aframe-master.js.map 2.9 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463
  1. {
  2. "version": 3,
  3. "sources": [
  4. "node_modules/browser-pack/_prelude.js",
  5. "node_modules/an-array/index.js",
  6. "node_modules/as-number/index.js",
  7. "node_modules/base64-js/index.js",
  8. "node_modules/browserify-css/browser.js",
  9. "node_modules/buffer-equal/index.js",
  10. "node_modules/buffer/index.js",
  11. "node_modules/custom-event-polyfill/polyfill.js",
  12. "node_modules/debug/browser.js",
  13. "node_modules/debug/debug.js",
  14. "node_modules/deep-assign/index.js",
  15. "node_modules/define-properties/index.js",
  16. "node_modules/document-register-element/build/document-register-element.js",
  17. "node_modules/dtype/index.js",
  18. "node_modules/es-abstract/GetIntrinsic.js",
  19. "node_modules/es-abstract/es5.js",
  20. "node_modules/es-abstract/helpers/assertRecord.js",
  21. "node_modules/es-abstract/helpers/isFinite.js",
  22. "node_modules/es-abstract/helpers/isNaN.js",
  23. "node_modules/es-abstract/helpers/mod.js",
  24. "node_modules/es-abstract/helpers/sign.js",
  25. "node_modules/es-to-primitive/es5.js",
  26. "node_modules/es-to-primitive/helpers/isPrimitive.js",
  27. "node_modules/flatten-vertex-data/index.js",
  28. "node_modules/for-each/index.js",
  29. "node_modules/function-bind/implementation.js",
  30. "node_modules/function-bind/index.js",
  31. "node_modules/global/window.js",
  32. "node_modules/has/src/index.js",
  33. "node_modules/ieee754/index.js",
  34. "node_modules/inherits/inherits_browser.js",
  35. "node_modules/is-buffer/index.js",
  36. "node_modules/is-callable/index.js",
  37. "node_modules/is-function/index.js",
  38. "node_modules/is-obj/index.js",
  39. "node_modules/isarray/index.js",
  40. "node_modules/layout-bmfont-text/index.js",
  41. "node_modules/load-bmfont/browser.js",
  42. "node_modules/load-bmfont/lib/is-binary.js",
  43. "node_modules/object-assign/index.js",
  44. "node_modules/object-keys/implementation.js",
  45. "node_modules/object-keys/index.js",
  46. "node_modules/object-keys/isArguments.js",
  47. "node_modules/parse-bmfont-ascii/index.js",
  48. "node_modules/parse-bmfont-binary/index.js",
  49. "node_modules/parse-bmfont-xml/lib/browser.js",
  50. "node_modules/parse-bmfont-xml/lib/parse-attribs.js",
  51. "node_modules/parse-headers/parse-headers.js",
  52. "node_modules/present/lib/present-browser.js",
  53. "node_modules/process/browser.js",
  54. "node_modules/promise-polyfill/Promise.js",
  55. "node_modules/quad-indices/index.js",
  56. "node_modules/string.prototype.trim/implementation.js",
  57. "node_modules/string.prototype.trim/index.js",
  58. "node_modules/string.prototype.trim/polyfill.js",
  59. "node_modules/string.prototype.trim/shim.js",
  60. "node_modules/super-animejs/lib/anime.js",
  61. "node_modules/super-three/build/three.js",
  62. "node_modules/super-three/examples/js/lights/LightProbeGenerator.js",
  63. "node_modules/super-three/examples/js/loaders/DRACOLoader.js",
  64. "node_modules/super-three/examples/js/loaders/GLTFLoader.js",
  65. "node_modules/super-three/examples/js/loaders/MTLLoader.js",
  66. "node_modules/super-three/examples/js/loaders/OBJLoader.js",
  67. "node_modules/super-three/examples/js/utils/BufferGeometryUtils.js",
  68. "node_modules/three-bmfont-text/index.js",
  69. "node_modules/three-bmfont-text/lib/utils.js",
  70. "node_modules/three-bmfont-text/lib/vertices.js",
  71. "node_modules/three-buffer-vertex-data/index.js",
  72. "node_modules/timers-browserify/main.js",
  73. "node_modules/webvr-polyfill/build/webvr-polyfill.js",
  74. "node_modules/word-wrapper/index.js",
  75. "node_modules/xhr/index.js",
  76. "node_modules/xml-parse-from-string/index.js",
  77. "node_modules/xtend/immutable.js",
  78. "package.json",
  79. "src/components/animation.js",
  80. "src/components/camera.js",
  81. "src/components/cursor.js",
  82. "src/components/daydream-controls.js",
  83. "src/components/gearvr-controls.js",
  84. "src/components/generic-tracked-controller-controls.js",
  85. "src/components/geometry.js",
  86. "src/components/gltf-model.js",
  87. "src/components/hand-controls.js",
  88. "src/components/hand-tracking-controls.js",
  89. "src/components/hide-on-enter-ar.js",
  90. "src/components/hp-mixed-reality-controls.js",
  91. "src/components/index.js",
  92. "src/components/laser-controls.js",
  93. "src/components/layer.js",
  94. "src/components/light.js",
  95. "src/components/line.js",
  96. "src/components/link.js",
  97. "src/components/look-controls.js",
  98. "src/components/magicleap-controls.js",
  99. "src/components/material.js",
  100. "src/components/obj-model.js",
  101. "src/components/oculus-go-controls.js",
  102. "src/components/oculus-touch-controls.js",
  103. "src/components/position.js",
  104. "src/components/raycaster.js",
  105. "src/components/rotation.js",
  106. "src/components/scale.js",
  107. "src/components/scene/ar-hit-test.js",
  108. "src/components/scene/background.js",
  109. "src/components/scene/debug.js",
  110. "src/components/scene/device-orientation-permission-ui.js",
  111. "src/components/scene/embedded.js",
  112. "src/components/scene/fog.js",
  113. "src/components/scene/inspector.js",
  114. "src/components/scene/keyboard-shortcuts.js",
  115. "src/components/scene/pool.js",
  116. "src/components/scene/screenshot.js",
  117. "src/components/scene/stats.js",
  118. "src/components/scene/vr-mode-ui.js",
  119. "src/components/shadow.js",
  120. "src/components/sound.js",
  121. "src/components/text.js",
  122. "src/components/tracked-controls-webvr.js",
  123. "src/components/tracked-controls-webxr.js",
  124. "src/components/tracked-controls.js",
  125. "src/components/valve-index-controls.js",
  126. "src/components/visible.js",
  127. "src/components/vive-controls.js",
  128. "src/components/vive-focus-controls.js",
  129. "src/components/wasd-controls.js",
  130. "src/components/windows-motion-controls.js",
  131. "src/constants/index.js",
  132. "src/constants/keyboardevent.js",
  133. "src/core/a-assets.js",
  134. "src/core/a-cubemap.js",
  135. "src/core/a-entity.js",
  136. "src/core/a-mixin.js",
  137. "src/core/a-node.js",
  138. "src/core/a-register-element.js",
  139. "src/core/component.js",
  140. "src/core/geometry.js",
  141. "src/core/propertyTypes.js",
  142. "src/core/scene/a-scene.js",
  143. "src/core/scene/loadingScreen.js",
  144. "src/core/scene/metaTags.js",
  145. "src/core/scene/postMessage.js",
  146. "src/core/scene/scenes.js",
  147. "src/core/scene/wakelock.js",
  148. "src/core/schema.js",
  149. "src/core/shader.js",
  150. "src/core/system.js",
  151. "src/extras/components/index.js",
  152. "src/extras/components/pivot.js",
  153. "src/extras/primitives/getMeshMixin.js",
  154. "src/extras/primitives/index.js",
  155. "src/extras/primitives/primitives.js",
  156. "src/extras/primitives/primitives/a-camera.js",
  157. "src/extras/primitives/primitives/a-cursor.js",
  158. "src/extras/primitives/primitives/a-curvedimage.js",
  159. "src/extras/primitives/primitives/a-gltf-model.js",
  160. "src/extras/primitives/primitives/a-image.js",
  161. "src/extras/primitives/primitives/a-light.js",
  162. "src/extras/primitives/primitives/a-link.js",
  163. "src/extras/primitives/primitives/a-obj-model.js",
  164. "src/extras/primitives/primitives/a-sky.js",
  165. "src/extras/primitives/primitives/a-sound.js",
  166. "src/extras/primitives/primitives/a-text.js",
  167. "src/extras/primitives/primitives/a-video.js",
  168. "src/extras/primitives/primitives/a-videosphere.js",
  169. "src/extras/primitives/primitives/meshPrimitives.js",
  170. "src/geometries/box.js",
  171. "src/geometries/circle.js",
  172. "src/geometries/cone.js",
  173. "src/geometries/cylinder.js",
  174. "src/geometries/dodecahedron.js",
  175. "src/geometries/icosahedron.js",
  176. "src/geometries/index.js",
  177. "src/geometries/octahedron.js",
  178. "src/geometries/plane.js",
  179. "src/geometries/ring.js",
  180. "src/geometries/sphere.js",
  181. "src/geometries/tetrahedron.js",
  182. "src/geometries/torus.js",
  183. "src/geometries/torusKnot.js",
  184. "src/geometries/triangle.js",
  185. "src/index.js",
  186. "src/lib/rStatsAframe.js",
  187. "src/lib/three.js",
  188. "src/shaders/flat.js",
  189. "src/shaders/index.js",
  190. "src/shaders/ios10hls.js",
  191. "src/shaders/msdf.js",
  192. "src/shaders/sdf.js",
  193. "src/shaders/shadow.js",
  194. "src/shaders/standard.js",
  195. "src/style/aframe.css",
  196. "src/style/rStats.css",
  197. "src/systems/camera.js",
  198. "src/systems/geometry.js",
  199. "src/systems/gltf-model.js",
  200. "src/systems/index.js",
  201. "src/systems/light.js",
  202. "src/systems/material.js",
  203. "src/systems/renderer.js",
  204. "src/systems/shadow.js",
  205. "src/systems/tracked-controls-webvr.js",
  206. "src/systems/tracked-controls-webxr.js",
  207. "src/systems/webxr.js",
  208. "src/utils/bind.js",
  209. "src/utils/coordinates.js",
  210. "src/utils/debug.js",
  211. "src/utils/device.js",
  212. "src/utils/entity.js",
  213. "src/utils/forceCanvasResizeSafariMobile.js",
  214. "src/utils/index.js",
  215. "src/utils/ios-orientationchange-blank-bug.js",
  216. "src/utils/is-ie11.js",
  217. "src/utils/isIOSOlderThan10.js",
  218. "src/utils/material.js",
  219. "src/utils/object-pool.js",
  220. "src/utils/split.js",
  221. "src/utils/src-loader.js",
  222. "src/utils/styleParser.js",
  223. "src/utils/tracked-controls.js",
  224. "vendor/DeviceOrientationControls.js",
  225. "vendor/rStats.extras.js",
  226. "vendor/rStats.js",
  227. "vendor/starts-with-polyfill.js",
  228. "vendor/wakelock/util.js",
  229. "vendor/wakelock/wakelock.js"
  230. ],
  231. "names": [],
  232. "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACXA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC7vDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3OA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjDA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACbA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC1SA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;ACjGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC/BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzzCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACl9nCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3jBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnzHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9eA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACl0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC3EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACp7GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3aA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACraA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtWA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/eA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjOA;AACA;AACA;AACA;AACA;AACA;;ACLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACnHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACleA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/UA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACZA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpeA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACp6BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/5BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/BA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5JA;AACA;;ACDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5HA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9LA;;ACAA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/QA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACVA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrXA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AC9GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AC5FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AC5LA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACbA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACfA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnQA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrcA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA",
  233. "file": "generated.js",
  234. "sourceRoot": "",
  235. "sourcesContent": [
  236. "(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c=\"function\"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error(\"Cannot find module '\"+i+\"'\");throw a.code=\"MODULE_NOT_FOUND\",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u=\"function\"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()",
  237. "var str = Object.prototype.toString\n\nmodule.exports = anArray\n\nfunction anArray(arr) {\n return (\n arr.BYTES_PER_ELEMENT\n && str.call(arr.buffer) === '[object ArrayBuffer]'\n || Array.isArray(arr)\n )\n}\n",
  238. "module.exports = function numtype(num, def) {\n\treturn typeof num === 'number'\n\t\t? num \n\t\t: (typeof def === 'number' ? def : 0)\n}",
  239. "'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n for (var i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(\n uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)\n ))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n",
  240. "'use strict';\n// For more information about browser field, check out the browser field at https://github.com/substack/browserify-handbook#browser-field.\n\nmodule.exports = {\n // Create a <link> tag with optional data attributes\n createLink: function(href, attributes) {\n var head = document.head || document.getElementsByTagName('head')[0];\n var link = document.createElement('link');\n\n link.href = href;\n link.rel = 'stylesheet';\n\n for (var key in attributes) {\n if ( ! attributes.hasOwnProperty(key)) {\n continue;\n }\n var value = attributes[key];\n link.setAttribute('data-' + key, value);\n }\n\n head.appendChild(link);\n },\n // Create a <style> tag with optional data attributes\n createStyle: function(cssText, attributes) {\n var head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('style');\n\n style.type = 'text/css';\n\n for (var key in attributes) {\n if ( ! attributes.hasOwnProperty(key)) {\n continue;\n }\n var value = attributes[key];\n style.setAttribute('data-' + key, value);\n }\n \n if (style.sheet) { // for jsdom and IE9+\n style.innerHTML = cssText;\n style.sheet.cssText = cssText;\n head.appendChild(style);\n } else if (style.styleSheet) { // for IE8 and below\n head.appendChild(style);\n style.styleSheet.cssText = cssText;\n } else { // for Chrome, Firefox, and Safari\n style.appendChild(document.createTextNode(cssText));\n head.appendChild(style);\n }\n }\n};\n",
  241. "var Buffer = require('buffer').Buffer; // for use with browserify\n\nmodule.exports = function (a, b) {\n if (!Buffer.isBuffer(a)) return undefined;\n if (!Buffer.isBuffer(b)) return undefined;\n if (typeof a.equals === 'function') return a.equals(b);\n if (a.length !== b.length) return false;\n \n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n \n return true;\n};\n",
  242. "/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>\n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return '<Buffer ' + str + '>'\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n",
  243. "// Polyfill for creating CustomEvents on IE9/10/11\n\n// code pulled from:\n// https://github.com/d4tocchini/customevent-polyfill\n// https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent#Polyfill\n\n(function() {\n if (typeof window === 'undefined') {\n return;\n }\n\n try {\n var ce = new window.CustomEvent('test', { cancelable: true });\n ce.preventDefault();\n if (ce.defaultPrevented !== true) {\n // IE has problems with .preventDefault() on custom events\n // http://stackoverflow.com/questions/23349191\n throw new Error('Could not prevent default');\n }\n } catch (e) {\n var CustomEvent = function(event, params) {\n var evt, origPrevent;\n params = params || {};\n params.bubbles = !!params.bubbles;\n params.cancelable = !!params.cancelable;\n\n evt = document.createEvent('CustomEvent');\n evt.initCustomEvent(\n event,\n params.bubbles,\n params.cancelable,\n params.detail\n );\n origPrevent = evt.preventDefault;\n evt.preventDefault = function() {\n origPrevent.call(this);\n try {\n Object.defineProperty(this, 'defaultPrevented', {\n get: function() {\n return true;\n }\n });\n } catch (e) {\n this.defaultPrevented = true;\n }\n };\n return evt;\n };\n\n CustomEvent.prototype = window.Event.prototype;\n window.CustomEvent = CustomEvent; // expose definition to window\n }\n})();\n",
  244. "\n/**\n * This is the web browser implementation of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = require('./debug');\nexports.log = log;\nexports.formatArgs = formatArgs;\nexports.save = save;\nexports.load = load;\nexports.useColors = useColors;\nexports.storage = 'undefined' != typeof chrome\n && 'undefined' != typeof chrome.storage\n ? chrome.storage.local\n : localstorage();\n\n/**\n * Colors.\n */\n\nexports.colors = [\n 'lightseagreen',\n 'forestgreen',\n 'goldenrod',\n 'dodgerblue',\n 'darkorchid',\n 'crimson'\n];\n\n/**\n * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n * and the Firebug extension (any Firefox version) are known\n * to support \"%c\" CSS customizations.\n *\n * TODO: add a `localStorage` variable to explicitly enable/disable colors\n */\n\nfunction useColors() {\n // is webkit? http://stackoverflow.com/a/16459606/376773\n return ('WebkitAppearance' in document.documentElement.style) ||\n // is firebug? http://stackoverflow.com/a/398120/376773\n (window.console && (console.firebug || (console.exception && console.table))) ||\n // is firefox >= v31?\n // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n}\n\n/**\n * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n */\n\nexports.formatters.j = function(v) {\n return JSON.stringify(v);\n};\n\n\n/**\n * Colorize log arguments if enabled.\n *\n * @api public\n */\n\nfunction formatArgs() {\n var args = arguments;\n var useColors = this.useColors;\n\n args[0] = (useColors ? '%c' : '')\n + this.namespace\n + (useColors ? ' %c' : ' ')\n + args[0]\n + (useColors ? '%c ' : ' ');\n\n if (!useColors) return args;\n\n var c = 'color: ' + this.color;\n args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\n // the final \"%c\" is somewhat tricky, because there could be other\n // arguments passed either before or after the %c, so we need to\n // figure out the correct index to insert the CSS into\n var index = 0;\n var lastC = 0;\n args[0].replace(/%[a-z%]/g, function(match) {\n if ('%%' === match) return;\n index++;\n if ('%c' === match) {\n // we only are interested in the *last* %c\n // (the user may have provided their own)\n lastC = index;\n }\n });\n\n args.splice(lastC, 0, c);\n return args;\n}\n\n/**\n * Invokes `console.log()` when available.\n * No-op when `console.log` is not a \"function\".\n *\n * @api public\n */\n\nfunction log() {\n // this hackery is required for IE8/9, where\n // the `console.log` function doesn't have 'apply'\n return 'object' === typeof console\n && console.log\n && Function.prototype.apply.call(console.log, console, arguments);\n}\n\n/**\n * Save `namespaces`.\n *\n * @param {String} namespaces\n * @api private\n */\n\nfunction save(namespaces) {\n try {\n if (null == namespaces) {\n exports.storage.removeItem('debug');\n } else {\n exports.storage.debug = namespaces;\n }\n } catch(e) {}\n}\n\n/**\n * Load `namespaces`.\n *\n * @return {String} returns the previously persisted debug modes\n * @api private\n */\n\nfunction load() {\n var r;\n try {\n r = exports.storage.debug;\n } catch(e) {}\n return r;\n}\n\n/**\n * Enable namespaces listed in `localStorage.debug` initially.\n */\n\nexports.enable(load());\n\n/**\n * Localstorage attempts to return the localstorage.\n *\n * This is necessary because safari throws\n * when a user disables cookies/localstorage\n * and you attempt to access it.\n *\n * @return {LocalStorage}\n * @api private\n */\n\nfunction localstorage(){\n try {\n return window.localStorage;\n } catch (e) {}\n}\n",
  245. "\n/**\n * This is the common logic for both the Node.js and web browser\n * implementations of `debug()`.\n *\n * Expose `debug()` as the module.\n */\n\nexports = module.exports = debug;\nexports.coerce = coerce;\nexports.disable = disable;\nexports.enable = enable;\nexports.enabled = enabled;\n\n/**\n * The currently active debug mode names, and names to skip.\n */\n\nexports.names = [];\nexports.skips = [];\n\n/**\n * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n *\n * Valid key names are a single, lowercased letter, i.e. \"n\".\n */\n\nexports.formatters = {};\n\n/**\n * Previously assigned color.\n */\n\nvar prevColor = 0;\n\n/**\n * Select a color.\n *\n * @return {Number}\n * @api private\n */\n\nfunction selectColor() {\n return exports.colors[prevColor++ % exports.colors.length];\n}\n\n/**\n * Create a debugger with the given `namespace`.\n *\n * @param {String} namespace\n * @return {Function}\n * @api public\n */\n\nfunction debug(namespace) {\n\n // define the `disabled` version\n function disabled() {\n }\n disabled.enabled = false;\n\n // define the `enabled` version\n function enabled() {\n\n var self = enabled;\n\n // add the `color` if not set\n if (null == self.useColors) self.useColors = exports.useColors();\n if (null == self.color && self.useColors) self.color = selectColor();\n\n var args = Array.prototype.slice.call(arguments);\n\n args[0] = exports.coerce(args[0]);\n\n if ('string' !== typeof args[0]) {\n // anything else let's inspect with %o\n args = ['%o'].concat(args);\n }\n\n // apply any `formatters` transformations\n var index = 0;\n args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n // if we encounter an escaped % then don't increase the array index\n if (match === '%%') return match;\n index++;\n var formatter = exports.formatters[format];\n if ('function' === typeof formatter) {\n var val = args[index];\n match = formatter.call(self, val);\n\n // now we need to remove `args[index]` since it's inlined in the `format`\n args.splice(index, 1);\n index--;\n }\n return match;\n });\n\n if ('function' === typeof exports.formatArgs) {\n args = exports.formatArgs.apply(self, args);\n }\n var logFn = enabled.log || exports.log || console.log.bind(console);\n logFn.apply(self, args);\n }\n enabled.enabled = true;\n\n var fn = exports.enabled(namespace) ? enabled : disabled;\n\n fn.namespace = namespace;\n\n return fn;\n}\n\n/**\n * Enables a debug mode by namespaces. This can include modes\n * separated by a colon and wildcards.\n *\n * @param {String} namespaces\n * @api public\n */\n\nfunction enable(namespaces) {\n exports.save(namespaces);\n\n var split = (namespaces || '').split(/[\\s,]+/);\n var len = split.length;\n\n for (var i = 0; i < len; i++) {\n if (!split[i]) continue; // ignore empty strings\n namespaces = split[i].replace(/\\*/g, '.*?');\n if (namespaces[0] === '-') {\n exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n } else {\n exports.names.push(new RegExp('^' + namespaces + '$'));\n }\n }\n}\n\n/**\n * Disable debug output.\n *\n * @api public\n */\n\nfunction disable() {\n exports.enable('');\n}\n\n/**\n * Returns true if the given mode name is enabled, false otherwise.\n *\n * @param {String} name\n * @return {Boolean}\n * @api public\n */\n\nfunction enabled(name) {\n var i, len;\n for (i = 0, len = exports.skips.length; i < len; i++) {\n if (exports.skips[i].test(name)) {\n return false;\n }\n }\n for (i = 0, len = exports.names.length; i < len; i++) {\n if (exports.names[i].test(name)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Coerce `val`.\n *\n * @param {Mixed} val\n * @return {Mixed}\n * @api private\n */\n\nfunction coerce(val) {\n if (val instanceof Error) return val.stack || val.message;\n return val;\n}\n",
  246. "'use strict';\nvar isObj = require('is-obj');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Sources cannot be null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction assignKey(to, from, key) {\n\tvar val = from[key];\n\n\tif (val === undefined || val === null) {\n\t\treturn;\n\t}\n\n\tif (hasOwnProperty.call(to, key)) {\n\t\tif (to[key] === undefined || to[key] === null) {\n\t\t\tthrow new TypeError('Cannot convert undefined or null to object (' + key + ')');\n\t\t}\n\t}\n\n\tif (!hasOwnProperty.call(to, key) || !isObj(val)) {\n\t\tto[key] = val;\n\t} else {\n\t\tto[key] = assign(Object(to[key]), from[key]);\n\t}\n}\n\nfunction assign(to, from) {\n\tif (to === from) {\n\t\treturn to;\n\t}\n\n\tfrom = Object(from);\n\n\tfor (var key in from) {\n\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\tassignKey(to, from, key);\n\t\t}\n\t}\n\n\tif (Object.getOwnPropertySymbols) {\n\t\tvar symbols = Object.getOwnPropertySymbols(from);\n\n\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\tassignKey(to, from, symbols[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n}\n\nmodule.exports = function deepAssign(target) {\n\ttarget = toObject(target);\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tassign(target, arguments[s]);\n\t}\n\n\treturn target;\n};\n",
  247. "'use strict';\n\nvar keys = require('object-keys');\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';\n\nvar toStr = Object.prototype.toString;\nvar concat = Array.prototype.concat;\nvar origDefineProperty = Object.defineProperty;\n\nvar isFunction = function (fn) {\n\treturn typeof fn === 'function' && toStr.call(fn) === '[object Function]';\n};\n\nvar arePropertyDescriptorsSupported = function () {\n\tvar obj = {};\n\ttry {\n\t\torigDefineProperty(obj, 'x', { enumerable: false, value: obj });\n\t\t// eslint-disable-next-line no-unused-vars, no-restricted-syntax\n\t\tfor (var _ in obj) { // jscs:ignore disallowUnusedVariables\n\t\t\treturn false;\n\t\t}\n\t\treturn obj.x === obj;\n\t} catch (e) { /* this is IE 8. */\n\t\treturn false;\n\t}\n};\nvar supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();\n\nvar defineProperty = function (object, name, value, predicate) {\n\tif (name in object && (!isFunction(predicate) || !predicate())) {\n\t\treturn;\n\t}\n\tif (supportsDescriptors) {\n\t\torigDefineProperty(object, name, {\n\t\t\tconfigurable: true,\n\t\t\tenumerable: false,\n\t\t\tvalue: value,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\tobject[name] = value;\n\t}\n};\n\nvar defineProperties = function (object, map) {\n\tvar predicates = arguments.length > 2 ? arguments[2] : {};\n\tvar props = keys(map);\n\tif (hasSymbols) {\n\t\tprops = concat.call(props, Object.getOwnPropertySymbols(map));\n\t}\n\tfor (var i = 0; i < props.length; i += 1) {\n\t\tdefineProperty(object, props[i], map[props[i]], predicates[props[i]]);\n\t}\n};\n\ndefineProperties.supportsDescriptors = !!supportsDescriptors;\n\nmodule.exports = defineProperties;\n",
  248. "/*! (C) WebReflection Mit Style License */\n(function(t,n,r,i){\"use strict\";function st(e,t){for(var n=0,r=e.length;n<r;n++)gt(e[n],t)}function ot(e){for(var t=0,n=e.length,r;t<n;t++)r=e[t],it(r,w[at(r)])}function ut(e){return function(t){F(t)&&(gt(t,e),st(t.querySelectorAll(E),e))}}function at(e){var t=R.call(e,\"is\"),n=e.nodeName.toUpperCase(),r=x.call(b,t?m+t.toUpperCase():v+n);return t&&-1<r&&!ft(n,t)?-1:r}function ft(e,t){return-1<E.indexOf(e+'[is=\"'+t+'\"]')}function lt(e){var t=e.currentTarget,n=e.attrChange,r=e.attrName,i=e.target;Y&&(!i||i===t)&&t.attributeChangedCallback&&r!==\"style\"&&e.prevValue!==e.newValue&&t.attributeChangedCallback(r,n===e[f]?null:e.prevValue,n===e[c]?null:e.newValue)}function ct(e){var t=ut(e);return function(e){$.push(t,e.target)}}function ht(e){G&&(G=!1,e.currentTarget.removeEventListener(p,ht)),st((e.target||n).querySelectorAll(E),e.detail===u?u:o),j&&vt()}function pt(e,t){var n=this;U.call(n,e,t),Z.call(n,{target:n})}function dt(e,t){P(e,t),nt?nt.observe(e,X):(Q&&(e.setAttribute=pt,e[s]=tt(e),e.addEventListener(d,Z)),e.addEventListener(h,lt)),e.createdCallback&&Y&&(e.created=!0,e.createdCallback(),e.created=!1)}function vt(){for(var e,t=0,n=I.length;t<n;t++)e=I[t],S.contains(e)||(n--,I.splice(t--,1),gt(e,u))}function mt(e){throw new Error(\"A \"+e+\" type is already registered\")}function gt(e,t){var n,r=at(e);-1<r&&(rt(e,w[r]),r=0,t===o&&!e[o]?(e[u]=!1,e[o]=!0,r=1,j&&x.call(I,e)<0&&I.push(e)):t===u&&!e[u]&&(e[o]=!1,e[u]=!0,r=1),r&&(n=e[t+\"Callback\"])&&n.call(e))}if(i in n)return;var s=\"__\"+i+(Math.random()*1e5>>0),o=\"attached\",u=\"detached\",a=\"extends\",f=\"ADDITION\",l=\"MODIFICATION\",c=\"REMOVAL\",h=\"DOMAttrModified\",p=\"DOMContentLoaded\",d=\"DOMSubtreeModified\",v=\"<\",m=\"=\",g=/^[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+$/,y=[\"ANNOTATION-XML\",\"COLOR-PROFILE\",\"FONT-FACE\",\"FONT-FACE-SRC\",\"FONT-FACE-URI\",\"FONT-FACE-FORMAT\",\"FONT-FACE-NAME\",\"MISSING-GLYPH\"],b=[],w=[],E=\"\",S=n.documentElement,x=b.indexOf||function(e){for(var t=this.length;t--&&this[t]!==e;);return t},T=r.prototype,N=T.hasOwnProperty,C=T.isPrototypeOf,k=r.defineProperty,L=r.getOwnPropertyDescriptor,A=r.getOwnPropertyNames,O=r.getPrototypeOf,M=r.setPrototypeOf,_=!!r.__proto__,D=r.create||function yt(e){return e?(yt.prototype=e,new yt):this},P=M||(_?function(e,t){return e.__proto__=t,e}:A&&L?function(){function e(e,t){for(var n,r=A(t),i=0,s=r.length;i<s;i++)n=r[i],N.call(e,n)||k(e,n,L(t,n))}return function(t,n){do e(t,n);while((n=O(n))&&!C.call(n,t));return t}}():function(e,t){for(var n in t)e[n]=t[n];return e}),H=t.MutationObserver||t.WebKitMutationObserver,B=(t.HTMLElement||t.Element||t.Node).prototype,j=!C.call(B,S),F=j?function(e){return e.nodeType===1}:function(e){return C.call(B,e)},I=j&&[],q=B.cloneNode,R=B.getAttribute,U=B.setAttribute,z=B.removeAttribute,W=n.createElement,X=H&&{attributes:!0,characterData:!0,attributeOldValue:!0},V=H||function(e){Q=!1,S.removeEventListener(h,V)},$,J=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.msRequestAnimationFrame||function(e){setTimeout(e,10)},K=!1,Q=!0,G=!0,Y=!0,Z,et,tt,nt,rt,it;M||_?(rt=function(e,t){C.call(t,e)||dt(e,t)},it=dt):(rt=function(e,t){e[s]||(e[s]=r(!0),dt(e,t))},it=rt),j?(Q=!1,function(){var t=L(B,\"addEventListener\"),n=t.value,r=function(e){var t=new CustomEvent(h,{bubbles:!0});t.attrName=e,t.prevValue=R.call(this,e),t.newValue=null,t[c]=t.attrChange=2,z.call(this,e),this.dispatchEvent(t)},i=function(t,n){var r=this.hasAttribute(t),i=r&&R.call(this,t);e=new CustomEvent(h,{bubbles:!0}),U.call(this,t,n),e.attrName=t,e.prevValue=r?i:null,e.newValue=n,r?e[l]=e.attrChange=1:e[f]=e.attrChange=0,this.dispatchEvent(e)},o=function(e){var t=e.currentTarget,n=t[s],r=e.propertyName,i;n.hasOwnProperty(r)&&(n=n[r],i=new CustomEvent(h,{bubbles:!0}),i.attrName=n.name,i.prevValue=n.value||null,i.newValue=n.value=t[r]||null,i.prevValue==null?i[f]=i.attrChange=0:i[l]=i.attrChange=1,t.dispatchEvent(i))};t.value=function(e,t,u){e===h&&this.attributeChangedCallback&&this.setAttribute!==i&&(this[s]={className:{name:\"class\",value:this.className}},this.setAttribute=i,this.removeAttribute=r,n.call(this,\"propertychange\",o)),n.call(this,e,t,u)},k(B,\"addEventListener\",t)}()):H||(S.addEventListener(h,V),S.setAttribute(s,1),S.removeAttribute(s),Q&&(Z=function(e){var t=this,n,r,i;if(t===e.target){n=t[s],t[s]=r=tt(t);for(i in r){if(!(i in n))return et(0,t,i,n[i],r[i],f);if(r[i]!==n[i])return et(1,t,i,n[i],r[i],l)}for(i in n)if(!(i in r))return et(2,t,i,n[i],r[i],c)}},et=function(e,t,n,r,i,s){var o={attrChange:e,currentTarget:t,attrName:n,prevValue:r,newValue:i};o[s]=e,lt(o)},tt=function(e){for(var t,n,r={},i=e.attributes,s=0,o=i.length;s<o;s++)t=i[s],n=t.name,n!==\"setAttribute\"&&(r[n]=t.value);return r})),n[i]=function(t,r){c=t.toUpperCase(),K||(K=!0,H?(nt=function(e,t){function n(e,t){for(var n=0,r=e.length;n<r;t(e[n++]));}return new H(function(r){for(var i,s,o,u=0,a=r.length;u<a;u++)i=r[u],i.type===\"childList\"?(n(i.addedNodes,e),n(i.removedNodes,t)):(s=i.target,Y&&s.attributeChangedCallback&&i.attributeName!==\"style\"&&(o=R.call(s,i.attributeName),o!==i.oldValue&&s.attributeChangedCallback(i.attributeName,i.oldValue,o)))})}(ut(o),ut(u)),nt.observe(n,{childList:!0,subtree:!0})):($=[],J(function d(){while($.length)$.shift().call(null,$.shift());J(d)}),n.addEventListener(\"DOMNodeInserted\",ct(o)),n.addEventListener(\"DOMNodeRemoved\",ct(u))),n.addEventListener(p,ht),n.addEventListener(\"readystatechange\",ht),n.createElement=function(e,t){var r=W.apply(n,arguments),i=\"\"+e,s=x.call(b,(t?m:v)+(t||i).toUpperCase()),o=-1<s;return t&&(r.setAttribute(\"is\",t=t.toLowerCase()),o&&(o=ft(i.toUpperCase(),t))),Y=!n.createElement.innerHTMLHelper,o&&it(r,w[s]),r},B.cloneNode=function(e){var t=q.call(this,!!e),n=at(t);return-1<n&&it(t,w[n]),e&&ot(t.querySelectorAll(E)),t}),-2<x.call(b,m+c)+x.call(b,v+c)&&mt(t);if(!g.test(c)||-1<x.call(y,c))throw new Error(\"The type \"+t+\" is invalid\");var i=function(){return f?n.createElement(l,c):n.createElement(l)},s=r||T,f=N.call(s,a),l=f?r[a].toUpperCase():c,c,h;return f&&-1<x.call(b,v+l)&&mt(l),h=b.push((f?m:v)+c)-1,E=E.concat(E.length?\",\":\"\",f?l+'[is=\"'+t.toLowerCase()+'\"]':l),i.prototype=w[h]=N.call(s,\"prototype\")?s.prototype:D(B),st(n.querySelectorAll(E),o),i}})(window,document,Object,\"registerElement\");",
  249. "module.exports = function(dtype) {\n switch (dtype) {\n case 'int8':\n return Int8Array\n case 'int16':\n return Int16Array\n case 'int32':\n return Int32Array\n case 'uint8':\n return Uint8Array\n case 'uint16':\n return Uint16Array\n case 'uint32':\n return Uint32Array\n case 'float32':\n return Float32Array\n case 'float64':\n return Float64Array\n case 'array':\n return Array\n case 'uint8_clamped':\n return Uint8ClampedArray\n }\n}\n",
  250. "'use strict';\n\n/* globals\n\tSet,\n\tMap,\n\tWeakSet,\n\tWeakMap,\n\n\tPromise,\n\n\tSymbol,\n\tProxy,\n\n\tAtomics,\n\tSharedArrayBuffer,\n\n\tArrayBuffer,\n\tDataView,\n\tUint8Array,\n\tFloat32Array,\n\tFloat64Array,\n\tInt8Array,\n\tInt16Array,\n\tInt32Array,\n\tUint8ClampedArray,\n\tUint16Array,\n\tUint32Array,\n*/\n\nvar undefined; // eslint-disable-line no-shadow-restricted-names\n\nvar ThrowTypeError = Object.getOwnPropertyDescriptor\n\t? (function () { return Object.getOwnPropertyDescriptor(arguments, 'callee').get; }())\n\t: function () { throw new TypeError(); };\n\nvar hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';\n\nvar getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto\n\nvar generator; // = function * () {};\nvar generatorFunction = generator ? getProto(generator) : undefined;\nvar asyncFn; // async function() {};\nvar asyncFunction = asyncFn ? asyncFn.constructor : undefined;\nvar asyncGen; // async function * () {};\nvar asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;\nvar asyncGenIterator = asyncGen ? asyncGen() : undefined;\n\nvar TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t'$ %Array%': Array,\n\t'$ %ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'$ %ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,\n\t'$ %ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,\n\t'$ %ArrayPrototype%': Array.prototype,\n\t'$ %ArrayProto_entries%': Array.prototype.entries,\n\t'$ %ArrayProto_forEach%': Array.prototype.forEach,\n\t'$ %ArrayProto_keys%': Array.prototype.keys,\n\t'$ %ArrayProto_values%': Array.prototype.values,\n\t'$ %AsyncFromSyncIteratorPrototype%': undefined,\n\t'$ %AsyncFunction%': asyncFunction,\n\t'$ %AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,\n\t'$ %AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,\n\t'$ %AsyncGeneratorFunction%': asyncGenFunction,\n\t'$ %AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,\n\t'$ %AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,\n\t'$ %Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'$ %Boolean%': Boolean,\n\t'$ %BooleanPrototype%': Boolean.prototype,\n\t'$ %DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'$ %DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,\n\t'$ %Date%': Date,\n\t'$ %DatePrototype%': Date.prototype,\n\t'$ %decodeURI%': decodeURI,\n\t'$ %decodeURIComponent%': decodeURIComponent,\n\t'$ %encodeURI%': encodeURI,\n\t'$ %encodeURIComponent%': encodeURIComponent,\n\t'$ %Error%': Error,\n\t'$ %ErrorPrototype%': Error.prototype,\n\t'$ %eval%': eval, // eslint-disable-line no-eval\n\t'$ %EvalError%': EvalError,\n\t'$ %EvalErrorPrototype%': EvalError.prototype,\n\t'$ %Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'$ %Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,\n\t'$ %Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'$ %Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,\n\t'$ %Function%': Function,\n\t'$ %FunctionPrototype%': Function.prototype,\n\t'$ %Generator%': generator ? getProto(generator()) : undefined,\n\t'$ %GeneratorFunction%': generatorFunction,\n\t'$ %GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,\n\t'$ %Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'$ %Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,\n\t'$ %Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'$ %Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,\n\t'$ %Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'$ %Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,\n\t'$ %isFinite%': isFinite,\n\t'$ %isNaN%': isNaN,\n\t'$ %IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'$ %JSON%': JSON,\n\t'$ %JSONParse%': JSON.parse,\n\t'$ %Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'$ %MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'$ %MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,\n\t'$ %Math%': Math,\n\t'$ %Number%': Number,\n\t'$ %NumberPrototype%': Number.prototype,\n\t'$ %Object%': Object,\n\t'$ %ObjectPrototype%': Object.prototype,\n\t'$ %ObjProto_toString%': Object.prototype.toString,\n\t'$ %ObjProto_valueOf%': Object.prototype.valueOf,\n\t'$ %parseFloat%': parseFloat,\n\t'$ %parseInt%': parseInt,\n\t'$ %Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'$ %PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,\n\t'$ %PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,\n\t'$ %Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,\n\t'$ %Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,\n\t'$ %Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,\n\t'$ %Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'$ %RangeError%': RangeError,\n\t'$ %RangeErrorPrototype%': RangeError.prototype,\n\t'$ %ReferenceError%': ReferenceError,\n\t'$ %ReferenceErrorPrototype%': ReferenceError.prototype,\n\t'$ %Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'$ %RegExp%': RegExp,\n\t'$ %RegExpPrototype%': RegExp.prototype,\n\t'$ %Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'$ %SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'$ %SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,\n\t'$ %SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'$ %SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,\n\t'$ %String%': String,\n\t'$ %StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,\n\t'$ %StringPrototype%': String.prototype,\n\t'$ %Symbol%': hasSymbols ? Symbol : undefined,\n\t'$ %SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,\n\t'$ %SyntaxError%': SyntaxError,\n\t'$ %SyntaxErrorPrototype%': SyntaxError.prototype,\n\t'$ %ThrowTypeError%': ThrowTypeError,\n\t'$ %TypedArray%': TypedArray,\n\t'$ %TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,\n\t'$ %TypeError%': TypeError,\n\t'$ %TypeErrorPrototype%': TypeError.prototype,\n\t'$ %Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'$ %Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,\n\t'$ %Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'$ %Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,\n\t'$ %Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'$ %Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,\n\t'$ %Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'$ %Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,\n\t'$ %URIError%': URIError,\n\t'$ %URIErrorPrototype%': URIError.prototype,\n\t'$ %WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'$ %WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,\n\t'$ %WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,\n\t'$ %WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tvar key = '$ ' + name;\n\tif (!(key in INTRINSICS)) {\n\t\tthrow new SyntaxError('intrinsic ' + name + ' does not exist!');\n\t}\n\n\t// istanbul ignore if // hopefully this is impossible to test :-)\n\tif (typeof INTRINSICS[key] === 'undefined' && !allowMissing) {\n\t\tthrow new TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t}\n\treturn INTRINSICS[key];\n};\n",
  251. "'use strict';\n\nvar GetIntrinsic = require('./GetIntrinsic');\n\nvar $Object = GetIntrinsic('%Object%');\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $String = GetIntrinsic('%String%');\n\nvar assertRecord = require('./helpers/assertRecord');\nvar $isNaN = require('./helpers/isNaN');\nvar $isFinite = require('./helpers/isFinite');\n\nvar sign = require('./helpers/sign');\nvar mod = require('./helpers/mod');\n\nvar IsCallable = require('is-callable');\nvar toPrimitive = require('es-to-primitive/es5');\n\nvar has = require('has');\n\n// https://es5.github.io/#x9\nvar ES5 = {\n\tToPrimitive: toPrimitive,\n\n\tToBoolean: function ToBoolean(value) {\n\t\treturn !!value;\n\t},\n\tToNumber: function ToNumber(value) {\n\t\treturn +value; // eslint-disable-line no-implicit-coercion\n\t},\n\tToInteger: function ToInteger(value) {\n\t\tvar number = this.ToNumber(value);\n\t\tif ($isNaN(number)) { return 0; }\n\t\tif (number === 0 || !$isFinite(number)) { return number; }\n\t\treturn sign(number) * Math.floor(Math.abs(number));\n\t},\n\tToInt32: function ToInt32(x) {\n\t\treturn this.ToNumber(x) >> 0;\n\t},\n\tToUint32: function ToUint32(x) {\n\t\treturn this.ToNumber(x) >>> 0;\n\t},\n\tToUint16: function ToUint16(value) {\n\t\tvar number = this.ToNumber(value);\n\t\tif ($isNaN(number) || number === 0 || !$isFinite(number)) { return 0; }\n\t\tvar posInt = sign(number) * Math.floor(Math.abs(number));\n\t\treturn mod(posInt, 0x10000);\n\t},\n\tToString: function ToString(value) {\n\t\treturn $String(value);\n\t},\n\tToObject: function ToObject(value) {\n\t\tthis.CheckObjectCoercible(value);\n\t\treturn $Object(value);\n\t},\n\tCheckObjectCoercible: function CheckObjectCoercible(value, optMessage) {\n\t\t/* jshint eqnull:true */\n\t\tif (value == null) {\n\t\t\tthrow new $TypeError(optMessage || 'Cannot call method on ' + value);\n\t\t}\n\t\treturn value;\n\t},\n\tIsCallable: IsCallable,\n\tSameValue: function SameValue(x, y) {\n\t\tif (x === y) { // 0 === -0, but they are not identical.\n\t\t\tif (x === 0) { return 1 / x === 1 / y; }\n\t\t\treturn true;\n\t\t}\n\t\treturn $isNaN(x) && $isNaN(y);\n\t},\n\n\t// https://www.ecma-international.org/ecma-262/5.1/#sec-8\n\tType: function Type(x) {\n\t\tif (x === null) {\n\t\t\treturn 'Null';\n\t\t}\n\t\tif (typeof x === 'undefined') {\n\t\t\treturn 'Undefined';\n\t\t}\n\t\tif (typeof x === 'function' || typeof x === 'object') {\n\t\t\treturn 'Object';\n\t\t}\n\t\tif (typeof x === 'number') {\n\t\t\treturn 'Number';\n\t\t}\n\t\tif (typeof x === 'boolean') {\n\t\t\treturn 'Boolean';\n\t\t}\n\t\tif (typeof x === 'string') {\n\t\t\treturn 'String';\n\t\t}\n\t},\n\n\t// https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type\n\tIsPropertyDescriptor: function IsPropertyDescriptor(Desc) {\n\t\tif (this.Type(Desc) !== 'Object') {\n\t\t\treturn false;\n\t\t}\n\t\tvar allowed = {\n\t\t\t'[[Configurable]]': true,\n\t\t\t'[[Enumerable]]': true,\n\t\t\t'[[Get]]': true,\n\t\t\t'[[Set]]': true,\n\t\t\t'[[Value]]': true,\n\t\t\t'[[Writable]]': true\n\t\t};\n\n\t\tfor (var key in Desc) { // eslint-disable-line\n\t\t\tif (has(Desc, key) && !allowed[key]) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tvar isData = has(Desc, '[[Value]]');\n\t\tvar IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n\t\tif (isData && IsAccessor) {\n\t\t\tthrow new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n\t\t}\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.1\n\tIsAccessorDescriptor: function IsAccessorDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!has(Desc, '[[Get]]') && !has(Desc, '[[Set]]')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.2\n\tIsDataDescriptor: function IsDataDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.3\n\tIsGenericDescriptor: function IsGenericDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn false;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (!this.IsAccessorDescriptor(Desc) && !this.IsDataDescriptor(Desc)) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.4\n\tFromPropertyDescriptor: function FromPropertyDescriptor(Desc) {\n\t\tif (typeof Desc === 'undefined') {\n\t\t\treturn Desc;\n\t\t}\n\n\t\tassertRecord(this, 'Property Descriptor', 'Desc', Desc);\n\n\t\tif (this.IsDataDescriptor(Desc)) {\n\t\t\treturn {\n\t\t\t\tvalue: Desc['[[Value]]'],\n\t\t\t\twritable: !!Desc['[[Writable]]'],\n\t\t\t\tenumerable: !!Desc['[[Enumerable]]'],\n\t\t\t\tconfigurable: !!Desc['[[Configurable]]']\n\t\t\t};\n\t\t} else if (this.IsAccessorDescriptor(Desc)) {\n\t\t\treturn {\n\t\t\t\tget: Desc['[[Get]]'],\n\t\t\t\tset: Desc['[[Set]]'],\n\t\t\t\tenumerable: !!Desc['[[Enumerable]]'],\n\t\t\t\tconfigurable: !!Desc['[[Configurable]]']\n\t\t\t};\n\t\t} else {\n\t\t\tthrow new $TypeError('FromPropertyDescriptor must be called with a fully populated Property Descriptor');\n\t\t}\n\t},\n\n\t// https://ecma-international.org/ecma-262/5.1/#sec-8.10.5\n\tToPropertyDescriptor: function ToPropertyDescriptor(Obj) {\n\t\tif (this.Type(Obj) !== 'Object') {\n\t\t\tthrow new $TypeError('ToPropertyDescriptor requires an object');\n\t\t}\n\n\t\tvar desc = {};\n\t\tif (has(Obj, 'enumerable')) {\n\t\t\tdesc['[[Enumerable]]'] = this.ToBoolean(Obj.enumerable);\n\t\t}\n\t\tif (has(Obj, 'configurable')) {\n\t\t\tdesc['[[Configurable]]'] = this.ToBoolean(Obj.configurable);\n\t\t}\n\t\tif (has(Obj, 'value')) {\n\t\t\tdesc['[[Value]]'] = Obj.value;\n\t\t}\n\t\tif (has(Obj, 'writable')) {\n\t\t\tdesc['[[Writable]]'] = this.ToBoolean(Obj.writable);\n\t\t}\n\t\tif (has(Obj, 'get')) {\n\t\t\tvar getter = Obj.get;\n\t\t\tif (typeof getter !== 'undefined' && !this.IsCallable(getter)) {\n\t\t\t\tthrow new TypeError('getter must be a function');\n\t\t\t}\n\t\t\tdesc['[[Get]]'] = getter;\n\t\t}\n\t\tif (has(Obj, 'set')) {\n\t\t\tvar setter = Obj.set;\n\t\t\tif (typeof setter !== 'undefined' && !this.IsCallable(setter)) {\n\t\t\t\tthrow new $TypeError('setter must be a function');\n\t\t\t}\n\t\t\tdesc['[[Set]]'] = setter;\n\t\t}\n\n\t\tif ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {\n\t\t\tthrow new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');\n\t\t}\n\t\treturn desc;\n\t}\n};\n\nmodule.exports = ES5;\n",
  252. "'use strict';\n\nvar GetIntrinsic = require('../GetIntrinsic');\n\nvar $TypeError = GetIntrinsic('%TypeError%');\nvar $SyntaxError = GetIntrinsic('%SyntaxError%');\n\nvar has = require('has');\n\nvar predicates = {\n // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type\n 'Property Descriptor': function isPropertyDescriptor(ES, Desc) {\n if (ES.Type(Desc) !== 'Object') {\n return false;\n }\n var allowed = {\n '[[Configurable]]': true,\n '[[Enumerable]]': true,\n '[[Get]]': true,\n '[[Set]]': true,\n '[[Value]]': true,\n '[[Writable]]': true\n };\n\n for (var key in Desc) { // eslint-disable-line\n if (has(Desc, key) && !allowed[key]) {\n return false;\n }\n }\n\n var isData = has(Desc, '[[Value]]');\n var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');\n if (isData && IsAccessor) {\n throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');\n }\n return true;\n }\n};\n\nmodule.exports = function assertRecord(ES, recordType, argumentName, value) {\n var predicate = predicates[recordType];\n if (typeof predicate !== 'function') {\n throw new $SyntaxError('unknown record type: ' + recordType);\n }\n if (!predicate(ES, value)) {\n throw new $TypeError(argumentName + ' must be a ' + recordType);\n }\n console.log(predicate(ES, value), value);\n};\n",
  253. "var $isNaN = Number.isNaN || function (a) { return a !== a; };\n\nmodule.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };\n",
  254. "module.exports = Number.isNaN || function isNaN(a) {\n\treturn a !== a;\n};\n",
  255. "module.exports = function mod(number, modulo) {\n\tvar remain = number % modulo;\n\treturn Math.floor(remain >= 0 ? remain : remain + modulo);\n};\n",
  256. "module.exports = function sign(number) {\n\treturn number >= 0 ? 1 : -1;\n};\n",
  257. "'use strict';\n\nvar toStr = Object.prototype.toString;\n\nvar isPrimitive = require('./helpers/isPrimitive');\n\nvar isCallable = require('is-callable');\n\n// http://ecma-international.org/ecma-262/5.1/#sec-8.12.8\nvar ES5internalSlots = {\n\t'[[DefaultValue]]': function (O) {\n\t\tvar actualHint;\n\t\tif (arguments.length > 1) {\n\t\t\tactualHint = arguments[1];\n\t\t} else {\n\t\t\tactualHint = toStr.call(O) === '[object Date]' ? String : Number;\n\t\t}\n\n\t\tif (actualHint === String || actualHint === Number) {\n\t\t\tvar methods = actualHint === String ? ['toString', 'valueOf'] : ['valueOf', 'toString'];\n\t\t\tvar value, i;\n\t\t\tfor (i = 0; i < methods.length; ++i) {\n\t\t\t\tif (isCallable(O[methods[i]])) {\n\t\t\t\t\tvalue = O[methods[i]]();\n\t\t\t\t\tif (isPrimitive(value)) {\n\t\t\t\t\t\treturn value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tthrow new TypeError('No default value');\n\t\t}\n\t\tthrow new TypeError('invalid [[DefaultValue]] hint supplied');\n\t}\n};\n\n// http://ecma-international.org/ecma-262/5.1/#sec-9.1\nmodule.exports = function ToPrimitive(input) {\n\tif (isPrimitive(input)) {\n\t\treturn input;\n\t}\n\tif (arguments.length > 1) {\n\t\treturn ES5internalSlots['[[DefaultValue]]'](input, arguments[1]);\n\t}\n\treturn ES5internalSlots['[[DefaultValue]]'](input);\n};\n",
  258. "module.exports = function isPrimitive(value) {\n\treturn value === null || (typeof value !== 'function' && typeof value !== 'object');\n};\n",
  259. "/*eslint new-cap:0*/\nvar dtype = require('dtype')\n\nmodule.exports = flattenVertexData\n\nfunction flattenVertexData (data, output, offset) {\n if (!data) throw new TypeError('must specify data as first parameter')\n offset = +(offset || 0) | 0\n\n if (Array.isArray(data) && (data[0] && typeof data[0][0] === 'number')) {\n var dim = data[0].length\n var length = data.length * dim\n var i, j, k, l\n\n // no output specified, create a new typed array\n if (!output || typeof output === 'string') {\n output = new (dtype(output || 'float32'))(length + offset)\n }\n\n var dstLength = output.length - offset\n if (length !== dstLength) {\n throw new Error('source length ' + length + ' (' + dim + 'x' + data.length + ')' +\n ' does not match destination length ' + dstLength)\n }\n\n for (i = 0, k = offset; i < data.length; i++) {\n for (j = 0; j < dim; j++) {\n output[k++] = data[i][j] === null ? NaN : data[i][j]\n }\n }\n } else {\n if (!output || typeof output === 'string') {\n // no output, create a new one\n var Ctor = dtype(output || 'float32')\n\n // handle arrays separately due to possible nulls\n if (Array.isArray(data) || output === 'array') {\n output = new Ctor(data.length + offset)\n for (i = 0, k = offset, l = output.length; k < l; k++, i++) {\n output[k] = data[i] === null ? NaN : data[i]\n }\n } else {\n if (offset === 0) {\n output = new Ctor(data)\n } else {\n output = new Ctor(data.length + offset)\n\n output.set(data, offset)\n }\n }\n } else {\n // store output in existing array\n output.set(data, offset)\n }\n }\n\n return output\n}\n",
  260. "'use strict';\n\nvar isCallable = require('is-callable');\n\nvar toStr = Object.prototype.toString;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar forEachArray = function forEachArray(array, iterator, receiver) {\n for (var i = 0, len = array.length; i < len; i++) {\n if (hasOwnProperty.call(array, i)) {\n if (receiver == null) {\n iterator(array[i], i, array);\n } else {\n iterator.call(receiver, array[i], i, array);\n }\n }\n }\n};\n\nvar forEachString = function forEachString(string, iterator, receiver) {\n for (var i = 0, len = string.length; i < len; i++) {\n // no such thing as a sparse string.\n if (receiver == null) {\n iterator(string.charAt(i), i, string);\n } else {\n iterator.call(receiver, string.charAt(i), i, string);\n }\n }\n};\n\nvar forEachObject = function forEachObject(object, iterator, receiver) {\n for (var k in object) {\n if (hasOwnProperty.call(object, k)) {\n if (receiver == null) {\n iterator(object[k], k, object);\n } else {\n iterator.call(receiver, object[k], k, object);\n }\n }\n }\n};\n\nvar forEach = function forEach(list, iterator, thisArg) {\n if (!isCallable(iterator)) {\n throw new TypeError('iterator must be a function');\n }\n\n var receiver;\n if (arguments.length >= 3) {\n receiver = thisArg;\n }\n\n if (toStr.call(list) === '[object Array]') {\n forEachArray(list, iterator, receiver);\n } else if (typeof list === 'string') {\n forEachString(list, iterator, receiver);\n } else {\n forEachObject(list, iterator, receiver);\n }\n};\n\nmodule.exports = forEach;\n",
  261. "'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar slice = Array.prototype.slice;\nvar toStr = Object.prototype.toString;\nvar funcType = '[object Function]';\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.call(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slice.call(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n args.concat(slice.call(arguments))\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n } else {\n return target.apply(\n that,\n args.concat(slice.call(arguments))\n );\n }\n };\n\n var boundLength = Math.max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs.push('$' + i);\n }\n\n bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n",
  262. "'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n",
  263. "var win;\n\nif (typeof window !== \"undefined\") {\n win = window;\n} else if (typeof global !== \"undefined\") {\n win = global;\n} else if (typeof self !== \"undefined\"){\n win = self;\n} else {\n win = {};\n}\n\nmodule.exports = win;\n",
  264. "'use strict';\n\nvar bind = require('function-bind');\n\nmodule.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);\n",
  265. "exports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n",
  266. "if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n",
  267. "/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n",
  268. "'use strict';\n\nvar fnToStr = Function.prototype.toString;\n\nvar constructorRegex = /^\\s*class\\b/;\nvar isES6ClassFn = function isES6ClassFunction(value) {\n\ttry {\n\t\tvar fnStr = fnToStr.call(value);\n\t\treturn constructorRegex.test(fnStr);\n\t} catch (e) {\n\t\treturn false; // not a function\n\t}\n};\n\nvar tryFunctionObject = function tryFunctionToStr(value) {\n\ttry {\n\t\tif (isES6ClassFn(value)) { return false; }\n\t\tfnToStr.call(value);\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\nvar toStr = Object.prototype.toString;\nvar fnClass = '[object Function]';\nvar genClass = '[object GeneratorFunction]';\nvar hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';\n\nmodule.exports = function isCallable(value) {\n\tif (!value) { return false; }\n\tif (typeof value !== 'function' && typeof value !== 'object') { return false; }\n\tif (typeof value === 'function' && !value.prototype) { return true; }\n\tif (hasToStringTag) { return tryFunctionObject(value); }\n\tif (isES6ClassFn(value)) { return false; }\n\tvar strClass = toStr.call(value);\n\treturn strClass === fnClass || strClass === genClass;\n};\n",
  269. "module.exports = isFunction\n\nvar toString = Object.prototype.toString\n\nfunction isFunction (fn) {\n var string = toString.call(fn)\n return string === '[object Function]' ||\n (typeof fn === 'function' && string !== '[object RegExp]') ||\n (typeof window !== 'undefined' &&\n // IE8 and below\n (fn === window.setTimeout ||\n fn === window.alert ||\n fn === window.confirm ||\n fn === window.prompt))\n};\n",
  270. "'use strict';\nmodule.exports = function (x) {\n\tvar type = typeof x;\n\treturn x !== null && (type === 'object' || type === 'function');\n};\n",
  271. "var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n",
  272. "var wordWrap = require('word-wrapper')\nvar xtend = require('xtend')\nvar number = require('as-number')\n\nvar X_HEIGHTS = ['x', 'e', 'a', 'o', 'n', 's', 'r', 'c', 'u', 'm', 'v', 'w', 'z']\nvar M_WIDTHS = ['m', 'w']\nvar CAP_HEIGHTS = ['H', 'I', 'N', 'E', 'F', 'K', 'L', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']\n\n\nvar TAB_ID = '\\t'.charCodeAt(0)\nvar SPACE_ID = ' '.charCodeAt(0)\nvar ALIGN_LEFT = 0, \n ALIGN_CENTER = 1, \n ALIGN_RIGHT = 2\n\nmodule.exports = function createLayout(opt) {\n return new TextLayout(opt)\n}\n\nfunction TextLayout(opt) {\n this.glyphs = []\n this._measure = this.computeMetrics.bind(this)\n this.update(opt)\n}\n\nTextLayout.prototype.update = function(opt) {\n opt = xtend({\n measure: this._measure\n }, opt)\n this._opt = opt\n this._opt.tabSize = number(this._opt.tabSize, 4)\n\n if (!opt.font)\n throw new Error('must provide a valid bitmap font')\n\n var glyphs = this.glyphs\n var text = opt.text||'' \n var font = opt.font\n this._setupSpaceGlyphs(font)\n \n var lines = wordWrap.lines(text, opt)\n var minWidth = opt.width || 0\n\n //clear glyphs\n glyphs.length = 0\n\n //get max line width\n var maxLineWidth = lines.reduce(function(prev, line) {\n return Math.max(prev, line.width, minWidth)\n }, 0)\n\n //the pen position\n var x = 0\n var y = 0\n var lineHeight = number(opt.lineHeight, font.common.lineHeight)\n var baseline = font.common.base\n var descender = lineHeight-baseline\n var letterSpacing = opt.letterSpacing || 0\n var height = lineHeight * lines.length - descender\n var align = getAlignType(this._opt.align)\n\n //draw text along baseline\n y -= height\n \n //the metrics for this text layout\n this._width = maxLineWidth\n this._height = height\n this._descender = lineHeight - baseline\n this._baseline = baseline\n this._xHeight = getXHeight(font)\n this._capHeight = getCapHeight(font)\n this._lineHeight = lineHeight\n this._ascender = lineHeight - descender - this._xHeight\n \n //layout each glyph\n var self = this\n lines.forEach(function(line, lineIndex) {\n var start = line.start\n var end = line.end\n var lineWidth = line.width\n var lastGlyph\n \n //for each glyph in that line...\n for (var i=start; i<end; i++) {\n var id = text.charCodeAt(i)\n var glyph = self.getGlyph(font, id)\n if (glyph) {\n if (lastGlyph) \n x += getKerning(font, lastGlyph.id, glyph.id)\n\n var tx = x\n if (align === ALIGN_CENTER) \n tx += (maxLineWidth-lineWidth)/2\n else if (align === ALIGN_RIGHT)\n tx += (maxLineWidth-lineWidth)\n\n glyphs.push({\n position: [tx, y],\n data: glyph,\n index: i,\n line: lineIndex\n }) \n\n //move pen forward\n x += glyph.xadvance + letterSpacing\n lastGlyph = glyph\n }\n }\n\n //next line down\n y += lineHeight\n x = 0\n })\n this._linesTotal = lines.length;\n}\n\nTextLayout.prototype._setupSpaceGlyphs = function(font) {\n //These are fallbacks, when the font doesn't include\n //' ' or '\\t' glyphs\n this._fallbackSpaceGlyph = null\n this._fallbackTabGlyph = null\n\n if (!font.chars || font.chars.length === 0)\n return\n\n //try to get space glyph\n //then fall back to the 'm' or 'w' glyphs\n //then fall back to the first glyph available\n var space = getGlyphById(font, SPACE_ID) \n || getMGlyph(font) \n || font.chars[0]\n\n //and create a fallback for tab\n var tabWidth = this._opt.tabSize * space.xadvance\n this._fallbackSpaceGlyph = space\n this._fallbackTabGlyph = xtend(space, {\n x: 0, y: 0, xadvance: tabWidth, id: TAB_ID, \n xoffset: 0, yoffset: 0, width: 0, height: 0\n })\n}\n\nTextLayout.prototype.getGlyph = function(font, id) {\n var glyph = getGlyphById(font, id)\n if (glyph)\n return glyph\n else if (id === TAB_ID) \n return this._fallbackTabGlyph\n else if (id === SPACE_ID) \n return this._fallbackSpaceGlyph\n return null\n}\n\nTextLayout.prototype.computeMetrics = function(text, start, end, width) {\n var letterSpacing = this._opt.letterSpacing || 0\n var font = this._opt.font\n var curPen = 0\n var curWidth = 0\n var count = 0\n var glyph\n var lastGlyph\n\n if (!font.chars || font.chars.length === 0) {\n return {\n start: start,\n end: start,\n width: 0\n }\n }\n\n end = Math.min(text.length, end)\n for (var i=start; i < end; i++) {\n var id = text.charCodeAt(i)\n var glyph = this.getGlyph(font, id)\n\n if (glyph) {\n //move pen forward\n var xoff = glyph.xoffset\n var kern = lastGlyph ? getKerning(font, lastGlyph.id, glyph.id) : 0\n curPen += kern\n\n var nextPen = curPen + glyph.xadvance + letterSpacing\n var nextWidth = curPen + glyph.width\n\n //we've hit our limit; we can't move onto the next glyph\n if (nextWidth >= width || nextPen >= width)\n break\n\n //otherwise continue along our line\n curPen = nextPen\n curWidth = nextWidth\n lastGlyph = glyph\n }\n count++\n }\n \n //make sure rightmost edge lines up with rendered glyphs\n if (lastGlyph)\n curWidth += lastGlyph.xoffset\n\n return {\n start: start,\n end: start + count,\n width: curWidth\n }\n}\n\n//getters for the private vars\n;['width', 'height', \n 'descender', 'ascender',\n 'xHeight', 'baseline',\n 'capHeight',\n 'lineHeight' ].forEach(addGetter)\n\nfunction addGetter(name) {\n Object.defineProperty(TextLayout.prototype, name, {\n get: wrapper(name),\n configurable: true\n })\n}\n\n//create lookups for private vars\nfunction wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}\n\nfunction getGlyphById(font, id) {\n if (!font.chars || font.chars.length === 0)\n return null\n\n var glyphIdx = findChar(font.chars, id)\n if (glyphIdx >= 0)\n return font.chars[glyphIdx]\n return null\n}\n\nfunction getXHeight(font) {\n for (var i=0; i<X_HEIGHTS.length; i++) {\n var id = X_HEIGHTS[i].charCodeAt(0)\n var idx = findChar(font.chars, id)\n if (idx >= 0) \n return font.chars[idx].height\n }\n return 0\n}\n\nfunction getMGlyph(font) {\n for (var i=0; i<M_WIDTHS.length; i++) {\n var id = M_WIDTHS[i].charCodeAt(0)\n var idx = findChar(font.chars, id)\n if (idx >= 0) \n return font.chars[idx]\n }\n return 0\n}\n\nfunction getCapHeight(font) {\n for (var i=0; i<CAP_HEIGHTS.length; i++) {\n var id = CAP_HEIGHTS[i].charCodeAt(0)\n var idx = findChar(font.chars, id)\n if (idx >= 0) \n return font.chars[idx].height\n }\n return 0\n}\n\nfunction getKerning(font, left, right) {\n if (!font.kernings || font.kernings.length === 0)\n return 0\n\n var table = font.kernings\n for (var i=0; i<table.length; i++) {\n var kern = table[i]\n if (kern.first === left && kern.second === right)\n return kern.amount\n }\n return 0\n}\n\nfunction getAlignType(align) {\n if (align === 'center')\n return ALIGN_CENTER\n else if (align === 'right')\n return ALIGN_RIGHT\n return ALIGN_LEFT\n}\n\nfunction findChar (array, value, start) {\n start = start || 0\n for (var i = start; i < array.length; i++) {\n if (array[i].id === value) {\n return i\n }\n }\n return -1\n}",
  273. "var xhr = require('xhr')\nvar noop = function(){}\nvar parseASCII = require('parse-bmfont-ascii')\nvar parseXML = require('parse-bmfont-xml')\nvar readBinary = require('parse-bmfont-binary')\nvar isBinaryFormat = require('./lib/is-binary')\nvar xtend = require('xtend')\n\nvar xml2 = (function hasXML2() {\n return self.XMLHttpRequest && \"withCredentials\" in new XMLHttpRequest\n})()\n\nmodule.exports = function(opt, cb) {\n cb = typeof cb === 'function' ? cb : noop\n\n if (typeof opt === 'string')\n opt = { uri: opt }\n else if (!opt)\n opt = {}\n\n var expectBinary = opt.binary\n if (expectBinary)\n opt = getBinaryOpts(opt)\n\n xhr(opt, function(err, res, body) {\n if (err)\n return cb(err)\n if (!/^2/.test(res.statusCode))\n return cb(new Error('http status code: '+res.statusCode))\n if (!body)\n return cb(new Error('no body result'))\n\n var binary = false \n\n //if the response type is an array buffer,\n //we need to convert it into a regular Buffer object\n if (isArrayBuffer(body)) {\n var array = new Uint8Array(body)\n body = new Buffer(array, 'binary')\n }\n\n //now check the string/Buffer response\n //and see if it has a binary BMF header\n if (isBinaryFormat(body)) {\n binary = true\n //if we have a string, turn it into a Buffer\n if (typeof body === 'string') \n body = new Buffer(body, 'binary')\n } \n\n //we are not parsing a binary format, just ASCII/XML/etc\n if (!binary) {\n //might still be a buffer if responseType is 'arraybuffer'\n if (Buffer.isBuffer(body))\n body = body.toString(opt.encoding)\n body = body.trim()\n }\n\n var result\n try {\n var type = res.headers['content-type']\n if (binary)\n result = readBinary(body)\n else if (/json/.test(type) || body.charAt(0) === '{')\n result = JSON.parse(body)\n else if (/xml/.test(type) || body.charAt(0) === '<')\n result = parseXML(body)\n else\n result = parseASCII(body)\n } catch (e) {\n cb(new Error('error parsing font '+e.message))\n cb = noop\n }\n cb(null, result)\n })\n}\n\nfunction isArrayBuffer(arr) {\n var str = Object.prototype.toString\n return str.call(arr) === '[object ArrayBuffer]'\n}\n\nfunction getBinaryOpts(opt) {\n //IE10+ and other modern browsers support array buffers\n if (xml2)\n return xtend(opt, { responseType: 'arraybuffer' })\n \n if (typeof self.XMLHttpRequest === 'undefined')\n throw new Error('your browser does not support XHR loading')\n\n //IE9 and XML1 browsers could still use an override\n var req = new self.XMLHttpRequest()\n req.overrideMimeType('text/plain; charset=x-user-defined')\n return xtend({\n xhr: req\n }, opt)\n}\n",
  274. "var equal = require('buffer-equal')\nvar HEADER = new Buffer([66, 77, 70, 3])\n\nmodule.exports = function(buf) {\n if (typeof buf === 'string')\n return buf.substring(0, 3) === 'BMF'\n return buf.length > 4 && equal(buf.slice(0, 4), HEADER)\n}",
  275. "/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n",
  276. "'use strict';\n\nvar keysShim;\nif (!Object.keys) {\n\t// modified from https://github.com/es-shims/es5-shim\n\tvar has = Object.prototype.hasOwnProperty;\n\tvar toStr = Object.prototype.toString;\n\tvar isArgs = require('./isArguments'); // eslint-disable-line global-require\n\tvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');\n\tvar hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');\n\tvar dontEnums = [\n\t\t'toString',\n\t\t'toLocaleString',\n\t\t'valueOf',\n\t\t'hasOwnProperty',\n\t\t'isPrototypeOf',\n\t\t'propertyIsEnumerable',\n\t\t'constructor'\n\t];\n\tvar equalsConstructorPrototype = function (o) {\n\t\tvar ctor = o.constructor;\n\t\treturn ctor && ctor.prototype === o;\n\t};\n\tvar excludedKeys = {\n\t\t$applicationCache: true,\n\t\t$console: true,\n\t\t$external: true,\n\t\t$frame: true,\n\t\t$frameElement: true,\n\t\t$frames: true,\n\t\t$innerHeight: true,\n\t\t$innerWidth: true,\n\t\t$onmozfullscreenchange: true,\n\t\t$onmozfullscreenerror: true,\n\t\t$outerHeight: true,\n\t\t$outerWidth: true,\n\t\t$pageXOffset: true,\n\t\t$pageYOffset: true,\n\t\t$parent: true,\n\t\t$scrollLeft: true,\n\t\t$scrollTop: true,\n\t\t$scrollX: true,\n\t\t$scrollY: true,\n\t\t$self: true,\n\t\t$webkitIndexedDB: true,\n\t\t$webkitStorageInfo: true,\n\t\t$window: true\n\t};\n\tvar hasAutomationEqualityBug = (function () {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined') { return false; }\n\t\tfor (var k in window) {\n\t\t\ttry {\n\t\t\t\tif (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tequalsConstructorPrototype(window[k]);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}());\n\tvar equalsConstructorPrototypeIfNotBuggy = function (o) {\n\t\t/* global window */\n\t\tif (typeof window === 'undefined' || !hasAutomationEqualityBug) {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t}\n\t\ttry {\n\t\t\treturn equalsConstructorPrototype(o);\n\t\t} catch (e) {\n\t\t\treturn false;\n\t\t}\n\t};\n\n\tkeysShim = function keys(object) {\n\t\tvar isObject = object !== null && typeof object === 'object';\n\t\tvar isFunction = toStr.call(object) === '[object Function]';\n\t\tvar isArguments = isArgs(object);\n\t\tvar isString = isObject && toStr.call(object) === '[object String]';\n\t\tvar theKeys = [];\n\n\t\tif (!isObject && !isFunction && !isArguments) {\n\t\t\tthrow new TypeError('Object.keys called on a non-object');\n\t\t}\n\n\t\tvar skipProto = hasProtoEnumBug && isFunction;\n\t\tif (isString && object.length > 0 && !has.call(object, 0)) {\n\t\t\tfor (var i = 0; i < object.length; ++i) {\n\t\t\t\ttheKeys.push(String(i));\n\t\t\t}\n\t\t}\n\n\t\tif (isArguments && object.length > 0) {\n\t\t\tfor (var j = 0; j < object.length; ++j) {\n\t\t\t\ttheKeys.push(String(j));\n\t\t\t}\n\t\t} else {\n\t\t\tfor (var name in object) {\n\t\t\t\tif (!(skipProto && name === 'prototype') && has.call(object, name)) {\n\t\t\t\t\ttheKeys.push(String(name));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (hasDontEnumBug) {\n\t\t\tvar skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);\n\n\t\t\tfor (var k = 0; k < dontEnums.length; ++k) {\n\t\t\t\tif (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {\n\t\t\t\t\ttheKeys.push(dontEnums[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn theKeys;\n\t};\n}\nmodule.exports = keysShim;\n",
  277. "'use strict';\n\nvar slice = Array.prototype.slice;\nvar isArgs = require('./isArguments');\n\nvar origKeys = Object.keys;\nvar keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');\n\nvar originalKeys = Object.keys;\n\nkeysShim.shim = function shimObjectKeys() {\n\tif (Object.keys) {\n\t\tvar keysWorksWithArguments = (function () {\n\t\t\t// Safari 5.0 bug\n\t\t\tvar args = Object.keys(arguments);\n\t\t\treturn args && args.length === arguments.length;\n\t\t}(1, 2));\n\t\tif (!keysWorksWithArguments) {\n\t\t\tObject.keys = function keys(object) { // eslint-disable-line func-name-matching\n\t\t\t\tif (isArgs(object)) {\n\t\t\t\t\treturn originalKeys(slice.call(object));\n\t\t\t\t}\n\t\t\t\treturn originalKeys(object);\n\t\t\t};\n\t\t}\n\t} else {\n\t\tObject.keys = keysShim;\n\t}\n\treturn Object.keys || keysShim;\n};\n\nmodule.exports = keysShim;\n",
  278. "'use strict';\n\nvar toStr = Object.prototype.toString;\n\nmodule.exports = function isArguments(value) {\n\tvar str = toStr.call(value);\n\tvar isArgs = str === '[object Arguments]';\n\tif (!isArgs) {\n\t\tisArgs = str !== '[object Array]' &&\n\t\t\tvalue !== null &&\n\t\t\ttypeof value === 'object' &&\n\t\t\ttypeof value.length === 'number' &&\n\t\t\tvalue.length >= 0 &&\n\t\t\ttoStr.call(value.callee) === '[object Function]';\n\t}\n\treturn isArgs;\n};\n",
  279. "module.exports = function parseBMFontAscii(data) {\n if (!data)\n throw new Error('no data provided')\n data = data.toString().trim()\n\n var output = {\n pages: [],\n chars: [],\n kernings: []\n }\n\n var lines = data.split(/\\r\\n?|\\n/g)\n\n if (lines.length === 0)\n throw new Error('no data in BMFont file')\n\n for (var i = 0; i < lines.length; i++) {\n var lineData = splitLine(lines[i], i)\n if (!lineData) //skip empty lines\n continue\n\n if (lineData.key === 'page') {\n if (typeof lineData.data.id !== 'number')\n throw new Error('malformed file at line ' + i + ' -- needs page id=N')\n if (typeof lineData.data.file !== 'string')\n throw new Error('malformed file at line ' + i + ' -- needs page file=\"path\"')\n output.pages[lineData.data.id] = lineData.data.file\n } else if (lineData.key === 'chars' || lineData.key === 'kernings') {\n //... do nothing for these two ...\n } else if (lineData.key === 'char') {\n output.chars.push(lineData.data)\n } else if (lineData.key === 'kerning') {\n output.kernings.push(lineData.data)\n } else {\n output[lineData.key] = lineData.data\n }\n }\n\n return output\n}\n\nfunction splitLine(line, idx) {\n line = line.replace(/\\t+/g, ' ').trim()\n if (!line)\n return null\n\n var space = line.indexOf(' ')\n if (space === -1) \n throw new Error(\"no named row at line \" + idx)\n\n var key = line.substring(0, space)\n\n line = line.substring(space + 1)\n //clear \"letter\" field as it is non-standard and\n //requires additional complexity to parse \" / = symbols\n line = line.replace(/letter=[\\'\\\"]\\S+[\\'\\\"]/gi, '') \n line = line.split(\"=\")\n line = line.map(function(str) {\n return str.trim().match((/(\".*?\"|[^\"\\s]+)+(?=\\s*|\\s*$)/g))\n })\n\n var data = []\n for (var i = 0; i < line.length; i++) {\n var dt = line[i]\n if (i === 0) {\n data.push({\n key: dt[0],\n data: \"\"\n })\n } else if (i === line.length - 1) {\n data[data.length - 1].data = parseData(dt[0])\n } else {\n data[data.length - 1].data = parseData(dt[0])\n data.push({\n key: dt[1],\n data: \"\"\n })\n }\n }\n\n var out = {\n key: key,\n data: {}\n }\n\n data.forEach(function(v) {\n out.data[v.key] = v.data;\n })\n\n return out\n}\n\nfunction parseData(data) {\n if (!data || data.length === 0)\n return \"\"\n\n if (data.indexOf('\"') === 0 || data.indexOf(\"'\") === 0)\n return data.substring(1, data.length - 1)\n if (data.indexOf(',') !== -1)\n return parseIntList(data)\n return parseInt(data, 10)\n}\n\nfunction parseIntList(data) {\n return data.split(',').map(function(val) {\n return parseInt(val, 10)\n })\n}",
  280. "var HEADER = [66, 77, 70]\n\nmodule.exports = function readBMFontBinary(buf) {\n if (buf.length < 6)\n throw new Error('invalid buffer length for BMFont')\n\n var header = HEADER.every(function(byte, i) {\n return buf.readUInt8(i) === byte\n })\n\n if (!header)\n throw new Error('BMFont missing BMF byte header')\n\n var i = 3\n var vers = buf.readUInt8(i++)\n if (vers > 3)\n throw new Error('Only supports BMFont Binary v3 (BMFont App v1.10)')\n \n var target = { kernings: [], chars: [] }\n for (var b=0; b<5; b++)\n i += readBlock(target, buf, i)\n return target\n}\n\nfunction readBlock(target, buf, i) {\n if (i > buf.length-1)\n return 0\n\n var blockID = buf.readUInt8(i++)\n var blockSize = buf.readInt32LE(i)\n i += 4\n\n switch(blockID) {\n case 1: \n target.info = readInfo(buf, i)\n break\n case 2:\n target.common = readCommon(buf, i)\n break\n case 3:\n target.pages = readPages(buf, i, blockSize)\n break\n case 4:\n target.chars = readChars(buf, i, blockSize)\n break\n case 5:\n target.kernings = readKernings(buf, i, blockSize)\n break\n }\n return 5 + blockSize\n}\n\nfunction readInfo(buf, i) {\n var info = {}\n info.size = buf.readInt16LE(i)\n\n var bitField = buf.readUInt8(i+2)\n info.smooth = (bitField >> 7) & 1\n info.unicode = (bitField >> 6) & 1\n info.italic = (bitField >> 5) & 1\n info.bold = (bitField >> 4) & 1\n \n //fixedHeight is only mentioned in binary spec \n if ((bitField >> 3) & 1)\n info.fixedHeight = 1\n \n info.charset = buf.readUInt8(i+3) || ''\n info.stretchH = buf.readUInt16LE(i+4)\n info.aa = buf.readUInt8(i+6)\n info.padding = [\n buf.readInt8(i+7),\n buf.readInt8(i+8),\n buf.readInt8(i+9),\n buf.readInt8(i+10)\n ]\n info.spacing = [\n buf.readInt8(i+11),\n buf.readInt8(i+12)\n ]\n info.outline = buf.readUInt8(i+13)\n info.face = readStringNT(buf, i+14)\n return info\n}\n\nfunction readCommon(buf, i) {\n var common = {}\n common.lineHeight = buf.readUInt16LE(i)\n common.base = buf.readUInt16LE(i+2)\n common.scaleW = buf.readUInt16LE(i+4)\n common.scaleH = buf.readUInt16LE(i+6)\n common.pages = buf.readUInt16LE(i+8)\n var bitField = buf.readUInt8(i+10)\n common.packed = 0\n common.alphaChnl = buf.readUInt8(i+11)\n common.redChnl = buf.readUInt8(i+12)\n common.greenChnl = buf.readUInt8(i+13)\n common.blueChnl = buf.readUInt8(i+14)\n return common\n}\n\nfunction readPages(buf, i, size) {\n var pages = []\n var text = readNameNT(buf, i)\n var len = text.length+1\n var count = size / len\n for (var c=0; c<count; c++) {\n pages[c] = buf.slice(i, i+text.length).toString('utf8')\n i += len\n }\n return pages\n}\n\nfunction readChars(buf, i, blockSize) {\n var chars = []\n\n var count = blockSize / 20\n for (var c=0; c<count; c++) {\n var char = {}\n var off = c*20\n char.id = buf.readUInt32LE(i + 0 + off)\n char.x = buf.readUInt16LE(i + 4 + off)\n char.y = buf.readUInt16LE(i + 6 + off)\n char.width = buf.readUInt16LE(i + 8 + off)\n char.height = buf.readUInt16LE(i + 10 + off)\n char.xoffset = buf.readInt16LE(i + 12 + off)\n char.yoffset = buf.readInt16LE(i + 14 + off)\n char.xadvance = buf.readInt16LE(i + 16 + off)\n char.page = buf.readUInt8(i + 18 + off)\n char.chnl = buf.readUInt8(i + 19 + off)\n chars[c] = char\n }\n return chars\n}\n\nfunction readKernings(buf, i, blockSize) {\n var kernings = []\n var count = blockSize / 10\n for (var c=0; c<count; c++) {\n var kern = {}\n var off = c*10\n kern.first = buf.readUInt32LE(i + 0 + off)\n kern.second = buf.readUInt32LE(i + 4 + off)\n kern.amount = buf.readInt16LE(i + 8 + off)\n kernings[c] = kern\n }\n return kernings\n}\n\nfunction readNameNT(buf, offset) {\n var pos=offset\n for (; pos<buf.length; pos++) {\n if (buf[pos] === 0x00) \n break\n }\n return buf.slice(offset, pos)\n}\n\nfunction readStringNT(buf, offset) {\n return readNameNT(buf, offset).toString('utf8')\n}",
  281. "var parseAttributes = require('./parse-attribs')\nvar parseFromString = require('xml-parse-from-string')\n\n//In some cases element.attribute.nodeName can return\n//all lowercase values.. so we need to map them to the correct \n//case\nvar NAME_MAP = {\n scaleh: 'scaleH',\n scalew: 'scaleW',\n stretchh: 'stretchH',\n lineheight: 'lineHeight',\n alphachnl: 'alphaChnl',\n redchnl: 'redChnl',\n greenchnl: 'greenChnl',\n bluechnl: 'blueChnl'\n}\n\nmodule.exports = function parse(data) {\n data = data.toString()\n \n var xmlRoot = parseFromString(data)\n var output = {\n pages: [],\n chars: [],\n kernings: []\n }\n\n //get config settings\n ;['info', 'common'].forEach(function(key) {\n var element = xmlRoot.getElementsByTagName(key)[0]\n if (element)\n output[key] = parseAttributes(getAttribs(element))\n })\n\n //get page info\n var pageRoot = xmlRoot.getElementsByTagName('pages')[0]\n if (!pageRoot)\n throw new Error('malformed file -- no <pages> element')\n var pages = pageRoot.getElementsByTagName('page')\n for (var i=0; i<pages.length; i++) {\n var p = pages[i]\n var id = parseInt(p.getAttribute('id'), 10)\n var file = p.getAttribute('file')\n if (isNaN(id))\n throw new Error('malformed file -- page \"id\" attribute is NaN')\n if (!file)\n throw new Error('malformed file -- needs page \"file\" attribute')\n output.pages[parseInt(id, 10)] = file\n }\n\n //get kernings / chars\n ;['chars', 'kernings'].forEach(function(key) {\n var element = xmlRoot.getElementsByTagName(key)[0]\n if (!element)\n return\n var childTag = key.substring(0, key.length-1)\n var children = element.getElementsByTagName(childTag)\n for (var i=0; i<children.length; i++) { \n var child = children[i]\n output[key].push(parseAttributes(getAttribs(child)))\n }\n })\n return output\n}\n\nfunction getAttribs(element) {\n var attribs = getAttribList(element)\n return attribs.reduce(function(dict, attrib) {\n var key = mapName(attrib.nodeName)\n dict[key] = attrib.nodeValue\n return dict\n }, {})\n}\n\nfunction getAttribList(element) {\n //IE8+ and modern browsers\n var attribs = []\n for (var i=0; i<element.attributes.length; i++)\n attribs.push(element.attributes[i])\n return attribs\n}\n\nfunction mapName(nodeName) {\n return NAME_MAP[nodeName.toLowerCase()] || nodeName\n}",
  282. "//Some versions of GlyphDesigner have a typo\n//that causes some bugs with parsing. \n//Need to confirm with recent version of the software\n//to see whether this is still an issue or not.\nvar GLYPH_DESIGNER_ERROR = 'chasrset'\n\nmodule.exports = function parseAttributes(obj) {\n if (GLYPH_DESIGNER_ERROR in obj) {\n obj['charset'] = obj[GLYPH_DESIGNER_ERROR]\n delete obj[GLYPH_DESIGNER_ERROR]\n }\n\n for (var k in obj) {\n if (k === 'face' || k === 'charset') \n continue\n else if (k === 'padding' || k === 'spacing')\n obj[k] = parseIntList(obj[k])\n else\n obj[k] = parseInt(obj[k], 10) \n }\n return obj\n}\n\nfunction parseIntList(data) {\n return data.split(',').map(function(val) {\n return parseInt(val, 10)\n })\n}",
  283. "var trim = require('string.prototype.trim')\n , forEach = require('for-each')\n , isArray = function(arg) {\n return Object.prototype.toString.call(arg) === '[object Array]';\n }\n\nmodule.exports = function (headers) {\n if (!headers)\n return {}\n\n var result = {}\n\n forEach(\n trim(headers).split('\\n')\n , function (row) {\n var index = row.indexOf(':')\n , key = trim(row.slice(0, index)).toLowerCase()\n , value = trim(row.slice(index + 1))\n\n if (typeof(result[key]) === 'undefined') {\n result[key] = value\n } else if (isArray(result[key])) {\n result[key].push(value)\n } else {\n result[key] = [ result[key], value ]\n }\n }\n )\n\n return result\n}\n",
  284. "var performance = global.performance || {};\n\nvar present = (function () {\n var names = ['now', 'webkitNow', 'msNow', 'mozNow', 'oNow'];\n while (names.length) {\n var name = names.shift();\n if (name in performance) {\n return performance[name].bind(performance);\n }\n }\n\n var dateNow = Date.now || function () { return new Date().getTime(); };\n var navigationStart = (performance.timing || {}).navigationStart || dateNow();\n return function () {\n return dateNow() - navigationStart;\n };\n}());\n\npresent.performanceNow = performance.now;\npresent.noConflict = function () {\n performance.now = present.performanceNow;\n};\npresent.conflict = function () {\n performance.now = present;\n};\npresent.conflict();\n\nmodule.exports = present;\n",
  285. "// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n",
  286. "(function(root) {\n\n\t// Store setTimeout reference so promise-polyfill will be unaffected by\n\t// other code modifying setTimeout (like sinon.useFakeTimers())\n\tvar setTimeoutFunc = setTimeout;\n\n\t// Use polyfill for setImmediate for performance gains\n\tvar asap = (typeof setImmediate === 'function' && setImmediate) ||\n\t\tfunction(fn) { setTimeoutFunc(fn, 1); };\n\n\t// Polyfill for Function.prototype.bind\n\tfunction bind(fn, thisArg) {\n\t\treturn function() {\n\t\t\tfn.apply(thisArg, arguments);\n\t\t}\n\t}\n\n\tvar isArray = Array.isArray || function(value) { return Object.prototype.toString.call(value) === \"[object Array]\" };\n\n\tfunction Promise(fn) {\n\t\tif (typeof this !== 'object') throw new TypeError('Promises must be constructed via new');\n\t\tif (typeof fn !== 'function') throw new TypeError('not a function');\n\t\tthis._state = null;\n\t\tthis._value = null;\n\t\tthis._deferreds = []\n\n\t\tdoResolve(fn, bind(resolve, this), bind(reject, this))\n\t}\n\n\tfunction handle(deferred) {\n\t\tvar me = this;\n\t\tif (this._state === null) {\n\t\t\tthis._deferreds.push(deferred);\n\t\t\treturn\n\t\t}\n\t\tasap(function() {\n\t\t\tvar cb = me._state ? deferred.onFulfilled : deferred.onRejected\n\t\t\tif (cb === null) {\n\t\t\t\t(me._state ? deferred.resolve : deferred.reject)(me._value);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar ret;\n\t\t\ttry {\n\t\t\t\tret = cb(me._value);\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\tdeferred.reject(e);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tdeferred.resolve(ret);\n\t\t})\n\t}\n\n\tfunction resolve(newValue) {\n\t\ttry { //Promise Resolution Procedure: https://github.com/promises-aplus/promises-spec#the-promise-resolution-procedure\n\t\t\tif (newValue === this) throw new TypeError('A promise cannot be resolved with itself.');\n\t\t\tif (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) {\n\t\t\t\tvar then = newValue.then;\n\t\t\t\tif (typeof then === 'function') {\n\t\t\t\t\tdoResolve(bind(then, newValue), bind(resolve, this), bind(reject, this));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._state = true;\n\t\t\tthis._value = newValue;\n\t\t\tfinale.call(this);\n\t\t} catch (e) { reject.call(this, e); }\n\t}\n\n\tfunction reject(newValue) {\n\t\tthis._state = false;\n\t\tthis._value = newValue;\n\t\tfinale.call(this);\n\t}\n\n\tfunction finale() {\n\t\tfor (var i = 0, len = this._deferreds.length; i < len; i++) {\n\t\t\thandle.call(this, this._deferreds[i]);\n\t\t}\n\t\tthis._deferreds = null;\n\t}\n\n\tfunction Handler(onFulfilled, onRejected, resolve, reject){\n\t\tthis.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null;\n\t\tthis.onRejected = typeof onRejected === 'function' ? onRejected : null;\n\t\tthis.resolve = resolve;\n\t\tthis.reject = reject;\n\t}\n\n\t/**\n\t * Take a potentially misbehaving resolver function and make sure\n\t * onFulfilled and onRejected are only called once.\n\t *\n\t * Makes no guarantees about asynchrony.\n\t */\n\tfunction doResolve(fn, onFulfilled, onRejected) {\n\t\tvar done = false;\n\t\ttry {\n\t\t\tfn(function (value) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonFulfilled(value);\n\t\t\t}, function (reason) {\n\t\t\t\tif (done) return;\n\t\t\t\tdone = true;\n\t\t\t\tonRejected(reason);\n\t\t\t})\n\t\t} catch (ex) {\n\t\t\tif (done) return;\n\t\t\tdone = true;\n\t\t\tonRejected(ex);\n\t\t}\n\t}\n\n\tPromise.prototype['catch'] = function (onRejected) {\n\t\treturn this.then(null, onRejected);\n\t};\n\n\tPromise.prototype.then = function(onFulfilled, onRejected) {\n\t\tvar me = this;\n\t\treturn new Promise(function(resolve, reject) {\n\t\t\thandle.call(me, new Handler(onFulfilled, onRejected, resolve, reject));\n\t\t})\n\t};\n\n\tPromise.all = function () {\n\t\tvar args = Array.prototype.slice.call(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments);\n\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tif (args.length === 0) return resolve([]);\n\t\t\tvar remaining = args.length;\n\t\t\tfunction res(i, val) {\n\t\t\t\ttry {\n\t\t\t\t\tif (val && (typeof val === 'object' || typeof val === 'function')) {\n\t\t\t\t\t\tvar then = val.then;\n\t\t\t\t\t\tif (typeof then === 'function') {\n\t\t\t\t\t\t\tthen.call(val, function (val) { res(i, val) }, reject);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\targs[i] = val;\n\t\t\t\t\tif (--remaining === 0) {\n\t\t\t\t\t\tresolve(args);\n\t\t\t\t\t}\n\t\t\t\t} catch (ex) {\n\t\t\t\t\treject(ex);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (var i = 0; i < args.length; i++) {\n\t\t\t\tres(i, args[i]);\n\t\t\t}\n\t\t});\n\t};\n\n\tPromise.resolve = function (value) {\n\t\tif (value && typeof value === 'object' && value.constructor === Promise) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn new Promise(function (resolve) {\n\t\t\tresolve(value);\n\t\t});\n\t};\n\n\tPromise.reject = function (value) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\treject(value);\n\t\t});\n\t};\n\n\tPromise.race = function (values) {\n\t\treturn new Promise(function (resolve, reject) {\n\t\t\tfor(var i = 0, len = values.length; i < len; i++) {\n\t\t\t\tvalues[i].then(resolve, reject);\n\t\t\t}\n\t\t});\n\t};\n\n\t/**\n\t * Set the immediate function to execute callbacks\n\t * @param fn {function} Function to execute\n\t * @private\n\t */\n\tPromise._setImmediateFn = function _setImmediateFn(fn) {\n\t\tasap = fn;\n\t};\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tmodule.exports = Promise;\n\t} else if (!root.Promise) {\n\t\troot.Promise = Promise;\n\t}\n\n})(this);\n",
  287. "var dtype = require('dtype')\nvar anArray = require('an-array')\nvar isBuffer = require('is-buffer')\n\nvar CW = [0, 2, 3]\nvar CCW = [2, 1, 3]\n\nmodule.exports = function createQuadElements(array, opt) {\n //if user didn't specify an output array\n if (!array || !(anArray(array) || isBuffer(array))) {\n opt = array || {}\n array = null\n }\n\n if (typeof opt === 'number') //backwards-compatible\n opt = { count: opt }\n else\n opt = opt || {}\n\n var type = typeof opt.type === 'string' ? opt.type : 'uint16'\n var count = typeof opt.count === 'number' ? opt.count : 1\n var start = (opt.start || 0) \n\n var dir = opt.clockwise !== false ? CW : CCW,\n a = dir[0], \n b = dir[1],\n c = dir[2]\n\n var numIndices = count * 6\n\n var indices = array || new (dtype(type))(numIndices)\n for (var i = 0, j = 0; i < numIndices; i += 6, j += 4) {\n var x = i + start\n indices[x + 0] = j + 0\n indices[x + 1] = j + 1\n indices[x + 2] = j + 2\n indices[x + 3] = j + a\n indices[x + 4] = j + b\n indices[x + 5] = j + c\n }\n return indices\n}",
  288. "'use strict';\n\nvar bind = require('function-bind');\nvar ES = require('es-abstract/es5');\nvar replace = bind.call(Function.call, String.prototype.replace);\n\n/* eslint-disable no-control-regex */\nvar leftWhitespace = /^[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+/;\nvar rightWhitespace = /[\\x09\\x0A\\x0B\\x0C\\x0D\\x20\\xA0\\u1680\\u180E\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200A\\u202F\\u205F\\u3000\\u2028\\u2029\\uFEFF]+$/;\n/* eslint-enable no-control-regex */\n\nmodule.exports = function trim() {\n\tvar S = ES.ToString(ES.CheckObjectCoercible(this));\n\treturn replace(replace(S, leftWhitespace, ''), rightWhitespace, '');\n};\n",
  289. "'use strict';\n\nvar bind = require('function-bind');\nvar define = require('define-properties');\n\nvar implementation = require('./implementation');\nvar getPolyfill = require('./polyfill');\nvar shim = require('./shim');\n\nvar boundTrim = bind.call(Function.call, getPolyfill());\n\ndefine(boundTrim, {\n\tgetPolyfill: getPolyfill,\n\timplementation: implementation,\n\tshim: shim\n});\n\nmodule.exports = boundTrim;\n",
  290. "'use strict';\n\nvar implementation = require('./implementation');\n\nvar zeroWidthSpace = '\\u200b';\n\nmodule.exports = function getPolyfill() {\n\tif (String.prototype.trim && zeroWidthSpace.trim() === zeroWidthSpace) {\n\t\treturn String.prototype.trim;\n\t}\n\treturn implementation;\n};\n",
  291. "'use strict';\n\nvar define = require('define-properties');\nvar getPolyfill = require('./polyfill');\n\nmodule.exports = function shimStringTrim() {\n\tvar polyfill = getPolyfill();\n\tdefine(String.prototype, { trim: polyfill }, {\n\t\ttrim: function testTrim() {\n\t\t\treturn String.prototype.trim !== polyfill;\n\t\t}\n\t});\n\treturn polyfill;\n};\n",
  292. "/*\n * anime.js v3.0.0\n * (c) 2019 Julian Garnier\n * Released under the MIT license\n * animejs.com\n */\n\n'use strict';\n\n// Defaults\n\nvar defaultInstanceSettings = {\n update: null,\n begin: null,\n loopBegin: null,\n changeBegin: null,\n change: null,\n changeComplete: null,\n loopComplete: null,\n complete: null,\n loop: 1,\n direction: 'normal',\n autoplay: true,\n timelineOffset: 0\n};\n\nvar defaultTweenSettings = {\n duration: 1000,\n delay: 0,\n endDelay: 0,\n easing: 'easeOutElastic(1, .5)',\n round: 0\n};\n\nvar validTransforms = ['translateX', 'translateY', 'translateZ', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'scale', 'scaleX', 'scaleY', 'scaleZ', 'skew', 'skewX', 'skewY', 'perspective'];\n\n// Caching\n\nvar cache = {\n CSS: {},\n springs: {}\n};\n\n// Utils\n\nfunction minMax(val, min, max) {\n return Math.min(Math.max(val, min), max);\n}\n\nfunction stringContains(str, text) {\n return str.indexOf(text) > -1;\n}\n\nfunction applyArguments(func, args) {\n return func.apply(null, args);\n}\n\nvar hexRegex = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i;\nvar rgbPrefixRegex = /^rgb/;\nvar hslRegex = /^hsl/;\n\nvar is = {\n arr: function (a) { return Array.isArray(a); },\n obj: function (a) { return stringContains(Object.prototype.toString.call(a), 'Object'); },\n pth: function (a) { return is.obj(a) && a.hasOwnProperty('totalLength'); },\n svg: function (a) { return a instanceof SVGElement; },\n inp: function (a) { return a instanceof HTMLInputElement; },\n dom: function (a) { return a.nodeType || is.svg(a); },\n str: function (a) { return typeof a === 'string'; },\n fnc: function (a) { return typeof a === 'function'; },\n und: function (a) { return typeof a === 'undefined'; },\n hex: function (a) { return hexRegex.test(a); },\n rgb: function (a) { return rgbPrefixRegex.test(a); },\n hsl: function (a) { return hslRegex.test(a); },\n col: function (a) { return (is.hex(a) || is.rgb(a) || is.hsl(a)); },\n key: function (a) { return !defaultInstanceSettings.hasOwnProperty(a) && !defaultTweenSettings.hasOwnProperty(a) && a !== 'targets' && a !== 'keyframes'; }\n};\n\n// Easings\n\nvar easingFunctionRegex = /\\(([^)]+)\\)/;\n\nfunction parseEasingParameters(string) {\n var match = easingFunctionRegex.exec(string);\n return match ? match[1].split(',').map(function (p) { return parseFloat(p); }) : [];\n}\n\n// Spring solver inspired by Webkit Copyright © 2016 Apple Inc. All rights reserved. https://webkit.org/demos/spring/spring.js\n\nfunction spring(string, duration) {\n\n var params = parseEasingParameters(string);\n var mass = minMax(is.und(params[0]) ? 1 : params[0], .1, 100);\n var stiffness = minMax(is.und(params[1]) ? 100 : params[1], .1, 100);\n var damping = minMax(is.und(params[2]) ? 10 : params[2], .1, 100);\n var velocity = minMax(is.und(params[3]) ? 0 : params[3], .1, 100);\n var w0 = Math.sqrt(stiffness / mass);\n var zeta = damping / (2 * Math.sqrt(stiffness * mass));\n var wd = zeta < 1 ? w0 * Math.sqrt(1 - zeta * zeta) : 0;\n var a = 1;\n var b = zeta < 1 ? (zeta * w0 + -velocity) / wd : -velocity + w0;\n\n function solver(t) {\n var progress = duration ? (duration * t) / 1000 : t;\n if (zeta < 1) {\n progress = Math.exp(-progress * zeta * w0) * (a * Math.cos(wd * progress) + b * Math.sin(wd * progress));\n } else {\n progress = (a + b * progress) * Math.exp(-progress * w0);\n }\n if (t === 0 || t === 1) { return t; }\n return 1 - progress;\n }\n\n function getDuration() {\n var cached = cache.springs[string];\n if (cached) { return cached; }\n var frame = 1/6;\n var elapsed = 0;\n var rest = 0;\n while(true) {\n elapsed += frame;\n if (solver(elapsed) === 1) {\n rest++;\n if (rest >= 16) { break; }\n } else {\n rest = 0;\n }\n }\n var duration = elapsed * frame * 1000;\n cache.springs[string] = duration;\n return duration;\n }\n\n return duration ? solver : getDuration;\n\n}\n\n// Elastic easing adapted from jQueryUI http://api.jqueryui.com/easings/\n\nfunction elastic(amplitude, period) {\n if ( amplitude === void 0 ) amplitude = 1;\n if ( period === void 0 ) period = .5;\n\n var a = minMax(amplitude, 1, 10);\n var p = minMax(period, .1, 2);\n return function (t) {\n return (t === 0 || t === 1) ? t :\n -a * Math.pow(2, 10 * (t - 1)) * Math.sin((((t - 1) - (p / (Math.PI * 2) * Math.asin(1 / a))) * (Math.PI * 2)) / p);\n }\n}\n\n// Basic steps easing implementation https://developer.mozilla.org/fr/docs/Web/CSS/transition-timing-function\n\nfunction steps(steps) {\n if ( steps === void 0 ) steps = 10;\n\n return function (t) { return Math.round(t * steps) * (1 / steps); };\n}\n\n// BezierEasing https://github.com/gre/bezier-easing\n\nvar bezier = (function () {\n\n var kSplineTableSize = 11;\n var kSampleStepSize = 1.0 / (kSplineTableSize - 1.0);\n\n function A(aA1, aA2) { return 1.0 - 3.0 * aA2 + 3.0 * aA1 }\n function B(aA1, aA2) { return 3.0 * aA2 - 6.0 * aA1 }\n function C(aA1) { return 3.0 * aA1 }\n\n function calcBezier(aT, aA1, aA2) { return ((A(aA1, aA2) * aT + B(aA1, aA2)) * aT + C(aA1)) * aT }\n function getSlope(aT, aA1, aA2) { return 3.0 * A(aA1, aA2) * aT * aT + 2.0 * B(aA1, aA2) * aT + C(aA1) }\n\n function binarySubdivide(aX, aA, aB, mX1, mX2) {\n var currentX, currentT, i = 0;\n do {\n currentT = aA + (aB - aA) / 2.0;\n currentX = calcBezier(currentT, mX1, mX2) - aX;\n if (currentX > 0.0) { aB = currentT; } else { aA = currentT; }\n } while (Math.abs(currentX) > 0.0000001 && ++i < 10);\n return currentT;\n }\n\n function newtonRaphsonIterate(aX, aGuessT, mX1, mX2) {\n for (var i = 0; i < 4; ++i) {\n var currentSlope = getSlope(aGuessT, mX1, mX2);\n if (currentSlope === 0.0) { return aGuessT; }\n var currentX = calcBezier(aGuessT, mX1, mX2) - aX;\n aGuessT -= currentX / currentSlope;\n }\n return aGuessT;\n }\n\n function bezier(mX1, mY1, mX2, mY2) {\n\n if (!(0 <= mX1 && mX1 <= 1 && 0 <= mX2 && mX2 <= 1)) { return; }\n var sampleValues = new Float32Array(kSplineTableSize);\n\n if (mX1 !== mY1 || mX2 !== mY2) {\n for (var i = 0; i < kSplineTableSize; ++i) {\n sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);\n }\n }\n\n function getTForX(aX) {\n\n var intervalStart = 0;\n var currentSample = 1;\n var lastSample = kSplineTableSize - 1;\n\n for (; currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {\n intervalStart += kSampleStepSize;\n }\n\n --currentSample;\n\n var dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);\n var guessForT = intervalStart + dist * kSampleStepSize;\n var initialSlope = getSlope(guessForT, mX1, mX2);\n\n if (initialSlope >= 0.001) {\n return newtonRaphsonIterate(aX, guessForT, mX1, mX2);\n } else if (initialSlope === 0.0) {\n return guessForT;\n } else {\n return binarySubdivide(aX, intervalStart, intervalStart + kSampleStepSize, mX1, mX2);\n }\n\n }\n\n return function (x) {\n if (mX1 === mY1 && mX2 === mY2) { return x; }\n if (x === 0 || x === 1) { return x; }\n return calcBezier(getTForX(x), mY1, mY2);\n }\n\n }\n\n return bezier;\n\n})();\n\nvar penner = (function () {\n\n var names = ['Quad', 'Cubic', 'Quart', 'Quint', 'Sine', 'Expo', 'Circ', 'Back', 'Elastic'];\n\n // Approximated Penner equations http://matthewlein.com/ceaser/\n\n var curves = {\n In: [\n [0.550, 0.085, 0.680, 0.530], /* inQuad */\n [0.550, 0.055, 0.675, 0.190], /* inCubic */\n [0.895, 0.030, 0.685, 0.220], /* inQuart */\n [0.755, 0.050, 0.855, 0.060], /* inQuint */\n [0.470, 0.000, 0.745, 0.715], /* inSine */\n [0.950, 0.050, 0.795, 0.035], /* inExpo */\n [0.600, 0.040, 0.980, 0.335], /* inCirc */\n [0.600,-0.280, 0.735, 0.045], /* inBack */\n elastic /* inElastic */\n ],\n Out: [\n [0.250, 0.460, 0.450, 0.940], /* outQuad */\n [0.215, 0.610, 0.355, 1.000], /* outCubic */\n [0.165, 0.840, 0.440, 1.000], /* outQuart */\n [0.230, 1.000, 0.320, 1.000], /* outQuint */\n [0.390, 0.575, 0.565, 1.000], /* outSine */\n [0.190, 1.000, 0.220, 1.000], /* outExpo */\n [0.075, 0.820, 0.165, 1.000], /* outCirc */\n [0.175, 0.885, 0.320, 1.275], /* outBack */\n function (a, p) { return function (t) { return 1 - elastic(a, p)(1 - t); }; } /* outElastic */\n ],\n InOut: [\n [0.455, 0.030, 0.515, 0.955], /* inOutQuad */\n [0.645, 0.045, 0.355, 1.000], /* inOutCubic */\n [0.770, 0.000, 0.175, 1.000], /* inOutQuart */\n [0.860, 0.000, 0.070, 1.000], /* inOutQuint */\n [0.445, 0.050, 0.550, 0.950], /* inOutSine */\n [1.000, 0.000, 0.000, 1.000], /* inOutExpo */\n [0.785, 0.135, 0.150, 0.860], /* inOutCirc */\n [0.680,-0.550, 0.265, 1.550], /* inOutBack */\n function (a, p) { return function (t) { return t < .5 ? elastic(a, p)(t * 2) / 2 : 1 - elastic(a, p)(t * -2 + 2) / 2; }; } /* inOutElastic */\n ]\n };\n\n var eases = {\n linear: [0.250, 0.250, 0.750, 0.750]\n };\n\n for (var coords in curves) {\n for (var i = 0, len = curves[coords].length; i < len; i++) {\n eases['ease'+coords+names[i]] = curves[coords][i];\n }\n }\n\n return eases;\n\n})();\n\nfunction parseEasings(easing, duration) {\n if (is.fnc(easing)) { return easing; }\n var name = easing.split('(')[0];\n var ease = penner[name];\n var args = parseEasingParameters(easing);\n switch (name) {\n case 'spring' : return spring(easing, duration);\n case 'cubicBezier' : return applyArguments(bezier, args);\n case 'steps' : return applyArguments(steps, args);\n default : return is.fnc(ease) ? applyArguments(ease, args) : applyArguments(bezier, ease);\n }\n}\n\n// Strings\n\nfunction selectString(str) {\n try {\n var nodes = document.querySelectorAll(str);\n return nodes;\n } catch(e) {\n return;\n }\n}\n\n// Arrays\n\nvar auxArrayFilter = [];\n\nfunction filterArray(arr, callback) {\n var result = auxArrayFilter;\n\n var len = arr.length;\n var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\n for (var i = 0; i < len; i++) {\n if (i in arr) {\n var val = arr[i];\n if (callback.call(thisArg, val, i, arr)) {\n result.push(val);\n }\n }\n }\n\n // arr turns into the auxArray and we return the previously aux array.\n auxArrayFilter = arr;\n auxArrayFilter.length = 0;\n return result;\n}\n\nfunction flattenArray (arr, result) {\n if (!result) { result = []; }\n for (var i = 0, length = arr.length; i < length; i++) {\n var value = arr[i];\n if (Array.isArray(value)) {\n flattenArray(value, result);\n } else {\n result.push(value);\n }\n }\n return result;\n}\n\nfunction toArray(o) {\n if (is.arr(o)) { return o; }\n if (is.str(o)) { o = selectString(o) || o; }\n if (o instanceof NodeList || o instanceof HTMLCollection) { return [].slice.call(o); }\n return [o];\n}\n\nfunction arrayContains(arr, val) {\n return arr.some(function (a) { return a === val; });\n}\n\n// Objects\n\nfunction cloneObject(o) {\n var clone = {};\n for (var p in o) { clone[p] = o[p]; }\n return clone;\n}\n\nfunction replaceObjectProps(o1, o2) {\n var o = cloneObject(o1);\n for (var p in o1) { o[p] = o2.hasOwnProperty(p) ? o2[p] : o1[p]; }\n return o;\n}\n\nfunction mergeObjects(o1, o2) {\n var o = cloneObject(o1);\n for (var p in o2) { o[p] = is.und(o1[p]) ? o2[p] : o1[p]; }\n return o;\n}\n\n// Colors\n\nvar rgbRegex = /rgb\\((\\d+,\\s*[\\d]+,\\s*[\\d]+)\\)/g;\n\nfunction rgbToRgba(rgbValue) {\n var rgb = rgbRegex.exec(rgbValue);\n return rgb ? (\"rgba(\" + (rgb[1]) + \",1)\") : rgbValue;\n}\n\nvar hexToRgbaHexRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\nvar hexToRgbaRgbRegex = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i;\n\nfunction hexToRgba(hexValue) {\n var hex = hexValue.replace(hexToRgbaHexRegex, function (m, r, g, b) { return r + r + g + g + b + b; } );\n var rgb = hexToRgbaRgbRegex.exec(hex);\n var r = parseInt(rgb[1], 16);\n var g = parseInt(rgb[2], 16);\n var b = parseInt(rgb[3], 16);\n return (\"rgba(\" + r + \",\" + g + \",\" + b + \",1)\");\n}\n\nvar hslToRgbaHsl1Regex = /hsl\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%\\)/g;\nvar hslToRgbaHsl2Regex = /hsla\\((\\d+),\\s*([\\d.]+)%,\\s*([\\d.]+)%,\\s*([\\d.]+)\\)/g;\n\nfunction hslToRgba(hslValue) {\n var hsl = hslToRgbaHsl1Regex.exec(hslValue) || hslToRgbaHsl2Regex.exec(hslValue);\n var h = parseInt(hsl[1], 10) / 360;\n var s = parseInt(hsl[2], 10) / 100;\n var l = parseInt(hsl[3], 10) / 100;\n var a = hsl[4] || 1;\n function hue2rgb(p, q, t) {\n if (t < 0) { t += 1; }\n if (t > 1) { t -= 1; }\n if (t < 1/6) { return p + (q - p) * 6 * t; }\n if (t < 1/2) { return q; }\n if (t < 2/3) { return p + (q - p) * (2/3 - t) * 6; }\n return p;\n }\n var r, g, b;\n if (s == 0) {\n r = g = b = l;\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n return (\"rgba(\" + (r * 255) + \",\" + (g * 255) + \",\" + (b * 255) + \",\" + a + \")\");\n}\n\nfunction colorToRgb(val) {\n if (is.rgb(val)) { return rgbToRgba(val); }\n if (is.hex(val)) { return hexToRgba(val); }\n if (is.hsl(val)) { return hslToRgba(val); }\n}\n\n// Units\n\nvar unitRegex = /([\\+\\-]?[0-9#\\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/;\n\nfunction getUnit(val) {\n var split = unitRegex.exec(val);\n if (split) { return split[2]; }\n}\n\nfunction getTransformUnit(propName) {\n if (stringContains(propName, 'translate') || propName === 'perspective') { return 'px'; }\n if (stringContains(propName, 'rotate') || stringContains(propName, 'skew')) { return 'deg'; }\n}\n\n// Values\n\nfunction getFunctionValue(val, animatable) {\n if (!is.fnc(val)) { return val; }\n return val(animatable.target, animatable.id, animatable.total);\n}\n\nfunction getAttribute(el, prop) {\n return el.getAttribute(prop);\n}\n\nfunction convertPxToUnit(el, value, unit) {\n var valueUnit = getUnit(value);\n if (arrayContains([unit, 'deg', 'rad', 'turn'], valueUnit)) { return value; }\n var cached = cache.CSS[value + unit];\n if (!is.und(cached)) { return cached; }\n var baseline = 100;\n var tempEl = document.createElement(el.tagName);\n var parentEl = (el.parentNode && (el.parentNode !== document)) ? el.parentNode : document.body;\n parentEl.appendChild(tempEl);\n tempEl.style.position = 'absolute';\n tempEl.style.width = baseline + unit;\n var factor = baseline / tempEl.offsetWidth;\n parentEl.removeChild(tempEl);\n var convertedUnit = factor * parseFloat(value);\n cache.CSS[value + unit] = convertedUnit;\n return convertedUnit;\n}\n\nfunction getCSSValue(el, prop, unit) {\n if (prop in el.style) {\n var uppercasePropName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n var value = el.style[prop] || getComputedStyle(el).getPropertyValue(uppercasePropName) || '0';\n return unit ? convertPxToUnit(el, value, unit) : value;\n }\n}\n\nfunction getAnimationType(el, prop) {\n if (is.dom(el) && !is.inp(el) && (getAttribute(el, prop) || (is.svg(el) && el[prop]))) { return 'attribute'; }\n if (is.dom(el) && arrayContains(validTransforms, prop)) { return 'transform'; }\n if (is.dom(el) && (prop !== 'transform' && getCSSValue(el, prop))) { return 'css'; }\n if (el[prop] != null) { return 'object'; }\n}\n\nvar transformRegex = /(\\w+)\\(([^)]*)\\)/g;\n\nfunction getElementTransforms(el) {\n if (!is.dom(el)) { return; }\n var str = el.style.transform || '';\n var transforms = new Map();\n var m; while (m = transformRegex.exec(str)) { transforms.set(m[1], m[2]); }\n return transforms;\n}\n\nfunction getTransformValue(el, propName, animatable, unit) {\n var defaultVal = stringContains(propName, 'scale') ? 1 : 0 + getTransformUnit(propName);\n var value = getElementTransforms(el).get(propName) || defaultVal;\n if (animatable) {\n animatable.transforms.list.set(propName, value);\n animatable.transforms['last'] = propName;\n }\n return unit ? convertPxToUnit(el, value, unit) : value;\n}\n\nfunction getOriginalTargetValue(target, propName, unit, animatable) {\n switch (getAnimationType(target, propName)) {\n case 'transform': return getTransformValue(target, propName, animatable, unit);\n case 'css': return getCSSValue(target, propName, unit);\n case 'attribute': return getAttribute(target, propName);\n default: return target[propName] || 0;\n }\n}\n\nvar operatorRegex = /^(\\*=|\\+=|-=)/;\n\nfunction getRelativeValue(to, from) {\n var operator = operatorRegex.exec(to);\n if (!operator) { return to; }\n var u = getUnit(to) || 0;\n var x = parseFloat(from);\n var y = parseFloat(to.replace(operator[0], ''));\n switch (operator[0][0]) {\n case '+': return x + y + u;\n case '-': return x - y + u;\n case '*': return x * y + u;\n }\n}\n\nvar whitespaceRegex = /\\s/g;\n\nfunction validateValue(val, unit) {\n if (is.col(val)) { return colorToRgb(val); }\n var originalUnit = getUnit(val);\n var unitLess = originalUnit ? val.substr(0, val.length - originalUnit.length) : val;\n return unit && !whitespaceRegex.test(val) ? unitLess + unit : unitLess;\n}\n\n// getTotalLength() equivalent for circle, rect, polyline, polygon and line shapes\n// adapted from https://gist.github.com/SebLambla/3e0550c496c236709744\n\nfunction getDistance(p1, p2) {\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}\n\nfunction getCircleLength(el) {\n return Math.PI * 2 * getAttribute(el, 'r');\n}\n\nfunction getRectLength(el) {\n return (getAttribute(el, 'width') * 2) + (getAttribute(el, 'height') * 2);\n}\n\nfunction getLineLength(el) {\n return getDistance(\n {x: getAttribute(el, 'x1'), y: getAttribute(el, 'y1')},\n {x: getAttribute(el, 'x2'), y: getAttribute(el, 'y2')}\n );\n}\n\nfunction getPolylineLength(el) {\n var points = el.points;\n var totalLength = 0;\n var previousPos;\n for (var i = 0 ; i < points.numberOfItems; i++) {\n var currentPos = points.getItem(i);\n if (i > 0) { totalLength += getDistance(previousPos, currentPos); }\n previousPos = currentPos;\n }\n return totalLength;\n}\n\nfunction getPolygonLength(el) {\n var points = el.points;\n return getPolylineLength(el) + getDistance(points.getItem(points.numberOfItems - 1), points.getItem(0));\n}\n\n// Path animation\n\nfunction getTotalLength(el) {\n if (el.getTotalLength) { return el.getTotalLength(); }\n switch(el.tagName.toLowerCase()) {\n case 'circle': return getCircleLength(el);\n case 'rect': return getRectLength(el);\n case 'line': return getLineLength(el);\n case 'polyline': return getPolylineLength(el);\n case 'polygon': return getPolygonLength(el);\n }\n}\n\nfunction setDashoffset(el) {\n var pathLength = getTotalLength(el);\n el.setAttribute('stroke-dasharray', pathLength);\n return pathLength;\n}\n\n// Motion path\n\nfunction getParentSvgEl(el) {\n var parentEl = el.parentNode;\n while (is.svg(parentEl)) {\n parentEl = parentEl.parentNode;\n if (!is.svg(parentEl.parentNode)) { break; }\n }\n return parentEl;\n}\n\nfunction getParentSvg(pathEl, svgData) {\n var svg = svgData || {};\n var parentSvgEl = svg.el || getParentSvgEl(pathEl);\n var rect = parentSvgEl.getBoundingClientRect();\n var viewBoxAttr = getAttribute(parentSvgEl, 'viewBox');\n var width = rect.width;\n var height = rect.height;\n var viewBox = svg.viewBox || (viewBoxAttr ? viewBoxAttr.split(' ') : [0, 0, width, height]);\n return {\n el: parentSvgEl,\n viewBox: viewBox,\n x: viewBox[0] / 1,\n y: viewBox[1] / 1,\n w: width / viewBox[2],\n h: height / viewBox[3]\n }\n}\n\nfunction getPath(path, percent) {\n var pathEl = is.str(path) ? selectString(path)[0] : path;\n var p = percent || 100;\n return function(property) {\n return {\n property: property,\n el: pathEl,\n svg: getParentSvg(pathEl),\n totalLength: getTotalLength(pathEl) * (p / 100)\n }\n }\n}\n\nfunction getPathProgress(path, progress) {\n function point(offset) {\n if ( offset === void 0 ) offset = 0;\n\n var l = progress + offset >= 1 ? progress + offset : 0;\n return path.el.getPointAtLength(l);\n }\n var svg = getParentSvg(path.el, path.svg);\n var p = point();\n var p0 = point(-1);\n var p1 = point(+1);\n switch (path.property) {\n case 'x': return (p.x - svg.x) * svg.w;\n case 'y': return (p.y - svg.y) * svg.h;\n case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;\n }\n}\n\n// Decompose value\n\nvar valueRegex = /-?\\d*\\.?\\d+/g;\n\nfunction decomposeValue(val, unit) {\n var value = validateValue((is.pth(val) ? val.totalLength : val), unit) + '';\n return {\n original: value,\n numbers: value.match(valueRegex) ? value.match(valueRegex).map(Number) : [0],\n strings: (is.str(val) || unit) ? value.split(valueRegex) : []\n }\n}\n\n// Animatables\n\nfunction parseTargets(targets) {\n var targetsArray = targets ? (flattenArray(is.arr(targets) ? targets.map(toArray) : toArray(targets))) : [];\n return filterArray(targetsArray, function (item, pos, self) { return self.indexOf(item) === pos; });\n}\n\nfunction getAnimatables(targets) {\n var parsed = parseTargets(targets);\n return parsed.map(function (t, i) {\n return {target: t, id: i, total: parsed.length, transforms: { list: getElementTransforms(t) } };\n });\n}\n\n// Properties\n\nvar springRegex = /^spring/;\n\nfunction normalizePropertyTweens(prop, tweenSettings) {\n var settings = cloneObject(tweenSettings);\n // Override duration if easing is a spring\n if (springRegex.test(settings.easing)) { settings.duration = spring(settings.easing); }\n if (is.arr(prop)) {\n var l = prop.length;\n var isFromTo = (l === 2 && !is.obj(prop[0]));\n if (!isFromTo) {\n // Duration divided by the number of tweens\n if (!is.fnc(tweenSettings.duration)) { settings.duration = tweenSettings.duration / l; }\n } else {\n // Transform [from, to] values shorthand to a valid tween value\n prop = {value: prop};\n }\n }\n var propArray = is.arr(prop) ? prop : [prop];\n return propArray.map(function (v, i) {\n var obj = (is.obj(v) && !is.pth(v)) ? v : {value: v};\n // Default delay value should only be applied to the first tween\n if (is.und(obj.delay)) { obj.delay = !i ? tweenSettings.delay : 0; }\n // Default endDelay value should only be applied to the last tween\n if (is.und(obj.endDelay)) { obj.endDelay = i === propArray.length - 1 ? tweenSettings.endDelay : 0; }\n return obj;\n }).map(function (k) { return mergeObjects(k, settings); });\n}\n\n\nfunction flattenKeyframes(keyframes) {\n var propertyNames = filterArray(flattenArray(keyframes.map(function (key) { return Object.keys(key); })), function (p) { return is.key(p); })\n .reduce(function (a,b) { if (a.indexOf(b) < 0) { a.push(b); } return a; }, []);\n var properties = {};\n var loop = function ( i ) {\n var propName = propertyNames[i];\n properties[propName] = keyframes.map(function (key) {\n var newKey = {};\n for (var p in key) {\n if (is.key(p)) {\n if (p == propName) { newKey.value = key[p]; }\n } else {\n newKey[p] = key[p];\n }\n }\n return newKey;\n });\n };\n\n for (var i = 0; i < propertyNames.length; i++) loop( i );\n return properties;\n}\n\nfunction getProperties(tweenSettings, params) {\n var properties = [];\n var keyframes = params.keyframes;\n if (keyframes) { params = mergeObjects(flattenKeyframes(keyframes), params); }\n for (var p in params) {\n if (is.key(p)) {\n properties.push({\n name: p,\n tweens: normalizePropertyTweens(params[p], tweenSettings)\n });\n }\n }\n return properties;\n}\n\n// Tweens\n\nfunction normalizeTweenValues(tween, animatable) {\n var t = {};\n for (var p in tween) {\n var value = getFunctionValue(tween[p], animatable);\n if (is.arr(value)) {\n value = value.map(function (v) { return getFunctionValue(v, animatable); });\n if (value.length === 1) { value = value[0]; }\n }\n t[p] = value;\n }\n t.duration = parseFloat(t.duration);\n t.delay = parseFloat(t.delay);\n return t;\n}\n\nfunction normalizeTweens(prop, animatable) {\n var previousTween;\n return prop.tweens.map(function (t) {\n var tween = normalizeTweenValues(t, animatable);\n var tweenValue = tween.value;\n var to = is.arr(tweenValue) ? tweenValue[1] : tweenValue;\n var toUnit = getUnit(to);\n var originalValue = getOriginalTargetValue(animatable.target, prop.name, toUnit, animatable);\n var previousValue = previousTween ? previousTween.to.original : originalValue;\n var from = is.arr(tweenValue) ? tweenValue[0] : previousValue;\n var fromUnit = getUnit(from) || getUnit(originalValue);\n var unit = toUnit || fromUnit;\n if (is.und(to)) { to = previousValue; }\n tween.from = decomposeValue(from, unit);\n tween.to = decomposeValue(getRelativeValue(to, from), unit);\n tween.start = previousTween ? previousTween.end : 0;\n tween.end = tween.start + tween.delay + tween.duration + tween.endDelay;\n tween.easing = parseEasings(tween.easing, tween.duration);\n tween.isPath = is.pth(tweenValue);\n tween.isColor = is.col(tween.from.original);\n if (tween.isColor) { tween.round = 1; }\n previousTween = tween;\n return tween;\n });\n}\n\n// Tween progress\n\nvar setProgressValue = {\n css: function (t, p, v) { return t.style[p] = v; },\n attribute: function (t, p, v) { return t.setAttribute(p, v); },\n object: function (t, p, v) { return t[p] = v; },\n transform: function (t, p, v, transforms, manual) {\n transforms.list.set(p, v);\n if (p === transforms.last || manual) {\n var str = '';\n transforms.list.forEach(function (value, prop) { str += prop + \"(\" + value + \") \"; });\n t.style.transform = str;\n }\n }\n};\n\n// Set Value helper\n\nfunction setTargetsValue(targets, properties) {\n var animatables = getAnimatables(targets);\n\n for (var i = 0, len = animatables.length; i < len; i++) {\n var animatable = animatables[i];\n\n for (var property in properties) {\n var value = getFunctionValue(properties[property], animatable);\n var target = animatable.target;\n var valueUnit = getUnit(value);\n var originalValue = getOriginalTargetValue(target, property, valueUnit, animatable);\n var unit = valueUnit || getUnit(originalValue);\n var to = getRelativeValue(validateValue(value, unit), originalValue);\n var animType = getAnimationType(target, property);\n setProgressValue[animType](target, property, to, animatable.transforms, true);\n }\n }\n}\n\n// Animations\n\nfunction createAnimation(animatable, prop) {\n var animType = getAnimationType(animatable.target, prop.name);\n if (animType) {\n var tweens = normalizeTweens(prop, animatable);\n var lastTween = tweens[tweens.length - 1];\n return {\n type: animType,\n property: prop.name,\n animatable: animatable,\n tweens: tweens,\n duration: lastTween.end,\n delay: tweens[0].delay,\n endDelay: lastTween.endDelay\n }\n }\n}\n\nfunction getAnimations(animatables, properties) {\n return filterArray(flattenArray(animatables.map(function (animatable) {\n return properties.map(function (prop) {\n return createAnimation(animatable, prop);\n });\n })), function (a) { return !is.und(a); });\n}\n\n// Create Instance\n\nfunction getInstanceTimings(animations, tweenSettings) {\n var animLength = animations.length;\n var getTlOffset = function (anim) { return anim.timelineOffset ? anim.timelineOffset : 0; };\n var timings = {};\n timings.duration = animLength ? Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration; })) : tweenSettings.duration;\n timings.delay = animLength ? Math.min.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.delay; })) : tweenSettings.delay;\n timings.endDelay = animLength ? timings.duration - Math.max.apply(Math, animations.map(function (anim) { return getTlOffset(anim) + anim.duration - anim.endDelay; })) : tweenSettings.endDelay;\n return timings;\n}\n\nvar instanceID = 0;\n\nfunction createNewInstance(params) {\n var instanceSettings = replaceObjectProps(defaultInstanceSettings, params);\n var tweenSettings = replaceObjectProps(defaultTweenSettings, params);\n var properties = getProperties(tweenSettings, params);\n var animatables = getAnimatables(params.targets);\n var animations = getAnimations(animatables, properties);\n var timings = getInstanceTimings(animations, tweenSettings);\n var id = instanceID;\n instanceID++;\n return mergeObjects(instanceSettings, {\n id: id,\n children: [],\n animatables: animatables,\n animations: animations,\n duration: timings.duration,\n delay: timings.delay,\n endDelay: timings.endDelay\n });\n}\n\n// Core\n\nvar activeInstances = [];\nvar pausedInstances = [];\nvar raf;\n\nvar engine = (function () {\n function play() {\n raf = requestAnimationFrame(step);\n }\n function step(t) {\n var activeInstancesLength = activeInstances.length;\n if (activeInstancesLength) {\n var i = 0;\n while (i < activeInstancesLength) {\n var activeInstance = activeInstances[i];\n if (!activeInstance.paused) {\n activeInstance.tick(t);\n } else {\n var instanceIndex = activeInstances.indexOf(activeInstance);\n if (instanceIndex > -1) {\n activeInstances.splice(instanceIndex, 1);\n activeInstancesLength = activeInstances.length;\n }\n }\n i++;\n }\n play();\n } else {\n raf = cancelAnimationFrame(raf);\n }\n }\n return play;\n})();\n\nfunction handleVisibilityChange() {\n if (document.hidden) {\n for (var i = 0, len = activeInstances.length; i < len; i++) {\n activeInstance[i].pause();\n }\n pausedInstances = activeInstances.slice(0);\n activeInstances = [];\n } else {\n for (var i$1 = 0, len$1 = pausedInstances.length; i$1 < len$1; i$1++) {\n pausedInstances[i$1].play();\n }\n }\n}\n\ndocument.addEventListener('visibilitychange', handleVisibilityChange);\n\n// Public Instance\n\nfunction anime(params) {\n if ( params === void 0 ) params = {};\n\n\n var startTime = 0, lastTime = 0, now = 0;\n var children, childrenLength = 0;\n var resolve = null;\n\n function makePromise() {\n return window.Promise && new Promise(function (_resolve) { return resolve = _resolve; });\n }\n\n var promise = makePromise();\n\n var instance = createNewInstance(params);\n\n function toggleInstanceDirection() {\n instance.reversed = !instance.reversed;\n for (var i = 0, len = children.length; i < len; i++) {\n children[i].reversed = instance.reversed;\n }\n }\n\n function adjustTime(time) {\n return instance.reversed ? instance.duration - time : time;\n }\n\n function resetTime() {\n startTime = 0;\n lastTime = adjustTime(instance.currentTime) * (1 / anime.speed);\n }\n\n function seekCild(time, child) {\n if (child) { child.seek(time - child.timelineOffset); }\n }\n\n function syncInstanceChildren(time) {\n if (!instance.reversePlayback) {\n for (var i = 0; i < childrenLength; i++) { seekCild(time, children[i]); }\n } else {\n for (var i$1 = childrenLength; i$1--;) { seekCild(time, children[i$1]); }\n }\n }\n\n function setAnimationsProgress(insTime) {\n var i = 0;\n var animations = instance.animations;\n var animationsLength = animations.length;\n while (i < animationsLength) {\n var anim = animations[i];\n var animatable = anim.animatable;\n var tweens = anim.tweens;\n var tweenLength = tweens.length - 1;\n var tween = tweens[tweenLength];\n // Only check for keyframes if there is more than one tween\n if (tweenLength) { tween = filterArray(tweens, function (t) { return (insTime < t.end); })[0] || tween; }\n var elapsed = minMax(insTime - tween.start - tween.delay, 0, tween.duration) / tween.duration;\n var eased = isNaN(elapsed) ? 1 : tween.easing(elapsed);\n var strings = tween.to.strings;\n var round = tween.round;\n var numbers = [];\n var toNumbersLength = tween.to.numbers.length;\n var progress = (void 0);\n for (var n = 0; n < toNumbersLength; n++) {\n var value = (void 0);\n var toNumber = tween.to.numbers[n];\n var fromNumber = tween.from.numbers[n] || 0;\n if (!tween.isPath) {\n value = fromNumber + (eased * (toNumber - fromNumber));\n } else {\n value = getPathProgress(tween.value, eased * toNumber);\n }\n if (round) {\n if (!(tween.isColor && n > 2)) {\n value = Math.round(value * round) / round;\n }\n }\n numbers.push(value);\n }\n // Manual Array.reduce for better performances\n var stringsLength = strings.length;\n if (!stringsLength) {\n progress = numbers[0];\n } else {\n progress = strings[0];\n for (var s = 0; s < stringsLength; s++) {\n var a = strings[s];\n var b = strings[s + 1];\n var n$1 = numbers[s];\n if (!isNaN(n$1)) {\n if (!b) {\n progress += n$1 + ' ';\n } else {\n progress += n$1 + b;\n }\n }\n }\n }\n setProgressValue[anim.type](animatable.target, anim.property, progress, animatable.transforms);\n anim.currentValue = progress;\n i++;\n }\n }\n\n function setCallback(cb) {\n if (instance[cb] && !instance.passThrough) { instance[cb](instance); }\n }\n\n function countIteration() {\n if (instance.remaining && instance.remaining !== true) {\n instance.remaining--;\n }\n }\n\n function setInstanceProgress(engineTime) {\n var insDuration = instance.duration;\n var insDelay = instance.delay;\n var insEndDelay = insDuration - instance.endDelay;\n var insTime = adjustTime(engineTime);\n instance.progress = minMax((insTime / insDuration) * 100, 0, 100);\n instance.reversePlayback = insTime < instance.currentTime;\n if (children) { syncInstanceChildren(insTime); }\n if (!instance.began && instance.currentTime > 0) {\n instance.began = true;\n setCallback('begin');\n setCallback('loopBegin');\n }\n if (insTime <= insDelay && instance.currentTime !== 0) {\n setAnimationsProgress(0);\n }\n if ((insTime >= insEndDelay && instance.currentTime !== insDuration) || !insDuration) {\n setAnimationsProgress(insDuration);\n }\n if (insTime > insDelay && insTime < insEndDelay) {\n if (!instance.changeBegan) {\n instance.changeBegan = true;\n instance.changeCompleted = false;\n setCallback('changeBegin');\n }\n setCallback('change');\n setAnimationsProgress(insTime);\n } else {\n if (instance.changeBegan) {\n instance.changeCompleted = true;\n instance.changeBegan = false;\n setCallback('changeComplete');\n }\n }\n instance.currentTime = minMax(insTime, 0, insDuration);\n if (instance.began) { setCallback('update'); }\n if (engineTime >= insDuration) {\n lastTime = 0;\n countIteration();\n if (instance.remaining) {\n startTime = now;\n setCallback('loopComplete');\n setCallback('loopBegin');\n if (instance.direction === 'alternate') { toggleInstanceDirection(); }\n } else {\n instance.paused = true;\n if (!instance.completed) {\n instance.completed = true;\n setCallback('loopComplete');\n setCallback('complete');\n if ('Promise' in window) {\n resolve();\n promise = makePromise();\n }\n }\n }\n }\n }\n\n instance.reset = function() {\n var direction = instance.direction;\n instance.passThrough = false;\n instance.currentTime = 0;\n instance.progress = 0;\n instance.paused = true;\n instance.began = false;\n instance.changeBegan = false;\n instance.completed = false;\n instance.changeCompleted = false;\n instance.reversePlayback = false;\n instance.reversed = direction === 'reverse';\n instance.remaining = instance.loop;\n children = instance.children;\n childrenLength = children.length;\n for (var i = childrenLength; i--;) { instance.children[i].reset(); }\n if (instance.reversed && instance.loop !== true || (direction === 'alternate' && instance.loop === 1)) { instance.remaining++; }\n setAnimationsProgress(0);\n };\n\n // Set Value helper\n\n instance.set = function(targets, properties) {\n setTargetsValue(targets, properties);\n return instance;\n };\n\n instance.tick = function(t) {\n now = t;\n if (!startTime) { startTime = now; }\n setInstanceProgress((now + (lastTime - startTime)) * anime.speed);\n };\n\n instance.seek = function(time) {\n setInstanceProgress(adjustTime(time));\n };\n\n instance.pause = function() {\n instance.paused = true;\n resetTime();\n };\n\n instance.play = function() {\n if (!instance.paused) { return; }\n instance.paused = false;\n activeInstances.push(instance);\n resetTime();\n if (!raf) { engine(); }\n };\n\n instance.reverse = function() {\n toggleInstanceDirection();\n resetTime();\n };\n\n instance.restart = function() {\n instance.reset();\n instance.play();\n };\n\n instance.finished = promise;\n instance.reset();\n\n if (instance.autoplay) { instance.play(); }\n\n return instance;\n\n}\n\n// Remove targets from animation\n\nfunction removeTargetsFromAnimations(targetsArray, animations) {\n for (var a = animations.length; a--;) {\n if (arrayContains(targetsArray, animations[a].animatable.target)) {\n animations.splice(a, 1);\n }\n }\n}\n\nfunction removeTargets(targets) {\n var targetsArray = parseTargets(targets);\n for (var i = activeInstances.length; i--;) {\n var instance = activeInstances[i];\n var animations = instance.animations;\n var children = instance.children;\n removeTargetsFromAnimations(targetsArray, animations);\n for (var c = children.length; c--;) {\n var child = children[c];\n var childAnimations = child.animations;\n removeTargetsFromAnimations(targetsArray, childAnimations);\n if (!childAnimations.length && !child.children.length) { children.splice(c, 1); }\n }\n if (!animations.length && !children.length) { instance.pause(); }\n }\n}\n\n// Stagger helpers\n\nfunction stagger(val, params) {\n if ( params === void 0 ) params = {};\n\n var direction = params.direction || 'normal';\n var easing = params.easing ? parseEasings(params.easing) : null;\n var grid = params.grid;\n var axis = params.axis;\n var fromIndex = params.from || 0;\n var fromFirst = fromIndex === 'first';\n var fromCenter = fromIndex === 'center';\n var fromLast = fromIndex === 'last';\n var isRange = is.arr(val);\n var val1 = isRange ? parseFloat(val[0]) : parseFloat(val);\n var val2 = isRange ? parseFloat(val[1]) : 0;\n var unit = getUnit(isRange ? val[1] : val) || 0;\n var start = params.start || 0 + (isRange ? val1 : 0);\n var values = [];\n var maxValue = 0;\n return function (el, i, t) {\n if (fromFirst) { fromIndex = 0; }\n if (fromCenter) { fromIndex = (t - 1) / 2; }\n if (fromLast) { fromIndex = t - 1; }\n if (!values.length) {\n for (var index = 0; index < t; index++) {\n if (!grid) {\n values.push(Math.abs(fromIndex - index));\n } else {\n var fromX = !fromCenter ? fromIndex%grid[0] : (grid[0]-1)/2;\n var fromY = !fromCenter ? Math.floor(fromIndex/grid[0]) : (grid[1]-1)/2;\n var toX = index%grid[0];\n var toY = Math.floor(index/grid[0]);\n var distanceX = fromX - toX;\n var distanceY = fromY - toY;\n var value = Math.sqrt(distanceX * distanceX + distanceY * distanceY);\n if (axis === 'x') { value = -distanceX; }\n if (axis === 'y') { value = -distanceY; }\n values.push(value);\n }\n maxValue = Math.max.apply(Math, values);\n }\n if (easing) { values = values.map(function (val) { return easing(val / maxValue) * maxValue; }); }\n if (direction === 'reverse') { values = values.map(function (val) { return axis ? (val < 0) ? val * -1 : -val : Math.abs(maxValue - val); }); }\n }\n var spacing = isRange ? (val2 - val1) / maxValue : val1;\n return start + (spacing * (Math.round(values[i] * 100) / 100)) + unit;\n }\n}\n\n// Timeline\n\nfunction timeline(params) {\n if ( params === void 0 ) params = {};\n\n var tl = anime(params);\n tl.duration = 0;\n tl.add = function(instanceParams, timelineOffset) {\n var tlIndex = activeInstances.indexOf(tl);\n var children = tl.children;\n if (tlIndex > -1) { activeInstances.splice(tlIndex, 1); }\n function passThrough(ins) { ins.passThrough = true; }\n for (var i = 0; i < children.length; i++) { passThrough(children[i]); }\n var insParams = mergeObjects(instanceParams, replaceObjectProps(defaultTweenSettings, params));\n insParams.targets = insParams.targets || params.targets;\n var tlDuration = tl.duration;\n insParams.autoplay = false;\n insParams.direction = tl.direction;\n insParams.timelineOffset = is.und(timelineOffset) ? tlDuration : getRelativeValue(timelineOffset, tlDuration);\n passThrough(tl);\n tl.seek(insParams.timelineOffset);\n var ins = anime(insParams);\n passThrough(ins);\n children.push(ins);\n var timings = getInstanceTimings(children, params);\n tl.delay = timings.delay;\n tl.endDelay = timings.endDelay;\n tl.duration = timings.duration;\n tl.seek(0);\n tl.reset();\n if (tl.autoplay) { tl.play(); }\n return tl;\n };\n return tl;\n}\n\nanime.version = '3.0.0';\nanime.speed = 1;\nanime.running = activeInstances;\nanime.remove = removeTargets;\nanime.get = getOriginalTargetValue;\nanime.set = setTargetsValue;\nanime.convertPx = convertPxToUnit;\nanime.path = getPath;\nanime.setDashoffset = setDashoffset;\nanime.stagger = stagger;\nanime.timeline = timeline;\nanime.easing = parseEasings;\nanime.penner = penner;\nanime.random = function (min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; };\n\nmodule.exports = anime;\n",
  293. "/**\n * @license\n * Copyright 2010-2021 Three.js Authors\n * SPDX-License-Identifier: MIT\n */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.THREE = {}));\n}(this, (function (exports) { 'use strict';\n\n\tconst REVISION = '133';\n\tconst MOUSE = {\n\t\tLEFT: 0,\n\t\tMIDDLE: 1,\n\t\tRIGHT: 2,\n\t\tROTATE: 0,\n\t\tDOLLY: 1,\n\t\tPAN: 2\n\t};\n\tconst TOUCH = {\n\t\tROTATE: 0,\n\t\tPAN: 1,\n\t\tDOLLY_PAN: 2,\n\t\tDOLLY_ROTATE: 3\n\t};\n\tconst CullFaceNone = 0;\n\tconst CullFaceBack = 1;\n\tconst CullFaceFront = 2;\n\tconst CullFaceFrontBack = 3;\n\tconst BasicShadowMap = 0;\n\tconst PCFShadowMap = 1;\n\tconst PCFSoftShadowMap = 2;\n\tconst VSMShadowMap = 3;\n\tconst FrontSide = 0;\n\tconst BackSide = 1;\n\tconst DoubleSide = 2;\n\tconst FlatShading = 1;\n\tconst SmoothShading = 2;\n\tconst NoBlending = 0;\n\tconst NormalBlending = 1;\n\tconst AdditiveBlending = 2;\n\tconst SubtractiveBlending = 3;\n\tconst MultiplyBlending = 4;\n\tconst CustomBlending = 5;\n\tconst AddEquation = 100;\n\tconst SubtractEquation = 101;\n\tconst ReverseSubtractEquation = 102;\n\tconst MinEquation = 103;\n\tconst MaxEquation = 104;\n\tconst ZeroFactor = 200;\n\tconst OneFactor = 201;\n\tconst SrcColorFactor = 202;\n\tconst OneMinusSrcColorFactor = 203;\n\tconst SrcAlphaFactor = 204;\n\tconst OneMinusSrcAlphaFactor = 205;\n\tconst DstAlphaFactor = 206;\n\tconst OneMinusDstAlphaFactor = 207;\n\tconst DstColorFactor = 208;\n\tconst OneMinusDstColorFactor = 209;\n\tconst SrcAlphaSaturateFactor = 210;\n\tconst NeverDepth = 0;\n\tconst AlwaysDepth = 1;\n\tconst LessDepth = 2;\n\tconst LessEqualDepth = 3;\n\tconst EqualDepth = 4;\n\tconst GreaterEqualDepth = 5;\n\tconst GreaterDepth = 6;\n\tconst NotEqualDepth = 7;\n\tconst MultiplyOperation = 0;\n\tconst MixOperation = 1;\n\tconst AddOperation = 2;\n\tconst NoToneMapping = 0;\n\tconst LinearToneMapping = 1;\n\tconst ReinhardToneMapping = 2;\n\tconst CineonToneMapping = 3;\n\tconst ACESFilmicToneMapping = 4;\n\tconst CustomToneMapping = 5;\n\tconst UVMapping = 300;\n\tconst CubeReflectionMapping = 301;\n\tconst CubeRefractionMapping = 302;\n\tconst EquirectangularReflectionMapping = 303;\n\tconst EquirectangularRefractionMapping = 304;\n\tconst CubeUVReflectionMapping = 306;\n\tconst CubeUVRefractionMapping = 307;\n\tconst RepeatWrapping = 1000;\n\tconst ClampToEdgeWrapping = 1001;\n\tconst MirroredRepeatWrapping = 1002;\n\tconst NearestFilter = 1003;\n\tconst NearestMipmapNearestFilter = 1004;\n\tconst NearestMipMapNearestFilter = 1004;\n\tconst NearestMipmapLinearFilter = 1005;\n\tconst NearestMipMapLinearFilter = 1005;\n\tconst LinearFilter = 1006;\n\tconst LinearMipmapNearestFilter = 1007;\n\tconst LinearMipMapNearestFilter = 1007;\n\tconst LinearMipmapLinearFilter = 1008;\n\tconst LinearMipMapLinearFilter = 1008;\n\tconst UnsignedByteType = 1009;\n\tconst ByteType = 1010;\n\tconst ShortType = 1011;\n\tconst UnsignedShortType = 1012;\n\tconst IntType = 1013;\n\tconst UnsignedIntType = 1014;\n\tconst FloatType = 1015;\n\tconst HalfFloatType = 1016;\n\tconst UnsignedShort4444Type = 1017;\n\tconst UnsignedShort5551Type = 1018;\n\tconst UnsignedShort565Type = 1019;\n\tconst UnsignedInt248Type = 1020;\n\tconst AlphaFormat = 1021;\n\tconst RGBFormat = 1022;\n\tconst RGBAFormat = 1023;\n\tconst LuminanceFormat = 1024;\n\tconst LuminanceAlphaFormat = 1025;\n\tconst RGBEFormat = RGBAFormat;\n\tconst DepthFormat = 1026;\n\tconst DepthStencilFormat = 1027;\n\tconst RedFormat = 1028;\n\tconst RedIntegerFormat = 1029;\n\tconst RGFormat = 1030;\n\tconst RGIntegerFormat = 1031;\n\tconst RGBIntegerFormat = 1032;\n\tconst RGBAIntegerFormat = 1033;\n\tconst RGB_S3TC_DXT1_Format = 33776;\n\tconst RGBA_S3TC_DXT1_Format = 33777;\n\tconst RGBA_S3TC_DXT3_Format = 33778;\n\tconst RGBA_S3TC_DXT5_Format = 33779;\n\tconst RGB_PVRTC_4BPPV1_Format = 35840;\n\tconst RGB_PVRTC_2BPPV1_Format = 35841;\n\tconst RGBA_PVRTC_4BPPV1_Format = 35842;\n\tconst RGBA_PVRTC_2BPPV1_Format = 35843;\n\tconst RGB_ETC1_Format = 36196;\n\tconst RGB_ETC2_Format = 37492;\n\tconst RGBA_ETC2_EAC_Format = 37496;\n\tconst RGBA_ASTC_4x4_Format = 37808;\n\tconst RGBA_ASTC_5x4_Format = 37809;\n\tconst RGBA_ASTC_5x5_Format = 37810;\n\tconst RGBA_ASTC_6x5_Format = 37811;\n\tconst RGBA_ASTC_6x6_Format = 37812;\n\tconst RGBA_ASTC_8x5_Format = 37813;\n\tconst RGBA_ASTC_8x6_Format = 37814;\n\tconst RGBA_ASTC_8x8_Format = 37815;\n\tconst RGBA_ASTC_10x5_Format = 37816;\n\tconst RGBA_ASTC_10x6_Format = 37817;\n\tconst RGBA_ASTC_10x8_Format = 37818;\n\tconst RGBA_ASTC_10x10_Format = 37819;\n\tconst RGBA_ASTC_12x10_Format = 37820;\n\tconst RGBA_ASTC_12x12_Format = 37821;\n\tconst RGBA_BPTC_Format = 36492;\n\tconst SRGB8_ALPHA8_ASTC_4x4_Format = 37840;\n\tconst SRGB8_ALPHA8_ASTC_5x4_Format = 37841;\n\tconst SRGB8_ALPHA8_ASTC_5x5_Format = 37842;\n\tconst SRGB8_ALPHA8_ASTC_6x5_Format = 37843;\n\tconst SRGB8_ALPHA8_ASTC_6x6_Format = 37844;\n\tconst SRGB8_ALPHA8_ASTC_8x5_Format = 37845;\n\tconst SRGB8_ALPHA8_ASTC_8x6_Format = 37846;\n\tconst SRGB8_ALPHA8_ASTC_8x8_Format = 37847;\n\tconst SRGB8_ALPHA8_ASTC_10x5_Format = 37848;\n\tconst SRGB8_ALPHA8_ASTC_10x6_Format = 37849;\n\tconst SRGB8_ALPHA8_ASTC_10x8_Format = 37850;\n\tconst SRGB8_ALPHA8_ASTC_10x10_Format = 37851;\n\tconst SRGB8_ALPHA8_ASTC_12x10_Format = 37852;\n\tconst SRGB8_ALPHA8_ASTC_12x12_Format = 37853;\n\tconst LoopOnce = 2200;\n\tconst LoopRepeat = 2201;\n\tconst LoopPingPong = 2202;\n\tconst InterpolateDiscrete = 2300;\n\tconst InterpolateLinear = 2301;\n\tconst InterpolateSmooth = 2302;\n\tconst ZeroCurvatureEnding = 2400;\n\tconst ZeroSlopeEnding = 2401;\n\tconst WrapAroundEnding = 2402;\n\tconst NormalAnimationBlendMode = 2500;\n\tconst AdditiveAnimationBlendMode = 2501;\n\tconst TrianglesDrawMode = 0;\n\tconst TriangleStripDrawMode = 1;\n\tconst TriangleFanDrawMode = 2;\n\tconst LinearEncoding = 3000;\n\tconst sRGBEncoding = 3001;\n\tconst GammaEncoding = 3007;\n\tconst RGBEEncoding = 3002;\n\tconst LogLuvEncoding = 3003;\n\tconst RGBM7Encoding = 3004;\n\tconst RGBM16Encoding = 3005;\n\tconst RGBDEncoding = 3006;\n\tconst BasicDepthPacking = 3200;\n\tconst RGBADepthPacking = 3201;\n\tconst TangentSpaceNormalMap = 0;\n\tconst ObjectSpaceNormalMap = 1;\n\tconst ZeroStencilOp = 0;\n\tconst KeepStencilOp = 7680;\n\tconst ReplaceStencilOp = 7681;\n\tconst IncrementStencilOp = 7682;\n\tconst DecrementStencilOp = 7683;\n\tconst IncrementWrapStencilOp = 34055;\n\tconst DecrementWrapStencilOp = 34056;\n\tconst InvertStencilOp = 5386;\n\tconst NeverStencilFunc = 512;\n\tconst LessStencilFunc = 513;\n\tconst EqualStencilFunc = 514;\n\tconst LessEqualStencilFunc = 515;\n\tconst GreaterStencilFunc = 516;\n\tconst NotEqualStencilFunc = 517;\n\tconst GreaterEqualStencilFunc = 518;\n\tconst AlwaysStencilFunc = 519;\n\tconst StaticDrawUsage = 35044;\n\tconst DynamicDrawUsage = 35048;\n\tconst StreamDrawUsage = 35040;\n\tconst StaticReadUsage = 35045;\n\tconst DynamicReadUsage = 35049;\n\tconst StreamReadUsage = 35041;\n\tconst StaticCopyUsage = 35046;\n\tconst DynamicCopyUsage = 35050;\n\tconst StreamCopyUsage = 35042;\n\tconst GLSL1 = '100';\n\tconst GLSL3 = '300 es';\n\n\t/**\n\t * https://github.com/mrdoob/eventdispatcher.js/\n\t */\n\tclass EventDispatcher {\n\t\taddEventListener(type, listener) {\n\t\t\tif (this._listeners === undefined) this._listeners = {};\n\t\t\tconst listeners = this._listeners;\n\n\t\t\tif (listeners[type] === undefined) {\n\t\t\t\tlisteners[type] = [];\n\t\t\t}\n\n\t\t\tif (listeners[type].indexOf(listener) === -1) {\n\t\t\t\tlisteners[type].push(listener);\n\t\t\t}\n\t\t}\n\n\t\thasEventListener(type, listener) {\n\t\t\tif (this._listeners === undefined) return false;\n\t\t\tconst listeners = this._listeners;\n\t\t\treturn listeners[type] !== undefined && listeners[type].indexOf(listener) !== -1;\n\t\t}\n\n\t\tremoveEventListener(type, listener) {\n\t\t\tif (this._listeners === undefined) return;\n\t\t\tconst listeners = this._listeners;\n\t\t\tconst listenerArray = listeners[type];\n\n\t\t\tif (listenerArray !== undefined) {\n\t\t\t\tconst index = listenerArray.indexOf(listener);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tlistenerArray.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tdispatchEvent(event) {\n\t\t\tif (this._listeners === undefined) return;\n\t\t\tconst listeners = this._listeners;\n\t\t\tconst listenerArray = listeners[event.type];\n\n\t\t\tif (listenerArray !== undefined) {\n\t\t\t\tevent.target = this; // Make a copy, in case listeners are removed while iterating.\n\n\t\t\t\tconst array = listenerArray.slice(0);\n\n\t\t\t\tfor (let i = 0, l = array.length; i < l; i++) {\n\t\t\t\t\tarray[i].call(this, event);\n\t\t\t\t}\n\n\t\t\t\tevent.target = null;\n\t\t\t}\n\t\t}\n\n\t}\n\n\tlet _seed = 1234567;\n\tconst DEG2RAD = Math.PI / 180;\n\tconst RAD2DEG = 180 / Math.PI; //\n\n\tconst _lut = [];\n\n\tfor (let i = 0; i < 256; i++) {\n\t\t_lut[i] = (i < 16 ? '0' : '') + i.toString(16);\n\t}\n\n\tconst hasRandomUUID = typeof crypto !== 'undefined' && 'randomUUID' in crypto;\n\n\tfunction generateUUID() {\n\t\tif (hasRandomUUID) {\n\t\t\treturn crypto.randomUUID().toUpperCase();\n\t\t} // TODO Remove this code when crypto.randomUUID() is available everywhere\n\t\t// http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/21963136#21963136\n\n\n\t\tconst d0 = Math.random() * 0xffffffff | 0;\n\t\tconst d1 = Math.random() * 0xffffffff | 0;\n\t\tconst d2 = Math.random() * 0xffffffff | 0;\n\t\tconst d3 = Math.random() * 0xffffffff | 0;\n\t\tconst uuid = _lut[d0 & 0xff] + _lut[d0 >> 8 & 0xff] + _lut[d0 >> 16 & 0xff] + _lut[d0 >> 24 & 0xff] + '-' + _lut[d1 & 0xff] + _lut[d1 >> 8 & 0xff] + '-' + _lut[d1 >> 16 & 0x0f | 0x40] + _lut[d1 >> 24 & 0xff] + '-' + _lut[d2 & 0x3f | 0x80] + _lut[d2 >> 8 & 0xff] + '-' + _lut[d2 >> 16 & 0xff] + _lut[d2 >> 24 & 0xff] + _lut[d3 & 0xff] + _lut[d3 >> 8 & 0xff] + _lut[d3 >> 16 & 0xff] + _lut[d3 >> 24 & 0xff]; // .toUpperCase() here flattens concatenated strings to save heap memory space.\n\n\t\treturn uuid.toUpperCase();\n\t}\n\n\tfunction clamp(value, min, max) {\n\t\treturn Math.max(min, Math.min(max, value));\n\t} // compute euclidian modulo of m % n\n\t// https://en.wikipedia.org/wiki/Modulo_operation\n\n\n\tfunction euclideanModulo(n, m) {\n\t\treturn (n % m + m) % m;\n\t} // Linear mapping from range <a1, a2> to range <b1, b2>\n\n\n\tfunction mapLinear(x, a1, a2, b1, b2) {\n\t\treturn b1 + (x - a1) * (b2 - b1) / (a2 - a1);\n\t} // https://www.gamedev.net/tutorials/programming/general-and-gameplay-programming/inverse-lerp-a-super-useful-yet-often-overlooked-function-r5230/\n\n\n\tfunction inverseLerp(x, y, value) {\n\t\tif (x !== y) {\n\t\t\treturn (value - x) / (y - x);\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t} // https://en.wikipedia.org/wiki/Linear_interpolation\n\n\n\tfunction lerp(x, y, t) {\n\t\treturn (1 - t) * x + t * y;\n\t} // http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/\n\n\n\tfunction damp(x, y, lambda, dt) {\n\t\treturn lerp(x, y, 1 - Math.exp(-lambda * dt));\n\t} // https://www.desmos.com/calculator/vcsjnyz7x4\n\n\n\tfunction pingpong(x, length = 1) {\n\t\treturn length - Math.abs(euclideanModulo(x, length * 2) - length);\n\t} // http://en.wikipedia.org/wiki/Smoothstep\n\n\n\tfunction smoothstep(x, min, max) {\n\t\tif (x <= min) return 0;\n\t\tif (x >= max) return 1;\n\t\tx = (x - min) / (max - min);\n\t\treturn x * x * (3 - 2 * x);\n\t}\n\n\tfunction smootherstep(x, min, max) {\n\t\tif (x <= min) return 0;\n\t\tif (x >= max) return 1;\n\t\tx = (x - min) / (max - min);\n\t\treturn x * x * x * (x * (x * 6 - 15) + 10);\n\t} // Random integer from <low, high> interval\n\n\n\tfunction randInt(low, high) {\n\t\treturn low + Math.floor(Math.random() * (high - low + 1));\n\t} // Random float from <low, high> interval\n\n\n\tfunction randFloat(low, high) {\n\t\treturn low + Math.random() * (high - low);\n\t} // Random float from <-range/2, range/2> interval\n\n\n\tfunction randFloatSpread(range) {\n\t\treturn range * (0.5 - Math.random());\n\t} // Deterministic pseudo-random float in the interval [ 0, 1 ]\n\n\n\tfunction seededRandom(s) {\n\t\tif (s !== undefined) _seed = s % 2147483647; // Park-Miller algorithm\n\n\t\t_seed = _seed * 16807 % 2147483647;\n\t\treturn (_seed - 1) / 2147483646;\n\t}\n\n\tfunction degToRad(degrees) {\n\t\treturn degrees * DEG2RAD;\n\t}\n\n\tfunction radToDeg(radians) {\n\t\treturn radians * RAD2DEG;\n\t}\n\n\tfunction isPowerOfTwo(value) {\n\t\treturn (value & value - 1) === 0 && value !== 0;\n\t}\n\n\tfunction ceilPowerOfTwo(value) {\n\t\treturn Math.pow(2, Math.ceil(Math.log(value) / Math.LN2));\n\t}\n\n\tfunction floorPowerOfTwo(value) {\n\t\treturn Math.pow(2, Math.floor(Math.log(value) / Math.LN2));\n\t}\n\n\tfunction setQuaternionFromProperEuler(q, a, b, c, order) {\n\t\t// Intrinsic Proper Euler Angles - see https://en.wikipedia.org/wiki/Euler_angles\n\t\t// rotations are applied to the axes in the order specified by 'order'\n\t\t// rotation by angle 'a' is applied first, then by angle 'b', then by angle 'c'\n\t\t// angles are in radians\n\t\tconst cos = Math.cos;\n\t\tconst sin = Math.sin;\n\t\tconst c2 = cos(b / 2);\n\t\tconst s2 = sin(b / 2);\n\t\tconst c13 = cos((a + c) / 2);\n\t\tconst s13 = sin((a + c) / 2);\n\t\tconst c1_3 = cos((a - c) / 2);\n\t\tconst s1_3 = sin((a - c) / 2);\n\t\tconst c3_1 = cos((c - a) / 2);\n\t\tconst s3_1 = sin((c - a) / 2);\n\n\t\tswitch (order) {\n\t\t\tcase 'XYX':\n\t\t\t\tq.set(c2 * s13, s2 * c1_3, s2 * s1_3, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'YZY':\n\t\t\t\tq.set(s2 * s1_3, c2 * s13, s2 * c1_3, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZXZ':\n\t\t\t\tq.set(s2 * c1_3, s2 * s1_3, c2 * s13, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'XZX':\n\t\t\t\tq.set(c2 * s13, s2 * s3_1, s2 * c3_1, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'YXY':\n\t\t\t\tq.set(s2 * c3_1, c2 * s13, s2 * s3_1, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ZYZ':\n\t\t\t\tq.set(s2 * s3_1, s2 * c3_1, c2 * s13, c2 * c13);\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order);\n\t\t}\n\t}\n\n\tvar MathUtils = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tDEG2RAD: DEG2RAD,\n\t\tRAD2DEG: RAD2DEG,\n\t\tgenerateUUID: generateUUID,\n\t\tclamp: clamp,\n\t\teuclideanModulo: euclideanModulo,\n\t\tmapLinear: mapLinear,\n\t\tinverseLerp: inverseLerp,\n\t\tlerp: lerp,\n\t\tdamp: damp,\n\t\tpingpong: pingpong,\n\t\tsmoothstep: smoothstep,\n\t\tsmootherstep: smootherstep,\n\t\trandInt: randInt,\n\t\trandFloat: randFloat,\n\t\trandFloatSpread: randFloatSpread,\n\t\tseededRandom: seededRandom,\n\t\tdegToRad: degToRad,\n\t\tradToDeg: radToDeg,\n\t\tisPowerOfTwo: isPowerOfTwo,\n\t\tceilPowerOfTwo: ceilPowerOfTwo,\n\t\tfloorPowerOfTwo: floorPowerOfTwo,\n\t\tsetQuaternionFromProperEuler: setQuaternionFromProperEuler\n\t});\n\n\tclass Vector2 {\n\t\tconstructor(x = 0, y = 0) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t}\n\n\t\tget width() {\n\t\t\treturn this.x;\n\t\t}\n\n\t\tset width(value) {\n\t\t\tthis.x = value;\n\t\t}\n\n\t\tget height() {\n\t\t\treturn this.y;\n\t\t}\n\n\t\tset height(value) {\n\t\t\tthis.y = value;\n\t\t}\n\n\t\tset(x, y) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(x) {\n\t\t\tthis.x = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(y) {\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponent(index, value) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.x = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.y = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetComponent(index) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn this.x;\n\n\t\t\t\tcase 1:\n\t\t\t\t\treturn this.y;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.x, this.y);\n\t\t}\n\n\t\tcopy(v) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\t\t\t\treturn this.addVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\treturn this;\n\t\t}\n\n\t\taddVectors(a, b) {\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledVector(v, s) {\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\t\t\t\treturn this.subVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubScalar(s) {\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubVectors(a, b) {\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(v) {\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(scalar) {\n\t\t\tthis.x *= scalar;\n\t\t\tthis.y *= scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivide(v) {\n\t\t\tthis.x /= v.x;\n\t\t\tthis.y /= v.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivideScalar(scalar) {\n\t\t\treturn this.multiplyScalar(1 / scalar);\n\t\t}\n\n\t\tapplyMatrix3(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[3] * y + e[6];\n\t\t\tthis.y = e[1] * x + e[4] * y + e[7];\n\t\t\treturn this;\n\t\t}\n\n\t\tmin(v) {\n\t\t\tthis.x = Math.min(this.x, v.x);\n\t\t\tthis.y = Math.min(this.y, v.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tmax(v) {\n\t\t\tthis.x = Math.max(this.x, v.x);\n\t\t\tthis.y = Math.max(this.y, v.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tclamp(min, max) {\n\t\t\t// assumes min < max, componentwise\n\t\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampScalar(minVal, maxVal) {\n\t\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampLength(min, max) {\n\t\t\tconst length = this.length();\n\t\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t\t}\n\n\t\tfloor() {\n\t\t\tthis.x = Math.floor(this.x);\n\t\t\tthis.y = Math.floor(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tceil() {\n\t\t\tthis.x = Math.ceil(this.x);\n\t\t\tthis.y = Math.ceil(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tround() {\n\t\t\tthis.x = Math.round(this.x);\n\t\t\tthis.y = Math.round(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\troundToZero() {\n\t\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.x = -this.x;\n\t\t\tthis.y = -this.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this.x * v.x + this.y * v.y;\n\t\t}\n\n\t\tcross(v) {\n\t\t\treturn this.x * v.y - this.y * v.x;\n\t\t}\n\n\t\tlengthSq() {\n\t\t\treturn this.x * this.x + this.y * this.y;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y);\n\t\t}\n\n\t\tmanhattanLength() {\n\t\t\treturn Math.abs(this.x) + Math.abs(this.y);\n\t\t}\n\n\t\tnormalize() {\n\t\t\treturn this.divideScalar(this.length() || 1);\n\t\t}\n\n\t\tangle() {\n\t\t\t// computes the angle in radians with respect to the positive x-axis\n\t\t\tconst angle = Math.atan2(-this.y, -this.x) + Math.PI;\n\t\t\treturn angle;\n\t\t}\n\n\t\tdistanceTo(v) {\n\t\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t\t}\n\n\t\tdistanceToSquared(v) {\n\t\t\tconst dx = this.x - v.x,\n\t\t\t\t\t\tdy = this.y - v.y;\n\t\t\treturn dx * dx + dy * dy;\n\t\t}\n\n\t\tmanhattanDistanceTo(v) {\n\t\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y);\n\t\t}\n\n\t\tsetLength(length) {\n\t\t\treturn this.normalize().multiplyScalar(length);\n\t\t}\n\n\t\tlerp(v, alpha) {\n\t\t\tthis.x += (v.x - this.x) * alpha;\n\t\t\tthis.y += (v.y - this.y) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpVectors(v1, v2, alpha) {\n\t\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(v) {\n\t\t\treturn v.x === this.x && v.y === this.y;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.x = array[offset];\n\t\t\tthis.y = array[offset + 1];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.x;\n\t\t\tarray[offset + 1] = this.y;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index, offset) {\n\t\t\tif (offset !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector2: offset has been removed from .fromBufferAttribute().');\n\t\t\t}\n\n\t\t\tthis.x = attribute.getX(index);\n\t\t\tthis.y = attribute.getY(index);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateAround(center, angle) {\n\t\t\tconst c = Math.cos(angle),\n\t\t\t\t\t\ts = Math.sin(angle);\n\t\t\tconst x = this.x - center.x;\n\t\t\tconst y = this.y - center.y;\n\t\t\tthis.x = x * c - y * s + center.x;\n\t\t\tthis.y = x * s + y * c + center.y;\n\t\t\treturn this;\n\t\t}\n\n\t\trandom() {\n\t\t\tthis.x = Math.random();\n\t\t\tthis.y = Math.random();\n\t\t\treturn this;\n\t\t}\n\n\t\t*[Symbol.iterator]() {\n\t\t\tyield this.x;\n\t\t\tyield this.y;\n\t\t}\n\n\t}\n\n\tVector2.prototype.isVector2 = true;\n\n\tclass Matrix3 {\n\t\tconstructor() {\n\t\t\tthis.elements = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\t\tif (arguments.length > 0) {\n\t\t\t\tconsole.error('THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.');\n\t\t\t}\n\t\t}\n\n\t\tset(n11, n12, n13, n21, n22, n23, n31, n32, n33) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] = n11;\n\t\t\tte[1] = n21;\n\t\t\tte[2] = n31;\n\t\t\tte[3] = n12;\n\t\t\tte[4] = n22;\n\t\t\tte[5] = n32;\n\t\t\tte[6] = n13;\n\t\t\tte[7] = n23;\n\t\t\tte[8] = n33;\n\t\t\treturn this;\n\t\t}\n\n\t\tidentity() {\n\t\t\tthis.set(1, 0, 0, 0, 1, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(m) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = m.elements;\n\t\t\tte[0] = me[0];\n\t\t\tte[1] = me[1];\n\t\t\tte[2] = me[2];\n\t\t\tte[3] = me[3];\n\t\t\tte[4] = me[4];\n\t\t\tte[5] = me[5];\n\t\t\tte[6] = me[6];\n\t\t\tte[7] = me[7];\n\t\t\tte[8] = me[8];\n\t\t\treturn this;\n\t\t}\n\n\t\textractBasis(xAxis, yAxis, zAxis) {\n\t\t\txAxis.setFromMatrix3Column(this, 0);\n\t\t\tyAxis.setFromMatrix3Column(this, 1);\n\t\t\tzAxis.setFromMatrix3Column(this, 2);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrix4(m) {\n\t\t\tconst me = m.elements;\n\t\t\tthis.set(me[0], me[4], me[8], me[1], me[5], me[9], me[2], me[6], me[10]);\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(m) {\n\t\t\treturn this.multiplyMatrices(this, m);\n\t\t}\n\n\t\tpremultiply(m) {\n\t\t\treturn this.multiplyMatrices(m, this);\n\t\t}\n\n\t\tmultiplyMatrices(a, b) {\n\t\t\tconst ae = a.elements;\n\t\t\tconst be = b.elements;\n\t\t\tconst te = this.elements;\n\t\t\tconst a11 = ae[0],\n\t\t\t\t\t\ta12 = ae[3],\n\t\t\t\t\t\ta13 = ae[6];\n\t\t\tconst a21 = ae[1],\n\t\t\t\t\t\ta22 = ae[4],\n\t\t\t\t\t\ta23 = ae[7];\n\t\t\tconst a31 = ae[2],\n\t\t\t\t\t\ta32 = ae[5],\n\t\t\t\t\t\ta33 = ae[8];\n\t\t\tconst b11 = be[0],\n\t\t\t\t\t\tb12 = be[3],\n\t\t\t\t\t\tb13 = be[6];\n\t\t\tconst b21 = be[1],\n\t\t\t\t\t\tb22 = be[4],\n\t\t\t\t\t\tb23 = be[7];\n\t\t\tconst b31 = be[2],\n\t\t\t\t\t\tb32 = be[5],\n\t\t\t\t\t\tb33 = be[8];\n\t\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31;\n\t\t\tte[3] = a11 * b12 + a12 * b22 + a13 * b32;\n\t\t\tte[6] = a11 * b13 + a12 * b23 + a13 * b33;\n\t\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31;\n\t\t\tte[4] = a21 * b12 + a22 * b22 + a23 * b32;\n\t\t\tte[7] = a21 * b13 + a22 * b23 + a23 * b33;\n\t\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31;\n\t\t\tte[5] = a31 * b12 + a32 * b22 + a33 * b32;\n\t\t\tte[8] = a31 * b13 + a32 * b23 + a33 * b33;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(s) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] *= s;\n\t\t\tte[3] *= s;\n\t\t\tte[6] *= s;\n\t\t\tte[1] *= s;\n\t\t\tte[4] *= s;\n\t\t\tte[7] *= s;\n\t\t\tte[2] *= s;\n\t\t\tte[5] *= s;\n\t\t\tte[8] *= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tdeterminant() {\n\t\t\tconst te = this.elements;\n\t\t\tconst a = te[0],\n\t\t\t\t\t\tb = te[1],\n\t\t\t\t\t\tc = te[2],\n\t\t\t\t\t\td = te[3],\n\t\t\t\t\t\te = te[4],\n\t\t\t\t\t\tf = te[5],\n\t\t\t\t\t\tg = te[6],\n\t\t\t\t\t\th = te[7],\n\t\t\t\t\t\ti = te[8];\n\t\t\treturn a * e * i - a * f * h - b * d * i + b * f * g + c * d * h - c * e * g;\n\t\t}\n\n\t\tinvert() {\n\t\t\tconst te = this.elements,\n\t\t\t\t\t\tn11 = te[0],\n\t\t\t\t\t\tn21 = te[1],\n\t\t\t\t\t\tn31 = te[2],\n\t\t\t\t\t\tn12 = te[3],\n\t\t\t\t\t\tn22 = te[4],\n\t\t\t\t\t\tn32 = te[5],\n\t\t\t\t\t\tn13 = te[6],\n\t\t\t\t\t\tn23 = te[7],\n\t\t\t\t\t\tn33 = te[8],\n\t\t\t\t\t\tt11 = n33 * n22 - n32 * n23,\n\t\t\t\t\t\tt12 = n32 * n13 - n33 * n12,\n\t\t\t\t\t\tt13 = n23 * n12 - n22 * n13,\n\t\t\t\t\t\tdet = n11 * t11 + n21 * t12 + n31 * t13;\n\t\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\t\tconst detInv = 1 / det;\n\t\t\tte[0] = t11 * detInv;\n\t\t\tte[1] = (n31 * n23 - n33 * n21) * detInv;\n\t\t\tte[2] = (n32 * n21 - n31 * n22) * detInv;\n\t\t\tte[3] = t12 * detInv;\n\t\t\tte[4] = (n33 * n11 - n31 * n13) * detInv;\n\t\t\tte[5] = (n31 * n12 - n32 * n11) * detInv;\n\t\t\tte[6] = t13 * detInv;\n\t\t\tte[7] = (n21 * n13 - n23 * n11) * detInv;\n\t\t\tte[8] = (n22 * n11 - n21 * n12) * detInv;\n\t\t\treturn this;\n\t\t}\n\n\t\ttranspose() {\n\t\t\tlet tmp;\n\t\t\tconst m = this.elements;\n\t\t\ttmp = m[1];\n\t\t\tm[1] = m[3];\n\t\t\tm[3] = tmp;\n\t\t\ttmp = m[2];\n\t\t\tm[2] = m[6];\n\t\t\tm[6] = tmp;\n\t\t\ttmp = m[5];\n\t\t\tm[5] = m[7];\n\t\t\tm[7] = tmp;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetNormalMatrix(matrix4) {\n\t\t\treturn this.setFromMatrix4(matrix4).invert().transpose();\n\t\t}\n\n\t\ttransposeIntoArray(r) {\n\t\t\tconst m = this.elements;\n\t\t\tr[0] = m[0];\n\t\t\tr[1] = m[3];\n\t\t\tr[2] = m[6];\n\t\t\tr[3] = m[1];\n\t\t\tr[4] = m[4];\n\t\t\tr[5] = m[7];\n\t\t\tr[6] = m[2];\n\t\t\tr[7] = m[5];\n\t\t\tr[8] = m[8];\n\t\t\treturn this;\n\t\t}\n\n\t\tsetUvTransform(tx, ty, sx, sy, rotation, cx, cy) {\n\t\t\tconst c = Math.cos(rotation);\n\t\t\tconst s = Math.sin(rotation);\n\t\t\tthis.set(sx * c, sx * s, -sx * (c * cx + s * cy) + cx + tx, -sy * s, sy * c, -sy * (-s * cx + c * cy) + cy + ty, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(sx, sy) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] *= sx;\n\t\t\tte[3] *= sx;\n\t\t\tte[6] *= sx;\n\t\t\tte[1] *= sy;\n\t\t\tte[4] *= sy;\n\t\t\tte[7] *= sy;\n\t\t\treturn this;\n\t\t}\n\n\t\trotate(theta) {\n\t\t\tconst c = Math.cos(theta);\n\t\t\tconst s = Math.sin(theta);\n\t\t\tconst te = this.elements;\n\t\t\tconst a11 = te[0],\n\t\t\t\t\t\ta12 = te[3],\n\t\t\t\t\t\ta13 = te[6];\n\t\t\tconst a21 = te[1],\n\t\t\t\t\t\ta22 = te[4],\n\t\t\t\t\t\ta23 = te[7];\n\t\t\tte[0] = c * a11 + s * a21;\n\t\t\tte[3] = c * a12 + s * a22;\n\t\t\tte[6] = c * a13 + s * a23;\n\t\t\tte[1] = -s * a11 + c * a21;\n\t\t\tte[4] = -s * a12 + c * a22;\n\t\t\tte[7] = -s * a13 + c * a23;\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(tx, ty) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] += tx * te[2];\n\t\t\tte[3] += tx * te[5];\n\t\t\tte[6] += tx * te[8];\n\t\t\tte[1] += ty * te[2];\n\t\t\tte[4] += ty * te[5];\n\t\t\tte[7] += ty * te[8];\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(matrix) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = matrix.elements;\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tif (te[i] !== me[i]) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.elements[i] = array[i + offset];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tconst te = this.elements;\n\t\t\tarray[offset] = te[0];\n\t\t\tarray[offset + 1] = te[1];\n\t\t\tarray[offset + 2] = te[2];\n\t\t\tarray[offset + 3] = te[3];\n\t\t\tarray[offset + 4] = te[4];\n\t\t\tarray[offset + 5] = te[5];\n\t\t\tarray[offset + 6] = te[6];\n\t\t\tarray[offset + 7] = te[7];\n\t\t\tarray[offset + 8] = te[8];\n\t\t\treturn array;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().fromArray(this.elements);\n\t\t}\n\n\t}\n\n\tMatrix3.prototype.isMatrix3 = true;\n\n\tfunction arrayMax(array) {\n\t\tif (array.length === 0) return -Infinity;\n\t\tlet max = array[0];\n\n\t\tfor (let i = 1, l = array.length; i < l; ++i) {\n\t\t\tif (array[i] > max) max = array[i];\n\t\t}\n\n\t\treturn max;\n\t}\n\n\tconst TYPED_ARRAYS = {\n\t\tInt8Array: Int8Array,\n\t\tUint8Array: Uint8Array,\n\t\tUint8ClampedArray: Uint8ClampedArray,\n\t\tInt16Array: Int16Array,\n\t\tUint16Array: Uint16Array,\n\t\tInt32Array: Int32Array,\n\t\tUint32Array: Uint32Array,\n\t\tFloat32Array: Float32Array,\n\t\tFloat64Array: Float64Array\n\t};\n\n\tfunction getTypedArray(type, buffer) {\n\t\treturn new TYPED_ARRAYS[type](buffer);\n\t}\n\n\tfunction createElementNS(name) {\n\t\treturn document.createElementNS('http://www.w3.org/1999/xhtml', name);\n\t}\n\n\tlet _canvas;\n\n\tclass ImageUtils {\n\t\tstatic getDataURL(image) {\n\t\t\tif (/^data:/i.test(image.src)) {\n\t\t\t\treturn image.src;\n\t\t\t}\n\n\t\t\tif (typeof HTMLCanvasElement == 'undefined') {\n\t\t\t\treturn image.src;\n\t\t\t}\n\n\t\t\tlet canvas;\n\n\t\t\tif (image instanceof HTMLCanvasElement) {\n\t\t\t\tcanvas = image;\n\t\t\t} else {\n\t\t\t\tif (_canvas === undefined) _canvas = createElementNS('canvas');\n\t\t\t\t_canvas.width = image.width;\n\t\t\t\t_canvas.height = image.height;\n\n\t\t\t\tconst context = _canvas.getContext('2d');\n\n\t\t\t\tif (image instanceof ImageData) {\n\t\t\t\t\tcontext.putImageData(image, 0, 0);\n\t\t\t\t} else {\n\t\t\t\t\tcontext.drawImage(image, 0, 0, image.width, image.height);\n\t\t\t\t}\n\n\t\t\t\tcanvas = _canvas;\n\t\t\t}\n\n\t\t\tif (canvas.width > 2048 || canvas.height > 2048) {\n\t\t\t\tconsole.warn('THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons', image);\n\t\t\t\treturn canvas.toDataURL('image/jpeg', 0.6);\n\t\t\t} else {\n\t\t\t\treturn canvas.toDataURL('image/png');\n\t\t\t}\n\t\t}\n\n\t}\n\n\tlet textureId = 0;\n\n\tclass Texture extends EventDispatcher {\n\t\tconstructor(image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding) {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: textureId++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.image = image;\n\t\t\tthis.mipmaps = [];\n\t\t\tthis.mapping = mapping;\n\t\t\tthis.wrapS = wrapS;\n\t\t\tthis.wrapT = wrapT;\n\t\t\tthis.magFilter = magFilter;\n\t\t\tthis.minFilter = minFilter;\n\t\t\tthis.anisotropy = anisotropy;\n\t\t\tthis.format = format;\n\t\t\tthis.internalFormat = null;\n\t\t\tthis.type = type;\n\t\t\tthis.offset = new Vector2(0, 0);\n\t\t\tthis.repeat = new Vector2(1, 1);\n\t\t\tthis.center = new Vector2(0, 0);\n\t\t\tthis.rotation = 0;\n\t\t\tthis.matrixAutoUpdate = true;\n\t\t\tthis.matrix = new Matrix3();\n\t\t\tthis.generateMipmaps = true;\n\t\t\tthis.premultiplyAlpha = false;\n\t\t\tthis.flipY = true;\n\t\t\tthis.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)\n\t\t\t// Values of encoding !== THREE.LinearEncoding only supported on map, envMap and emissiveMap.\n\t\t\t//\n\t\t\t// Also changing the encoding after already used by a Material will not automatically make the Material\n\t\t\t// update. You need to explicitly call Material.needsUpdate to trigger it to recompile.\n\n\t\t\tthis.encoding = encoding;\n\t\t\tthis.version = 0;\n\t\t\tthis.onUpdate = null;\n\t\t\tthis.isRenderTargetTexture = false;\n\t\t}\n\n\t\tupdateMatrix() {\n\t\t\tthis.matrix.setUvTransform(this.offset.x, this.offset.y, this.repeat.x, this.repeat.y, this.rotation, this.center.x, this.center.y);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.image = source.image;\n\t\t\tthis.mipmaps = source.mipmaps.slice(0);\n\t\t\tthis.mapping = source.mapping;\n\t\t\tthis.wrapS = source.wrapS;\n\t\t\tthis.wrapT = source.wrapT;\n\t\t\tthis.magFilter = source.magFilter;\n\t\t\tthis.minFilter = source.minFilter;\n\t\t\tthis.anisotropy = source.anisotropy;\n\t\t\tthis.format = source.format;\n\t\t\tthis.internalFormat = source.internalFormat;\n\t\t\tthis.type = source.type;\n\t\t\tthis.offset.copy(source.offset);\n\t\t\tthis.repeat.copy(source.repeat);\n\t\t\tthis.center.copy(source.center);\n\t\t\tthis.rotation = source.rotation;\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\tthis.matrix.copy(source.matrix);\n\t\t\tthis.generateMipmaps = source.generateMipmaps;\n\t\t\tthis.premultiplyAlpha = source.premultiplyAlpha;\n\t\t\tthis.flipY = source.flipY;\n\t\t\tthis.unpackAlignment = source.unpackAlignment;\n\t\t\tthis.encoding = source.encoding;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst isRootObject = meta === undefined || typeof meta === 'string';\n\n\t\t\tif (!isRootObject && meta.textures[this.uuid] !== undefined) {\n\t\t\t\treturn meta.textures[this.uuid];\n\t\t\t}\n\n\t\t\tconst output = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Texture',\n\t\t\t\t\tgenerator: 'Texture.toJSON'\n\t\t\t\t},\n\t\t\t\tuuid: this.uuid,\n\t\t\t\tname: this.name,\n\t\t\t\tmapping: this.mapping,\n\t\t\t\trepeat: [this.repeat.x, this.repeat.y],\n\t\t\t\toffset: [this.offset.x, this.offset.y],\n\t\t\t\tcenter: [this.center.x, this.center.y],\n\t\t\t\trotation: this.rotation,\n\t\t\t\twrap: [this.wrapS, this.wrapT],\n\t\t\t\tformat: this.format,\n\t\t\t\ttype: this.type,\n\t\t\t\tencoding: this.encoding,\n\t\t\t\tminFilter: this.minFilter,\n\t\t\t\tmagFilter: this.magFilter,\n\t\t\t\tanisotropy: this.anisotropy,\n\t\t\t\tflipY: this.flipY,\n\t\t\t\tpremultiplyAlpha: this.premultiplyAlpha,\n\t\t\t\tunpackAlignment: this.unpackAlignment\n\t\t\t};\n\n\t\t\tif (this.image !== undefined) {\n\t\t\t\t// TODO: Move to THREE.Image\n\t\t\t\tconst image = this.image;\n\n\t\t\t\tif (image.uuid === undefined) {\n\t\t\t\t\timage.uuid = generateUUID(); // UGH\n\t\t\t\t}\n\n\t\t\t\tif (!isRootObject && meta.images[image.uuid] === undefined) {\n\t\t\t\t\tlet url;\n\n\t\t\t\t\tif (Array.isArray(image)) {\n\t\t\t\t\t\t// process array of images e.g. CubeTexture\n\t\t\t\t\t\turl = [];\n\n\t\t\t\t\t\tfor (let i = 0, l = image.length; i < l; i++) {\n\t\t\t\t\t\t\t// check cube texture with data textures\n\t\t\t\t\t\t\tif (image[i].isDataTexture) {\n\t\t\t\t\t\t\t\turl.push(serializeImage(image[i].image));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\turl.push(serializeImage(image[i]));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// process single image\n\t\t\t\t\t\turl = serializeImage(image);\n\t\t\t\t\t}\n\n\t\t\t\t\tmeta.images[image.uuid] = {\n\t\t\t\t\t\tuuid: image.uuid,\n\t\t\t\t\t\turl: url\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\toutput.image = image.uuid;\n\t\t\t}\n\n\t\t\tif (!isRootObject) {\n\t\t\t\tmeta.textures[this.uuid] = output;\n\t\t\t}\n\n\t\t\treturn output;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t\ttransformUv(uv) {\n\t\t\tif (this.mapping !== UVMapping) return uv;\n\t\t\tuv.applyMatrix3(this.matrix);\n\n\t\t\tif (uv.x < 0 || uv.x > 1) {\n\t\t\t\tswitch (this.wrapS) {\n\t\t\t\t\tcase RepeatWrapping:\n\t\t\t\t\t\tuv.x = uv.x - Math.floor(uv.x);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ClampToEdgeWrapping:\n\t\t\t\t\t\tuv.x = uv.x < 0 ? 0 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MirroredRepeatWrapping:\n\t\t\t\t\t\tif (Math.abs(Math.floor(uv.x) % 2) === 1) {\n\t\t\t\t\t\t\tuv.x = Math.ceil(uv.x) - uv.x;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuv.x = uv.x - Math.floor(uv.x);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (uv.y < 0 || uv.y > 1) {\n\t\t\t\tswitch (this.wrapT) {\n\t\t\t\t\tcase RepeatWrapping:\n\t\t\t\t\t\tuv.y = uv.y - Math.floor(uv.y);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase ClampToEdgeWrapping:\n\t\t\t\t\t\tuv.y = uv.y < 0 ? 0 : 1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase MirroredRepeatWrapping:\n\t\t\t\t\t\tif (Math.abs(Math.floor(uv.y) % 2) === 1) {\n\t\t\t\t\t\t\tuv.y = Math.ceil(uv.y) - uv.y;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tuv.y = uv.y - Math.floor(uv.y);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.flipY) {\n\t\t\t\tuv.y = 1 - uv.y;\n\t\t\t}\n\n\t\t\treturn uv;\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t}\n\n\tTexture.DEFAULT_IMAGE = undefined;\n\tTexture.DEFAULT_MAPPING = UVMapping;\n\tTexture.prototype.isTexture = true;\n\n\tfunction serializeImage(image) {\n\t\tif (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement || typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap) {\n\t\t\t// default images\n\t\t\treturn ImageUtils.getDataURL(image);\n\t\t} else {\n\t\t\tif (image.data) {\n\t\t\t\t// images of DataTexture\n\t\t\t\treturn {\n\t\t\t\t\tdata: Array.prototype.slice.call(image.data),\n\t\t\t\t\twidth: image.width,\n\t\t\t\t\theight: image.height,\n\t\t\t\t\ttype: image.data.constructor.name\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tconsole.warn('THREE.Texture: Unable to serialize Texture.');\n\t\t\t\treturn {};\n\t\t\t}\n\t\t}\n\t}\n\n\tclass Vector4 {\n\t\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\tthis.w = w;\n\t\t}\n\n\t\tget width() {\n\t\t\treturn this.z;\n\t\t}\n\n\t\tset width(value) {\n\t\t\tthis.z = value;\n\t\t}\n\n\t\tget height() {\n\t\t\treturn this.w;\n\t\t}\n\n\t\tset height(value) {\n\t\t\tthis.w = value;\n\t\t}\n\n\t\tset(x, y, z, w) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\tthis.w = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\tthis.z = scalar;\n\t\t\tthis.w = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(x) {\n\t\t\tthis.x = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(y) {\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetZ(z) {\n\t\t\tthis.z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetW(w) {\n\t\t\tthis.w = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponent(index, value) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.x = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.y = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.z = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\tthis.w = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetComponent(index) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn this.x;\n\n\t\t\t\tcase 1:\n\t\t\t\t\treturn this.y;\n\n\t\t\t\tcase 2:\n\t\t\t\t\treturn this.z;\n\n\t\t\t\tcase 3:\n\t\t\t\t\treturn this.w;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.x, this.y, this.z, this.w);\n\t\t}\n\n\t\tcopy(v) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\tthis.z = v.z;\n\t\t\tthis.w = v.w !== undefined ? v.w : 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\t\t\t\treturn this.addVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\tthis.z += v.z;\n\t\t\tthis.w += v.w;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\tthis.z += s;\n\t\t\tthis.w += s;\n\t\t\treturn this;\n\t\t}\n\n\t\taddVectors(a, b) {\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\tthis.z = a.z + b.z;\n\t\t\tthis.w = a.w + b.w;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledVector(v, s) {\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\tthis.z += v.z * s;\n\t\t\tthis.w += v.w * s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\t\t\t\treturn this.subVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\tthis.z -= v.z;\n\t\t\tthis.w -= v.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubScalar(s) {\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\tthis.z -= s;\n\t\t\tthis.w -= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubVectors(a, b) {\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\tthis.z = a.z - b.z;\n\t\t\tthis.w = a.w - b.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(v) {\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\tthis.z *= v.z;\n\t\t\tthis.w *= v.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(scalar) {\n\t\t\tthis.x *= scalar;\n\t\t\tthis.y *= scalar;\n\t\t\tthis.z *= scalar;\n\t\t\tthis.w *= scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z,\n\t\t\t\t\t\tw = this.w;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[4] * y + e[8] * z + e[12] * w;\n\t\t\tthis.y = e[1] * x + e[5] * y + e[9] * z + e[13] * w;\n\t\t\tthis.z = e[2] * x + e[6] * y + e[10] * z + e[14] * w;\n\t\t\tthis.w = e[3] * x + e[7] * y + e[11] * z + e[15] * w;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivideScalar(scalar) {\n\t\t\treturn this.multiplyScalar(1 / scalar);\n\t\t}\n\n\t\tsetAxisAngleFromQuaternion(q) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\t\t\t// q is assumed to be normalized\n\t\t\tthis.w = 2 * Math.acos(q.w);\n\t\t\tconst s = Math.sqrt(1 - q.w * q.w);\n\n\t\t\tif (s < 0.0001) {\n\t\t\t\tthis.x = 1;\n\t\t\t\tthis.y = 0;\n\t\t\t\tthis.z = 0;\n\t\t\t} else {\n\t\t\t\tthis.x = q.x / s;\n\t\t\t\tthis.y = q.y / s;\n\t\t\t\tthis.z = q.z / s;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetAxisAngleFromRotationMatrix(m) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tlet angle, x, y, z; // variables for result\n\n\t\t\tconst epsilon = 0.01,\n\t\t\t\t\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\n\t\t\t\t\t\t// margin to distinguish between 0 and 180 degrees\n\t\t\tte = m.elements,\n\t\t\t\t\t\tm11 = te[0],\n\t\t\t\t\t\tm12 = te[4],\n\t\t\t\t\t\tm13 = te[8],\n\t\t\t\t\t\tm21 = te[1],\n\t\t\t\t\t\tm22 = te[5],\n\t\t\t\t\t\tm23 = te[9],\n\t\t\t\t\t\tm31 = te[2],\n\t\t\t\t\t\tm32 = te[6],\n\t\t\t\t\t\tm33 = te[10];\n\n\t\t\tif (Math.abs(m12 - m21) < epsilon && Math.abs(m13 - m31) < epsilon && Math.abs(m23 - m32) < epsilon) {\n\t\t\t\t// singularity found\n\t\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t\t// in leading diagonal and zero in other terms\n\t\t\t\tif (Math.abs(m12 + m21) < epsilon2 && Math.abs(m13 + m31) < epsilon2 && Math.abs(m23 + m32) < epsilon2 && Math.abs(m11 + m22 + m33 - 3) < epsilon2) {\n\t\t\t\t\t// this singularity is identity matrix so angle = 0\n\t\t\t\t\tthis.set(1, 0, 0, 0);\n\t\t\t\t\treturn this; // zero angle, arbitrary axis\n\t\t\t\t} // otherwise this singularity is angle = 180\n\n\n\t\t\t\tangle = Math.PI;\n\t\t\t\tconst xx = (m11 + 1) / 2;\n\t\t\t\tconst yy = (m22 + 1) / 2;\n\t\t\t\tconst zz = (m33 + 1) / 2;\n\t\t\t\tconst xy = (m12 + m21) / 4;\n\t\t\t\tconst xz = (m13 + m31) / 4;\n\t\t\t\tconst yz = (m23 + m32) / 4;\n\n\t\t\t\tif (xx > yy && xx > zz) {\n\t\t\t\t\t// m11 is the largest diagonal term\n\t\t\t\t\tif (xx < epsilon) {\n\t\t\t\t\t\tx = 0;\n\t\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\t\tz = 0.707106781;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tx = Math.sqrt(xx);\n\t\t\t\t\t\ty = xy / x;\n\t\t\t\t\t\tz = xz / x;\n\t\t\t\t\t}\n\t\t\t\t} else if (yy > zz) {\n\t\t\t\t\t// m22 is the largest diagonal term\n\t\t\t\t\tif (yy < epsilon) {\n\t\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\t\ty = 0;\n\t\t\t\t\t\tz = 0.707106781;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ty = Math.sqrt(yy);\n\t\t\t\t\t\tx = xy / y;\n\t\t\t\t\t\tz = yz / y;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// m33 is the largest diagonal term so base result on this\n\t\t\t\t\tif (zz < epsilon) {\n\t\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\t\tz = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tz = Math.sqrt(zz);\n\t\t\t\t\t\tx = xz / z;\n\t\t\t\t\t\ty = yz / z;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.set(x, y, z, angle);\n\t\t\t\treturn this; // return 180 deg rotation\n\t\t\t} // as we have reached here there are no singularities so we can handle normally\n\n\n\t\t\tlet s = Math.sqrt((m32 - m23) * (m32 - m23) + (m13 - m31) * (m13 - m31) + (m21 - m12) * (m21 - m12)); // used to normalize\n\n\t\t\tif (Math.abs(s) < 0.001) s = 1; // prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\t\tthis.x = (m32 - m23) / s;\n\t\t\tthis.y = (m13 - m31) / s;\n\t\t\tthis.z = (m21 - m12) / s;\n\t\t\tthis.w = Math.acos((m11 + m22 + m33 - 1) / 2);\n\t\t\treturn this;\n\t\t}\n\n\t\tmin(v) {\n\t\t\tthis.x = Math.min(this.x, v.x);\n\t\t\tthis.y = Math.min(this.y, v.y);\n\t\t\tthis.z = Math.min(this.z, v.z);\n\t\t\tthis.w = Math.min(this.w, v.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tmax(v) {\n\t\t\tthis.x = Math.max(this.x, v.x);\n\t\t\tthis.y = Math.max(this.y, v.y);\n\t\t\tthis.z = Math.max(this.z, v.z);\n\t\t\tthis.w = Math.max(this.w, v.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tclamp(min, max) {\n\t\t\t// assumes min < max, componentwise\n\t\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\t\tthis.w = Math.max(min.w, Math.min(max.w, this.w));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampScalar(minVal, maxVal) {\n\t\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\t\tthis.w = Math.max(minVal, Math.min(maxVal, this.w));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampLength(min, max) {\n\t\t\tconst length = this.length();\n\t\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t\t}\n\n\t\tfloor() {\n\t\t\tthis.x = Math.floor(this.x);\n\t\t\tthis.y = Math.floor(this.y);\n\t\t\tthis.z = Math.floor(this.z);\n\t\t\tthis.w = Math.floor(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tceil() {\n\t\t\tthis.x = Math.ceil(this.x);\n\t\t\tthis.y = Math.ceil(this.y);\n\t\t\tthis.z = Math.ceil(this.z);\n\t\t\tthis.w = Math.ceil(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tround() {\n\t\t\tthis.x = Math.round(this.x);\n\t\t\tthis.y = Math.round(this.y);\n\t\t\tthis.z = Math.round(this.z);\n\t\t\tthis.w = Math.round(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\troundToZero() {\n\t\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\t\tthis.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w);\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.x = -this.x;\n\t\t\tthis.y = -this.y;\n\t\t\tthis.z = -this.z;\n\t\t\tthis.w = -this.w;\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\t\t}\n\n\t\tlengthSq() {\n\t\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n\t\t}\n\n\t\tmanhattanLength() {\n\t\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w);\n\t\t}\n\n\t\tnormalize() {\n\t\t\treturn this.divideScalar(this.length() || 1);\n\t\t}\n\n\t\tsetLength(length) {\n\t\t\treturn this.normalize().multiplyScalar(length);\n\t\t}\n\n\t\tlerp(v, alpha) {\n\t\t\tthis.x += (v.x - this.x) * alpha;\n\t\t\tthis.y += (v.y - this.y) * alpha;\n\t\t\tthis.z += (v.z - this.z) * alpha;\n\t\t\tthis.w += (v.w - this.w) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpVectors(v1, v2, alpha) {\n\t\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\t\tthis.w = v1.w + (v2.w - v1.w) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(v) {\n\t\t\treturn v.x === this.x && v.y === this.y && v.z === this.z && v.w === this.w;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.x = array[offset];\n\t\t\tthis.y = array[offset + 1];\n\t\t\tthis.z = array[offset + 2];\n\t\t\tthis.w = array[offset + 3];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.x;\n\t\t\tarray[offset + 1] = this.y;\n\t\t\tarray[offset + 2] = this.z;\n\t\t\tarray[offset + 3] = this.w;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index, offset) {\n\t\t\tif (offset !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector4: offset has been removed from .fromBufferAttribute().');\n\t\t\t}\n\n\t\t\tthis.x = attribute.getX(index);\n\t\t\tthis.y = attribute.getY(index);\n\t\t\tthis.z = attribute.getZ(index);\n\t\t\tthis.w = attribute.getW(index);\n\t\t\treturn this;\n\t\t}\n\n\t\trandom() {\n\t\t\tthis.x = Math.random();\n\t\t\tthis.y = Math.random();\n\t\t\tthis.z = Math.random();\n\t\t\tthis.w = Math.random();\n\t\t\treturn this;\n\t\t}\n\n\t\t*[Symbol.iterator]() {\n\t\t\tyield this.x;\n\t\t\tyield this.y;\n\t\t\tyield this.z;\n\t\t\tyield this.w;\n\t\t}\n\n\t}\n\n\tVector4.prototype.isVector4 = true;\n\n\t/*\n\t In options, we can specify:\n\t * Texture parameters for an auto-generated target texture\n\t * depthBuffer/stencilBuffer: Booleans to indicate if we should generate these buffers\n\t*/\n\n\tclass WebGLRenderTarget extends EventDispatcher {\n\t\tconstructor(width, height, options = {}) {\n\t\t\tsuper();\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t\tthis.depth = 1;\n\t\t\tthis.scissor = new Vector4(0, 0, width, height);\n\t\t\tthis.scissorTest = false;\n\t\t\tthis.viewport = new Vector4(0, 0, width, height);\n\t\t\tthis.texture = new Texture(undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);\n\t\t\tthis.texture.isRenderTargetTexture = true;\n\t\t\tthis.texture.image = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tdepth: 1\n\t\t\t};\n\t\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\t\tthis.texture.internalFormat = options.internalFormat !== undefined ? options.internalFormat : null;\n\t\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\t\t\tthis.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;\n\t\t\tthis.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;\n\t\t\tthis.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;\n\t\t}\n\n\t\tsetTexture(texture) {\n\t\t\ttexture.image = {\n\t\t\t\twidth: this.width,\n\t\t\t\theight: this.height,\n\t\t\t\tdepth: this.depth\n\t\t\t};\n\t\t\tthis.texture = texture;\n\t\t}\n\n\t\tsetSize(width, height, depth = 1) {\n\t\t\tif (this.width !== width || this.height !== height || this.depth !== depth) {\n\t\t\t\tthis.width = width;\n\t\t\t\tthis.height = height;\n\t\t\t\tthis.depth = depth;\n\t\t\t\tthis.texture.image.width = width;\n\t\t\t\tthis.texture.image.height = height;\n\t\t\t\tthis.texture.image.depth = depth;\n\t\t\t\tthis.dispose();\n\t\t\t}\n\n\t\t\tthis.viewport.set(0, 0, width, height);\n\t\t\tthis.scissor.set(0, 0, width, height);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\t\t\tthis.depth = source.depth;\n\t\t\tthis.viewport.copy(source.viewport);\n\t\t\tthis.texture = source.texture.clone();\n\t\t\tthis.texture.image = { ...this.texture.image\n\t\t\t}; // See #20328.\n\n\t\t\tthis.depthBuffer = source.depthBuffer;\n\t\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\t\tthis.depthTexture = source.depthTexture;\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t}\n\n\tWebGLRenderTarget.prototype.isWebGLRenderTarget = true;\n\n\tclass WebGLMultipleRenderTargets extends WebGLRenderTarget {\n\t\tconstructor(width, height, count) {\n\t\t\tsuper(width, height);\n\t\t\tconst texture = this.texture;\n\t\t\tthis.texture = [];\n\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tthis.texture[i] = texture.clone();\n\t\t\t}\n\t\t}\n\n\t\tsetSize(width, height, depth = 1) {\n\t\t\tif (this.width !== width || this.height !== height || this.depth !== depth) {\n\t\t\t\tthis.width = width;\n\t\t\t\tthis.height = height;\n\t\t\t\tthis.depth = depth;\n\n\t\t\t\tfor (let i = 0, il = this.texture.length; i < il; i++) {\n\t\t\t\t\tthis.texture[i].image.width = width;\n\t\t\t\t\tthis.texture[i].image.height = height;\n\t\t\t\t\tthis.texture[i].image.depth = depth;\n\t\t\t\t}\n\n\t\t\t\tthis.dispose();\n\t\t\t}\n\n\t\t\tthis.viewport.set(0, 0, width, height);\n\t\t\tthis.scissor.set(0, 0, width, height);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.dispose();\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\t\t\tthis.depth = source.depth;\n\t\t\tthis.viewport.set(0, 0, this.width, this.height);\n\t\t\tthis.scissor.set(0, 0, this.width, this.height);\n\t\t\tthis.depthBuffer = source.depthBuffer;\n\t\t\tthis.stencilBuffer = source.stencilBuffer;\n\t\t\tthis.depthTexture = source.depthTexture;\n\t\t\tthis.texture.length = 0;\n\n\t\t\tfor (let i = 0, il = source.texture.length; i < il; i++) {\n\t\t\t\tthis.texture[i] = source.texture[i].clone();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tWebGLMultipleRenderTargets.prototype.isWebGLMultipleRenderTargets = true;\n\n\tclass WebGLMultisampleRenderTarget extends WebGLRenderTarget {\n\t\tconstructor(width, height, options) {\n\t\t\tsuper(width, height, options);\n\t\t\tthis.samples = 4;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy.call(this, source);\n\t\t\tthis.samples = source.samples;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tWebGLMultisampleRenderTarget.prototype.isWebGLMultisampleRenderTarget = true;\n\n\tclass Quaternion {\n\t\tconstructor(x = 0, y = 0, z = 0, w = 1) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._w = w;\n\t\t}\n\n\t\tstatic slerp(qa, qb, qm, t) {\n\t\t\tconsole.warn('THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.');\n\t\t\treturn qm.slerpQuaternions(qa, qb, t);\n\t\t}\n\n\t\tstatic slerpFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t) {\n\t\t\t// fuzz-free, array-based Quaternion SLERP operation\n\t\t\tlet x0 = src0[srcOffset0 + 0],\n\t\t\t\t\ty0 = src0[srcOffset0 + 1],\n\t\t\t\t\tz0 = src0[srcOffset0 + 2],\n\t\t\t\t\tw0 = src0[srcOffset0 + 3];\n\t\t\tconst x1 = src1[srcOffset1 + 0],\n\t\t\t\t\t\ty1 = src1[srcOffset1 + 1],\n\t\t\t\t\t\tz1 = src1[srcOffset1 + 2],\n\t\t\t\t\t\tw1 = src1[srcOffset1 + 3];\n\n\t\t\tif (t === 0) {\n\t\t\t\tdst[dstOffset + 0] = x0;\n\t\t\t\tdst[dstOffset + 1] = y0;\n\t\t\t\tdst[dstOffset + 2] = z0;\n\t\t\t\tdst[dstOffset + 3] = w0;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (t === 1) {\n\t\t\t\tdst[dstOffset + 0] = x1;\n\t\t\t\tdst[dstOffset + 1] = y1;\n\t\t\t\tdst[dstOffset + 2] = z1;\n\t\t\t\tdst[dstOffset + 3] = w1;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1) {\n\t\t\t\tlet s = 1 - t;\n\t\t\t\tconst cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,\n\t\t\t\t\t\t\tdir = cos >= 0 ? 1 : -1,\n\t\t\t\t\t\t\tsqrSin = 1 - cos * cos; // Skip the Slerp for tiny steps to avoid numeric problems:\n\n\t\t\t\tif (sqrSin > Number.EPSILON) {\n\t\t\t\t\tconst sin = Math.sqrt(sqrSin),\n\t\t\t\t\t\t\t\tlen = Math.atan2(sin, cos * dir);\n\t\t\t\t\ts = Math.sin(s * len) / sin;\n\t\t\t\t\tt = Math.sin(t * len) / sin;\n\t\t\t\t}\n\n\t\t\t\tconst tDir = t * dir;\n\t\t\t\tx0 = x0 * s + x1 * tDir;\n\t\t\t\ty0 = y0 * s + y1 * tDir;\n\t\t\t\tz0 = z0 * s + z1 * tDir;\n\t\t\t\tw0 = w0 * s + w1 * tDir; // Normalize in case we just did a lerp:\n\n\t\t\t\tif (s === 1 - t) {\n\t\t\t\t\tconst f = 1 / Math.sqrt(x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0);\n\t\t\t\t\tx0 *= f;\n\t\t\t\t\ty0 *= f;\n\t\t\t\t\tz0 *= f;\n\t\t\t\t\tw0 *= f;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdst[dstOffset] = x0;\n\t\t\tdst[dstOffset + 1] = y0;\n\t\t\tdst[dstOffset + 2] = z0;\n\t\t\tdst[dstOffset + 3] = w0;\n\t\t}\n\n\t\tstatic multiplyQuaternionsFlat(dst, dstOffset, src0, srcOffset0, src1, srcOffset1) {\n\t\t\tconst x0 = src0[srcOffset0];\n\t\t\tconst y0 = src0[srcOffset0 + 1];\n\t\t\tconst z0 = src0[srcOffset0 + 2];\n\t\t\tconst w0 = src0[srcOffset0 + 3];\n\t\t\tconst x1 = src1[srcOffset1];\n\t\t\tconst y1 = src1[srcOffset1 + 1];\n\t\t\tconst z1 = src1[srcOffset1 + 2];\n\t\t\tconst w1 = src1[srcOffset1 + 3];\n\t\t\tdst[dstOffset] = x0 * w1 + w0 * x1 + y0 * z1 - z0 * y1;\n\t\t\tdst[dstOffset + 1] = y0 * w1 + w0 * y1 + z0 * x1 - x0 * z1;\n\t\t\tdst[dstOffset + 2] = z0 * w1 + w0 * z1 + x0 * y1 - y0 * x1;\n\t\t\tdst[dstOffset + 3] = w0 * w1 - x0 * x1 - y0 * y1 - z0 * z1;\n\t\t\treturn dst;\n\t\t}\n\n\t\tget x() {\n\t\t\treturn this._x;\n\t\t}\n\n\t\tset x(value) {\n\t\t\tthis._x = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget y() {\n\t\t\treturn this._y;\n\t\t}\n\n\t\tset y(value) {\n\t\t\tthis._y = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget z() {\n\t\t\treturn this._z;\n\t\t}\n\n\t\tset z(value) {\n\t\t\tthis._z = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget w() {\n\t\t\treturn this._w;\n\t\t}\n\n\t\tset w(value) {\n\t\t\tthis._w = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tset(x, y, z, w) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._w = w;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this._x, this._y, this._z, this._w);\n\t\t}\n\n\t\tcopy(quaternion) {\n\t\t\tthis._x = quaternion.x;\n\t\t\tthis._y = quaternion.y;\n\t\t\tthis._z = quaternion.z;\n\t\t\tthis._w = quaternion.w;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromEuler(euler, update) {\n\t\t\tif (!(euler && euler.isEuler)) {\n\t\t\t\tthrow new Error('THREE.Quaternion: .setFromEuler() now expects an Euler rotation rather than a Vector3 and order.');\n\t\t\t}\n\n\t\t\tconst x = euler._x,\n\t\t\t\t\t\ty = euler._y,\n\t\t\t\t\t\tz = euler._z,\n\t\t\t\t\t\torder = euler._order; // http://www.mathworks.com/matlabcentral/fileexchange/\n\t\t\t// \t20696-function-to-convert-between-dcm-euler-angles-quaternions-and-euler-vectors/\n\t\t\t//\tcontent/SpinCalc.m\n\n\t\t\tconst cos = Math.cos;\n\t\t\tconst sin = Math.sin;\n\t\t\tconst c1 = cos(x / 2);\n\t\t\tconst c2 = cos(y / 2);\n\t\t\tconst c3 = cos(z / 2);\n\t\t\tconst s1 = sin(x / 2);\n\t\t\tconst s2 = sin(y / 2);\n\t\t\tconst s3 = sin(z / 2);\n\n\t\t\tswitch (order) {\n\t\t\t\tcase 'XYZ':\n\t\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YXZ':\n\t\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZXY':\n\t\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZYX':\n\t\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YZX':\n\t\t\t\t\tthis._x = s1 * c2 * c3 + c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 + s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 - s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 - s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'XZY':\n\t\t\t\t\tthis._x = s1 * c2 * c3 - c1 * s2 * s3;\n\t\t\t\t\tthis._y = c1 * s2 * c3 - s1 * c2 * s3;\n\t\t\t\t\tthis._z = c1 * c2 * s3 + s1 * s2 * c3;\n\t\t\t\t\tthis._w = c1 * c2 * c3 + s1 * s2 * s3;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn('THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order);\n\t\t\t}\n\n\t\t\tif (update !== false) this._onChangeCallback();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromAxisAngle(axis, angle) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm\n\t\t\t// assumes axis is normalized\n\t\t\tconst halfAngle = angle / 2,\n\t\t\t\t\t\ts = Math.sin(halfAngle);\n\t\t\tthis._x = axis.x * s;\n\t\t\tthis._y = axis.y * s;\n\t\t\tthis._z = axis.z * s;\n\t\t\tthis._w = Math.cos(halfAngle);\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromRotationMatrix(m) {\n\t\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tconst te = m.elements,\n\t\t\t\t\t\tm11 = te[0],\n\t\t\t\t\t\tm12 = te[4],\n\t\t\t\t\t\tm13 = te[8],\n\t\t\t\t\t\tm21 = te[1],\n\t\t\t\t\t\tm22 = te[5],\n\t\t\t\t\t\tm23 = te[9],\n\t\t\t\t\t\tm31 = te[2],\n\t\t\t\t\t\tm32 = te[6],\n\t\t\t\t\t\tm33 = te[10],\n\t\t\t\t\t\ttrace = m11 + m22 + m33;\n\n\t\t\tif (trace > 0) {\n\t\t\t\tconst s = 0.5 / Math.sqrt(trace + 1.0);\n\t\t\t\tthis._w = 0.25 / s;\n\t\t\t\tthis._x = (m32 - m23) * s;\n\t\t\t\tthis._y = (m13 - m31) * s;\n\t\t\t\tthis._z = (m21 - m12) * s;\n\t\t\t} else if (m11 > m22 && m11 > m33) {\n\t\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m11 - m22 - m33);\n\t\t\t\tthis._w = (m32 - m23) / s;\n\t\t\t\tthis._x = 0.25 * s;\n\t\t\t\tthis._y = (m12 + m21) / s;\n\t\t\t\tthis._z = (m13 + m31) / s;\n\t\t\t} else if (m22 > m33) {\n\t\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m22 - m11 - m33);\n\t\t\t\tthis._w = (m13 - m31) / s;\n\t\t\t\tthis._x = (m12 + m21) / s;\n\t\t\t\tthis._y = 0.25 * s;\n\t\t\t\tthis._z = (m23 + m32) / s;\n\t\t\t} else {\n\t\t\t\tconst s = 2.0 * Math.sqrt(1.0 + m33 - m11 - m22);\n\t\t\t\tthis._w = (m21 - m12) / s;\n\t\t\t\tthis._x = (m13 + m31) / s;\n\t\t\t\tthis._y = (m23 + m32) / s;\n\t\t\t\tthis._z = 0.25 * s;\n\t\t\t}\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromUnitVectors(vFrom, vTo) {\n\t\t\t// assumes direction vectors vFrom and vTo are normalized\n\t\t\tlet r = vFrom.dot(vTo) + 1;\n\n\t\t\tif (r < Number.EPSILON) {\n\t\t\t\t// vFrom and vTo point in opposite directions\n\t\t\t\tr = 0;\n\n\t\t\t\tif (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n\t\t\t\t\tthis._x = -vFrom.y;\n\t\t\t\t\tthis._y = vFrom.x;\n\t\t\t\t\tthis._z = 0;\n\t\t\t\t\tthis._w = r;\n\t\t\t\t} else {\n\t\t\t\t\tthis._x = 0;\n\t\t\t\t\tthis._y = -vFrom.z;\n\t\t\t\t\tthis._z = vFrom.y;\n\t\t\t\t\tthis._w = r;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// crossVectors( vFrom, vTo ); // inlined to avoid cyclic dependency on Vector3\n\t\t\t\tthis._x = vFrom.y * vTo.z - vFrom.z * vTo.y;\n\t\t\t\tthis._y = vFrom.z * vTo.x - vFrom.x * vTo.z;\n\t\t\t\tthis._z = vFrom.x * vTo.y - vFrom.y * vTo.x;\n\t\t\t\tthis._w = r;\n\t\t\t}\n\n\t\t\treturn this.normalize();\n\t\t}\n\n\t\tangleTo(q) {\n\t\t\treturn 2 * Math.acos(Math.abs(clamp(this.dot(q), -1, 1)));\n\t\t}\n\n\t\trotateTowards(q, step) {\n\t\t\tconst angle = this.angleTo(q);\n\t\t\tif (angle === 0) return this;\n\t\t\tconst t = Math.min(1, step / angle);\n\t\t\tthis.slerp(q, t);\n\t\t\treturn this;\n\t\t}\n\n\t\tidentity() {\n\t\t\treturn this.set(0, 0, 0, 1);\n\t\t}\n\n\t\tinvert() {\n\t\t\t// quaternion is assumed to have unit length\n\t\t\treturn this.conjugate();\n\t\t}\n\n\t\tconjugate() {\n\t\t\tthis._x *= -1;\n\t\t\tthis._y *= -1;\n\t\t\tthis._z *= -1;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this._x * v._x + this._y * v._y + this._z * v._z + this._w * v._w;\n\t\t}\n\n\t\tlengthSq() {\n\t\t\treturn this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w);\n\t\t}\n\n\t\tnormalize() {\n\t\t\tlet l = this.length();\n\n\t\t\tif (l === 0) {\n\t\t\t\tthis._x = 0;\n\t\t\t\tthis._y = 0;\n\t\t\t\tthis._z = 0;\n\t\t\t\tthis._w = 1;\n\t\t\t} else {\n\t\t\t\tl = 1 / l;\n\t\t\t\tthis._x = this._x * l;\n\t\t\t\tthis._y = this._y * l;\n\t\t\t\tthis._z = this._z * l;\n\t\t\t\tthis._w = this._w * l;\n\t\t\t}\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(q, p) {\n\t\t\tif (p !== undefined) {\n\t\t\t\tconsole.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.');\n\t\t\t\treturn this.multiplyQuaternions(q, p);\n\t\t\t}\n\n\t\t\treturn this.multiplyQuaternions(this, q);\n\t\t}\n\n\t\tpremultiply(q) {\n\t\t\treturn this.multiplyQuaternions(q, this);\n\t\t}\n\n\t\tmultiplyQuaternions(a, b) {\n\t\t\t// from http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm\n\t\t\tconst qax = a._x,\n\t\t\t\t\t\tqay = a._y,\n\t\t\t\t\t\tqaz = a._z,\n\t\t\t\t\t\tqaw = a._w;\n\t\t\tconst qbx = b._x,\n\t\t\t\t\t\tqby = b._y,\n\t\t\t\t\t\tqbz = b._z,\n\t\t\t\t\t\tqbw = b._w;\n\t\t\tthis._x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n\t\t\tthis._y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n\t\t\tthis._z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n\t\t\tthis._w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tslerp(qb, t) {\n\t\t\tif (t === 0) return this;\n\t\t\tif (t === 1) return this.copy(qb);\n\t\t\tconst x = this._x,\n\t\t\t\t\t\ty = this._y,\n\t\t\t\t\t\tz = this._z,\n\t\t\t\t\t\tw = this._w; // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/\n\n\t\t\tlet cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;\n\n\t\t\tif (cosHalfTheta < 0) {\n\t\t\t\tthis._w = -qb._w;\n\t\t\t\tthis._x = -qb._x;\n\t\t\t\tthis._y = -qb._y;\n\t\t\t\tthis._z = -qb._z;\n\t\t\t\tcosHalfTheta = -cosHalfTheta;\n\t\t\t} else {\n\t\t\t\tthis.copy(qb);\n\t\t\t}\n\n\t\t\tif (cosHalfTheta >= 1.0) {\n\t\t\t\tthis._w = w;\n\t\t\t\tthis._x = x;\n\t\t\t\tthis._y = y;\n\t\t\t\tthis._z = z;\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;\n\n\t\t\tif (sqrSinHalfTheta <= Number.EPSILON) {\n\t\t\t\tconst s = 1 - t;\n\t\t\t\tthis._w = s * w + t * this._w;\n\t\t\t\tthis._x = s * x + t * this._x;\n\t\t\t\tthis._y = s * y + t * this._y;\n\t\t\t\tthis._z = s * z + t * this._z;\n\t\t\t\tthis.normalize();\n\n\t\t\t\tthis._onChangeCallback();\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst sinHalfTheta = Math.sqrt(sqrSinHalfTheta);\n\t\t\tconst halfTheta = Math.atan2(sinHalfTheta, cosHalfTheta);\n\t\t\tconst ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n\t\t\t\t\t\tratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n\t\t\tthis._w = w * ratioA + this._w * ratioB;\n\t\t\tthis._x = x * ratioA + this._x * ratioB;\n\t\t\tthis._y = y * ratioA + this._y * ratioB;\n\t\t\tthis._z = z * ratioA + this._z * ratioB;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tslerpQuaternions(qa, qb, t) {\n\t\t\tthis.copy(qa).slerp(qb, t);\n\t\t}\n\n\t\trandom() {\n\t\t\t// Derived from http://planning.cs.uiuc.edu/node198.html\n\t\t\t// Note, this source uses w, x, y, z ordering,\n\t\t\t// so we swap the order below.\n\t\t\tconst u1 = Math.random();\n\t\t\tconst sqrt1u1 = Math.sqrt(1 - u1);\n\t\t\tconst sqrtu1 = Math.sqrt(u1);\n\t\t\tconst u2 = 2 * Math.PI * Math.random();\n\t\t\tconst u3 = 2 * Math.PI * Math.random();\n\t\t\treturn this.set(sqrt1u1 * Math.cos(u2), sqrtu1 * Math.sin(u3), sqrtu1 * Math.cos(u3), sqrt1u1 * Math.sin(u2));\n\t\t}\n\n\t\tequals(quaternion) {\n\t\t\treturn quaternion._x === this._x && quaternion._y === this._y && quaternion._z === this._z && quaternion._w === this._w;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis._x = array[offset];\n\t\t\tthis._y = array[offset + 1];\n\t\t\tthis._z = array[offset + 2];\n\t\t\tthis._w = array[offset + 3];\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this._x;\n\t\t\tarray[offset + 1] = this._y;\n\t\t\tarray[offset + 2] = this._z;\n\t\t\tarray[offset + 3] = this._w;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index) {\n\t\t\tthis._x = attribute.getX(index);\n\t\t\tthis._y = attribute.getY(index);\n\t\t\tthis._z = attribute.getZ(index);\n\t\t\tthis._w = attribute.getW(index);\n\t\t\treturn this;\n\t\t}\n\n\t\t_onChange(callback) {\n\t\t\tthis._onChangeCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\t_onChangeCallback() {}\n\n\t}\n\n\tQuaternion.prototype.isQuaternion = true;\n\n\tclass Vector3 {\n\t\tconstructor(x = 0, y = 0, z = 0) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t}\n\n\t\tset(x, y, z) {\n\t\t\tif (z === undefined) z = this.z; // sprite.scale.set(x,y)\n\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.x = scalar;\n\t\t\tthis.y = scalar;\n\t\t\tthis.z = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(x) {\n\t\t\tthis.x = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(y) {\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetZ(z) {\n\t\t\tthis.z = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponent(index, value) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\tthis.x = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 1:\n\t\t\t\t\tthis.y = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\tthis.z = value;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetComponent(index) {\n\t\t\tswitch (index) {\n\t\t\t\tcase 0:\n\t\t\t\t\treturn this.x;\n\n\t\t\t\tcase 1:\n\t\t\t\t\treturn this.y;\n\n\t\t\t\tcase 2:\n\t\t\t\t\treturn this.z;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error('index is out of range: ' + index);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.x, this.y, this.z);\n\t\t}\n\n\t\tcopy(v) {\n\t\t\tthis.x = v.x;\n\t\t\tthis.y = v.y;\n\t\t\tthis.z = v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.');\n\t\t\t\treturn this.addVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x += v.x;\n\t\t\tthis.y += v.y;\n\t\t\tthis.z += v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.x += s;\n\t\t\tthis.y += s;\n\t\t\tthis.z += s;\n\t\t\treturn this;\n\t\t}\n\n\t\taddVectors(a, b) {\n\t\t\tthis.x = a.x + b.x;\n\t\t\tthis.y = a.y + b.y;\n\t\t\tthis.z = a.z + b.z;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledVector(v, s) {\n\t\t\tthis.x += v.x * s;\n\t\t\tthis.y += v.y * s;\n\t\t\tthis.z += v.z * s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.');\n\t\t\t\treturn this.subVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x -= v.x;\n\t\t\tthis.y -= v.y;\n\t\t\tthis.z -= v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubScalar(s) {\n\t\t\tthis.x -= s;\n\t\t\tthis.y -= s;\n\t\t\tthis.z -= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsubVectors(a, b) {\n\t\t\tthis.x = a.x - b.x;\n\t\t\tthis.y = a.y - b.y;\n\t\t\tthis.z = a.z - b.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.');\n\t\t\t\treturn this.multiplyVectors(v, w);\n\t\t\t}\n\n\t\t\tthis.x *= v.x;\n\t\t\tthis.y *= v.y;\n\t\t\tthis.z *= v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(scalar) {\n\t\t\tthis.x *= scalar;\n\t\t\tthis.y *= scalar;\n\t\t\tthis.z *= scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyVectors(a, b) {\n\t\t\tthis.x = a.x * b.x;\n\t\t\tthis.y = a.y * b.y;\n\t\t\tthis.z = a.z * b.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyEuler(euler) {\n\t\t\tif (!(euler && euler.isEuler)) {\n\t\t\t\tconsole.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.');\n\t\t\t}\n\n\t\t\treturn this.applyQuaternion(_quaternion$4.setFromEuler(euler));\n\t\t}\n\n\t\tapplyAxisAngle(axis, angle) {\n\t\t\treturn this.applyQuaternion(_quaternion$4.setFromAxisAngle(axis, angle));\n\t\t}\n\n\t\tapplyMatrix3(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[3] * y + e[6] * z;\n\t\t\tthis.y = e[1] * x + e[4] * y + e[7] * z;\n\t\t\tthis.z = e[2] * x + e[5] * y + e[8] * z;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyNormalMatrix(m) {\n\t\t\treturn this.applyMatrix3(m).normalize();\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst e = m.elements;\n\t\t\tconst w = 1 / (e[3] * x + e[7] * y + e[11] * z + e[15]);\n\t\t\tthis.x = (e[0] * x + e[4] * y + e[8] * z + e[12]) * w;\n\t\t\tthis.y = (e[1] * x + e[5] * y + e[9] * z + e[13]) * w;\n\t\t\tthis.z = (e[2] * x + e[6] * y + e[10] * z + e[14]) * w;\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyQuaternion(q) {\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst qx = q.x,\n\t\t\t\t\t\tqy = q.y,\n\t\t\t\t\t\tqz = q.z,\n\t\t\t\t\t\tqw = q.w; // calculate quat * vector\n\n\t\t\tconst ix = qw * x + qy * z - qz * y;\n\t\t\tconst iy = qw * y + qz * x - qx * z;\n\t\t\tconst iz = qw * z + qx * y - qy * x;\n\t\t\tconst iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n\t\t\tthis.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n\t\t\tthis.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n\t\t\tthis.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\t\t\treturn this;\n\t\t}\n\n\t\tproject(camera) {\n\t\t\treturn this.applyMatrix4(camera.matrixWorldInverse).applyMatrix4(camera.projectionMatrix);\n\t\t}\n\n\t\tunproject(camera) {\n\t\t\treturn this.applyMatrix4(camera.projectionMatrixInverse).applyMatrix4(camera.matrixWorld);\n\t\t}\n\n\t\ttransformDirection(m) {\n\t\t\t// input: THREE.Matrix4 affine matrix\n\t\t\t// vector interpreted as a direction\n\t\t\tconst x = this.x,\n\t\t\t\t\t\ty = this.y,\n\t\t\t\t\t\tz = this.z;\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[0] * x + e[4] * y + e[8] * z;\n\t\t\tthis.y = e[1] * x + e[5] * y + e[9] * z;\n\t\t\tthis.z = e[2] * x + e[6] * y + e[10] * z;\n\t\t\treturn this.normalize();\n\t\t}\n\n\t\tdivide(v) {\n\t\t\tthis.x /= v.x;\n\t\t\tthis.y /= v.y;\n\t\t\tthis.z /= v.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tdivideScalar(scalar) {\n\t\t\treturn this.multiplyScalar(1 / scalar);\n\t\t}\n\n\t\tmin(v) {\n\t\t\tthis.x = Math.min(this.x, v.x);\n\t\t\tthis.y = Math.min(this.y, v.y);\n\t\t\tthis.z = Math.min(this.z, v.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tmax(v) {\n\t\t\tthis.x = Math.max(this.x, v.x);\n\t\t\tthis.y = Math.max(this.y, v.y);\n\t\t\tthis.z = Math.max(this.z, v.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tclamp(min, max) {\n\t\t\t// assumes min < max, componentwise\n\t\t\tthis.x = Math.max(min.x, Math.min(max.x, this.x));\n\t\t\tthis.y = Math.max(min.y, Math.min(max.y, this.y));\n\t\t\tthis.z = Math.max(min.z, Math.min(max.z, this.z));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampScalar(minVal, maxVal) {\n\t\t\tthis.x = Math.max(minVal, Math.min(maxVal, this.x));\n\t\t\tthis.y = Math.max(minVal, Math.min(maxVal, this.y));\n\t\t\tthis.z = Math.max(minVal, Math.min(maxVal, this.z));\n\t\t\treturn this;\n\t\t}\n\n\t\tclampLength(min, max) {\n\t\t\tconst length = this.length();\n\t\t\treturn this.divideScalar(length || 1).multiplyScalar(Math.max(min, Math.min(max, length)));\n\t\t}\n\n\t\tfloor() {\n\t\t\tthis.x = Math.floor(this.x);\n\t\t\tthis.y = Math.floor(this.y);\n\t\t\tthis.z = Math.floor(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tceil() {\n\t\t\tthis.x = Math.ceil(this.x);\n\t\t\tthis.y = Math.ceil(this.y);\n\t\t\tthis.z = Math.ceil(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tround() {\n\t\t\tthis.x = Math.round(this.x);\n\t\t\tthis.y = Math.round(this.y);\n\t\t\tthis.z = Math.round(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\troundToZero() {\n\t\t\tthis.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x);\n\t\t\tthis.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y);\n\t\t\tthis.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.x = -this.x;\n\t\t\tthis.y = -this.y;\n\t\t\tthis.z = -this.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tdot(v) {\n\t\t\treturn this.x * v.x + this.y * v.y + this.z * v.z;\n\t\t} // TODO lengthSquared?\n\n\n\t\tlengthSq() {\n\t\t\treturn this.x * this.x + this.y * this.y + this.z * this.z;\n\t\t}\n\n\t\tlength() {\n\t\t\treturn Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n\t\t}\n\n\t\tmanhattanLength() {\n\t\t\treturn Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z);\n\t\t}\n\n\t\tnormalize() {\n\t\t\treturn this.divideScalar(this.length() || 1);\n\t\t}\n\n\t\tsetLength(length) {\n\t\t\treturn this.normalize().multiplyScalar(length);\n\t\t}\n\n\t\tlerp(v, alpha) {\n\t\t\tthis.x += (v.x - this.x) * alpha;\n\t\t\tthis.y += (v.y - this.y) * alpha;\n\t\t\tthis.z += (v.z - this.z) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpVectors(v1, v2, alpha) {\n\t\t\tthis.x = v1.x + (v2.x - v1.x) * alpha;\n\t\t\tthis.y = v1.y + (v2.y - v1.y) * alpha;\n\t\t\tthis.z = v1.z + (v2.z - v1.z) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tcross(v, w) {\n\t\t\tif (w !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.');\n\t\t\t\treturn this.crossVectors(v, w);\n\t\t\t}\n\n\t\t\treturn this.crossVectors(this, v);\n\t\t}\n\n\t\tcrossVectors(a, b) {\n\t\t\tconst ax = a.x,\n\t\t\t\t\t\tay = a.y,\n\t\t\t\t\t\taz = a.z;\n\t\t\tconst bx = b.x,\n\t\t\t\t\t\tby = b.y,\n\t\t\t\t\t\tbz = b.z;\n\t\t\tthis.x = ay * bz - az * by;\n\t\t\tthis.y = az * bx - ax * bz;\n\t\t\tthis.z = ax * by - ay * bx;\n\t\t\treturn this;\n\t\t}\n\n\t\tprojectOnVector(v) {\n\t\t\tconst denominator = v.lengthSq();\n\t\t\tif (denominator === 0) return this.set(0, 0, 0);\n\t\t\tconst scalar = v.dot(this) / denominator;\n\t\t\treturn this.copy(v).multiplyScalar(scalar);\n\t\t}\n\n\t\tprojectOnPlane(planeNormal) {\n\t\t\t_vector$c.copy(this).projectOnVector(planeNormal);\n\n\t\t\treturn this.sub(_vector$c);\n\t\t}\n\n\t\treflect(normal) {\n\t\t\t// reflect incident vector off plane orthogonal to normal\n\t\t\t// normal is assumed to have unit length\n\t\t\treturn this.sub(_vector$c.copy(normal).multiplyScalar(2 * this.dot(normal)));\n\t\t}\n\n\t\tangleTo(v) {\n\t\t\tconst denominator = Math.sqrt(this.lengthSq() * v.lengthSq());\n\t\t\tif (denominator === 0) return Math.PI / 2;\n\t\t\tconst theta = this.dot(v) / denominator; // clamp, to handle numerical problems\n\n\t\t\treturn Math.acos(clamp(theta, -1, 1));\n\t\t}\n\n\t\tdistanceTo(v) {\n\t\t\treturn Math.sqrt(this.distanceToSquared(v));\n\t\t}\n\n\t\tdistanceToSquared(v) {\n\t\t\tconst dx = this.x - v.x,\n\t\t\t\t\t\tdy = this.y - v.y,\n\t\t\t\t\t\tdz = this.z - v.z;\n\t\t\treturn dx * dx + dy * dy + dz * dz;\n\t\t}\n\n\t\tmanhattanDistanceTo(v) {\n\t\t\treturn Math.abs(this.x - v.x) + Math.abs(this.y - v.y) + Math.abs(this.z - v.z);\n\t\t}\n\n\t\tsetFromSpherical(s) {\n\t\t\treturn this.setFromSphericalCoords(s.radius, s.phi, s.theta);\n\t\t}\n\n\t\tsetFromSphericalCoords(radius, phi, theta) {\n\t\t\tconst sinPhiRadius = Math.sin(phi) * radius;\n\t\t\tthis.x = sinPhiRadius * Math.sin(theta);\n\t\t\tthis.y = Math.cos(phi) * radius;\n\t\t\tthis.z = sinPhiRadius * Math.cos(theta);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCylindrical(c) {\n\t\t\treturn this.setFromCylindricalCoords(c.radius, c.theta, c.y);\n\t\t}\n\n\t\tsetFromCylindricalCoords(radius, theta, y) {\n\t\t\tthis.x = radius * Math.sin(theta);\n\t\t\tthis.y = y;\n\t\t\tthis.z = radius * Math.cos(theta);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrixPosition(m) {\n\t\t\tconst e = m.elements;\n\t\t\tthis.x = e[12];\n\t\t\tthis.y = e[13];\n\t\t\tthis.z = e[14];\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrixScale(m) {\n\t\t\tconst sx = this.setFromMatrixColumn(m, 0).length();\n\t\t\tconst sy = this.setFromMatrixColumn(m, 1).length();\n\t\t\tconst sz = this.setFromMatrixColumn(m, 2).length();\n\t\t\tthis.x = sx;\n\t\t\tthis.y = sy;\n\t\t\tthis.z = sz;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrixColumn(m, index) {\n\t\t\treturn this.fromArray(m.elements, index * 4);\n\t\t}\n\n\t\tsetFromMatrix3Column(m, index) {\n\t\t\treturn this.fromArray(m.elements, index * 3);\n\t\t}\n\n\t\tequals(v) {\n\t\t\treturn v.x === this.x && v.y === this.y && v.z === this.z;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.x = array[offset];\n\t\t\tthis.y = array[offset + 1];\n\t\t\tthis.z = array[offset + 2];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.x;\n\t\t\tarray[offset + 1] = this.y;\n\t\t\tarray[offset + 2] = this.z;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index, offset) {\n\t\t\tif (offset !== undefined) {\n\t\t\t\tconsole.warn('THREE.Vector3: offset has been removed from .fromBufferAttribute().');\n\t\t\t}\n\n\t\t\tthis.x = attribute.getX(index);\n\t\t\tthis.y = attribute.getY(index);\n\t\t\tthis.z = attribute.getZ(index);\n\t\t\treturn this;\n\t\t}\n\n\t\trandom() {\n\t\t\tthis.x = Math.random();\n\t\t\tthis.y = Math.random();\n\t\t\tthis.z = Math.random();\n\t\t\treturn this;\n\t\t}\n\n\t\trandomDirection() {\n\t\t\t// Derived from https://mathworld.wolfram.com/SpherePointPicking.html\n\t\t\tconst u = (Math.random() - 0.5) * 2;\n\t\t\tconst t = Math.random() * Math.PI * 2;\n\t\t\tconst f = Math.sqrt(1 - u ** 2);\n\t\t\tthis.x = f * Math.cos(t);\n\t\t\tthis.y = f * Math.sin(t);\n\t\t\tthis.z = u;\n\t\t\treturn this;\n\t\t}\n\n\t\t*[Symbol.iterator]() {\n\t\t\tyield this.x;\n\t\t\tyield this.y;\n\t\t\tyield this.z;\n\t\t}\n\n\t}\n\n\tVector3.prototype.isVector3 = true;\n\n\tconst _vector$c = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion$4 = /*@__PURE__*/new Quaternion();\n\n\tclass Box3 {\n\t\tconstructor(min = new Vector3(+Infinity, +Infinity, +Infinity), max = new Vector3(-Infinity, -Infinity, -Infinity)) {\n\t\t\tthis.min = min;\n\t\t\tthis.max = max;\n\t\t}\n\n\t\tset(min, max) {\n\t\t\tthis.min.copy(min);\n\t\t\tthis.max.copy(max);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromArray(array) {\n\t\t\tlet minX = +Infinity;\n\t\t\tlet minY = +Infinity;\n\t\t\tlet minZ = +Infinity;\n\t\t\tlet maxX = -Infinity;\n\t\t\tlet maxY = -Infinity;\n\t\t\tlet maxZ = -Infinity;\n\n\t\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\t\tconst x = array[i];\n\t\t\t\tconst y = array[i + 1];\n\t\t\t\tconst z = array[i + 2];\n\t\t\t\tif (x < minX) minX = x;\n\t\t\t\tif (y < minY) minY = y;\n\t\t\t\tif (z < minZ) minZ = z;\n\t\t\t\tif (x > maxX) maxX = x;\n\t\t\t\tif (y > maxY) maxY = y;\n\t\t\t\tif (z > maxZ) maxZ = z;\n\t\t\t}\n\n\t\t\tthis.min.set(minX, minY, minZ);\n\t\t\tthis.max.set(maxX, maxY, maxZ);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromBufferAttribute(attribute) {\n\t\t\tlet minX = +Infinity;\n\t\t\tlet minY = +Infinity;\n\t\t\tlet minZ = +Infinity;\n\t\t\tlet maxX = -Infinity;\n\t\t\tlet maxY = -Infinity;\n\t\t\tlet maxZ = -Infinity;\n\n\t\t\tfor (let i = 0, l = attribute.count; i < l; i++) {\n\t\t\t\tconst x = attribute.getX(i);\n\t\t\t\tconst y = attribute.getY(i);\n\t\t\t\tconst z = attribute.getZ(i);\n\t\t\t\tif (x < minX) minX = x;\n\t\t\t\tif (y < minY) minY = y;\n\t\t\t\tif (z < minZ) minZ = z;\n\t\t\t\tif (x > maxX) maxX = x;\n\t\t\t\tif (y > maxY) maxY = y;\n\t\t\t\tif (z > maxZ) maxZ = z;\n\t\t\t}\n\n\t\t\tthis.min.set(minX, minY, minZ);\n\t\t\tthis.max.set(maxX, maxY, maxZ);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tthis.makeEmpty();\n\n\t\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\t\tthis.expandByPoint(points[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCenterAndSize(center, size) {\n\t\t\tconst halfSize = _vector$b.copy(size).multiplyScalar(0.5);\n\n\t\t\tthis.min.copy(center).sub(halfSize);\n\t\t\tthis.max.copy(center).add(halfSize);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromObject(object) {\n\t\t\tthis.makeEmpty();\n\t\t\treturn this.expandByObject(object);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(box) {\n\t\t\tthis.min.copy(box.min);\n\t\t\tthis.max.copy(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeEmpty() {\n\t\t\tthis.min.x = this.min.y = this.min.z = +Infinity;\n\t\t\tthis.max.x = this.max.y = this.max.z = -Infinity;\n\t\t\treturn this;\n\t\t}\n\n\t\tisEmpty() {\n\t\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\t\treturn this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z;\n\t\t}\n\n\t\tgetCenter(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t\t}\n\n\t\tgetSize(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0, 0) : target.subVectors(this.max, this.min);\n\t\t}\n\n\t\texpandByPoint(point) {\n\t\t\tthis.min.min(point);\n\t\t\tthis.max.max(point);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByVector(vector) {\n\t\t\tthis.min.sub(vector);\n\t\t\tthis.max.add(vector);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByScalar(scalar) {\n\t\t\tthis.min.addScalar(-scalar);\n\t\t\tthis.max.addScalar(scalar);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByObject(object) {\n\t\t\t// Computes the world-axis-aligned bounding box of an object (including its children),\n\t\t\t// accounting for both the object's, and children's, world transforms\n\t\t\tobject.updateWorldMatrix(false, false);\n\t\t\tconst geometry = object.geometry;\n\n\t\t\tif (geometry !== undefined) {\n\t\t\t\tif (geometry.boundingBox === null) {\n\t\t\t\t\tgeometry.computeBoundingBox();\n\t\t\t\t}\n\n\t\t\t\t_box$3.copy(geometry.boundingBox);\n\n\t\t\t\t_box$3.applyMatrix4(object.matrixWorld);\n\n\t\t\t\tthis.union(_box$3);\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tthis.expandByObject(children[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y || point.z < this.min.z || point.z > this.max.z ? false : true;\n\t\t}\n\n\t\tcontainsBox(box) {\n\t\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y && this.min.z <= box.min.z && box.max.z <= this.max.z;\n\t\t}\n\n\t\tgetParameter(point, target) {\n\t\t\t// This can potentially have a divide by zero if the box\n\t\t\t// has a size dimension of 0.\n\t\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y), (point.z - this.min.z) / (this.max.z - this.min.z));\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\t// using 6 splitting planes to rule out intersections.\n\t\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y || box.max.z < this.min.z || box.min.z > this.max.z ? false : true;\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\t// Find the point on the AABB closest to the sphere center.\n\t\t\tthis.clampPoint(sphere.center, _vector$b); // If that point is inside the sphere, the AABB and sphere intersect.\n\n\t\t\treturn _vector$b.distanceToSquared(sphere.center) <= sphere.radius * sphere.radius;\n\t\t}\n\n\t\tintersectsPlane(plane) {\n\t\t\t// We compute the minimum and maximum dot product values. If those values\n\t\t\t// are on the same side (back or front) of the plane, then there is no intersection.\n\t\t\tlet min, max;\n\n\t\t\tif (plane.normal.x > 0) {\n\t\t\t\tmin = plane.normal.x * this.min.x;\n\t\t\t\tmax = plane.normal.x * this.max.x;\n\t\t\t} else {\n\t\t\t\tmin = plane.normal.x * this.max.x;\n\t\t\t\tmax = plane.normal.x * this.min.x;\n\t\t\t}\n\n\t\t\tif (plane.normal.y > 0) {\n\t\t\t\tmin += plane.normal.y * this.min.y;\n\t\t\t\tmax += plane.normal.y * this.max.y;\n\t\t\t} else {\n\t\t\t\tmin += plane.normal.y * this.max.y;\n\t\t\t\tmax += plane.normal.y * this.min.y;\n\t\t\t}\n\n\t\t\tif (plane.normal.z > 0) {\n\t\t\t\tmin += plane.normal.z * this.min.z;\n\t\t\t\tmax += plane.normal.z * this.max.z;\n\t\t\t} else {\n\t\t\t\tmin += plane.normal.z * this.max.z;\n\t\t\t\tmax += plane.normal.z * this.min.z;\n\t\t\t}\n\n\t\t\treturn min <= -plane.constant && max >= -plane.constant;\n\t\t}\n\n\t\tintersectsTriangle(triangle) {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\treturn false;\n\t\t\t} // compute box center and extents\n\n\n\t\t\tthis.getCenter(_center);\n\n\t\t\t_extents.subVectors(this.max, _center); // translate triangle to aabb origin\n\n\n\t\t\t_v0$2.subVectors(triangle.a, _center);\n\n\t\t\t_v1$7.subVectors(triangle.b, _center);\n\n\t\t\t_v2$3.subVectors(triangle.c, _center); // compute edge vectors for triangle\n\n\n\t\t\t_f0.subVectors(_v1$7, _v0$2);\n\n\t\t\t_f1.subVectors(_v2$3, _v1$7);\n\n\t\t\t_f2.subVectors(_v0$2, _v2$3); // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb\n\t\t\t// make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation\n\t\t\t// axis_ij = u_i x f_j (u0, u1, u2 = face normals of aabb = x,y,z axes vectors since aabb is axis aligned)\n\n\n\t\t\tlet axes = [0, -_f0.z, _f0.y, 0, -_f1.z, _f1.y, 0, -_f2.z, _f2.y, _f0.z, 0, -_f0.x, _f1.z, 0, -_f1.x, _f2.z, 0, -_f2.x, -_f0.y, _f0.x, 0, -_f1.y, _f1.x, 0, -_f2.y, _f2.x, 0];\n\n\t\t\tif (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {\n\t\t\t\treturn false;\n\t\t\t} // test 3 face normals from the aabb\n\n\n\t\t\taxes = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n\t\t\tif (!satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents)) {\n\t\t\t\treturn false;\n\t\t\t} // finally testing the face normal of the triangle\n\t\t\t// use already existing triangle edge vectors here\n\n\n\t\t\t_triangleNormal.crossVectors(_f0, _f1);\n\n\t\t\taxes = [_triangleNormal.x, _triangleNormal.y, _triangleNormal.z];\n\t\t\treturn satForAxes(axes, _v0$2, _v1$7, _v2$3, _extents);\n\t\t}\n\n\t\tclampPoint(point, target) {\n\t\t\treturn target.copy(point).clamp(this.min, this.max);\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\tconst clampedPoint = _vector$b.copy(point).clamp(this.min, this.max);\n\n\t\t\treturn clampedPoint.sub(point).length();\n\t\t}\n\n\t\tgetBoundingSphere(target) {\n\t\t\tthis.getCenter(target.center);\n\t\t\ttarget.radius = this.getSize(_vector$b).length() * 0.5;\n\t\t\treturn target;\n\t\t}\n\n\t\tintersect(box) {\n\t\t\tthis.min.max(box.min);\n\t\t\tthis.max.min(box.max); // ensure that if there is no overlap, the result is fully empty, not slightly empty with non-inf/+inf values that will cause subsequence intersects to erroneously return valid values.\n\n\t\t\tif (this.isEmpty()) this.makeEmpty();\n\t\t\treturn this;\n\t\t}\n\n\t\tunion(box) {\n\t\t\tthis.min.min(box.min);\n\t\t\tthis.max.max(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\t// transform of empty box is an empty box.\n\t\t\tif (this.isEmpty()) return this; // NOTE: I am using a binary pattern to specify all 2^3 combinations below\n\n\t\t\t_points[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(matrix); // 000\n\n\n\t\t\t_points[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(matrix); // 001\n\n\n\t\t\t_points[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(matrix); // 010\n\n\n\t\t\t_points[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(matrix); // 011\n\n\n\t\t\t_points[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(matrix); // 100\n\n\n\t\t\t_points[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(matrix); // 101\n\n\n\t\t\t_points[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(matrix); // 110\n\n\n\t\t\t_points[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(matrix); // 111\n\n\n\t\t\tthis.setFromPoints(_points);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.min.add(offset);\n\t\t\tthis.max.add(offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(box) {\n\t\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t\t}\n\n\t}\n\n\tBox3.prototype.isBox3 = true;\n\tconst _points = [/*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3(), /*@__PURE__*/new Vector3()];\n\n\tconst _vector$b = /*@__PURE__*/new Vector3();\n\n\tconst _box$3 = /*@__PURE__*/new Box3(); // triangle centered vertices\n\n\n\tconst _v0$2 = /*@__PURE__*/new Vector3();\n\n\tconst _v1$7 = /*@__PURE__*/new Vector3();\n\n\tconst _v2$3 = /*@__PURE__*/new Vector3(); // triangle edge vectors\n\n\n\tconst _f0 = /*@__PURE__*/new Vector3();\n\n\tconst _f1 = /*@__PURE__*/new Vector3();\n\n\tconst _f2 = /*@__PURE__*/new Vector3();\n\n\tconst _center = /*@__PURE__*/new Vector3();\n\n\tconst _extents = /*@__PURE__*/new Vector3();\n\n\tconst _triangleNormal = /*@__PURE__*/new Vector3();\n\n\tconst _testAxis = /*@__PURE__*/new Vector3();\n\n\tfunction satForAxes(axes, v0, v1, v2, extents) {\n\t\tfor (let i = 0, j = axes.length - 3; i <= j; i += 3) {\n\t\t\t_testAxis.fromArray(axes, i); // project the aabb onto the seperating axis\n\n\n\t\t\tconst r = extents.x * Math.abs(_testAxis.x) + extents.y * Math.abs(_testAxis.y) + extents.z * Math.abs(_testAxis.z); // project all 3 vertices of the triangle onto the seperating axis\n\n\t\t\tconst p0 = v0.dot(_testAxis);\n\t\t\tconst p1 = v1.dot(_testAxis);\n\t\t\tconst p2 = v2.dot(_testAxis); // actual test, basically see if either of the most extreme of the triangle points intersects r\n\n\t\t\tif (Math.max(-Math.max(p0, p1, p2), Math.min(p0, p1, p2)) > r) {\n\t\t\t\t// points of the projected triangle are outside the projected half-length of the aabb\n\t\t\t\t// the axis is seperating and we can exit\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tconst _box$2 = /*@__PURE__*/new Box3();\n\n\tconst _v1$6 = /*@__PURE__*/new Vector3();\n\n\tconst _toFarthestPoint = /*@__PURE__*/new Vector3();\n\n\tconst _toPoint = /*@__PURE__*/new Vector3();\n\n\tclass Sphere {\n\t\tconstructor(center = new Vector3(), radius = -1) {\n\t\t\tthis.center = center;\n\t\t\tthis.radius = radius;\n\t\t}\n\n\t\tset(center, radius) {\n\t\t\tthis.center.copy(center);\n\t\t\tthis.radius = radius;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points, optionalCenter) {\n\t\t\tconst center = this.center;\n\n\t\t\tif (optionalCenter !== undefined) {\n\t\t\t\tcenter.copy(optionalCenter);\n\t\t\t} else {\n\t\t\t\t_box$2.setFromPoints(points).getCenter(center);\n\t\t\t}\n\n\t\t\tlet maxRadiusSq = 0;\n\n\t\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(points[i]));\n\t\t\t}\n\n\t\t\tthis.radius = Math.sqrt(maxRadiusSq);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(sphere) {\n\t\t\tthis.center.copy(sphere.center);\n\t\t\tthis.radius = sphere.radius;\n\t\t\treturn this;\n\t\t}\n\n\t\tisEmpty() {\n\t\t\treturn this.radius < 0;\n\t\t}\n\n\t\tmakeEmpty() {\n\t\t\tthis.center.set(0, 0, 0);\n\t\t\tthis.radius = -1;\n\t\t\treturn this;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn point.distanceToSquared(this.center) <= this.radius * this.radius;\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\treturn point.distanceTo(this.center) - this.radius;\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\tconst radiusSum = this.radius + sphere.radius;\n\t\t\treturn sphere.center.distanceToSquared(this.center) <= radiusSum * radiusSum;\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn box.intersectsSphere(this);\n\t\t}\n\n\t\tintersectsPlane(plane) {\n\t\t\treturn Math.abs(plane.distanceToPoint(this.center)) <= this.radius;\n\t\t}\n\n\t\tclampPoint(point, target) {\n\t\t\tconst deltaLengthSq = this.center.distanceToSquared(point);\n\t\t\ttarget.copy(point);\n\n\t\t\tif (deltaLengthSq > this.radius * this.radius) {\n\t\t\t\ttarget.sub(this.center).normalize();\n\t\t\t\ttarget.multiplyScalar(this.radius).add(this.center);\n\t\t\t}\n\n\t\t\treturn target;\n\t\t}\n\n\t\tgetBoundingBox(target) {\n\t\t\tif (this.isEmpty()) {\n\t\t\t\t// Empty sphere produces empty bounding box\n\t\t\t\ttarget.makeEmpty();\n\t\t\t\treturn target;\n\t\t\t}\n\n\t\t\ttarget.set(this.center, this.center);\n\t\t\ttarget.expandByScalar(this.radius);\n\t\t\treturn target;\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tthis.center.applyMatrix4(matrix);\n\t\t\tthis.radius = this.radius * matrix.getMaxScaleOnAxis();\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.center.add(offset);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByPoint(point) {\n\t\t\t// from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671\n\t\t\t_toPoint.subVectors(point, this.center);\n\n\t\t\tconst lengthSq = _toPoint.lengthSq();\n\n\t\t\tif (lengthSq > this.radius * this.radius) {\n\t\t\t\tconst length = Math.sqrt(lengthSq);\n\t\t\t\tconst missingRadiusHalf = (length - this.radius) * 0.5; // Nudge this sphere towards the target point. Add half the missing distance to radius,\n\t\t\t\t// and the other half to position. This gives a tighter enclosure, instead of if\n\t\t\t\t// the whole missing distance were just added to radius.\n\n\t\t\t\tthis.center.add(_toPoint.multiplyScalar(missingRadiusHalf / length));\n\t\t\t\tthis.radius += missingRadiusHalf;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tunion(sphere) {\n\t\t\t// from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769\n\t\t\t// To enclose another sphere into this sphere, we only need to enclose two points:\n\t\t\t// 1) Enclose the farthest point on the other sphere into this sphere.\n\t\t\t// 2) Enclose the opposite point of the farthest point into this sphere.\n\t\t\t_toFarthestPoint.subVectors(sphere.center, this.center).normalize().multiplyScalar(sphere.radius);\n\n\t\t\tthis.expandByPoint(_v1$6.copy(sphere.center).add(_toFarthestPoint));\n\t\t\tthis.expandByPoint(_v1$6.copy(sphere.center).sub(_toFarthestPoint));\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(sphere) {\n\t\t\treturn sphere.center.equals(this.center) && sphere.radius === this.radius;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tconst _vector$a = /*@__PURE__*/new Vector3();\n\n\tconst _segCenter = /*@__PURE__*/new Vector3();\n\n\tconst _segDir = /*@__PURE__*/new Vector3();\n\n\tconst _diff = /*@__PURE__*/new Vector3();\n\n\tconst _edge1 = /*@__PURE__*/new Vector3();\n\n\tconst _edge2 = /*@__PURE__*/new Vector3();\n\n\tconst _normal$1 = /*@__PURE__*/new Vector3();\n\n\tclass Ray {\n\t\tconstructor(origin = new Vector3(), direction = new Vector3(0, 0, -1)) {\n\t\t\tthis.origin = origin;\n\t\t\tthis.direction = direction;\n\t\t}\n\n\t\tset(origin, direction) {\n\t\t\tthis.origin.copy(origin);\n\t\t\tthis.direction.copy(direction);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(ray) {\n\t\t\tthis.origin.copy(ray.origin);\n\t\t\tthis.direction.copy(ray.direction);\n\t\t\treturn this;\n\t\t}\n\n\t\tat(t, target) {\n\t\t\treturn target.copy(this.direction).multiplyScalar(t).add(this.origin);\n\t\t}\n\n\t\tlookAt(v) {\n\t\t\tthis.direction.copy(v).sub(this.origin).normalize();\n\t\t\treturn this;\n\t\t}\n\n\t\trecast(t) {\n\t\t\tthis.origin.copy(this.at(t, _vector$a));\n\t\t\treturn this;\n\t\t}\n\n\t\tclosestPointToPoint(point, target) {\n\t\t\ttarget.subVectors(point, this.origin);\n\t\t\tconst directionDistance = target.dot(this.direction);\n\n\t\t\tif (directionDistance < 0) {\n\t\t\t\treturn target.copy(this.origin);\n\t\t\t}\n\n\t\t\treturn target.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\treturn Math.sqrt(this.distanceSqToPoint(point));\n\t\t}\n\n\t\tdistanceSqToPoint(point) {\n\t\t\tconst directionDistance = _vector$a.subVectors(point, this.origin).dot(this.direction); // point behind the ray\n\n\n\t\t\tif (directionDistance < 0) {\n\t\t\t\treturn this.origin.distanceToSquared(point);\n\t\t\t}\n\n\t\t\t_vector$a.copy(this.direction).multiplyScalar(directionDistance).add(this.origin);\n\n\t\t\treturn _vector$a.distanceToSquared(point);\n\t\t}\n\n\t\tdistanceSqToSegment(v0, v1, optionalPointOnRay, optionalPointOnSegment) {\n\t\t\t// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteDistRaySegment.h\n\t\t\t// It returns the min distance between the ray and the segment\n\t\t\t// defined by v0 and v1\n\t\t\t// It can also set two optional targets :\n\t\t\t// - The closest point on the ray\n\t\t\t// - The closest point on the segment\n\t\t\t_segCenter.copy(v0).add(v1).multiplyScalar(0.5);\n\n\t\t\t_segDir.copy(v1).sub(v0).normalize();\n\n\t\t\t_diff.copy(this.origin).sub(_segCenter);\n\n\t\t\tconst segExtent = v0.distanceTo(v1) * 0.5;\n\t\t\tconst a01 = -this.direction.dot(_segDir);\n\n\t\t\tconst b0 = _diff.dot(this.direction);\n\n\t\t\tconst b1 = -_diff.dot(_segDir);\n\n\t\t\tconst c = _diff.lengthSq();\n\n\t\t\tconst det = Math.abs(1 - a01 * a01);\n\t\t\tlet s0, s1, sqrDist, extDet;\n\n\t\t\tif (det > 0) {\n\t\t\t\t// The ray and segment are not parallel.\n\t\t\t\ts0 = a01 * b1 - b0;\n\t\t\t\ts1 = a01 * b0 - b1;\n\t\t\t\textDet = segExtent * det;\n\n\t\t\t\tif (s0 >= 0) {\n\t\t\t\t\tif (s1 >= -extDet) {\n\t\t\t\t\t\tif (s1 <= extDet) {\n\t\t\t\t\t\t\t// region 0\n\t\t\t\t\t\t\t// Minimum at interior points of ray and segment.\n\t\t\t\t\t\t\tconst invDet = 1 / det;\n\t\t\t\t\t\t\ts0 *= invDet;\n\t\t\t\t\t\t\ts1 *= invDet;\n\t\t\t\t\t\t\tsqrDist = s0 * (s0 + a01 * s1 + 2 * b0) + s1 * (a01 * s0 + s1 + 2 * b1) + c;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// region 1\n\t\t\t\t\t\t\ts1 = segExtent;\n\t\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 5\n\t\t\t\t\t\ts1 = -segExtent;\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (s1 <= -extDet) {\n\t\t\t\t\t\t// region 4\n\t\t\t\t\t\ts0 = Math.max(0, -(-a01 * segExtent + b0));\n\t\t\t\t\t\ts1 = s0 > 0 ? -segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t} else if (s1 <= extDet) {\n\t\t\t\t\t\t// region 3\n\t\t\t\t\t\ts0 = 0;\n\t\t\t\t\t\ts1 = Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\t\tsqrDist = s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// region 2\n\t\t\t\t\t\ts0 = Math.max(0, -(a01 * segExtent + b0));\n\t\t\t\t\t\ts1 = s0 > 0 ? segExtent : Math.min(Math.max(-segExtent, -b1), segExtent);\n\t\t\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Ray and segment are parallel.\n\t\t\t\ts1 = a01 > 0 ? -segExtent : segExtent;\n\t\t\t\ts0 = Math.max(0, -(a01 * s1 + b0));\n\t\t\t\tsqrDist = -s0 * s0 + s1 * (s1 + 2 * b1) + c;\n\t\t\t}\n\n\t\t\tif (optionalPointOnRay) {\n\t\t\t\toptionalPointOnRay.copy(this.direction).multiplyScalar(s0).add(this.origin);\n\t\t\t}\n\n\t\t\tif (optionalPointOnSegment) {\n\t\t\t\toptionalPointOnSegment.copy(_segDir).multiplyScalar(s1).add(_segCenter);\n\t\t\t}\n\n\t\t\treturn sqrDist;\n\t\t}\n\n\t\tintersectSphere(sphere, target) {\n\t\t\t_vector$a.subVectors(sphere.center, this.origin);\n\n\t\t\tconst tca = _vector$a.dot(this.direction);\n\n\t\t\tconst d2 = _vector$a.dot(_vector$a) - tca * tca;\n\t\t\tconst radius2 = sphere.radius * sphere.radius;\n\t\t\tif (d2 > radius2) return null;\n\t\t\tconst thc = Math.sqrt(radius2 - d2); // t0 = first intersect point - entrance on front of sphere\n\n\t\t\tconst t0 = tca - thc; // t1 = second intersect point - exit point on back of sphere\n\n\t\t\tconst t1 = tca + thc; // test to see if both t0 and t1 are behind the ray - if so, return null\n\n\t\t\tif (t0 < 0 && t1 < 0) return null; // test to see if t0 is behind the ray:\n\t\t\t// if it is, the ray is inside the sphere, so return the second exit point scaled by t1,\n\t\t\t// in order to always return an intersect point that is in front of the ray.\n\n\t\t\tif (t0 < 0) return this.at(t1, target); // else t0 is in front of the ray, so return the first collision point scaled by t0\n\n\t\t\treturn this.at(t0, target);\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\treturn this.distanceSqToPoint(sphere.center) <= sphere.radius * sphere.radius;\n\t\t}\n\n\t\tdistanceToPlane(plane) {\n\t\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\t\tif (denominator === 0) {\n\t\t\t\t// line is coplanar, return origin\n\t\t\t\tif (plane.distanceToPoint(this.origin) === 0) {\n\t\t\t\t\treturn 0;\n\t\t\t\t} // Null is preferable to undefined since undefined means.... it is undefined\n\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst t = -(this.origin.dot(plane.normal) + plane.constant) / denominator; // Return if the ray never intersects the plane\n\n\t\t\treturn t >= 0 ? t : null;\n\t\t}\n\n\t\tintersectPlane(plane, target) {\n\t\t\tconst t = this.distanceToPlane(plane);\n\n\t\t\tif (t === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn this.at(t, target);\n\t\t}\n\n\t\tintersectsPlane(plane) {\n\t\t\t// check if the ray lies on the plane first\n\t\t\tconst distToPoint = plane.distanceToPoint(this.origin);\n\n\t\t\tif (distToPoint === 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst denominator = plane.normal.dot(this.direction);\n\n\t\t\tif (denominator * distToPoint < 0) {\n\t\t\t\treturn true;\n\t\t\t} // ray origin is behind the plane (and is pointing behind it)\n\n\n\t\t\treturn false;\n\t\t}\n\n\t\tintersectBox(box, target) {\n\t\t\tlet tmin, tmax, tymin, tymax, tzmin, tzmax;\n\t\t\tconst invdirx = 1 / this.direction.x,\n\t\t\t\t\t\tinvdiry = 1 / this.direction.y,\n\t\t\t\t\t\tinvdirz = 1 / this.direction.z;\n\t\t\tconst origin = this.origin;\n\n\t\t\tif (invdirx >= 0) {\n\t\t\t\ttmin = (box.min.x - origin.x) * invdirx;\n\t\t\t\ttmax = (box.max.x - origin.x) * invdirx;\n\t\t\t} else {\n\t\t\t\ttmin = (box.max.x - origin.x) * invdirx;\n\t\t\t\ttmax = (box.min.x - origin.x) * invdirx;\n\t\t\t}\n\n\t\t\tif (invdiry >= 0) {\n\t\t\t\ttymin = (box.min.y - origin.y) * invdiry;\n\t\t\t\ttymax = (box.max.y - origin.y) * invdiry;\n\t\t\t} else {\n\t\t\t\ttymin = (box.max.y - origin.y) * invdiry;\n\t\t\t\ttymax = (box.min.y - origin.y) * invdiry;\n\t\t\t}\n\n\t\t\tif (tmin > tymax || tymin > tmax) return null; // These lines also handle the case where tmin or tmax is NaN\n\t\t\t// (result of 0 * Infinity). x !== x returns true if x is NaN\n\n\t\t\tif (tymin > tmin || tmin !== tmin) tmin = tymin;\n\t\t\tif (tymax < tmax || tmax !== tmax) tmax = tymax;\n\n\t\t\tif (invdirz >= 0) {\n\t\t\t\ttzmin = (box.min.z - origin.z) * invdirz;\n\t\t\t\ttzmax = (box.max.z - origin.z) * invdirz;\n\t\t\t} else {\n\t\t\t\ttzmin = (box.max.z - origin.z) * invdirz;\n\t\t\t\ttzmax = (box.min.z - origin.z) * invdirz;\n\t\t\t}\n\n\t\t\tif (tmin > tzmax || tzmin > tmax) return null;\n\t\t\tif (tzmin > tmin || tmin !== tmin) tmin = tzmin;\n\t\t\tif (tzmax < tmax || tmax !== tmax) tmax = tzmax; //return point closest to the ray (positive side)\n\n\t\t\tif (tmax < 0) return null;\n\t\t\treturn this.at(tmin >= 0 ? tmin : tmax, target);\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn this.intersectBox(box, _vector$a) !== null;\n\t\t}\n\n\t\tintersectTriangle(a, b, c, backfaceCulling, target) {\n\t\t\t// Compute the offset origin, edges, and normal.\n\t\t\t// from http://www.geometrictools.com/GTEngine/Include/Mathematics/GteIntrRay3Triangle3.h\n\t\t\t_edge1.subVectors(b, a);\n\n\t\t\t_edge2.subVectors(c, a);\n\n\t\t\t_normal$1.crossVectors(_edge1, _edge2); // Solve Q + t*D = b1*E1 + b2*E2 (Q = kDiff, D = ray direction,\n\t\t\t// E1 = kEdge1, E2 = kEdge2, N = Cross(E1,E2)) by\n\t\t\t//\t |Dot(D,N)|*b1 = sign(Dot(D,N))*Dot(D,Cross(Q,E2))\n\t\t\t//\t |Dot(D,N)|*b2 = sign(Dot(D,N))*Dot(D,Cross(E1,Q))\n\t\t\t//\t |Dot(D,N)|*t = -sign(Dot(D,N))*Dot(Q,N)\n\n\n\t\t\tlet DdN = this.direction.dot(_normal$1);\n\t\t\tlet sign;\n\n\t\t\tif (DdN > 0) {\n\t\t\t\tif (backfaceCulling) return null;\n\t\t\t\tsign = 1;\n\t\t\t} else if (DdN < 0) {\n\t\t\t\tsign = -1;\n\t\t\t\tDdN = -DdN;\n\t\t\t} else {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\t_diff.subVectors(this.origin, a);\n\n\t\t\tconst DdQxE2 = sign * this.direction.dot(_edge2.crossVectors(_diff, _edge2)); // b1 < 0, no intersection\n\n\t\t\tif (DdQxE2 < 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst DdE1xQ = sign * this.direction.dot(_edge1.cross(_diff)); // b2 < 0, no intersection\n\n\t\t\tif (DdE1xQ < 0) {\n\t\t\t\treturn null;\n\t\t\t} // b1+b2 > 1, no intersection\n\n\n\t\t\tif (DdQxE2 + DdE1xQ > DdN) {\n\t\t\t\treturn null;\n\t\t\t} // Line intersects triangle, check if ray does.\n\n\n\t\t\tconst QdN = -sign * _diff.dot(_normal$1); // t < 0, no intersection\n\n\n\t\t\tif (QdN < 0) {\n\t\t\t\treturn null;\n\t\t\t} // Ray intersects triangle.\n\n\n\t\t\treturn this.at(QdN / DdN, target);\n\t\t}\n\n\t\tapplyMatrix4(matrix4) {\n\t\t\tthis.origin.applyMatrix4(matrix4);\n\t\t\tthis.direction.transformDirection(matrix4);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(ray) {\n\t\t\treturn ray.origin.equals(this.origin) && ray.direction.equals(this.direction);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tclass Matrix4 {\n\t\tconstructor() {\n\t\t\tthis.elements = [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n\n\t\t\tif (arguments.length > 0) {\n\t\t\t\tconsole.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.');\n\t\t\t}\n\t\t}\n\n\t\tset(n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] = n11;\n\t\t\tte[4] = n12;\n\t\t\tte[8] = n13;\n\t\t\tte[12] = n14;\n\t\t\tte[1] = n21;\n\t\t\tte[5] = n22;\n\t\t\tte[9] = n23;\n\t\t\tte[13] = n24;\n\t\t\tte[2] = n31;\n\t\t\tte[6] = n32;\n\t\t\tte[10] = n33;\n\t\t\tte[14] = n34;\n\t\t\tte[3] = n41;\n\t\t\tte[7] = n42;\n\t\t\tte[11] = n43;\n\t\t\tte[15] = n44;\n\t\t\treturn this;\n\t\t}\n\n\t\tidentity() {\n\t\t\tthis.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Matrix4().fromArray(this.elements);\n\t\t}\n\n\t\tcopy(m) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = m.elements;\n\t\t\tte[0] = me[0];\n\t\t\tte[1] = me[1];\n\t\t\tte[2] = me[2];\n\t\t\tte[3] = me[3];\n\t\t\tte[4] = me[4];\n\t\t\tte[5] = me[5];\n\t\t\tte[6] = me[6];\n\t\t\tte[7] = me[7];\n\t\t\tte[8] = me[8];\n\t\t\tte[9] = me[9];\n\t\t\tte[10] = me[10];\n\t\t\tte[11] = me[11];\n\t\t\tte[12] = me[12];\n\t\t\tte[13] = me[13];\n\t\t\tte[14] = me[14];\n\t\t\tte[15] = me[15];\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyPosition(m) {\n\t\t\tconst te = this.elements,\n\t\t\t\t\t\tme = m.elements;\n\t\t\tte[12] = me[12];\n\t\t\tte[13] = me[13];\n\t\t\tte[14] = me[14];\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromMatrix3(m) {\n\t\t\tconst me = m.elements;\n\t\t\tthis.set(me[0], me[3], me[6], 0, me[1], me[4], me[7], 0, me[2], me[5], me[8], 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\textractBasis(xAxis, yAxis, zAxis) {\n\t\t\txAxis.setFromMatrixColumn(this, 0);\n\t\t\tyAxis.setFromMatrixColumn(this, 1);\n\t\t\tzAxis.setFromMatrixColumn(this, 2);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeBasis(xAxis, yAxis, zAxis) {\n\t\t\tthis.set(xAxis.x, yAxis.x, zAxis.x, 0, xAxis.y, yAxis.y, zAxis.y, 0, xAxis.z, yAxis.z, zAxis.z, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\textractRotation(m) {\n\t\t\t// this method does not support reflection matrices\n\t\t\tconst te = this.elements;\n\t\t\tconst me = m.elements;\n\n\t\t\tconst scaleX = 1 / _v1$5.setFromMatrixColumn(m, 0).length();\n\n\t\t\tconst scaleY = 1 / _v1$5.setFromMatrixColumn(m, 1).length();\n\n\t\t\tconst scaleZ = 1 / _v1$5.setFromMatrixColumn(m, 2).length();\n\n\t\t\tte[0] = me[0] * scaleX;\n\t\t\tte[1] = me[1] * scaleX;\n\t\t\tte[2] = me[2] * scaleX;\n\t\t\tte[3] = 0;\n\t\t\tte[4] = me[4] * scaleY;\n\t\t\tte[5] = me[5] * scaleY;\n\t\t\tte[6] = me[6] * scaleY;\n\t\t\tte[7] = 0;\n\t\t\tte[8] = me[8] * scaleZ;\n\t\t\tte[9] = me[9] * scaleZ;\n\t\t\tte[10] = me[10] * scaleZ;\n\t\t\tte[11] = 0;\n\t\t\tte[12] = 0;\n\t\t\tte[13] = 0;\n\t\t\tte[14] = 0;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationFromEuler(euler) {\n\t\t\tif (!(euler && euler.isEuler)) {\n\t\t\t\tconsole.error('THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.');\n\t\t\t}\n\n\t\t\tconst te = this.elements;\n\t\t\tconst x = euler.x,\n\t\t\t\t\t\ty = euler.y,\n\t\t\t\t\t\tz = euler.z;\n\t\t\tconst a = Math.cos(x),\n\t\t\t\t\t\tb = Math.sin(x);\n\t\t\tconst c = Math.cos(y),\n\t\t\t\t\t\td = Math.sin(y);\n\t\t\tconst e = Math.cos(z),\n\t\t\t\t\t\tf = Math.sin(z);\n\n\t\t\tif (euler.order === 'XYZ') {\n\t\t\t\tconst ae = a * e,\n\t\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\t\tbf = b * f;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = -c * f;\n\t\t\t\tte[8] = d;\n\t\t\t\tte[1] = af + be * d;\n\t\t\t\tte[5] = ae - bf * d;\n\t\t\t\tte[9] = -b * c;\n\t\t\t\tte[2] = bf - ae * d;\n\t\t\t\tte[6] = be + af * d;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'YXZ') {\n\t\t\t\tconst ce = c * e,\n\t\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\t\tdf = d * f;\n\t\t\t\tte[0] = ce + df * b;\n\t\t\t\tte[4] = de * b - cf;\n\t\t\t\tte[8] = a * d;\n\t\t\t\tte[1] = a * f;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = -b;\n\t\t\t\tte[2] = cf * b - de;\n\t\t\t\tte[6] = df + ce * b;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'ZXY') {\n\t\t\t\tconst ce = c * e,\n\t\t\t\t\t\t\tcf = c * f,\n\t\t\t\t\t\t\tde = d * e,\n\t\t\t\t\t\t\tdf = d * f;\n\t\t\t\tte[0] = ce - df * b;\n\t\t\t\tte[4] = -a * f;\n\t\t\t\tte[8] = de + cf * b;\n\t\t\t\tte[1] = cf + de * b;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = df - ce * b;\n\t\t\t\tte[2] = -a * d;\n\t\t\t\tte[6] = b;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'ZYX') {\n\t\t\t\tconst ae = a * e,\n\t\t\t\t\t\t\taf = a * f,\n\t\t\t\t\t\t\tbe = b * e,\n\t\t\t\t\t\t\tbf = b * f;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = be * d - af;\n\t\t\t\tte[8] = ae * d + bf;\n\t\t\t\tte[1] = c * f;\n\t\t\t\tte[5] = bf * d + ae;\n\t\t\t\tte[9] = af * d - be;\n\t\t\t\tte[2] = -d;\n\t\t\t\tte[6] = b * c;\n\t\t\t\tte[10] = a * c;\n\t\t\t} else if (euler.order === 'YZX') {\n\t\t\t\tconst ac = a * c,\n\t\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\t\tbd = b * d;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = bd - ac * f;\n\t\t\t\tte[8] = bc * f + ad;\n\t\t\t\tte[1] = f;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = -b * e;\n\t\t\t\tte[2] = -d * e;\n\t\t\t\tte[6] = ad * f + bc;\n\t\t\t\tte[10] = ac - bd * f;\n\t\t\t} else if (euler.order === 'XZY') {\n\t\t\t\tconst ac = a * c,\n\t\t\t\t\t\t\tad = a * d,\n\t\t\t\t\t\t\tbc = b * c,\n\t\t\t\t\t\t\tbd = b * d;\n\t\t\t\tte[0] = c * e;\n\t\t\t\tte[4] = -f;\n\t\t\t\tte[8] = d * e;\n\t\t\t\tte[1] = ac * f + bd;\n\t\t\t\tte[5] = a * e;\n\t\t\t\tte[9] = ad * f - bc;\n\t\t\t\tte[2] = bc * f - ad;\n\t\t\t\tte[6] = b * e;\n\t\t\t\tte[10] = bd * f + ac;\n\t\t\t} // bottom row\n\n\n\t\t\tte[3] = 0;\n\t\t\tte[7] = 0;\n\t\t\tte[11] = 0; // last column\n\n\t\t\tte[12] = 0;\n\t\t\tte[13] = 0;\n\t\t\tte[14] = 0;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationFromQuaternion(q) {\n\t\t\treturn this.compose(_zero, q, _one);\n\t\t}\n\n\t\tlookAt(eye, target, up) {\n\t\t\tconst te = this.elements;\n\n\t\t\t_z.subVectors(eye, target);\n\n\t\t\tif (_z.lengthSq() === 0) {\n\t\t\t\t// eye and target are in the same position\n\t\t\t\t_z.z = 1;\n\t\t\t}\n\n\t\t\t_z.normalize();\n\n\t\t\t_x.crossVectors(up, _z);\n\n\t\t\tif (_x.lengthSq() === 0) {\n\t\t\t\t// up and z are parallel\n\t\t\t\tif (Math.abs(up.z) === 1) {\n\t\t\t\t\t_z.x += 0.0001;\n\t\t\t\t} else {\n\t\t\t\t\t_z.z += 0.0001;\n\t\t\t\t}\n\n\t\t\t\t_z.normalize();\n\n\t\t\t\t_x.crossVectors(up, _z);\n\t\t\t}\n\n\t\t\t_x.normalize();\n\n\t\t\t_y.crossVectors(_z, _x);\n\n\t\t\tte[0] = _x.x;\n\t\t\tte[4] = _y.x;\n\t\t\tte[8] = _z.x;\n\t\t\tte[1] = _x.y;\n\t\t\tte[5] = _y.y;\n\t\t\tte[9] = _z.y;\n\t\t\tte[2] = _x.z;\n\t\t\tte[6] = _y.z;\n\t\t\tte[10] = _z.z;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(m, n) {\n\t\t\tif (n !== undefined) {\n\t\t\t\tconsole.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.');\n\t\t\t\treturn this.multiplyMatrices(m, n);\n\t\t\t}\n\n\t\t\treturn this.multiplyMatrices(this, m);\n\t\t}\n\n\t\tpremultiply(m) {\n\t\t\treturn this.multiplyMatrices(m, this);\n\t\t}\n\n\t\tmultiplyMatrices(a, b) {\n\t\t\tconst ae = a.elements;\n\t\t\tconst be = b.elements;\n\t\t\tconst te = this.elements;\n\t\t\tconst a11 = ae[0],\n\t\t\t\t\t\ta12 = ae[4],\n\t\t\t\t\t\ta13 = ae[8],\n\t\t\t\t\t\ta14 = ae[12];\n\t\t\tconst a21 = ae[1],\n\t\t\t\t\t\ta22 = ae[5],\n\t\t\t\t\t\ta23 = ae[9],\n\t\t\t\t\t\ta24 = ae[13];\n\t\t\tconst a31 = ae[2],\n\t\t\t\t\t\ta32 = ae[6],\n\t\t\t\t\t\ta33 = ae[10],\n\t\t\t\t\t\ta34 = ae[14];\n\t\t\tconst a41 = ae[3],\n\t\t\t\t\t\ta42 = ae[7],\n\t\t\t\t\t\ta43 = ae[11],\n\t\t\t\t\t\ta44 = ae[15];\n\t\t\tconst b11 = be[0],\n\t\t\t\t\t\tb12 = be[4],\n\t\t\t\t\t\tb13 = be[8],\n\t\t\t\t\t\tb14 = be[12];\n\t\t\tconst b21 = be[1],\n\t\t\t\t\t\tb22 = be[5],\n\t\t\t\t\t\tb23 = be[9],\n\t\t\t\t\t\tb24 = be[13];\n\t\t\tconst b31 = be[2],\n\t\t\t\t\t\tb32 = be[6],\n\t\t\t\t\t\tb33 = be[10],\n\t\t\t\t\t\tb34 = be[14];\n\t\t\tconst b41 = be[3],\n\t\t\t\t\t\tb42 = be[7],\n\t\t\t\t\t\tb43 = be[11],\n\t\t\t\t\t\tb44 = be[15];\n\t\t\tte[0] = a11 * b11 + a12 * b21 + a13 * b31 + a14 * b41;\n\t\t\tte[4] = a11 * b12 + a12 * b22 + a13 * b32 + a14 * b42;\n\t\t\tte[8] = a11 * b13 + a12 * b23 + a13 * b33 + a14 * b43;\n\t\t\tte[12] = a11 * b14 + a12 * b24 + a13 * b34 + a14 * b44;\n\t\t\tte[1] = a21 * b11 + a22 * b21 + a23 * b31 + a24 * b41;\n\t\t\tte[5] = a21 * b12 + a22 * b22 + a23 * b32 + a24 * b42;\n\t\t\tte[9] = a21 * b13 + a22 * b23 + a23 * b33 + a24 * b43;\n\t\t\tte[13] = a21 * b14 + a22 * b24 + a23 * b34 + a24 * b44;\n\t\t\tte[2] = a31 * b11 + a32 * b21 + a33 * b31 + a34 * b41;\n\t\t\tte[6] = a31 * b12 + a32 * b22 + a33 * b32 + a34 * b42;\n\t\t\tte[10] = a31 * b13 + a32 * b23 + a33 * b33 + a34 * b43;\n\t\t\tte[14] = a31 * b14 + a32 * b24 + a33 * b34 + a34 * b44;\n\t\t\tte[3] = a41 * b11 + a42 * b21 + a43 * b31 + a44 * b41;\n\t\t\tte[7] = a41 * b12 + a42 * b22 + a43 * b32 + a44 * b42;\n\t\t\tte[11] = a41 * b13 + a42 * b23 + a43 * b33 + a44 * b43;\n\t\t\tte[15] = a41 * b14 + a42 * b24 + a43 * b34 + a44 * b44;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(s) {\n\t\t\tconst te = this.elements;\n\t\t\tte[0] *= s;\n\t\t\tte[4] *= s;\n\t\t\tte[8] *= s;\n\t\t\tte[12] *= s;\n\t\t\tte[1] *= s;\n\t\t\tte[5] *= s;\n\t\t\tte[9] *= s;\n\t\t\tte[13] *= s;\n\t\t\tte[2] *= s;\n\t\t\tte[6] *= s;\n\t\t\tte[10] *= s;\n\t\t\tte[14] *= s;\n\t\t\tte[3] *= s;\n\t\t\tte[7] *= s;\n\t\t\tte[11] *= s;\n\t\t\tte[15] *= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tdeterminant() {\n\t\t\tconst te = this.elements;\n\t\t\tconst n11 = te[0],\n\t\t\t\t\t\tn12 = te[4],\n\t\t\t\t\t\tn13 = te[8],\n\t\t\t\t\t\tn14 = te[12];\n\t\t\tconst n21 = te[1],\n\t\t\t\t\t\tn22 = te[5],\n\t\t\t\t\t\tn23 = te[9],\n\t\t\t\t\t\tn24 = te[13];\n\t\t\tconst n31 = te[2],\n\t\t\t\t\t\tn32 = te[6],\n\t\t\t\t\t\tn33 = te[10],\n\t\t\t\t\t\tn34 = te[14];\n\t\t\tconst n41 = te[3],\n\t\t\t\t\t\tn42 = te[7],\n\t\t\t\t\t\tn43 = te[11],\n\t\t\t\t\t\tn44 = te[15]; //TODO: make this more efficient\n\t\t\t//( based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm )\n\n\t\t\treturn n41 * (+n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34) + n42 * (+n11 * n23 * n34 - n11 * n24 * n33 + n14 * n21 * n33 - n13 * n21 * n34 + n13 * n24 * n31 - n14 * n23 * n31) + n43 * (+n11 * n24 * n32 - n11 * n22 * n34 - n14 * n21 * n32 + n12 * n21 * n34 + n14 * n22 * n31 - n12 * n24 * n31) + n44 * (-n13 * n22 * n31 - n11 * n23 * n32 + n11 * n22 * n33 + n13 * n21 * n32 - n12 * n21 * n33 + n12 * n23 * n31);\n\t\t}\n\n\t\ttranspose() {\n\t\t\tconst te = this.elements;\n\t\t\tlet tmp;\n\t\t\ttmp = te[1];\n\t\t\tte[1] = te[4];\n\t\t\tte[4] = tmp;\n\t\t\ttmp = te[2];\n\t\t\tte[2] = te[8];\n\t\t\tte[8] = tmp;\n\t\t\ttmp = te[6];\n\t\t\tte[6] = te[9];\n\t\t\tte[9] = tmp;\n\t\t\ttmp = te[3];\n\t\t\tte[3] = te[12];\n\t\t\tte[12] = tmp;\n\t\t\ttmp = te[7];\n\t\t\tte[7] = te[13];\n\t\t\tte[13] = tmp;\n\t\t\ttmp = te[11];\n\t\t\tte[11] = te[14];\n\t\t\tte[14] = tmp;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetPosition(x, y, z) {\n\t\t\tconst te = this.elements;\n\n\t\t\tif (x.isVector3) {\n\t\t\t\tte[12] = x.x;\n\t\t\t\tte[13] = x.y;\n\t\t\t\tte[14] = x.z;\n\t\t\t} else {\n\t\t\t\tte[12] = x;\n\t\t\t\tte[13] = y;\n\t\t\t\tte[14] = z;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tinvert() {\n\t\t\t// based on http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n\t\t\tconst te = this.elements,\n\t\t\t\t\t\tn11 = te[0],\n\t\t\t\t\t\tn21 = te[1],\n\t\t\t\t\t\tn31 = te[2],\n\t\t\t\t\t\tn41 = te[3],\n\t\t\t\t\t\tn12 = te[4],\n\t\t\t\t\t\tn22 = te[5],\n\t\t\t\t\t\tn32 = te[6],\n\t\t\t\t\t\tn42 = te[7],\n\t\t\t\t\t\tn13 = te[8],\n\t\t\t\t\t\tn23 = te[9],\n\t\t\t\t\t\tn33 = te[10],\n\t\t\t\t\t\tn43 = te[11],\n\t\t\t\t\t\tn14 = te[12],\n\t\t\t\t\t\tn24 = te[13],\n\t\t\t\t\t\tn34 = te[14],\n\t\t\t\t\t\tn44 = te[15],\n\t\t\t\t\t\tt11 = n23 * n34 * n42 - n24 * n33 * n42 + n24 * n32 * n43 - n22 * n34 * n43 - n23 * n32 * n44 + n22 * n33 * n44,\n\t\t\t\t\t\tt12 = n14 * n33 * n42 - n13 * n34 * n42 - n14 * n32 * n43 + n12 * n34 * n43 + n13 * n32 * n44 - n12 * n33 * n44,\n\t\t\t\t\t\tt13 = n13 * n24 * n42 - n14 * n23 * n42 + n14 * n22 * n43 - n12 * n24 * n43 - n13 * n22 * n44 + n12 * n23 * n44,\n\t\t\t\t\t\tt14 = n14 * n23 * n32 - n13 * n24 * n32 - n14 * n22 * n33 + n12 * n24 * n33 + n13 * n22 * n34 - n12 * n23 * n34;\n\t\t\tconst det = n11 * t11 + n21 * t12 + n31 * t13 + n41 * t14;\n\t\t\tif (det === 0) return this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n\t\t\tconst detInv = 1 / det;\n\t\t\tte[0] = t11 * detInv;\n\t\t\tte[1] = (n24 * n33 * n41 - n23 * n34 * n41 - n24 * n31 * n43 + n21 * n34 * n43 + n23 * n31 * n44 - n21 * n33 * n44) * detInv;\n\t\t\tte[2] = (n22 * n34 * n41 - n24 * n32 * n41 + n24 * n31 * n42 - n21 * n34 * n42 - n22 * n31 * n44 + n21 * n32 * n44) * detInv;\n\t\t\tte[3] = (n23 * n32 * n41 - n22 * n33 * n41 - n23 * n31 * n42 + n21 * n33 * n42 + n22 * n31 * n43 - n21 * n32 * n43) * detInv;\n\t\t\tte[4] = t12 * detInv;\n\t\t\tte[5] = (n13 * n34 * n41 - n14 * n33 * n41 + n14 * n31 * n43 - n11 * n34 * n43 - n13 * n31 * n44 + n11 * n33 * n44) * detInv;\n\t\t\tte[6] = (n14 * n32 * n41 - n12 * n34 * n41 - n14 * n31 * n42 + n11 * n34 * n42 + n12 * n31 * n44 - n11 * n32 * n44) * detInv;\n\t\t\tte[7] = (n12 * n33 * n41 - n13 * n32 * n41 + n13 * n31 * n42 - n11 * n33 * n42 - n12 * n31 * n43 + n11 * n32 * n43) * detInv;\n\t\t\tte[8] = t13 * detInv;\n\t\t\tte[9] = (n14 * n23 * n41 - n13 * n24 * n41 - n14 * n21 * n43 + n11 * n24 * n43 + n13 * n21 * n44 - n11 * n23 * n44) * detInv;\n\t\t\tte[10] = (n12 * n24 * n41 - n14 * n22 * n41 + n14 * n21 * n42 - n11 * n24 * n42 - n12 * n21 * n44 + n11 * n22 * n44) * detInv;\n\t\t\tte[11] = (n13 * n22 * n41 - n12 * n23 * n41 - n13 * n21 * n42 + n11 * n23 * n42 + n12 * n21 * n43 - n11 * n22 * n43) * detInv;\n\t\t\tte[12] = t14 * detInv;\n\t\t\tte[13] = (n13 * n24 * n31 - n14 * n23 * n31 + n14 * n21 * n33 - n11 * n24 * n33 - n13 * n21 * n34 + n11 * n23 * n34) * detInv;\n\t\t\tte[14] = (n14 * n22 * n31 - n12 * n24 * n31 - n14 * n21 * n32 + n11 * n24 * n32 + n12 * n21 * n34 - n11 * n22 * n34) * detInv;\n\t\t\tte[15] = (n12 * n23 * n31 - n13 * n22 * n31 + n13 * n21 * n32 - n11 * n23 * n32 - n12 * n21 * n33 + n11 * n22 * n33) * detInv;\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(v) {\n\t\t\tconst te = this.elements;\n\t\t\tconst x = v.x,\n\t\t\t\t\t\ty = v.y,\n\t\t\t\t\t\tz = v.z;\n\t\t\tte[0] *= x;\n\t\t\tte[4] *= y;\n\t\t\tte[8] *= z;\n\t\t\tte[1] *= x;\n\t\t\tte[5] *= y;\n\t\t\tte[9] *= z;\n\t\t\tte[2] *= x;\n\t\t\tte[6] *= y;\n\t\t\tte[10] *= z;\n\t\t\tte[3] *= x;\n\t\t\tte[7] *= y;\n\t\t\tte[11] *= z;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetMaxScaleOnAxis() {\n\t\t\tconst te = this.elements;\n\t\t\tconst scaleXSq = te[0] * te[0] + te[1] * te[1] + te[2] * te[2];\n\t\t\tconst scaleYSq = te[4] * te[4] + te[5] * te[5] + te[6] * te[6];\n\t\t\tconst scaleZSq = te[8] * te[8] + te[9] * te[9] + te[10] * te[10];\n\t\t\treturn Math.sqrt(Math.max(scaleXSq, scaleYSq, scaleZSq));\n\t\t}\n\n\t\tmakeTranslation(x, y, z) {\n\t\t\tthis.set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationX(theta) {\n\t\t\tconst c = Math.cos(theta),\n\t\t\t\t\t\ts = Math.sin(theta);\n\t\t\tthis.set(1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationY(theta) {\n\t\t\tconst c = Math.cos(theta),\n\t\t\t\t\t\ts = Math.sin(theta);\n\t\t\tthis.set(c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationZ(theta) {\n\t\t\tconst c = Math.cos(theta),\n\t\t\t\t\t\ts = Math.sin(theta);\n\t\t\tthis.set(c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeRotationAxis(axis, angle) {\n\t\t\t// Based on http://www.gamedev.net/reference/articles/article1199.asp\n\t\t\tconst c = Math.cos(angle);\n\t\t\tconst s = Math.sin(angle);\n\t\t\tconst t = 1 - c;\n\t\t\tconst x = axis.x,\n\t\t\t\t\t\ty = axis.y,\n\t\t\t\t\t\tz = axis.z;\n\t\t\tconst tx = t * x,\n\t\t\t\t\t\tty = t * y;\n\t\t\tthis.set(tx * x + c, tx * y - s * z, tx * z + s * y, 0, tx * y + s * z, ty * y + c, ty * z - s * x, 0, tx * z - s * y, ty * z + s * x, t * z * z + c, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeScale(x, y, z) {\n\t\t\tthis.set(x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeShear(xy, xz, yx, yz, zx, zy) {\n\t\t\tthis.set(1, yx, zx, 0, xy, 1, zy, 0, xz, yz, 1, 0, 0, 0, 0, 1);\n\t\t\treturn this;\n\t\t}\n\n\t\tcompose(position, quaternion, scale) {\n\t\t\tconst te = this.elements;\n\t\t\tconst x = quaternion._x,\n\t\t\t\t\t\ty = quaternion._y,\n\t\t\t\t\t\tz = quaternion._z,\n\t\t\t\t\t\tw = quaternion._w;\n\t\t\tconst x2 = x + x,\n\t\t\t\t\t\ty2 = y + y,\n\t\t\t\t\t\tz2 = z + z;\n\t\t\tconst xx = x * x2,\n\t\t\t\t\t\txy = x * y2,\n\t\t\t\t\t\txz = x * z2;\n\t\t\tconst yy = y * y2,\n\t\t\t\t\t\tyz = y * z2,\n\t\t\t\t\t\tzz = z * z2;\n\t\t\tconst wx = w * x2,\n\t\t\t\t\t\twy = w * y2,\n\t\t\t\t\t\twz = w * z2;\n\t\t\tconst sx = scale.x,\n\t\t\t\t\t\tsy = scale.y,\n\t\t\t\t\t\tsz = scale.z;\n\t\t\tte[0] = (1 - (yy + zz)) * sx;\n\t\t\tte[1] = (xy + wz) * sx;\n\t\t\tte[2] = (xz - wy) * sx;\n\t\t\tte[3] = 0;\n\t\t\tte[4] = (xy - wz) * sy;\n\t\t\tte[5] = (1 - (xx + zz)) * sy;\n\t\t\tte[6] = (yz + wx) * sy;\n\t\t\tte[7] = 0;\n\t\t\tte[8] = (xz + wy) * sz;\n\t\t\tte[9] = (yz - wx) * sz;\n\t\t\tte[10] = (1 - (xx + yy)) * sz;\n\t\t\tte[11] = 0;\n\t\t\tte[12] = position.x;\n\t\t\tte[13] = position.y;\n\t\t\tte[14] = position.z;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tdecompose(position, quaternion, scale) {\n\t\t\tconst te = this.elements;\n\n\t\t\tlet sx = _v1$5.set(te[0], te[1], te[2]).length();\n\n\t\t\tconst sy = _v1$5.set(te[4], te[5], te[6]).length();\n\n\t\t\tconst sz = _v1$5.set(te[8], te[9], te[10]).length(); // if determine is negative, we need to invert one scale\n\n\n\t\t\tconst det = this.determinant();\n\t\t\tif (det < 0) sx = -sx;\n\t\t\tposition.x = te[12];\n\t\t\tposition.y = te[13];\n\t\t\tposition.z = te[14]; // scale the rotation part\n\n\t\t\t_m1$2.copy(this);\n\n\t\t\tconst invSX = 1 / sx;\n\t\t\tconst invSY = 1 / sy;\n\t\t\tconst invSZ = 1 / sz;\n\t\t\t_m1$2.elements[0] *= invSX;\n\t\t\t_m1$2.elements[1] *= invSX;\n\t\t\t_m1$2.elements[2] *= invSX;\n\t\t\t_m1$2.elements[4] *= invSY;\n\t\t\t_m1$2.elements[5] *= invSY;\n\t\t\t_m1$2.elements[6] *= invSY;\n\t\t\t_m1$2.elements[8] *= invSZ;\n\t\t\t_m1$2.elements[9] *= invSZ;\n\t\t\t_m1$2.elements[10] *= invSZ;\n\t\t\tquaternion.setFromRotationMatrix(_m1$2);\n\t\t\tscale.x = sx;\n\t\t\tscale.y = sy;\n\t\t\tscale.z = sz;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakePerspective(left, right, top, bottom, near, far) {\n\t\t\tif (far === undefined) {\n\t\t\t\tconsole.warn('THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.');\n\t\t\t}\n\n\t\t\tconst te = this.elements;\n\t\t\tconst x = 2 * near / (right - left);\n\t\t\tconst y = 2 * near / (top - bottom);\n\t\t\tconst a = (right + left) / (right - left);\n\t\t\tconst b = (top + bottom) / (top - bottom);\n\t\t\tconst c = -(far + near) / (far - near);\n\t\t\tconst d = -2 * far * near / (far - near);\n\t\t\tte[0] = x;\n\t\t\tte[4] = 0;\n\t\t\tte[8] = a;\n\t\t\tte[12] = 0;\n\t\t\tte[1] = 0;\n\t\t\tte[5] = y;\n\t\t\tte[9] = b;\n\t\t\tte[13] = 0;\n\t\t\tte[2] = 0;\n\t\t\tte[6] = 0;\n\t\t\tte[10] = c;\n\t\t\tte[14] = d;\n\t\t\tte[3] = 0;\n\t\t\tte[7] = 0;\n\t\t\tte[11] = -1;\n\t\t\tte[15] = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeOrthographic(left, right, top, bottom, near, far) {\n\t\t\tconst te = this.elements;\n\t\t\tconst w = 1.0 / (right - left);\n\t\t\tconst h = 1.0 / (top - bottom);\n\t\t\tconst p = 1.0 / (far - near);\n\t\t\tconst x = (right + left) * w;\n\t\t\tconst y = (top + bottom) * h;\n\t\t\tconst z = (far + near) * p;\n\t\t\tte[0] = 2 * w;\n\t\t\tte[4] = 0;\n\t\t\tte[8] = 0;\n\t\t\tte[12] = -x;\n\t\t\tte[1] = 0;\n\t\t\tte[5] = 2 * h;\n\t\t\tte[9] = 0;\n\t\t\tte[13] = -y;\n\t\t\tte[2] = 0;\n\t\t\tte[6] = 0;\n\t\t\tte[10] = -2 * p;\n\t\t\tte[14] = -z;\n\t\t\tte[3] = 0;\n\t\t\tte[7] = 0;\n\t\t\tte[11] = 0;\n\t\t\tte[15] = 1;\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(matrix) {\n\t\t\tconst te = this.elements;\n\t\t\tconst me = matrix.elements;\n\n\t\t\tfor (let i = 0; i < 16; i++) {\n\t\t\t\tif (te[i] !== me[i]) return false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tfor (let i = 0; i < 16; i++) {\n\t\t\t\tthis.elements[i] = array[i + offset];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tconst te = this.elements;\n\t\t\tarray[offset] = te[0];\n\t\t\tarray[offset + 1] = te[1];\n\t\t\tarray[offset + 2] = te[2];\n\t\t\tarray[offset + 3] = te[3];\n\t\t\tarray[offset + 4] = te[4];\n\t\t\tarray[offset + 5] = te[5];\n\t\t\tarray[offset + 6] = te[6];\n\t\t\tarray[offset + 7] = te[7];\n\t\t\tarray[offset + 8] = te[8];\n\t\t\tarray[offset + 9] = te[9];\n\t\t\tarray[offset + 10] = te[10];\n\t\t\tarray[offset + 11] = te[11];\n\t\t\tarray[offset + 12] = te[12];\n\t\t\tarray[offset + 13] = te[13];\n\t\t\tarray[offset + 14] = te[14];\n\t\t\tarray[offset + 15] = te[15];\n\t\t\treturn array;\n\t\t}\n\n\t}\n\n\tMatrix4.prototype.isMatrix4 = true;\n\n\tconst _v1$5 = /*@__PURE__*/new Vector3();\n\n\tconst _m1$2 = /*@__PURE__*/new Matrix4();\n\n\tconst _zero = /*@__PURE__*/new Vector3(0, 0, 0);\n\n\tconst _one = /*@__PURE__*/new Vector3(1, 1, 1);\n\n\tconst _x = /*@__PURE__*/new Vector3();\n\n\tconst _y = /*@__PURE__*/new Vector3();\n\n\tconst _z = /*@__PURE__*/new Vector3();\n\n\tconst _matrix$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _quaternion$3 = /*@__PURE__*/new Quaternion();\n\n\tclass Euler {\n\t\tconstructor(x = 0, y = 0, z = 0, order = Euler.DefaultOrder) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._order = order;\n\t\t}\n\n\t\tget x() {\n\t\t\treturn this._x;\n\t\t}\n\n\t\tset x(value) {\n\t\t\tthis._x = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget y() {\n\t\t\treturn this._y;\n\t\t}\n\n\t\tset y(value) {\n\t\t\tthis._y = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget z() {\n\t\t\treturn this._z;\n\t\t}\n\n\t\tset z(value) {\n\t\t\tthis._z = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tget order() {\n\t\t\treturn this._order;\n\t\t}\n\n\t\tset order(value) {\n\t\t\tthis._order = value;\n\n\t\t\tthis._onChangeCallback();\n\t\t}\n\n\t\tset(x, y, z, order = this._order) {\n\t\t\tthis._x = x;\n\t\t\tthis._y = y;\n\t\t\tthis._z = z;\n\t\t\tthis._order = order;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this._x, this._y, this._z, this._order);\n\t\t}\n\n\t\tcopy(euler) {\n\t\t\tthis._x = euler._x;\n\t\t\tthis._y = euler._y;\n\t\t\tthis._z = euler._z;\n\t\t\tthis._order = euler._order;\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromRotationMatrix(m, order = this._order, update = true) {\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tconst te = m.elements;\n\t\t\tconst m11 = te[0],\n\t\t\t\t\t\tm12 = te[4],\n\t\t\t\t\t\tm13 = te[8];\n\t\t\tconst m21 = te[1],\n\t\t\t\t\t\tm22 = te[5],\n\t\t\t\t\t\tm23 = te[9];\n\t\t\tconst m31 = te[2],\n\t\t\t\t\t\tm32 = te[6],\n\t\t\t\t\t\tm33 = te[10];\n\n\t\t\tswitch (order) {\n\t\t\t\tcase 'XYZ':\n\t\t\t\t\tthis._y = Math.asin(clamp(m13, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m13) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(-m12, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\t\tthis._z = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YXZ':\n\t\t\t\t\tthis._x = Math.asin(-clamp(m23, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m23) < 0.9999999) {\n\t\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(m21, m22);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\t\tthis._z = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZXY':\n\t\t\t\t\tthis._x = Math.asin(clamp(m32, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m32) < 0.9999999) {\n\t\t\t\t\t\tthis._y = Math.atan2(-m31, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._y = 0;\n\t\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'ZYX':\n\t\t\t\t\tthis._y = Math.asin(-clamp(m31, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m31) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(m32, m33);\n\t\t\t\t\t\tthis._z = Math.atan2(m21, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = 0;\n\t\t\t\t\t\tthis._z = Math.atan2(-m12, m22);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'YZX':\n\t\t\t\t\tthis._z = Math.asin(clamp(m21, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m21) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(-m23, m22);\n\t\t\t\t\t\tthis._y = Math.atan2(-m31, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = 0;\n\t\t\t\t\t\tthis._y = Math.atan2(m13, m33);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'XZY':\n\t\t\t\t\tthis._z = Math.asin(-clamp(m12, -1, 1));\n\n\t\t\t\t\tif (Math.abs(m12) < 0.9999999) {\n\t\t\t\t\t\tthis._x = Math.atan2(m32, m22);\n\t\t\t\t\t\tthis._y = Math.atan2(m13, m11);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis._x = Math.atan2(-m23, m33);\n\t\t\t\t\t\tthis._y = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.warn('THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order);\n\t\t\t}\n\n\t\t\tthis._order = order;\n\t\t\tif (update === true) this._onChangeCallback();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromQuaternion(q, order, update) {\n\t\t\t_matrix$1.makeRotationFromQuaternion(q);\n\n\t\t\treturn this.setFromRotationMatrix(_matrix$1, order, update);\n\t\t}\n\n\t\tsetFromVector3(v, order = this._order) {\n\t\t\treturn this.set(v.x, v.y, v.z, order);\n\t\t}\n\n\t\treorder(newOrder) {\n\t\t\t// WARNING: this discards revolution information -bhouston\n\t\t\t_quaternion$3.setFromEuler(this);\n\n\t\t\treturn this.setFromQuaternion(_quaternion$3, newOrder);\n\t\t}\n\n\t\tequals(euler) {\n\t\t\treturn euler._x === this._x && euler._y === this._y && euler._z === this._z && euler._order === this._order;\n\t\t}\n\n\t\tfromArray(array) {\n\t\t\tthis._x = array[0];\n\t\t\tthis._y = array[1];\n\t\t\tthis._z = array[2];\n\t\t\tif (array[3] !== undefined) this._order = array[3];\n\n\t\t\tthis._onChangeCallback();\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this._x;\n\t\t\tarray[offset + 1] = this._y;\n\t\t\tarray[offset + 2] = this._z;\n\t\t\tarray[offset + 3] = this._order;\n\t\t\treturn array;\n\t\t}\n\n\t\ttoVector3(optionalResult) {\n\t\t\tif (optionalResult) {\n\t\t\t\treturn optionalResult.set(this._x, this._y, this._z);\n\t\t\t} else {\n\t\t\t\treturn new Vector3(this._x, this._y, this._z);\n\t\t\t}\n\t\t}\n\n\t\t_onChange(callback) {\n\t\t\tthis._onChangeCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\t_onChangeCallback() {}\n\n\t}\n\n\tEuler.prototype.isEuler = true;\n\tEuler.DefaultOrder = 'XYZ';\n\tEuler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX'];\n\n\tclass Layers {\n\t\tconstructor() {\n\t\t\tthis.mask = 1 | 0;\n\t\t}\n\n\t\tset(channel) {\n\t\t\tthis.mask = 1 << channel | 0;\n\t\t}\n\n\t\tenable(channel) {\n\t\t\tthis.mask |= 1 << channel | 0;\n\t\t}\n\n\t\tenableAll() {\n\t\t\tthis.mask = 0xffffffff | 0;\n\t\t}\n\n\t\ttoggle(channel) {\n\t\t\tthis.mask ^= 1 << channel | 0;\n\t\t}\n\n\t\tdisable(channel) {\n\t\t\tthis.mask &= ~(1 << channel | 0);\n\t\t}\n\n\t\tdisableAll() {\n\t\t\tthis.mask = 0;\n\t\t}\n\n\t\ttest(layers) {\n\t\t\treturn (this.mask & layers.mask) !== 0;\n\t\t}\n\n\t}\n\n\tlet _object3DId = 0;\n\n\tconst _v1$4 = /*@__PURE__*/new Vector3();\n\n\tconst _q1 = /*@__PURE__*/new Quaternion();\n\n\tconst _m1$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _target = /*@__PURE__*/new Vector3();\n\n\tconst _position$3 = /*@__PURE__*/new Vector3();\n\n\tconst _scale$2 = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion$2 = /*@__PURE__*/new Quaternion();\n\n\tconst _xAxis = /*@__PURE__*/new Vector3(1, 0, 0);\n\n\tconst _yAxis = /*@__PURE__*/new Vector3(0, 1, 0);\n\n\tconst _zAxis = /*@__PURE__*/new Vector3(0, 0, 1);\n\n\tconst _addedEvent = {\n\t\ttype: 'added'\n\t};\n\tconst _removedEvent = {\n\t\ttype: 'removed'\n\t};\n\n\tclass Object3D extends EventDispatcher {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: _object3DId++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.type = 'Object3D';\n\t\t\tthis.parent = null;\n\t\t\tthis.children = [];\n\t\t\tthis.up = Object3D.DefaultUp.clone();\n\t\t\tconst position = new Vector3();\n\t\t\tconst rotation = new Euler();\n\t\t\tconst quaternion = new Quaternion();\n\t\t\tconst scale = new Vector3(1, 1, 1);\n\n\t\t\tfunction onRotationChange() {\n\t\t\t\tquaternion.setFromEuler(rotation, false);\n\t\t\t}\n\n\t\t\tfunction onQuaternionChange() {\n\t\t\t\trotation.setFromQuaternion(quaternion, undefined, false);\n\t\t\t}\n\n\t\t\trotation._onChange(onRotationChange);\n\n\t\t\tquaternion._onChange(onQuaternionChange);\n\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tposition: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: position\n\t\t\t\t},\n\t\t\t\trotation: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: rotation\n\t\t\t\t},\n\t\t\t\tquaternion: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: quaternion\n\t\t\t\t},\n\t\t\t\tscale: {\n\t\t\t\t\tconfigurable: true,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: scale\n\t\t\t\t},\n\t\t\t\tmodelViewMatrix: {\n\t\t\t\t\tvalue: new Matrix4()\n\t\t\t\t},\n\t\t\t\tnormalMatrix: {\n\t\t\t\t\tvalue: new Matrix3()\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.matrix = new Matrix4();\n\t\t\tthis.matrixWorld = new Matrix4();\n\t\t\tthis.matrixAutoUpdate = Object3D.DefaultMatrixAutoUpdate;\n\t\t\tthis.matrixWorldNeedsUpdate = false;\n\t\t\tthis.layers = new Layers();\n\t\t\tthis.visible = true;\n\t\t\tthis.castShadow = false;\n\t\t\tthis.receiveShadow = false;\n\t\t\tthis.frustumCulled = true;\n\t\t\tthis.renderOrder = 0;\n\t\t\tthis.animations = [];\n\t\t\tthis.userData = {};\n\t\t}\n\n\t\tonBeforeRender() {}\n\n\t\tonAfterRender() {}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tif (this.matrixAutoUpdate) this.updateMatrix();\n\t\t\tthis.matrix.premultiply(matrix);\n\t\t\tthis.matrix.decompose(this.position, this.quaternion, this.scale);\n\t\t}\n\n\t\tapplyQuaternion(q) {\n\t\t\tthis.quaternion.premultiply(q);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRotationFromAxisAngle(axis, angle) {\n\t\t\t// assumes axis is normalized\n\t\t\tthis.quaternion.setFromAxisAngle(axis, angle);\n\t\t}\n\n\t\tsetRotationFromEuler(euler) {\n\t\t\tthis.quaternion.setFromEuler(euler, true);\n\t\t}\n\n\t\tsetRotationFromMatrix(m) {\n\t\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\t\t\tthis.quaternion.setFromRotationMatrix(m);\n\t\t}\n\n\t\tsetRotationFromQuaternion(q) {\n\t\t\t// assumes q is normalized\n\t\t\tthis.quaternion.copy(q);\n\t\t}\n\n\t\trotateOnAxis(axis, angle) {\n\t\t\t// rotate object on axis in object space\n\t\t\t// axis is assumed to be normalized\n\t\t\t_q1.setFromAxisAngle(axis, angle);\n\n\t\t\tthis.quaternion.multiply(_q1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateOnWorldAxis(axis, angle) {\n\t\t\t// rotate object on axis in world space\n\t\t\t// axis is assumed to be normalized\n\t\t\t// method assumes no rotated parent\n\t\t\t_q1.setFromAxisAngle(axis, angle);\n\n\t\t\tthis.quaternion.premultiply(_q1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateX(angle) {\n\t\t\treturn this.rotateOnAxis(_xAxis, angle);\n\t\t}\n\n\t\trotateY(angle) {\n\t\t\treturn this.rotateOnAxis(_yAxis, angle);\n\t\t}\n\n\t\trotateZ(angle) {\n\t\t\treturn this.rotateOnAxis(_zAxis, angle);\n\t\t}\n\n\t\ttranslateOnAxis(axis, distance) {\n\t\t\t// translate object by distance along axis in object space\n\t\t\t// axis is assumed to be normalized\n\t\t\t_v1$4.copy(axis).applyQuaternion(this.quaternion);\n\n\t\t\tthis.position.add(_v1$4.multiplyScalar(distance));\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslateX(distance) {\n\t\t\treturn this.translateOnAxis(_xAxis, distance);\n\t\t}\n\n\t\ttranslateY(distance) {\n\t\t\treturn this.translateOnAxis(_yAxis, distance);\n\t\t}\n\n\t\ttranslateZ(distance) {\n\t\t\treturn this.translateOnAxis(_zAxis, distance);\n\t\t}\n\n\t\tlocalToWorld(vector) {\n\t\t\treturn vector.applyMatrix4(this.matrixWorld);\n\t\t}\n\n\t\tworldToLocal(vector) {\n\t\t\treturn vector.applyMatrix4(_m1$1.copy(this.matrixWorld).invert());\n\t\t}\n\n\t\tlookAt(x, y, z) {\n\t\t\t// This method does not support objects having non-uniformly-scaled parent(s)\n\t\t\tif (x.isVector3) {\n\t\t\t\t_target.copy(x);\n\t\t\t} else {\n\t\t\t\t_target.set(x, y, z);\n\t\t\t}\n\n\t\t\tconst parent = this.parent;\n\t\t\tthis.updateWorldMatrix(true, false);\n\n\t\t\t_position$3.setFromMatrixPosition(this.matrixWorld);\n\n\t\t\tif (this.isCamera || this.isLight) {\n\t\t\t\t_m1$1.lookAt(_position$3, _target, this.up);\n\t\t\t} else {\n\t\t\t\t_m1$1.lookAt(_target, _position$3, this.up);\n\t\t\t}\n\n\t\t\tthis.quaternion.setFromRotationMatrix(_m1$1);\n\n\t\t\tif (parent) {\n\t\t\t\t_m1$1.extractRotation(parent.matrixWorld);\n\n\t\t\t\t_q1.setFromRotationMatrix(_m1$1);\n\n\t\t\t\tthis.quaternion.premultiply(_q1.invert());\n\t\t\t}\n\t\t}\n\n\t\tadd(object) {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfor (let i = 0; i < arguments.length; i++) {\n\t\t\t\t\tthis.add(arguments[i]);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (object === this) {\n\t\t\t\tconsole.error('THREE.Object3D.add: object can\\'t be added as a child of itself.', object);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tif (object && object.isObject3D) {\n\t\t\t\tif (object.parent !== null) {\n\t\t\t\t\tobject.parent.remove(object);\n\t\t\t\t}\n\n\t\t\t\tobject.parent = this;\n\t\t\t\tthis.children.push(object);\n\t\t\t\tobject.dispatchEvent(_addedEvent);\n\t\t\t} else {\n\t\t\t\tconsole.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', object);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tremove(object) {\n\t\t\tif (arguments.length > 1) {\n\t\t\t\tfor (let i = 0; i < arguments.length; i++) {\n\t\t\t\t\tthis.remove(arguments[i]);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst index = this.children.indexOf(object);\n\n\t\t\tif (index !== -1) {\n\t\t\t\tobject.parent = null;\n\t\t\t\tthis.children.splice(index, 1);\n\t\t\t\tobject.dispatchEvent(_removedEvent);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tremoveFromParent() {\n\t\t\tconst parent = this.parent;\n\n\t\t\tif (parent !== null) {\n\t\t\t\tparent.remove(this);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclear() {\n\t\t\tfor (let i = 0; i < this.children.length; i++) {\n\t\t\t\tconst object = this.children[i];\n\t\t\t\tobject.parent = null;\n\t\t\t\tobject.dispatchEvent(_removedEvent);\n\t\t\t}\n\n\t\t\tthis.children.length = 0;\n\t\t\treturn this;\n\t\t}\n\n\t\tattach(object) {\n\t\t\t// adds object as a child of this, while maintaining the object's world transform\n\t\t\tthis.updateWorldMatrix(true, false);\n\n\t\t\t_m1$1.copy(this.matrixWorld).invert();\n\n\t\t\tif (object.parent !== null) {\n\t\t\t\tobject.parent.updateWorldMatrix(true, false);\n\n\t\t\t\t_m1$1.multiply(object.parent.matrixWorld);\n\t\t\t}\n\n\t\t\tobject.applyMatrix4(_m1$1);\n\t\t\tthis.add(object);\n\t\t\tobject.updateWorldMatrix(false, true);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetObjectById(id) {\n\t\t\treturn this.getObjectByProperty('id', id);\n\t\t}\n\n\t\tgetObjectByName(name) {\n\t\t\treturn this.getObjectByProperty('name', name);\n\t\t}\n\n\t\tgetObjectByProperty(name, value) {\n\t\t\tif (this[name] === value) return this;\n\n\t\t\tfor (let i = 0, l = this.children.length; i < l; i++) {\n\t\t\t\tconst child = this.children[i];\n\t\t\t\tconst object = child.getObjectByProperty(name, value);\n\n\t\t\t\tif (object !== undefined) {\n\t\t\t\t\treturn object;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\tgetWorldPosition(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\treturn target.setFromMatrixPosition(this.matrixWorld);\n\t\t}\n\n\t\tgetWorldQuaternion(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tthis.matrixWorld.decompose(_position$3, target, _scale$2);\n\t\t\treturn target;\n\t\t}\n\n\t\tgetWorldScale(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tthis.matrixWorld.decompose(_position$3, _quaternion$2, target);\n\t\t\treturn target;\n\t\t}\n\n\t\tgetWorldDirection(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tconst e = this.matrixWorld.elements;\n\t\t\treturn target.set(e[8], e[9], e[10]).normalize();\n\t\t}\n\n\t\traycast() {}\n\n\t\ttraverse(callback) {\n\t\t\tcallback(this);\n\t\t\tconst children = this.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].traverse(callback);\n\t\t\t}\n\t\t}\n\n\t\ttraverseVisible(callback) {\n\t\t\tif (this.visible === false) return;\n\t\t\tcallback(this);\n\t\t\tconst children = this.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].traverseVisible(callback);\n\t\t\t}\n\t\t}\n\n\t\ttraverseAncestors(callback) {\n\t\t\tconst parent = this.parent;\n\n\t\t\tif (parent !== null) {\n\t\t\t\tcallback(parent);\n\t\t\t\tparent.traverseAncestors(callback);\n\t\t\t}\n\t\t}\n\n\t\tupdateMatrix() {\n\t\t\tthis.matrix.compose(this.position, this.quaternion, this.scale);\n\t\t\tthis.matrixWorldNeedsUpdate = true;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tif (this.matrixAutoUpdate) this.updateMatrix();\n\n\t\t\tif (this.matrixWorldNeedsUpdate || force) {\n\t\t\t\tif (this.parent === null) {\n\t\t\t\t\tthis.matrixWorld.copy(this.matrix);\n\t\t\t\t} else {\n\t\t\t\t\tthis.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);\n\t\t\t\t}\n\n\t\t\t\tthis.matrixWorldNeedsUpdate = false;\n\t\t\t\tforce = true;\n\t\t\t} // update children\n\n\n\t\t\tconst children = this.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].updateMatrixWorld(force);\n\t\t\t}\n\t\t}\n\n\t\tupdateWorldMatrix(updateParents, updateChildren) {\n\t\t\tconst parent = this.parent;\n\n\t\t\tif (updateParents === true && parent !== null) {\n\t\t\t\tparent.updateWorldMatrix(true, false);\n\t\t\t}\n\n\t\t\tif (this.matrixAutoUpdate) this.updateMatrix();\n\n\t\t\tif (this.parent === null) {\n\t\t\t\tthis.matrixWorld.copy(this.matrix);\n\t\t\t} else {\n\t\t\t\tthis.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix);\n\t\t\t} // update children\n\n\n\t\t\tif (updateChildren === true) {\n\t\t\t\tconst children = this.children;\n\n\t\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchildren[i].updateWorldMatrix(false, true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\t// meta is a string when called from JSON.stringify\n\t\t\tconst isRootObject = meta === undefined || typeof meta === 'string';\n\t\t\tconst output = {}; // meta is a hash used to collect geometries, materials.\n\t\t\t// not providing it implies that this is the root object\n\t\t\t// being serialized.\n\n\t\t\tif (isRootObject) {\n\t\t\t\t// initialize meta obj\n\t\t\t\tmeta = {\n\t\t\t\t\tgeometries: {},\n\t\t\t\t\tmaterials: {},\n\t\t\t\t\ttextures: {},\n\t\t\t\t\timages: {},\n\t\t\t\t\tshapes: {},\n\t\t\t\t\tskeletons: {},\n\t\t\t\t\tanimations: {}\n\t\t\t\t};\n\t\t\t\toutput.metadata = {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Object',\n\t\t\t\t\tgenerator: 'Object3D.toJSON'\n\t\t\t\t};\n\t\t\t} // standard Object3D serialization\n\n\n\t\t\tconst object = {};\n\t\t\tobject.uuid = this.uuid;\n\t\t\tobject.type = this.type;\n\t\t\tif (this.name !== '') object.name = this.name;\n\t\t\tif (this.castShadow === true) object.castShadow = true;\n\t\t\tif (this.receiveShadow === true) object.receiveShadow = true;\n\t\t\tif (this.visible === false) object.visible = false;\n\t\t\tif (this.frustumCulled === false) object.frustumCulled = false;\n\t\t\tif (this.renderOrder !== 0) object.renderOrder = this.renderOrder;\n\t\t\tif (JSON.stringify(this.userData) !== '{}') object.userData = this.userData;\n\t\t\tobject.layers = this.layers.mask;\n\t\t\tobject.matrix = this.matrix.toArray();\n\t\t\tif (this.matrixAutoUpdate === false) object.matrixAutoUpdate = false; // object specific properties\n\n\t\t\tif (this.isInstancedMesh) {\n\t\t\t\tobject.type = 'InstancedMesh';\n\t\t\t\tobject.count = this.count;\n\t\t\t\tobject.instanceMatrix = this.instanceMatrix.toJSON();\n\t\t\t\tif (this.instanceColor !== null) object.instanceColor = this.instanceColor.toJSON();\n\t\t\t} //\n\n\n\t\t\tfunction serialize(library, element) {\n\t\t\t\tif (library[element.uuid] === undefined) {\n\t\t\t\t\tlibrary[element.uuid] = element.toJSON(meta);\n\t\t\t\t}\n\n\t\t\t\treturn element.uuid;\n\t\t\t}\n\n\t\t\tif (this.isScene) {\n\t\t\t\tif (this.background) {\n\t\t\t\t\tif (this.background.isColor) {\n\t\t\t\t\t\tobject.background = this.background.toJSON();\n\t\t\t\t\t} else if (this.background.isTexture) {\n\t\t\t\t\t\tobject.background = this.background.toJSON(meta).uuid;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (this.environment && this.environment.isTexture) {\n\t\t\t\t\tobject.environment = this.environment.toJSON(meta).uuid;\n\t\t\t\t}\n\t\t\t} else if (this.isMesh || this.isLine || this.isPoints) {\n\t\t\t\tobject.geometry = serialize(meta.geometries, this.geometry);\n\t\t\t\tconst parameters = this.geometry.parameters;\n\n\t\t\t\tif (parameters !== undefined && parameters.shapes !== undefined) {\n\t\t\t\t\tconst shapes = parameters.shapes;\n\n\t\t\t\t\tif (Array.isArray(shapes)) {\n\t\t\t\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\t\t\t\tconst shape = shapes[i];\n\t\t\t\t\t\t\tserialize(meta.shapes, shape);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tserialize(meta.shapes, shapes);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.isSkinnedMesh) {\n\t\t\t\tobject.bindMode = this.bindMode;\n\t\t\t\tobject.bindMatrix = this.bindMatrix.toArray();\n\n\t\t\t\tif (this.skeleton !== undefined) {\n\t\t\t\t\tserialize(meta.skeletons, this.skeleton);\n\t\t\t\t\tobject.skeleton = this.skeleton.uuid;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.material !== undefined) {\n\t\t\t\tif (Array.isArray(this.material)) {\n\t\t\t\t\tconst uuids = [];\n\n\t\t\t\t\tfor (let i = 0, l = this.material.length; i < l; i++) {\n\t\t\t\t\t\tuuids.push(serialize(meta.materials, this.material[i]));\n\t\t\t\t\t}\n\n\t\t\t\t\tobject.material = uuids;\n\t\t\t\t} else {\n\t\t\t\t\tobject.material = serialize(meta.materials, this.material);\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tif (this.children.length > 0) {\n\t\t\t\tobject.children = [];\n\n\t\t\t\tfor (let i = 0; i < this.children.length; i++) {\n\t\t\t\t\tobject.children.push(this.children[i].toJSON(meta).object);\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tif (this.animations.length > 0) {\n\t\t\t\tobject.animations = [];\n\n\t\t\t\tfor (let i = 0; i < this.animations.length; i++) {\n\t\t\t\t\tconst animation = this.animations[i];\n\t\t\t\t\tobject.animations.push(serialize(meta.animations, animation));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isRootObject) {\n\t\t\t\tconst geometries = extractFromCache(meta.geometries);\n\t\t\t\tconst materials = extractFromCache(meta.materials);\n\t\t\t\tconst textures = extractFromCache(meta.textures);\n\t\t\t\tconst images = extractFromCache(meta.images);\n\t\t\t\tconst shapes = extractFromCache(meta.shapes);\n\t\t\t\tconst skeletons = extractFromCache(meta.skeletons);\n\t\t\t\tconst animations = extractFromCache(meta.animations);\n\t\t\t\tif (geometries.length > 0) output.geometries = geometries;\n\t\t\t\tif (materials.length > 0) output.materials = materials;\n\t\t\t\tif (textures.length > 0) output.textures = textures;\n\t\t\t\tif (images.length > 0) output.images = images;\n\t\t\t\tif (shapes.length > 0) output.shapes = shapes;\n\t\t\t\tif (skeletons.length > 0) output.skeletons = skeletons;\n\t\t\t\tif (animations.length > 0) output.animations = animations;\n\t\t\t}\n\n\t\t\toutput.object = object;\n\t\t\treturn output; // extract data from the cache hash\n\t\t\t// remove metadata on each item\n\t\t\t// and return as array\n\n\t\t\tfunction extractFromCache(cache) {\n\t\t\t\tconst values = [];\n\n\t\t\t\tfor (const key in cache) {\n\t\t\t\t\tconst data = cache[key];\n\t\t\t\t\tdelete data.metadata;\n\t\t\t\t\tvalues.push(data);\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t}\n\t\t}\n\n\t\tclone(recursive) {\n\t\t\treturn new this.constructor().copy(this, recursive);\n\t\t}\n\n\t\tcopy(source, recursive = true) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.up.copy(source.up);\n\t\t\tthis.position.copy(source.position);\n\t\t\tthis.rotation.order = source.rotation.order;\n\t\t\tthis.quaternion.copy(source.quaternion);\n\t\t\tthis.scale.copy(source.scale);\n\t\t\tthis.matrix.copy(source.matrix);\n\t\t\tthis.matrixWorld.copy(source.matrixWorld);\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\tthis.matrixWorldNeedsUpdate = source.matrixWorldNeedsUpdate;\n\t\t\tthis.layers.mask = source.layers.mask;\n\t\t\tthis.visible = source.visible;\n\t\t\tthis.castShadow = source.castShadow;\n\t\t\tthis.receiveShadow = source.receiveShadow;\n\t\t\tthis.frustumCulled = source.frustumCulled;\n\t\t\tthis.renderOrder = source.renderOrder;\n\t\t\tthis.userData = JSON.parse(JSON.stringify(source.userData));\n\n\t\t\tif (recursive === true) {\n\t\t\t\tfor (let i = 0; i < source.children.length; i++) {\n\t\t\t\t\tconst child = source.children[i];\n\t\t\t\t\tthis.add(child.clone());\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tObject3D.DefaultUp = new Vector3(0, 1, 0);\n\tObject3D.DefaultMatrixAutoUpdate = true;\n\tObject3D.prototype.isObject3D = true;\n\n\tconst _v0$1 = /*@__PURE__*/new Vector3();\n\n\tconst _v1$3 = /*@__PURE__*/new Vector3();\n\n\tconst _v2$2 = /*@__PURE__*/new Vector3();\n\n\tconst _v3$1 = /*@__PURE__*/new Vector3();\n\n\tconst _vab = /*@__PURE__*/new Vector3();\n\n\tconst _vac = /*@__PURE__*/new Vector3();\n\n\tconst _vbc = /*@__PURE__*/new Vector3();\n\n\tconst _vap = /*@__PURE__*/new Vector3();\n\n\tconst _vbp = /*@__PURE__*/new Vector3();\n\n\tconst _vcp = /*@__PURE__*/new Vector3();\n\n\tclass Triangle {\n\t\tconstructor(a = new Vector3(), b = new Vector3(), c = new Vector3()) {\n\t\t\tthis.a = a;\n\t\t\tthis.b = b;\n\t\t\tthis.c = c;\n\t\t}\n\n\t\tstatic getNormal(a, b, c, target) {\n\t\t\ttarget.subVectors(c, b);\n\n\t\t\t_v0$1.subVectors(a, b);\n\n\t\t\ttarget.cross(_v0$1);\n\t\t\tconst targetLengthSq = target.lengthSq();\n\n\t\t\tif (targetLengthSq > 0) {\n\t\t\t\treturn target.multiplyScalar(1 / Math.sqrt(targetLengthSq));\n\t\t\t}\n\n\t\t\treturn target.set(0, 0, 0);\n\t\t} // static/instance method to calculate barycentric coordinates\n\t\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\n\t\tstatic getBarycoord(point, a, b, c, target) {\n\t\t\t_v0$1.subVectors(c, a);\n\n\t\t\t_v1$3.subVectors(b, a);\n\n\t\t\t_v2$2.subVectors(point, a);\n\n\t\t\tconst dot00 = _v0$1.dot(_v0$1);\n\n\t\t\tconst dot01 = _v0$1.dot(_v1$3);\n\n\t\t\tconst dot02 = _v0$1.dot(_v2$2);\n\n\t\t\tconst dot11 = _v1$3.dot(_v1$3);\n\n\t\t\tconst dot12 = _v1$3.dot(_v2$2);\n\n\t\t\tconst denom = dot00 * dot11 - dot01 * dot01; // collinear or singular triangle\n\n\t\t\tif (denom === 0) {\n\t\t\t\t// arbitrary location outside of triangle?\n\t\t\t\t// not sure if this is the best idea, maybe should be returning undefined\n\t\t\t\treturn target.set(-2, -1, -1);\n\t\t\t}\n\n\t\t\tconst invDenom = 1 / denom;\n\t\t\tconst u = (dot11 * dot02 - dot01 * dot12) * invDenom;\n\t\t\tconst v = (dot00 * dot12 - dot01 * dot02) * invDenom; // barycentric coordinates must always sum to 1\n\n\t\t\treturn target.set(1 - u - v, v, u);\n\t\t}\n\n\t\tstatic containsPoint(point, a, b, c) {\n\t\t\tthis.getBarycoord(point, a, b, c, _v3$1);\n\t\t\treturn _v3$1.x >= 0 && _v3$1.y >= 0 && _v3$1.x + _v3$1.y <= 1;\n\t\t}\n\n\t\tstatic getUV(point, p1, p2, p3, uv1, uv2, uv3, target) {\n\t\t\tthis.getBarycoord(point, p1, p2, p3, _v3$1);\n\t\t\ttarget.set(0, 0);\n\t\t\ttarget.addScaledVector(uv1, _v3$1.x);\n\t\t\ttarget.addScaledVector(uv2, _v3$1.y);\n\t\t\ttarget.addScaledVector(uv3, _v3$1.z);\n\t\t\treturn target;\n\t\t}\n\n\t\tstatic isFrontFacing(a, b, c, direction) {\n\t\t\t_v0$1.subVectors(c, b);\n\n\t\t\t_v1$3.subVectors(a, b); // strictly front facing\n\n\n\t\t\treturn _v0$1.cross(_v1$3).dot(direction) < 0 ? true : false;\n\t\t}\n\n\t\tset(a, b, c) {\n\t\t\tthis.a.copy(a);\n\t\t\tthis.b.copy(b);\n\t\t\tthis.c.copy(c);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPointsAndIndices(points, i0, i1, i2) {\n\t\t\tthis.a.copy(points[i0]);\n\t\t\tthis.b.copy(points[i1]);\n\t\t\tthis.c.copy(points[i2]);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromAttributeAndIndices(attribute, i0, i1, i2) {\n\t\t\tthis.a.fromBufferAttribute(attribute, i0);\n\t\t\tthis.b.fromBufferAttribute(attribute, i1);\n\t\t\tthis.c.fromBufferAttribute(attribute, i2);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(triangle) {\n\t\t\tthis.a.copy(triangle.a);\n\t\t\tthis.b.copy(triangle.b);\n\t\t\tthis.c.copy(triangle.c);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetArea() {\n\t\t\t_v0$1.subVectors(this.c, this.b);\n\n\t\t\t_v1$3.subVectors(this.a, this.b);\n\n\t\t\treturn _v0$1.cross(_v1$3).length() * 0.5;\n\t\t}\n\n\t\tgetMidpoint(target) {\n\t\t\treturn target.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);\n\t\t}\n\n\t\tgetNormal(target) {\n\t\t\treturn Triangle.getNormal(this.a, this.b, this.c, target);\n\t\t}\n\n\t\tgetPlane(target) {\n\t\t\treturn target.setFromCoplanarPoints(this.a, this.b, this.c);\n\t\t}\n\n\t\tgetBarycoord(point, target) {\n\t\t\treturn Triangle.getBarycoord(point, this.a, this.b, this.c, target);\n\t\t}\n\n\t\tgetUV(point, uv1, uv2, uv3, target) {\n\t\t\treturn Triangle.getUV(point, this.a, this.b, this.c, uv1, uv2, uv3, target);\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn Triangle.containsPoint(point, this.a, this.b, this.c);\n\t\t}\n\n\t\tisFrontFacing(direction) {\n\t\t\treturn Triangle.isFrontFacing(this.a, this.b, this.c, direction);\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn box.intersectsTriangle(this);\n\t\t}\n\n\t\tclosestPointToPoint(p, target) {\n\t\t\tconst a = this.a,\n\t\t\t\t\t\tb = this.b,\n\t\t\t\t\t\tc = this.c;\n\t\t\tlet v, w; // algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t\t_vab.subVectors(b, a);\n\n\t\t\t_vac.subVectors(c, a);\n\n\t\t\t_vap.subVectors(p, a);\n\n\t\t\tconst d1 = _vab.dot(_vap);\n\n\t\t\tconst d2 = _vac.dot(_vap);\n\n\t\t\tif (d1 <= 0 && d2 <= 0) {\n\t\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\t\treturn target.copy(a);\n\t\t\t}\n\n\t\t\t_vbp.subVectors(p, b);\n\n\t\t\tconst d3 = _vab.dot(_vbp);\n\n\t\t\tconst d4 = _vac.dot(_vbp);\n\n\t\t\tif (d3 >= 0 && d4 <= d3) {\n\t\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\t\treturn target.copy(b);\n\t\t\t}\n\n\t\t\tconst vc = d1 * d4 - d3 * d2;\n\n\t\t\tif (vc <= 0 && d1 >= 0 && d3 <= 0) {\n\t\t\t\tv = d1 / (d1 - d3); // edge region of AB; barycentric coords (1-v, v, 0)\n\n\t\t\t\treturn target.copy(a).addScaledVector(_vab, v);\n\t\t\t}\n\n\t\t\t_vcp.subVectors(p, c);\n\n\t\t\tconst d5 = _vab.dot(_vcp);\n\n\t\t\tconst d6 = _vac.dot(_vcp);\n\n\t\t\tif (d6 >= 0 && d5 <= d6) {\n\t\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\t\treturn target.copy(c);\n\t\t\t}\n\n\t\t\tconst vb = d5 * d2 - d1 * d6;\n\n\t\t\tif (vb <= 0 && d2 >= 0 && d6 <= 0) {\n\t\t\t\tw = d2 / (d2 - d6); // edge region of AC; barycentric coords (1-w, 0, w)\n\n\t\t\t\treturn target.copy(a).addScaledVector(_vac, w);\n\t\t\t}\n\n\t\t\tconst va = d3 * d6 - d5 * d4;\n\n\t\t\tif (va <= 0 && d4 - d3 >= 0 && d5 - d6 >= 0) {\n\t\t\t\t_vbc.subVectors(c, b);\n\n\t\t\t\tw = (d4 - d3) / (d4 - d3 + (d5 - d6)); // edge region of BC; barycentric coords (0, 1-w, w)\n\n\t\t\t\treturn target.copy(b).addScaledVector(_vbc, w); // edge region of BC\n\t\t\t} // face region\n\n\n\t\t\tconst denom = 1 / (va + vb + vc); // u = va * denom\n\n\t\t\tv = vb * denom;\n\t\t\tw = vc * denom;\n\t\t\treturn target.copy(a).addScaledVector(_vab, v).addScaledVector(_vac, w);\n\t\t}\n\n\t\tequals(triangle) {\n\t\t\treturn triangle.a.equals(this.a) && triangle.b.equals(this.b) && triangle.c.equals(this.c);\n\t\t}\n\n\t}\n\n\tlet materialId = 0;\n\n\tclass Material extends EventDispatcher {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: materialId++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.type = 'Material';\n\t\t\tthis.fog = true;\n\t\t\tthis.blending = NormalBlending;\n\t\t\tthis.side = FrontSide;\n\t\t\tthis.vertexColors = false;\n\t\t\tthis.opacity = 1;\n\t\t\tthis.format = RGBAFormat;\n\t\t\tthis.transparent = false;\n\t\t\tthis.blendSrc = SrcAlphaFactor;\n\t\t\tthis.blendDst = OneMinusSrcAlphaFactor;\n\t\t\tthis.blendEquation = AddEquation;\n\t\t\tthis.blendSrcAlpha = null;\n\t\t\tthis.blendDstAlpha = null;\n\t\t\tthis.blendEquationAlpha = null;\n\t\t\tthis.depthFunc = LessEqualDepth;\n\t\t\tthis.depthTest = true;\n\t\t\tthis.depthWrite = true;\n\t\t\tthis.stencilWriteMask = 0xff;\n\t\t\tthis.stencilFunc = AlwaysStencilFunc;\n\t\t\tthis.stencilRef = 0;\n\t\t\tthis.stencilFuncMask = 0xff;\n\t\t\tthis.stencilFail = KeepStencilOp;\n\t\t\tthis.stencilZFail = KeepStencilOp;\n\t\t\tthis.stencilZPass = KeepStencilOp;\n\t\t\tthis.stencilWrite = false;\n\t\t\tthis.clippingPlanes = null;\n\t\t\tthis.clipIntersection = false;\n\t\t\tthis.clipShadows = false;\n\t\t\tthis.shadowSide = null;\n\t\t\tthis.colorWrite = true;\n\t\t\tthis.precision = null; // override the renderer's default precision for this material\n\n\t\t\tthis.polygonOffset = false;\n\t\t\tthis.polygonOffsetFactor = 0;\n\t\t\tthis.polygonOffsetUnits = 0;\n\t\t\tthis.dithering = false;\n\t\t\tthis.alphaToCoverage = false;\n\t\t\tthis.premultipliedAlpha = false;\n\t\t\tthis.visible = true;\n\t\t\tthis.toneMapped = true;\n\t\t\tthis.userData = {};\n\t\t\tthis.version = 0;\n\t\t\tthis._alphaTest = 0;\n\t\t}\n\n\t\tget alphaTest() {\n\t\t\treturn this._alphaTest;\n\t\t}\n\n\t\tset alphaTest(value) {\n\t\t\tif (this._alphaTest > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._alphaTest = value;\n\t\t}\n\n\t\tonBuild() {}\n\n\t\tonBeforeRender() {}\n\n\t\tonBeforeCompile() {}\n\n\t\tcustomProgramCacheKey() {\n\t\t\treturn this.onBeforeCompile.toString();\n\t\t}\n\n\t\tsetValues(values) {\n\t\t\tif (values === undefined) return;\n\n\t\t\tfor (const key in values) {\n\t\t\t\tconst newValue = values[key];\n\n\t\t\t\tif (newValue === undefined) {\n\t\t\t\t\tconsole.warn('THREE.Material: \\'' + key + '\\' parameter is undefined.');\n\t\t\t\t\tcontinue;\n\t\t\t\t} // for backward compatability if shading is set in the constructor\n\n\n\t\t\t\tif (key === 'shading') {\n\t\t\t\t\tconsole.warn('THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.');\n\t\t\t\t\tthis.flatShading = newValue === FlatShading ? true : false;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tconst currentValue = this[key];\n\n\t\t\t\tif (currentValue === undefined) {\n\t\t\t\t\tconsole.warn('THREE.' + this.type + ': \\'' + key + '\\' is not a property of this material.');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (currentValue && currentValue.isColor) {\n\t\t\t\t\tcurrentValue.set(newValue);\n\t\t\t\t} else if (currentValue && currentValue.isVector3 && newValue && newValue.isVector3) {\n\t\t\t\t\tcurrentValue.copy(newValue);\n\t\t\t\t} else {\n\t\t\t\t\tthis[key] = newValue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst isRoot = meta === undefined || typeof meta === 'string';\n\n\t\t\tif (isRoot) {\n\t\t\t\tmeta = {\n\t\t\t\t\ttextures: {},\n\t\t\t\t\timages: {}\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Material',\n\t\t\t\t\tgenerator: 'Material.toJSON'\n\t\t\t\t}\n\t\t\t}; // standard Material serialization\n\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\t\t\tif (this.name !== '') data.name = this.name;\n\t\t\tif (this.color && this.color.isColor) data.color = this.color.getHex();\n\t\t\tif (this.roughness !== undefined) data.roughness = this.roughness;\n\t\t\tif (this.metalness !== undefined) data.metalness = this.metalness;\n\t\t\tif (this.sheen !== undefined) data.sheen = this.sheen;\n\t\t\tif (this.sheenTint && this.sheenTint.isColor) data.sheenTint = this.sheenTint.getHex();\n\t\t\tif (this.sheenRoughness !== undefined) data.sheenRoughness = this.sheenRoughness;\n\t\t\tif (this.emissive && this.emissive.isColor) data.emissive = this.emissive.getHex();\n\t\t\tif (this.emissiveIntensity && this.emissiveIntensity !== 1) data.emissiveIntensity = this.emissiveIntensity;\n\t\t\tif (this.specular && this.specular.isColor) data.specular = this.specular.getHex();\n\t\t\tif (this.specularIntensity !== undefined) data.specularIntensity = this.specularIntensity;\n\t\t\tif (this.specularTint && this.specularTint.isColor) data.specularTint = this.specularTint.getHex();\n\t\t\tif (this.shininess !== undefined) data.shininess = this.shininess;\n\t\t\tif (this.clearcoat !== undefined) data.clearcoat = this.clearcoat;\n\t\t\tif (this.clearcoatRoughness !== undefined) data.clearcoatRoughness = this.clearcoatRoughness;\n\n\t\t\tif (this.clearcoatMap && this.clearcoatMap.isTexture) {\n\t\t\t\tdata.clearcoatMap = this.clearcoatMap.toJSON(meta).uuid;\n\t\t\t}\n\n\t\t\tif (this.clearcoatRoughnessMap && this.clearcoatRoughnessMap.isTexture) {\n\t\t\t\tdata.clearcoatRoughnessMap = this.clearcoatRoughnessMap.toJSON(meta).uuid;\n\t\t\t}\n\n\t\t\tif (this.clearcoatNormalMap && this.clearcoatNormalMap.isTexture) {\n\t\t\t\tdata.clearcoatNormalMap = this.clearcoatNormalMap.toJSON(meta).uuid;\n\t\t\t\tdata.clearcoatNormalScale = this.clearcoatNormalScale.toArray();\n\t\t\t}\n\n\t\t\tif (this.map && this.map.isTexture) data.map = this.map.toJSON(meta).uuid;\n\t\t\tif (this.matcap && this.matcap.isTexture) data.matcap = this.matcap.toJSON(meta).uuid;\n\t\t\tif (this.alphaMap && this.alphaMap.isTexture) data.alphaMap = this.alphaMap.toJSON(meta).uuid;\n\n\t\t\tif (this.lightMap && this.lightMap.isTexture) {\n\t\t\t\tdata.lightMap = this.lightMap.toJSON(meta).uuid;\n\t\t\t\tdata.lightMapIntensity = this.lightMapIntensity;\n\t\t\t}\n\n\t\t\tif (this.aoMap && this.aoMap.isTexture) {\n\t\t\t\tdata.aoMap = this.aoMap.toJSON(meta).uuid;\n\t\t\t\tdata.aoMapIntensity = this.aoMapIntensity;\n\t\t\t}\n\n\t\t\tif (this.bumpMap && this.bumpMap.isTexture) {\n\t\t\t\tdata.bumpMap = this.bumpMap.toJSON(meta).uuid;\n\t\t\t\tdata.bumpScale = this.bumpScale;\n\t\t\t}\n\n\t\t\tif (this.normalMap && this.normalMap.isTexture) {\n\t\t\t\tdata.normalMap = this.normalMap.toJSON(meta).uuid;\n\t\t\t\tdata.normalMapType = this.normalMapType;\n\t\t\t\tdata.normalScale = this.normalScale.toArray();\n\t\t\t}\n\n\t\t\tif (this.displacementMap && this.displacementMap.isTexture) {\n\t\t\t\tdata.displacementMap = this.displacementMap.toJSON(meta).uuid;\n\t\t\t\tdata.displacementScale = this.displacementScale;\n\t\t\t\tdata.displacementBias = this.displacementBias;\n\t\t\t}\n\n\t\t\tif (this.roughnessMap && this.roughnessMap.isTexture) data.roughnessMap = this.roughnessMap.toJSON(meta).uuid;\n\t\t\tif (this.metalnessMap && this.metalnessMap.isTexture) data.metalnessMap = this.metalnessMap.toJSON(meta).uuid;\n\t\t\tif (this.emissiveMap && this.emissiveMap.isTexture) data.emissiveMap = this.emissiveMap.toJSON(meta).uuid;\n\t\t\tif (this.specularMap && this.specularMap.isTexture) data.specularMap = this.specularMap.toJSON(meta).uuid;\n\t\t\tif (this.specularIntensityMap && this.specularIntensityMap.isTexture) data.specularIntensityMap = this.specularIntensityMap.toJSON(meta).uuid;\n\t\t\tif (this.specularTintMap && this.specularTintMap.isTexture) data.specularTintMap = this.specularTintMap.toJSON(meta).uuid;\n\n\t\t\tif (this.envMap && this.envMap.isTexture) {\n\t\t\t\tdata.envMap = this.envMap.toJSON(meta).uuid;\n\t\t\t\tif (this.combine !== undefined) data.combine = this.combine;\n\t\t\t}\n\n\t\t\tif (this.envMapIntensity !== undefined) data.envMapIntensity = this.envMapIntensity;\n\t\t\tif (this.reflectivity !== undefined) data.reflectivity = this.reflectivity;\n\t\t\tif (this.refractionRatio !== undefined) data.refractionRatio = this.refractionRatio;\n\n\t\t\tif (this.gradientMap && this.gradientMap.isTexture) {\n\t\t\t\tdata.gradientMap = this.gradientMap.toJSON(meta).uuid;\n\t\t\t}\n\n\t\t\tif (this.transmission !== undefined) data.transmission = this.transmission;\n\t\t\tif (this.transmissionMap && this.transmissionMap.isTexture) data.transmissionMap = this.transmissionMap.toJSON(meta).uuid;\n\t\t\tif (this.thickness !== undefined) data.thickness = this.thickness;\n\t\t\tif (this.thicknessMap && this.thicknessMap.isTexture) data.thicknessMap = this.thicknessMap.toJSON(meta).uuid;\n\t\t\tif (this.attenuationDistance !== undefined) data.attenuationDistance = this.attenuationDistance;\n\t\t\tif (this.attenuationTint !== undefined) data.attenuationTint = this.attenuationTint.getHex();\n\t\t\tif (this.size !== undefined) data.size = this.size;\n\t\t\tif (this.shadowSide !== null) data.shadowSide = this.shadowSide;\n\t\t\tif (this.sizeAttenuation !== undefined) data.sizeAttenuation = this.sizeAttenuation;\n\t\t\tif (this.blending !== NormalBlending) data.blending = this.blending;\n\t\t\tif (this.side !== FrontSide) data.side = this.side;\n\t\t\tif (this.vertexColors) data.vertexColors = true;\n\t\t\tif (this.opacity < 1) data.opacity = this.opacity;\n\t\t\tif (this.format !== RGBAFormat) data.format = this.format;\n\t\t\tif (this.transparent === true) data.transparent = this.transparent;\n\t\t\tdata.depthFunc = this.depthFunc;\n\t\t\tdata.depthTest = this.depthTest;\n\t\t\tdata.depthWrite = this.depthWrite;\n\t\t\tdata.colorWrite = this.colorWrite;\n\t\t\tdata.stencilWrite = this.stencilWrite;\n\t\t\tdata.stencilWriteMask = this.stencilWriteMask;\n\t\t\tdata.stencilFunc = this.stencilFunc;\n\t\t\tdata.stencilRef = this.stencilRef;\n\t\t\tdata.stencilFuncMask = this.stencilFuncMask;\n\t\t\tdata.stencilFail = this.stencilFail;\n\t\t\tdata.stencilZFail = this.stencilZFail;\n\t\t\tdata.stencilZPass = this.stencilZPass; // rotation (SpriteMaterial)\n\n\t\t\tif (this.rotation && this.rotation !== 0) data.rotation = this.rotation;\n\t\t\tif (this.polygonOffset === true) data.polygonOffset = true;\n\t\t\tif (this.polygonOffsetFactor !== 0) data.polygonOffsetFactor = this.polygonOffsetFactor;\n\t\t\tif (this.polygonOffsetUnits !== 0) data.polygonOffsetUnits = this.polygonOffsetUnits;\n\t\t\tif (this.linewidth && this.linewidth !== 1) data.linewidth = this.linewidth;\n\t\t\tif (this.dashSize !== undefined) data.dashSize = this.dashSize;\n\t\t\tif (this.gapSize !== undefined) data.gapSize = this.gapSize;\n\t\t\tif (this.scale !== undefined) data.scale = this.scale;\n\t\t\tif (this.dithering === true) data.dithering = true;\n\t\t\tif (this.alphaTest > 0) data.alphaTest = this.alphaTest;\n\t\t\tif (this.alphaToCoverage === true) data.alphaToCoverage = this.alphaToCoverage;\n\t\t\tif (this.premultipliedAlpha === true) data.premultipliedAlpha = this.premultipliedAlpha;\n\t\t\tif (this.wireframe === true) data.wireframe = this.wireframe;\n\t\t\tif (this.wireframeLinewidth > 1) data.wireframeLinewidth = this.wireframeLinewidth;\n\t\t\tif (this.wireframeLinecap !== 'round') data.wireframeLinecap = this.wireframeLinecap;\n\t\t\tif (this.wireframeLinejoin !== 'round') data.wireframeLinejoin = this.wireframeLinejoin;\n\t\t\tif (this.flatShading === true) data.flatShading = this.flatShading;\n\t\t\tif (this.visible === false) data.visible = false;\n\t\t\tif (this.toneMapped === false) data.toneMapped = false;\n\t\t\tif (JSON.stringify(this.userData) !== '{}') data.userData = this.userData; // TODO: Copied from Object3D.toJSON\n\n\t\t\tfunction extractFromCache(cache) {\n\t\t\t\tconst values = [];\n\n\t\t\t\tfor (const key in cache) {\n\t\t\t\t\tconst data = cache[key];\n\t\t\t\t\tdelete data.metadata;\n\t\t\t\t\tvalues.push(data);\n\t\t\t\t}\n\n\t\t\t\treturn values;\n\t\t\t}\n\n\t\t\tif (isRoot) {\n\t\t\t\tconst textures = extractFromCache(meta.textures);\n\t\t\t\tconst images = extractFromCache(meta.images);\n\t\t\t\tif (textures.length > 0) data.textures = textures;\n\t\t\t\tif (images.length > 0) data.images = images;\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.fog = source.fog;\n\t\t\tthis.blending = source.blending;\n\t\t\tthis.side = source.side;\n\t\t\tthis.vertexColors = source.vertexColors;\n\t\t\tthis.opacity = source.opacity;\n\t\t\tthis.format = source.format;\n\t\t\tthis.transparent = source.transparent;\n\t\t\tthis.blendSrc = source.blendSrc;\n\t\t\tthis.blendDst = source.blendDst;\n\t\t\tthis.blendEquation = source.blendEquation;\n\t\t\tthis.blendSrcAlpha = source.blendSrcAlpha;\n\t\t\tthis.blendDstAlpha = source.blendDstAlpha;\n\t\t\tthis.blendEquationAlpha = source.blendEquationAlpha;\n\t\t\tthis.depthFunc = source.depthFunc;\n\t\t\tthis.depthTest = source.depthTest;\n\t\t\tthis.depthWrite = source.depthWrite;\n\t\t\tthis.stencilWriteMask = source.stencilWriteMask;\n\t\t\tthis.stencilFunc = source.stencilFunc;\n\t\t\tthis.stencilRef = source.stencilRef;\n\t\t\tthis.stencilFuncMask = source.stencilFuncMask;\n\t\t\tthis.stencilFail = source.stencilFail;\n\t\t\tthis.stencilZFail = source.stencilZFail;\n\t\t\tthis.stencilZPass = source.stencilZPass;\n\t\t\tthis.stencilWrite = source.stencilWrite;\n\t\t\tconst srcPlanes = source.clippingPlanes;\n\t\t\tlet dstPlanes = null;\n\n\t\t\tif (srcPlanes !== null) {\n\t\t\t\tconst n = srcPlanes.length;\n\t\t\t\tdstPlanes = new Array(n);\n\n\t\t\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\t\t\tdstPlanes[i] = srcPlanes[i].clone();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.clippingPlanes = dstPlanes;\n\t\t\tthis.clipIntersection = source.clipIntersection;\n\t\t\tthis.clipShadows = source.clipShadows;\n\t\t\tthis.shadowSide = source.shadowSide;\n\t\t\tthis.colorWrite = source.colorWrite;\n\t\t\tthis.precision = source.precision;\n\t\t\tthis.polygonOffset = source.polygonOffset;\n\t\t\tthis.polygonOffsetFactor = source.polygonOffsetFactor;\n\t\t\tthis.polygonOffsetUnits = source.polygonOffsetUnits;\n\t\t\tthis.dithering = source.dithering;\n\t\t\tthis.alphaTest = source.alphaTest;\n\t\t\tthis.alphaToCoverage = source.alphaToCoverage;\n\t\t\tthis.premultipliedAlpha = source.premultipliedAlpha;\n\t\t\tthis.visible = source.visible;\n\t\t\tthis.toneMapped = source.toneMapped;\n\t\t\tthis.userData = JSON.parse(JSON.stringify(source.userData));\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t}\n\n\tMaterial.prototype.isMaterial = true;\n\n\tconst _colorKeywords = {\n\t\t'aliceblue': 0xF0F8FF,\n\t\t'antiquewhite': 0xFAEBD7,\n\t\t'aqua': 0x00FFFF,\n\t\t'aquamarine': 0x7FFFD4,\n\t\t'azure': 0xF0FFFF,\n\t\t'beige': 0xF5F5DC,\n\t\t'bisque': 0xFFE4C4,\n\t\t'black': 0x000000,\n\t\t'blanchedalmond': 0xFFEBCD,\n\t\t'blue': 0x0000FF,\n\t\t'blueviolet': 0x8A2BE2,\n\t\t'brown': 0xA52A2A,\n\t\t'burlywood': 0xDEB887,\n\t\t'cadetblue': 0x5F9EA0,\n\t\t'chartreuse': 0x7FFF00,\n\t\t'chocolate': 0xD2691E,\n\t\t'coral': 0xFF7F50,\n\t\t'cornflowerblue': 0x6495ED,\n\t\t'cornsilk': 0xFFF8DC,\n\t\t'crimson': 0xDC143C,\n\t\t'cyan': 0x00FFFF,\n\t\t'darkblue': 0x00008B,\n\t\t'darkcyan': 0x008B8B,\n\t\t'darkgoldenrod': 0xB8860B,\n\t\t'darkgray': 0xA9A9A9,\n\t\t'darkgreen': 0x006400,\n\t\t'darkgrey': 0xA9A9A9,\n\t\t'darkkhaki': 0xBDB76B,\n\t\t'darkmagenta': 0x8B008B,\n\t\t'darkolivegreen': 0x556B2F,\n\t\t'darkorange': 0xFF8C00,\n\t\t'darkorchid': 0x9932CC,\n\t\t'darkred': 0x8B0000,\n\t\t'darksalmon': 0xE9967A,\n\t\t'darkseagreen': 0x8FBC8F,\n\t\t'darkslateblue': 0x483D8B,\n\t\t'darkslategray': 0x2F4F4F,\n\t\t'darkslategrey': 0x2F4F4F,\n\t\t'darkturquoise': 0x00CED1,\n\t\t'darkviolet': 0x9400D3,\n\t\t'deeppink': 0xFF1493,\n\t\t'deepskyblue': 0x00BFFF,\n\t\t'dimgray': 0x696969,\n\t\t'dimgrey': 0x696969,\n\t\t'dodgerblue': 0x1E90FF,\n\t\t'firebrick': 0xB22222,\n\t\t'floralwhite': 0xFFFAF0,\n\t\t'forestgreen': 0x228B22,\n\t\t'fuchsia': 0xFF00FF,\n\t\t'gainsboro': 0xDCDCDC,\n\t\t'ghostwhite': 0xF8F8FF,\n\t\t'gold': 0xFFD700,\n\t\t'goldenrod': 0xDAA520,\n\t\t'gray': 0x808080,\n\t\t'green': 0x008000,\n\t\t'greenyellow': 0xADFF2F,\n\t\t'grey': 0x808080,\n\t\t'honeydew': 0xF0FFF0,\n\t\t'hotpink': 0xFF69B4,\n\t\t'indianred': 0xCD5C5C,\n\t\t'indigo': 0x4B0082,\n\t\t'ivory': 0xFFFFF0,\n\t\t'khaki': 0xF0E68C,\n\t\t'lavender': 0xE6E6FA,\n\t\t'lavenderblush': 0xFFF0F5,\n\t\t'lawngreen': 0x7CFC00,\n\t\t'lemonchiffon': 0xFFFACD,\n\t\t'lightblue': 0xADD8E6,\n\t\t'lightcoral': 0xF08080,\n\t\t'lightcyan': 0xE0FFFF,\n\t\t'lightgoldenrodyellow': 0xFAFAD2,\n\t\t'lightgray': 0xD3D3D3,\n\t\t'lightgreen': 0x90EE90,\n\t\t'lightgrey': 0xD3D3D3,\n\t\t'lightpink': 0xFFB6C1,\n\t\t'lightsalmon': 0xFFA07A,\n\t\t'lightseagreen': 0x20B2AA,\n\t\t'lightskyblue': 0x87CEFA,\n\t\t'lightslategray': 0x778899,\n\t\t'lightslategrey': 0x778899,\n\t\t'lightsteelblue': 0xB0C4DE,\n\t\t'lightyellow': 0xFFFFE0,\n\t\t'lime': 0x00FF00,\n\t\t'limegreen': 0x32CD32,\n\t\t'linen': 0xFAF0E6,\n\t\t'magenta': 0xFF00FF,\n\t\t'maroon': 0x800000,\n\t\t'mediumaquamarine': 0x66CDAA,\n\t\t'mediumblue': 0x0000CD,\n\t\t'mediumorchid': 0xBA55D3,\n\t\t'mediumpurple': 0x9370DB,\n\t\t'mediumseagreen': 0x3CB371,\n\t\t'mediumslateblue': 0x7B68EE,\n\t\t'mediumspringgreen': 0x00FA9A,\n\t\t'mediumturquoise': 0x48D1CC,\n\t\t'mediumvioletred': 0xC71585,\n\t\t'midnightblue': 0x191970,\n\t\t'mintcream': 0xF5FFFA,\n\t\t'mistyrose': 0xFFE4E1,\n\t\t'moccasin': 0xFFE4B5,\n\t\t'navajowhite': 0xFFDEAD,\n\t\t'navy': 0x000080,\n\t\t'oldlace': 0xFDF5E6,\n\t\t'olive': 0x808000,\n\t\t'olivedrab': 0x6B8E23,\n\t\t'orange': 0xFFA500,\n\t\t'orangered': 0xFF4500,\n\t\t'orchid': 0xDA70D6,\n\t\t'palegoldenrod': 0xEEE8AA,\n\t\t'palegreen': 0x98FB98,\n\t\t'paleturquoise': 0xAFEEEE,\n\t\t'palevioletred': 0xDB7093,\n\t\t'papayawhip': 0xFFEFD5,\n\t\t'peachpuff': 0xFFDAB9,\n\t\t'peru': 0xCD853F,\n\t\t'pink': 0xFFC0CB,\n\t\t'plum': 0xDDA0DD,\n\t\t'powderblue': 0xB0E0E6,\n\t\t'purple': 0x800080,\n\t\t'rebeccapurple': 0x663399,\n\t\t'red': 0xFF0000,\n\t\t'rosybrown': 0xBC8F8F,\n\t\t'royalblue': 0x4169E1,\n\t\t'saddlebrown': 0x8B4513,\n\t\t'salmon': 0xFA8072,\n\t\t'sandybrown': 0xF4A460,\n\t\t'seagreen': 0x2E8B57,\n\t\t'seashell': 0xFFF5EE,\n\t\t'sienna': 0xA0522D,\n\t\t'silver': 0xC0C0C0,\n\t\t'skyblue': 0x87CEEB,\n\t\t'slateblue': 0x6A5ACD,\n\t\t'slategray': 0x708090,\n\t\t'slategrey': 0x708090,\n\t\t'snow': 0xFFFAFA,\n\t\t'springgreen': 0x00FF7F,\n\t\t'steelblue': 0x4682B4,\n\t\t'tan': 0xD2B48C,\n\t\t'teal': 0x008080,\n\t\t'thistle': 0xD8BFD8,\n\t\t'tomato': 0xFF6347,\n\t\t'turquoise': 0x40E0D0,\n\t\t'violet': 0xEE82EE,\n\t\t'wheat': 0xF5DEB3,\n\t\t'white': 0xFFFFFF,\n\t\t'whitesmoke': 0xF5F5F5,\n\t\t'yellow': 0xFFFF00,\n\t\t'yellowgreen': 0x9ACD32\n\t};\n\tconst _hslA = {\n\t\th: 0,\n\t\ts: 0,\n\t\tl: 0\n\t};\n\tconst _hslB = {\n\t\th: 0,\n\t\ts: 0,\n\t\tl: 0\n\t};\n\n\tfunction hue2rgb(p, q, t) {\n\t\tif (t < 0) t += 1;\n\t\tif (t > 1) t -= 1;\n\t\tif (t < 1 / 6) return p + (q - p) * 6 * t;\n\t\tif (t < 1 / 2) return q;\n\t\tif (t < 2 / 3) return p + (q - p) * 6 * (2 / 3 - t);\n\t\treturn p;\n\t}\n\n\tfunction SRGBToLinear(c) {\n\t\treturn c < 0.04045 ? c * 0.0773993808 : Math.pow(c * 0.9478672986 + 0.0521327014, 2.4);\n\t}\n\n\tfunction LinearToSRGB(c) {\n\t\treturn c < 0.0031308 ? c * 12.92 : 1.055 * Math.pow(c, 0.41666) - 0.055;\n\t}\n\n\tclass Color {\n\t\tconstructor(r, g, b) {\n\t\t\tif (g === undefined && b === undefined) {\n\t\t\t\t// r is THREE.Color, hex or string\n\t\t\t\treturn this.set(r);\n\t\t\t}\n\n\t\t\treturn this.setRGB(r, g, b);\n\t\t}\n\n\t\tset(value) {\n\t\t\tif (value && value.isColor) {\n\t\t\t\tthis.copy(value);\n\t\t\t} else if (typeof value === 'number') {\n\t\t\t\tthis.setHex(value);\n\t\t\t} else if (typeof value === 'string') {\n\t\t\t\tthis.setStyle(value);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetScalar(scalar) {\n\t\t\tthis.r = scalar;\n\t\t\tthis.g = scalar;\n\t\t\tthis.b = scalar;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetHex(hex) {\n\t\t\thex = Math.floor(hex);\n\t\t\tthis.r = (hex >> 16 & 255) / 255;\n\t\t\tthis.g = (hex >> 8 & 255) / 255;\n\t\t\tthis.b = (hex & 255) / 255;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRGB(r, g, b) {\n\t\t\tthis.r = r;\n\t\t\tthis.g = g;\n\t\t\tthis.b = b;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetHSL(h, s, l) {\n\t\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\t\th = euclideanModulo(h, 1);\n\t\t\ts = clamp(s, 0, 1);\n\t\t\tl = clamp(l, 0, 1);\n\n\t\t\tif (s === 0) {\n\t\t\t\tthis.r = this.g = this.b = l;\n\t\t\t} else {\n\t\t\t\tconst p = l <= 0.5 ? l * (1 + s) : l + s - l * s;\n\t\t\t\tconst q = 2 * l - p;\n\t\t\t\tthis.r = hue2rgb(q, p, h + 1 / 3);\n\t\t\t\tthis.g = hue2rgb(q, p, h);\n\t\t\t\tthis.b = hue2rgb(q, p, h - 1 / 3);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetStyle(style) {\n\t\t\tfunction handleAlpha(string) {\n\t\t\t\tif (string === undefined) return;\n\n\t\t\t\tif (parseFloat(string) < 1) {\n\t\t\t\t\tconsole.warn('THREE.Color: Alpha component of ' + style + ' will be ignored.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet m;\n\n\t\t\tif (m = /^((?:rgb|hsl)a?)\\(([^\\)]*)\\)/.exec(style)) {\n\t\t\t\t// rgb / hsl\n\t\t\t\tlet color;\n\t\t\t\tconst name = m[1];\n\t\t\t\tconst components = m[2];\n\n\t\t\t\tswitch (name) {\n\t\t\t\t\tcase 'rgb':\n\t\t\t\t\tcase 'rgba':\n\t\t\t\t\t\tif (color = /^\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t\t// rgb(255,0,0) rgba(255,0,0,0.5)\n\t\t\t\t\t\t\tthis.r = Math.min(255, parseInt(color[1], 10)) / 255;\n\t\t\t\t\t\t\tthis.g = Math.min(255, parseInt(color[2], 10)) / 255;\n\t\t\t\t\t\t\tthis.b = Math.min(255, parseInt(color[3], 10)) / 255;\n\t\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (color = /^\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t\t// rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)\n\t\t\t\t\t\t\tthis.r = Math.min(100, parseInt(color[1], 10)) / 100;\n\t\t\t\t\t\t\tthis.g = Math.min(100, parseInt(color[2], 10)) / 100;\n\t\t\t\t\t\t\tthis.b = Math.min(100, parseInt(color[3], 10)) / 100;\n\t\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\t\treturn this;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'hsl':\n\t\t\t\t\tcase 'hsla':\n\t\t\t\t\t\tif (color = /^\\s*(\\d*\\.?\\d+)\\s*,\\s*(\\d+)\\%\\s*,\\s*(\\d+)\\%\\s*(?:,\\s*(\\d*\\.?\\d+)\\s*)?$/.exec(components)) {\n\t\t\t\t\t\t\t// hsl(120,50%,50%) hsla(120,50%,50%,0.5)\n\t\t\t\t\t\t\tconst h = parseFloat(color[1]) / 360;\n\t\t\t\t\t\t\tconst s = parseInt(color[2], 10) / 100;\n\t\t\t\t\t\t\tconst l = parseInt(color[3], 10) / 100;\n\t\t\t\t\t\t\thandleAlpha(color[4]);\n\t\t\t\t\t\t\treturn this.setHSL(h, s, l);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t} else if (m = /^\\#([A-Fa-f\\d]+)$/.exec(style)) {\n\t\t\t\t// hex color\n\t\t\t\tconst hex = m[1];\n\t\t\t\tconst size = hex.length;\n\n\t\t\t\tif (size === 3) {\n\t\t\t\t\t// #ff0\n\t\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(0), 16) / 255;\n\t\t\t\t\tthis.g = parseInt(hex.charAt(1) + hex.charAt(1), 16) / 255;\n\t\t\t\t\tthis.b = parseInt(hex.charAt(2) + hex.charAt(2), 16) / 255;\n\t\t\t\t\treturn this;\n\t\t\t\t} else if (size === 6) {\n\t\t\t\t\t// #ff0000\n\t\t\t\t\tthis.r = parseInt(hex.charAt(0) + hex.charAt(1), 16) / 255;\n\t\t\t\t\tthis.g = parseInt(hex.charAt(2) + hex.charAt(3), 16) / 255;\n\t\t\t\t\tthis.b = parseInt(hex.charAt(4) + hex.charAt(5), 16) / 255;\n\t\t\t\t\treturn this;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (style && style.length > 0) {\n\t\t\t\treturn this.setColorName(style);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetColorName(style) {\n\t\t\t// color keywords\n\t\t\tconst hex = _colorKeywords[style.toLowerCase()];\n\n\t\t\tif (hex !== undefined) {\n\t\t\t\t// red\n\t\t\t\tthis.setHex(hex);\n\t\t\t} else {\n\t\t\t\t// unknown color\n\t\t\t\tconsole.warn('THREE.Color: Unknown color ' + style);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.r, this.g, this.b);\n\t\t}\n\n\t\tcopy(color) {\n\t\t\tthis.r = color.r;\n\t\t\tthis.g = color.g;\n\t\t\tthis.b = color.b;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyGammaToLinear(color, gammaFactor = 2.0) {\n\t\t\tthis.r = Math.pow(color.r, gammaFactor);\n\t\t\tthis.g = Math.pow(color.g, gammaFactor);\n\t\t\tthis.b = Math.pow(color.b, gammaFactor);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyLinearToGamma(color, gammaFactor = 2.0) {\n\t\t\tconst safeInverse = gammaFactor > 0 ? 1.0 / gammaFactor : 1.0;\n\t\t\tthis.r = Math.pow(color.r, safeInverse);\n\t\t\tthis.g = Math.pow(color.g, safeInverse);\n\t\t\tthis.b = Math.pow(color.b, safeInverse);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertGammaToLinear(gammaFactor) {\n\t\t\tthis.copyGammaToLinear(this, gammaFactor);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertLinearToGamma(gammaFactor) {\n\t\t\tthis.copyLinearToGamma(this, gammaFactor);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopySRGBToLinear(color) {\n\t\t\tthis.r = SRGBToLinear(color.r);\n\t\t\tthis.g = SRGBToLinear(color.g);\n\t\t\tthis.b = SRGBToLinear(color.b);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyLinearToSRGB(color) {\n\t\t\tthis.r = LinearToSRGB(color.r);\n\t\t\tthis.g = LinearToSRGB(color.g);\n\t\t\tthis.b = LinearToSRGB(color.b);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertSRGBToLinear() {\n\t\t\tthis.copySRGBToLinear(this);\n\t\t\treturn this;\n\t\t}\n\n\t\tconvertLinearToSRGB() {\n\t\t\tthis.copyLinearToSRGB(this);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetHex() {\n\t\t\treturn this.r * 255 << 16 ^ this.g * 255 << 8 ^ this.b * 255 << 0;\n\t\t}\n\n\t\tgetHexString() {\n\t\t\treturn ('000000' + this.getHex().toString(16)).slice(-6);\n\t\t}\n\n\t\tgetHSL(target) {\n\t\t\t// h,s,l ranges are in 0.0 - 1.0\n\t\t\tconst r = this.r,\n\t\t\t\t\t\tg = this.g,\n\t\t\t\t\t\tb = this.b;\n\t\t\tconst max = Math.max(r, g, b);\n\t\t\tconst min = Math.min(r, g, b);\n\t\t\tlet hue, saturation;\n\t\t\tconst lightness = (min + max) / 2.0;\n\n\t\t\tif (min === max) {\n\t\t\t\thue = 0;\n\t\t\t\tsaturation = 0;\n\t\t\t} else {\n\t\t\t\tconst delta = max - min;\n\t\t\t\tsaturation = lightness <= 0.5 ? delta / (max + min) : delta / (2 - max - min);\n\n\t\t\t\tswitch (max) {\n\t\t\t\t\tcase r:\n\t\t\t\t\t\thue = (g - b) / delta + (g < b ? 6 : 0);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase g:\n\t\t\t\t\t\thue = (b - r) / delta + 2;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase b:\n\t\t\t\t\t\thue = (r - g) / delta + 4;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\thue /= 6;\n\t\t\t}\n\n\t\t\ttarget.h = hue;\n\t\t\ttarget.s = saturation;\n\t\t\ttarget.l = lightness;\n\t\t\treturn target;\n\t\t}\n\n\t\tgetStyle() {\n\t\t\treturn 'rgb(' + (this.r * 255 | 0) + ',' + (this.g * 255 | 0) + ',' + (this.b * 255 | 0) + ')';\n\t\t}\n\n\t\toffsetHSL(h, s, l) {\n\t\t\tthis.getHSL(_hslA);\n\t\t\t_hslA.h += h;\n\t\t\t_hslA.s += s;\n\t\t\t_hslA.l += l;\n\t\t\tthis.setHSL(_hslA.h, _hslA.s, _hslA.l);\n\t\t\treturn this;\n\t\t}\n\n\t\tadd(color) {\n\t\t\tthis.r += color.r;\n\t\t\tthis.g += color.g;\n\t\t\tthis.b += color.b;\n\t\t\treturn this;\n\t\t}\n\n\t\taddColors(color1, color2) {\n\t\t\tthis.r = color1.r + color2.r;\n\t\t\tthis.g = color1.g + color2.g;\n\t\t\tthis.b = color1.b + color2.b;\n\t\t\treturn this;\n\t\t}\n\n\t\taddScalar(s) {\n\t\t\tthis.r += s;\n\t\t\tthis.g += s;\n\t\t\tthis.b += s;\n\t\t\treturn this;\n\t\t}\n\n\t\tsub(color) {\n\t\t\tthis.r = Math.max(0, this.r - color.r);\n\t\t\tthis.g = Math.max(0, this.g - color.g);\n\t\t\tthis.b = Math.max(0, this.b - color.b);\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiply(color) {\n\t\t\tthis.r *= color.r;\n\t\t\tthis.g *= color.g;\n\t\t\tthis.b *= color.b;\n\t\t\treturn this;\n\t\t}\n\n\t\tmultiplyScalar(s) {\n\t\t\tthis.r *= s;\n\t\t\tthis.g *= s;\n\t\t\tthis.b *= s;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerp(color, alpha) {\n\t\t\tthis.r += (color.r - this.r) * alpha;\n\t\t\tthis.g += (color.g - this.g) * alpha;\n\t\t\tthis.b += (color.b - this.b) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpColors(color1, color2, alpha) {\n\t\t\tthis.r = color1.r + (color2.r - color1.r) * alpha;\n\t\t\tthis.g = color1.g + (color2.g - color1.g) * alpha;\n\t\t\tthis.b = color1.b + (color2.b - color1.b) * alpha;\n\t\t\treturn this;\n\t\t}\n\n\t\tlerpHSL(color, alpha) {\n\t\t\tthis.getHSL(_hslA);\n\t\t\tcolor.getHSL(_hslB);\n\t\t\tconst h = lerp(_hslA.h, _hslB.h, alpha);\n\t\t\tconst s = lerp(_hslA.s, _hslB.s, alpha);\n\t\t\tconst l = lerp(_hslA.l, _hslB.l, alpha);\n\t\t\tthis.setHSL(h, s, l);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(c) {\n\t\t\treturn c.r === this.r && c.g === this.g && c.b === this.b;\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tthis.r = array[offset];\n\t\t\tthis.g = array[offset + 1];\n\t\t\tthis.b = array[offset + 2];\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tarray[offset] = this.r;\n\t\t\tarray[offset + 1] = this.g;\n\t\t\tarray[offset + 2] = this.b;\n\t\t\treturn array;\n\t\t}\n\n\t\tfromBufferAttribute(attribute, index) {\n\t\t\tthis.r = attribute.getX(index);\n\t\t\tthis.g = attribute.getY(index);\n\t\t\tthis.b = attribute.getZ(index);\n\n\t\t\tif (attribute.normalized === true) {\n\t\t\t\t// assuming Uint8Array\n\t\t\t\tthis.r /= 255;\n\t\t\t\tthis.g /= 255;\n\t\t\t\tthis.b /= 255;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn this.getHex();\n\t\t}\n\n\t}\n\n\tColor.NAMES = _colorKeywords;\n\tColor.prototype.isColor = true;\n\tColor.prototype.r = 1;\n\tColor.prototype.g = 1;\n\tColor.prototype.b = 1;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\tspecularMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tcombine: THREE.Multiply,\n\t *\treflectivity: <float>,\n\t *\trefractionRatio: <float>,\n\t *\n\t *\tdepthTest: <bool>,\n\t *\tdepthWrite: <bool>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t * }\n\t */\n\n\tclass MeshBasicMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshBasicMaterial';\n\t\t\tthis.color = new Color(0xffffff); // emissive\n\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.specularMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.combine = MultiplyOperation;\n\t\t\tthis.reflectivity = 1;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.combine = source.combine;\n\t\t\tthis.reflectivity = source.reflectivity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshBasicMaterial.prototype.isMeshBasicMaterial = true;\n\n\tconst _vector$9 = /*@__PURE__*/new Vector3();\n\n\tconst _vector2$1 = /*@__PURE__*/new Vector2();\n\n\tclass BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tif (Array.isArray(array)) {\n\t\t\t\tthrow new TypeError('THREE.BufferAttribute: array should be a Typed Array.');\n\t\t\t}\n\n\t\t\tthis.name = '';\n\t\t\tthis.array = array;\n\t\t\tthis.itemSize = itemSize;\n\t\t\tthis.count = array !== undefined ? array.length / itemSize : 0;\n\t\t\tthis.normalized = normalized === true;\n\t\t\tthis.usage = StaticDrawUsage;\n\t\t\tthis.updateRange = {\n\t\t\t\toffset: 0,\n\t\t\t\tcount: -1\n\t\t\t};\n\t\t\tthis.version = 0;\n\t\t}\n\n\t\tonUploadCallback() {}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t\tsetUsage(value) {\n\t\t\tthis.usage = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.name = source.name;\n\t\t\tthis.array = new source.array.constructor(source.array);\n\t\t\tthis.itemSize = source.itemSize;\n\t\t\tthis.count = source.count;\n\t\t\tthis.normalized = source.normalized;\n\t\t\tthis.usage = source.usage;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyAt(index1, attribute, index2) {\n\t\t\tindex1 *= this.itemSize;\n\t\t\tindex2 *= attribute.itemSize;\n\n\t\t\tfor (let i = 0, l = this.itemSize; i < l; i++) {\n\t\t\t\tthis.array[index1 + i] = attribute.array[index2 + i];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyArray(array) {\n\t\t\tthis.array.set(array);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyColorsArray(colors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = colors.length; i < l; i++) {\n\t\t\t\tlet color = colors[i];\n\n\t\t\t\tif (color === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', i);\n\t\t\t\t\tcolor = new Color();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = color.r;\n\t\t\t\tarray[offset++] = color.g;\n\t\t\t\tarray[offset++] = color.b;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyVector2sArray(vectors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = vectors.length; i < l; i++) {\n\t\t\t\tlet vector = vectors[i];\n\n\t\t\t\tif (vector === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyVector2sArray(): vector is undefined', i);\n\t\t\t\t\tvector = new Vector2();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = vector.x;\n\t\t\t\tarray[offset++] = vector.y;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyVector3sArray(vectors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = vectors.length; i < l; i++) {\n\t\t\t\tlet vector = vectors[i];\n\n\t\t\t\tif (vector === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyVector3sArray(): vector is undefined', i);\n\t\t\t\t\tvector = new Vector3();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = vector.x;\n\t\t\t\tarray[offset++] = vector.y;\n\t\t\t\tarray[offset++] = vector.z;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyVector4sArray(vectors) {\n\t\t\tconst array = this.array;\n\t\t\tlet offset = 0;\n\n\t\t\tfor (let i = 0, l = vectors.length; i < l; i++) {\n\t\t\t\tlet vector = vectors[i];\n\n\t\t\t\tif (vector === undefined) {\n\t\t\t\t\tconsole.warn('THREE.BufferAttribute.copyVector4sArray(): vector is undefined', i);\n\t\t\t\t\tvector = new Vector4();\n\t\t\t\t}\n\n\t\t\t\tarray[offset++] = vector.x;\n\t\t\t\tarray[offset++] = vector.y;\n\t\t\t\tarray[offset++] = vector.z;\n\t\t\t\tarray[offset++] = vector.w;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix3(m) {\n\t\t\tif (this.itemSize === 2) {\n\t\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t\t_vector2$1.fromBufferAttribute(this, i);\n\n\t\t\t\t\t_vector2$1.applyMatrix3(m);\n\n\t\t\t\t\tthis.setXY(i, _vector2$1.x, _vector2$1.y);\n\t\t\t\t}\n\t\t\t} else if (this.itemSize === 3) {\n\t\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t\t_vector$9.fromBufferAttribute(this, i);\n\n\t\t\t\t\t_vector$9.applyMatrix3(m);\n\n\t\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$9.x = this.getX(i);\n\t\t\t\t_vector$9.y = this.getY(i);\n\t\t\t\t_vector$9.z = this.getZ(i);\n\n\t\t\t\t_vector$9.applyMatrix4(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyNormalMatrix(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$9.x = this.getX(i);\n\t\t\t\t_vector$9.y = this.getY(i);\n\t\t\t\t_vector$9.z = this.getZ(i);\n\n\t\t\t\t_vector$9.applyNormalMatrix(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttransformDirection(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$9.x = this.getX(i);\n\t\t\t\t_vector$9.y = this.getY(i);\n\t\t\t\t_vector$9.z = this.getZ(i);\n\n\t\t\t\t_vector$9.transformDirection(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$9.x, _vector$9.y, _vector$9.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(value, offset = 0) {\n\t\t\tthis.array.set(value, offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetX(index) {\n\t\t\treturn this.array[index * this.itemSize];\n\t\t}\n\n\t\tsetX(index, x) {\n\t\t\tthis.array[index * this.itemSize] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetY(index) {\n\t\t\treturn this.array[index * this.itemSize + 1];\n\t\t}\n\n\t\tsetY(index, y) {\n\t\t\tthis.array[index * this.itemSize + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetZ(index) {\n\t\t\treturn this.array[index * this.itemSize + 2];\n\t\t}\n\n\t\tsetZ(index, z) {\n\t\t\tthis.array[index * this.itemSize + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetW(index) {\n\t\t\treturn this.array[index * this.itemSize + 3];\n\t\t}\n\n\t\tsetW(index, w) {\n\t\t\tthis.array[index * this.itemSize + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXY(index, x, y) {\n\t\t\tindex *= this.itemSize;\n\t\t\tthis.array[index + 0] = x;\n\t\t\tthis.array[index + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZ(index, x, y, z) {\n\t\t\tindex *= this.itemSize;\n\t\t\tthis.array[index + 0] = x;\n\t\t\tthis.array[index + 1] = y;\n\t\t\tthis.array[index + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZW(index, x, y, z, w) {\n\t\t\tindex *= this.itemSize;\n\t\t\tthis.array[index + 0] = x;\n\t\t\tthis.array[index + 1] = y;\n\t\t\tthis.array[index + 2] = z;\n\t\t\tthis.array[index + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tonUpload(callback) {\n\t\t\tthis.onUploadCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.array, this.itemSize).copy(this);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\titemSize: this.itemSize,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tarray: Array.prototype.slice.call(this.array),\n\t\t\t\tnormalized: this.normalized\n\t\t\t};\n\t\t\tif (this.name !== '') data.name = this.name;\n\t\t\tif (this.usage !== StaticDrawUsage) data.usage = this.usage;\n\t\t\tif (this.updateRange.offset !== 0 || this.updateRange.count !== -1) data.updateRange = this.updateRange;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tBufferAttribute.prototype.isBufferAttribute = true; //\n\n\tclass Int8BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Int8Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint8BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint8Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint8ClampedBufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint8ClampedArray(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Int16BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Int16Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint16BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint16Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Int32BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Int32Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Uint32BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint32Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Float16BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Uint16Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tFloat16BufferAttribute.prototype.isFloat16BufferAttribute = true;\n\n\tclass Float32BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Float32Array(array), itemSize, normalized);\n\t\t}\n\n\t}\n\n\tclass Float64BufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized) {\n\t\t\tsuper(new Float64Array(array), itemSize, normalized);\n\t\t}\n\n\t} //\n\n\tlet _id = 0;\n\n\tconst _m1 = /*@__PURE__*/new Matrix4();\n\n\tconst _obj = /*@__PURE__*/new Object3D();\n\n\tconst _offset = /*@__PURE__*/new Vector3();\n\n\tconst _box$1 = /*@__PURE__*/new Box3();\n\n\tconst _boxMorphTargets = /*@__PURE__*/new Box3();\n\n\tconst _vector$8 = /*@__PURE__*/new Vector3();\n\n\tclass BufferGeometry extends EventDispatcher {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tObject.defineProperty(this, 'id', {\n\t\t\t\tvalue: _id++\n\t\t\t});\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.name = '';\n\t\t\tthis.type = 'BufferGeometry';\n\t\t\tthis.index = null;\n\t\t\tthis.attributes = {};\n\t\t\tthis.morphAttributes = {};\n\t\t\tthis.morphTargetsRelative = false;\n\t\t\tthis.groups = [];\n\t\t\tthis.boundingBox = null;\n\t\t\tthis.boundingSphere = null;\n\t\t\tthis.drawRange = {\n\t\t\t\tstart: 0,\n\t\t\t\tcount: Infinity\n\t\t\t};\n\t\t\tthis.userData = {};\n\t\t}\n\n\t\tgetIndex() {\n\t\t\treturn this.index;\n\t\t}\n\n\t\tsetIndex(index) {\n\t\t\tif (Array.isArray(index)) {\n\t\t\t\tthis.index = new (arrayMax(index) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute)(index, 1);\n\t\t\t} else {\n\t\t\t\tthis.index = index;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetAttribute(name) {\n\t\t\treturn this.attributes[name];\n\t\t}\n\n\t\tsetAttribute(name, attribute) {\n\t\t\tthis.attributes[name] = attribute;\n\t\t\treturn this;\n\t\t}\n\n\t\tdeleteAttribute(name) {\n\t\t\tdelete this.attributes[name];\n\t\t\treturn this;\n\t\t}\n\n\t\thasAttribute(name) {\n\t\t\treturn this.attributes[name] !== undefined;\n\t\t}\n\n\t\taddGroup(start, count, materialIndex = 0) {\n\t\t\tthis.groups.push({\n\t\t\t\tstart: start,\n\t\t\t\tcount: count,\n\t\t\t\tmaterialIndex: materialIndex\n\t\t\t});\n\t\t}\n\n\t\tclearGroups() {\n\t\t\tthis.groups = [];\n\t\t}\n\n\t\tsetDrawRange(start, count) {\n\t\t\tthis.drawRange.start = start;\n\t\t\tthis.drawRange.count = count;\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tconst position = this.attributes.position;\n\n\t\t\tif (position !== undefined) {\n\t\t\t\tposition.applyMatrix4(matrix);\n\t\t\t\tposition.needsUpdate = true;\n\t\t\t}\n\n\t\t\tconst normal = this.attributes.normal;\n\n\t\t\tif (normal !== undefined) {\n\t\t\t\tconst normalMatrix = new Matrix3().getNormalMatrix(matrix);\n\t\t\t\tnormal.applyNormalMatrix(normalMatrix);\n\t\t\t\tnormal.needsUpdate = true;\n\t\t\t}\n\n\t\t\tconst tangent = this.attributes.tangent;\n\n\t\t\tif (tangent !== undefined) {\n\t\t\t\ttangent.transformDirection(matrix);\n\t\t\t\ttangent.needsUpdate = true;\n\t\t\t}\n\n\t\t\tif (this.boundingBox !== null) {\n\t\t\t\tthis.computeBoundingBox();\n\t\t\t}\n\n\t\t\tif (this.boundingSphere !== null) {\n\t\t\t\tthis.computeBoundingSphere();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyQuaternion(q) {\n\t\t\t_m1.makeRotationFromQuaternion(q);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateX(angle) {\n\t\t\t// rotate geometry around world x-axis\n\t\t\t_m1.makeRotationX(angle);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateY(angle) {\n\t\t\t// rotate geometry around world y-axis\n\t\t\t_m1.makeRotationY(angle);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\trotateZ(angle) {\n\t\t\t// rotate geometry around world z-axis\n\t\t\t_m1.makeRotationZ(angle);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(x, y, z) {\n\t\t\t// translate geometry\n\t\t\t_m1.makeTranslation(x, y, z);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(x, y, z) {\n\t\t\t// scale geometry\n\t\t\t_m1.makeScale(x, y, z);\n\n\t\t\tthis.applyMatrix4(_m1);\n\t\t\treturn this;\n\t\t}\n\n\t\tlookAt(vector) {\n\t\t\t_obj.lookAt(vector);\n\n\t\t\t_obj.updateMatrix();\n\n\t\t\tthis.applyMatrix4(_obj.matrix);\n\t\t\treturn this;\n\t\t}\n\n\t\tcenter() {\n\t\t\tthis.computeBoundingBox();\n\t\t\tthis.boundingBox.getCenter(_offset).negate();\n\t\t\tthis.translate(_offset.x, _offset.y, _offset.z);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tconst position = [];\n\n\t\t\tfor (let i = 0, l = points.length; i < l; i++) {\n\t\t\t\tconst point = points[i];\n\t\t\t\tposition.push(point.x, point.y, point.z || 0);\n\t\t\t}\n\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(position, 3));\n\t\t\treturn this;\n\t\t}\n\n\t\tcomputeBoundingBox() {\n\t\t\tif (this.boundingBox === null) {\n\t\t\t\tthis.boundingBox = new Box3();\n\t\t\t}\n\n\t\t\tconst position = this.attributes.position;\n\t\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\t\tif (position && position.isGLBufferAttribute) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set \"mesh.frustumCulled\" to \"false\".', this);\n\t\t\t\tthis.boundingBox.set(new Vector3(-Infinity, -Infinity, -Infinity), new Vector3(+Infinity, +Infinity, +Infinity));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (position !== undefined) {\n\t\t\t\tthis.boundingBox.setFromBufferAttribute(position); // process morph attributes if present\n\n\t\t\t\tif (morphAttributesPosition) {\n\t\t\t\t\tfor (let i = 0, il = morphAttributesPosition.length; i < il; i++) {\n\t\t\t\t\t\tconst morphAttribute = morphAttributesPosition[i];\n\n\t\t\t\t\t\t_box$1.setFromBufferAttribute(morphAttribute);\n\n\t\t\t\t\t\tif (this.morphTargetsRelative) {\n\t\t\t\t\t\t\t_vector$8.addVectors(this.boundingBox.min, _box$1.min);\n\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_vector$8);\n\n\t\t\t\t\t\t\t_vector$8.addVectors(this.boundingBox.max, _box$1.max);\n\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_vector$8);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_box$1.min);\n\t\t\t\t\t\t\tthis.boundingBox.expandByPoint(_box$1.max);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.boundingBox.makeEmpty();\n\t\t\t}\n\n\t\t\tif (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The \"position\" attribute is likely to have NaN values.', this);\n\t\t\t}\n\t\t}\n\n\t\tcomputeBoundingSphere() {\n\t\t\tif (this.boundingSphere === null) {\n\t\t\t\tthis.boundingSphere = new Sphere();\n\t\t\t}\n\n\t\t\tconst position = this.attributes.position;\n\t\t\tconst morphAttributesPosition = this.morphAttributes.position;\n\n\t\t\tif (position && position.isGLBufferAttribute) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set \"mesh.frustumCulled\" to \"false\".', this);\n\t\t\t\tthis.boundingSphere.set(new Vector3(), Infinity);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (position) {\n\t\t\t\t// first, find the center of the bounding sphere\n\t\t\t\tconst center = this.boundingSphere.center;\n\n\t\t\t\t_box$1.setFromBufferAttribute(position); // process morph attributes if present\n\n\n\t\t\t\tif (morphAttributesPosition) {\n\t\t\t\t\tfor (let i = 0, il = morphAttributesPosition.length; i < il; i++) {\n\t\t\t\t\t\tconst morphAttribute = morphAttributesPosition[i];\n\n\t\t\t\t\t\t_boxMorphTargets.setFromBufferAttribute(morphAttribute);\n\n\t\t\t\t\t\tif (this.morphTargetsRelative) {\n\t\t\t\t\t\t\t_vector$8.addVectors(_box$1.min, _boxMorphTargets.min);\n\n\t\t\t\t\t\t\t_box$1.expandByPoint(_vector$8);\n\n\t\t\t\t\t\t\t_vector$8.addVectors(_box$1.max, _boxMorphTargets.max);\n\n\t\t\t\t\t\t\t_box$1.expandByPoint(_vector$8);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t_box$1.expandByPoint(_boxMorphTargets.min);\n\n\t\t\t\t\t\t\t_box$1.expandByPoint(_boxMorphTargets.max);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t_box$1.getCenter(center); // second, try to find a boundingSphere with a radius smaller than the\n\t\t\t\t// boundingSphere of the boundingBox: sqrt(3) smaller in the best case\n\n\n\t\t\t\tlet maxRadiusSq = 0;\n\n\t\t\t\tfor (let i = 0, il = position.count; i < il; i++) {\n\t\t\t\t\t_vector$8.fromBufferAttribute(position, i);\n\n\t\t\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));\n\t\t\t\t} // process morph attributes if present\n\n\n\t\t\t\tif (morphAttributesPosition) {\n\t\t\t\t\tfor (let i = 0, il = morphAttributesPosition.length; i < il; i++) {\n\t\t\t\t\t\tconst morphAttribute = morphAttributesPosition[i];\n\t\t\t\t\t\tconst morphTargetsRelative = this.morphTargetsRelative;\n\n\t\t\t\t\t\tfor (let j = 0, jl = morphAttribute.count; j < jl; j++) {\n\t\t\t\t\t\t\t_vector$8.fromBufferAttribute(morphAttribute, j);\n\n\t\t\t\t\t\t\tif (morphTargetsRelative) {\n\t\t\t\t\t\t\t\t_offset.fromBufferAttribute(position, j);\n\n\t\t\t\t\t\t\t\t_vector$8.add(_offset);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector$8));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.boundingSphere.radius = Math.sqrt(maxRadiusSq);\n\n\t\t\t\tif (isNaN(this.boundingSphere.radius)) {\n\t\t\t\t\tconsole.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The \"position\" attribute is likely to have NaN values.', this);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcomputeTangents() {\n\t\t\tconst index = this.index;\n\t\t\tconst attributes = this.attributes; // based on http://www.terathon.com/code/tangent.html\n\t\t\t// (per vertex tangents)\n\n\t\t\tif (index === null || attributes.position === undefined || attributes.normal === undefined || attributes.uv === undefined) {\n\t\t\t\tconsole.error('THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst indices = index.array;\n\t\t\tconst positions = attributes.position.array;\n\t\t\tconst normals = attributes.normal.array;\n\t\t\tconst uvs = attributes.uv.array;\n\t\t\tconst nVertices = positions.length / 3;\n\n\t\t\tif (attributes.tangent === undefined) {\n\t\t\t\tthis.setAttribute('tangent', new BufferAttribute(new Float32Array(4 * nVertices), 4));\n\t\t\t}\n\n\t\t\tconst tangents = attributes.tangent.array;\n\t\t\tconst tan1 = [],\n\t\t\t\t\t\ttan2 = [];\n\n\t\t\tfor (let i = 0; i < nVertices; i++) {\n\t\t\t\ttan1[i] = new Vector3();\n\t\t\t\ttan2[i] = new Vector3();\n\t\t\t}\n\n\t\t\tconst vA = new Vector3(),\n\t\t\t\t\t\tvB = new Vector3(),\n\t\t\t\t\t\tvC = new Vector3(),\n\t\t\t\t\t\tuvA = new Vector2(),\n\t\t\t\t\t\tuvB = new Vector2(),\n\t\t\t\t\t\tuvC = new Vector2(),\n\t\t\t\t\t\tsdir = new Vector3(),\n\t\t\t\t\t\ttdir = new Vector3();\n\n\t\t\tfunction handleTriangle(a, b, c) {\n\t\t\t\tvA.fromArray(positions, a * 3);\n\t\t\t\tvB.fromArray(positions, b * 3);\n\t\t\t\tvC.fromArray(positions, c * 3);\n\t\t\t\tuvA.fromArray(uvs, a * 2);\n\t\t\t\tuvB.fromArray(uvs, b * 2);\n\t\t\t\tuvC.fromArray(uvs, c * 2);\n\t\t\t\tvB.sub(vA);\n\t\t\t\tvC.sub(vA);\n\t\t\t\tuvB.sub(uvA);\n\t\t\t\tuvC.sub(uvA);\n\t\t\t\tconst r = 1.0 / (uvB.x * uvC.y - uvC.x * uvB.y); // silently ignore degenerate uv triangles having coincident or colinear vertices\n\n\t\t\t\tif (!isFinite(r)) return;\n\t\t\t\tsdir.copy(vB).multiplyScalar(uvC.y).addScaledVector(vC, -uvB.y).multiplyScalar(r);\n\t\t\t\ttdir.copy(vC).multiplyScalar(uvB.x).addScaledVector(vB, -uvC.x).multiplyScalar(r);\n\t\t\t\ttan1[a].add(sdir);\n\t\t\t\ttan1[b].add(sdir);\n\t\t\t\ttan1[c].add(sdir);\n\t\t\t\ttan2[a].add(tdir);\n\t\t\t\ttan2[b].add(tdir);\n\t\t\t\ttan2[c].add(tdir);\n\t\t\t}\n\n\t\t\tlet groups = this.groups;\n\n\t\t\tif (groups.length === 0) {\n\t\t\t\tgroups = [{\n\t\t\t\t\tstart: 0,\n\t\t\t\t\tcount: indices.length\n\t\t\t\t}];\n\t\t\t}\n\n\t\t\tfor (let i = 0, il = groups.length; i < il; ++i) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tconst start = group.start;\n\t\t\t\tconst count = group.count;\n\n\t\t\t\tfor (let j = start, jl = start + count; j < jl; j += 3) {\n\t\t\t\t\thandleTriangle(indices[j + 0], indices[j + 1], indices[j + 2]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst tmp = new Vector3(),\n\t\t\t\t\t\ttmp2 = new Vector3();\n\t\t\tconst n = new Vector3(),\n\t\t\t\t\t\tn2 = new Vector3();\n\n\t\t\tfunction handleVertex(v) {\n\t\t\t\tn.fromArray(normals, v * 3);\n\t\t\t\tn2.copy(n);\n\t\t\t\tconst t = tan1[v]; // Gram-Schmidt orthogonalize\n\n\t\t\t\ttmp.copy(t);\n\t\t\t\ttmp.sub(n.multiplyScalar(n.dot(t))).normalize(); // Calculate handedness\n\n\t\t\t\ttmp2.crossVectors(n2, t);\n\t\t\t\tconst test = tmp2.dot(tan2[v]);\n\t\t\t\tconst w = test < 0.0 ? -1.0 : 1.0;\n\t\t\t\ttangents[v * 4] = tmp.x;\n\t\t\t\ttangents[v * 4 + 1] = tmp.y;\n\t\t\t\ttangents[v * 4 + 2] = tmp.z;\n\t\t\t\ttangents[v * 4 + 3] = w;\n\t\t\t}\n\n\t\t\tfor (let i = 0, il = groups.length; i < il; ++i) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tconst start = group.start;\n\t\t\t\tconst count = group.count;\n\n\t\t\t\tfor (let j = start, jl = start + count; j < jl; j += 3) {\n\t\t\t\t\thandleVertex(indices[j + 0]);\n\t\t\t\t\thandleVertex(indices[j + 1]);\n\t\t\t\t\thandleVertex(indices[j + 2]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcomputeVertexNormals() {\n\t\t\tconst index = this.index;\n\t\t\tconst positionAttribute = this.getAttribute('position');\n\n\t\t\tif (positionAttribute !== undefined) {\n\t\t\t\tlet normalAttribute = this.getAttribute('normal');\n\n\t\t\t\tif (normalAttribute === undefined) {\n\t\t\t\t\tnormalAttribute = new BufferAttribute(new Float32Array(positionAttribute.count * 3), 3);\n\t\t\t\t\tthis.setAttribute('normal', normalAttribute);\n\t\t\t\t} else {\n\t\t\t\t\t// reset existing normals to zero\n\t\t\t\t\tfor (let i = 0, il = normalAttribute.count; i < il; i++) {\n\t\t\t\t\t\tnormalAttribute.setXYZ(i, 0, 0, 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst pA = new Vector3(),\n\t\t\t\t\t\t\tpB = new Vector3(),\n\t\t\t\t\t\t\tpC = new Vector3();\n\t\t\t\tconst nA = new Vector3(),\n\t\t\t\t\t\t\tnB = new Vector3(),\n\t\t\t\t\t\t\tnC = new Vector3();\n\t\t\t\tconst cb = new Vector3(),\n\t\t\t\t\t\t\tab = new Vector3(); // indexed elements\n\n\t\t\t\tif (index) {\n\t\t\t\t\tfor (let i = 0, il = index.count; i < il; i += 3) {\n\t\t\t\t\t\tconst vA = index.getX(i + 0);\n\t\t\t\t\t\tconst vB = index.getX(i + 1);\n\t\t\t\t\t\tconst vC = index.getX(i + 2);\n\t\t\t\t\t\tpA.fromBufferAttribute(positionAttribute, vA);\n\t\t\t\t\t\tpB.fromBufferAttribute(positionAttribute, vB);\n\t\t\t\t\t\tpC.fromBufferAttribute(positionAttribute, vC);\n\t\t\t\t\t\tcb.subVectors(pC, pB);\n\t\t\t\t\t\tab.subVectors(pA, pB);\n\t\t\t\t\t\tcb.cross(ab);\n\t\t\t\t\t\tnA.fromBufferAttribute(normalAttribute, vA);\n\t\t\t\t\t\tnB.fromBufferAttribute(normalAttribute, vB);\n\t\t\t\t\t\tnC.fromBufferAttribute(normalAttribute, vC);\n\t\t\t\t\t\tnA.add(cb);\n\t\t\t\t\t\tnB.add(cb);\n\t\t\t\t\t\tnC.add(cb);\n\t\t\t\t\t\tnormalAttribute.setXYZ(vA, nA.x, nA.y, nA.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(vB, nB.x, nB.y, nB.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(vC, nC.x, nC.y, nC.z);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// non-indexed elements (unconnected triangle soup)\n\t\t\t\t\tfor (let i = 0, il = positionAttribute.count; i < il; i += 3) {\n\t\t\t\t\t\tpA.fromBufferAttribute(positionAttribute, i + 0);\n\t\t\t\t\t\tpB.fromBufferAttribute(positionAttribute, i + 1);\n\t\t\t\t\t\tpC.fromBufferAttribute(positionAttribute, i + 2);\n\t\t\t\t\t\tcb.subVectors(pC, pB);\n\t\t\t\t\t\tab.subVectors(pA, pB);\n\t\t\t\t\t\tcb.cross(ab);\n\t\t\t\t\t\tnormalAttribute.setXYZ(i + 0, cb.x, cb.y, cb.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(i + 1, cb.x, cb.y, cb.z);\n\t\t\t\t\t\tnormalAttribute.setXYZ(i + 2, cb.x, cb.y, cb.z);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.normalizeNormals();\n\t\t\t\tnormalAttribute.needsUpdate = true;\n\t\t\t}\n\t\t}\n\n\t\tmerge(geometry, offset) {\n\t\t\tif (!(geometry && geometry.isBufferGeometry)) {\n\t\t\t\tconsole.error('THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', geometry);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (offset === undefined) {\n\t\t\t\toffset = 0;\n\t\t\t\tconsole.warn('THREE.BufferGeometry.merge(): Overwriting original geometry, starting at offset=0. ' + 'Use BufferGeometryUtils.mergeBufferGeometries() for lossless merge.');\n\t\t\t}\n\n\t\t\tconst attributes = this.attributes;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tif (geometry.attributes[key] === undefined) continue;\n\t\t\t\tconst attribute1 = attributes[key];\n\t\t\t\tconst attributeArray1 = attribute1.array;\n\t\t\t\tconst attribute2 = geometry.attributes[key];\n\t\t\t\tconst attributeArray2 = attribute2.array;\n\t\t\t\tconst attributeOffset = attribute2.itemSize * offset;\n\t\t\t\tconst length = Math.min(attributeArray2.length, attributeArray1.length - attributeOffset);\n\n\t\t\t\tfor (let i = 0, j = attributeOffset; i < length; i++, j++) {\n\t\t\t\t\tattributeArray1[j] = attributeArray2[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tnormalizeNormals() {\n\t\t\tconst normals = this.attributes.normal;\n\n\t\t\tfor (let i = 0, il = normals.count; i < il; i++) {\n\t\t\t\t_vector$8.fromBufferAttribute(normals, i);\n\n\t\t\t\t_vector$8.normalize();\n\n\t\t\t\tnormals.setXYZ(i, _vector$8.x, _vector$8.y, _vector$8.z);\n\t\t\t}\n\t\t}\n\n\t\ttoNonIndexed() {\n\t\t\tfunction convertBufferAttribute(attribute, indices) {\n\t\t\t\tconst array = attribute.array;\n\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\tconst normalized = attribute.normalized;\n\t\t\t\tconst array2 = new array.constructor(indices.length * itemSize);\n\t\t\t\tlet index = 0,\n\t\t\t\t\t\tindex2 = 0;\n\n\t\t\t\tfor (let i = 0, l = indices.length; i < l; i++) {\n\t\t\t\t\tif (attribute.isInterleavedBufferAttribute) {\n\t\t\t\t\t\tindex = indices[i] * attribute.data.stride + attribute.offset;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindex = indices[i] * itemSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let j = 0; j < itemSize; j++) {\n\t\t\t\t\t\tarray2[index2++] = array[index++];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new BufferAttribute(array2, itemSize, normalized);\n\t\t\t} //\n\n\n\t\t\tif (this.index === null) {\n\t\t\t\tconsole.warn('THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.');\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tconst geometry2 = new BufferGeometry();\n\t\t\tconst indices = this.index.array;\n\t\t\tconst attributes = this.attributes; // attributes\n\n\t\t\tfor (const name in attributes) {\n\t\t\t\tconst attribute = attributes[name];\n\t\t\t\tconst newAttribute = convertBufferAttribute(attribute, indices);\n\t\t\t\tgeometry2.setAttribute(name, newAttribute);\n\t\t\t} // morph attributes\n\n\n\t\t\tconst morphAttributes = this.morphAttributes;\n\n\t\t\tfor (const name in morphAttributes) {\n\t\t\t\tconst morphArray = [];\n\t\t\t\tconst morphAttribute = morphAttributes[name]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\t\tfor (let i = 0, il = morphAttribute.length; i < il; i++) {\n\t\t\t\t\tconst attribute = morphAttribute[i];\n\t\t\t\t\tconst newAttribute = convertBufferAttribute(attribute, indices);\n\t\t\t\t\tmorphArray.push(newAttribute);\n\t\t\t\t}\n\n\t\t\t\tgeometry2.morphAttributes[name] = morphArray;\n\t\t\t}\n\n\t\t\tgeometry2.morphTargetsRelative = this.morphTargetsRelative; // groups\n\n\t\t\tconst groups = this.groups;\n\n\t\t\tfor (let i = 0, l = groups.length; i < l; i++) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tgeometry2.addGroup(group.start, group.count, group.materialIndex);\n\t\t\t}\n\n\t\t\treturn geometry2;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'BufferGeometry',\n\t\t\t\t\tgenerator: 'BufferGeometry.toJSON'\n\t\t\t\t}\n\t\t\t}; // standard BufferGeometry serialization\n\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.type = this.type;\n\t\t\tif (this.name !== '') data.name = this.name;\n\t\t\tif (Object.keys(this.userData).length > 0) data.userData = this.userData;\n\n\t\t\tif (this.parameters !== undefined) {\n\t\t\t\tconst parameters = this.parameters;\n\n\t\t\t\tfor (const key in parameters) {\n\t\t\t\t\tif (parameters[key] !== undefined) data[key] = parameters[key];\n\t\t\t\t}\n\n\t\t\t\treturn data;\n\t\t\t} // for simplicity the code assumes attributes are not shared across geometries, see #15811\n\n\n\t\t\tdata.data = {\n\t\t\t\tattributes: {}\n\t\t\t};\n\t\t\tconst index = this.index;\n\n\t\t\tif (index !== null) {\n\t\t\t\tdata.data.index = {\n\t\t\t\t\ttype: index.array.constructor.name,\n\t\t\t\t\tarray: Array.prototype.slice.call(index.array)\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tconst attributes = this.attributes;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tconst attribute = attributes[key];\n\t\t\t\tdata.data.attributes[key] = attribute.toJSON(data.data);\n\t\t\t}\n\n\t\t\tconst morphAttributes = {};\n\t\t\tlet hasMorphAttributes = false;\n\n\t\t\tfor (const key in this.morphAttributes) {\n\t\t\t\tconst attributeArray = this.morphAttributes[key];\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor (let i = 0, il = attributeArray.length; i < il; i++) {\n\t\t\t\t\tconst attribute = attributeArray[i];\n\t\t\t\t\tarray.push(attribute.toJSON(data.data));\n\t\t\t\t}\n\n\t\t\t\tif (array.length > 0) {\n\t\t\t\t\tmorphAttributes[key] = array;\n\t\t\t\t\thasMorphAttributes = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (hasMorphAttributes) {\n\t\t\t\tdata.data.morphAttributes = morphAttributes;\n\t\t\t\tdata.data.morphTargetsRelative = this.morphTargetsRelative;\n\t\t\t}\n\n\t\t\tconst groups = this.groups;\n\n\t\t\tif (groups.length > 0) {\n\t\t\t\tdata.data.groups = JSON.parse(JSON.stringify(groups));\n\t\t\t}\n\n\t\t\tconst boundingSphere = this.boundingSphere;\n\n\t\t\tif (boundingSphere !== null) {\n\t\t\t\tdata.data.boundingSphere = {\n\t\t\t\t\tcenter: boundingSphere.center.toArray(),\n\t\t\t\t\tradius: boundingSphere.radius\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\t// reset\n\t\t\tthis.index = null;\n\t\t\tthis.attributes = {};\n\t\t\tthis.morphAttributes = {};\n\t\t\tthis.groups = [];\n\t\t\tthis.boundingBox = null;\n\t\t\tthis.boundingSphere = null; // used for storing cloned, shared data\n\n\t\t\tconst data = {}; // name\n\n\t\t\tthis.name = source.name; // index\n\n\t\t\tconst index = source.index;\n\n\t\t\tif (index !== null) {\n\t\t\t\tthis.setIndex(index.clone(data));\n\t\t\t} // attributes\n\n\n\t\t\tconst attributes = source.attributes;\n\n\t\t\tfor (const name in attributes) {\n\t\t\t\tconst attribute = attributes[name];\n\t\t\t\tthis.setAttribute(name, attribute.clone(data));\n\t\t\t} // morph attributes\n\n\n\t\t\tconst morphAttributes = source.morphAttributes;\n\n\t\t\tfor (const name in morphAttributes) {\n\t\t\t\tconst array = [];\n\t\t\t\tconst morphAttribute = morphAttributes[name]; // morphAttribute: array of Float32BufferAttributes\n\n\t\t\t\tfor (let i = 0, l = morphAttribute.length; i < l; i++) {\n\t\t\t\t\tarray.push(morphAttribute[i].clone(data));\n\t\t\t\t}\n\n\t\t\t\tthis.morphAttributes[name] = array;\n\t\t\t}\n\n\t\t\tthis.morphTargetsRelative = source.morphTargetsRelative; // groups\n\n\t\t\tconst groups = source.groups;\n\n\t\t\tfor (let i = 0, l = groups.length; i < l; i++) {\n\t\t\t\tconst group = groups[i];\n\t\t\t\tthis.addGroup(group.start, group.count, group.materialIndex);\n\t\t\t} // bounding box\n\n\n\t\t\tconst boundingBox = source.boundingBox;\n\n\t\t\tif (boundingBox !== null) {\n\t\t\t\tthis.boundingBox = boundingBox.clone();\n\t\t\t} // bounding sphere\n\n\n\t\t\tconst boundingSphere = source.boundingSphere;\n\n\t\t\tif (boundingSphere !== null) {\n\t\t\t\tthis.boundingSphere = boundingSphere.clone();\n\t\t\t} // draw range\n\n\n\t\t\tthis.drawRange.start = source.drawRange.start;\n\t\t\tthis.drawRange.count = source.drawRange.count; // user data\n\n\t\t\tthis.userData = source.userData; // geometry generator parameters\n\n\t\t\tif (source.parameters !== undefined) this.parameters = Object.assign({}, source.parameters);\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t}\n\n\tBufferGeometry.prototype.isBufferGeometry = true;\n\n\tconst _inverseMatrix$2 = /*@__PURE__*/new Matrix4();\n\n\tconst _ray$2 = /*@__PURE__*/new Ray();\n\n\tconst _sphere$3 = /*@__PURE__*/new Sphere();\n\n\tconst _vA$1 = /*@__PURE__*/new Vector3();\n\n\tconst _vB$1 = /*@__PURE__*/new Vector3();\n\n\tconst _vC$1 = /*@__PURE__*/new Vector3();\n\n\tconst _tempA = /*@__PURE__*/new Vector3();\n\n\tconst _tempB = /*@__PURE__*/new Vector3();\n\n\tconst _tempC = /*@__PURE__*/new Vector3();\n\n\tconst _morphA = /*@__PURE__*/new Vector3();\n\n\tconst _morphB = /*@__PURE__*/new Vector3();\n\n\tconst _morphC = /*@__PURE__*/new Vector3();\n\n\tconst _uvA$1 = /*@__PURE__*/new Vector2();\n\n\tconst _uvB$1 = /*@__PURE__*/new Vector2();\n\n\tconst _uvC$1 = /*@__PURE__*/new Vector2();\n\n\tconst _intersectionPoint = /*@__PURE__*/new Vector3();\n\n\tconst _intersectionPointWorld = /*@__PURE__*/new Vector3();\n\n\tclass Mesh extends Object3D {\n\t\tconstructor(geometry = new BufferGeometry(), material = new MeshBasicMaterial()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Mesh';\n\t\t\tthis.geometry = geometry;\n\t\t\tthis.material = material;\n\t\t\tthis.updateMorphTargets();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\n\t\t\tif (source.morphTargetInfluences !== undefined) {\n\t\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\t\t\t}\n\n\t\t\tif (source.morphTargetDictionary !== undefined) {\n\t\t\t\tthis.morphTargetDictionary = Object.assign({}, source.morphTargetDictionary);\n\t\t\t}\n\n\t\t\tthis.material = source.material;\n\t\t\tthis.geometry = source.geometry;\n\t\t\treturn this;\n\t\t}\n\n\t\tupdateMorphTargets() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\t\tconst keys = Object.keys(morphAttributes);\n\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst morphAttribute = morphAttributes[keys[0]];\n\n\t\t\t\t\tif (morphAttribute !== undefined) {\n\t\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\t\tfor (let m = 0, ml = morphAttribute.length; m < ml; m++) {\n\t\t\t\t\t\t\tconst name = morphAttribute[m].name || String(m);\n\t\t\t\t\t\t\tthis.morphTargetInfluences.push(0);\n\t\t\t\t\t\t\tthis.morphTargetDictionary[name] = m;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\t\tif (morphTargets !== undefined && morphTargets.length > 0) {\n\t\t\t\t\tconsole.error('THREE.Mesh.updateMorphTargets() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst material = this.material;\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tif (material === undefined) return; // Checking boundingSphere distance to ray\n\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$3.copy(geometry.boundingSphere);\n\n\t\t\t_sphere$3.applyMatrix4(matrixWorld);\n\n\t\t\tif (raycaster.ray.intersectsSphere(_sphere$3) === false) return; //\n\n\t\t\t_inverseMatrix$2.copy(matrixWorld).invert();\n\n\t\t\t_ray$2.copy(raycaster.ray).applyMatrix4(_inverseMatrix$2); // Check boundingBox before continuing\n\n\n\t\t\tif (geometry.boundingBox !== null) {\n\t\t\t\tif (_ray$2.intersectsBox(geometry.boundingBox) === false) return;\n\t\t\t}\n\n\t\t\tlet intersection;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst index = geometry.index;\n\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\t\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\t\t\t\tconst uv = geometry.attributes.uv;\n\t\t\t\tconst uv2 = geometry.attributes.uv2;\n\t\t\t\tconst groups = geometry.groups;\n\t\t\t\tconst drawRange = geometry.drawRange;\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\t// indexed buffer geometry\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tfor (let i = 0, il = groups.length; i < il; i++) {\n\t\t\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\t\t\t\t\t\t\tconst start = Math.max(group.start, drawRange.start);\n\t\t\t\t\t\t\tconst end = Math.min(index.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));\n\n\t\t\t\t\t\t\tfor (let j = start, jl = end; j < jl; j += 3) {\n\t\t\t\t\t\t\t\tconst a = index.getX(j);\n\t\t\t\t\t\t\t\tconst b = index.getX(j + 1);\n\t\t\t\t\t\t\t\tconst c = index.getX(j + 2);\n\t\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(j / 3); // triangle number in indexed buffer semantics\n\n\t\t\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\t\tconst end = Math.min(index.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\t\tfor (let i = start, il = end; i < il; i += 3) {\n\t\t\t\t\t\t\tconst a = index.getX(i);\n\t\t\t\t\t\t\tconst b = index.getX(i + 1);\n\t\t\t\t\t\t\tconst c = index.getX(i + 2);\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(i / 3); // triangle number in indexed buffer semantics\n\n\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (position !== undefined) {\n\t\t\t\t\t// non-indexed buffer geometry\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tfor (let i = 0, il = groups.length; i < il; i++) {\n\t\t\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\t\t\t\t\t\t\tconst start = Math.max(group.start, drawRange.start);\n\t\t\t\t\t\t\tconst end = Math.min(position.count, Math.min(group.start + group.count, drawRange.start + drawRange.count));\n\n\t\t\t\t\t\t\tfor (let j = start, jl = end; j < jl; j += 3) {\n\t\t\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\t\t\tconst c = j + 2;\n\t\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(j / 3); // triangle number in non-indexed buffer semantics\n\n\t\t\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\t\tconst end = Math.min(position.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\t\tfor (let i = start, il = end; i < il; i += 3) {\n\t\t\t\t\t\t\tconst a = i;\n\t\t\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\t\t\tconst c = i + 2;\n\t\t\t\t\t\t\tintersection = checkBufferGeometryIntersection(this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c);\n\n\t\t\t\t\t\t\tif (intersection) {\n\t\t\t\t\t\t\t\tintersection.faceIndex = Math.floor(i / 3); // triangle number in non-indexed buffer semantics\n\n\t\t\t\t\t\t\t\tintersects.push(intersection);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.Mesh.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\t\t}\n\n\t}\n\n\tMesh.prototype.isMesh = true;\n\n\tfunction checkIntersection(object, material, raycaster, ray, pA, pB, pC, point) {\n\t\tlet intersect;\n\n\t\tif (material.side === BackSide) {\n\t\t\tintersect = ray.intersectTriangle(pC, pB, pA, true, point);\n\t\t} else {\n\t\t\tintersect = ray.intersectTriangle(pA, pB, pC, material.side !== DoubleSide, point);\n\t\t}\n\n\t\tif (intersect === null) return null;\n\n\t\t_intersectionPointWorld.copy(point);\n\n\t\t_intersectionPointWorld.applyMatrix4(object.matrixWorld);\n\n\t\tconst distance = raycaster.ray.origin.distanceTo(_intersectionPointWorld);\n\t\tif (distance < raycaster.near || distance > raycaster.far) return null;\n\t\treturn {\n\t\t\tdistance: distance,\n\t\t\tpoint: _intersectionPointWorld.clone(),\n\t\t\tobject: object\n\t\t};\n\t}\n\n\tfunction checkBufferGeometryIntersection(object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c) {\n\t\t_vA$1.fromBufferAttribute(position, a);\n\n\t\t_vB$1.fromBufferAttribute(position, b);\n\n\t\t_vC$1.fromBufferAttribute(position, c);\n\n\t\tconst morphInfluences = object.morphTargetInfluences;\n\n\t\tif (morphPosition && morphInfluences) {\n\t\t\t_morphA.set(0, 0, 0);\n\n\t\t\t_morphB.set(0, 0, 0);\n\n\t\t\t_morphC.set(0, 0, 0);\n\n\t\t\tfor (let i = 0, il = morphPosition.length; i < il; i++) {\n\t\t\t\tconst influence = morphInfluences[i];\n\t\t\t\tconst morphAttribute = morphPosition[i];\n\t\t\t\tif (influence === 0) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute(morphAttribute, a);\n\n\t\t\t\t_tempB.fromBufferAttribute(morphAttribute, b);\n\n\t\t\t\t_tempC.fromBufferAttribute(morphAttribute, c);\n\n\t\t\t\tif (morphTargetsRelative) {\n\t\t\t\t\t_morphA.addScaledVector(_tempA, influence);\n\n\t\t\t\t\t_morphB.addScaledVector(_tempB, influence);\n\n\t\t\t\t\t_morphC.addScaledVector(_tempC, influence);\n\t\t\t\t} else {\n\t\t\t\t\t_morphA.addScaledVector(_tempA.sub(_vA$1), influence);\n\n\t\t\t\t\t_morphB.addScaledVector(_tempB.sub(_vB$1), influence);\n\n\t\t\t\t\t_morphC.addScaledVector(_tempC.sub(_vC$1), influence);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_vA$1.add(_morphA);\n\n\t\t\t_vB$1.add(_morphB);\n\n\t\t\t_vC$1.add(_morphC);\n\t\t}\n\n\t\tif (object.isSkinnedMesh) {\n\t\t\tobject.boneTransform(a, _vA$1);\n\t\t\tobject.boneTransform(b, _vB$1);\n\t\t\tobject.boneTransform(c, _vC$1);\n\t\t}\n\n\t\tconst intersection = checkIntersection(object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint);\n\n\t\tif (intersection) {\n\t\t\tif (uv) {\n\t\t\t\t_uvA$1.fromBufferAttribute(uv, a);\n\n\t\t\t\t_uvB$1.fromBufferAttribute(uv, b);\n\n\t\t\t\t_uvC$1.fromBufferAttribute(uv, c);\n\n\t\t\t\tintersection.uv = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());\n\t\t\t}\n\n\t\t\tif (uv2) {\n\t\t\t\t_uvA$1.fromBufferAttribute(uv2, a);\n\n\t\t\t\t_uvB$1.fromBufferAttribute(uv2, b);\n\n\t\t\t\t_uvC$1.fromBufferAttribute(uv2, c);\n\n\t\t\t\tintersection.uv2 = Triangle.getUV(_intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2());\n\t\t\t}\n\n\t\t\tconst face = {\n\t\t\t\ta: a,\n\t\t\t\tb: b,\n\t\t\t\tc: c,\n\t\t\t\tnormal: new Vector3(),\n\t\t\t\tmaterialIndex: 0\n\t\t\t};\n\t\t\tTriangle.getNormal(_vA$1, _vB$1, _vC$1, face.normal);\n\t\t\tintersection.face = face;\n\t\t}\n\n\t\treturn intersection;\n\t}\n\n\tclass BoxGeometry extends BufferGeometry {\n\t\tconstructor(width = 1, height = 1, depth = 1, widthSegments = 1, heightSegments = 1, depthSegments = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'BoxGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tdepth: depth,\n\t\t\t\twidthSegments: widthSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\tdepthSegments: depthSegments\n\t\t\t};\n\t\t\tconst scope = this; // segments\n\n\t\t\twidthSegments = Math.floor(widthSegments);\n\t\t\theightSegments = Math.floor(heightSegments);\n\t\t\tdepthSegments = Math.floor(depthSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tlet numberOfVertices = 0;\n\t\t\tlet groupStart = 0; // build each side of the box geometry\n\n\t\t\tbuildPlane('z', 'y', 'x', -1, -1, depth, height, width, depthSegments, heightSegments, 0); // px\n\n\t\t\tbuildPlane('z', 'y', 'x', 1, -1, depth, height, -width, depthSegments, heightSegments, 1); // nx\n\n\t\t\tbuildPlane('x', 'z', 'y', 1, 1, width, depth, height, widthSegments, depthSegments, 2); // py\n\n\t\t\tbuildPlane('x', 'z', 'y', 1, -1, width, depth, -height, widthSegments, depthSegments, 3); // ny\n\n\t\t\tbuildPlane('x', 'y', 'z', 1, -1, width, height, depth, widthSegments, heightSegments, 4); // pz\n\n\t\t\tbuildPlane('x', 'y', 'z', -1, -1, width, height, -depth, widthSegments, heightSegments, 5); // nz\n\t\t\t// build geometry\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\n\t\t\tfunction buildPlane(u, v, w, udir, vdir, width, height, depth, gridX, gridY, materialIndex) {\n\t\t\t\tconst segmentWidth = width / gridX;\n\t\t\t\tconst segmentHeight = height / gridY;\n\t\t\t\tconst widthHalf = width / 2;\n\t\t\t\tconst heightHalf = height / 2;\n\t\t\t\tconst depthHalf = depth / 2;\n\t\t\t\tconst gridX1 = gridX + 1;\n\t\t\t\tconst gridY1 = gridY + 1;\n\t\t\t\tlet vertexCounter = 0;\n\t\t\t\tlet groupCount = 0;\n\t\t\t\tconst vector = new Vector3(); // generate vertices, normals and uvs\n\n\t\t\t\tfor (let iy = 0; iy < gridY1; iy++) {\n\t\t\t\t\tconst y = iy * segmentHeight - heightHalf;\n\n\t\t\t\t\tfor (let ix = 0; ix < gridX1; ix++) {\n\t\t\t\t\t\tconst x = ix * segmentWidth - widthHalf; // set values to correct vector component\n\n\t\t\t\t\t\tvector[u] = x * udir;\n\t\t\t\t\t\tvector[v] = y * vdir;\n\t\t\t\t\t\tvector[w] = depthHalf; // now apply vector to vertex buffer\n\n\t\t\t\t\t\tvertices.push(vector.x, vector.y, vector.z); // set values to correct vector component\n\n\t\t\t\t\t\tvector[u] = 0;\n\t\t\t\t\t\tvector[v] = 0;\n\t\t\t\t\t\tvector[w] = depth > 0 ? 1 : -1; // now apply vector to normal buffer\n\n\t\t\t\t\t\tnormals.push(vector.x, vector.y, vector.z); // uvs\n\n\t\t\t\t\t\tuvs.push(ix / gridX);\n\t\t\t\t\t\tuvs.push(1 - iy / gridY); // counters\n\n\t\t\t\t\t\tvertexCounter += 1;\n\t\t\t\t\t}\n\t\t\t\t} // indices\n\t\t\t\t// 1. you need three indices to draw a single face\n\t\t\t\t// 2. a single segment consists of two faces\n\t\t\t\t// 3. so we need to generate six (2*3) indices per segment\n\n\n\t\t\t\tfor (let iy = 0; iy < gridY; iy++) {\n\t\t\t\t\tfor (let ix = 0; ix < gridX; ix++) {\n\t\t\t\t\t\tconst a = numberOfVertices + ix + gridX1 * iy;\n\t\t\t\t\t\tconst b = numberOfVertices + ix + gridX1 * (iy + 1);\n\t\t\t\t\t\tconst c = numberOfVertices + (ix + 1) + gridX1 * (iy + 1);\n\t\t\t\t\t\tconst d = numberOfVertices + (ix + 1) + gridX1 * iy; // faces\n\n\t\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\t\tindices.push(b, c, d); // increase counter\n\n\t\t\t\t\t\tgroupCount += 6;\n\t\t\t\t\t}\n\t\t\t\t} // add a group to the geometry. this will ensure multi material support\n\n\n\t\t\t\tscope.addGroup(groupStart, groupCount, materialIndex); // calculate new start value for groups\n\n\t\t\t\tgroupStart += groupCount; // update total number of vertices\n\n\t\t\t\tnumberOfVertices += vertexCounter;\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new BoxGeometry(data.width, data.height, data.depth, data.widthSegments, data.heightSegments, data.depthSegments);\n\t\t}\n\n\t}\n\n\t/**\n\t * Uniform Utilities\n\t */\n\tfunction cloneUniforms(src) {\n\t\tconst dst = {};\n\n\t\tfor (const u in src) {\n\t\t\tdst[u] = {};\n\n\t\t\tfor (const p in src[u]) {\n\t\t\t\tconst property = src[u][p];\n\n\t\t\t\tif (property && (property.isColor || property.isMatrix3 || property.isMatrix4 || property.isVector2 || property.isVector3 || property.isVector4 || property.isTexture || property.isQuaternion)) {\n\t\t\t\t\tdst[u][p] = property.clone();\n\t\t\t\t} else if (Array.isArray(property)) {\n\t\t\t\t\tdst[u][p] = property.slice();\n\t\t\t\t} else {\n\t\t\t\t\tdst[u][p] = property;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn dst;\n\t}\n\tfunction mergeUniforms(uniforms) {\n\t\tconst merged = {};\n\n\t\tfor (let u = 0; u < uniforms.length; u++) {\n\t\t\tconst tmp = cloneUniforms(uniforms[u]);\n\n\t\t\tfor (const p in tmp) {\n\t\t\t\tmerged[p] = tmp[p];\n\t\t\t}\n\t\t}\n\n\t\treturn merged;\n\t} // Legacy\n\n\tconst UniformsUtils = {\n\t\tclone: cloneUniforms,\n\t\tmerge: mergeUniforms\n\t};\n\n\tvar default_vertex = \"void main() {\\n\\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\\n}\";\n\n\tvar default_fragment = \"void main() {\\n\\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\\n}\";\n\n\t/**\n\t * parameters = {\n\t *\tdefines: { \"label\" : \"value\" },\n\t *\tuniforms: { \"parameter1\": { value: 1.0 }, \"parameter2\": { value2: 2 } },\n\t *\n\t *\tfragmentShader: <string>,\n\t *\tvertexShader: <string>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t *\tlights: <bool>\n\t * }\n\t */\n\n\tclass ShaderMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ShaderMaterial';\n\t\t\tthis.defines = {};\n\t\t\tthis.uniforms = {};\n\t\t\tthis.vertexShader = default_vertex;\n\t\t\tthis.fragmentShader = default_fragment;\n\t\t\tthis.linewidth = 1;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.fog = false; // set to use scene fog\n\n\t\t\tthis.lights = false; // set to use scene lights\n\n\t\t\tthis.clipping = false; // set to use user-defined clipping planes\n\n\t\t\tthis.extensions = {\n\t\t\t\tderivatives: false,\n\t\t\t\t// set to use derivatives\n\t\t\t\tfragDepth: false,\n\t\t\t\t// set to use fragment depth values\n\t\t\t\tdrawBuffers: false,\n\t\t\t\t// set to use draw buffers\n\t\t\t\tshaderTextureLOD: false // set to use shader texture LOD\n\n\t\t\t}; // When rendered geometry doesn't include these attributes but the material does,\n\t\t\t// use these default values in WebGL. This avoids errors when buffer data is missing.\n\n\t\t\tthis.defaultAttributeValues = {\n\t\t\t\t'color': [1, 1, 1],\n\t\t\t\t'uv': [0, 0],\n\t\t\t\t'uv2': [0, 0]\n\t\t\t};\n\t\t\tthis.index0AttributeName = undefined;\n\t\t\tthis.uniformsNeedUpdate = false;\n\t\t\tthis.glslVersion = null;\n\n\t\t\tif (parameters !== undefined) {\n\t\t\t\tif (parameters.attributes !== undefined) {\n\t\t\t\t\tconsole.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.');\n\t\t\t\t}\n\n\t\t\t\tthis.setValues(parameters);\n\t\t\t}\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.fragmentShader = source.fragmentShader;\n\t\t\tthis.vertexShader = source.vertexShader;\n\t\t\tthis.uniforms = cloneUniforms(source.uniforms);\n\t\t\tthis.defines = Object.assign({}, source.defines);\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.lights = source.lights;\n\t\t\tthis.clipping = source.clipping;\n\t\t\tthis.extensions = Object.assign({}, source.extensions);\n\t\t\tthis.glslVersion = source.glslVersion;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.glslVersion = this.glslVersion;\n\t\t\tdata.uniforms = {};\n\n\t\t\tfor (const name in this.uniforms) {\n\t\t\t\tconst uniform = this.uniforms[name];\n\t\t\t\tconst value = uniform.value;\n\n\t\t\t\tif (value && value.isTexture) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 't',\n\t\t\t\t\t\tvalue: value.toJSON(meta).uuid\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isColor) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'c',\n\t\t\t\t\t\tvalue: value.getHex()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isVector2) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'v2',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isVector3) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'v3',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isVector4) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'v4',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isMatrix3) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'm3',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else if (value && value.isMatrix4) {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\ttype: 'm4',\n\t\t\t\t\t\tvalue: value.toArray()\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tdata.uniforms[name] = {\n\t\t\t\t\t\tvalue: value\n\t\t\t\t\t}; // note: the array variants v2v, v3v, v4v, m4v and tv are not supported so far\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (Object.keys(this.defines).length > 0) data.defines = this.defines;\n\t\t\tdata.vertexShader = this.vertexShader;\n\t\t\tdata.fragmentShader = this.fragmentShader;\n\t\t\tconst extensions = {};\n\n\t\t\tfor (const key in this.extensions) {\n\t\t\t\tif (this.extensions[key] === true) extensions[key] = true;\n\t\t\t}\n\n\t\t\tif (Object.keys(extensions).length > 0) data.extensions = extensions;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tShaderMaterial.prototype.isShaderMaterial = true;\n\n\tclass Camera extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Camera';\n\t\t\tthis.matrixWorldInverse = new Matrix4();\n\t\t\tthis.projectionMatrix = new Matrix4();\n\t\t\tthis.projectionMatrixInverse = new Matrix4();\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tthis.matrixWorldInverse.copy(source.matrixWorldInverse);\n\t\t\tthis.projectionMatrix.copy(source.projectionMatrix);\n\t\t\tthis.projectionMatrixInverse.copy(source.projectionMatrixInverse);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetWorldDirection(target) {\n\t\t\tthis.updateWorldMatrix(true, false);\n\t\t\tconst e = this.matrixWorld.elements;\n\t\t\treturn target.set(-e[8], -e[9], -e[10]).normalize();\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t\tthis.matrixWorldInverse.copy(this.matrixWorld).invert();\n\t\t}\n\n\t\tupdateWorldMatrix(updateParents, updateChildren) {\n\t\t\tsuper.updateWorldMatrix(updateParents, updateChildren);\n\t\t\tthis.matrixWorldInverse.copy(this.matrixWorld).invert();\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tCamera.prototype.isCamera = true;\n\n\tclass PerspectiveCamera extends Camera {\n\t\tconstructor(fov = 50, aspect = 1, near = 0.1, far = 2000) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PerspectiveCamera';\n\t\t\tthis.fov = fov;\n\t\t\tthis.zoom = 1;\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t\tthis.focus = 10;\n\t\t\tthis.aspect = aspect;\n\t\t\tthis.view = null;\n\t\t\tthis.filmGauge = 35; // width of the film (default in millimeters)\n\n\t\t\tthis.filmOffset = 0; // horizontal film offset (same unit as gauge)\n\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tthis.fov = source.fov;\n\t\t\tthis.zoom = source.zoom;\n\t\t\tthis.near = source.near;\n\t\t\tthis.far = source.far;\n\t\t\tthis.focus = source.focus;\n\t\t\tthis.aspect = source.aspect;\n\t\t\tthis.view = source.view === null ? null : Object.assign({}, source.view);\n\t\t\tthis.filmGauge = source.filmGauge;\n\t\t\tthis.filmOffset = source.filmOffset;\n\t\t\treturn this;\n\t\t}\n\t\t/**\n\t\t * Sets the FOV by focal length in respect to the current .filmGauge.\n\t\t *\n\t\t * The default film gauge is 35, so that the focal length can be specified for\n\t\t * a 35mm (full frame) camera.\n\t\t *\n\t\t * Values for focal length and film gauge must have the same unit.\n\t\t */\n\n\n\t\tsetFocalLength(focalLength) {\n\t\t\t/** see {@link http://www.bobatkins.com/photography/technical/field_of_view.html} */\n\t\t\tconst vExtentSlope = 0.5 * this.getFilmHeight() / focalLength;\n\t\t\tthis.fov = RAD2DEG * 2 * Math.atan(vExtentSlope);\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\t\t/**\n\t\t * Calculates the focal length from the current .fov and .filmGauge.\n\t\t */\n\n\n\t\tgetFocalLength() {\n\t\t\tconst vExtentSlope = Math.tan(DEG2RAD * 0.5 * this.fov);\n\t\t\treturn 0.5 * this.getFilmHeight() / vExtentSlope;\n\t\t}\n\n\t\tgetEffectiveFOV() {\n\t\t\treturn RAD2DEG * 2 * Math.atan(Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom);\n\t\t}\n\n\t\tgetFilmWidth() {\n\t\t\t// film not completely covered in portrait format (aspect < 1)\n\t\t\treturn this.filmGauge * Math.min(this.aspect, 1);\n\t\t}\n\n\t\tgetFilmHeight() {\n\t\t\t// film not completely covered in landscape format (aspect > 1)\n\t\t\treturn this.filmGauge / Math.max(this.aspect, 1);\n\t\t}\n\t\t/**\n\t\t * Sets an offset in a larger frustum. This is useful for multi-window or\n\t\t * multi-monitor/multi-machine setups.\n\t\t *\n\t\t * For example, if you have 3x2 monitors and each monitor is 1920x1080 and\n\t\t * the monitors are in grid like this\n\t\t *\n\t\t *\t +---+---+---+\n\t\t *\t | A | B | C |\n\t\t *\t +---+---+---+\n\t\t *\t | D | E | F |\n\t\t *\t +---+---+---+\n\t\t *\n\t\t * then for each monitor you would call it like this\n\t\t *\n\t\t *\t const w = 1920;\n\t\t *\t const h = 1080;\n\t\t *\t const fullWidth = w * 3;\n\t\t *\t const fullHeight = h * 2;\n\t\t *\n\t\t *\t --A--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h );\n\t\t *\t --B--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h );\n\t\t *\t --C--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h );\n\t\t *\t --D--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h );\n\t\t *\t --E--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h );\n\t\t *\t --F--\n\t\t *\t camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );\n\t\t *\n\t\t *\t Note there is no reason monitors have to be the same size or in a grid.\n\t\t */\n\n\n\t\tsetViewOffset(fullWidth, fullHeight, x, y, width, height) {\n\t\t\tthis.aspect = fullWidth / fullHeight;\n\n\t\t\tif (this.view === null) {\n\t\t\t\tthis.view = {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tfullWidth: 1,\n\t\t\t\t\tfullHeight: 1,\n\t\t\t\t\toffsetX: 0,\n\t\t\t\t\toffsetY: 0,\n\t\t\t\t\twidth: 1,\n\t\t\t\t\theight: 1\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tthis.view.enabled = true;\n\t\t\tthis.view.fullWidth = fullWidth;\n\t\t\tthis.view.fullHeight = fullHeight;\n\t\t\tthis.view.offsetX = x;\n\t\t\tthis.view.offsetY = y;\n\t\t\tthis.view.width = width;\n\t\t\tthis.view.height = height;\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tclearViewOffset() {\n\t\t\tif (this.view !== null) {\n\t\t\t\tthis.view.enabled = false;\n\t\t\t}\n\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tupdateProjectionMatrix() {\n\t\t\tconst near = this.near;\n\t\t\tlet top = near * Math.tan(DEG2RAD * 0.5 * this.fov) / this.zoom;\n\t\t\tlet height = 2 * top;\n\t\t\tlet width = this.aspect * height;\n\t\t\tlet left = -0.5 * width;\n\t\t\tconst view = this.view;\n\n\t\t\tif (this.view !== null && this.view.enabled) {\n\t\t\t\tconst fullWidth = view.fullWidth,\n\t\t\t\t\t\t\tfullHeight = view.fullHeight;\n\t\t\t\tleft += view.offsetX * width / fullWidth;\n\t\t\t\ttop -= view.offsetY * height / fullHeight;\n\t\t\t\twidth *= view.width / fullWidth;\n\t\t\t\theight *= view.height / fullHeight;\n\t\t\t}\n\n\t\t\tconst skew = this.filmOffset;\n\t\t\tif (skew !== 0) left += near * skew / this.getFilmWidth();\n\t\t\tthis.projectionMatrix.makePerspective(left, left + width, top, top - height, near, this.far);\n\t\t\tthis.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.fov = this.fov;\n\t\t\tdata.object.zoom = this.zoom;\n\t\t\tdata.object.near = this.near;\n\t\t\tdata.object.far = this.far;\n\t\t\tdata.object.focus = this.focus;\n\t\t\tdata.object.aspect = this.aspect;\n\t\t\tif (this.view !== null) data.object.view = Object.assign({}, this.view);\n\t\t\tdata.object.filmGauge = this.filmGauge;\n\t\t\tdata.object.filmOffset = this.filmOffset;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tPerspectiveCamera.prototype.isPerspectiveCamera = true;\n\n\tconst fov = 90,\n\t\t\t\taspect = 1;\n\n\tclass CubeCamera extends Object3D {\n\t\tconstructor(near, far, renderTarget) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CubeCamera';\n\n\t\t\tif (renderTarget.isWebGLCubeRenderTarget !== true) {\n\t\t\t\tconsole.error('THREE.CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.renderTarget = renderTarget;\n\t\t\tconst cameraPX = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraPX.layers = this.layers;\n\t\t\tcameraPX.up.set(0, -1, 0);\n\t\t\tcameraPX.lookAt(new Vector3(1, 0, 0));\n\t\t\tthis.add(cameraPX);\n\t\t\tconst cameraNX = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraNX.layers = this.layers;\n\t\t\tcameraNX.up.set(0, -1, 0);\n\t\t\tcameraNX.lookAt(new Vector3(-1, 0, 0));\n\t\t\tthis.add(cameraNX);\n\t\t\tconst cameraPY = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraPY.layers = this.layers;\n\t\t\tcameraPY.up.set(0, 0, 1);\n\t\t\tcameraPY.lookAt(new Vector3(0, 1, 0));\n\t\t\tthis.add(cameraPY);\n\t\t\tconst cameraNY = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraNY.layers = this.layers;\n\t\t\tcameraNY.up.set(0, 0, -1);\n\t\t\tcameraNY.lookAt(new Vector3(0, -1, 0));\n\t\t\tthis.add(cameraNY);\n\t\t\tconst cameraPZ = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraPZ.layers = this.layers;\n\t\t\tcameraPZ.up.set(0, -1, 0);\n\t\t\tcameraPZ.lookAt(new Vector3(0, 0, 1));\n\t\t\tthis.add(cameraPZ);\n\t\t\tconst cameraNZ = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tcameraNZ.layers = this.layers;\n\t\t\tcameraNZ.up.set(0, -1, 0);\n\t\t\tcameraNZ.lookAt(new Vector3(0, 0, -1));\n\t\t\tthis.add(cameraNZ);\n\t\t}\n\n\t\tupdate(renderer, scene) {\n\t\t\tif (this.parent === null) this.updateMatrixWorld();\n\t\t\tconst renderTarget = this.renderTarget;\n\t\t\tconst [cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ] = this.children;\n\t\t\tconst currentXrEnabled = renderer.xr.enabled;\n\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\trenderer.xr.enabled = false;\n\t\t\tconst generateMipmaps = renderTarget.texture.generateMipmaps;\n\t\t\trenderTarget.texture.generateMipmaps = false;\n\t\t\trenderer.setRenderTarget(renderTarget, 0);\n\t\t\trenderer.render(scene, cameraPX);\n\t\t\trenderer.setRenderTarget(renderTarget, 1);\n\t\t\trenderer.render(scene, cameraNX);\n\t\t\trenderer.setRenderTarget(renderTarget, 2);\n\t\t\trenderer.render(scene, cameraPY);\n\t\t\trenderer.setRenderTarget(renderTarget, 3);\n\t\t\trenderer.render(scene, cameraNY);\n\t\t\trenderer.setRenderTarget(renderTarget, 4);\n\t\t\trenderer.render(scene, cameraPZ);\n\t\t\trenderTarget.texture.generateMipmaps = generateMipmaps;\n\t\t\trenderer.setRenderTarget(renderTarget, 5);\n\t\t\trenderer.render(scene, cameraNZ);\n\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t\trenderer.xr.enabled = currentXrEnabled;\n\t\t}\n\n\t}\n\n\tclass CubeTexture extends Texture {\n\t\tconstructor(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding) {\n\t\t\timages = images !== undefined ? images : [];\n\t\t\tmapping = mapping !== undefined ? mapping : CubeReflectionMapping;\n\t\t\tsuper(images, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);\n\t\t\tthis.flipY = false;\n\t\t}\n\n\t\tget images() {\n\t\t\treturn this.image;\n\t\t}\n\n\t\tset images(value) {\n\t\t\tthis.image = value;\n\t\t}\n\n\t}\n\n\tCubeTexture.prototype.isCubeTexture = true;\n\n\tclass WebGLCubeRenderTarget extends WebGLRenderTarget {\n\t\tconstructor(size, options, dummy) {\n\t\t\tif (Number.isInteger(options)) {\n\t\t\t\tconsole.warn('THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )');\n\t\t\t\toptions = dummy;\n\t\t\t}\n\n\t\t\tsuper(size, size, options);\n\t\t\toptions = options || {}; // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)\n\t\t\t// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,\n\t\t\t// in a left-handed coordinate system. By continuing this convention, preexisting cube maps continued to render correctly.\n\t\t\t// three.js uses a right-handed coordinate system. So environment maps used in three.js appear to have px and nx swapped\n\t\t\t// and the flag isRenderTargetTexture controls this conversion. The flip is not required when using WebGLCubeRenderTarget.texture\n\t\t\t// as a cube texture (this is detected when isRenderTargetTexture is set to true for cube textures).\n\n\t\t\tthis.texture = new CubeTexture(undefined, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.encoding);\n\t\t\tthis.texture.isRenderTargetTexture = true;\n\t\t\tthis.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;\n\t\t\tthis.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;\n\t\t\tthis.texture._needsFlipEnvMap = false;\n\t\t}\n\n\t\tfromEquirectangularTexture(renderer, texture) {\n\t\t\tthis.texture.type = texture.type;\n\t\t\tthis.texture.format = RGBAFormat; // see #18859\n\n\t\t\tthis.texture.encoding = texture.encoding;\n\t\t\tthis.texture.generateMipmaps = texture.generateMipmaps;\n\t\t\tthis.texture.minFilter = texture.minFilter;\n\t\t\tthis.texture.magFilter = texture.magFilter;\n\t\t\tconst shader = {\n\t\t\t\tuniforms: {\n\t\t\t\t\ttEquirect: {\n\t\t\t\t\t\tvalue: null\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tvertexShader:\n\t\t\t\t/* glsl */\n\t\t\t\t`\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\tvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\n\t\t\t\t\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvWorldDirection = transformDirection( position, modelMatrix );\n\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t}\n\t\t\t`,\n\t\t\t\tfragmentShader:\n\t\t\t\t/* glsl */\n\t\t\t\t`\n\n\t\t\t\tuniform sampler2D tEquirect;\n\n\t\t\t\tvarying vec3 vWorldDirection;\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 direction = normalize( vWorldDirection );\n\n\t\t\t\t\tvec2 sampleUV = equirectUv( direction );\n\n\t\t\t\t\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\n\t\t\t\t}\n\t\t\t`\n\t\t\t};\n\t\t\tconst geometry = new BoxGeometry(5, 5, 5);\n\t\t\tconst material = new ShaderMaterial({\n\t\t\t\tname: 'CubemapFromEquirect',\n\t\t\t\tuniforms: cloneUniforms(shader.uniforms),\n\t\t\t\tvertexShader: shader.vertexShader,\n\t\t\t\tfragmentShader: shader.fragmentShader,\n\t\t\t\tside: BackSide,\n\t\t\t\tblending: NoBlending\n\t\t\t});\n\t\t\tmaterial.uniforms.tEquirect.value = texture;\n\t\t\tconst mesh = new Mesh(geometry, material);\n\t\t\tconst currentMinFilter = texture.minFilter; // Avoid blurred poles\n\n\t\t\tif (texture.minFilter === LinearMipmapLinearFilter) texture.minFilter = LinearFilter;\n\t\t\tconst camera = new CubeCamera(1, 10, this);\n\t\t\tcamera.update(renderer, mesh);\n\t\t\ttexture.minFilter = currentMinFilter;\n\t\t\tmesh.geometry.dispose();\n\t\t\tmesh.material.dispose();\n\t\t\treturn this;\n\t\t}\n\n\t\tclear(renderer, color, depth, stencil) {\n\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\trenderer.setRenderTarget(this, i);\n\t\t\t\trenderer.clear(color, depth, stencil);\n\t\t\t}\n\n\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t}\n\n\t}\n\n\tWebGLCubeRenderTarget.prototype.isWebGLCubeRenderTarget = true;\n\n\tconst _vector1 = /*@__PURE__*/new Vector3();\n\n\tconst _vector2 = /*@__PURE__*/new Vector3();\n\n\tconst _normalMatrix = /*@__PURE__*/new Matrix3();\n\n\tclass Plane {\n\t\tconstructor(normal = new Vector3(1, 0, 0), constant = 0) {\n\t\t\t// normal is assumed to be normalized\n\t\t\tthis.normal = normal;\n\t\t\tthis.constant = constant;\n\t\t}\n\n\t\tset(normal, constant) {\n\t\t\tthis.normal.copy(normal);\n\t\t\tthis.constant = constant;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetComponents(x, y, z, w) {\n\t\t\tthis.normal.set(x, y, z);\n\t\t\tthis.constant = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromNormalAndCoplanarPoint(normal, point) {\n\t\t\tthis.normal.copy(normal);\n\t\t\tthis.constant = -point.dot(this.normal);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCoplanarPoints(a, b, c) {\n\t\t\tconst normal = _vector1.subVectors(c, b).cross(_vector2.subVectors(a, b)).normalize(); // Q: should an error be thrown if normal is zero (e.g. degenerate plane)?\n\n\n\t\t\tthis.setFromNormalAndCoplanarPoint(normal, a);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(plane) {\n\t\t\tthis.normal.copy(plane.normal);\n\t\t\tthis.constant = plane.constant;\n\t\t\treturn this;\n\t\t}\n\n\t\tnormalize() {\n\t\t\t// Note: will lead to a divide by zero if the plane is invalid.\n\t\t\tconst inverseNormalLength = 1.0 / this.normal.length();\n\t\t\tthis.normal.multiplyScalar(inverseNormalLength);\n\t\t\tthis.constant *= inverseNormalLength;\n\t\t\treturn this;\n\t\t}\n\n\t\tnegate() {\n\t\t\tthis.constant *= -1;\n\t\t\tthis.normal.negate();\n\t\t\treturn this;\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\treturn this.normal.dot(point) + this.constant;\n\t\t}\n\n\t\tdistanceToSphere(sphere) {\n\t\t\treturn this.distanceToPoint(sphere.center) - sphere.radius;\n\t\t}\n\n\t\tprojectPoint(point, target) {\n\t\t\treturn target.copy(this.normal).multiplyScalar(-this.distanceToPoint(point)).add(point);\n\t\t}\n\n\t\tintersectLine(line, target) {\n\t\t\tconst direction = line.delta(_vector1);\n\t\t\tconst denominator = this.normal.dot(direction);\n\n\t\t\tif (denominator === 0) {\n\t\t\t\t// line is coplanar, return origin\n\t\t\t\tif (this.distanceToPoint(line.start) === 0) {\n\t\t\t\t\treturn target.copy(line.start);\n\t\t\t\t} // Unsure if this is the correct method to handle this case.\n\n\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst t = -(line.start.dot(this.normal) + this.constant) / denominator;\n\n\t\t\tif (t < 0 || t > 1) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn target.copy(direction).multiplyScalar(t).add(line.start);\n\t\t}\n\n\t\tintersectsLine(line) {\n\t\t\t// Note: this tests if a line intersects the plane, not whether it (or its end-points) are coplanar with it.\n\t\t\tconst startSign = this.distanceToPoint(line.start);\n\t\t\tconst endSign = this.distanceToPoint(line.end);\n\t\t\treturn startSign < 0 && endSign > 0 || endSign < 0 && startSign > 0;\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\treturn box.intersectsPlane(this);\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\treturn sphere.intersectsPlane(this);\n\t\t}\n\n\t\tcoplanarPoint(target) {\n\t\t\treturn target.copy(this.normal).multiplyScalar(-this.constant);\n\t\t}\n\n\t\tapplyMatrix4(matrix, optionalNormalMatrix) {\n\t\t\tconst normalMatrix = optionalNormalMatrix || _normalMatrix.getNormalMatrix(matrix);\n\n\t\t\tconst referencePoint = this.coplanarPoint(_vector1).applyMatrix4(matrix);\n\t\t\tconst normal = this.normal.applyMatrix3(normalMatrix).normalize();\n\t\t\tthis.constant = -referencePoint.dot(normal);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.constant -= offset.dot(this.normal);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(plane) {\n\t\t\treturn plane.normal.equals(this.normal) && plane.constant === this.constant;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tPlane.prototype.isPlane = true;\n\n\tconst _sphere$2 = /*@__PURE__*/new Sphere();\n\n\tconst _vector$7 = /*@__PURE__*/new Vector3();\n\n\tclass Frustum {\n\t\tconstructor(p0 = new Plane(), p1 = new Plane(), p2 = new Plane(), p3 = new Plane(), p4 = new Plane(), p5 = new Plane()) {\n\t\t\tthis.planes = [p0, p1, p2, p3, p4, p5];\n\t\t}\n\n\t\tset(p0, p1, p2, p3, p4, p5) {\n\t\t\tconst planes = this.planes;\n\t\t\tplanes[0].copy(p0);\n\t\t\tplanes[1].copy(p1);\n\t\t\tplanes[2].copy(p2);\n\t\t\tplanes[3].copy(p3);\n\t\t\tplanes[4].copy(p4);\n\t\t\tplanes[5].copy(p5);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(frustum) {\n\t\t\tconst planes = this.planes;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tplanes[i].copy(frustum.planes[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromProjectionMatrix(m) {\n\t\t\tconst planes = this.planes;\n\t\t\tconst me = m.elements;\n\t\t\tconst me0 = me[0],\n\t\t\t\t\t\tme1 = me[1],\n\t\t\t\t\t\tme2 = me[2],\n\t\t\t\t\t\tme3 = me[3];\n\t\t\tconst me4 = me[4],\n\t\t\t\t\t\tme5 = me[5],\n\t\t\t\t\t\tme6 = me[6],\n\t\t\t\t\t\tme7 = me[7];\n\t\t\tconst me8 = me[8],\n\t\t\t\t\t\tme9 = me[9],\n\t\t\t\t\t\tme10 = me[10],\n\t\t\t\t\t\tme11 = me[11];\n\t\t\tconst me12 = me[12],\n\t\t\t\t\t\tme13 = me[13],\n\t\t\t\t\t\tme14 = me[14],\n\t\t\t\t\t\tme15 = me[15];\n\t\t\tplanes[0].setComponents(me3 - me0, me7 - me4, me11 - me8, me15 - me12).normalize();\n\t\t\tplanes[1].setComponents(me3 + me0, me7 + me4, me11 + me8, me15 + me12).normalize();\n\t\t\tplanes[2].setComponents(me3 + me1, me7 + me5, me11 + me9, me15 + me13).normalize();\n\t\t\tplanes[3].setComponents(me3 - me1, me7 - me5, me11 - me9, me15 - me13).normalize();\n\t\t\tplanes[4].setComponents(me3 - me2, me7 - me6, me11 - me10, me15 - me14).normalize();\n\t\t\tplanes[5].setComponents(me3 + me2, me7 + me6, me11 + me10, me15 + me14).normalize();\n\t\t\treturn this;\n\t\t}\n\n\t\tintersectsObject(object) {\n\t\t\tconst geometry = object.geometry;\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$2.copy(geometry.boundingSphere).applyMatrix4(object.matrixWorld);\n\n\t\t\treturn this.intersectsSphere(_sphere$2);\n\t\t}\n\n\t\tintersectsSprite(sprite) {\n\t\t\t_sphere$2.center.set(0, 0, 0);\n\n\t\t\t_sphere$2.radius = 0.7071067811865476;\n\n\t\t\t_sphere$2.applyMatrix4(sprite.matrixWorld);\n\n\t\t\treturn this.intersectsSphere(_sphere$2);\n\t\t}\n\n\t\tintersectsSphere(sphere) {\n\t\t\tconst planes = this.planes;\n\t\t\tconst center = sphere.center;\n\t\t\tconst negRadius = -sphere.radius;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tconst distance = planes[i].distanceToPoint(center);\n\n\t\t\t\tif (distance < negRadius) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\tconst planes = this.planes;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tconst plane = planes[i]; // corner at max distance\n\n\t\t\t\t_vector$7.x = plane.normal.x > 0 ? box.max.x : box.min.x;\n\t\t\t\t_vector$7.y = plane.normal.y > 0 ? box.max.y : box.min.y;\n\t\t\t\t_vector$7.z = plane.normal.z > 0 ? box.max.z : box.min.z;\n\n\t\t\t\tif (plane.distanceToPoint(_vector$7) < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\tconst planes = this.planes;\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tif (planes[i].distanceToPoint(point) < 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tfunction WebGLAnimation() {\n\t\tlet context = null;\n\t\tlet isAnimating = false;\n\t\tlet animationLoop = null;\n\t\tlet requestId = null;\n\n\t\tfunction onAnimationFrame(time, frame) {\n\t\t\tanimationLoop(time, frame);\n\t\t\trequestId = context.requestAnimationFrame(onAnimationFrame);\n\t\t}\n\n\t\treturn {\n\t\t\tstart: function () {\n\t\t\t\tif (isAnimating === true) return;\n\t\t\t\tif (animationLoop === null) return;\n\t\t\t\trequestId = context.requestAnimationFrame(onAnimationFrame);\n\t\t\t\tisAnimating = true;\n\t\t\t},\n\t\t\tstop: function () {\n\t\t\t\tcontext.cancelAnimationFrame(requestId);\n\t\t\t\tisAnimating = false;\n\t\t\t},\n\t\t\tsetAnimationLoop: function (callback) {\n\t\t\t\tanimationLoop = callback;\n\t\t\t},\n\t\t\tsetContext: function (value) {\n\t\t\t\tcontext = value;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction WebGLAttributes(gl, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tconst buffers = new WeakMap();\n\n\t\tfunction createBuffer(attribute, bufferType) {\n\t\t\tconst array = attribute.array;\n\t\t\tconst usage = attribute.usage;\n\t\t\tconst buffer = gl.createBuffer();\n\t\t\tgl.bindBuffer(bufferType, buffer);\n\t\t\tgl.bufferData(bufferType, array, usage);\n\t\t\tattribute.onUploadCallback();\n\t\t\tlet type = gl.FLOAT;\n\n\t\t\tif (array instanceof Float32Array) {\n\t\t\t\ttype = gl.FLOAT;\n\t\t\t} else if (array instanceof Float64Array) {\n\t\t\t\tconsole.warn('THREE.WebGLAttributes: Unsupported data buffer format: Float64Array.');\n\t\t\t} else if (array instanceof Uint16Array) {\n\t\t\t\tif (attribute.isFloat16BufferAttribute) {\n\t\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t\ttype = gl.HALF_FLOAT;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttype = gl.UNSIGNED_SHORT;\n\t\t\t\t}\n\t\t\t} else if (array instanceof Int16Array) {\n\t\t\t\ttype = gl.SHORT;\n\t\t\t} else if (array instanceof Uint32Array) {\n\t\t\t\ttype = gl.UNSIGNED_INT;\n\t\t\t} else if (array instanceof Int32Array) {\n\t\t\t\ttype = gl.INT;\n\t\t\t} else if (array instanceof Int8Array) {\n\t\t\t\ttype = gl.BYTE;\n\t\t\t} else if (array instanceof Uint8Array) {\n\t\t\t\ttype = gl.UNSIGNED_BYTE;\n\t\t\t} else if (array instanceof Uint8ClampedArray) {\n\t\t\t\ttype = gl.UNSIGNED_BYTE;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tbuffer: buffer,\n\t\t\t\ttype: type,\n\t\t\t\tbytesPerElement: array.BYTES_PER_ELEMENT,\n\t\t\t\tversion: attribute.version\n\t\t\t};\n\t\t}\n\n\t\tfunction updateBuffer(buffer, attribute, bufferType) {\n\t\t\tconst array = attribute.array;\n\t\t\tconst updateRange = attribute.updateRange;\n\t\t\tgl.bindBuffer(bufferType, buffer);\n\n\t\t\tif (updateRange.count === -1) {\n\t\t\t\t// Not using update ranges\n\t\t\t\tgl.bufferSubData(bufferType, 0, array);\n\t\t\t} else {\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\tgl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array, updateRange.offset, updateRange.count);\n\t\t\t\t} else {\n\t\t\t\t\tgl.bufferSubData(bufferType, updateRange.offset * array.BYTES_PER_ELEMENT, array.subarray(updateRange.offset, updateRange.offset + updateRange.count));\n\t\t\t\t}\n\n\t\t\t\tupdateRange.count = -1; // reset range\n\t\t\t}\n\t\t} //\n\n\n\t\tfunction get(attribute) {\n\t\t\tif (attribute.isInterleavedBufferAttribute) attribute = attribute.data;\n\t\t\treturn buffers.get(attribute);\n\t\t}\n\n\t\tfunction remove(attribute) {\n\t\t\tif (attribute.isInterleavedBufferAttribute) attribute = attribute.data;\n\t\t\tconst data = buffers.get(attribute);\n\n\t\t\tif (data) {\n\t\t\t\tgl.deleteBuffer(data.buffer);\n\t\t\t\tbuffers.delete(attribute);\n\t\t\t}\n\t\t}\n\n\t\tfunction update(attribute, bufferType) {\n\t\t\tif (attribute.isGLBufferAttribute) {\n\t\t\t\tconst cached = buffers.get(attribute);\n\n\t\t\t\tif (!cached || cached.version < attribute.version) {\n\t\t\t\t\tbuffers.set(attribute, {\n\t\t\t\t\t\tbuffer: attribute.buffer,\n\t\t\t\t\t\ttype: attribute.type,\n\t\t\t\t\t\tbytesPerElement: attribute.elementSize,\n\t\t\t\t\t\tversion: attribute.version\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (attribute.isInterleavedBufferAttribute) attribute = attribute.data;\n\t\t\tconst data = buffers.get(attribute);\n\n\t\t\tif (data === undefined) {\n\t\t\t\tbuffers.set(attribute, createBuffer(attribute, bufferType));\n\t\t\t} else if (data.version < attribute.version) {\n\t\t\t\tupdateBuffer(data.buffer, attribute, bufferType);\n\t\t\t\tdata.version = attribute.version;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tremove: remove,\n\t\t\tupdate: update\n\t\t};\n\t}\n\n\tclass PlaneGeometry extends BufferGeometry {\n\t\tconstructor(width = 1, height = 1, widthSegments = 1, heightSegments = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PlaneGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\twidthSegments: widthSegments,\n\t\t\t\theightSegments: heightSegments\n\t\t\t};\n\t\t\tconst width_half = width / 2;\n\t\t\tconst height_half = height / 2;\n\t\t\tconst gridX = Math.floor(widthSegments);\n\t\t\tconst gridY = Math.floor(heightSegments);\n\t\t\tconst gridX1 = gridX + 1;\n\t\t\tconst gridY1 = gridY + 1;\n\t\t\tconst segment_width = width / gridX;\n\t\t\tconst segment_height = height / gridY; //\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = [];\n\n\t\t\tfor (let iy = 0; iy < gridY1; iy++) {\n\t\t\t\tconst y = iy * segment_height - height_half;\n\n\t\t\t\tfor (let ix = 0; ix < gridX1; ix++) {\n\t\t\t\t\tconst x = ix * segment_width - width_half;\n\t\t\t\t\tvertices.push(x, -y, 0);\n\t\t\t\t\tnormals.push(0, 0, 1);\n\t\t\t\t\tuvs.push(ix / gridX);\n\t\t\t\t\tuvs.push(1 - iy / gridY);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let iy = 0; iy < gridY; iy++) {\n\t\t\t\tfor (let ix = 0; ix < gridX; ix++) {\n\t\t\t\t\tconst a = ix + gridX1 * iy;\n\t\t\t\t\tconst b = ix + gridX1 * (iy + 1);\n\t\t\t\t\tconst c = ix + 1 + gridX1 * (iy + 1);\n\t\t\t\t\tconst d = ix + 1 + gridX1 * iy;\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new PlaneGeometry(data.width, data.height, data.widthSegments, data.heightSegments);\n\t\t}\n\n\t}\n\n\tvar alphamap_fragment = \"#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\\n#endif\";\n\n\tvar alphamap_pars_fragment = \"#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\n\tvar alphatest_fragment = \"#ifdef USE_ALPHATEST\\n\\tif ( diffuseColor.a < alphaTest ) discard;\\n#endif\";\n\n\tvar alphatest_pars_fragment = \"#ifdef USE_ALPHATEST\\n\\tuniform float alphaTest;\\n#endif\";\n\n\tvar aomap_fragment = \"#ifdef USE_AOMAP\\n\\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\\n\\treflectedLight.indirectDiffuse *= ambientOcclusion;\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD )\\n\\t\\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\\n\\t\\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );\\n\\t#endif\\n#endif\";\n\n\tvar aomap_pars_fragment = \"#ifdef USE_AOMAP\\n\\tuniform sampler2D aoMap;\\n\\tuniform float aoMapIntensity;\\n#endif\";\n\n\tvar begin_vertex = \"vec3 transformed = vec3( position );\";\n\n\tvar beginnormal_vertex = \"vec3 objectNormal = vec3( normal );\\n#ifdef USE_TANGENT\\n\\tvec3 objectTangent = vec3( tangent.xyz );\\n#endif\";\n\n\tvar bsdfs = \"vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\\n\\treturn RECIPROCAL_PI * diffuseColor;\\n}\\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\\n\\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\\n\\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\\n}\\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\\n\\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\\n\\treturn 0.5 / max( gv + gl, EPSILON );\\n}\\nfloat D_GGX( const in float alpha, const in float dotNH ) {\\n\\tfloat a2 = pow2( alpha );\\n\\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\\n\\treturn RECIPROCAL_PI * a2 / pow2( denom );\\n}\\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( f0, f90, dotVH );\\n\\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\\n\\tfloat D = D_GGX( alpha, dotNH );\\n\\treturn F * ( V * D );\\n}\\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\\n\\tconst float LUT_SIZE = 64.0;\\n\\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\\n\\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\\n\\tfloat dotNV = saturate( dot( N, V ) );\\n\\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\\n\\tuv = uv * LUT_SCALE + LUT_BIAS;\\n\\treturn uv;\\n}\\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\\n\\tfloat l = length( f );\\n\\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\\n}\\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\\n\\tfloat x = dot( v1, v2 );\\n\\tfloat y = abs( x );\\n\\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\\n\\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\\n\\tfloat v = a / b;\\n\\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\\n\\treturn cross( v1, v2 ) * theta_sintheta;\\n}\\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\\n\\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\\n\\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\\n\\tvec3 lightNormal = cross( v1, v2 );\\n\\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\\n\\tvec3 T1, T2;\\n\\tT1 = normalize( V - N * dot( V, N ) );\\n\\tT2 = - cross( N, T1 );\\n\\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\\n\\tvec3 coords[ 4 ];\\n\\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\\n\\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\\n\\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\\n\\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\\n\\tcoords[ 0 ] = normalize( coords[ 0 ] );\\n\\tcoords[ 1 ] = normalize( coords[ 1 ] );\\n\\tcoords[ 2 ] = normalize( coords[ 2 ] );\\n\\tcoords[ 3 ] = normalize( coords[ 3 ] );\\n\\tvec3 vectorFormFactor = vec3( 0.0 );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\\n\\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\\n\\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\\n\\treturn vec3( result );\\n}\\nfloat G_BlinnPhong_Implicit( ) {\\n\\treturn 0.25;\\n}\\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\\n\\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\\n}\\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\\n\\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\\n\\tfloat G = G_BlinnPhong_Implicit( );\\n\\tfloat D = D_BlinnPhong( shininess, dotNH );\\n\\treturn F * ( G * D );\\n}\\n#if defined( USE_SHEEN )\\nfloat D_Charlie( float roughness, float dotNH ) {\\n\\tfloat alpha = pow2( roughness );\\n\\tfloat invAlpha = 1.0 / alpha;\\n\\tfloat cos2h = dotNH * dotNH;\\n\\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\\n\\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\\n}\\nfloat V_Neubelt( float dotNV, float dotNL ) {\\n\\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\\n}\\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenTint, const in float sheenRoughness ) {\\n\\tvec3 halfDir = normalize( lightDir + viewDir );\\n\\tfloat dotNL = saturate( dot( normal, lightDir ) );\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tfloat dotNH = saturate( dot( normal, halfDir ) );\\n\\tfloat D = D_Charlie( sheenRoughness, dotNH );\\n\\tfloat V = V_Neubelt( dotNV, dotNL );\\n\\treturn sheenTint * ( D * V );\\n}\\n#endif\";\n\n\tvar bumpmap_pars_fragment = \"#ifdef USE_BUMPMAP\\n\\tuniform sampler2D bumpMap;\\n\\tuniform float bumpScale;\\n\\tvec2 dHdxy_fwd() {\\n\\t\\tvec2 dSTdx = dFdx( vUv );\\n\\t\\tvec2 dSTdy = dFdy( vUv );\\n\\t\\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\\n\\t\\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\\n\\t\\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\\n\\t\\treturn vec2( dBx, dBy );\\n\\t}\\n\\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\\n\\t\\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\\n\\t\\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\\n\\t\\tvec3 vN = surf_norm;\\n\\t\\tvec3 R1 = cross( vSigmaY, vN );\\n\\t\\tvec3 R2 = cross( vN, vSigmaX );\\n\\t\\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\\n\\t\\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\\n\\t\\treturn normalize( abs( fDet ) * surf_norm - vGrad );\\n\\t}\\n#endif\";\n\n\tvar clipping_planes_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvec4 plane;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\\n\\t\\tplane = clippingPlanes[ i ];\\n\\t\\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\\n\\t\\tbool clipped = true;\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\\n\\t\\t\\tplane = clippingPlanes[ i ];\\n\\t\\t\\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t\\tif ( clipped ) discard;\\n\\t#endif\\n#endif\";\n\n\tvar clipping_planes_pars_fragment = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n\\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\\n#endif\";\n\n\tvar clipping_planes_pars_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvarying vec3 vClipPosition;\\n#endif\";\n\n\tvar clipping_planes_vertex = \"#if NUM_CLIPPING_PLANES > 0\\n\\tvClipPosition = - mvPosition.xyz;\\n#endif\";\n\n\tvar color_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tdiffuseColor *= vColor;\\n#elif defined( USE_COLOR )\\n\\tdiffuseColor.rgb *= vColor;\\n#endif\";\n\n\tvar color_pars_fragment = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\n\tvar color_pars_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvarying vec4 vColor;\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvarying vec3 vColor;\\n#endif\";\n\n\tvar color_vertex = \"#if defined( USE_COLOR_ALPHA )\\n\\tvColor = vec4( 1.0 );\\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\\n\\tvColor = vec3( 1.0 );\\n#endif\\n#ifdef USE_COLOR\\n\\tvColor *= color;\\n#endif\\n#ifdef USE_INSTANCING_COLOR\\n\\tvColor.xyz *= instanceColor.xyz;\\n#endif\";\n\n\tvar common = \"#define PI 3.141592653589793\\n#define PI2 6.283185307179586\\n#define PI_HALF 1.5707963267948966\\n#define RECIPROCAL_PI 0.3183098861837907\\n#define RECIPROCAL_PI2 0.15915494309189535\\n#define EPSILON 1e-6\\n#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\\nfloat pow2( const in float x ) { return x*x; }\\nfloat pow3( const in float x ) { return x*x*x; }\\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\\nhighp float rand( const in vec2 uv ) {\\n\\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\\n\\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\\n\\treturn fract( sin( sn ) * c );\\n}\\n#ifdef HIGH_PRECISION\\n\\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\\n#else\\n\\tfloat precisionSafeLength( vec3 v ) {\\n\\t\\tfloat maxComponent = max3( abs( v ) );\\n\\t\\treturn length( v / maxComponent ) * maxComponent;\\n\\t}\\n#endif\\nstruct IncidentLight {\\n\\tvec3 color;\\n\\tvec3 direction;\\n\\tbool visible;\\n};\\nstruct ReflectedLight {\\n\\tvec3 directDiffuse;\\n\\tvec3 directSpecular;\\n\\tvec3 indirectDiffuse;\\n\\tvec3 indirectSpecular;\\n};\\nstruct GeometricContext {\\n\\tvec3 position;\\n\\tvec3 normal;\\n\\tvec3 viewDir;\\n#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal;\\n#endif\\n};\\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\\n}\\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\\n\\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\\n}\\nmat3 transposeMat3( const in mat3 m ) {\\n\\tmat3 tmp;\\n\\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\\n\\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\\n\\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\\n\\treturn tmp;\\n}\\nfloat linearToRelativeLuminance( const in vec3 color ) {\\n\\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\\n\\treturn dot( weights, color.rgb );\\n}\\nbool isPerspectiveMatrix( mat4 m ) {\\n\\treturn m[ 2 ][ 3 ] == - 1.0;\\n}\\nvec2 equirectUv( in vec3 dir ) {\\n\\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\\n\\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\\n\\treturn vec2( u, v );\\n}\";\n\n\tvar cube_uv_reflection_fragment = \"#ifdef ENVMAP_TYPE_CUBE_UV\\n\\t#define cubeUV_maxMipLevel 8.0\\n\\t#define cubeUV_minMipLevel 4.0\\n\\t#define cubeUV_maxTileSize 256.0\\n\\t#define cubeUV_minTileSize 16.0\\n\\tfloat getFace( vec3 direction ) {\\n\\t\\tvec3 absDirection = abs( direction );\\n\\t\\tfloat face = - 1.0;\\n\\t\\tif ( absDirection.x > absDirection.z ) {\\n\\t\\t\\tif ( absDirection.x > absDirection.y )\\n\\t\\t\\t\\tface = direction.x > 0.0 ? 0.0 : 3.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t} else {\\n\\t\\t\\tif ( absDirection.z > absDirection.y )\\n\\t\\t\\t\\tface = direction.z > 0.0 ? 2.0 : 5.0;\\n\\t\\t\\telse\\n\\t\\t\\t\\tface = direction.y > 0.0 ? 1.0 : 4.0;\\n\\t\\t}\\n\\t\\treturn face;\\n\\t}\\n\\tvec2 getUV( vec3 direction, float face ) {\\n\\t\\tvec2 uv;\\n\\t\\tif ( face == 0.0 ) {\\n\\t\\t\\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 1.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\\n\\t\\t} else if ( face == 2.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\\n\\t\\t} else if ( face == 3.0 ) {\\n\\t\\t\\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\\n\\t\\t} else if ( face == 4.0 ) {\\n\\t\\t\\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\\n\\t\\t} else {\\n\\t\\t\\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\\n\\t\\t}\\n\\t\\treturn 0.5 * ( uv + 1.0 );\\n\\t}\\n\\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\\n\\t\\tfloat face = getFace( direction );\\n\\t\\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\\n\\t\\tmipInt = max( mipInt, cubeUV_minMipLevel );\\n\\t\\tfloat faceSize = exp2( mipInt );\\n\\t\\tfloat texelSize = 1.0 / ( 3.0 * cubeUV_maxTileSize );\\n\\t\\tvec2 uv = getUV( direction, face ) * ( faceSize - 1.0 );\\n\\t\\tvec2 f = fract( uv );\\n\\t\\tuv += 0.5 - f;\\n\\t\\tif ( face > 2.0 ) {\\n\\t\\t\\tuv.y += faceSize;\\n\\t\\t\\tface -= 3.0;\\n\\t\\t}\\n\\t\\tuv.x += face * faceSize;\\n\\t\\tif ( mipInt < cubeUV_maxMipLevel ) {\\n\\t\\t\\tuv.y += 2.0 * cubeUV_maxTileSize;\\n\\t\\t}\\n\\t\\tuv.y += filterInt * 2.0 * cubeUV_minTileSize;\\n\\t\\tuv.x += 3.0 * max( 0.0, cubeUV_maxTileSize - 2.0 * faceSize );\\n\\t\\tuv *= texelSize;\\n\\t\\tvec3 tl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.x += texelSize;\\n\\t\\tvec3 tr = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.y += texelSize;\\n\\t\\tvec3 br = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tuv.x -= texelSize;\\n\\t\\tvec3 bl = envMapTexelToLinear( texture2D( envMap, uv ) ).rgb;\\n\\t\\tvec3 tm = mix( tl, tr, f.x );\\n\\t\\tvec3 bm = mix( bl, br, f.x );\\n\\t\\treturn mix( tm, bm, f.y );\\n\\t}\\n\\t#define r0 1.0\\n\\t#define v0 0.339\\n\\t#define m0 - 2.0\\n\\t#define r1 0.8\\n\\t#define v1 0.276\\n\\t#define m1 - 1.0\\n\\t#define r4 0.4\\n\\t#define v4 0.046\\n\\t#define m4 2.0\\n\\t#define r5 0.305\\n\\t#define v5 0.016\\n\\t#define m5 3.0\\n\\t#define r6 0.21\\n\\t#define v6 0.0038\\n\\t#define m6 4.0\\n\\tfloat roughnessToMip( float roughness ) {\\n\\t\\tfloat mip = 0.0;\\n\\t\\tif ( roughness >= r1 ) {\\n\\t\\t\\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\\n\\t\\t} else if ( roughness >= r4 ) {\\n\\t\\t\\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\\n\\t\\t} else if ( roughness >= r5 ) {\\n\\t\\t\\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\\n\\t\\t} else if ( roughness >= r6 ) {\\n\\t\\t\\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\\n\\t\\t} else {\\n\\t\\t\\tmip = - 2.0 * log2( 1.16 * roughness );\\t\\t}\\n\\t\\treturn mip;\\n\\t}\\n\\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\\n\\t\\tfloat mip = clamp( roughnessToMip( roughness ), m0, cubeUV_maxMipLevel );\\n\\t\\tfloat mipF = fract( mip );\\n\\t\\tfloat mipInt = floor( mip );\\n\\t\\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\\n\\t\\tif ( mipF == 0.0 ) {\\n\\t\\t\\treturn vec4( color0, 1.0 );\\n\\t\\t} else {\\n\\t\\t\\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\\n\\t\\t\\treturn vec4( mix( color0, color1, mipF ), 1.0 );\\n\\t\\t}\\n\\t}\\n#endif\";\n\n\tvar defaultnormal_vertex = \"vec3 transformedNormal = objectNormal;\\n#ifdef USE_INSTANCING\\n\\tmat3 m = mat3( instanceMatrix );\\n\\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\\n\\ttransformedNormal = m * transformedNormal;\\n#endif\\ntransformedNormal = normalMatrix * transformedNormal;\\n#ifdef FLIP_SIDED\\n\\ttransformedNormal = - transformedNormal;\\n#endif\\n#ifdef USE_TANGENT\\n\\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#ifdef FLIP_SIDED\\n\\t\\ttransformedTangent = - transformedTangent;\\n\\t#endif\\n#endif\";\n\n\tvar displacementmap_pars_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\tuniform sampler2D displacementMap;\\n\\tuniform float displacementScale;\\n\\tuniform float displacementBias;\\n#endif\";\n\n\tvar displacementmap_vertex = \"#ifdef USE_DISPLACEMENTMAP\\n\\ttransformed += normalize( objectNormal ) * ( texture2D( displacementMap, vUv ).x * displacementScale + displacementBias );\\n#endif\";\n\n\tvar emissivemap_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\\n\\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\\n\\ttotalEmissiveRadiance *= emissiveColor.rgb;\\n#endif\";\n\n\tvar emissivemap_pars_fragment = \"#ifdef USE_EMISSIVEMAP\\n\\tuniform sampler2D emissiveMap;\\n#endif\";\n\n\tvar encodings_fragment = \"gl_FragColor = linearToOutputTexel( gl_FragColor );\";\n\n\tvar encodings_pars_fragment = \"\\nvec4 LinearToLinear( in vec4 value ) {\\n\\treturn value;\\n}\\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.rgb, vec3( gammaFactor ) ), value.a );\\n}\\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\\n\\treturn vec4( pow( value.rgb, vec3( 1.0 / gammaFactor ) ), value.a );\\n}\\nvec4 sRGBToLinear( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );\\n}\\nvec4 LinearTosRGB( in vec4 value ) {\\n\\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\\n}\\nvec4 RGBEToLinear( in vec4 value ) {\\n\\treturn vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\\n}\\nvec4 LinearToRGBE( in vec4 value ) {\\n\\tfloat maxComponent = max( max( value.r, value.g ), value.b );\\n\\tfloat fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\\n\\treturn vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\\n}\\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * value.a * maxRange, 1.0 );\\n}\\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\\n\\tfloat M = clamp( maxRGB / maxRange, 0.0, 1.0 );\\n\\tM = ceil( M * 255.0 ) / 255.0;\\n\\treturn vec4( value.rgb / ( M * maxRange ), M );\\n}\\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\\n\\treturn vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\\n}\\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\\n\\tfloat maxRGB = max( value.r, max( value.g, value.b ) );\\n\\tfloat D = max( maxRange / maxRGB, 1.0 );\\n\\tD = clamp( floor( D ) / 255.0, 0.0, 1.0 );\\n\\treturn vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\\n}\\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\\nvec4 LinearToLogLuv( in vec4 value ) {\\n\\tvec3 Xp_Y_XYZp = cLogLuvM * value.rgb;\\n\\tXp_Y_XYZp = max( Xp_Y_XYZp, vec3( 1e-6, 1e-6, 1e-6 ) );\\n\\tvec4 vResult;\\n\\tvResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\\n\\tfloat Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\\n\\tvResult.w = fract( Le );\\n\\tvResult.z = ( Le - ( floor( vResult.w * 255.0 ) ) / 255.0 ) / 255.0;\\n\\treturn vResult;\\n}\\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\\nvec4 LogLuvToLinear( in vec4 value ) {\\n\\tfloat Le = value.z * 255.0 + value.w;\\n\\tvec3 Xp_Y_XYZp;\\n\\tXp_Y_XYZp.y = exp2( ( Le - 127.0 ) / 2.0 );\\n\\tXp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\\n\\tXp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\\n\\tvec3 vRGB = cLogLuvInverseM * Xp_Y_XYZp.rgb;\\n\\treturn vec4( max( vRGB, 0.0 ), 1.0 );\\n}\";\n\n\tvar envmap_fragment = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvec3 cameraToFrag;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#else\\n\\t\\tvec3 reflectVec = vReflect;\\n\\t#endif\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\\n\\t\\tenvColor = envMapTexelToLinear( envColor );\\n\\t#elif defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\\n\\t#else\\n\\t\\tvec4 envColor = vec4( 0.0 );\\n\\t#endif\\n\\t#ifdef ENVMAP_BLENDING_MULTIPLY\\n\\t\\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_MIX )\\n\\t\\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\\n\\t#elif defined( ENVMAP_BLENDING_ADD )\\n\\t\\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\\n\\t#endif\\n#endif\";\n\n\tvar envmap_common_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float envMapIntensity;\\n\\tuniform float flipEnvMap;\\n\\tuniform int maxMipLevel;\\n\\t#ifdef ENVMAP_TYPE_CUBE\\n\\t\\tuniform samplerCube envMap;\\n\\t#else\\n\\t\\tuniform sampler2D envMap;\\n\\t#endif\\n\\t\\n#endif\";\n\n\tvar envmap_pars_fragment = \"#ifdef USE_ENVMAP\\n\\tuniform float reflectivity;\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t\\tuniform float refractionRatio;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t#endif\\n#endif\";\n\n\tvar envmap_pars_vertex = \"#ifdef USE_ENVMAP\\n\\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) ||defined( PHONG )\\n\\t\\t#define ENV_WORLDPOS\\n\\t#endif\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\t\\n\\t\\tvarying vec3 vWorldPosition;\\n\\t#else\\n\\t\\tvarying vec3 vReflect;\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n#endif\";\n\n\tvar envmap_vertex = \"#ifdef USE_ENVMAP\\n\\t#ifdef ENV_WORLDPOS\\n\\t\\tvWorldPosition = worldPosition.xyz;\\n\\t#else\\n\\t\\tvec3 cameraToVertex;\\n\\t\\tif ( isOrthographic ) {\\n\\t\\t\\tcameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\\n\\t\\t} else {\\n\\t\\t\\tcameraToVertex = normalize( worldPosition.xyz - cameraPosition );\\n\\t\\t}\\n\\t\\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\tvReflect = reflect( cameraToVertex, worldNormal );\\n\\t\\t#else\\n\\t\\t\\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\n\tvar fog_vertex = \"#ifdef USE_FOG\\n\\tvFogDepth = - mvPosition.z;\\n#endif\";\n\n\tvar fog_pars_vertex = \"#ifdef USE_FOG\\n\\tvarying float vFogDepth;\\n#endif\";\n\n\tvar fog_fragment = \"#ifdef USE_FOG\\n\\t#ifdef FOG_EXP2\\n\\t\\tfloat fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );\\n\\t#else\\n\\t\\tfloat fogFactor = smoothstep( fogNear, fogFar, vFogDepth );\\n\\t#endif\\n\\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\\n#endif\";\n\n\tvar fog_pars_fragment = \"#ifdef USE_FOG\\n\\tuniform vec3 fogColor;\\n\\tvarying float vFogDepth;\\n\\t#ifdef FOG_EXP2\\n\\t\\tuniform float fogDensity;\\n\\t#else\\n\\t\\tuniform float fogNear;\\n\\t\\tuniform float fogFar;\\n\\t#endif\\n#endif\";\n\n\tvar gradientmap_pars_fragment = \"#ifdef USE_GRADIENTMAP\\n\\tuniform sampler2D gradientMap;\\n#endif\\nvec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {\\n\\tfloat dotNL = dot( normal, lightDirection );\\n\\tvec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );\\n\\t#ifdef USE_GRADIENTMAP\\n\\t\\treturn texture2D( gradientMap, coord ).rgb;\\n\\t#else\\n\\t\\treturn ( coord.x < 0.7 ) ? vec3( 0.7 ) : vec3( 1.0 );\\n\\t#endif\\n}\";\n\n\tvar lightmap_fragment = \"#ifdef USE_LIGHTMAP\\n\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\tlightMapIrradiance *= PI;\\n\\t#endif\\n\\treflectedLight.indirectDiffuse += lightMapIrradiance;\\n#endif\";\n\n\tvar lightmap_pars_fragment = \"#ifdef USE_LIGHTMAP\\n\\tuniform sampler2D lightMap;\\n\\tuniform float lightMapIntensity;\\n#endif\";\n\n\tvar lights_lambert_vertex = \"vec3 diffuse = vec3( 1.0 );\\nGeometricContext geometry;\\ngeometry.position = mvPosition.xyz;\\ngeometry.normal = normalize( transformedNormal );\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( -mvPosition.xyz );\\nGeometricContext backGeometry;\\nbackGeometry.position = geometry.position;\\nbackGeometry.normal = -geometry.normal;\\nbackGeometry.viewDir = geometry.viewDir;\\nvLightFront = vec3( 0.0 );\\nvIndirectFront = vec3( 0.0 );\\n#ifdef DOUBLE_SIDED\\n\\tvLightBack = vec3( 0.0 );\\n\\tvIndirectBack = vec3( 0.0 );\\n#endif\\nIncidentLight directLight;\\nfloat dotNL;\\nvec3 directLightColor_Diffuse;\\nvIndirectFront += getAmbientLightIrradiance( ambientLightColor );\\nvIndirectFront += getLightProbeIrradiance( lightProbe, geometry.normal );\\n#ifdef DOUBLE_SIDED\\n\\tvIndirectBack += getAmbientLightIrradiance( ambientLightColor );\\n\\tvIndirectBack += getLightProbeIrradiance( lightProbe, backGeometry.normal );\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tgetPointLightInfo( pointLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tgetSpotLightInfo( spotLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_DIR_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tgetDirectionalLightInfo( directionalLights[ i ], geometry, directLight );\\n\\t\\tdotNL = dot( geometry.normal, directLight.direction );\\n\\t\\tdirectLightColor_Diffuse = directLight.color;\\n\\t\\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvLightBack += saturate( - dotNL ) * directLightColor_Diffuse;\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\tvIndirectFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\tvIndirectBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry.normal );\\n\\t\\t#endif\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\";\n\n\tvar lights_pars_begin = \"uniform bool receiveShadow;\\nuniform vec3 ambientLightColor;\\nuniform vec3 lightProbe[ 9 ];\\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\\n\\tfloat x = normal.x, y = normal.y, z = normal.z;\\n\\tvec3 result = shCoefficients[ 0 ] * 0.886227;\\n\\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\\n\\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\\n\\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\\n\\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\\n\\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\\n\\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\\n\\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\\n\\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\\n\\treturn result;\\n}\\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\\n\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\\n\\treturn irradiance;\\n}\\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\\n\\tvec3 irradiance = ambientLightColor;\\n\\treturn irradiance;\\n}\\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\\n\\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\\n\\t\\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\\n\\t\\tif ( cutoffDistance > 0.0 ) {\\n\\t\\t\\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\\n\\t\\t}\\n\\t\\treturn distanceFalloff;\\n\\t#else\\n\\t\\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\\n\\t\\t\\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\\n\\t\\t}\\n\\t\\treturn 1.0;\\n\\t#endif\\n}\\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\\n\\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\\n}\\n#if NUM_DIR_LIGHTS > 0\\n\\tstruct DirectionalLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t};\\n\\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\\n\\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tlight.color = directionalLight.color;\\n\\t\\tlight.direction = directionalLight.direction;\\n\\t\\tlight.visible = true;\\n\\t}\\n#endif\\n#if NUM_POINT_LIGHTS > 0\\n\\tstruct PointLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t};\\n\\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\\n\\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = pointLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat lightDistance = length( lVector );\\n\\t\\tlight.color = pointLight.color;\\n\\t\\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\\n\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t}\\n#endif\\n#if NUM_SPOT_LIGHTS > 0\\n\\tstruct SpotLight {\\n\\t\\tvec3 position;\\n\\t\\tvec3 direction;\\n\\t\\tvec3 color;\\n\\t\\tfloat distance;\\n\\t\\tfloat decay;\\n\\t\\tfloat coneCos;\\n\\t\\tfloat penumbraCos;\\n\\t};\\n\\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\\n\\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\\n\\t\\tvec3 lVector = spotLight.position - geometry.position;\\n\\t\\tlight.direction = normalize( lVector );\\n\\t\\tfloat angleCos = dot( light.direction, spotLight.direction );\\n\\t\\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\\n\\t\\tif ( spotAttenuation > 0.0 ) {\\n\\t\\t\\tfloat lightDistance = length( lVector );\\n\\t\\t\\tlight.color = spotLight.color * spotAttenuation;\\n\\t\\t\\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\\n\\t\\t\\tlight.visible = ( light.color != vec3( 0.0 ) );\\n\\t\\t} else {\\n\\t\\t\\tlight.color = vec3( 0.0 );\\n\\t\\t\\tlight.visible = false;\\n\\t\\t}\\n\\t}\\n#endif\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tstruct RectAreaLight {\\n\\t\\tvec3 color;\\n\\t\\tvec3 position;\\n\\t\\tvec3 halfWidth;\\n\\t\\tvec3 halfHeight;\\n\\t};\\n\\tuniform sampler2D ltc_1;\\tuniform sampler2D ltc_2;\\n\\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\\n#endif\\n#if NUM_HEMI_LIGHTS > 0\\n\\tstruct HemisphereLight {\\n\\t\\tvec3 direction;\\n\\t\\tvec3 skyColor;\\n\\t\\tvec3 groundColor;\\n\\t};\\n\\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\\n\\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\\n\\t\\tfloat dotNL = dot( normal, hemiLight.direction );\\n\\t\\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\\n\\t\\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\\n\\t\\treturn irradiance;\\n\\t}\\n#endif\";\n\n\tvar envmap_physical_pars_fragment = \"#if defined( USE_ENVMAP )\\n\\t#ifdef ENVMAP_MODE_REFRACTION\\n\\t\\tuniform float refractionRatio;\\n\\t#endif\\n\\tvec3 getIBLIrradiance( const in vec3 normal ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\\n\\t\\t\\treturn PI * envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\\n\\t\\t#if defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\t\\tvec3 reflectVec;\\n\\t\\t\\t#ifdef ENVMAP_MODE_REFLECTION\\n\\t\\t\\t\\treflectVec = reflect( - viewDir, normal );\\n\\t\\t\\t\\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\\n\\t\\t\\t#else\\n\\t\\t\\t\\treflectVec = refract( - viewDir, normal, refractionRatio );\\n\\t\\t\\t#endif\\n\\t\\t\\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\\n\\t\\t\\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\\n\\t\\t\\treturn envMapColor.rgb * envMapIntensity;\\n\\t\\t#else\\n\\t\\t\\treturn vec3( 0.0 );\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\n\tvar lights_toon_fragment = \"ToonMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\";\n\n\tvar lights_toon_pars_fragment = \"varying vec3 vViewPosition;\\nstruct ToonMaterial {\\n\\tvec3 diffuseColor;\\n};\\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Toon\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Toon\\n#define Material_LightProbeLOD( material )\\t(0)\";\n\n\tvar lights_phong_fragment = \"BlinnPhongMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb;\\nmaterial.specularColor = specular;\\nmaterial.specularShininess = shininess;\\nmaterial.specularStrength = specularStrength;\";\n\n\tvar lights_phong_pars_fragment = \"varying vec3 vViewPosition;\\nstruct BlinnPhongMaterial {\\n\\tvec3 diffuseColor;\\n\\tvec3 specularColor;\\n\\tfloat specularShininess;\\n\\tfloat specularStrength;\\n};\\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n\\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\\n}\\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_BlinnPhong\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_BlinnPhong\\n#define Material_LightProbeLOD( material )\\t(0)\";\n\n\tvar lights_physical_fragment = \"PhysicalMaterial material;\\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\\nmaterial.roughness = min( material.roughness, 1.0 );\\n#ifdef IOR\\n\\t#ifdef SPECULAR\\n\\t\\tfloat specularIntensityFactor = specularIntensity;\\n\\t\\tvec3 specularTintFactor = specularTint;\\n\\t\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\t\\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\\n\\t\\t#endif\\n\\t\\t#ifdef USE_SPECULARTINTMAP\\n\\t\\t\\tspecularTintFactor *= specularTintMapTexelToLinear( texture2D( specularTintMap, vUv ) ).rgb;\\n\\t\\t#endif\\n\\t\\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\\n\\t#else\\n\\t\\tfloat specularIntensityFactor = 1.0;\\n\\t\\tvec3 specularTintFactor = vec3( 1.0 );\\n\\t\\tmaterial.specularF90 = 1.0;\\n\\t#endif\\n\\tmaterial.specularColor = mix( min( pow2( ( ior - 1.0 ) / ( ior + 1.0 ) ) * specularTintFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\\n#else\\n\\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\\n\\tmaterial.specularF90 = 1.0;\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tmaterial.clearcoat = clearcoat;\\n\\tmaterial.clearcoatRoughness = clearcoatRoughness;\\n\\tmaterial.clearcoatF0 = vec3( 0.04 );\\n\\tmaterial.clearcoatF90 = 1.0;\\n\\t#ifdef USE_CLEARCOATMAP\\n\\t\\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\\n\\t#endif\\n\\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\t\\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\\n\\t#endif\\n\\tmaterial.clearcoat = saturate( material.clearcoat );\\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\\n\\tmaterial.clearcoatRoughness += geometryRoughness;\\n\\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\\n#endif\\n#ifdef USE_SHEEN\\n\\tmaterial.sheenTint = sheenTint;\\n\\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\\n#endif\";\n\n\tvar lights_physical_pars_fragment = \"struct PhysicalMaterial {\\n\\tvec3 diffuseColor;\\n\\tfloat roughness;\\n\\tvec3 specularColor;\\n\\tfloat specularF90;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat clearcoat;\\n\\t\\tfloat clearcoatRoughness;\\n\\t\\tvec3 clearcoatF0;\\n\\t\\tfloat clearcoatF90;\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\tvec3 sheenTint;\\n\\t\\tfloat sheenRoughness;\\n\\t#endif\\n};\\nvec3 clearcoatSpecular = vec3( 0.0 );\\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\\n\\tfloat dotNV = saturate( dot( normal, viewDir ) );\\n\\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\\n\\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\\n\\tvec4 r = roughness * c0 + c1;\\n\\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\\n\\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\\n\\treturn fab;\\n}\\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\treturn specularColor * fab.x + specularF90 * fab.y;\\n}\\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\\n\\tvec2 fab = DFGApprox( normal, viewDir, roughness );\\n\\tvec3 FssEss = specularColor * fab.x + specularF90 * fab.y;\\n\\tfloat Ess = fab.x + fab.y;\\n\\tfloat Ems = 1.0 - Ess;\\n\\tvec3 Favg = specularColor + ( 1.0 - specularColor ) * 0.047619;\\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\\n\\tsingleScatter += FssEss;\\n\\tmultiScatter += Fms * Ems;\\n}\\n#if NUM_RECT_AREA_LIGHTS > 0\\n\\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\t\\tvec3 normal = geometry.normal;\\n\\t\\tvec3 viewDir = geometry.viewDir;\\n\\t\\tvec3 position = geometry.position;\\n\\t\\tvec3 lightPos = rectAreaLight.position;\\n\\t\\tvec3 halfWidth = rectAreaLight.halfWidth;\\n\\t\\tvec3 halfHeight = rectAreaLight.halfHeight;\\n\\t\\tvec3 lightColor = rectAreaLight.color;\\n\\t\\tfloat roughness = material.roughness;\\n\\t\\tvec3 rectCoords[ 4 ];\\n\\t\\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\\t\\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\\n\\t\\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\\n\\t\\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\\n\\t\\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\\n\\t\\tvec4 t1 = texture2D( ltc_1, uv );\\n\\t\\tvec4 t2 = texture2D( ltc_2, uv );\\n\\t\\tmat3 mInv = mat3(\\n\\t\\t\\tvec3( t1.x, 0, t1.y ),\\n\\t\\t\\tvec3(\t\t0, 1,\t\t0 ),\\n\\t\\t\\tvec3( t1.z, 0, t1.w )\\n\\t\\t);\\n\\t\\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\\n\\t\\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\\n\\t\\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\\n\\t}\\n#endif\\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\\n\\tvec3 irradiance = dotNL * directLight.color;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\\n\\t\\tvec3 ccIrradiance = dotNLcc * directLight.color;\\n\\t\\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\t#ifdef USE_SHEEN\\n\\t\\treflectedLight.directSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenTint, material.sheenRoughness );\\n\\t#endif\\n\\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\\n\\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\\n\\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\\n}\\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\\n\\t#endif\\n\\tvec3 singleScattering = vec3( 0.0 );\\n\\tvec3 multiScattering = vec3( 0.0 );\\n\\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\\n\\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\\n\\tvec3 diffuse = material.diffuseColor * ( 1.0 - ( singleScattering + multiScattering ) );\\n\\treflectedLight.indirectSpecular += radiance * singleScattering;\\n\\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\\n\\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\\n}\\n#define RE_Direct\\t\\t\\t\\tRE_Direct_Physical\\n#define RE_Direct_RectArea\\t\\tRE_Direct_RectArea_Physical\\n#define RE_IndirectDiffuse\\t\\tRE_IndirectDiffuse_Physical\\n#define RE_IndirectSpecular\\t\\tRE_IndirectSpecular_Physical\\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\\n\\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\\n}\";\n\n\tvar lights_fragment_begin = \"\\nGeometricContext geometry;\\ngeometry.position = - vViewPosition;\\ngeometry.normal = normal;\\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\\n#ifdef USE_CLEARCOAT\\n\\tgeometry.clearcoatNormal = clearcoatNormal;\\n#endif\\nIncidentLight directLight;\\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tPointLight pointLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\\n\\t\\tpointLight = pointLights[ i ];\\n\\t\\tgetPointLightInfo( pointLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\\n\\t\\tpointLightShadow = pointLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tSpotLight spotLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\\n\\t\\tspotLight = spotLights[ i ];\\n\\t\\tgetSpotLightInfo( spotLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\\n\\t\\tspotLightShadow = spotLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\\n\\tDirectionalLight directionalLight;\\n\\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLightShadow;\\n\\t#endif\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLights[ i ];\\n\\t\\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\\n\\t\\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\\n\\t\\tdirectionalLightShadow = directionalLightShadows[ i ];\\n\\t\\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t\\t#endif\\n\\t\\tRE_Direct( directLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\\n\\tRectAreaLight rectAreaLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\\n\\t\\trectAreaLight = rectAreaLights[ i ];\\n\\t\\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\\n\\t}\\n\\t#pragma unroll_loop_end\\n#endif\\n#if defined( RE_IndirectDiffuse )\\n\\tvec3 iblIrradiance = vec3( 0.0 );\\n\\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\\n\\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\\n\\t#if ( NUM_HEMI_LIGHTS > 0 )\\n\\t\\t#pragma unroll_loop_start\\n\\t\\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\\n\\t\\t\\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\\n\\t\\t}\\n\\t\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tvec3 radiance = vec3( 0.0 );\\n\\tvec3 clearcoatRadiance = vec3( 0.0 );\\n#endif\";\n\n\tvar lights_fragment_maps = \"#if defined( RE_IndirectDiffuse )\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\\n\\t\\tvec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t\\t#ifndef PHYSICALLY_CORRECT_LIGHTS\\n\\t\\t\\tlightMapIrradiance *= PI;\\n\\t\\t#endif\\n\\t\\tirradiance += lightMapIrradiance;\\n\\t#endif\\n\\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\\n\\t\\tiblIrradiance += getIBLIrradiance( geometry.normal );\\n\\t#endif\\n#endif\\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\\n\\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\\n\\t#endif\\n#endif\";\n\n\tvar lights_fragment_end = \"#if defined( RE_IndirectDiffuse )\\n\\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\\n#endif\\n#if defined( RE_IndirectSpecular )\\n\\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\\n#endif\";\n\n\tvar logdepthbuf_fragment = \"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tgl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;\\n#endif\";\n\n\tvar logdepthbuf_pars_fragment = \"#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT )\\n\\tuniform float logDepthBufFC;\\n\\tvarying float vFragDepth;\\n\\tvarying float vIsPerspective;\\n#endif\";\n\n\tvar logdepthbuf_pars_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvarying float vFragDepth;\\n\\t\\tvarying float vIsPerspective;\\n\\t#else\\n\\t\\tuniform float logDepthBufFC;\\n\\t#endif\\n#endif\";\n\n\tvar logdepthbuf_vertex = \"#ifdef USE_LOGDEPTHBUF\\n\\t#ifdef USE_LOGDEPTHBUF_EXT\\n\\t\\tvFragDepth = 1.0 + gl_Position.w;\\n\\t\\tvIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );\\n\\t#else\\n\\t\\tif ( isPerspectiveMatrix( projectionMatrix ) ) {\\n\\t\\t\\tgl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0;\\n\\t\\t\\tgl_Position.z *= gl_Position.w;\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\n\tvar map_fragment = \"#ifdef USE_MAP\\n\\tvec4 texelColor = texture2D( map, vUv );\\n\\ttexelColor = mapTexelToLinear( texelColor );\\n\\tdiffuseColor *= texelColor;\\n#endif\";\n\n\tvar map_pars_fragment = \"#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\";\n\n\tvar map_particle_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tvec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;\\n#endif\\n#ifdef USE_MAP\\n\\tvec4 mapTexel = texture2D( map, uv );\\n\\tdiffuseColor *= mapTexelToLinear( mapTexel );\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tdiffuseColor.a *= texture2D( alphaMap, uv ).g;\\n#endif\";\n\n\tvar map_particle_pars_fragment = \"#if defined( USE_MAP ) || defined( USE_ALPHAMAP )\\n\\tuniform mat3 uvTransform;\\n#endif\\n#ifdef USE_MAP\\n\\tuniform sampler2D map;\\n#endif\\n#ifdef USE_ALPHAMAP\\n\\tuniform sampler2D alphaMap;\\n#endif\";\n\n\tvar metalnessmap_fragment = \"float metalnessFactor = metalness;\\n#ifdef USE_METALNESSMAP\\n\\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\\n\\tmetalnessFactor *= texelMetalness.b;\\n#endif\";\n\n\tvar metalnessmap_pars_fragment = \"#ifdef USE_METALNESSMAP\\n\\tuniform sampler2D metalnessMap;\\n#endif\";\n\n\tvar morphnormal_vertex = \"#ifdef USE_MORPHNORMALS\\n\\tobjectNormal *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t}\\n\\t#else\\n\\t\\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\\n\\t\\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\\n\\t\\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\\n\\t\\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\\n\\t#endif\\n#endif\";\n\n\tvar morphtarget_pars_vertex = \"#ifdef USE_MORPHTARGETS\\n\\tuniform float morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\\n\\t\\tuniform sampler2DArray morphTargetsTexture;\\n\\t\\tuniform vec2 morphTargetsTextureSize;\\n\\t\\tvec3 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset, const in int stride ) {\\n\\t\\t\\tfloat texelIndex = float( vertexIndex * stride + offset );\\n\\t\\t\\tfloat y = floor( texelIndex / morphTargetsTextureSize.x );\\n\\t\\t\\tfloat x = texelIndex - y * morphTargetsTextureSize.x;\\n\\t\\t\\tvec3 morphUV = vec3( ( x + 0.5 ) / morphTargetsTextureSize.x, y / morphTargetsTextureSize.y, morphTargetIndex );\\n\\t\\t\\treturn texture( morphTargetsTexture, morphUV ).xyz;\\n\\t\\t}\\n\\t#else\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\tuniform float morphTargetInfluences[ 8 ];\\n\\t\\t#else\\n\\t\\t\\tuniform float morphTargetInfluences[ 4 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\n\tvar morphtarget_vertex = \"#ifdef USE_MORPHTARGETS\\n\\ttransformed *= morphTargetBaseInfluence;\\n\\t#ifdef MORPHTARGETS_TEXTURE\\n\\t\\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\\n\\t\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 1 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#else\\n\\t\\t\\t\\tif ( morphTargetInfluences[ i ] > 0.0 ) transformed += getMorph( gl_VertexID, i, 0, 2 ) * morphTargetInfluences[ i ];\\n\\t\\t\\t#endif\\n\\t\\t}\\n\\t#else\\n\\t\\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\\n\\t\\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\\n\\t\\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\\n\\t\\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\\n\\t\\t#ifndef USE_MORPHNORMALS\\n\\t\\t\\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\\n\\t\\t\\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\\n\\t\\t\\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\\n\\t\\t\\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\\n\\t\\t#endif\\n\\t#endif\\n#endif\";\n\n\tvar normal_fragment_begin = \"float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\\n#ifdef FLAT_SHADED\\n\\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\\n\\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\\n\\tvec3 normal = normalize( cross( fdx, fdy ) );\\n#else\\n\\tvec3 normal = normalize( vNormal );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\t#ifdef USE_TANGENT\\n\\t\\tvec3 tangent = normalize( vTangent );\\n\\t\\tvec3 bitangent = normalize( vBitangent );\\n\\t\\t#ifdef DOUBLE_SIDED\\n\\t\\t\\ttangent = tangent * faceDirection;\\n\\t\\t\\tbitangent = bitangent * faceDirection;\\n\\t\\t#endif\\n\\t\\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\\n\\t\\t\\tmat3 vTBN = mat3( tangent, bitangent, normal );\\n\\t\\t#endif\\n\\t#endif\\n#endif\\nvec3 geometryNormal = normal;\";\n\n\tvar normal_fragment_maps = \"#ifdef OBJECTSPACE_NORMALMAP\\n\\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\t#ifdef FLIP_SIDED\\n\\t\\tnormal = - normal;\\n\\t#endif\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\tnormal = normal * faceDirection;\\n\\t#endif\\n\\tnormal = normalize( normalMatrix * normal );\\n#elif defined( TANGENTSPACE_NORMALMAP )\\n\\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tmapN.xy *= normalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tnormal = normalize( vTBN * mapN );\\n\\t#else\\n\\t\\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\\n\\t#endif\\n#elif defined( USE_BUMPMAP )\\n\\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\\n#endif\";\n\n\tvar normal_pars_fragment = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\n\tvar normal_pars_vertex = \"#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n\\t#ifdef USE_TANGENT\\n\\t\\tvarying vec3 vTangent;\\n\\t\\tvarying vec3 vBitangent;\\n\\t#endif\\n#endif\";\n\n\tvar normal_vertex = \"#ifndef FLAT_SHADED\\n\\tvNormal = normalize( transformedNormal );\\n\\t#ifdef USE_TANGENT\\n\\t\\tvTangent = normalize( transformedTangent );\\n\\t\\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\\n\\t#endif\\n#endif\";\n\n\tvar normalmap_pars_fragment = \"#ifdef USE_NORMALMAP\\n\\tuniform sampler2D normalMap;\\n\\tuniform vec2 normalScale;\\n#endif\\n#ifdef OBJECTSPACE_NORMALMAP\\n\\tuniform mat3 normalMatrix;\\n#endif\\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\\n\\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\\n\\t\\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\\n\\t\\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\\n\\t\\tvec2 st0 = dFdx( vUv.st );\\n\\t\\tvec2 st1 = dFdy( vUv.st );\\n\\t\\tvec3 N = surf_norm;\\n\\t\\tvec3 q1perp = cross( q1, N );\\n\\t\\tvec3 q0perp = cross( N, q0 );\\n\\t\\tvec3 T = q1perp * st0.x + q0perp * st1.x;\\n\\t\\tvec3 B = q1perp * st0.y + q0perp * st1.y;\\n\\t\\tfloat det = max( dot( T, T ), dot( B, B ) );\\n\\t\\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\\n\\t\\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\\n\\t}\\n#endif\";\n\n\tvar clearcoat_normal_fragment_begin = \"#ifdef USE_CLEARCOAT\\n\\tvec3 clearcoatNormal = geometryNormal;\\n#endif\";\n\n\tvar clearcoat_normal_fragment_maps = \"#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tvec3 clearcoatMapN = texture2D( clearcoatNormalMap, vUv ).xyz * 2.0 - 1.0;\\n\\tclearcoatMapN.xy *= clearcoatNormalScale;\\n\\t#ifdef USE_TANGENT\\n\\t\\tclearcoatNormal = normalize( vTBN * clearcoatMapN );\\n\\t#else\\n\\t\\tclearcoatNormal = perturbNormal2Arb( - vViewPosition, clearcoatNormal, clearcoatMapN, faceDirection );\\n\\t#endif\\n#endif\";\n\n\tvar clearcoat_pars_fragment = \"#ifdef USE_CLEARCOATMAP\\n\\tuniform sampler2D clearcoatMap;\\n#endif\\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\\n\\tuniform sampler2D clearcoatRoughnessMap;\\n#endif\\n#ifdef USE_CLEARCOAT_NORMALMAP\\n\\tuniform sampler2D clearcoatNormalMap;\\n\\tuniform vec2 clearcoatNormalScale;\\n#endif\";\n\n\tvar output_fragment = \"#ifdef OPAQUE\\ndiffuseColor.a = 1.0;\\n#endif\\n#ifdef USE_TRANSMISSION\\ndiffuseColor.a *= transmissionAlpha + 0.1;\\n#endif\\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );\";\n\n\tvar packing = \"vec3 packNormalToRGB( const in vec3 normal ) {\\n\\treturn normalize( normal ) * 0.5 + 0.5;\\n}\\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\\n\\treturn 2.0 * rgb.xyz - 1.0;\\n}\\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\\nconst float ShiftRight8 = 1. / 256.;\\nvec4 packDepthToRGBA( const in float v ) {\\n\\tvec4 r = vec4( fract( v * PackFactors ), v );\\n\\tr.yzw -= r.xyz * ShiftRight8;\\treturn r * PackUpscale;\\n}\\nfloat unpackRGBAToDepth( const in vec4 v ) {\\n\\treturn dot( v, UnpackFactors );\\n}\\nvec4 pack2HalfToRGBA( vec2 v ) {\\n\\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\\n\\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\\n}\\nvec2 unpackRGBATo2Half( vec4 v ) {\\n\\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\\n}\\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( viewZ + near ) / ( near - far );\\n}\\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\\n\\treturn linearClipZ * ( near - far ) - near;\\n}\\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\\n\\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\\n}\\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\\n\\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\\n}\";\n\n\tvar premultiplied_alpha_fragment = \"#ifdef PREMULTIPLIED_ALPHA\\n\\tgl_FragColor.rgb *= gl_FragColor.a;\\n#endif\";\n\n\tvar project_vertex = \"vec4 mvPosition = vec4( transformed, 1.0 );\\n#ifdef USE_INSTANCING\\n\\tmvPosition = instanceMatrix * mvPosition;\\n#endif\\nmvPosition = modelViewMatrix * mvPosition;\\ngl_Position = projectionMatrix * mvPosition;\";\n\n\tvar dithering_fragment = \"#ifdef DITHERING\\n\\tgl_FragColor.rgb = dithering( gl_FragColor.rgb );\\n#endif\";\n\n\tvar dithering_pars_fragment = \"#ifdef DITHERING\\n\\tvec3 dithering( vec3 color ) {\\n\\t\\tfloat grid_position = rand( gl_FragCoord.xy );\\n\\t\\tvec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );\\n\\t\\tdither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );\\n\\t\\treturn color + dither_shift_RGB;\\n\\t}\\n#endif\";\n\n\tvar roughnessmap_fragment = \"float roughnessFactor = roughness;\\n#ifdef USE_ROUGHNESSMAP\\n\\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\\n\\troughnessFactor *= texelRoughness.g;\\n#endif\";\n\n\tvar roughnessmap_pars_fragment = \"#ifdef USE_ROUGHNESSMAP\\n\\tuniform sampler2D roughnessMap;\\n#endif\";\n\n\tvar shadowmap_pars_fragment = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\\n\\t\\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\\n\\t}\\n\\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\\n\\t\\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\\n\\t}\\n\\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\\n\\t\\tfloat occlusion = 1.0;\\n\\t\\tvec2 distribution = texture2DDistribution( shadow, uv );\\n\\t\\tfloat hard_shadow = step( compare , distribution.x );\\n\\t\\tif (hard_shadow != 1.0 ) {\\n\\t\\t\\tfloat distance = compare - distribution.x ;\\n\\t\\t\\tfloat variance = max( 0.00000, distribution.y * distribution.y );\\n\\t\\t\\tfloat softness_probability = variance / (variance + distance * distance );\\t\\t\\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\\t\\t\\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\\n\\t\\t}\\n\\t\\treturn occlusion;\\n\\t}\\n\\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\\n\\t\\tfloat shadow = 1.0;\\n\\t\\tshadowCoord.xyz /= shadowCoord.w;\\n\\t\\tshadowCoord.z += shadowBias;\\n\\t\\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\\n\\t\\tbool inFrustum = all( inFrustumVec );\\n\\t\\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\\n\\t\\tbool frustumTest = all( frustumTestVec );\\n\\t\\tif ( frustumTest ) {\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx0 = - texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy0 = - texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx1 = + texelSize.x * shadowRadius;\\n\\t\\t\\tfloat dy1 = + texelSize.y * shadowRadius;\\n\\t\\t\\tfloat dx2 = dx0 / 2.0;\\n\\t\\t\\tfloat dy2 = dy0 / 2.0;\\n\\t\\t\\tfloat dx3 = dx1 / 2.0;\\n\\t\\t\\tfloat dy3 = dy1 / 2.0;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\\n\\t\\t\\t) * ( 1.0 / 17.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\\n\\t\\t\\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\\n\\t\\t\\tfloat dx = texelSize.x;\\n\\t\\t\\tfloat dy = texelSize.y;\\n\\t\\t\\tvec2 uv = shadowCoord.xy;\\n\\t\\t\\tvec2 f = fract( uv * shadowMapSize + 0.5 );\\n\\t\\t\\tuv -= f * texelSize;\\n\\t\\t\\tshadow = (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.x ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t f.y ) +\\n\\t\\t\\t\\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t\\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t\tf.x ),\\n\\t\\t\\t\\t\\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), \\n\\t\\t\\t\\t\\t\\t\ttexture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\\n\\t\\t\\t\\t\\t\\t\tf.x ),\\n\\t\\t\\t\\t\\t f.y )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#elif defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#else\\n\\t\\t\\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\\n\\t\\t#endif\\n\\t\\t}\\n\\t\\treturn shadow;\\n\\t}\\n\\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\\n\\t\\tvec3 absV = abs( v );\\n\\t\\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\\n\\t\\tabsV *= scaleToCube;\\n\\t\\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\\n\\t\\tvec2 planar = v.xy;\\n\\t\\tfloat almostATexel = 1.5 * texelSizeY;\\n\\t\\tfloat almostOne = 1.0 - almostATexel;\\n\\t\\tif ( absV.z >= almostOne ) {\\n\\t\\t\\tif ( v.z > 0.0 )\\n\\t\\t\\t\\tplanar.x = 4.0 - v.x;\\n\\t\\t} else if ( absV.x >= almostOne ) {\\n\\t\\t\\tfloat signX = sign( v.x );\\n\\t\\t\\tplanar.x = v.z * signX + 2.0 * signX;\\n\\t\\t} else if ( absV.y >= almostOne ) {\\n\\t\\t\\tfloat signY = sign( v.y );\\n\\t\\t\\tplanar.x = v.x + 2.0 * signY + 2.0;\\n\\t\\t\\tplanar.y = v.z * signY - 2.0;\\n\\t\\t}\\n\\t\\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\\n\\t}\\n\\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\\n\\t\\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\\n\\t\\tvec3 lightToPosition = shadowCoord.xyz;\\n\\t\\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\\t\\tdp += shadowBias;\\n\\t\\tvec3 bd3D = normalize( lightToPosition );\\n\\t\\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\\n\\t\\t\\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\\n\\t\\t\\treturn (\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\\n\\t\\t\\t\\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\\n\\t\\t\\t) * ( 1.0 / 9.0 );\\n\\t\\t#else\\n\\t\\t\\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\\n\\t\\t#endif\\n\\t}\\n#endif\";\n\n\tvar shadowmap_pars_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t\\tstruct DirectionalLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t\\tstruct SpotLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t};\\n\\t\\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t\\tstruct PointLightShadow {\\n\\t\\t\\tfloat shadowBias;\\n\\t\\t\\tfloat shadowNormalBias;\\n\\t\\t\\tfloat shadowRadius;\\n\\t\\t\\tvec2 shadowMapSize;\\n\\t\\t\\tfloat shadowCameraNear;\\n\\t\\t\\tfloat shadowCameraFar;\\n\\t\\t};\\n\\t\\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\\n\\t#endif\\n#endif\";\n\n\tvar shadowmap_vertex = \"#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0 || NUM_SPOT_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0\\n\\t\\tvec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\\n\\t\\tvec4 shadowWorldPosition;\\n\\t#endif\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tshadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );\\n\\t\\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n#endif\";\n\n\tvar shadowmask_pars_fragment = \"float getShadowMask() {\\n\\tfloat shadow = 1.0;\\n\\t#ifdef USE_SHADOWMAP\\n\\t#if NUM_DIR_LIGHT_SHADOWS > 0\\n\\tDirectionalLightShadow directionalLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tdirectionalLight = directionalLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_SPOT_LIGHT_SHADOWS > 0\\n\\tSpotLightShadow spotLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tspotLight = spotLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#if NUM_POINT_LIGHT_SHADOWS > 0\\n\\tPointLightShadow pointLight;\\n\\t#pragma unroll_loop_start\\n\\tfor ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {\\n\\t\\tpointLight = pointLightShadows[ i ];\\n\\t\\tshadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;\\n\\t}\\n\\t#pragma unroll_loop_end\\n\\t#endif\\n\\t#endif\\n\\treturn shadow;\\n}\";\n\n\tvar skinbase_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\\n\\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\\n\\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\\n\\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\\n#endif\";\n\n\tvar skinning_pars_vertex = \"#ifdef USE_SKINNING\\n\\tuniform mat4 bindMatrix;\\n\\tuniform mat4 bindMatrixInverse;\\n\\t#ifdef BONE_TEXTURE\\n\\t\\tuniform highp sampler2D boneTexture;\\n\\t\\tuniform int boneTextureSize;\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tfloat j = i * 4.0;\\n\\t\\t\\tfloat x = mod( j, float( boneTextureSize ) );\\n\\t\\t\\tfloat y = floor( j / float( boneTextureSize ) );\\n\\t\\t\\tfloat dx = 1.0 / float( boneTextureSize );\\n\\t\\t\\tfloat dy = 1.0 / float( boneTextureSize );\\n\\t\\t\\ty = dy * ( y + 0.5 );\\n\\t\\t\\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\\n\\t\\t\\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\\n\\t\\t\\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\\n\\t\\t\\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\\n\\t\\t\\tmat4 bone = mat4( v1, v2, v3, v4 );\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#else\\n\\t\\tuniform mat4 boneMatrices[ MAX_BONES ];\\n\\t\\tmat4 getBoneMatrix( const in float i ) {\\n\\t\\t\\tmat4 bone = boneMatrices[ int(i) ];\\n\\t\\t\\treturn bone;\\n\\t\\t}\\n\\t#endif\\n#endif\";\n\n\tvar skinning_vertex = \"#ifdef USE_SKINNING\\n\\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\\n\\tvec4 skinned = vec4( 0.0 );\\n\\tskinned += boneMatX * skinVertex * skinWeight.x;\\n\\tskinned += boneMatY * skinVertex * skinWeight.y;\\n\\tskinned += boneMatZ * skinVertex * skinWeight.z;\\n\\tskinned += boneMatW * skinVertex * skinWeight.w;\\n\\ttransformed = ( bindMatrixInverse * skinned ).xyz;\\n#endif\";\n\n\tvar skinnormal_vertex = \"#ifdef USE_SKINNING\\n\\tmat4 skinMatrix = mat4( 0.0 );\\n\\tskinMatrix += skinWeight.x * boneMatX;\\n\\tskinMatrix += skinWeight.y * boneMatY;\\n\\tskinMatrix += skinWeight.z * boneMatZ;\\n\\tskinMatrix += skinWeight.w * boneMatW;\\n\\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\\n\\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\\n\\t#ifdef USE_TANGENT\\n\\t\\tobjectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;\\n\\t#endif\\n#endif\";\n\n\tvar specularmap_fragment = \"float specularStrength;\\n#ifdef USE_SPECULARMAP\\n\\tvec4 texelSpecular = texture2D( specularMap, vUv );\\n\\tspecularStrength = texelSpecular.r;\\n#else\\n\\tspecularStrength = 1.0;\\n#endif\";\n\n\tvar specularmap_pars_fragment = \"#ifdef USE_SPECULARMAP\\n\\tuniform sampler2D specularMap;\\n#endif\";\n\n\tvar tonemapping_fragment = \"#if defined( TONE_MAPPING )\\n\\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\\n#endif\";\n\n\tvar tonemapping_pars_fragment = \"#ifndef saturate\\n#define saturate( a ) clamp( a, 0.0, 1.0 )\\n#endif\\nuniform float toneMappingExposure;\\nvec3 LinearToneMapping( vec3 color ) {\\n\\treturn toneMappingExposure * color;\\n}\\nvec3 ReinhardToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\treturn saturate( color / ( vec3( 1.0 ) + color ) );\\n}\\nvec3 OptimizedCineonToneMapping( vec3 color ) {\\n\\tcolor *= toneMappingExposure;\\n\\tcolor = max( vec3( 0.0 ), color - 0.004 );\\n\\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\\n}\\nvec3 RRTAndODTFit( vec3 v ) {\\n\\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\\n\\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\\n\\treturn a / b;\\n}\\nvec3 ACESFilmicToneMapping( vec3 color ) {\\n\\tconst mat3 ACESInputMat = mat3(\\n\\t\\tvec3( 0.59719, 0.07600, 0.02840 ),\\t\\tvec3( 0.35458, 0.90834, 0.13383 ),\\n\\t\\tvec3( 0.04823, 0.01566, 0.83777 )\\n\\t);\\n\\tconst mat3 ACESOutputMat = mat3(\\n\\t\\tvec3(\t1.60475, -0.10208, -0.00327 ),\\t\\tvec3( -0.53108,\t1.10813, -0.07276 ),\\n\\t\\tvec3( -0.07367, -0.00605,\t1.07602 )\\n\\t);\\n\\tcolor *= toneMappingExposure / 0.6;\\n\\tcolor = ACESInputMat * color;\\n\\tcolor = RRTAndODTFit( color );\\n\\tcolor = ACESOutputMat * color;\\n\\treturn saturate( color );\\n}\\nvec3 CustomToneMapping( vec3 color ) { return color; }\";\n\n\tvar transmission_fragment = \"#ifdef USE_TRANSMISSION\\n\\tfloat transmissionAlpha = 1.0;\\n\\tfloat transmissionFactor = transmission;\\n\\tfloat thicknessFactor = thickness;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\ttransmissionFactor *= texture2D( transmissionMap, vUv ).r;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tthicknessFactor *= texture2D( thicknessMap, vUv ).g;\\n\\t#endif\\n\\tvec3 pos = vWorldPosition;\\n\\tvec3 v = normalize( cameraPosition - pos );\\n\\tvec3 n = inverseTransformDirection( normal, viewMatrix );\\n\\tvec4 transmission = getIBLVolumeRefraction(\\n\\t\\tn, v, roughnessFactor, material.diffuseColor, material.specularColor, material.specularF90,\\n\\t\\tpos, modelMatrix, viewMatrix, projectionMatrix, ior, thicknessFactor,\\n\\t\\tattenuationTint, attenuationDistance );\\n\\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, transmissionFactor );\\n\\ttransmissionAlpha = mix( transmissionAlpha, transmission.a, transmissionFactor );\\n#endif\";\n\n\tvar transmission_pars_fragment = \"#ifdef USE_TRANSMISSION\\n\\tuniform float transmission;\\n\\tuniform float thickness;\\n\\tuniform float attenuationDistance;\\n\\tuniform vec3 attenuationTint;\\n\\t#ifdef USE_TRANSMISSIONMAP\\n\\t\\tuniform sampler2D transmissionMap;\\n\\t#endif\\n\\t#ifdef USE_THICKNESSMAP\\n\\t\\tuniform sampler2D thicknessMap;\\n\\t#endif\\n\\tuniform vec2 transmissionSamplerSize;\\n\\tuniform sampler2D transmissionSamplerMap;\\n\\tuniform mat4 modelMatrix;\\n\\tuniform mat4 projectionMatrix;\\n\\tvarying vec3 vWorldPosition;\\n\\tvec3 getVolumeTransmissionRay( vec3 n, vec3 v, float thickness, float ior, mat4 modelMatrix ) {\\n\\t\\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\\n\\t\\tvec3 modelScale;\\n\\t\\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\\n\\t\\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\\n\\t\\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\\n\\t\\treturn normalize( refractionVector ) * thickness * modelScale;\\n\\t}\\n\\tfloat applyIorToRoughness( float roughness, float ior ) {\\n\\t\\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\\n\\t}\\n\\tvec4 getTransmissionSample( vec2 fragCoord, float roughness, float ior ) {\\n\\t\\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\\n\\t\\t#ifdef TEXTURE_LOD_EXT\\n\\t\\t\\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#else\\n\\t\\t\\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\\n\\t\\t#endif\\n\\t}\\n\\tvec3 applyVolumeAttenuation( vec3 radiance, float transmissionDistance, vec3 attenuationColor, float attenuationDistance ) {\\n\\t\\tif ( attenuationDistance == 0.0 ) {\\n\\t\\t\\treturn radiance;\\n\\t\\t} else {\\n\\t\\t\\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\\n\\t\\t\\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\\t\\t\\treturn transmittance * radiance;\\n\\t\\t}\\n\\t}\\n\\tvec4 getIBLVolumeRefraction( vec3 n, vec3 v, float roughness, vec3 diffuseColor, vec3 specularColor, float specularF90,\\n\\t\\tvec3 position, mat4 modelMatrix, mat4 viewMatrix, mat4 projMatrix, float ior, float thickness,\\n\\t\\tvec3 attenuationColor, float attenuationDistance ) {\\n\\t\\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\\n\\t\\tvec3 refractedRayExit = position + transmissionRay;\\n\\t\\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\\n\\t\\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\\n\\t\\trefractionCoords += 1.0;\\n\\t\\trefractionCoords /= 2.0;\\n\\t\\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\\n\\t\\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\\n\\t\\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\\n\\t\\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\\n\\t}\\n#endif\";\n\n\tvar uv_pars_fragment = \"#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\\n\\tvarying vec2 vUv;\\n#endif\";\n\n\tvar uv_pars_vertex = \"#ifdef USE_UV\\n\\t#ifdef UVS_VERTEX_ONLY\\n\\t\\tvec2 vUv;\\n\\t#else\\n\\t\\tvarying vec2 vUv;\\n\\t#endif\\n\\tuniform mat3 uvTransform;\\n#endif\";\n\n\tvar uv_vertex = \"#ifdef USE_UV\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n#endif\";\n\n\tvar uv2_pars_fragment = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvarying vec2 vUv2;\\n#endif\";\n\n\tvar uv2_pars_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tattribute vec2 uv2;\\n\\tvarying vec2 vUv2;\\n\\tuniform mat3 uv2Transform;\\n#endif\";\n\n\tvar uv2_vertex = \"#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\\n\\tvUv2 = ( uv2Transform * vec3( uv2, 1 ) ).xy;\\n#endif\";\n\n\tvar worldpos_vertex = \"#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION )\\n\\tvec4 worldPosition = vec4( transformed, 1.0 );\\n\\t#ifdef USE_INSTANCING\\n\\t\\tworldPosition = instanceMatrix * worldPosition;\\n\\t#endif\\n\\tworldPosition = modelMatrix * worldPosition;\\n#endif\";\n\n\tconst vertex$g = \"varying vec2 vUv;\\nuniform mat3 uvTransform;\\nvoid main() {\\n\\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\\n\\tgl_Position = vec4( position.xy, 1.0, 1.0 );\\n}\";\n\tconst fragment$g = \"uniform sampler2D t2D;\\nvarying vec2 vUv;\\nvoid main() {\\n\\tvec4 texColor = texture2D( t2D, vUv );\\n\\tgl_FragColor = mapTexelToLinear( texColor );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";\n\n\tconst vertex$f = \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n\\tgl_Position.z = gl_Position.w;\\n}\";\n\tconst fragment$f = \"#include <envmap_common_pars_fragment>\\nuniform float opacity;\\nvarying vec3 vWorldDirection;\\n#include <cube_uv_reflection_fragment>\\nvoid main() {\\n\\tvec3 vReflect = vWorldDirection;\\n\\t#include <envmap_fragment>\\n\\tgl_FragColor = envColor;\\n\\tgl_FragColor.a *= opacity;\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";\n\n\tconst vertex$e = \"#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvHighPrecisionZW = gl_Position.zw;\\n}\";\n\tconst fragment$e = \"#if DEPTH_PACKING == 3200\\n\\tuniform float opacity;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvarying vec2 vHighPrecisionZW;\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tdiffuseColor.a = opacity;\\n\\t#endif\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\\n\\t#if DEPTH_PACKING == 3200\\n\\t\\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\\n\\t#elif DEPTH_PACKING == 3201\\n\\t\\tgl_FragColor = packDepthToRGBA( fragCoordZ );\\n\\t#endif\\n}\";\n\n\tconst vertex$d = \"#define DISTANCE\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#ifdef USE_DISPLACEMENTMAP\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvWorldPosition = worldPosition.xyz;\\n}\";\n\tconst fragment$d = \"#define DISTANCE\\nuniform vec3 referencePosition;\\nuniform float nearDistance;\\nuniform float farDistance;\\nvarying vec3 vWorldPosition;\\n#include <common>\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main () {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( 1.0 );\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\tfloat dist = length( vWorldPosition - referencePosition );\\n\\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\\n\\tdist = saturate( dist );\\n\\tgl_FragColor = packDepthToRGBA( dist );\\n}\";\n\n\tconst vertex$c = \"varying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvWorldDirection = transformDirection( position, modelMatrix );\\n\\t#include <begin_vertex>\\n\\t#include <project_vertex>\\n}\";\n\tconst fragment$c = \"uniform sampler2D tEquirect;\\nvarying vec3 vWorldDirection;\\n#include <common>\\nvoid main() {\\n\\tvec3 direction = normalize( vWorldDirection );\\n\\tvec2 sampleUV = equirectUv( direction );\\n\\tvec4 texColor = texture2D( tEquirect, sampleUV );\\n\\tgl_FragColor = mapTexelToLinear( texColor );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n}\";\n\n\tconst vertex$b = \"uniform float scale;\\nattribute float lineDistance;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\tvLineDistance = scale * lineDistance;\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$b = \"uniform vec3 diffuse;\\nuniform float opacity;\\nuniform float dashSize;\\nuniform float totalSize;\\nvarying float vLineDistance;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\\n\\t\\tdiscard;\\n\\t}\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <color_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\";\n\n\tconst vertex$a = \"#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\\n\\t\\t#include <beginnormal_vertex>\\n\\t\\t#include <morphnormal_vertex>\\n\\t\\t#include <skinbase_vertex>\\n\\t\\t#include <skinnormal_vertex>\\n\\t\\t#include <defaultnormal_vertex>\\n\\t#endif\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$a = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#ifndef FLAT_SHADED\\n\\tvarying vec3 vNormal;\\n#endif\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <fog_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\t#ifdef USE_LIGHTMAP\\n\\t\\tvec4 lightMapTexel= texture2D( lightMap, vUv2 );\\n\\t\\treflectedLight.indirectDiffuse += lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vec3( 1.0 );\\n\\t#endif\\n\\t#include <aomap_fragment>\\n\\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\\n\\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";\n\n\tconst vertex$9 = \"#define LAMBERT\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <lights_lambert_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$9 = \"uniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\nvarying vec3 vLightFront;\\nvarying vec3 vIndirectFront;\\n#ifdef DOUBLE_SIDED\\n\\tvarying vec3 vLightBack;\\n\\tvarying vec3 vIndirectBack;\\n#endif\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <fog_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <emissivemap_fragment>\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.indirectDiffuse += ( gl_FrontFacing ) ? vIndirectFront : vIndirectBack;\\n\\t#else\\n\\t\\treflectedLight.indirectDiffuse += vIndirectFront;\\n\\t#endif\\n\\t#include <lightmap_fragment>\\n\\treflectedLight.indirectDiffuse *= BRDF_Lambert( diffuseColor.rgb );\\n\\t#ifdef DOUBLE_SIDED\\n\\t\\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\\n\\t#else\\n\\t\\treflectedLight.directDiffuse = vLightFront;\\n\\t#endif\\n\\treflectedLight.directDiffuse *= BRDF_Lambert( diffuseColor.rgb ) * getShadowMask();\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";\n\n\tconst vertex$8 = \"#define MATCAP\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <color_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n}\";\n\tconst fragment$8 = \"#define MATCAP\\nuniform vec3 diffuse;\\nuniform float opacity;\\nuniform sampler2D matcap;\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tvec3 viewDir = normalize( vViewPosition );\\n\\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\\n\\tvec3 y = cross( viewDir, x );\\n\\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\\n\\t#ifdef USE_MATCAP\\n\\t\\tvec4 matcapColor = texture2D( matcap, uv );\\n\\t\\tmatcapColor = matcapTexelToLinear( matcapColor );\\n\\t#else\\n\\t\\tvec4 matcapColor = vec4( 1.0 );\\n\\t#endif\\n\\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";\n\n\tconst vertex$7 = \"#define NORMAL\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvViewPosition = - mvPosition.xyz;\\n#endif\\n}\";\n\tconst fragment$7 = \"#define NORMAL\\nuniform float opacity;\\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( TANGENTSPACE_NORMALMAP )\\n\\tvarying vec3 vViewPosition;\\n#endif\\n#include <packing>\\n#include <uv_pars_fragment>\\n#include <normal_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\tgl_FragColor = vec4( packNormalToRGB( normal ), opacity );\\n}\";\n\n\tconst vertex$6 = \"#define PHONG\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <envmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <envmap_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$6 = \"#define PHONG\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform vec3 specular;\\nuniform float shininess;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_pars_fragment>\\n#include <cube_uv_reflection_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_phong_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <specularmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <specularmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_phong_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\\n\\t#include <envmap_fragment>\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";\n\n\tconst vertex$5 = \"#define STANDARD\\nvarying vec3 vViewPosition;\\n#ifdef USE_TRANSMISSION\\n\\tvarying vec3 vWorldPosition;\\n#endif\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n#ifdef USE_TRANSMISSION\\n\\tvWorldPosition = worldPosition.xyz;\\n#endif\\n}\";\n\tconst fragment$5 = \"#define STANDARD\\n#ifdef PHYSICAL\\n\\t#define IOR\\n\\t#define SPECULAR\\n#endif\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float roughness;\\nuniform float metalness;\\nuniform float opacity;\\n#ifdef IOR\\n\\tuniform float ior;\\n#endif\\n#ifdef SPECULAR\\n\\tuniform float specularIntensity;\\n\\tuniform vec3 specularTint;\\n\\t#ifdef USE_SPECULARINTENSITYMAP\\n\\t\\tuniform sampler2D specularIntensityMap;\\n\\t#endif\\n\\t#ifdef USE_SPECULARTINTMAP\\n\\t\\tuniform sampler2D specularTintMap;\\n\\t#endif\\n#endif\\n#ifdef USE_CLEARCOAT\\n\\tuniform float clearcoat;\\n\\tuniform float clearcoatRoughness;\\n#endif\\n#ifdef USE_SHEEN\\n\\tuniform vec3 sheenTint;\\n\\tuniform float sheenRoughness;\\n#endif\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <bsdfs>\\n#include <cube_uv_reflection_fragment>\\n#include <envmap_common_pars_fragment>\\n#include <envmap_physical_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_physical_pars_fragment>\\n#include <transmission_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <clearcoat_pars_fragment>\\n#include <roughnessmap_pars_fragment>\\n#include <metalnessmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <roughnessmap_fragment>\\n\\t#include <metalnessmap_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <clearcoat_normal_fragment_begin>\\n\\t#include <clearcoat_normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_physical_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\\n\\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\\n\\t#include <transmission_fragment>\\n\\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\\n\\t#ifdef USE_CLEARCOAT\\n\\t\\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\\n\\t\\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\\n\\t\\toutgoingLight = outgoingLight * ( 1.0 - clearcoat * Fcc ) + clearcoatSpecular * clearcoat;\\n\\t#endif\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";\n\n\tconst vertex$4 = \"#define TOON\\nvarying vec3 vViewPosition;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <uv2_pars_vertex>\\n#include <displacementmap_pars_vertex>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <normal_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\t#include <uv2_vertex>\\n\\t#include <color_vertex>\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <normal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <displacementmap_vertex>\\n\\t#include <project_vertex>\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\tvViewPosition = - mvPosition.xyz;\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$4 = \"#define TOON\\nuniform vec3 diffuse;\\nuniform vec3 emissive;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <dithering_pars_fragment>\\n#include <color_pars_fragment>\\n#include <uv_pars_fragment>\\n#include <uv2_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <aomap_pars_fragment>\\n#include <lightmap_pars_fragment>\\n#include <emissivemap_pars_fragment>\\n#include <gradientmap_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <normal_pars_fragment>\\n#include <lights_toon_pars_fragment>\\n#include <shadowmap_pars_fragment>\\n#include <bumpmap_pars_fragment>\\n#include <normalmap_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\\n\\tvec3 totalEmissiveRadiance = emissive;\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\t#include <normal_fragment_begin>\\n\\t#include <normal_fragment_maps>\\n\\t#include <emissivemap_fragment>\\n\\t#include <lights_toon_fragment>\\n\\t#include <lights_fragment_begin>\\n\\t#include <lights_fragment_maps>\\n\\t#include <lights_fragment_end>\\n\\t#include <aomap_fragment>\\n\\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n\\t#include <dithering_fragment>\\n}\";\n\n\tconst vertex$3 = \"uniform float size;\\nuniform float scale;\\n#include <common>\\n#include <color_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <color_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <project_vertex>\\n\\tgl_PointSize = size;\\n\\t#ifdef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\\n\\t#endif\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$3 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <color_pars_fragment>\\n#include <map_particle_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_particle_fragment>\\n\\t#include <color_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n\\t#include <premultiplied_alpha_fragment>\\n}\";\n\n\tconst vertex$2 = \"#include <common>\\n#include <fog_pars_vertex>\\n#include <morphtarget_pars_vertex>\\n#include <skinning_pars_vertex>\\n#include <shadowmap_pars_vertex>\\nvoid main() {\\n\\t#include <beginnormal_vertex>\\n\\t#include <morphnormal_vertex>\\n\\t#include <skinbase_vertex>\\n\\t#include <skinnormal_vertex>\\n\\t#include <defaultnormal_vertex>\\n\\t#include <begin_vertex>\\n\\t#include <morphtarget_vertex>\\n\\t#include <skinning_vertex>\\n\\t#include <project_vertex>\\n\\t#include <worldpos_vertex>\\n\\t#include <shadowmap_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$2 = \"uniform vec3 color;\\nuniform float opacity;\\n#include <common>\\n#include <packing>\\n#include <fog_pars_fragment>\\n#include <bsdfs>\\n#include <lights_pars_begin>\\n#include <shadowmap_pars_fragment>\\n#include <shadowmask_pars_fragment>\\nvoid main() {\\n\\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\";\n\n\tconst vertex$1 = \"uniform float rotation;\\nuniform vec2 center;\\n#include <common>\\n#include <uv_pars_vertex>\\n#include <fog_pars_vertex>\\n#include <logdepthbuf_pars_vertex>\\n#include <clipping_planes_pars_vertex>\\nvoid main() {\\n\\t#include <uv_vertex>\\n\\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\\n\\tvec2 scale;\\n\\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\\n\\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\\n\\t#ifndef USE_SIZEATTENUATION\\n\\t\\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\\n\\t\\tif ( isPerspective ) scale *= - mvPosition.z;\\n\\t#endif\\n\\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\\n\\tvec2 rotatedPosition;\\n\\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\\n\\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\\n\\tmvPosition.xy += rotatedPosition;\\n\\tgl_Position = projectionMatrix * mvPosition;\\n\\t#include <logdepthbuf_vertex>\\n\\t#include <clipping_planes_vertex>\\n\\t#include <fog_vertex>\\n}\";\n\tconst fragment$1 = \"uniform vec3 diffuse;\\nuniform float opacity;\\n#include <common>\\n#include <uv_pars_fragment>\\n#include <map_pars_fragment>\\n#include <alphamap_pars_fragment>\\n#include <alphatest_pars_fragment>\\n#include <fog_pars_fragment>\\n#include <logdepthbuf_pars_fragment>\\n#include <clipping_planes_pars_fragment>\\nvoid main() {\\n\\t#include <clipping_planes_fragment>\\n\\tvec3 outgoingLight = vec3( 0.0 );\\n\\tvec4 diffuseColor = vec4( diffuse, opacity );\\n\\t#include <logdepthbuf_fragment>\\n\\t#include <map_fragment>\\n\\t#include <alphamap_fragment>\\n\\t#include <alphatest_fragment>\\n\\toutgoingLight = diffuseColor.rgb;\\n\\t#include <output_fragment>\\n\\t#include <tonemapping_fragment>\\n\\t#include <encodings_fragment>\\n\\t#include <fog_fragment>\\n}\";\n\n\tconst ShaderChunk = {\n\t\talphamap_fragment: alphamap_fragment,\n\t\talphamap_pars_fragment: alphamap_pars_fragment,\n\t\talphatest_fragment: alphatest_fragment,\n\t\talphatest_pars_fragment: alphatest_pars_fragment,\n\t\taomap_fragment: aomap_fragment,\n\t\taomap_pars_fragment: aomap_pars_fragment,\n\t\tbegin_vertex: begin_vertex,\n\t\tbeginnormal_vertex: beginnormal_vertex,\n\t\tbsdfs: bsdfs,\n\t\tbumpmap_pars_fragment: bumpmap_pars_fragment,\n\t\tclipping_planes_fragment: clipping_planes_fragment,\n\t\tclipping_planes_pars_fragment: clipping_planes_pars_fragment,\n\t\tclipping_planes_pars_vertex: clipping_planes_pars_vertex,\n\t\tclipping_planes_vertex: clipping_planes_vertex,\n\t\tcolor_fragment: color_fragment,\n\t\tcolor_pars_fragment: color_pars_fragment,\n\t\tcolor_pars_vertex: color_pars_vertex,\n\t\tcolor_vertex: color_vertex,\n\t\tcommon: common,\n\t\tcube_uv_reflection_fragment: cube_uv_reflection_fragment,\n\t\tdefaultnormal_vertex: defaultnormal_vertex,\n\t\tdisplacementmap_pars_vertex: displacementmap_pars_vertex,\n\t\tdisplacementmap_vertex: displacementmap_vertex,\n\t\temissivemap_fragment: emissivemap_fragment,\n\t\temissivemap_pars_fragment: emissivemap_pars_fragment,\n\t\tencodings_fragment: encodings_fragment,\n\t\tencodings_pars_fragment: encodings_pars_fragment,\n\t\tenvmap_fragment: envmap_fragment,\n\t\tenvmap_common_pars_fragment: envmap_common_pars_fragment,\n\t\tenvmap_pars_fragment: envmap_pars_fragment,\n\t\tenvmap_pars_vertex: envmap_pars_vertex,\n\t\tenvmap_physical_pars_fragment: envmap_physical_pars_fragment,\n\t\tenvmap_vertex: envmap_vertex,\n\t\tfog_vertex: fog_vertex,\n\t\tfog_pars_vertex: fog_pars_vertex,\n\t\tfog_fragment: fog_fragment,\n\t\tfog_pars_fragment: fog_pars_fragment,\n\t\tgradientmap_pars_fragment: gradientmap_pars_fragment,\n\t\tlightmap_fragment: lightmap_fragment,\n\t\tlightmap_pars_fragment: lightmap_pars_fragment,\n\t\tlights_lambert_vertex: lights_lambert_vertex,\n\t\tlights_pars_begin: lights_pars_begin,\n\t\tlights_toon_fragment: lights_toon_fragment,\n\t\tlights_toon_pars_fragment: lights_toon_pars_fragment,\n\t\tlights_phong_fragment: lights_phong_fragment,\n\t\tlights_phong_pars_fragment: lights_phong_pars_fragment,\n\t\tlights_physical_fragment: lights_physical_fragment,\n\t\tlights_physical_pars_fragment: lights_physical_pars_fragment,\n\t\tlights_fragment_begin: lights_fragment_begin,\n\t\tlights_fragment_maps: lights_fragment_maps,\n\t\tlights_fragment_end: lights_fragment_end,\n\t\tlogdepthbuf_fragment: logdepthbuf_fragment,\n\t\tlogdepthbuf_pars_fragment: logdepthbuf_pars_fragment,\n\t\tlogdepthbuf_pars_vertex: logdepthbuf_pars_vertex,\n\t\tlogdepthbuf_vertex: logdepthbuf_vertex,\n\t\tmap_fragment: map_fragment,\n\t\tmap_pars_fragment: map_pars_fragment,\n\t\tmap_particle_fragment: map_particle_fragment,\n\t\tmap_particle_pars_fragment: map_particle_pars_fragment,\n\t\tmetalnessmap_fragment: metalnessmap_fragment,\n\t\tmetalnessmap_pars_fragment: metalnessmap_pars_fragment,\n\t\tmorphnormal_vertex: morphnormal_vertex,\n\t\tmorphtarget_pars_vertex: morphtarget_pars_vertex,\n\t\tmorphtarget_vertex: morphtarget_vertex,\n\t\tnormal_fragment_begin: normal_fragment_begin,\n\t\tnormal_fragment_maps: normal_fragment_maps,\n\t\tnormal_pars_fragment: normal_pars_fragment,\n\t\tnormal_pars_vertex: normal_pars_vertex,\n\t\tnormal_vertex: normal_vertex,\n\t\tnormalmap_pars_fragment: normalmap_pars_fragment,\n\t\tclearcoat_normal_fragment_begin: clearcoat_normal_fragment_begin,\n\t\tclearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,\n\t\tclearcoat_pars_fragment: clearcoat_pars_fragment,\n\t\toutput_fragment: output_fragment,\n\t\tpacking: packing,\n\t\tpremultiplied_alpha_fragment: premultiplied_alpha_fragment,\n\t\tproject_vertex: project_vertex,\n\t\tdithering_fragment: dithering_fragment,\n\t\tdithering_pars_fragment: dithering_pars_fragment,\n\t\troughnessmap_fragment: roughnessmap_fragment,\n\t\troughnessmap_pars_fragment: roughnessmap_pars_fragment,\n\t\tshadowmap_pars_fragment: shadowmap_pars_fragment,\n\t\tshadowmap_pars_vertex: shadowmap_pars_vertex,\n\t\tshadowmap_vertex: shadowmap_vertex,\n\t\tshadowmask_pars_fragment: shadowmask_pars_fragment,\n\t\tskinbase_vertex: skinbase_vertex,\n\t\tskinning_pars_vertex: skinning_pars_vertex,\n\t\tskinning_vertex: skinning_vertex,\n\t\tskinnormal_vertex: skinnormal_vertex,\n\t\tspecularmap_fragment: specularmap_fragment,\n\t\tspecularmap_pars_fragment: specularmap_pars_fragment,\n\t\ttonemapping_fragment: tonemapping_fragment,\n\t\ttonemapping_pars_fragment: tonemapping_pars_fragment,\n\t\ttransmission_fragment: transmission_fragment,\n\t\ttransmission_pars_fragment: transmission_pars_fragment,\n\t\tuv_pars_fragment: uv_pars_fragment,\n\t\tuv_pars_vertex: uv_pars_vertex,\n\t\tuv_vertex: uv_vertex,\n\t\tuv2_pars_fragment: uv2_pars_fragment,\n\t\tuv2_pars_vertex: uv2_pars_vertex,\n\t\tuv2_vertex: uv2_vertex,\n\t\tworldpos_vertex: worldpos_vertex,\n\t\tbackground_vert: vertex$g,\n\t\tbackground_frag: fragment$g,\n\t\tcube_vert: vertex$f,\n\t\tcube_frag: fragment$f,\n\t\tdepth_vert: vertex$e,\n\t\tdepth_frag: fragment$e,\n\t\tdistanceRGBA_vert: vertex$d,\n\t\tdistanceRGBA_frag: fragment$d,\n\t\tequirect_vert: vertex$c,\n\t\tequirect_frag: fragment$c,\n\t\tlinedashed_vert: vertex$b,\n\t\tlinedashed_frag: fragment$b,\n\t\tmeshbasic_vert: vertex$a,\n\t\tmeshbasic_frag: fragment$a,\n\t\tmeshlambert_vert: vertex$9,\n\t\tmeshlambert_frag: fragment$9,\n\t\tmeshmatcap_vert: vertex$8,\n\t\tmeshmatcap_frag: fragment$8,\n\t\tmeshnormal_vert: vertex$7,\n\t\tmeshnormal_frag: fragment$7,\n\t\tmeshphong_vert: vertex$6,\n\t\tmeshphong_frag: fragment$6,\n\t\tmeshphysical_vert: vertex$5,\n\t\tmeshphysical_frag: fragment$5,\n\t\tmeshtoon_vert: vertex$4,\n\t\tmeshtoon_frag: fragment$4,\n\t\tpoints_vert: vertex$3,\n\t\tpoints_frag: fragment$3,\n\t\tshadow_vert: vertex$2,\n\t\tshadow_frag: fragment$2,\n\t\tsprite_vert: vertex$1,\n\t\tsprite_frag: fragment$1\n\t};\n\n\t/**\n\t * Uniforms library for shared webgl shaders\n\t */\n\n\tconst UniformsLib = {\n\t\tcommon: {\n\t\t\tdiffuse: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t},\n\t\t\topacity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tuvTransform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t},\n\t\t\tuv2Transform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t},\n\t\t\talphaMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaTest: {\n\t\t\t\tvalue: 0\n\t\t\t}\n\t\t},\n\t\tspecularmap: {\n\t\t\tspecularMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tenvmap: {\n\t\t\tenvMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tflipEnvMap: {\n\t\t\t\tvalue: -1\n\t\t\t},\n\t\t\treflectivity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\t// basic, lambert, phong\n\t\t\tior: {\n\t\t\t\tvalue: 1.5\n\t\t\t},\n\t\t\t// standard, physical\n\t\t\trefractionRatio: {\n\t\t\t\tvalue: 0.98\n\t\t\t},\n\t\t\tmaxMipLevel: {\n\t\t\t\tvalue: 0\n\t\t\t}\n\t\t},\n\t\taomap: {\n\t\t\taoMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\taoMapIntensity: {\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\tlightmap: {\n\t\t\tlightMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tlightMapIntensity: {\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\temissivemap: {\n\t\t\temissiveMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tbumpmap: {\n\t\t\tbumpMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tbumpScale: {\n\t\t\t\tvalue: 1\n\t\t\t}\n\t\t},\n\t\tnormalmap: {\n\t\t\tnormalMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tnormalScale: {\n\t\t\t\tvalue: new Vector2(1, 1)\n\t\t\t}\n\t\t},\n\t\tdisplacementmap: {\n\t\t\tdisplacementMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tdisplacementScale: {\n\t\t\t\tvalue: 1\n\t\t\t},\n\t\t\tdisplacementBias: {\n\t\t\t\tvalue: 0\n\t\t\t}\n\t\t},\n\t\troughnessmap: {\n\t\t\troughnessMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tmetalnessmap: {\n\t\t\tmetalnessMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tgradientmap: {\n\t\t\tgradientMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tfog: {\n\t\t\tfogDensity: {\n\t\t\t\tvalue: 0.00025\n\t\t\t},\n\t\t\tfogNear: {\n\t\t\t\tvalue: 1\n\t\t\t},\n\t\t\tfogFar: {\n\t\t\t\tvalue: 2000\n\t\t\t},\n\t\t\tfogColor: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t}\n\t\t},\n\t\tlights: {\n\t\t\tambientLightColor: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tlightProbe: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tdirectionalLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tdirection: {},\n\t\t\t\t\tcolor: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdirectionalLightShadows: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tshadowBias: {},\n\t\t\t\t\tshadowNormalBias: {},\n\t\t\t\t\tshadowRadius: {},\n\t\t\t\t\tshadowMapSize: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tdirectionalShadowMap: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tdirectionalShadowMatrix: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tspotLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tcolor: {},\n\t\t\t\t\tposition: {},\n\t\t\t\t\tdirection: {},\n\t\t\t\t\tdistance: {},\n\t\t\t\t\tconeCos: {},\n\t\t\t\t\tpenumbraCos: {},\n\t\t\t\t\tdecay: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tspotLightShadows: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tshadowBias: {},\n\t\t\t\t\tshadowNormalBias: {},\n\t\t\t\t\tshadowRadius: {},\n\t\t\t\t\tshadowMapSize: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tspotShadowMap: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tspotShadowMatrix: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tpointLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tcolor: {},\n\t\t\t\t\tposition: {},\n\t\t\t\t\tdecay: {},\n\t\t\t\t\tdistance: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tpointLightShadows: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tshadowBias: {},\n\t\t\t\t\tshadowNormalBias: {},\n\t\t\t\t\tshadowRadius: {},\n\t\t\t\t\tshadowMapSize: {},\n\t\t\t\t\tshadowCameraNear: {},\n\t\t\t\t\tshadowCameraFar: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tpointShadowMap: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\tpointShadowMatrix: {\n\t\t\t\tvalue: []\n\t\t\t},\n\t\t\themisphereLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tdirection: {},\n\t\t\t\t\tskyColor: {},\n\t\t\t\t\tgroundColor: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\t// TODO (abelnation): RectAreaLight BRDF data needs to be moved from example to main src\n\t\t\trectAreaLights: {\n\t\t\t\tvalue: [],\n\t\t\t\tproperties: {\n\t\t\t\t\tcolor: {},\n\t\t\t\t\tposition: {},\n\t\t\t\t\twidth: {},\n\t\t\t\t\theight: {}\n\t\t\t\t}\n\t\t\t},\n\t\t\tltc_1: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tltc_2: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t},\n\t\tpoints: {\n\t\t\tdiffuse: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t},\n\t\t\topacity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tsize: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tscale: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaTest: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tuvTransform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t},\n\t\tsprite: {\n\t\t\tdiffuse: {\n\t\t\t\tvalue: new Color(0xffffff)\n\t\t\t},\n\t\t\topacity: {\n\t\t\t\tvalue: 1.0\n\t\t\t},\n\t\t\tcenter: {\n\t\t\t\tvalue: new Vector2(0.5, 0.5)\n\t\t\t},\n\t\t\trotation: {\n\t\t\t\tvalue: 0.0\n\t\t\t},\n\t\t\tmap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\talphaTest: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tuvTransform: {\n\t\t\t\tvalue: new Matrix3()\n\t\t\t}\n\t\t}\n\t};\n\n\tconst ShaderLib = {\n\t\tbasic: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.specularmap, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.fog]),\n\t\t\tvertexShader: ShaderChunk.meshbasic_vert,\n\t\t\tfragmentShader: ShaderChunk.meshbasic_frag\n\t\t},\n\t\tlambert: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.specularmap, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshlambert_vert,\n\t\t\tfragmentShader: ShaderChunk.meshlambert_frag\n\t\t},\n\t\tphong: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.specularmap, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t},\n\t\t\t\tspecular: {\n\t\t\t\t\tvalue: new Color(0x111111)\n\t\t\t\t},\n\t\t\t\tshininess: {\n\t\t\t\t\tvalue: 30\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshphong_vert,\n\t\t\tfragmentShader: ShaderChunk.meshphong_frag\n\t\t},\n\t\tstandard: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.envmap, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.roughnessmap, UniformsLib.metalnessmap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t},\n\t\t\t\troughness: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t},\n\t\t\t\tmetalness: {\n\t\t\t\t\tvalue: 0.0\n\t\t\t\t},\n\t\t\t\tenvMapIntensity: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t} // temporary\n\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\t\t},\n\t\ttoon: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.aomap, UniformsLib.lightmap, UniformsLib.emissivemap, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.gradientmap, UniformsLib.fog, UniformsLib.lights, {\n\t\t\t\temissive: {\n\t\t\t\t\tvalue: new Color(0x000000)\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshtoon_vert,\n\t\t\tfragmentShader: ShaderChunk.meshtoon_frag\n\t\t},\n\t\tmatcap: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, UniformsLib.fog, {\n\t\t\t\tmatcap: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshmatcap_vert,\n\t\t\tfragmentShader: ShaderChunk.meshmatcap_frag\n\t\t},\n\t\tpoints: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.points, UniformsLib.fog]),\n\t\t\tvertexShader: ShaderChunk.points_vert,\n\t\t\tfragmentShader: ShaderChunk.points_frag\n\t\t},\n\t\tdashed: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.fog, {\n\t\t\t\tscale: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\tdashSize: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\ttotalSize: {\n\t\t\t\t\tvalue: 2\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.linedashed_vert,\n\t\t\tfragmentShader: ShaderChunk.linedashed_frag\n\t\t},\n\t\tdepth: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.displacementmap]),\n\t\t\tvertexShader: ShaderChunk.depth_vert,\n\t\t\tfragmentShader: ShaderChunk.depth_frag\n\t\t},\n\t\tnormal: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.bumpmap, UniformsLib.normalmap, UniformsLib.displacementmap, {\n\t\t\t\topacity: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.meshnormal_vert,\n\t\t\tfragmentShader: ShaderChunk.meshnormal_frag\n\t\t},\n\t\tsprite: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.sprite, UniformsLib.fog]),\n\t\t\tvertexShader: ShaderChunk.sprite_vert,\n\t\t\tfragmentShader: ShaderChunk.sprite_frag\n\t\t},\n\t\tbackground: {\n\t\t\tuniforms: {\n\t\t\t\tuvTransform: {\n\t\t\t\t\tvalue: new Matrix3()\n\t\t\t\t},\n\t\t\t\tt2D: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: ShaderChunk.background_vert,\n\t\t\tfragmentShader: ShaderChunk.background_frag\n\t\t},\n\n\t\t/* -------------------------------------------------------------------------\n\t\t//\tCube map shader\n\t\t ------------------------------------------------------------------------- */\n\t\tcube: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.envmap, {\n\t\t\t\topacity: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.cube_vert,\n\t\t\tfragmentShader: ShaderChunk.cube_frag\n\t\t},\n\t\tequirect: {\n\t\t\tuniforms: {\n\t\t\t\ttEquirect: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: ShaderChunk.equirect_vert,\n\t\t\tfragmentShader: ShaderChunk.equirect_frag\n\t\t},\n\t\tdistanceRGBA: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.common, UniformsLib.displacementmap, {\n\t\t\t\treferencePosition: {\n\t\t\t\t\tvalue: new Vector3()\n\t\t\t\t},\n\t\t\t\tnearDistance: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\tfarDistance: {\n\t\t\t\t\tvalue: 1000\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.distanceRGBA_vert,\n\t\t\tfragmentShader: ShaderChunk.distanceRGBA_frag\n\t\t},\n\t\tshadow: {\n\t\t\tuniforms: mergeUniforms([UniformsLib.lights, UniformsLib.fog, {\n\t\t\t\tcolor: {\n\t\t\t\t\tvalue: new Color(0x00000)\n\t\t\t\t},\n\t\t\t\topacity: {\n\t\t\t\t\tvalue: 1.0\n\t\t\t\t}\n\t\t\t}]),\n\t\t\tvertexShader: ShaderChunk.shadow_vert,\n\t\t\tfragmentShader: ShaderChunk.shadow_frag\n\t\t}\n\t};\n\tShaderLib.physical = {\n\t\tuniforms: mergeUniforms([ShaderLib.standard.uniforms, {\n\t\t\tclearcoat: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tclearcoatMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tclearcoatRoughness: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tclearcoatRoughnessMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tclearcoatNormalScale: {\n\t\t\t\tvalue: new Vector2(1, 1)\n\t\t\t},\n\t\t\tclearcoatNormalMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tsheen: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tsheenTint: {\n\t\t\t\tvalue: new Color(0x000000)\n\t\t\t},\n\t\t\tsheenRoughness: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\ttransmission: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\ttransmissionMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\ttransmissionSamplerSize: {\n\t\t\t\tvalue: new Vector2()\n\t\t\t},\n\t\t\ttransmissionSamplerMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tthickness: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tthicknessMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tattenuationDistance: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tattenuationTint: {\n\t\t\t\tvalue: new Color(0x000000)\n\t\t\t},\n\t\t\tspecularIntensity: {\n\t\t\t\tvalue: 0\n\t\t\t},\n\t\t\tspecularIntensityMap: {\n\t\t\t\tvalue: null\n\t\t\t},\n\t\t\tspecularTint: {\n\t\t\t\tvalue: new Color(1, 1, 1)\n\t\t\t},\n\t\t\tspecularTintMap: {\n\t\t\t\tvalue: null\n\t\t\t}\n\t\t}]),\n\t\tvertexShader: ShaderChunk.meshphysical_vert,\n\t\tfragmentShader: ShaderChunk.meshphysical_frag\n\t};\n\n\tfunction WebGLBackground(renderer, cubemaps, state, objects, premultipliedAlpha) {\n\t\tconst clearColor = new Color(0x000000);\n\t\tlet clearAlpha = 0;\n\t\tlet planeMesh;\n\t\tlet boxMesh;\n\t\tlet currentBackground = null;\n\t\tlet currentBackgroundVersion = 0;\n\t\tlet currentTonemapping = null;\n\n\t\tfunction render(renderList, scene) {\n\t\t\tlet forceClear = false;\n\t\t\tlet background = scene.isScene === true ? scene.background : null;\n\n\t\t\tif (background && background.isTexture) {\n\t\t\t\tbackground = cubemaps.get(background);\n\t\t\t} // Ignore background in AR\n\t\t\t// TODO: Reconsider this.\n\n\n\t\t\tconst xr = renderer.xr;\n\t\t\tconst session = xr.getSession && xr.getSession();\n\n\t\t\tif (session && session.environmentBlendMode === 'additive') {\n\t\t\t\tbackground = null;\n\t\t\t}\n\n\t\t\tif (background === null) {\n\t\t\t\tsetClear(clearColor, clearAlpha);\n\t\t\t} else if (background && background.isColor) {\n\t\t\t\tsetClear(background, 1);\n\t\t\t\tforceClear = true;\n\t\t\t}\n\n\t\t\tif (renderer.autoClear || forceClear) {\n\t\t\t\trenderer.clear(renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil);\n\t\t\t}\n\n\t\t\tif (background && (background.isCubeTexture || background.mapping === CubeUVReflectionMapping)) {\n\t\t\t\tif (boxMesh === undefined) {\n\t\t\t\t\tboxMesh = new Mesh(new BoxGeometry(1, 1, 1), new ShaderMaterial({\n\t\t\t\t\t\tname: 'BackgroundCubeMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms(ShaderLib.cube.uniforms),\n\t\t\t\t\t\tvertexShader: ShaderLib.cube.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.cube.fragmentShader,\n\t\t\t\t\t\tside: BackSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t}));\n\t\t\t\t\tboxMesh.geometry.deleteAttribute('normal');\n\t\t\t\t\tboxMesh.geometry.deleteAttribute('uv');\n\n\t\t\t\t\tboxMesh.onBeforeRender = function (renderer, scene, camera) {\n\t\t\t\t\t\tthis.matrixWorld.copyPosition(camera.matrixWorld);\n\t\t\t\t\t}; // enable code injection for non-built-in material\n\n\n\t\t\t\t\tObject.defineProperty(boxMesh.material, 'envMap', {\n\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\treturn this.uniforms.envMap.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tobjects.update(boxMesh);\n\t\t\t\t}\n\n\t\t\t\tboxMesh.material.uniforms.envMap.value = background;\n\t\t\t\tboxMesh.material.uniforms.flipEnvMap.value = background.isCubeTexture && background.isRenderTargetTexture === false ? -1 : 1;\n\n\t\t\t\tif (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {\n\t\t\t\t\tboxMesh.material.needsUpdate = true;\n\t\t\t\t\tcurrentBackground = background;\n\t\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\t\t\t\t} // push to the pre-sorted opaque render list\n\n\n\t\t\t\trenderList.unshift(boxMesh, boxMesh.geometry, boxMesh.material, 0, 0, null);\n\t\t\t} else if (background && background.isTexture) {\n\t\t\t\tif (planeMesh === undefined) {\n\t\t\t\t\tplaneMesh = new Mesh(new PlaneGeometry(2, 2), new ShaderMaterial({\n\t\t\t\t\t\tname: 'BackgroundMaterial',\n\t\t\t\t\t\tuniforms: cloneUniforms(ShaderLib.background.uniforms),\n\t\t\t\t\t\tvertexShader: ShaderLib.background.vertexShader,\n\t\t\t\t\t\tfragmentShader: ShaderLib.background.fragmentShader,\n\t\t\t\t\t\tside: FrontSide,\n\t\t\t\t\t\tdepthTest: false,\n\t\t\t\t\t\tdepthWrite: false,\n\t\t\t\t\t\tfog: false\n\t\t\t\t\t}));\n\t\t\t\t\tplaneMesh.geometry.deleteAttribute('normal'); // enable code injection for non-built-in material\n\n\t\t\t\t\tObject.defineProperty(planeMesh.material, 'map', {\n\t\t\t\t\t\tget: function () {\n\t\t\t\t\t\t\treturn this.uniforms.t2D.value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tobjects.update(planeMesh);\n\t\t\t\t}\n\n\t\t\t\tplaneMesh.material.uniforms.t2D.value = background;\n\n\t\t\t\tif (background.matrixAutoUpdate === true) {\n\t\t\t\t\tbackground.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tplaneMesh.material.uniforms.uvTransform.value.copy(background.matrix);\n\n\t\t\t\tif (currentBackground !== background || currentBackgroundVersion !== background.version || currentTonemapping !== renderer.toneMapping) {\n\t\t\t\t\tplaneMesh.material.needsUpdate = true;\n\t\t\t\t\tcurrentBackground = background;\n\t\t\t\t\tcurrentBackgroundVersion = background.version;\n\t\t\t\t\tcurrentTonemapping = renderer.toneMapping;\n\t\t\t\t} // push to the pre-sorted opaque render list\n\n\n\t\t\t\trenderList.unshift(planeMesh, planeMesh.geometry, planeMesh.material, 0, 0, null);\n\t\t\t}\n\t\t}\n\n\t\tfunction setClear(color, alpha) {\n\t\t\tstate.buffers.color.setClear(color.r, color.g, color.b, alpha, premultipliedAlpha);\n\t\t}\n\n\t\treturn {\n\t\t\tgetClearColor: function () {\n\t\t\t\treturn clearColor;\n\t\t\t},\n\t\t\tsetClearColor: function (color, alpha = 1) {\n\t\t\t\tclearColor.set(color);\n\t\t\t\tclearAlpha = alpha;\n\t\t\t\tsetClear(clearColor, clearAlpha);\n\t\t\t},\n\t\t\tgetClearAlpha: function () {\n\t\t\t\treturn clearAlpha;\n\t\t\t},\n\t\t\tsetClearAlpha: function (alpha) {\n\t\t\t\tclearAlpha = alpha;\n\t\t\t\tsetClear(clearColor, clearAlpha);\n\t\t\t},\n\t\t\trender: render\n\t\t};\n\t}\n\n\tfunction WebGLBindingStates(gl, extensions, attributes, capabilities) {\n\t\tconst maxVertexAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\t\tconst extension = capabilities.isWebGL2 ? null : extensions.get('OES_vertex_array_object');\n\t\tconst vaoAvailable = capabilities.isWebGL2 || extension !== null;\n\t\tconst bindingStates = {};\n\t\tconst defaultState = createBindingState(null);\n\t\tlet currentState = defaultState;\n\n\t\tfunction setup(object, material, program, geometry, index) {\n\t\t\tlet updateBuffers = false;\n\n\t\t\tif (vaoAvailable) {\n\t\t\t\tconst state = getBindingState(geometry, program, material);\n\n\t\t\t\tif (currentState !== state) {\n\t\t\t\t\tcurrentState = state;\n\t\t\t\t\tbindVertexArrayObject(currentState.object);\n\t\t\t\t}\n\n\t\t\t\tupdateBuffers = needsUpdate(geometry, index);\n\t\t\t\tif (updateBuffers) saveCache(geometry, index);\n\t\t\t} else {\n\t\t\t\tconst wireframe = material.wireframe === true;\n\n\t\t\t\tif (currentState.geometry !== geometry.id || currentState.program !== program.id || currentState.wireframe !== wireframe) {\n\t\t\t\t\tcurrentState.geometry = geometry.id;\n\t\t\t\t\tcurrentState.program = program.id;\n\t\t\t\t\tcurrentState.wireframe = wireframe;\n\t\t\t\t\tupdateBuffers = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (object.isInstancedMesh === true) {\n\t\t\t\tupdateBuffers = true;\n\t\t\t}\n\n\t\t\tif (index !== null) {\n\t\t\t\tattributes.update(index, gl.ELEMENT_ARRAY_BUFFER);\n\t\t\t}\n\n\t\t\tif (updateBuffers) {\n\t\t\t\tsetupVertexAttributes(object, material, program, geometry);\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, attributes.get(index).buffer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction createVertexArrayObject() {\n\t\t\tif (capabilities.isWebGL2) return gl.createVertexArray();\n\t\t\treturn extension.createVertexArrayOES();\n\t\t}\n\n\t\tfunction bindVertexArrayObject(vao) {\n\t\t\tif (capabilities.isWebGL2) return gl.bindVertexArray(vao);\n\t\t\treturn extension.bindVertexArrayOES(vao);\n\t\t}\n\n\t\tfunction deleteVertexArrayObject(vao) {\n\t\t\tif (capabilities.isWebGL2) return gl.deleteVertexArray(vao);\n\t\t\treturn extension.deleteVertexArrayOES(vao);\n\t\t}\n\n\t\tfunction getBindingState(geometry, program, material) {\n\t\t\tconst wireframe = material.wireframe === true;\n\t\t\tlet programMap = bindingStates[geometry.id];\n\n\t\t\tif (programMap === undefined) {\n\t\t\t\tprogramMap = {};\n\t\t\t\tbindingStates[geometry.id] = programMap;\n\t\t\t}\n\n\t\t\tlet stateMap = programMap[program.id];\n\n\t\t\tif (stateMap === undefined) {\n\t\t\t\tstateMap = {};\n\t\t\t\tprogramMap[program.id] = stateMap;\n\t\t\t}\n\n\t\t\tlet state = stateMap[wireframe];\n\n\t\t\tif (state === undefined) {\n\t\t\t\tstate = createBindingState(createVertexArrayObject());\n\t\t\t\tstateMap[wireframe] = state;\n\t\t\t}\n\n\t\t\treturn state;\n\t\t}\n\n\t\tfunction createBindingState(vao) {\n\t\t\tconst newAttributes = [];\n\t\t\tconst enabledAttributes = [];\n\t\t\tconst attributeDivisors = [];\n\n\t\t\tfor (let i = 0; i < maxVertexAttributes; i++) {\n\t\t\t\tnewAttributes[i] = 0;\n\t\t\t\tenabledAttributes[i] = 0;\n\t\t\t\tattributeDivisors[i] = 0;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t// for backward compatibility on non-VAO support browser\n\t\t\t\tgeometry: null,\n\t\t\t\tprogram: null,\n\t\t\t\twireframe: false,\n\t\t\t\tnewAttributes: newAttributes,\n\t\t\t\tenabledAttributes: enabledAttributes,\n\t\t\t\tattributeDivisors: attributeDivisors,\n\t\t\t\tobject: vao,\n\t\t\t\tattributes: {},\n\t\t\t\tindex: null\n\t\t\t};\n\t\t}\n\n\t\tfunction needsUpdate(geometry, index) {\n\t\t\tconst cachedAttributes = currentState.attributes;\n\t\t\tconst geometryAttributes = geometry.attributes;\n\t\t\tlet attributesNum = 0;\n\n\t\t\tfor (const key in geometryAttributes) {\n\t\t\t\tconst cachedAttribute = cachedAttributes[key];\n\t\t\t\tconst geometryAttribute = geometryAttributes[key];\n\t\t\t\tif (cachedAttribute === undefined) return true;\n\t\t\t\tif (cachedAttribute.attribute !== geometryAttribute) return true;\n\t\t\t\tif (cachedAttribute.data !== geometryAttribute.data) return true;\n\t\t\t\tattributesNum++;\n\t\t\t}\n\n\t\t\tif (currentState.attributesNum !== attributesNum) return true;\n\t\t\tif (currentState.index !== index) return true;\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction saveCache(geometry, index) {\n\t\t\tconst cache = {};\n\t\t\tconst attributes = geometry.attributes;\n\t\t\tlet attributesNum = 0;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tconst attribute = attributes[key];\n\t\t\t\tconst data = {};\n\t\t\t\tdata.attribute = attribute;\n\n\t\t\t\tif (attribute.data) {\n\t\t\t\t\tdata.data = attribute.data;\n\t\t\t\t}\n\n\t\t\t\tcache[key] = data;\n\t\t\t\tattributesNum++;\n\t\t\t}\n\n\t\t\tcurrentState.attributes = cache;\n\t\t\tcurrentState.attributesNum = attributesNum;\n\t\t\tcurrentState.index = index;\n\t\t}\n\n\t\tfunction initAttributes() {\n\t\t\tconst newAttributes = currentState.newAttributes;\n\n\t\t\tfor (let i = 0, il = newAttributes.length; i < il; i++) {\n\t\t\t\tnewAttributes[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\tfunction enableAttribute(attribute) {\n\t\t\tenableAttributeAndDivisor(attribute, 0);\n\t\t}\n\n\t\tfunction enableAttributeAndDivisor(attribute, meshPerAttribute) {\n\t\t\tconst newAttributes = currentState.newAttributes;\n\t\t\tconst enabledAttributes = currentState.enabledAttributes;\n\t\t\tconst attributeDivisors = currentState.attributeDivisors;\n\t\t\tnewAttributes[attribute] = 1;\n\n\t\t\tif (enabledAttributes[attribute] === 0) {\n\t\t\t\tgl.enableVertexAttribArray(attribute);\n\t\t\t\tenabledAttributes[attribute] = 1;\n\t\t\t}\n\n\t\t\tif (attributeDivisors[attribute] !== meshPerAttribute) {\n\t\t\t\tconst extension = capabilities.isWebGL2 ? gl : extensions.get('ANGLE_instanced_arrays');\n\t\t\t\textension[capabilities.isWebGL2 ? 'vertexAttribDivisor' : 'vertexAttribDivisorANGLE'](attribute, meshPerAttribute);\n\t\t\t\tattributeDivisors[attribute] = meshPerAttribute;\n\t\t\t}\n\t\t}\n\n\t\tfunction disableUnusedAttributes() {\n\t\t\tconst newAttributes = currentState.newAttributes;\n\t\t\tconst enabledAttributes = currentState.enabledAttributes;\n\n\t\t\tfor (let i = 0, il = enabledAttributes.length; i < il; i++) {\n\t\t\t\tif (enabledAttributes[i] !== newAttributes[i]) {\n\t\t\t\t\tgl.disableVertexAttribArray(i);\n\t\t\t\t\tenabledAttributes[i] = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction vertexAttribPointer(index, size, type, normalized, stride, offset) {\n\t\t\tif (capabilities.isWebGL2 === true && (type === gl.INT || type === gl.UNSIGNED_INT)) {\n\t\t\t\tgl.vertexAttribIPointer(index, size, type, stride, offset);\n\t\t\t} else {\n\t\t\t\tgl.vertexAttribPointer(index, size, type, normalized, stride, offset);\n\t\t\t}\n\t\t}\n\n\t\tfunction setupVertexAttributes(object, material, program, geometry) {\n\t\t\tif (capabilities.isWebGL2 === false && (object.isInstancedMesh || geometry.isInstancedBufferGeometry)) {\n\t\t\t\tif (extensions.get('ANGLE_instanced_arrays') === null) return;\n\t\t\t}\n\n\t\t\tinitAttributes();\n\t\t\tconst geometryAttributes = geometry.attributes;\n\t\t\tconst programAttributes = program.getAttributes();\n\t\t\tconst materialDefaultAttributeValues = material.defaultAttributeValues;\n\n\t\t\tfor (const name in programAttributes) {\n\t\t\t\tconst programAttribute = programAttributes[name];\n\n\t\t\t\tif (programAttribute.location >= 0) {\n\t\t\t\t\tlet geometryAttribute = geometryAttributes[name];\n\n\t\t\t\t\tif (geometryAttribute === undefined) {\n\t\t\t\t\t\tif (name === 'instanceMatrix' && object.instanceMatrix) geometryAttribute = object.instanceMatrix;\n\t\t\t\t\t\tif (name === 'instanceColor' && object.instanceColor) geometryAttribute = object.instanceColor;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (geometryAttribute !== undefined) {\n\t\t\t\t\t\tconst normalized = geometryAttribute.normalized;\n\t\t\t\t\t\tconst size = geometryAttribute.itemSize;\n\t\t\t\t\t\tconst attribute = attributes.get(geometryAttribute); // TODO Attribute may not be available on context restore\n\n\t\t\t\t\t\tif (attribute === undefined) continue;\n\t\t\t\t\t\tconst buffer = attribute.buffer;\n\t\t\t\t\t\tconst type = attribute.type;\n\t\t\t\t\t\tconst bytesPerElement = attribute.bytesPerElement;\n\n\t\t\t\t\t\tif (geometryAttribute.isInterleavedBufferAttribute) {\n\t\t\t\t\t\t\tconst data = geometryAttribute.data;\n\t\t\t\t\t\t\tconst stride = data.stride;\n\t\t\t\t\t\t\tconst offset = geometryAttribute.offset;\n\n\t\t\t\t\t\t\tif (data && data.isInstancedInterleavedBuffer) {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttributeAndDivisor(programAttribute.location + i, data.meshPerAttribute);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined) {\n\t\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = data.meshPerAttribute * data.count;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttribute(programAttribute.location + i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n\n\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\tvertexAttribPointer(programAttribute.location + i, size / programAttribute.locationSize, type, normalized, stride * bytesPerElement, (offset + size / programAttribute.locationSize * i) * bytesPerElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (geometryAttribute.isInstancedBufferAttribute) {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttributeAndDivisor(programAttribute.location + i, geometryAttribute.meshPerAttribute);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (object.isInstancedMesh !== true && geometry._maxInstanceCount === undefined) {\n\t\t\t\t\t\t\t\t\tgeometry._maxInstanceCount = geometryAttribute.meshPerAttribute * geometryAttribute.count;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\t\tenableAttribute(programAttribute.location + i);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n\n\t\t\t\t\t\t\tfor (let i = 0; i < programAttribute.locationSize; i++) {\n\t\t\t\t\t\t\t\tvertexAttribPointer(programAttribute.location + i, size / programAttribute.locationSize, type, normalized, size * bytesPerElement, size / programAttribute.locationSize * i * bytesPerElement);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (materialDefaultAttributeValues !== undefined) {\n\t\t\t\t\t\tconst value = materialDefaultAttributeValues[name];\n\n\t\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\t\tswitch (value.length) {\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib2fv(programAttribute.location, value);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib3fv(programAttribute.location, value);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib4fv(programAttribute.location, value);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tgl.vertexAttrib1fv(programAttribute.location, value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdisableUnusedAttributes();\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\treset();\n\n\t\t\tfor (const geometryId in bindingStates) {\n\t\t\t\tconst programMap = bindingStates[geometryId];\n\n\t\t\t\tfor (const programId in programMap) {\n\t\t\t\t\tconst stateMap = programMap[programId];\n\n\t\t\t\t\tfor (const wireframe in stateMap) {\n\t\t\t\t\t\tdeleteVertexArrayObject(stateMap[wireframe].object);\n\t\t\t\t\t\tdelete stateMap[wireframe];\n\t\t\t\t\t}\n\n\t\t\t\t\tdelete programMap[programId];\n\t\t\t\t}\n\n\t\t\t\tdelete bindingStates[geometryId];\n\t\t\t}\n\t\t}\n\n\t\tfunction releaseStatesOfGeometry(geometry) {\n\t\t\tif (bindingStates[geometry.id] === undefined) return;\n\t\t\tconst programMap = bindingStates[geometry.id];\n\n\t\t\tfor (const programId in programMap) {\n\t\t\t\tconst stateMap = programMap[programId];\n\n\t\t\t\tfor (const wireframe in stateMap) {\n\t\t\t\t\tdeleteVertexArrayObject(stateMap[wireframe].object);\n\t\t\t\t\tdelete stateMap[wireframe];\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[programId];\n\t\t\t}\n\n\t\t\tdelete bindingStates[geometry.id];\n\t\t}\n\n\t\tfunction releaseStatesOfProgram(program) {\n\t\t\tfor (const geometryId in bindingStates) {\n\t\t\t\tconst programMap = bindingStates[geometryId];\n\t\t\t\tif (programMap[program.id] === undefined) continue;\n\t\t\t\tconst stateMap = programMap[program.id];\n\n\t\t\t\tfor (const wireframe in stateMap) {\n\t\t\t\t\tdeleteVertexArrayObject(stateMap[wireframe].object);\n\t\t\t\t\tdelete stateMap[wireframe];\n\t\t\t\t}\n\n\t\t\t\tdelete programMap[program.id];\n\t\t\t}\n\t\t}\n\n\t\tfunction reset() {\n\t\t\tresetDefaultState();\n\t\t\tif (currentState === defaultState) return;\n\t\t\tcurrentState = defaultState;\n\t\t\tbindVertexArrayObject(currentState.object);\n\t\t} // for backward-compatilibity\n\n\n\t\tfunction resetDefaultState() {\n\t\t\tdefaultState.geometry = null;\n\t\t\tdefaultState.program = null;\n\t\t\tdefaultState.wireframe = false;\n\t\t}\n\n\t\treturn {\n\t\t\tsetup: setup,\n\t\t\treset: reset,\n\t\t\tresetDefaultState: resetDefaultState,\n\t\t\tdispose: dispose,\n\t\t\treleaseStatesOfGeometry: releaseStatesOfGeometry,\n\t\t\treleaseStatesOfProgram: releaseStatesOfProgram,\n\t\t\tinitAttributes: initAttributes,\n\t\t\tenableAttribute: enableAttribute,\n\t\t\tdisableUnusedAttributes: disableUnusedAttributes\n\t\t};\n\t}\n\n\tfunction WebGLBufferRenderer(gl, extensions, info, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tlet mode;\n\n\t\tfunction setMode(value) {\n\t\t\tmode = value;\n\t\t}\n\n\t\tfunction render(start, count) {\n\t\t\tgl.drawArrays(mode, start, count);\n\t\t\tinfo.update(count, mode, 1);\n\t\t}\n\n\t\tfunction renderInstances(start, count, primcount) {\n\t\t\tif (primcount === 0) return;\n\t\t\tlet extension, methodName;\n\n\t\t\tif (isWebGL2) {\n\t\t\t\textension = gl;\n\t\t\t\tmethodName = 'drawArraysInstanced';\n\t\t\t} else {\n\t\t\t\textension = extensions.get('ANGLE_instanced_arrays');\n\t\t\t\tmethodName = 'drawArraysInstancedANGLE';\n\n\t\t\t\tif (extension === null) {\n\t\t\t\t\tconsole.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\textension[methodName](mode, start, count, primcount);\n\t\t\tinfo.update(count, mode, primcount);\n\t\t} //\n\n\n\t\tthis.setMode = setMode;\n\t\tthis.render = render;\n\t\tthis.renderInstances = renderInstances;\n\t}\n\n\tfunction WebGLCapabilities(gl, extensions, parameters) {\n\t\tlet maxAnisotropy;\n\n\t\tfunction getMaxAnisotropy() {\n\t\t\tif (maxAnisotropy !== undefined) return maxAnisotropy;\n\n\t\t\tif (extensions.has('EXT_texture_filter_anisotropic') === true) {\n\t\t\t\tconst extension = extensions.get('EXT_texture_filter_anisotropic');\n\t\t\t\tmaxAnisotropy = gl.getParameter(extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT);\n\t\t\t} else {\n\t\t\t\tmaxAnisotropy = 0;\n\t\t\t}\n\n\t\t\treturn maxAnisotropy;\n\t\t}\n\n\t\tfunction getMaxPrecision(precision) {\n\t\t\tif (precision === 'highp') {\n\t\t\t\tif (gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision > 0 && gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.HIGH_FLOAT).precision > 0) {\n\t\t\t\t\treturn 'highp';\n\t\t\t\t}\n\n\t\t\t\tprecision = 'mediump';\n\t\t\t}\n\n\t\t\tif (precision === 'mediump') {\n\t\t\t\tif (gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.MEDIUM_FLOAT).precision > 0 && gl.getShaderPrecisionFormat(gl.FRAGMENT_SHADER, gl.MEDIUM_FLOAT).precision > 0) {\n\t\t\t\t\treturn 'mediump';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 'lowp';\n\t\t}\n\t\t/* eslint-disable no-undef */\n\n\n\t\tconst isWebGL2 = typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext || typeof WebGL2ComputeRenderingContext !== 'undefined' && gl instanceof WebGL2ComputeRenderingContext;\n\t\t/* eslint-enable no-undef */\n\n\t\tlet precision = parameters.precision !== undefined ? parameters.precision : 'highp';\n\t\tconst maxPrecision = getMaxPrecision(precision);\n\n\t\tif (maxPrecision !== precision) {\n\t\t\tconsole.warn('THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.');\n\t\t\tprecision = maxPrecision;\n\t\t}\n\n\t\tconst drawBuffers = isWebGL2 || extensions.has('WEBGL_draw_buffers');\n\t\tconst logarithmicDepthBuffer = parameters.logarithmicDepthBuffer === true;\n\t\tconst maxTextures = gl.getParameter(gl.MAX_TEXTURE_IMAGE_UNITS);\n\t\tconst maxVertexTextures = gl.getParameter(gl.MAX_VERTEX_TEXTURE_IMAGE_UNITS);\n\t\tconst maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n\t\tconst maxCubemapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n\t\tconst maxAttributes = gl.getParameter(gl.MAX_VERTEX_ATTRIBS);\n\t\tconst maxVertexUniforms = gl.getParameter(gl.MAX_VERTEX_UNIFORM_VECTORS);\n\t\tconst maxVaryings = gl.getParameter(gl.MAX_VARYING_VECTORS);\n\t\tconst maxFragmentUniforms = gl.getParameter(gl.MAX_FRAGMENT_UNIFORM_VECTORS);\n\t\tconst vertexTextures = maxVertexTextures > 0;\n\t\tconst floatFragmentTextures = isWebGL2 || extensions.has('OES_texture_float');\n\t\tconst floatVertexTextures = vertexTextures && floatFragmentTextures;\n\t\tconst maxSamples = isWebGL2 ? gl.getParameter(gl.MAX_SAMPLES) : 0;\n\t\treturn {\n\t\t\tisWebGL2: isWebGL2,\n\t\t\tdrawBuffers: drawBuffers,\n\t\t\tgetMaxAnisotropy: getMaxAnisotropy,\n\t\t\tgetMaxPrecision: getMaxPrecision,\n\t\t\tprecision: precision,\n\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\t\tmaxTextures: maxTextures,\n\t\t\tmaxVertexTextures: maxVertexTextures,\n\t\t\tmaxTextureSize: maxTextureSize,\n\t\t\tmaxCubemapSize: maxCubemapSize,\n\t\t\tmaxAttributes: maxAttributes,\n\t\t\tmaxVertexUniforms: maxVertexUniforms,\n\t\t\tmaxVaryings: maxVaryings,\n\t\t\tmaxFragmentUniforms: maxFragmentUniforms,\n\t\t\tvertexTextures: vertexTextures,\n\t\t\tfloatFragmentTextures: floatFragmentTextures,\n\t\t\tfloatVertexTextures: floatVertexTextures,\n\t\t\tmaxSamples: maxSamples\n\t\t};\n\t}\n\n\tfunction WebGLClipping(properties) {\n\t\tconst scope = this;\n\t\tlet globalState = null,\n\t\t\t\tnumGlobalPlanes = 0,\n\t\t\t\tlocalClippingEnabled = false,\n\t\t\t\trenderingShadows = false;\n\t\tconst plane = new Plane(),\n\t\t\t\t\tviewNormalMatrix = new Matrix3(),\n\t\t\t\t\tuniform = {\n\t\t\tvalue: null,\n\t\t\tneedsUpdate: false\n\t\t};\n\t\tthis.uniform = uniform;\n\t\tthis.numPlanes = 0;\n\t\tthis.numIntersection = 0;\n\n\t\tthis.init = function (planes, enableLocalClipping, camera) {\n\t\t\tconst enabled = planes.length !== 0 || enableLocalClipping || // enable state of previous frame - the clipping code has to\n\t\t\t// run another frame in order to reset the state:\n\t\t\tnumGlobalPlanes !== 0 || localClippingEnabled;\n\t\t\tlocalClippingEnabled = enableLocalClipping;\n\t\t\tglobalState = projectPlanes(planes, camera, 0);\n\t\t\tnumGlobalPlanes = planes.length;\n\t\t\treturn enabled;\n\t\t};\n\n\t\tthis.beginShadows = function () {\n\t\t\trenderingShadows = true;\n\t\t\tprojectPlanes(null);\n\t\t};\n\n\t\tthis.endShadows = function () {\n\t\t\trenderingShadows = false;\n\t\t\tresetGlobalState();\n\t\t};\n\n\t\tthis.setState = function (material, camera, useCache) {\n\t\t\tconst planes = material.clippingPlanes,\n\t\t\t\t\t\tclipIntersection = material.clipIntersection,\n\t\t\t\t\t\tclipShadows = material.clipShadows;\n\t\t\tconst materialProperties = properties.get(material);\n\n\t\t\tif (!localClippingEnabled || planes === null || planes.length === 0 || renderingShadows && !clipShadows) {\n\t\t\t\t// there's no local clipping\n\t\t\t\tif (renderingShadows) {\n\t\t\t\t\t// there's no global clipping\n\t\t\t\t\tprojectPlanes(null);\n\t\t\t\t} else {\n\t\t\t\t\tresetGlobalState();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst nGlobal = renderingShadows ? 0 : numGlobalPlanes,\n\t\t\t\t\t\t\tlGlobal = nGlobal * 4;\n\t\t\t\tlet dstArray = materialProperties.clippingState || null;\n\t\t\t\tuniform.value = dstArray; // ensure unique state\n\n\t\t\t\tdstArray = projectPlanes(planes, camera, lGlobal, useCache);\n\n\t\t\t\tfor (let i = 0; i !== lGlobal; ++i) {\n\t\t\t\t\tdstArray[i] = globalState[i];\n\t\t\t\t}\n\n\t\t\t\tmaterialProperties.clippingState = dstArray;\n\t\t\t\tthis.numIntersection = clipIntersection ? this.numPlanes : 0;\n\t\t\t\tthis.numPlanes += nGlobal;\n\t\t\t}\n\t\t};\n\n\t\tfunction resetGlobalState() {\n\t\t\tif (uniform.value !== globalState) {\n\t\t\t\tuniform.value = globalState;\n\t\t\t\tuniform.needsUpdate = numGlobalPlanes > 0;\n\t\t\t}\n\n\t\t\tscope.numPlanes = numGlobalPlanes;\n\t\t\tscope.numIntersection = 0;\n\t\t}\n\n\t\tfunction projectPlanes(planes, camera, dstOffset, skipTransform) {\n\t\t\tconst nPlanes = planes !== null ? planes.length : 0;\n\t\t\tlet dstArray = null;\n\n\t\t\tif (nPlanes !== 0) {\n\t\t\t\tdstArray = uniform.value;\n\n\t\t\t\tif (skipTransform !== true || dstArray === null) {\n\t\t\t\t\tconst flatSize = dstOffset + nPlanes * 4,\n\t\t\t\t\t\t\t\tviewMatrix = camera.matrixWorldInverse;\n\t\t\t\t\tviewNormalMatrix.getNormalMatrix(viewMatrix);\n\n\t\t\t\t\tif (dstArray === null || dstArray.length < flatSize) {\n\t\t\t\t\t\tdstArray = new Float32Array(flatSize);\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let i = 0, i4 = dstOffset; i !== nPlanes; ++i, i4 += 4) {\n\t\t\t\t\t\tplane.copy(planes[i]).applyMatrix4(viewMatrix, viewNormalMatrix);\n\t\t\t\t\t\tplane.normal.toArray(dstArray, i4);\n\t\t\t\t\t\tdstArray[i4 + 3] = plane.constant;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tuniform.value = dstArray;\n\t\t\t\tuniform.needsUpdate = true;\n\t\t\t}\n\n\t\t\tscope.numPlanes = nPlanes;\n\t\t\tscope.numIntersection = 0;\n\t\t\treturn dstArray;\n\t\t}\n\t}\n\n\tfunction WebGLCubeMaps(renderer) {\n\t\tlet cubemaps = new WeakMap();\n\n\t\tfunction mapTextureMapping(texture, mapping) {\n\t\t\tif (mapping === EquirectangularReflectionMapping) {\n\t\t\t\ttexture.mapping = CubeReflectionMapping;\n\t\t\t} else if (mapping === EquirectangularRefractionMapping) {\n\t\t\t\ttexture.mapping = CubeRefractionMapping;\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tfunction get(texture) {\n\t\t\tif (texture && texture.isTexture && texture.isRenderTargetTexture === false) {\n\t\t\t\tconst mapping = texture.mapping;\n\n\t\t\t\tif (mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping) {\n\t\t\t\t\tif (cubemaps.has(texture)) {\n\t\t\t\t\t\tconst cubemap = cubemaps.get(texture).texture;\n\t\t\t\t\t\treturn mapTextureMapping(cubemap, texture.mapping);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif (image && image.height > 0) {\n\t\t\t\t\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\t\t\t\t\tconst renderTarget = new WebGLCubeRenderTarget(image.height / 2);\n\t\t\t\t\t\t\trenderTarget.fromEquirectangularTexture(renderer, texture);\n\t\t\t\t\t\t\tcubemaps.set(texture, renderTarget);\n\t\t\t\t\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t\t\t\t\t\ttexture.addEventListener('dispose', onTextureDispose);\n\t\t\t\t\t\t\treturn mapTextureMapping(renderTarget.texture, texture.mapping);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tfunction onTextureDispose(event) {\n\t\t\tconst texture = event.target;\n\t\t\ttexture.removeEventListener('dispose', onTextureDispose);\n\t\t\tconst cubemap = cubemaps.get(texture);\n\n\t\t\tif (cubemap !== undefined) {\n\t\t\t\tcubemaps.delete(texture);\n\t\t\t\tcubemap.dispose();\n\t\t\t}\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tcubemaps = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tclass OrthographicCamera extends Camera {\n\t\tconstructor(left = -1, right = 1, top = 1, bottom = -1, near = 0.1, far = 2000) {\n\t\t\tsuper();\n\t\t\tthis.type = 'OrthographicCamera';\n\t\t\tthis.zoom = 1;\n\t\t\tthis.view = null;\n\t\t\tthis.left = left;\n\t\t\tthis.right = right;\n\t\t\tthis.top = top;\n\t\t\tthis.bottom = bottom;\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tthis.left = source.left;\n\t\t\tthis.right = source.right;\n\t\t\tthis.top = source.top;\n\t\t\tthis.bottom = source.bottom;\n\t\t\tthis.near = source.near;\n\t\t\tthis.far = source.far;\n\t\t\tthis.zoom = source.zoom;\n\t\t\tthis.view = source.view === null ? null : Object.assign({}, source.view);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetViewOffset(fullWidth, fullHeight, x, y, width, height) {\n\t\t\tif (this.view === null) {\n\t\t\t\tthis.view = {\n\t\t\t\t\tenabled: true,\n\t\t\t\t\tfullWidth: 1,\n\t\t\t\t\tfullHeight: 1,\n\t\t\t\t\toffsetX: 0,\n\t\t\t\t\toffsetY: 0,\n\t\t\t\t\twidth: 1,\n\t\t\t\t\theight: 1\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tthis.view.enabled = true;\n\t\t\tthis.view.fullWidth = fullWidth;\n\t\t\tthis.view.fullHeight = fullHeight;\n\t\t\tthis.view.offsetX = x;\n\t\t\tthis.view.offsetY = y;\n\t\t\tthis.view.width = width;\n\t\t\tthis.view.height = height;\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tclearViewOffset() {\n\t\t\tif (this.view !== null) {\n\t\t\t\tthis.view.enabled = false;\n\t\t\t}\n\n\t\t\tthis.updateProjectionMatrix();\n\t\t}\n\n\t\tupdateProjectionMatrix() {\n\t\t\tconst dx = (this.right - this.left) / (2 * this.zoom);\n\t\t\tconst dy = (this.top - this.bottom) / (2 * this.zoom);\n\t\t\tconst cx = (this.right + this.left) / 2;\n\t\t\tconst cy = (this.top + this.bottom) / 2;\n\t\t\tlet left = cx - dx;\n\t\t\tlet right = cx + dx;\n\t\t\tlet top = cy + dy;\n\t\t\tlet bottom = cy - dy;\n\n\t\t\tif (this.view !== null && this.view.enabled) {\n\t\t\t\tconst scaleW = (this.right - this.left) / this.view.fullWidth / this.zoom;\n\t\t\t\tconst scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n\t\t\t\tleft += scaleW * this.view.offsetX;\n\t\t\t\tright = left + scaleW * this.view.width;\n\t\t\t\ttop -= scaleH * this.view.offsetY;\n\t\t\t\tbottom = top - scaleH * this.view.height;\n\t\t\t}\n\n\t\t\tthis.projectionMatrix.makeOrthographic(left, right, top, bottom, this.near, this.far);\n\t\t\tthis.projectionMatrixInverse.copy(this.projectionMatrix).invert();\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.zoom = this.zoom;\n\t\t\tdata.object.left = this.left;\n\t\t\tdata.object.right = this.right;\n\t\t\tdata.object.top = this.top;\n\t\t\tdata.object.bottom = this.bottom;\n\t\t\tdata.object.near = this.near;\n\t\t\tdata.object.far = this.far;\n\t\t\tif (this.view !== null) data.object.view = Object.assign({}, this.view);\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tOrthographicCamera.prototype.isOrthographicCamera = true;\n\n\tclass RawShaderMaterial extends ShaderMaterial {\n\t\tconstructor(parameters) {\n\t\t\tsuper(parameters);\n\t\t\tthis.type = 'RawShaderMaterial';\n\t\t}\n\n\t}\n\n\tRawShaderMaterial.prototype.isRawShaderMaterial = true;\n\n\tconst LOD_MIN = 4;\n\tconst LOD_MAX = 8;\n\tconst SIZE_MAX = Math.pow(2, LOD_MAX); // The standard deviations (radians) associated with the extra mips. These are\n\t// chosen to approximate a Trowbridge-Reitz distribution function times the\n\t// geometric shadowing function. These sigma values squared must match the\n\t// variance #defines in cube_uv_reflection_fragment.glsl.js.\n\n\tconst EXTRA_LOD_SIGMA = [0.125, 0.215, 0.35, 0.446, 0.526, 0.582];\n\tconst TOTAL_LODS = LOD_MAX - LOD_MIN + 1 + EXTRA_LOD_SIGMA.length; // The maximum length of the blur for loop. Smaller sigmas will use fewer\n\t// samples and exit early, but not recompile the shader.\n\n\tconst MAX_SAMPLES = 20;\n\tconst ENCODINGS = {\n\t\t[LinearEncoding]: 0,\n\t\t[sRGBEncoding]: 1,\n\t\t[RGBEEncoding]: 2,\n\t\t[RGBM7Encoding]: 3,\n\t\t[RGBM16Encoding]: 4,\n\t\t[RGBDEncoding]: 5,\n\t\t[GammaEncoding]: 6\n\t};\n\n\tconst _flatCamera = /*@__PURE__*/new OrthographicCamera();\n\n\tconst {\n\t\t_lodPlanes,\n\t\t_sizeLods,\n\t\t_sigmas\n\t} = /*@__PURE__*/_createPlanes();\n\n\tconst _clearColor = /*@__PURE__*/new Color();\n\n\tlet _oldTarget = null; // Golden Ratio\n\n\tconst PHI = (1 + Math.sqrt(5)) / 2;\n\tconst INV_PHI = 1 / PHI; // Vertices of a dodecahedron (except the opposites, which represent the\n\t// same axis), used as axis directions evenly spread on a sphere.\n\n\tconst _axisDirections = [/*@__PURE__*/new Vector3(1, 1, 1), /*@__PURE__*/new Vector3(-1, 1, 1), /*@__PURE__*/new Vector3(1, 1, -1), /*@__PURE__*/new Vector3(-1, 1, -1), /*@__PURE__*/new Vector3(0, PHI, INV_PHI), /*@__PURE__*/new Vector3(0, PHI, -INV_PHI), /*@__PURE__*/new Vector3(INV_PHI, 0, PHI), /*@__PURE__*/new Vector3(-INV_PHI, 0, PHI), /*@__PURE__*/new Vector3(PHI, INV_PHI, 0), /*@__PURE__*/new Vector3(-PHI, INV_PHI, 0)];\n\t/**\n\t * This class generates a Prefiltered, Mipmapped Radiance Environment Map\n\t * (PMREM) from a cubeMap environment texture. This allows different levels of\n\t * blur to be quickly accessed based on material roughness. It is packed into a\n\t * special CubeUV format that allows us to perform custom interpolation so that\n\t * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap\n\t * chain, it only goes down to the LOD_MIN level (above), and then creates extra\n\t * even more filtered 'mips' at the same LOD_MIN resolution, associated with\n\t * higher roughness levels. In this way we maintain resolution to smoothly\n\t * interpolate diffuse lighting while limiting sampling computation.\n\t *\n\t * Paper: Fast, Accurate Image-Based Lighting\n\t * https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view\n\t*/\n\n\tclass PMREMGenerator {\n\t\tconstructor(renderer) {\n\t\t\tthis._renderer = renderer;\n\t\t\tthis._pingPongRenderTarget = null;\n\t\t\tthis._blurMaterial = _getBlurShader(MAX_SAMPLES);\n\t\t\tthis._equirectShader = null;\n\t\t\tthis._cubemapShader = null;\n\n\t\t\tthis._compileMaterial(this._blurMaterial);\n\t\t}\n\t\t/**\n\t\t * Generates a PMREM from a supplied Scene, which can be faster than using an\n\t\t * image if networking bandwidth is low. Optional sigma specifies a blur radius\n\t\t * in radians to be applied to the scene before PMREM generation. Optional near\n\t\t * and far planes ensure the scene is rendered in its entirety (the cubeCamera\n\t\t * is placed at the origin).\n\t\t */\n\n\n\t\tfromScene(scene, sigma = 0, near = 0.1, far = 100) {\n\t\t\t_oldTarget = this._renderer.getRenderTarget();\n\n\t\t\tconst cubeUVRenderTarget = this._allocateTargets();\n\n\t\t\tthis._sceneToCubeUV(scene, near, far, cubeUVRenderTarget);\n\n\t\t\tif (sigma > 0) {\n\t\t\t\tthis._blur(cubeUVRenderTarget, 0, 0, sigma);\n\t\t\t}\n\n\t\t\tthis._applyPMREM(cubeUVRenderTarget);\n\n\t\t\tthis._cleanup(cubeUVRenderTarget);\n\n\t\t\treturn cubeUVRenderTarget;\n\t\t}\n\t\t/**\n\t\t * Generates a PMREM from an equirectangular texture, which can be either LDR\n\t\t * (RGBFormat) or HDR (RGBEFormat). The ideal input image size is 1k (1024 x 512),\n\t\t * as this matches best with the 256 x 256 cubemap output.\n\t\t */\n\n\n\t\tfromEquirectangular(equirectangular) {\n\t\t\treturn this._fromTexture(equirectangular);\n\t\t}\n\t\t/**\n\t\t * Generates a PMREM from an cubemap texture, which can be either LDR\n\t\t * (RGBFormat) or HDR (RGBEFormat). The ideal input cube size is 256 x 256,\n\t\t * as this matches best with the 256 x 256 cubemap output.\n\t\t */\n\n\n\t\tfromCubemap(cubemap) {\n\t\t\treturn this._fromTexture(cubemap);\n\t\t}\n\t\t/**\n\t\t * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during\n\t\t * your texture's network fetch for increased concurrency.\n\t\t */\n\n\n\t\tcompileCubemapShader() {\n\t\t\tif (this._cubemapShader === null) {\n\t\t\t\tthis._cubemapShader = _getCubemapShader();\n\n\t\t\t\tthis._compileMaterial(this._cubemapShader);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during\n\t\t * your texture's network fetch for increased concurrency.\n\t\t */\n\n\n\t\tcompileEquirectangularShader() {\n\t\t\tif (this._equirectShader === null) {\n\t\t\t\tthis._equirectShader = _getEquirectShader();\n\n\t\t\t\tthis._compileMaterial(this._equirectShader);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class,\n\t\t * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on\n\t\t * one of them will cause any others to also become unusable.\n\t\t */\n\n\n\t\tdispose() {\n\t\t\tthis._blurMaterial.dispose();\n\n\t\t\tif (this._cubemapShader !== null) this._cubemapShader.dispose();\n\t\t\tif (this._equirectShader !== null) this._equirectShader.dispose();\n\n\t\t\tfor (let i = 0; i < _lodPlanes.length; i++) {\n\t\t\t\t_lodPlanes[i].dispose();\n\t\t\t}\n\t\t} // private interface\n\n\n\t\t_cleanup(outputTarget) {\n\t\t\tthis._pingPongRenderTarget.dispose();\n\n\t\t\tthis._renderer.setRenderTarget(_oldTarget);\n\n\t\t\toutputTarget.scissorTest = false;\n\n\t\t\t_setViewport(outputTarget, 0, 0, outputTarget.width, outputTarget.height);\n\t\t}\n\n\t\t_fromTexture(texture) {\n\t\t\t_oldTarget = this._renderer.getRenderTarget();\n\n\t\t\tconst cubeUVRenderTarget = this._allocateTargets(texture);\n\n\t\t\tthis._textureToCubeUV(texture, cubeUVRenderTarget);\n\n\t\t\tthis._applyPMREM(cubeUVRenderTarget);\n\n\t\t\tthis._cleanup(cubeUVRenderTarget);\n\n\t\t\treturn cubeUVRenderTarget;\n\t\t}\n\n\t\t_allocateTargets(texture) {\n\t\t\t// warning: null texture is valid\n\t\t\tconst params = {\n\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\tminFilter: NearestFilter,\n\t\t\t\tgenerateMipmaps: false,\n\t\t\t\ttype: UnsignedByteType,\n\t\t\t\tformat: RGBEFormat,\n\t\t\t\tencoding: _isLDR(texture) ? texture.encoding : RGBEEncoding,\n\t\t\t\tdepthBuffer: false\n\t\t\t};\n\n\t\t\tconst cubeUVRenderTarget = _createRenderTarget(params);\n\n\t\t\tcubeUVRenderTarget.depthBuffer = texture ? false : true;\n\t\t\tthis._pingPongRenderTarget = _createRenderTarget(params);\n\t\t\treturn cubeUVRenderTarget;\n\t\t}\n\n\t\t_compileMaterial(material) {\n\t\t\tconst tmpMesh = new Mesh(_lodPlanes[0], material);\n\n\t\t\tthis._renderer.compile(tmpMesh, _flatCamera);\n\t\t}\n\n\t\t_sceneToCubeUV(scene, near, far, cubeUVRenderTarget) {\n\t\t\tconst fov = 90;\n\t\t\tconst aspect = 1;\n\t\t\tconst cubeCamera = new PerspectiveCamera(fov, aspect, near, far);\n\t\t\tconst upSign = [1, -1, 1, 1, 1, 1];\n\t\t\tconst forwardSign = [1, 1, 1, -1, -1, -1];\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst originalAutoClear = renderer.autoClear;\n\t\t\tconst outputEncoding = renderer.outputEncoding;\n\t\t\tconst toneMapping = renderer.toneMapping;\n\t\t\trenderer.getClearColor(_clearColor);\n\t\t\trenderer.toneMapping = NoToneMapping;\n\t\t\trenderer.outputEncoding = LinearEncoding;\n\t\t\trenderer.autoClear = false;\n\t\t\tconst backgroundMaterial = new MeshBasicMaterial({\n\t\t\t\tname: 'PMREM.Background',\n\t\t\t\tside: BackSide,\n\t\t\t\tdepthWrite: false,\n\t\t\t\tdepthTest: false\n\t\t\t});\n\t\t\tconst backgroundBox = new Mesh(new BoxGeometry(), backgroundMaterial);\n\t\t\tlet useSolidColor = false;\n\t\t\tconst background = scene.background;\n\n\t\t\tif (background) {\n\t\t\t\tif (background.isColor) {\n\t\t\t\t\tbackgroundMaterial.color.copy(background);\n\t\t\t\t\tscene.background = null;\n\t\t\t\t\tuseSolidColor = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbackgroundMaterial.color.copy(_clearColor);\n\t\t\t\tuseSolidColor = true;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tconst col = i % 3;\n\n\t\t\t\tif (col == 0) {\n\t\t\t\t\tcubeCamera.up.set(0, upSign[i], 0);\n\t\t\t\t\tcubeCamera.lookAt(forwardSign[i], 0, 0);\n\t\t\t\t} else if (col == 1) {\n\t\t\t\t\tcubeCamera.up.set(0, 0, upSign[i]);\n\t\t\t\t\tcubeCamera.lookAt(0, forwardSign[i], 0);\n\t\t\t\t} else {\n\t\t\t\t\tcubeCamera.up.set(0, upSign[i], 0);\n\t\t\t\t\tcubeCamera.lookAt(0, 0, forwardSign[i]);\n\t\t\t\t}\n\n\t\t\t\t_setViewport(cubeUVRenderTarget, col * SIZE_MAX, i > 2 ? SIZE_MAX : 0, SIZE_MAX, SIZE_MAX);\n\n\t\t\t\trenderer.setRenderTarget(cubeUVRenderTarget);\n\n\t\t\t\tif (useSolidColor) {\n\t\t\t\t\trenderer.render(backgroundBox, cubeCamera);\n\t\t\t\t}\n\n\t\t\t\trenderer.render(scene, cubeCamera);\n\t\t\t}\n\n\t\t\tbackgroundBox.geometry.dispose();\n\t\t\tbackgroundBox.material.dispose();\n\t\t\trenderer.toneMapping = toneMapping;\n\t\t\trenderer.outputEncoding = outputEncoding;\n\t\t\trenderer.autoClear = originalAutoClear;\n\t\t\tscene.background = background;\n\t\t}\n\n\t\t_setEncoding(uniform, texture) {\n\t\t\tif (this._renderer.capabilities.isWebGL2 === true && texture.format === RGBAFormat && texture.type === UnsignedByteType && texture.encoding === sRGBEncoding) {\n\t\t\t\tuniform.value = ENCODINGS[LinearEncoding];\n\t\t\t} else {\n\t\t\t\tuniform.value = ENCODINGS[texture.encoding];\n\t\t\t}\n\t\t}\n\n\t\t_textureToCubeUV(texture, cubeUVRenderTarget) {\n\t\t\tconst renderer = this._renderer;\n\n\t\t\tif (texture.isCubeTexture) {\n\t\t\t\tif (this._cubemapShader == null) {\n\t\t\t\t\tthis._cubemapShader = _getCubemapShader();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (this._equirectShader == null) {\n\t\t\t\t\tthis._equirectShader = _getEquirectShader();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst material = texture.isCubeTexture ? this._cubemapShader : this._equirectShader;\n\t\t\tconst mesh = new Mesh(_lodPlanes[0], material);\n\t\t\tconst uniforms = material.uniforms;\n\t\t\tuniforms['envMap'].value = texture;\n\n\t\t\tif (!texture.isCubeTexture) {\n\t\t\t\tuniforms['texelSize'].value.set(1.0 / texture.image.width, 1.0 / texture.image.height);\n\t\t\t}\n\n\t\t\tthis._setEncoding(uniforms['inputEncoding'], texture);\n\n\t\t\tthis._setEncoding(uniforms['outputEncoding'], cubeUVRenderTarget.texture);\n\n\t\t\t_setViewport(cubeUVRenderTarget, 0, 0, 3 * SIZE_MAX, 2 * SIZE_MAX);\n\n\t\t\trenderer.setRenderTarget(cubeUVRenderTarget);\n\t\t\trenderer.render(mesh, _flatCamera);\n\t\t}\n\n\t\t_applyPMREM(cubeUVRenderTarget) {\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst autoClear = renderer.autoClear;\n\t\t\trenderer.autoClear = false;\n\n\t\t\tfor (let i = 1; i < TOTAL_LODS; i++) {\n\t\t\t\tconst sigma = Math.sqrt(_sigmas[i] * _sigmas[i] - _sigmas[i - 1] * _sigmas[i - 1]);\n\t\t\t\tconst poleAxis = _axisDirections[(i - 1) % _axisDirections.length];\n\n\t\t\t\tthis._blur(cubeUVRenderTarget, i - 1, i, sigma, poleAxis);\n\t\t\t}\n\n\t\t\trenderer.autoClear = autoClear;\n\t\t}\n\t\t/**\n\t\t * This is a two-pass Gaussian blur for a cubemap. Normally this is done\n\t\t * vertically and horizontally, but this breaks down on a cube. Here we apply\n\t\t * the blur latitudinally (around the poles), and then longitudinally (towards\n\t\t * the poles) to approximate the orthogonally-separable blur. It is least\n\t\t * accurate at the poles, but still does a decent job.\n\t\t */\n\n\n\t\t_blur(cubeUVRenderTarget, lodIn, lodOut, sigma, poleAxis) {\n\t\t\tconst pingPongRenderTarget = this._pingPongRenderTarget;\n\n\t\t\tthis._halfBlur(cubeUVRenderTarget, pingPongRenderTarget, lodIn, lodOut, sigma, 'latitudinal', poleAxis);\n\n\t\t\tthis._halfBlur(pingPongRenderTarget, cubeUVRenderTarget, lodOut, lodOut, sigma, 'longitudinal', poleAxis);\n\t\t}\n\n\t\t_halfBlur(targetIn, targetOut, lodIn, lodOut, sigmaRadians, direction, poleAxis) {\n\t\t\tconst renderer = this._renderer;\n\t\t\tconst blurMaterial = this._blurMaterial;\n\n\t\t\tif (direction !== 'latitudinal' && direction !== 'longitudinal') {\n\t\t\t\tconsole.error('blur direction must be either latitudinal or longitudinal!');\n\t\t\t} // Number of standard deviations at which to cut off the discrete approximation.\n\n\n\t\t\tconst STANDARD_DEVIATIONS = 3;\n\t\t\tconst blurMesh = new Mesh(_lodPlanes[lodOut], blurMaterial);\n\t\t\tconst blurUniforms = blurMaterial.uniforms;\n\t\t\tconst pixels = _sizeLods[lodIn] - 1;\n\t\t\tconst radiansPerPixel = isFinite(sigmaRadians) ? Math.PI / (2 * pixels) : 2 * Math.PI / (2 * MAX_SAMPLES - 1);\n\t\t\tconst sigmaPixels = sigmaRadians / radiansPerPixel;\n\t\t\tconst samples = isFinite(sigmaRadians) ? 1 + Math.floor(STANDARD_DEVIATIONS * sigmaPixels) : MAX_SAMPLES;\n\n\t\t\tif (samples > MAX_SAMPLES) {\n\t\t\t\tconsole.warn(`sigmaRadians, ${sigmaRadians}, is too large and will clip, as it requested ${samples} samples when the maximum is set to ${MAX_SAMPLES}`);\n\t\t\t}\n\n\t\t\tconst weights = [];\n\t\t\tlet sum = 0;\n\n\t\t\tfor (let i = 0; i < MAX_SAMPLES; ++i) {\n\t\t\t\tconst x = i / sigmaPixels;\n\t\t\t\tconst weight = Math.exp(-x * x / 2);\n\t\t\t\tweights.push(weight);\n\n\t\t\t\tif (i == 0) {\n\t\t\t\t\tsum += weight;\n\t\t\t\t} else if (i < samples) {\n\t\t\t\t\tsum += 2 * weight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < weights.length; i++) {\n\t\t\t\tweights[i] = weights[i] / sum;\n\t\t\t}\n\n\t\t\tblurUniforms['envMap'].value = targetIn.texture;\n\t\t\tblurUniforms['samples'].value = samples;\n\t\t\tblurUniforms['weights'].value = weights;\n\t\t\tblurUniforms['latitudinal'].value = direction === 'latitudinal';\n\n\t\t\tif (poleAxis) {\n\t\t\t\tblurUniforms['poleAxis'].value = poleAxis;\n\t\t\t}\n\n\t\t\tblurUniforms['dTheta'].value = radiansPerPixel;\n\t\t\tblurUniforms['mipInt'].value = LOD_MAX - lodIn;\n\n\t\t\tthis._setEncoding(blurUniforms['inputEncoding'], targetIn.texture);\n\n\t\t\tthis._setEncoding(blurUniforms['outputEncoding'], targetIn.texture);\n\n\t\t\tconst outputSize = _sizeLods[lodOut];\n\t\t\tconst x = 3 * Math.max(0, SIZE_MAX - 2 * outputSize);\n\t\t\tconst y = (lodOut === 0 ? 0 : 2 * SIZE_MAX) + 2 * outputSize * (lodOut > LOD_MAX - LOD_MIN ? lodOut - LOD_MAX + LOD_MIN : 0);\n\n\t\t\t_setViewport(targetOut, x, y, 3 * outputSize, 2 * outputSize);\n\n\t\t\trenderer.setRenderTarget(targetOut);\n\t\t\trenderer.render(blurMesh, _flatCamera);\n\t\t}\n\n\t}\n\n\tfunction _isLDR(texture) {\n\t\tif (texture === undefined || texture.type !== UnsignedByteType) return false;\n\t\treturn texture.encoding === LinearEncoding || texture.encoding === sRGBEncoding || texture.encoding === GammaEncoding;\n\t}\n\n\tfunction _createPlanes() {\n\t\tconst _lodPlanes = [];\n\t\tconst _sizeLods = [];\n\t\tconst _sigmas = [];\n\t\tlet lod = LOD_MAX;\n\n\t\tfor (let i = 0; i < TOTAL_LODS; i++) {\n\t\t\tconst sizeLod = Math.pow(2, lod);\n\n\t\t\t_sizeLods.push(sizeLod);\n\n\t\t\tlet sigma = 1.0 / sizeLod;\n\n\t\t\tif (i > LOD_MAX - LOD_MIN) {\n\t\t\t\tsigma = EXTRA_LOD_SIGMA[i - LOD_MAX + LOD_MIN - 1];\n\t\t\t} else if (i == 0) {\n\t\t\t\tsigma = 0;\n\t\t\t}\n\n\t\t\t_sigmas.push(sigma);\n\n\t\t\tconst texelSize = 1.0 / (sizeLod - 1);\n\t\t\tconst min = -texelSize / 2;\n\t\t\tconst max = 1 + texelSize / 2;\n\t\t\tconst uv1 = [min, min, max, min, max, max, min, min, max, max, min, max];\n\t\t\tconst cubeFaces = 6;\n\t\t\tconst vertices = 6;\n\t\t\tconst positionSize = 3;\n\t\t\tconst uvSize = 2;\n\t\t\tconst faceIndexSize = 1;\n\t\t\tconst position = new Float32Array(positionSize * vertices * cubeFaces);\n\t\t\tconst uv = new Float32Array(uvSize * vertices * cubeFaces);\n\t\t\tconst faceIndex = new Float32Array(faceIndexSize * vertices * cubeFaces);\n\n\t\t\tfor (let face = 0; face < cubeFaces; face++) {\n\t\t\t\tconst x = face % 3 * 2 / 3 - 1;\n\t\t\t\tconst y = face > 2 ? 0 : -1;\n\t\t\t\tconst coordinates = [x, y, 0, x + 2 / 3, y, 0, x + 2 / 3, y + 1, 0, x, y, 0, x + 2 / 3, y + 1, 0, x, y + 1, 0];\n\t\t\t\tposition.set(coordinates, positionSize * vertices * face);\n\t\t\t\tuv.set(uv1, uvSize * vertices * face);\n\t\t\t\tconst fill = [face, face, face, face, face, face];\n\t\t\t\tfaceIndex.set(fill, faceIndexSize * vertices * face);\n\t\t\t}\n\n\t\t\tconst planes = new BufferGeometry();\n\t\t\tplanes.setAttribute('position', new BufferAttribute(position, positionSize));\n\t\t\tplanes.setAttribute('uv', new BufferAttribute(uv, uvSize));\n\t\t\tplanes.setAttribute('faceIndex', new BufferAttribute(faceIndex, faceIndexSize));\n\n\t\t\t_lodPlanes.push(planes);\n\n\t\t\tif (lod > LOD_MIN) {\n\t\t\t\tlod--;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\t_lodPlanes,\n\t\t\t_sizeLods,\n\t\t\t_sigmas\n\t\t};\n\t}\n\n\tfunction _createRenderTarget(params) {\n\t\tconst cubeUVRenderTarget = new WebGLRenderTarget(3 * SIZE_MAX, 3 * SIZE_MAX, params);\n\t\tcubeUVRenderTarget.texture.mapping = CubeUVReflectionMapping;\n\t\tcubeUVRenderTarget.texture.name = 'PMREM.cubeUv';\n\t\tcubeUVRenderTarget.scissorTest = true;\n\t\treturn cubeUVRenderTarget;\n\t}\n\n\tfunction _setViewport(target, x, y, width, height) {\n\t\ttarget.viewport.set(x, y, width, height);\n\t\ttarget.scissor.set(x, y, width, height);\n\t}\n\n\tfunction _getBlurShader(maxSamples) {\n\t\tconst weights = new Float32Array(maxSamples);\n\t\tconst poleAxis = new Vector3(0, 1, 0);\n\t\tconst shaderMaterial = new RawShaderMaterial({\n\t\t\tname: 'SphericalGaussianBlur',\n\t\t\tdefines: {\n\t\t\t\t'n': maxSamples\n\t\t\t},\n\t\t\tuniforms: {\n\t\t\t\t'envMap': {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\t'samples': {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\t'weights': {\n\t\t\t\t\tvalue: weights\n\t\t\t\t},\n\t\t\t\t'latitudinal': {\n\t\t\t\t\tvalue: false\n\t\t\t\t},\n\t\t\t\t'dTheta': {\n\t\t\t\t\tvalue: 0\n\t\t\t\t},\n\t\t\t\t'mipInt': {\n\t\t\t\t\tvalue: 0\n\t\t\t\t},\n\t\t\t\t'poleAxis': {\n\t\t\t\t\tvalue: poleAxis\n\t\t\t\t},\n\t\t\t\t'inputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t},\n\t\t\t\t'outputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: _getCommonVertexShader(),\n\t\t\tfragmentShader:\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform int samples;\n\t\t\tuniform float weights[ n ];\n\t\t\tuniform bool latitudinal;\n\t\t\tuniform float dTheta;\n\t\t\tuniform float mipInt;\n\t\t\tuniform vec3 poleAxis;\n\n\t\t\t${_getEncodings()}\n\n\t\t\t#define ENVMAP_TYPE_CUBE_UV\n\t\t\t#include <cube_uv_reflection_fragment>\n\n\t\t\tvec3 getSample( float theta, vec3 axis ) {\n\n\t\t\t\tfloat cosTheta = cos( theta );\n\t\t\t\t// Rodrigues' axis-angle rotation\n\t\t\t\tvec3 sampleDirection = vOutputDirection * cosTheta\n\t\t\t\t\t+ cross( axis, vOutputDirection ) * sin( theta )\n\t\t\t\t\t+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );\n\n\t\t\t\treturn bilinearCubeUV( envMap, sampleDirection, mipInt );\n\n\t\t\t}\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );\n\n\t\t\t\tif ( all( equal( axis, vec3( 0.0 ) ) ) ) {\n\n\t\t\t\t\taxis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );\n\n\t\t\t\t}\n\n\t\t\t\taxis = normalize( axis );\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );\n\n\t\t\t\tfor ( int i = 1; i < n; i++ ) {\n\n\t\t\t\t\tif ( i >= samples ) {\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat theta = dTheta * float( i );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );\n\t\t\t\t\tgl_FragColor.rgb += weights[ i ] * getSample( theta, axis );\n\n\t\t\t\t}\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,\n\t\t\tblending: NoBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false\n\t\t});\n\t\treturn shaderMaterial;\n\t}\n\n\tfunction _getEquirectShader() {\n\t\tconst texelSize = new Vector2(1, 1);\n\t\tconst shaderMaterial = new RawShaderMaterial({\n\t\t\tname: 'EquirectangularToCubeUV',\n\t\t\tuniforms: {\n\t\t\t\t'envMap': {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\t'texelSize': {\n\t\t\t\t\tvalue: texelSize\n\t\t\t\t},\n\t\t\t\t'inputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t},\n\t\t\t\t'outputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: _getCommonVertexShader(),\n\t\t\tfragmentShader:\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform sampler2D envMap;\n\t\t\tuniform vec2 texelSize;\n\n\t\t\t${_getEncodings()}\n\n\t\t\t#include <common>\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\n\t\t\t\tvec3 outputDirection = normalize( vOutputDirection );\n\t\t\t\tvec2 uv = equirectUv( outputDirection );\n\n\t\t\t\tvec2 f = fract( uv / texelSize - 0.5 );\n\t\t\t\tuv -= f * texelSize;\n\t\t\t\tvec3 tl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x += texelSize.x;\n\t\t\t\tvec3 tr = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.y += texelSize.y;\n\t\t\t\tvec3 br = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\t\t\t\tuv.x -= texelSize.x;\n\t\t\t\tvec3 bl = envMapTexelToLinear( texture2D ( envMap, uv ) ).rgb;\n\n\t\t\t\tvec3 tm = mix( tl, tr, f.x );\n\t\t\t\tvec3 bm = mix( bl, br, f.x );\n\t\t\t\tgl_FragColor.rgb = mix( tm, bm, f.y );\n\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,\n\t\t\tblending: NoBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false\n\t\t});\n\t\treturn shaderMaterial;\n\t}\n\n\tfunction _getCubemapShader() {\n\t\tconst shaderMaterial = new RawShaderMaterial({\n\t\t\tname: 'CubemapToCubeUV',\n\t\t\tuniforms: {\n\t\t\t\t'envMap': {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\t'inputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t},\n\t\t\t\t'outputEncoding': {\n\t\t\t\t\tvalue: ENCODINGS[LinearEncoding]\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: _getCommonVertexShader(),\n\t\t\tfragmentShader:\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\t\tprecision mediump float;\n\t\t\tprecision mediump int;\n\n\t\t\tvarying vec3 vOutputDirection;\n\n\t\t\tuniform samplerCube envMap;\n\n\t\t\t${_getEncodings()}\n\n\t\t\tvoid main() {\n\n\t\t\t\tgl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t\t\t\tgl_FragColor.rgb = envMapTexelToLinear( textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ) ).rgb;\n\t\t\t\tgl_FragColor = linearToOutputTexel( gl_FragColor );\n\n\t\t\t}\n\t\t`,\n\t\t\tblending: NoBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false\n\t\t});\n\t\treturn shaderMaterial;\n\t}\n\n\tfunction _getCommonVertexShader() {\n\t\treturn (\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\tprecision mediump float;\n\t\tprecision mediump int;\n\n\t\tattribute vec3 position;\n\t\tattribute vec2 uv;\n\t\tattribute float faceIndex;\n\n\t\tvarying vec3 vOutputDirection;\n\n\t\t// RH coordinate system; PMREM face-indexing convention\n\t\tvec3 getDirection( vec2 uv, float face ) {\n\n\t\t\tuv = 2.0 * uv - 1.0;\n\n\t\t\tvec3 direction = vec3( uv, 1.0 );\n\n\t\t\tif ( face == 0.0 ) {\n\n\t\t\t\tdirection = direction.zyx; // ( 1, v, u ) pos x\n\n\t\t\t} else if ( face == 1.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xz *= -1.0; // ( -u, 1, -v ) pos y\n\n\t\t\t} else if ( face == 2.0 ) {\n\n\t\t\t\tdirection.x *= -1.0; // ( -u, v, 1 ) pos z\n\n\t\t\t} else if ( face == 3.0 ) {\n\n\t\t\t\tdirection = direction.zyx;\n\t\t\t\tdirection.xz *= -1.0; // ( -1, v, -u ) neg x\n\n\t\t\t} else if ( face == 4.0 ) {\n\n\t\t\t\tdirection = direction.xzy;\n\t\t\t\tdirection.xy *= -1.0; // ( -u, -1, v ) neg y\n\n\t\t\t} else if ( face == 5.0 ) {\n\n\t\t\t\tdirection.z *= -1.0; // ( u, v, -1 ) neg z\n\n\t\t\t}\n\n\t\t\treturn direction;\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvOutputDirection = getDirection( uv, faceIndex );\n\t\t\tgl_Position = vec4( position, 1.0 );\n\n\t\t}\n\t`\n\t\t);\n\t}\n\n\tfunction _getEncodings() {\n\t\treturn (\n\t\t\t/* glsl */\n\t\t\t`\n\n\t\tuniform int inputEncoding;\n\t\tuniform int outputEncoding;\n\n\t\t#include <encodings_pars_fragment>\n\n\t\tvec4 inputTexelToLinear( vec4 value ) {\n\n\t\t\tif ( inputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( inputEncoding == 1 ) {\n\n\t\t\t\treturn sRGBToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 2 ) {\n\n\t\t\t\treturn RGBEToLinear( value );\n\n\t\t\t} else if ( inputEncoding == 3 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 7.0 );\n\n\t\t\t} else if ( inputEncoding == 4 ) {\n\n\t\t\t\treturn RGBMToLinear( value, 16.0 );\n\n\t\t\t} else if ( inputEncoding == 5 ) {\n\n\t\t\t\treturn RGBDToLinear( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn GammaToLinear( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 linearToOutputTexel( vec4 value ) {\n\n\t\t\tif ( outputEncoding == 0 ) {\n\n\t\t\t\treturn value;\n\n\t\t\t} else if ( outputEncoding == 1 ) {\n\n\t\t\t\treturn LinearTosRGB( value );\n\n\t\t\t} else if ( outputEncoding == 2 ) {\n\n\t\t\t\treturn LinearToRGBE( value );\n\n\t\t\t} else if ( outputEncoding == 3 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 7.0 );\n\n\t\t\t} else if ( outputEncoding == 4 ) {\n\n\t\t\t\treturn LinearToRGBM( value, 16.0 );\n\n\t\t\t} else if ( outputEncoding == 5 ) {\n\n\t\t\t\treturn LinearToRGBD( value, 256.0 );\n\n\t\t\t} else {\n\n\t\t\t\treturn LinearToGamma( value, 2.2 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tvec4 envMapTexelToLinear( vec4 color ) {\n\n\t\t\treturn inputTexelToLinear( color );\n\n\t\t}\n\t`\n\t\t);\n\t}\n\n\tfunction WebGLCubeUVMaps(renderer) {\n\t\tlet cubeUVmaps = new WeakMap();\n\t\tlet pmremGenerator = null;\n\n\t\tfunction get(texture) {\n\t\t\tif (texture && texture.isTexture && texture.isRenderTargetTexture === false) {\n\t\t\t\tconst mapping = texture.mapping;\n\t\t\t\tconst isEquirectMap = mapping === EquirectangularReflectionMapping || mapping === EquirectangularRefractionMapping;\n\t\t\t\tconst isCubeMap = mapping === CubeReflectionMapping || mapping === CubeRefractionMapping;\n\n\t\t\t\tif (isEquirectMap || isCubeMap) {\n\t\t\t\t\t// equirect/cube map to cubeUV conversion\n\t\t\t\t\tif (cubeUVmaps.has(texture)) {\n\t\t\t\t\t\treturn cubeUVmaps.get(texture).texture;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst image = texture.image;\n\n\t\t\t\t\t\tif (isEquirectMap && image && image.height > 0 || isCubeMap && image && isCubeTextureComplete(image)) {\n\t\t\t\t\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\t\t\t\t\tif (pmremGenerator === null) pmremGenerator = new PMREMGenerator(renderer);\n\t\t\t\t\t\t\tconst renderTarget = isEquirectMap ? pmremGenerator.fromEquirectangular(texture) : pmremGenerator.fromCubemap(texture);\n\t\t\t\t\t\t\tcubeUVmaps.set(texture, renderTarget);\n\t\t\t\t\t\t\trenderer.setRenderTarget(currentRenderTarget);\n\t\t\t\t\t\t\ttexture.addEventListener('dispose', onTextureDispose);\n\t\t\t\t\t\t\treturn renderTarget.texture;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// image not yet ready. try the conversion next frame\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tfunction isCubeTextureComplete(image) {\n\t\t\tlet count = 0;\n\t\t\tconst length = 6;\n\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tif (image[i] !== undefined) count++;\n\t\t\t}\n\n\t\t\treturn count === length;\n\t\t}\n\n\t\tfunction onTextureDispose(event) {\n\t\t\tconst texture = event.target;\n\t\t\ttexture.removeEventListener('dispose', onTextureDispose);\n\t\t\tconst cubemapUV = cubeUVmaps.get(texture);\n\n\t\t\tif (cubemapUV !== undefined) {\n\t\t\t\tcubeUVmaps.delete(texture);\n\t\t\t\tcubemapUV.dispose();\n\t\t\t}\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tcubeUVmaps = new WeakMap();\n\n\t\t\tif (pmremGenerator !== null) {\n\t\t\t\tpmremGenerator.dispose();\n\t\t\t\tpmremGenerator = null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tfunction WebGLExtensions(gl) {\n\t\tconst extensions = {};\n\n\t\tfunction getExtension(name) {\n\t\t\tif (extensions[name] !== undefined) {\n\t\t\t\treturn extensions[name];\n\t\t\t}\n\n\t\t\tlet extension;\n\n\t\t\tswitch (name) {\n\t\t\t\tcase 'WEBGL_depth_texture':\n\t\t\t\t\textension = gl.getExtension('WEBGL_depth_texture') || gl.getExtension('MOZ_WEBGL_depth_texture') || gl.getExtension('WEBKIT_WEBGL_depth_texture');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'EXT_texture_filter_anisotropic':\n\t\t\t\t\textension = gl.getExtension('EXT_texture_filter_anisotropic') || gl.getExtension('MOZ_EXT_texture_filter_anisotropic') || gl.getExtension('WEBKIT_EXT_texture_filter_anisotropic');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'WEBGL_compressed_texture_s3tc':\n\t\t\t\t\textension = gl.getExtension('WEBGL_compressed_texture_s3tc') || gl.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'WEBGL_compressed_texture_pvrtc':\n\t\t\t\t\textension = gl.getExtension('WEBGL_compressed_texture_pvrtc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\textension = gl.getExtension(name);\n\t\t\t}\n\n\t\t\textensions[name] = extension;\n\t\t\treturn extension;\n\t\t}\n\n\t\treturn {\n\t\t\thas: function (name) {\n\t\t\t\treturn getExtension(name) !== null;\n\t\t\t},\n\t\t\tinit: function (capabilities) {\n\t\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t\tgetExtension('EXT_color_buffer_float');\n\t\t\t\t} else {\n\t\t\t\t\tgetExtension('WEBGL_depth_texture');\n\t\t\t\t\tgetExtension('OES_texture_float');\n\t\t\t\t\tgetExtension('OES_texture_half_float');\n\t\t\t\t\tgetExtension('OES_texture_half_float_linear');\n\t\t\t\t\tgetExtension('OES_standard_derivatives');\n\t\t\t\t\tgetExtension('OES_element_index_uint');\n\t\t\t\t\tgetExtension('OES_vertex_array_object');\n\t\t\t\t\tgetExtension('ANGLE_instanced_arrays');\n\t\t\t\t}\n\n\t\t\t\tgetExtension('OES_texture_float_linear');\n\t\t\t\tgetExtension('EXT_color_buffer_half_float');\n\t\t\t},\n\t\t\tget: function (name) {\n\t\t\t\tconst extension = getExtension(name);\n\n\t\t\t\tif (extension === null) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: ' + name + ' extension not supported.');\n\t\t\t\t}\n\n\t\t\t\treturn extension;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction WebGLGeometries(gl, attributes, info, bindingStates) {\n\t\tconst geometries = {};\n\t\tconst wireframeAttributes = new WeakMap();\n\n\t\tfunction onGeometryDispose(event) {\n\t\t\tconst geometry = event.target;\n\n\t\t\tif (geometry.index !== null) {\n\t\t\t\tattributes.remove(geometry.index);\n\t\t\t}\n\n\t\t\tfor (const name in geometry.attributes) {\n\t\t\t\tattributes.remove(geometry.attributes[name]);\n\t\t\t}\n\n\t\t\tgeometry.removeEventListener('dispose', onGeometryDispose);\n\t\t\tdelete geometries[geometry.id];\n\t\t\tconst attribute = wireframeAttributes.get(geometry);\n\n\t\t\tif (attribute) {\n\t\t\t\tattributes.remove(attribute);\n\t\t\t\twireframeAttributes.delete(geometry);\n\t\t\t}\n\n\t\t\tbindingStates.releaseStatesOfGeometry(geometry);\n\n\t\t\tif (geometry.isInstancedBufferGeometry === true) {\n\t\t\t\tdelete geometry._maxInstanceCount;\n\t\t\t} //\n\n\n\t\t\tinfo.memory.geometries--;\n\t\t}\n\n\t\tfunction get(object, geometry) {\n\t\t\tif (geometries[geometry.id] === true) return geometry;\n\t\t\tgeometry.addEventListener('dispose', onGeometryDispose);\n\t\t\tgeometries[geometry.id] = true;\n\t\t\tinfo.memory.geometries++;\n\t\t\treturn geometry;\n\t\t}\n\n\t\tfunction update(geometry) {\n\t\t\tconst geometryAttributes = geometry.attributes; // Updating index buffer in VAO now. See WebGLBindingStates.\n\n\t\t\tfor (const name in geometryAttributes) {\n\t\t\t\tattributes.update(geometryAttributes[name], gl.ARRAY_BUFFER);\n\t\t\t} // morph targets\n\n\n\t\t\tconst morphAttributes = geometry.morphAttributes;\n\n\t\t\tfor (const name in morphAttributes) {\n\t\t\t\tconst array = morphAttributes[name];\n\n\t\t\t\tfor (let i = 0, l = array.length; i < l; i++) {\n\t\t\t\t\tattributes.update(array[i], gl.ARRAY_BUFFER);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateWireframeAttribute(geometry) {\n\t\t\tconst indices = [];\n\t\t\tconst geometryIndex = geometry.index;\n\t\t\tconst geometryPosition = geometry.attributes.position;\n\t\t\tlet version = 0;\n\n\t\t\tif (geometryIndex !== null) {\n\t\t\t\tconst array = geometryIndex.array;\n\t\t\t\tversion = geometryIndex.version;\n\n\t\t\t\tfor (let i = 0, l = array.length; i < l; i += 3) {\n\t\t\t\t\tconst a = array[i + 0];\n\t\t\t\t\tconst b = array[i + 1];\n\t\t\t\t\tconst c = array[i + 2];\n\t\t\t\t\tindices.push(a, b, b, c, c, a);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst array = geometryPosition.array;\n\t\t\t\tversion = geometryPosition.version;\n\n\t\t\t\tfor (let i = 0, l = array.length / 3 - 1; i < l; i += 3) {\n\t\t\t\t\tconst a = i + 0;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\t\t\t\t\tindices.push(a, b, b, c, c, a);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst attribute = new (arrayMax(indices) > 65535 ? Uint32BufferAttribute : Uint16BufferAttribute)(indices, 1);\n\t\t\tattribute.version = version; // Updating index buffer in VAO now. See WebGLBindingStates\n\t\t\t//\n\n\t\t\tconst previousAttribute = wireframeAttributes.get(geometry);\n\t\t\tif (previousAttribute) attributes.remove(previousAttribute); //\n\n\t\t\twireframeAttributes.set(geometry, attribute);\n\t\t}\n\n\t\tfunction getWireframeAttribute(geometry) {\n\t\t\tconst currentAttribute = wireframeAttributes.get(geometry);\n\n\t\t\tif (currentAttribute) {\n\t\t\t\tconst geometryIndex = geometry.index;\n\n\t\t\t\tif (geometryIndex !== null) {\n\t\t\t\t\t// if the attribute is obsolete, create a new one\n\t\t\t\t\tif (currentAttribute.version < geometryIndex.version) {\n\t\t\t\t\t\tupdateWireframeAttribute(geometry);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tupdateWireframeAttribute(geometry);\n\t\t\t}\n\n\t\t\treturn wireframeAttributes.get(geometry);\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tupdate: update,\n\t\t\tgetWireframeAttribute: getWireframeAttribute\n\t\t};\n\t}\n\n\tfunction WebGLIndexedBufferRenderer(gl, extensions, info, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tlet mode;\n\n\t\tfunction setMode(value) {\n\t\t\tmode = value;\n\t\t}\n\n\t\tlet type, bytesPerElement;\n\n\t\tfunction setIndex(value) {\n\t\t\ttype = value.type;\n\t\t\tbytesPerElement = value.bytesPerElement;\n\t\t}\n\n\t\tfunction render(start, count) {\n\t\t\tgl.drawElements(mode, count, type, start * bytesPerElement);\n\t\t\tinfo.update(count, mode, 1);\n\t\t}\n\n\t\tfunction renderInstances(start, count, primcount) {\n\t\t\tif (primcount === 0) return;\n\t\t\tlet extension, methodName;\n\n\t\t\tif (isWebGL2) {\n\t\t\t\textension = gl;\n\t\t\t\tmethodName = 'drawElementsInstanced';\n\t\t\t} else {\n\t\t\t\textension = extensions.get('ANGLE_instanced_arrays');\n\t\t\t\tmethodName = 'drawElementsInstancedANGLE';\n\n\t\t\t\tif (extension === null) {\n\t\t\t\t\tconsole.error('THREE.WebGLIndexedBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\textension[methodName](mode, count, type, start * bytesPerElement, primcount);\n\t\t\tinfo.update(count, mode, primcount);\n\t\t} //\n\n\n\t\tthis.setMode = setMode;\n\t\tthis.setIndex = setIndex;\n\t\tthis.render = render;\n\t\tthis.renderInstances = renderInstances;\n\t}\n\n\tfunction WebGLInfo(gl) {\n\t\tconst memory = {\n\t\t\tgeometries: 0,\n\t\t\ttextures: 0\n\t\t};\n\t\tconst render = {\n\t\t\tframe: 0,\n\t\t\tcalls: 0,\n\t\t\ttriangles: 0,\n\t\t\tpoints: 0,\n\t\t\tlines: 0\n\t\t};\n\n\t\tfunction update(count, mode, instanceCount) {\n\t\t\trender.calls++;\n\n\t\t\tswitch (mode) {\n\t\t\t\tcase gl.TRIANGLES:\n\t\t\t\t\trender.triangles += instanceCount * (count / 3);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.LINES:\n\t\t\t\t\trender.lines += instanceCount * (count / 2);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.LINE_STRIP:\n\t\t\t\t\trender.lines += instanceCount * (count - 1);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.LINE_LOOP:\n\t\t\t\t\trender.lines += instanceCount * count;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase gl.POINTS:\n\t\t\t\t\trender.points += instanceCount * count;\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.error('THREE.WebGLInfo: Unknown draw mode:', mode);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tfunction reset() {\n\t\t\trender.frame++;\n\t\t\trender.calls = 0;\n\t\t\trender.triangles = 0;\n\t\t\trender.points = 0;\n\t\t\trender.lines = 0;\n\t\t}\n\n\t\treturn {\n\t\t\tmemory: memory,\n\t\t\trender: render,\n\t\t\tprograms: null,\n\t\t\tautoReset: true,\n\t\t\treset: reset,\n\t\t\tupdate: update\n\t\t};\n\t}\n\n\tclass DataTexture2DArray extends Texture {\n\t\tconstructor(data = null, width = 1, height = 1, depth = 1) {\n\t\t\tsuper(null);\n\t\t\tthis.image = {\n\t\t\t\tdata,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tdepth\n\t\t\t};\n\t\t\tthis.magFilter = NearestFilter;\n\t\t\tthis.minFilter = NearestFilter;\n\t\t\tthis.wrapR = ClampToEdgeWrapping;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tthis.flipY = false;\n\t\t\tthis.unpackAlignment = 1;\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tDataTexture2DArray.prototype.isDataTexture2DArray = true;\n\n\tfunction numericalSort(a, b) {\n\t\treturn a[0] - b[0];\n\t}\n\n\tfunction absNumericalSort(a, b) {\n\t\treturn Math.abs(b[1]) - Math.abs(a[1]);\n\t}\n\n\tfunction denormalize(morph, attribute) {\n\t\tlet denominator = 1;\n\t\tconst array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;\n\t\tif (array instanceof Int8Array) denominator = 127;else if (array instanceof Int16Array) denominator = 32767;else if (array instanceof Int32Array) denominator = 2147483647;else console.error('THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array);\n\t\tmorph.divideScalar(denominator);\n\t}\n\n\tfunction WebGLMorphtargets(gl, capabilities, textures) {\n\t\tconst influencesList = {};\n\t\tconst morphInfluences = new Float32Array(8);\n\t\tconst morphTextures = new WeakMap();\n\t\tconst morph = new Vector3();\n\t\tconst workInfluences = [];\n\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tworkInfluences[i] = [i, 0];\n\t\t}\n\n\t\tfunction update(object, geometry, material, program) {\n\t\t\tconst objectInfluences = object.morphTargetInfluences;\n\n\t\t\tif (capabilities.isWebGL2 === true) {\n\t\t\t\t// instead of using attributes, the WebGL 2 code path encodes morph targets\n\t\t\t\t// into an array of data textures. Each layer represents a single morph target.\n\t\t\t\tconst numberOfMorphTargets = geometry.morphAttributes.position.length;\n\t\t\t\tlet entry = morphTextures.get(geometry);\n\n\t\t\t\tif (entry === undefined || entry.count !== numberOfMorphTargets) {\n\t\t\t\t\tif (entry !== undefined) entry.texture.dispose();\n\t\t\t\t\tconst hasMorphNormals = geometry.morphAttributes.normal !== undefined;\n\t\t\t\t\tconst morphTargets = geometry.morphAttributes.position;\n\t\t\t\t\tconst morphNormals = geometry.morphAttributes.normal || [];\n\t\t\t\t\tconst numberOfVertices = geometry.attributes.position.count;\n\t\t\t\t\tconst numberOfVertexData = hasMorphNormals === true ? 2 : 1; // (v,n) vs. (v)\n\n\t\t\t\t\tlet width = numberOfVertices * numberOfVertexData;\n\t\t\t\t\tlet height = 1;\n\n\t\t\t\t\tif (width > capabilities.maxTextureSize) {\n\t\t\t\t\t\theight = Math.ceil(width / capabilities.maxTextureSize);\n\t\t\t\t\t\twidth = capabilities.maxTextureSize;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst buffer = new Float32Array(width * height * 4 * numberOfMorphTargets);\n\t\t\t\t\tconst texture = new DataTexture2DArray(buffer, width, height, numberOfMorphTargets);\n\t\t\t\t\ttexture.format = RGBAFormat; // using RGBA since RGB might be emulated (and is thus slower)\n\n\t\t\t\t\ttexture.type = FloatType; // fill buffer\n\n\t\t\t\t\tconst vertexDataStride = numberOfVertexData * 4;\n\n\t\t\t\t\tfor (let i = 0; i < numberOfMorphTargets; i++) {\n\t\t\t\t\t\tconst morphTarget = morphTargets[i];\n\t\t\t\t\t\tconst morphNormal = morphNormals[i];\n\t\t\t\t\t\tconst offset = width * height * 4 * i;\n\n\t\t\t\t\t\tfor (let j = 0; j < morphTarget.count; j++) {\n\t\t\t\t\t\t\tmorph.fromBufferAttribute(morphTarget, j);\n\t\t\t\t\t\t\tif (morphTarget.normalized === true) denormalize(morph, morphTarget);\n\t\t\t\t\t\t\tconst stride = j * vertexDataStride;\n\t\t\t\t\t\t\tbuffer[offset + stride + 0] = morph.x;\n\t\t\t\t\t\t\tbuffer[offset + stride + 1] = morph.y;\n\t\t\t\t\t\t\tbuffer[offset + stride + 2] = morph.z;\n\t\t\t\t\t\t\tbuffer[offset + stride + 3] = 0;\n\n\t\t\t\t\t\t\tif (hasMorphNormals === true) {\n\t\t\t\t\t\t\t\tmorph.fromBufferAttribute(morphNormal, j);\n\t\t\t\t\t\t\t\tif (morphNormal.normalized === true) denormalize(morph, morphNormal);\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 4] = morph.x;\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 5] = morph.y;\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 6] = morph.z;\n\t\t\t\t\t\t\t\tbuffer[offset + stride + 7] = 0;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tentry = {\n\t\t\t\t\t\tcount: numberOfMorphTargets,\n\t\t\t\t\t\ttexture: texture,\n\t\t\t\t\t\tsize: new Vector2(width, height)\n\t\t\t\t\t};\n\t\t\t\t\tmorphTextures.set(geometry, entry);\n\t\t\t\t} //\n\n\n\t\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\t\tfor (let i = 0; i < objectInfluences.length; i++) {\n\t\t\t\t\tmorphInfluencesSum += objectInfluences[i];\n\t\t\t\t}\n\n\t\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetBaseInfluence', morphBaseInfluence);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetInfluences', objectInfluences);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetsTexture', entry.texture, textures);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetsTextureSize', entry.size);\n\t\t\t} else {\n\t\t\t\t// When object doesn't have morph target influences defined, we treat it as a 0-length array\n\t\t\t\t// This is important to make sure we set up morphTargetBaseInfluence / morphTargetInfluences\n\t\t\t\tconst length = objectInfluences === undefined ? 0 : objectInfluences.length;\n\t\t\t\tlet influences = influencesList[geometry.id];\n\n\t\t\t\tif (influences === undefined || influences.length !== length) {\n\t\t\t\t\t// initialise list\n\t\t\t\t\tinfluences = [];\n\n\t\t\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\t\t\tinfluences[i] = [i, 0];\n\t\t\t\t\t}\n\n\t\t\t\t\tinfluencesList[geometry.id] = influences;\n\t\t\t\t} // Collect influences\n\n\n\t\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\t\tconst influence = influences[i];\n\t\t\t\t\tinfluence[0] = i;\n\t\t\t\t\tinfluence[1] = objectInfluences[i];\n\t\t\t\t}\n\n\t\t\t\tinfluences.sort(absNumericalSort);\n\n\t\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\t\tif (i < length && influences[i][1]) {\n\t\t\t\t\t\tworkInfluences[i][0] = influences[i][0];\n\t\t\t\t\t\tworkInfluences[i][1] = influences[i][1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tworkInfluences[i][0] = Number.MAX_SAFE_INTEGER;\n\t\t\t\t\t\tworkInfluences[i][1] = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tworkInfluences.sort(numericalSort);\n\t\t\t\tconst morphTargets = geometry.morphAttributes.position;\n\t\t\t\tconst morphNormals = geometry.morphAttributes.normal;\n\t\t\t\tlet morphInfluencesSum = 0;\n\n\t\t\t\tfor (let i = 0; i < 8; i++) {\n\t\t\t\t\tconst influence = workInfluences[i];\n\t\t\t\t\tconst index = influence[0];\n\t\t\t\t\tconst value = influence[1];\n\n\t\t\t\t\tif (index !== Number.MAX_SAFE_INTEGER && value) {\n\t\t\t\t\t\tif (morphTargets && geometry.getAttribute('morphTarget' + i) !== morphTargets[index]) {\n\t\t\t\t\t\t\tgeometry.setAttribute('morphTarget' + i, morphTargets[index]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (morphNormals && geometry.getAttribute('morphNormal' + i) !== morphNormals[index]) {\n\t\t\t\t\t\t\tgeometry.setAttribute('morphNormal' + i, morphNormals[index]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmorphInfluences[i] = value;\n\t\t\t\t\t\tmorphInfluencesSum += value;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (morphTargets && geometry.hasAttribute('morphTarget' + i) === true) {\n\t\t\t\t\t\t\tgeometry.deleteAttribute('morphTarget' + i);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (morphNormals && geometry.hasAttribute('morphNormal' + i) === true) {\n\t\t\t\t\t\t\tgeometry.deleteAttribute('morphNormal' + i);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmorphInfluences[i] = 0;\n\t\t\t\t\t}\n\t\t\t\t} // GLSL shader uses formula baseinfluence * base + sum(target * influence)\n\t\t\t\t// This allows us to switch between absolute morphs and relative morphs without changing shader code\n\t\t\t\t// When baseinfluence = 1 - sum(influence), the above is equivalent to sum((target - base) * influence)\n\n\n\t\t\t\tconst morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetBaseInfluence', morphBaseInfluence);\n\t\t\t\tprogram.getUniforms().setValue(gl, 'morphTargetInfluences', morphInfluences);\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tupdate: update\n\t\t};\n\t}\n\n\tfunction WebGLObjects(gl, geometries, attributes, info) {\n\t\tlet updateMap = new WeakMap();\n\n\t\tfunction update(object) {\n\t\t\tconst frame = info.render.frame;\n\t\t\tconst geometry = object.geometry;\n\t\t\tconst buffergeometry = geometries.get(object, geometry); // Update once per frame\n\n\t\t\tif (updateMap.get(buffergeometry) !== frame) {\n\t\t\t\tgeometries.update(buffergeometry);\n\t\t\t\tupdateMap.set(buffergeometry, frame);\n\t\t\t}\n\n\t\t\tif (object.isInstancedMesh) {\n\t\t\t\tif (object.hasEventListener('dispose', onInstancedMeshDispose) === false) {\n\t\t\t\t\tobject.addEventListener('dispose', onInstancedMeshDispose);\n\t\t\t\t}\n\n\t\t\t\tattributes.update(object.instanceMatrix, gl.ARRAY_BUFFER);\n\n\t\t\t\tif (object.instanceColor !== null) {\n\t\t\t\t\tattributes.update(object.instanceColor, gl.ARRAY_BUFFER);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn buffergeometry;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tupdateMap = new WeakMap();\n\t\t}\n\n\t\tfunction onInstancedMeshDispose(event) {\n\t\t\tconst instancedMesh = event.target;\n\t\t\tinstancedMesh.removeEventListener('dispose', onInstancedMeshDispose);\n\t\t\tattributes.remove(instancedMesh.instanceMatrix);\n\t\t\tif (instancedMesh.instanceColor !== null) attributes.remove(instancedMesh.instanceColor);\n\t\t}\n\n\t\treturn {\n\t\t\tupdate: update,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tclass DataTexture3D extends Texture {\n\t\tconstructor(data = null, width = 1, height = 1, depth = 1) {\n\t\t\t// We're going to add .setXXX() methods for setting properties later.\n\t\t\t// Users can still set in DataTexture3D directly.\n\t\t\t//\n\t\t\t//\tconst texture = new THREE.DataTexture3D( data, width, height, depth );\n\t\t\t// \ttexture.anisotropy = 16;\n\t\t\t//\n\t\t\t// See #14839\n\t\t\tsuper(null);\n\t\t\tthis.image = {\n\t\t\t\tdata,\n\t\t\t\twidth,\n\t\t\t\theight,\n\t\t\t\tdepth\n\t\t\t};\n\t\t\tthis.magFilter = NearestFilter;\n\t\t\tthis.minFilter = NearestFilter;\n\t\t\tthis.wrapR = ClampToEdgeWrapping;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tthis.flipY = false;\n\t\t\tthis.unpackAlignment = 1;\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tDataTexture3D.prototype.isDataTexture3D = true;\n\n\t/**\n\t * Uniforms of a program.\n\t * Those form a tree structure with a special top-level container for the root,\n\t * which you get by calling 'new WebGLUniforms( gl, program )'.\n\t *\n\t *\n\t * Properties of inner nodes including the top-level container:\n\t *\n\t * .seq - array of nested uniforms\n\t * .map - nested uniforms by name\n\t *\n\t *\n\t * Methods of all nodes except the top-level container:\n\t *\n\t * .setValue( gl, value, [textures] )\n\t *\n\t * \t\tuploads a uniform value(s)\n\t *\t\tthe 'textures' parameter is needed for sampler uniforms\n\t *\n\t *\n\t * Static methods of the top-level container (textures factorizations):\n\t *\n\t * .upload( gl, seq, values, textures )\n\t *\n\t * \t\tsets uniforms in 'seq' to 'values[id].value'\n\t *\n\t * .seqWithValue( seq, values ) : filteredSeq\n\t *\n\t * \t\tfilters 'seq' entries with corresponding entry in values\n\t *\n\t *\n\t * Methods of the top-level container (textures factorizations):\n\t *\n\t * .setValue( gl, name, value, textures )\n\t *\n\t * \t\tsets uniform with\tname 'name' to 'value'\n\t *\n\t * .setOptional( gl, obj, prop )\n\t *\n\t * \t\tlike .set for an optional property of the object\n\t *\n\t */\n\tconst emptyTexture = new Texture();\n\tconst emptyTexture2dArray = new DataTexture2DArray();\n\tconst emptyTexture3d = new DataTexture3D();\n\tconst emptyCubeTexture = new CubeTexture(); // --- Utilities ---\n\t// Array Caches (provide typed arrays for temporary by size)\n\n\tconst arrayCacheF32 = [];\n\tconst arrayCacheI32 = []; // Float32Array caches used for uploading Matrix uniforms\n\n\tconst mat4array = new Float32Array(16);\n\tconst mat3array = new Float32Array(9);\n\tconst mat2array = new Float32Array(4); // Flattening for arrays of vectors and matrices\n\n\tfunction flatten(array, nBlocks, blockSize) {\n\t\tconst firstElem = array[0];\n\t\tif (firstElem <= 0 || firstElem > 0) return array; // unoptimized: ! isNaN( firstElem )\n\t\t// see http://jacksondunstan.com/articles/983\n\n\t\tconst n = nBlocks * blockSize;\n\t\tlet r = arrayCacheF32[n];\n\n\t\tif (r === undefined) {\n\t\t\tr = new Float32Array(n);\n\t\t\tarrayCacheF32[n] = r;\n\t\t}\n\n\t\tif (nBlocks !== 0) {\n\t\t\tfirstElem.toArray(r, 0);\n\n\t\t\tfor (let i = 1, offset = 0; i !== nBlocks; ++i) {\n\t\t\t\toffset += blockSize;\n\t\t\t\tarray[i].toArray(r, offset);\n\t\t\t}\n\t\t}\n\n\t\treturn r;\n\t}\n\n\tfunction arraysEqual(a, b) {\n\t\tif (a.length !== b.length) return false;\n\n\t\tfor (let i = 0, l = a.length; i < l; i++) {\n\t\t\tif (a[i] !== b[i]) return false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction copyArray(a, b) {\n\t\tfor (let i = 0, l = b.length; i < l; i++) {\n\t\t\ta[i] = b[i];\n\t\t}\n\t} // Texture unit allocation\n\n\n\tfunction allocTexUnits(textures, n) {\n\t\tlet r = arrayCacheI32[n];\n\n\t\tif (r === undefined) {\n\t\t\tr = new Int32Array(n);\n\t\t\tarrayCacheI32[n] = r;\n\t\t}\n\n\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\tr[i] = textures.allocateTextureUnit();\n\t\t}\n\n\t\treturn r;\n\t} // --- Setters ---\n\t// Note: Defining these methods externally, because they come in a bunch\n\t// and this way their names minify.\n\t// Single scalar\n\n\n\tfunction setValueV1f(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (cache[0] === v) return;\n\t\tgl.uniform1f(this.addr, v);\n\t\tcache[0] = v;\n\t} // Single float vector (from flat array or THREE.VectorN)\n\n\n\tfunction setValueV2f(gl, v) {\n\t\tconst cache = this.cache;\n\n\t\tif (v.x !== undefined) {\n\t\t\tif (cache[0] !== v.x || cache[1] !== v.y) {\n\t\t\t\tgl.uniform2f(this.addr, v.x, v.y);\n\t\t\t\tcache[0] = v.x;\n\t\t\t\tcache[1] = v.y;\n\t\t\t}\n\t\t} else {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniform2fv(this.addr, v);\n\t\t\tcopyArray(cache, v);\n\t\t}\n\t}\n\n\tfunction setValueV3f(gl, v) {\n\t\tconst cache = this.cache;\n\n\t\tif (v.x !== undefined) {\n\t\t\tif (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z) {\n\t\t\t\tgl.uniform3f(this.addr, v.x, v.y, v.z);\n\t\t\t\tcache[0] = v.x;\n\t\t\t\tcache[1] = v.y;\n\t\t\t\tcache[2] = v.z;\n\t\t\t}\n\t\t} else if (v.r !== undefined) {\n\t\t\tif (cache[0] !== v.r || cache[1] !== v.g || cache[2] !== v.b) {\n\t\t\t\tgl.uniform3f(this.addr, v.r, v.g, v.b);\n\t\t\t\tcache[0] = v.r;\n\t\t\t\tcache[1] = v.g;\n\t\t\t\tcache[2] = v.b;\n\t\t\t}\n\t\t} else {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniform3fv(this.addr, v);\n\t\t\tcopyArray(cache, v);\n\t\t}\n\t}\n\n\tfunction setValueV4f(gl, v) {\n\t\tconst cache = this.cache;\n\n\t\tif (v.x !== undefined) {\n\t\t\tif (cache[0] !== v.x || cache[1] !== v.y || cache[2] !== v.z || cache[3] !== v.w) {\n\t\t\t\tgl.uniform4f(this.addr, v.x, v.y, v.z, v.w);\n\t\t\t\tcache[0] = v.x;\n\t\t\t\tcache[1] = v.y;\n\t\t\t\tcache[2] = v.z;\n\t\t\t\tcache[3] = v.w;\n\t\t\t}\n\t\t} else {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniform4fv(this.addr, v);\n\t\t\tcopyArray(cache, v);\n\t\t}\n\t} // Single matrix (from flat array or THREE.MatrixN)\n\n\n\tfunction setValueM2(gl, v) {\n\t\tconst cache = this.cache;\n\t\tconst elements = v.elements;\n\n\t\tif (elements === undefined) {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniformMatrix2fv(this.addr, false, v);\n\t\t\tcopyArray(cache, v);\n\t\t} else {\n\t\t\tif (arraysEqual(cache, elements)) return;\n\t\t\tmat2array.set(elements);\n\t\t\tgl.uniformMatrix2fv(this.addr, false, mat2array);\n\t\t\tcopyArray(cache, elements);\n\t\t}\n\t}\n\n\tfunction setValueM3(gl, v) {\n\t\tconst cache = this.cache;\n\t\tconst elements = v.elements;\n\n\t\tif (elements === undefined) {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniformMatrix3fv(this.addr, false, v);\n\t\t\tcopyArray(cache, v);\n\t\t} else {\n\t\t\tif (arraysEqual(cache, elements)) return;\n\t\t\tmat3array.set(elements);\n\t\t\tgl.uniformMatrix3fv(this.addr, false, mat3array);\n\t\t\tcopyArray(cache, elements);\n\t\t}\n\t}\n\n\tfunction setValueM4(gl, v) {\n\t\tconst cache = this.cache;\n\t\tconst elements = v.elements;\n\n\t\tif (elements === undefined) {\n\t\t\tif (arraysEqual(cache, v)) return;\n\t\t\tgl.uniformMatrix4fv(this.addr, false, v);\n\t\t\tcopyArray(cache, v);\n\t\t} else {\n\t\t\tif (arraysEqual(cache, elements)) return;\n\t\t\tmat4array.set(elements);\n\t\t\tgl.uniformMatrix4fv(this.addr, false, mat4array);\n\t\t\tcopyArray(cache, elements);\n\t\t}\n\t} // Single integer / boolean\n\n\n\tfunction setValueV1i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (cache[0] === v) return;\n\t\tgl.uniform1i(this.addr, v);\n\t\tcache[0] = v;\n\t} // Single integer / boolean vector (from flat array)\n\n\n\tfunction setValueV2i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform2iv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV3i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform3iv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV4i(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform4iv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t} // Single unsigned integer\n\n\n\tfunction setValueV1ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (cache[0] === v) return;\n\t\tgl.uniform1ui(this.addr, v);\n\t\tcache[0] = v;\n\t} // Single unsigned integer vector (from flat array)\n\n\n\tfunction setValueV2ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform2uiv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV3ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform3uiv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t}\n\n\tfunction setValueV4ui(gl, v) {\n\t\tconst cache = this.cache;\n\t\tif (arraysEqual(cache, v)) return;\n\t\tgl.uniform4uiv(this.addr, v);\n\t\tcopyArray(cache, v);\n\t} // Single texture (2D / Cube)\n\n\n\tfunction setValueT1(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.safeSetTexture2D(v || emptyTexture, unit);\n\t}\n\n\tfunction setValueT3D1(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.setTexture3D(v || emptyTexture3d, unit);\n\t}\n\n\tfunction setValueT6(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.safeSetTextureCube(v || emptyCubeTexture, unit);\n\t}\n\n\tfunction setValueT2DArray1(gl, v, textures) {\n\t\tconst cache = this.cache;\n\t\tconst unit = textures.allocateTextureUnit();\n\n\t\tif (cache[0] !== unit) {\n\t\t\tgl.uniform1i(this.addr, unit);\n\t\t\tcache[0] = unit;\n\t\t}\n\n\t\ttextures.setTexture2DArray(v || emptyTexture2dArray, unit);\n\t} // Helper to pick the right setter for the singular case\n\n\n\tfunction getSingularSetter(type) {\n\t\tswitch (type) {\n\t\t\tcase 0x1406:\n\t\t\t\treturn setValueV1f;\n\t\t\t// FLOAT\n\n\t\t\tcase 0x8b50:\n\t\t\t\treturn setValueV2f;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b51:\n\t\t\t\treturn setValueV3f;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b52:\n\t\t\t\treturn setValueV4f;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5a:\n\t\t\t\treturn setValueM2;\n\t\t\t// _MAT2\n\n\t\t\tcase 0x8b5b:\n\t\t\t\treturn setValueM3;\n\t\t\t// _MAT3\n\n\t\t\tcase 0x8b5c:\n\t\t\t\treturn setValueM4;\n\t\t\t// _MAT4\n\n\t\t\tcase 0x1404:\n\t\t\tcase 0x8b56:\n\t\t\t\treturn setValueV1i;\n\t\t\t// INT, BOOL\n\n\t\t\tcase 0x8b53:\n\t\t\tcase 0x8b57:\n\t\t\t\treturn setValueV2i;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b54:\n\t\t\tcase 0x8b58:\n\t\t\t\treturn setValueV3i;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b55:\n\t\t\tcase 0x8b59:\n\t\t\t\treturn setValueV4i;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x1405:\n\t\t\t\treturn setValueV1ui;\n\t\t\t// UINT\n\n\t\t\tcase 0x8dc6:\n\t\t\t\treturn setValueV2ui;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8dc7:\n\t\t\t\treturn setValueV3ui;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8dc8:\n\t\t\t\treturn setValueV4ui;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\n\t\t\tcase 0x8b62:\n\t\t\t\t// SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1;\n\n\t\t\tcase 0x8b5f: // SAMPLER_3D\n\n\t\t\tcase 0x8dcb: // INT_SAMPLER_3D\n\n\t\t\tcase 0x8dd3:\n\t\t\t\t// UNSIGNED_INT_SAMPLER_3D\n\t\t\t\treturn setValueT3D1;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dc5:\n\t\t\t\t// SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6;\n\n\t\t\tcase 0x8dc1: // SAMPLER_2D_ARRAY\n\n\t\t\tcase 0x8dcf: // INT_SAMPLER_2D_ARRAY\n\n\t\t\tcase 0x8dd7: // UNSIGNED_INT_SAMPLER_2D_ARRAY\n\n\t\t\tcase 0x8dc4:\n\t\t\t\t// SAMPLER_2D_ARRAY_SHADOW\n\t\t\t\treturn setValueT2DArray1;\n\t\t}\n\t} // Array of scalars\n\n\n\tfunction setValueV1fArray(gl, v) {\n\t\tgl.uniform1fv(this.addr, v);\n\t} // Array of vectors (from flat array or array of THREE.VectorN)\n\n\n\tfunction setValueV2fArray(gl, v) {\n\t\tconst data = flatten(v, this.size, 2);\n\t\tgl.uniform2fv(this.addr, data);\n\t}\n\n\tfunction setValueV3fArray(gl, v) {\n\t\tconst data = flatten(v, this.size, 3);\n\t\tgl.uniform3fv(this.addr, data);\n\t}\n\n\tfunction setValueV4fArray(gl, v) {\n\t\tconst data = flatten(v, this.size, 4);\n\t\tgl.uniform4fv(this.addr, data);\n\t} // Array of matrices (from flat array or array of THREE.MatrixN)\n\n\n\tfunction setValueM2Array(gl, v) {\n\t\tconst data = flatten(v, this.size, 4);\n\t\tgl.uniformMatrix2fv(this.addr, false, data);\n\t}\n\n\tfunction setValueM3Array(gl, v) {\n\t\tconst data = flatten(v, this.size, 9);\n\t\tgl.uniformMatrix3fv(this.addr, false, data);\n\t}\n\n\tfunction setValueM4Array(gl, v) {\n\t\tconst data = flatten(v, this.size, 16);\n\t\tgl.uniformMatrix4fv(this.addr, false, data);\n\t} // Array of integer / boolean\n\n\n\tfunction setValueV1iArray(gl, v) {\n\t\tgl.uniform1iv(this.addr, v);\n\t} // Array of integer / boolean vectors (from flat array)\n\n\n\tfunction setValueV2iArray(gl, v) {\n\t\tgl.uniform2iv(this.addr, v);\n\t}\n\n\tfunction setValueV3iArray(gl, v) {\n\t\tgl.uniform3iv(this.addr, v);\n\t}\n\n\tfunction setValueV4iArray(gl, v) {\n\t\tgl.uniform4iv(this.addr, v);\n\t} // Array of unsigned integer\n\n\n\tfunction setValueV1uiArray(gl, v) {\n\t\tgl.uniform1uiv(this.addr, v);\n\t} // Array of unsigned integer vectors (from flat array)\n\n\n\tfunction setValueV2uiArray(gl, v) {\n\t\tgl.uniform2uiv(this.addr, v);\n\t}\n\n\tfunction setValueV3uiArray(gl, v) {\n\t\tgl.uniform3uiv(this.addr, v);\n\t}\n\n\tfunction setValueV4uiArray(gl, v) {\n\t\tgl.uniform4uiv(this.addr, v);\n\t} // Array of textures (2D / Cube)\n\n\n\tfunction setValueT1Array(gl, v, textures) {\n\t\tconst n = v.length;\n\t\tconst units = allocTexUnits(textures, n);\n\t\tgl.uniform1iv(this.addr, units);\n\n\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\ttextures.safeSetTexture2D(v[i] || emptyTexture, units[i]);\n\t\t}\n\t}\n\n\tfunction setValueT6Array(gl, v, textures) {\n\t\tconst n = v.length;\n\t\tconst units = allocTexUnits(textures, n);\n\t\tgl.uniform1iv(this.addr, units);\n\n\t\tfor (let i = 0; i !== n; ++i) {\n\t\t\ttextures.safeSetTextureCube(v[i] || emptyCubeTexture, units[i]);\n\t\t}\n\t} // Helper to pick the right setter for a pure (bottom-level) array\n\n\n\tfunction getPureArraySetter(type) {\n\t\tswitch (type) {\n\t\t\tcase 0x1406:\n\t\t\t\treturn setValueV1fArray;\n\t\t\t// FLOAT\n\n\t\t\tcase 0x8b50:\n\t\t\t\treturn setValueV2fArray;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b51:\n\t\t\t\treturn setValueV3fArray;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b52:\n\t\t\t\treturn setValueV4fArray;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5a:\n\t\t\t\treturn setValueM2Array;\n\t\t\t// _MAT2\n\n\t\t\tcase 0x8b5b:\n\t\t\t\treturn setValueM3Array;\n\t\t\t// _MAT3\n\n\t\t\tcase 0x8b5c:\n\t\t\t\treturn setValueM4Array;\n\t\t\t// _MAT4\n\n\t\t\tcase 0x1404:\n\t\t\tcase 0x8b56:\n\t\t\t\treturn setValueV1iArray;\n\t\t\t// INT, BOOL\n\n\t\t\tcase 0x8b53:\n\t\t\tcase 0x8b57:\n\t\t\t\treturn setValueV2iArray;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8b54:\n\t\t\tcase 0x8b58:\n\t\t\t\treturn setValueV3iArray;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8b55:\n\t\t\tcase 0x8b59:\n\t\t\t\treturn setValueV4iArray;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x1405:\n\t\t\t\treturn setValueV1uiArray;\n\t\t\t// UINT\n\n\t\t\tcase 0x8dc6:\n\t\t\t\treturn setValueV2uiArray;\n\t\t\t// _VEC2\n\n\t\t\tcase 0x8dc7:\n\t\t\t\treturn setValueV3uiArray;\n\t\t\t// _VEC3\n\n\t\t\tcase 0x8dc8:\n\t\t\t\treturn setValueV4uiArray;\n\t\t\t// _VEC4\n\n\t\t\tcase 0x8b5e: // SAMPLER_2D\n\n\t\t\tcase 0x8d66: // SAMPLER_EXTERNAL_OES\n\n\t\t\tcase 0x8dca: // INT_SAMPLER_2D\n\n\t\t\tcase 0x8dd2: // UNSIGNED_INT_SAMPLER_2D\n\n\t\t\tcase 0x8b62:\n\t\t\t\t// SAMPLER_2D_SHADOW\n\t\t\t\treturn setValueT1Array;\n\n\t\t\tcase 0x8b60: // SAMPLER_CUBE\n\n\t\t\tcase 0x8dcc: // INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dd4: // UNSIGNED_INT_SAMPLER_CUBE\n\n\t\t\tcase 0x8dc5:\n\t\t\t\t// SAMPLER_CUBE_SHADOW\n\t\t\t\treturn setValueT6Array;\n\t\t}\n\t} // --- Uniform Classes ---\n\n\n\tfunction SingleUniform(id, activeInfo, addr) {\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.setValue = getSingularSetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG\n\t}\n\n\tfunction PureArrayUniform(id, activeInfo, addr) {\n\t\tthis.id = id;\n\t\tthis.addr = addr;\n\t\tthis.cache = [];\n\t\tthis.size = activeInfo.size;\n\t\tthis.setValue = getPureArraySetter(activeInfo.type); // this.path = activeInfo.name; // DEBUG\n\t}\n\n\tPureArrayUniform.prototype.updateCache = function (data) {\n\t\tconst cache = this.cache;\n\n\t\tif (data instanceof Float32Array && cache.length !== data.length) {\n\t\t\tthis.cache = new Float32Array(data.length);\n\t\t}\n\n\t\tcopyArray(cache, data);\n\t};\n\n\tfunction StructuredUniform(id) {\n\t\tthis.id = id;\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\t}\n\n\tStructuredUniform.prototype.setValue = function (gl, value, textures) {\n\t\tconst seq = this.seq;\n\n\t\tfor (let i = 0, n = seq.length; i !== n; ++i) {\n\t\t\tconst u = seq[i];\n\t\t\tu.setValue(gl, value[u.id], textures);\n\t\t}\n\t}; // --- Top-level ---\n\t// Parser - builds up the property tree from the path strings\n\n\n\tconst RePathPart = /(\\w+)(\\])?(\\[|\\.)?/g; // extracts\n\t// \t- the identifier (member name or array index)\n\t//\t- followed by an optional right bracket (found when array index)\n\t//\t- followed by an optional left bracket or dot (type of subscript)\n\t//\n\t// Note: These portions can be read in a non-overlapping fashion and\n\t// allow straightforward parsing of the hierarchy that WebGL encodes\n\t// in the uniform names.\n\n\tfunction addUniform(container, uniformObject) {\n\t\tcontainer.seq.push(uniformObject);\n\t\tcontainer.map[uniformObject.id] = uniformObject;\n\t}\n\n\tfunction parseUniform(activeInfo, addr, container) {\n\t\tconst path = activeInfo.name,\n\t\t\t\t\tpathLength = path.length; // reset RegExp object, because of the early exit of a previous run\n\n\t\tRePathPart.lastIndex = 0;\n\n\t\twhile (true) {\n\t\t\tconst match = RePathPart.exec(path),\n\t\t\t\t\t\tmatchEnd = RePathPart.lastIndex;\n\t\t\tlet id = match[1];\n\t\t\tconst idIsIndex = match[2] === ']',\n\t\t\t\t\t\tsubscript = match[3];\n\t\t\tif (idIsIndex) id = id | 0; // convert to integer\n\n\t\t\tif (subscript === undefined || subscript === '[' && matchEnd + 2 === pathLength) {\n\t\t\t\t// bare name or \"pure\" bottom-level array \"[0]\" suffix\n\t\t\t\taddUniform(container, subscript === undefined ? new SingleUniform(id, activeInfo, addr) : new PureArrayUniform(id, activeInfo, addr));\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// step into inner node / create it in case it doesn't exist\n\t\t\t\tconst map = container.map;\n\t\t\t\tlet next = map[id];\n\n\t\t\t\tif (next === undefined) {\n\t\t\t\t\tnext = new StructuredUniform(id);\n\t\t\t\t\taddUniform(container, next);\n\t\t\t\t}\n\n\t\t\t\tcontainer = next;\n\t\t\t}\n\t\t}\n\t} // Root Container\n\n\n\tfunction WebGLUniforms(gl, program) {\n\t\tthis.seq = [];\n\t\tthis.map = {};\n\t\tconst n = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n\n\t\tfor (let i = 0; i < n; ++i) {\n\t\t\tconst info = gl.getActiveUniform(program, i),\n\t\t\t\t\t\taddr = gl.getUniformLocation(program, info.name);\n\t\t\tparseUniform(info, addr, this);\n\t\t}\n\t}\n\n\tWebGLUniforms.prototype.setValue = function (gl, name, value, textures) {\n\t\tconst u = this.map[name];\n\t\tif (u !== undefined) u.setValue(gl, value, textures);\n\t};\n\n\tWebGLUniforms.prototype.setOptional = function (gl, object, name) {\n\t\tconst v = object[name];\n\t\tif (v !== undefined) this.setValue(gl, name, v);\n\t}; // Static interface\n\n\n\tWebGLUniforms.upload = function (gl, seq, values, textures) {\n\t\tfor (let i = 0, n = seq.length; i !== n; ++i) {\n\t\t\tconst u = seq[i],\n\t\t\t\t\t\tv = values[u.id];\n\n\t\t\tif (v.needsUpdate !== false) {\n\t\t\t\t// note: always updating when .needsUpdate is undefined\n\t\t\t\tu.setValue(gl, v.value, textures);\n\t\t\t}\n\t\t}\n\t};\n\n\tWebGLUniforms.seqWithValue = function (seq, values) {\n\t\tconst r = [];\n\n\t\tfor (let i = 0, n = seq.length; i !== n; ++i) {\n\t\t\tconst u = seq[i];\n\t\t\tif (u.id in values) r.push(u);\n\t\t}\n\n\t\treturn r;\n\t};\n\n\tfunction WebGLShader(gl, type, string) {\n\t\tconst shader = gl.createShader(type);\n\t\tgl.shaderSource(shader, string);\n\t\tgl.compileShader(shader);\n\t\treturn shader;\n\t}\n\n\tlet programIdCount = 0;\n\n\tfunction addLineNumbers(string) {\n\t\tconst lines = string.split('\\n');\n\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tlines[i] = i + 1 + ': ' + lines[i];\n\t\t}\n\n\t\treturn lines.join('\\n');\n\t}\n\n\tfunction getEncodingComponents(encoding) {\n\t\tswitch (encoding) {\n\t\t\tcase LinearEncoding:\n\t\t\t\treturn ['Linear', '( value )'];\n\n\t\t\tcase sRGBEncoding:\n\t\t\t\treturn ['sRGB', '( value )'];\n\n\t\t\tcase RGBEEncoding:\n\t\t\t\treturn ['RGBE', '( value )'];\n\n\t\t\tcase RGBM7Encoding:\n\t\t\t\treturn ['RGBM', '( value, 7.0 )'];\n\n\t\t\tcase RGBM16Encoding:\n\t\t\t\treturn ['RGBM', '( value, 16.0 )'];\n\n\t\t\tcase RGBDEncoding:\n\t\t\t\treturn ['RGBD', '( value, 256.0 )'];\n\n\t\t\tcase GammaEncoding:\n\t\t\t\treturn ['Gamma', '( value, float( GAMMA_FACTOR ) )'];\n\n\t\t\tcase LogLuvEncoding:\n\t\t\t\treturn ['LogLuv', '( value )'];\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.WebGLProgram: Unsupported encoding:', encoding);\n\t\t\t\treturn ['Linear', '( value )'];\n\t\t}\n\t}\n\n\tfunction getShaderErrors(gl, shader, type) {\n\t\tconst status = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n\t\tconst errors = gl.getShaderInfoLog(shader).trim();\n\t\tif (status && errors === '') return ''; // --enable-privileged-webgl-extension\n\t\t// console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );\n\n\t\treturn type.toUpperCase() + '\\n\\n' + errors + '\\n\\n' + addLineNumbers(gl.getShaderSource(shader));\n\t}\n\n\tfunction getTexelDecodingFunction(functionName, encoding) {\n\t\tconst components = getEncodingComponents(encoding);\n\t\treturn 'vec4 ' + functionName + '( vec4 value ) { return ' + components[0] + 'ToLinear' + components[1] + '; }';\n\t}\n\n\tfunction getTexelEncodingFunction(functionName, encoding) {\n\t\tconst components = getEncodingComponents(encoding);\n\t\treturn 'vec4 ' + functionName + '( vec4 value ) { return LinearTo' + components[0] + components[1] + '; }';\n\t}\n\n\tfunction getToneMappingFunction(functionName, toneMapping) {\n\t\tlet toneMappingName;\n\n\t\tswitch (toneMapping) {\n\t\t\tcase LinearToneMapping:\n\t\t\t\ttoneMappingName = 'Linear';\n\t\t\t\tbreak;\n\n\t\t\tcase ReinhardToneMapping:\n\t\t\t\ttoneMappingName = 'Reinhard';\n\t\t\t\tbreak;\n\n\t\t\tcase CineonToneMapping:\n\t\t\t\ttoneMappingName = 'OptimizedCineon';\n\t\t\t\tbreak;\n\n\t\t\tcase ACESFilmicToneMapping:\n\t\t\t\ttoneMappingName = 'ACESFilmic';\n\t\t\t\tbreak;\n\n\t\t\tcase CustomToneMapping:\n\t\t\t\ttoneMappingName = 'Custom';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn('THREE.WebGLProgram: Unsupported toneMapping:', toneMapping);\n\t\t\t\ttoneMappingName = 'Linear';\n\t\t}\n\n\t\treturn 'vec3 ' + functionName + '( vec3 color ) { return ' + toneMappingName + 'ToneMapping( color ); }';\n\t}\n\n\tfunction generateExtensions(parameters) {\n\t\tconst chunks = [parameters.extensionDerivatives || parameters.envMapCubeUV || parameters.bumpMap || parameters.tangentSpaceNormalMap || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === 'physical' ? '#extension GL_OES_standard_derivatives : enable' : '', (parameters.extensionFragDepth || parameters.logarithmicDepthBuffer) && parameters.rendererExtensionFragDepth ? '#extension GL_EXT_frag_depth : enable' : '', parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ? '#extension GL_EXT_draw_buffers : require' : '', (parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission) && parameters.rendererExtensionShaderTextureLod ? '#extension GL_EXT_shader_texture_lod : enable' : ''];\n\t\treturn chunks.filter(filterEmptyLine).join('\\n');\n\t}\n\n\tfunction generateDefines(defines) {\n\t\tconst chunks = [];\n\n\t\tfor (const name in defines) {\n\t\t\tconst value = defines[name];\n\t\t\tif (value === false) continue;\n\t\t\tchunks.push('#define ' + name + ' ' + value);\n\t\t}\n\n\t\treturn chunks.join('\\n');\n\t}\n\n\tfunction fetchAttributeLocations(gl, program) {\n\t\tconst attributes = {};\n\t\tconst n = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n\n\t\tfor (let i = 0; i < n; i++) {\n\t\t\tconst info = gl.getActiveAttrib(program, i);\n\t\t\tconst name = info.name;\n\t\t\tlet locationSize = 1;\n\t\t\tif (info.type === gl.FLOAT_MAT2) locationSize = 2;\n\t\t\tif (info.type === gl.FLOAT_MAT3) locationSize = 3;\n\t\t\tif (info.type === gl.FLOAT_MAT4) locationSize = 4; // console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );\n\n\t\t\tattributes[name] = {\n\t\t\t\ttype: info.type,\n\t\t\t\tlocation: gl.getAttribLocation(program, name),\n\t\t\t\tlocationSize: locationSize\n\t\t\t};\n\t\t}\n\n\t\treturn attributes;\n\t}\n\n\tfunction filterEmptyLine(string) {\n\t\treturn string !== '';\n\t}\n\n\tfunction replaceLightNums(string, parameters) {\n\t\treturn string.replace(/NUM_DIR_LIGHTS/g, parameters.numDirLights).replace(/NUM_SPOT_LIGHTS/g, parameters.numSpotLights).replace(/NUM_RECT_AREA_LIGHTS/g, parameters.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g, parameters.numPointLights).replace(/NUM_HEMI_LIGHTS/g, parameters.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g, parameters.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS/g, parameters.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g, parameters.numPointLightShadows);\n\t}\n\n\tfunction replaceClippingPlaneNums(string, parameters) {\n\t\treturn string.replace(/NUM_CLIPPING_PLANES/g, parameters.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g, parameters.numClippingPlanes - parameters.numClipIntersection);\n\t} // Resolve Includes\n\n\n\tconst includePattern = /^[ \\t]*#include +<([\\w\\d./]+)>/gm;\n\n\tfunction resolveIncludes(string) {\n\t\treturn string.replace(includePattern, includeReplacer);\n\t}\n\n\tfunction includeReplacer(match, include) {\n\t\tconst string = ShaderChunk[include];\n\n\t\tif (string === undefined) {\n\t\t\tthrow new Error('Can not resolve #include <' + include + '>');\n\t\t}\n\n\t\treturn resolveIncludes(string);\n\t} // Unroll Loops\n\n\n\tconst deprecatedUnrollLoopPattern = /#pragma unroll_loop[\\s]+?for \\( int i \\= (\\d+)\\; i < (\\d+)\\; i \\+\\+ \\) \\{([\\s\\S]+?)(?=\\})\\}/g;\n\tconst unrollLoopPattern = /#pragma unroll_loop_start\\s+for\\s*\\(\\s*int\\s+i\\s*=\\s*(\\d+)\\s*;\\s*i\\s*<\\s*(\\d+)\\s*;\\s*i\\s*\\+\\+\\s*\\)\\s*{([\\s\\S]+?)}\\s+#pragma unroll_loop_end/g;\n\n\tfunction unrollLoops(string) {\n\t\treturn string.replace(unrollLoopPattern, loopReplacer).replace(deprecatedUnrollLoopPattern, deprecatedLoopReplacer);\n\t}\n\n\tfunction deprecatedLoopReplacer(match, start, end, snippet) {\n\t\tconsole.warn('WebGLProgram: #pragma unroll_loop shader syntax is deprecated. Please use #pragma unroll_loop_start syntax instead.');\n\t\treturn loopReplacer(match, start, end, snippet);\n\t}\n\n\tfunction loopReplacer(match, start, end, snippet) {\n\t\tlet string = '';\n\n\t\tfor (let i = parseInt(start); i < parseInt(end); i++) {\n\t\t\tstring += snippet.replace(/\\[\\s*i\\s*\\]/g, '[ ' + i + ' ]').replace(/UNROLLED_LOOP_INDEX/g, i);\n\t\t}\n\n\t\treturn string;\n\t} //\n\n\n\tfunction generatePrecision(parameters) {\n\t\tlet precisionstring = 'precision ' + parameters.precision + ' float;\\nprecision ' + parameters.precision + ' int;';\n\n\t\tif (parameters.precision === 'highp') {\n\t\t\tprecisionstring += '\\n#define HIGH_PRECISION';\n\t\t} else if (parameters.precision === 'mediump') {\n\t\t\tprecisionstring += '\\n#define MEDIUM_PRECISION';\n\t\t} else if (parameters.precision === 'lowp') {\n\t\t\tprecisionstring += '\\n#define LOW_PRECISION';\n\t\t}\n\n\t\treturn precisionstring;\n\t}\n\n\tfunction generateShadowMapTypeDefine(parameters) {\n\t\tlet shadowMapTypeDefine = 'SHADOWMAP_TYPE_BASIC';\n\n\t\tif (parameters.shadowMapType === PCFShadowMap) {\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF';\n\t\t} else if (parameters.shadowMapType === PCFSoftShadowMap) {\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_PCF_SOFT';\n\t\t} else if (parameters.shadowMapType === VSMShadowMap) {\n\t\t\tshadowMapTypeDefine = 'SHADOWMAP_TYPE_VSM';\n\t\t}\n\n\t\treturn shadowMapTypeDefine;\n\t}\n\n\tfunction generateEnvMapTypeDefine(parameters) {\n\t\tlet envMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\n\t\tif (parameters.envMap) {\n\t\t\tswitch (parameters.envMapMode) {\n\t\t\t\tcase CubeReflectionMapping:\n\t\t\t\tcase CubeRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase CubeUVReflectionMapping:\n\t\t\t\tcase CubeUVRefractionMapping:\n\t\t\t\t\tenvMapTypeDefine = 'ENVMAP_TYPE_CUBE_UV';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn envMapTypeDefine;\n\t}\n\n\tfunction generateEnvMapModeDefine(parameters) {\n\t\tlet envMapModeDefine = 'ENVMAP_MODE_REFLECTION';\n\n\t\tif (parameters.envMap) {\n\t\t\tswitch (parameters.envMapMode) {\n\t\t\t\tcase CubeRefractionMapping:\n\t\t\t\tcase CubeUVRefractionMapping:\n\t\t\t\t\tenvMapModeDefine = 'ENVMAP_MODE_REFRACTION';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn envMapModeDefine;\n\t}\n\n\tfunction generateEnvMapBlendingDefine(parameters) {\n\t\tlet envMapBlendingDefine = 'ENVMAP_BLENDING_NONE';\n\n\t\tif (parameters.envMap) {\n\t\t\tswitch (parameters.combine) {\n\t\t\t\tcase MultiplyOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MULTIPLY';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase MixOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_MIX';\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase AddOperation:\n\t\t\t\t\tenvMapBlendingDefine = 'ENVMAP_BLENDING_ADD';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn envMapBlendingDefine;\n\t}\n\n\tfunction WebGLProgram(renderer, cacheKey, parameters, bindingStates) {\n\t\t// TODO Send this event to Three.js DevTools\n\t\t// console.log( 'WebGLProgram', cacheKey );\n\t\tconst gl = renderer.getContext();\n\t\tconst defines = parameters.defines;\n\t\tlet vertexShader = parameters.vertexShader;\n\t\tlet fragmentShader = parameters.fragmentShader;\n\t\tconst shadowMapTypeDefine = generateShadowMapTypeDefine(parameters);\n\t\tconst envMapTypeDefine = generateEnvMapTypeDefine(parameters);\n\t\tconst envMapModeDefine = generateEnvMapModeDefine(parameters);\n\t\tconst envMapBlendingDefine = generateEnvMapBlendingDefine(parameters);\n\t\tconst gammaFactorDefine = renderer.gammaFactor > 0 ? renderer.gammaFactor : 1.0;\n\t\tconst customExtensions = parameters.isWebGL2 ? '' : generateExtensions(parameters);\n\t\tconst customDefines = generateDefines(defines);\n\t\tconst program = gl.createProgram();\n\t\tlet prefixVertex, prefixFragment;\n\t\tlet versionString = parameters.glslVersion ? '#version ' + parameters.glslVersion + '\\n' : '';\n\n\t\tif (parameters.isRawShaderMaterial) {\n\t\t\tprefixVertex = [customDefines].filter(filterEmptyLine).join('\\n');\n\n\t\t\tif (prefixVertex.length > 0) {\n\t\t\t\tprefixVertex += '\\n';\n\t\t\t}\n\n\t\t\tprefixFragment = [customExtensions, customDefines].filter(filterEmptyLine).join('\\n');\n\n\t\t\tif (prefixFragment.length > 0) {\n\t\t\t\tprefixFragment += '\\n';\n\t\t\t}\n\t\t} else {\n\t\t\tprefixVertex = [generatePrecision(parameters), '#define SHADER_NAME ' + parameters.shaderName, customDefines, parameters.instancing ? '#define USE_INSTANCING' : '', parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '', parameters.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '', '#define GAMMA_FACTOR ' + gammaFactorDefine, '#define MAX_BONES ' + parameters.maxBones, parameters.useFog && parameters.fog ? '#define USE_FOG' : '', parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '', parameters.map ? '#define USE_MAP' : '', parameters.envMap ? '#define USE_ENVMAP' : '', parameters.envMap ? '#define ' + envMapModeDefine : '', parameters.lightMap ? '#define USE_LIGHTMAP' : '', parameters.aoMap ? '#define USE_AOMAP' : '', parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', parameters.bumpMap ? '#define USE_BUMPMAP' : '', parameters.normalMap ? '#define USE_NORMALMAP' : '', parameters.normalMap && parameters.objectSpaceNormalMap ? '#define OBJECTSPACE_NORMALMAP' : '', parameters.normalMap && parameters.tangentSpaceNormalMap ? '#define TANGENTSPACE_NORMALMAP' : '', parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', parameters.displacementMap && parameters.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '', parameters.specularMap ? '#define USE_SPECULARMAP' : '', parameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '', parameters.specularTintMap ? '#define USE_SPECULARTINTMAP' : '', parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUvs ? '#define USE_UV' : '', parameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '', parameters.flatShading ? '#define FLAT_SHADED' : '', parameters.skinning ? '#define USE_SKINNING' : '', parameters.useVertexTexture ? '#define BONE_TEXTURE' : '', parameters.morphTargets ? '#define USE_MORPHTARGETS' : '', parameters.morphNormals && parameters.flatShading === false ? '#define USE_MORPHNORMALS' : '', parameters.morphTargets && parameters.isWebGL2 ? '#define MORPHTARGETS_TEXTURE' : '', parameters.morphTargets && parameters.isWebGL2 ? '#define MORPHTARGETS_COUNT ' + parameters.morphTargetsCount : '', parameters.doubleSided ? '#define DOUBLE_SIDED' : '', parameters.flipSided ? '#define FLIP_SIDED' : '', parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '', parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? '#define USE_LOGDEPTHBUF_EXT' : '', 'uniform mat4 modelMatrix;', 'uniform mat4 modelViewMatrix;', 'uniform mat4 projectionMatrix;', 'uniform mat4 viewMatrix;', 'uniform mat3 normalMatrix;', 'uniform vec3 cameraPosition;', 'uniform bool isOrthographic;', '#ifdef USE_INSTANCING', '\tattribute mat4 instanceMatrix;', '#endif', '#ifdef USE_INSTANCING_COLOR', '\tattribute vec3 instanceColor;', '#endif', 'attribute vec3 position;', 'attribute vec3 normal;', 'attribute vec2 uv;', '#ifdef USE_TANGENT', '\tattribute vec4 tangent;', '#endif', '#if defined( USE_COLOR_ALPHA )', '\tattribute vec4 color;', '#elif defined( USE_COLOR )', '\tattribute vec3 color;', '#endif', '#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )', '\tattribute vec3 morphTarget0;', '\tattribute vec3 morphTarget1;', '\tattribute vec3 morphTarget2;', '\tattribute vec3 morphTarget3;', '\t#ifdef USE_MORPHNORMALS', '\t\tattribute vec3 morphNormal0;', '\t\tattribute vec3 morphNormal1;', '\t\tattribute vec3 morphNormal2;', '\t\tattribute vec3 morphNormal3;', '\t#else', '\t\tattribute vec3 morphTarget4;', '\t\tattribute vec3 morphTarget5;', '\t\tattribute vec3 morphTarget6;', '\t\tattribute vec3 morphTarget7;', '\t#endif', '#endif', '#ifdef USE_SKINNING', '\tattribute vec4 skinIndex;', '\tattribute vec4 skinWeight;', '#endif', '\\n'].filter(filterEmptyLine).join('\\n');\n\t\t\tprefixFragment = [customExtensions, generatePrecision(parameters), '#define SHADER_NAME ' + parameters.shaderName, customDefines, '#define GAMMA_FACTOR ' + gammaFactorDefine, parameters.useFog && parameters.fog ? '#define USE_FOG' : '', parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '', parameters.map ? '#define USE_MAP' : '', parameters.matcap ? '#define USE_MATCAP' : '', parameters.envMap ? '#define USE_ENVMAP' : '', parameters.envMap ? '#define ' + envMapTypeDefine : '', parameters.envMap ? '#define ' + envMapModeDefine : '', parameters.envMap ? '#define ' + envMapBlendingDefine : '', parameters.lightMap ? '#define USE_LIGHTMAP' : '', parameters.aoMap ? '#define USE_AOMAP' : '', parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '', parameters.bumpMap ? '#define USE_BUMPMAP' : '', parameters.normalMap ? '#define USE_NORMALMAP' : '', parameters.normalMap && parameters.objectSpaceNormalMap ? '#define OBJECTSPACE_NORMALMAP' : '', parameters.normalMap && parameters.tangentSpaceNormalMap ? '#define TANGENTSPACE_NORMALMAP' : '', parameters.clearcoat ? '#define USE_CLEARCOAT' : '', parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '', parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '', parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '', parameters.specularMap ? '#define USE_SPECULARMAP' : '', parameters.specularIntensityMap ? '#define USE_SPECULARINTENSITYMAP' : '', parameters.specularTintMap ? '#define USE_SPECULARTINTMAP' : '', parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '', parameters.metalnessMap ? '#define USE_METALNESSMAP' : '', parameters.alphaMap ? '#define USE_ALPHAMAP' : '', parameters.alphaTest ? '#define USE_ALPHATEST' : '', parameters.sheen ? '#define USE_SHEEN' : '', parameters.transmission ? '#define USE_TRANSMISSION' : '', parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '', parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '', parameters.vertexTangents ? '#define USE_TANGENT' : '', parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '', parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '', parameters.vertexUvs ? '#define USE_UV' : '', parameters.uvsVertexOnly ? '#define UVS_VERTEX_ONLY' : '', parameters.gradientMap ? '#define USE_GRADIENTMAP' : '', parameters.flatShading ? '#define FLAT_SHADED' : '', parameters.doubleSided ? '#define DOUBLE_SIDED' : '', parameters.flipSided ? '#define FLIP_SIDED' : '', parameters.shadowMapEnabled ? '#define USE_SHADOWMAP' : '', parameters.shadowMapEnabled ? '#define ' + shadowMapTypeDefine : '', parameters.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '', parameters.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '', parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '', parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ? '#define USE_LOGDEPTHBUF_EXT' : '', (parameters.extensionShaderTextureLOD || parameters.envMap) && parameters.rendererExtensionShaderTextureLod ? '#define TEXTURE_LOD_EXT' : '', 'uniform mat4 viewMatrix;', 'uniform vec3 cameraPosition;', 'uniform bool isOrthographic;', parameters.toneMapping !== NoToneMapping ? '#define TONE_MAPPING' : '', parameters.toneMapping !== NoToneMapping ? ShaderChunk['tonemapping_pars_fragment'] : '', // this code is required here because it is used by the toneMapping() function defined below\n\t\t\tparameters.toneMapping !== NoToneMapping ? getToneMappingFunction('toneMapping', parameters.toneMapping) : '', parameters.dithering ? '#define DITHERING' : '', parameters.format === RGBFormat ? '#define OPAQUE' : '', ShaderChunk['encodings_pars_fragment'], // this code is required here because it is used by the various encoding/decoding function defined below\n\t\t\tparameters.map ? getTexelDecodingFunction('mapTexelToLinear', parameters.mapEncoding) : '', parameters.matcap ? getTexelDecodingFunction('matcapTexelToLinear', parameters.matcapEncoding) : '', parameters.envMap ? getTexelDecodingFunction('envMapTexelToLinear', parameters.envMapEncoding) : '', parameters.emissiveMap ? getTexelDecodingFunction('emissiveMapTexelToLinear', parameters.emissiveMapEncoding) : '', parameters.specularTintMap ? getTexelDecodingFunction('specularTintMapTexelToLinear', parameters.specularTintMapEncoding) : '', parameters.lightMap ? getTexelDecodingFunction('lightMapTexelToLinear', parameters.lightMapEncoding) : '', getTexelEncodingFunction('linearToOutputTexel', parameters.outputEncoding), parameters.depthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '', '\\n'].filter(filterEmptyLine).join('\\n');\n\t\t}\n\n\t\tvertexShader = resolveIncludes(vertexShader);\n\t\tvertexShader = replaceLightNums(vertexShader, parameters);\n\t\tvertexShader = replaceClippingPlaneNums(vertexShader, parameters);\n\t\tfragmentShader = resolveIncludes(fragmentShader);\n\t\tfragmentShader = replaceLightNums(fragmentShader, parameters);\n\t\tfragmentShader = replaceClippingPlaneNums(fragmentShader, parameters);\n\t\tvertexShader = unrollLoops(vertexShader);\n\t\tfragmentShader = unrollLoops(fragmentShader);\n\n\t\tif (parameters.isWebGL2 && parameters.isRawShaderMaterial !== true) {\n\t\t\t// GLSL 3.0 conversion for built-in materials and ShaderMaterial\n\t\t\tversionString = '#version 300 es\\n';\n\t\t\tprefixVertex = ['precision mediump sampler2DArray;', '#define attribute in', '#define varying out', '#define texture2D texture'].join('\\n') + '\\n' + prefixVertex;\n\t\t\tprefixFragment = ['#define varying in', parameters.glslVersion === GLSL3 ? '' : 'out highp vec4 pc_fragColor;', parameters.glslVersion === GLSL3 ? '' : '#define gl_FragColor pc_fragColor', '#define gl_FragDepthEXT gl_FragDepth', '#define texture2D texture', '#define textureCube texture', '#define texture2DProj textureProj', '#define texture2DLodEXT textureLod', '#define texture2DProjLodEXT textureProjLod', '#define textureCubeLodEXT textureLod', '#define texture2DGradEXT textureGrad', '#define texture2DProjGradEXT textureProjGrad', '#define textureCubeGradEXT textureGrad'].join('\\n') + '\\n' + prefixFragment;\n\t\t}\n\n\t\tconst vertexGlsl = versionString + prefixVertex + vertexShader;\n\t\tconst fragmentGlsl = versionString + prefixFragment + fragmentShader; // console.log( '*VERTEX*', vertexGlsl );\n\t\t// console.log( '*FRAGMENT*', fragmentGlsl );\n\n\t\tconst glVertexShader = WebGLShader(gl, gl.VERTEX_SHADER, vertexGlsl);\n\t\tconst glFragmentShader = WebGLShader(gl, gl.FRAGMENT_SHADER, fragmentGlsl);\n\t\tgl.attachShader(program, glVertexShader);\n\t\tgl.attachShader(program, glFragmentShader); // Force a particular attribute to index 0.\n\n\t\tif (parameters.index0AttributeName !== undefined) {\n\t\t\tgl.bindAttribLocation(program, 0, parameters.index0AttributeName);\n\t\t} else if (parameters.morphTargets === true) {\n\t\t\t// programs with morphTargets displace position out of attribute 0\n\t\t\tgl.bindAttribLocation(program, 0, 'position');\n\t\t}\n\n\t\tgl.linkProgram(program); // check for link errors\n\n\t\tif (renderer.debug.checkShaderErrors) {\n\t\t\tconst programLog = gl.getProgramInfoLog(program).trim();\n\t\t\tconst vertexLog = gl.getShaderInfoLog(glVertexShader).trim();\n\t\t\tconst fragmentLog = gl.getShaderInfoLog(glFragmentShader).trim();\n\t\t\tlet runnable = true;\n\t\t\tlet haveDiagnostics = true;\n\n\t\t\tif (gl.getProgramParameter(program, gl.LINK_STATUS) === false) {\n\t\t\t\trunnable = false;\n\t\t\t\tconst vertexErrors = getShaderErrors(gl, glVertexShader, 'vertex');\n\t\t\t\tconst fragmentErrors = getShaderErrors(gl, glFragmentShader, 'fragment');\n\t\t\t\tconsole.error('THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' + 'VALIDATE_STATUS ' + gl.getProgramParameter(program, gl.VALIDATE_STATUS) + '\\n\\n' + 'Program Info Log: ' + programLog + '\\n' + vertexErrors + '\\n' + fragmentErrors);\n\t\t\t} else if (programLog !== '') {\n\t\t\t\tconsole.warn('THREE.WebGLProgram: Program Info Log:', programLog);\n\t\t\t} else if (vertexLog === '' || fragmentLog === '') {\n\t\t\t\thaveDiagnostics = false;\n\t\t\t}\n\n\t\t\tif (haveDiagnostics) {\n\t\t\t\tthis.diagnostics = {\n\t\t\t\t\trunnable: runnable,\n\t\t\t\t\tprogramLog: programLog,\n\t\t\t\t\tvertexShader: {\n\t\t\t\t\t\tlog: vertexLog,\n\t\t\t\t\t\tprefix: prefixVertex\n\t\t\t\t\t},\n\t\t\t\t\tfragmentShader: {\n\t\t\t\t\t\tlog: fragmentLog,\n\t\t\t\t\t\tprefix: prefixFragment\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t} // Clean up\n\t\t// Crashes in iOS9 and iOS10. #18402\n\t\t// gl.detachShader( program, glVertexShader );\n\t\t// gl.detachShader( program, glFragmentShader );\n\n\n\t\tgl.deleteShader(glVertexShader);\n\t\tgl.deleteShader(glFragmentShader); // set up caching for uniform locations\n\n\t\tlet cachedUniforms;\n\n\t\tthis.getUniforms = function () {\n\t\t\tif (cachedUniforms === undefined) {\n\t\t\t\tcachedUniforms = new WebGLUniforms(gl, program);\n\t\t\t}\n\n\t\t\treturn cachedUniforms;\n\t\t}; // set up caching for attribute locations\n\n\n\t\tlet cachedAttributes;\n\n\t\tthis.getAttributes = function () {\n\t\t\tif (cachedAttributes === undefined) {\n\t\t\t\tcachedAttributes = fetchAttributeLocations(gl, program);\n\t\t\t}\n\n\t\t\treturn cachedAttributes;\n\t\t}; // free resource\n\n\n\t\tthis.destroy = function () {\n\t\t\tbindingStates.releaseStatesOfProgram(this);\n\t\t\tgl.deleteProgram(program);\n\t\t\tthis.program = undefined;\n\t\t}; //\n\n\n\t\tthis.name = parameters.shaderName;\n\t\tthis.id = programIdCount++;\n\t\tthis.cacheKey = cacheKey;\n\t\tthis.usedTimes = 1;\n\t\tthis.program = program;\n\t\tthis.vertexShader = glVertexShader;\n\t\tthis.fragmentShader = glFragmentShader;\n\t\treturn this;\n\t}\n\n\tfunction WebGLPrograms(renderer, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping) {\n\t\tconst programs = [];\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tconst logarithmicDepthBuffer = capabilities.logarithmicDepthBuffer;\n\t\tconst floatVertexTextures = capabilities.floatVertexTextures;\n\t\tconst maxVertexUniforms = capabilities.maxVertexUniforms;\n\t\tconst vertexTextures = capabilities.vertexTextures;\n\t\tlet precision = capabilities.precision;\n\t\tconst shaderIDs = {\n\t\t\tMeshDepthMaterial: 'depth',\n\t\t\tMeshDistanceMaterial: 'distanceRGBA',\n\t\t\tMeshNormalMaterial: 'normal',\n\t\t\tMeshBasicMaterial: 'basic',\n\t\t\tMeshLambertMaterial: 'lambert',\n\t\t\tMeshPhongMaterial: 'phong',\n\t\t\tMeshToonMaterial: 'toon',\n\t\t\tMeshStandardMaterial: 'physical',\n\t\t\tMeshPhysicalMaterial: 'physical',\n\t\t\tMeshMatcapMaterial: 'matcap',\n\t\t\tLineBasicMaterial: 'basic',\n\t\t\tLineDashedMaterial: 'dashed',\n\t\t\tPointsMaterial: 'points',\n\t\t\tShadowMaterial: 'shadow',\n\t\t\tSpriteMaterial: 'sprite'\n\t\t};\n\t\tconst parameterNames = ['precision', 'isWebGL2', 'supportsVertexTextures', 'outputEncoding', 'instancing', 'instancingColor', 'map', 'mapEncoding', 'matcap', 'matcapEncoding', 'envMap', 'envMapMode', 'envMapEncoding', 'envMapCubeUV', 'lightMap', 'lightMapEncoding', 'aoMap', 'emissiveMap', 'emissiveMapEncoding', 'bumpMap', 'normalMap', 'objectSpaceNormalMap', 'tangentSpaceNormalMap', 'clearcoat', 'clearcoatMap', 'clearcoatRoughnessMap', 'clearcoatNormalMap', 'displacementMap', 'specularMap', 'specularIntensityMap', 'specularTintMap', 'specularTintMapEncoding', 'roughnessMap', 'metalnessMap', 'gradientMap', 'alphaMap', 'alphaTest', 'combine', 'vertexColors', 'vertexAlphas', 'vertexTangents', 'vertexUvs', 'uvsVertexOnly', 'fog', 'useFog', 'fogExp2', 'flatShading', 'sizeAttenuation', 'logarithmicDepthBuffer', 'skinning', 'maxBones', 'useVertexTexture', 'morphTargets', 'morphNormals', 'morphTargetsCount', 'premultipliedAlpha', 'numDirLights', 'numPointLights', 'numSpotLights', 'numHemiLights', 'numRectAreaLights', 'numDirLightShadows', 'numPointLightShadows', 'numSpotLightShadows', 'shadowMapEnabled', 'shadowMapType', 'toneMapping', 'physicallyCorrectLights', 'doubleSided', 'flipSided', 'numClippingPlanes', 'numClipIntersection', 'depthPacking', 'dithering', 'format', 'sheen', 'transmission', 'transmissionMap', 'thicknessMap'];\n\n\t\tfunction getMaxBones(object) {\n\t\t\tconst skeleton = object.skeleton;\n\t\t\tconst bones = skeleton.bones;\n\n\t\t\tif (floatVertexTextures) {\n\t\t\t\treturn 1024;\n\t\t\t} else {\n\t\t\t\t// default for when object is not specified\n\t\t\t\t// ( for example when prebuilding shader to be used with multiple objects )\n\t\t\t\t//\n\t\t\t\t//\t- leave some extra space for other uniforms\n\t\t\t\t//\t- limit here is ANGLE's 254 max uniform vectors\n\t\t\t\t//\t\t(up to 54 should be safe)\n\t\t\t\tconst nVertexUniforms = maxVertexUniforms;\n\t\t\t\tconst nVertexMatrices = Math.floor((nVertexUniforms - 20) / 4);\n\t\t\t\tconst maxBones = Math.min(nVertexMatrices, bones.length);\n\n\t\t\t\tif (maxBones < bones.length) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Skeleton has ' + bones.length + ' bones. This GPU supports ' + maxBones + '.');\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\n\t\t\t\treturn maxBones;\n\t\t\t}\n\t\t}\n\n\t\tfunction getTextureEncodingFromMap(map) {\n\t\t\tlet encoding;\n\n\t\t\tif (map && map.isTexture) {\n\t\t\t\tencoding = map.encoding;\n\t\t\t} else if (map && map.isWebGLRenderTarget) {\n\t\t\t\tconsole.warn('THREE.WebGLPrograms.getTextureEncodingFromMap: don\\'t use render targets as textures. Use their .texture property instead.');\n\t\t\t\tencoding = map.texture.encoding;\n\t\t\t} else {\n\t\t\t\tencoding = LinearEncoding;\n\t\t\t}\n\n\t\t\tif (isWebGL2 && map && map.isTexture && map.format === RGBAFormat && map.type === UnsignedByteType && map.encoding === sRGBEncoding) {\n\t\t\t\tencoding = LinearEncoding; // disable inline decode for sRGB textures in WebGL 2\n\t\t\t}\n\n\t\t\treturn encoding;\n\t\t}\n\n\t\tfunction getParameters(material, lights, shadows, scene, object) {\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment);\n\t\t\tconst shaderID = shaderIDs[material.type]; // heuristics to create shader parameters according to lights in the scene\n\t\t\t// (not to blow over maxLights budget)\n\n\t\t\tconst maxBones = object.isSkinnedMesh ? getMaxBones(object) : 0;\n\n\t\t\tif (material.precision !== null) {\n\t\t\t\tprecision = capabilities.getMaxPrecision(material.precision);\n\n\t\t\t\tif (precision !== material.precision) {\n\t\t\t\t\tconsole.warn('THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet vertexShader, fragmentShader;\n\n\t\t\tif (shaderID) {\n\t\t\t\tconst shader = ShaderLib[shaderID];\n\t\t\t\tvertexShader = shader.vertexShader;\n\t\t\t\tfragmentShader = shader.fragmentShader;\n\t\t\t} else {\n\t\t\t\tvertexShader = material.vertexShader;\n\t\t\t\tfragmentShader = material.fragmentShader;\n\t\t\t}\n\n\t\t\tconst currentRenderTarget = renderer.getRenderTarget();\n\t\t\tconst useAlphaTest = material.alphaTest > 0;\n\t\t\tconst useClearcoat = material.clearcoat > 0;\n\t\t\tconst parameters = {\n\t\t\t\tisWebGL2: isWebGL2,\n\t\t\t\tshaderID: shaderID,\n\t\t\t\tshaderName: material.type,\n\t\t\t\tvertexShader: vertexShader,\n\t\t\t\tfragmentShader: fragmentShader,\n\t\t\t\tdefines: material.defines,\n\t\t\t\tisRawShaderMaterial: material.isRawShaderMaterial === true,\n\t\t\t\tglslVersion: material.glslVersion,\n\t\t\t\tprecision: precision,\n\t\t\t\tinstancing: object.isInstancedMesh === true,\n\t\t\t\tinstancingColor: object.isInstancedMesh === true && object.instanceColor !== null,\n\t\t\t\tsupportsVertexTextures: vertexTextures,\n\t\t\t\toutputEncoding: currentRenderTarget !== null ? getTextureEncodingFromMap(currentRenderTarget.texture) : renderer.outputEncoding,\n\t\t\t\tmap: !!material.map,\n\t\t\t\tmapEncoding: getTextureEncodingFromMap(material.map),\n\t\t\t\tmatcap: !!material.matcap,\n\t\t\t\tmatcapEncoding: getTextureEncodingFromMap(material.matcap),\n\t\t\t\tenvMap: !!envMap,\n\t\t\t\tenvMapMode: envMap && envMap.mapping,\n\t\t\t\tenvMapEncoding: getTextureEncodingFromMap(envMap),\n\t\t\t\tenvMapCubeUV: !!envMap && (envMap.mapping === CubeUVReflectionMapping || envMap.mapping === CubeUVRefractionMapping),\n\t\t\t\tlightMap: !!material.lightMap,\n\t\t\t\tlightMapEncoding: getTextureEncodingFromMap(material.lightMap),\n\t\t\t\taoMap: !!material.aoMap,\n\t\t\t\temissiveMap: !!material.emissiveMap,\n\t\t\t\temissiveMapEncoding: getTextureEncodingFromMap(material.emissiveMap),\n\t\t\t\tbumpMap: !!material.bumpMap,\n\t\t\t\tnormalMap: !!material.normalMap,\n\t\t\t\tobjectSpaceNormalMap: material.normalMapType === ObjectSpaceNormalMap,\n\t\t\t\ttangentSpaceNormalMap: material.normalMapType === TangentSpaceNormalMap,\n\t\t\t\tclearcoat: useClearcoat,\n\t\t\t\tclearcoatMap: useClearcoat && !!material.clearcoatMap,\n\t\t\t\tclearcoatRoughnessMap: useClearcoat && !!material.clearcoatRoughnessMap,\n\t\t\t\tclearcoatNormalMap: useClearcoat && !!material.clearcoatNormalMap,\n\t\t\t\tdisplacementMap: !!material.displacementMap,\n\t\t\t\troughnessMap: !!material.roughnessMap,\n\t\t\t\tmetalnessMap: !!material.metalnessMap,\n\t\t\t\tspecularMap: !!material.specularMap,\n\t\t\t\tspecularIntensityMap: !!material.specularIntensityMap,\n\t\t\t\tspecularTintMap: !!material.specularTintMap,\n\t\t\t\tspecularTintMapEncoding: getTextureEncodingFromMap(material.specularTintMap),\n\t\t\t\talphaMap: !!material.alphaMap,\n\t\t\t\talphaTest: useAlphaTest,\n\t\t\t\tgradientMap: !!material.gradientMap,\n\t\t\t\tsheen: material.sheen > 0,\n\t\t\t\ttransmission: material.transmission > 0,\n\t\t\t\ttransmissionMap: !!material.transmissionMap,\n\t\t\t\tthicknessMap: !!material.thicknessMap,\n\t\t\t\tcombine: material.combine,\n\t\t\t\tvertexTangents: !!material.normalMap && !!object.geometry && !!object.geometry.attributes.tangent,\n\t\t\t\tvertexColors: material.vertexColors,\n\t\t\t\tvertexAlphas: material.vertexColors === true && !!object.geometry && !!object.geometry.attributes.color && object.geometry.attributes.color.itemSize === 4,\n\t\t\t\tvertexUvs: !!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatMap || !!material.clearcoatRoughnessMap || !!material.clearcoatNormalMap || !!material.displacementMap || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularTintMap,\n\t\t\t\tuvsVertexOnly: !(!!material.map || !!material.bumpMap || !!material.normalMap || !!material.specularMap || !!material.alphaMap || !!material.emissiveMap || !!material.roughnessMap || !!material.metalnessMap || !!material.clearcoatNormalMap || material.transmission > 0 || !!material.transmissionMap || !!material.thicknessMap || !!material.specularIntensityMap || !!material.specularTintMap) && !!material.displacementMap,\n\t\t\t\tfog: !!fog,\n\t\t\t\tuseFog: material.fog,\n\t\t\t\tfogExp2: fog && fog.isFogExp2,\n\t\t\t\tflatShading: !!material.flatShading,\n\t\t\t\tsizeAttenuation: material.sizeAttenuation,\n\t\t\t\tlogarithmicDepthBuffer: logarithmicDepthBuffer,\n\t\t\t\tskinning: object.isSkinnedMesh === true && maxBones > 0,\n\t\t\t\tmaxBones: maxBones,\n\t\t\t\tuseVertexTexture: floatVertexTextures,\n\t\t\t\tmorphTargets: !!object.geometry && !!object.geometry.morphAttributes.position,\n\t\t\t\tmorphNormals: !!object.geometry && !!object.geometry.morphAttributes.normal,\n\t\t\t\tmorphTargetsCount: !!object.geometry && !!object.geometry.morphAttributes.position ? object.geometry.morphAttributes.position.length : 0,\n\t\t\t\tnumDirLights: lights.directional.length,\n\t\t\t\tnumPointLights: lights.point.length,\n\t\t\t\tnumSpotLights: lights.spot.length,\n\t\t\t\tnumRectAreaLights: lights.rectArea.length,\n\t\t\t\tnumHemiLights: lights.hemi.length,\n\t\t\t\tnumDirLightShadows: lights.directionalShadowMap.length,\n\t\t\t\tnumPointLightShadows: lights.pointShadowMap.length,\n\t\t\t\tnumSpotLightShadows: lights.spotShadowMap.length,\n\t\t\t\tnumClippingPlanes: clipping.numPlanes,\n\t\t\t\tnumClipIntersection: clipping.numIntersection,\n\t\t\t\tformat: material.format,\n\t\t\t\tdithering: material.dithering,\n\t\t\t\tshadowMapEnabled: renderer.shadowMap.enabled && shadows.length > 0,\n\t\t\t\tshadowMapType: renderer.shadowMap.type,\n\t\t\t\ttoneMapping: material.toneMapped ? renderer.toneMapping : NoToneMapping,\n\t\t\t\tphysicallyCorrectLights: renderer.physicallyCorrectLights,\n\t\t\t\tpremultipliedAlpha: material.premultipliedAlpha,\n\t\t\t\tdoubleSided: material.side === DoubleSide,\n\t\t\t\tflipSided: material.side === BackSide,\n\t\t\t\tdepthPacking: material.depthPacking !== undefined ? material.depthPacking : false,\n\t\t\t\tindex0AttributeName: material.index0AttributeName,\n\t\t\t\textensionDerivatives: material.extensions && material.extensions.derivatives,\n\t\t\t\textensionFragDepth: material.extensions && material.extensions.fragDepth,\n\t\t\t\textensionDrawBuffers: material.extensions && material.extensions.drawBuffers,\n\t\t\t\textensionShaderTextureLOD: material.extensions && material.extensions.shaderTextureLOD,\n\t\t\t\trendererExtensionFragDepth: isWebGL2 || extensions.has('EXT_frag_depth'),\n\t\t\t\trendererExtensionDrawBuffers: isWebGL2 || extensions.has('WEBGL_draw_buffers'),\n\t\t\t\trendererExtensionShaderTextureLod: isWebGL2 || extensions.has('EXT_shader_texture_lod'),\n\t\t\t\tcustomProgramCacheKey: material.customProgramCacheKey()\n\t\t\t};\n\t\t\treturn parameters;\n\t\t}\n\n\t\tfunction getProgramCacheKey(parameters) {\n\t\t\tconst array = [];\n\n\t\t\tif (parameters.shaderID) {\n\t\t\t\tarray.push(parameters.shaderID);\n\t\t\t} else {\n\t\t\t\tarray.push(parameters.fragmentShader);\n\t\t\t\tarray.push(parameters.vertexShader);\n\t\t\t}\n\n\t\t\tif (parameters.defines !== undefined) {\n\t\t\t\tfor (const name in parameters.defines) {\n\t\t\t\t\tarray.push(name);\n\t\t\t\t\tarray.push(parameters.defines[name]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (parameters.isRawShaderMaterial === false) {\n\t\t\t\tfor (let i = 0; i < parameterNames.length; i++) {\n\t\t\t\t\tarray.push(parameters[parameterNames[i]]);\n\t\t\t\t}\n\n\t\t\t\tarray.push(renderer.outputEncoding);\n\t\t\t\tarray.push(renderer.gammaFactor);\n\t\t\t}\n\n\t\t\tarray.push(parameters.customProgramCacheKey);\n\t\t\treturn array.join();\n\t\t}\n\n\t\tfunction getUniforms(material) {\n\t\t\tconst shaderID = shaderIDs[material.type];\n\t\t\tlet uniforms;\n\n\t\t\tif (shaderID) {\n\t\t\t\tconst shader = ShaderLib[shaderID];\n\t\t\t\tuniforms = UniformsUtils.clone(shader.uniforms);\n\t\t\t} else {\n\t\t\t\tuniforms = material.uniforms;\n\t\t\t}\n\n\t\t\treturn uniforms;\n\t\t}\n\n\t\tfunction acquireProgram(parameters, cacheKey) {\n\t\t\tlet program; // Check if code has been already compiled\n\n\t\t\tfor (let p = 0, pl = programs.length; p < pl; p++) {\n\t\t\t\tconst preexistingProgram = programs[p];\n\n\t\t\t\tif (preexistingProgram.cacheKey === cacheKey) {\n\t\t\t\t\tprogram = preexistingProgram;\n\t\t\t\t\t++program.usedTimes;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (program === undefined) {\n\t\t\t\tprogram = new WebGLProgram(renderer, cacheKey, parameters, bindingStates);\n\t\t\t\tprograms.push(program);\n\t\t\t}\n\n\t\t\treturn program;\n\t\t}\n\n\t\tfunction releaseProgram(program) {\n\t\t\tif (--program.usedTimes === 0) {\n\t\t\t\t// Remove from unordered set\n\t\t\t\tconst i = programs.indexOf(program);\n\t\t\t\tprograms[i] = programs[programs.length - 1];\n\t\t\t\tprograms.pop(); // Free WebGL resources\n\n\t\t\t\tprogram.destroy();\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tgetParameters: getParameters,\n\t\t\tgetProgramCacheKey: getProgramCacheKey,\n\t\t\tgetUniforms: getUniforms,\n\t\t\tacquireProgram: acquireProgram,\n\t\t\treleaseProgram: releaseProgram,\n\t\t\t// Exposed for resource monitoring & error feedback via renderer.info:\n\t\t\tprograms: programs\n\t\t};\n\t}\n\n\tfunction WebGLProperties() {\n\t\tlet properties = new WeakMap();\n\n\t\tfunction get(object) {\n\t\t\tlet map = properties.get(object);\n\n\t\t\tif (map === undefined) {\n\t\t\t\tmap = {};\n\t\t\t\tproperties.set(object, map);\n\t\t\t}\n\n\t\t\treturn map;\n\t\t}\n\n\t\tfunction remove(object) {\n\t\t\tproperties.delete(object);\n\t\t}\n\n\t\tfunction update(object, key, value) {\n\t\t\tproperties.get(object)[key] = value;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tproperties = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tremove: remove,\n\t\t\tupdate: update,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tfunction painterSortStable(a, b) {\n\t\tif (a.groupOrder !== b.groupOrder) {\n\t\t\treturn a.groupOrder - b.groupOrder;\n\t\t} else if (a.renderOrder !== b.renderOrder) {\n\t\t\treturn a.renderOrder - b.renderOrder;\n\t\t} else if (a.program !== b.program) {\n\t\t\treturn a.program.id - b.program.id;\n\t\t} else if (a.material.id !== b.material.id) {\n\t\t\treturn a.material.id - b.material.id;\n\t\t} else if (a.z !== b.z) {\n\t\t\treturn a.z - b.z;\n\t\t} else {\n\t\t\treturn a.id - b.id;\n\t\t}\n\t}\n\n\tfunction reversePainterSortStable(a, b) {\n\t\tif (a.groupOrder !== b.groupOrder) {\n\t\t\treturn a.groupOrder - b.groupOrder;\n\t\t} else if (a.renderOrder !== b.renderOrder) {\n\t\t\treturn a.renderOrder - b.renderOrder;\n\t\t} else if (a.z !== b.z) {\n\t\t\treturn b.z - a.z;\n\t\t} else {\n\t\t\treturn a.id - b.id;\n\t\t}\n\t}\n\n\tfunction WebGLRenderList(properties) {\n\t\tconst renderItems = [];\n\t\tlet renderItemsIndex = 0;\n\t\tconst opaque = [];\n\t\tconst transmissive = [];\n\t\tconst transparent = [];\n\t\tconst defaultProgram = {\n\t\t\tid: -1\n\t\t};\n\n\t\tfunction init() {\n\t\t\trenderItemsIndex = 0;\n\t\t\topaque.length = 0;\n\t\t\ttransmissive.length = 0;\n\t\t\ttransparent.length = 0;\n\t\t}\n\n\t\tfunction getNextRenderItem(object, geometry, material, groupOrder, z, group) {\n\t\t\tlet renderItem = renderItems[renderItemsIndex];\n\t\t\tconst materialProperties = properties.get(material);\n\n\t\t\tif (renderItem === undefined) {\n\t\t\t\trenderItem = {\n\t\t\t\t\tid: object.id,\n\t\t\t\t\tobject: object,\n\t\t\t\t\tgeometry: geometry,\n\t\t\t\t\tmaterial: material,\n\t\t\t\t\tprogram: materialProperties.program || defaultProgram,\n\t\t\t\t\tgroupOrder: groupOrder,\n\t\t\t\t\trenderOrder: object.renderOrder,\n\t\t\t\t\tz: z,\n\t\t\t\t\tgroup: group\n\t\t\t\t};\n\t\t\t\trenderItems[renderItemsIndex] = renderItem;\n\t\t\t} else {\n\t\t\t\trenderItem.id = object.id;\n\t\t\t\trenderItem.object = object;\n\t\t\t\trenderItem.geometry = geometry;\n\t\t\t\trenderItem.material = material;\n\t\t\t\trenderItem.program = materialProperties.program || defaultProgram;\n\t\t\t\trenderItem.groupOrder = groupOrder;\n\t\t\t\trenderItem.renderOrder = object.renderOrder;\n\t\t\t\trenderItem.z = z;\n\t\t\t\trenderItem.group = group;\n\t\t\t}\n\n\t\t\trenderItemsIndex++;\n\t\t\treturn renderItem;\n\t\t}\n\n\t\tfunction push(object, geometry, material, groupOrder, z, group) {\n\t\t\tconst renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group);\n\n\t\t\tif (material.transmission > 0.0) {\n\t\t\t\ttransmissive.push(renderItem);\n\t\t\t} else if (material.transparent === true) {\n\t\t\t\ttransparent.push(renderItem);\n\t\t\t} else {\n\t\t\t\topaque.push(renderItem);\n\t\t\t}\n\t\t}\n\n\t\tfunction unshift(object, geometry, material, groupOrder, z, group) {\n\t\t\tconst renderItem = getNextRenderItem(object, geometry, material, groupOrder, z, group);\n\n\t\t\tif (material.transmission > 0.0) {\n\t\t\t\ttransmissive.unshift(renderItem);\n\t\t\t} else if (material.transparent === true) {\n\t\t\t\ttransparent.unshift(renderItem);\n\t\t\t} else {\n\t\t\t\topaque.unshift(renderItem);\n\t\t\t}\n\t\t}\n\n\t\tfunction sort(customOpaqueSort, customTransparentSort) {\n\t\t\tif (opaque.length > 1) opaque.sort(customOpaqueSort || painterSortStable);\n\t\t\tif (transmissive.length > 1) transmissive.sort(customTransparentSort || reversePainterSortStable);\n\t\t\tif (transparent.length > 1) transparent.sort(customTransparentSort || reversePainterSortStable);\n\t\t}\n\n\t\tfunction finish() {\n\t\t\t// Clear references from inactive renderItems in the list\n\t\t\tfor (let i = renderItemsIndex, il = renderItems.length; i < il; i++) {\n\t\t\t\tconst renderItem = renderItems[i];\n\t\t\t\tif (renderItem.id === null) break;\n\t\t\t\trenderItem.id = null;\n\t\t\t\trenderItem.object = null;\n\t\t\t\trenderItem.geometry = null;\n\t\t\t\trenderItem.material = null;\n\t\t\t\trenderItem.program = null;\n\t\t\t\trenderItem.group = null;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\topaque: opaque,\n\t\t\ttransmissive: transmissive,\n\t\t\ttransparent: transparent,\n\t\t\tinit: init,\n\t\t\tpush: push,\n\t\t\tunshift: unshift,\n\t\t\tfinish: finish,\n\t\t\tsort: sort\n\t\t};\n\t}\n\n\tfunction WebGLRenderLists(properties) {\n\t\tlet lists = new WeakMap();\n\n\t\tfunction get(scene, renderCallDepth) {\n\t\t\tlet list;\n\n\t\t\tif (lists.has(scene) === false) {\n\t\t\t\tlist = new WebGLRenderList(properties);\n\t\t\t\tlists.set(scene, [list]);\n\t\t\t} else {\n\t\t\t\tif (renderCallDepth >= lists.get(scene).length) {\n\t\t\t\t\tlist = new WebGLRenderList(properties);\n\t\t\t\t\tlists.get(scene).push(list);\n\t\t\t\t} else {\n\t\t\t\t\tlist = lists.get(scene)[renderCallDepth];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn list;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\tlists = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\tfunction UniformsCache() {\n\t\tconst lights = {};\n\t\treturn {\n\t\t\tget: function (light) {\n\t\t\t\tif (lights[light.id] !== undefined) {\n\t\t\t\t\treturn lights[light.id];\n\t\t\t\t}\n\n\t\t\t\tlet uniforms;\n\n\t\t\t\tswitch (light.type) {\n\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\t\tconeCos: 0,\n\t\t\t\t\t\t\tpenumbraCos: 0,\n\t\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tdistance: 0,\n\t\t\t\t\t\t\tdecay: 0\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tdirection: new Vector3(),\n\t\t\t\t\t\t\tskyColor: new Color(),\n\t\t\t\t\t\t\tgroundColor: new Color()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tcolor: new Color(),\n\t\t\t\t\t\t\tposition: new Vector3(),\n\t\t\t\t\t\t\thalfWidth: new Vector3(),\n\t\t\t\t\t\t\thalfHeight: new Vector3()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tlights[light.id] = uniforms;\n\t\t\t\treturn uniforms;\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction ShadowUniformsCache() {\n\t\tconst lights = {};\n\t\treturn {\n\t\t\tget: function (light) {\n\t\t\t\tif (lights[light.id] !== undefined) {\n\t\t\t\t\treturn lights[light.id];\n\t\t\t\t}\n\n\t\t\t\tlet uniforms;\n\n\t\t\t\tswitch (light.type) {\n\t\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'SpotLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2()\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'PointLight':\n\t\t\t\t\t\tuniforms = {\n\t\t\t\t\t\t\tshadowBias: 0,\n\t\t\t\t\t\t\tshadowNormalBias: 0,\n\t\t\t\t\t\t\tshadowRadius: 1,\n\t\t\t\t\t\t\tshadowMapSize: new Vector2(),\n\t\t\t\t\t\t\tshadowCameraNear: 1,\n\t\t\t\t\t\t\tshadowCameraFar: 1000\n\t\t\t\t\t\t};\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t// TODO (abelnation): set RectAreaLight shadow uniforms\n\t\t\t\t}\n\n\t\t\t\tlights[light.id] = uniforms;\n\t\t\t\treturn uniforms;\n\t\t\t}\n\t\t};\n\t}\n\n\tlet nextVersion = 0;\n\n\tfunction shadowCastingLightsFirst(lightA, lightB) {\n\t\treturn (lightB.castShadow ? 1 : 0) - (lightA.castShadow ? 1 : 0);\n\t}\n\n\tfunction WebGLLights(extensions, capabilities) {\n\t\tconst cache = new UniformsCache();\n\t\tconst shadowCache = ShadowUniformsCache();\n\t\tconst state = {\n\t\t\tversion: 0,\n\t\t\thash: {\n\t\t\t\tdirectionalLength: -1,\n\t\t\t\tpointLength: -1,\n\t\t\t\tspotLength: -1,\n\t\t\t\trectAreaLength: -1,\n\t\t\t\themiLength: -1,\n\t\t\t\tnumDirectionalShadows: -1,\n\t\t\t\tnumPointShadows: -1,\n\t\t\t\tnumSpotShadows: -1\n\t\t\t},\n\t\t\tambient: [0, 0, 0],\n\t\t\tprobe: [],\n\t\t\tdirectional: [],\n\t\t\tdirectionalShadow: [],\n\t\t\tdirectionalShadowMap: [],\n\t\t\tdirectionalShadowMatrix: [],\n\t\t\tspot: [],\n\t\t\tspotShadow: [],\n\t\t\tspotShadowMap: [],\n\t\t\tspotShadowMatrix: [],\n\t\t\trectArea: [],\n\t\t\trectAreaLTC1: null,\n\t\t\trectAreaLTC2: null,\n\t\t\tpoint: [],\n\t\t\tpointShadow: [],\n\t\t\tpointShadowMap: [],\n\t\t\tpointShadowMatrix: [],\n\t\t\themi: []\n\t\t};\n\n\t\tfor (let i = 0; i < 9; i++) state.probe.push(new Vector3());\n\n\t\tconst vector3 = new Vector3();\n\t\tconst matrix4 = new Matrix4();\n\t\tconst matrix42 = new Matrix4();\n\n\t\tfunction setup(lights, physicallyCorrectLights) {\n\t\t\tlet r = 0,\n\t\t\t\t\tg = 0,\n\t\t\t\t\tb = 0;\n\n\t\t\tfor (let i = 0; i < 9; i++) state.probe[i].set(0, 0, 0);\n\n\t\t\tlet directionalLength = 0;\n\t\t\tlet pointLength = 0;\n\t\t\tlet spotLength = 0;\n\t\t\tlet rectAreaLength = 0;\n\t\t\tlet hemiLength = 0;\n\t\t\tlet numDirectionalShadows = 0;\n\t\t\tlet numPointShadows = 0;\n\t\t\tlet numSpotShadows = 0;\n\t\t\tlights.sort(shadowCastingLightsFirst); // artist-friendly light intensity scaling factor\n\n\t\t\tconst scaleFactor = physicallyCorrectLights !== true ? Math.PI : 1;\n\n\t\t\tfor (let i = 0, l = lights.length; i < l; i++) {\n\t\t\t\tconst light = lights[i];\n\t\t\t\tconst color = light.color;\n\t\t\t\tconst intensity = light.intensity;\n\t\t\t\tconst distance = light.distance;\n\t\t\t\tconst shadowMap = light.shadow && light.shadow.map ? light.shadow.map.texture : null;\n\n\t\t\t\tif (light.isAmbientLight) {\n\t\t\t\t\tr += color.r * intensity * scaleFactor;\n\t\t\t\t\tg += color.g * intensity * scaleFactor;\n\t\t\t\t\tb += color.b * intensity * scaleFactor;\n\t\t\t\t} else if (light.isLightProbe) {\n\t\t\t\t\tfor (let j = 0; j < 9; j++) {\n\t\t\t\t\t\tstate.probe[j].addScaledVector(light.sh.coefficients[j], intensity);\n\t\t\t\t\t}\n\t\t\t\t} else if (light.isDirectionalLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor);\n\n\t\t\t\t\tif (light.castShadow) {\n\t\t\t\t\t\tconst shadow = light.shadow;\n\t\t\t\t\t\tconst shadowUniforms = shadowCache.get(light);\n\t\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\t\tstate.directionalShadow[directionalLength] = shadowUniforms;\n\t\t\t\t\t\tstate.directionalShadowMap[directionalLength] = shadowMap;\n\t\t\t\t\t\tstate.directionalShadowMatrix[directionalLength] = light.shadow.matrix;\n\t\t\t\t\t\tnumDirectionalShadows++;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.directional[directionalLength] = uniforms;\n\t\t\t\t\tdirectionalLength++;\n\t\t\t\t} else if (light.isSpotLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.color.copy(color).multiplyScalar(intensity * scaleFactor);\n\t\t\t\t\tuniforms.distance = distance;\n\t\t\t\t\tuniforms.coneCos = Math.cos(light.angle);\n\t\t\t\t\tuniforms.penumbraCos = Math.cos(light.angle * (1 - light.penumbra));\n\t\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\t\tif (light.castShadow) {\n\t\t\t\t\t\tconst shadow = light.shadow;\n\t\t\t\t\t\tconst shadowUniforms = shadowCache.get(light);\n\t\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\t\tstate.spotShadow[spotLength] = shadowUniforms;\n\t\t\t\t\t\tstate.spotShadowMap[spotLength] = shadowMap;\n\t\t\t\t\t\tstate.spotShadowMatrix[spotLength] = light.shadow.matrix;\n\t\t\t\t\t\tnumSpotShadows++;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.spot[spotLength] = uniforms;\n\t\t\t\t\tspotLength++;\n\t\t\t\t} else if (light.isRectAreaLight) {\n\t\t\t\t\tconst uniforms = cache.get(light); // (a) intensity is the total visible light emitted\n\t\t\t\t\t//uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );\n\t\t\t\t\t// (b) intensity is the brightness of the light\n\n\t\t\t\t\tuniforms.color.copy(color).multiplyScalar(intensity);\n\t\t\t\t\tuniforms.halfWidth.set(light.width * 0.5, 0.0, 0.0);\n\t\t\t\t\tuniforms.halfHeight.set(0.0, light.height * 0.5, 0.0);\n\t\t\t\t\tstate.rectArea[rectAreaLength] = uniforms;\n\t\t\t\t\trectAreaLength++;\n\t\t\t\t} else if (light.isPointLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.color.copy(light.color).multiplyScalar(light.intensity * scaleFactor);\n\t\t\t\t\tuniforms.distance = light.distance;\n\t\t\t\t\tuniforms.decay = light.decay;\n\n\t\t\t\t\tif (light.castShadow) {\n\t\t\t\t\t\tconst shadow = light.shadow;\n\t\t\t\t\t\tconst shadowUniforms = shadowCache.get(light);\n\t\t\t\t\t\tshadowUniforms.shadowBias = shadow.bias;\n\t\t\t\t\t\tshadowUniforms.shadowNormalBias = shadow.normalBias;\n\t\t\t\t\t\tshadowUniforms.shadowRadius = shadow.radius;\n\t\t\t\t\t\tshadowUniforms.shadowMapSize = shadow.mapSize;\n\t\t\t\t\t\tshadowUniforms.shadowCameraNear = shadow.camera.near;\n\t\t\t\t\t\tshadowUniforms.shadowCameraFar = shadow.camera.far;\n\t\t\t\t\t\tstate.pointShadow[pointLength] = shadowUniforms;\n\t\t\t\t\t\tstate.pointShadowMap[pointLength] = shadowMap;\n\t\t\t\t\t\tstate.pointShadowMatrix[pointLength] = light.shadow.matrix;\n\t\t\t\t\t\tnumPointShadows++;\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.point[pointLength] = uniforms;\n\t\t\t\t\tpointLength++;\n\t\t\t\t} else if (light.isHemisphereLight) {\n\t\t\t\t\tconst uniforms = cache.get(light);\n\t\t\t\t\tuniforms.skyColor.copy(light.color).multiplyScalar(intensity * scaleFactor);\n\t\t\t\t\tuniforms.groundColor.copy(light.groundColor).multiplyScalar(intensity * scaleFactor);\n\t\t\t\t\tstate.hemi[hemiLength] = uniforms;\n\t\t\t\t\themiLength++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (rectAreaLength > 0) {\n\t\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t\t// WebGL 2\n\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\t\t\t\t} else {\n\t\t\t\t\t// WebGL 1\n\t\t\t\t\tif (extensions.has('OES_texture_float_linear') === true) {\n\t\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_FLOAT_1;\n\t\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_FLOAT_2;\n\t\t\t\t\t} else if (extensions.has('OES_texture_half_float_linear') === true) {\n\t\t\t\t\t\tstate.rectAreaLTC1 = UniformsLib.LTC_HALF_1;\n\t\t\t\t\t\tstate.rectAreaLTC2 = UniformsLib.LTC_HALF_2;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.ambient[0] = r;\n\t\t\tstate.ambient[1] = g;\n\t\t\tstate.ambient[2] = b;\n\t\t\tconst hash = state.hash;\n\n\t\t\tif (hash.directionalLength !== directionalLength || hash.pointLength !== pointLength || hash.spotLength !== spotLength || hash.rectAreaLength !== rectAreaLength || hash.hemiLength !== hemiLength || hash.numDirectionalShadows !== numDirectionalShadows || hash.numPointShadows !== numPointShadows || hash.numSpotShadows !== numSpotShadows) {\n\t\t\t\tstate.directional.length = directionalLength;\n\t\t\t\tstate.spot.length = spotLength;\n\t\t\t\tstate.rectArea.length = rectAreaLength;\n\t\t\t\tstate.point.length = pointLength;\n\t\t\t\tstate.hemi.length = hemiLength;\n\t\t\t\tstate.directionalShadow.length = numDirectionalShadows;\n\t\t\t\tstate.directionalShadowMap.length = numDirectionalShadows;\n\t\t\t\tstate.pointShadow.length = numPointShadows;\n\t\t\t\tstate.pointShadowMap.length = numPointShadows;\n\t\t\t\tstate.spotShadow.length = numSpotShadows;\n\t\t\t\tstate.spotShadowMap.length = numSpotShadows;\n\t\t\t\tstate.directionalShadowMatrix.length = numDirectionalShadows;\n\t\t\t\tstate.pointShadowMatrix.length = numPointShadows;\n\t\t\t\tstate.spotShadowMatrix.length = numSpotShadows;\n\t\t\t\thash.directionalLength = directionalLength;\n\t\t\t\thash.pointLength = pointLength;\n\t\t\t\thash.spotLength = spotLength;\n\t\t\t\thash.rectAreaLength = rectAreaLength;\n\t\t\t\thash.hemiLength = hemiLength;\n\t\t\t\thash.numDirectionalShadows = numDirectionalShadows;\n\t\t\t\thash.numPointShadows = numPointShadows;\n\t\t\t\thash.numSpotShadows = numSpotShadows;\n\t\t\t\tstate.version = nextVersion++;\n\t\t\t}\n\t\t}\n\n\t\tfunction setupView(lights, camera) {\n\t\t\tlet directionalLength = 0;\n\t\t\tlet pointLength = 0;\n\t\t\tlet spotLength = 0;\n\t\t\tlet rectAreaLength = 0;\n\t\t\tlet hemiLength = 0;\n\t\t\tconst viewMatrix = camera.matrixWorldInverse;\n\n\t\t\tfor (let i = 0, l = lights.length; i < l; i++) {\n\t\t\t\tconst light = lights[i];\n\n\t\t\t\tif (light.isDirectionalLight) {\n\t\t\t\t\tconst uniforms = state.directional[directionalLength];\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tvector3.setFromMatrixPosition(light.target.matrixWorld);\n\t\t\t\t\tuniforms.direction.sub(vector3);\n\t\t\t\t\tuniforms.direction.transformDirection(viewMatrix);\n\t\t\t\t\tdirectionalLength++;\n\t\t\t\t} else if (light.isSpotLight) {\n\t\t\t\t\tconst uniforms = state.spot[spotLength];\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.position.applyMatrix4(viewMatrix);\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tvector3.setFromMatrixPosition(light.target.matrixWorld);\n\t\t\t\t\tuniforms.direction.sub(vector3);\n\t\t\t\t\tuniforms.direction.transformDirection(viewMatrix);\n\t\t\t\t\tspotLength++;\n\t\t\t\t} else if (light.isRectAreaLight) {\n\t\t\t\t\tconst uniforms = state.rectArea[rectAreaLength];\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.position.applyMatrix4(viewMatrix); // extract local rotation of light to derive width/height half vectors\n\n\t\t\t\t\tmatrix42.identity();\n\t\t\t\t\tmatrix4.copy(light.matrixWorld);\n\t\t\t\t\tmatrix4.premultiply(viewMatrix);\n\t\t\t\t\tmatrix42.extractRotation(matrix4);\n\t\t\t\t\tuniforms.halfWidth.set(light.width * 0.5, 0.0, 0.0);\n\t\t\t\t\tuniforms.halfHeight.set(0.0, light.height * 0.5, 0.0);\n\t\t\t\t\tuniforms.halfWidth.applyMatrix4(matrix42);\n\t\t\t\t\tuniforms.halfHeight.applyMatrix4(matrix42);\n\t\t\t\t\trectAreaLength++;\n\t\t\t\t} else if (light.isPointLight) {\n\t\t\t\t\tconst uniforms = state.point[pointLength];\n\t\t\t\t\tuniforms.position.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.position.applyMatrix4(viewMatrix);\n\t\t\t\t\tpointLength++;\n\t\t\t\t} else if (light.isHemisphereLight) {\n\t\t\t\t\tconst uniforms = state.hemi[hemiLength];\n\t\t\t\t\tuniforms.direction.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\t\tuniforms.direction.transformDirection(viewMatrix);\n\t\t\t\t\tuniforms.direction.normalize();\n\t\t\t\t\themiLength++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tsetup: setup,\n\t\t\tsetupView: setupView,\n\t\t\tstate: state\n\t\t};\n\t}\n\n\tfunction WebGLRenderState(extensions, capabilities) {\n\t\tconst lights = new WebGLLights(extensions, capabilities);\n\t\tconst lightsArray = [];\n\t\tconst shadowsArray = [];\n\n\t\tfunction init() {\n\t\t\tlightsArray.length = 0;\n\t\t\tshadowsArray.length = 0;\n\t\t}\n\n\t\tfunction pushLight(light) {\n\t\t\tlightsArray.push(light);\n\t\t}\n\n\t\tfunction pushShadow(shadowLight) {\n\t\t\tshadowsArray.push(shadowLight);\n\t\t}\n\n\t\tfunction setupLights(physicallyCorrectLights) {\n\t\t\tlights.setup(lightsArray, physicallyCorrectLights);\n\t\t}\n\n\t\tfunction setupLightsView(camera) {\n\t\t\tlights.setupView(lightsArray, camera);\n\t\t}\n\n\t\tconst state = {\n\t\t\tlightsArray: lightsArray,\n\t\t\tshadowsArray: shadowsArray,\n\t\t\tlights: lights\n\t\t};\n\t\treturn {\n\t\t\tinit: init,\n\t\t\tstate: state,\n\t\t\tsetupLights: setupLights,\n\t\t\tsetupLightsView: setupLightsView,\n\t\t\tpushLight: pushLight,\n\t\t\tpushShadow: pushShadow\n\t\t};\n\t}\n\n\tfunction WebGLRenderStates(extensions, capabilities) {\n\t\tlet renderStates = new WeakMap();\n\n\t\tfunction get(scene, renderCallDepth = 0) {\n\t\t\tlet renderState;\n\n\t\t\tif (renderStates.has(scene) === false) {\n\t\t\t\trenderState = new WebGLRenderState(extensions, capabilities);\n\t\t\t\trenderStates.set(scene, [renderState]);\n\t\t\t} else {\n\t\t\t\tif (renderCallDepth >= renderStates.get(scene).length) {\n\t\t\t\t\trenderState = new WebGLRenderState(extensions, capabilities);\n\t\t\t\t\trenderStates.get(scene).push(renderState);\n\t\t\t\t} else {\n\t\t\t\t\trenderState = renderStates.get(scene)[renderCallDepth];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn renderState;\n\t\t}\n\n\t\tfunction dispose() {\n\t\t\trenderStates = new WeakMap();\n\t\t}\n\n\t\treturn {\n\t\t\tget: get,\n\t\t\tdispose: dispose\n\t\t};\n\t}\n\n\t/**\n\t * parameters = {\n\t *\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>\n\t * }\n\t */\n\n\tclass MeshDepthMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshDepthMaterial';\n\t\t\tthis.depthPacking = BasicDepthPacking;\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.fog = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.depthPacking = source.depthPacking;\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshDepthMaterial.prototype.isMeshDepthMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\n\t *\treferencePosition: <float>,\n\t *\tnearDistance: <float>,\n\t *\tfarDistance: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>\n\t *\n\t * }\n\t */\n\n\tclass MeshDistanceMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshDistanceMaterial';\n\t\t\tthis.referencePosition = new Vector3();\n\t\t\tthis.nearDistance = 1;\n\t\t\tthis.farDistance = 1000;\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.fog = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.referencePosition.copy(source.referencePosition);\n\t\t\tthis.nearDistance = source.nearDistance;\n\t\t\tthis.farDistance = source.farDistance;\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshDistanceMaterial.prototype.isMeshDistanceMaterial = true;\n\n\tconst vertex = \"void main() {\\n\\tgl_Position = vec4( position, 1.0 );\\n}\";\n\tconst fragment = \"uniform sampler2D shadow_pass;\\nuniform vec2 resolution;\\nuniform float radius;\\nuniform float samples;\\n#include <packing>\\nvoid main() {\\n\\tfloat mean = 0.0;\\n\\tfloat squared_mean = 0.0;\\n\\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\\n\\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\\n\\tfor ( float i = 0.0; i < samples; i ++ ) {\\n\\t\\tfloat uvOffset = uvStart + i * uvStride;\\n\\t\\t#ifdef HORIZONTAL_PASS\\n\\t\\t\\tvec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );\\n\\t\\t\\tmean += distribution.x;\\n\\t\\t\\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\\n\\t\\t#else\\n\\t\\t\\tfloat depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );\\n\\t\\t\\tmean += depth;\\n\\t\\t\\tsquared_mean += depth * depth;\\n\\t\\t#endif\\n\\t}\\n\\tmean = mean / samples;\\n\\tsquared_mean = squared_mean / samples;\\n\\tfloat std_dev = sqrt( squared_mean - mean * mean );\\n\\tgl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );\\n}\";\n\n\tfunction WebGLShadowMap(_renderer, _objects, _capabilities) {\n\t\tlet _frustum = new Frustum();\n\n\t\tconst _shadowMapSize = new Vector2(),\n\t\t\t\t\t_viewportSize = new Vector2(),\n\t\t\t\t\t_viewport = new Vector4(),\n\t\t\t\t\t_depthMaterial = new MeshDepthMaterial({\n\t\t\tdepthPacking: RGBADepthPacking\n\t\t}),\n\t\t\t\t\t_distanceMaterial = new MeshDistanceMaterial(),\n\t\t\t\t\t_materialCache = {},\n\t\t\t\t\t_maxTextureSize = _capabilities.maxTextureSize;\n\n\t\tconst shadowSide = {\n\t\t\t0: BackSide,\n\t\t\t1: FrontSide,\n\t\t\t2: DoubleSide\n\t\t};\n\t\tconst shadowMaterialVertical = new ShaderMaterial({\n\t\t\tuniforms: {\n\t\t\t\tshadow_pass: {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\tresolution: {\n\t\t\t\t\tvalue: new Vector2()\n\t\t\t\t},\n\t\t\t\tradius: {\n\t\t\t\t\tvalue: 4.0\n\t\t\t\t},\n\t\t\t\tsamples: {\n\t\t\t\t\tvalue: 8.0\n\t\t\t\t}\n\t\t\t},\n\t\t\tvertexShader: vertex,\n\t\t\tfragmentShader: fragment\n\t\t});\n\t\tconst shadowMaterialHorizontal = shadowMaterialVertical.clone();\n\t\tshadowMaterialHorizontal.defines.HORIZONTAL_PASS = 1;\n\t\tconst fullScreenTri = new BufferGeometry();\n\t\tfullScreenTri.setAttribute('position', new BufferAttribute(new Float32Array([-1, -1, 0.5, 3, -1, 0.5, -1, 3, 0.5]), 3));\n\t\tconst fullScreenMesh = new Mesh(fullScreenTri, shadowMaterialVertical);\n\t\tconst scope = this;\n\t\tthis.enabled = false;\n\t\tthis.autoUpdate = true;\n\t\tthis.needsUpdate = false;\n\t\tthis.type = PCFShadowMap;\n\n\t\tthis.render = function (lights, scene, camera) {\n\t\t\tif (scope.enabled === false) return;\n\t\t\tif (scope.autoUpdate === false && scope.needsUpdate === false) return;\n\t\t\tif (lights.length === 0) return;\n\n\t\t\tconst currentRenderTarget = _renderer.getRenderTarget();\n\n\t\t\tconst activeCubeFace = _renderer.getActiveCubeFace();\n\n\t\t\tconst activeMipmapLevel = _renderer.getActiveMipmapLevel();\n\n\t\t\tconst _state = _renderer.state; // Set GL state for depth map.\n\n\t\t\t_state.setBlending(NoBlending);\n\n\t\t\t_state.buffers.color.setClear(1, 1, 1, 1);\n\n\t\t\t_state.buffers.depth.setTest(true);\n\n\t\t\t_state.setScissorTest(false); // render depth map\n\n\n\t\t\tfor (let i = 0, il = lights.length; i < il; i++) {\n\t\t\t\tconst light = lights[i];\n\t\t\t\tconst shadow = light.shadow;\n\n\t\t\t\tif (shadow === undefined) {\n\t\t\t\t\tconsole.warn('THREE.WebGLShadowMap:', light, 'has no shadow.');\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (shadow.autoUpdate === false && shadow.needsUpdate === false) continue;\n\n\t\t\t\t_shadowMapSize.copy(shadow.mapSize);\n\n\t\t\t\tconst shadowFrameExtents = shadow.getFrameExtents();\n\n\t\t\t\t_shadowMapSize.multiply(shadowFrameExtents);\n\n\t\t\t\t_viewportSize.copy(shadow.mapSize);\n\n\t\t\t\tif (_shadowMapSize.x > _maxTextureSize || _shadowMapSize.y > _maxTextureSize) {\n\t\t\t\t\tif (_shadowMapSize.x > _maxTextureSize) {\n\t\t\t\t\t\t_viewportSize.x = Math.floor(_maxTextureSize / shadowFrameExtents.x);\n\t\t\t\t\t\t_shadowMapSize.x = _viewportSize.x * shadowFrameExtents.x;\n\t\t\t\t\t\tshadow.mapSize.x = _viewportSize.x;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_shadowMapSize.y > _maxTextureSize) {\n\t\t\t\t\t\t_viewportSize.y = Math.floor(_maxTextureSize / shadowFrameExtents.y);\n\t\t\t\t\t\t_shadowMapSize.y = _viewportSize.y * shadowFrameExtents.y;\n\t\t\t\t\t\tshadow.mapSize.y = _viewportSize.y;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (shadow.map === null && !shadow.isPointLightShadow && this.type === VSMShadowMap) {\n\t\t\t\t\tconst pars = {\n\t\t\t\t\t\tminFilter: LinearFilter,\n\t\t\t\t\t\tmagFilter: LinearFilter,\n\t\t\t\t\t\tformat: RGBAFormat\n\t\t\t\t\t};\n\t\t\t\t\tshadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);\n\t\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\t\t\t\t\tshadow.mapPass = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);\n\t\t\t\t\tshadow.camera.updateProjectionMatrix();\n\t\t\t\t}\n\n\t\t\t\tif (shadow.map === null) {\n\t\t\t\t\tconst pars = {\n\t\t\t\t\t\tminFilter: NearestFilter,\n\t\t\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\t\t\tformat: RGBAFormat\n\t\t\t\t\t};\n\t\t\t\t\tshadow.map = new WebGLRenderTarget(_shadowMapSize.x, _shadowMapSize.y, pars);\n\t\t\t\t\tshadow.map.texture.name = light.name + '.shadowMap';\n\t\t\t\t\tshadow.camera.updateProjectionMatrix();\n\t\t\t\t}\n\n\t\t\t\t_renderer.setRenderTarget(shadow.map);\n\n\t\t\t\t_renderer.clear();\n\n\t\t\t\tconst viewportCount = shadow.getViewportCount();\n\n\t\t\t\tfor (let vp = 0; vp < viewportCount; vp++) {\n\t\t\t\t\tconst viewport = shadow.getViewport(vp);\n\n\t\t\t\t\t_viewport.set(_viewportSize.x * viewport.x, _viewportSize.y * viewport.y, _viewportSize.x * viewport.z, _viewportSize.y * viewport.w);\n\n\t\t\t\t\t_state.viewport(_viewport);\n\n\t\t\t\t\tshadow.updateMatrices(light, vp);\n\t\t\t\t\t_frustum = shadow.getFrustum();\n\t\t\t\t\trenderObject(scene, camera, shadow.camera, light, this.type);\n\t\t\t\t} // do blur pass for VSM\n\n\n\t\t\t\tif (!shadow.isPointLightShadow && this.type === VSMShadowMap) {\n\t\t\t\t\tVSMPass(shadow, camera);\n\t\t\t\t}\n\n\t\t\t\tshadow.needsUpdate = false;\n\t\t\t}\n\n\t\t\tscope.needsUpdate = false;\n\n\t\t\t_renderer.setRenderTarget(currentRenderTarget, activeCubeFace, activeMipmapLevel);\n\t\t};\n\n\t\tfunction VSMPass(shadow, camera) {\n\t\t\tconst geometry = _objects.update(fullScreenMesh); // vertical pass\n\n\n\t\t\tshadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;\n\t\t\tshadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;\n\t\t\tshadowMaterialVertical.uniforms.radius.value = shadow.radius;\n\t\t\tshadowMaterialVertical.uniforms.samples.value = shadow.blurSamples;\n\n\t\t\t_renderer.setRenderTarget(shadow.mapPass);\n\n\t\t\t_renderer.clear();\n\n\t\t\t_renderer.renderBufferDirect(camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null); // horizontal pass\n\n\n\t\t\tshadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;\n\t\t\tshadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;\n\t\t\tshadowMaterialHorizontal.uniforms.radius.value = shadow.radius;\n\t\t\tshadowMaterialHorizontal.uniforms.samples.value = shadow.blurSamples;\n\n\t\t\t_renderer.setRenderTarget(shadow.map);\n\n\t\t\t_renderer.clear();\n\n\t\t\t_renderer.renderBufferDirect(camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null);\n\t\t}\n\n\t\tfunction getDepthMaterial(object, geometry, material, light, shadowCameraNear, shadowCameraFar, type) {\n\t\t\tlet result = null;\n\t\t\tconst customMaterial = light.isPointLight === true ? object.customDistanceMaterial : object.customDepthMaterial;\n\n\t\t\tif (customMaterial !== undefined) {\n\t\t\t\tresult = customMaterial;\n\t\t\t} else {\n\t\t\t\tresult = light.isPointLight === true ? _distanceMaterial : _depthMaterial;\n\t\t\t}\n\n\t\t\tif (_renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 || material.displacementMap && material.displacementScale !== 0 || material.alphaMap && material.alphaTest > 0) {\n\t\t\t\t// in this case we need a unique material instance reflecting the\n\t\t\t\t// appropriate state\n\t\t\t\tconst keyA = result.uuid,\n\t\t\t\t\t\t\tkeyB = material.uuid;\n\t\t\t\tlet materialsForVariant = _materialCache[keyA];\n\n\t\t\t\tif (materialsForVariant === undefined) {\n\t\t\t\t\tmaterialsForVariant = {};\n\t\t\t\t\t_materialCache[keyA] = materialsForVariant;\n\t\t\t\t}\n\n\t\t\t\tlet cachedMaterial = materialsForVariant[keyB];\n\n\t\t\t\tif (cachedMaterial === undefined) {\n\t\t\t\t\tcachedMaterial = result.clone();\n\t\t\t\t\tmaterialsForVariant[keyB] = cachedMaterial;\n\t\t\t\t}\n\n\t\t\t\tresult = cachedMaterial;\n\t\t\t}\n\n\t\t\tresult.visible = material.visible;\n\t\t\tresult.wireframe = material.wireframe;\n\n\t\t\tif (type === VSMShadowMap) {\n\t\t\t\tresult.side = material.shadowSide !== null ? material.shadowSide : material.side;\n\t\t\t} else {\n\t\t\t\tresult.side = material.shadowSide !== null ? material.shadowSide : shadowSide[material.side];\n\t\t\t}\n\n\t\t\tresult.alphaMap = material.alphaMap;\n\t\t\tresult.alphaTest = material.alphaTest;\n\t\t\tresult.clipShadows = material.clipShadows;\n\t\t\tresult.clippingPlanes = material.clippingPlanes;\n\t\t\tresult.clipIntersection = material.clipIntersection;\n\t\t\tresult.displacementMap = material.displacementMap;\n\t\t\tresult.displacementScale = material.displacementScale;\n\t\t\tresult.displacementBias = material.displacementBias;\n\t\t\tresult.wireframeLinewidth = material.wireframeLinewidth;\n\t\t\tresult.linewidth = material.linewidth;\n\n\t\t\tif (light.isPointLight === true && result.isMeshDistanceMaterial === true) {\n\t\t\t\tresult.referencePosition.setFromMatrixPosition(light.matrixWorld);\n\t\t\t\tresult.nearDistance = shadowCameraNear;\n\t\t\t\tresult.farDistance = shadowCameraFar;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t\tfunction renderObject(object, camera, shadowCamera, light, type) {\n\t\t\tif (object.visible === false) return;\n\t\t\tconst visible = object.layers.test(camera.layers);\n\n\t\t\tif (visible && (object.isMesh || object.isLine || object.isPoints)) {\n\t\t\t\tif ((object.castShadow || object.receiveShadow && type === VSMShadowMap) && (!object.frustumCulled || _frustum.intersectsObject(object))) {\n\t\t\t\t\tobject.modelViewMatrix.multiplyMatrices(shadowCamera.matrixWorldInverse, object.matrixWorld);\n\n\t\t\t\t\tconst geometry = _objects.update(object);\n\n\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\tfor (let k = 0, kl = groups.length; k < kl; k++) {\n\t\t\t\t\t\t\tconst group = groups[k];\n\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\n\t\t\t\t\t\t\tif (groupMaterial && groupMaterial.visible) {\n\t\t\t\t\t\t\t\tconst depthMaterial = getDepthMaterial(object, geometry, groupMaterial, light, shadowCamera.near, shadowCamera.far, type);\n\n\t\t\t\t\t\t\t\t_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, group);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (material.visible) {\n\t\t\t\t\t\tconst depthMaterial = getDepthMaterial(object, geometry, material, light, shadowCamera.near, shadowCamera.far, type);\n\n\t\t\t\t\t\t_renderer.renderBufferDirect(shadowCamera, null, geometry, depthMaterial, object, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\trenderObject(children[i], camera, shadowCamera, light, type);\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction WebGLState(gl, extensions, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\n\t\tfunction ColorBuffer() {\n\t\t\tlet locked = false;\n\t\t\tconst color = new Vector4();\n\t\t\tlet currentColorMask = null;\n\t\t\tconst currentColorClear = new Vector4(0, 0, 0, 0);\n\t\t\treturn {\n\t\t\t\tsetMask: function (colorMask) {\n\t\t\t\t\tif (currentColorMask !== colorMask && !locked) {\n\t\t\t\t\t\tgl.colorMask(colorMask, colorMask, colorMask, colorMask);\n\t\t\t\t\t\tcurrentColorMask = colorMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetLocked: function (lock) {\n\t\t\t\t\tlocked = lock;\n\t\t\t\t},\n\t\t\t\tsetClear: function (r, g, b, a, premultipliedAlpha) {\n\t\t\t\t\tif (premultipliedAlpha === true) {\n\t\t\t\t\t\tr *= a;\n\t\t\t\t\t\tg *= a;\n\t\t\t\t\t\tb *= a;\n\t\t\t\t\t}\n\n\t\t\t\t\tcolor.set(r, g, b, a);\n\n\t\t\t\t\tif (currentColorClear.equals(color) === false) {\n\t\t\t\t\t\tgl.clearColor(r, g, b, a);\n\t\t\t\t\t\tcurrentColorClear.copy(color);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treset: function () {\n\t\t\t\t\tlocked = false;\n\t\t\t\t\tcurrentColorMask = null;\n\t\t\t\t\tcurrentColorClear.set(-1, 0, 0, 0); // set to invalid state\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tfunction DepthBuffer() {\n\t\t\tlet locked = false;\n\t\t\tlet currentDepthMask = null;\n\t\t\tlet currentDepthFunc = null;\n\t\t\tlet currentDepthClear = null;\n\t\t\treturn {\n\t\t\t\tsetTest: function (depthTest) {\n\t\t\t\t\tif (depthTest) {\n\t\t\t\t\t\tenable(gl.DEPTH_TEST);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdisable(gl.DEPTH_TEST);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetMask: function (depthMask) {\n\t\t\t\t\tif (currentDepthMask !== depthMask && !locked) {\n\t\t\t\t\t\tgl.depthMask(depthMask);\n\t\t\t\t\t\tcurrentDepthMask = depthMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetFunc: function (depthFunc) {\n\t\t\t\t\tif (currentDepthFunc !== depthFunc) {\n\t\t\t\t\t\tif (depthFunc) {\n\t\t\t\t\t\t\tswitch (depthFunc) {\n\t\t\t\t\t\t\t\tcase NeverDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.NEVER);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase AlwaysDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.ALWAYS);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase LessDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.LESS);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase LessEqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.LEQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase EqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.EQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase GreaterEqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.GEQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase GreaterDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.GREATER);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase NotEqualDepth:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.NOTEQUAL);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tgl.depthFunc(gl.LEQUAL);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tgl.depthFunc(gl.LEQUAL);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcurrentDepthFunc = depthFunc;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetLocked: function (lock) {\n\t\t\t\t\tlocked = lock;\n\t\t\t\t},\n\t\t\t\tsetClear: function (depth) {\n\t\t\t\t\tif (currentDepthClear !== depth) {\n\t\t\t\t\t\tgl.clearDepth(depth);\n\t\t\t\t\t\tcurrentDepthClear = depth;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treset: function () {\n\t\t\t\t\tlocked = false;\n\t\t\t\t\tcurrentDepthMask = null;\n\t\t\t\t\tcurrentDepthFunc = null;\n\t\t\t\t\tcurrentDepthClear = null;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\n\t\tfunction StencilBuffer() {\n\t\t\tlet locked = false;\n\t\t\tlet currentStencilMask = null;\n\t\t\tlet currentStencilFunc = null;\n\t\t\tlet currentStencilRef = null;\n\t\t\tlet currentStencilFuncMask = null;\n\t\t\tlet currentStencilFail = null;\n\t\t\tlet currentStencilZFail = null;\n\t\t\tlet currentStencilZPass = null;\n\t\t\tlet currentStencilClear = null;\n\t\t\treturn {\n\t\t\t\tsetTest: function (stencilTest) {\n\t\t\t\t\tif (!locked) {\n\t\t\t\t\t\tif (stencilTest) {\n\t\t\t\t\t\t\tenable(gl.STENCIL_TEST);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tdisable(gl.STENCIL_TEST);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetMask: function (stencilMask) {\n\t\t\t\t\tif (currentStencilMask !== stencilMask && !locked) {\n\t\t\t\t\t\tgl.stencilMask(stencilMask);\n\t\t\t\t\t\tcurrentStencilMask = stencilMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetFunc: function (stencilFunc, stencilRef, stencilMask) {\n\t\t\t\t\tif (currentStencilFunc !== stencilFunc || currentStencilRef !== stencilRef || currentStencilFuncMask !== stencilMask) {\n\t\t\t\t\t\tgl.stencilFunc(stencilFunc, stencilRef, stencilMask);\n\t\t\t\t\t\tcurrentStencilFunc = stencilFunc;\n\t\t\t\t\t\tcurrentStencilRef = stencilRef;\n\t\t\t\t\t\tcurrentStencilFuncMask = stencilMask;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetOp: function (stencilFail, stencilZFail, stencilZPass) {\n\t\t\t\t\tif (currentStencilFail !== stencilFail || currentStencilZFail !== stencilZFail || currentStencilZPass !== stencilZPass) {\n\t\t\t\t\t\tgl.stencilOp(stencilFail, stencilZFail, stencilZPass);\n\t\t\t\t\t\tcurrentStencilFail = stencilFail;\n\t\t\t\t\t\tcurrentStencilZFail = stencilZFail;\n\t\t\t\t\t\tcurrentStencilZPass = stencilZPass;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tsetLocked: function (lock) {\n\t\t\t\t\tlocked = lock;\n\t\t\t\t},\n\t\t\t\tsetClear: function (stencil) {\n\t\t\t\t\tif (currentStencilClear !== stencil) {\n\t\t\t\t\t\tgl.clearStencil(stencil);\n\t\t\t\t\t\tcurrentStencilClear = stencil;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\treset: function () {\n\t\t\t\t\tlocked = false;\n\t\t\t\t\tcurrentStencilMask = null;\n\t\t\t\t\tcurrentStencilFunc = null;\n\t\t\t\t\tcurrentStencilRef = null;\n\t\t\t\t\tcurrentStencilFuncMask = null;\n\t\t\t\t\tcurrentStencilFail = null;\n\t\t\t\t\tcurrentStencilZFail = null;\n\t\t\t\t\tcurrentStencilZPass = null;\n\t\t\t\t\tcurrentStencilClear = null;\n\t\t\t\t}\n\t\t\t};\n\t\t} //\n\n\n\t\tconst colorBuffer = new ColorBuffer();\n\t\tconst depthBuffer = new DepthBuffer();\n\t\tconst stencilBuffer = new StencilBuffer();\n\t\tlet enabledCapabilities = {};\n\t\tlet xrFramebuffer = null;\n\t\tlet currentBoundFramebuffers = {};\n\t\tlet currentProgram = null;\n\t\tlet currentBlendingEnabled = false;\n\t\tlet currentBlending = null;\n\t\tlet currentBlendEquation = null;\n\t\tlet currentBlendSrc = null;\n\t\tlet currentBlendDst = null;\n\t\tlet currentBlendEquationAlpha = null;\n\t\tlet currentBlendSrcAlpha = null;\n\t\tlet currentBlendDstAlpha = null;\n\t\tlet currentPremultipledAlpha = false;\n\t\tlet currentFlipSided = null;\n\t\tlet currentCullFace = null;\n\t\tlet currentLineWidth = null;\n\t\tlet currentPolygonOffsetFactor = null;\n\t\tlet currentPolygonOffsetUnits = null;\n\t\tconst maxTextures = gl.getParameter(gl.MAX_COMBINED_TEXTURE_IMAGE_UNITS);\n\t\tlet lineWidthAvailable = false;\n\t\tlet version = 0;\n\t\tconst glVersion = gl.getParameter(gl.VERSION);\n\n\t\tif (glVersion.indexOf('WebGL') !== -1) {\n\t\t\tversion = parseFloat(/^WebGL (\\d)/.exec(glVersion)[1]);\n\t\t\tlineWidthAvailable = version >= 1.0;\n\t\t} else if (glVersion.indexOf('OpenGL ES') !== -1) {\n\t\t\tversion = parseFloat(/^OpenGL ES (\\d)/.exec(glVersion)[1]);\n\t\t\tlineWidthAvailable = version >= 2.0;\n\t\t}\n\n\t\tlet currentTextureSlot = null;\n\t\tlet currentBoundTextures = {};\n\t\tconst scissorParam = gl.getParameter(gl.SCISSOR_BOX);\n\t\tconst viewportParam = gl.getParameter(gl.VIEWPORT);\n\t\tconst currentScissor = new Vector4().fromArray(scissorParam);\n\t\tconst currentViewport = new Vector4().fromArray(viewportParam);\n\n\t\tfunction createTexture(type, target, count) {\n\t\t\tconst data = new Uint8Array(4); // 4 is required to match default unpack alignment of 4.\n\n\t\t\tconst texture = gl.createTexture();\n\t\t\tgl.bindTexture(type, texture);\n\t\t\tgl.texParameteri(type, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\t\t\tgl.texParameteri(type, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n\n\t\t\tfor (let i = 0; i < count; i++) {\n\t\t\t\tgl.texImage2D(target + i, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t\tconst emptyTextures = {};\n\t\temptyTextures[gl.TEXTURE_2D] = createTexture(gl.TEXTURE_2D, gl.TEXTURE_2D, 1);\n\t\temptyTextures[gl.TEXTURE_CUBE_MAP] = createTexture(gl.TEXTURE_CUBE_MAP, gl.TEXTURE_CUBE_MAP_POSITIVE_X, 6); // init\n\n\t\tcolorBuffer.setClear(0, 0, 0, 1);\n\t\tdepthBuffer.setClear(1);\n\t\tstencilBuffer.setClear(0);\n\t\tenable(gl.DEPTH_TEST);\n\t\tdepthBuffer.setFunc(LessEqualDepth);\n\t\tsetFlipSided(false);\n\t\tsetCullFace(CullFaceBack);\n\t\tenable(gl.CULL_FACE);\n\t\tsetBlending(NoBlending); //\n\n\t\tfunction enable(id) {\n\t\t\tif (enabledCapabilities[id] !== true) {\n\t\t\t\tgl.enable(id);\n\t\t\t\tenabledCapabilities[id] = true;\n\t\t\t}\n\t\t}\n\n\t\tfunction disable(id) {\n\t\t\tif (enabledCapabilities[id] !== false) {\n\t\t\t\tgl.disable(id);\n\t\t\t\tenabledCapabilities[id] = false;\n\t\t\t}\n\t\t}\n\n\t\tfunction bindXRFramebuffer(framebuffer) {\n\t\t\tif (framebuffer !== xrFramebuffer) {\n\t\t\t\tgl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);\n\t\t\t\txrFramebuffer = framebuffer;\n\t\t\t}\n\t\t}\n\n\t\tfunction bindFramebuffer(target, framebuffer) {\n\t\t\tif (framebuffer === null && xrFramebuffer !== null) framebuffer = xrFramebuffer; // use active XR framebuffer if available\n\n\t\t\tif (currentBoundFramebuffers[target] !== framebuffer) {\n\t\t\t\tgl.bindFramebuffer(target, framebuffer);\n\t\t\t\tcurrentBoundFramebuffers[target] = framebuffer;\n\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t// gl.DRAW_FRAMEBUFFER is equivalent to gl.FRAMEBUFFER\n\t\t\t\t\tif (target === gl.DRAW_FRAMEBUFFER) {\n\t\t\t\t\t\tcurrentBoundFramebuffers[gl.FRAMEBUFFER] = framebuffer;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (target === gl.FRAMEBUFFER) {\n\t\t\t\t\t\tcurrentBoundFramebuffers[gl.DRAW_FRAMEBUFFER] = framebuffer;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tfunction useProgram(program) {\n\t\t\tif (currentProgram !== program) {\n\t\t\t\tgl.useProgram(program);\n\t\t\t\tcurrentProgram = program;\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\n\t\tconst equationToGL = {\n\t\t\t[AddEquation]: gl.FUNC_ADD,\n\t\t\t[SubtractEquation]: gl.FUNC_SUBTRACT,\n\t\t\t[ReverseSubtractEquation]: gl.FUNC_REVERSE_SUBTRACT\n\t\t};\n\n\t\tif (isWebGL2) {\n\t\t\tequationToGL[MinEquation] = gl.MIN;\n\t\t\tequationToGL[MaxEquation] = gl.MAX;\n\t\t} else {\n\t\t\tconst extension = extensions.get('EXT_blend_minmax');\n\n\t\t\tif (extension !== null) {\n\t\t\t\tequationToGL[MinEquation] = extension.MIN_EXT;\n\t\t\t\tequationToGL[MaxEquation] = extension.MAX_EXT;\n\t\t\t}\n\t\t}\n\n\t\tconst factorToGL = {\n\t\t\t[ZeroFactor]: gl.ZERO,\n\t\t\t[OneFactor]: gl.ONE,\n\t\t\t[SrcColorFactor]: gl.SRC_COLOR,\n\t\t\t[SrcAlphaFactor]: gl.SRC_ALPHA,\n\t\t\t[SrcAlphaSaturateFactor]: gl.SRC_ALPHA_SATURATE,\n\t\t\t[DstColorFactor]: gl.DST_COLOR,\n\t\t\t[DstAlphaFactor]: gl.DST_ALPHA,\n\t\t\t[OneMinusSrcColorFactor]: gl.ONE_MINUS_SRC_COLOR,\n\t\t\t[OneMinusSrcAlphaFactor]: gl.ONE_MINUS_SRC_ALPHA,\n\t\t\t[OneMinusDstColorFactor]: gl.ONE_MINUS_DST_COLOR,\n\t\t\t[OneMinusDstAlphaFactor]: gl.ONE_MINUS_DST_ALPHA\n\t\t};\n\n\t\tfunction setBlending(blending, blendEquation, blendSrc, blendDst, blendEquationAlpha, blendSrcAlpha, blendDstAlpha, premultipliedAlpha) {\n\t\t\tif (blending === NoBlending) {\n\t\t\t\tif (currentBlendingEnabled === true) {\n\t\t\t\t\tdisable(gl.BLEND);\n\t\t\t\t\tcurrentBlendingEnabled = false;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (currentBlendingEnabled === false) {\n\t\t\t\tenable(gl.BLEND);\n\t\t\t\tcurrentBlendingEnabled = true;\n\t\t\t}\n\n\t\t\tif (blending !== CustomBlending) {\n\t\t\t\tif (blending !== currentBlending || premultipliedAlpha !== currentPremultipledAlpha) {\n\t\t\t\t\tif (currentBlendEquation !== AddEquation || currentBlendEquationAlpha !== AddEquation) {\n\t\t\t\t\t\tgl.blendEquation(gl.FUNC_ADD);\n\t\t\t\t\t\tcurrentBlendEquation = AddEquation;\n\t\t\t\t\t\tcurrentBlendEquationAlpha = AddEquation;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (premultipliedAlpha) {\n\t\t\t\t\t\tswitch (blending) {\n\t\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.ONE, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.ONE, gl.ONE);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.ZERO, gl.ZERO, gl.ONE_MINUS_SRC_COLOR, gl.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.ZERO, gl.SRC_COLOR, gl.ZERO, gl.SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.error('THREE.WebGLState: Invalid blending: ', blending);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tswitch (blending) {\n\t\t\t\t\t\t\tcase NormalBlending:\n\t\t\t\t\t\t\t\tgl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase AdditiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase SubtractiveBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.ZERO, gl.ONE_MINUS_SRC_COLOR);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase MultiplyBlending:\n\t\t\t\t\t\t\t\tgl.blendFunc(gl.ZERO, gl.SRC_COLOR);\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.error('THREE.WebGLState: Invalid blending: ', blending);\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentBlendSrc = null;\n\t\t\t\t\tcurrentBlendDst = null;\n\t\t\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\t\t\tcurrentBlendDstAlpha = null;\n\t\t\t\t\tcurrentBlending = blending;\n\t\t\t\t\tcurrentPremultipledAlpha = premultipliedAlpha;\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t} // custom blending\n\n\n\t\t\tblendEquationAlpha = blendEquationAlpha || blendEquation;\n\t\t\tblendSrcAlpha = blendSrcAlpha || blendSrc;\n\t\t\tblendDstAlpha = blendDstAlpha || blendDst;\n\n\t\t\tif (blendEquation !== currentBlendEquation || blendEquationAlpha !== currentBlendEquationAlpha) {\n\t\t\t\tgl.blendEquationSeparate(equationToGL[blendEquation], equationToGL[blendEquationAlpha]);\n\t\t\t\tcurrentBlendEquation = blendEquation;\n\t\t\t\tcurrentBlendEquationAlpha = blendEquationAlpha;\n\t\t\t}\n\n\t\t\tif (blendSrc !== currentBlendSrc || blendDst !== currentBlendDst || blendSrcAlpha !== currentBlendSrcAlpha || blendDstAlpha !== currentBlendDstAlpha) {\n\t\t\t\tgl.blendFuncSeparate(factorToGL[blendSrc], factorToGL[blendDst], factorToGL[blendSrcAlpha], factorToGL[blendDstAlpha]);\n\t\t\t\tcurrentBlendSrc = blendSrc;\n\t\t\t\tcurrentBlendDst = blendDst;\n\t\t\t\tcurrentBlendSrcAlpha = blendSrcAlpha;\n\t\t\t\tcurrentBlendDstAlpha = blendDstAlpha;\n\t\t\t}\n\n\t\t\tcurrentBlending = blending;\n\t\t\tcurrentPremultipledAlpha = null;\n\t\t}\n\n\t\tfunction setMaterial(material, frontFaceCW) {\n\t\t\tmaterial.side === DoubleSide ? disable(gl.CULL_FACE) : enable(gl.CULL_FACE);\n\t\t\tlet flipSided = material.side === BackSide;\n\t\t\tif (frontFaceCW) flipSided = !flipSided;\n\t\t\tsetFlipSided(flipSided);\n\t\t\tmaterial.blending === NormalBlending && material.transparent === false ? setBlending(NoBlending) : setBlending(material.blending, material.blendEquation, material.blendSrc, material.blendDst, material.blendEquationAlpha, material.blendSrcAlpha, material.blendDstAlpha, material.premultipliedAlpha);\n\t\t\tdepthBuffer.setFunc(material.depthFunc);\n\t\t\tdepthBuffer.setTest(material.depthTest);\n\t\t\tdepthBuffer.setMask(material.depthWrite);\n\t\t\tcolorBuffer.setMask(material.colorWrite);\n\t\t\tconst stencilWrite = material.stencilWrite;\n\t\t\tstencilBuffer.setTest(stencilWrite);\n\n\t\t\tif (stencilWrite) {\n\t\t\t\tstencilBuffer.setMask(material.stencilWriteMask);\n\t\t\t\tstencilBuffer.setFunc(material.stencilFunc, material.stencilRef, material.stencilFuncMask);\n\t\t\t\tstencilBuffer.setOp(material.stencilFail, material.stencilZFail, material.stencilZPass);\n\t\t\t}\n\n\t\t\tsetPolygonOffset(material.polygonOffset, material.polygonOffsetFactor, material.polygonOffsetUnits);\n\t\t\tmaterial.alphaToCoverage === true ? enable(gl.SAMPLE_ALPHA_TO_COVERAGE) : disable(gl.SAMPLE_ALPHA_TO_COVERAGE);\n\t\t} //\n\n\n\t\tfunction setFlipSided(flipSided) {\n\t\t\tif (currentFlipSided !== flipSided) {\n\t\t\t\tif (flipSided) {\n\t\t\t\t\tgl.frontFace(gl.CW);\n\t\t\t\t} else {\n\t\t\t\t\tgl.frontFace(gl.CCW);\n\t\t\t\t}\n\n\t\t\t\tcurrentFlipSided = flipSided;\n\t\t\t}\n\t\t}\n\n\t\tfunction setCullFace(cullFace) {\n\t\t\tif (cullFace !== CullFaceNone) {\n\t\t\t\tenable(gl.CULL_FACE);\n\n\t\t\t\tif (cullFace !== currentCullFace) {\n\t\t\t\t\tif (cullFace === CullFaceBack) {\n\t\t\t\t\t\tgl.cullFace(gl.BACK);\n\t\t\t\t\t} else if (cullFace === CullFaceFront) {\n\t\t\t\t\t\tgl.cullFace(gl.FRONT);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgl.cullFace(gl.FRONT_AND_BACK);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdisable(gl.CULL_FACE);\n\t\t\t}\n\n\t\t\tcurrentCullFace = cullFace;\n\t\t}\n\n\t\tfunction setLineWidth(width) {\n\t\t\tif (width !== currentLineWidth) {\n\t\t\t\tif (lineWidthAvailable) gl.lineWidth(width);\n\t\t\t\tcurrentLineWidth = width;\n\t\t\t}\n\t\t}\n\n\t\tfunction setPolygonOffset(polygonOffset, factor, units) {\n\t\t\tif (polygonOffset) {\n\t\t\t\tenable(gl.POLYGON_OFFSET_FILL);\n\n\t\t\t\tif (currentPolygonOffsetFactor !== factor || currentPolygonOffsetUnits !== units) {\n\t\t\t\t\tgl.polygonOffset(factor, units);\n\t\t\t\t\tcurrentPolygonOffsetFactor = factor;\n\t\t\t\t\tcurrentPolygonOffsetUnits = units;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tdisable(gl.POLYGON_OFFSET_FILL);\n\t\t\t}\n\t\t}\n\n\t\tfunction setScissorTest(scissorTest) {\n\t\t\tif (scissorTest) {\n\t\t\t\tenable(gl.SCISSOR_TEST);\n\t\t\t} else {\n\t\t\t\tdisable(gl.SCISSOR_TEST);\n\t\t\t}\n\t\t} // texture\n\n\n\t\tfunction activeTexture(webglSlot) {\n\t\t\tif (webglSlot === undefined) webglSlot = gl.TEXTURE0 + maxTextures - 1;\n\n\t\t\tif (currentTextureSlot !== webglSlot) {\n\t\t\t\tgl.activeTexture(webglSlot);\n\t\t\t\tcurrentTextureSlot = webglSlot;\n\t\t\t}\n\t\t}\n\n\t\tfunction bindTexture(webglType, webglTexture) {\n\t\t\tif (currentTextureSlot === null) {\n\t\t\t\tactiveTexture();\n\t\t\t}\n\n\t\t\tlet boundTexture = currentBoundTextures[currentTextureSlot];\n\n\t\t\tif (boundTexture === undefined) {\n\t\t\t\tboundTexture = {\n\t\t\t\t\ttype: undefined,\n\t\t\t\t\ttexture: undefined\n\t\t\t\t};\n\t\t\t\tcurrentBoundTextures[currentTextureSlot] = boundTexture;\n\t\t\t}\n\n\t\t\tif (boundTexture.type !== webglType || boundTexture.texture !== webglTexture) {\n\t\t\t\tgl.bindTexture(webglType, webglTexture || emptyTextures[webglType]);\n\t\t\t\tboundTexture.type = webglType;\n\t\t\t\tboundTexture.texture = webglTexture;\n\t\t\t}\n\t\t}\n\n\t\tfunction unbindTexture() {\n\t\t\tconst boundTexture = currentBoundTextures[currentTextureSlot];\n\n\t\t\tif (boundTexture !== undefined && boundTexture.type !== undefined) {\n\t\t\t\tgl.bindTexture(boundTexture.type, null);\n\t\t\t\tboundTexture.type = undefined;\n\t\t\t\tboundTexture.texture = undefined;\n\t\t\t}\n\t\t}\n\n\t\tfunction compressedTexImage2D() {\n\t\t\ttry {\n\t\t\t\tgl.compressedTexImage2D.apply(gl, arguments);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('THREE.WebGLState:', error);\n\t\t\t}\n\t\t}\n\n\t\tfunction texImage2D() {\n\t\t\ttry {\n\t\t\t\tgl.texImage2D.apply(gl, arguments);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('THREE.WebGLState:', error);\n\t\t\t}\n\t\t}\n\n\t\tfunction texImage3D() {\n\t\t\ttry {\n\t\t\t\tgl.texImage3D.apply(gl, arguments);\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error('THREE.WebGLState:', error);\n\t\t\t}\n\t\t} //\n\n\n\t\tfunction scissor(scissor) {\n\t\t\tif (currentScissor.equals(scissor) === false) {\n\t\t\t\tgl.scissor(scissor.x, scissor.y, scissor.z, scissor.w);\n\t\t\t\tcurrentScissor.copy(scissor);\n\t\t\t}\n\t\t}\n\n\t\tfunction viewport(viewport) {\n\t\t\tif (currentViewport.equals(viewport) === false) {\n\t\t\t\tgl.viewport(viewport.x, viewport.y, viewport.z, viewport.w);\n\t\t\t\tcurrentViewport.copy(viewport);\n\t\t\t}\n\t\t} //\n\n\n\t\tfunction reset() {\n\t\t\t// reset state\n\t\t\tgl.disable(gl.BLEND);\n\t\t\tgl.disable(gl.CULL_FACE);\n\t\t\tgl.disable(gl.DEPTH_TEST);\n\t\t\tgl.disable(gl.POLYGON_OFFSET_FILL);\n\t\t\tgl.disable(gl.SCISSOR_TEST);\n\t\t\tgl.disable(gl.STENCIL_TEST);\n\t\t\tgl.disable(gl.SAMPLE_ALPHA_TO_COVERAGE);\n\t\t\tgl.blendEquation(gl.FUNC_ADD);\n\t\t\tgl.blendFunc(gl.ONE, gl.ZERO);\n\t\t\tgl.blendFuncSeparate(gl.ONE, gl.ZERO, gl.ONE, gl.ZERO);\n\t\t\tgl.colorMask(true, true, true, true);\n\t\t\tgl.clearColor(0, 0, 0, 0);\n\t\t\tgl.depthMask(true);\n\t\t\tgl.depthFunc(gl.LESS);\n\t\t\tgl.clearDepth(1);\n\t\t\tgl.stencilMask(0xffffffff);\n\t\t\tgl.stencilFunc(gl.ALWAYS, 0, 0xffffffff);\n\t\t\tgl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n\t\t\tgl.clearStencil(0);\n\t\t\tgl.cullFace(gl.BACK);\n\t\t\tgl.frontFace(gl.CCW);\n\t\t\tgl.polygonOffset(0, 0);\n\t\t\tgl.activeTexture(gl.TEXTURE0);\n\t\t\tgl.bindFramebuffer(gl.FRAMEBUFFER, null);\n\n\t\t\tif (isWebGL2 === true) {\n\t\t\t\tgl.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n\t\t\t\tgl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n\t\t\t}\n\n\t\t\tgl.useProgram(null);\n\t\t\tgl.lineWidth(1);\n\t\t\tgl.scissor(0, 0, gl.canvas.width, gl.canvas.height);\n\t\t\tgl.viewport(0, 0, gl.canvas.width, gl.canvas.height); // reset internals\n\n\t\t\tenabledCapabilities = {};\n\t\t\tcurrentTextureSlot = null;\n\t\t\tcurrentBoundTextures = {};\n\t\t\txrFramebuffer = null;\n\t\t\tcurrentBoundFramebuffers = {};\n\t\t\tcurrentProgram = null;\n\t\t\tcurrentBlendingEnabled = false;\n\t\t\tcurrentBlending = null;\n\t\t\tcurrentBlendEquation = null;\n\t\t\tcurrentBlendSrc = null;\n\t\t\tcurrentBlendDst = null;\n\t\t\tcurrentBlendEquationAlpha = null;\n\t\t\tcurrentBlendSrcAlpha = null;\n\t\t\tcurrentBlendDstAlpha = null;\n\t\t\tcurrentPremultipledAlpha = false;\n\t\t\tcurrentFlipSided = null;\n\t\t\tcurrentCullFace = null;\n\t\t\tcurrentLineWidth = null;\n\t\t\tcurrentPolygonOffsetFactor = null;\n\t\t\tcurrentPolygonOffsetUnits = null;\n\t\t\tcurrentScissor.set(0, 0, gl.canvas.width, gl.canvas.height);\n\t\t\tcurrentViewport.set(0, 0, gl.canvas.width, gl.canvas.height);\n\t\t\tcolorBuffer.reset();\n\t\t\tdepthBuffer.reset();\n\t\t\tstencilBuffer.reset();\n\t\t}\n\n\t\treturn {\n\t\t\tbuffers: {\n\t\t\t\tcolor: colorBuffer,\n\t\t\t\tdepth: depthBuffer,\n\t\t\t\tstencil: stencilBuffer\n\t\t\t},\n\t\t\tenable: enable,\n\t\t\tdisable: disable,\n\t\t\tbindFramebuffer: bindFramebuffer,\n\t\t\tbindXRFramebuffer: bindXRFramebuffer,\n\t\t\tuseProgram: useProgram,\n\t\t\tsetBlending: setBlending,\n\t\t\tsetMaterial: setMaterial,\n\t\t\tsetFlipSided: setFlipSided,\n\t\t\tsetCullFace: setCullFace,\n\t\t\tsetLineWidth: setLineWidth,\n\t\t\tsetPolygonOffset: setPolygonOffset,\n\t\t\tsetScissorTest: setScissorTest,\n\t\t\tactiveTexture: activeTexture,\n\t\t\tbindTexture: bindTexture,\n\t\t\tunbindTexture: unbindTexture,\n\t\t\tcompressedTexImage2D: compressedTexImage2D,\n\t\t\ttexImage2D: texImage2D,\n\t\t\ttexImage3D: texImage3D,\n\t\t\tscissor: scissor,\n\t\t\tviewport: viewport,\n\t\t\treset: reset\n\t\t};\n\t}\n\n\tfunction WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\t\tconst maxTextures = capabilities.maxTextures;\n\t\tconst maxCubemapSize = capabilities.maxCubemapSize;\n\t\tconst maxTextureSize = capabilities.maxTextureSize;\n\t\tconst maxSamples = capabilities.maxSamples;\n\n\t\tconst _videoTextures = new WeakMap();\n\n\t\tlet _canvas; // cordova iOS (as of 5.0) still uses UIWebView, which provides OffscreenCanvas,\n\t\t// also OffscreenCanvas.getContext(\"webgl\"), but not OffscreenCanvas.getContext(\"2d\")!\n\t\t// Some implementations may only implement OffscreenCanvas partially (e.g. lacking 2d).\n\n\n\t\tlet useOffscreenCanvas = false;\n\n\t\ttry {\n\t\t\tuseOffscreenCanvas = typeof OffscreenCanvas !== 'undefined' && new OffscreenCanvas(1, 1).getContext('2d') !== null;\n\t\t} catch (err) {// Ignore any errors\n\t\t}\n\n\t\tfunction createCanvas(width, height) {\n\t\t\t// Use OffscreenCanvas when available. Specially needed in web workers\n\t\t\treturn useOffscreenCanvas ? new OffscreenCanvas(width, height) : createElementNS('canvas');\n\t\t}\n\n\t\tfunction resizeImage(image, needsPowerOfTwo, needsNewCanvas, maxSize) {\n\t\t\tlet scale = 1; // handle case if texture exceeds max size\n\n\t\t\tif (image.width > maxSize || image.height > maxSize) {\n\t\t\t\tscale = maxSize / Math.max(image.width, image.height);\n\t\t\t} // only perform resize if necessary\n\n\n\t\t\tif (scale < 1 || needsPowerOfTwo === true) {\n\t\t\t\t// only perform resize for certain image types\n\t\t\t\tif (typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement || typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement || typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap) {\n\t\t\t\t\tconst floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;\n\t\t\t\t\tconst width = floor(scale * image.width);\n\t\t\t\t\tconst height = floor(scale * image.height);\n\t\t\t\t\tif (_canvas === undefined) _canvas = createCanvas(width, height); // cube textures can't reuse the same canvas\n\n\t\t\t\t\tconst canvas = needsNewCanvas ? createCanvas(width, height) : _canvas;\n\t\t\t\t\tcanvas.width = width;\n\t\t\t\t\tcanvas.height = height;\n\t\t\t\t\tconst context = canvas.getContext('2d');\n\t\t\t\t\tcontext.drawImage(image, 0, 0, width, height);\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').');\n\t\t\t\t\treturn canvas;\n\t\t\t\t} else {\n\t\t\t\t\tif ('data' in image) {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn image;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn image;\n\t\t}\n\n\t\tfunction isPowerOfTwo$1(image) {\n\t\t\treturn isPowerOfTwo(image.width) && isPowerOfTwo(image.height);\n\t\t}\n\n\t\tfunction textureNeedsPowerOfTwo(texture) {\n\t\t\tif (isWebGL2) return false;\n\t\t\treturn texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping || texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\t\t}\n\n\t\tfunction textureNeedsGenerateMipmaps(texture, supportsMips) {\n\t\t\treturn texture.generateMipmaps && supportsMips && texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;\n\t\t}\n\n\t\tfunction generateMipmap(target, texture, width, height, depth = 1) {\n\t\t\t_gl.generateMipmap(target);\n\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\ttextureProperties.__maxMipLevel = Math.log2(Math.max(width, height, depth));\n\t\t}\n\n\t\tfunction getInternalFormat(internalFormatName, glFormat, glType, encoding) {\n\t\t\tif (isWebGL2 === false) return glFormat;\n\n\t\t\tif (internalFormatName !== null) {\n\t\t\t\tif (_gl[internalFormatName] !== undefined) return _gl[internalFormatName];\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \\'' + internalFormatName + '\\'');\n\t\t\t}\n\n\t\t\tlet internalFormat = glFormat;\n\n\t\t\tif (glFormat === _gl.RED) {\n\t\t\t\tif (glType === _gl.FLOAT) internalFormat = _gl.R32F;\n\t\t\t\tif (glType === _gl.HALF_FLOAT) internalFormat = _gl.R16F;\n\t\t\t\tif (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.R8;\n\t\t\t}\n\n\t\t\tif (glFormat === _gl.RGB) {\n\t\t\t\tif (glType === _gl.FLOAT) internalFormat = _gl.RGB32F;\n\t\t\t\tif (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGB16F;\n\t\t\t\tif (glType === _gl.UNSIGNED_BYTE) internalFormat = _gl.RGB8;\n\t\t\t}\n\n\t\t\tif (glFormat === _gl.RGBA) {\n\t\t\t\tif (glType === _gl.FLOAT) internalFormat = _gl.RGBA32F;\n\t\t\t\tif (glType === _gl.HALF_FLOAT) internalFormat = _gl.RGBA16F;\n\t\t\t\tif (glType === _gl.UNSIGNED_BYTE) internalFormat = encoding === sRGBEncoding ? _gl.SRGB8_ALPHA8 : _gl.RGBA8;\n\t\t\t}\n\n\t\t\tif (internalFormat === _gl.R16F || internalFormat === _gl.R32F || internalFormat === _gl.RGBA16F || internalFormat === _gl.RGBA32F) {\n\t\t\t\textensions.get('EXT_color_buffer_float');\n\t\t\t}\n\n\t\t\treturn internalFormat;\n\t\t} // Fallback filters for non-power-of-2 textures\n\n\n\t\tfunction filterFallback(f) {\n\t\t\tif (f === NearestFilter || f === NearestMipmapNearestFilter || f === NearestMipmapLinearFilter) {\n\t\t\t\treturn _gl.NEAREST;\n\t\t\t}\n\n\t\t\treturn _gl.LINEAR;\n\t\t} //\n\n\n\t\tfunction onTextureDispose(event) {\n\t\t\tconst texture = event.target;\n\t\t\ttexture.removeEventListener('dispose', onTextureDispose);\n\t\t\tdeallocateTexture(texture);\n\n\t\t\tif (texture.isVideoTexture) {\n\t\t\t\t_videoTextures.delete(texture);\n\t\t\t}\n\n\t\t\tinfo.memory.textures--;\n\t\t}\n\n\t\tfunction onRenderTargetDispose(event) {\n\t\t\tconst renderTarget = event.target;\n\t\t\trenderTarget.removeEventListener('dispose', onRenderTargetDispose);\n\t\t\tdeallocateRenderTarget(renderTarget);\n\t\t} //\n\n\n\t\tfunction deallocateTexture(texture) {\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\tif (textureProperties.__webglInit === undefined) return;\n\n\t\t\t_gl.deleteTexture(textureProperties.__webglTexture);\n\n\t\t\tproperties.remove(texture);\n\t\t}\n\n\t\tfunction deallocateRenderTarget(renderTarget) {\n\t\t\tconst texture = renderTarget.texture;\n\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\tif (!renderTarget) return;\n\n\t\t\tif (textureProperties.__webglTexture !== undefined) {\n\t\t\t\t_gl.deleteTexture(textureProperties.__webglTexture);\n\n\t\t\t\tinfo.memory.textures--;\n\t\t\t}\n\n\t\t\tif (renderTarget.depthTexture) {\n\t\t\t\trenderTarget.depthTexture.dispose();\n\t\t\t}\n\n\t\t\tif (renderTarget.isWebGLCubeRenderTarget) {\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\t_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer[i]);\n\n\t\t\t\t\tif (renderTargetProperties.__webglDepthbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer[i]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t_gl.deleteFramebuffer(renderTargetProperties.__webglFramebuffer);\n\n\t\t\t\tif (renderTargetProperties.__webglDepthbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthbuffer);\n\t\t\t\tif (renderTargetProperties.__webglMultisampledFramebuffer) _gl.deleteFramebuffer(renderTargetProperties.__webglMultisampledFramebuffer);\n\t\t\t\tif (renderTargetProperties.__webglColorRenderbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglColorRenderbuffer);\n\t\t\t\tif (renderTargetProperties.__webglDepthRenderbuffer) _gl.deleteRenderbuffer(renderTargetProperties.__webglDepthRenderbuffer);\n\t\t\t}\n\n\t\t\tif (renderTarget.isWebGLMultipleRenderTargets) {\n\t\t\t\tfor (let i = 0, il = texture.length; i < il; i++) {\n\t\t\t\t\tconst attachmentProperties = properties.get(texture[i]);\n\n\t\t\t\t\tif (attachmentProperties.__webglTexture) {\n\t\t\t\t\t\t_gl.deleteTexture(attachmentProperties.__webglTexture);\n\n\t\t\t\t\t\tinfo.memory.textures--;\n\t\t\t\t\t}\n\n\t\t\t\t\tproperties.remove(texture[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tproperties.remove(texture);\n\t\t\tproperties.remove(renderTarget);\n\t\t} //\n\n\n\t\tlet textureUnits = 0;\n\n\t\tfunction resetTextureUnits() {\n\t\t\ttextureUnits = 0;\n\t\t}\n\n\t\tfunction allocateTextureUnit() {\n\t\t\tconst textureUnit = textureUnits;\n\n\t\t\tif (textureUnit >= maxTextures) {\n\t\t\t\tconsole.warn('THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + maxTextures);\n\t\t\t}\n\n\t\t\ttextureUnits += 1;\n\t\t\treturn textureUnit;\n\t\t} //\n\n\n\t\tfunction setTexture2D(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\tif (texture.isVideoTexture) updateVideoTexture(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tconst image = texture.image;\n\n\t\t\t\tif (image === undefined) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined');\n\t\t\t\t} else if (image.complete === false) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete');\n\t\t\t\t} else {\n\t\t\t\t\tuploadTexture(textureProperties, texture, slot);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_2D, textureProperties.__webglTexture);\n\t\t}\n\n\t\tfunction setTexture2DArray(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tuploadTexture(textureProperties, texture, slot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture);\n\t\t}\n\n\t\tfunction setTexture3D(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tuploadTexture(textureProperties, texture, slot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_3D, textureProperties.__webglTexture);\n\t\t}\n\n\t\tfunction setTextureCube(texture, slot) {\n\t\t\tconst textureProperties = properties.get(texture);\n\n\t\t\tif (texture.version > 0 && textureProperties.__version !== texture.version) {\n\t\t\t\tuploadCubeTexture(textureProperties, texture, slot);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture);\n\t\t}\n\n\t\tconst wrappingToGL = {\n\t\t\t[RepeatWrapping]: _gl.REPEAT,\n\t\t\t[ClampToEdgeWrapping]: _gl.CLAMP_TO_EDGE,\n\t\t\t[MirroredRepeatWrapping]: _gl.MIRRORED_REPEAT\n\t\t};\n\t\tconst filterToGL = {\n\t\t\t[NearestFilter]: _gl.NEAREST,\n\t\t\t[NearestMipmapNearestFilter]: _gl.NEAREST_MIPMAP_NEAREST,\n\t\t\t[NearestMipmapLinearFilter]: _gl.NEAREST_MIPMAP_LINEAR,\n\t\t\t[LinearFilter]: _gl.LINEAR,\n\t\t\t[LinearMipmapNearestFilter]: _gl.LINEAR_MIPMAP_NEAREST,\n\t\t\t[LinearMipmapLinearFilter]: _gl.LINEAR_MIPMAP_LINEAR\n\t\t};\n\n\t\tfunction setTextureParameters(textureType, texture, supportsMips) {\n\t\t\tif (supportsMips) {\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[texture.wrapS]);\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_T, wrappingToGL[texture.wrapT]);\n\n\t\t\t\tif (textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY) {\n\t\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_R, wrappingToGL[texture.wrapR]);\n\t\t\t\t}\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MAG_FILTER, filterToGL[texture.magFilter]);\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MIN_FILTER, filterToGL[texture.minFilter]);\n\t\t\t} else {\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_S, _gl.CLAMP_TO_EDGE);\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_T, _gl.CLAMP_TO_EDGE);\n\n\t\t\t\tif (textureType === _gl.TEXTURE_3D || textureType === _gl.TEXTURE_2D_ARRAY) {\n\t\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_WRAP_R, _gl.CLAMP_TO_EDGE);\n\t\t\t\t}\n\n\t\t\t\tif (texture.wrapS !== ClampToEdgeWrapping || texture.wrapT !== ClampToEdgeWrapping) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.');\n\t\t\t\t}\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MAG_FILTER, filterFallback(texture.magFilter));\n\n\t\t\t\t_gl.texParameteri(textureType, _gl.TEXTURE_MIN_FILTER, filterFallback(texture.minFilter));\n\n\t\t\t\tif (texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (extensions.has('EXT_texture_filter_anisotropic') === true) {\n\t\t\t\tconst extension = extensions.get('EXT_texture_filter_anisotropic');\n\t\t\t\tif (texture.type === FloatType && extensions.has('OES_texture_float_linear') === false) return; // verify extension for WebGL 1 and WebGL 2\n\n\t\t\t\tif (isWebGL2 === false && texture.type === HalfFloatType && extensions.has('OES_texture_half_float_linear') === false) return; // verify extension for WebGL 1 only\n\n\t\t\t\tif (texture.anisotropy > 1 || properties.get(texture).__currentAnisotropy) {\n\t\t\t\t\t_gl.texParameterf(textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(texture.anisotropy, capabilities.getMaxAnisotropy()));\n\n\t\t\t\t\tproperties.get(texture).__currentAnisotropy = texture.anisotropy;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction initTexture(textureProperties, texture) {\n\t\t\tif (textureProperties.__webglInit === undefined) {\n\t\t\t\ttextureProperties.__webglInit = true;\n\t\t\t\ttexture.addEventListener('dispose', onTextureDispose);\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\t\t\t\tinfo.memory.textures++;\n\t\t\t}\n\t\t}\n\n\t\tfunction uploadTexture(textureProperties, texture, slot) {\n\t\t\tlet textureType = _gl.TEXTURE_2D;\n\t\t\tif (texture.isDataTexture2DArray) textureType = _gl.TEXTURE_2D_ARRAY;\n\t\t\tif (texture.isDataTexture3D) textureType = _gl.TEXTURE_3D;\n\t\t\tinitTexture(textureProperties, texture);\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(textureType, textureProperties.__webglTexture);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE);\n\n\t\t\tconst needsPowerOfTwo = textureNeedsPowerOfTwo(texture) && isPowerOfTwo$1(texture.image) === false;\n\t\t\tconst image = resizeImage(texture.image, needsPowerOfTwo, false, maxTextureSize);\n\t\t\tconst supportsMips = isPowerOfTwo$1(image) || isWebGL2,\n\t\t\t\t\t\tglFormat = utils.convert(texture.format);\n\t\t\tlet glType = utils.convert(texture.type),\n\t\t\t\t\tglInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\t\t\tsetTextureParameters(textureType, texture, supportsMips);\n\t\t\tlet mipmap;\n\t\t\tconst mipmaps = texture.mipmaps;\n\n\t\t\tif (texture.isDepthTexture) {\n\t\t\t\t// populate depth texture with dummy data\n\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT;\n\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\tif (texture.type === FloatType) {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\t\t\t\t\t} else if (texture.type === UnsignedIntType) {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\t\t\t\t\t} else if (texture.type === UnsignedInt248Type) {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH24_STENCIL8;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT16; // WebGL2 requires sized internalformat for glTexImage2D\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (texture.type === FloatType) {\n\t\t\t\t\t\tconsole.error('WebGLRenderer: Floating point depth texture requires WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t} // validation checks for WebGL 1\n\n\n\t\t\t\tif (texture.format === DepthFormat && glInternalFormat === _gl.DEPTH_COMPONENT) {\n\t\t\t\t\t// The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n\t\t\t\t\t// DEPTH_COMPONENT and type is not UNSIGNED_SHORT or UNSIGNED_INT\n\t\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\t\tif (texture.type !== UnsignedShortType && texture.type !== UnsignedIntType) {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.');\n\t\t\t\t\t\ttexture.type = UnsignedShortType;\n\t\t\t\t\t\tglType = utils.convert(texture.type);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (texture.format === DepthStencilFormat && glInternalFormat === _gl.DEPTH_COMPONENT) {\n\t\t\t\t\t// Depth stencil textures need the DEPTH_STENCIL internal format\n\t\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\t\t\t\t\tglInternalFormat = _gl.DEPTH_STENCIL; // The error INVALID_OPERATION is generated by texImage2D if format and internalformat are\n\t\t\t\t\t// DEPTH_STENCIL and type is not UNSIGNED_INT_24_8_WEBGL.\n\t\t\t\t\t// (https://www.khronos.org/registry/webgl/extensions/WEBGL_depth_texture/)\n\n\t\t\t\t\tif (texture.type !== UnsignedInt248Type) {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.');\n\t\t\t\t\t\ttexture.type = UnsignedInt248Type;\n\t\t\t\t\t\tglType = utils.convert(texture.type);\n\t\t\t\t\t}\n\t\t\t\t} //\n\n\n\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, null);\n\t\t\t} else if (texture.isDataTexture) {\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\t\t\t\tif (mipmaps.length > 0 && supportsMips) {\n\t\t\t\t\tfor (let i = 0, il = mipmaps.length; i < il; i++) {\n\t\t\t\t\t\tmipmap = mipmaps[i];\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\t\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t\t} else {\n\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, image.width, image.height, 0, glFormat, glType, image.data);\n\t\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t\t}\n\t\t\t} else if (texture.isCompressedTexture) {\n\t\t\t\tfor (let i = 0, il = mipmaps.length; i < il; i++) {\n\t\t\t\t\tmipmap = mipmaps[i];\n\n\t\t\t\t\tif (texture.format !== RGBAFormat && texture.format !== RGBFormat) {\n\t\t\t\t\t\tif (glFormat !== null) {\n\t\t\t\t\t\t\tstate.compressedTexImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t} else if (texture.isDataTexture2DArray) {\n\t\t\t\tstate.texImage3D(_gl.TEXTURE_2D_ARRAY, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);\n\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t} else if (texture.isDataTexture3D) {\n\t\t\t\tstate.texImage3D(_gl.TEXTURE_3D, 0, glInternalFormat, image.width, image.height, image.depth, 0, glFormat, glType, image.data);\n\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t} else {\n\t\t\t\t// regular Texture (image, video, canvas)\n\t\t\t\t// use manually created mipmaps if available\n\t\t\t\t// if there are no manual mipmaps\n\t\t\t\t// set 0 level mipmap and then use GL to generate other mipmap levels\n\t\t\t\tif (mipmaps.length > 0 && supportsMips) {\n\t\t\t\t\tfor (let i = 0, il = mipmaps.length; i < il; i++) {\n\t\t\t\t\t\tmipmap = mipmaps[i];\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, i, glInternalFormat, glFormat, glType, mipmap);\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.generateMipmaps = false;\n\t\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t\t} else {\n\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_2D, 0, glInternalFormat, glFormat, glType, image);\n\t\t\t\t\ttextureProperties.__maxMipLevel = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\tgenerateMipmap(textureType, texture, image.width, image.height);\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tif (texture.onUpdate) texture.onUpdate(texture);\n\t\t}\n\n\t\tfunction uploadCubeTexture(textureProperties, texture, slot) {\n\t\t\tif (texture.image.length !== 6) return;\n\t\t\tinitTexture(textureProperties, texture);\n\t\t\tstate.activeTexture(_gl.TEXTURE0 + slot);\n\t\t\tstate.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, texture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, texture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, texture.unpackAlignment);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, _gl.NONE);\n\n\t\t\tconst isCompressed = texture && (texture.isCompressedTexture || texture.image[0].isCompressedTexture);\n\t\t\tconst isDataTexture = texture.image[0] && texture.image[0].isDataTexture;\n\t\t\tconst cubeImage = [];\n\n\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\tif (!isCompressed && !isDataTexture) {\n\t\t\t\t\tcubeImage[i] = resizeImage(texture.image[i], false, true, maxCubemapSize);\n\t\t\t\t} else {\n\t\t\t\t\tcubeImage[i] = isDataTexture ? texture.image[i].image : texture.image[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst image = cubeImage[0],\n\t\t\t\t\t\tsupportsMips = isPowerOfTwo$1(image) || isWebGL2,\n\t\t\t\t\t\tglFormat = utils.convert(texture.format),\n\t\t\t\t\t\tglType = utils.convert(texture.type),\n\t\t\t\t\t\tglInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\t\t\tsetTextureParameters(_gl.TEXTURE_CUBE_MAP, texture, supportsMips);\n\t\t\tlet mipmaps;\n\n\t\t\tif (isCompressed) {\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\tmipmaps = cubeImage[i].mipmaps;\n\n\t\t\t\t\tfor (let j = 0; j < mipmaps.length; j++) {\n\t\t\t\t\t\tconst mipmap = mipmaps[j];\n\n\t\t\t\t\t\tif (texture.format !== RGBAFormat && texture.format !== RGBFormat) {\n\t\t\t\t\t\t\tif (glFormat !== null) {\n\t\t\t\t\t\t\t\tstate.compressedTexImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length - 1;\n\t\t\t} else {\n\t\t\t\tmipmaps = texture.mipmaps;\n\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\tif (isDataTexture) {\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, cubeImage[i].width, cubeImage[i].height, 0, glFormat, glType, cubeImage[i].data);\n\n\t\t\t\t\t\tfor (let j = 0; j < mipmaps.length; j++) {\n\t\t\t\t\t\t\tconst mipmap = mipmaps[j];\n\t\t\t\t\t\t\tconst mipmapImage = mipmap.image[i].image;\n\t\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, mipmapImage.width, mipmapImage.height, 0, glFormat, glType, mipmapImage.data);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glInternalFormat, glFormat, glType, cubeImage[i]);\n\n\t\t\t\t\t\tfor (let j = 0; j < mipmaps.length; j++) {\n\t\t\t\t\t\t\tconst mipmap = mipmaps[j];\n\t\t\t\t\t\t\tstate.texImage2D(_gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, glInternalFormat, glFormat, glType, mipmap.image[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttextureProperties.__maxMipLevel = mipmaps.length;\n\t\t\t}\n\n\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t// We assume images for cube map have the same size.\n\t\t\t\tgenerateMipmap(_gl.TEXTURE_CUBE_MAP, texture, image.width, image.height);\n\t\t\t}\n\n\t\t\ttextureProperties.__version = texture.version;\n\t\t\tif (texture.onUpdate) texture.onUpdate(texture);\n\t\t} // Render targets\n\t\t// Setup storage for target texture and bind it to correct framebuffer\n\n\n\t\tfunction setupFrameBufferTexture(framebuffer, renderTarget, texture, attachment, textureTarget) {\n\t\t\tconst glFormat = utils.convert(texture.format);\n\t\t\tconst glType = utils.convert(texture.type);\n\t\t\tconst glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\n\t\t\tif (textureTarget === _gl.TEXTURE_3D || textureTarget === _gl.TEXTURE_2D_ARRAY) {\n\t\t\t\tstate.texImage3D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, renderTarget.depth, 0, glFormat, glType, null);\n\t\t\t} else {\n\t\t\t\tstate.texImage2D(textureTarget, 0, glInternalFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null);\n\t\t\t}\n\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, attachment, textureTarget, properties.get(texture).__webglTexture, 0);\n\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t\t} // Setup storage for internal depth/stencil buffers and bind to correct framebuffer\n\n\n\t\tfunction setupRenderBufferStorage(renderbuffer, renderTarget, isMultisample) {\n\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, renderbuffer);\n\n\t\t\tif (renderTarget.depthBuffer && !renderTarget.stencilBuffer) {\n\t\t\t\tlet glInternalFormat = _gl.DEPTH_COMPONENT16;\n\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst depthTexture = renderTarget.depthTexture;\n\n\t\t\t\t\tif (depthTexture && depthTexture.isDepthTexture) {\n\t\t\t\t\t\tif (depthTexture.type === FloatType) {\n\t\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT32F;\n\t\t\t\t\t\t} else if (depthTexture.type === UnsignedIntType) {\n\t\t\t\t\t\t\tglInternalFormat = _gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.renderbufferStorage(_gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\n\t\t\t\t_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer);\n\t\t\t} else if (renderTarget.depthBuffer && renderTarget.stencilBuffer) {\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, _gl.DEPTH24_STENCIL8, renderTarget.width, renderTarget.height);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.renderbufferStorage(_gl.RENDERBUFFER, _gl.DEPTH_STENCIL, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\n\t\t\t\t_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.RENDERBUFFER, renderbuffer);\n\t\t\t} else {\n\t\t\t\t// Use the first texture for MRT so far\n\t\t\t\tconst texture = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture[0] : renderTarget.texture;\n\t\t\t\tconst glFormat = utils.convert(texture.format);\n\t\t\t\tconst glType = utils.convert(texture.type);\n\t\t\t\tconst glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.renderbufferStorage(_gl.RENDERBUFFER, glInternalFormat, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, null);\n\t\t} // Setup resources for a Depth Texture for a FBO (needs an extension)\n\n\n\t\tfunction setupDepthTexture(framebuffer, renderTarget) {\n\t\t\tconst isCube = renderTarget && renderTarget.isWebGLCubeRenderTarget;\n\t\t\tif (isCube) throw new Error('Depth Texture with cube render targets is not supported');\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\tif (!(renderTarget.depthTexture && renderTarget.depthTexture.isDepthTexture)) {\n\t\t\t\tthrow new Error('renderTarget.depthTexture must be an instance of THREE.DepthTexture');\n\t\t\t} // upload an empty depth texture with framebuffer size\n\n\n\t\t\tif (!properties.get(renderTarget.depthTexture).__webglTexture || renderTarget.depthTexture.image.width !== renderTarget.width || renderTarget.depthTexture.image.height !== renderTarget.height) {\n\t\t\t\trenderTarget.depthTexture.image.width = renderTarget.width;\n\t\t\t\trenderTarget.depthTexture.image.height = renderTarget.height;\n\t\t\t\trenderTarget.depthTexture.needsUpdate = true;\n\t\t\t}\n\n\t\t\tsetTexture2D(renderTarget.depthTexture, 0);\n\n\t\t\tconst webglDepthTexture = properties.get(renderTarget.depthTexture).__webglTexture;\n\n\t\t\tif (renderTarget.depthTexture.format === DepthFormat) {\n\t\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.DEPTH_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0);\n\t\t\t} else if (renderTarget.depthTexture.format === DepthStencilFormat) {\n\t\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.DEPTH_STENCIL_ATTACHMENT, _gl.TEXTURE_2D, webglDepthTexture, 0);\n\t\t\t} else {\n\t\t\t\tthrow new Error('Unknown depthTexture format');\n\t\t\t}\n\t\t} // Setup GL resources for a non-texture depth buffer\n\n\n\t\tfunction setupDepthRenderbuffer(renderTarget) {\n\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\tconst isCube = renderTarget.isWebGLCubeRenderTarget === true;\n\n\t\t\tif (renderTarget.depthTexture) {\n\t\t\t\tif (isCube) throw new Error('target.depthTexture not supported in Cube render targets');\n\t\t\t\tsetupDepthTexture(renderTargetProperties.__webglFramebuffer, renderTarget);\n\t\t\t} else {\n\t\t\t\tif (isCube) {\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = [];\n\n\t\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer[i]);\n\t\t\t\t\t\trenderTargetProperties.__webglDepthbuffer[i] = _gl.createRenderbuffer();\n\t\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer[i], renderTarget, false);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglFramebuffer);\n\t\t\t\t\trenderTargetProperties.__webglDepthbuffer = _gl.createRenderbuffer();\n\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthbuffer, renderTarget, false);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t\t} // Set up GL resources for the render target\n\n\n\t\tfunction setupRenderTarget(renderTarget) {\n\t\t\tconst texture = renderTarget.texture;\n\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\tconst textureProperties = properties.get(texture);\n\t\t\trenderTarget.addEventListener('dispose', onRenderTargetDispose);\n\n\t\t\tif (renderTarget.isWebGLMultipleRenderTargets !== true) {\n\t\t\t\ttextureProperties.__webglTexture = _gl.createTexture();\n\t\t\t\ttextureProperties.__version = texture.version;\n\t\t\t\tinfo.memory.textures++;\n\t\t\t}\n\n\t\t\tconst isCube = renderTarget.isWebGLCubeRenderTarget === true;\n\t\t\tconst isMultipleRenderTargets = renderTarget.isWebGLMultipleRenderTargets === true;\n\t\t\tconst isMultisample = renderTarget.isWebGLMultisampleRenderTarget === true;\n\t\t\tconst isRenderTarget3D = texture.isDataTexture3D || texture.isDataTexture2DArray;\n\t\t\tconst supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2; // Handles WebGL2 RGBFormat fallback - #18858\n\n\t\t\tif (isWebGL2 && texture.format === RGBFormat && (texture.type === FloatType || texture.type === HalfFloatType)) {\n\t\t\t\ttexture.format = RGBAFormat;\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: Rendering to textures with RGB format is not supported. Using RGBA format instead.');\n\t\t\t} // Setup framebuffer\n\n\n\t\t\tif (isCube) {\n\t\t\t\trenderTargetProperties.__webglFramebuffer = [];\n\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\trenderTargetProperties.__webglFramebuffer[i] = _gl.createFramebuffer();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trenderTargetProperties.__webglFramebuffer = _gl.createFramebuffer();\n\n\t\t\t\tif (isMultipleRenderTargets) {\n\t\t\t\t\tif (capabilities.drawBuffers) {\n\t\t\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\t\t\t\tconst attachmentProperties = properties.get(textures[i]);\n\n\t\t\t\t\t\t\tif (attachmentProperties.__webglTexture === undefined) {\n\t\t\t\t\t\t\t\tattachmentProperties.__webglTexture = _gl.createTexture();\n\t\t\t\t\t\t\t\tinfo.memory.textures++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: WebGLMultipleRenderTargets can only be used with WebGL2 or WEBGL_draw_buffers extension.');\n\t\t\t\t\t}\n\t\t\t\t} else if (isMultisample) {\n\t\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t\trenderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();\n\t\t\t\t\t\trenderTargetProperties.__webglColorRenderbuffer = _gl.createRenderbuffer();\n\n\t\t\t\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer);\n\n\t\t\t\t\t\tconst glFormat = utils.convert(texture.format);\n\t\t\t\t\t\tconst glType = utils.convert(texture.type);\n\t\t\t\t\t\tconst glInternalFormat = getInternalFormat(texture.internalFormat, glFormat, glType, texture.encoding);\n\t\t\t\t\t\tconst samples = getRenderTargetSamples(renderTarget);\n\n\t\t\t\t\t\t_gl.renderbufferStorageMultisample(_gl.RENDERBUFFER, samples, glInternalFormat, renderTarget.width, renderTarget.height);\n\n\t\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer);\n\n\t\t\t\t\t\t_gl.framebufferRenderbuffer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.RENDERBUFFER, renderTargetProperties.__webglColorRenderbuffer);\n\n\t\t\t\t\t\t_gl.bindRenderbuffer(_gl.RENDERBUFFER, null);\n\n\t\t\t\t\t\tif (renderTarget.depthBuffer) {\n\t\t\t\t\t\t\trenderTargetProperties.__webglDepthRenderbuffer = _gl.createRenderbuffer();\n\t\t\t\t\t\t\tsetupRenderBufferStorage(renderTargetProperties.__webglDepthRenderbuffer, renderTarget, true);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // Setup color buffer\n\n\n\t\t\tif (isCube) {\n\t\t\t\tstate.bindTexture(_gl.TEXTURE_CUBE_MAP, textureProperties.__webglTexture);\n\t\t\t\tsetTextureParameters(_gl.TEXTURE_CUBE_MAP, texture, supportsMips);\n\n\t\t\t\tfor (let i = 0; i < 6; i++) {\n\t\t\t\t\tsetupFrameBufferTexture(renderTargetProperties.__webglFramebuffer[i], renderTarget, texture, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i);\n\t\t\t\t}\n\n\t\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t\tgenerateMipmap(_gl.TEXTURE_CUBE_MAP, texture, renderTarget.width, renderTarget.height);\n\t\t\t\t}\n\n\t\t\t\tstate.unbindTexture();\n\t\t\t} else if (isMultipleRenderTargets) {\n\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\t\tconst attachment = textures[i];\n\t\t\t\t\tconst attachmentProperties = properties.get(attachment);\n\t\t\t\t\tstate.bindTexture(_gl.TEXTURE_2D, attachmentProperties.__webglTexture);\n\t\t\t\t\tsetTextureParameters(_gl.TEXTURE_2D, attachment, supportsMips);\n\t\t\t\t\tsetupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, attachment, _gl.COLOR_ATTACHMENT0 + i, _gl.TEXTURE_2D);\n\n\t\t\t\t\tif (textureNeedsGenerateMipmaps(attachment, supportsMips)) {\n\t\t\t\t\t\tgenerateMipmap(_gl.TEXTURE_2D, attachment, renderTarget.width, renderTarget.height);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.unbindTexture();\n\t\t\t} else {\n\t\t\t\tlet glTextureType = _gl.TEXTURE_2D;\n\n\t\t\t\tif (isRenderTarget3D) {\n\t\t\t\t\t// Render targets containing layers, i.e: Texture 3D and 2d arrays\n\t\t\t\t\tif (isWebGL2) {\n\t\t\t\t\t\tconst isTexture3D = texture.isDataTexture3D;\n\t\t\t\t\t\tglTextureType = isTexture3D ? _gl.TEXTURE_3D : _gl.TEXTURE_2D_ARRAY;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn('THREE.DataTexture3D and THREE.DataTexture2DArray only supported with WebGL2.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstate.bindTexture(glTextureType, textureProperties.__webglTexture);\n\t\t\t\tsetTextureParameters(glTextureType, texture, supportsMips);\n\t\t\t\tsetupFrameBufferTexture(renderTargetProperties.__webglFramebuffer, renderTarget, texture, _gl.COLOR_ATTACHMENT0, glTextureType);\n\n\t\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t\tgenerateMipmap(glTextureType, texture, renderTarget.width, renderTarget.height, renderTarget.depth);\n\t\t\t\t}\n\n\t\t\t\tstate.unbindTexture();\n\t\t\t} // Setup depth and stencil buffers\n\n\n\t\t\tif (renderTarget.depthBuffer) {\n\t\t\t\tsetupDepthRenderbuffer(renderTarget);\n\t\t\t}\n\t\t}\n\n\t\tfunction updateRenderTargetMipmap(renderTarget) {\n\t\t\tconst supportsMips = isPowerOfTwo$1(renderTarget) || isWebGL2;\n\t\t\tconst textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [renderTarget.texture];\n\n\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\tconst texture = textures[i];\n\n\t\t\t\tif (textureNeedsGenerateMipmaps(texture, supportsMips)) {\n\t\t\t\t\tconst target = renderTarget.isWebGLCubeRenderTarget ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;\n\n\t\t\t\t\tconst webglTexture = properties.get(texture).__webglTexture;\n\n\t\t\t\t\tstate.bindTexture(target, webglTexture);\n\t\t\t\t\tgenerateMipmap(target, texture, renderTarget.width, renderTarget.height);\n\t\t\t\t\tstate.unbindTexture();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateMultisampleRenderTarget(renderTarget) {\n\t\t\tif (renderTarget.isWebGLMultisampleRenderTarget) {\n\t\t\t\tif (isWebGL2) {\n\t\t\t\t\tconst width = renderTarget.width;\n\t\t\t\t\tconst height = renderTarget.height;\n\t\t\t\t\tlet mask = _gl.COLOR_BUFFER_BIT;\n\t\t\t\t\tif (renderTarget.depthBuffer) mask |= _gl.DEPTH_BUFFER_BIT;\n\t\t\t\t\tif (renderTarget.stencilBuffer) mask |= _gl.STENCIL_BUFFER_BIT;\n\t\t\t\t\tconst renderTargetProperties = properties.get(renderTarget);\n\t\t\t\t\tstate.bindFramebuffer(_gl.READ_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer);\n\t\t\t\t\tstate.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglFramebuffer);\n\n\t\t\t\t\t_gl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, mask, _gl.NEAREST);\n\n\t\t\t\t\tstate.bindFramebuffer(_gl.READ_FRAMEBUFFER, null);\n\t\t\t\t\tstate.bindFramebuffer(_gl.DRAW_FRAMEBUFFER, renderTargetProperties.__webglMultisampledFramebuffer);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer: WebGLMultisampleRenderTarget can only be used with WebGL2.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction getRenderTargetSamples(renderTarget) {\n\t\t\treturn isWebGL2 && renderTarget.isWebGLMultisampleRenderTarget ? Math.min(maxSamples, renderTarget.samples) : 0;\n\t\t}\n\n\t\tfunction updateVideoTexture(texture) {\n\t\t\tconst frame = info.render.frame; // Check the last frame we updated the VideoTexture\n\n\t\t\tif (_videoTextures.get(texture) !== frame) {\n\t\t\t\t_videoTextures.set(texture, frame);\n\n\t\t\t\ttexture.update();\n\t\t\t}\n\t\t} // backwards compatibility\n\n\n\t\tlet warnedTexture2D = false;\n\t\tlet warnedTextureCube = false;\n\n\t\tfunction safeSetTexture2D(texture, slot) {\n\t\t\tif (texture && texture.isWebGLRenderTarget) {\n\t\t\t\tif (warnedTexture2D === false) {\n\t\t\t\t\tconsole.warn('THREE.WebGLTextures.safeSetTexture2D: don\\'t use render targets as textures. Use their .texture property instead.');\n\t\t\t\t\twarnedTexture2D = true;\n\t\t\t\t}\n\n\t\t\t\ttexture = texture.texture;\n\t\t\t}\n\n\t\t\tsetTexture2D(texture, slot);\n\t\t}\n\n\t\tfunction safeSetTextureCube(texture, slot) {\n\t\t\tif (texture && texture.isWebGLCubeRenderTarget) {\n\t\t\t\tif (warnedTextureCube === false) {\n\t\t\t\t\tconsole.warn('THREE.WebGLTextures.safeSetTextureCube: don\\'t use cube render targets as textures. Use their .texture property instead.');\n\t\t\t\t\twarnedTextureCube = true;\n\t\t\t\t}\n\n\t\t\t\ttexture = texture.texture;\n\t\t\t}\n\n\t\t\tsetTextureCube(texture, slot);\n\t\t} //\n\n\n\t\tthis.allocateTextureUnit = allocateTextureUnit;\n\t\tthis.resetTextureUnits = resetTextureUnits;\n\t\tthis.setTexture2D = setTexture2D;\n\t\tthis.setTexture2DArray = setTexture2DArray;\n\t\tthis.setTexture3D = setTexture3D;\n\t\tthis.setTextureCube = setTextureCube;\n\t\tthis.setupRenderTarget = setupRenderTarget;\n\t\tthis.updateRenderTargetMipmap = updateRenderTargetMipmap;\n\t\tthis.updateMultisampleRenderTarget = updateMultisampleRenderTarget;\n\t\tthis.safeSetTexture2D = safeSetTexture2D;\n\t\tthis.safeSetTextureCube = safeSetTextureCube;\n\t}\n\n\tfunction WebGLUtils(gl, extensions, capabilities) {\n\t\tconst isWebGL2 = capabilities.isWebGL2;\n\n\t\tfunction convert(p) {\n\t\t\tlet extension;\n\t\t\tif (p === UnsignedByteType) return gl.UNSIGNED_BYTE;\n\t\t\tif (p === UnsignedShort4444Type) return gl.UNSIGNED_SHORT_4_4_4_4;\n\t\t\tif (p === UnsignedShort5551Type) return gl.UNSIGNED_SHORT_5_5_5_1;\n\t\t\tif (p === UnsignedShort565Type) return gl.UNSIGNED_SHORT_5_6_5;\n\t\t\tif (p === ByteType) return gl.BYTE;\n\t\t\tif (p === ShortType) return gl.SHORT;\n\t\t\tif (p === UnsignedShortType) return gl.UNSIGNED_SHORT;\n\t\t\tif (p === IntType) return gl.INT;\n\t\t\tif (p === UnsignedIntType) return gl.UNSIGNED_INT;\n\t\t\tif (p === FloatType) return gl.FLOAT;\n\n\t\t\tif (p === HalfFloatType) {\n\t\t\t\tif (isWebGL2) return gl.HALF_FLOAT;\n\t\t\t\textension = extensions.get('OES_texture_half_float');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\treturn extension.HALF_FLOAT_OES;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === AlphaFormat) return gl.ALPHA;\n\t\t\tif (p === RGBFormat) return gl.RGB;\n\t\t\tif (p === RGBAFormat) return gl.RGBA;\n\t\t\tif (p === LuminanceFormat) return gl.LUMINANCE;\n\t\t\tif (p === LuminanceAlphaFormat) return gl.LUMINANCE_ALPHA;\n\t\t\tif (p === DepthFormat) return gl.DEPTH_COMPONENT;\n\t\t\tif (p === DepthStencilFormat) return gl.DEPTH_STENCIL;\n\t\t\tif (p === RedFormat) return gl.RED; // WebGL2 formats.\n\n\t\t\tif (p === RedIntegerFormat) return gl.RED_INTEGER;\n\t\t\tif (p === RGFormat) return gl.RG;\n\t\t\tif (p === RGIntegerFormat) return gl.RG_INTEGER;\n\t\t\tif (p === RGBIntegerFormat) return gl.RGB_INTEGER;\n\t\t\tif (p === RGBAIntegerFormat) return gl.RGBA_INTEGER;\n\n\t\t\tif (p === RGB_S3TC_DXT1_Format || p === RGBA_S3TC_DXT1_Format || p === RGBA_S3TC_DXT3_Format || p === RGBA_S3TC_DXT5_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_s3tc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\tif (p === RGB_S3TC_DXT1_Format) return extension.COMPRESSED_RGB_S3TC_DXT1_EXT;\n\t\t\t\t\tif (p === RGBA_S3TC_DXT1_Format) return extension.COMPRESSED_RGBA_S3TC_DXT1_EXT;\n\t\t\t\t\tif (p === RGBA_S3TC_DXT3_Format) return extension.COMPRESSED_RGBA_S3TC_DXT3_EXT;\n\t\t\t\t\tif (p === RGBA_S3TC_DXT5_Format) return extension.COMPRESSED_RGBA_S3TC_DXT5_EXT;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGB_PVRTC_4BPPV1_Format || p === RGB_PVRTC_2BPPV1_Format || p === RGBA_PVRTC_4BPPV1_Format || p === RGBA_PVRTC_2BPPV1_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_pvrtc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\tif (p === RGB_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif (p === RGB_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;\n\t\t\t\t\tif (p === RGBA_PVRTC_4BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;\n\t\t\t\t\tif (p === RGBA_PVRTC_2BPPV1_Format) return extension.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGB_ETC1_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_etc1');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\treturn extension.COMPRESSED_RGB_ETC1_WEBGL;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGB_ETC2_Format || p === RGBA_ETC2_EAC_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_etc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\tif (p === RGB_ETC2_Format) return extension.COMPRESSED_RGB8_ETC2;\n\t\t\t\t\tif (p === RGBA_ETC2_EAC_Format) return extension.COMPRESSED_RGBA8_ETC2_EAC;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGBA_ASTC_4x4_Format || p === RGBA_ASTC_5x4_Format || p === RGBA_ASTC_5x5_Format || p === RGBA_ASTC_6x5_Format || p === RGBA_ASTC_6x6_Format || p === RGBA_ASTC_8x5_Format || p === RGBA_ASTC_8x6_Format || p === RGBA_ASTC_8x8_Format || p === RGBA_ASTC_10x5_Format || p === RGBA_ASTC_10x6_Format || p === RGBA_ASTC_10x8_Format || p === RGBA_ASTC_10x10_Format || p === RGBA_ASTC_12x10_Format || p === RGBA_ASTC_12x12_Format || p === SRGB8_ALPHA8_ASTC_4x4_Format || p === SRGB8_ALPHA8_ASTC_5x4_Format || p === SRGB8_ALPHA8_ASTC_5x5_Format || p === SRGB8_ALPHA8_ASTC_6x5_Format || p === SRGB8_ALPHA8_ASTC_6x6_Format || p === SRGB8_ALPHA8_ASTC_8x5_Format || p === SRGB8_ALPHA8_ASTC_8x6_Format || p === SRGB8_ALPHA8_ASTC_8x8_Format || p === SRGB8_ALPHA8_ASTC_10x5_Format || p === SRGB8_ALPHA8_ASTC_10x6_Format || p === SRGB8_ALPHA8_ASTC_10x8_Format || p === SRGB8_ALPHA8_ASTC_10x10_Format || p === SRGB8_ALPHA8_ASTC_12x10_Format || p === SRGB8_ALPHA8_ASTC_12x12_Format) {\n\t\t\t\textension = extensions.get('WEBGL_compressed_texture_astc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\t// TODO Complete?\n\t\t\t\t\treturn p;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === RGBA_BPTC_Format) {\n\t\t\t\textension = extensions.get('EXT_texture_compression_bptc');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\t// TODO Complete?\n\t\t\t\t\treturn p;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (p === UnsignedInt248Type) {\n\t\t\t\tif (isWebGL2) return gl.UNSIGNED_INT_24_8;\n\t\t\t\textension = extensions.get('WEBGL_depth_texture');\n\n\t\t\t\tif (extension !== null) {\n\t\t\t\t\treturn extension.UNSIGNED_INT_24_8_WEBGL;\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tconvert: convert\n\t\t};\n\t}\n\n\tclass Group extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Group';\n\t\t}\n\n\t}\n\n\tGroup.prototype.isGroup = true;\n\n\tclass ArrayCamera extends PerspectiveCamera {\n\t\tconstructor(array = []) {\n\t\t\tsuper();\n\t\t\tthis.cameras = array;\n\t\t}\n\n\t}\n\n\tArrayCamera.prototype.isArrayCamera = true;\n\n\t/**\n\t * @author jsantell / https://www.jsantell.com/\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\tvar cameraLPos = new Vector3();\n\tvar cameraRPos = new Vector3();\n\t/**\n\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t * the cameras' projection and world matrices have already been set.\n\t * And that near and far planes are identical for both cameras.\n\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t */\n\n\tfunction setProjectionFromUnion(camera, cameraL, cameraR) {\n\t\tcameraLPos.setFromMatrixPosition(cameraL.matrixWorld);\n\t\tcameraRPos.setFromMatrixPosition(cameraR.matrixWorld);\n\t\tvar ipd = cameraLPos.distanceTo(cameraRPos);\n\t\tvar projL = cameraL.projectionMatrix.elements;\n\t\tvar projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and\n\t\t// most likely identical top and bottom frustum extents.\n\t\t// Use the left camera for these values.\n\n\t\tvar near = projL[14] / (projL[10] - 1);\n\t\tvar far = projL[14] / (projL[10] + 1);\n\t\tvar topFov = (projL[9] + 1) / projL[5];\n\t\tvar bottomFov = (projL[9] - 1) / projL[5];\n\t\tvar leftFov = (projL[8] - 1) / projL[0];\n\t\tvar rightFov = (projR[8] + 1) / projR[0];\n\t\tvar left = near * leftFov;\n\t\tvar right = near * rightFov; // Calculate the new camera's position offset from the\n\t\t// left camera. xOffset should be roughly half `ipd`.\n\n\t\tvar zOffset = ipd / (-leftFov + rightFov);\n\t\tvar xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?\n\n\t\tcameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);\n\t\tcamera.translateX(xOffset);\n\t\tcamera.translateZ(zOffset);\n\t\tcamera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);\n\t\tcamera.matrixWorldInverse.getInverse(camera.matrixWorld); // Find the union of the frustum values of the cameras and scale\n\t\t// the values so that the near plane's position does not change in world space,\n\t\t// although must now be relative to the new union camera.\n\n\t\tvar near2 = near + zOffset;\n\t\tvar far2 = far + zOffset;\n\t\tvar left2 = left - xOffset;\n\t\tvar right2 = right + (ipd - xOffset);\n\t\tvar top2 = topFov * far / far2 * near2;\n\t\tvar bottom2 = bottomFov * far / far2 * near2;\n\t\tcamera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);\n\t}\n\n\t/**\n\t * @author mrdoob / http://mrdoob.com/\n\t */\n\n\tfunction WebVRManager(renderer) {\n\t\tvar renderWidth, renderHeight;\n\t\tvar scope = this;\n\t\tvar device = null;\n\t\tvar frameData = null;\n\t\tvar poseTarget = null;\n\t\tvar controllers = [];\n\t\tvar standingMatrix = new Matrix4();\n\t\tvar standingMatrixInverse = new Matrix4();\n\t\tvar framebufferScaleFactor = 1.0;\n\t\tvar referenceSpaceType = 'local-floor';\n\n\t\tif (typeof window !== 'undefined' && 'VRFrameData' in window) {\n\t\t\tframeData = new window.VRFrameData();\n\t\t\twindow.addEventListener('vrdisplaypresentchange', onVRDisplayPresentChange, false);\n\t\t}\n\n\t\tvar matrixWorldInverse = new Matrix4();\n\t\tvar tempQuaternion = new Quaternion();\n\t\tvar tempPosition = new Vector3();\n\t\tvar cameraL = new PerspectiveCamera();\n\t\tcameraL.viewport = new Vector4();\n\t\tcameraL.layers.enable(1);\n\t\tvar cameraR = new PerspectiveCamera();\n\t\tcameraR.viewport = new Vector4();\n\t\tcameraR.layers.enable(2);\n\t\tvar cameraVR = new ArrayCamera([cameraL, cameraR]);\n\t\tcameraVR.layers.enable(1);\n\t\tcameraVR.layers.enable(2);\n\t\tvar currentSize = new Vector2(),\n\t\t\t\tcurrentPixelRatio;\n\n\t\tfunction onVRDisplayPresentChange() {\n\t\t\tvar isPresenting = scope.isPresenting = device !== null && device.isPresenting === true;\n\n\t\t\tif (isPresenting) {\n\t\t\t\tvar eyeParameters = device.getEyeParameters('left');\n\t\t\t\trenderWidth = 2 * eyeParameters.renderWidth * framebufferScaleFactor;\n\t\t\t\trenderHeight = eyeParameters.renderHeight * framebufferScaleFactor;\n\t\t\t\tcurrentPixelRatio = renderer.getPixelRatio();\n\t\t\t\trenderer.getSize(currentSize);\n\t\t\t\trenderer.setDrawingBufferSize(renderWidth, renderHeight, 1);\n\t\t\t\tcameraL.viewport.set(0, 0, renderWidth / 2, renderHeight);\n\t\t\t\tcameraR.viewport.set(renderWidth / 2, 0, renderWidth / 2, renderHeight);\n\t\t\t\tanimation.start();\n\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\ttype: 'sessionstart'\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (scope.enabled) {\n\t\t\t\t\trenderer.setDrawingBufferSize(currentSize.width, currentSize.height, currentPixelRatio);\n\t\t\t\t}\n\n\t\t\t\tanimation.stop();\n\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\ttype: 'sessionend'\n\t\t\t\t});\n\t\t\t}\n\t\t} //\n\n\n\t\tvar triggers = [];\n\t\tvar grips = [];\n\n\t\tfunction findGamepad(id) {\n\t\t\tvar gamepads = navigator.getGamepads && navigator.getGamepads();\n\n\t\t\tfor (var i = 0, l = gamepads.length; i < l; i++) {\n\t\t\t\tvar gamepad = gamepads[i];\n\n\t\t\t\tif (gamepad && (gamepad.id === 'Daydream Controller' || gamepad.id === 'Gear VR Controller' || gamepad.id === 'Oculus Go Controller' || gamepad.id === 'OpenVR Gamepad' || gamepad.id.startsWith('Oculus Touch') || gamepad.id.startsWith('HTC Vive Focus') || gamepad.id.startsWith('Spatial Controller'))) {\n\t\t\t\t\tvar hand = gamepad.hand;\n\t\t\t\t\tif (id === 0 && (hand === '' || hand === 'right')) return gamepad;\n\t\t\t\t\tif (id === 1 && hand === 'left') return gamepad;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateControllers() {\n\t\t\tfor (var i = 0; i < controllers.length; i++) {\n\t\t\t\tvar controller = controllers[i];\n\t\t\t\tvar gamepad = findGamepad(i);\n\n\t\t\t\tif (gamepad !== undefined && gamepad.pose !== undefined) {\n\t\t\t\t\tif (gamepad.pose === null) return; // Pose\n\n\t\t\t\t\tvar pose = gamepad.pose;\n\t\t\t\t\tif (pose.hasPosition === false) controller.position.set(0.2, -0.6, -0.05);\n\t\t\t\t\tif (pose.position !== null) controller.position.fromArray(pose.position);\n\t\t\t\t\tif (pose.orientation !== null) controller.quaternion.fromArray(pose.orientation);\n\t\t\t\t\tcontroller.matrix.compose(controller.position, controller.quaternion, controller.scale);\n\t\t\t\t\tcontroller.matrix.premultiply(standingMatrix);\n\t\t\t\t\tcontroller.matrix.decompose(controller.position, controller.quaternion, controller.scale);\n\t\t\t\t\tcontroller.matrixWorldNeedsUpdate = true;\n\t\t\t\t\tcontroller.visible = true; // Trigger\n\n\t\t\t\t\tvar buttonId = gamepad.id === 'Daydream Controller' ? 0 : 1;\n\t\t\t\t\tif (triggers[i] === undefined) triggers[i] = false;\n\n\t\t\t\t\tif (triggers[i] !== gamepad.buttons[buttonId].pressed) {\n\t\t\t\t\t\ttriggers[i] = gamepad.buttons[buttonId].pressed;\n\n\t\t\t\t\t\tif (triggers[i] === true) {\n\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\ttype: 'selectstart'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\ttype: 'selectend'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\ttype: 'select'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t} // Grip\n\n\n\t\t\t\t\tbuttonId = 2;\n\t\t\t\t\tif (grips[i] === undefined) grips[i] = false; // Skip if the grip button doesn't exist on this controller\n\n\t\t\t\t\tif (gamepad.buttons[buttonId] !== undefined) {\n\t\t\t\t\t\tif (grips[i] !== gamepad.buttons[buttonId].pressed) {\n\t\t\t\t\t\t\tgrips[i] = gamepad.buttons[buttonId].pressed;\n\n\t\t\t\t\t\t\tif (grips[i] === true) {\n\t\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\t\ttype: 'squeezestart'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\t\ttype: 'squeezeend'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\t\t\ttype: 'squeeze'\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tcontroller.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction updateViewportFromBounds(viewport, bounds) {\n\t\t\tif (bounds !== null && bounds.length === 4) {\n\t\t\t\tviewport.set(bounds[0] * renderWidth, bounds[1] * renderHeight, bounds[2] * renderWidth, bounds[3] * renderHeight);\n\t\t\t}\n\t\t} //\n\n\n\t\tthis.enabled = false;\n\n\t\tthis.getController = function (id) {\n\t\t\tvar controller = controllers[id];\n\n\t\t\tif (controller === undefined) {\n\t\t\t\tcontroller = new Group();\n\t\t\t\tcontroller.matrixAutoUpdate = false;\n\t\t\t\tcontroller.visible = false;\n\t\t\t\tcontrollers[id] = controller;\n\t\t\t}\n\n\t\t\treturn controller;\n\t\t};\n\n\t\tthis.getDevice = function () {\n\t\t\treturn device;\n\t\t};\n\n\t\tthis.setDevice = function (value) {\n\t\t\tif (value !== undefined) device = value;\n\t\t\tanimation.setContext(value);\n\t\t};\n\n\t\tthis.setFramebufferScaleFactor = function (value) {\n\t\t\tframebufferScaleFactor = value;\n\t\t};\n\n\t\tthis.setReferenceSpaceType = function (value) {\n\t\t\treferenceSpaceType = value;\n\t\t};\n\n\t\tthis.setPoseTarget = function (object) {\n\t\t\tif (object !== undefined) poseTarget = object;\n\t\t};\n\n\t\tthis.getCamera = function (camera) {\n\t\t\tvar userHeight = referenceSpaceType === 'local-floor' ? 1.6 : 0;\n\t\t\tdevice.depthNear = camera.near;\n\t\t\tdevice.depthFar = camera.far;\n\t\t\tdevice.getFrameData(frameData); //\n\n\t\t\tif (referenceSpaceType === 'local-floor') {\n\t\t\t\tvar stageParameters = device.stageParameters;\n\n\t\t\t\tif (stageParameters) {\n\t\t\t\t\tstandingMatrix.fromArray(stageParameters.sittingToStandingTransform);\n\t\t\t\t} else {\n\t\t\t\t\tstandingMatrix.makeTranslation(0, userHeight, 0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tvar pose = frameData.pose;\n\t\t\tvar poseObject = poseTarget !== null ? poseTarget : camera; // We want to manipulate poseObject by its position and quaternion components since users may rely on them.\n\n\t\t\tposeObject.matrix.copy(standingMatrix);\n\t\t\tposeObject.matrix.decompose(poseObject.position, poseObject.quaternion, poseObject.scale);\n\n\t\t\tif (pose.orientation !== null) {\n\t\t\t\ttempQuaternion.fromArray(pose.orientation);\n\t\t\t\tposeObject.quaternion.multiply(tempQuaternion);\n\t\t\t}\n\n\t\t\tif (pose.position !== null) {\n\t\t\t\ttempQuaternion.setFromRotationMatrix(standingMatrix);\n\t\t\t\ttempPosition.fromArray(pose.position);\n\t\t\t\ttempPosition.applyQuaternion(tempQuaternion);\n\t\t\t\tposeObject.position.add(tempPosition);\n\t\t\t}\n\n\t\t\tposeObject.updateMatrixWorld();\n\t\t\tvar children = poseObject.children;\n\n\t\t\tfor (var i = 0, l = children.length; i < l; i++) {\n\t\t\t\tchildren[i].updateMatrixWorld(true);\n\t\t\t} //\n\n\n\t\t\tcameraL.near = camera.near;\n\t\t\tcameraR.near = camera.near;\n\t\t\tcameraL.far = camera.far;\n\t\t\tcameraR.far = camera.far;\n\t\t\tcameraL.matrixWorldInverse.fromArray(frameData.leftViewMatrix);\n\t\t\tcameraR.matrixWorldInverse.fromArray(frameData.rightViewMatrix); // TODO (mrdoob) Double check this code\n\n\t\t\tstandingMatrixInverse.getInverse(standingMatrix);\n\n\t\t\tif (referenceSpaceType === 'local-floor') {\n\t\t\t\tcameraL.matrixWorldInverse.multiply(standingMatrixInverse);\n\t\t\t\tcameraR.matrixWorldInverse.multiply(standingMatrixInverse);\n\t\t\t}\n\n\t\t\tvar parent = poseObject.parent;\n\n\t\t\tif (parent !== null) {\n\t\t\t\tmatrixWorldInverse.getInverse(parent.matrixWorld);\n\t\t\t\tcameraL.matrixWorldInverse.multiply(matrixWorldInverse);\n\t\t\t\tcameraR.matrixWorldInverse.multiply(matrixWorldInverse);\n\t\t\t} // envMap and Mirror needs camera.matrixWorld\n\n\n\t\t\tcameraL.matrixWorld.getInverse(cameraL.matrixWorldInverse);\n\t\t\tcameraR.matrixWorld.getInverse(cameraR.matrixWorldInverse);\n\t\t\tcameraL.projectionMatrix.fromArray(frameData.leftProjectionMatrix);\n\t\t\tcameraR.projectionMatrix.fromArray(frameData.rightProjectionMatrix);\n\t\t\tsetProjectionFromUnion(cameraVR, cameraL, cameraR); //\n\n\t\t\tvar layers = device.getLayers();\n\n\t\t\tif (layers.length) {\n\t\t\t\tvar layer = layers[0];\n\t\t\t\tupdateViewportFromBounds(cameraL.viewport, layer.leftBounds);\n\t\t\t\tupdateViewportFromBounds(cameraR.viewport, layer.rightBounds);\n\t\t\t}\n\n\t\t\tupdateControllers();\n\t\t\treturn cameraVR;\n\t\t};\n\n\t\tthis.getStandingMatrix = function () {\n\t\t\treturn standingMatrix;\n\t\t};\n\n\t\tthis.isPresenting = false; // Animation Loop\n\n\t\tvar animation = new WebGLAnimation();\n\n\t\tthis.setAnimationLoop = function (callback) {\n\t\t\tanimation.setAnimationLoop(callback);\n\t\t\tif (this.isPresenting) animation.start();\n\t\t};\n\n\t\tthis.submitFrame = function () {\n\t\t\tif (this.isPresenting) device.submitFrame();\n\t\t};\n\n\t\tthis.dispose = function () {\n\t\t\tif (typeof window !== 'undefined') {\n\t\t\t\twindow.removeEventListener('vrdisplaypresentchange', onVRDisplayPresentChange);\n\t\t\t}\n\t\t}; // DEPRECATED\n\n\n\t\tthis.setFrameOfReferenceType = function () {\n\t\t\tconsole.warn('THREE.WebVRManager: setFrameOfReferenceType() has been deprecated.');\n\t\t};\n\n\t\tthis.addEventListener = function () {\n\t\t\t/* Stub */\n\t\t};\n\t}\n\n\tObject.assign(WebVRManager.prototype, EventDispatcher.prototype);\n\n\tconst _moveEvent = {\n\t\ttype: 'move'\n\t};\n\n\tclass WebXRController {\n\t\tconstructor() {\n\t\t\tthis._targetRay = null;\n\t\t\tthis._grip = null;\n\t\t\tthis._hand = null;\n\t\t}\n\n\t\tgetHandSpace() {\n\t\t\tif (this._hand === null) {\n\t\t\t\tthis._hand = new Group();\n\t\t\t\tthis._hand.matrixAutoUpdate = false;\n\t\t\t\tthis._hand.visible = false;\n\t\t\t\tthis._hand.joints = {};\n\t\t\t\tthis._hand.inputState = {\n\t\t\t\t\tpinching: false\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn this._hand;\n\t\t}\n\n\t\tgetTargetRaySpace() {\n\t\t\tif (this._targetRay === null) {\n\t\t\t\tthis._targetRay = new Group();\n\t\t\t\tthis._targetRay.matrixAutoUpdate = false;\n\t\t\t\tthis._targetRay.visible = false;\n\t\t\t\tthis._targetRay.hasLinearVelocity = false;\n\t\t\t\tthis._targetRay.linearVelocity = new Vector3();\n\t\t\t\tthis._targetRay.hasAngularVelocity = false;\n\t\t\t\tthis._targetRay.angularVelocity = new Vector3();\n\t\t\t}\n\n\t\t\treturn this._targetRay;\n\t\t}\n\n\t\tgetGripSpace() {\n\t\t\tif (this._grip === null) {\n\t\t\t\tthis._grip = new Group();\n\t\t\t\tthis._grip.matrixAutoUpdate = false;\n\t\t\t\tthis._grip.visible = false;\n\t\t\t\tthis._grip.hasLinearVelocity = false;\n\t\t\t\tthis._grip.linearVelocity = new Vector3();\n\t\t\t\tthis._grip.hasAngularVelocity = false;\n\t\t\t\tthis._grip.angularVelocity = new Vector3();\n\t\t\t}\n\n\t\t\treturn this._grip;\n\t\t}\n\n\t\tdispatchEvent(event) {\n\t\t\tif (this._targetRay !== null) {\n\t\t\t\tthis._targetRay.dispatchEvent(event);\n\t\t\t}\n\n\t\t\tif (this._grip !== null) {\n\t\t\t\tthis._grip.dispatchEvent(event);\n\t\t\t}\n\n\t\t\tif (this._hand !== null) {\n\t\t\t\tthis._hand.dispatchEvent(event);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tdisconnect(inputSource) {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'disconnected',\n\t\t\t\tdata: inputSource\n\t\t\t});\n\n\t\t\tif (this._targetRay !== null) {\n\t\t\t\tthis._targetRay.visible = false;\n\t\t\t}\n\n\t\t\tif (this._grip !== null) {\n\t\t\t\tthis._grip.visible = false;\n\t\t\t}\n\n\t\t\tif (this._hand !== null) {\n\t\t\t\tthis._hand.visible = false;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tupdate(inputSource, frame, referenceSpace) {\n\t\t\tlet inputPose = null;\n\t\t\tlet gripPose = null;\n\t\t\tlet handPose = null;\n\t\t\tconst targetRay = this._targetRay;\n\t\t\tconst grip = this._grip;\n\t\t\tconst hand = this._hand;\n\n\t\t\tif (inputSource && frame.session.visibilityState !== 'visible-blurred') {\n\t\t\t\tif (targetRay !== null) {\n\t\t\t\t\tinputPose = frame.getPose(inputSource.targetRaySpace, referenceSpace);\n\n\t\t\t\t\tif (inputPose !== null) {\n\t\t\t\t\t\ttargetRay.matrix.fromArray(inputPose.transform.matrix);\n\t\t\t\t\t\ttargetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);\n\n\t\t\t\t\t\tif (inputPose.linearVelocity) {\n\t\t\t\t\t\t\ttargetRay.hasLinearVelocity = true;\n\t\t\t\t\t\t\ttargetRay.linearVelocity.copy(inputPose.linearVelocity);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetRay.hasLinearVelocity = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (inputPose.angularVelocity) {\n\t\t\t\t\t\t\ttargetRay.hasAngularVelocity = true;\n\t\t\t\t\t\t\ttargetRay.angularVelocity.copy(inputPose.angularVelocity);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttargetRay.hasAngularVelocity = false;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis.dispatchEvent(_moveEvent);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hand && inputSource.hand) {\n\t\t\t\t\thandPose = true;\n\n\t\t\t\t\tfor (const inputjoint of inputSource.hand.values()) {\n\t\t\t\t\t\t// Update the joints groups with the XRJoint poses\n\t\t\t\t\t\tconst jointPose = frame.getJointPose(inputjoint, referenceSpace);\n\n\t\t\t\t\t\tif (hand.joints[inputjoint.jointName] === undefined) {\n\t\t\t\t\t\t\t// The transform of this joint will be updated with the joint pose on each frame\n\t\t\t\t\t\t\tconst joint = new Group();\n\t\t\t\t\t\t\tjoint.matrixAutoUpdate = false;\n\t\t\t\t\t\t\tjoint.visible = false;\n\t\t\t\t\t\t\thand.joints[inputjoint.jointName] = joint; // ??\n\n\t\t\t\t\t\t\thand.add(joint);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst joint = hand.joints[inputjoint.jointName];\n\n\t\t\t\t\t\tif (jointPose !== null) {\n\t\t\t\t\t\t\tjoint.matrix.fromArray(jointPose.transform.matrix);\n\t\t\t\t\t\t\tjoint.matrix.decompose(joint.position, joint.rotation, joint.scale);\n\t\t\t\t\t\t\tjoint.jointRadius = jointPose.radius;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tjoint.visible = jointPose !== null;\n\t\t\t\t\t} // Custom events\n\t\t\t\t\t// Check pinchz\n\n\n\t\t\t\t\tconst indexTip = hand.joints['index-finger-tip'];\n\t\t\t\t\tconst thumbTip = hand.joints['thumb-tip'];\n\t\t\t\t\tconst distance = indexTip.position.distanceTo(thumbTip.position);\n\t\t\t\t\tconst distanceToPinch = 0.02;\n\t\t\t\t\tconst threshold = 0.005;\n\n\t\t\t\t\tif (hand.inputState.pinching && distance > distanceToPinch + threshold) {\n\t\t\t\t\t\thand.inputState.pinching = false;\n\t\t\t\t\t\tthis.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'pinchend',\n\t\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\t\ttarget: this\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {\n\t\t\t\t\t\thand.inputState.pinching = true;\n\t\t\t\t\t\tthis.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'pinchstart',\n\t\t\t\t\t\t\thandedness: inputSource.handedness,\n\t\t\t\t\t\t\ttarget: this\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (grip !== null && inputSource.gripSpace) {\n\t\t\t\t\t\tgripPose = frame.getPose(inputSource.gripSpace, referenceSpace);\n\n\t\t\t\t\t\tif (gripPose !== null) {\n\t\t\t\t\t\t\tgrip.matrix.fromArray(gripPose.transform.matrix);\n\t\t\t\t\t\t\tgrip.matrix.decompose(grip.position, grip.rotation, grip.scale);\n\n\t\t\t\t\t\t\tif (gripPose.linearVelocity) {\n\t\t\t\t\t\t\t\tgrip.hasLinearVelocity = true;\n\t\t\t\t\t\t\t\tgrip.linearVelocity.copy(gripPose.linearVelocity);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgrip.hasLinearVelocity = false;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (gripPose.angularVelocity) {\n\t\t\t\t\t\t\t\tgrip.hasAngularVelocity = true;\n\t\t\t\t\t\t\t\tgrip.angularVelocity.copy(gripPose.angularVelocity);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tgrip.hasAngularVelocity = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (targetRay !== null) {\n\t\t\t\ttargetRay.visible = inputPose !== null;\n\t\t\t}\n\n\t\t\tif (grip !== null) {\n\t\t\t\tgrip.visible = gripPose !== null;\n\t\t\t}\n\n\t\t\tif (hand !== null) {\n\t\t\t\thand.visible = handPose !== null;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass WebXRManager extends EventDispatcher {\n\t\tconstructor(renderer, gl) {\n\t\t\tsuper();\n\t\t\tconst scope = this;\n\t\t\tconst state = renderer.state;\n\t\t\tlet session = null;\n\t\t\tlet framebufferScaleFactor = 1.0;\n\t\t\tvar poseTarget = null;\n\t\t\tlet referenceSpace = null;\n\t\t\tlet referenceSpaceType = 'local-floor';\n\t\t\tlet pose = null;\n\t\t\tvar layers = [];\n\t\t\tlet glBinding = null;\n\t\t\tlet glFramebuffer = null;\n\t\t\tlet glProjLayer = null;\n\t\t\tlet glBaseLayer = null;\n\t\t\tlet isMultisample = false;\n\t\t\tlet glMultisampledFramebuffer = null;\n\t\t\tlet glColorRenderbuffer = null;\n\t\t\tlet glDepthRenderbuffer = null;\n\t\t\tlet xrFrame = null;\n\t\t\tlet depthStyle = null;\n\t\t\tlet clearStyle = null;\n\t\t\tconst controllers = [];\n\t\t\tconst inputSourcesMap = new Map(); //\n\n\t\t\tconst cameraL = new PerspectiveCamera();\n\t\t\tcameraL.layers.enable(1);\n\t\t\tcameraL.viewport = new Vector4();\n\t\t\tconst cameraR = new PerspectiveCamera();\n\t\t\tcameraR.layers.enable(2);\n\t\t\tcameraR.viewport = new Vector4();\n\t\t\tconst cameras = [cameraL, cameraR];\n\t\t\tconst cameraVR = new ArrayCamera();\n\t\t\tcameraVR.layers.enable(1);\n\t\t\tcameraVR.layers.enable(2);\n\t\t\tlet _currentDepthNear = null;\n\t\t\tlet _currentDepthFar = null; //\n\n\t\t\tthis.cameraAutoUpdate = true;\n\t\t\tthis.layersEnabled = false;\n\t\t\tthis.enabled = false;\n\t\t\tthis.isPresenting = false;\n\n\t\t\tthis.getCameraPose = function () {\n\t\t\t\treturn pose;\n\t\t\t};\n\n\t\t\tthis.getController = function (index) {\n\t\t\t\tlet controller = controllers[index];\n\n\t\t\t\tif (controller === undefined) {\n\t\t\t\t\tcontroller = new WebXRController();\n\t\t\t\t\tcontrollers[index] = controller;\n\t\t\t\t}\n\n\t\t\t\treturn controller.getTargetRaySpace();\n\t\t\t};\n\n\t\t\tthis.getControllerGrip = function (index) {\n\t\t\t\tlet controller = controllers[index];\n\n\t\t\t\tif (controller === undefined) {\n\t\t\t\t\tcontroller = new WebXRController();\n\t\t\t\t\tcontrollers[index] = controller;\n\t\t\t\t}\n\n\t\t\t\treturn controller.getGripSpace();\n\t\t\t};\n\n\t\t\tthis.getHand = function (index) {\n\t\t\t\tlet controller = controllers[index];\n\n\t\t\t\tif (controller === undefined) {\n\t\t\t\t\tcontroller = new WebXRController();\n\t\t\t\t\tcontrollers[index] = controller;\n\t\t\t\t}\n\n\t\t\t\treturn controller.getHandSpace();\n\t\t\t}; //\n\n\n\t\t\tfunction onSessionEvent(event) {\n\t\t\t\tconst controller = inputSourcesMap.get(event.inputSource);\n\n\t\t\t\tif (controller) {\n\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\ttype: event.type,\n\t\t\t\t\t\tdata: event.inputSource\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction onSessionEnd() {\n\t\t\t\tinputSourcesMap.forEach(function (controller, inputSource) {\n\t\t\t\t\tcontroller.disconnect(inputSource);\n\t\t\t\t});\n\t\t\t\tinputSourcesMap.clear();\n\t\t\t\t_currentDepthNear = null;\n\t\t\t\t_currentDepthFar = null; // restore framebuffer/rendering state\n\n\t\t\t\tstate.bindXRFramebuffer(null);\n\t\t\t\trenderer.setRenderTarget(renderer.getRenderTarget());\n\t\t\t\tif (glFramebuffer) gl.deleteFramebuffer(glFramebuffer);\n\t\t\t\tif (glMultisampledFramebuffer) gl.deleteFramebuffer(glMultisampledFramebuffer);\n\t\t\t\tif (glColorRenderbuffer) gl.deleteRenderbuffer(glColorRenderbuffer);\n\t\t\t\tif (glDepthRenderbuffer) gl.deleteRenderbuffer(glDepthRenderbuffer);\n\t\t\t\tglFramebuffer = null;\n\t\t\t\tglMultisampledFramebuffer = null;\n\t\t\t\tglColorRenderbuffer = null;\n\t\t\t\tglDepthRenderbuffer = null;\n\t\t\t\tglBaseLayer = null;\n\t\t\t\tglProjLayer = null;\n\t\t\t\tglBinding = null;\n\t\t\t\tsession = null; //\n\n\t\t\t\tanimation.stop();\n\t\t\t\tscope.isPresenting = false;\n\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\ttype: 'sessionend'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tthis.setFramebufferScaleFactor = function (value) {\n\t\t\t\tframebufferScaleFactor = value;\n\n\t\t\t\tif (scope.isPresenting === true) {\n\t\t\t\t\tconsole.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.setReferenceSpaceType = function (value) {\n\t\t\t\treferenceSpaceType = value;\n\n\t\t\t\tif (scope.isPresenting === true) {\n\t\t\t\t\tconsole.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.getReferenceSpace = function () {\n\t\t\t\treturn referenceSpace;\n\t\t\t};\n\n\t\t\tthis.getBaseLayer = function () {\n\t\t\t\treturn glProjLayer !== null ? glProjLayer : glBaseLayer;\n\t\t\t};\n\n\t\t\tthis.getBinding = function () {\n\t\t\t\treturn glBinding;\n\t\t\t};\n\n\t\t\tthis.getFrame = function () {\n\t\t\t\treturn xrFrame;\n\t\t\t};\n\n\t\t\tthis.getSession = function () {\n\t\t\t\treturn session;\n\t\t\t};\n\n\t\t\tthis.setSession = async function (value) {\n\t\t\t\tsession = value;\n\n\t\t\t\tif (session !== null) {\n\t\t\t\t\tsession.addEventListener('select', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('selectstart', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('selectend', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('squeeze', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('squeezestart', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('squeezeend', onSessionEvent);\n\t\t\t\t\tsession.addEventListener('end', onSessionEnd);\n\t\t\t\t\tsession.addEventListener('inputsourceschange', onInputSourcesChange);\n\t\t\t\t\tconst attributes = gl.getContextAttributes();\n\n\t\t\t\t\tif (attributes.xrCompatible !== true) {\n\t\t\t\t\t\tawait gl.makeXRCompatible();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (session.renderState.layers === undefined) {\n\t\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\t\tantialias: attributes.antialias,\n\t\t\t\t\t\t\talpha: attributes.alpha,\n\t\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t\t};\n\t\t\t\t\t\tglBaseLayer = new XRWebGLLayer(session, gl, layerInit);\n\t\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\t\tbaseLayer: glBaseLayer\n\t\t\t\t\t\t});\n\t\t\t\t\t} else if (gl instanceof WebGLRenderingContext) {\n\t\t\t\t\t\t// Use old style webgl layer because we can't use MSAA\n\t\t\t\t\t\t// WebGL2 support.\n\t\t\t\t\t\tconst layerInit = {\n\t\t\t\t\t\t\tantialias: true,\n\t\t\t\t\t\t\talpha: attributes.alpha,\n\t\t\t\t\t\t\tdepth: attributes.depth,\n\t\t\t\t\t\t\tstencil: attributes.stencil,\n\t\t\t\t\t\t\tframebufferScaleFactor: framebufferScaleFactor\n\t\t\t\t\t\t};\n\t\t\t\t\t\tglBaseLayer = new XRWebGLLayer(session, gl, layerInit);\n\t\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\t\tlayers: [glBaseLayer]\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tisMultisample = attributes.antialias;\n\t\t\t\t\t\tlet depthFormat = null;\n\n\t\t\t\t\t\tif (attributes.depth) {\n\t\t\t\t\t\t\tclearStyle = gl.DEPTH_BUFFER_BIT;\n\t\t\t\t\t\t\tif (attributes.stencil) clearStyle |= gl.STENCIL_BUFFER_BIT;\n\t\t\t\t\t\t\tdepthStyle = attributes.stencil ? gl.DEPTH_STENCIL_ATTACHMENT : gl.DEPTH_ATTACHMENT;\n\t\t\t\t\t\t\tdepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst projectionlayerInit = {\n\t\t\t\t\t\t\tcolorFormat: attributes.alpha ? gl.RGBA8 : gl.RGB8,\n\t\t\t\t\t\t\tdepthFormat: depthFormat,\n\t\t\t\t\t\t\tscaleFactor: framebufferScaleFactor\n\t\t\t\t\t\t};\n\t\t\t\t\t\tglBinding = new XRWebGLBinding(session, gl);\n\t\t\t\t\t\tglProjLayer = glBinding.createProjectionLayer(projectionlayerInit);\n\t\t\t\t\t\tglFramebuffer = gl.createFramebuffer();\n\t\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\t\tlayers: [glProjLayer]\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif (isMultisample) {\n\t\t\t\t\t\t\tglMultisampledFramebuffer = gl.createFramebuffer();\n\t\t\t\t\t\t\tglColorRenderbuffer = gl.createRenderbuffer();\n\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, glColorRenderbuffer);\n\t\t\t\t\t\t\tgl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, gl.RGBA8, glProjLayer.textureWidth, glProjLayer.textureHeight);\n\t\t\t\t\t\t\tstate.bindFramebuffer(gl.FRAMEBUFFER, glMultisampledFramebuffer);\n\t\t\t\t\t\t\tgl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.RENDERBUFFER, glColorRenderbuffer);\n\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\n\t\t\t\t\t\t\tif (depthFormat !== null) {\n\t\t\t\t\t\t\t\tglDepthRenderbuffer = gl.createRenderbuffer();\n\t\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, glDepthRenderbuffer);\n\t\t\t\t\t\t\t\tgl.renderbufferStorageMultisample(gl.RENDERBUFFER, 4, depthFormat, glProjLayer.textureWidth, glProjLayer.textureHeight);\n\t\t\t\t\t\t\t\tgl.framebufferRenderbuffer(gl.FRAMEBUFFER, depthStyle, gl.RENDERBUFFER, glDepthRenderbuffer);\n\t\t\t\t\t\t\t\tgl.bindRenderbuffer(gl.RENDERBUFFER, null);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tstate.bindFramebuffer(gl.FRAMEBUFFER, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treferenceSpace = await session.requestReferenceSpace(referenceSpaceType);\n\t\t\t\t\tanimation.setContext(session);\n\t\t\t\t\tanimation.start();\n\t\t\t\t\tscope.isPresenting = true;\n\t\t\t\t\tscope.dispatchEvent({\n\t\t\t\t\t\ttype: 'sessionstart'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.addLayer = function (layer) {\n\t\t\t\tif (!window.XRWebGLBinding || !this.layersEnabled || !session) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlayers.push(layer);\n\t\t\t\tthis.updateLayers();\n\t\t\t};\n\n\t\t\tthis.removeLayer = function (layer) {\n\t\t\t\tif (!window.XRWebGLBinding || !this.layersEnabled || !session) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tlayers.splice(layers.indexOf(layer), 1);\n\t\t\t\tthis.updateLayers();\n\t\t\t};\n\n\t\t\tthis.updateLayers = function () {\n\t\t\t\tvar layersCopy = layers.map(function (x) {\n\t\t\t\t\treturn x;\n\t\t\t\t});\n\t\t\t\tlayersCopy.unshift(session.renderState.layers[0]);\n\t\t\t\tsession.updateRenderState({\n\t\t\t\t\tlayers: layersCopy\n\t\t\t\t});\n\t\t\t};\n\n\t\t\tfunction onInputSourcesChange(event) {\n\t\t\t\tconst inputSources = session.inputSources; // Assign inputSources to available controllers\n\n\t\t\t\tfor (let i = 0; i < controllers.length; i++) {\n\t\t\t\t\tinputSourcesMap.set(inputSources[i], controllers[i]);\n\t\t\t\t} // Notify disconnected\n\n\n\t\t\t\tfor (let i = 0; i < event.removed.length; i++) {\n\t\t\t\t\tconst inputSource = event.removed[i];\n\t\t\t\t\tconst controller = inputSourcesMap.get(inputSource);\n\n\t\t\t\t\tif (controller) {\n\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'disconnected',\n\t\t\t\t\t\t\tdata: inputSource\n\t\t\t\t\t\t});\n\t\t\t\t\t\tinputSourcesMap.delete(inputSource);\n\t\t\t\t\t}\n\t\t\t\t} // Notify connected\n\n\n\t\t\t\tfor (let i = 0; i < event.added.length; i++) {\n\t\t\t\t\tconst inputSource = event.added[i];\n\t\t\t\t\tconst controller = inputSourcesMap.get(inputSource);\n\n\t\t\t\t\tif (controller) {\n\t\t\t\t\t\tcontroller.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'connected',\n\t\t\t\t\t\t\tdata: inputSource\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tconst cameraLPos = new Vector3();\n\t\t\tconst cameraRPos = new Vector3();\n\t\t\t/**\n\t\t\t * Assumes 2 cameras that are parallel and share an X-axis, and that\n\t\t\t * the cameras' projection and world matrices have already been set.\n\t\t\t * And that near and far planes are identical for both cameras.\n\t\t\t * Visualization of this technique: https://computergraphics.stackexchange.com/a/4765\n\t\t\t */\n\n\t\t\tfunction setProjectionFromUnion(camera, cameraL, cameraR) {\n\t\t\t\tcameraLPos.setFromMatrixPosition(cameraL.matrixWorld);\n\t\t\t\tcameraRPos.setFromMatrixPosition(cameraR.matrixWorld);\n\t\t\t\tconst ipd = cameraLPos.distanceTo(cameraRPos);\n\t\t\t\tconst projL = cameraL.projectionMatrix.elements;\n\t\t\t\tconst projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and\n\t\t\t\t// most likely identical top and bottom frustum extents.\n\t\t\t\t// Use the left camera for these values.\n\n\t\t\t\tconst near = projL[14] / (projL[10] - 1);\n\t\t\t\tconst far = projL[14] / (projL[10] + 1);\n\t\t\t\tconst topFov = (projL[9] + 1) / projL[5];\n\t\t\t\tconst bottomFov = (projL[9] - 1) / projL[5];\n\t\t\t\tconst leftFov = (projL[8] - 1) / projL[0];\n\t\t\t\tconst rightFov = (projR[8] + 1) / projR[0];\n\t\t\t\tconst left = near * leftFov;\n\t\t\t\tconst right = near * rightFov; // Calculate the new camera's position offset from the\n\t\t\t\t// left camera. xOffset should be roughly half `ipd`.\n\n\t\t\t\tconst zOffset = ipd / (-leftFov + rightFov);\n\t\t\t\tconst xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?\n\n\t\t\t\tcameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);\n\t\t\t\tcamera.translateX(xOffset);\n\t\t\t\tcamera.translateZ(zOffset);\n\t\t\t\tcamera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);\n\t\t\t\tcamera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale\n\t\t\t\t// the values so that the near plane's position does not change in world space,\n\t\t\t\t// although must now be relative to the new union camera.\n\n\t\t\t\tconst near2 = near + zOffset;\n\t\t\t\tconst far2 = far + zOffset;\n\t\t\t\tconst left2 = left - xOffset;\n\t\t\t\tconst right2 = right + (ipd - xOffset);\n\t\t\t\tconst top2 = topFov * far / far2 * near2;\n\t\t\t\tconst bottom2 = bottomFov * far / far2 * near2;\n\t\t\t\tcamera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);\n\t\t\t}\n\n\t\t\tfunction updateCamera(camera, parent) {\n\t\t\t\tif (parent === null) {\n\t\t\t\t\tcamera.matrixWorld.copy(camera.matrix);\n\t\t\t\t} else {\n\t\t\t\t\tcamera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);\n\t\t\t\t}\n\n\t\t\t\tcamera.matrixWorldInverse.copy(camera.matrixWorld).invert();\n\t\t\t}\n\n\t\t\tthis.setPoseTarget = function (object) {\n\t\t\t\tif (object !== undefined) poseTarget = object;\n\t\t\t};\n\n\t\t\tthis.updateCamera = function (camera) {\n\t\t\t\tif (session === null) return;\n\t\t\t\tcameraVR.near = cameraR.near = cameraL.near = camera.near;\n\t\t\t\tcameraVR.far = cameraR.far = cameraL.far = camera.far;\n\n\t\t\t\tif (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {\n\t\t\t\t\t// Note that the new renderState won't apply until the next frame. See #18320\n\t\t\t\t\tsession.updateRenderState({\n\t\t\t\t\t\tdepthNear: cameraVR.near,\n\t\t\t\t\t\tdepthFar: cameraVR.far\n\t\t\t\t\t});\n\t\t\t\t\t_currentDepthNear = cameraVR.near;\n\t\t\t\t\t_currentDepthFar = cameraVR.far;\n\t\t\t\t}\n\n\t\t\t\tconst cameras = cameraVR.cameras;\n\t\t\t\tvar object = poseTarget || camera;\n\t\t\t\tconst parent = object.parent;\n\t\t\t\tupdateCamera(cameraVR, parent);\n\n\t\t\t\tfor (let i = 0; i < cameras.length; i++) {\n\t\t\t\t\tupdateCamera(cameras[i], parent);\n\t\t\t\t}\n\n\t\t\t\tcameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children\n\n\t\t\t\tobject.matrixWorld.copy(cameraVR.matrixWorld);\n\t\t\t\tobject.matrix.copy(cameraVR.matrix);\n\t\t\t\tobject.matrix.decompose(object.position, object.quaternion, object.scale);\n\t\t\t\tconst children = object.children;\n\n\t\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\t\tchildren[i].updateMatrixWorld(true);\n\t\t\t\t} // update projection matrix for proper view frustum culling\n\n\n\t\t\t\tif (cameras.length === 2) {\n\t\t\t\t\tsetProjectionFromUnion(cameraVR, cameraL, cameraR);\n\t\t\t\t} else {\n\t\t\t\t\t// assume single camera setup (AR)\n\t\t\t\t\tcameraVR.projectionMatrix.copy(cameraL.projectionMatrix);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.getCamera = function () {\n\t\t\t\treturn cameraVR;\n\t\t\t};\n\n\t\t\tthis.getFoveation = function () {\n\t\t\t\tif (glProjLayer !== null) {\n\t\t\t\t\treturn glProjLayer.fixedFoveation;\n\t\t\t\t}\n\n\t\t\t\tif (glBaseLayer !== null) {\n\t\t\t\t\treturn glBaseLayer.fixedFoveation;\n\t\t\t\t}\n\n\t\t\t\treturn undefined;\n\t\t\t};\n\n\t\t\tthis.setFoveation = function (foveation) {\n\t\t\t\t// 0 = no foveation = full resolution\n\t\t\t\t// 1 = maximum foveation = the edges render at lower resolution\n\t\t\t\tif (glProjLayer !== null) {\n\t\t\t\t\tglProjLayer.fixedFoveation = foveation;\n\t\t\t\t}\n\n\t\t\t\tif (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {\n\t\t\t\t\tglBaseLayer.fixedFoveation = foveation;\n\t\t\t\t}\n\t\t\t}; // Animation Loop\n\n\n\t\t\tlet onAnimationFrameCallback = null;\n\n\t\t\tfunction onAnimationFrame(time, frame) {\n\t\t\t\tpose = frame.getViewerPose(referenceSpace);\n\t\t\t\txrFrame = frame;\n\n\t\t\t\tif (pose !== null) {\n\t\t\t\t\tconst views = pose.views;\n\n\t\t\t\t\tif (glBaseLayer !== null) {\n\t\t\t\t\t\tstate.bindXRFramebuffer(glBaseLayer.framebuffer);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list\n\n\t\t\t\t\tif (views.length !== cameraVR.cameras.length) {\n\t\t\t\t\t\tcameraVR.cameras.length = 0;\n\t\t\t\t\t\tcameraVRNeedsUpdate = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tfor (let i = 0; i < views.length; i++) {\n\t\t\t\t\t\tconst view = views[i];\n\t\t\t\t\t\tlet viewport = null;\n\n\t\t\t\t\t\tif (glBaseLayer !== null) {\n\t\t\t\t\t\t\tviewport = glBaseLayer.getViewport(view);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst glSubImage = glBinding.getViewSubImage(glProjLayer, view);\n\t\t\t\t\t\t\tstate.bindXRFramebuffer(glFramebuffer);\n\n\t\t\t\t\t\t\tif (glSubImage.depthStencilTexture !== undefined) {\n\t\t\t\t\t\t\t\tgl.framebufferTexture2D(gl.FRAMEBUFFER, depthStyle, gl.TEXTURE_2D, glSubImage.depthStencilTexture, 0);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tgl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glSubImage.colorTexture, 0);\n\t\t\t\t\t\t\tviewport = glSubImage.viewport;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst camera = cameras[i];\n\t\t\t\t\t\tcamera.matrix.fromArray(view.transform.matrix);\n\t\t\t\t\t\tcamera.projectionMatrix.fromArray(view.projectionMatrix);\n\t\t\t\t\t\tcamera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);\n\n\t\t\t\t\t\tif (i === 0) {\n\t\t\t\t\t\t\tcameraVR.matrix.copy(camera.matrix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (cameraVRNeedsUpdate === true) {\n\t\t\t\t\t\t\tcameraVR.cameras.push(camera);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isMultisample) {\n\t\t\t\t\t\tstate.bindXRFramebuffer(glMultisampledFramebuffer);\n\t\t\t\t\t\tif (clearStyle !== null) gl.clear(clearStyle);\n\t\t\t\t\t}\n\t\t\t\t} //\n\n\n\t\t\t\tconst inputSources = session.inputSources;\n\n\t\t\t\tfor (let i = 0; i < controllers.length; i++) {\n\t\t\t\t\tconst controller = controllers[i];\n\t\t\t\t\tconst inputSource = inputSources[i];\n\t\t\t\t\tcontroller.update(inputSource, frame, referenceSpace);\n\t\t\t\t}\n\n\t\t\t\tif (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);\n\n\t\t\t\tif (isMultisample) {\n\t\t\t\t\tconst width = glProjLayer.textureWidth;\n\t\t\t\t\tconst height = glProjLayer.textureHeight;\n\t\t\t\t\tstate.bindFramebuffer(gl.READ_FRAMEBUFFER, glMultisampledFramebuffer);\n\t\t\t\t\tstate.bindFramebuffer(gl.DRAW_FRAMEBUFFER, glFramebuffer); // Invalidate the depth here to avoid flush of the depth data to main memory.\n\n\t\t\t\t\tgl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [depthStyle]);\n\t\t\t\t\tgl.invalidateFramebuffer(gl.DRAW_FRAMEBUFFER, [depthStyle]);\n\t\t\t\t\tgl.blitFramebuffer(0, 0, width, height, 0, 0, width, height, gl.COLOR_BUFFER_BIT, gl.NEAREST); // Invalidate the MSAA buffer because it's not needed anymore.\n\n\t\t\t\t\tgl.invalidateFramebuffer(gl.READ_FRAMEBUFFER, [gl.COLOR_ATTACHMENT0]);\n\t\t\t\t\tstate.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n\t\t\t\t\tstate.bindFramebuffer(gl.DRAW_FRAMEBUFFER, null);\n\t\t\t\t\tstate.bindFramebuffer(gl.FRAMEBUFFER, glMultisampledFramebuffer);\n\t\t\t\t}\n\n\t\t\t\txrFrame = null;\n\t\t\t}\n\n\t\t\tconst animation = new WebGLAnimation();\n\t\t\tanimation.setAnimationLoop(onAnimationFrame);\n\n\t\t\tthis.setAnimationLoop = function (callback) {\n\t\t\t\tonAnimationFrameCallback = callback;\n\t\t\t};\n\n\t\t\tthis.dispose = function () {};\n\t\t}\n\n\t}\n\n\tfunction WebGLMaterials(properties) {\n\t\tfunction refreshFogUniforms(uniforms, fog) {\n\t\t\tuniforms.fogColor.value.copy(fog.color);\n\n\t\t\tif (fog.isFog) {\n\t\t\t\tuniforms.fogNear.value = fog.near;\n\t\t\t\tuniforms.fogFar.value = fog.far;\n\t\t\t} else if (fog.isFogExp2) {\n\t\t\t\tuniforms.fogDensity.value = fog.density;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshMaterialUniforms(uniforms, material, pixelRatio, height, transmissionRenderTarget) {\n\t\t\tif (material.isMeshBasicMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t} else if (material.isMeshLambertMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsLambert(uniforms, material);\n\t\t\t} else if (material.isMeshToonMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsToon(uniforms, material);\n\t\t\t} else if (material.isMeshPhongMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsPhong(uniforms, material);\n\t\t\t} else if (material.isMeshStandardMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\n\t\t\t\tif (material.isMeshPhysicalMaterial) {\n\t\t\t\t\trefreshUniformsPhysical(uniforms, material, transmissionRenderTarget);\n\t\t\t\t} else {\n\t\t\t\t\trefreshUniformsStandard(uniforms, material);\n\t\t\t\t}\n\t\t\t} else if (material.isMeshMatcapMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsMatcap(uniforms, material);\n\t\t\t} else if (material.isMeshDepthMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsDepth(uniforms, material);\n\t\t\t} else if (material.isMeshDistanceMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsDistance(uniforms, material);\n\t\t\t} else if (material.isMeshNormalMaterial) {\n\t\t\t\trefreshUniformsCommon(uniforms, material);\n\t\t\t\trefreshUniformsNormal(uniforms, material);\n\t\t\t} else if (material.isLineBasicMaterial) {\n\t\t\t\trefreshUniformsLine(uniforms, material);\n\n\t\t\t\tif (material.isLineDashedMaterial) {\n\t\t\t\t\trefreshUniformsDash(uniforms, material);\n\t\t\t\t}\n\t\t\t} else if (material.isPointsMaterial) {\n\t\t\t\trefreshUniformsPoints(uniforms, material, pixelRatio, height);\n\t\t\t} else if (material.isSpriteMaterial) {\n\t\t\t\trefreshUniformsSprites(uniforms, material);\n\t\t\t} else if (material.isShadowMaterial) {\n\t\t\t\tuniforms.color.value.copy(material.color);\n\t\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\t} else if (material.isShaderMaterial) {\n\t\t\t\tmaterial.uniformsNeedUpdate = false; // #15581\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsCommon(uniforms, material) {\n\t\t\tuniforms.opacity.value = material.opacity;\n\n\t\t\tif (material.color) {\n\t\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\t}\n\n\t\t\tif (material.emissive) {\n\t\t\t\tuniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity);\n\t\t\t}\n\n\t\t\tif (material.map) {\n\t\t\t\tuniforms.map.value = material.map;\n\t\t\t}\n\n\t\t\tif (material.alphaMap) {\n\t\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (material.specularMap) {\n\t\t\t\tuniforms.specularMap.value = material.specularMap;\n\t\t\t}\n\n\t\t\tif (material.alphaTest > 0) {\n\t\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\t\t\t}\n\n\t\t\tconst envMap = properties.get(material).envMap;\n\n\t\t\tif (envMap) {\n\t\t\t\tuniforms.envMap.value = envMap;\n\t\t\t\tuniforms.flipEnvMap.value = envMap.isCubeTexture && envMap.isRenderTargetTexture === false ? -1 : 1;\n\t\t\t\tuniforms.reflectivity.value = material.reflectivity;\n\t\t\t\tuniforms.ior.value = material.ior;\n\t\t\t\tuniforms.refractionRatio.value = material.refractionRatio;\n\n\t\t\t\tconst maxMipLevel = properties.get(envMap).__maxMipLevel;\n\n\t\t\t\tif (maxMipLevel !== undefined) {\n\t\t\t\t\tuniforms.maxMipLevel.value = maxMipLevel;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (material.lightMap) {\n\t\t\t\tuniforms.lightMap.value = material.lightMap;\n\t\t\t\tuniforms.lightMapIntensity.value = material.lightMapIntensity;\n\t\t\t}\n\n\t\t\tif (material.aoMap) {\n\t\t\t\tuniforms.aoMap.value = material.aoMap;\n\t\t\t\tuniforms.aoMapIntensity.value = material.aoMapIntensity;\n\t\t\t} // uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. specular map\n\t\t\t// 3. displacementMap map\n\t\t\t// 4. normal map\n\t\t\t// 5. bump map\n\t\t\t// 6. roughnessMap map\n\t\t\t// 7. metalnessMap map\n\t\t\t// 8. alphaMap map\n\t\t\t// 9. emissiveMap map\n\t\t\t// 10. clearcoat map\n\t\t\t// 11. clearcoat normal map\n\t\t\t// 12. clearcoat roughnessMap map\n\t\t\t// 13. specular intensity map\n\t\t\t// 14. specular tint map\n\t\t\t// 15. transmission map\n\t\t\t// 16. thickness map\n\n\n\t\t\tlet uvScaleMap;\n\n\t\t\tif (material.map) {\n\t\t\t\tuvScaleMap = material.map;\n\t\t\t} else if (material.specularMap) {\n\t\t\t\tuvScaleMap = material.specularMap;\n\t\t\t} else if (material.displacementMap) {\n\t\t\t\tuvScaleMap = material.displacementMap;\n\t\t\t} else if (material.normalMap) {\n\t\t\t\tuvScaleMap = material.normalMap;\n\t\t\t} else if (material.bumpMap) {\n\t\t\t\tuvScaleMap = material.bumpMap;\n\t\t\t} else if (material.roughnessMap) {\n\t\t\t\tuvScaleMap = material.roughnessMap;\n\t\t\t} else if (material.metalnessMap) {\n\t\t\t\tuvScaleMap = material.metalnessMap;\n\t\t\t} else if (material.alphaMap) {\n\t\t\t\tuvScaleMap = material.alphaMap;\n\t\t\t} else if (material.emissiveMap) {\n\t\t\t\tuvScaleMap = material.emissiveMap;\n\t\t\t} else if (material.clearcoatMap) {\n\t\t\t\tuvScaleMap = material.clearcoatMap;\n\t\t\t} else if (material.clearcoatNormalMap) {\n\t\t\t\tuvScaleMap = material.clearcoatNormalMap;\n\t\t\t} else if (material.clearcoatRoughnessMap) {\n\t\t\t\tuvScaleMap = material.clearcoatRoughnessMap;\n\t\t\t} else if (material.specularIntensityMap) {\n\t\t\t\tuvScaleMap = material.specularIntensityMap;\n\t\t\t} else if (material.specularTintMap) {\n\t\t\t\tuvScaleMap = material.specularTintMap;\n\t\t\t} else if (material.transmissionMap) {\n\t\t\t\tuvScaleMap = material.transmissionMap;\n\t\t\t} else if (material.thicknessMap) {\n\t\t\t\tuvScaleMap = material.thicknessMap;\n\t\t\t}\n\n\t\t\tif (uvScaleMap !== undefined) {\n\t\t\t\t// backwards compatibility\n\t\t\t\tif (uvScaleMap.isWebGLRenderTarget) {\n\t\t\t\t\tuvScaleMap = uvScaleMap.texture;\n\t\t\t\t}\n\n\t\t\t\tif (uvScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuvScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uvTransform.value.copy(uvScaleMap.matrix);\n\t\t\t} // uv repeat and offset setting priorities for uv2\n\t\t\t// 1. ao map\n\t\t\t// 2. light map\n\n\n\t\t\tlet uv2ScaleMap;\n\n\t\t\tif (material.aoMap) {\n\t\t\t\tuv2ScaleMap = material.aoMap;\n\t\t\t} else if (material.lightMap) {\n\t\t\t\tuv2ScaleMap = material.lightMap;\n\t\t\t}\n\n\t\t\tif (uv2ScaleMap !== undefined) {\n\t\t\t\t// backwards compatibility\n\t\t\t\tif (uv2ScaleMap.isWebGLRenderTarget) {\n\t\t\t\t\tuv2ScaleMap = uv2ScaleMap.texture;\n\t\t\t\t}\n\n\t\t\t\tif (uv2ScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuv2ScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uv2Transform.value.copy(uv2ScaleMap.matrix);\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsLine(uniforms, material) {\n\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t}\n\n\t\tfunction refreshUniformsDash(uniforms, material) {\n\t\t\tuniforms.dashSize.value = material.dashSize;\n\t\t\tuniforms.totalSize.value = material.dashSize + material.gapSize;\n\t\t\tuniforms.scale.value = material.scale;\n\t\t}\n\n\t\tfunction refreshUniformsPoints(uniforms, material, pixelRatio, height) {\n\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\tuniforms.size.value = material.size * pixelRatio;\n\t\t\tuniforms.scale.value = height * 0.5;\n\n\t\t\tif (material.map) {\n\t\t\t\tuniforms.map.value = material.map;\n\t\t\t}\n\n\t\t\tif (material.alphaMap) {\n\t\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (material.alphaTest > 0) {\n\t\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\t\t\t} // uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. alpha map\n\n\n\t\t\tlet uvScaleMap;\n\n\t\t\tif (material.map) {\n\t\t\t\tuvScaleMap = material.map;\n\t\t\t} else if (material.alphaMap) {\n\t\t\t\tuvScaleMap = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (uvScaleMap !== undefined) {\n\t\t\t\tif (uvScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuvScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uvTransform.value.copy(uvScaleMap.matrix);\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsSprites(uniforms, material) {\n\t\t\tuniforms.diffuse.value.copy(material.color);\n\t\t\tuniforms.opacity.value = material.opacity;\n\t\t\tuniforms.rotation.value = material.rotation;\n\n\t\t\tif (material.map) {\n\t\t\t\tuniforms.map.value = material.map;\n\t\t\t}\n\n\t\t\tif (material.alphaMap) {\n\t\t\t\tuniforms.alphaMap.value = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (material.alphaTest > 0) {\n\t\t\t\tuniforms.alphaTest.value = material.alphaTest;\n\t\t\t} // uv repeat and offset setting priorities\n\t\t\t// 1. color map\n\t\t\t// 2. alpha map\n\n\n\t\t\tlet uvScaleMap;\n\n\t\t\tif (material.map) {\n\t\t\t\tuvScaleMap = material.map;\n\t\t\t} else if (material.alphaMap) {\n\t\t\t\tuvScaleMap = material.alphaMap;\n\t\t\t}\n\n\t\t\tif (uvScaleMap !== undefined) {\n\t\t\t\tif (uvScaleMap.matrixAutoUpdate === true) {\n\t\t\t\t\tuvScaleMap.updateMatrix();\n\t\t\t\t}\n\n\t\t\t\tuniforms.uvTransform.value.copy(uvScaleMap.matrix);\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsLambert(uniforms, material) {\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsPhong(uniforms, material) {\n\t\t\tuniforms.specular.value.copy(material.specular);\n\t\t\tuniforms.shininess.value = Math.max(material.shininess, 1e-4); // to prevent pow( 0.0, 0.0 )\n\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsToon(uniforms, material) {\n\t\t\tif (material.gradientMap) {\n\t\t\t\tuniforms.gradientMap.value = material.gradientMap;\n\t\t\t}\n\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsStandard(uniforms, material) {\n\t\t\tuniforms.roughness.value = material.roughness;\n\t\t\tuniforms.metalness.value = material.metalness;\n\n\t\t\tif (material.roughnessMap) {\n\t\t\t\tuniforms.roughnessMap.value = material.roughnessMap;\n\t\t\t}\n\n\t\t\tif (material.metalnessMap) {\n\t\t\t\tuniforms.metalnessMap.value = material.metalnessMap;\n\t\t\t}\n\n\t\t\tif (material.emissiveMap) {\n\t\t\t\tuniforms.emissiveMap.value = material.emissiveMap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\n\t\t\tconst envMap = properties.get(material).envMap;\n\n\t\t\tif (envMap) {\n\t\t\t\t//uniforms.envMap.value = material.envMap; // part of uniforms common\n\t\t\t\tuniforms.envMapIntensity.value = material.envMapIntensity;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsPhysical(uniforms, material, transmissionRenderTarget) {\n\t\t\trefreshUniformsStandard(uniforms, material);\n\t\t\tuniforms.ior.value = material.ior; // also part of uniforms common\n\n\t\t\tif (material.sheen > 0) {\n\t\t\t\tuniforms.sheenTint.value.copy(material.sheenTint).multiplyScalar(material.sheen);\n\t\t\t\tuniforms.sheenRoughness.value = material.sheenRoughness;\n\t\t\t}\n\n\t\t\tif (material.clearcoat > 0) {\n\t\t\t\tuniforms.clearcoat.value = material.clearcoat;\n\t\t\t\tuniforms.clearcoatRoughness.value = material.clearcoatRoughness;\n\n\t\t\t\tif (material.clearcoatMap) {\n\t\t\t\t\tuniforms.clearcoatMap.value = material.clearcoatMap;\n\t\t\t\t}\n\n\t\t\t\tif (material.clearcoatRoughnessMap) {\n\t\t\t\t\tuniforms.clearcoatRoughnessMap.value = material.clearcoatRoughnessMap;\n\t\t\t\t}\n\n\t\t\t\tif (material.clearcoatNormalMap) {\n\t\t\t\t\tuniforms.clearcoatNormalScale.value.copy(material.clearcoatNormalScale);\n\t\t\t\t\tuniforms.clearcoatNormalMap.value = material.clearcoatNormalMap;\n\n\t\t\t\t\tif (material.side === BackSide) {\n\t\t\t\t\t\tuniforms.clearcoatNormalScale.value.negate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (material.transmission > 0) {\n\t\t\t\tuniforms.transmission.value = material.transmission;\n\t\t\t\tuniforms.transmissionSamplerMap.value = transmissionRenderTarget.texture;\n\t\t\t\tuniforms.transmissionSamplerSize.value.set(transmissionRenderTarget.width, transmissionRenderTarget.height);\n\n\t\t\t\tif (material.transmissionMap) {\n\t\t\t\t\tuniforms.transmissionMap.value = material.transmissionMap;\n\t\t\t\t}\n\n\t\t\t\tuniforms.thickness.value = material.thickness;\n\n\t\t\t\tif (material.thicknessMap) {\n\t\t\t\t\tuniforms.thicknessMap.value = material.thicknessMap;\n\t\t\t\t}\n\n\t\t\t\tuniforms.attenuationDistance.value = material.attenuationDistance;\n\t\t\t\tuniforms.attenuationTint.value.copy(material.attenuationTint);\n\t\t\t}\n\n\t\t\tuniforms.specularIntensity.value = material.specularIntensity;\n\t\t\tuniforms.specularTint.value.copy(material.specularTint);\n\n\t\t\tif (material.specularIntensityMap) {\n\t\t\t\tuniforms.specularIntensityMap.value = material.specularIntensityMap;\n\t\t\t}\n\n\t\t\tif (material.specularTintMap) {\n\t\t\t\tuniforms.specularTintMap.value = material.specularTintMap;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsMatcap(uniforms, material) {\n\t\t\tif (material.matcap) {\n\t\t\t\tuniforms.matcap.value = material.matcap;\n\t\t\t}\n\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsDepth(uniforms, material) {\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\tfunction refreshUniformsDistance(uniforms, material) {\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\n\t\t\tuniforms.referencePosition.value.copy(material.referencePosition);\n\t\t\tuniforms.nearDistance.value = material.nearDistance;\n\t\t\tuniforms.farDistance.value = material.farDistance;\n\t\t}\n\n\t\tfunction refreshUniformsNormal(uniforms, material) {\n\t\t\tif (material.bumpMap) {\n\t\t\t\tuniforms.bumpMap.value = material.bumpMap;\n\t\t\t\tuniforms.bumpScale.value = material.bumpScale;\n\t\t\t\tif (material.side === BackSide) uniforms.bumpScale.value *= -1;\n\t\t\t}\n\n\t\t\tif (material.normalMap) {\n\t\t\t\tuniforms.normalMap.value = material.normalMap;\n\t\t\t\tuniforms.normalScale.value.copy(material.normalScale);\n\t\t\t\tif (material.side === BackSide) uniforms.normalScale.value.negate();\n\t\t\t}\n\n\t\t\tif (material.displacementMap) {\n\t\t\t\tuniforms.displacementMap.value = material.displacementMap;\n\t\t\t\tuniforms.displacementScale.value = material.displacementScale;\n\t\t\t\tuniforms.displacementBias.value = material.displacementBias;\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trefreshFogUniforms: refreshFogUniforms,\n\t\t\trefreshMaterialUniforms: refreshMaterialUniforms\n\t\t};\n\t}\n\n\tfunction createCanvasElement() {\n\t\tconst canvas = createElementNS('canvas');\n\t\tcanvas.style.display = 'block';\n\t\treturn canvas;\n\t}\n\n\tfunction WebGLRenderer(parameters = {}) {\n\t\tconst _canvas = parameters.canvas !== undefined ? parameters.canvas : createCanvasElement(),\n\t\t\t\t\t_context = parameters.context !== undefined ? parameters.context : null,\n\t\t\t\t\t_alpha = parameters.alpha !== undefined ? parameters.alpha : false,\n\t\t\t\t\t_depth = parameters.depth !== undefined ? parameters.depth : true,\n\t\t\t\t\t_stencil = parameters.stencil !== undefined ? parameters.stencil : true,\n\t\t\t\t\t_antialias = parameters.antialias !== undefined ? parameters.antialias : false,\n\t\t\t\t\t_premultipliedAlpha = parameters.premultipliedAlpha !== undefined ? parameters.premultipliedAlpha : true,\n\t\t\t\t\t_preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false,\n\t\t\t\t\t_powerPreference = parameters.powerPreference !== undefined ? parameters.powerPreference : 'default',\n\t\t\t\t\t_failIfMajorPerformanceCaveat = parameters.failIfMajorPerformanceCaveat !== undefined ? parameters.failIfMajorPerformanceCaveat : false;\n\n\t\tlet currentRenderList = null;\n\t\tlet currentRenderState = null; // render() can be called from within a callback triggered by another render.\n\t\t// We track this so that the nested render call gets its list and state isolated from the parent render call.\n\n\t\tconst renderListStack = [];\n\t\tconst renderStateStack = []; // public properties\n\n\t\tthis.domElement = _canvas; // Debug configuration container\n\n\t\tthis.debug = {\n\t\t\t/**\n\t\t\t * Enables error checking and reporting when shader programs are being compiled\n\t\t\t * @type {boolean}\n\t\t\t */\n\t\t\tcheckShaderErrors: true\n\t\t}; // clearing\n\n\t\tthis.autoClear = true;\n\t\tthis.autoClearColor = true;\n\t\tthis.autoClearDepth = true;\n\t\tthis.autoClearStencil = true; // scene graph\n\n\t\tthis.sortObjects = true; // user-defined clipping\n\n\t\tthis.clippingPlanes = [];\n\t\tthis.localClippingEnabled = false; // physically based shading\n\n\t\tthis.gammaFactor = 2.0; // for backwards compatibility\n\n\t\tthis.outputEncoding = LinearEncoding; // physical lights\n\n\t\tthis.physicallyCorrectLights = false; // tone mapping\n\n\t\tthis.toneMapping = NoToneMapping;\n\t\tthis.toneMappingExposure = 1.0; // internal properties\n\n\t\tconst _this = this;\n\n\t\tlet _isContextLost = false; // internal state cache\n\n\t\tlet _currentActiveCubeFace = 0;\n\t\tlet _currentActiveMipmapLevel = 0;\n\t\tlet _currentRenderTarget = null;\n\n\t\tlet _currentMaterialId = -1;\n\n\t\tlet _currentCamera = null;\n\n\t\tconst _currentViewport = new Vector4();\n\n\t\tconst _currentScissor = new Vector4();\n\n\t\tlet _currentScissorTest = null; //\n\n\t\tlet _width = _canvas.width;\n\t\tlet _height = _canvas.height;\n\t\tlet _pixelRatio = 1;\n\t\tlet _opaqueSort = null;\n\t\tlet _transparentSort = null;\n\n\t\tconst _viewport = new Vector4(0, 0, _width, _height);\n\n\t\tconst _scissor = new Vector4(0, 0, _width, _height);\n\n\t\tlet _scissorTest = false; //\n\n\t\tconst _currentDrawBuffers = []; // frustum\n\n\t\tconst _frustum = new Frustum(); // clipping\n\n\n\t\tlet _clippingEnabled = false;\n\t\tlet _localClippingEnabled = false; // transmission\n\n\t\tlet _transmissionRenderTarget = null; // camera matrices cache\n\n\t\tconst _projScreenMatrix = new Matrix4();\n\n\t\tconst _vector3 = new Vector3();\n\n\t\tconst _emptyScene = {\n\t\t\tbackground: null,\n\t\t\tfog: null,\n\t\t\tenvironment: null,\n\t\t\toverrideMaterial: null,\n\t\t\tisScene: true\n\t\t};\n\n\t\tfunction getTargetPixelRatio() {\n\t\t\treturn _currentRenderTarget === null ? _pixelRatio : 1;\n\t\t} // initialize\n\n\n\t\tlet _gl = _context;\n\n\t\tfunction getContext(contextNames, contextAttributes) {\n\t\t\tfor (let i = 0; i < contextNames.length; i++) {\n\t\t\t\tconst contextName = contextNames[i];\n\n\t\t\t\tconst context = _canvas.getContext(contextName, contextAttributes);\n\n\t\t\t\tif (context !== null) return context;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\ttry {\n\t\t\tconst contextAttributes = {\n\t\t\t\talpha: _alpha,\n\t\t\t\tdepth: _depth,\n\t\t\t\tstencil: _stencil,\n\t\t\t\tantialias: _antialias,\n\t\t\t\tpremultipliedAlpha: _premultipliedAlpha,\n\t\t\t\tpreserveDrawingBuffer: _preserveDrawingBuffer,\n\t\t\t\tpowerPreference: _powerPreference,\n\t\t\t\tfailIfMajorPerformanceCaveat: _failIfMajorPerformanceCaveat\n\t\t\t}; // event listeners must be registered before WebGL context is created, see #12753\n\n\t\t\t_canvas.addEventListener('webglcontextlost', onContextLost, false);\n\n\t\t\t_canvas.addEventListener('webglcontextrestored', onContextRestore, false);\n\n\t\t\tif (_gl === null) {\n\t\t\t\tconst contextNames = ['webgl2', 'webgl', 'experimental-webgl'];\n\n\t\t\t\tif (_this.isWebGL1Renderer === true) {\n\t\t\t\t\tcontextNames.shift();\n\t\t\t\t}\n\n\t\t\t\t_gl = getContext(contextNames, contextAttributes);\n\n\t\t\t\tif (_gl === null) {\n\t\t\t\t\tif (getContext(contextNames)) {\n\t\t\t\t\t\tthrow new Error('Error creating WebGL context with your selected attributes.');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error('Error creating WebGL context.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // Some experimental-webgl implementations do not have getShaderPrecisionFormat\n\n\n\t\t\tif (_gl.getShaderPrecisionFormat === undefined) {\n\t\t\t\t_gl.getShaderPrecisionFormat = function () {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'rangeMin': 1,\n\t\t\t\t\t\t'rangeMax': 1,\n\t\t\t\t\t\t'precision': 1\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t}\n\t\t} catch (error) {\n\t\t\tconsole.error('THREE.WebGLRenderer: ' + error.message);\n\t\t\tthrow error;\n\t\t}\n\n\t\tlet extensions, capabilities, state, info;\n\t\tlet properties, textures, cubemaps, cubeuvmaps, attributes, geometries, objects;\n\t\tlet programCache, materials, renderLists, renderStates, clipping, shadowMap;\n\t\tlet background, morphtargets, bufferRenderer, indexedBufferRenderer;\n\t\tlet utils, bindingStates;\n\n\t\tfunction initGLContext() {\n\t\t\textensions = new WebGLExtensions(_gl);\n\t\t\tcapabilities = new WebGLCapabilities(_gl, extensions, parameters);\n\t\t\textensions.init(capabilities);\n\t\t\tutils = new WebGLUtils(_gl, extensions, capabilities);\n\t\t\tstate = new WebGLState(_gl, extensions, capabilities);\n\t\t\t_currentDrawBuffers[0] = _gl.BACK;\n\t\t\tinfo = new WebGLInfo(_gl);\n\t\t\tproperties = new WebGLProperties();\n\t\t\ttextures = new WebGLTextures(_gl, extensions, state, properties, capabilities, utils, info);\n\t\t\tcubemaps = new WebGLCubeMaps(_this);\n\t\t\tcubeuvmaps = new WebGLCubeUVMaps(_this);\n\t\t\tattributes = new WebGLAttributes(_gl, capabilities);\n\t\t\tbindingStates = new WebGLBindingStates(_gl, extensions, attributes, capabilities);\n\t\t\tgeometries = new WebGLGeometries(_gl, attributes, info, bindingStates);\n\t\t\tobjects = new WebGLObjects(_gl, geometries, attributes, info);\n\t\t\tmorphtargets = new WebGLMorphtargets(_gl, capabilities, textures);\n\t\t\tclipping = new WebGLClipping(properties);\n\t\t\tprogramCache = new WebGLPrograms(_this, cubemaps, cubeuvmaps, extensions, capabilities, bindingStates, clipping);\n\t\t\tmaterials = new WebGLMaterials(properties);\n\t\t\trenderLists = new WebGLRenderLists(properties);\n\t\t\trenderStates = new WebGLRenderStates(extensions, capabilities);\n\t\t\tbackground = new WebGLBackground(_this, cubemaps, state, objects, _premultipliedAlpha);\n\t\t\tshadowMap = new WebGLShadowMap(_this, objects, capabilities);\n\t\t\tbufferRenderer = new WebGLBufferRenderer(_gl, extensions, info, capabilities);\n\t\t\tindexedBufferRenderer = new WebGLIndexedBufferRenderer(_gl, extensions, info, capabilities);\n\t\t\tinfo.programs = programCache.programs;\n\t\t\t_this.capabilities = capabilities;\n\t\t\t_this.extensions = extensions;\n\t\t\t_this.properties = properties;\n\t\t\t_this.renderLists = renderLists;\n\t\t\t_this.shadowMap = shadowMap;\n\t\t\t_this.state = state;\n\t\t\t_this.info = info;\n\t\t}\n\n\t\tinitGLContext();\n\t\tconst xr = typeof navigator !== 'undefined' && 'xr' in navigator ? new WebXRManager(_this, _gl) : new WebVRManager(_this);\n\t\tthis.xr = xr; // API\n\n\t\tthis.getContext = function () {\n\t\t\treturn _gl;\n\t\t};\n\n\t\tthis.getContextAttributes = function () {\n\t\t\treturn _gl.getContextAttributes();\n\t\t};\n\n\t\tthis.forceContextLoss = function () {\n\t\t\tconst extension = extensions.get('WEBGL_lose_context');\n\t\t\tif (extension) extension.loseContext();\n\t\t};\n\n\t\tthis.forceContextRestore = function () {\n\t\t\tconst extension = extensions.get('WEBGL_lose_context');\n\t\t\tif (extension) extension.restoreContext();\n\t\t};\n\n\t\tthis.getPixelRatio = function () {\n\t\t\treturn _pixelRatio;\n\t\t};\n\n\t\tthis.setPixelRatio = function (value) {\n\t\t\tif (value === undefined) return;\n\t\t\t_pixelRatio = value;\n\t\t\tthis.setSize(_width, _height, false);\n\t\t};\n\n\t\tthis.getSize = function (target) {\n\t\t\treturn target.set(_width, _height);\n\t\t};\n\n\t\tthis.setSize = function (width, height, updateStyle) {\n\t\t\tif (xr.isPresenting) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: Can\\'t change size while VR device is presenting.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_width = width;\n\t\t\t_height = height;\n\t\t\t_canvas.width = Math.floor(width * _pixelRatio);\n\t\t\t_canvas.height = Math.floor(height * _pixelRatio);\n\n\t\t\tif (updateStyle !== false) {\n\t\t\t\t_canvas.style.width = width + 'px';\n\t\t\t\t_canvas.style.height = height + 'px';\n\t\t\t}\n\n\t\t\tthis.setViewport(0, 0, width, height);\n\t\t};\n\n\t\tthis.getDrawingBufferSize = function (target) {\n\t\t\treturn target.set(_width * _pixelRatio, _height * _pixelRatio).floor();\n\t\t};\n\n\t\tthis.setDrawingBufferSize = function (width, height, pixelRatio) {\n\t\t\t_width = width;\n\t\t\t_height = height;\n\t\t\t_pixelRatio = pixelRatio;\n\t\t\t_canvas.width = Math.floor(width * pixelRatio);\n\t\t\t_canvas.height = Math.floor(height * pixelRatio);\n\t\t\tthis.setViewport(0, 0, width, height);\n\t\t};\n\n\t\tthis.getCurrentViewport = function (target) {\n\t\t\treturn target.copy(_currentViewport);\n\t\t};\n\n\t\tthis.getViewport = function (target) {\n\t\t\treturn target.copy(_viewport);\n\t\t};\n\n\t\tthis.setViewport = function (x, y, width, height) {\n\t\t\tif (x.isVector4) {\n\t\t\t\t_viewport.set(x.x, x.y, x.z, x.w);\n\t\t\t} else {\n\t\t\t\t_viewport.set(x, y, width, height);\n\t\t\t}\n\n\t\t\tstate.viewport(_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor());\n\t\t};\n\n\t\tthis.getScissor = function (target) {\n\t\t\treturn target.copy(_scissor);\n\t\t};\n\n\t\tthis.setScissor = function (x, y, width, height) {\n\t\t\tif (x.isVector4) {\n\t\t\t\t_scissor.set(x.x, x.y, x.z, x.w);\n\t\t\t} else {\n\t\t\t\t_scissor.set(x, y, width, height);\n\t\t\t}\n\n\t\t\tstate.scissor(_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor());\n\t\t};\n\n\t\tthis.getScissorTest = function () {\n\t\t\treturn _scissorTest;\n\t\t};\n\n\t\tthis.setScissorTest = function (boolean) {\n\t\t\tstate.setScissorTest(_scissorTest = boolean);\n\t\t};\n\n\t\tthis.setOpaqueSort = function (method) {\n\t\t\t_opaqueSort = method;\n\t\t};\n\n\t\tthis.setTransparentSort = function (method) {\n\t\t\t_transparentSort = method;\n\t\t}; // Clearing\n\n\n\t\tthis.getClearColor = function (target) {\n\t\t\treturn target.copy(background.getClearColor());\n\t\t};\n\n\t\tthis.setClearColor = function () {\n\t\t\tbackground.setClearColor.apply(background, arguments);\n\t\t};\n\n\t\tthis.getClearAlpha = function () {\n\t\t\treturn background.getClearAlpha();\n\t\t};\n\n\t\tthis.setClearAlpha = function () {\n\t\t\tbackground.setClearAlpha.apply(background, arguments);\n\t\t};\n\n\t\tthis.clear = function (color, depth, stencil) {\n\t\t\tlet bits = 0;\n\t\t\tif (color === undefined || color) bits |= _gl.COLOR_BUFFER_BIT;\n\t\t\tif (depth === undefined || depth) bits |= _gl.DEPTH_BUFFER_BIT;\n\t\t\tif (stencil === undefined || stencil) bits |= _gl.STENCIL_BUFFER_BIT;\n\n\t\t\t_gl.clear(bits);\n\t\t};\n\n\t\tthis.clearColor = function () {\n\t\t\tthis.clear(true, false, false);\n\t\t};\n\n\t\tthis.clearDepth = function () {\n\t\t\tthis.clear(false, true, false);\n\t\t};\n\n\t\tthis.clearStencil = function () {\n\t\t\tthis.clear(false, false, true);\n\t\t}; //\n\n\n\t\tthis.dispose = function () {\n\t\t\t_canvas.removeEventListener('webglcontextlost', onContextLost, false);\n\n\t\t\t_canvas.removeEventListener('webglcontextrestored', onContextRestore, false);\n\n\t\t\trenderLists.dispose();\n\t\t\trenderStates.dispose();\n\t\t\tproperties.dispose();\n\t\t\tcubemaps.dispose();\n\t\t\tcubeuvmaps.dispose();\n\t\t\tobjects.dispose();\n\t\t\tbindingStates.dispose();\n\t\t\txr.dispose();\n\t\t\txr.removeEventListener('sessionstart', onXRSessionStart);\n\t\t\txr.removeEventListener('sessionend', onXRSessionEnd);\n\n\t\t\tif (_transmissionRenderTarget) {\n\t\t\t\t_transmissionRenderTarget.dispose();\n\n\t\t\t\t_transmissionRenderTarget = null;\n\t\t\t}\n\n\t\t\tanimation.stop();\n\t\t}; // Events\n\n\n\t\tfunction onContextLost(event) {\n\t\t\tevent.preventDefault();\n\t\t\tconsole.log('THREE.WebGLRenderer: Context Lost.');\n\t\t\t_isContextLost = true;\n\t\t}\n\n\t\tfunction onContextRestore() {\n\t\t\tconsole.log('THREE.WebGLRenderer: Context Restored.');\n\t\t\t_isContextLost = false;\n\t\t\tconst infoAutoReset = info.autoReset;\n\t\t\tconst shadowMapEnabled = shadowMap.enabled;\n\t\t\tconst shadowMapAutoUpdate = shadowMap.autoUpdate;\n\t\t\tconst shadowMapNeedsUpdate = shadowMap.needsUpdate;\n\t\t\tconst shadowMapType = shadowMap.type;\n\t\t\tinitGLContext();\n\t\t\tinfo.autoReset = infoAutoReset;\n\t\t\tshadowMap.enabled = shadowMapEnabled;\n\t\t\tshadowMap.autoUpdate = shadowMapAutoUpdate;\n\t\t\tshadowMap.needsUpdate = shadowMapNeedsUpdate;\n\t\t\tshadowMap.type = shadowMapType;\n\t\t}\n\n\t\tfunction onMaterialDispose(event) {\n\t\t\tconst material = event.target;\n\t\t\tmaterial.removeEventListener('dispose', onMaterialDispose);\n\t\t\tdeallocateMaterial(material);\n\t\t} // Buffer deallocation\n\n\n\t\tfunction deallocateMaterial(material) {\n\t\t\treleaseMaterialProgramReferences(material);\n\t\t\tproperties.remove(material);\n\t\t}\n\n\t\tfunction releaseMaterialProgramReferences(material) {\n\t\t\tconst programs = properties.get(material).programs;\n\n\t\t\tif (programs !== undefined) {\n\t\t\t\tprograms.forEach(function (program) {\n\t\t\t\t\tprogramCache.releaseProgram(program);\n\t\t\t\t});\n\t\t\t}\n\t\t} // Buffer rendering\n\n\n\t\tfunction renderObjectImmediate(object, program) {\n\t\t\tobject.render(function (object) {\n\t\t\t\t_this.renderBufferImmediate(object, program);\n\t\t\t});\n\t\t}\n\n\t\tthis.renderBufferImmediate = function (object, program) {\n\t\t\tbindingStates.initAttributes();\n\t\t\tconst buffers = properties.get(object);\n\t\t\tif (object.hasPositions && !buffers.position) buffers.position = _gl.createBuffer();\n\t\t\tif (object.hasNormals && !buffers.normal) buffers.normal = _gl.createBuffer();\n\t\t\tif (object.hasUvs && !buffers.uv) buffers.uv = _gl.createBuffer();\n\t\t\tif (object.hasColors && !buffers.color) buffers.color = _gl.createBuffer();\n\t\t\tconst programAttributes = program.getAttributes();\n\n\t\t\tif (object.hasPositions) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.position);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.positionArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.position.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.position.location, 3, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tif (object.hasNormals) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.normal);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.normalArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.normal.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.normal.location, 3, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tif (object.hasUvs) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.uv);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.uvArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.uv.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.uv.location, 2, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tif (object.hasColors) {\n\t\t\t\t_gl.bindBuffer(_gl.ARRAY_BUFFER, buffers.color);\n\n\t\t\t\t_gl.bufferData(_gl.ARRAY_BUFFER, object.colorArray, _gl.DYNAMIC_DRAW);\n\n\t\t\t\tbindingStates.enableAttribute(programAttributes.color.location);\n\n\t\t\t\t_gl.vertexAttribPointer(programAttributes.color.location, 3, _gl.FLOAT, false, 0, 0);\n\t\t\t}\n\n\t\t\tbindingStates.disableUnusedAttributes();\n\n\t\t\t_gl.drawArrays(_gl.TRIANGLES, 0, object.count);\n\n\t\t\tobject.count = 0;\n\t\t};\n\n\t\tthis.renderBufferDirect = function (camera, scene, geometry, material, object, group) {\n\t\t\tif (scene === null) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)\n\n\t\t\tconst frontFaceCW = object.isMesh && object.matrixWorld.determinant() < 0;\n\t\t\tconst program = setProgram(camera, scene, geometry, material, object);\n\t\t\tstate.setMaterial(material, frontFaceCW); //\n\n\t\t\tlet index = geometry.index;\n\t\t\tconst position = geometry.attributes.position; //\n\n\t\t\tif (index === null) {\n\t\t\t\tif (position === undefined || position.count === 0) return;\n\t\t\t} else if (index.count === 0) {\n\t\t\t\treturn;\n\t\t\t} //\n\n\n\t\t\tlet rangeFactor = 1;\n\n\t\t\tif (material.wireframe === true) {\n\t\t\t\tindex = geometries.getWireframeAttribute(geometry);\n\t\t\t\trangeFactor = 2;\n\t\t\t}\n\n\t\t\tbindingStates.setup(object, material, program, geometry, index);\n\t\t\tlet attribute;\n\t\t\tlet renderer = bufferRenderer;\n\n\t\t\tif (index !== null) {\n\t\t\t\tattribute = attributes.get(index);\n\t\t\t\trenderer = indexedBufferRenderer;\n\t\t\t\trenderer.setIndex(attribute);\n\t\t\t} //\n\n\n\t\t\tconst dataCount = index !== null ? index.count : position.count;\n\t\t\tconst rangeStart = geometry.drawRange.start * rangeFactor;\n\t\t\tconst rangeCount = geometry.drawRange.count * rangeFactor;\n\t\t\tconst groupStart = group !== null ? group.start * rangeFactor : 0;\n\t\t\tconst groupCount = group !== null ? group.count * rangeFactor : Infinity;\n\t\t\tconst drawStart = Math.max(rangeStart, groupStart);\n\t\t\tconst drawEnd = Math.min(dataCount, rangeStart + rangeCount, groupStart + groupCount) - 1;\n\t\t\tconst drawCount = Math.max(0, drawEnd - drawStart + 1);\n\t\t\tif (drawCount === 0) return; //\n\n\t\t\tif (object.isMesh) {\n\t\t\t\tif (material.wireframe === true) {\n\t\t\t\t\tstate.setLineWidth(material.wireframeLinewidth * getTargetPixelRatio());\n\t\t\t\t\trenderer.setMode(_gl.LINES);\n\t\t\t\t} else {\n\t\t\t\t\trenderer.setMode(_gl.TRIANGLES);\n\t\t\t\t}\n\t\t\t} else if (object.isLine) {\n\t\t\t\tlet lineWidth = material.linewidth;\n\t\t\t\tif (lineWidth === undefined) lineWidth = 1; // Not using Line*Material\n\n\t\t\t\tstate.setLineWidth(lineWidth * getTargetPixelRatio());\n\n\t\t\t\tif (object.isLineSegments) {\n\t\t\t\t\trenderer.setMode(_gl.LINES);\n\t\t\t\t} else if (object.isLineLoop) {\n\t\t\t\t\trenderer.setMode(_gl.LINE_LOOP);\n\t\t\t\t} else {\n\t\t\t\t\trenderer.setMode(_gl.LINE_STRIP);\n\t\t\t\t}\n\t\t\t} else if (object.isPoints) {\n\t\t\t\trenderer.setMode(_gl.POINTS);\n\t\t\t} else if (object.isSprite) {\n\t\t\t\trenderer.setMode(_gl.TRIANGLES);\n\t\t\t}\n\n\t\t\tif (object.isInstancedMesh) {\n\t\t\t\trenderer.renderInstances(drawStart, drawCount, object.count);\n\t\t\t} else if (geometry.isInstancedBufferGeometry) {\n\t\t\t\tconst instanceCount = Math.min(geometry.instanceCount, geometry._maxInstanceCount);\n\t\t\t\trenderer.renderInstances(drawStart, drawCount, instanceCount);\n\t\t\t} else {\n\t\t\t\trenderer.render(drawStart, drawCount);\n\t\t\t}\n\t\t}; // Compile\n\n\n\t\tthis.compile = function (scene, camera) {\n\t\t\tcurrentRenderState = renderStates.get(scene);\n\t\t\tcurrentRenderState.init();\n\t\t\trenderStateStack.push(currentRenderState);\n\t\t\tscene.traverseVisible(function (object) {\n\t\t\t\tif (object.isLight && object.layers.test(camera.layers)) {\n\t\t\t\t\tcurrentRenderState.pushLight(object);\n\n\t\t\t\t\tif (object.castShadow) {\n\t\t\t\t\t\tcurrentRenderState.pushShadow(object);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tcurrentRenderState.setupLights(_this.physicallyCorrectLights);\n\t\t\tscene.traverse(function (object) {\n\t\t\t\tconst material = object.material;\n\n\t\t\t\tif (material) {\n\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\tfor (let i = 0; i < material.length; i++) {\n\t\t\t\t\t\t\tconst material2 = material[i];\n\t\t\t\t\t\t\tgetProgram(material2, scene, object);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tgetProgram(material, scene, object);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\trenderStateStack.pop();\n\t\t\tcurrentRenderState = null;\n\t\t}; // Animation Loop\n\n\n\t\tlet onAnimationFrameCallback = null;\n\n\t\tfunction onAnimationFrame(time) {\n\t\t\tif (onAnimationFrameCallback) onAnimationFrameCallback(time);\n\t\t}\n\n\t\tfunction onXRSessionStart() {\n\t\t\tanimation.stop();\n\t\t}\n\n\t\tfunction onXRSessionEnd() {\n\t\t\tanimation.start();\n\t\t}\n\n\t\tconst animation = new WebGLAnimation();\n\t\tanimation.setAnimationLoop(onAnimationFrame);\n\t\tif (typeof window !== 'undefined') animation.setContext(window);\n\n\t\tthis.setAnimationLoop = function (callback) {\n\t\t\tonAnimationFrameCallback = callback;\n\t\t\txr.setAnimationLoop(callback);\n\t\t\tcallback === null ? animation.stop() : animation.start();\n\t\t};\n\n\t\txr.addEventListener('sessionstart', onXRSessionStart);\n\t\txr.addEventListener('sessionend', onXRSessionEnd); // Rendering\n\n\t\tthis.render = function (scene, camera) {\n\t\t\tif (camera !== undefined && camera.isCamera !== true) {\n\t\t\t\tconsole.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_isContextLost === true) return; // update scene graph\n\n\t\t\tif (scene.autoUpdate === true) scene.updateMatrixWorld(); // update camera matrices and frustum\n\n\t\t\tif (camera.parent === null) camera.updateMatrixWorld();\n\n\t\t\tif (xr.enabled === true && xr.isPresenting === true) {\n\t\t\t\tif (xr.cameraAutoUpdate === true) xr.updateCamera(camera);\n\t\t\t\tcamera = xr.getCamera(); // use XR camera for rendering\n\t\t\t} //\n\n\n\t\t\tif (scene.isScene === true) scene.onBeforeRender(_this, scene, camera, _currentRenderTarget);\n\t\t\tcurrentRenderState = renderStates.get(scene, renderStateStack.length);\n\t\t\tcurrentRenderState.init();\n\t\t\trenderStateStack.push(currentRenderState);\n\n\t\t\t_projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\n\t\t\t_frustum.setFromProjectionMatrix(_projScreenMatrix);\n\n\t\t\t_localClippingEnabled = this.localClippingEnabled;\n\t\t\t_clippingEnabled = clipping.init(this.clippingPlanes, _localClippingEnabled, camera);\n\t\t\tcurrentRenderList = renderLists.get(scene, renderListStack.length);\n\t\t\tcurrentRenderList.init();\n\t\t\trenderListStack.push(currentRenderList);\n\t\t\tprojectObject(scene, camera, 0, _this.sortObjects);\n\t\t\tcurrentRenderList.finish();\n\n\t\t\tif (_this.sortObjects === true) {\n\t\t\t\tcurrentRenderList.sort(_opaqueSort, _transparentSort);\n\t\t\t} //\n\n\n\t\t\tif (_clippingEnabled === true) clipping.beginShadows();\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\t\t\tshadowMap.render(shadowsArray, scene, camera);\n\t\t\tif (_clippingEnabled === true) clipping.endShadows(); //\n\n\t\t\tif (this.info.autoReset === true) this.info.reset(); //\n\n\t\t\tbackground.render(currentRenderList, scene); // render scene\n\n\t\t\tcurrentRenderState.setupLights(_this.physicallyCorrectLights);\n\n\t\t\tif (camera.isArrayCamera) {\n\t\t\t\tconst cameras = camera.cameras;\n\n\t\t\t\tfor (let i = 0, l = cameras.length; i < l; i++) {\n\t\t\t\t\tconst camera2 = cameras[i];\n\t\t\t\t\trenderScene(currentRenderList, scene, camera2, camera2.viewport);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\trenderScene(currentRenderList, scene, camera);\n\t\t\t} //\n\n\n\t\t\tif (_currentRenderTarget !== null) {\n\t\t\t\t// resolve multisample renderbuffers to a single-sample texture if necessary\n\t\t\t\ttextures.updateMultisampleRenderTarget(_currentRenderTarget); // Generate mipmap if we're using any kind of mipmap filtering\n\n\t\t\t\ttextures.updateRenderTargetMipmap(_currentRenderTarget);\n\t\t\t} //\n\n\n\t\t\tif (scene.isScene === true) scene.onAfterRender(_this, scene, camera); // Ensure depth buffer writing is enabled so it can be cleared on next render\n\n\t\t\tstate.buffers.depth.setTest(true);\n\t\t\tstate.buffers.depth.setMask(true);\n\t\t\tstate.buffers.color.setMask(true);\n\t\t\tstate.setPolygonOffset(false);\n\n\t\t\tif (xr.enabled && xr.submitFrame) {\n\t\t\t\txr.submitFrame();\n\t\t\t} // _gl.finish();\n\n\n\t\t\tbindingStates.resetDefaultState();\n\t\t\t_currentMaterialId = -1;\n\t\t\t_currentCamera = null;\n\t\t\trenderStateStack.pop();\n\n\t\t\tif (renderStateStack.length > 0) {\n\t\t\t\tcurrentRenderState = renderStateStack[renderStateStack.length - 1];\n\t\t\t} else {\n\t\t\t\tcurrentRenderState = null;\n\t\t\t}\n\n\t\t\trenderListStack.pop();\n\n\t\t\tif (renderListStack.length > 0) {\n\t\t\t\tcurrentRenderList = renderListStack[renderListStack.length - 1];\n\t\t\t} else {\n\t\t\t\tcurrentRenderList = null;\n\t\t\t}\n\t\t};\n\n\t\tfunction projectObject(object, camera, groupOrder, sortObjects) {\n\t\t\tif (object.visible === false) return;\n\t\t\tconst visible = object.layers.test(camera.layers);\n\n\t\t\tif (visible) {\n\t\t\t\tif (object.isGroup) {\n\t\t\t\t\tgroupOrder = object.renderOrder;\n\t\t\t\t} else if (object.isLOD) {\n\t\t\t\t\tif (object.autoUpdate === true) object.update(camera);\n\t\t\t\t} else if (object.isLight) {\n\t\t\t\t\tcurrentRenderState.pushLight(object);\n\n\t\t\t\t\tif (object.castShadow) {\n\t\t\t\t\t\tcurrentRenderState.pushShadow(object);\n\t\t\t\t\t}\n\t\t\t\t} else if (object.isSprite) {\n\t\t\t\t\tif (!object.frustumCulled || _frustum.intersectsSprite(object)) {\n\t\t\t\t\t\tif (sortObjects) {\n\t\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update(object);\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif (material.visible) {\n\t\t\t\t\t\t\tcurrentRenderList.push(object, geometry, material, groupOrder, _vector3.z, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else if (object.isImmediateRenderObject) {\n\t\t\t\t\tif (sortObjects) {\n\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);\n\t\t\t\t\t}\n\n\t\t\t\t\tcurrentRenderList.push(object, null, object.material, groupOrder, _vector3.z, null);\n\t\t\t\t} else if (object.isMesh || object.isLine || object.isPoints) {\n\t\t\t\t\tif (object.isSkinnedMesh) {\n\t\t\t\t\t\t// update skeleton only once in a frame\n\t\t\t\t\t\tif (object.skeleton.frame !== info.render.frame) {\n\t\t\t\t\t\t\tobject.skeleton.update();\n\t\t\t\t\t\t\tobject.skeleton.frame = info.render.frame;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!object.frustumCulled || _frustum.intersectsObject(object)) {\n\t\t\t\t\t\tif (sortObjects) {\n\t\t\t\t\t\t\t_vector3.setFromMatrixPosition(object.matrixWorld).applyMatrix4(_projScreenMatrix);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst geometry = objects.update(object);\n\t\t\t\t\t\tconst material = object.material;\n\n\t\t\t\t\t\tif (Array.isArray(material)) {\n\t\t\t\t\t\t\tconst groups = geometry.groups;\n\n\t\t\t\t\t\t\tfor (let i = 0, l = groups.length; i < l; i++) {\n\t\t\t\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\t\t\t\tconst groupMaterial = material[group.materialIndex];\n\n\t\t\t\t\t\t\t\tif (groupMaterial && groupMaterial.visible) {\n\t\t\t\t\t\t\t\t\tcurrentRenderList.push(object, geometry, groupMaterial, groupOrder, _vector3.z, group);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (material.visible) {\n\t\t\t\t\t\t\tcurrentRenderList.push(object, geometry, material, groupOrder, _vector3.z, null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tprojectObject(children[i], camera, groupOrder, sortObjects);\n\t\t\t}\n\t\t}\n\n\t\tfunction renderScene(currentRenderList, scene, camera, viewport) {\n\t\t\tconst opaqueObjects = currentRenderList.opaque;\n\t\t\tconst transmissiveObjects = currentRenderList.transmissive;\n\t\t\tconst transparentObjects = currentRenderList.transparent;\n\t\t\tcurrentRenderState.setupLightsView(camera);\n\t\t\tif (transmissiveObjects.length > 0) renderTransmissionPass(opaqueObjects, scene, camera);\n\t\t\tif (viewport) state.viewport(_currentViewport.copy(viewport));\n\t\t\tif (opaqueObjects.length > 0) renderObjects(opaqueObjects, scene, camera);\n\t\t\tif (transmissiveObjects.length > 0) renderObjects(transmissiveObjects, scene, camera);\n\t\t\tif (transparentObjects.length > 0) renderObjects(transparentObjects, scene, camera);\n\t\t}\n\n\t\tfunction renderTransmissionPass(opaqueObjects, scene, camera) {\n\t\t\tif (_transmissionRenderTarget === null) {\n\t\t\t\tconst needsAntialias = _antialias === true && capabilities.isWebGL2 === true;\n\t\t\t\tconst renderTargetType = needsAntialias ? WebGLMultisampleRenderTarget : WebGLRenderTarget;\n\t\t\t\t_transmissionRenderTarget = new renderTargetType(1024, 1024, {\n\t\t\t\t\tgenerateMipmaps: true,\n\t\t\t\t\ttype: utils.convert(HalfFloatType) !== null ? HalfFloatType : UnsignedByteType,\n\t\t\t\t\tminFilter: LinearMipmapLinearFilter,\n\t\t\t\t\tmagFilter: NearestFilter,\n\t\t\t\t\twrapS: ClampToEdgeWrapping,\n\t\t\t\t\twrapT: ClampToEdgeWrapping\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst currentRenderTarget = _this.getRenderTarget();\n\n\t\t\t_this.setRenderTarget(_transmissionRenderTarget);\n\n\t\t\t_this.clear(); // Turn off the features which can affect the frag color for opaque objects pass.\n\t\t\t// Otherwise they are applied twice in opaque objects pass and transmission objects pass.\n\n\n\t\t\tconst currentToneMapping = _this.toneMapping;\n\t\t\t_this.toneMapping = NoToneMapping;\n\t\t\trenderObjects(opaqueObjects, scene, camera);\n\t\t\t_this.toneMapping = currentToneMapping;\n\t\t\ttextures.updateMultisampleRenderTarget(_transmissionRenderTarget);\n\t\t\ttextures.updateRenderTargetMipmap(_transmissionRenderTarget);\n\n\t\t\t_this.setRenderTarget(currentRenderTarget);\n\t\t}\n\n\t\tfunction renderObjects(renderList, scene, camera) {\n\t\t\tconst overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;\n\n\t\t\tfor (let i = 0, l = renderList.length; i < l; i++) {\n\t\t\t\tconst renderItem = renderList[i];\n\t\t\t\tconst object = renderItem.object;\n\t\t\t\tconst geometry = renderItem.geometry;\n\t\t\t\tconst material = overrideMaterial === null ? renderItem.material : overrideMaterial;\n\t\t\t\tconst group = renderItem.group;\n\n\t\t\t\tif (object.layers.test(camera.layers)) {\n\t\t\t\t\trenderObject(object, scene, camera, geometry, material, group);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction renderObject(object, scene, camera, geometry, material, group) {\n\t\t\tobject.onBeforeRender(_this, scene, camera, geometry, material, group);\n\t\t\tobject.modelViewMatrix.multiplyMatrices(camera.matrixWorldInverse, object.matrixWorld);\n\t\t\tobject.normalMatrix.getNormalMatrix(object.modelViewMatrix);\n\t\t\tmaterial.onBeforeRender(_this, scene, camera, geometry, object, group);\n\n\t\t\tif (object.isImmediateRenderObject) {\n\t\t\t\tconst program = setProgram(camera, scene, geometry, material, object);\n\t\t\t\tstate.setMaterial(material);\n\t\t\t\tbindingStates.reset();\n\t\t\t\trenderObjectImmediate(object, program);\n\t\t\t} else {\n\t\t\t\tif (material.transparent === true && material.side === DoubleSide) {\n\t\t\t\t\tmaterial.side = BackSide;\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t_this.renderBufferDirect(camera, scene, geometry, material, object, group);\n\n\t\t\t\t\tmaterial.side = FrontSide;\n\t\t\t\t\tmaterial.needsUpdate = true;\n\n\t\t\t\t\t_this.renderBufferDirect(camera, scene, geometry, material, object, group);\n\n\t\t\t\t\tmaterial.side = DoubleSide;\n\t\t\t\t} else {\n\t\t\t\t\t_this.renderBufferDirect(camera, scene, geometry, material, object, group);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tobject.onAfterRender(_this, scene, camera, geometry, material, group);\n\t\t}\n\n\t\tfunction getProgram(material, scene, object) {\n\t\t\tif (scene.isScene !== true) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\tconst materialProperties = properties.get(material);\n\t\t\tconst lights = currentRenderState.state.lights;\n\t\t\tconst shadowsArray = currentRenderState.state.shadowsArray;\n\t\t\tconst lightsStateVersion = lights.state.version;\n\t\t\tconst parameters = programCache.getParameters(material, lights.state, shadowsArray, scene, object);\n\t\t\tconst programCacheKey = programCache.getProgramCacheKey(parameters);\n\t\t\tlet programs = materialProperties.programs; // always update environment and fog - changing these trigger an getProgram call, but it's possible that the program doesn't change\n\n\t\t\tmaterialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tmaterialProperties.fog = scene.fog;\n\t\t\tmaterialProperties.envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || materialProperties.environment);\n\n\t\t\tif (programs === undefined) {\n\t\t\t\t// new material\n\t\t\t\tmaterial.addEventListener('dispose', onMaterialDispose);\n\t\t\t\tprograms = new Map();\n\t\t\t\tmaterialProperties.programs = programs;\n\t\t\t}\n\n\t\t\tlet program = programs.get(programCacheKey);\n\n\t\t\tif (program !== undefined) {\n\t\t\t\t// early out if program and light state is identical\n\t\t\t\tif (materialProperties.currentProgram === program && materialProperties.lightsStateVersion === lightsStateVersion) {\n\t\t\t\t\tupdateCommonMaterialProperties(material, parameters);\n\t\t\t\t\treturn program;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tparameters.uniforms = programCache.getUniforms(material);\n\t\t\t\tmaterial.onBuild(parameters, _this);\n\t\t\t\tmaterial.onBeforeCompile(parameters, _this);\n\t\t\t\tprogram = programCache.acquireProgram(parameters, programCacheKey);\n\t\t\t\tprograms.set(programCacheKey, program);\n\t\t\t\tmaterialProperties.uniforms = parameters.uniforms;\n\t\t\t}\n\n\t\t\tconst uniforms = materialProperties.uniforms;\n\n\t\t\tif (!material.isShaderMaterial && !material.isRawShaderMaterial || material.clipping === true) {\n\t\t\t\tuniforms.clippingPlanes = clipping.uniform;\n\t\t\t}\n\n\t\t\tupdateCommonMaterialProperties(material, parameters); // store the light setup it was created for\n\n\t\t\tmaterialProperties.needsLights = materialNeedsLights(material);\n\t\t\tmaterialProperties.lightsStateVersion = lightsStateVersion;\n\n\t\t\tif (materialProperties.needsLights) {\n\t\t\t\t// wire up the material to this renderer's lighting state\n\t\t\t\tuniforms.ambientLightColor.value = lights.state.ambient;\n\t\t\t\tuniforms.lightProbe.value = lights.state.probe;\n\t\t\t\tuniforms.directionalLights.value = lights.state.directional;\n\t\t\t\tuniforms.directionalLightShadows.value = lights.state.directionalShadow;\n\t\t\t\tuniforms.spotLights.value = lights.state.spot;\n\t\t\t\tuniforms.spotLightShadows.value = lights.state.spotShadow;\n\t\t\t\tuniforms.rectAreaLights.value = lights.state.rectArea;\n\t\t\t\tuniforms.ltc_1.value = lights.state.rectAreaLTC1;\n\t\t\t\tuniforms.ltc_2.value = lights.state.rectAreaLTC2;\n\t\t\t\tuniforms.pointLights.value = lights.state.point;\n\t\t\t\tuniforms.pointLightShadows.value = lights.state.pointShadow;\n\t\t\t\tuniforms.hemisphereLights.value = lights.state.hemi;\n\t\t\t\tuniforms.directionalShadowMap.value = lights.state.directionalShadowMap;\n\t\t\t\tuniforms.directionalShadowMatrix.value = lights.state.directionalShadowMatrix;\n\t\t\t\tuniforms.spotShadowMap.value = lights.state.spotShadowMap;\n\t\t\t\tuniforms.spotShadowMatrix.value = lights.state.spotShadowMatrix;\n\t\t\t\tuniforms.pointShadowMap.value = lights.state.pointShadowMap;\n\t\t\t\tuniforms.pointShadowMatrix.value = lights.state.pointShadowMatrix; // TODO (abelnation): add area lights shadow info to uniforms\n\t\t\t}\n\n\t\t\tconst progUniforms = program.getUniforms();\n\t\t\tconst uniformsList = WebGLUniforms.seqWithValue(progUniforms.seq, uniforms);\n\t\t\tmaterialProperties.currentProgram = program;\n\t\t\tmaterialProperties.uniformsList = uniformsList;\n\t\t\treturn program;\n\t\t}\n\n\t\tfunction updateCommonMaterialProperties(material, parameters) {\n\t\t\tconst materialProperties = properties.get(material);\n\t\t\tmaterialProperties.outputEncoding = parameters.outputEncoding;\n\t\t\tmaterialProperties.instancing = parameters.instancing;\n\t\t\tmaterialProperties.skinning = parameters.skinning;\n\t\t\tmaterialProperties.morphTargets = parameters.morphTargets;\n\t\t\tmaterialProperties.morphNormals = parameters.morphNormals;\n\t\t\tmaterialProperties.morphTargetsCount = parameters.morphTargetsCount;\n\t\t\tmaterialProperties.numClippingPlanes = parameters.numClippingPlanes;\n\t\t\tmaterialProperties.numIntersection = parameters.numClipIntersection;\n\t\t\tmaterialProperties.vertexAlphas = parameters.vertexAlphas;\n\t\t\tmaterialProperties.vertexTangents = parameters.vertexTangents;\n\t\t}\n\n\t\tfunction setProgram(camera, scene, geometry, material, object) {\n\t\t\tif (scene.isScene !== true) scene = _emptyScene; // scene could be a Mesh, Line, Points, ...\n\n\t\t\ttextures.resetTextureUnits();\n\t\t\tconst fog = scene.fog;\n\t\t\tconst environment = material.isMeshStandardMaterial ? scene.environment : null;\n\t\t\tconst encoding = _currentRenderTarget === null ? _this.outputEncoding : _currentRenderTarget.texture.encoding;\n\t\t\tconst envMap = (material.isMeshStandardMaterial ? cubeuvmaps : cubemaps).get(material.envMap || environment);\n\t\t\tconst vertexAlphas = material.vertexColors === true && !!geometry && !!geometry.attributes.color && geometry.attributes.color.itemSize === 4;\n\t\t\tconst vertexTangents = !!material.normalMap && !!geometry && !!geometry.attributes.tangent;\n\t\t\tconst morphTargets = !!geometry && !!geometry.morphAttributes.position;\n\t\t\tconst morphNormals = !!geometry && !!geometry.morphAttributes.normal;\n\t\t\tconst morphTargetsCount = !!geometry && !!geometry.morphAttributes.position ? geometry.morphAttributes.position.length : 0;\n\t\t\tconst materialProperties = properties.get(material);\n\t\t\tconst lights = currentRenderState.state.lights;\n\n\t\t\tif (_clippingEnabled === true) {\n\t\t\t\tif (_localClippingEnabled === true || camera !== _currentCamera) {\n\t\t\t\t\tconst useCache = camera === _currentCamera && material.id === _currentMaterialId; // we might want to call this function with some ClippingGroup\n\t\t\t\t\t// object instead of the material, once it becomes feasible\n\t\t\t\t\t// (#8465, #8379)\n\n\t\t\t\t\tclipping.setState(material, camera, useCache);\n\t\t\t\t}\n\t\t\t} //\n\n\n\t\t\tlet needsProgramChange = false;\n\n\t\t\tif (material.version === materialProperties.__version) {\n\t\t\t\tif (materialProperties.needsLights && materialProperties.lightsStateVersion !== lights.state.version) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.outputEncoding !== encoding) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (object.isInstancedMesh && materialProperties.instancing === false) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (!object.isInstancedMesh && materialProperties.instancing === true) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (object.isSkinnedMesh && materialProperties.skinning === false) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (!object.isSkinnedMesh && materialProperties.skinning === true) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.envMap !== envMap) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (material.fog && materialProperties.fog !== fog) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.numClippingPlanes !== undefined && (materialProperties.numClippingPlanes !== clipping.numPlanes || materialProperties.numIntersection !== clipping.numIntersection)) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.vertexAlphas !== vertexAlphas) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.vertexTangents !== vertexTangents) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.morphTargets !== morphTargets) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (materialProperties.morphNormals !== morphNormals) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t} else if (capabilities.isWebGL2 === true && materialProperties.morphTargetsCount !== morphTargetsCount) {\n\t\t\t\t\tneedsProgramChange = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tneedsProgramChange = true;\n\t\t\t\tmaterialProperties.__version = material.version;\n\t\t\t} //\n\n\n\t\t\tlet program = materialProperties.currentProgram;\n\n\t\t\tif (needsProgramChange === true) {\n\t\t\t\tprogram = getProgram(material, scene, object);\n\t\t\t}\n\n\t\t\tlet refreshProgram = false;\n\t\t\tlet refreshMaterial = false;\n\t\t\tlet refreshLights = false;\n\t\t\tconst p_uniforms = program.getUniforms(),\n\t\t\t\t\t\tm_uniforms = materialProperties.uniforms;\n\n\t\t\tif (state.useProgram(program.program)) {\n\t\t\t\trefreshProgram = true;\n\t\t\t\trefreshMaterial = true;\n\t\t\t\trefreshLights = true;\n\t\t\t}\n\n\t\t\tif (material.id !== _currentMaterialId) {\n\t\t\t\t_currentMaterialId = material.id;\n\t\t\t\trefreshMaterial = true;\n\t\t\t}\n\n\t\t\tif (refreshProgram || _currentCamera !== camera) {\n\t\t\t\tp_uniforms.setValue(_gl, 'projectionMatrix', camera.projectionMatrix);\n\n\t\t\t\tif (capabilities.logarithmicDepthBuffer) {\n\t\t\t\t\tp_uniforms.setValue(_gl, 'logDepthBufFC', 2.0 / (Math.log(camera.far + 1.0) / Math.LN2));\n\t\t\t\t}\n\n\t\t\t\tif (_currentCamera !== camera) {\n\t\t\t\t\t_currentCamera = camera; // lighting uniforms depend on the camera so enforce an update\n\t\t\t\t\t// now, in case this material supports lights - or later, when\n\t\t\t\t\t// the next material that does gets activated:\n\n\t\t\t\t\trefreshMaterial = true; // set to true on material change\n\n\t\t\t\t\trefreshLights = true; // remains set until update done\n\t\t\t\t} // load material specific uniforms\n\t\t\t\t// (shader material also gets them for the sake of genericity)\n\n\n\t\t\t\tif (material.isShaderMaterial || material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshStandardMaterial || material.envMap) {\n\t\t\t\t\tconst uCamPos = p_uniforms.map.cameraPosition;\n\n\t\t\t\t\tif (uCamPos !== undefined) {\n\t\t\t\t\t\tuCamPos.setValue(_gl, _vector3.setFromMatrixPosition(camera.matrixWorld));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial) {\n\t\t\t\t\tp_uniforms.setValue(_gl, 'isOrthographic', camera.isOrthographicCamera === true);\n\t\t\t\t}\n\n\t\t\t\tif (material.isMeshPhongMaterial || material.isMeshToonMaterial || material.isMeshLambertMaterial || material.isMeshBasicMaterial || material.isMeshStandardMaterial || material.isShaderMaterial || material.isShadowMaterial || object.isSkinnedMesh) {\n\t\t\t\t\tp_uniforms.setValue(_gl, 'viewMatrix', camera.matrixWorldInverse);\n\t\t\t\t}\n\t\t\t} // skinning and morph target uniforms must be set even if material didn't change\n\t\t\t// auto-setting of texture unit for bone and morph texture must go before other textures\n\t\t\t// otherwise textures used for skinning and morphing can take over texture units reserved for other material textures\n\n\n\t\t\tif (object.isSkinnedMesh) {\n\t\t\t\tp_uniforms.setOptional(_gl, object, 'bindMatrix');\n\t\t\t\tp_uniforms.setOptional(_gl, object, 'bindMatrixInverse');\n\t\t\t\tconst skeleton = object.skeleton;\n\n\t\t\t\tif (skeleton) {\n\t\t\t\t\tif (capabilities.floatVertexTextures) {\n\t\t\t\t\t\tif (skeleton.boneTexture === null) skeleton.computeBoneTexture();\n\t\t\t\t\t\tp_uniforms.setValue(_gl, 'boneTexture', skeleton.boneTexture, textures);\n\t\t\t\t\t\tp_uniforms.setValue(_gl, 'boneTextureSize', skeleton.boneTextureSize);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tp_uniforms.setOptional(_gl, skeleton, 'boneMatrices');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!!geometry && (geometry.morphAttributes.position !== undefined || geometry.morphAttributes.normal !== undefined)) {\n\t\t\t\tmorphtargets.update(object, geometry, material, program);\n\t\t\t}\n\n\t\t\tif (refreshMaterial || materialProperties.receiveShadow !== object.receiveShadow) {\n\t\t\t\tmaterialProperties.receiveShadow = object.receiveShadow;\n\t\t\t\tp_uniforms.setValue(_gl, 'receiveShadow', object.receiveShadow);\n\t\t\t}\n\n\t\t\tif (refreshMaterial) {\n\t\t\t\tp_uniforms.setValue(_gl, 'toneMappingExposure', _this.toneMappingExposure);\n\n\t\t\t\tif (materialProperties.needsLights) {\n\t\t\t\t\t// the current material requires lighting info\n\t\t\t\t\t// note: all lighting uniforms are always set correctly\n\t\t\t\t\t// they simply reference the renderer's state for their\n\t\t\t\t\t// values\n\t\t\t\t\t//\n\t\t\t\t\t// use the current material's .needsUpdate flags to set\n\t\t\t\t\t// the GL state when required\n\t\t\t\t\tmarkUniformsLightsNeedsUpdate(m_uniforms, refreshLights);\n\t\t\t\t} // refresh uniforms common to several materials\n\n\n\t\t\t\tif (fog && material.fog) {\n\t\t\t\t\tmaterials.refreshFogUniforms(m_uniforms, fog);\n\t\t\t\t}\n\n\t\t\t\tmaterials.refreshMaterialUniforms(m_uniforms, material, _pixelRatio, _height, _transmissionRenderTarget);\n\t\t\t\tWebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures);\n\t\t\t}\n\n\t\t\tif (material.isShaderMaterial && material.uniformsNeedUpdate === true) {\n\t\t\t\tWebGLUniforms.upload(_gl, materialProperties.uniformsList, m_uniforms, textures);\n\t\t\t\tmaterial.uniformsNeedUpdate = false;\n\t\t\t}\n\n\t\t\tif (material.isSpriteMaterial) {\n\t\t\t\tp_uniforms.setValue(_gl, 'center', object.center);\n\t\t\t} // common matrices\n\n\n\t\t\tp_uniforms.setValue(_gl, 'modelViewMatrix', object.modelViewMatrix);\n\t\t\tp_uniforms.setValue(_gl, 'normalMatrix', object.normalMatrix);\n\t\t\tp_uniforms.setValue(_gl, 'modelMatrix', object.matrixWorld);\n\t\t\treturn program;\n\t\t} // If uniforms are marked as clean, they don't need to be loaded to the GPU.\n\n\n\t\tfunction markUniformsLightsNeedsUpdate(uniforms, value) {\n\t\t\tuniforms.ambientLightColor.needsUpdate = value;\n\t\t\tuniforms.lightProbe.needsUpdate = value;\n\t\t\tuniforms.directionalLights.needsUpdate = value;\n\t\t\tuniforms.directionalLightShadows.needsUpdate = value;\n\t\t\tuniforms.pointLights.needsUpdate = value;\n\t\t\tuniforms.pointLightShadows.needsUpdate = value;\n\t\t\tuniforms.spotLights.needsUpdate = value;\n\t\t\tuniforms.spotLightShadows.needsUpdate = value;\n\t\t\tuniforms.rectAreaLights.needsUpdate = value;\n\t\t\tuniforms.hemisphereLights.needsUpdate = value;\n\t\t}\n\n\t\tfunction materialNeedsLights(material) {\n\t\t\treturn material.isMeshLambertMaterial || material.isMeshToonMaterial || material.isMeshPhongMaterial || material.isMeshStandardMaterial || material.isShadowMaterial || material.isShaderMaterial && material.lights === true;\n\t\t}\n\n\t\tthis.setTexture2D = function () {\n\t\t\tvar warned = false; // backwards compatibility: peel texture.texture\n\n\t\t\treturn function setTexture2D(texture, slot) {\n\t\t\t\tif (texture && texture.isWebGLRenderTarget) {\n\t\t\t\t\tif (!warned) {\n\t\t\t\t\t\tconsole.warn(\"THREE.WebGLRenderer.setTexture2D: don't use render targets as textures. Use their .texture property instead.\");\n\t\t\t\t\t\twarned = true;\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture = texture.texture;\n\t\t\t\t}\n\n\t\t\t\ttextures.setTexture2D(texture, slot);\n\t\t\t};\n\t\t}();\n\n\t\tthis.getActiveCubeFace = function () {\n\t\t\treturn _currentActiveCubeFace;\n\t\t};\n\n\t\tthis.getActiveMipmapLevel = function () {\n\t\t\treturn _currentActiveMipmapLevel;\n\t\t};\n\n\t\tthis.getRenderTarget = function () {\n\t\t\treturn _currentRenderTarget;\n\t\t};\n\n\t\tthis.setRenderTarget = function (renderTarget, activeCubeFace = 0, activeMipmapLevel = 0) {\n\t\t\t_currentRenderTarget = renderTarget;\n\t\t\t_currentActiveCubeFace = activeCubeFace;\n\t\t\t_currentActiveMipmapLevel = activeMipmapLevel;\n\n\t\t\tif (renderTarget && properties.get(renderTarget).__webglFramebuffer === undefined) {\n\t\t\t\ttextures.setupRenderTarget(renderTarget);\n\t\t\t}\n\n\t\t\tlet framebuffer = null;\n\t\t\tlet isCube = false;\n\t\t\tlet isRenderTarget3D = false;\n\n\t\t\tif (renderTarget) {\n\t\t\t\tconst texture = renderTarget.texture;\n\n\t\t\t\tif (texture.isDataTexture3D || texture.isDataTexture2DArray) {\n\t\t\t\t\tisRenderTarget3D = true;\n\t\t\t\t}\n\n\t\t\t\tconst __webglFramebuffer = properties.get(renderTarget).__webglFramebuffer;\n\n\t\t\t\tif (renderTarget.isWebGLCubeRenderTarget) {\n\t\t\t\t\tframebuffer = __webglFramebuffer[activeCubeFace];\n\t\t\t\t\tisCube = true;\n\t\t\t\t} else if (renderTarget.isWebGLMultisampleRenderTarget) {\n\t\t\t\t\tframebuffer = properties.get(renderTarget).__webglMultisampledFramebuffer;\n\t\t\t\t} else {\n\t\t\t\t\tframebuffer = __webglFramebuffer;\n\t\t\t\t}\n\n\t\t\t\t_currentViewport.copy(renderTarget.viewport);\n\n\t\t\t\t_currentScissor.copy(renderTarget.scissor);\n\n\t\t\t\t_currentScissorTest = renderTarget.scissorTest;\n\t\t\t} else {\n\t\t\t\t_currentViewport.copy(_viewport).multiplyScalar(_pixelRatio).floor();\n\n\t\t\t\t_currentScissor.copy(_scissor).multiplyScalar(_pixelRatio).floor();\n\n\t\t\t\t_currentScissorTest = _scissorTest;\n\t\t\t}\n\n\t\t\tconst framebufferBound = state.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\tif (framebufferBound && capabilities.drawBuffers) {\n\t\t\t\tlet needsUpdate = false;\n\n\t\t\t\tif (renderTarget) {\n\t\t\t\t\tif (renderTarget.isWebGLMultipleRenderTargets) {\n\t\t\t\t\t\tconst textures = renderTarget.texture;\n\n\t\t\t\t\t\tif (_currentDrawBuffers.length !== textures.length || _currentDrawBuffers[0] !== _gl.COLOR_ATTACHMENT0) {\n\t\t\t\t\t\t\tfor (let i = 0, il = textures.length; i < il; i++) {\n\t\t\t\t\t\t\t\t_currentDrawBuffers[i] = _gl.COLOR_ATTACHMENT0 + i;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t_currentDrawBuffers.length = textures.length;\n\t\t\t\t\t\t\tneedsUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (_currentDrawBuffers.length !== 1 || _currentDrawBuffers[0] !== _gl.COLOR_ATTACHMENT0) {\n\t\t\t\t\t\t\t_currentDrawBuffers[0] = _gl.COLOR_ATTACHMENT0;\n\t\t\t\t\t\t\t_currentDrawBuffers.length = 1;\n\t\t\t\t\t\t\tneedsUpdate = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (_currentDrawBuffers.length !== 1 || _currentDrawBuffers[0] !== _gl.BACK) {\n\t\t\t\t\t\t_currentDrawBuffers[0] = _gl.BACK;\n\t\t\t\t\t\t_currentDrawBuffers.length = 1;\n\t\t\t\t\t\tneedsUpdate = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (needsUpdate) {\n\t\t\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t\t\t_gl.drawBuffers(_currentDrawBuffers);\n\t\t\t\t\t} else {\n\t\t\t\t\t\textensions.get('WEBGL_draw_buffers').drawBuffersWEBGL(_currentDrawBuffers);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstate.viewport(_currentViewport);\n\t\t\tstate.scissor(_currentScissor);\n\t\t\tstate.setScissorTest(_currentScissorTest);\n\n\t\t\tif (isCube) {\n\t\t\t\tconst textureProperties = properties.get(renderTarget.texture);\n\n\t\t\t\t_gl.framebufferTexture2D(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + activeCubeFace, textureProperties.__webglTexture, activeMipmapLevel);\n\t\t\t} else if (isRenderTarget3D) {\n\t\t\t\tconst textureProperties = properties.get(renderTarget.texture);\n\t\t\t\tconst layer = activeCubeFace || 0;\n\n\t\t\t\t_gl.framebufferTextureLayer(_gl.FRAMEBUFFER, _gl.COLOR_ATTACHMENT0, textureProperties.__webglTexture, activeMipmapLevel || 0, layer);\n\t\t\t}\n\n\t\t\t_currentMaterialId = -1; // reset current material to ensure correct uniform bindings\n\t\t};\n\n\t\tthis.readRenderTargetPixels = function (renderTarget, x, y, width, height, buffer, activeCubeFaceIndex) {\n\t\t\tif (!(renderTarget && renderTarget.isWebGLRenderTarget)) {\n\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tlet framebuffer = properties.get(renderTarget).__webglFramebuffer;\n\n\t\t\tif (renderTarget.isWebGLCubeRenderTarget && activeCubeFaceIndex !== undefined) {\n\t\t\t\tframebuffer = framebuffer[activeCubeFaceIndex];\n\t\t\t}\n\n\t\t\tif (framebuffer) {\n\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\n\t\t\t\ttry {\n\t\t\t\t\tconst texture = renderTarget.texture;\n\t\t\t\t\tconst textureFormat = texture.format;\n\t\t\t\t\tconst textureType = texture.type;\n\n\t\t\t\t\tif (textureFormat !== RGBAFormat && utils.convert(textureFormat) !== _gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_FORMAT)) {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst halfFloatSupportedByExt = textureType === HalfFloatType && (extensions.has('EXT_color_buffer_half_float') || capabilities.isWebGL2 && extensions.has('EXT_color_buffer_float'));\n\n\t\t\t\t\tif (textureType !== UnsignedByteType && utils.convert(textureType) !== _gl.getParameter(_gl.IMPLEMENTATION_COLOR_READ_TYPE) && // Edge and Chrome Mac < 52 (#9513)\n\t\t\t\t\t!(textureType === FloatType && (capabilities.isWebGL2 || extensions.has('OES_texture_float') || extensions.has('WEBGL_color_buffer_float'))) && // Chrome Mac >= 52 and Firefox\n\t\t\t\t\t!halfFloatSupportedByExt) {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.');\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (_gl.checkFramebufferStatus(_gl.FRAMEBUFFER) === _gl.FRAMEBUFFER_COMPLETE) {\n\t\t\t\t\t\t// the following if statement ensures valid read requests (no out-of-bounds pixels, see #8604)\n\t\t\t\t\t\tif (x >= 0 && x <= renderTarget.width - width && y >= 0 && y <= renderTarget.height - height) {\n\t\t\t\t\t\t\t_gl.readPixels(x, y, width, height, utils.convert(textureFormat), utils.convert(textureType), buffer);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.');\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\t// restore framebuffer of current render target if necessary\n\t\t\t\t\tconst framebuffer = _currentRenderTarget !== null ? properties.get(_currentRenderTarget).__webglFramebuffer : null;\n\t\t\t\t\tstate.bindFramebuffer(_gl.FRAMEBUFFER, framebuffer);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.copyFramebufferToTexture = function (position, texture, level = 0) {\n\t\t\tconst levelScale = Math.pow(2, -level);\n\t\t\tconst width = Math.floor(texture.image.width * levelScale);\n\t\t\tconst height = Math.floor(texture.image.height * levelScale);\n\t\t\tlet glFormat = utils.convert(texture.format);\n\n\t\t\tif (capabilities.isWebGL2) {\n\t\t\t\t// Workaround for https://bugs.chromium.org/p/chromium/issues/detail?id=1120100\n\t\t\t\t// Not needed in Chrome 93+\n\t\t\t\tif (glFormat === _gl.RGB) glFormat = _gl.RGB8;\n\t\t\t\tif (glFormat === _gl.RGBA) glFormat = _gl.RGBA8;\n\t\t\t}\n\n\t\t\ttextures.setTexture2D(texture, 0);\n\n\t\t\t_gl.copyTexImage2D(_gl.TEXTURE_2D, level, glFormat, position.x, position.y, width, height, 0);\n\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.copyTextureToTexture = function (position, srcTexture, dstTexture, level = 0) {\n\t\t\tconst width = srcTexture.image.width;\n\t\t\tconst height = srcTexture.image.height;\n\t\t\tconst glFormat = utils.convert(dstTexture.format);\n\t\t\tconst glType = utils.convert(dstTexture.type);\n\t\t\ttextures.setTexture2D(dstTexture, 0); // As another texture upload may have changed pixelStorei\n\t\t\t// parameters, make sure they are correct for the dstTexture\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);\n\n\t\t\tif (srcTexture.isDataTexture) {\n\t\t\t\t_gl.texSubImage2D(_gl.TEXTURE_2D, level, position.x, position.y, width, height, glFormat, glType, srcTexture.image.data);\n\t\t\t} else {\n\t\t\t\tif (srcTexture.isCompressedTexture) {\n\t\t\t\t\t_gl.compressedTexSubImage2D(_gl.TEXTURE_2D, level, position.x, position.y, srcTexture.mipmaps[0].width, srcTexture.mipmaps[0].height, glFormat, srcTexture.mipmaps[0].data);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.texSubImage2D(_gl.TEXTURE_2D, level, position.x, position.y, glFormat, glType, srcTexture.image);\n\t\t\t\t}\n\t\t\t} // Generate mipmaps only when copying level 0\n\n\n\t\t\tif (level === 0 && dstTexture.generateMipmaps) _gl.generateMipmap(_gl.TEXTURE_2D);\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.copyTextureToTexture3D = function (sourceBox, position, srcTexture, dstTexture, level = 0) {\n\t\t\tif (_this.isWebGL1Renderer) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst width = sourceBox.max.x - sourceBox.min.x + 1;\n\t\t\tconst height = sourceBox.max.y - sourceBox.min.y + 1;\n\t\t\tconst depth = sourceBox.max.z - sourceBox.min.z + 1;\n\t\t\tconst glFormat = utils.convert(dstTexture.format);\n\t\t\tconst glType = utils.convert(dstTexture.type);\n\t\t\tlet glTarget;\n\n\t\t\tif (dstTexture.isDataTexture3D) {\n\t\t\t\ttextures.setTexture3D(dstTexture, 0);\n\t\t\t\tglTarget = _gl.TEXTURE_3D;\n\t\t\t} else if (dstTexture.isDataTexture2DArray) {\n\t\t\t\ttextures.setTexture2DArray(dstTexture, 0);\n\t\t\t\tglTarget = _gl.TEXTURE_2D_ARRAY;\n\t\t\t} else {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_FLIP_Y_WEBGL, dstTexture.flipY);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, dstTexture.premultiplyAlpha);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ALIGNMENT, dstTexture.unpackAlignment);\n\n\t\t\tconst unpackRowLen = _gl.getParameter(_gl.UNPACK_ROW_LENGTH);\n\n\t\t\tconst unpackImageHeight = _gl.getParameter(_gl.UNPACK_IMAGE_HEIGHT);\n\n\t\t\tconst unpackSkipPixels = _gl.getParameter(_gl.UNPACK_SKIP_PIXELS);\n\n\t\t\tconst unpackSkipRows = _gl.getParameter(_gl.UNPACK_SKIP_ROWS);\n\n\t\t\tconst unpackSkipImages = _gl.getParameter(_gl.UNPACK_SKIP_IMAGES);\n\n\t\t\tconst image = srcTexture.isCompressedTexture ? srcTexture.mipmaps[0] : srcTexture.image;\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, image.width);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, image.height);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, sourceBox.min.x);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, sourceBox.min.y);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, sourceBox.min.z);\n\n\t\t\tif (srcTexture.isDataTexture || srcTexture.isDataTexture3D) {\n\t\t\t\t_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image.data);\n\t\t\t} else {\n\t\t\t\tif (srcTexture.isCompressedTexture) {\n\t\t\t\t\tconsole.warn('THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.');\n\n\t\t\t\t\t_gl.compressedTexSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data);\n\t\t\t\t} else {\n\t\t\t\t\t_gl.texSubImage3D(glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, glType, image);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_ROW_LENGTH, unpackRowLen);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_IMAGE_HEIGHT, unpackImageHeight);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_PIXELS, unpackSkipPixels);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_ROWS, unpackSkipRows);\n\n\t\t\t_gl.pixelStorei(_gl.UNPACK_SKIP_IMAGES, unpackSkipImages); // Generate mipmaps only when copying level 0\n\n\n\t\t\tif (level === 0 && dstTexture.generateMipmaps) _gl.generateMipmap(glTarget);\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.initTexture = function (texture) {\n\t\t\ttextures.setTexture2D(texture, 0);\n\t\t\tstate.unbindTexture();\n\t\t};\n\n\t\tthis.resetState = function () {\n\t\t\t_currentActiveCubeFace = 0;\n\t\t\t_currentActiveMipmapLevel = 0;\n\t\t\t_currentRenderTarget = null;\n\t\t\tstate.reset();\n\t\t\tbindingStates.reset();\n\t\t};\n\n\t\tif (typeof __THREE_DEVTOOLS__ !== 'undefined') {\n\t\t\t__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {\n\t\t\t\tdetail: this\n\t\t\t})); // eslint-disable-line no-undef\n\n\t\t}\n\t}\n\n\tclass WebGL1Renderer extends WebGLRenderer {}\n\n\tWebGL1Renderer.prototype.isWebGL1Renderer = true;\n\n\tclass FogExp2 {\n\t\tconstructor(color, density = 0.00025) {\n\t\t\tthis.name = '';\n\t\t\tthis.color = new Color(color);\n\t\t\tthis.density = density;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new FogExp2(this.color, this.density);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn {\n\t\t\t\ttype: 'FogExp2',\n\t\t\t\tcolor: this.color.getHex(),\n\t\t\t\tdensity: this.density\n\t\t\t};\n\t\t}\n\n\t}\n\n\tFogExp2.prototype.isFogExp2 = true;\n\n\tclass Fog {\n\t\tconstructor(color, near = 1, far = 1000) {\n\t\t\tthis.name = '';\n\t\t\tthis.color = new Color(color);\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Fog(this.color, this.near, this.far);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn {\n\t\t\t\ttype: 'Fog',\n\t\t\t\tcolor: this.color.getHex(),\n\t\t\t\tnear: this.near,\n\t\t\t\tfar: this.far\n\t\t\t};\n\t\t}\n\n\t}\n\n\tFog.prototype.isFog = true;\n\n\tclass Scene extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Scene';\n\t\t\tthis.background = null;\n\t\t\tthis.environment = null;\n\t\t\tthis.fog = null;\n\t\t\tthis.overrideMaterial = null;\n\t\t\tthis.autoUpdate = true; // checked by the renderer\n\n\t\t\tif (typeof __THREE_DEVTOOLS__ !== 'undefined') {\n\t\t\t\t__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('observe', {\n\t\t\t\t\tdetail: this\n\t\t\t\t})); // eslint-disable-line no-undef\n\n\t\t\t}\n\t\t}\n\n\t\tcopy(source, recursive) {\n\t\t\tsuper.copy(source, recursive);\n\t\t\tif (source.background !== null) this.background = source.background.clone();\n\t\t\tif (source.environment !== null) this.environment = source.environment.clone();\n\t\t\tif (source.fog !== null) this.fog = source.fog.clone();\n\t\t\tif (source.overrideMaterial !== null) this.overrideMaterial = source.overrideMaterial.clone();\n\t\t\tthis.autoUpdate = source.autoUpdate;\n\t\t\tthis.matrixAutoUpdate = source.matrixAutoUpdate;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tif (this.fog !== null) data.object.fog = this.fog.toJSON();\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tScene.prototype.isScene = true;\n\n\tclass InterleavedBuffer {\n\t\tconstructor(array, stride) {\n\t\t\tthis.array = array;\n\t\t\tthis.stride = stride;\n\t\t\tthis.count = array !== undefined ? array.length / stride : 0;\n\t\t\tthis.usage = StaticDrawUsage;\n\t\t\tthis.updateRange = {\n\t\t\t\toffset: 0,\n\t\t\t\tcount: -1\n\t\t\t};\n\t\t\tthis.version = 0;\n\t\t\tthis.uuid = generateUUID();\n\t\t}\n\n\t\tonUploadCallback() {}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t\tsetUsage(value) {\n\t\t\tthis.usage = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.array = new source.array.constructor(source.array);\n\t\t\tthis.count = source.count;\n\t\t\tthis.stride = source.stride;\n\t\t\tthis.usage = source.usage;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopyAt(index1, attribute, index2) {\n\t\t\tindex1 *= this.stride;\n\t\t\tindex2 *= attribute.stride;\n\n\t\t\tfor (let i = 0, l = this.stride; i < l; i++) {\n\t\t\t\tthis.array[index1 + i] = attribute.array[index2 + i];\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(value, offset = 0) {\n\t\t\tthis.array.set(value, offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone(data) {\n\t\t\tif (data.arrayBuffers === undefined) {\n\t\t\t\tdata.arrayBuffers = {};\n\t\t\t}\n\n\t\t\tif (this.array.buffer._uuid === undefined) {\n\t\t\t\tthis.array.buffer._uuid = generateUUID();\n\t\t\t}\n\n\t\t\tif (data.arrayBuffers[this.array.buffer._uuid] === undefined) {\n\t\t\t\tdata.arrayBuffers[this.array.buffer._uuid] = this.array.slice(0).buffer;\n\t\t\t}\n\n\t\t\tconst array = new this.array.constructor(data.arrayBuffers[this.array.buffer._uuid]);\n\t\t\tconst ib = new this.constructor(array, this.stride);\n\t\t\tib.setUsage(this.usage);\n\t\t\treturn ib;\n\t\t}\n\n\t\tonUpload(callback) {\n\t\t\tthis.onUploadCallback = callback;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(data) {\n\t\t\tif (data.arrayBuffers === undefined) {\n\t\t\t\tdata.arrayBuffers = {};\n\t\t\t} // generate UUID for array buffer if necessary\n\n\n\t\t\tif (this.array.buffer._uuid === undefined) {\n\t\t\t\tthis.array.buffer._uuid = generateUUID();\n\t\t\t}\n\n\t\t\tif (data.arrayBuffers[this.array.buffer._uuid] === undefined) {\n\t\t\t\tdata.arrayBuffers[this.array.buffer._uuid] = Array.prototype.slice.call(new Uint32Array(this.array.buffer));\n\t\t\t} //\n\n\n\t\t\treturn {\n\t\t\t\tuuid: this.uuid,\n\t\t\t\tbuffer: this.array.buffer._uuid,\n\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\tstride: this.stride\n\t\t\t};\n\t\t}\n\n\t}\n\n\tInterleavedBuffer.prototype.isInterleavedBuffer = true;\n\n\tconst _vector$6 = /*@__PURE__*/new Vector3();\n\n\tclass InterleavedBufferAttribute {\n\t\tconstructor(interleavedBuffer, itemSize, offset, normalized = false) {\n\t\t\tthis.name = '';\n\t\t\tthis.data = interleavedBuffer;\n\t\t\tthis.itemSize = itemSize;\n\t\t\tthis.offset = offset;\n\t\t\tthis.normalized = normalized === true;\n\t\t}\n\n\t\tget count() {\n\t\t\treturn this.data.count;\n\t\t}\n\n\t\tget array() {\n\t\t\treturn this.data.array;\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tthis.data.needsUpdate = value;\n\t\t}\n\n\t\tapplyMatrix4(m) {\n\t\t\tfor (let i = 0, l = this.data.count; i < l; i++) {\n\t\t\t\t_vector$6.x = this.getX(i);\n\t\t\t\t_vector$6.y = this.getY(i);\n\t\t\t\t_vector$6.z = this.getZ(i);\n\n\t\t\t\t_vector$6.applyMatrix4(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tapplyNormalMatrix(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$6.x = this.getX(i);\n\t\t\t\t_vector$6.y = this.getY(i);\n\t\t\t\t_vector$6.z = this.getZ(i);\n\n\t\t\t\t_vector$6.applyNormalMatrix(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttransformDirection(m) {\n\t\t\tfor (let i = 0, l = this.count; i < l; i++) {\n\t\t\t\t_vector$6.x = this.getX(i);\n\t\t\t\t_vector$6.y = this.getY(i);\n\t\t\t\t_vector$6.z = this.getZ(i);\n\n\t\t\t\t_vector$6.transformDirection(m);\n\n\t\t\t\tthis.setXYZ(i, _vector$6.x, _vector$6.y, _vector$6.z);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetX(index, x) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset] = x;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetY(index, y) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetZ(index, z) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetW(index, w) {\n\t\t\tthis.data.array[index * this.data.stride + this.offset + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetX(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset];\n\t\t}\n\n\t\tgetY(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset + 1];\n\t\t}\n\n\t\tgetZ(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset + 2];\n\t\t}\n\n\t\tgetW(index) {\n\t\t\treturn this.data.array[index * this.data.stride + this.offset + 3];\n\t\t}\n\n\t\tsetXY(index, x, y) {\n\t\t\tindex = index * this.data.stride + this.offset;\n\t\t\tthis.data.array[index + 0] = x;\n\t\t\tthis.data.array[index + 1] = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZ(index, x, y, z) {\n\t\t\tindex = index * this.data.stride + this.offset;\n\t\t\tthis.data.array[index + 0] = x;\n\t\t\tthis.data.array[index + 1] = y;\n\t\t\tthis.data.array[index + 2] = z;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetXYZW(index, x, y, z, w) {\n\t\t\tindex = index * this.data.stride + this.offset;\n\t\t\tthis.data.array[index + 0] = x;\n\t\t\tthis.data.array[index + 1] = y;\n\t\t\tthis.data.array[index + 2] = z;\n\t\t\tthis.data.array[index + 3] = w;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone(data) {\n\t\t\tif (data === undefined) {\n\t\t\t\tconsole.log('THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.');\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor (let i = 0; i < this.count; i++) {\n\t\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\t\tfor (let j = 0; j < this.itemSize; j++) {\n\t\t\t\t\t\tarray.push(this.data.array[index + j]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn new BufferAttribute(new this.array.constructor(array), this.itemSize, this.normalized);\n\t\t\t} else {\n\t\t\t\tif (data.interleavedBuffers === undefined) {\n\t\t\t\t\tdata.interleavedBuffers = {};\n\t\t\t\t}\n\n\t\t\t\tif (data.interleavedBuffers[this.data.uuid] === undefined) {\n\t\t\t\t\tdata.interleavedBuffers[this.data.uuid] = this.data.clone(data);\n\t\t\t\t}\n\n\t\t\t\treturn new InterleavedBufferAttribute(data.interleavedBuffers[this.data.uuid], this.itemSize, this.offset, this.normalized);\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(data) {\n\t\t\tif (data === undefined) {\n\t\t\t\tconsole.log('THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.');\n\t\t\t\tconst array = [];\n\n\t\t\t\tfor (let i = 0; i < this.count; i++) {\n\t\t\t\t\tconst index = i * this.data.stride + this.offset;\n\n\t\t\t\t\tfor (let j = 0; j < this.itemSize; j++) {\n\t\t\t\t\t\tarray.push(this.data.array[index + j]);\n\t\t\t\t\t}\n\t\t\t\t} // deinterleave data and save it as an ordinary buffer attribute for now\n\n\n\t\t\t\treturn {\n\t\t\t\t\titemSize: this.itemSize,\n\t\t\t\t\ttype: this.array.constructor.name,\n\t\t\t\t\tarray: array,\n\t\t\t\t\tnormalized: this.normalized\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\t// save as true interlaved attribtue\n\t\t\t\tif (data.interleavedBuffers === undefined) {\n\t\t\t\t\tdata.interleavedBuffers = {};\n\t\t\t\t}\n\n\t\t\t\tif (data.interleavedBuffers[this.data.uuid] === undefined) {\n\t\t\t\t\tdata.interleavedBuffers[this.data.uuid] = this.data.toJSON(data);\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tisInterleavedBufferAttribute: true,\n\t\t\t\t\titemSize: this.itemSize,\n\t\t\t\t\tdata: this.data.uuid,\n\t\t\t\t\toffset: this.offset,\n\t\t\t\t\tnormalized: this.normalized\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t}\n\n\tInterleavedBufferAttribute.prototype.isInterleavedBufferAttribute = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\trotation: <float>,\n\t *\tsizeAttenuation: <bool>\n\t * }\n\t */\n\n\tclass SpriteMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'SpriteMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.rotation = 0;\n\t\t\tthis.sizeAttenuation = true;\n\t\t\tthis.transparent = true;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.rotation = source.rotation;\n\t\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSpriteMaterial.prototype.isSpriteMaterial = true;\n\n\tlet _geometry;\n\n\tconst _intersectPoint = /*@__PURE__*/new Vector3();\n\n\tconst _worldScale = /*@__PURE__*/new Vector3();\n\n\tconst _mvPosition = /*@__PURE__*/new Vector3();\n\n\tconst _alignedPosition = /*@__PURE__*/new Vector2();\n\n\tconst _rotatedPosition = /*@__PURE__*/new Vector2();\n\n\tconst _viewWorldMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _vA = /*@__PURE__*/new Vector3();\n\n\tconst _vB = /*@__PURE__*/new Vector3();\n\n\tconst _vC = /*@__PURE__*/new Vector3();\n\n\tconst _uvA = /*@__PURE__*/new Vector2();\n\n\tconst _uvB = /*@__PURE__*/new Vector2();\n\n\tconst _uvC = /*@__PURE__*/new Vector2();\n\n\tclass Sprite extends Object3D {\n\t\tconstructor(material) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Sprite';\n\n\t\t\tif (_geometry === undefined) {\n\t\t\t\t_geometry = new BufferGeometry();\n\t\t\t\tconst float32Array = new Float32Array([-0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1]);\n\t\t\t\tconst interleavedBuffer = new InterleavedBuffer(float32Array, 5);\n\n\t\t\t\t_geometry.setIndex([0, 1, 2, 0, 2, 3]);\n\n\t\t\t\t_geometry.setAttribute('position', new InterleavedBufferAttribute(interleavedBuffer, 3, 0, false));\n\n\t\t\t\t_geometry.setAttribute('uv', new InterleavedBufferAttribute(interleavedBuffer, 2, 3, false));\n\t\t\t}\n\n\t\t\tthis.geometry = _geometry;\n\t\t\tthis.material = material !== undefined ? material : new SpriteMaterial();\n\t\t\tthis.center = new Vector2(0.5, 0.5);\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tif (raycaster.camera === null) {\n\t\t\t\tconsole.error('THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.');\n\t\t\t}\n\n\t\t\t_worldScale.setFromMatrixScale(this.matrixWorld);\n\n\t\t\t_viewWorldMatrix.copy(raycaster.camera.matrixWorld);\n\n\t\t\tthis.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse, this.matrixWorld);\n\n\t\t\t_mvPosition.setFromMatrixPosition(this.modelViewMatrix);\n\n\t\t\tif (raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false) {\n\t\t\t\t_worldScale.multiplyScalar(-_mvPosition.z);\n\t\t\t}\n\n\t\t\tconst rotation = this.material.rotation;\n\t\t\tlet sin, cos;\n\n\t\t\tif (rotation !== 0) {\n\t\t\t\tcos = Math.cos(rotation);\n\t\t\t\tsin = Math.sin(rotation);\n\t\t\t}\n\n\t\t\tconst center = this.center;\n\t\t\ttransformVertex(_vA.set(-0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\t\t\ttransformVertex(_vB.set(0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\t\t\ttransformVertex(_vC.set(0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\n\t\t\t_uvA.set(0, 0);\n\n\t\t\t_uvB.set(1, 0);\n\n\t\t\t_uvC.set(1, 1); // check first triangle\n\n\n\t\t\tlet intersect = raycaster.ray.intersectTriangle(_vA, _vB, _vC, false, _intersectPoint);\n\n\t\t\tif (intersect === null) {\n\t\t\t\t// check second triangle\n\t\t\t\ttransformVertex(_vB.set(-0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos);\n\n\t\t\t\t_uvB.set(0, 1);\n\n\t\t\t\tintersect = raycaster.ray.intersectTriangle(_vA, _vC, _vB, false, _intersectPoint);\n\n\t\t\t\tif (intersect === null) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst distance = raycaster.ray.origin.distanceTo(_intersectPoint);\n\t\t\tif (distance < raycaster.near || distance > raycaster.far) return;\n\t\t\tintersects.push({\n\t\t\t\tdistance: distance,\n\t\t\t\tpoint: _intersectPoint.clone(),\n\t\t\t\tuv: Triangle.getUV(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2()),\n\t\t\t\tface: null,\n\t\t\t\tobject: this\n\t\t\t});\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tif (source.center !== undefined) this.center.copy(source.center);\n\t\t\tthis.material = source.material;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSprite.prototype.isSprite = true;\n\n\tfunction transformVertex(vertexPosition, mvPosition, center, scale, sin, cos) {\n\t\t// compute position in camera space\n\t\t_alignedPosition.subVectors(vertexPosition, center).addScalar(0.5).multiply(scale); // to check if rotation is not zero\n\n\n\t\tif (sin !== undefined) {\n\t\t\t_rotatedPosition.x = cos * _alignedPosition.x - sin * _alignedPosition.y;\n\t\t\t_rotatedPosition.y = sin * _alignedPosition.x + cos * _alignedPosition.y;\n\t\t} else {\n\t\t\t_rotatedPosition.copy(_alignedPosition);\n\t\t}\n\n\t\tvertexPosition.copy(mvPosition);\n\t\tvertexPosition.x += _rotatedPosition.x;\n\t\tvertexPosition.y += _rotatedPosition.y; // transform to world space\n\n\t\tvertexPosition.applyMatrix4(_viewWorldMatrix);\n\t}\n\n\tconst _v1$2 = /*@__PURE__*/new Vector3();\n\n\tconst _v2$1 = /*@__PURE__*/new Vector3();\n\n\tclass LOD extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis._currentLevel = 0;\n\t\t\tthis.type = 'LOD';\n\t\t\tObject.defineProperties(this, {\n\t\t\t\tlevels: {\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tvalue: []\n\t\t\t\t},\n\t\t\t\tisLOD: {\n\t\t\t\t\tvalue: true\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.autoUpdate = true;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source, false);\n\t\t\tconst levels = source.levels;\n\n\t\t\tfor (let i = 0, l = levels.length; i < l; i++) {\n\t\t\t\tconst level = levels[i];\n\t\t\t\tthis.addLevel(level.object.clone(), level.distance);\n\t\t\t}\n\n\t\t\tthis.autoUpdate = source.autoUpdate;\n\t\t\treturn this;\n\t\t}\n\n\t\taddLevel(object, distance = 0) {\n\t\t\tdistance = Math.abs(distance);\n\t\t\tconst levels = this.levels;\n\t\t\tlet l;\n\n\t\t\tfor (l = 0; l < levels.length; l++) {\n\t\t\t\tif (distance < levels[l].distance) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlevels.splice(l, 0, {\n\t\t\t\tdistance: distance,\n\t\t\t\tobject: object\n\t\t\t});\n\t\t\tthis.add(object);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetCurrentLevel() {\n\t\t\treturn this._currentLevel;\n\t\t}\n\n\t\tgetObjectForDistance(distance) {\n\t\t\tconst levels = this.levels;\n\n\t\t\tif (levels.length > 0) {\n\t\t\t\tlet i, l;\n\n\t\t\t\tfor (i = 1, l = levels.length; i < l; i++) {\n\t\t\t\t\tif (distance < levels[i].distance) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn levels[i - 1].object;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst levels = this.levels;\n\n\t\t\tif (levels.length > 0) {\n\t\t\t\t_v1$2.setFromMatrixPosition(this.matrixWorld);\n\n\t\t\t\tconst distance = raycaster.ray.origin.distanceTo(_v1$2);\n\t\t\t\tthis.getObjectForDistance(distance).raycast(raycaster, intersects);\n\t\t\t}\n\t\t}\n\n\t\tupdate(camera) {\n\t\t\tconst levels = this.levels;\n\n\t\t\tif (levels.length > 1) {\n\t\t\t\t_v1$2.setFromMatrixPosition(camera.matrixWorld);\n\n\t\t\t\t_v2$1.setFromMatrixPosition(this.matrixWorld);\n\n\t\t\t\tconst distance = _v1$2.distanceTo(_v2$1) / camera.zoom;\n\t\t\t\tlevels[0].object.visible = true;\n\t\t\t\tlet i, l;\n\n\t\t\t\tfor (i = 1, l = levels.length; i < l; i++) {\n\t\t\t\t\tif (distance >= levels[i].distance) {\n\t\t\t\t\t\tlevels[i - 1].object.visible = false;\n\t\t\t\t\t\tlevels[i].object.visible = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._currentLevel = i - 1;\n\n\t\t\t\tfor (; i < l; i++) {\n\t\t\t\t\tlevels[i].object.visible = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tif (this.autoUpdate === false) data.object.autoUpdate = false;\n\t\t\tdata.object.levels = [];\n\t\t\tconst levels = this.levels;\n\n\t\t\tfor (let i = 0, l = levels.length; i < l; i++) {\n\t\t\t\tconst level = levels[i];\n\t\t\t\tdata.object.levels.push({\n\t\t\t\t\tobject: level.object.uuid,\n\t\t\t\t\tdistance: level.distance\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tconst _basePosition = /*@__PURE__*/new Vector3();\n\n\tconst _skinIndex = /*@__PURE__*/new Vector4();\n\n\tconst _skinWeight = /*@__PURE__*/new Vector4();\n\n\tconst _vector$5 = /*@__PURE__*/new Vector3();\n\n\tconst _matrix = /*@__PURE__*/new Matrix4();\n\n\tclass SkinnedMesh extends Mesh {\n\t\tconstructor(geometry, material) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'SkinnedMesh';\n\t\t\tthis.bindMode = 'attached';\n\t\t\tthis.bindMatrix = new Matrix4();\n\t\t\tthis.bindMatrixInverse = new Matrix4();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.bindMode = source.bindMode;\n\t\t\tthis.bindMatrix.copy(source.bindMatrix);\n\t\t\tthis.bindMatrixInverse.copy(source.bindMatrixInverse);\n\t\t\tthis.skeleton = source.skeleton;\n\t\t\treturn this;\n\t\t}\n\n\t\tbind(skeleton, bindMatrix) {\n\t\t\tthis.skeleton = skeleton;\n\n\t\t\tif (bindMatrix === undefined) {\n\t\t\t\tthis.updateMatrixWorld(true);\n\t\t\t\tthis.skeleton.calculateInverses();\n\t\t\t\tbindMatrix = this.matrixWorld;\n\t\t\t}\n\n\t\t\tthis.bindMatrix.copy(bindMatrix);\n\t\t\tthis.bindMatrixInverse.copy(bindMatrix).invert();\n\t\t}\n\n\t\tpose() {\n\t\t\tthis.skeleton.pose();\n\t\t}\n\n\t\tnormalizeSkinWeights() {\n\t\t\tconst vector = new Vector4();\n\t\t\tconst skinWeight = this.geometry.attributes.skinWeight;\n\n\t\t\tfor (let i = 0, l = skinWeight.count; i < l; i++) {\n\t\t\t\tvector.x = skinWeight.getX(i);\n\t\t\t\tvector.y = skinWeight.getY(i);\n\t\t\t\tvector.z = skinWeight.getZ(i);\n\t\t\t\tvector.w = skinWeight.getW(i);\n\t\t\t\tconst scale = 1.0 / vector.manhattanLength();\n\n\t\t\t\tif (scale !== Infinity) {\n\t\t\t\t\tvector.multiplyScalar(scale);\n\t\t\t\t} else {\n\t\t\t\t\tvector.set(1, 0, 0, 0); // do something reasonable\n\t\t\t\t}\n\n\t\t\t\tskinWeight.setXYZW(i, vector.x, vector.y, vector.z, vector.w);\n\t\t\t}\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\n\t\t\tif (this.bindMode === 'attached') {\n\t\t\t\tthis.bindMatrixInverse.copy(this.matrixWorld).invert();\n\t\t\t} else if (this.bindMode === 'detached') {\n\t\t\t\tthis.bindMatrixInverse.copy(this.bindMatrix).invert();\n\t\t\t} else {\n\t\t\t\tconsole.warn('THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode);\n\t\t\t}\n\t\t}\n\n\t\tboneTransform(index, target) {\n\t\t\tconst skeleton = this.skeleton;\n\t\t\tconst geometry = this.geometry;\n\n\t\t\t_skinIndex.fromBufferAttribute(geometry.attributes.skinIndex, index);\n\n\t\t\t_skinWeight.fromBufferAttribute(geometry.attributes.skinWeight, index);\n\n\t\t\t_basePosition.copy(target).applyMatrix4(this.bindMatrix);\n\n\t\t\ttarget.set(0, 0, 0);\n\n\t\t\tfor (let i = 0; i < 4; i++) {\n\t\t\t\tconst weight = _skinWeight.getComponent(i);\n\n\t\t\t\tif (weight !== 0) {\n\t\t\t\t\tconst boneIndex = _skinIndex.getComponent(i);\n\n\t\t\t\t\t_matrix.multiplyMatrices(skeleton.bones[boneIndex].matrixWorld, skeleton.boneInverses[boneIndex]);\n\n\t\t\t\t\ttarget.addScaledVector(_vector$5.copy(_basePosition).applyMatrix4(_matrix), weight);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn target.applyMatrix4(this.bindMatrixInverse);\n\t\t}\n\n\t}\n\n\tSkinnedMesh.prototype.isSkinnedMesh = true;\n\n\tclass Bone extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'Bone';\n\t\t}\n\n\t}\n\n\tBone.prototype.isBone = true;\n\n\tclass DataTexture extends Texture {\n\t\tconstructor(data = null, width = 1, height = 1, format, type, mapping, wrapS, wrapT, magFilter = NearestFilter, minFilter = NearestFilter, anisotropy, encoding) {\n\t\t\tsuper(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);\n\t\t\tthis.image = {\n\t\t\t\tdata: data,\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t\tthis.magFilter = magFilter;\n\t\t\tthis.minFilter = minFilter;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tthis.flipY = false;\n\t\t\tthis.unpackAlignment = 1;\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tDataTexture.prototype.isDataTexture = true;\n\n\tconst _offsetMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _identityMatrix = /*@__PURE__*/new Matrix4();\n\n\tclass Skeleton {\n\t\tconstructor(bones = [], boneInverses = []) {\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.bones = bones.slice(0);\n\t\t\tthis.boneInverses = boneInverses;\n\t\t\tthis.boneMatrices = null;\n\t\t\tthis.boneTexture = null;\n\t\t\tthis.boneTextureSize = 0;\n\t\t\tthis.frame = -1;\n\t\t\tthis.init();\n\t\t}\n\n\t\tinit() {\n\t\t\tconst bones = this.bones;\n\t\t\tconst boneInverses = this.boneInverses;\n\t\t\tthis.boneMatrices = new Float32Array(bones.length * 16); // calculate inverse bone matrices if necessary\n\n\t\t\tif (boneInverses.length === 0) {\n\t\t\t\tthis.calculateInverses();\n\t\t\t} else {\n\t\t\t\t// handle special case\n\t\t\t\tif (bones.length !== boneInverses.length) {\n\t\t\t\t\tconsole.warn('THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.');\n\t\t\t\t\tthis.boneInverses = [];\n\n\t\t\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\t\t\tthis.boneInverses.push(new Matrix4());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcalculateInverses() {\n\t\t\tthis.boneInverses.length = 0;\n\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst inverse = new Matrix4();\n\n\t\t\t\tif (this.bones[i]) {\n\t\t\t\t\tinverse.copy(this.bones[i].matrixWorld).invert();\n\t\t\t\t}\n\n\t\t\t\tthis.boneInverses.push(inverse);\n\t\t\t}\n\t\t}\n\n\t\tpose() {\n\t\t\t// recover the bind-time world matrices\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst bone = this.bones[i];\n\n\t\t\t\tif (bone) {\n\t\t\t\t\tbone.matrixWorld.copy(this.boneInverses[i]).invert();\n\t\t\t\t}\n\t\t\t} // compute the local matrices, positions, rotations and scales\n\n\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst bone = this.bones[i];\n\n\t\t\t\tif (bone) {\n\t\t\t\t\tif (bone.parent && bone.parent.isBone) {\n\t\t\t\t\t\tbone.matrix.copy(bone.parent.matrixWorld).invert();\n\t\t\t\t\t\tbone.matrix.multiply(bone.matrixWorld);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbone.matrix.copy(bone.matrixWorld);\n\t\t\t\t\t}\n\n\t\t\t\t\tbone.matrix.decompose(bone.position, bone.quaternion, bone.scale);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst bones = this.bones;\n\t\t\tconst boneInverses = this.boneInverses;\n\t\t\tconst boneMatrices = this.boneMatrices;\n\t\t\tconst boneTexture = this.boneTexture; // flatten bone matrices to array\n\n\t\t\tfor (let i = 0, il = bones.length; i < il; i++) {\n\t\t\t\t// compute the offset between the current and the original transform\n\t\t\t\tconst matrix = bones[i] ? bones[i].matrixWorld : _identityMatrix;\n\n\t\t\t\t_offsetMatrix.multiplyMatrices(matrix, boneInverses[i]);\n\n\t\t\t\t_offsetMatrix.toArray(boneMatrices, i * 16);\n\t\t\t}\n\n\t\t\tif (boneTexture !== null) {\n\t\t\t\tboneTexture.needsUpdate = true;\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Skeleton(this.bones, this.boneInverses);\n\t\t}\n\n\t\tcomputeBoneTexture() {\n\t\t\t// layout (1 matrix = 4 pixels)\n\t\t\t//\t\t\tRGBA RGBA RGBA RGBA (=> column1, column2, column3, column4)\n\t\t\t//\twith\t8x8\tpixel texture max\t 16 bones * 4 pixels =\t(8 * 8)\n\t\t\t//\t\t\t 16x16 pixel texture max\t 64 bones * 4 pixels = (16 * 16)\n\t\t\t//\t\t\t 32x32 pixel texture max\t256 bones * 4 pixels = (32 * 32)\n\t\t\t//\t\t\t 64x64 pixel texture max 1024 bones * 4 pixels = (64 * 64)\n\t\t\tlet size = Math.sqrt(this.bones.length * 4); // 4 pixels needed for 1 matrix\n\n\t\t\tsize = ceilPowerOfTwo(size);\n\t\t\tsize = Math.max(size, 4);\n\t\t\tconst boneMatrices = new Float32Array(size * size * 4); // 4 floats per RGBA pixel\n\n\t\t\tboneMatrices.set(this.boneMatrices); // copy current values\n\n\t\t\tconst boneTexture = new DataTexture(boneMatrices, size, size, RGBAFormat, FloatType);\n\t\t\tthis.boneMatrices = boneMatrices;\n\t\t\tthis.boneTexture = boneTexture;\n\t\t\tthis.boneTextureSize = size;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetBoneByName(name) {\n\t\t\tfor (let i = 0, il = this.bones.length; i < il; i++) {\n\t\t\t\tconst bone = this.bones[i];\n\n\t\t\t\tif (bone.name === name) {\n\t\t\t\t\treturn bone;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn undefined;\n\t\t}\n\n\t\tdispose() {\n\t\t\tif (this.boneTexture !== null) {\n\t\t\t\tthis.boneTexture.dispose();\n\t\t\t\tthis.boneTexture = null;\n\t\t\t}\n\t\t}\n\n\t\tfromJSON(json, bones) {\n\t\t\tthis.uuid = json.uuid;\n\n\t\t\tfor (let i = 0, l = json.bones.length; i < l; i++) {\n\t\t\t\tconst uuid = json.bones[i];\n\t\t\t\tlet bone = bones[uuid];\n\n\t\t\t\tif (bone === undefined) {\n\t\t\t\t\tconsole.warn('THREE.Skeleton: No bone found with UUID:', uuid);\n\t\t\t\t\tbone = new Bone();\n\t\t\t\t}\n\n\t\t\t\tthis.bones.push(bone);\n\t\t\t\tthis.boneInverses.push(new Matrix4().fromArray(json.boneInverses[i]));\n\t\t\t}\n\n\t\t\tthis.init();\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Skeleton',\n\t\t\t\t\tgenerator: 'Skeleton.toJSON'\n\t\t\t\t},\n\t\t\t\tbones: [],\n\t\t\t\tboneInverses: []\n\t\t\t};\n\t\t\tdata.uuid = this.uuid;\n\t\t\tconst bones = this.bones;\n\t\t\tconst boneInverses = this.boneInverses;\n\n\t\t\tfor (let i = 0, l = bones.length; i < l; i++) {\n\t\t\t\tconst bone = bones[i];\n\t\t\t\tdata.bones.push(bone.uuid);\n\t\t\t\tconst boneInverse = boneInverses[i];\n\t\t\t\tdata.boneInverses.push(boneInverse.toArray());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tclass InstancedBufferAttribute extends BufferAttribute {\n\t\tconstructor(array, itemSize, normalized, meshPerAttribute = 1) {\n\t\t\tif (typeof normalized === 'number') {\n\t\t\t\tmeshPerAttribute = normalized;\n\t\t\t\tnormalized = false;\n\t\t\t\tconsole.error('THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.');\n\t\t\t}\n\n\t\t\tsuper(array, itemSize, normalized);\n\t\t\tthis.meshPerAttribute = meshPerAttribute;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.meshPerAttribute = this.meshPerAttribute;\n\t\t\tdata.isInstancedBufferAttribute = true;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tInstancedBufferAttribute.prototype.isInstancedBufferAttribute = true;\n\n\tconst _instanceLocalMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _instanceWorldMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _instanceIntersects = [];\n\n\tconst _mesh = /*@__PURE__*/new Mesh();\n\n\tclass InstancedMesh extends Mesh {\n\t\tconstructor(geometry, material, count) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.instanceMatrix = new InstancedBufferAttribute(new Float32Array(count * 16), 16);\n\t\t\tthis.instanceColor = null;\n\t\t\tthis.count = count;\n\t\t\tthis.frustumCulled = false;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.instanceMatrix.copy(source.instanceMatrix);\n\t\t\tif (source.instanceColor !== null) this.instanceColor = source.instanceColor.clone();\n\t\t\tthis.count = source.count;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetColorAt(index, color) {\n\t\t\tcolor.fromArray(this.instanceColor.array, index * 3);\n\t\t}\n\n\t\tgetMatrixAt(index, matrix) {\n\t\t\tmatrix.fromArray(this.instanceMatrix.array, index * 16);\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tconst raycastTimes = this.count;\n\t\t\t_mesh.geometry = this.geometry;\n\t\t\t_mesh.material = this.material;\n\t\t\tif (_mesh.material === undefined) return;\n\n\t\t\tfor (let instanceId = 0; instanceId < raycastTimes; instanceId++) {\n\t\t\t\t// calculate the world matrix for each instance\n\t\t\t\tthis.getMatrixAt(instanceId, _instanceLocalMatrix);\n\n\t\t\t\t_instanceWorldMatrix.multiplyMatrices(matrixWorld, _instanceLocalMatrix); // the mesh represents this single instance\n\n\n\t\t\t\t_mesh.matrixWorld = _instanceWorldMatrix;\n\n\t\t\t\t_mesh.raycast(raycaster, _instanceIntersects); // process the result of raycast\n\n\n\t\t\t\tfor (let i = 0, l = _instanceIntersects.length; i < l; i++) {\n\t\t\t\t\tconst intersect = _instanceIntersects[i];\n\t\t\t\t\tintersect.instanceId = instanceId;\n\t\t\t\t\tintersect.object = this;\n\t\t\t\t\tintersects.push(intersect);\n\t\t\t\t}\n\n\t\t\t\t_instanceIntersects.length = 0;\n\t\t\t}\n\t\t}\n\n\t\tsetColorAt(index, color) {\n\t\t\tif (this.instanceColor === null) {\n\t\t\t\tthis.instanceColor = new InstancedBufferAttribute(new Float32Array(this.instanceMatrix.count * 3), 3);\n\t\t\t}\n\n\t\t\tcolor.toArray(this.instanceColor.array, index * 3);\n\t\t}\n\n\t\tsetMatrixAt(index, matrix) {\n\t\t\tmatrix.toArray(this.instanceMatrix.array, index * 16);\n\t\t}\n\n\t\tupdateMorphTargets() {}\n\n\t\tdispose() {\n\t\t\tthis.dispatchEvent({\n\t\t\t\ttype: 'dispose'\n\t\t\t});\n\t\t}\n\n\t}\n\n\tInstancedMesh.prototype.isInstancedMesh = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tlinewidth: <float>,\n\t *\tlinecap: \"round\",\n\t *\tlinejoin: \"round\"\n\t * }\n\t */\n\n\tclass LineBasicMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineBasicMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.linewidth = 1;\n\t\t\tthis.linecap = 'round';\n\t\t\tthis.linejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.linewidth = source.linewidth;\n\t\t\tthis.linecap = source.linecap;\n\t\t\tthis.linejoin = source.linejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineBasicMaterial.prototype.isLineBasicMaterial = true;\n\n\tconst _start$1 = /*@__PURE__*/new Vector3();\n\n\tconst _end$1 = /*@__PURE__*/new Vector3();\n\n\tconst _inverseMatrix$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _ray$1 = /*@__PURE__*/new Ray();\n\n\tconst _sphere$1 = /*@__PURE__*/new Sphere();\n\n\tclass Line extends Object3D {\n\t\tconstructor(geometry = new BufferGeometry(), material = new LineBasicMaterial()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Line';\n\t\t\tthis.geometry = geometry;\n\t\t\tthis.material = material;\n\t\t\tthis.updateMorphTargets();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.material = source.material;\n\t\t\tthis.geometry = source.geometry;\n\t\t\treturn this;\n\t\t}\n\n\t\tcomputeLineDistances() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\t// we assume non-indexed geometry\n\t\t\t\tif (geometry.index === null) {\n\t\t\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\t\t\tconst lineDistances = [0];\n\n\t\t\t\t\tfor (let i = 1, l = positionAttribute.count; i < l; i++) {\n\t\t\t\t\t\t_start$1.fromBufferAttribute(positionAttribute, i - 1);\n\n\t\t\t\t\t\t_end$1.fromBufferAttribute(positionAttribute, i);\n\n\t\t\t\t\t\tlineDistances[i] = lineDistances[i - 1];\n\t\t\t\t\t\tlineDistances[i] += _start$1.distanceTo(_end$1);\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setAttribute('lineDistance', new Float32BufferAttribute(lineDistances, 1));\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.');\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.Line.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tconst threshold = raycaster.params.Line.threshold;\n\t\t\tconst drawRange = geometry.drawRange; // Checking boundingSphere distance to ray\n\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere$1.copy(geometry.boundingSphere);\n\n\t\t\t_sphere$1.applyMatrix4(matrixWorld);\n\n\t\t\t_sphere$1.radius += threshold;\n\t\t\tif (raycaster.ray.intersectsSphere(_sphere$1) === false) return; //\n\n\t\t\t_inverseMatrix$1.copy(matrixWorld).invert();\n\n\t\t\t_ray$1.copy(raycaster.ray).applyMatrix4(_inverseMatrix$1);\n\n\t\t\tconst localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3);\n\t\t\tconst localThresholdSq = localThreshold * localThreshold;\n\t\t\tconst vStart = new Vector3();\n\t\t\tconst vEnd = new Vector3();\n\t\t\tconst interSegment = new Vector3();\n\t\t\tconst interRay = new Vector3();\n\t\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst index = geometry.index;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tconst positionAttribute = attributes.position;\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(index.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, l = end - 1; i < l; i += step) {\n\t\t\t\t\t\tconst a = index.getX(i);\n\t\t\t\t\t\tconst b = index.getX(i + 1);\n\t\t\t\t\t\tvStart.fromBufferAttribute(positionAttribute, a);\n\t\t\t\t\t\tvEnd.fromBufferAttribute(positionAttribute, b);\n\n\t\t\t\t\t\tconst distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);\n\n\t\t\t\t\t\tif (distSq > localThresholdSq) continue;\n\t\t\t\t\t\tinterRay.applyMatrix4(this.matrixWorld); //Move back to world space for distance calculation\n\n\t\t\t\t\t\tconst distance = raycaster.ray.origin.distanceTo(interRay);\n\t\t\t\t\t\tif (distance < raycaster.near || distance > raycaster.far) continue;\n\t\t\t\t\t\tintersects.push({\n\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4(this.matrixWorld),\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\tobject: this\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, l = end - 1; i < l; i += step) {\n\t\t\t\t\t\tvStart.fromBufferAttribute(positionAttribute, i);\n\t\t\t\t\t\tvEnd.fromBufferAttribute(positionAttribute, i + 1);\n\n\t\t\t\t\t\tconst distSq = _ray$1.distanceSqToSegment(vStart, vEnd, interRay, interSegment);\n\n\t\t\t\t\t\tif (distSq > localThresholdSq) continue;\n\t\t\t\t\t\tinterRay.applyMatrix4(this.matrixWorld); //Move back to world space for distance calculation\n\n\t\t\t\t\t\tconst distance = raycaster.ray.origin.distanceTo(interRay);\n\t\t\t\t\t\tif (distance < raycaster.near || distance > raycaster.far) continue;\n\t\t\t\t\t\tintersects.push({\n\t\t\t\t\t\t\tdistance: distance,\n\t\t\t\t\t\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t\t\t\t\t\t// point: raycaster.ray.at( distance ),\n\t\t\t\t\t\t\tpoint: interSegment.clone().applyMatrix4(this.matrixWorld),\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tface: null,\n\t\t\t\t\t\t\tfaceIndex: null,\n\t\t\t\t\t\t\tobject: this\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.Line.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\t\t}\n\n\t\tupdateMorphTargets() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\t\tconst keys = Object.keys(morphAttributes);\n\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst morphAttribute = morphAttributes[keys[0]];\n\n\t\t\t\t\tif (morphAttribute !== undefined) {\n\t\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\t\tfor (let m = 0, ml = morphAttribute.length; m < ml; m++) {\n\t\t\t\t\t\t\tconst name = morphAttribute[m].name || String(m);\n\t\t\t\t\t\t\tthis.morphTargetInfluences.push(0);\n\t\t\t\t\t\t\tthis.morphTargetDictionary[name] = m;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\t\tif (morphTargets !== undefined && morphTargets.length > 0) {\n\t\t\t\t\tconsole.error('THREE.Line.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tLine.prototype.isLine = true;\n\n\tconst _start = /*@__PURE__*/new Vector3();\n\n\tconst _end = /*@__PURE__*/new Vector3();\n\n\tclass LineSegments extends Line {\n\t\tconstructor(geometry, material) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'LineSegments';\n\t\t}\n\n\t\tcomputeLineDistances() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\t// we assume non-indexed geometry\n\t\t\t\tif (geometry.index === null) {\n\t\t\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\t\t\tconst lineDistances = [];\n\n\t\t\t\t\tfor (let i = 0, l = positionAttribute.count; i < l; i += 2) {\n\t\t\t\t\t\t_start.fromBufferAttribute(positionAttribute, i);\n\n\t\t\t\t\t\t_end.fromBufferAttribute(positionAttribute, i + 1);\n\n\t\t\t\t\t\tlineDistances[i] = i === 0 ? 0 : lineDistances[i - 1];\n\t\t\t\t\t\tlineDistances[i + 1] = lineDistances[i] + _start.distanceTo(_end);\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setAttribute('lineDistance', new Float32BufferAttribute(lineDistances, 1));\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.');\n\t\t\t\t}\n\t\t\t} else if (geometry.isGeometry) {\n\t\t\t\tconsole.error('THREE.LineSegments.computeLineDistances() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineSegments.prototype.isLineSegments = true;\n\n\tclass LineLoop extends Line {\n\t\tconstructor(geometry, material) {\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'LineLoop';\n\t\t}\n\n\t}\n\n\tLineLoop.prototype.isLineLoop = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tsize: <float>,\n\t *\tsizeAttenuation: <bool>\n\t *\n\t * }\n\t */\n\n\tclass PointsMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PointsMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.map = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.size = 1;\n\t\t\tthis.sizeAttenuation = true;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.size = source.size;\n\t\t\tthis.sizeAttenuation = source.sizeAttenuation;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tPointsMaterial.prototype.isPointsMaterial = true;\n\n\tconst _inverseMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _ray = /*@__PURE__*/new Ray();\n\n\tconst _sphere = /*@__PURE__*/new Sphere();\n\n\tconst _position$2 = /*@__PURE__*/new Vector3();\n\n\tclass Points extends Object3D {\n\t\tconstructor(geometry = new BufferGeometry(), material = new PointsMaterial()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Points';\n\t\t\tthis.geometry = geometry;\n\t\t\tthis.material = material;\n\t\t\tthis.updateMorphTargets();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.material = source.material;\n\t\t\tthis.geometry = source.geometry;\n\t\t\treturn this;\n\t\t}\n\n\t\traycast(raycaster, intersects) {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst matrixWorld = this.matrixWorld;\n\t\t\tconst threshold = raycaster.params.Points.threshold;\n\t\t\tconst drawRange = geometry.drawRange; // Checking boundingSphere distance to ray\n\n\t\t\tif (geometry.boundingSphere === null) geometry.computeBoundingSphere();\n\n\t\t\t_sphere.copy(geometry.boundingSphere);\n\n\t\t\t_sphere.applyMatrix4(matrixWorld);\n\n\t\t\t_sphere.radius += threshold;\n\t\t\tif (raycaster.ray.intersectsSphere(_sphere) === false) return; //\n\n\t\t\t_inverseMatrix.copy(matrixWorld).invert();\n\n\t\t\t_ray.copy(raycaster.ray).applyMatrix4(_inverseMatrix);\n\n\t\t\tconst localThreshold = threshold / ((this.scale.x + this.scale.y + this.scale.z) / 3);\n\t\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst index = geometry.index;\n\t\t\t\tconst attributes = geometry.attributes;\n\t\t\t\tconst positionAttribute = attributes.position;\n\n\t\t\t\tif (index !== null) {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(index.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, il = end; i < il; i++) {\n\t\t\t\t\t\tconst a = index.getX(i);\n\n\t\t\t\t\t\t_position$2.fromBufferAttribute(positionAttribute, a);\n\n\t\t\t\t\t\ttestPoint(_position$2, a, localThresholdSq, matrixWorld, raycaster, intersects, this);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst start = Math.max(0, drawRange.start);\n\t\t\t\t\tconst end = Math.min(positionAttribute.count, drawRange.start + drawRange.count);\n\n\t\t\t\t\tfor (let i = start, l = end; i < l; i++) {\n\t\t\t\t\t\t_position$2.fromBufferAttribute(positionAttribute, i);\n\n\t\t\t\t\t\ttestPoint(_position$2, i, localThresholdSq, matrixWorld, raycaster, intersects, this);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.error('THREE.Points.raycast() no longer supports THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t}\n\t\t}\n\n\t\tupdateMorphTargets() {\n\t\t\tconst geometry = this.geometry;\n\n\t\t\tif (geometry.isBufferGeometry) {\n\t\t\t\tconst morphAttributes = geometry.morphAttributes;\n\t\t\t\tconst keys = Object.keys(morphAttributes);\n\n\t\t\t\tif (keys.length > 0) {\n\t\t\t\t\tconst morphAttribute = morphAttributes[keys[0]];\n\n\t\t\t\t\tif (morphAttribute !== undefined) {\n\t\t\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\t\t\tfor (let m = 0, ml = morphAttribute.length; m < ml; m++) {\n\t\t\t\t\t\t\tconst name = morphAttribute[m].name || String(m);\n\t\t\t\t\t\t\tthis.morphTargetInfluences.push(0);\n\t\t\t\t\t\t\tthis.morphTargetDictionary[name] = m;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconst morphTargets = geometry.morphTargets;\n\n\t\t\t\tif (morphTargets !== undefined && morphTargets.length > 0) {\n\t\t\t\t\tconsole.error('THREE.Points.updateMorphTargets() does not support THREE.Geometry. Use THREE.BufferGeometry instead.');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tPoints.prototype.isPoints = true;\n\n\tfunction testPoint(point, index, localThresholdSq, matrixWorld, raycaster, intersects, object) {\n\t\tconst rayPointDistanceSq = _ray.distanceSqToPoint(point);\n\n\t\tif (rayPointDistanceSq < localThresholdSq) {\n\t\t\tconst intersectPoint = new Vector3();\n\n\t\t\t_ray.closestPointToPoint(point, intersectPoint);\n\n\t\t\tintersectPoint.applyMatrix4(matrixWorld);\n\t\t\tconst distance = raycaster.ray.origin.distanceTo(intersectPoint);\n\t\t\tif (distance < raycaster.near || distance > raycaster.far) return;\n\t\t\tintersects.push({\n\t\t\t\tdistance: distance,\n\t\t\t\tdistanceToRay: Math.sqrt(rayPointDistanceSq),\n\t\t\t\tpoint: intersectPoint,\n\t\t\t\tindex: index,\n\t\t\t\tface: null,\n\t\t\t\tobject: object\n\t\t\t});\n\t\t}\n\t}\n\n\tclass VideoTexture extends Texture {\n\t\tconstructor(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {\n\t\t\tsuper(video, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);\n\t\t\tthis.format = format !== undefined ? format : RGBFormat;\n\t\t\tthis.minFilter = minFilter !== undefined ? minFilter : LinearFilter;\n\t\t\tthis.magFilter = magFilter !== undefined ? magFilter : LinearFilter;\n\t\t\tthis.generateMipmaps = false;\n\t\t\tconst scope = this;\n\n\t\t\tfunction updateVideo() {\n\t\t\t\tscope.needsUpdate = true;\n\t\t\t\tvideo.requestVideoFrameCallback(updateVideo);\n\t\t\t}\n\n\t\t\tif ('requestVideoFrameCallback' in video) {\n\t\t\t\tvideo.requestVideoFrameCallback(updateVideo);\n\t\t\t}\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor(this.image).copy(this);\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst video = this.image;\n\t\t\tconst hasVideoFrameCallback = ('requestVideoFrameCallback' in video);\n\n\t\t\tif (hasVideoFrameCallback === false && video.readyState >= video.HAVE_CURRENT_DATA) {\n\t\t\t\tthis.needsUpdate = true;\n\t\t\t}\n\t\t}\n\n\t}\n\n\tVideoTexture.prototype.isVideoTexture = true;\n\n\tclass CompressedTexture extends Texture {\n\t\tconstructor(mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, encoding) {\n\t\t\tsuper(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, encoding);\n\t\t\tthis.image = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t\tthis.mipmaps = mipmaps; // no flipping for cube textures\n\t\t\t// (also flipping doesn't work for compressed textures )\n\n\t\t\tthis.flipY = false; // can't generate mipmaps for compressed textures\n\t\t\t// mips must be embedded in DDS files\n\n\t\t\tthis.generateMipmaps = false;\n\t\t}\n\n\t}\n\n\tCompressedTexture.prototype.isCompressedTexture = true;\n\n\tclass CanvasTexture extends Texture {\n\t\tconstructor(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy) {\n\t\t\tsuper(canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);\n\t\t\tthis.needsUpdate = true;\n\t\t}\n\n\t}\n\n\tCanvasTexture.prototype.isCanvasTexture = true;\n\n\tclass DepthTexture extends Texture {\n\t\tconstructor(width, height, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, format) {\n\t\t\tformat = format !== undefined ? format : DepthFormat;\n\n\t\t\tif (format !== DepthFormat && format !== DepthStencilFormat) {\n\t\t\t\tthrow new Error('DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat');\n\t\t\t}\n\n\t\t\tif (type === undefined && format === DepthFormat) type = UnsignedShortType;\n\t\t\tif (type === undefined && format === DepthStencilFormat) type = UnsignedInt248Type;\n\t\t\tsuper(null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy);\n\t\t\tthis.image = {\n\t\t\t\twidth: width,\n\t\t\t\theight: height\n\t\t\t};\n\t\t\tthis.magFilter = magFilter !== undefined ? magFilter : NearestFilter;\n\t\t\tthis.minFilter = minFilter !== undefined ? minFilter : NearestFilter;\n\t\t\tthis.flipY = false;\n\t\t\tthis.generateMipmaps = false;\n\t\t}\n\n\t}\n\n\tDepthTexture.prototype.isDepthTexture = true;\n\n\tclass CircleGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, segments = 8, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CircleGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tsegments: segments,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\tsegments = Math.max(3, segments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst uv = new Vector2(); // center point\n\n\t\t\tvertices.push(0, 0, 0);\n\t\t\tnormals.push(0, 0, 1);\n\t\t\tuvs.push(0.5, 0.5);\n\n\t\t\tfor (let s = 0, i = 3; s <= segments; s++, i += 3) {\n\t\t\t\tconst segment = thetaStart + s / segments * thetaLength; // vertex\n\n\t\t\t\tvertex.x = radius * Math.cos(segment);\n\t\t\t\tvertex.y = radius * Math.sin(segment);\n\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\tnormals.push(0, 0, 1); // uvs\n\n\t\t\t\tuv.x = (vertices[i] / radius + 1) / 2;\n\t\t\t\tuv.y = (vertices[i + 1] / radius + 1) / 2;\n\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t} // indices\n\n\n\t\t\tfor (let i = 1; i <= segments; i++) {\n\t\t\t\tindices.push(i, i + 1, 0);\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new CircleGeometry(data.radius, data.segments, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass CylinderGeometry extends BufferGeometry {\n\t\tconstructor(radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CylinderGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradiusTop: radiusTop,\n\t\t\t\tradiusBottom: radiusBottom,\n\t\t\t\theight: height,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\topenEnded: openEnded,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\tconst scope = this;\n\t\t\tradialSegments = Math.floor(radialSegments);\n\t\t\theightSegments = Math.floor(heightSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tlet index = 0;\n\t\t\tconst indexArray = [];\n\t\t\tconst halfHeight = height / 2;\n\t\t\tlet groupStart = 0; // generate geometry\n\n\t\t\tgenerateTorso();\n\n\t\t\tif (openEnded === false) {\n\t\t\t\tif (radiusTop > 0) generateCap(true);\n\t\t\t\tif (radiusBottom > 0) generateCap(false);\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\n\t\t\tfunction generateTorso() {\n\t\t\t\tconst normal = new Vector3();\n\t\t\t\tconst vertex = new Vector3();\n\t\t\t\tlet groupCount = 0; // this will be used to calculate the normal\n\n\t\t\t\tconst slope = (radiusBottom - radiusTop) / height; // generate vertices, normals and uvs\n\n\t\t\t\tfor (let y = 0; y <= heightSegments; y++) {\n\t\t\t\t\tconst indexRow = [];\n\t\t\t\t\tconst v = y / heightSegments; // calculate the radius of the current row\n\n\t\t\t\t\tconst radius = v * (radiusBottom - radiusTop) + radiusTop;\n\n\t\t\t\t\tfor (let x = 0; x <= radialSegments; x++) {\n\t\t\t\t\t\tconst u = x / radialSegments;\n\t\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\t\t\t\t\t\tconst sinTheta = Math.sin(theta);\n\t\t\t\t\t\tconst cosTheta = Math.cos(theta); // vertex\n\n\t\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\t\tvertex.y = -v * height + halfHeight;\n\t\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\t\tnormal.set(sinTheta, slope, cosTheta).normalize();\n\t\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\t\tuvs.push(u, 1 - v); // save index of vertex in respective row\n\n\t\t\t\t\t\tindexRow.push(index++);\n\t\t\t\t\t} // now save vertices of the row in our index array\n\n\n\t\t\t\t\tindexArray.push(indexRow);\n\t\t\t\t} // generate indices\n\n\n\t\t\t\tfor (let x = 0; x < radialSegments; x++) {\n\t\t\t\t\tfor (let y = 0; y < heightSegments; y++) {\n\t\t\t\t\t\t// we use the index array to access the correct indices\n\t\t\t\t\t\tconst a = indexArray[y][x];\n\t\t\t\t\t\tconst b = indexArray[y + 1][x];\n\t\t\t\t\t\tconst c = indexArray[y + 1][x + 1];\n\t\t\t\t\t\tconst d = indexArray[y][x + 1]; // faces\n\n\t\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\t\tindices.push(b, c, d); // update group counter\n\n\t\t\t\t\t\tgroupCount += 6;\n\t\t\t\t\t}\n\t\t\t\t} // add a group to the geometry. this will ensure multi material support\n\n\n\t\t\t\tscope.addGroup(groupStart, groupCount, 0); // calculate new start value for groups\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t}\n\n\t\t\tfunction generateCap(top) {\n\t\t\t\t// save the index of the first center vertex\n\t\t\t\tconst centerIndexStart = index;\n\t\t\t\tconst uv = new Vector2();\n\t\t\t\tconst vertex = new Vector3();\n\t\t\t\tlet groupCount = 0;\n\t\t\t\tconst radius = top === true ? radiusTop : radiusBottom;\n\t\t\t\tconst sign = top === true ? 1 : -1; // first we generate the center vertex data of the cap.\n\t\t\t\t// because the geometry needs one set of uvs per face,\n\t\t\t\t// we must generate a center vertex per face/segment\n\n\t\t\t\tfor (let x = 1; x <= radialSegments; x++) {\n\t\t\t\t\t// vertex\n\t\t\t\t\tvertices.push(0, halfHeight * sign, 0); // normal\n\n\t\t\t\t\tnormals.push(0, sign, 0); // uv\n\n\t\t\t\t\tuvs.push(0.5, 0.5); // increase index\n\n\t\t\t\t\tindex++;\n\t\t\t\t} // save the index of the last center vertex\n\n\n\t\t\t\tconst centerIndexEnd = index; // now we generate the surrounding vertices, normals and uvs\n\n\t\t\t\tfor (let x = 0; x <= radialSegments; x++) {\n\t\t\t\t\tconst u = x / radialSegments;\n\t\t\t\t\tconst theta = u * thetaLength + thetaStart;\n\t\t\t\t\tconst cosTheta = Math.cos(theta);\n\t\t\t\t\tconst sinTheta = Math.sin(theta); // vertex\n\n\t\t\t\t\tvertex.x = radius * sinTheta;\n\t\t\t\t\tvertex.y = halfHeight * sign;\n\t\t\t\t\tvertex.z = radius * cosTheta;\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tnormals.push(0, sign, 0); // uv\n\n\t\t\t\t\tuv.x = cosTheta * 0.5 + 0.5;\n\t\t\t\t\tuv.y = sinTheta * 0.5 * sign + 0.5;\n\t\t\t\t\tuvs.push(uv.x, uv.y); // increase index\n\n\t\t\t\t\tindex++;\n\t\t\t\t} // generate indices\n\n\n\t\t\t\tfor (let x = 0; x < radialSegments; x++) {\n\t\t\t\t\tconst c = centerIndexStart + x;\n\t\t\t\t\tconst i = centerIndexEnd + x;\n\n\t\t\t\t\tif (top === true) {\n\t\t\t\t\t\t// face top\n\t\t\t\t\t\tindices.push(i, i + 1, c);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// face bottom\n\t\t\t\t\t\tindices.push(i + 1, i, c);\n\t\t\t\t\t}\n\n\t\t\t\t\tgroupCount += 3;\n\t\t\t\t} // add a group to the geometry. this will ensure multi material support\n\n\n\t\t\t\tscope.addGroup(groupStart, groupCount, top === true ? 1 : 2); // calculate new start value for groups\n\n\t\t\t\tgroupStart += groupCount;\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new CylinderGeometry(data.radiusTop, data.radiusBottom, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass ConeGeometry extends CylinderGeometry {\n\t\tconstructor(radius = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper(0, radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength);\n\t\t\tthis.type = 'ConeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\theight: height,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\topenEnded: openEnded,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new ConeGeometry(data.radius, data.height, data.radialSegments, data.heightSegments, data.openEnded, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass PolyhedronGeometry extends BufferGeometry {\n\t\tconstructor(vertices = [], indices = [], radius = 1, detail = 0) {\n\t\t\tsuper();\n\t\t\tthis.type = 'PolyhedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tvertices: vertices,\n\t\t\t\tindices: indices,\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t}; // default buffer data\n\n\t\t\tconst vertexBuffer = [];\n\t\t\tconst uvBuffer = []; // the subdivision creates the vertex buffer data\n\n\t\t\tsubdivide(detail); // all vertices should lie on a conceptual sphere with a given radius\n\n\t\t\tapplyRadius(radius); // finally, create the uv data\n\n\t\t\tgenerateUVs(); // build non-indexed geometry\n\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertexBuffer, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(vertexBuffer.slice(), 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvBuffer, 2));\n\n\t\t\tif (detail === 0) {\n\t\t\t\tthis.computeVertexNormals(); // flat normals\n\t\t\t} else {\n\t\t\t\tthis.normalizeNormals(); // smooth normals\n\t\t\t} // helper functions\n\n\n\t\t\tfunction subdivide(detail) {\n\t\t\t\tconst a = new Vector3();\n\t\t\t\tconst b = new Vector3();\n\t\t\t\tconst c = new Vector3(); // iterate over all faces and apply a subdivison with the given detail value\n\n\t\t\t\tfor (let i = 0; i < indices.length; i += 3) {\n\t\t\t\t\t// get the vertices of the face\n\t\t\t\t\tgetVertexByIndex(indices[i + 0], a);\n\t\t\t\t\tgetVertexByIndex(indices[i + 1], b);\n\t\t\t\t\tgetVertexByIndex(indices[i + 2], c); // perform subdivision\n\n\t\t\t\t\tsubdivideFace(a, b, c, detail);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction subdivideFace(a, b, c, detail) {\n\t\t\t\tconst cols = detail + 1; // we use this multidimensional array as a data structure for creating the subdivision\n\n\t\t\t\tconst v = []; // construct all of the vertices for this subdivision\n\n\t\t\t\tfor (let i = 0; i <= cols; i++) {\n\t\t\t\t\tv[i] = [];\n\t\t\t\t\tconst aj = a.clone().lerp(c, i / cols);\n\t\t\t\t\tconst bj = b.clone().lerp(c, i / cols);\n\t\t\t\t\tconst rows = cols - i;\n\n\t\t\t\t\tfor (let j = 0; j <= rows; j++) {\n\t\t\t\t\t\tif (j === 0 && i === cols) {\n\t\t\t\t\t\t\tv[i][j] = aj;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tv[i][j] = aj.clone().lerp(bj, j / rows);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // construct all of the faces\n\n\n\t\t\t\tfor (let i = 0; i < cols; i++) {\n\t\t\t\t\tfor (let j = 0; j < 2 * (cols - i) - 1; j++) {\n\t\t\t\t\t\tconst k = Math.floor(j / 2);\n\n\t\t\t\t\t\tif (j % 2 === 0) {\n\t\t\t\t\t\t\tpushVertex(v[i][k + 1]);\n\t\t\t\t\t\t\tpushVertex(v[i + 1][k]);\n\t\t\t\t\t\t\tpushVertex(v[i][k]);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tpushVertex(v[i][k + 1]);\n\t\t\t\t\t\t\tpushVertex(v[i + 1][k + 1]);\n\t\t\t\t\t\t\tpushVertex(v[i + 1][k]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction applyRadius(radius) {\n\t\t\t\tconst vertex = new Vector3(); // iterate over the entire buffer and apply the radius to each vertex\n\n\t\t\t\tfor (let i = 0; i < vertexBuffer.length; i += 3) {\n\t\t\t\t\tvertex.x = vertexBuffer[i + 0];\n\t\t\t\t\tvertex.y = vertexBuffer[i + 1];\n\t\t\t\t\tvertex.z = vertexBuffer[i + 2];\n\t\t\t\t\tvertex.normalize().multiplyScalar(radius);\n\t\t\t\t\tvertexBuffer[i + 0] = vertex.x;\n\t\t\t\t\tvertexBuffer[i + 1] = vertex.y;\n\t\t\t\t\tvertexBuffer[i + 2] = vertex.z;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction generateUVs() {\n\t\t\t\tconst vertex = new Vector3();\n\n\t\t\t\tfor (let i = 0; i < vertexBuffer.length; i += 3) {\n\t\t\t\t\tvertex.x = vertexBuffer[i + 0];\n\t\t\t\t\tvertex.y = vertexBuffer[i + 1];\n\t\t\t\t\tvertex.z = vertexBuffer[i + 2];\n\t\t\t\t\tconst u = azimuth(vertex) / 2 / Math.PI + 0.5;\n\t\t\t\t\tconst v = inclination(vertex) / Math.PI + 0.5;\n\t\t\t\t\tuvBuffer.push(u, 1 - v);\n\t\t\t\t}\n\n\t\t\t\tcorrectUVs();\n\t\t\t\tcorrectSeam();\n\t\t\t}\n\n\t\t\tfunction correctSeam() {\n\t\t\t\t// handle case when face straddles the seam, see #3269\n\t\t\t\tfor (let i = 0; i < uvBuffer.length; i += 6) {\n\t\t\t\t\t// uv data of a single face\n\t\t\t\t\tconst x0 = uvBuffer[i + 0];\n\t\t\t\t\tconst x1 = uvBuffer[i + 2];\n\t\t\t\t\tconst x2 = uvBuffer[i + 4];\n\t\t\t\t\tconst max = Math.max(x0, x1, x2);\n\t\t\t\t\tconst min = Math.min(x0, x1, x2); // 0.9 is somewhat arbitrary\n\n\t\t\t\t\tif (max > 0.9 && min < 0.1) {\n\t\t\t\t\t\tif (x0 < 0.2) uvBuffer[i + 0] += 1;\n\t\t\t\t\t\tif (x1 < 0.2) uvBuffer[i + 2] += 1;\n\t\t\t\t\t\tif (x2 < 0.2) uvBuffer[i + 4] += 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction pushVertex(vertex) {\n\t\t\t\tvertexBuffer.push(vertex.x, vertex.y, vertex.z);\n\t\t\t}\n\n\t\t\tfunction getVertexByIndex(index, vertex) {\n\t\t\t\tconst stride = index * 3;\n\t\t\t\tvertex.x = vertices[stride + 0];\n\t\t\t\tvertex.y = vertices[stride + 1];\n\t\t\t\tvertex.z = vertices[stride + 2];\n\t\t\t}\n\n\t\t\tfunction correctUVs() {\n\t\t\t\tconst a = new Vector3();\n\t\t\t\tconst b = new Vector3();\n\t\t\t\tconst c = new Vector3();\n\t\t\t\tconst centroid = new Vector3();\n\t\t\t\tconst uvA = new Vector2();\n\t\t\t\tconst uvB = new Vector2();\n\t\t\t\tconst uvC = new Vector2();\n\n\t\t\t\tfor (let i = 0, j = 0; i < vertexBuffer.length; i += 9, j += 6) {\n\t\t\t\t\ta.set(vertexBuffer[i + 0], vertexBuffer[i + 1], vertexBuffer[i + 2]);\n\t\t\t\t\tb.set(vertexBuffer[i + 3], vertexBuffer[i + 4], vertexBuffer[i + 5]);\n\t\t\t\t\tc.set(vertexBuffer[i + 6], vertexBuffer[i + 7], vertexBuffer[i + 8]);\n\t\t\t\t\tuvA.set(uvBuffer[j + 0], uvBuffer[j + 1]);\n\t\t\t\t\tuvB.set(uvBuffer[j + 2], uvBuffer[j + 3]);\n\t\t\t\t\tuvC.set(uvBuffer[j + 4], uvBuffer[j + 5]);\n\t\t\t\t\tcentroid.copy(a).add(b).add(c).divideScalar(3);\n\t\t\t\t\tconst azi = azimuth(centroid);\n\t\t\t\t\tcorrectUV(uvA, j + 0, a, azi);\n\t\t\t\t\tcorrectUV(uvB, j + 2, b, azi);\n\t\t\t\t\tcorrectUV(uvC, j + 4, c, azi);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction correctUV(uv, stride, vector, azimuth) {\n\t\t\t\tif (azimuth < 0 && uv.x === 1) {\n\t\t\t\t\tuvBuffer[stride] = uv.x - 1;\n\t\t\t\t}\n\n\t\t\t\tif (vector.x === 0 && vector.z === 0) {\n\t\t\t\t\tuvBuffer[stride] = azimuth / 2 / Math.PI + 0.5;\n\t\t\t\t}\n\t\t\t} // Angle around the Y axis, counter-clockwise when looking from above.\n\n\n\t\t\tfunction azimuth(vector) {\n\t\t\t\treturn Math.atan2(vector.z, -vector.x);\n\t\t\t} // Angle above the XZ plane.\n\n\n\t\t\tfunction inclination(vector) {\n\t\t\t\treturn Math.atan2(-vector.y, Math.sqrt(vector.x * vector.x + vector.z * vector.z));\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new PolyhedronGeometry(data.vertices, data.indices, data.radius, data.details);\n\t\t}\n\n\t}\n\n\tclass DodecahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst t = (1 + Math.sqrt(5)) / 2;\n\t\t\tconst r = 1 / t;\n\t\t\tconst vertices = [// (±1, ±1, ±1)\n\t\t\t-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, // (0, ±1/φ, ±φ)\n\t\t\t0, -r, -t, 0, -r, t, 0, r, -t, 0, r, t, // (±1/φ, ±φ, 0)\n\t\t\t-r, -t, 0, -r, t, 0, r, -t, 0, r, t, 0, // (±φ, 0, ±1/φ)\n\t\t\t-t, 0, -r, t, 0, -r, -t, 0, r, t, 0, r];\n\t\t\tconst indices = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'DodecahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new DodecahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tconst _v0 = new Vector3();\n\n\tconst _v1$1 = new Vector3();\n\n\tconst _normal = new Vector3();\n\n\tconst _triangle = new Triangle();\n\n\tclass EdgesGeometry extends BufferGeometry {\n\t\tconstructor(geometry = null, thresholdAngle = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'EdgesGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tgeometry: geometry,\n\t\t\t\tthresholdAngle: thresholdAngle\n\t\t\t};\n\n\t\t\tif (geometry !== null) {\n\t\t\t\tconst precisionPoints = 4;\n\t\t\t\tconst precision = Math.pow(10, precisionPoints);\n\t\t\t\tconst thresholdDot = Math.cos(DEG2RAD * thresholdAngle);\n\t\t\t\tconst indexAttr = geometry.getIndex();\n\t\t\t\tconst positionAttr = geometry.getAttribute('position');\n\t\t\t\tconst indexCount = indexAttr ? indexAttr.count : positionAttr.count;\n\t\t\t\tconst indexArr = [0, 0, 0];\n\t\t\t\tconst vertKeys = ['a', 'b', 'c'];\n\t\t\t\tconst hashes = new Array(3);\n\t\t\t\tconst edgeData = {};\n\t\t\t\tconst vertices = [];\n\n\t\t\t\tfor (let i = 0; i < indexCount; i += 3) {\n\t\t\t\t\tif (indexAttr) {\n\t\t\t\t\t\tindexArr[0] = indexAttr.getX(i);\n\t\t\t\t\t\tindexArr[1] = indexAttr.getX(i + 1);\n\t\t\t\t\t\tindexArr[2] = indexAttr.getX(i + 2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tindexArr[0] = i;\n\t\t\t\t\t\tindexArr[1] = i + 1;\n\t\t\t\t\t\tindexArr[2] = i + 2;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst {\n\t\t\t\t\t\ta,\n\t\t\t\t\t\tb,\n\t\t\t\t\t\tc\n\t\t\t\t\t} = _triangle;\n\t\t\t\t\ta.fromBufferAttribute(positionAttr, indexArr[0]);\n\t\t\t\t\tb.fromBufferAttribute(positionAttr, indexArr[1]);\n\t\t\t\t\tc.fromBufferAttribute(positionAttr, indexArr[2]);\n\n\t\t\t\t\t_triangle.getNormal(_normal); // create hashes for the edge from the vertices\n\n\n\t\t\t\t\thashes[0] = `${Math.round(a.x * precision)},${Math.round(a.y * precision)},${Math.round(a.z * precision)}`;\n\t\t\t\t\thashes[1] = `${Math.round(b.x * precision)},${Math.round(b.y * precision)},${Math.round(b.z * precision)}`;\n\t\t\t\t\thashes[2] = `${Math.round(c.x * precision)},${Math.round(c.y * precision)},${Math.round(c.z * precision)}`; // skip degenerate triangles\n\n\t\t\t\t\tif (hashes[0] === hashes[1] || hashes[1] === hashes[2] || hashes[2] === hashes[0]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t} // iterate over every edge\n\n\n\t\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\t\t// get the first and next vertex making up the edge\n\t\t\t\t\t\tconst jNext = (j + 1) % 3;\n\t\t\t\t\t\tconst vecHash0 = hashes[j];\n\t\t\t\t\t\tconst vecHash1 = hashes[jNext];\n\t\t\t\t\t\tconst v0 = _triangle[vertKeys[j]];\n\t\t\t\t\t\tconst v1 = _triangle[vertKeys[jNext]];\n\t\t\t\t\t\tconst hash = `${vecHash0}_${vecHash1}`;\n\t\t\t\t\t\tconst reverseHash = `${vecHash1}_${vecHash0}`;\n\n\t\t\t\t\t\tif (reverseHash in edgeData && edgeData[reverseHash]) {\n\t\t\t\t\t\t\t// if we found a sibling edge add it into the vertex array if\n\t\t\t\t\t\t\t// it meets the angle threshold and delete the edge from the map.\n\t\t\t\t\t\t\tif (_normal.dot(edgeData[reverseHash].normal) <= thresholdDot) {\n\t\t\t\t\t\t\t\tvertices.push(v0.x, v0.y, v0.z);\n\t\t\t\t\t\t\t\tvertices.push(v1.x, v1.y, v1.z);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tedgeData[reverseHash] = null;\n\t\t\t\t\t\t} else if (!(hash in edgeData)) {\n\t\t\t\t\t\t\t// if we've already got an edge here then skip adding a new one\n\t\t\t\t\t\t\tedgeData[hash] = {\n\t\t\t\t\t\t\t\tindex0: indexArr[j],\n\t\t\t\t\t\t\t\tindex1: indexArr[jNext],\n\t\t\t\t\t\t\t\tnormal: _normal.clone()\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // iterate over all remaining, unmatched edges and add them to the vertex array\n\n\n\t\t\t\tfor (const key in edgeData) {\n\t\t\t\t\tif (edgeData[key]) {\n\t\t\t\t\t\tconst {\n\t\t\t\t\t\t\tindex0,\n\t\t\t\t\t\t\tindex1\n\t\t\t\t\t\t} = edgeData[key];\n\n\t\t\t\t\t\t_v0.fromBufferAttribute(positionAttr, index0);\n\n\t\t\t\t\t\t_v1$1.fromBufferAttribute(positionAttr, index1);\n\n\t\t\t\t\t\tvertices.push(_v0.x, _v0.y, _v0.z);\n\t\t\t\t\t\tvertices.push(_v1$1.x, _v1$1.y, _v1$1.z);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\t}\n\t\t}\n\n\t}\n\n\t/**\n\t * Extensible curve object.\n\t *\n\t * Some common of curve methods:\n\t * .getPoint( t, optionalTarget ), .getTangent( t, optionalTarget )\n\t * .getPointAt( u, optionalTarget ), .getTangentAt( u, optionalTarget )\n\t * .getPoints(), .getSpacedPoints()\n\t * .getLength()\n\t * .updateArcLengths()\n\t *\n\t * This following curves inherit from THREE.Curve:\n\t *\n\t * -- 2D curves --\n\t * THREE.ArcCurve\n\t * THREE.CubicBezierCurve\n\t * THREE.EllipseCurve\n\t * THREE.LineCurve\n\t * THREE.QuadraticBezierCurve\n\t * THREE.SplineCurve\n\t *\n\t * -- 3D curves --\n\t * THREE.CatmullRomCurve3\n\t * THREE.CubicBezierCurve3\n\t * THREE.LineCurve3\n\t * THREE.QuadraticBezierCurve3\n\t *\n\t * A series of curves can be represented as a THREE.CurvePath.\n\t *\n\t **/\n\n\tclass Curve {\n\t\tconstructor() {\n\t\t\tthis.type = 'Curve';\n\t\t\tthis.arcLengthDivisions = 200;\n\t\t} // Virtual base class method to overwrite and implement in subclasses\n\t\t//\t- t [0 .. 1]\n\n\n\t\tgetPoint() {\n\t\t\tconsole.warn('THREE.Curve: .getPoint() not implemented.');\n\t\t\treturn null;\n\t\t} // Get point at relative position in curve according to arc length\n\t\t// - u [0 .. 1]\n\n\n\t\tgetPointAt(u, optionalTarget) {\n\t\t\tconst t = this.getUtoTmapping(u);\n\t\t\treturn this.getPoint(t, optionalTarget);\n\t\t} // Get sequence of points using getPoint( t )\n\n\n\t\tgetPoints(divisions = 5) {\n\t\t\tconst points = [];\n\n\t\t\tfor (let d = 0; d <= divisions; d++) {\n\t\t\t\tpoints.push(this.getPoint(d / divisions));\n\t\t\t}\n\n\t\t\treturn points;\n\t\t} // Get sequence of points using getPointAt( u )\n\n\n\t\tgetSpacedPoints(divisions = 5) {\n\t\t\tconst points = [];\n\n\t\t\tfor (let d = 0; d <= divisions; d++) {\n\t\t\t\tpoints.push(this.getPointAt(d / divisions));\n\t\t\t}\n\n\t\t\treturn points;\n\t\t} // Get total curve arc length\n\n\n\t\tgetLength() {\n\t\t\tconst lengths = this.getLengths();\n\t\t\treturn lengths[lengths.length - 1];\n\t\t} // Get list of cumulative segment lengths\n\n\n\t\tgetLengths(divisions = this.arcLengthDivisions) {\n\t\t\tif (this.cacheArcLengths && this.cacheArcLengths.length === divisions + 1 && !this.needsUpdate) {\n\t\t\t\treturn this.cacheArcLengths;\n\t\t\t}\n\n\t\t\tthis.needsUpdate = false;\n\t\t\tconst cache = [];\n\t\t\tlet current,\n\t\t\t\t\tlast = this.getPoint(0);\n\t\t\tlet sum = 0;\n\t\t\tcache.push(0);\n\n\t\t\tfor (let p = 1; p <= divisions; p++) {\n\t\t\t\tcurrent = this.getPoint(p / divisions);\n\t\t\t\tsum += current.distanceTo(last);\n\t\t\t\tcache.push(sum);\n\t\t\t\tlast = current;\n\t\t\t}\n\n\t\t\tthis.cacheArcLengths = cache;\n\t\t\treturn cache; // { sums: cache, sum: sum }; Sum is in the last element.\n\t\t}\n\n\t\tupdateArcLengths() {\n\t\t\tthis.needsUpdate = true;\n\t\t\tthis.getLengths();\n\t\t} // Given u ( 0 .. 1 ), get a t to find p. This gives you points which are equidistant\n\n\n\t\tgetUtoTmapping(u, distance) {\n\t\t\tconst arcLengths = this.getLengths();\n\t\t\tlet i = 0;\n\t\t\tconst il = arcLengths.length;\n\t\t\tlet targetArcLength; // The targeted u distance value to get\n\n\t\t\tif (distance) {\n\t\t\t\ttargetArcLength = distance;\n\t\t\t} else {\n\t\t\t\ttargetArcLength = u * arcLengths[il - 1];\n\t\t\t} // binary search for the index with largest value smaller than target u distance\n\n\n\t\t\tlet low = 0,\n\t\t\t\t\thigh = il - 1,\n\t\t\t\t\tcomparison;\n\n\t\t\twhile (low <= high) {\n\t\t\t\ti = Math.floor(low + (high - low) / 2); // less likely to overflow, though probably not issue here, JS doesn't really have integers, all numbers are floats\n\n\t\t\t\tcomparison = arcLengths[i] - targetArcLength;\n\n\t\t\t\tif (comparison < 0) {\n\t\t\t\t\tlow = i + 1;\n\t\t\t\t} else if (comparison > 0) {\n\t\t\t\t\thigh = i - 1;\n\t\t\t\t} else {\n\t\t\t\t\thigh = i;\n\t\t\t\t\tbreak; // DONE\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti = high;\n\n\t\t\tif (arcLengths[i] === targetArcLength) {\n\t\t\t\treturn i / (il - 1);\n\t\t\t} // we could get finer grain at lengths, or use simple interpolation between two points\n\n\n\t\t\tconst lengthBefore = arcLengths[i];\n\t\t\tconst lengthAfter = arcLengths[i + 1];\n\t\t\tconst segmentLength = lengthAfter - lengthBefore; // determine where we are between the 'before' and 'after' points\n\n\t\t\tconst segmentFraction = (targetArcLength - lengthBefore) / segmentLength; // add that fractional amount to t\n\n\t\t\tconst t = (i + segmentFraction) / (il - 1);\n\t\t\treturn t;\n\t\t} // Returns a unit vector tangent at t\n\t\t// In case any sub curve does not implement its tangent derivation,\n\t\t// 2 points a small delta apart will be used to find its gradient\n\t\t// which seems to give a reasonable approximation\n\n\n\t\tgetTangent(t, optionalTarget) {\n\t\t\tconst delta = 0.0001;\n\t\t\tlet t1 = t - delta;\n\t\t\tlet t2 = t + delta; // Capping in case of danger\n\n\t\t\tif (t1 < 0) t1 = 0;\n\t\t\tif (t2 > 1) t2 = 1;\n\t\t\tconst pt1 = this.getPoint(t1);\n\t\t\tconst pt2 = this.getPoint(t2);\n\t\t\tconst tangent = optionalTarget || (pt1.isVector2 ? new Vector2() : new Vector3());\n\t\t\ttangent.copy(pt2).sub(pt1).normalize();\n\t\t\treturn tangent;\n\t\t}\n\n\t\tgetTangentAt(u, optionalTarget) {\n\t\t\tconst t = this.getUtoTmapping(u);\n\t\t\treturn this.getTangent(t, optionalTarget);\n\t\t}\n\n\t\tcomputeFrenetFrames(segments, closed) {\n\t\t\t// see http://www.cs.indiana.edu/pub/techreports/TR425.pdf\n\t\t\tconst normal = new Vector3();\n\t\t\tconst tangents = [];\n\t\t\tconst normals = [];\n\t\t\tconst binormals = [];\n\t\t\tconst vec = new Vector3();\n\t\t\tconst mat = new Matrix4(); // compute the tangent vectors for each segment on the curve\n\n\t\t\tfor (let i = 0; i <= segments; i++) {\n\t\t\t\tconst u = i / segments;\n\t\t\t\ttangents[i] = this.getTangentAt(u, new Vector3());\n\t\t\t} // select an initial normal vector perpendicular to the first tangent vector,\n\t\t\t// and in the direction of the minimum tangent xyz component\n\n\n\t\t\tnormals[0] = new Vector3();\n\t\t\tbinormals[0] = new Vector3();\n\t\t\tlet min = Number.MAX_VALUE;\n\t\t\tconst tx = Math.abs(tangents[0].x);\n\t\t\tconst ty = Math.abs(tangents[0].y);\n\t\t\tconst tz = Math.abs(tangents[0].z);\n\n\t\t\tif (tx <= min) {\n\t\t\t\tmin = tx;\n\t\t\t\tnormal.set(1, 0, 0);\n\t\t\t}\n\n\t\t\tif (ty <= min) {\n\t\t\t\tmin = ty;\n\t\t\t\tnormal.set(0, 1, 0);\n\t\t\t}\n\n\t\t\tif (tz <= min) {\n\t\t\t\tnormal.set(0, 0, 1);\n\t\t\t}\n\n\t\t\tvec.crossVectors(tangents[0], normal).normalize();\n\t\t\tnormals[0].crossVectors(tangents[0], vec);\n\t\t\tbinormals[0].crossVectors(tangents[0], normals[0]); // compute the slowly-varying normal and binormal vectors for each segment on the curve\n\n\t\t\tfor (let i = 1; i <= segments; i++) {\n\t\t\t\tnormals[i] = normals[i - 1].clone();\n\t\t\t\tbinormals[i] = binormals[i - 1].clone();\n\t\t\t\tvec.crossVectors(tangents[i - 1], tangents[i]);\n\n\t\t\t\tif (vec.length() > Number.EPSILON) {\n\t\t\t\t\tvec.normalize();\n\t\t\t\t\tconst theta = Math.acos(clamp(tangents[i - 1].dot(tangents[i]), -1, 1)); // clamp for floating pt errors\n\n\t\t\t\t\tnormals[i].applyMatrix4(mat.makeRotationAxis(vec, theta));\n\t\t\t\t}\n\n\t\t\t\tbinormals[i].crossVectors(tangents[i], normals[i]);\n\t\t\t} // if the curve is closed, postprocess the vectors so the first and last normal vectors are the same\n\n\n\t\t\tif (closed === true) {\n\t\t\t\tlet theta = Math.acos(clamp(normals[0].dot(normals[segments]), -1, 1));\n\t\t\t\ttheta /= segments;\n\n\t\t\t\tif (tangents[0].dot(vec.crossVectors(normals[0], normals[segments])) > 0) {\n\t\t\t\t\ttheta = -theta;\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 1; i <= segments; i++) {\n\t\t\t\t\t// twist a little...\n\t\t\t\t\tnormals[i].applyMatrix4(mat.makeRotationAxis(tangents[i], theta * i));\n\t\t\t\t\tbinormals[i].crossVectors(tangents[i], normals[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttangents: tangents,\n\t\t\t\tnormals: normals,\n\t\t\t\tbinormals: binormals\n\t\t\t};\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.arcLengthDivisions = source.arcLengthDivisions;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = {\n\t\t\t\tmetadata: {\n\t\t\t\t\tversion: 4.5,\n\t\t\t\t\ttype: 'Curve',\n\t\t\t\t\tgenerator: 'Curve.toJSON'\n\t\t\t\t}\n\t\t\t};\n\t\t\tdata.arcLengthDivisions = this.arcLengthDivisions;\n\t\t\tdata.type = this.type;\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tthis.arcLengthDivisions = json.arcLengthDivisions;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass EllipseCurve extends Curve {\n\t\tconstructor(aX = 0, aY = 0, xRadius = 1, yRadius = 1, aStartAngle = 0, aEndAngle = Math.PI * 2, aClockwise = false, aRotation = 0) {\n\t\t\tsuper();\n\t\t\tthis.type = 'EllipseCurve';\n\t\t\tthis.aX = aX;\n\t\t\tthis.aY = aY;\n\t\t\tthis.xRadius = xRadius;\n\t\t\tthis.yRadius = yRadius;\n\t\t\tthis.aStartAngle = aStartAngle;\n\t\t\tthis.aEndAngle = aEndAngle;\n\t\t\tthis.aClockwise = aClockwise;\n\t\t\tthis.aRotation = aRotation;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget) {\n\t\t\tconst point = optionalTarget || new Vector2();\n\t\t\tconst twoPi = Math.PI * 2;\n\t\t\tlet deltaAngle = this.aEndAngle - this.aStartAngle;\n\t\t\tconst samePoints = Math.abs(deltaAngle) < Number.EPSILON; // ensures that deltaAngle is 0 .. 2 PI\n\n\t\t\twhile (deltaAngle < 0) deltaAngle += twoPi;\n\n\t\t\twhile (deltaAngle > twoPi) deltaAngle -= twoPi;\n\n\t\t\tif (deltaAngle < Number.EPSILON) {\n\t\t\t\tif (samePoints) {\n\t\t\t\t\tdeltaAngle = 0;\n\t\t\t\t} else {\n\t\t\t\t\tdeltaAngle = twoPi;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.aClockwise === true && !samePoints) {\n\t\t\t\tif (deltaAngle === twoPi) {\n\t\t\t\t\tdeltaAngle = -twoPi;\n\t\t\t\t} else {\n\t\t\t\t\tdeltaAngle = deltaAngle - twoPi;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst angle = this.aStartAngle + t * deltaAngle;\n\t\t\tlet x = this.aX + this.xRadius * Math.cos(angle);\n\t\t\tlet y = this.aY + this.yRadius * Math.sin(angle);\n\n\t\t\tif (this.aRotation !== 0) {\n\t\t\t\tconst cos = Math.cos(this.aRotation);\n\t\t\t\tconst sin = Math.sin(this.aRotation);\n\t\t\t\tconst tx = x - this.aX;\n\t\t\t\tconst ty = y - this.aY; // Rotate the point about the center of the ellipse.\n\n\t\t\t\tx = tx * cos - ty * sin + this.aX;\n\t\t\t\ty = tx * sin + ty * cos + this.aY;\n\t\t\t}\n\n\t\t\treturn point.set(x, y);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.aX = source.aX;\n\t\t\tthis.aY = source.aY;\n\t\t\tthis.xRadius = source.xRadius;\n\t\t\tthis.yRadius = source.yRadius;\n\t\t\tthis.aStartAngle = source.aStartAngle;\n\t\t\tthis.aEndAngle = source.aEndAngle;\n\t\t\tthis.aClockwise = source.aClockwise;\n\t\t\tthis.aRotation = source.aRotation;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.aX = this.aX;\n\t\t\tdata.aY = this.aY;\n\t\t\tdata.xRadius = this.xRadius;\n\t\t\tdata.yRadius = this.yRadius;\n\t\t\tdata.aStartAngle = this.aStartAngle;\n\t\t\tdata.aEndAngle = this.aEndAngle;\n\t\t\tdata.aClockwise = this.aClockwise;\n\t\t\tdata.aRotation = this.aRotation;\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.aX = json.aX;\n\t\t\tthis.aY = json.aY;\n\t\t\tthis.xRadius = json.xRadius;\n\t\t\tthis.yRadius = json.yRadius;\n\t\t\tthis.aStartAngle = json.aStartAngle;\n\t\t\tthis.aEndAngle = json.aEndAngle;\n\t\t\tthis.aClockwise = json.aClockwise;\n\t\t\tthis.aRotation = json.aRotation;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tEllipseCurve.prototype.isEllipseCurve = true;\n\n\tclass ArcCurve extends EllipseCurve {\n\t\tconstructor(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {\n\t\t\tsuper(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);\n\t\t\tthis.type = 'ArcCurve';\n\t\t}\n\n\t}\n\n\tArcCurve.prototype.isArcCurve = true;\n\n\t/**\n\t * Centripetal CatmullRom Curve - which is useful for avoiding\n\t * cusps and self-intersections in non-uniform catmull rom curves.\n\t * http://www.cemyuksel.com/research/catmullrom_param/catmullrom.pdf\n\t *\n\t * curve.type accepts centripetal(default), chordal and catmullrom\n\t * curve.tension is used for catmullrom which defaults to 0.5\n\t */\n\n\t/*\n\tBased on an optimized c++ solution in\n\t - http://stackoverflow.com/questions/9489736/catmull-rom-curve-with-no-cusps-and-no-self-intersections/\n\t - http://ideone.com/NoEbVM\n\n\tThis CubicPoly class could be used for reusing some variables and calculations,\n\tbut for three.js curve use, it could be possible inlined and flatten into a single function call\n\twhich can be placed in CurveUtils.\n\t*/\n\n\tfunction CubicPoly() {\n\t\tlet c0 = 0,\n\t\t\t\tc1 = 0,\n\t\t\t\tc2 = 0,\n\t\t\t\tc3 = 0;\n\t\t/*\n\t\t * Compute coefficients for a cubic polynomial\n\t\t *\t p(s) = c0 + c1*s + c2*s^2 + c3*s^3\n\t\t * such that\n\t\t *\t p(0) = x0, p(1) = x1\n\t\t *\tand\n\t\t *\t p'(0) = t0, p'(1) = t1.\n\t\t */\n\n\t\tfunction init(x0, x1, t0, t1) {\n\t\t\tc0 = x0;\n\t\t\tc1 = t0;\n\t\t\tc2 = -3 * x0 + 3 * x1 - 2 * t0 - t1;\n\t\t\tc3 = 2 * x0 - 2 * x1 + t0 + t1;\n\t\t}\n\n\t\treturn {\n\t\t\tinitCatmullRom: function (x0, x1, x2, x3, tension) {\n\t\t\t\tinit(x1, x2, tension * (x2 - x0), tension * (x3 - x1));\n\t\t\t},\n\t\t\tinitNonuniformCatmullRom: function (x0, x1, x2, x3, dt0, dt1, dt2) {\n\t\t\t\t// compute tangents when parameterized in [t1,t2]\n\t\t\t\tlet t1 = (x1 - x0) / dt0 - (x2 - x0) / (dt0 + dt1) + (x2 - x1) / dt1;\n\t\t\t\tlet t2 = (x2 - x1) / dt1 - (x3 - x1) / (dt1 + dt2) + (x3 - x2) / dt2; // rescale tangents for parametrization in [0,1]\n\n\t\t\t\tt1 *= dt1;\n\t\t\t\tt2 *= dt1;\n\t\t\t\tinit(x1, x2, t1, t2);\n\t\t\t},\n\t\t\tcalc: function (t) {\n\t\t\t\tconst t2 = t * t;\n\t\t\t\tconst t3 = t2 * t;\n\t\t\t\treturn c0 + c1 * t + c2 * t2 + c3 * t3;\n\t\t\t}\n\t\t};\n\t} //\n\n\n\tconst tmp = new Vector3();\n\tconst px = new CubicPoly(),\n\t\t\t\tpy = new CubicPoly(),\n\t\t\t\tpz = new CubicPoly();\n\n\tclass CatmullRomCurve3 extends Curve {\n\t\tconstructor(points = [], closed = false, curveType = 'centripetal', tension = 0.5) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CatmullRomCurve3';\n\t\t\tthis.points = points;\n\t\t\tthis.closed = closed;\n\t\t\tthis.curveType = curveType;\n\t\t\tthis.tension = tension;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst points = this.points;\n\t\t\tconst l = points.length;\n\t\t\tconst p = (l - (this.closed ? 0 : 1)) * t;\n\t\t\tlet intPoint = Math.floor(p);\n\t\t\tlet weight = p - intPoint;\n\n\t\t\tif (this.closed) {\n\t\t\t\tintPoint += intPoint > 0 ? 0 : (Math.floor(Math.abs(intPoint) / l) + 1) * l;\n\t\t\t} else if (weight === 0 && intPoint === l - 1) {\n\t\t\t\tintPoint = l - 2;\n\t\t\t\tweight = 1;\n\t\t\t}\n\n\t\t\tlet p0, p3; // 4 points (p1 & p2 defined below)\n\n\t\t\tif (this.closed || intPoint > 0) {\n\t\t\t\tp0 = points[(intPoint - 1) % l];\n\t\t\t} else {\n\t\t\t\t// extrapolate first point\n\t\t\t\ttmp.subVectors(points[0], points[1]).add(points[0]);\n\t\t\t\tp0 = tmp;\n\t\t\t}\n\n\t\t\tconst p1 = points[intPoint % l];\n\t\t\tconst p2 = points[(intPoint + 1) % l];\n\n\t\t\tif (this.closed || intPoint + 2 < l) {\n\t\t\t\tp3 = points[(intPoint + 2) % l];\n\t\t\t} else {\n\t\t\t\t// extrapolate last point\n\t\t\t\ttmp.subVectors(points[l - 1], points[l - 2]).add(points[l - 1]);\n\t\t\t\tp3 = tmp;\n\t\t\t}\n\n\t\t\tif (this.curveType === 'centripetal' || this.curveType === 'chordal') {\n\t\t\t\t// init Centripetal / Chordal Catmull-Rom\n\t\t\t\tconst pow = this.curveType === 'chordal' ? 0.5 : 0.25;\n\t\t\t\tlet dt0 = Math.pow(p0.distanceToSquared(p1), pow);\n\t\t\t\tlet dt1 = Math.pow(p1.distanceToSquared(p2), pow);\n\t\t\t\tlet dt2 = Math.pow(p2.distanceToSquared(p3), pow); // safety check for repeated points\n\n\t\t\t\tif (dt1 < 1e-4) dt1 = 1.0;\n\t\t\t\tif (dt0 < 1e-4) dt0 = dt1;\n\t\t\t\tif (dt2 < 1e-4) dt2 = dt1;\n\t\t\t\tpx.initNonuniformCatmullRom(p0.x, p1.x, p2.x, p3.x, dt0, dt1, dt2);\n\t\t\t\tpy.initNonuniformCatmullRom(p0.y, p1.y, p2.y, p3.y, dt0, dt1, dt2);\n\t\t\t\tpz.initNonuniformCatmullRom(p0.z, p1.z, p2.z, p3.z, dt0, dt1, dt2);\n\t\t\t} else if (this.curveType === 'catmullrom') {\n\t\t\t\tpx.initCatmullRom(p0.x, p1.x, p2.x, p3.x, this.tension);\n\t\t\t\tpy.initCatmullRom(p0.y, p1.y, p2.y, p3.y, this.tension);\n\t\t\t\tpz.initCatmullRom(p0.z, p1.z, p2.z, p3.z, this.tension);\n\t\t\t}\n\n\t\t\tpoint.set(px.calc(weight), py.calc(weight), pz.calc(weight));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = source.points.length; i < l; i++) {\n\t\t\t\tconst point = source.points[i];\n\t\t\t\tthis.points.push(point.clone());\n\t\t\t}\n\n\t\t\tthis.closed = source.closed;\n\t\t\tthis.curveType = source.curveType;\n\t\t\tthis.tension = source.tension;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.points = [];\n\n\t\t\tfor (let i = 0, l = this.points.length; i < l; i++) {\n\t\t\t\tconst point = this.points[i];\n\t\t\t\tdata.points.push(point.toArray());\n\t\t\t}\n\n\t\t\tdata.closed = this.closed;\n\t\t\tdata.curveType = this.curveType;\n\t\t\tdata.tension = this.tension;\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = json.points.length; i < l; i++) {\n\t\t\t\tconst point = json.points[i];\n\t\t\t\tthis.points.push(new Vector3().fromArray(point));\n\t\t\t}\n\n\t\t\tthis.closed = json.closed;\n\t\t\tthis.curveType = json.curveType;\n\t\t\tthis.tension = json.tension;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tCatmullRomCurve3.prototype.isCatmullRomCurve3 = true;\n\n\t/**\n\t * Bezier Curves formulas obtained from\n\t * http://en.wikipedia.org/wiki/Bézier_curve\n\t */\n\tfunction CatmullRom(t, p0, p1, p2, p3) {\n\t\tconst v0 = (p2 - p0) * 0.5;\n\t\tconst v1 = (p3 - p1) * 0.5;\n\t\tconst t2 = t * t;\n\t\tconst t3 = t * t2;\n\t\treturn (2 * p1 - 2 * p2 + v0 + v1) * t3 + (-3 * p1 + 3 * p2 - 2 * v0 - v1) * t2 + v0 * t + p1;\n\t} //\n\n\n\tfunction QuadraticBezierP0(t, p) {\n\t\tconst k = 1 - t;\n\t\treturn k * k * p;\n\t}\n\n\tfunction QuadraticBezierP1(t, p) {\n\t\treturn 2 * (1 - t) * t * p;\n\t}\n\n\tfunction QuadraticBezierP2(t, p) {\n\t\treturn t * t * p;\n\t}\n\n\tfunction QuadraticBezier(t, p0, p1, p2) {\n\t\treturn QuadraticBezierP0(t, p0) + QuadraticBezierP1(t, p1) + QuadraticBezierP2(t, p2);\n\t} //\n\n\n\tfunction CubicBezierP0(t, p) {\n\t\tconst k = 1 - t;\n\t\treturn k * k * k * p;\n\t}\n\n\tfunction CubicBezierP1(t, p) {\n\t\tconst k = 1 - t;\n\t\treturn 3 * k * k * t * p;\n\t}\n\n\tfunction CubicBezierP2(t, p) {\n\t\treturn 3 * (1 - t) * t * t * p;\n\t}\n\n\tfunction CubicBezierP3(t, p) {\n\t\treturn t * t * t * p;\n\t}\n\n\tfunction CubicBezier(t, p0, p1, p2, p3) {\n\t\treturn CubicBezierP0(t, p0) + CubicBezierP1(t, p1) + CubicBezierP2(t, p2) + CubicBezierP3(t, p3);\n\t}\n\n\tclass CubicBezierCurve extends Curve {\n\t\tconstructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2(), v3 = new Vector2()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CubicBezierCurve';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t\tthis.v3 = v3;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2,\n\t\t\t\t\t\tv3 = this.v3;\n\t\t\tpoint.set(CubicBezier(t, v0.x, v1.x, v2.x, v3.x), CubicBezier(t, v0.y, v1.y, v2.y, v3.y));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\tthis.v3.copy(source.v3);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\tdata.v3 = this.v3.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\tthis.v3.fromArray(json.v3);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tCubicBezierCurve.prototype.isCubicBezierCurve = true;\n\n\tclass CubicBezierCurve3 extends Curve {\n\t\tconstructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3(), v3 = new Vector3()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'CubicBezierCurve3';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t\tthis.v3 = v3;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2,\n\t\t\t\t\t\tv3 = this.v3;\n\t\t\tpoint.set(CubicBezier(t, v0.x, v1.x, v2.x, v3.x), CubicBezier(t, v0.y, v1.y, v2.y, v3.y), CubicBezier(t, v0.z, v1.z, v2.z, v3.z));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\tthis.v3.copy(source.v3);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\tdata.v3 = this.v3.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\tthis.v3.fromArray(json.v3);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tCubicBezierCurve3.prototype.isCubicBezierCurve3 = true;\n\n\tclass LineCurve extends Curve {\n\t\tconstructor(v1 = new Vector2(), v2 = new Vector2()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineCurve';\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\n\t\t\tif (t === 1) {\n\t\t\t\tpoint.copy(this.v2);\n\t\t\t} else {\n\t\t\t\tpoint.copy(this.v2).sub(this.v1);\n\t\t\t\tpoint.multiplyScalar(t).add(this.v1);\n\t\t\t}\n\n\t\t\treturn point;\n\t\t} // Line curve is linear, so we can overwrite default getPointAt\n\n\n\t\tgetPointAt(u, optionalTarget) {\n\t\t\treturn this.getPoint(u, optionalTarget);\n\t\t}\n\n\t\tgetTangent(t, optionalTarget) {\n\t\t\tconst tangent = optionalTarget || new Vector2();\n\t\t\ttangent.copy(this.v2).sub(this.v1).normalize();\n\t\t\treturn tangent;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineCurve.prototype.isLineCurve = true;\n\n\tclass LineCurve3 extends Curve {\n\t\tconstructor(v1 = new Vector3(), v2 = new Vector3()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineCurve3';\n\t\t\tthis.isLineCurve3 = true;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\n\t\t\tif (t === 1) {\n\t\t\t\tpoint.copy(this.v2);\n\t\t\t} else {\n\t\t\t\tpoint.copy(this.v2).sub(this.v1);\n\t\t\t\tpoint.multiplyScalar(t).add(this.v1);\n\t\t\t}\n\n\t\t\treturn point;\n\t\t} // Line curve is linear, so we can overwrite default getPointAt\n\n\n\t\tgetPointAt(u, optionalTarget) {\n\t\t\treturn this.getPoint(u, optionalTarget);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass QuadraticBezierCurve extends Curve {\n\t\tconstructor(v0 = new Vector2(), v1 = new Vector2(), v2 = new Vector2()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'QuadraticBezierCurve';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2;\n\t\t\tpoint.set(QuadraticBezier(t, v0.x, v1.x, v2.x), QuadraticBezier(t, v0.y, v1.y, v2.y));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tQuadraticBezierCurve.prototype.isQuadraticBezierCurve = true;\n\n\tclass QuadraticBezierCurve3 extends Curve {\n\t\tconstructor(v0 = new Vector3(), v1 = new Vector3(), v2 = new Vector3()) {\n\t\t\tsuper();\n\t\t\tthis.type = 'QuadraticBezierCurve3';\n\t\t\tthis.v0 = v0;\n\t\t\tthis.v1 = v1;\n\t\t\tthis.v2 = v2;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector3()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst v0 = this.v0,\n\t\t\t\t\t\tv1 = this.v1,\n\t\t\t\t\t\tv2 = this.v2;\n\t\t\tpoint.set(QuadraticBezier(t, v0.x, v1.x, v2.x), QuadraticBezier(t, v0.y, v1.y, v2.y), QuadraticBezier(t, v0.z, v1.z, v2.z));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.v0.copy(source.v0);\n\t\t\tthis.v1.copy(source.v1);\n\t\t\tthis.v2.copy(source.v2);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.v0 = this.v0.toArray();\n\t\t\tdata.v1 = this.v1.toArray();\n\t\t\tdata.v2 = this.v2.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.v0.fromArray(json.v0);\n\t\t\tthis.v1.fromArray(json.v1);\n\t\t\tthis.v2.fromArray(json.v2);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tQuadraticBezierCurve3.prototype.isQuadraticBezierCurve3 = true;\n\n\tclass SplineCurve extends Curve {\n\t\tconstructor(points = []) {\n\t\t\tsuper();\n\t\t\tthis.type = 'SplineCurve';\n\t\t\tthis.points = points;\n\t\t}\n\n\t\tgetPoint(t, optionalTarget = new Vector2()) {\n\t\t\tconst point = optionalTarget;\n\t\t\tconst points = this.points;\n\t\t\tconst p = (points.length - 1) * t;\n\t\t\tconst intPoint = Math.floor(p);\n\t\t\tconst weight = p - intPoint;\n\t\t\tconst p0 = points[intPoint === 0 ? intPoint : intPoint - 1];\n\t\t\tconst p1 = points[intPoint];\n\t\t\tconst p2 = points[intPoint > points.length - 2 ? points.length - 1 : intPoint + 1];\n\t\t\tconst p3 = points[intPoint > points.length - 3 ? points.length - 1 : intPoint + 2];\n\t\t\tpoint.set(CatmullRom(weight, p0.x, p1.x, p2.x, p3.x), CatmullRom(weight, p0.y, p1.y, p2.y, p3.y));\n\t\t\treturn point;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = source.points.length; i < l; i++) {\n\t\t\t\tconst point = source.points[i];\n\t\t\t\tthis.points.push(point.clone());\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.points = [];\n\n\t\t\tfor (let i = 0, l = this.points.length; i < l; i++) {\n\t\t\t\tconst point = this.points[i];\n\t\t\t\tdata.points.push(point.toArray());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.points = [];\n\n\t\t\tfor (let i = 0, l = json.points.length; i < l; i++) {\n\t\t\t\tconst point = json.points[i];\n\t\t\t\tthis.points.push(new Vector2().fromArray(point));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSplineCurve.prototype.isSplineCurve = true;\n\n\tvar Curves = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tArcCurve: ArcCurve,\n\t\tCatmullRomCurve3: CatmullRomCurve3,\n\t\tCubicBezierCurve: CubicBezierCurve,\n\t\tCubicBezierCurve3: CubicBezierCurve3,\n\t\tEllipseCurve: EllipseCurve,\n\t\tLineCurve: LineCurve,\n\t\tLineCurve3: LineCurve3,\n\t\tQuadraticBezierCurve: QuadraticBezierCurve,\n\t\tQuadraticBezierCurve3: QuadraticBezierCurve3,\n\t\tSplineCurve: SplineCurve\n\t});\n\n\t/**************************************************************\n\t *\tCurved Path - a curve path is simply a array of connected\n\t *\tcurves, but retains the api of a curve\n\t **************************************************************/\n\n\tclass CurvePath extends Curve {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'CurvePath';\n\t\t\tthis.curves = [];\n\t\t\tthis.autoClose = false; // Automatically closes the path\n\t\t}\n\n\t\tadd(curve) {\n\t\t\tthis.curves.push(curve);\n\t\t}\n\n\t\tclosePath() {\n\t\t\t// Add a line curve if start and end of lines are not connected\n\t\t\tconst startPoint = this.curves[0].getPoint(0);\n\t\t\tconst endPoint = this.curves[this.curves.length - 1].getPoint(1);\n\n\t\t\tif (!startPoint.equals(endPoint)) {\n\t\t\t\tthis.curves.push(new LineCurve(endPoint, startPoint));\n\t\t\t}\n\t\t} // To get accurate point with reference to\n\t\t// entire path distance at time t,\n\t\t// following has to be done:\n\t\t// 1. Length of each sub path have to be known\n\t\t// 2. Locate and identify type of curve\n\t\t// 3. Get t for the curve\n\t\t// 4. Return curve.getPointAt(t')\n\n\n\t\tgetPoint(t, optionalTarget) {\n\t\t\tconst d = t * this.getLength();\n\t\t\tconst curveLengths = this.getCurveLengths();\n\t\t\tlet i = 0; // To think about boundaries points.\n\n\t\t\twhile (i < curveLengths.length) {\n\t\t\t\tif (curveLengths[i] >= d) {\n\t\t\t\t\tconst diff = curveLengths[i] - d;\n\t\t\t\t\tconst curve = this.curves[i];\n\t\t\t\t\tconst segmentLength = curve.getLength();\n\t\t\t\t\tconst u = segmentLength === 0 ? 0 : 1 - diff / segmentLength;\n\t\t\t\t\treturn curve.getPointAt(u, optionalTarget);\n\t\t\t\t}\n\n\t\t\t\ti++;\n\t\t\t}\n\n\t\t\treturn null; // loop where sum != 0, sum > d , sum+1 <d\n\t\t} // We cannot use the default THREE.Curve getPoint() with getLength() because in\n\t\t// THREE.Curve, getLength() depends on getPoint() but in THREE.CurvePath\n\t\t// getPoint() depends on getLength\n\n\n\t\tgetLength() {\n\t\t\tconst lens = this.getCurveLengths();\n\t\t\treturn lens[lens.length - 1];\n\t\t} // cacheLengths must be recalculated.\n\n\n\t\tupdateArcLengths() {\n\t\t\tthis.needsUpdate = true;\n\t\t\tthis.cacheLengths = null;\n\t\t\tthis.getCurveLengths();\n\t\t} // Compute lengths and cache them\n\t\t// We cannot overwrite getLengths() because UtoT mapping uses it.\n\n\n\t\tgetCurveLengths() {\n\t\t\t// We use cache values if curves and cache array are same length\n\t\t\tif (this.cacheLengths && this.cacheLengths.length === this.curves.length) {\n\t\t\t\treturn this.cacheLengths;\n\t\t\t} // Get length of sub-curve\n\t\t\t// Push sums into cached array\n\n\n\t\t\tconst lengths = [];\n\t\t\tlet sums = 0;\n\n\t\t\tfor (let i = 0, l = this.curves.length; i < l; i++) {\n\t\t\t\tsums += this.curves[i].getLength();\n\t\t\t\tlengths.push(sums);\n\t\t\t}\n\n\t\t\tthis.cacheLengths = lengths;\n\t\t\treturn lengths;\n\t\t}\n\n\t\tgetSpacedPoints(divisions = 40) {\n\t\t\tconst points = [];\n\n\t\t\tfor (let i = 0; i <= divisions; i++) {\n\t\t\t\tpoints.push(this.getPoint(i / divisions));\n\t\t\t}\n\n\t\t\tif (this.autoClose) {\n\t\t\t\tpoints.push(points[0]);\n\t\t\t}\n\n\t\t\treturn points;\n\t\t}\n\n\t\tgetPoints(divisions = 12) {\n\t\t\tconst points = [];\n\t\t\tlet last;\n\n\t\t\tfor (let i = 0, curves = this.curves; i < curves.length; i++) {\n\t\t\t\tconst curve = curves[i];\n\t\t\t\tconst resolution = curve && curve.isEllipseCurve ? divisions * 2 : curve && (curve.isLineCurve || curve.isLineCurve3) ? 1 : curve && curve.isSplineCurve ? divisions * curve.points.length : divisions;\n\t\t\t\tconst pts = curve.getPoints(resolution);\n\n\t\t\t\tfor (let j = 0; j < pts.length; j++) {\n\t\t\t\t\tconst point = pts[j];\n\t\t\t\t\tif (last && last.equals(point)) continue; // ensures no consecutive points are duplicates\n\n\t\t\t\t\tpoints.push(point);\n\t\t\t\t\tlast = point;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.autoClose && points.length > 1 && !points[points.length - 1].equals(points[0])) {\n\t\t\t\tpoints.push(points[0]);\n\t\t\t}\n\n\t\t\treturn points;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.curves = [];\n\n\t\t\tfor (let i = 0, l = source.curves.length; i < l; i++) {\n\t\t\t\tconst curve = source.curves[i];\n\t\t\t\tthis.curves.push(curve.clone());\n\t\t\t}\n\n\t\t\tthis.autoClose = source.autoClose;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.autoClose = this.autoClose;\n\t\t\tdata.curves = [];\n\n\t\t\tfor (let i = 0, l = this.curves.length; i < l; i++) {\n\t\t\t\tconst curve = this.curves[i];\n\t\t\t\tdata.curves.push(curve.toJSON());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.autoClose = json.autoClose;\n\t\t\tthis.curves = [];\n\n\t\t\tfor (let i = 0, l = json.curves.length; i < l; i++) {\n\t\t\t\tconst curve = json.curves[i];\n\t\t\t\tthis.curves.push(new Curves[curve.type]().fromJSON(curve));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass Path extends CurvePath {\n\t\tconstructor(points) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Path';\n\t\t\tthis.currentPoint = new Vector2();\n\n\t\t\tif (points) {\n\t\t\t\tthis.setFromPoints(points);\n\t\t\t}\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tthis.moveTo(points[0].x, points[0].y);\n\n\t\t\tfor (let i = 1, l = points.length; i < l; i++) {\n\t\t\t\tthis.lineTo(points[i].x, points[i].y);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tmoveTo(x, y) {\n\t\t\tthis.currentPoint.set(x, y); // TODO consider referencing vectors instead of copying?\n\n\t\t\treturn this;\n\t\t}\n\n\t\tlineTo(x, y) {\n\t\t\tconst curve = new LineCurve(this.currentPoint.clone(), new Vector2(x, y));\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.set(x, y);\n\t\t\treturn this;\n\t\t}\n\n\t\tquadraticCurveTo(aCPx, aCPy, aX, aY) {\n\t\t\tconst curve = new QuadraticBezierCurve(this.currentPoint.clone(), new Vector2(aCPx, aCPy), new Vector2(aX, aY));\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.set(aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tbezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {\n\t\t\tconst curve = new CubicBezierCurve(this.currentPoint.clone(), new Vector2(aCP1x, aCP1y), new Vector2(aCP2x, aCP2y), new Vector2(aX, aY));\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.set(aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tsplineThru(pts\n\t\t/*Array of Vector*/\n\t\t) {\n\t\t\tconst npts = [this.currentPoint.clone()].concat(pts);\n\t\t\tconst curve = new SplineCurve(npts);\n\t\t\tthis.curves.push(curve);\n\t\t\tthis.currentPoint.copy(pts[pts.length - 1]);\n\t\t\treturn this;\n\t\t}\n\n\t\tarc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {\n\t\t\tconst x0 = this.currentPoint.x;\n\t\t\tconst y0 = this.currentPoint.y;\n\t\t\tthis.absarc(aX + x0, aY + y0, aRadius, aStartAngle, aEndAngle, aClockwise);\n\t\t\treturn this;\n\t\t}\n\n\t\tabsarc(aX, aY, aRadius, aStartAngle, aEndAngle, aClockwise) {\n\t\t\tthis.absellipse(aX, aY, aRadius, aRadius, aStartAngle, aEndAngle, aClockwise);\n\t\t\treturn this;\n\t\t}\n\n\t\tellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) {\n\t\t\tconst x0 = this.currentPoint.x;\n\t\t\tconst y0 = this.currentPoint.y;\n\t\t\tthis.absellipse(aX + x0, aY + y0, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation);\n\t\t\treturn this;\n\t\t}\n\n\t\tabsellipse(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation) {\n\t\t\tconst curve = new EllipseCurve(aX, aY, xRadius, yRadius, aStartAngle, aEndAngle, aClockwise, aRotation);\n\n\t\t\tif (this.curves.length > 0) {\n\t\t\t\t// if a previous curve is present, attempt to join\n\t\t\t\tconst firstPoint = curve.getPoint(0);\n\n\t\t\t\tif (!firstPoint.equals(this.currentPoint)) {\n\t\t\t\t\tthis.lineTo(firstPoint.x, firstPoint.y);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.curves.push(curve);\n\t\t\tconst lastPoint = curve.getPoint(1);\n\t\t\tthis.currentPoint.copy(lastPoint);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.currentPoint.copy(source.currentPoint);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.currentPoint = this.currentPoint.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.currentPoint.fromArray(json.currentPoint);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass Shape extends Path {\n\t\tconstructor(points) {\n\t\t\tsuper(points);\n\t\t\tthis.uuid = generateUUID();\n\t\t\tthis.type = 'Shape';\n\t\t\tthis.holes = [];\n\t\t}\n\n\t\tgetPointsHoles(divisions) {\n\t\t\tconst holesPts = [];\n\n\t\t\tfor (let i = 0, l = this.holes.length; i < l; i++) {\n\t\t\t\tholesPts[i] = this.holes[i].getPoints(divisions);\n\t\t\t}\n\n\t\t\treturn holesPts;\n\t\t} // get points of shape and holes (keypoints based on segments parameter)\n\n\n\t\textractPoints(divisions) {\n\t\t\treturn {\n\t\t\t\tshape: this.getPoints(divisions),\n\t\t\t\tholes: this.getPointsHoles(divisions)\n\t\t\t};\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.holes = [];\n\n\t\t\tfor (let i = 0, l = source.holes.length; i < l; i++) {\n\t\t\t\tconst hole = source.holes[i];\n\t\t\t\tthis.holes.push(hole.clone());\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.uuid = this.uuid;\n\t\t\tdata.holes = [];\n\n\t\t\tfor (let i = 0, l = this.holes.length; i < l; i++) {\n\t\t\t\tconst hole = this.holes[i];\n\t\t\t\tdata.holes.push(hole.toJSON());\n\t\t\t}\n\n\t\t\treturn data;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tsuper.fromJSON(json);\n\t\t\tthis.uuid = json.uuid;\n\t\t\tthis.holes = [];\n\n\t\t\tfor (let i = 0, l = json.holes.length; i < l; i++) {\n\t\t\t\tconst hole = json.holes[i];\n\t\t\t\tthis.holes.push(new Path().fromJSON(hole));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\t/**\n\t * Port from https://github.com/mapbox/earcut (v2.2.2)\n\t */\n\tconst Earcut = {\n\t\ttriangulate: function (data, holeIndices, dim = 2) {\n\t\t\tconst hasHoles = holeIndices && holeIndices.length;\n\t\t\tconst outerLen = hasHoles ? holeIndices[0] * dim : data.length;\n\t\t\tlet outerNode = linkedList(data, 0, outerLen, dim, true);\n\t\t\tconst triangles = [];\n\t\t\tif (!outerNode || outerNode.next === outerNode.prev) return triangles;\n\t\t\tlet minX, minY, maxX, maxY, x, y, invSize;\n\t\t\tif (hasHoles) outerNode = eliminateHoles(data, holeIndices, outerNode, dim); // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox\n\n\t\t\tif (data.length > 80 * dim) {\n\t\t\t\tminX = maxX = data[0];\n\t\t\t\tminY = maxY = data[1];\n\n\t\t\t\tfor (let i = dim; i < outerLen; i += dim) {\n\t\t\t\t\tx = data[i];\n\t\t\t\t\ty = data[i + 1];\n\t\t\t\t\tif (x < minX) minX = x;\n\t\t\t\t\tif (y < minY) minY = y;\n\t\t\t\t\tif (x > maxX) maxX = x;\n\t\t\t\t\tif (y > maxY) maxY = y;\n\t\t\t\t} // minX, minY and invSize are later used to transform coords into integers for z-order calculation\n\n\n\t\t\t\tinvSize = Math.max(maxX - minX, maxY - minY);\n\t\t\t\tinvSize = invSize !== 0 ? 1 / invSize : 0;\n\t\t\t}\n\n\t\t\tearcutLinked(outerNode, triangles, dim, minX, minY, invSize);\n\t\t\treturn triangles;\n\t\t}\n\t}; // create a circular doubly linked list from polygon points in the specified winding order\n\n\tfunction linkedList(data, start, end, dim, clockwise) {\n\t\tlet i, last;\n\n\t\tif (clockwise === signedArea(data, start, end, dim) > 0) {\n\t\t\tfor (i = start; i < end; i += dim) last = insertNode(i, data[i], data[i + 1], last);\n\t\t} else {\n\t\t\tfor (i = end - dim; i >= start; i -= dim) last = insertNode(i, data[i], data[i + 1], last);\n\t\t}\n\n\t\tif (last && equals(last, last.next)) {\n\t\t\tremoveNode(last);\n\t\t\tlast = last.next;\n\t\t}\n\n\t\treturn last;\n\t} // eliminate colinear or duplicate points\n\n\n\tfunction filterPoints(start, end) {\n\t\tif (!start) return start;\n\t\tif (!end) end = start;\n\t\tlet p = start,\n\t\t\t\tagain;\n\n\t\tdo {\n\t\t\tagain = false;\n\n\t\t\tif (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {\n\t\t\t\tremoveNode(p);\n\t\t\t\tp = end = p.prev;\n\t\t\t\tif (p === p.next) break;\n\t\t\t\tagain = true;\n\t\t\t} else {\n\t\t\t\tp = p.next;\n\t\t\t}\n\t\t} while (again || p !== end);\n\n\t\treturn end;\n\t} // main ear slicing loop which triangulates a polygon (given as a linked list)\n\n\n\tfunction earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {\n\t\tif (!ear) return; // interlink polygon nodes in z-order\n\n\t\tif (!pass && invSize) indexCurve(ear, minX, minY, invSize);\n\t\tlet stop = ear,\n\t\t\t\tprev,\n\t\t\t\tnext; // iterate through ears, slicing them one by one\n\n\t\twhile (ear.prev !== ear.next) {\n\t\t\tprev = ear.prev;\n\t\t\tnext = ear.next;\n\n\t\t\tif (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {\n\t\t\t\t// cut off the triangle\n\t\t\t\ttriangles.push(prev.i / dim);\n\t\t\t\ttriangles.push(ear.i / dim);\n\t\t\t\ttriangles.push(next.i / dim);\n\t\t\t\tremoveNode(ear); // skipping the next vertex leads to less sliver triangles\n\n\t\t\t\tear = next.next;\n\t\t\t\tstop = next.next;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tear = next; // if we looped through the whole remaining polygon and can't find any more ears\n\n\t\t\tif (ear === stop) {\n\t\t\t\t// try filtering points and slicing again\n\t\t\t\tif (!pass) {\n\t\t\t\t\tearcutLinked(filterPoints(ear), triangles, dim, minX, minY, invSize, 1); // if this didn't work, try curing all small self-intersections locally\n\t\t\t\t} else if (pass === 1) {\n\t\t\t\t\tear = cureLocalIntersections(filterPoints(ear), triangles, dim);\n\t\t\t\t\tearcutLinked(ear, triangles, dim, minX, minY, invSize, 2); // as a last resort, try splitting the remaining polygon into two\n\t\t\t\t} else if (pass === 2) {\n\t\t\t\t\tsplitEarcut(ear, triangles, dim, minX, minY, invSize);\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t} // check whether a polygon node forms a valid ear with adjacent nodes\n\n\n\tfunction isEar(ear) {\n\t\tconst a = ear.prev,\n\t\t\t\t\tb = ear,\n\t\t\t\t\tc = ear.next;\n\t\tif (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\t\t// now make sure we don't have other points inside the potential ear\n\n\t\tlet p = ear.next.next;\n\n\t\twhile (p !== ear.prev) {\n\t\t\tif (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n\t\t\tp = p.next;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tfunction isEarHashed(ear, minX, minY, invSize) {\n\t\tconst a = ear.prev,\n\t\t\t\t\tb = ear,\n\t\t\t\t\tc = ear.next;\n\t\tif (area(a, b, c) >= 0) return false; // reflex, can't be an ear\n\t\t// triangle bbox; min & max are calculated like this for speed\n\n\t\tconst minTX = a.x < b.x ? a.x < c.x ? a.x : c.x : b.x < c.x ? b.x : c.x,\n\t\t\t\t\tminTY = a.y < b.y ? a.y < c.y ? a.y : c.y : b.y < c.y ? b.y : c.y,\n\t\t\t\t\tmaxTX = a.x > b.x ? a.x > c.x ? a.x : c.x : b.x > c.x ? b.x : c.x,\n\t\t\t\t\tmaxTY = a.y > b.y ? a.y > c.y ? a.y : c.y : b.y > c.y ? b.y : c.y; // z-order range for the current triangle bbox;\n\n\t\tconst minZ = zOrder(minTX, minTY, minX, minY, invSize),\n\t\t\t\t\tmaxZ = zOrder(maxTX, maxTY, minX, minY, invSize);\n\t\tlet p = ear.prevZ,\n\t\t\t\tn = ear.nextZ; // look for points inside the triangle in both directions\n\n\t\twhile (p && p.z >= minZ && n && n.z <= maxZ) {\n\t\t\tif (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n\t\t\tp = p.prevZ;\n\t\t\tif (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n\t\t\tn = n.nextZ;\n\t\t} // look for remaining points in decreasing z-order\n\n\n\t\twhile (p && p.z >= minZ) {\n\t\t\tif (p !== ear.prev && p !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;\n\t\t\tp = p.prevZ;\n\t\t} // look for remaining points in increasing z-order\n\n\n\t\twhile (n && n.z <= maxZ) {\n\t\t\tif (n !== ear.prev && n !== ear.next && pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;\n\t\t\tn = n.nextZ;\n\t\t}\n\n\t\treturn true;\n\t} // go through all polygon nodes and cure small local self-intersections\n\n\n\tfunction cureLocalIntersections(start, triangles, dim) {\n\t\tlet p = start;\n\n\t\tdo {\n\t\t\tconst a = p.prev,\n\t\t\t\t\t\tb = p.next.next;\n\n\t\t\tif (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {\n\t\t\t\ttriangles.push(a.i / dim);\n\t\t\t\ttriangles.push(p.i / dim);\n\t\t\t\ttriangles.push(b.i / dim); // remove two nodes involved\n\n\t\t\t\tremoveNode(p);\n\t\t\t\tremoveNode(p.next);\n\t\t\t\tp = start = b;\n\t\t\t}\n\n\t\t\tp = p.next;\n\t\t} while (p !== start);\n\n\t\treturn filterPoints(p);\n\t} // try splitting polygon into two and triangulate them independently\n\n\n\tfunction splitEarcut(start, triangles, dim, minX, minY, invSize) {\n\t\t// look for a valid diagonal that divides the polygon into two\n\t\tlet a = start;\n\n\t\tdo {\n\t\t\tlet b = a.next.next;\n\n\t\t\twhile (b !== a.prev) {\n\t\t\t\tif (a.i !== b.i && isValidDiagonal(a, b)) {\n\t\t\t\t\t// split the polygon in two by the diagonal\n\t\t\t\t\tlet c = splitPolygon(a, b); // filter colinear points around the cuts\n\n\t\t\t\t\ta = filterPoints(a, a.next);\n\t\t\t\t\tc = filterPoints(c, c.next); // run earcut on each half\n\n\t\t\t\t\tearcutLinked(a, triangles, dim, minX, minY, invSize);\n\t\t\t\t\tearcutLinked(c, triangles, dim, minX, minY, invSize);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tb = b.next;\n\t\t\t}\n\n\t\t\ta = a.next;\n\t\t} while (a !== start);\n\t} // link every hole into the outer loop, producing a single-ring polygon without holes\n\n\n\tfunction eliminateHoles(data, holeIndices, outerNode, dim) {\n\t\tconst queue = [];\n\t\tlet i, len, start, end, list;\n\n\t\tfor (i = 0, len = holeIndices.length; i < len; i++) {\n\t\t\tstart = holeIndices[i] * dim;\n\t\t\tend = i < len - 1 ? holeIndices[i + 1] * dim : data.length;\n\t\t\tlist = linkedList(data, start, end, dim, false);\n\t\t\tif (list === list.next) list.steiner = true;\n\t\t\tqueue.push(getLeftmost(list));\n\t\t}\n\n\t\tqueue.sort(compareX); // process holes from left to right\n\n\t\tfor (i = 0; i < queue.length; i++) {\n\t\t\teliminateHole(queue[i], outerNode);\n\t\t\touterNode = filterPoints(outerNode, outerNode.next);\n\t\t}\n\n\t\treturn outerNode;\n\t}\n\n\tfunction compareX(a, b) {\n\t\treturn a.x - b.x;\n\t} // find a bridge between vertices that connects hole with an outer ring and and link it\n\n\n\tfunction eliminateHole(hole, outerNode) {\n\t\touterNode = findHoleBridge(hole, outerNode);\n\n\t\tif (outerNode) {\n\t\t\tconst b = splitPolygon(outerNode, hole); // filter collinear points around the cuts\n\n\t\t\tfilterPoints(outerNode, outerNode.next);\n\t\t\tfilterPoints(b, b.next);\n\t\t}\n\t} // David Eberly's algorithm for finding a bridge between hole and outer polygon\n\n\n\tfunction findHoleBridge(hole, outerNode) {\n\t\tlet p = outerNode;\n\t\tconst hx = hole.x;\n\t\tconst hy = hole.y;\n\t\tlet qx = -Infinity,\n\t\t\t\tm; // find a segment intersected by a ray from the hole's leftmost point to the left;\n\t\t// segment's endpoint with lesser x will be potential connection point\n\n\t\tdo {\n\t\t\tif (hy <= p.y && hy >= p.next.y && p.next.y !== p.y) {\n\t\t\t\tconst x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);\n\n\t\t\t\tif (x <= hx && x > qx) {\n\t\t\t\t\tqx = x;\n\n\t\t\t\t\tif (x === hx) {\n\t\t\t\t\t\tif (hy === p.y) return p;\n\t\t\t\t\t\tif (hy === p.next.y) return p.next;\n\t\t\t\t\t}\n\n\t\t\t\t\tm = p.x < p.next.x ? p : p.next;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp = p.next;\n\t\t} while (p !== outerNode);\n\n\t\tif (!m) return null;\n\t\tif (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint\n\t\t// look for points inside the triangle of hole point, segment intersection and endpoint;\n\t\t// if there are no points found, we have a valid connection;\n\t\t// otherwise choose the point of the minimum angle with the ray as connection point\n\n\t\tconst stop = m,\n\t\t\t\t\tmx = m.x,\n\t\t\t\t\tmy = m.y;\n\t\tlet tanMin = Infinity,\n\t\t\t\ttan;\n\t\tp = m;\n\n\t\tdo {\n\t\t\tif (hx >= p.x && p.x >= mx && hx !== p.x && pointInTriangle(hy < my ? hx : qx, hy, mx, my, hy < my ? qx : hx, hy, p.x, p.y)) {\n\t\t\t\ttan = Math.abs(hy - p.y) / (hx - p.x); // tangential\n\n\t\t\t\tif (locallyInside(p, hole) && (tan < tanMin || tan === tanMin && (p.x > m.x || p.x === m.x && sectorContainsSector(m, p)))) {\n\t\t\t\t\tm = p;\n\t\t\t\t\ttanMin = tan;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tp = p.next;\n\t\t} while (p !== stop);\n\n\t\treturn m;\n\t} // whether sector in vertex m contains sector in vertex p in the same coordinates\n\n\n\tfunction sectorContainsSector(m, p) {\n\t\treturn area(m.prev, m, p.prev) < 0 && area(p.next, m, m.next) < 0;\n\t} // interlink polygon nodes in z-order\n\n\n\tfunction indexCurve(start, minX, minY, invSize) {\n\t\tlet p = start;\n\n\t\tdo {\n\t\t\tif (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);\n\t\t\tp.prevZ = p.prev;\n\t\t\tp.nextZ = p.next;\n\t\t\tp = p.next;\n\t\t} while (p !== start);\n\n\t\tp.prevZ.nextZ = null;\n\t\tp.prevZ = null;\n\t\tsortLinked(p);\n\t} // Simon Tatham's linked list merge sort algorithm\n\t// http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html\n\n\n\tfunction sortLinked(list) {\n\t\tlet i,\n\t\t\t\tp,\n\t\t\t\tq,\n\t\t\t\te,\n\t\t\t\ttail,\n\t\t\t\tnumMerges,\n\t\t\t\tpSize,\n\t\t\t\tqSize,\n\t\t\t\tinSize = 1;\n\n\t\tdo {\n\t\t\tp = list;\n\t\t\tlist = null;\n\t\t\ttail = null;\n\t\t\tnumMerges = 0;\n\n\t\t\twhile (p) {\n\t\t\t\tnumMerges++;\n\t\t\t\tq = p;\n\t\t\t\tpSize = 0;\n\n\t\t\t\tfor (i = 0; i < inSize; i++) {\n\t\t\t\t\tpSize++;\n\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\tif (!q) break;\n\t\t\t\t}\n\n\t\t\t\tqSize = inSize;\n\n\t\t\t\twhile (pSize > 0 || qSize > 0 && q) {\n\t\t\t\t\tif (pSize !== 0 && (qSize === 0 || !q || p.z <= q.z)) {\n\t\t\t\t\t\te = p;\n\t\t\t\t\t\tp = p.nextZ;\n\t\t\t\t\t\tpSize--;\n\t\t\t\t\t} else {\n\t\t\t\t\t\te = q;\n\t\t\t\t\t\tq = q.nextZ;\n\t\t\t\t\t\tqSize--;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (tail) tail.nextZ = e;else list = e;\n\t\t\t\t\te.prevZ = tail;\n\t\t\t\t\ttail = e;\n\t\t\t\t}\n\n\t\t\t\tp = q;\n\t\t\t}\n\n\t\t\ttail.nextZ = null;\n\t\t\tinSize *= 2;\n\t\t} while (numMerges > 1);\n\n\t\treturn list;\n\t} // z-order of a point given coords and inverse of the longer side of data bbox\n\n\n\tfunction zOrder(x, y, minX, minY, invSize) {\n\t\t// coords are transformed into non-negative 15-bit integer range\n\t\tx = 32767 * (x - minX) * invSize;\n\t\ty = 32767 * (y - minY) * invSize;\n\t\tx = (x | x << 8) & 0x00FF00FF;\n\t\tx = (x | x << 4) & 0x0F0F0F0F;\n\t\tx = (x | x << 2) & 0x33333333;\n\t\tx = (x | x << 1) & 0x55555555;\n\t\ty = (y | y << 8) & 0x00FF00FF;\n\t\ty = (y | y << 4) & 0x0F0F0F0F;\n\t\ty = (y | y << 2) & 0x33333333;\n\t\ty = (y | y << 1) & 0x55555555;\n\t\treturn x | y << 1;\n\t} // find the leftmost node of a polygon ring\n\n\n\tfunction getLeftmost(start) {\n\t\tlet p = start,\n\t\t\t\tleftmost = start;\n\n\t\tdo {\n\t\t\tif (p.x < leftmost.x || p.x === leftmost.x && p.y < leftmost.y) leftmost = p;\n\t\t\tp = p.next;\n\t\t} while (p !== start);\n\n\t\treturn leftmost;\n\t} // check if a point lies within a convex triangle\n\n\n\tfunction pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t\treturn (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t} // check if a diagonal between two polygon nodes is valid (lies in polygon interior)\n\n\n\tfunction isValidDiagonal(a, b) {\n\t\treturn a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && (locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b) && (area(a.prev, a, b.prev) || area(a, b.prev, b)) || // does not create opposite-facing sectors\n\t\tequals(a, b) && area(a.prev, a, a.next) > 0 && area(b.prev, b, b.next) > 0); // special zero-length case\n\t} // signed area of a triangle\n\n\n\tfunction area(p, q, r) {\n\t\treturn (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);\n\t} // check if two points are equal\n\n\n\tfunction equals(p1, p2) {\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\t} // check if two segments intersect\n\n\n\tfunction intersects(p1, q1, p2, q2) {\n\t\tconst o1 = sign(area(p1, q1, p2));\n\t\tconst o2 = sign(area(p1, q1, q2));\n\t\tconst o3 = sign(area(p2, q2, p1));\n\t\tconst o4 = sign(area(p2, q2, q1));\n\t\tif (o1 !== o2 && o3 !== o4) return true; // general case\n\n\t\tif (o1 === 0 && onSegment(p1, p2, q1)) return true; // p1, q1 and p2 are collinear and p2 lies on p1q1\n\n\t\tif (o2 === 0 && onSegment(p1, q2, q1)) return true; // p1, q1 and q2 are collinear and q2 lies on p1q1\n\n\t\tif (o3 === 0 && onSegment(p2, p1, q2)) return true; // p2, q2 and p1 are collinear and p1 lies on p2q2\n\n\t\tif (o4 === 0 && onSegment(p2, q1, q2)) return true; // p2, q2 and q1 are collinear and q1 lies on p2q2\n\n\t\treturn false;\n\t} // for collinear points p, q, r, check if point q lies on segment pr\n\n\n\tfunction onSegment(p, q, r) {\n\t\treturn q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n\t}\n\n\tfunction sign(num) {\n\t\treturn num > 0 ? 1 : num < 0 ? -1 : 0;\n\t} // check if a polygon diagonal intersects any polygon segments\n\n\n\tfunction intersectsPolygon(a, b) {\n\t\tlet p = a;\n\n\t\tdo {\n\t\t\tif (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true;\n\t\t\tp = p.next;\n\t\t} while (p !== a);\n\n\t\treturn false;\n\t} // check if a polygon diagonal is locally inside the polygon\n\n\n\tfunction locallyInside(a, b) {\n\t\treturn area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0;\n\t} // check if the middle point of a polygon diagonal is inside the polygon\n\n\n\tfunction middleInside(a, b) {\n\t\tlet p = a,\n\t\t\t\tinside = false;\n\t\tconst px = (a.x + b.x) / 2,\n\t\t\t\t\tpy = (a.y + b.y) / 2;\n\n\t\tdo {\n\t\t\tif (p.y > py !== p.next.y > py && p.next.y !== p.y && px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x) inside = !inside;\n\t\t\tp = p.next;\n\t\t} while (p !== a);\n\n\t\treturn inside;\n\t} // link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two;\n\t// if one belongs to the outer ring and another to a hole, it merges it into a single ring\n\n\n\tfunction splitPolygon(a, b) {\n\t\tconst a2 = new Node(a.i, a.x, a.y),\n\t\t\t\t\tb2 = new Node(b.i, b.x, b.y),\n\t\t\t\t\tan = a.next,\n\t\t\t\t\tbp = b.prev;\n\t\ta.next = b;\n\t\tb.prev = a;\n\t\ta2.next = an;\n\t\tan.prev = a2;\n\t\tb2.next = a2;\n\t\ta2.prev = b2;\n\t\tbp.next = b2;\n\t\tb2.prev = bp;\n\t\treturn b2;\n\t} // create a node and optionally link it with previous one (in a circular doubly linked list)\n\n\n\tfunction insertNode(i, x, y, last) {\n\t\tconst p = new Node(i, x, y);\n\n\t\tif (!last) {\n\t\t\tp.prev = p;\n\t\t\tp.next = p;\n\t\t} else {\n\t\t\tp.next = last.next;\n\t\t\tp.prev = last;\n\t\t\tlast.next.prev = p;\n\t\t\tlast.next = p;\n\t\t}\n\n\t\treturn p;\n\t}\n\n\tfunction removeNode(p) {\n\t\tp.next.prev = p.prev;\n\t\tp.prev.next = p.next;\n\t\tif (p.prevZ) p.prevZ.nextZ = p.nextZ;\n\t\tif (p.nextZ) p.nextZ.prevZ = p.prevZ;\n\t}\n\n\tfunction Node(i, x, y) {\n\t\t// vertex index in coordinates array\n\t\tthis.i = i; // vertex coordinates\n\n\t\tthis.x = x;\n\t\tthis.y = y; // previous and next vertex nodes in a polygon ring\n\n\t\tthis.prev = null;\n\t\tthis.next = null; // z-order curve value\n\n\t\tthis.z = null; // previous and next nodes in z-order\n\n\t\tthis.prevZ = null;\n\t\tthis.nextZ = null; // indicates whether this is a steiner point\n\n\t\tthis.steiner = false;\n\t}\n\n\tfunction signedArea(data, start, end, dim) {\n\t\tlet sum = 0;\n\n\t\tfor (let i = start, j = end - dim; i < end; i += dim) {\n\t\t\tsum += (data[j] - data[i]) * (data[i + 1] + data[j + 1]);\n\t\t\tj = i;\n\t\t}\n\n\t\treturn sum;\n\t}\n\n\tclass ShapeUtils {\n\t\t// calculate area of the contour polygon\n\t\tstatic area(contour) {\n\t\t\tconst n = contour.length;\n\t\t\tlet a = 0.0;\n\n\t\t\tfor (let p = n - 1, q = 0; q < n; p = q++) {\n\t\t\t\ta += contour[p].x * contour[q].y - contour[q].x * contour[p].y;\n\t\t\t}\n\n\t\t\treturn a * 0.5;\n\t\t}\n\n\t\tstatic isClockWise(pts) {\n\t\t\treturn ShapeUtils.area(pts) < 0;\n\t\t}\n\n\t\tstatic triangulateShape(contour, holes) {\n\t\t\tconst vertices = []; // flat array of vertices like [ x0,y0, x1,y1, x2,y2, ... ]\n\n\t\t\tconst holeIndices = []; // array of hole indices\n\n\t\t\tconst faces = []; // final array of vertex indices like [ [ a,b,d ], [ b,c,d ] ]\n\n\t\t\tremoveDupEndPts(contour);\n\t\t\taddContour(vertices, contour); //\n\n\t\t\tlet holeIndex = contour.length;\n\t\t\tholes.forEach(removeDupEndPts);\n\n\t\t\tfor (let i = 0; i < holes.length; i++) {\n\t\t\t\tholeIndices.push(holeIndex);\n\t\t\t\tholeIndex += holes[i].length;\n\t\t\t\taddContour(vertices, holes[i]);\n\t\t\t} //\n\n\n\t\t\tconst triangles = Earcut.triangulate(vertices, holeIndices); //\n\n\t\t\tfor (let i = 0; i < triangles.length; i += 3) {\n\t\t\t\tfaces.push(triangles.slice(i, i + 3));\n\t\t\t}\n\n\t\t\treturn faces;\n\t\t}\n\n\t}\n\n\tfunction removeDupEndPts(points) {\n\t\tconst l = points.length;\n\n\t\tif (l > 2 && points[l - 1].equals(points[0])) {\n\t\t\tpoints.pop();\n\t\t}\n\t}\n\n\tfunction addContour(vertices, contour) {\n\t\tfor (let i = 0; i < contour.length; i++) {\n\t\t\tvertices.push(contour[i].x);\n\t\t\tvertices.push(contour[i].y);\n\t\t}\n\t}\n\n\t/**\n\t * Creates extruded geometry from a path shape.\n\t *\n\t * parameters = {\n\t *\n\t *\tcurveSegments: <int>, // number of points on the curves\n\t *\tsteps: <int>, // number of points for z-side extrusions / used for subdividing segments of extrude spline too\n\t *\tdepth: <float>, // Depth to extrude the shape\n\t *\n\t *\tbevelEnabled: <bool>, // turn on bevel\n\t *\tbevelThickness: <float>, // how deep into the original shape bevel goes\n\t *\tbevelSize: <float>, // how far from shape outline (including bevelOffset) is bevel\n\t *\tbevelOffset: <float>, // how far from shape outline does bevel start\n\t *\tbevelSegments: <int>, // number of bevel layers\n\t *\n\t *\textrudePath: <THREE.Curve> // curve to extrude shape along\n\t *\n\t *\tUVGenerator: <Object> // object that provides UV generator functions\n\t *\n\t * }\n\t */\n\n\tclass ExtrudeGeometry extends BufferGeometry {\n\t\tconstructor(shapes = new Shape([new Vector2(0.5, 0.5), new Vector2(-0.5, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), options = {}) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ExtrudeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tshapes: shapes,\n\t\t\t\toptions: options\n\t\t\t};\n\t\t\tshapes = Array.isArray(shapes) ? shapes : [shapes];\n\t\t\tconst scope = this;\n\t\t\tconst verticesArray = [];\n\t\t\tconst uvArray = [];\n\n\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\tconst shape = shapes[i];\n\t\t\t\taddShape(shape);\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(verticesArray, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvArray, 2));\n\t\t\tthis.computeVertexNormals(); // functions\n\n\t\t\tfunction addShape(shape) {\n\t\t\t\tconst placeholder = []; // options\n\n\t\t\t\tconst curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;\n\t\t\t\tconst steps = options.steps !== undefined ? options.steps : 1;\n\t\t\t\tlet depth = options.depth !== undefined ? options.depth : 1;\n\t\t\t\tlet bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;\n\t\t\t\tlet bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;\n\t\t\t\tlet bevelSize = options.bevelSize !== undefined ? options.bevelSize : bevelThickness - 0.1;\n\t\t\t\tlet bevelOffset = options.bevelOffset !== undefined ? options.bevelOffset : 0;\n\t\t\t\tlet bevelSegments = options.bevelSegments !== undefined ? options.bevelSegments : 3;\n\t\t\t\tconst extrudePath = options.extrudePath;\n\t\t\t\tconst uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator; // deprecated options\n\n\t\t\t\tif (options.amount !== undefined) {\n\t\t\t\t\tconsole.warn('THREE.ExtrudeBufferGeometry: amount has been renamed to depth.');\n\t\t\t\t\tdepth = options.amount;\n\t\t\t\t} //\n\n\n\t\t\t\tlet extrudePts,\n\t\t\t\t\t\textrudeByPath = false;\n\t\t\t\tlet splineTube, binormal, normal, position2;\n\n\t\t\t\tif (extrudePath) {\n\t\t\t\t\textrudePts = extrudePath.getSpacedPoints(steps);\n\t\t\t\t\textrudeByPath = true;\n\t\t\t\t\tbevelEnabled = false; // bevels not supported for path extrusion\n\t\t\t\t\t// SETUP TNB variables\n\t\t\t\t\t// TODO1 - have a .isClosed in spline?\n\n\t\t\t\t\tsplineTube = extrudePath.computeFrenetFrames(steps, false); // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);\n\n\t\t\t\t\tbinormal = new Vector3();\n\t\t\t\t\tnormal = new Vector3();\n\t\t\t\t\tposition2 = new Vector3();\n\t\t\t\t} // Safeguards if bevels are not enabled\n\n\n\t\t\t\tif (!bevelEnabled) {\n\t\t\t\t\tbevelSegments = 0;\n\t\t\t\t\tbevelThickness = 0;\n\t\t\t\t\tbevelSize = 0;\n\t\t\t\t\tbevelOffset = 0;\n\t\t\t\t} // Variables initialization\n\n\n\t\t\t\tconst shapePoints = shape.extractPoints(curveSegments);\n\t\t\t\tlet vertices = shapePoints.shape;\n\t\t\t\tconst holes = shapePoints.holes;\n\t\t\t\tconst reverse = !ShapeUtils.isClockWise(vertices);\n\n\t\t\t\tif (reverse) {\n\t\t\t\t\tvertices = vertices.reverse(); // Maybe we should also check if holes are in the opposite direction, just to be safe ...\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\n\t\t\t\t\t\tif (ShapeUtils.isClockWise(ahole)) {\n\t\t\t\t\t\t\tholes[h] = ahole.reverse();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst faces = ShapeUtils.triangulateShape(vertices, holes);\n\t\t\t\t/* Vertices */\n\n\t\t\t\tconst contour = vertices; // vertices has all points but contour has only points of circumference\n\n\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\tvertices = vertices.concat(ahole);\n\t\t\t\t}\n\n\t\t\t\tfunction scalePt2(pt, vec, size) {\n\t\t\t\t\tif (!vec) console.error('THREE.ExtrudeGeometry: vec does not exist');\n\t\t\t\t\treturn vec.clone().multiplyScalar(size).add(pt);\n\t\t\t\t}\n\n\t\t\t\tconst vlen = vertices.length,\n\t\t\t\t\t\t\tflen = faces.length; // Find directions for point movement\n\n\t\t\t\tfunction getBevelVec(inPt, inPrev, inNext) {\n\t\t\t\t\t// computes for inPt the corresponding point inPt' on a new contour\n\t\t\t\t\t//\t shifted by 1 unit (length of normalized vector) to the left\n\t\t\t\t\t// if we walk along contour clockwise, this new contour is outside the old one\n\t\t\t\t\t//\n\t\t\t\t\t// inPt' is the intersection of the two lines parallel to the two\n\t\t\t\t\t//\tadjacent edges of inPt at a distance of 1 unit on the left side.\n\t\t\t\t\tlet v_trans_x, v_trans_y, shrink_by; // resulting translation vector for inPt\n\t\t\t\t\t// good reading for geometry algorithms (here: line-line intersection)\n\t\t\t\t\t// http://geomalgorithms.com/a05-_intersect-1.html\n\n\t\t\t\t\tconst v_prev_x = inPt.x - inPrev.x,\n\t\t\t\t\t\t\t\tv_prev_y = inPt.y - inPrev.y;\n\t\t\t\t\tconst v_next_x = inNext.x - inPt.x,\n\t\t\t\t\t\t\t\tv_next_y = inNext.y - inPt.y;\n\t\t\t\t\tconst v_prev_lensq = v_prev_x * v_prev_x + v_prev_y * v_prev_y; // check for collinear edges\n\n\t\t\t\t\tconst collinear0 = v_prev_x * v_next_y - v_prev_y * v_next_x;\n\n\t\t\t\t\tif (Math.abs(collinear0) > Number.EPSILON) {\n\t\t\t\t\t\t// not collinear\n\t\t\t\t\t\t// length of vectors for normalizing\n\t\t\t\t\t\tconst v_prev_len = Math.sqrt(v_prev_lensq);\n\t\t\t\t\t\tconst v_next_len = Math.sqrt(v_next_x * v_next_x + v_next_y * v_next_y); // shift adjacent points by unit vectors to the left\n\n\t\t\t\t\t\tconst ptPrevShift_x = inPrev.x - v_prev_y / v_prev_len;\n\t\t\t\t\t\tconst ptPrevShift_y = inPrev.y + v_prev_x / v_prev_len;\n\t\t\t\t\t\tconst ptNextShift_x = inNext.x - v_next_y / v_next_len;\n\t\t\t\t\t\tconst ptNextShift_y = inNext.y + v_next_x / v_next_len; // scaling factor for v_prev to intersection point\n\n\t\t\t\t\t\tconst sf = ((ptNextShift_x - ptPrevShift_x) * v_next_y - (ptNextShift_y - ptPrevShift_y) * v_next_x) / (v_prev_x * v_next_y - v_prev_y * v_next_x); // vector from inPt to intersection point\n\n\t\t\t\t\t\tv_trans_x = ptPrevShift_x + v_prev_x * sf - inPt.x;\n\t\t\t\t\t\tv_trans_y = ptPrevShift_y + v_prev_y * sf - inPt.y; // Don't normalize!, otherwise sharp corners become ugly\n\t\t\t\t\t\t//\tbut prevent crazy spikes\n\n\t\t\t\t\t\tconst v_trans_lensq = v_trans_x * v_trans_x + v_trans_y * v_trans_y;\n\n\t\t\t\t\t\tif (v_trans_lensq <= 2) {\n\t\t\t\t\t\t\treturn new Vector2(v_trans_x, v_trans_y);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tshrink_by = Math.sqrt(v_trans_lensq / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// handle special case of collinear edges\n\t\t\t\t\t\tlet direction_eq = false; // assumes: opposite\n\n\t\t\t\t\t\tif (v_prev_x > Number.EPSILON) {\n\t\t\t\t\t\t\tif (v_next_x > Number.EPSILON) {\n\t\t\t\t\t\t\t\tdirection_eq = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (v_prev_x < -Number.EPSILON) {\n\t\t\t\t\t\t\t\tif (v_next_x < -Number.EPSILON) {\n\t\t\t\t\t\t\t\t\tdirection_eq = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif (Math.sign(v_prev_y) === Math.sign(v_next_y)) {\n\t\t\t\t\t\t\t\t\tdirection_eq = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (direction_eq) {\n\t\t\t\t\t\t\t// console.log(\"Warning: lines are a straight sequence\");\n\t\t\t\t\t\t\tv_trans_x = -v_prev_y;\n\t\t\t\t\t\t\tv_trans_y = v_prev_x;\n\t\t\t\t\t\t\tshrink_by = Math.sqrt(v_prev_lensq);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// console.log(\"Warning: lines are a straight spike\");\n\t\t\t\t\t\t\tv_trans_x = v_prev_x;\n\t\t\t\t\t\t\tv_trans_y = v_prev_y;\n\t\t\t\t\t\t\tshrink_by = Math.sqrt(v_prev_lensq / 2);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn new Vector2(v_trans_x / shrink_by, v_trans_y / shrink_by);\n\t\t\t\t}\n\n\t\t\t\tconst contourMovements = [];\n\n\t\t\t\tfor (let i = 0, il = contour.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) {\n\t\t\t\t\tif (j === il) j = 0;\n\t\t\t\t\tif (k === il) k = 0; //\t(j)---(i)---(k)\n\t\t\t\t\t// console.log('i,j,k', i, j , k)\n\n\t\t\t\t\tcontourMovements[i] = getBevelVec(contour[i], contour[j], contour[k]);\n\t\t\t\t}\n\n\t\t\t\tconst holesMovements = [];\n\t\t\t\tlet oneHoleMovements,\n\t\t\t\t\t\tverticesMovements = contourMovements.concat();\n\n\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\toneHoleMovements = [];\n\n\t\t\t\t\tfor (let i = 0, il = ahole.length, j = il - 1, k = i + 1; i < il; i++, j++, k++) {\n\t\t\t\t\t\tif (j === il) j = 0;\n\t\t\t\t\t\tif (k === il) k = 0; //\t(j)---(i)---(k)\n\n\t\t\t\t\t\toneHoleMovements[i] = getBevelVec(ahole[i], ahole[j], ahole[k]);\n\t\t\t\t\t}\n\n\t\t\t\t\tholesMovements.push(oneHoleMovements);\n\t\t\t\t\tverticesMovements = verticesMovements.concat(oneHoleMovements);\n\t\t\t\t} // Loop bevelSegments, 1 for the front, 1 for the back\n\n\n\t\t\t\tfor (let b = 0; b < bevelSegments; b++) {\n\t\t\t\t\t//for ( b = bevelSegments; b > 0; b -- ) {\n\t\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\t\tconst z = bevelThickness * Math.cos(t * Math.PI / 2);\n\t\t\t\t\tconst bs = bevelSize * Math.sin(t * Math.PI / 2) + bevelOffset; // contract shape\n\n\t\t\t\t\tfor (let i = 0, il = contour.length; i < il; i++) {\n\t\t\t\t\t\tconst vert = scalePt2(contour[i], contourMovements[i], bs);\n\t\t\t\t\t\tv(vert.x, vert.y, -z);\n\t\t\t\t\t} // expand holes\n\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\t\toneHoleMovements = holesMovements[h];\n\n\t\t\t\t\t\tfor (let i = 0, il = ahole.length; i < il; i++) {\n\t\t\t\t\t\t\tconst vert = scalePt2(ahole[i], oneHoleMovements[i], bs);\n\t\t\t\t\t\t\tv(vert.x, vert.y, -z);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst bs = bevelSize + bevelOffset; // Back facing vertices\n\n\t\t\t\tfor (let i = 0; i < vlen; i++) {\n\t\t\t\t\tconst vert = bevelEnabled ? scalePt2(vertices[i], verticesMovements[i], bs) : vertices[i];\n\n\t\t\t\t\tif (!extrudeByPath) {\n\t\t\t\t\t\tv(vert.x, vert.y, 0);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ 0 ].y, extrudePts[ 0 ].x );\n\t\t\t\t\t\tnormal.copy(splineTube.normals[0]).multiplyScalar(vert.x);\n\t\t\t\t\t\tbinormal.copy(splineTube.binormals[0]).multiplyScalar(vert.y);\n\t\t\t\t\t\tposition2.copy(extrudePts[0]).add(normal).add(binormal);\n\t\t\t\t\t\tv(position2.x, position2.y, position2.z);\n\t\t\t\t\t}\n\t\t\t\t} // Add stepped vertices...\n\t\t\t\t// Including front facing vertices\n\n\n\t\t\t\tfor (let s = 1; s <= steps; s++) {\n\t\t\t\t\tfor (let i = 0; i < vlen; i++) {\n\t\t\t\t\t\tconst vert = bevelEnabled ? scalePt2(vertices[i], verticesMovements[i], bs) : vertices[i];\n\n\t\t\t\t\t\tif (!extrudeByPath) {\n\t\t\t\t\t\t\tv(vert.x, vert.y, depth / steps * s);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// v( vert.x, vert.y + extrudePts[ s - 1 ].y, extrudePts[ s - 1 ].x );\n\t\t\t\t\t\t\tnormal.copy(splineTube.normals[s]).multiplyScalar(vert.x);\n\t\t\t\t\t\t\tbinormal.copy(splineTube.binormals[s]).multiplyScalar(vert.y);\n\t\t\t\t\t\t\tposition2.copy(extrudePts[s]).add(normal).add(binormal);\n\t\t\t\t\t\t\tv(position2.x, position2.y, position2.z);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // Add bevel segments planes\n\t\t\t\t//for ( b = 1; b <= bevelSegments; b ++ ) {\n\n\n\t\t\t\tfor (let b = bevelSegments - 1; b >= 0; b--) {\n\t\t\t\t\tconst t = b / bevelSegments;\n\t\t\t\t\tconst z = bevelThickness * Math.cos(t * Math.PI / 2);\n\t\t\t\t\tconst bs = bevelSize * Math.sin(t * Math.PI / 2) + bevelOffset; // contract shape\n\n\t\t\t\t\tfor (let i = 0, il = contour.length; i < il; i++) {\n\t\t\t\t\t\tconst vert = scalePt2(contour[i], contourMovements[i], bs);\n\t\t\t\t\t\tv(vert.x, vert.y, depth + z);\n\t\t\t\t\t} // expand holes\n\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\t\toneHoleMovements = holesMovements[h];\n\n\t\t\t\t\t\tfor (let i = 0, il = ahole.length; i < il; i++) {\n\t\t\t\t\t\t\tconst vert = scalePt2(ahole[i], oneHoleMovements[i], bs);\n\n\t\t\t\t\t\t\tif (!extrudeByPath) {\n\t\t\t\t\t\t\t\tv(vert.x, vert.y, depth + z);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tv(vert.x, vert.y + extrudePts[steps - 1].y, extrudePts[steps - 1].x + z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/* Faces */\n\t\t\t\t// Top and bottom faces\n\n\n\t\t\t\tbuildLidFaces(); // Sides faces\n\n\t\t\t\tbuildSideFaces(); /////\tInternal functions\n\n\t\t\t\tfunction buildLidFaces() {\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\n\t\t\t\t\tif (bevelEnabled) {\n\t\t\t\t\t\tlet layer = 0; // steps + 1\n\n\t\t\t\t\t\tlet offset = vlen * layer; // Bottom faces\n\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[2] + offset, face[1] + offset, face[0] + offset);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tlayer = steps + bevelSegments * 2;\n\t\t\t\t\t\toffset = vlen * layer; // Top faces\n\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[0] + offset, face[1] + offset, face[2] + offset);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Bottom faces\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[2], face[1], face[0]);\n\t\t\t\t\t\t} // Top faces\n\n\n\t\t\t\t\t\tfor (let i = 0; i < flen; i++) {\n\t\t\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\t\t\tf3(face[0] + vlen * steps, face[1] + vlen * steps, face[2] + vlen * steps);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.addGroup(start, verticesArray.length / 3 - start, 0);\n\t\t\t\t} // Create faces for the z-sides of the shape\n\n\n\t\t\t\tfunction buildSideFaces() {\n\t\t\t\t\tconst start = verticesArray.length / 3;\n\t\t\t\t\tlet layeroffset = 0;\n\t\t\t\t\tsidewalls(contour, layeroffset);\n\t\t\t\t\tlayeroffset += contour.length;\n\n\t\t\t\t\tfor (let h = 0, hl = holes.length; h < hl; h++) {\n\t\t\t\t\t\tconst ahole = holes[h];\n\t\t\t\t\t\tsidewalls(ahole, layeroffset); //, true\n\n\t\t\t\t\t\tlayeroffset += ahole.length;\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.addGroup(start, verticesArray.length / 3 - start, 1);\n\t\t\t\t}\n\n\t\t\t\tfunction sidewalls(contour, layeroffset) {\n\t\t\t\t\tlet i = contour.length;\n\n\t\t\t\t\twhile (--i >= 0) {\n\t\t\t\t\t\tconst j = i;\n\t\t\t\t\t\tlet k = i - 1;\n\t\t\t\t\t\tif (k < 0) k = contour.length - 1; //console.log('b', i,j, i-1, k,vertices.length);\n\n\t\t\t\t\t\tfor (let s = 0, sl = steps + bevelSegments * 2; s < sl; s++) {\n\t\t\t\t\t\t\tconst slen1 = vlen * s;\n\t\t\t\t\t\t\tconst slen2 = vlen * (s + 1);\n\t\t\t\t\t\t\tconst a = layeroffset + j + slen1,\n\t\t\t\t\t\t\t\t\t\tb = layeroffset + k + slen1,\n\t\t\t\t\t\t\t\t\t\tc = layeroffset + k + slen2,\n\t\t\t\t\t\t\t\t\t\td = layeroffset + j + slen2;\n\t\t\t\t\t\t\tf4(a, b, c, d);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfunction v(x, y, z) {\n\t\t\t\t\tplaceholder.push(x);\n\t\t\t\t\tplaceholder.push(y);\n\t\t\t\t\tplaceholder.push(z);\n\t\t\t\t}\n\n\t\t\t\tfunction f3(a, b, c) {\n\t\t\t\t\taddVertex(a);\n\t\t\t\t\taddVertex(b);\n\t\t\t\t\taddVertex(c);\n\t\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\t\tconst uvs = uvgen.generateTopUV(scope, verticesArray, nextIndex - 3, nextIndex - 2, nextIndex - 1);\n\t\t\t\t\taddUV(uvs[0]);\n\t\t\t\t\taddUV(uvs[1]);\n\t\t\t\t\taddUV(uvs[2]);\n\t\t\t\t}\n\n\t\t\t\tfunction f4(a, b, c, d) {\n\t\t\t\t\taddVertex(a);\n\t\t\t\t\taddVertex(b);\n\t\t\t\t\taddVertex(d);\n\t\t\t\t\taddVertex(b);\n\t\t\t\t\taddVertex(c);\n\t\t\t\t\taddVertex(d);\n\t\t\t\t\tconst nextIndex = verticesArray.length / 3;\n\t\t\t\t\tconst uvs = uvgen.generateSideWallUV(scope, verticesArray, nextIndex - 6, nextIndex - 3, nextIndex - 2, nextIndex - 1);\n\t\t\t\t\taddUV(uvs[0]);\n\t\t\t\t\taddUV(uvs[1]);\n\t\t\t\t\taddUV(uvs[3]);\n\t\t\t\t\taddUV(uvs[1]);\n\t\t\t\t\taddUV(uvs[2]);\n\t\t\t\t\taddUV(uvs[3]);\n\t\t\t\t}\n\n\t\t\t\tfunction addVertex(index) {\n\t\t\t\t\tverticesArray.push(placeholder[index * 3 + 0]);\n\t\t\t\t\tverticesArray.push(placeholder[index * 3 + 1]);\n\t\t\t\t\tverticesArray.push(placeholder[index * 3 + 2]);\n\t\t\t\t}\n\n\t\t\t\tfunction addUV(vector2) {\n\t\t\t\t\tuvArray.push(vector2.x);\n\t\t\t\t\tuvArray.push(vector2.y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tconst shapes = this.parameters.shapes;\n\t\t\tconst options = this.parameters.options;\n\t\t\treturn toJSON$1(shapes, options, data);\n\t\t}\n\n\t\tstatic fromJSON(data, shapes) {\n\t\t\tconst geometryShapes = [];\n\n\t\t\tfor (let j = 0, jl = data.shapes.length; j < jl; j++) {\n\t\t\t\tconst shape = shapes[data.shapes[j]];\n\t\t\t\tgeometryShapes.push(shape);\n\t\t\t}\n\n\t\t\tconst extrudePath = data.options.extrudePath;\n\n\t\t\tif (extrudePath !== undefined) {\n\t\t\t\tdata.options.extrudePath = new Curves[extrudePath.type]().fromJSON(extrudePath);\n\t\t\t}\n\n\t\t\treturn new ExtrudeGeometry(geometryShapes, data.options);\n\t\t}\n\n\t}\n\n\tconst WorldUVGenerator = {\n\t\tgenerateTopUV: function (geometry, vertices, indexA, indexB, indexC) {\n\t\t\tconst a_x = vertices[indexA * 3];\n\t\t\tconst a_y = vertices[indexA * 3 + 1];\n\t\t\tconst b_x = vertices[indexB * 3];\n\t\t\tconst b_y = vertices[indexB * 3 + 1];\n\t\t\tconst c_x = vertices[indexC * 3];\n\t\t\tconst c_y = vertices[indexC * 3 + 1];\n\t\t\treturn [new Vector2(a_x, a_y), new Vector2(b_x, b_y), new Vector2(c_x, c_y)];\n\t\t},\n\t\tgenerateSideWallUV: function (geometry, vertices, indexA, indexB, indexC, indexD) {\n\t\t\tconst a_x = vertices[indexA * 3];\n\t\t\tconst a_y = vertices[indexA * 3 + 1];\n\t\t\tconst a_z = vertices[indexA * 3 + 2];\n\t\t\tconst b_x = vertices[indexB * 3];\n\t\t\tconst b_y = vertices[indexB * 3 + 1];\n\t\t\tconst b_z = vertices[indexB * 3 + 2];\n\t\t\tconst c_x = vertices[indexC * 3];\n\t\t\tconst c_y = vertices[indexC * 3 + 1];\n\t\t\tconst c_z = vertices[indexC * 3 + 2];\n\t\t\tconst d_x = vertices[indexD * 3];\n\t\t\tconst d_y = vertices[indexD * 3 + 1];\n\t\t\tconst d_z = vertices[indexD * 3 + 2];\n\n\t\t\tif (Math.abs(a_y - b_y) < Math.abs(a_x - b_x)) {\n\t\t\t\treturn [new Vector2(a_x, 1 - a_z), new Vector2(b_x, 1 - b_z), new Vector2(c_x, 1 - c_z), new Vector2(d_x, 1 - d_z)];\n\t\t\t} else {\n\t\t\t\treturn [new Vector2(a_y, 1 - a_z), new Vector2(b_y, 1 - b_z), new Vector2(c_y, 1 - c_z), new Vector2(d_y, 1 - d_z)];\n\t\t\t}\n\t\t}\n\t};\n\n\tfunction toJSON$1(shapes, options, data) {\n\t\tdata.shapes = [];\n\n\t\tif (Array.isArray(shapes)) {\n\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\tconst shape = shapes[i];\n\t\t\t\tdata.shapes.push(shape.uuid);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.shapes.push(shapes.uuid);\n\t\t}\n\n\t\tif (options.extrudePath !== undefined) data.options.extrudePath = options.extrudePath.toJSON();\n\t\treturn data;\n\t}\n\n\tclass IcosahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst t = (1 + Math.sqrt(5)) / 2;\n\t\t\tconst vertices = [-1, t, 0, 1, t, 0, -1, -t, 0, 1, -t, 0, 0, -1, t, 0, 1, t, 0, -1, -t, 0, 1, -t, t, 0, -1, t, 0, 1, -t, 0, -1, -t, 0, 1];\n\t\t\tconst indices = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'IcosahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new IcosahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tclass LatheGeometry extends BufferGeometry {\n\t\tconstructor(points = [new Vector2(0, 0.5), new Vector2(0.5, 0), new Vector2(0, -0.5)], segments = 12, phiStart = 0, phiLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LatheGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tpoints: points,\n\t\t\t\tsegments: segments,\n\t\t\t\tphiStart: phiStart,\n\t\t\t\tphiLength: phiLength\n\t\t\t};\n\t\t\tsegments = Math.floor(segments); // clamp phiLength so it's in range of [ 0, 2PI ]\n\n\t\t\tphiLength = clamp(phiLength, 0, Math.PI * 2); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst inverseSegments = 1.0 / segments;\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst uv = new Vector2(); // generate vertices and uvs\n\n\t\t\tfor (let i = 0; i <= segments; i++) {\n\t\t\t\tconst phi = phiStart + i * inverseSegments * phiLength;\n\t\t\t\tconst sin = Math.sin(phi);\n\t\t\t\tconst cos = Math.cos(phi);\n\n\t\t\t\tfor (let j = 0; j <= points.length - 1; j++) {\n\t\t\t\t\t// vertex\n\t\t\t\t\tvertex.x = points[j].x * sin;\n\t\t\t\t\tvertex.y = points[j].y;\n\t\t\t\t\tvertex.z = points[j].x * cos;\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // uv\n\n\t\t\t\t\tuv.x = i / segments;\n\t\t\t\t\tuv.y = j / (points.length - 1);\n\t\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t\t}\n\t\t\t} // indices\n\n\n\t\t\tfor (let i = 0; i < segments; i++) {\n\t\t\t\tfor (let j = 0; j < points.length - 1; j++) {\n\t\t\t\t\tconst base = j + i * points.length;\n\t\t\t\t\tconst a = base;\n\t\t\t\t\tconst b = base + points.length;\n\t\t\t\t\tconst c = base + points.length + 1;\n\t\t\t\t\tconst d = base + 1; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // generate normals\n\n\t\t\tthis.computeVertexNormals(); // if the geometry is closed, we need to average the normals along the seam.\n\t\t\t// because the corresponding vertices are identical (but still have different UVs).\n\n\t\t\tif (phiLength === Math.PI * 2) {\n\t\t\t\tconst normals = this.attributes.normal.array;\n\t\t\t\tconst n1 = new Vector3();\n\t\t\t\tconst n2 = new Vector3();\n\t\t\t\tconst n = new Vector3(); // this is the buffer offset for the last line of vertices\n\n\t\t\t\tconst base = segments * points.length * 3;\n\n\t\t\t\tfor (let i = 0, j = 0; i < points.length; i++, j += 3) {\n\t\t\t\t\t// select the normal of the vertex in the first line\n\t\t\t\t\tn1.x = normals[j + 0];\n\t\t\t\t\tn1.y = normals[j + 1];\n\t\t\t\t\tn1.z = normals[j + 2]; // select the normal of the vertex in the last line\n\n\t\t\t\t\tn2.x = normals[base + j + 0];\n\t\t\t\t\tn2.y = normals[base + j + 1];\n\t\t\t\t\tn2.z = normals[base + j + 2]; // average normals\n\n\t\t\t\t\tn.addVectors(n1, n2).normalize(); // assign the new values to both normals\n\n\t\t\t\t\tnormals[j + 0] = normals[base + j + 0] = n.x;\n\t\t\t\t\tnormals[j + 1] = normals[base + j + 1] = n.y;\n\t\t\t\t\tnormals[j + 2] = normals[base + j + 2] = n.z;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new LatheGeometry(data.points, data.segments, data.phiStart, data.phiLength);\n\t\t}\n\n\t}\n\n\tclass OctahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst vertices = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1];\n\t\t\tconst indices = [0, 2, 4, 0, 4, 3, 0, 3, 5, 0, 5, 2, 1, 2, 5, 1, 5, 3, 1, 3, 4, 1, 4, 2];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'OctahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new OctahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tclass RingGeometry extends BufferGeometry {\n\t\tconstructor(innerRadius = 0.5, outerRadius = 1, thetaSegments = 8, phiSegments = 1, thetaStart = 0, thetaLength = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'RingGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tinnerRadius: innerRadius,\n\t\t\t\touterRadius: outerRadius,\n\t\t\t\tthetaSegments: thetaSegments,\n\t\t\t\tphiSegments: phiSegments,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\tthetaSegments = Math.max(3, thetaSegments);\n\t\t\tphiSegments = Math.max(1, phiSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // some helper variables\n\n\t\t\tlet radius = innerRadius;\n\t\t\tconst radiusStep = (outerRadius - innerRadius) / phiSegments;\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst uv = new Vector2(); // generate vertices, normals and uvs\n\n\t\t\tfor (let j = 0; j <= phiSegments; j++) {\n\t\t\t\tfor (let i = 0; i <= thetaSegments; i++) {\n\t\t\t\t\t// values are generate from the inside of the ring to the outside\n\t\t\t\t\tconst segment = thetaStart + i / thetaSegments * thetaLength; // vertex\n\n\t\t\t\t\tvertex.x = radius * Math.cos(segment);\n\t\t\t\t\tvertex.y = radius * Math.sin(segment);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tnormals.push(0, 0, 1); // uv\n\n\t\t\t\t\tuv.x = (vertex.x / outerRadius + 1) / 2;\n\t\t\t\t\tuv.y = (vertex.y / outerRadius + 1) / 2;\n\t\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t\t} // increase the radius for next row of vertices\n\n\n\t\t\t\tradius += radiusStep;\n\t\t\t} // indices\n\n\n\t\t\tfor (let j = 0; j < phiSegments; j++) {\n\t\t\t\tconst thetaSegmentLevel = j * (thetaSegments + 1);\n\n\t\t\t\tfor (let i = 0; i < thetaSegments; i++) {\n\t\t\t\t\tconst segment = i + thetaSegmentLevel;\n\t\t\t\t\tconst a = segment;\n\t\t\t\t\tconst b = segment + thetaSegments + 1;\n\t\t\t\t\tconst c = segment + thetaSegments + 2;\n\t\t\t\t\tconst d = segment + 1; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new RingGeometry(data.innerRadius, data.outerRadius, data.thetaSegments, data.phiSegments, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass ShapeGeometry extends BufferGeometry {\n\t\tconstructor(shapes = new Shape([new Vector2(0, 0.5), new Vector2(-0.5, -0.5), new Vector2(0.5, -0.5)]), curveSegments = 12) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ShapeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tshapes: shapes,\n\t\t\t\tcurveSegments: curveSegments\n\t\t\t}; // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tlet groupStart = 0;\n\t\t\tlet groupCount = 0; // allow single and array values for \"shapes\" parameter\n\n\t\t\tif (Array.isArray(shapes) === false) {\n\t\t\t\taddShape(shapes);\n\t\t\t} else {\n\t\t\t\tfor (let i = 0; i < shapes.length; i++) {\n\t\t\t\t\taddShape(shapes[i]);\n\t\t\t\t\tthis.addGroup(groupStart, groupCount, i); // enables MultiMaterial support\n\n\t\t\t\t\tgroupStart += groupCount;\n\t\t\t\t\tgroupCount = 0;\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // helper functions\n\n\t\t\tfunction addShape(shape) {\n\t\t\t\tconst indexOffset = vertices.length / 3;\n\t\t\t\tconst points = shape.extractPoints(curveSegments);\n\t\t\t\tlet shapeVertices = points.shape;\n\t\t\t\tconst shapeHoles = points.holes; // check direction of vertices\n\n\t\t\t\tif (ShapeUtils.isClockWise(shapeVertices) === false) {\n\t\t\t\t\tshapeVertices = shapeVertices.reverse();\n\t\t\t\t}\n\n\t\t\t\tfor (let i = 0, l = shapeHoles.length; i < l; i++) {\n\t\t\t\t\tconst shapeHole = shapeHoles[i];\n\n\t\t\t\t\tif (ShapeUtils.isClockWise(shapeHole) === true) {\n\t\t\t\t\t\tshapeHoles[i] = shapeHole.reverse();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst faces = ShapeUtils.triangulateShape(shapeVertices, shapeHoles); // join vertices of inner and outer paths to a single array\n\n\t\t\t\tfor (let i = 0, l = shapeHoles.length; i < l; i++) {\n\t\t\t\t\tconst shapeHole = shapeHoles[i];\n\t\t\t\t\tshapeVertices = shapeVertices.concat(shapeHole);\n\t\t\t\t} // vertices, normals, uvs\n\n\n\t\t\t\tfor (let i = 0, l = shapeVertices.length; i < l; i++) {\n\t\t\t\t\tconst vertex = shapeVertices[i];\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, 0);\n\t\t\t\t\tnormals.push(0, 0, 1);\n\t\t\t\t\tuvs.push(vertex.x, vertex.y); // world uvs\n\t\t\t\t} // incides\n\n\n\t\t\t\tfor (let i = 0, l = faces.length; i < l; i++) {\n\t\t\t\t\tconst face = faces[i];\n\t\t\t\t\tconst a = face[0] + indexOffset;\n\t\t\t\t\tconst b = face[1] + indexOffset;\n\t\t\t\t\tconst c = face[2] + indexOffset;\n\t\t\t\t\tindices.push(a, b, c);\n\t\t\t\t\tgroupCount += 3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tconst shapes = this.parameters.shapes;\n\t\t\treturn toJSON(shapes, data);\n\t\t}\n\n\t\tstatic fromJSON(data, shapes) {\n\t\t\tconst geometryShapes = [];\n\n\t\t\tfor (let j = 0, jl = data.shapes.length; j < jl; j++) {\n\t\t\t\tconst shape = shapes[data.shapes[j]];\n\t\t\t\tgeometryShapes.push(shape);\n\t\t\t}\n\n\t\t\treturn new ShapeGeometry(geometryShapes, data.curveSegments);\n\t\t}\n\n\t}\n\n\tfunction toJSON(shapes, data) {\n\t\tdata.shapes = [];\n\n\t\tif (Array.isArray(shapes)) {\n\t\t\tfor (let i = 0, l = shapes.length; i < l; i++) {\n\t\t\t\tconst shape = shapes[i];\n\t\t\t\tdata.shapes.push(shape.uuid);\n\t\t\t}\n\t\t} else {\n\t\t\tdata.shapes.push(shapes.uuid);\n\t\t}\n\n\t\treturn data;\n\t}\n\n\tclass SphereGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI) {\n\t\t\tsuper();\n\t\t\tthis.type = 'SphereGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\twidthSegments: widthSegments,\n\t\t\t\theightSegments: heightSegments,\n\t\t\t\tphiStart: phiStart,\n\t\t\t\tphiLength: phiLength,\n\t\t\t\tthetaStart: thetaStart,\n\t\t\t\tthetaLength: thetaLength\n\t\t\t};\n\t\t\twidthSegments = Math.max(3, Math.floor(widthSegments));\n\t\t\theightSegments = Math.max(2, Math.floor(heightSegments));\n\t\t\tconst thetaEnd = Math.min(thetaStart + thetaLength, Math.PI);\n\t\t\tlet index = 0;\n\t\t\tconst grid = [];\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3(); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // generate vertices, normals and uvs\n\n\t\t\tfor (let iy = 0; iy <= heightSegments; iy++) {\n\t\t\t\tconst verticesRow = [];\n\t\t\t\tconst v = iy / heightSegments; // special case for the poles\n\n\t\t\t\tlet uOffset = 0;\n\n\t\t\t\tif (iy == 0 && thetaStart == 0) {\n\t\t\t\t\tuOffset = 0.5 / widthSegments;\n\t\t\t\t} else if (iy == heightSegments && thetaEnd == Math.PI) {\n\t\t\t\t\tuOffset = -0.5 / widthSegments;\n\t\t\t\t}\n\n\t\t\t\tfor (let ix = 0; ix <= widthSegments; ix++) {\n\t\t\t\t\tconst u = ix / widthSegments; // vertex\n\n\t\t\t\t\tvertex.x = -radius * Math.cos(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength);\n\t\t\t\t\tvertex.y = radius * Math.cos(thetaStart + v * thetaLength);\n\t\t\t\t\tvertex.z = radius * Math.sin(phiStart + u * phiLength) * Math.sin(thetaStart + v * thetaLength);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tnormal.copy(vertex).normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\tuvs.push(u + uOffset, 1 - v);\n\t\t\t\t\tverticesRow.push(index++);\n\t\t\t\t}\n\n\t\t\t\tgrid.push(verticesRow);\n\t\t\t} // indices\n\n\n\t\t\tfor (let iy = 0; iy < heightSegments; iy++) {\n\t\t\t\tfor (let ix = 0; ix < widthSegments; ix++) {\n\t\t\t\t\tconst a = grid[iy][ix + 1];\n\t\t\t\t\tconst b = grid[iy][ix];\n\t\t\t\t\tconst c = grid[iy + 1][ix];\n\t\t\t\t\tconst d = grid[iy + 1][ix + 1];\n\t\t\t\t\tif (iy !== 0 || thetaStart > 0) indices.push(a, b, d);\n\t\t\t\t\tif (iy !== heightSegments - 1 || thetaEnd < Math.PI) indices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new SphereGeometry(data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength);\n\t\t}\n\n\t}\n\n\tclass TetrahedronGeometry extends PolyhedronGeometry {\n\t\tconstructor(radius = 1, detail = 0) {\n\t\t\tconst vertices = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1];\n\t\t\tconst indices = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];\n\t\t\tsuper(vertices, indices, radius, detail);\n\t\t\tthis.type = 'TetrahedronGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\tdetail: detail\n\t\t\t};\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new TetrahedronGeometry(data.radius, data.detail);\n\t\t}\n\n\t}\n\n\tclass TorusGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, tube = 0.4, radialSegments = 8, tubularSegments = 6, arc = Math.PI * 2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'TorusGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\ttube: tube,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\ttubularSegments: tubularSegments,\n\t\t\t\tarc: arc\n\t\t\t};\n\t\t\tradialSegments = Math.floor(radialSegments);\n\t\t\ttubularSegments = Math.floor(tubularSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst center = new Vector3();\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3(); // generate vertices, normals and uvs\n\n\t\t\tfor (let j = 0; j <= radialSegments; j++) {\n\t\t\t\tfor (let i = 0; i <= tubularSegments; i++) {\n\t\t\t\t\tconst u = i / tubularSegments * arc;\n\t\t\t\t\tconst v = j / radialSegments * Math.PI * 2; // vertex\n\n\t\t\t\t\tvertex.x = (radius + tube * Math.cos(v)) * Math.cos(u);\n\t\t\t\t\tvertex.y = (radius + tube * Math.cos(v)) * Math.sin(u);\n\t\t\t\t\tvertex.z = tube * Math.sin(v);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal\n\n\t\t\t\t\tcenter.x = radius * Math.cos(u);\n\t\t\t\t\tcenter.y = radius * Math.sin(u);\n\t\t\t\t\tnormal.subVectors(vertex, center).normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\tuvs.push(i / tubularSegments);\n\t\t\t\t\tuvs.push(j / radialSegments);\n\t\t\t\t}\n\t\t\t} // generate indices\n\n\n\t\t\tfor (let j = 1; j <= radialSegments; j++) {\n\t\t\t\tfor (let i = 1; i <= tubularSegments; i++) {\n\t\t\t\t\t// indices\n\t\t\t\t\tconst a = (tubularSegments + 1) * j + i - 1;\n\t\t\t\t\tconst b = (tubularSegments + 1) * (j - 1) + i - 1;\n\t\t\t\t\tconst c = (tubularSegments + 1) * (j - 1) + i;\n\t\t\t\t\tconst d = (tubularSegments + 1) * j + i; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2));\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new TorusGeometry(data.radius, data.tube, data.radialSegments, data.tubularSegments, data.arc);\n\t\t}\n\n\t}\n\n\tclass TorusKnotGeometry extends BufferGeometry {\n\t\tconstructor(radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3) {\n\t\t\tsuper();\n\t\t\tthis.type = 'TorusKnotGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tradius: radius,\n\t\t\t\ttube: tube,\n\t\t\t\ttubularSegments: tubularSegments,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\tp: p,\n\t\t\t\tq: q\n\t\t\t};\n\t\t\ttubularSegments = Math.floor(tubularSegments);\n\t\t\tradialSegments = Math.floor(radialSegments); // buffers\n\n\t\t\tconst indices = [];\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = []; // helper variables\n\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3();\n\t\t\tconst P1 = new Vector3();\n\t\t\tconst P2 = new Vector3();\n\t\t\tconst B = new Vector3();\n\t\t\tconst T = new Vector3();\n\t\t\tconst N = new Vector3(); // generate vertices, normals and uvs\n\n\t\t\tfor (let i = 0; i <= tubularSegments; ++i) {\n\t\t\t\t// the radian \"u\" is used to calculate the position on the torus curve of the current tubular segement\n\t\t\t\tconst u = i / tubularSegments * p * Math.PI * 2; // now we calculate two points. P1 is our current position on the curve, P2 is a little farther ahead.\n\t\t\t\t// these points are used to create a special \"coordinate space\", which is necessary to calculate the correct vertex positions\n\n\t\t\t\tcalculatePositionOnCurve(u, p, q, radius, P1);\n\t\t\t\tcalculatePositionOnCurve(u + 0.01, p, q, radius, P2); // calculate orthonormal basis\n\n\t\t\t\tT.subVectors(P2, P1);\n\t\t\t\tN.addVectors(P2, P1);\n\t\t\t\tB.crossVectors(T, N);\n\t\t\t\tN.crossVectors(B, T); // normalize B, N. T can be ignored, we don't use it\n\n\t\t\t\tB.normalize();\n\t\t\t\tN.normalize();\n\n\t\t\t\tfor (let j = 0; j <= radialSegments; ++j) {\n\t\t\t\t\t// now calculate the vertices. they are nothing more than an extrusion of the torus curve.\n\t\t\t\t\t// because we extrude a shape in the xy-plane, there is no need to calculate a z-value.\n\t\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\t\tconst cx = -tube * Math.cos(v);\n\t\t\t\t\tconst cy = tube * Math.sin(v); // now calculate the final vertex position.\n\t\t\t\t\t// first we orient the extrusion with our basis vectos, then we add it to the current position on the curve\n\n\t\t\t\t\tvertex.x = P1.x + (cx * N.x + cy * B.x);\n\t\t\t\t\tvertex.y = P1.y + (cx * N.y + cy * B.y);\n\t\t\t\t\tvertex.z = P1.z + (cx * N.z + cy * B.z);\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z); // normal (P1 is always the center/origin of the extrusion, thus we can use it to calculate the normal)\n\n\t\t\t\t\tnormal.subVectors(vertex, P1).normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // uv\n\n\t\t\t\t\tuvs.push(i / tubularSegments);\n\t\t\t\t\tuvs.push(j / radialSegments);\n\t\t\t\t}\n\t\t\t} // generate indices\n\n\n\t\t\tfor (let j = 1; j <= tubularSegments; j++) {\n\t\t\t\tfor (let i = 1; i <= radialSegments; i++) {\n\t\t\t\t\t// indices\n\t\t\t\t\tconst a = (radialSegments + 1) * (j - 1) + (i - 1);\n\t\t\t\t\tconst b = (radialSegments + 1) * j + (i - 1);\n\t\t\t\t\tconst c = (radialSegments + 1) * j + i;\n\t\t\t\t\tconst d = (radialSegments + 1) * (j - 1) + i; // faces\n\n\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t}\n\t\t\t} // build geometry\n\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // this function calculates the current position on the torus curve\n\n\t\t\tfunction calculatePositionOnCurve(u, p, q, radius, position) {\n\t\t\t\tconst cu = Math.cos(u);\n\t\t\t\tconst su = Math.sin(u);\n\t\t\t\tconst quOverP = q / p * u;\n\t\t\t\tconst cs = Math.cos(quOverP);\n\t\t\t\tposition.x = radius * (2 + cs) * 0.5 * cu;\n\t\t\t\tposition.y = radius * (2 + cs) * su * 0.5;\n\t\t\t\tposition.z = radius * Math.sin(quOverP) * 0.5;\n\t\t\t}\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\treturn new TorusKnotGeometry(data.radius, data.tube, data.tubularSegments, data.radialSegments, data.p, data.q);\n\t\t}\n\n\t}\n\n\tclass TubeGeometry extends BufferGeometry {\n\t\tconstructor(path = new QuadraticBezierCurve3(new Vector3(-1, -1, 0), new Vector3(-1, 1, 0), new Vector3(1, 1, 0)), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false) {\n\t\t\tsuper();\n\t\t\tthis.type = 'TubeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tpath: path,\n\t\t\t\ttubularSegments: tubularSegments,\n\t\t\t\tradius: radius,\n\t\t\t\tradialSegments: radialSegments,\n\t\t\t\tclosed: closed\n\t\t\t};\n\t\t\tconst frames = path.computeFrenetFrames(tubularSegments, closed); // expose internals\n\n\t\t\tthis.tangents = frames.tangents;\n\t\t\tthis.normals = frames.normals;\n\t\t\tthis.binormals = frames.binormals; // helper variables\n\n\t\t\tconst vertex = new Vector3();\n\t\t\tconst normal = new Vector3();\n\t\t\tconst uv = new Vector2();\n\t\t\tlet P = new Vector3(); // buffer\n\n\t\t\tconst vertices = [];\n\t\t\tconst normals = [];\n\t\t\tconst uvs = [];\n\t\t\tconst indices = []; // create buffer data\n\n\t\t\tgenerateBufferData(); // build geometry\n\n\t\t\tthis.setIndex(indices);\n\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tthis.setAttribute('normal', new Float32BufferAttribute(normals, 3));\n\t\t\tthis.setAttribute('uv', new Float32BufferAttribute(uvs, 2)); // functions\n\n\t\t\tfunction generateBufferData() {\n\t\t\t\tfor (let i = 0; i < tubularSegments; i++) {\n\t\t\t\t\tgenerateSegment(i);\n\t\t\t\t} // if the geometry is not closed, generate the last row of vertices and normals\n\t\t\t\t// at the regular position on the given path\n\t\t\t\t//\n\t\t\t\t// if the geometry is closed, duplicate the first row of vertices and normals (uvs will differ)\n\n\n\t\t\t\tgenerateSegment(closed === false ? tubularSegments : 0); // uvs are generated in a separate function.\n\t\t\t\t// this makes it easy compute correct values for closed geometries\n\n\t\t\t\tgenerateUVs(); // finally create faces\n\n\t\t\t\tgenerateIndices();\n\t\t\t}\n\n\t\t\tfunction generateSegment(i) {\n\t\t\t\t// we use getPointAt to sample evenly distributed points from the given path\n\t\t\t\tP = path.getPointAt(i / tubularSegments, P); // retrieve corresponding normal and binormal\n\n\t\t\t\tconst N = frames.normals[i];\n\t\t\t\tconst B = frames.binormals[i]; // generate normals and vertices for the current segment\n\n\t\t\t\tfor (let j = 0; j <= radialSegments; j++) {\n\t\t\t\t\tconst v = j / radialSegments * Math.PI * 2;\n\t\t\t\t\tconst sin = Math.sin(v);\n\t\t\t\t\tconst cos = -Math.cos(v); // normal\n\n\t\t\t\t\tnormal.x = cos * N.x + sin * B.x;\n\t\t\t\t\tnormal.y = cos * N.y + sin * B.y;\n\t\t\t\t\tnormal.z = cos * N.z + sin * B.z;\n\t\t\t\t\tnormal.normalize();\n\t\t\t\t\tnormals.push(normal.x, normal.y, normal.z); // vertex\n\n\t\t\t\t\tvertex.x = P.x + radius * normal.x;\n\t\t\t\t\tvertex.y = P.y + radius * normal.y;\n\t\t\t\t\tvertex.z = P.z + radius * normal.z;\n\t\t\t\t\tvertices.push(vertex.x, vertex.y, vertex.z);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction generateIndices() {\n\t\t\t\tfor (let j = 1; j <= tubularSegments; j++) {\n\t\t\t\t\tfor (let i = 1; i <= radialSegments; i++) {\n\t\t\t\t\t\tconst a = (radialSegments + 1) * (j - 1) + (i - 1);\n\t\t\t\t\t\tconst b = (radialSegments + 1) * j + (i - 1);\n\t\t\t\t\t\tconst c = (radialSegments + 1) * j + i;\n\t\t\t\t\t\tconst d = (radialSegments + 1) * (j - 1) + i; // faces\n\n\t\t\t\t\t\tindices.push(a, b, d);\n\t\t\t\t\t\tindices.push(b, c, d);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction generateUVs() {\n\t\t\t\tfor (let i = 0; i <= tubularSegments; i++) {\n\t\t\t\t\tfor (let j = 0; j <= radialSegments; j++) {\n\t\t\t\t\t\tuv.x = i / tubularSegments;\n\t\t\t\t\t\tuv.y = j / radialSegments;\n\t\t\t\t\t\tuvs.push(uv.x, uv.y);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON();\n\t\t\tdata.path = this.parameters.path.toJSON();\n\t\t\treturn data;\n\t\t}\n\n\t\tstatic fromJSON(data) {\n\t\t\t// This only works for built-in curves (e.g. CatmullRomCurve3).\n\t\t\t// User defined curves or instances of CurvePath will not be deserialized.\n\t\t\treturn new TubeGeometry(new Curves[data.path.type]().fromJSON(data.path), data.tubularSegments, data.radius, data.radialSegments, data.closed);\n\t\t}\n\n\t}\n\n\tclass WireframeGeometry extends BufferGeometry {\n\t\tconstructor(geometry = null) {\n\t\t\tsuper();\n\t\t\tthis.type = 'WireframeGeometry';\n\t\t\tthis.parameters = {\n\t\t\t\tgeometry: geometry\n\t\t\t};\n\n\t\t\tif (geometry !== null) {\n\t\t\t\t// buffer\n\t\t\t\tconst vertices = [];\n\t\t\t\tconst edges = new Set(); // helper variables\n\n\t\t\t\tconst start = new Vector3();\n\t\t\t\tconst end = new Vector3();\n\n\t\t\t\tif (geometry.index !== null) {\n\t\t\t\t\t// indexed BufferGeometry\n\t\t\t\t\tconst position = geometry.attributes.position;\n\t\t\t\t\tconst indices = geometry.index;\n\t\t\t\t\tlet groups = geometry.groups;\n\n\t\t\t\t\tif (groups.length === 0) {\n\t\t\t\t\t\tgroups = [{\n\t\t\t\t\t\t\tstart: 0,\n\t\t\t\t\t\t\tcount: indices.count,\n\t\t\t\t\t\t\tmaterialIndex: 0\n\t\t\t\t\t\t}];\n\t\t\t\t\t} // create a data structure that contains all eges without duplicates\n\n\n\t\t\t\t\tfor (let o = 0, ol = groups.length; o < ol; ++o) {\n\t\t\t\t\t\tconst group = groups[o];\n\t\t\t\t\t\tconst groupStart = group.start;\n\t\t\t\t\t\tconst groupCount = group.count;\n\n\t\t\t\t\t\tfor (let i = groupStart, l = groupStart + groupCount; i < l; i += 3) {\n\t\t\t\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\t\t\t\tconst index1 = indices.getX(i + j);\n\t\t\t\t\t\t\t\tconst index2 = indices.getX(i + (j + 1) % 3);\n\t\t\t\t\t\t\t\tstart.fromBufferAttribute(position, index1);\n\t\t\t\t\t\t\t\tend.fromBufferAttribute(position, index2);\n\n\t\t\t\t\t\t\t\tif (isUniqueEdge(start, end, edges) === true) {\n\t\t\t\t\t\t\t\t\tvertices.push(start.x, start.y, start.z);\n\t\t\t\t\t\t\t\t\tvertices.push(end.x, end.y, end.z);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// non-indexed BufferGeometry\n\t\t\t\t\tconst position = geometry.attributes.position;\n\n\t\t\t\t\tfor (let i = 0, l = position.count / 3; i < l; i++) {\n\t\t\t\t\t\tfor (let j = 0; j < 3; j++) {\n\t\t\t\t\t\t\t// three edges per triangle, an edge is represented as (index1, index2)\n\t\t\t\t\t\t\t// e.g. the first triangle has the following edges: (0,1),(1,2),(2,0)\n\t\t\t\t\t\t\tconst index1 = 3 * i + j;\n\t\t\t\t\t\t\tconst index2 = 3 * i + (j + 1) % 3;\n\t\t\t\t\t\t\tstart.fromBufferAttribute(position, index1);\n\t\t\t\t\t\t\tend.fromBufferAttribute(position, index2);\n\n\t\t\t\t\t\t\tif (isUniqueEdge(start, end, edges) === true) {\n\t\t\t\t\t\t\t\tvertices.push(start.x, start.y, start.z);\n\t\t\t\t\t\t\t\tvertices.push(end.x, end.y, end.z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // build geometry\n\n\n\t\t\t\tthis.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\t}\n\t\t}\n\n\t}\n\n\tfunction isUniqueEdge(start, end, edges) {\n\t\tconst hash1 = `${start.x},${start.y},${start.z}-${end.x},${end.y},${end.z}`;\n\t\tconst hash2 = `${end.x},${end.y},${end.z}-${start.x},${start.y},${start.z}`; // coincident edge\n\n\t\tif (edges.has(hash1) === true || edges.has(hash2) === true) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tedges.add(hash1, hash2);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tvar Geometries = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tBoxGeometry: BoxGeometry,\n\t\tBoxBufferGeometry: BoxGeometry,\n\t\tCircleGeometry: CircleGeometry,\n\t\tCircleBufferGeometry: CircleGeometry,\n\t\tConeGeometry: ConeGeometry,\n\t\tConeBufferGeometry: ConeGeometry,\n\t\tCylinderGeometry: CylinderGeometry,\n\t\tCylinderBufferGeometry: CylinderGeometry,\n\t\tDodecahedronGeometry: DodecahedronGeometry,\n\t\tDodecahedronBufferGeometry: DodecahedronGeometry,\n\t\tEdgesGeometry: EdgesGeometry,\n\t\tExtrudeGeometry: ExtrudeGeometry,\n\t\tExtrudeBufferGeometry: ExtrudeGeometry,\n\t\tIcosahedronGeometry: IcosahedronGeometry,\n\t\tIcosahedronBufferGeometry: IcosahedronGeometry,\n\t\tLatheGeometry: LatheGeometry,\n\t\tLatheBufferGeometry: LatheGeometry,\n\t\tOctahedronGeometry: OctahedronGeometry,\n\t\tOctahedronBufferGeometry: OctahedronGeometry,\n\t\tPlaneGeometry: PlaneGeometry,\n\t\tPlaneBufferGeometry: PlaneGeometry,\n\t\tPolyhedronGeometry: PolyhedronGeometry,\n\t\tPolyhedronBufferGeometry: PolyhedronGeometry,\n\t\tRingGeometry: RingGeometry,\n\t\tRingBufferGeometry: RingGeometry,\n\t\tShapeGeometry: ShapeGeometry,\n\t\tShapeBufferGeometry: ShapeGeometry,\n\t\tSphereGeometry: SphereGeometry,\n\t\tSphereBufferGeometry: SphereGeometry,\n\t\tTetrahedronGeometry: TetrahedronGeometry,\n\t\tTetrahedronBufferGeometry: TetrahedronGeometry,\n\t\tTorusGeometry: TorusGeometry,\n\t\tTorusBufferGeometry: TorusGeometry,\n\t\tTorusKnotGeometry: TorusKnotGeometry,\n\t\tTorusKnotBufferGeometry: TorusKnotGeometry,\n\t\tTubeGeometry: TubeGeometry,\n\t\tTubeBufferGeometry: TubeGeometry,\n\t\tWireframeGeometry: WireframeGeometry\n\t});\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <THREE.Color>\n\t * }\n\t */\n\n\tclass ShadowMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ShadowMaterial';\n\t\t\tthis.color = new Color(0x000000);\n\t\t\tthis.transparent = true;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tShadowMaterial.prototype.isShadowMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\troughness: <float>,\n\t *\tmetalness: <float>,\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\troughnessMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tmetalnessMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tenvMapIntensity: <float>\n\t *\n\t *\trefractionRatio: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshStandardMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshStandardMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.roughness = 1.0;\n\t\t\tthis.metalness = 0.0;\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.roughnessMap = null;\n\t\t\tthis.metalnessMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.envMapIntensity = 1.0;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': ''\n\t\t\t};\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.roughness = source.roughness;\n\t\t\tthis.metalness = source.metalness;\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.roughnessMap = source.roughnessMap;\n\t\t\tthis.metalnessMap = source.metalnessMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.envMapIntensity = source.envMapIntensity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshStandardMaterial.prototype.isMeshStandardMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tclearcoat: <float>,\n\t *\tclearcoatMap: new THREE.Texture( <Image> ),\n\t *\tclearcoatRoughness: <float>,\n\t *\tclearcoatRoughnessMap: new THREE.Texture( <Image> ),\n\t *\tclearcoatNormalScale: <Vector2>,\n\t *\tclearcoatNormalMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tior: <float>,\n\t *\treflectivity: <float>,\n\t *\n\t *\tsheen: <float>,\n\t *\tsheenTint: <Color>,\n\t *\tsheenRoughness: <float>,\n\t *\n\t *\ttransmission: <float>,\n\t *\ttransmissionMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tthickness: <float>,\n\t *\tthicknessMap: new THREE.Texture( <Image> ),\n\t *\tattenuationDistance: <float>,\n\t *\tattenuationTint: <Color>,\n\t *\n\t *\tspecularIntensity: <float>,\n\t *\tspecularIntensityhMap: new THREE.Texture( <Image> ),\n\t *\tspecularTint: <Color>,\n\t *\tspecularTintMap: new THREE.Texture( <Image> )\n\t * }\n\t */\n\n\tclass MeshPhysicalMaterial extends MeshStandardMaterial {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': '',\n\t\t\t\t'PHYSICAL': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshPhysicalMaterial';\n\t\t\tthis.clearcoatMap = null;\n\t\t\tthis.clearcoatRoughness = 0.0;\n\t\t\tthis.clearcoatRoughnessMap = null;\n\t\t\tthis.clearcoatNormalScale = new Vector2(1, 1);\n\t\t\tthis.clearcoatNormalMap = null;\n\t\t\tthis.ior = 1.5;\n\t\t\tObject.defineProperty(this, 'reflectivity', {\n\t\t\t\tget: function () {\n\t\t\t\t\treturn clamp(2.5 * (this.ior - 1) / (this.ior + 1), 0, 1);\n\t\t\t\t},\n\t\t\t\tset: function (reflectivity) {\n\t\t\t\t\tthis.ior = (1 + 0.4 * reflectivity) / (1 - 0.4 * reflectivity);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.sheenTint = new Color(0x000000);\n\t\t\tthis.sheenRoughness = 1.0;\n\t\t\tthis.transmissionMap = null;\n\t\t\tthis.thickness = 0.01;\n\t\t\tthis.thicknessMap = null;\n\t\t\tthis.attenuationDistance = 0.0;\n\t\t\tthis.attenuationTint = new Color(1, 1, 1);\n\t\t\tthis.specularIntensity = 1.0;\n\t\t\tthis.specularIntensityMap = null;\n\t\t\tthis.specularTint = new Color(1, 1, 1);\n\t\t\tthis.specularTintMap = null;\n\t\t\tthis._sheen = 0.0;\n\t\t\tthis._clearcoat = 0;\n\t\t\tthis._transmission = 0;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tget sheen() {\n\t\t\treturn this._sheen;\n\t\t}\n\n\t\tset sheen(value) {\n\t\t\tif (this._sheen > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._sheen = value;\n\t\t}\n\n\t\tget clearcoat() {\n\t\t\treturn this._clearcoat;\n\t\t}\n\n\t\tset clearcoat(value) {\n\t\t\tif (this._clearcoat > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._clearcoat = value;\n\t\t}\n\n\t\tget transmission() {\n\t\t\treturn this._transmission;\n\t\t}\n\n\t\tset transmission(value) {\n\t\t\tif (this._transmission > 0 !== value > 0) {\n\t\t\t\tthis.version++;\n\t\t\t}\n\n\t\t\tthis._transmission = value;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.defines = {\n\t\t\t\t'STANDARD': '',\n\t\t\t\t'PHYSICAL': ''\n\t\t\t};\n\t\t\tthis.clearcoat = source.clearcoat;\n\t\t\tthis.clearcoatMap = source.clearcoatMap;\n\t\t\tthis.clearcoatRoughness = source.clearcoatRoughness;\n\t\t\tthis.clearcoatRoughnessMap = source.clearcoatRoughnessMap;\n\t\t\tthis.clearcoatNormalMap = source.clearcoatNormalMap;\n\t\t\tthis.clearcoatNormalScale.copy(source.clearcoatNormalScale);\n\t\t\tthis.ior = source.ior;\n\t\t\tthis.sheen = source.sheen;\n\t\t\tthis.sheenTint.copy(source.sheenTint);\n\t\t\tthis.sheenRoughness = source.sheenRoughness;\n\t\t\tthis.transmission = source.transmission;\n\t\t\tthis.transmissionMap = source.transmissionMap;\n\t\t\tthis.thickness = source.thickness;\n\t\t\tthis.thicknessMap = source.thicknessMap;\n\t\t\tthis.attenuationDistance = source.attenuationDistance;\n\t\t\tthis.attenuationTint.copy(source.attenuationTint);\n\t\t\tthis.specularIntensity = source.specularIntensity;\n\t\t\tthis.specularIntensityMap = source.specularIntensityMap;\n\t\t\tthis.specularTint.copy(source.specularTint);\n\t\t\tthis.specularTintMap = source.specularTintMap;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshPhysicalMaterial.prototype.isMeshPhysicalMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\tspecular: <hex>,\n\t *\tshininess: <float>,\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\tspecularMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tcombine: THREE.MultiplyOperation,\n\t *\treflectivity: <float>,\n\t *\trefractionRatio: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshPhongMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshPhongMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.specular = new Color(0x111111);\n\t\t\tthis.shininess = 30;\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.specularMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.combine = MultiplyOperation;\n\t\t\tthis.reflectivity = 1;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.specular.copy(source.specular);\n\t\t\tthis.shininess = source.shininess;\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.combine = source.combine;\n\t\t\tthis.reflectivity = source.reflectivity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshPhongMaterial.prototype.isMeshPhongMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\tgradientMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t * }\n\t */\n\n\tclass MeshToonMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'TOON': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshToonMaterial';\n\t\t\tthis.color = new Color(0xffffff);\n\t\t\tthis.map = null;\n\t\t\tthis.gradientMap = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.gradientMap = source.gradientMap;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshToonMaterial.prototype.isMeshToonMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\topacity: <float>,\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshNormalMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshNormalMaterial';\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.fog = false;\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshNormalMaterial.prototype.isMeshNormalMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tlightMap: new THREE.Texture( <Image> ),\n\t *\tlightMapIntensity: <float>\n\t *\n\t *\taoMap: new THREE.Texture( <Image> ),\n\t *\taoMapIntensity: <float>\n\t *\n\t *\temissive: <hex>,\n\t *\temissiveIntensity: <float>\n\t *\temissiveMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tspecularMap: new THREE.Texture( <Image> ),\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tenvMap: new THREE.CubeTexture( [posx, negx, posy, negy, posz, negz] ),\n\t *\tcombine: THREE.Multiply,\n\t *\treflectivity: <float>,\n\t *\trefractionRatio: <float>,\n\t *\n\t *\twireframe: <boolean>,\n\t *\twireframeLinewidth: <float>,\n\t *\n\t * }\n\t */\n\n\tclass MeshLambertMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'MeshLambertMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.map = null;\n\t\t\tthis.lightMap = null;\n\t\t\tthis.lightMapIntensity = 1.0;\n\t\t\tthis.aoMap = null;\n\t\t\tthis.aoMapIntensity = 1.0;\n\t\t\tthis.emissive = new Color(0x000000);\n\t\t\tthis.emissiveIntensity = 1.0;\n\t\t\tthis.emissiveMap = null;\n\t\t\tthis.specularMap = null;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.envMap = null;\n\t\t\tthis.combine = MultiplyOperation;\n\t\t\tthis.reflectivity = 1;\n\t\t\tthis.refractionRatio = 0.98;\n\t\t\tthis.wireframe = false;\n\t\t\tthis.wireframeLinewidth = 1;\n\t\t\tthis.wireframeLinecap = 'round';\n\t\t\tthis.wireframeLinejoin = 'round';\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.map = source.map;\n\t\t\tthis.lightMap = source.lightMap;\n\t\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\t\t\tthis.aoMap = source.aoMap;\n\t\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\t\t\tthis.emissive.copy(source.emissive);\n\t\t\tthis.emissiveMap = source.emissiveMap;\n\t\t\tthis.emissiveIntensity = source.emissiveIntensity;\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.envMap = source.envMap;\n\t\t\tthis.combine = source.combine;\n\t\t\tthis.reflectivity = source.reflectivity;\n\t\t\tthis.refractionRatio = source.refractionRatio;\n\t\t\tthis.wireframe = source.wireframe;\n\t\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshLambertMaterial.prototype.isMeshLambertMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tmatcap: new THREE.Texture( <Image> ),\n\t *\n\t *\tmap: new THREE.Texture( <Image> ),\n\t *\n\t *\tbumpMap: new THREE.Texture( <Image> ),\n\t *\tbumpScale: <float>,\n\t *\n\t *\tnormalMap: new THREE.Texture( <Image> ),\n\t *\tnormalMapType: THREE.TangentSpaceNormalMap,\n\t *\tnormalScale: <Vector2>,\n\t *\n\t *\tdisplacementMap: new THREE.Texture( <Image> ),\n\t *\tdisplacementScale: <float>,\n\t *\tdisplacementBias: <float>,\n\t *\n\t *\talphaMap: new THREE.Texture( <Image> ),\n\t *\n\t *\tflatShading: <bool>\n\t * }\n\t */\n\n\tclass MeshMatcapMaterial extends Material {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.defines = {\n\t\t\t\t'MATCAP': ''\n\t\t\t};\n\t\t\tthis.type = 'MeshMatcapMaterial';\n\t\t\tthis.color = new Color(0xffffff); // diffuse\n\n\t\t\tthis.matcap = null;\n\t\t\tthis.map = null;\n\t\t\tthis.bumpMap = null;\n\t\t\tthis.bumpScale = 1;\n\t\t\tthis.normalMap = null;\n\t\t\tthis.normalMapType = TangentSpaceNormalMap;\n\t\t\tthis.normalScale = new Vector2(1, 1);\n\t\t\tthis.displacementMap = null;\n\t\t\tthis.displacementScale = 1;\n\t\t\tthis.displacementBias = 0;\n\t\t\tthis.alphaMap = null;\n\t\t\tthis.flatShading = false;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.defines = {\n\t\t\t\t'MATCAP': ''\n\t\t\t};\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.matcap = source.matcap;\n\t\t\tthis.map = source.map;\n\t\t\tthis.bumpMap = source.bumpMap;\n\t\t\tthis.bumpScale = source.bumpScale;\n\t\t\tthis.normalMap = source.normalMap;\n\t\t\tthis.normalMapType = source.normalMapType;\n\t\t\tthis.normalScale.copy(source.normalScale);\n\t\t\tthis.displacementMap = source.displacementMap;\n\t\t\tthis.displacementScale = source.displacementScale;\n\t\t\tthis.displacementBias = source.displacementBias;\n\t\t\tthis.alphaMap = source.alphaMap;\n\t\t\tthis.flatShading = source.flatShading;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tMeshMatcapMaterial.prototype.isMeshMatcapMaterial = true;\n\n\t/**\n\t * parameters = {\n\t *\tcolor: <hex>,\n\t *\topacity: <float>,\n\t *\n\t *\tlinewidth: <float>,\n\t *\n\t *\tscale: <float>,\n\t *\tdashSize: <float>,\n\t *\tgapSize: <float>\n\t * }\n\t */\n\n\tclass LineDashedMaterial extends LineBasicMaterial {\n\t\tconstructor(parameters) {\n\t\t\tsuper();\n\t\t\tthis.type = 'LineDashedMaterial';\n\t\t\tthis.scale = 1;\n\t\t\tthis.dashSize = 3;\n\t\t\tthis.gapSize = 1;\n\t\t\tthis.setValues(parameters);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.scale = source.scale;\n\t\t\tthis.dashSize = source.dashSize;\n\t\t\tthis.gapSize = source.gapSize;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tLineDashedMaterial.prototype.isLineDashedMaterial = true;\n\n\tvar Materials = /*#__PURE__*/Object.freeze({\n\t\t__proto__: null,\n\t\tShadowMaterial: ShadowMaterial,\n\t\tSpriteMaterial: SpriteMaterial,\n\t\tRawShaderMaterial: RawShaderMaterial,\n\t\tShaderMaterial: ShaderMaterial,\n\t\tPointsMaterial: PointsMaterial,\n\t\tMeshPhysicalMaterial: MeshPhysicalMaterial,\n\t\tMeshStandardMaterial: MeshStandardMaterial,\n\t\tMeshPhongMaterial: MeshPhongMaterial,\n\t\tMeshToonMaterial: MeshToonMaterial,\n\t\tMeshNormalMaterial: MeshNormalMaterial,\n\t\tMeshLambertMaterial: MeshLambertMaterial,\n\t\tMeshDepthMaterial: MeshDepthMaterial,\n\t\tMeshDistanceMaterial: MeshDistanceMaterial,\n\t\tMeshBasicMaterial: MeshBasicMaterial,\n\t\tMeshMatcapMaterial: MeshMatcapMaterial,\n\t\tLineDashedMaterial: LineDashedMaterial,\n\t\tLineBasicMaterial: LineBasicMaterial,\n\t\tMaterial: Material\n\t});\n\n\tconst AnimationUtils = {\n\t\t// same as Array.prototype.slice, but also works on typed arrays\n\t\tarraySlice: function (array, from, to) {\n\t\t\tif (AnimationUtils.isTypedArray(array)) {\n\t\t\t\t// in ios9 array.subarray(from, undefined) will return empty array\n\t\t\t\t// but array.subarray(from) or array.subarray(from, len) is correct\n\t\t\t\treturn new array.constructor(array.subarray(from, to !== undefined ? to : array.length));\n\t\t\t}\n\n\t\t\treturn array.slice(from, to);\n\t\t},\n\t\t// converts an array to a specific type\n\t\tconvertArray: function (array, type, forceClone) {\n\t\t\tif (!array || // let 'undefined' and 'null' pass\n\t\t\t!forceClone && array.constructor === type) return array;\n\n\t\t\tif (typeof type.BYTES_PER_ELEMENT === 'number') {\n\t\t\t\treturn new type(array); // create typed array\n\t\t\t}\n\n\t\t\treturn Array.prototype.slice.call(array); // create Array\n\t\t},\n\t\tisTypedArray: function (object) {\n\t\t\treturn ArrayBuffer.isView(object) && !(object instanceof DataView);\n\t\t},\n\t\t// returns an array by which times and values can be sorted\n\t\tgetKeyframeOrder: function (times) {\n\t\t\tfunction compareTime(i, j) {\n\t\t\t\treturn times[i] - times[j];\n\t\t\t}\n\n\t\t\tconst n = times.length;\n\t\t\tconst result = new Array(n);\n\n\t\t\tfor (let i = 0; i !== n; ++i) result[i] = i;\n\n\t\t\tresult.sort(compareTime);\n\t\t\treturn result;\n\t\t},\n\t\t// uses the array previously returned by 'getKeyframeOrder' to sort data\n\t\tsortedArray: function (values, stride, order) {\n\t\t\tconst nValues = values.length;\n\t\t\tconst result = new values.constructor(nValues);\n\n\t\t\tfor (let i = 0, dstOffset = 0; dstOffset !== nValues; ++i) {\n\t\t\t\tconst srcOffset = order[i] * stride;\n\n\t\t\t\tfor (let j = 0; j !== stride; ++j) {\n\t\t\t\t\tresult[dstOffset++] = values[srcOffset + j];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn result;\n\t\t},\n\t\t// function for parsing AOS keyframe formats\n\t\tflattenJSON: function (jsonKeys, times, values, valuePropertyName) {\n\t\t\tlet i = 1,\n\t\t\t\t\tkey = jsonKeys[0];\n\n\t\t\twhile (key !== undefined && key[valuePropertyName] === undefined) {\n\t\t\t\tkey = jsonKeys[i++];\n\t\t\t}\n\n\t\t\tif (key === undefined) return; // no data\n\n\t\t\tlet value = key[valuePropertyName];\n\t\t\tif (value === undefined) return; // no data\n\n\t\t\tif (Array.isArray(value)) {\n\t\t\t\tdo {\n\t\t\t\t\tvalue = key[valuePropertyName];\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\ttimes.push(key.time);\n\t\t\t\t\t\tvalues.push.apply(values, value); // push all elements\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[i++];\n\t\t\t\t} while (key !== undefined);\n\t\t\t} else if (value.toArray !== undefined) {\n\t\t\t\t// ...assume THREE.Math-ish\n\t\t\t\tdo {\n\t\t\t\t\tvalue = key[valuePropertyName];\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\ttimes.push(key.time);\n\t\t\t\t\t\tvalue.toArray(values, values.length);\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[i++];\n\t\t\t\t} while (key !== undefined);\n\t\t\t} else {\n\t\t\t\t// otherwise push as-is\n\t\t\t\tdo {\n\t\t\t\t\tvalue = key[valuePropertyName];\n\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\ttimes.push(key.time);\n\t\t\t\t\t\tvalues.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tkey = jsonKeys[i++];\n\t\t\t\t} while (key !== undefined);\n\t\t\t}\n\t\t},\n\t\tsubclip: function (sourceClip, name, startFrame, endFrame, fps = 30) {\n\t\t\tconst clip = sourceClip.clone();\n\t\t\tclip.name = name;\n\t\t\tconst tracks = [];\n\n\t\t\tfor (let i = 0; i < clip.tracks.length; ++i) {\n\t\t\t\tconst track = clip.tracks[i];\n\t\t\t\tconst valueSize = track.getValueSize();\n\t\t\t\tconst times = [];\n\t\t\t\tconst values = [];\n\n\t\t\t\tfor (let j = 0; j < track.times.length; ++j) {\n\t\t\t\t\tconst frame = track.times[j] * fps;\n\t\t\t\t\tif (frame < startFrame || frame >= endFrame) continue;\n\t\t\t\t\ttimes.push(track.times[j]);\n\n\t\t\t\t\tfor (let k = 0; k < valueSize; ++k) {\n\t\t\t\t\t\tvalues.push(track.values[j * valueSize + k]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (times.length === 0) continue;\n\t\t\t\ttrack.times = AnimationUtils.convertArray(times, track.times.constructor);\n\t\t\t\ttrack.values = AnimationUtils.convertArray(values, track.values.constructor);\n\t\t\t\ttracks.push(track);\n\t\t\t}\n\n\t\t\tclip.tracks = tracks; // find minimum .times value across all tracks in the trimmed clip\n\n\t\t\tlet minStartTime = Infinity;\n\n\t\t\tfor (let i = 0; i < clip.tracks.length; ++i) {\n\t\t\t\tif (minStartTime > clip.tracks[i].times[0]) {\n\t\t\t\t\tminStartTime = clip.tracks[i].times[0];\n\t\t\t\t}\n\t\t\t} // shift all tracks such that clip begins at t=0\n\n\n\t\t\tfor (let i = 0; i < clip.tracks.length; ++i) {\n\t\t\t\tclip.tracks[i].shift(-1 * minStartTime);\n\t\t\t}\n\n\t\t\tclip.resetDuration();\n\t\t\treturn clip;\n\t\t},\n\t\tmakeClipAdditive: function (targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30) {\n\t\t\tif (fps <= 0) fps = 30;\n\t\t\tconst numTracks = referenceClip.tracks.length;\n\t\t\tconst referenceTime = referenceFrame / fps; // Make each track's values relative to the values at the reference frame\n\n\t\t\tfor (let i = 0; i < numTracks; ++i) {\n\t\t\t\tconst referenceTrack = referenceClip.tracks[i];\n\t\t\t\tconst referenceTrackType = referenceTrack.ValueTypeName; // Skip this track if it's non-numeric\n\n\t\t\t\tif (referenceTrackType === 'bool' || referenceTrackType === 'string') continue; // Find the track in the target clip whose name and type matches the reference track\n\n\t\t\t\tconst targetTrack = targetClip.tracks.find(function (track) {\n\t\t\t\t\treturn track.name === referenceTrack.name && track.ValueTypeName === referenceTrackType;\n\t\t\t\t});\n\t\t\t\tif (targetTrack === undefined) continue;\n\t\t\t\tlet referenceOffset = 0;\n\t\t\t\tconst referenceValueSize = referenceTrack.getValueSize();\n\n\t\t\t\tif (referenceTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) {\n\t\t\t\t\treferenceOffset = referenceValueSize / 3;\n\t\t\t\t}\n\n\t\t\t\tlet targetOffset = 0;\n\t\t\t\tconst targetValueSize = targetTrack.getValueSize();\n\n\t\t\t\tif (targetTrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline) {\n\t\t\t\t\ttargetOffset = targetValueSize / 3;\n\t\t\t\t}\n\n\t\t\t\tconst lastIndex = referenceTrack.times.length - 1;\n\t\t\t\tlet referenceValue; // Find the value to subtract out of the track\n\n\t\t\t\tif (referenceTime <= referenceTrack.times[0]) {\n\t\t\t\t\t// Reference frame is earlier than the first keyframe, so just use the first keyframe\n\t\t\t\t\tconst startIndex = referenceOffset;\n\t\t\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\t\t\treferenceValue = AnimationUtils.arraySlice(referenceTrack.values, startIndex, endIndex);\n\t\t\t\t} else if (referenceTime >= referenceTrack.times[lastIndex]) {\n\t\t\t\t\t// Reference frame is after the last keyframe, so just use the last keyframe\n\t\t\t\t\tconst startIndex = lastIndex * referenceValueSize + referenceOffset;\n\t\t\t\t\tconst endIndex = startIndex + referenceValueSize - referenceOffset;\n\t\t\t\t\treferenceValue = AnimationUtils.arraySlice(referenceTrack.values, startIndex, endIndex);\n\t\t\t\t} else {\n\t\t\t\t\t// Interpolate to the reference value\n\t\t\t\t\tconst interpolant = referenceTrack.createInterpolant();\n\t\t\t\t\tconst startIndex = referenceOffset;\n\t\t\t\t\tconst endIndex = referenceValueSize - referenceOffset;\n\t\t\t\t\tinterpolant.evaluate(referenceTime);\n\t\t\t\t\treferenceValue = AnimationUtils.arraySlice(interpolant.resultBuffer, startIndex, endIndex);\n\t\t\t\t} // Conjugate the quaternion\n\n\n\t\t\t\tif (referenceTrackType === 'quaternion') {\n\t\t\t\t\tconst referenceQuat = new Quaternion().fromArray(referenceValue).normalize().conjugate();\n\t\t\t\t\treferenceQuat.toArray(referenceValue);\n\t\t\t\t} // Subtract the reference value from all of the track values\n\n\n\t\t\t\tconst numTimes = targetTrack.times.length;\n\n\t\t\t\tfor (let j = 0; j < numTimes; ++j) {\n\t\t\t\t\tconst valueStart = j * targetValueSize + targetOffset;\n\n\t\t\t\t\tif (referenceTrackType === 'quaternion') {\n\t\t\t\t\t\t// Multiply the conjugate for quaternion track types\n\t\t\t\t\t\tQuaternion.multiplyQuaternionsFlat(targetTrack.values, valueStart, referenceValue, 0, targetTrack.values, valueStart);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst valueEnd = targetValueSize - targetOffset * 2; // Subtract each value for all other numeric track types\n\n\t\t\t\t\t\tfor (let k = 0; k < valueEnd; ++k) {\n\t\t\t\t\t\t\ttargetTrack.values[valueStart + k] -= referenceValue[k];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ttargetClip.blendMode = AdditiveAnimationBlendMode;\n\t\t\treturn targetClip;\n\t\t}\n\t};\n\n\t/**\n\t * Abstract base class of interpolants over parametric samples.\n\t *\n\t * The parameter domain is one dimensional, typically the time or a path\n\t * along a curve defined by the data.\n\t *\n\t * The sample values can have any dimensionality and derived classes may\n\t * apply special interpretations to the data.\n\t *\n\t * This class provides the interval seek in a Template Method, deferring\n\t * the actual interpolation to derived classes.\n\t *\n\t * Time complexity is O(1) for linear access crossing at most two points\n\t * and O(log N) for random access, where N is the number of positions.\n\t *\n\t * References:\n\t *\n\t * \t\thttp://www.oodesign.com/template-method-pattern.html\n\t *\n\t */\n\tclass Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tthis.parameterPositions = parameterPositions;\n\t\t\tthis._cachedIndex = 0;\n\t\t\tthis.resultBuffer = resultBuffer !== undefined ? resultBuffer : new sampleValues.constructor(sampleSize);\n\t\t\tthis.sampleValues = sampleValues;\n\t\t\tthis.valueSize = sampleSize;\n\t\t\tthis.settings = null;\n\t\t\tthis.DefaultSettings_ = {};\n\t\t}\n\n\t\tevaluate(t) {\n\t\t\tconst pp = this.parameterPositions;\n\t\t\tlet i1 = this._cachedIndex,\n\t\t\t\t\tt1 = pp[i1],\n\t\t\t\t\tt0 = pp[i1 - 1];\n\n\t\t\tvalidate_interval: {\n\t\t\t\tseek: {\n\t\t\t\t\tlet right;\n\n\t\t\t\t\tlinear_scan: {\n\t\t\t\t\t\t//- See http://jsperf.com/comparison-to-undefined/3\n\t\t\t\t\t\t//- slower code:\n\t\t\t\t\t\t//-\n\t\t\t\t\t\t//- \t\t\t\tif ( t >= t1 || t1 === undefined ) {\n\t\t\t\t\t\tforward_scan: if (!(t < t1)) {\n\t\t\t\t\t\t\tfor (let giveUpAt = i1 + 2;;) {\n\t\t\t\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\t\t\t\tif (t < t0) break forward_scan; // after end\n\n\t\t\t\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\t\t\t\treturn this.afterEnd_(i1 - 1, t, t0);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\t\tt0 = t1;\n\t\t\t\t\t\t\t\tt1 = pp[++i1];\n\n\t\t\t\t\t\t\t\tif (t < t1) {\n\t\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // prepare binary search on the right side of the index\n\n\n\t\t\t\t\t\t\tright = pp.length;\n\t\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t\t} //- slower code:\n\t\t\t\t\t\t//-\t\t\t\t\tif ( t < t0 || t0 === undefined ) {\n\n\n\t\t\t\t\t\tif (!(t >= t0)) {\n\t\t\t\t\t\t\t// looping?\n\t\t\t\t\t\t\tconst t1global = pp[1];\n\n\t\t\t\t\t\t\tif (t < t1global) {\n\t\t\t\t\t\t\t\ti1 = 2; // + 1, using the scan for the details\n\n\t\t\t\t\t\t\t\tt0 = t1global;\n\t\t\t\t\t\t\t} // linear reverse scan\n\n\n\t\t\t\t\t\t\tfor (let giveUpAt = i1 - 2;;) {\n\t\t\t\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\t\t\t\t// before start\n\t\t\t\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\t\t\t\treturn this.beforeStart_(0, t, t1);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tif (i1 === giveUpAt) break; // this loop\n\n\t\t\t\t\t\t\t\tt1 = t0;\n\t\t\t\t\t\t\t\tt0 = pp[--i1 - 1];\n\n\t\t\t\t\t\t\t\tif (t >= t0) {\n\t\t\t\t\t\t\t\t\t// we have arrived at the sought interval\n\t\t\t\t\t\t\t\t\tbreak seek;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} // prepare binary search on the left side of the index\n\n\n\t\t\t\t\t\t\tright = i1;\n\t\t\t\t\t\t\ti1 = 0;\n\t\t\t\t\t\t\tbreak linear_scan;\n\t\t\t\t\t\t} // the interval is valid\n\n\n\t\t\t\t\t\tbreak validate_interval;\n\t\t\t\t\t} // linear scan\n\t\t\t\t\t// binary search\n\n\n\t\t\t\t\twhile (i1 < right) {\n\t\t\t\t\t\tconst mid = i1 + right >>> 1;\n\n\t\t\t\t\t\tif (t < pp[mid]) {\n\t\t\t\t\t\t\tright = mid;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ti1 = mid + 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tt1 = pp[i1];\n\t\t\t\t\tt0 = pp[i1 - 1]; // check boundary cases, again\n\n\t\t\t\t\tif (t0 === undefined) {\n\t\t\t\t\t\tthis._cachedIndex = 0;\n\t\t\t\t\t\treturn this.beforeStart_(0, t, t1);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (t1 === undefined) {\n\t\t\t\t\t\ti1 = pp.length;\n\t\t\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\t\t\treturn this.afterEnd_(i1 - 1, t0, t);\n\t\t\t\t\t}\n\t\t\t\t} // seek\n\n\n\t\t\t\tthis._cachedIndex = i1;\n\t\t\t\tthis.intervalChanged_(i1, t0, t1);\n\t\t\t} // validate_interval\n\n\n\t\t\treturn this.interpolate_(i1, t0, t, t1);\n\t\t}\n\n\t\tgetSettings_() {\n\t\t\treturn this.settings || this.DefaultSettings_;\n\t\t}\n\n\t\tcopySampleValue_(index) {\n\t\t\t// copies a sample value to the result buffer\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset = index * stride;\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tresult[i] = values[offset + i];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t} // Template methods for derived classes:\n\n\n\t\tinterpolate_() {\n\t\t\tthrow new Error('call to abstract method'); // implementations shall return this.resultBuffer\n\t\t}\n\n\t\tintervalChanged_() {// empty\n\t\t}\n\n\t} // ALIAS DEFINITIONS\n\n\n\tInterpolant.prototype.beforeStart_ = Interpolant.prototype.copySampleValue_;\n\tInterpolant.prototype.afterEnd_ = Interpolant.prototype.copySampleValue_;\n\n\t/**\n\t * Fast and simple cubic spline interpolant.\n\t *\n\t * It was derived from a Hermitian construction setting the first derivative\n\t * at each sample position to the linear slope between neighboring positions\n\t * over their parameter interval.\n\t */\n\n\tclass CubicInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t\tthis._weightPrev = -0;\n\t\t\tthis._offsetPrev = -0;\n\t\t\tthis._weightNext = -0;\n\t\t\tthis._offsetNext = -0;\n\t\t\tthis.DefaultSettings_ = {\n\t\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t\t};\n\t\t}\n\n\t\tintervalChanged_(i1, t0, t1) {\n\t\t\tconst pp = this.parameterPositions;\n\t\t\tlet iPrev = i1 - 2,\n\t\t\t\t\tiNext = i1 + 1,\n\t\t\t\t\ttPrev = pp[iPrev],\n\t\t\t\t\ttNext = pp[iNext];\n\n\t\t\tif (tPrev === undefined) {\n\t\t\t\tswitch (this.getSettings_().endingStart) {\n\t\t\t\t\tcase ZeroSlopeEnding:\n\t\t\t\t\t\t// f'(t0) = 0\n\t\t\t\t\t\tiPrev = i1;\n\t\t\t\t\t\ttPrev = 2 * t0 - t1;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase WrapAroundEnding:\n\t\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\t\tiPrev = pp.length - 2;\n\t\t\t\t\t\ttPrev = t0 + pp[iPrev] - pp[iPrev + 1];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// ZeroCurvatureEnding\n\t\t\t\t\t\t// f''(t0) = 0 a.k.a. Natural Spline\n\t\t\t\t\t\tiPrev = i1;\n\t\t\t\t\t\ttPrev = t1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tNext === undefined) {\n\t\t\t\tswitch (this.getSettings_().endingEnd) {\n\t\t\t\t\tcase ZeroSlopeEnding:\n\t\t\t\t\t\t// f'(tN) = 0\n\t\t\t\t\t\tiNext = i1;\n\t\t\t\t\t\ttNext = 2 * t1 - t0;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase WrapAroundEnding:\n\t\t\t\t\t\t// use the other end of the curve\n\t\t\t\t\t\tiNext = 1;\n\t\t\t\t\t\ttNext = t1 + pp[1] - pp[0];\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t// ZeroCurvatureEnding\n\t\t\t\t\t\t// f''(tN) = 0, a.k.a. Natural Spline\n\t\t\t\t\t\tiNext = i1 - 1;\n\t\t\t\t\t\ttNext = t0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst halfDt = (t1 - t0) * 0.5,\n\t\t\t\t\t\tstride = this.valueSize;\n\t\t\tthis._weightPrev = halfDt / (t0 - tPrev);\n\t\t\tthis._weightNext = halfDt / (tNext - t1);\n\t\t\tthis._offsetPrev = iPrev * stride;\n\t\t\tthis._offsetNext = iNext * stride;\n\t\t}\n\n\t\tinterpolate_(i1, t0, t, t1) {\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\to1 = i1 * stride,\n\t\t\t\t\t\to0 = o1 - stride,\n\t\t\t\t\t\toP = this._offsetPrev,\n\t\t\t\t\t\toN = this._offsetNext,\n\t\t\t\t\t\twP = this._weightPrev,\n\t\t\t\t\t\twN = this._weightNext,\n\t\t\t\t\t\tp = (t - t0) / (t1 - t0),\n\t\t\t\t\t\tpp = p * p,\n\t\t\t\t\t\tppp = pp * p; // evaluate polynomials\n\n\t\t\tconst sP = -wP * ppp + 2 * wP * pp - wP * p;\n\t\t\tconst s0 = (1 + wP) * ppp + (-1.5 - 2 * wP) * pp + (-0.5 + wP) * p + 1;\n\t\t\tconst s1 = (-1 - wN) * ppp + (1.5 + wN) * pp + 0.5 * p;\n\t\t\tconst sN = wN * ppp - wN * pp; // combine data linearly\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tresult[i] = sP * values[oP + i] + s0 * values[o0 + i] + s1 * values[o1 + i] + sN * values[oN + i];\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n\n\tclass LinearInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t}\n\n\t\tinterpolate_(i1, t0, t, t1) {\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset1 = i1 * stride,\n\t\t\t\t\t\toffset0 = offset1 - stride,\n\t\t\t\t\t\tweight1 = (t - t0) / (t1 - t0),\n\t\t\t\t\t\tweight0 = 1 - weight1;\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tresult[i] = values[offset0 + i] * weight0 + values[offset1 + i] * weight1;\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n\n\t/**\n\t *\n\t * Interpolant that evaluates to the sample value at the position preceeding\n\t * the parameter.\n\t */\n\n\tclass DiscreteInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t}\n\n\t\tinterpolate_(i1\n\t\t/*, t0, t, t1 */\n\t\t) {\n\t\t\treturn this.copySampleValue_(i1 - 1);\n\t\t}\n\n\t}\n\n\tclass KeyframeTrack {\n\t\tconstructor(name, times, values, interpolation) {\n\t\t\tif (name === undefined) throw new Error('THREE.KeyframeTrack: track name is undefined');\n\t\t\tif (times === undefined || times.length === 0) throw new Error('THREE.KeyframeTrack: no keyframes in track named ' + name);\n\t\t\tthis.name = name;\n\t\t\tthis.times = AnimationUtils.convertArray(times, this.TimeBufferType);\n\t\t\tthis.values = AnimationUtils.convertArray(values, this.ValueBufferType);\n\t\t\tthis.setInterpolation(interpolation || this.DefaultInterpolation);\n\t\t} // Serialization (in static context, because of constructor invocation\n\t\t// and automatic invocation of .toJSON):\n\n\n\t\tstatic toJSON(track) {\n\t\t\tconst trackType = track.constructor;\n\t\t\tlet json; // derived classes can define a static toJSON method\n\n\t\t\tif (trackType.toJSON !== this.toJSON) {\n\t\t\t\tjson = trackType.toJSON(track);\n\t\t\t} else {\n\t\t\t\t// by default, we assume the data can be serialized as-is\n\t\t\t\tjson = {\n\t\t\t\t\t'name': track.name,\n\t\t\t\t\t'times': AnimationUtils.convertArray(track.times, Array),\n\t\t\t\t\t'values': AnimationUtils.convertArray(track.values, Array)\n\t\t\t\t};\n\t\t\t\tconst interpolation = track.getInterpolation();\n\n\t\t\t\tif (interpolation !== track.DefaultInterpolation) {\n\t\t\t\t\tjson.interpolation = interpolation;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tjson.type = track.ValueTypeName; // mandatory\n\n\t\t\treturn json;\n\t\t}\n\n\t\tInterpolantFactoryMethodDiscrete(result) {\n\t\t\treturn new DiscreteInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t\tInterpolantFactoryMethodLinear(result) {\n\t\t\treturn new LinearInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t\tInterpolantFactoryMethodSmooth(result) {\n\t\t\treturn new CubicInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t\tsetInterpolation(interpolation) {\n\t\t\tlet factoryMethod;\n\n\t\t\tswitch (interpolation) {\n\t\t\t\tcase InterpolateDiscrete:\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodDiscrete;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase InterpolateLinear:\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodLinear;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase InterpolateSmooth:\n\t\t\t\t\tfactoryMethod = this.InterpolantFactoryMethodSmooth;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (factoryMethod === undefined) {\n\t\t\t\tconst message = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name;\n\n\t\t\t\tif (this.createInterpolant === undefined) {\n\t\t\t\t\t// fall back to default, unless the default itself is messed up\n\t\t\t\t\tif (interpolation !== this.DefaultInterpolation) {\n\t\t\t\t\t\tthis.setInterpolation(this.DefaultInterpolation);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(message); // fatal, in this case\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconsole.warn('THREE.KeyframeTrack:', message);\n\t\t\t\treturn this;\n\t\t\t}\n\n\t\t\tthis.createInterpolant = factoryMethod;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetInterpolation() {\n\t\t\tswitch (this.createInterpolant) {\n\t\t\t\tcase this.InterpolantFactoryMethodDiscrete:\n\t\t\t\t\treturn InterpolateDiscrete;\n\n\t\t\t\tcase this.InterpolantFactoryMethodLinear:\n\t\t\t\t\treturn InterpolateLinear;\n\n\t\t\t\tcase this.InterpolantFactoryMethodSmooth:\n\t\t\t\t\treturn InterpolateSmooth;\n\t\t\t}\n\t\t}\n\n\t\tgetValueSize() {\n\t\t\treturn this.values.length / this.times.length;\n\t\t} // move all keyframes either forwards or backwards in time\n\n\n\t\tshift(timeOffset) {\n\t\t\tif (timeOffset !== 0.0) {\n\t\t\t\tconst times = this.times;\n\n\t\t\t\tfor (let i = 0, n = times.length; i !== n; ++i) {\n\t\t\t\t\ttimes[i] += timeOffset;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // scale all keyframe times by a factor (useful for frame <-> seconds conversions)\n\n\n\t\tscale(timeScale) {\n\t\t\tif (timeScale !== 1.0) {\n\t\t\t\tconst times = this.times;\n\n\t\t\t\tfor (let i = 0, n = times.length; i !== n; ++i) {\n\t\t\t\t\ttimes[i] *= timeScale;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // removes keyframes before and after animation without changing any values within the range [startTime, endTime].\n\t\t// IMPORTANT: We do not shift around keys to the start of the track time, because for interpolated keys this will change their values\n\n\n\t\ttrim(startTime, endTime) {\n\t\t\tconst times = this.times,\n\t\t\t\t\t\tnKeys = times.length;\n\t\t\tlet from = 0,\n\t\t\t\t\tto = nKeys - 1;\n\n\t\t\twhile (from !== nKeys && times[from] < startTime) {\n\t\t\t\t++from;\n\t\t\t}\n\n\t\t\twhile (to !== -1 && times[to] > endTime) {\n\t\t\t\t--to;\n\t\t\t}\n\n\t\t\t++to; // inclusive -> exclusive bound\n\n\t\t\tif (from !== 0 || to !== nKeys) {\n\t\t\t\t// empty tracks are forbidden, so keep at least one keyframe\n\t\t\t\tif (from >= to) {\n\t\t\t\t\tto = Math.max(to, 1);\n\t\t\t\t\tfrom = to - 1;\n\t\t\t\t}\n\n\t\t\t\tconst stride = this.getValueSize();\n\t\t\t\tthis.times = AnimationUtils.arraySlice(times, from, to);\n\t\t\t\tthis.values = AnimationUtils.arraySlice(this.values, from * stride, to * stride);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // ensure we do not get a GarbageInGarbageOut situation, make sure tracks are at least minimally viable\n\n\n\t\tvalidate() {\n\t\t\tlet valid = true;\n\t\t\tconst valueSize = this.getValueSize();\n\n\t\t\tif (valueSize - Math.floor(valueSize) !== 0) {\n\t\t\t\tconsole.error('THREE.KeyframeTrack: Invalid value size in track.', this);\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\tconst times = this.times,\n\t\t\t\t\t\tvalues = this.values,\n\t\t\t\t\t\tnKeys = times.length;\n\n\t\t\tif (nKeys === 0) {\n\t\t\t\tconsole.error('THREE.KeyframeTrack: Track is empty.', this);\n\t\t\t\tvalid = false;\n\t\t\t}\n\n\t\t\tlet prevTime = null;\n\n\t\t\tfor (let i = 0; i !== nKeys; i++) {\n\t\t\t\tconst currTime = times[i];\n\n\t\t\t\tif (typeof currTime === 'number' && isNaN(currTime)) {\n\t\t\t\t\tconsole.error('THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime);\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (prevTime !== null && prevTime > currTime) {\n\t\t\t\t\tconsole.error('THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime);\n\t\t\t\t\tvalid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tprevTime = currTime;\n\t\t\t}\n\n\t\t\tif (values !== undefined) {\n\t\t\t\tif (AnimationUtils.isTypedArray(values)) {\n\t\t\t\t\tfor (let i = 0, n = values.length; i !== n; ++i) {\n\t\t\t\t\t\tconst value = values[i];\n\n\t\t\t\t\t\tif (isNaN(value)) {\n\t\t\t\t\t\t\tconsole.error('THREE.KeyframeTrack: Value is not a valid number.', this, i, value);\n\t\t\t\t\t\t\tvalid = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t} // removes equivalent sequential keys as common in morph target sequences\n\t\t// (0,0,0,0,1,1,1,0,0,0,0,0,0,0) --> (0,0,1,1,0,0)\n\n\n\t\toptimize() {\n\t\t\t// times or values may be shared with other tracks, so overwriting is unsafe\n\t\t\tconst times = AnimationUtils.arraySlice(this.times),\n\t\t\t\t\t\tvalues = AnimationUtils.arraySlice(this.values),\n\t\t\t\t\t\tstride = this.getValueSize(),\n\t\t\t\t\t\tsmoothInterpolation = this.getInterpolation() === InterpolateSmooth,\n\t\t\t\t\t\tlastIndex = times.length - 1;\n\t\t\tlet writeIndex = 1;\n\n\t\t\tfor (let i = 1; i < lastIndex; ++i) {\n\t\t\t\tlet keep = false;\n\t\t\t\tconst time = times[i];\n\t\t\t\tconst timeNext = times[i + 1]; // remove adjacent keyframes scheduled at the same time\n\n\t\t\t\tif (time !== timeNext && (i !== 1 || time !== times[0])) {\n\t\t\t\t\tif (!smoothInterpolation) {\n\t\t\t\t\t\t// remove unnecessary keyframes same as their neighbors\n\t\t\t\t\t\tconst offset = i * stride,\n\t\t\t\t\t\t\t\t\toffsetP = offset - stride,\n\t\t\t\t\t\t\t\t\toffsetN = offset + stride;\n\n\t\t\t\t\t\tfor (let j = 0; j !== stride; ++j) {\n\t\t\t\t\t\t\tconst value = values[offset + j];\n\n\t\t\t\t\t\t\tif (value !== values[offsetP + j] || value !== values[offsetN + j]) {\n\t\t\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tkeep = true;\n\t\t\t\t\t}\n\t\t\t\t} // in-place compaction\n\n\n\t\t\t\tif (keep) {\n\t\t\t\t\tif (i !== writeIndex) {\n\t\t\t\t\t\ttimes[writeIndex] = times[i];\n\t\t\t\t\t\tconst readOffset = i * stride,\n\t\t\t\t\t\t\t\t\twriteOffset = writeIndex * stride;\n\n\t\t\t\t\t\tfor (let j = 0; j !== stride; ++j) {\n\t\t\t\t\t\t\tvalues[writeOffset + j] = values[readOffset + j];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t++writeIndex;\n\t\t\t\t}\n\t\t\t} // flush last keyframe (compaction looks ahead)\n\n\n\t\t\tif (lastIndex > 0) {\n\t\t\t\ttimes[writeIndex] = times[lastIndex];\n\n\t\t\t\tfor (let readOffset = lastIndex * stride, writeOffset = writeIndex * stride, j = 0; j !== stride; ++j) {\n\t\t\t\t\tvalues[writeOffset + j] = values[readOffset + j];\n\t\t\t\t}\n\n\t\t\t\t++writeIndex;\n\t\t\t}\n\n\t\t\tif (writeIndex !== times.length) {\n\t\t\t\tthis.times = AnimationUtils.arraySlice(times, 0, writeIndex);\n\t\t\t\tthis.values = AnimationUtils.arraySlice(values, 0, writeIndex * stride);\n\t\t\t} else {\n\t\t\t\tthis.times = times;\n\t\t\t\tthis.values = values;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\tconst times = AnimationUtils.arraySlice(this.times, 0);\n\t\t\tconst values = AnimationUtils.arraySlice(this.values, 0);\n\t\t\tconst TypedKeyframeTrack = this.constructor;\n\t\t\tconst track = new TypedKeyframeTrack(this.name, times, values); // Interpolant argument to constructor is not saved, so copy the factory method directly.\n\n\t\t\ttrack.createInterpolant = this.createInterpolant;\n\t\t\treturn track;\n\t\t}\n\n\t}\n\n\tKeyframeTrack.prototype.TimeBufferType = Float32Array;\n\tKeyframeTrack.prototype.ValueBufferType = Float32Array;\n\tKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\n\t/**\n\t * A Track of Boolean keyframe values.\n\t */\n\n\tclass BooleanKeyframeTrack extends KeyframeTrack {}\n\n\tBooleanKeyframeTrack.prototype.ValueTypeName = 'bool';\n\tBooleanKeyframeTrack.prototype.ValueBufferType = Array;\n\tBooleanKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\n\tBooleanKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\n\tBooleanKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined; // Note: Actually this track could have a optimized / compressed\n\n\t/**\n\t * A Track of keyframe values that represent color.\n\t */\n\n\tclass ColorKeyframeTrack extends KeyframeTrack {}\n\n\tColorKeyframeTrack.prototype.ValueTypeName = 'color'; // ValueBufferType is inherited\n\n\t/**\n\t * A Track of numeric keyframe values.\n\t */\n\n\tclass NumberKeyframeTrack extends KeyframeTrack {}\n\n\tNumberKeyframeTrack.prototype.ValueTypeName = 'number'; // ValueBufferType is inherited\n\n\t/**\n\t * Spherical linear unit quaternion interpolant.\n\t */\n\n\tclass QuaternionLinearInterpolant extends Interpolant {\n\t\tconstructor(parameterPositions, sampleValues, sampleSize, resultBuffer) {\n\t\t\tsuper(parameterPositions, sampleValues, sampleSize, resultBuffer);\n\t\t}\n\n\t\tinterpolate_(i1, t0, t, t1) {\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\t\t\tvalues = this.sampleValues,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\talpha = (t - t0) / (t1 - t0);\n\t\t\tlet offset = i1 * stride;\n\n\t\t\tfor (let end = offset + stride; offset !== end; offset += 4) {\n\t\t\t\tQuaternion.slerpFlat(result, 0, values, offset - stride, values, offset, alpha);\n\t\t\t}\n\n\t\t\treturn result;\n\t\t}\n\n\t}\n\n\t/**\n\t * A Track of quaternion keyframe values.\n\t */\n\n\tclass QuaternionKeyframeTrack extends KeyframeTrack {\n\t\tInterpolantFactoryMethodLinear(result) {\n\t\t\treturn new QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), result);\n\t\t}\n\n\t}\n\n\tQuaternionKeyframeTrack.prototype.ValueTypeName = 'quaternion'; // ValueBufferType is inherited\n\n\tQuaternionKeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;\n\tQuaternionKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n\t/**\n\t * A Track that interpolates Strings\n\t */\n\n\tclass StringKeyframeTrack extends KeyframeTrack {}\n\n\tStringKeyframeTrack.prototype.ValueTypeName = 'string';\n\tStringKeyframeTrack.prototype.ValueBufferType = Array;\n\tStringKeyframeTrack.prototype.DefaultInterpolation = InterpolateDiscrete;\n\tStringKeyframeTrack.prototype.InterpolantFactoryMethodLinear = undefined;\n\tStringKeyframeTrack.prototype.InterpolantFactoryMethodSmooth = undefined;\n\n\t/**\n\t * A Track of vectored keyframe values.\n\t */\n\n\tclass VectorKeyframeTrack extends KeyframeTrack {}\n\n\tVectorKeyframeTrack.prototype.ValueTypeName = 'vector'; // ValueBufferType is inherited\n\n\tclass AnimationClip {\n\t\tconstructor(name, duration = -1, tracks, blendMode = NormalAnimationBlendMode) {\n\t\t\tthis.name = name;\n\t\t\tthis.tracks = tracks;\n\t\t\tthis.duration = duration;\n\t\t\tthis.blendMode = blendMode;\n\t\t\tthis.uuid = generateUUID(); // this means it should figure out its duration by scanning the tracks\n\n\t\t\tif (this.duration < 0) {\n\t\t\t\tthis.resetDuration();\n\t\t\t}\n\t\t}\n\n\t\tstatic parse(json) {\n\t\t\tconst tracks = [],\n\t\t\t\t\t\tjsonTracks = json.tracks,\n\t\t\t\t\t\tframeTime = 1.0 / (json.fps || 1.0);\n\n\t\t\tfor (let i = 0, n = jsonTracks.length; i !== n; ++i) {\n\t\t\t\ttracks.push(parseKeyframeTrack(jsonTracks[i]).scale(frameTime));\n\t\t\t}\n\n\t\t\tconst clip = new this(json.name, json.duration, tracks, json.blendMode);\n\t\t\tclip.uuid = json.uuid;\n\t\t\treturn clip;\n\t\t}\n\n\t\tstatic toJSON(clip) {\n\t\t\tconst tracks = [],\n\t\t\t\t\t\tclipTracks = clip.tracks;\n\t\t\tconst json = {\n\t\t\t\t'name': clip.name,\n\t\t\t\t'duration': clip.duration,\n\t\t\t\t'tracks': tracks,\n\t\t\t\t'uuid': clip.uuid,\n\t\t\t\t'blendMode': clip.blendMode\n\t\t\t};\n\n\t\t\tfor (let i = 0, n = clipTracks.length; i !== n; ++i) {\n\t\t\t\ttracks.push(KeyframeTrack.toJSON(clipTracks[i]));\n\t\t\t}\n\n\t\t\treturn json;\n\t\t}\n\n\t\tstatic CreateFromMorphTargetSequence(name, morphTargetSequence, fps, noLoop) {\n\t\t\tconst numMorphTargets = morphTargetSequence.length;\n\t\t\tconst tracks = [];\n\n\t\t\tfor (let i = 0; i < numMorphTargets; i++) {\n\t\t\t\tlet times = [];\n\t\t\t\tlet values = [];\n\t\t\t\ttimes.push((i + numMorphTargets - 1) % numMorphTargets, i, (i + 1) % numMorphTargets);\n\t\t\t\tvalues.push(0, 1, 0);\n\t\t\t\tconst order = AnimationUtils.getKeyframeOrder(times);\n\t\t\t\ttimes = AnimationUtils.sortedArray(times, 1, order);\n\t\t\t\tvalues = AnimationUtils.sortedArray(values, 1, order); // if there is a key at the first frame, duplicate it as the\n\t\t\t\t// last frame as well for perfect loop.\n\n\t\t\t\tif (!noLoop && times[0] === 0) {\n\t\t\t\t\ttimes.push(numMorphTargets);\n\t\t\t\t\tvalues.push(values[0]);\n\t\t\t\t}\n\n\t\t\t\ttracks.push(new NumberKeyframeTrack('.morphTargetInfluences[' + morphTargetSequence[i].name + ']', times, values).scale(1.0 / fps));\n\t\t\t}\n\n\t\t\treturn new this(name, -1, tracks);\n\t\t}\n\n\t\tstatic findByName(objectOrClipArray, name) {\n\t\t\tlet clipArray = objectOrClipArray;\n\n\t\t\tif (!Array.isArray(objectOrClipArray)) {\n\t\t\t\tconst o = objectOrClipArray;\n\t\t\t\tclipArray = o.geometry && o.geometry.animations || o.animations;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < clipArray.length; i++) {\n\t\t\t\tif (clipArray[i].name === name) {\n\t\t\t\t\treturn clipArray[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t}\n\n\t\tstatic CreateClipsFromMorphTargetSequences(morphTargets, fps, noLoop) {\n\t\t\tconst animationToMorphTargets = {}; // tested with https://regex101.com/ on trick sequences\n\t\t\t// such flamingo_flyA_003, flamingo_run1_003, crdeath0059\n\n\t\t\tconst pattern = /^([\\w-]*?)([\\d]+)$/; // sort morph target names into animation groups based\n\t\t\t// patterns like Walk_001, Walk_002, Run_001, Run_002\n\n\t\t\tfor (let i = 0, il = morphTargets.length; i < il; i++) {\n\t\t\t\tconst morphTarget = morphTargets[i];\n\t\t\t\tconst parts = morphTarget.name.match(pattern);\n\n\t\t\t\tif (parts && parts.length > 1) {\n\t\t\t\t\tconst name = parts[1];\n\t\t\t\t\tlet animationMorphTargets = animationToMorphTargets[name];\n\n\t\t\t\t\tif (!animationMorphTargets) {\n\t\t\t\t\t\tanimationToMorphTargets[name] = animationMorphTargets = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tanimationMorphTargets.push(morphTarget);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst clips = [];\n\n\t\t\tfor (const name in animationToMorphTargets) {\n\t\t\t\tclips.push(this.CreateFromMorphTargetSequence(name, animationToMorphTargets[name], fps, noLoop));\n\t\t\t}\n\n\t\t\treturn clips;\n\t\t} // parse the animation.hierarchy format\n\n\n\t\tstatic parseAnimation(animation, bones) {\n\t\t\tif (!animation) {\n\t\t\t\tconsole.error('THREE.AnimationClip: No animation in JSONLoader data.');\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst addNonemptyTrack = function (trackType, trackName, animationKeys, propertyName, destTracks) {\n\t\t\t\t// only return track if there are actually keys.\n\t\t\t\tif (animationKeys.length !== 0) {\n\t\t\t\t\tconst times = [];\n\t\t\t\t\tconst values = [];\n\t\t\t\t\tAnimationUtils.flattenJSON(animationKeys, times, values, propertyName); // empty keys are filtered out, so check again\n\n\t\t\t\t\tif (times.length !== 0) {\n\t\t\t\t\t\tdestTracks.push(new trackType(trackName, times, values));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst tracks = [];\n\t\t\tconst clipName = animation.name || 'default';\n\t\t\tconst fps = animation.fps || 30;\n\t\t\tconst blendMode = animation.blendMode; // automatic length determination in AnimationClip.\n\n\t\t\tlet duration = animation.length || -1;\n\t\t\tconst hierarchyTracks = animation.hierarchy || [];\n\n\t\t\tfor (let h = 0; h < hierarchyTracks.length; h++) {\n\t\t\t\tconst animationKeys = hierarchyTracks[h].keys; // skip empty tracks\n\n\t\t\t\tif (!animationKeys || animationKeys.length === 0) continue; // process morph targets\n\n\t\t\t\tif (animationKeys[0].morphTargets) {\n\t\t\t\t\t// figure out all morph targets used in this track\n\t\t\t\t\tconst morphTargetNames = {};\n\t\t\t\t\tlet k;\n\n\t\t\t\t\tfor (k = 0; k < animationKeys.length; k++) {\n\t\t\t\t\t\tif (animationKeys[k].morphTargets) {\n\t\t\t\t\t\t\tfor (let m = 0; m < animationKeys[k].morphTargets.length; m++) {\n\t\t\t\t\t\t\t\tmorphTargetNames[animationKeys[k].morphTargets[m]] = -1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} // create a track for each morph target with all zero\n\t\t\t\t\t// morphTargetInfluences except for the keys in which\n\t\t\t\t\t// the morphTarget is named.\n\n\n\t\t\t\t\tfor (const morphTargetName in morphTargetNames) {\n\t\t\t\t\t\tconst times = [];\n\t\t\t\t\t\tconst values = [];\n\n\t\t\t\t\t\tfor (let m = 0; m !== animationKeys[k].morphTargets.length; ++m) {\n\t\t\t\t\t\t\tconst animationKey = animationKeys[k];\n\t\t\t\t\t\t\ttimes.push(animationKey.time);\n\t\t\t\t\t\t\tvalues.push(animationKey.morphTarget === morphTargetName ? 1 : 0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttracks.push(new NumberKeyframeTrack('.morphTargetInfluence[' + morphTargetName + ']', times, values));\n\t\t\t\t\t}\n\n\t\t\t\t\tduration = morphTargetNames.length * (fps || 1.0);\n\t\t\t\t} else {\n\t\t\t\t\t// ...assume skeletal animation\n\t\t\t\t\tconst boneName = '.bones[' + bones[h].name + ']';\n\t\t\t\t\taddNonemptyTrack(VectorKeyframeTrack, boneName + '.position', animationKeys, 'pos', tracks);\n\t\t\t\t\taddNonemptyTrack(QuaternionKeyframeTrack, boneName + '.quaternion', animationKeys, 'rot', tracks);\n\t\t\t\t\taddNonemptyTrack(VectorKeyframeTrack, boneName + '.scale', animationKeys, 'scl', tracks);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (tracks.length === 0) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\tconst clip = new this(clipName, duration, tracks, blendMode);\n\t\t\treturn clip;\n\t\t}\n\n\t\tresetDuration() {\n\t\t\tconst tracks = this.tracks;\n\t\t\tlet duration = 0;\n\n\t\t\tfor (let i = 0, n = tracks.length; i !== n; ++i) {\n\t\t\t\tconst track = this.tracks[i];\n\t\t\t\tduration = Math.max(duration, track.times[track.times.length - 1]);\n\t\t\t}\n\n\t\t\tthis.duration = duration;\n\t\t\treturn this;\n\t\t}\n\n\t\ttrim() {\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\tthis.tracks[i].trim(0, this.duration);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tvalidate() {\n\t\t\tlet valid = true;\n\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\tvalid = valid && this.tracks[i].validate();\n\t\t\t}\n\n\t\t\treturn valid;\n\t\t}\n\n\t\toptimize() {\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\tthis.tracks[i].optimize();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\tconst tracks = [];\n\n\t\t\tfor (let i = 0; i < this.tracks.length; i++) {\n\t\t\t\ttracks.push(this.tracks[i].clone());\n\t\t\t}\n\n\t\t\treturn new this.constructor(this.name, this.duration, tracks, this.blendMode);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn this.constructor.toJSON(this);\n\t\t}\n\n\t}\n\n\tfunction getTrackTypeForValueTypeName(typeName) {\n\t\tswitch (typeName.toLowerCase()) {\n\t\t\tcase 'scalar':\n\t\t\tcase 'double':\n\t\t\tcase 'float':\n\t\t\tcase 'number':\n\t\t\tcase 'integer':\n\t\t\t\treturn NumberKeyframeTrack;\n\n\t\t\tcase 'vector':\n\t\t\tcase 'vector2':\n\t\t\tcase 'vector3':\n\t\t\tcase 'vector4':\n\t\t\t\treturn VectorKeyframeTrack;\n\n\t\t\tcase 'color':\n\t\t\t\treturn ColorKeyframeTrack;\n\n\t\t\tcase 'quaternion':\n\t\t\t\treturn QuaternionKeyframeTrack;\n\n\t\t\tcase 'bool':\n\t\t\tcase 'boolean':\n\t\t\t\treturn BooleanKeyframeTrack;\n\n\t\t\tcase 'string':\n\t\t\t\treturn StringKeyframeTrack;\n\t\t}\n\n\t\tthrow new Error('THREE.KeyframeTrack: Unsupported typeName: ' + typeName);\n\t}\n\n\tfunction parseKeyframeTrack(json) {\n\t\tif (json.type === undefined) {\n\t\t\tthrow new Error('THREE.KeyframeTrack: track type undefined, can not parse');\n\t\t}\n\n\t\tconst trackType = getTrackTypeForValueTypeName(json.type);\n\n\t\tif (json.times === undefined) {\n\t\t\tconst times = [],\n\t\t\t\t\t\tvalues = [];\n\t\t\tAnimationUtils.flattenJSON(json.keys, times, values, 'value');\n\t\t\tjson.times = times;\n\t\t\tjson.values = values;\n\t\t} // derived classes can define a static parse method\n\n\n\t\tif (trackType.parse !== undefined) {\n\t\t\treturn trackType.parse(json);\n\t\t} else {\n\t\t\t// by default, we assume a constructor compatible with the base\n\t\t\treturn new trackType(json.name, json.times, json.values, json.interpolation);\n\t\t}\n\t}\n\n\tconst Cache = {\n\t\tenabled: false,\n\t\tfiles: {},\n\t\tadd: function (key, file) {\n\t\t\tif (this.enabled === false) return; // console.log( 'THREE.Cache', 'Adding key:', key );\n\n\t\t\tthis.files[key] = file;\n\t\t},\n\t\tget: function (key) {\n\t\t\tif (this.enabled === false) return; // console.log( 'THREE.Cache', 'Checking key:', key );\n\n\t\t\treturn this.files[key];\n\t\t},\n\t\tremove: function (key) {\n\t\t\tdelete this.files[key];\n\t\t},\n\t\tclear: function () {\n\t\t\tthis.files = {};\n\t\t}\n\t};\n\n\tclass LoadingManager {\n\t\tconstructor(onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tlet isLoading = false;\n\t\t\tlet itemsLoaded = 0;\n\t\t\tlet itemsTotal = 0;\n\t\t\tlet urlModifier = undefined;\n\t\t\tconst handlers = []; // Refer to #5689 for the reason why we don't set .onStart\n\t\t\t// in the constructor\n\n\t\t\tthis.onStart = undefined;\n\t\t\tthis.onLoad = onLoad;\n\t\t\tthis.onProgress = onProgress;\n\t\t\tthis.onError = onError;\n\n\t\t\tthis.itemStart = function (url) {\n\t\t\t\titemsTotal++;\n\n\t\t\t\tif (isLoading === false) {\n\t\t\t\t\tif (scope.onStart !== undefined) {\n\t\t\t\t\t\tscope.onStart(url, itemsLoaded, itemsTotal);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tisLoading = true;\n\t\t\t};\n\n\t\t\tthis.itemEnd = function (url) {\n\t\t\t\titemsLoaded++;\n\n\t\t\t\tif (scope.onProgress !== undefined) {\n\t\t\t\t\tscope.onProgress(url, itemsLoaded, itemsTotal);\n\t\t\t\t}\n\n\t\t\t\tif (itemsLoaded === itemsTotal) {\n\t\t\t\t\tisLoading = false;\n\n\t\t\t\t\tif (scope.onLoad !== undefined) {\n\t\t\t\t\t\tscope.onLoad();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.itemError = function (url) {\n\t\t\t\tif (scope.onError !== undefined) {\n\t\t\t\t\tscope.onError(url);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.resolveURL = function (url) {\n\t\t\t\tif (urlModifier) {\n\t\t\t\t\treturn urlModifier(url);\n\t\t\t\t}\n\n\t\t\t\treturn url;\n\t\t\t};\n\n\t\t\tthis.setURLModifier = function (transform) {\n\t\t\t\turlModifier = transform;\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tthis.addHandler = function (regex, loader) {\n\t\t\t\thandlers.push(regex, loader);\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tthis.removeHandler = function (regex) {\n\t\t\t\tconst index = handlers.indexOf(regex);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\thandlers.splice(index, 2);\n\t\t\t\t}\n\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tthis.getHandler = function (file) {\n\t\t\t\tfor (let i = 0, l = handlers.length; i < l; i += 2) {\n\t\t\t\t\tconst regex = handlers[i];\n\t\t\t\t\tconst loader = handlers[i + 1];\n\t\t\t\t\tif (regex.global) regex.lastIndex = 0; // see #17920\n\n\t\t\t\t\tif (regex.test(file)) {\n\t\t\t\t\t\treturn loader;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn null;\n\t\t\t};\n\t\t}\n\n\t}\n\n\tconst DefaultLoadingManager = new LoadingManager();\n\n\tclass Loader {\n\t\tconstructor(manager) {\n\t\t\tthis.manager = manager !== undefined ? manager : DefaultLoadingManager;\n\t\t\tthis.crossOrigin = 'anonymous';\n\t\t\tthis.withCredentials = false;\n\t\t\tthis.path = '';\n\t\t\tthis.resourcePath = '';\n\t\t\tthis.requestHeader = {};\n\t\t}\n\n\t\tload() {}\n\n\t\tloadAsync(url, onProgress) {\n\t\t\tconst scope = this;\n\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\tscope.load(url, resolve, onProgress, reject);\n\t\t\t});\n\t\t}\n\n\t\tparse() {}\n\n\t\tsetCrossOrigin(crossOrigin) {\n\t\t\tthis.crossOrigin = crossOrigin;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetWithCredentials(value) {\n\t\t\tthis.withCredentials = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetPath(path) {\n\t\t\tthis.path = path;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetResourcePath(resourcePath) {\n\t\t\tthis.resourcePath = resourcePath;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetRequestHeader(requestHeader) {\n\t\t\tthis.requestHeader = requestHeader;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tconst loading = {};\n\n\tclass FileLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tif (url === undefined) url = '';\n\t\t\tif (this.path !== undefined) url = this.path + url;\n\t\t\turl = this.manager.resolveURL(url);\n\t\t\tconst scope = this;\n\t\t\tconst cached = Cache.get(url);\n\n\t\t\tif (cached !== undefined) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tif (onLoad) onLoad(cached);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, 0);\n\t\t\t\treturn cached;\n\t\t\t} // Check if request is duplicate\n\n\n\t\t\tif (loading[url] !== undefined) {\n\t\t\t\tloading[url].push({\n\t\t\t\t\tonLoad: onLoad,\n\t\t\t\t\tonProgress: onProgress,\n\t\t\t\t\tonError: onError\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t} // Check for data: URI\n\n\n\t\t\tconst dataUriRegex = /^data:(.*?)(;base64)?,(.*)$/;\n\t\t\tconst dataUriRegexResult = url.match(dataUriRegex);\n\t\t\tlet request; // Safari can not handle Data URIs through XMLHttpRequest so process manually\n\n\t\t\tif (dataUriRegexResult) {\n\t\t\t\tconst mimeType = dataUriRegexResult[1];\n\t\t\t\tconst isBase64 = !!dataUriRegexResult[2];\n\t\t\t\tlet data = dataUriRegexResult[3];\n\t\t\t\tdata = decodeURIComponent(data);\n\t\t\t\tif (isBase64) data = atob(data);\n\n\t\t\t\ttry {\n\t\t\t\t\tlet response;\n\t\t\t\t\tconst responseType = (this.responseType || '').toLowerCase();\n\n\t\t\t\t\tswitch (responseType) {\n\t\t\t\t\t\tcase 'arraybuffer':\n\t\t\t\t\t\tcase 'blob':\n\t\t\t\t\t\t\tconst view = new Uint8Array(data.length);\n\n\t\t\t\t\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\t\t\t\t\tview[i] = data.charCodeAt(i);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (responseType === 'blob') {\n\t\t\t\t\t\t\t\tresponse = new Blob([view.buffer], {\n\t\t\t\t\t\t\t\t\ttype: mimeType\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresponse = view.buffer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'document':\n\t\t\t\t\t\t\tconst parser = new DOMParser();\n\t\t\t\t\t\t\tresponse = parser.parseFromString(data, mimeType);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'json':\n\t\t\t\t\t\t\tresponse = JSON.parse(data);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t// 'text' or other\n\t\t\t\t\t\t\tresponse = data;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t} // Wait for next browser tick like standard XMLHttpRequest event dispatching does\n\n\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (onLoad) onLoad(response);\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t}, 0);\n\t\t\t\t} catch (error) {\n\t\t\t\t\t// Wait for next browser tick like standard XMLHttpRequest event dispatching does\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\tif (onError) onError(error);\n\t\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t}, 0);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Initialise array for duplicate requests\n\t\t\t\tloading[url] = [];\n\t\t\t\tloading[url].push({\n\t\t\t\t\tonLoad: onLoad,\n\t\t\t\t\tonProgress: onProgress,\n\t\t\t\t\tonError: onError\n\t\t\t\t});\n\t\t\t\trequest = new XMLHttpRequest();\n\t\t\t\trequest.open('GET', url, true);\n\t\t\t\trequest.addEventListener('load', function (event) {\n\t\t\t\t\tconst response = this.response;\n\t\t\t\t\tconst callbacks = loading[url];\n\t\t\t\t\tdelete loading[url];\n\n\t\t\t\t\tif (this.status === 200 || this.status === 0) {\n\t\t\t\t\t\t// Some browsers return HTTP Status 0 when using non-http protocol\n\t\t\t\t\t\t// e.g. 'file://' or 'data://'. Handle as success.\n\t\t\t\t\t\tif (this.status === 0) console.warn('THREE.FileLoader: HTTP Status 0 received.'); // Add to cache only on HTTP success, so that we do not cache\n\t\t\t\t\t\t// error response bodies as proper responses to requests.\n\n\t\t\t\t\t\tCache.add(url, response);\n\n\t\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\t\tif (callback.onLoad) callback.onLoad(response);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\t\tif (callback.onError) callback.onError(event);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t\t}\n\t\t\t\t}, false);\n\t\t\t\trequest.addEventListener('progress', function (event) {\n\t\t\t\t\tconst callbacks = loading[url];\n\n\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\tif (callback.onProgress) callback.onProgress(event);\n\t\t\t\t\t}\n\t\t\t\t}, false);\n\t\t\t\trequest.addEventListener('error', function (event) {\n\t\t\t\t\tconst callbacks = loading[url];\n\t\t\t\t\tdelete loading[url];\n\n\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\tif (callback.onError) callback.onError(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, false);\n\t\t\t\trequest.addEventListener('abort', function (event) {\n\t\t\t\t\tconst callbacks = loading[url];\n\t\t\t\t\tdelete loading[url];\n\n\t\t\t\t\tfor (let i = 0, il = callbacks.length; i < il; i++) {\n\t\t\t\t\t\tconst callback = callbacks[i];\n\t\t\t\t\t\tif (callback.onError) callback.onError(event);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, false);\n\t\t\t\tif (this.responseType !== undefined) request.responseType = this.responseType;\n\t\t\t\tif (this.withCredentials !== undefined) request.withCredentials = this.withCredentials;\n\t\t\t\tif (request.overrideMimeType) request.overrideMimeType(this.mimeType !== undefined ? this.mimeType : 'text/plain');\n\n\t\t\t\tfor (const header in this.requestHeader) {\n\t\t\t\t\trequest.setRequestHeader(header, this.requestHeader[header]);\n\t\t\t\t}\n\n\t\t\t\trequest.send(null);\n\t\t\t}\n\n\t\t\tscope.manager.itemStart(url);\n\t\t\treturn request;\n\t\t}\n\n\t\tsetResponseType(value) {\n\t\t\tthis.responseType = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetMimeType(value) {\n\t\t\tthis.mimeType = value;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass AnimationLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\ttry {\n\t\t\t\t\tonLoad(scope.parse(JSON.parse(text)));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tparse(json) {\n\t\t\tconst animations = [];\n\n\t\t\tfor (let i = 0; i < json.length; i++) {\n\t\t\t\tconst clip = AnimationClip.parse(json[i]);\n\t\t\t\tanimations.push(clip);\n\t\t\t}\n\n\t\t\treturn animations;\n\t\t}\n\n\t}\n\n\t/**\n\t * Abstract Base class to block based textures loader (dds, pvr, ...)\n\t *\n\t * Sub classes have to implement the parse() method which will be used in load().\n\t */\n\n\tclass CompressedTextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst images = [];\n\t\t\tconst texture = new CompressedTexture();\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setResponseType('arraybuffer');\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tlet loaded = 0;\n\n\t\t\tfunction loadTexture(i) {\n\t\t\t\tloader.load(url[i], function (buffer) {\n\t\t\t\t\tconst texDatas = scope.parse(buffer, true);\n\t\t\t\t\timages[i] = {\n\t\t\t\t\t\twidth: texDatas.width,\n\t\t\t\t\t\theight: texDatas.height,\n\t\t\t\t\t\tformat: texDatas.format,\n\t\t\t\t\t\tmipmaps: texDatas.mipmaps\n\t\t\t\t\t};\n\t\t\t\t\tloaded += 1;\n\n\t\t\t\t\tif (loaded === 6) {\n\t\t\t\t\t\tif (texDatas.mipmapCount === 1) texture.minFilter = LinearFilter;\n\t\t\t\t\t\ttexture.image = images;\n\t\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\t\tif (onLoad) onLoad(texture);\n\t\t\t\t\t}\n\t\t\t\t}, onProgress, onError);\n\t\t\t}\n\n\t\t\tif (Array.isArray(url)) {\n\t\t\t\tfor (let i = 0, il = url.length; i < il; ++i) {\n\t\t\t\t\tloadTexture(i);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// compressed cubemap texture stored in a single DDS file\n\t\t\t\tloader.load(url, function (buffer) {\n\t\t\t\t\tconst texDatas = scope.parse(buffer, true);\n\n\t\t\t\t\tif (texDatas.isCubemap) {\n\t\t\t\t\t\tconst faces = texDatas.mipmaps.length / texDatas.mipmapCount;\n\n\t\t\t\t\t\tfor (let f = 0; f < faces; f++) {\n\t\t\t\t\t\t\timages[f] = {\n\t\t\t\t\t\t\t\tmipmaps: []\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tfor (let i = 0; i < texDatas.mipmapCount; i++) {\n\t\t\t\t\t\t\t\timages[f].mipmaps.push(texDatas.mipmaps[f * texDatas.mipmapCount + i]);\n\t\t\t\t\t\t\t\timages[f].format = texDatas.format;\n\t\t\t\t\t\t\t\timages[f].width = texDatas.width;\n\t\t\t\t\t\t\t\timages[f].height = texDatas.height;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttexture.image = images;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttexture.image.width = texDatas.width;\n\t\t\t\t\t\ttexture.image.height = texDatas.height;\n\t\t\t\t\t\ttexture.mipmaps = texDatas.mipmaps;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (texDatas.mipmapCount === 1) {\n\t\t\t\t\t\ttexture.minFilter = LinearFilter;\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.format = texDatas.format;\n\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\tif (onLoad) onLoad(texture);\n\t\t\t\t}, onProgress, onError);\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\tclass ImageLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tif (this.path !== undefined) url = this.path + url;\n\t\t\turl = this.manager.resolveURL(url);\n\t\t\tconst scope = this;\n\t\t\tconst cached = Cache.get(url);\n\n\t\t\tif (cached !== undefined) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tif (onLoad) onLoad(cached);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, 0);\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst image = createElementNS('img');\n\n\t\t\tfunction onImageLoad() {\n\t\t\t\timage.removeEventListener('load', onImageLoad, false);\n\t\t\t\timage.removeEventListener('error', onImageError, false);\n\t\t\t\tCache.add(url, this);\n\t\t\t\tif (onLoad) onLoad(this);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t}\n\n\t\t\tfunction onImageError(event) {\n\t\t\t\timage.removeEventListener('load', onImageLoad, false);\n\t\t\t\timage.removeEventListener('error', onImageError, false);\n\t\t\t\tif (onError) onError(event);\n\t\t\t\tscope.manager.itemError(url);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t}\n\n\t\t\timage.addEventListener('load', onImageLoad, false);\n\t\t\timage.addEventListener('error', onImageError, false);\n\n\t\t\tif (url.substr(0, 5) !== 'data:') {\n\t\t\t\tif (this.crossOrigin !== undefined) image.crossOrigin = this.crossOrigin;\n\t\t\t}\n\n\t\t\tscope.manager.itemStart(url);\n\t\t\timage.src = url;\n\t\t\treturn image;\n\t\t}\n\n\t}\n\n\tclass CubeTextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(urls, onLoad, onProgress, onError) {\n\t\t\tconst texture = new CubeTexture();\n\t\t\tconst loader = new ImageLoader(this.manager);\n\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\t\tloader.setPath(this.path);\n\t\t\tlet loaded = 0;\n\n\t\t\tfunction loadTexture(i) {\n\t\t\t\tloader.load(urls[i], function (image) {\n\t\t\t\t\ttexture.images[i] = image;\n\t\t\t\t\tloaded++;\n\n\t\t\t\t\tif (loaded === 6) {\n\t\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\t\tif (onLoad) onLoad(texture);\n\t\t\t\t\t}\n\t\t\t\t}, undefined, onError);\n\t\t\t}\n\n\t\t\tfor (let i = 0; i < urls.length; ++i) {\n\t\t\t\tloadTexture(i);\n\t\t\t}\n\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\t/**\n\t * Abstract Base class to load generic binary textures formats (rgbe, hdr, ...)\n\t *\n\t * Sub classes have to implement the parse() method which will be used in load().\n\t */\n\n\tclass DataTextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst texture = new DataTexture();\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setResponseType('arraybuffer');\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tloader.load(url, function (buffer) {\n\t\t\t\tconst texData = scope.parse(buffer);\n\t\t\t\tif (!texData) return;\n\n\t\t\t\tif (texData.image !== undefined) {\n\t\t\t\t\ttexture.image = texData.image;\n\t\t\t\t} else if (texData.data !== undefined) {\n\t\t\t\t\ttexture.image.width = texData.width;\n\t\t\t\t\ttexture.image.height = texData.height;\n\t\t\t\t\ttexture.image.data = texData.data;\n\t\t\t\t}\n\n\t\t\t\ttexture.wrapS = texData.wrapS !== undefined ? texData.wrapS : ClampToEdgeWrapping;\n\t\t\t\ttexture.wrapT = texData.wrapT !== undefined ? texData.wrapT : ClampToEdgeWrapping;\n\t\t\t\ttexture.magFilter = texData.magFilter !== undefined ? texData.magFilter : LinearFilter;\n\t\t\t\ttexture.minFilter = texData.minFilter !== undefined ? texData.minFilter : LinearFilter;\n\t\t\t\ttexture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1;\n\n\t\t\t\tif (texData.encoding !== undefined) {\n\t\t\t\t\ttexture.encoding = texData.encoding;\n\t\t\t\t}\n\n\t\t\t\tif (texData.flipY !== undefined) {\n\t\t\t\t\ttexture.flipY = texData.flipY;\n\t\t\t\t}\n\n\t\t\t\tif (texData.format !== undefined) {\n\t\t\t\t\ttexture.format = texData.format;\n\t\t\t\t}\n\n\t\t\t\tif (texData.type !== undefined) {\n\t\t\t\t\ttexture.type = texData.type;\n\t\t\t\t}\n\n\t\t\t\tif (texData.mipmaps !== undefined) {\n\t\t\t\t\ttexture.mipmaps = texData.mipmaps;\n\t\t\t\t\ttexture.minFilter = LinearMipmapLinearFilter; // presumably...\n\t\t\t\t}\n\n\t\t\t\tif (texData.mipmapCount === 1) {\n\t\t\t\t\ttexture.minFilter = LinearFilter;\n\t\t\t\t}\n\n\t\t\t\tif (texData.generateMipmaps !== undefined) {\n\t\t\t\t\ttexture.generateMipmaps = texData.generateMipmaps;\n\t\t\t\t}\n\n\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\tif (onLoad) onLoad(texture, texData);\n\t\t\t}, onProgress, onError);\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\tclass TextureLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst texture = new Texture();\n\t\t\tconst loader = new ImageLoader(this.manager);\n\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.load(url, function (image) {\n\t\t\t\ttexture.image = image;\n\t\t\t\ttexture.needsUpdate = true;\n\n\t\t\t\tif (onLoad !== undefined) {\n\t\t\t\t\tonLoad(texture);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t\treturn texture;\n\t\t}\n\n\t}\n\n\tclass Light extends Object3D {\n\t\tconstructor(color, intensity = 1) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Light';\n\t\t\tthis.color = new Color(color);\n\t\t\tthis.intensity = intensity;\n\t\t}\n\n\t\tdispose() {// Empty here in base class; some subclasses override.\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.color.copy(source.color);\n\t\t\tthis.intensity = source.intensity;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.color = this.color.getHex();\n\t\t\tdata.object.intensity = this.intensity;\n\t\t\tif (this.groundColor !== undefined) data.object.groundColor = this.groundColor.getHex();\n\t\t\tif (this.distance !== undefined) data.object.distance = this.distance;\n\t\t\tif (this.angle !== undefined) data.object.angle = this.angle;\n\t\t\tif (this.decay !== undefined) data.object.decay = this.decay;\n\t\t\tif (this.penumbra !== undefined) data.object.penumbra = this.penumbra;\n\t\t\tif (this.shadow !== undefined) data.object.shadow = this.shadow.toJSON();\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tLight.prototype.isLight = true;\n\n\tclass HemisphereLight extends Light {\n\t\tconstructor(skyColor, groundColor, intensity) {\n\t\t\tsuper(skyColor, intensity);\n\t\t\tthis.type = 'HemisphereLight';\n\t\t\tthis.position.copy(Object3D.DefaultUp);\n\t\t\tthis.updateMatrix();\n\t\t\tthis.groundColor = new Color(groundColor);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tLight.prototype.copy.call(this, source);\n\t\t\tthis.groundColor.copy(source.groundColor);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tHemisphereLight.prototype.isHemisphereLight = true;\n\n\tconst _projScreenMatrix$1 = /*@__PURE__*/new Matrix4();\n\n\tconst _lightPositionWorld$1 = /*@__PURE__*/new Vector3();\n\n\tconst _lookTarget$1 = /*@__PURE__*/new Vector3();\n\n\tclass LightShadow {\n\t\tconstructor(camera) {\n\t\t\tthis.camera = camera;\n\t\t\tthis.bias = 0;\n\t\t\tthis.normalBias = 0;\n\t\t\tthis.radius = 1;\n\t\t\tthis.blurSamples = 8;\n\t\t\tthis.mapSize = new Vector2(512, 512);\n\t\t\tthis.map = null;\n\t\t\tthis.mapPass = null;\n\t\t\tthis.matrix = new Matrix4();\n\t\t\tthis.autoUpdate = true;\n\t\t\tthis.needsUpdate = false;\n\t\t\tthis._frustum = new Frustum();\n\t\t\tthis._frameExtents = new Vector2(1, 1);\n\t\t\tthis._viewportCount = 1;\n\t\t\tthis._viewports = [new Vector4(0, 0, 1, 1)];\n\t\t}\n\n\t\tgetViewportCount() {\n\t\t\treturn this._viewportCount;\n\t\t}\n\n\t\tgetFrustum() {\n\t\t\treturn this._frustum;\n\t\t}\n\n\t\tupdateMatrices(light) {\n\t\t\tconst shadowCamera = this.camera;\n\t\t\tconst shadowMatrix = this.matrix;\n\n\t\t\t_lightPositionWorld$1.setFromMatrixPosition(light.matrixWorld);\n\n\t\t\tshadowCamera.position.copy(_lightPositionWorld$1);\n\n\t\t\t_lookTarget$1.setFromMatrixPosition(light.target.matrixWorld);\n\n\t\t\tshadowCamera.lookAt(_lookTarget$1);\n\t\t\tshadowCamera.updateMatrixWorld();\n\n\t\t\t_projScreenMatrix$1.multiplyMatrices(shadowCamera.projectionMatrix, shadowCamera.matrixWorldInverse);\n\n\t\t\tthis._frustum.setFromProjectionMatrix(_projScreenMatrix$1);\n\n\t\t\tshadowMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);\n\t\t\tshadowMatrix.multiply(shadowCamera.projectionMatrix);\n\t\t\tshadowMatrix.multiply(shadowCamera.matrixWorldInverse);\n\t\t}\n\n\t\tgetViewport(viewportIndex) {\n\t\t\treturn this._viewports[viewportIndex];\n\t\t}\n\n\t\tgetFrameExtents() {\n\t\t\treturn this._frameExtents;\n\t\t}\n\n\t\tdispose() {\n\t\t\tif (this.map) {\n\t\t\t\tthis.map.dispose();\n\t\t\t}\n\n\t\t\tif (this.mapPass) {\n\t\t\t\tthis.mapPass.dispose();\n\t\t\t}\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tthis.camera = source.camera.clone();\n\t\t\tthis.bias = source.bias;\n\t\t\tthis.radius = source.radius;\n\t\t\tthis.mapSize.copy(source.mapSize);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst object = {};\n\t\t\tif (this.bias !== 0) object.bias = this.bias;\n\t\t\tif (this.normalBias !== 0) object.normalBias = this.normalBias;\n\t\t\tif (this.radius !== 1) object.radius = this.radius;\n\t\t\tif (this.mapSize.x !== 512 || this.mapSize.y !== 512) object.mapSize = this.mapSize.toArray();\n\t\t\tobject.camera = this.camera.toJSON(false).object;\n\t\t\tdelete object.camera.matrix;\n\t\t\treturn object;\n\t\t}\n\n\t}\n\n\tclass SpotLightShadow extends LightShadow {\n\t\tconstructor() {\n\t\t\tsuper(new PerspectiveCamera(50, 1, 0.5, 500));\n\t\t\tthis.focus = 1;\n\t\t}\n\n\t\tupdateMatrices(light) {\n\t\t\tconst camera = this.camera;\n\t\t\tconst fov = RAD2DEG * 2 * light.angle * this.focus;\n\t\t\tconst aspect = this.mapSize.width / this.mapSize.height;\n\t\t\tconst far = light.distance || camera.far;\n\n\t\t\tif (fov !== camera.fov || aspect !== camera.aspect || far !== camera.far) {\n\t\t\t\tcamera.fov = fov;\n\t\t\t\tcamera.aspect = aspect;\n\t\t\t\tcamera.far = far;\n\t\t\t\tcamera.updateProjectionMatrix();\n\t\t\t}\n\n\t\t\tsuper.updateMatrices(light);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.focus = source.focus;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSpotLightShadow.prototype.isSpotLightShadow = true;\n\n\tclass SpotLight extends Light {\n\t\tconstructor(color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 1) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'SpotLight';\n\t\t\tthis.position.copy(Object3D.DefaultUp);\n\t\t\tthis.updateMatrix();\n\t\t\tthis.target = new Object3D();\n\t\t\tthis.distance = distance;\n\t\t\tthis.angle = angle;\n\t\t\tthis.penumbra = penumbra;\n\t\t\tthis.decay = decay; // for physically correct lights, should be 2.\n\n\t\t\tthis.shadow = new SpotLightShadow();\n\t\t}\n\n\t\tget power() {\n\t\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t\t// by convention for a spotlight, luminous power (lm) = π * luminous intensity (cd)\n\t\t\treturn this.intensity * Math.PI;\n\t\t}\n\n\t\tset power(power) {\n\t\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\t\tthis.intensity = power / Math.PI;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.shadow.dispose();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.distance = source.distance;\n\t\t\tthis.angle = source.angle;\n\t\t\tthis.penumbra = source.penumbra;\n\t\t\tthis.decay = source.decay;\n\t\t\tthis.target = source.target.clone();\n\t\t\tthis.shadow = source.shadow.clone();\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tSpotLight.prototype.isSpotLight = true;\n\n\tconst _projScreenMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _lightPositionWorld = /*@__PURE__*/new Vector3();\n\n\tconst _lookTarget = /*@__PURE__*/new Vector3();\n\n\tclass PointLightShadow extends LightShadow {\n\t\tconstructor() {\n\t\t\tsuper(new PerspectiveCamera(90, 1, 0.5, 500));\n\t\t\tthis._frameExtents = new Vector2(4, 2);\n\t\t\tthis._viewportCount = 6;\n\t\t\tthis._viewports = [// These viewports map a cube-map onto a 2D texture with the\n\t\t\t// following orientation:\n\t\t\t//\n\t\t\t//\txzXZ\n\t\t\t//\t y Y\n\t\t\t//\n\t\t\t// X - Positive x direction\n\t\t\t// x - Negative x direction\n\t\t\t// Y - Positive y direction\n\t\t\t// y - Negative y direction\n\t\t\t// Z - Positive z direction\n\t\t\t// z - Negative z direction\n\t\t\t// positive X\n\t\t\tnew Vector4(2, 1, 1, 1), // negative X\n\t\t\tnew Vector4(0, 1, 1, 1), // positive Z\n\t\t\tnew Vector4(3, 1, 1, 1), // negative Z\n\t\t\tnew Vector4(1, 1, 1, 1), // positive Y\n\t\t\tnew Vector4(3, 0, 1, 1), // negative Y\n\t\t\tnew Vector4(1, 0, 1, 1)];\n\t\t\tthis._cubeDirections = [new Vector3(1, 0, 0), new Vector3(-1, 0, 0), new Vector3(0, 0, 1), new Vector3(0, 0, -1), new Vector3(0, 1, 0), new Vector3(0, -1, 0)];\n\t\t\tthis._cubeUps = [new Vector3(0, 1, 0), new Vector3(0, 1, 0), new Vector3(0, 1, 0), new Vector3(0, 1, 0), new Vector3(0, 0, 1), new Vector3(0, 0, -1)];\n\t\t}\n\n\t\tupdateMatrices(light, viewportIndex = 0) {\n\t\t\tconst camera = this.camera;\n\t\t\tconst shadowMatrix = this.matrix;\n\t\t\tconst far = light.distance || camera.far;\n\n\t\t\tif (far !== camera.far) {\n\t\t\t\tcamera.far = far;\n\t\t\t\tcamera.updateProjectionMatrix();\n\t\t\t}\n\n\t\t\t_lightPositionWorld.setFromMatrixPosition(light.matrixWorld);\n\n\t\t\tcamera.position.copy(_lightPositionWorld);\n\n\t\t\t_lookTarget.copy(camera.position);\n\n\t\t\t_lookTarget.add(this._cubeDirections[viewportIndex]);\n\n\t\t\tcamera.up.copy(this._cubeUps[viewportIndex]);\n\t\t\tcamera.lookAt(_lookTarget);\n\t\t\tcamera.updateMatrixWorld();\n\t\t\tshadowMatrix.makeTranslation(-_lightPositionWorld.x, -_lightPositionWorld.y, -_lightPositionWorld.z);\n\n\t\t\t_projScreenMatrix.multiplyMatrices(camera.projectionMatrix, camera.matrixWorldInverse);\n\n\t\t\tthis._frustum.setFromProjectionMatrix(_projScreenMatrix);\n\t\t}\n\n\t}\n\n\tPointLightShadow.prototype.isPointLightShadow = true;\n\n\tclass PointLight extends Light {\n\t\tconstructor(color, intensity, distance = 0, decay = 1) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'PointLight';\n\t\t\tthis.distance = distance;\n\t\t\tthis.decay = decay; // for physically correct lights, should be 2.\n\n\t\t\tthis.shadow = new PointLightShadow();\n\t\t}\n\n\t\tget power() {\n\t\t\t// compute the light's luminous power (in lumens) from its intensity (in candela)\n\t\t\t// for an isotropic light source, luminous power (lm) = 4 π luminous intensity (cd)\n\t\t\treturn this.intensity * 4 * Math.PI;\n\t\t}\n\n\t\tset power(power) {\n\t\t\t// set the light's intensity (in candela) from the desired luminous power (in lumens)\n\t\t\tthis.intensity = power / (4 * Math.PI);\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.shadow.dispose();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.distance = source.distance;\n\t\t\tthis.decay = source.decay;\n\t\t\tthis.shadow = source.shadow.clone();\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tPointLight.prototype.isPointLight = true;\n\n\tclass DirectionalLightShadow extends LightShadow {\n\t\tconstructor() {\n\t\t\tsuper(new OrthographicCamera(-5, 5, 5, -5, 0.5, 500));\n\t\t}\n\n\t}\n\n\tDirectionalLightShadow.prototype.isDirectionalLightShadow = true;\n\n\tclass DirectionalLight extends Light {\n\t\tconstructor(color, intensity) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'DirectionalLight';\n\t\t\tthis.position.copy(Object3D.DefaultUp);\n\t\t\tthis.updateMatrix();\n\t\t\tthis.target = new Object3D();\n\t\t\tthis.shadow = new DirectionalLightShadow();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.shadow.dispose();\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.target = source.target.clone();\n\t\t\tthis.shadow = source.shadow.clone();\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tDirectionalLight.prototype.isDirectionalLight = true;\n\n\tclass AmbientLight extends Light {\n\t\tconstructor(color, intensity) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'AmbientLight';\n\t\t}\n\n\t}\n\n\tAmbientLight.prototype.isAmbientLight = true;\n\n\tclass RectAreaLight extends Light {\n\t\tconstructor(color, intensity, width = 10, height = 10) {\n\t\t\tsuper(color, intensity);\n\t\t\tthis.type = 'RectAreaLight';\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\t\t}\n\n\t\tget power() {\n\t\t\t// compute the light's luminous power (in lumens) from its intensity (in nits)\n\t\t\treturn this.intensity * this.width * this.height * Math.PI;\n\t\t}\n\n\t\tset power(power) {\n\t\t\t// set the light's intensity (in nits) from the desired luminous power (in lumens)\n\t\t\tthis.intensity = power / (this.width * this.height * Math.PI);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.width = source.width;\n\t\t\tthis.height = source.height;\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.width = this.width;\n\t\t\tdata.object.height = this.height;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tRectAreaLight.prototype.isRectAreaLight = true;\n\n\t/**\n\t * Primary reference:\n\t *\t https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\t *\n\t * Secondary reference:\n\t *\t https://www.ppsloan.org/publications/StupidSH36.pdf\n\t */\n\t// 3-band SH defined by 9 coefficients\n\n\tclass SphericalHarmonics3 {\n\t\tconstructor() {\n\t\t\tthis.coefficients = [];\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients.push(new Vector3());\n\t\t\t}\n\t\t}\n\n\t\tset(coefficients) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].copy(coefficients[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tzero() {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].set(0, 0, 0);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // get the radiance in the direction of the normal\n\t\t// target is a Vector3\n\n\n\t\tgetAt(normal, target) {\n\t\t\t// normal is assumed to be unit length\n\t\t\tconst x = normal.x,\n\t\t\t\t\t\ty = normal.y,\n\t\t\t\t\t\tz = normal.z;\n\t\t\tconst coeff = this.coefficients; // band 0\n\n\t\t\ttarget.copy(coeff[0]).multiplyScalar(0.282095); // band 1\n\n\t\t\ttarget.addScaledVector(coeff[1], 0.488603 * y);\n\t\t\ttarget.addScaledVector(coeff[2], 0.488603 * z);\n\t\t\ttarget.addScaledVector(coeff[3], 0.488603 * x); // band 2\n\n\t\t\ttarget.addScaledVector(coeff[4], 1.092548 * (x * y));\n\t\t\ttarget.addScaledVector(coeff[5], 1.092548 * (y * z));\n\t\t\ttarget.addScaledVector(coeff[6], 0.315392 * (3.0 * z * z - 1.0));\n\t\t\ttarget.addScaledVector(coeff[7], 1.092548 * (x * z));\n\t\t\ttarget.addScaledVector(coeff[8], 0.546274 * (x * x - y * y));\n\t\t\treturn target;\n\t\t} // get the irradiance (radiance convolved with cosine lobe) in the direction of the normal\n\t\t// target is a Vector3\n\t\t// https://graphics.stanford.edu/papers/envmap/envmap.pdf\n\n\n\t\tgetIrradianceAt(normal, target) {\n\t\t\t// normal is assumed to be unit length\n\t\t\tconst x = normal.x,\n\t\t\t\t\t\ty = normal.y,\n\t\t\t\t\t\tz = normal.z;\n\t\t\tconst coeff = this.coefficients; // band 0\n\n\t\t\ttarget.copy(coeff[0]).multiplyScalar(0.886227); // π * 0.282095\n\t\t\t// band 1\n\n\t\t\ttarget.addScaledVector(coeff[1], 2.0 * 0.511664 * y); // ( 2 * π / 3 ) * 0.488603\n\n\t\t\ttarget.addScaledVector(coeff[2], 2.0 * 0.511664 * z);\n\t\t\ttarget.addScaledVector(coeff[3], 2.0 * 0.511664 * x); // band 2\n\n\t\t\ttarget.addScaledVector(coeff[4], 2.0 * 0.429043 * x * y); // ( π / 4 ) * 1.092548\n\n\t\t\ttarget.addScaledVector(coeff[5], 2.0 * 0.429043 * y * z);\n\t\t\ttarget.addScaledVector(coeff[6], 0.743125 * z * z - 0.247708); // ( π / 4 ) * 0.315392 * 3\n\n\t\t\ttarget.addScaledVector(coeff[7], 2.0 * 0.429043 * x * z);\n\t\t\ttarget.addScaledVector(coeff[8], 0.429043 * (x * x - y * y)); // ( π / 4 ) * 0.546274\n\n\t\t\treturn target;\n\t\t}\n\n\t\tadd(sh) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].add(sh.coefficients[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\taddScaledSH(sh, s) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].addScaledVector(sh.coefficients[i], s);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tscale(s) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].multiplyScalar(s);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tlerp(sh, alpha) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tthis.coefficients[i].lerp(sh.coefficients[i], alpha);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(sh) {\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tif (!this.coefficients[i].equals(sh.coefficients[i])) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\tcopy(sh) {\n\t\t\treturn this.set(sh.coefficients);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tfromArray(array, offset = 0) {\n\t\t\tconst coefficients = this.coefficients;\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tcoefficients[i].fromArray(array, offset + i * 3);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\ttoArray(array = [], offset = 0) {\n\t\t\tconst coefficients = this.coefficients;\n\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tcoefficients[i].toArray(array, offset + i * 3);\n\t\t\t}\n\n\t\t\treturn array;\n\t\t} // evaluate the basis functions\n\t\t// shBasis is an Array[ 9 ]\n\n\n\t\tstatic getBasisAt(normal, shBasis) {\n\t\t\t// normal is assumed to be unit length\n\t\t\tconst x = normal.x,\n\t\t\t\t\t\ty = normal.y,\n\t\t\t\t\t\tz = normal.z; // band 0\n\n\t\t\tshBasis[0] = 0.282095; // band 1\n\n\t\t\tshBasis[1] = 0.488603 * y;\n\t\t\tshBasis[2] = 0.488603 * z;\n\t\t\tshBasis[3] = 0.488603 * x; // band 2\n\n\t\t\tshBasis[4] = 1.092548 * x * y;\n\t\t\tshBasis[5] = 1.092548 * y * z;\n\t\t\tshBasis[6] = 0.315392 * (3 * z * z - 1);\n\t\t\tshBasis[7] = 1.092548 * x * z;\n\t\t\tshBasis[8] = 0.546274 * (x * x - y * y);\n\t\t}\n\n\t}\n\n\tSphericalHarmonics3.prototype.isSphericalHarmonics3 = true;\n\n\tclass LightProbe extends Light {\n\t\tconstructor(sh = new SphericalHarmonics3(), intensity = 1) {\n\t\t\tsuper(undefined, intensity);\n\t\t\tthis.sh = sh;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.sh.copy(source.sh);\n\t\t\treturn this;\n\t\t}\n\n\t\tfromJSON(json) {\n\t\t\tthis.intensity = json.intensity; // TODO: Move this bit to Light.fromJSON();\n\n\t\t\tthis.sh.fromArray(json.sh);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoJSON(meta) {\n\t\t\tconst data = super.toJSON(meta);\n\t\t\tdata.object.sh = this.sh.toArray();\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tLightProbe.prototype.isLightProbe = true;\n\n\tclass MaterialLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t\tthis.textures = {};\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(scope.manager);\n\t\t\tloader.setPath(scope.path);\n\t\t\tloader.setRequestHeader(scope.requestHeader);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\ttry {\n\t\t\t\t\tonLoad(scope.parse(JSON.parse(text)));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tparse(json) {\n\t\t\tconst textures = this.textures;\n\n\t\t\tfunction getTexture(name) {\n\t\t\t\tif (textures[name] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.MaterialLoader: Undefined texture', name);\n\t\t\t\t}\n\n\t\t\t\treturn textures[name];\n\t\t\t}\n\n\t\t\tconst material = new Materials[json.type]();\n\t\t\tif (json.uuid !== undefined) material.uuid = json.uuid;\n\t\t\tif (json.name !== undefined) material.name = json.name;\n\t\t\tif (json.color !== undefined && material.color !== undefined) material.color.setHex(json.color);\n\t\t\tif (json.roughness !== undefined) material.roughness = json.roughness;\n\t\t\tif (json.metalness !== undefined) material.metalness = json.metalness;\n\t\t\tif (json.sheen !== undefined) material.sheen = json.sheen;\n\t\t\tif (json.sheenTint !== undefined) material.sheenTint = new Color().setHex(json.sheenTint);\n\t\t\tif (json.sheenRoughness !== undefined) material.sheenRoughness = json.sheenRoughness;\n\t\t\tif (json.emissive !== undefined && material.emissive !== undefined) material.emissive.setHex(json.emissive);\n\t\t\tif (json.specular !== undefined && material.specular !== undefined) material.specular.setHex(json.specular);\n\t\t\tif (json.specularIntensity !== undefined) material.specularIntensity = json.specularIntensity;\n\t\t\tif (json.specularTint !== undefined && material.specularTint !== undefined) material.specularTint.setHex(json.specularTint);\n\t\t\tif (json.shininess !== undefined) material.shininess = json.shininess;\n\t\t\tif (json.clearcoat !== undefined) material.clearcoat = json.clearcoat;\n\t\t\tif (json.clearcoatRoughness !== undefined) material.clearcoatRoughness = json.clearcoatRoughness;\n\t\t\tif (json.transmission !== undefined) material.transmission = json.transmission;\n\t\t\tif (json.thickness !== undefined) material.thickness = json.thickness;\n\t\t\tif (json.attenuationDistance !== undefined) material.attenuationDistance = json.attenuationDistance;\n\t\t\tif (json.attenuationTint !== undefined && material.attenuationTint !== undefined) material.attenuationTint.setHex(json.attenuationTint);\n\t\t\tif (json.fog !== undefined) material.fog = json.fog;\n\t\t\tif (json.flatShading !== undefined) material.flatShading = json.flatShading;\n\t\t\tif (json.blending !== undefined) material.blending = json.blending;\n\t\t\tif (json.combine !== undefined) material.combine = json.combine;\n\t\t\tif (json.side !== undefined) material.side = json.side;\n\t\t\tif (json.shadowSide !== undefined) material.shadowSide = json.shadowSide;\n\t\t\tif (json.opacity !== undefined) material.opacity = json.opacity;\n\t\t\tif (json.format !== undefined) material.format = json.format;\n\t\t\tif (json.transparent !== undefined) material.transparent = json.transparent;\n\t\t\tif (json.alphaTest !== undefined) material.alphaTest = json.alphaTest;\n\t\t\tif (json.depthTest !== undefined) material.depthTest = json.depthTest;\n\t\t\tif (json.depthWrite !== undefined) material.depthWrite = json.depthWrite;\n\t\t\tif (json.colorWrite !== undefined) material.colorWrite = json.colorWrite;\n\t\t\tif (json.stencilWrite !== undefined) material.stencilWrite = json.stencilWrite;\n\t\t\tif (json.stencilWriteMask !== undefined) material.stencilWriteMask = json.stencilWriteMask;\n\t\t\tif (json.stencilFunc !== undefined) material.stencilFunc = json.stencilFunc;\n\t\t\tif (json.stencilRef !== undefined) material.stencilRef = json.stencilRef;\n\t\t\tif (json.stencilFuncMask !== undefined) material.stencilFuncMask = json.stencilFuncMask;\n\t\t\tif (json.stencilFail !== undefined) material.stencilFail = json.stencilFail;\n\t\t\tif (json.stencilZFail !== undefined) material.stencilZFail = json.stencilZFail;\n\t\t\tif (json.stencilZPass !== undefined) material.stencilZPass = json.stencilZPass;\n\t\t\tif (json.wireframe !== undefined) material.wireframe = json.wireframe;\n\t\t\tif (json.wireframeLinewidth !== undefined) material.wireframeLinewidth = json.wireframeLinewidth;\n\t\t\tif (json.wireframeLinecap !== undefined) material.wireframeLinecap = json.wireframeLinecap;\n\t\t\tif (json.wireframeLinejoin !== undefined) material.wireframeLinejoin = json.wireframeLinejoin;\n\t\t\tif (json.rotation !== undefined) material.rotation = json.rotation;\n\t\t\tif (json.linewidth !== 1) material.linewidth = json.linewidth;\n\t\t\tif (json.dashSize !== undefined) material.dashSize = json.dashSize;\n\t\t\tif (json.gapSize !== undefined) material.gapSize = json.gapSize;\n\t\t\tif (json.scale !== undefined) material.scale = json.scale;\n\t\t\tif (json.polygonOffset !== undefined) material.polygonOffset = json.polygonOffset;\n\t\t\tif (json.polygonOffsetFactor !== undefined) material.polygonOffsetFactor = json.polygonOffsetFactor;\n\t\t\tif (json.polygonOffsetUnits !== undefined) material.polygonOffsetUnits = json.polygonOffsetUnits;\n\t\t\tif (json.dithering !== undefined) material.dithering = json.dithering;\n\t\t\tif (json.alphaToCoverage !== undefined) material.alphaToCoverage = json.alphaToCoverage;\n\t\t\tif (json.premultipliedAlpha !== undefined) material.premultipliedAlpha = json.premultipliedAlpha;\n\t\t\tif (json.visible !== undefined) material.visible = json.visible;\n\t\t\tif (json.toneMapped !== undefined) material.toneMapped = json.toneMapped;\n\t\t\tif (json.userData !== undefined) material.userData = json.userData;\n\n\t\t\tif (json.vertexColors !== undefined) {\n\t\t\t\tif (typeof json.vertexColors === 'number') {\n\t\t\t\t\tmaterial.vertexColors = json.vertexColors > 0 ? true : false;\n\t\t\t\t} else {\n\t\t\t\t\tmaterial.vertexColors = json.vertexColors;\n\t\t\t\t}\n\t\t\t} // Shader Material\n\n\n\t\t\tif (json.uniforms !== undefined) {\n\t\t\t\tfor (const name in json.uniforms) {\n\t\t\t\t\tconst uniform = json.uniforms[name];\n\t\t\t\t\tmaterial.uniforms[name] = {};\n\n\t\t\t\t\tswitch (uniform.type) {\n\t\t\t\t\t\tcase 't':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = getTexture(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'c':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Color().setHex(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'v2':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Vector2().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'v3':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Vector3().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'v4':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Vector4().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm3':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Matrix3().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'm4':\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = new Matrix4().fromArray(uniform.value);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tmaterial.uniforms[name].value = uniform.value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (json.defines !== undefined) material.defines = json.defines;\n\t\t\tif (json.vertexShader !== undefined) material.vertexShader = json.vertexShader;\n\t\t\tif (json.fragmentShader !== undefined) material.fragmentShader = json.fragmentShader;\n\n\t\t\tif (json.extensions !== undefined) {\n\t\t\t\tfor (const key in json.extensions) {\n\t\t\t\t\tmaterial.extensions[key] = json.extensions[key];\n\t\t\t\t}\n\t\t\t} // Deprecated\n\n\n\t\t\tif (json.shading !== undefined) material.flatShading = json.shading === 1; // THREE.FlatShading\n\t\t\t// for PointsMaterial\n\n\t\t\tif (json.size !== undefined) material.size = json.size;\n\t\t\tif (json.sizeAttenuation !== undefined) material.sizeAttenuation = json.sizeAttenuation; // maps\n\n\t\t\tif (json.map !== undefined) material.map = getTexture(json.map);\n\t\t\tif (json.matcap !== undefined) material.matcap = getTexture(json.matcap);\n\t\t\tif (json.alphaMap !== undefined) material.alphaMap = getTexture(json.alphaMap);\n\t\t\tif (json.bumpMap !== undefined) material.bumpMap = getTexture(json.bumpMap);\n\t\t\tif (json.bumpScale !== undefined) material.bumpScale = json.bumpScale;\n\t\t\tif (json.normalMap !== undefined) material.normalMap = getTexture(json.normalMap);\n\t\t\tif (json.normalMapType !== undefined) material.normalMapType = json.normalMapType;\n\n\t\t\tif (json.normalScale !== undefined) {\n\t\t\t\tlet normalScale = json.normalScale;\n\n\t\t\t\tif (Array.isArray(normalScale) === false) {\n\t\t\t\t\t// Blender exporter used to export a scalar. See #7459\n\t\t\t\t\tnormalScale = [normalScale, normalScale];\n\t\t\t\t}\n\n\t\t\t\tmaterial.normalScale = new Vector2().fromArray(normalScale);\n\t\t\t}\n\n\t\t\tif (json.displacementMap !== undefined) material.displacementMap = getTexture(json.displacementMap);\n\t\t\tif (json.displacementScale !== undefined) material.displacementScale = json.displacementScale;\n\t\t\tif (json.displacementBias !== undefined) material.displacementBias = json.displacementBias;\n\t\t\tif (json.roughnessMap !== undefined) material.roughnessMap = getTexture(json.roughnessMap);\n\t\t\tif (json.metalnessMap !== undefined) material.metalnessMap = getTexture(json.metalnessMap);\n\t\t\tif (json.emissiveMap !== undefined) material.emissiveMap = getTexture(json.emissiveMap);\n\t\t\tif (json.emissiveIntensity !== undefined) material.emissiveIntensity = json.emissiveIntensity;\n\t\t\tif (json.specularMap !== undefined) material.specularMap = getTexture(json.specularMap);\n\t\t\tif (json.specularIntensityMap !== undefined) material.specularIntensityMap = getTexture(json.specularIntensityMap);\n\t\t\tif (json.specularTintMap !== undefined) material.specularTintMap = getTexture(json.specularTintMap);\n\t\t\tif (json.envMap !== undefined) material.envMap = getTexture(json.envMap);\n\t\t\tif (json.envMapIntensity !== undefined) material.envMapIntensity = json.envMapIntensity;\n\t\t\tif (json.reflectivity !== undefined) material.reflectivity = json.reflectivity;\n\t\t\tif (json.refractionRatio !== undefined) material.refractionRatio = json.refractionRatio;\n\t\t\tif (json.lightMap !== undefined) material.lightMap = getTexture(json.lightMap);\n\t\t\tif (json.lightMapIntensity !== undefined) material.lightMapIntensity = json.lightMapIntensity;\n\t\t\tif (json.aoMap !== undefined) material.aoMap = getTexture(json.aoMap);\n\t\t\tif (json.aoMapIntensity !== undefined) material.aoMapIntensity = json.aoMapIntensity;\n\t\t\tif (json.gradientMap !== undefined) material.gradientMap = getTexture(json.gradientMap);\n\t\t\tif (json.clearcoatMap !== undefined) material.clearcoatMap = getTexture(json.clearcoatMap);\n\t\t\tif (json.clearcoatRoughnessMap !== undefined) material.clearcoatRoughnessMap = getTexture(json.clearcoatRoughnessMap);\n\t\t\tif (json.clearcoatNormalMap !== undefined) material.clearcoatNormalMap = getTexture(json.clearcoatNormalMap);\n\t\t\tif (json.clearcoatNormalScale !== undefined) material.clearcoatNormalScale = new Vector2().fromArray(json.clearcoatNormalScale);\n\t\t\tif (json.transmissionMap !== undefined) material.transmissionMap = getTexture(json.transmissionMap);\n\t\t\tif (json.thicknessMap !== undefined) material.thicknessMap = getTexture(json.thicknessMap);\n\t\t\treturn material;\n\t\t}\n\n\t\tsetTextures(value) {\n\t\t\tthis.textures = value;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass LoaderUtils {\n\t\tstatic decodeText(array) {\n\t\t\tif (typeof TextDecoder !== 'undefined') {\n\t\t\t\treturn new TextDecoder().decode(array);\n\t\t\t} // Avoid the String.fromCharCode.apply(null, array) shortcut, which\n\t\t\t// throws a \"maximum call stack size exceeded\" error for large arrays.\n\n\n\t\t\tlet s = '';\n\n\t\t\tfor (let i = 0, il = array.length; i < il; i++) {\n\t\t\t\t// Implicitly assumes little-endian.\n\t\t\t\ts += String.fromCharCode(array[i]);\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t// merges multi-byte utf-8 characters.\n\t\t\t\treturn decodeURIComponent(escape(s));\n\t\t\t} catch (e) {\n\t\t\t\t// see #16358\n\t\t\t\treturn s;\n\t\t\t}\n\t\t}\n\n\t\tstatic extractUrlBase(url) {\n\t\t\tconst index = url.lastIndexOf('/');\n\t\t\tif (index === -1) return './';\n\t\t\treturn url.substr(0, index + 1);\n\t\t}\n\n\t}\n\n\tclass InstancedBufferGeometry extends BufferGeometry {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'InstancedBufferGeometry';\n\t\t\tthis.instanceCount = Infinity;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.instanceCount = source.instanceCount;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\tconst data = super.toJSON(this);\n\t\t\tdata.instanceCount = this.instanceCount;\n\t\t\tdata.isInstancedBufferGeometry = true;\n\t\t\treturn data;\n\t\t}\n\n\t}\n\n\tInstancedBufferGeometry.prototype.isInstancedBufferGeometry = true;\n\n\tclass BufferGeometryLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(scope.manager);\n\t\t\tloader.setPath(scope.path);\n\t\t\tloader.setRequestHeader(scope.requestHeader);\n\t\t\tloader.setWithCredentials(scope.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\ttry {\n\t\t\t\t\tonLoad(scope.parse(JSON.parse(text)));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tparse(json) {\n\t\t\tconst interleavedBufferMap = {};\n\t\t\tconst arrayBufferMap = {};\n\n\t\t\tfunction getInterleavedBuffer(json, uuid) {\n\t\t\t\tif (interleavedBufferMap[uuid] !== undefined) return interleavedBufferMap[uuid];\n\t\t\t\tconst interleavedBuffers = json.interleavedBuffers;\n\t\t\t\tconst interleavedBuffer = interleavedBuffers[uuid];\n\t\t\t\tconst buffer = getArrayBuffer(json, interleavedBuffer.buffer);\n\t\t\t\tconst array = getTypedArray(interleavedBuffer.type, buffer);\n\t\t\t\tconst ib = new InterleavedBuffer(array, interleavedBuffer.stride);\n\t\t\t\tib.uuid = interleavedBuffer.uuid;\n\t\t\t\tinterleavedBufferMap[uuid] = ib;\n\t\t\t\treturn ib;\n\t\t\t}\n\n\t\t\tfunction getArrayBuffer(json, uuid) {\n\t\t\t\tif (arrayBufferMap[uuid] !== undefined) return arrayBufferMap[uuid];\n\t\t\t\tconst arrayBuffers = json.arrayBuffers;\n\t\t\t\tconst arrayBuffer = arrayBuffers[uuid];\n\t\t\t\tconst ab = new Uint32Array(arrayBuffer).buffer;\n\t\t\t\tarrayBufferMap[uuid] = ab;\n\t\t\t\treturn ab;\n\t\t\t}\n\n\t\t\tconst geometry = json.isInstancedBufferGeometry ? new InstancedBufferGeometry() : new BufferGeometry();\n\t\t\tconst index = json.data.index;\n\n\t\t\tif (index !== undefined) {\n\t\t\t\tconst typedArray = getTypedArray(index.type, index.array);\n\t\t\t\tgeometry.setIndex(new BufferAttribute(typedArray, 1));\n\t\t\t}\n\n\t\t\tconst attributes = json.data.attributes;\n\n\t\t\tfor (const key in attributes) {\n\t\t\t\tconst attribute = attributes[key];\n\t\t\t\tlet bufferAttribute;\n\n\t\t\t\tif (attribute.isInterleavedBufferAttribute) {\n\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer(json.data, attribute.data);\n\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized);\n\t\t\t\t} else {\n\t\t\t\t\tconst typedArray = getTypedArray(attribute.type, attribute.array);\n\t\t\t\t\tconst bufferAttributeConstr = attribute.isInstancedBufferAttribute ? InstancedBufferAttribute : BufferAttribute;\n\t\t\t\t\tbufferAttribute = new bufferAttributeConstr(typedArray, attribute.itemSize, attribute.normalized);\n\t\t\t\t}\n\n\t\t\t\tif (attribute.name !== undefined) bufferAttribute.name = attribute.name;\n\t\t\t\tif (attribute.usage !== undefined) bufferAttribute.setUsage(attribute.usage);\n\n\t\t\t\tif (attribute.updateRange !== undefined) {\n\t\t\t\t\tbufferAttribute.updateRange.offset = attribute.updateRange.offset;\n\t\t\t\t\tbufferAttribute.updateRange.count = attribute.updateRange.count;\n\t\t\t\t}\n\n\t\t\t\tgeometry.setAttribute(key, bufferAttribute);\n\t\t\t}\n\n\t\t\tconst morphAttributes = json.data.morphAttributes;\n\n\t\t\tif (morphAttributes) {\n\t\t\t\tfor (const key in morphAttributes) {\n\t\t\t\t\tconst attributeArray = morphAttributes[key];\n\t\t\t\t\tconst array = [];\n\n\t\t\t\t\tfor (let i = 0, il = attributeArray.length; i < il; i++) {\n\t\t\t\t\t\tconst attribute = attributeArray[i];\n\t\t\t\t\t\tlet bufferAttribute;\n\n\t\t\t\t\t\tif (attribute.isInterleavedBufferAttribute) {\n\t\t\t\t\t\t\tconst interleavedBuffer = getInterleavedBuffer(json.data, attribute.data);\n\t\t\t\t\t\t\tbufferAttribute = new InterleavedBufferAttribute(interleavedBuffer, attribute.itemSize, attribute.offset, attribute.normalized);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst typedArray = getTypedArray(attribute.type, attribute.array);\n\t\t\t\t\t\t\tbufferAttribute = new BufferAttribute(typedArray, attribute.itemSize, attribute.normalized);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (attribute.name !== undefined) bufferAttribute.name = attribute.name;\n\t\t\t\t\t\tarray.push(bufferAttribute);\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.morphAttributes[key] = array;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst morphTargetsRelative = json.data.morphTargetsRelative;\n\n\t\t\tif (morphTargetsRelative) {\n\t\t\t\tgeometry.morphTargetsRelative = true;\n\t\t\t}\n\n\t\t\tconst groups = json.data.groups || json.data.drawcalls || json.data.offsets;\n\n\t\t\tif (groups !== undefined) {\n\t\t\t\tfor (let i = 0, n = groups.length; i !== n; ++i) {\n\t\t\t\t\tconst group = groups[i];\n\t\t\t\t\tgeometry.addGroup(group.start, group.count, group.materialIndex);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst boundingSphere = json.data.boundingSphere;\n\n\t\t\tif (boundingSphere !== undefined) {\n\t\t\t\tconst center = new Vector3();\n\n\t\t\t\tif (boundingSphere.center !== undefined) {\n\t\t\t\t\tcenter.fromArray(boundingSphere.center);\n\t\t\t\t}\n\n\t\t\t\tgeometry.boundingSphere = new Sphere(center, boundingSphere.radius);\n\t\t\t}\n\n\t\t\tif (json.name) geometry.name = json.name;\n\t\t\tif (json.userData) geometry.userData = json.userData;\n\t\t\treturn geometry;\n\t\t}\n\n\t}\n\n\tclass ObjectLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst path = this.path === '' ? LoaderUtils.extractUrlBase(url) : this.path;\n\t\t\tthis.resourcePath = this.resourcePath || path;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tloader.load(url, function (text) {\n\t\t\t\tlet json = null;\n\n\t\t\t\ttry {\n\t\t\t\t\tjson = JSON.parse(text);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (onError !== undefined) onError(error);\n\t\t\t\t\tconsole.error('THREE:ObjectLoader: Can\\'t parse ' + url + '.', error.message);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst metadata = json.metadata;\n\n\t\t\t\tif (metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry') {\n\t\t\t\t\tconsole.error('THREE.ObjectLoader: Can\\'t load ' + url);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tscope.parse(json, onLoad);\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t\tasync loadAsync(url, onProgress) {\n\t\t\tconst scope = this;\n\t\t\tconst path = this.path === '' ? LoaderUtils.extractUrlBase(url) : this.path;\n\t\t\tthis.resourcePath = this.resourcePath || path;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tconst text = await loader.loadAsync(url, onProgress);\n\t\t\tconst json = JSON.parse(text);\n\t\t\tconst metadata = json.metadata;\n\n\t\t\tif (metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry') {\n\t\t\t\tthrow new Error('THREE.ObjectLoader: Can\\'t load ' + url);\n\t\t\t}\n\n\t\t\treturn await scope.parseAsync(json);\n\t\t}\n\n\t\tparse(json, onLoad) {\n\t\t\tconst animations = this.parseAnimations(json.animations);\n\t\t\tconst shapes = this.parseShapes(json.shapes);\n\t\t\tconst geometries = this.parseGeometries(json.geometries, shapes);\n\t\t\tconst images = this.parseImages(json.images, function () {\n\t\t\t\tif (onLoad !== undefined) onLoad(object);\n\t\t\t});\n\t\t\tconst textures = this.parseTextures(json.textures, images);\n\t\t\tconst materials = this.parseMaterials(json.materials, textures);\n\t\t\tconst object = this.parseObject(json.object, geometries, materials, textures, animations);\n\t\t\tconst skeletons = this.parseSkeletons(json.skeletons, object);\n\t\t\tthis.bindSkeletons(object, skeletons); //\n\n\t\t\tif (onLoad !== undefined) {\n\t\t\t\tlet hasImages = false;\n\n\t\t\t\tfor (const uuid in images) {\n\t\t\t\t\tif (images[uuid] instanceof HTMLImageElement) {\n\t\t\t\t\t\thasImages = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (hasImages === false) onLoad(object);\n\t\t\t}\n\n\t\t\treturn object;\n\t\t}\n\n\t\tasync parseAsync(json) {\n\t\t\tconst animations = this.parseAnimations(json.animations);\n\t\t\tconst shapes = this.parseShapes(json.shapes);\n\t\t\tconst geometries = this.parseGeometries(json.geometries, shapes);\n\t\t\tconst images = await this.parseImagesAsync(json.images);\n\t\t\tconst textures = this.parseTextures(json.textures, images);\n\t\t\tconst materials = this.parseMaterials(json.materials, textures);\n\t\t\tconst object = this.parseObject(json.object, geometries, materials, textures, animations);\n\t\t\tconst skeletons = this.parseSkeletons(json.skeletons, object);\n\t\t\tthis.bindSkeletons(object, skeletons);\n\t\t\treturn object;\n\t\t}\n\n\t\tparseShapes(json) {\n\t\t\tconst shapes = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst shape = new Shape().fromJSON(json[i]);\n\t\t\t\t\tshapes[shape.uuid] = shape;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn shapes;\n\t\t}\n\n\t\tparseSkeletons(json, object) {\n\t\t\tconst skeletons = {};\n\t\t\tconst bones = {}; // generate bone lookup table\n\n\t\t\tobject.traverse(function (child) {\n\t\t\t\tif (child.isBone) bones[child.uuid] = child;\n\t\t\t}); // create skeletons\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst skeleton = new Skeleton().fromJSON(json[i], bones);\n\t\t\t\t\tskeletons[skeleton.uuid] = skeleton;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn skeletons;\n\t\t}\n\n\t\tparseGeometries(json, shapes) {\n\t\t\tconst geometries = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tconst bufferGeometryLoader = new BufferGeometryLoader();\n\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tlet geometry;\n\t\t\t\t\tconst data = json[i];\n\n\t\t\t\t\tswitch (data.type) {\n\t\t\t\t\t\tcase 'BufferGeometry':\n\t\t\t\t\t\tcase 'InstancedBufferGeometry':\n\t\t\t\t\t\t\tgeometry = bufferGeometryLoader.parse(data);\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'Geometry':\n\t\t\t\t\t\t\tif ('THREE' in window && 'LegacyJSONLoader' in THREE) {\n\t\t\t\t\t\t\t\tvar geometryLoader = new THREE.LegacyJSONLoader();\n\t\t\t\t\t\t\t\tgeometry = geometryLoader.parse(data, this.resourcePath).geometry;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.error('THREE.ObjectLoader: You have to import LegacyJSONLoader in order load geometry data of type \"Geometry\".');\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif (data.type in Geometries) {\n\t\t\t\t\t\t\t\tgeometry = Geometries[data.type].fromJSON(data, shapes);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tconsole.warn(`THREE.ObjectLoader: Unsupported geometry type \"${data.type}\"`);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.uuid = data.uuid;\n\t\t\t\t\tif (data.name !== undefined) geometry.name = data.name;\n\t\t\t\t\tif (geometry.isBufferGeometry === true && data.userData !== undefined) geometry.userData = data.userData;\n\t\t\t\t\tgeometries[data.uuid] = geometry;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn geometries;\n\t\t}\n\n\t\tparseMaterials(json, textures) {\n\t\t\tconst cache = {}; // MultiMaterial\n\n\t\t\tconst materials = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tconst loader = new MaterialLoader();\n\t\t\t\tloader.setTextures(textures);\n\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst data = json[i];\n\n\t\t\t\t\tif (data.type === 'MultiMaterial') {\n\t\t\t\t\t\t// Deprecated\n\t\t\t\t\t\tconst array = [];\n\n\t\t\t\t\t\tfor (let j = 0; j < data.materials.length; j++) {\n\t\t\t\t\t\t\tconst material = data.materials[j];\n\n\t\t\t\t\t\t\tif (cache[material.uuid] === undefined) {\n\t\t\t\t\t\t\t\tcache[material.uuid] = loader.parse(material);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tarray.push(cache[material.uuid]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterials[data.uuid] = array;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (cache[data.uuid] === undefined) {\n\t\t\t\t\t\t\tcache[data.uuid] = loader.parse(data);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tmaterials[data.uuid] = cache[data.uuid];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn materials;\n\t\t}\n\n\t\tparseAnimations(json) {\n\t\t\tconst animations = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0; i < json.length; i++) {\n\t\t\t\t\tconst data = json[i];\n\t\t\t\t\tconst clip = AnimationClip.parse(data);\n\t\t\t\t\tanimations[clip.uuid] = clip;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn animations;\n\t\t}\n\n\t\tparseImages(json, onLoad) {\n\t\t\tconst scope = this;\n\t\t\tconst images = {};\n\t\t\tlet loader;\n\n\t\t\tfunction loadImage(url) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\treturn loader.load(url, function () {\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, undefined, function () {\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction deserializeImage(image) {\n\t\t\t\tif (typeof image === 'string') {\n\t\t\t\t\tconst url = image;\n\t\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(url) ? url : scope.resourcePath + url;\n\t\t\t\t\treturn loadImage(path);\n\t\t\t\t} else {\n\t\t\t\t\tif (image.data) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: getTypedArray(image.type, image.data),\n\t\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\t\theight: image.height\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (json !== undefined && json.length > 0) {\n\t\t\t\tconst manager = new LoadingManager(onLoad);\n\t\t\t\tloader = new ImageLoader(manager);\n\t\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\n\t\t\t\tfor (let i = 0, il = json.length; i < il; i++) {\n\t\t\t\t\tconst image = json[i];\n\t\t\t\t\tconst url = image.url;\n\n\t\t\t\t\tif (Array.isArray(url)) {\n\t\t\t\t\t\t// load array of images e.g CubeTexture\n\t\t\t\t\t\timages[image.uuid] = [];\n\n\t\t\t\t\t\tfor (let j = 0, jl = url.length; j < jl; j++) {\n\t\t\t\t\t\t\tconst currentUrl = url[j];\n\t\t\t\t\t\t\tconst deserializedImage = deserializeImage(currentUrl);\n\n\t\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\t\tif (deserializedImage instanceof HTMLImageElement) {\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(deserializedImage);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// load single image\n\t\t\t\t\t\tconst deserializedImage = deserializeImage(image.url);\n\n\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\timages[image.uuid] = deserializedImage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn images;\n\t\t}\n\n\t\tasync parseImagesAsync(json) {\n\t\t\tconst scope = this;\n\t\t\tconst images = {};\n\t\t\tlet loader;\n\n\t\t\tasync function deserializeImage(image) {\n\t\t\t\tif (typeof image === 'string') {\n\t\t\t\t\tconst url = image;\n\t\t\t\t\tconst path = /^(\\/\\/)|([a-z]+:(\\/\\/)?)/i.test(url) ? url : scope.resourcePath + url;\n\t\t\t\t\treturn await loader.loadAsync(path);\n\t\t\t\t} else {\n\t\t\t\t\tif (image.data) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdata: getTypedArray(image.type, image.data),\n\t\t\t\t\t\t\twidth: image.width,\n\t\t\t\t\t\t\theight: image.height\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (json !== undefined && json.length > 0) {\n\t\t\t\tloader = new ImageLoader(this.manager);\n\t\t\t\tloader.setCrossOrigin(this.crossOrigin);\n\n\t\t\t\tfor (let i = 0, il = json.length; i < il; i++) {\n\t\t\t\t\tconst image = json[i];\n\t\t\t\t\tconst url = image.url;\n\n\t\t\t\t\tif (Array.isArray(url)) {\n\t\t\t\t\t\t// load array of images e.g CubeTexture\n\t\t\t\t\t\timages[image.uuid] = [];\n\n\t\t\t\t\t\tfor (let j = 0, jl = url.length; j < jl; j++) {\n\t\t\t\t\t\t\tconst currentUrl = url[j];\n\t\t\t\t\t\t\tconst deserializedImage = await deserializeImage(currentUrl);\n\n\t\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\t\tif (deserializedImage instanceof HTMLImageElement) {\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(deserializedImage);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t// special case: handle array of data textures for cube textures\n\t\t\t\t\t\t\t\t\timages[image.uuid].push(new DataTexture(deserializedImage.data, deserializedImage.width, deserializedImage.height));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// load single image\n\t\t\t\t\t\tconst deserializedImage = await deserializeImage(image.url);\n\n\t\t\t\t\t\tif (deserializedImage !== null) {\n\t\t\t\t\t\t\timages[image.uuid] = deserializedImage;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn images;\n\t\t}\n\n\t\tparseTextures(json, images) {\n\t\t\tfunction parseConstant(value, type) {\n\t\t\t\tif (typeof value === 'number') return value;\n\t\t\t\tconsole.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value);\n\t\t\t\treturn type[value];\n\t\t\t}\n\n\t\t\tconst textures = {};\n\n\t\t\tif (json !== undefined) {\n\t\t\t\tfor (let i = 0, l = json.length; i < l; i++) {\n\t\t\t\t\tconst data = json[i];\n\n\t\t\t\t\tif (data.image === undefined) {\n\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: No \"image\" specified for', data.uuid);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (images[data.image] === undefined) {\n\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined image', data.image);\n\t\t\t\t\t}\n\n\t\t\t\t\tlet texture;\n\t\t\t\t\tconst image = images[data.image];\n\n\t\t\t\t\tif (Array.isArray(image)) {\n\t\t\t\t\t\ttexture = new CubeTexture(image);\n\t\t\t\t\t\tif (image.length === 6) texture.needsUpdate = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (image && image.data) {\n\t\t\t\t\t\t\ttexture = new DataTexture(image.data, image.width, image.height);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttexture = new Texture(image);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (image) texture.needsUpdate = true; // textures can have undefined image data\n\t\t\t\t\t}\n\n\t\t\t\t\ttexture.uuid = data.uuid;\n\t\t\t\t\tif (data.name !== undefined) texture.name = data.name;\n\t\t\t\t\tif (data.mapping !== undefined) texture.mapping = parseConstant(data.mapping, TEXTURE_MAPPING);\n\t\t\t\t\tif (data.offset !== undefined) texture.offset.fromArray(data.offset);\n\t\t\t\t\tif (data.repeat !== undefined) texture.repeat.fromArray(data.repeat);\n\t\t\t\t\tif (data.center !== undefined) texture.center.fromArray(data.center);\n\t\t\t\t\tif (data.rotation !== undefined) texture.rotation = data.rotation;\n\n\t\t\t\t\tif (data.wrap !== undefined) {\n\t\t\t\t\t\ttexture.wrapS = parseConstant(data.wrap[0], TEXTURE_WRAPPING);\n\t\t\t\t\t\ttexture.wrapT = parseConstant(data.wrap[1], TEXTURE_WRAPPING);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.format !== undefined) texture.format = data.format;\n\t\t\t\t\tif (data.type !== undefined) texture.type = data.type;\n\t\t\t\t\tif (data.encoding !== undefined) texture.encoding = data.encoding;\n\t\t\t\t\tif (data.minFilter !== undefined) texture.minFilter = parseConstant(data.minFilter, TEXTURE_FILTER);\n\t\t\t\t\tif (data.magFilter !== undefined) texture.magFilter = parseConstant(data.magFilter, TEXTURE_FILTER);\n\t\t\t\t\tif (data.anisotropy !== undefined) texture.anisotropy = data.anisotropy;\n\t\t\t\t\tif (data.flipY !== undefined) texture.flipY = data.flipY;\n\t\t\t\t\tif (data.premultiplyAlpha !== undefined) texture.premultiplyAlpha = data.premultiplyAlpha;\n\t\t\t\t\tif (data.unpackAlignment !== undefined) texture.unpackAlignment = data.unpackAlignment;\n\t\t\t\t\ttextures[data.uuid] = texture;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn textures;\n\t\t}\n\n\t\tparseObject(data, geometries, materials, textures, animations) {\n\t\t\tlet object;\n\n\t\t\tfunction getGeometry(name) {\n\t\t\t\tif (geometries[name] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined geometry', name);\n\t\t\t\t}\n\n\t\t\t\treturn geometries[name];\n\t\t\t}\n\n\t\t\tfunction getMaterial(name) {\n\t\t\t\tif (name === undefined) return undefined;\n\n\t\t\t\tif (Array.isArray(name)) {\n\t\t\t\t\tconst array = [];\n\n\t\t\t\t\tfor (let i = 0, l = name.length; i < l; i++) {\n\t\t\t\t\t\tconst uuid = name[i];\n\n\t\t\t\t\t\tif (materials[uuid] === undefined) {\n\t\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined material', uuid);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tarray.push(materials[uuid]);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn array;\n\t\t\t\t}\n\n\t\t\t\tif (materials[name] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined material', name);\n\t\t\t\t}\n\n\t\t\t\treturn materials[name];\n\t\t\t}\n\n\t\t\tfunction getTexture(uuid) {\n\t\t\t\tif (textures[uuid] === undefined) {\n\t\t\t\t\tconsole.warn('THREE.ObjectLoader: Undefined texture', uuid);\n\t\t\t\t}\n\n\t\t\t\treturn textures[uuid];\n\t\t\t}\n\n\t\t\tlet geometry, material;\n\n\t\t\tswitch (data.type) {\n\t\t\t\tcase 'Scene':\n\t\t\t\t\tobject = new Scene();\n\n\t\t\t\t\tif (data.background !== undefined) {\n\t\t\t\t\t\tif (Number.isInteger(data.background)) {\n\t\t\t\t\t\t\tobject.background = new Color(data.background);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tobject.background = getTexture(data.background);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.environment !== undefined) {\n\t\t\t\t\t\tobject.environment = getTexture(data.environment);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (data.fog !== undefined) {\n\t\t\t\t\t\tif (data.fog.type === 'Fog') {\n\t\t\t\t\t\t\tobject.fog = new Fog(data.fog.color, data.fog.near, data.fog.far);\n\t\t\t\t\t\t} else if (data.fog.type === 'FogExp2') {\n\t\t\t\t\t\t\tobject.fog = new FogExp2(data.fog.color, data.fog.density);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PerspectiveCamera':\n\t\t\t\t\tobject = new PerspectiveCamera(data.fov, data.aspect, data.near, data.far);\n\t\t\t\t\tif (data.focus !== undefined) object.focus = data.focus;\n\t\t\t\t\tif (data.zoom !== undefined) object.zoom = data.zoom;\n\t\t\t\t\tif (data.filmGauge !== undefined) object.filmGauge = data.filmGauge;\n\t\t\t\t\tif (data.filmOffset !== undefined) object.filmOffset = data.filmOffset;\n\t\t\t\t\tif (data.view !== undefined) object.view = Object.assign({}, data.view);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'OrthographicCamera':\n\t\t\t\t\tobject = new OrthographicCamera(data.left, data.right, data.top, data.bottom, data.near, data.far);\n\t\t\t\t\tif (data.zoom !== undefined) object.zoom = data.zoom;\n\t\t\t\t\tif (data.view !== undefined) object.view = Object.assign({}, data.view);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'AmbientLight':\n\t\t\t\t\tobject = new AmbientLight(data.color, data.intensity);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'DirectionalLight':\n\t\t\t\t\tobject = new DirectionalLight(data.color, data.intensity);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointLight':\n\t\t\t\t\tobject = new PointLight(data.color, data.intensity, data.distance, data.decay);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'RectAreaLight':\n\t\t\t\t\tobject = new RectAreaLight(data.color, data.intensity, data.width, data.height);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SpotLight':\n\t\t\t\t\tobject = new SpotLight(data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'HemisphereLight':\n\t\t\t\t\tobject = new HemisphereLight(data.color, data.groundColor, data.intensity);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LightProbe':\n\t\t\t\t\tobject = new LightProbe().fromJSON(data);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'SkinnedMesh':\n\t\t\t\t\tgeometry = getGeometry(data.geometry);\n\t\t\t\t\tmaterial = getMaterial(data.material);\n\t\t\t\t\tobject = new SkinnedMesh(geometry, material);\n\t\t\t\t\tif (data.bindMode !== undefined) object.bindMode = data.bindMode;\n\t\t\t\t\tif (data.bindMatrix !== undefined) object.bindMatrix.fromArray(data.bindMatrix);\n\t\t\t\t\tif (data.skeleton !== undefined) object.skeleton = data.skeleton;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Mesh':\n\t\t\t\t\tgeometry = getGeometry(data.geometry);\n\t\t\t\t\tmaterial = getMaterial(data.material);\n\t\t\t\t\tobject = new Mesh(geometry, material);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'InstancedMesh':\n\t\t\t\t\tgeometry = getGeometry(data.geometry);\n\t\t\t\t\tmaterial = getMaterial(data.material);\n\t\t\t\t\tconst count = data.count;\n\t\t\t\t\tconst instanceMatrix = data.instanceMatrix;\n\t\t\t\t\tconst instanceColor = data.instanceColor;\n\t\t\t\t\tobject = new InstancedMesh(geometry, material, count);\n\t\t\t\t\tobject.instanceMatrix = new InstancedBufferAttribute(new Float32Array(instanceMatrix.array), 16);\n\t\t\t\t\tif (instanceColor !== undefined) object.instanceColor = new InstancedBufferAttribute(new Float32Array(instanceColor.array), instanceColor.itemSize);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LOD':\n\t\t\t\t\tobject = new LOD();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Line':\n\t\t\t\t\tobject = new Line(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LineLoop':\n\t\t\t\t\tobject = new LineLoop(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'LineSegments':\n\t\t\t\t\tobject = new LineSegments(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'PointCloud':\n\t\t\t\tcase 'Points':\n\t\t\t\t\tobject = new Points(getGeometry(data.geometry), getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Sprite':\n\t\t\t\t\tobject = new Sprite(getMaterial(data.material));\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Group':\n\t\t\t\t\tobject = new Group();\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'Bone':\n\t\t\t\t\tobject = new Bone();\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tobject = new Object3D();\n\t\t\t}\n\n\t\t\tobject.uuid = data.uuid;\n\t\t\tif (data.name !== undefined) object.name = data.name;\n\n\t\t\tif (data.matrix !== undefined) {\n\t\t\t\tobject.matrix.fromArray(data.matrix);\n\t\t\t\tif (data.matrixAutoUpdate !== undefined) object.matrixAutoUpdate = data.matrixAutoUpdate;\n\t\t\t\tif (object.matrixAutoUpdate) object.matrix.decompose(object.position, object.quaternion, object.scale);\n\t\t\t} else {\n\t\t\t\tif (data.position !== undefined) object.position.fromArray(data.position);\n\t\t\t\tif (data.rotation !== undefined) object.rotation.fromArray(data.rotation);\n\t\t\t\tif (data.quaternion !== undefined) object.quaternion.fromArray(data.quaternion);\n\t\t\t\tif (data.scale !== undefined) object.scale.fromArray(data.scale);\n\t\t\t}\n\n\t\t\tif (data.castShadow !== undefined) object.castShadow = data.castShadow;\n\t\t\tif (data.receiveShadow !== undefined) object.receiveShadow = data.receiveShadow;\n\n\t\t\tif (data.shadow) {\n\t\t\t\tif (data.shadow.bias !== undefined) object.shadow.bias = data.shadow.bias;\n\t\t\t\tif (data.shadow.normalBias !== undefined) object.shadow.normalBias = data.shadow.normalBias;\n\t\t\t\tif (data.shadow.radius !== undefined) object.shadow.radius = data.shadow.radius;\n\t\t\t\tif (data.shadow.mapSize !== undefined) object.shadow.mapSize.fromArray(data.shadow.mapSize);\n\t\t\t\tif (data.shadow.camera !== undefined) object.shadow.camera = this.parseObject(data.shadow.camera);\n\t\t\t}\n\n\t\t\tif (data.visible !== undefined) object.visible = data.visible;\n\t\t\tif (data.frustumCulled !== undefined) object.frustumCulled = data.frustumCulled;\n\t\t\tif (data.renderOrder !== undefined) object.renderOrder = data.renderOrder;\n\t\t\tif (data.userData !== undefined) object.userData = data.userData;\n\t\t\tif (data.layers !== undefined) object.layers.mask = data.layers;\n\n\t\t\tif (data.children !== undefined) {\n\t\t\t\tconst children = data.children;\n\n\t\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\t\tobject.add(this.parseObject(children[i], geometries, materials, textures, animations));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (data.animations !== undefined) {\n\t\t\t\tconst objectAnimations = data.animations;\n\n\t\t\t\tfor (let i = 0; i < objectAnimations.length; i++) {\n\t\t\t\t\tconst uuid = objectAnimations[i];\n\t\t\t\t\tobject.animations.push(animations[uuid]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (data.type === 'LOD') {\n\t\t\t\tif (data.autoUpdate !== undefined) object.autoUpdate = data.autoUpdate;\n\t\t\t\tconst levels = data.levels;\n\n\t\t\t\tfor (let l = 0; l < levels.length; l++) {\n\t\t\t\t\tconst level = levels[l];\n\t\t\t\t\tconst child = object.getObjectByProperty('uuid', level.object);\n\n\t\t\t\t\tif (child !== undefined) {\n\t\t\t\t\t\tobject.addLevel(child, level.distance);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn object;\n\t\t}\n\n\t\tbindSkeletons(object, skeletons) {\n\t\t\tif (Object.keys(skeletons).length === 0) return;\n\t\t\tobject.traverse(function (child) {\n\t\t\t\tif (child.isSkinnedMesh === true && child.skeleton !== undefined) {\n\t\t\t\t\tconst skeleton = skeletons[child.skeleton];\n\n\t\t\t\t\tif (skeleton === undefined) {\n\t\t\t\t\t\tconsole.warn('THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.bind(skeleton, child.bindMatrix);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t/* DEPRECATED */\n\n\n\t\tsetTexturePath(value) {\n\t\t\tconsole.warn('THREE.ObjectLoader: .setTexturePath() has been renamed to .setResourcePath().');\n\t\t\treturn this.setResourcePath(value);\n\t\t}\n\n\t}\n\n\tconst TEXTURE_MAPPING = {\n\t\tUVMapping: UVMapping,\n\t\tCubeReflectionMapping: CubeReflectionMapping,\n\t\tCubeRefractionMapping: CubeRefractionMapping,\n\t\tEquirectangularReflectionMapping: EquirectangularReflectionMapping,\n\t\tEquirectangularRefractionMapping: EquirectangularRefractionMapping,\n\t\tCubeUVReflectionMapping: CubeUVReflectionMapping,\n\t\tCubeUVRefractionMapping: CubeUVRefractionMapping\n\t};\n\tconst TEXTURE_WRAPPING = {\n\t\tRepeatWrapping: RepeatWrapping,\n\t\tClampToEdgeWrapping: ClampToEdgeWrapping,\n\t\tMirroredRepeatWrapping: MirroredRepeatWrapping\n\t};\n\tconst TEXTURE_FILTER = {\n\t\tNearestFilter: NearestFilter,\n\t\tNearestMipmapNearestFilter: NearestMipmapNearestFilter,\n\t\tNearestMipmapLinearFilter: NearestMipmapLinearFilter,\n\t\tLinearFilter: LinearFilter,\n\t\tLinearMipmapNearestFilter: LinearMipmapNearestFilter,\n\t\tLinearMipmapLinearFilter: LinearMipmapLinearFilter\n\t};\n\n\tclass ImageBitmapLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\n\t\t\tif (typeof createImageBitmap === 'undefined') {\n\t\t\t\tconsole.warn('THREE.ImageBitmapLoader: createImageBitmap() not supported.');\n\t\t\t}\n\n\t\t\tif (typeof fetch === 'undefined') {\n\t\t\t\tconsole.warn('THREE.ImageBitmapLoader: fetch() not supported.');\n\t\t\t}\n\n\t\t\tthis.options = {\n\t\t\t\tpremultiplyAlpha: 'none'\n\t\t\t};\n\t\t}\n\n\t\tsetOptions(options) {\n\t\t\tthis.options = options;\n\t\t\treturn this;\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tif (url === undefined) url = '';\n\t\t\tif (this.path !== undefined) url = this.path + url;\n\t\t\turl = this.manager.resolveURL(url);\n\t\t\tconst scope = this;\n\t\t\tconst cached = Cache.get(url);\n\n\t\t\tif (cached !== undefined) {\n\t\t\t\tscope.manager.itemStart(url);\n\t\t\t\tsetTimeout(function () {\n\t\t\t\t\tif (onLoad) onLoad(cached);\n\t\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t\t}, 0);\n\t\t\t\treturn cached;\n\t\t\t}\n\n\t\t\tconst fetchOptions = {};\n\t\t\tfetchOptions.credentials = this.crossOrigin === 'anonymous' ? 'same-origin' : 'include';\n\t\t\tfetchOptions.headers = this.requestHeader;\n\t\t\tfetch(url, fetchOptions).then(function (res) {\n\t\t\t\treturn res.blob();\n\t\t\t}).then(function (blob) {\n\t\t\t\treturn createImageBitmap(blob, Object.assign(scope.options, {\n\t\t\t\t\tcolorSpaceConversion: 'none'\n\t\t\t\t}));\n\t\t\t}).then(function (imageBitmap) {\n\t\t\t\tCache.add(url, imageBitmap);\n\t\t\t\tif (onLoad) onLoad(imageBitmap);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t}).catch(function (e) {\n\t\t\t\tif (onError) onError(e);\n\t\t\t\tscope.manager.itemError(url);\n\t\t\t\tscope.manager.itemEnd(url);\n\t\t\t});\n\t\t\tscope.manager.itemStart(url);\n\t\t}\n\n\t}\n\n\tImageBitmapLoader.prototype.isImageBitmapLoader = true;\n\n\tlet _context;\n\n\tconst AudioContext = {\n\t\tgetContext: function () {\n\t\t\tif (_context === undefined) {\n\t\t\t\t_context = new (window.AudioContext || window.webkitAudioContext)();\n\t\t\t}\n\n\t\t\treturn _context;\n\t\t},\n\t\tsetContext: function (value) {\n\t\t\t_context = value;\n\t\t}\n\t};\n\n\tclass AudioLoader extends Loader {\n\t\tconstructor(manager) {\n\t\t\tsuper(manager);\n\t\t}\n\n\t\tload(url, onLoad, onProgress, onError) {\n\t\t\tconst scope = this;\n\t\t\tconst loader = new FileLoader(this.manager);\n\t\t\tloader.setResponseType('arraybuffer');\n\t\t\tloader.setPath(this.path);\n\t\t\tloader.setRequestHeader(this.requestHeader);\n\t\t\tloader.setWithCredentials(this.withCredentials);\n\t\t\tloader.load(url, function (buffer) {\n\t\t\t\ttry {\n\t\t\t\t\t// Create a copy of the buffer. The `decodeAudioData` method\n\t\t\t\t\t// detaches the buffer when complete, preventing reuse.\n\t\t\t\t\tconst bufferCopy = buffer.slice(0);\n\t\t\t\t\tconst context = AudioContext.getContext();\n\t\t\t\t\tcontext.decodeAudioData(bufferCopy, function (audioBuffer) {\n\t\t\t\t\t\tonLoad(audioBuffer);\n\t\t\t\t\t});\n\t\t\t\t} catch (e) {\n\t\t\t\t\tif (onError) {\n\t\t\t\t\t\tonError(e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error(e);\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError(url);\n\t\t\t\t}\n\t\t\t}, onProgress, onError);\n\t\t}\n\n\t}\n\n\tclass HemisphereLightProbe extends LightProbe {\n\t\tconstructor(skyColor, groundColor, intensity = 1) {\n\t\t\tsuper(undefined, intensity);\n\t\t\tconst color1 = new Color().set(skyColor);\n\t\t\tconst color2 = new Color().set(groundColor);\n\t\t\tconst sky = new Vector3(color1.r, color1.g, color1.b);\n\t\t\tconst ground = new Vector3(color2.r, color2.g, color2.b); // without extra factor of PI in the shader, should = 1 / Math.sqrt( Math.PI );\n\n\t\t\tconst c0 = Math.sqrt(Math.PI);\n\t\t\tconst c1 = c0 * Math.sqrt(0.75);\n\t\t\tthis.sh.coefficients[0].copy(sky).add(ground).multiplyScalar(c0);\n\t\t\tthis.sh.coefficients[1].copy(sky).sub(ground).multiplyScalar(c1);\n\t\t}\n\n\t}\n\n\tHemisphereLightProbe.prototype.isHemisphereLightProbe = true;\n\n\tclass AmbientLightProbe extends LightProbe {\n\t\tconstructor(color, intensity = 1) {\n\t\t\tsuper(undefined, intensity);\n\t\t\tconst color1 = new Color().set(color); // without extra factor of PI in the shader, would be 2 / Math.sqrt( Math.PI );\n\n\t\t\tthis.sh.coefficients[0].set(color1.r, color1.g, color1.b).multiplyScalar(2 * Math.sqrt(Math.PI));\n\t\t}\n\n\t}\n\n\tAmbientLightProbe.prototype.isAmbientLightProbe = true;\n\n\tconst _eyeRight = /*@__PURE__*/new Matrix4();\n\n\tconst _eyeLeft = /*@__PURE__*/new Matrix4();\n\n\tclass StereoCamera {\n\t\tconstructor() {\n\t\t\tthis.type = 'StereoCamera';\n\t\t\tthis.aspect = 1;\n\t\t\tthis.eyeSep = 0.064;\n\t\t\tthis.cameraL = new PerspectiveCamera();\n\t\t\tthis.cameraL.layers.enable(1);\n\t\t\tthis.cameraL.matrixAutoUpdate = false;\n\t\t\tthis.cameraR = new PerspectiveCamera();\n\t\t\tthis.cameraR.layers.enable(2);\n\t\t\tthis.cameraR.matrixAutoUpdate = false;\n\t\t\tthis._cache = {\n\t\t\t\tfocus: null,\n\t\t\t\tfov: null,\n\t\t\t\taspect: null,\n\t\t\t\tnear: null,\n\t\t\t\tfar: null,\n\t\t\t\tzoom: null,\n\t\t\t\teyeSep: null\n\t\t\t};\n\t\t}\n\n\t\tupdate(camera) {\n\t\t\tconst cache = this._cache;\n\t\t\tconst needsUpdate = cache.focus !== camera.focus || cache.fov !== camera.fov || cache.aspect !== camera.aspect * this.aspect || cache.near !== camera.near || cache.far !== camera.far || cache.zoom !== camera.zoom || cache.eyeSep !== this.eyeSep;\n\n\t\t\tif (needsUpdate) {\n\t\t\t\tcache.focus = camera.focus;\n\t\t\t\tcache.fov = camera.fov;\n\t\t\t\tcache.aspect = camera.aspect * this.aspect;\n\t\t\t\tcache.near = camera.near;\n\t\t\t\tcache.far = camera.far;\n\t\t\t\tcache.zoom = camera.zoom;\n\t\t\t\tcache.eyeSep = this.eyeSep; // Off-axis stereoscopic effect based on\n\t\t\t\t// http://paulbourke.net/stereographics/stereorender/\n\n\t\t\t\tconst projectionMatrix = camera.projectionMatrix.clone();\n\t\t\t\tconst eyeSepHalf = cache.eyeSep / 2;\n\t\t\t\tconst eyeSepOnProjection = eyeSepHalf * cache.near / cache.focus;\n\t\t\t\tconst ymax = cache.near * Math.tan(DEG2RAD * cache.fov * 0.5) / cache.zoom;\n\t\t\t\tlet xmin, xmax; // translate xOffset\n\n\t\t\t\t_eyeLeft.elements[12] = -eyeSepHalf;\n\t\t\t\t_eyeRight.elements[12] = eyeSepHalf; // for left eye\n\n\t\t\t\txmin = -ymax * cache.aspect + eyeSepOnProjection;\n\t\t\t\txmax = ymax * cache.aspect + eyeSepOnProjection;\n\t\t\t\tprojectionMatrix.elements[0] = 2 * cache.near / (xmax - xmin);\n\t\t\t\tprojectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin);\n\t\t\t\tthis.cameraL.projectionMatrix.copy(projectionMatrix); // for right eye\n\n\t\t\t\txmin = -ymax * cache.aspect - eyeSepOnProjection;\n\t\t\t\txmax = ymax * cache.aspect - eyeSepOnProjection;\n\t\t\t\tprojectionMatrix.elements[0] = 2 * cache.near / (xmax - xmin);\n\t\t\t\tprojectionMatrix.elements[8] = (xmax + xmin) / (xmax - xmin);\n\t\t\t\tthis.cameraR.projectionMatrix.copy(projectionMatrix);\n\t\t\t}\n\n\t\t\tthis.cameraL.matrixWorld.copy(camera.matrixWorld).multiply(_eyeLeft);\n\t\t\tthis.cameraR.matrixWorld.copy(camera.matrixWorld).multiply(_eyeRight);\n\t\t}\n\n\t}\n\n\tclass Clock {\n\t\tconstructor(autoStart = true) {\n\t\t\tthis.autoStart = autoStart;\n\t\t\tthis.startTime = 0;\n\t\t\tthis.oldTime = 0;\n\t\t\tthis.elapsedTime = 0;\n\t\t\tthis.running = false;\n\t\t}\n\n\t\tstart() {\n\t\t\tthis.startTime = now();\n\t\t\tthis.oldTime = this.startTime;\n\t\t\tthis.elapsedTime = 0;\n\t\t\tthis.running = true;\n\t\t}\n\n\t\tstop() {\n\t\t\tthis.getElapsedTime();\n\t\t\tthis.running = false;\n\t\t\tthis.autoStart = false;\n\t\t}\n\n\t\tgetElapsedTime() {\n\t\t\tthis.getDelta();\n\t\t\treturn this.elapsedTime;\n\t\t}\n\n\t\tgetDelta() {\n\t\t\tlet diff = 0;\n\n\t\t\tif (this.autoStart && !this.running) {\n\t\t\t\tthis.start();\n\t\t\t\treturn 0;\n\t\t\t}\n\n\t\t\tif (this.running) {\n\t\t\t\tconst newTime = now();\n\t\t\t\tdiff = (newTime - this.oldTime) / 1000;\n\t\t\t\tthis.oldTime = newTime;\n\t\t\t\tthis.elapsedTime += diff;\n\t\t\t}\n\n\t\t\treturn diff;\n\t\t}\n\n\t}\n\n\tfunction now() {\n\t\treturn (typeof performance === 'undefined' ? Date : performance).now(); // see #10732\n\t}\n\n\tconst _position$1 = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion$1 = /*@__PURE__*/new Quaternion();\n\n\tconst _scale$1 = /*@__PURE__*/new Vector3();\n\n\tconst _orientation$1 = /*@__PURE__*/new Vector3();\n\n\tclass AudioListener extends Object3D {\n\t\tconstructor() {\n\t\t\tsuper();\n\t\t\tthis.type = 'AudioListener';\n\t\t\tthis.context = AudioContext.getContext();\n\t\t\tthis.gain = this.context.createGain();\n\t\t\tthis.gain.connect(this.context.destination);\n\t\t\tthis.filter = null;\n\t\t\tthis.timeDelta = 0; // private\n\n\t\t\tthis._clock = new Clock();\n\t\t}\n\n\t\tgetInput() {\n\t\t\treturn this.gain;\n\t\t}\n\n\t\tremoveFilter() {\n\t\t\tif (this.filter !== null) {\n\t\t\t\tthis.gain.disconnect(this.filter);\n\t\t\t\tthis.filter.disconnect(this.context.destination);\n\t\t\t\tthis.gain.connect(this.context.destination);\n\t\t\t\tthis.filter = null;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetFilter() {\n\t\t\treturn this.filter;\n\t\t}\n\n\t\tsetFilter(value) {\n\t\t\tif (this.filter !== null) {\n\t\t\t\tthis.gain.disconnect(this.filter);\n\t\t\t\tthis.filter.disconnect(this.context.destination);\n\t\t\t} else {\n\t\t\t\tthis.gain.disconnect(this.context.destination);\n\t\t\t}\n\n\t\t\tthis.filter = value;\n\t\t\tthis.gain.connect(this.filter);\n\t\t\tthis.filter.connect(this.context.destination);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetMasterVolume() {\n\t\t\treturn this.gain.gain.value;\n\t\t}\n\n\t\tsetMasterVolume(value) {\n\t\t\tthis.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01);\n\t\t\treturn this;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t\tconst listener = this.context.listener;\n\t\t\tconst up = this.up;\n\t\t\tthis.timeDelta = this._clock.getDelta();\n\t\t\tthis.matrixWorld.decompose(_position$1, _quaternion$1, _scale$1);\n\n\t\t\t_orientation$1.set(0, 0, -1).applyQuaternion(_quaternion$1);\n\n\t\t\tif (listener.positionX) {\n\t\t\t\t// code path for Chrome (see #14393)\n\t\t\t\tconst endTime = this.context.currentTime + this.timeDelta;\n\t\t\t\tlistener.positionX.linearRampToValueAtTime(_position$1.x, endTime);\n\t\t\t\tlistener.positionY.linearRampToValueAtTime(_position$1.y, endTime);\n\t\t\t\tlistener.positionZ.linearRampToValueAtTime(_position$1.z, endTime);\n\t\t\t\tlistener.forwardX.linearRampToValueAtTime(_orientation$1.x, endTime);\n\t\t\t\tlistener.forwardY.linearRampToValueAtTime(_orientation$1.y, endTime);\n\t\t\t\tlistener.forwardZ.linearRampToValueAtTime(_orientation$1.z, endTime);\n\t\t\t\tlistener.upX.linearRampToValueAtTime(up.x, endTime);\n\t\t\t\tlistener.upY.linearRampToValueAtTime(up.y, endTime);\n\t\t\t\tlistener.upZ.linearRampToValueAtTime(up.z, endTime);\n\t\t\t} else {\n\t\t\t\tlistener.setPosition(_position$1.x, _position$1.y, _position$1.z);\n\t\t\t\tlistener.setOrientation(_orientation$1.x, _orientation$1.y, _orientation$1.z, up.x, up.y, up.z);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tclass Audio extends Object3D {\n\t\tconstructor(listener) {\n\t\t\tsuper();\n\t\t\tthis.type = 'Audio';\n\t\t\tthis.listener = listener;\n\t\t\tthis.context = listener.context;\n\t\t\tthis.gain = this.context.createGain();\n\t\t\tthis.gain.connect(listener.getInput());\n\t\t\tthis.autoplay = false;\n\t\t\tthis.buffer = null;\n\t\t\tthis.detune = 0;\n\t\t\tthis.loop = false;\n\t\t\tthis.loopStart = 0;\n\t\t\tthis.loopEnd = 0;\n\t\t\tthis.offset = 0;\n\t\t\tthis.duration = undefined;\n\t\t\tthis.playbackRate = 1;\n\t\t\tthis.isPlaying = false;\n\t\t\tthis.hasPlaybackControl = true;\n\t\t\tthis.source = null;\n\t\t\tthis.sourceType = 'empty';\n\t\t\tthis._startedAt = 0;\n\t\t\tthis._progress = 0;\n\t\t\tthis._connected = false;\n\t\t\tthis.filters = [];\n\t\t}\n\n\t\tgetOutput() {\n\t\t\treturn this.gain;\n\t\t}\n\n\t\tsetNodeSource(audioNode) {\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'audioNode';\n\t\t\tthis.source = audioNode;\n\t\t\tthis.connect();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetMediaElementSource(mediaElement) {\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'mediaNode';\n\t\t\tthis.source = this.context.createMediaElementSource(mediaElement);\n\t\t\tthis.connect();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetMediaStreamSource(mediaStream) {\n\t\t\tthis.hasPlaybackControl = false;\n\t\t\tthis.sourceType = 'mediaStreamNode';\n\t\t\tthis.source = this.context.createMediaStreamSource(mediaStream);\n\t\t\tthis.connect();\n\t\t\treturn this;\n\t\t}\n\n\t\tsetBuffer(audioBuffer) {\n\t\t\tthis.buffer = audioBuffer;\n\t\t\tthis.sourceType = 'buffer';\n\t\t\tif (this.autoplay) this.play();\n\t\t\treturn this;\n\t\t}\n\n\t\tplay(delay = 0) {\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tconsole.warn('THREE.Audio: Audio is already playing.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._startedAt = this.context.currentTime + delay;\n\t\t\tconst source = this.context.createBufferSource();\n\t\t\tsource.buffer = this.buffer;\n\t\t\tsource.loop = this.loop;\n\t\t\tsource.loopStart = this.loopStart;\n\t\t\tsource.loopEnd = this.loopEnd;\n\t\t\tsource.onended = this.onEnded.bind(this);\n\t\t\tsource.start(this._startedAt, this._progress + this.offset, this.duration);\n\t\t\tthis.isPlaying = true;\n\t\t\tthis.source = source;\n\t\t\tthis.setDetune(this.detune);\n\t\t\tthis.setPlaybackRate(this.playbackRate);\n\t\t\treturn this.connect();\n\t\t}\n\n\t\tpause() {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\t// update current progress\n\t\t\t\tthis._progress += Math.max(this.context.currentTime - this._startedAt, 0) * this.playbackRate;\n\n\t\t\t\tif (this.loop === true) {\n\t\t\t\t\t// ensure _progress does not exceed duration with looped audios\n\t\t\t\t\tthis._progress = this._progress % (this.duration || this.buffer.duration);\n\t\t\t\t}\n\n\t\t\t\tthis.source.stop();\n\t\t\t\tthis.source.onended = null;\n\t\t\t\tthis.isPlaying = false;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tstop() {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._progress = 0;\n\t\t\tthis.source.stop();\n\t\t\tthis.source.onended = null;\n\t\t\tthis.isPlaying = false;\n\t\t\treturn this;\n\t\t}\n\n\t\tconnect() {\n\t\t\tif (this.filters.length > 0) {\n\t\t\t\tthis.source.connect(this.filters[0]);\n\n\t\t\t\tfor (let i = 1, l = this.filters.length; i < l; i++) {\n\t\t\t\t\tthis.filters[i - 1].connect(this.filters[i]);\n\t\t\t\t}\n\n\t\t\t\tthis.filters[this.filters.length - 1].connect(this.getOutput());\n\t\t\t} else {\n\t\t\t\tthis.source.connect(this.getOutput());\n\t\t\t}\n\n\t\t\tthis._connected = true;\n\t\t\treturn this;\n\t\t}\n\n\t\tdisconnect() {\n\t\t\tif (this.filters.length > 0) {\n\t\t\t\tthis.source.disconnect(this.filters[0]);\n\n\t\t\t\tfor (let i = 1, l = this.filters.length; i < l; i++) {\n\t\t\t\t\tthis.filters[i - 1].disconnect(this.filters[i]);\n\t\t\t\t}\n\n\t\t\t\tthis.filters[this.filters.length - 1].disconnect(this.getOutput());\n\t\t\t} else {\n\t\t\t\tthis.source.disconnect(this.getOutput());\n\t\t\t}\n\n\t\t\tthis._connected = false;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetFilters() {\n\t\t\treturn this.filters;\n\t\t}\n\n\t\tsetFilters(value) {\n\t\t\tif (!value) value = [];\n\n\t\t\tif (this._connected === true) {\n\t\t\t\tthis.disconnect();\n\t\t\t\tthis.filters = value.slice();\n\t\t\t\tthis.connect();\n\t\t\t} else {\n\t\t\t\tthis.filters = value.slice();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetDetune(value) {\n\t\t\tthis.detune = value;\n\t\t\tif (this.source.detune === undefined) return; // only set detune when available\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tthis.source.detune.setTargetAtTime(this.detune, this.context.currentTime, 0.01);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetDetune() {\n\t\t\treturn this.detune;\n\t\t}\n\n\t\tgetFilter() {\n\t\t\treturn this.getFilters()[0];\n\t\t}\n\n\t\tsetFilter(filter) {\n\t\t\treturn this.setFilters(filter ? [filter] : []);\n\t\t}\n\n\t\tsetPlaybackRate(value) {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.playbackRate = value;\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tthis.source.playbackRate.setTargetAtTime(this.playbackRate, this.context.currentTime, 0.01);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tgetPlaybackRate() {\n\t\t\treturn this.playbackRate;\n\t\t}\n\n\t\tonEnded() {\n\t\t\tthis.isPlaying = false;\n\t\t}\n\n\t\tgetLoop() {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn this.loop;\n\t\t}\n\n\t\tsetLoop(value) {\n\t\t\tif (this.hasPlaybackControl === false) {\n\t\t\t\tconsole.warn('THREE.Audio: this Audio has no playback control.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.loop = value;\n\n\t\t\tif (this.isPlaying === true) {\n\t\t\t\tthis.source.loop = this.loop;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetLoopStart(value) {\n\t\t\tthis.loopStart = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetLoopEnd(value) {\n\t\t\tthis.loopEnd = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetVolume() {\n\t\t\treturn this.gain.gain.value;\n\t\t}\n\n\t\tsetVolume(value) {\n\t\t\tthis.gain.gain.setTargetAtTime(value, this.context.currentTime, 0.01);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tconst _position = /*@__PURE__*/new Vector3();\n\n\tconst _quaternion = /*@__PURE__*/new Quaternion();\n\n\tconst _scale = /*@__PURE__*/new Vector3();\n\n\tconst _orientation = /*@__PURE__*/new Vector3();\n\n\tclass PositionalAudio extends Audio {\n\t\tconstructor(listener) {\n\t\t\tsuper(listener);\n\t\t\tthis.panner = this.context.createPanner();\n\t\t\tthis.panner.panningModel = 'HRTF';\n\t\t\tthis.panner.connect(this.gain);\n\t\t}\n\n\t\tgetOutput() {\n\t\t\treturn this.panner;\n\t\t}\n\n\t\tgetRefDistance() {\n\t\t\treturn this.panner.refDistance;\n\t\t}\n\n\t\tsetRefDistance(value) {\n\t\t\tthis.panner.refDistance = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetRolloffFactor() {\n\t\t\treturn this.panner.rolloffFactor;\n\t\t}\n\n\t\tsetRolloffFactor(value) {\n\t\t\tthis.panner.rolloffFactor = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetDistanceModel() {\n\t\t\treturn this.panner.distanceModel;\n\t\t}\n\n\t\tsetDistanceModel(value) {\n\t\t\tthis.panner.distanceModel = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tgetMaxDistance() {\n\t\t\treturn this.panner.maxDistance;\n\t\t}\n\n\t\tsetMaxDistance(value) {\n\t\t\tthis.panner.maxDistance = value;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetDirectionalCone(coneInnerAngle, coneOuterAngle, coneOuterGain) {\n\t\t\tthis.panner.coneInnerAngle = coneInnerAngle;\n\t\t\tthis.panner.coneOuterAngle = coneOuterAngle;\n\t\t\tthis.panner.coneOuterGain = coneOuterGain;\n\t\t\treturn this;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t\tif (this.hasPlaybackControl === true && this.isPlaying === false) return;\n\t\t\tthis.matrixWorld.decompose(_position, _quaternion, _scale);\n\n\t\t\t_orientation.set(0, 0, 1).applyQuaternion(_quaternion);\n\n\t\t\tconst panner = this.panner;\n\n\t\t\tif (panner.positionX) {\n\t\t\t\t// code path for Chrome and Firefox (see #14393)\n\t\t\t\tconst endTime = this.context.currentTime + this.listener.timeDelta;\n\t\t\t\tpanner.positionX.linearRampToValueAtTime(_position.x, endTime);\n\t\t\t\tpanner.positionY.linearRampToValueAtTime(_position.y, endTime);\n\t\t\t\tpanner.positionZ.linearRampToValueAtTime(_position.z, endTime);\n\t\t\t\tpanner.orientationX.linearRampToValueAtTime(_orientation.x, endTime);\n\t\t\t\tpanner.orientationY.linearRampToValueAtTime(_orientation.y, endTime);\n\t\t\t\tpanner.orientationZ.linearRampToValueAtTime(_orientation.z, endTime);\n\t\t\t} else {\n\t\t\t\tpanner.setPosition(_position.x, _position.y, _position.z);\n\t\t\t\tpanner.setOrientation(_orientation.x, _orientation.y, _orientation.z);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tclass AudioAnalyser {\n\t\tconstructor(audio, fftSize = 2048) {\n\t\t\tthis.analyser = audio.context.createAnalyser();\n\t\t\tthis.analyser.fftSize = fftSize;\n\t\t\tthis.data = new Uint8Array(this.analyser.frequencyBinCount);\n\t\t\taudio.getOutput().connect(this.analyser);\n\t\t}\n\n\t\tgetFrequencyData() {\n\t\t\tthis.analyser.getByteFrequencyData(this.data);\n\t\t\treturn this.data;\n\t\t}\n\n\t\tgetAverageFrequency() {\n\t\t\tlet value = 0;\n\t\t\tconst data = this.getFrequencyData();\n\n\t\t\tfor (let i = 0; i < data.length; i++) {\n\t\t\t\tvalue += data[i];\n\t\t\t}\n\n\t\t\treturn value / data.length;\n\t\t}\n\n\t}\n\n\tclass PropertyMixer {\n\t\tconstructor(binding, typeName, valueSize) {\n\t\t\tthis.binding = binding;\n\t\t\tthis.valueSize = valueSize;\n\t\t\tlet mixFunction, mixFunctionAdditive, setIdentity; // buffer layout: [ incoming | accu0 | accu1 | orig | addAccu | (optional work) ]\n\t\t\t//\n\t\t\t// interpolators can use .buffer as their .result\n\t\t\t// the data then goes to 'incoming'\n\t\t\t//\n\t\t\t// 'accu0' and 'accu1' are used frame-interleaved for\n\t\t\t// the cumulative result and are compared to detect\n\t\t\t// changes\n\t\t\t//\n\t\t\t// 'orig' stores the original state of the property\n\t\t\t//\n\t\t\t// 'add' is used for additive cumulative results\n\t\t\t//\n\t\t\t// 'work' is optional and is only present for quaternion types. It is used\n\t\t\t// to store intermediate quaternion multiplication results\n\n\t\t\tswitch (typeName) {\n\t\t\t\tcase 'quaternion':\n\t\t\t\t\tmixFunction = this._slerp;\n\t\t\t\t\tmixFunctionAdditive = this._slerpAdditive;\n\t\t\t\t\tsetIdentity = this._setAdditiveIdentityQuaternion;\n\t\t\t\t\tthis.buffer = new Float64Array(valueSize * 6);\n\t\t\t\t\tthis._workIndex = 5;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'string':\n\t\t\t\tcase 'bool':\n\t\t\t\t\tmixFunction = this._select; // Use the regular mix function and for additive on these types,\n\t\t\t\t\t// additive is not relevant for non-numeric types\n\n\t\t\t\t\tmixFunctionAdditive = this._select;\n\t\t\t\t\tsetIdentity = this._setAdditiveIdentityOther;\n\t\t\t\t\tthis.buffer = new Array(valueSize * 5);\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tmixFunction = this._lerp;\n\t\t\t\t\tmixFunctionAdditive = this._lerpAdditive;\n\t\t\t\t\tsetIdentity = this._setAdditiveIdentityNumeric;\n\t\t\t\t\tthis.buffer = new Float64Array(valueSize * 5);\n\t\t\t}\n\n\t\t\tthis._mixBufferRegion = mixFunction;\n\t\t\tthis._mixBufferRegionAdditive = mixFunctionAdditive;\n\t\t\tthis._setIdentity = setIdentity;\n\t\t\tthis._origIndex = 3;\n\t\t\tthis._addIndex = 4;\n\t\t\tthis.cumulativeWeight = 0;\n\t\t\tthis.cumulativeWeightAdditive = 0;\n\t\t\tthis.useCount = 0;\n\t\t\tthis.referenceCount = 0;\n\t\t} // accumulate data in the 'incoming' region into 'accu<i>'\n\n\n\t\taccumulate(accuIndex, weight) {\n\t\t\t// note: happily accumulating nothing when weight = 0, the caller knows\n\t\t\t// the weight and shouldn't have made the call in the first place\n\t\t\tconst buffer = this.buffer,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset = accuIndex * stride + stride;\n\t\t\tlet currentWeight = this.cumulativeWeight;\n\n\t\t\tif (currentWeight === 0) {\n\t\t\t\t// accuN := incoming * weight\n\t\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\t\tbuffer[offset + i] = buffer[i];\n\t\t\t\t}\n\n\t\t\t\tcurrentWeight = weight;\n\t\t\t} else {\n\t\t\t\t// accuN := accuN + incoming * weight\n\t\t\t\tcurrentWeight += weight;\n\t\t\t\tconst mix = weight / currentWeight;\n\n\t\t\t\tthis._mixBufferRegion(buffer, offset, 0, mix, stride);\n\t\t\t}\n\n\t\t\tthis.cumulativeWeight = currentWeight;\n\t\t} // accumulate data in the 'incoming' region into 'add'\n\n\n\t\taccumulateAdditive(weight) {\n\t\t\tconst buffer = this.buffer,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toffset = stride * this._addIndex;\n\n\t\t\tif (this.cumulativeWeightAdditive === 0) {\n\t\t\t\t// add = identity\n\t\t\t\tthis._setIdentity();\n\t\t\t} // add := add + incoming * weight\n\n\n\t\t\tthis._mixBufferRegionAdditive(buffer, offset, 0, weight, stride);\n\n\t\t\tthis.cumulativeWeightAdditive += weight;\n\t\t} // apply the state of 'accu<i>' to the binding when accus differ\n\n\n\t\tapply(accuIndex) {\n\t\t\tconst stride = this.valueSize,\n\t\t\t\t\t\tbuffer = this.buffer,\n\t\t\t\t\t\toffset = accuIndex * stride + stride,\n\t\t\t\t\t\tweight = this.cumulativeWeight,\n\t\t\t\t\t\tweightAdditive = this.cumulativeWeightAdditive,\n\t\t\t\t\t\tbinding = this.binding;\n\t\t\tthis.cumulativeWeight = 0;\n\t\t\tthis.cumulativeWeightAdditive = 0;\n\n\t\t\tif (weight < 1) {\n\t\t\t\t// accuN := accuN + original * ( 1 - cumulativeWeight )\n\t\t\t\tconst originalValueOffset = stride * this._origIndex;\n\n\t\t\t\tthis._mixBufferRegion(buffer, offset, originalValueOffset, 1 - weight, stride);\n\t\t\t}\n\n\t\t\tif (weightAdditive > 0) {\n\t\t\t\t// accuN := accuN + additive accuN\n\t\t\t\tthis._mixBufferRegionAdditive(buffer, offset, this._addIndex * stride, 1, stride);\n\t\t\t}\n\n\t\t\tfor (let i = stride, e = stride + stride; i !== e; ++i) {\n\t\t\t\tif (buffer[i] !== buffer[i + stride]) {\n\t\t\t\t\t// value has changed -> update scene graph\n\t\t\t\t\tbinding.setValue(buffer, offset);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} // remember the state of the bound property and copy it to both accus\n\n\n\t\tsaveOriginalState() {\n\t\t\tconst binding = this.binding;\n\t\t\tconst buffer = this.buffer,\n\t\t\t\t\t\tstride = this.valueSize,\n\t\t\t\t\t\toriginalValueOffset = stride * this._origIndex;\n\t\t\tbinding.getValue(buffer, originalValueOffset); // accu[0..1] := orig -- initially detect changes against the original\n\n\t\t\tfor (let i = stride, e = originalValueOffset; i !== e; ++i) {\n\t\t\t\tbuffer[i] = buffer[originalValueOffset + i % stride];\n\t\t\t} // Add to identity for additive\n\n\n\t\t\tthis._setIdentity();\n\n\t\t\tthis.cumulativeWeight = 0;\n\t\t\tthis.cumulativeWeightAdditive = 0;\n\t\t} // apply the state previously taken via 'saveOriginalState' to the binding\n\n\n\t\trestoreOriginalState() {\n\t\t\tconst originalValueOffset = this.valueSize * 3;\n\t\t\tthis.binding.setValue(this.buffer, originalValueOffset);\n\t\t}\n\n\t\t_setAdditiveIdentityNumeric() {\n\t\t\tconst startIndex = this._addIndex * this.valueSize;\n\t\t\tconst endIndex = startIndex + this.valueSize;\n\n\t\t\tfor (let i = startIndex; i < endIndex; i++) {\n\t\t\t\tthis.buffer[i] = 0;\n\t\t\t}\n\t\t}\n\n\t\t_setAdditiveIdentityQuaternion() {\n\t\t\tthis._setAdditiveIdentityNumeric();\n\n\t\t\tthis.buffer[this._addIndex * this.valueSize + 3] = 1;\n\t\t}\n\n\t\t_setAdditiveIdentityOther() {\n\t\t\tconst startIndex = this._origIndex * this.valueSize;\n\t\t\tconst targetIndex = this._addIndex * this.valueSize;\n\n\t\t\tfor (let i = 0; i < this.valueSize; i++) {\n\t\t\t\tthis.buffer[targetIndex + i] = this.buffer[startIndex + i];\n\t\t\t}\n\t\t} // mix functions\n\n\n\t\t_select(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tif (t >= 0.5) {\n\t\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\t\tbuffer[dstOffset + i] = buffer[srcOffset + i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_slerp(buffer, dstOffset, srcOffset, t) {\n\t\t\tQuaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, srcOffset, t);\n\t\t}\n\n\t\t_slerpAdditive(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tconst workOffset = this._workIndex * stride; // Store result in intermediate buffer offset\n\n\t\t\tQuaternion.multiplyQuaternionsFlat(buffer, workOffset, buffer, dstOffset, buffer, srcOffset); // Slerp to the intermediate result\n\n\t\t\tQuaternion.slerpFlat(buffer, dstOffset, buffer, dstOffset, buffer, workOffset, t);\n\t\t}\n\n\t\t_lerp(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tconst s = 1 - t;\n\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tconst j = dstOffset + i;\n\t\t\t\tbuffer[j] = buffer[j] * s + buffer[srcOffset + i] * t;\n\t\t\t}\n\t\t}\n\n\t\t_lerpAdditive(buffer, dstOffset, srcOffset, t, stride) {\n\t\t\tfor (let i = 0; i !== stride; ++i) {\n\t\t\t\tconst j = dstOffset + i;\n\t\t\t\tbuffer[j] = buffer[j] + buffer[srcOffset + i] * t;\n\t\t\t}\n\t\t}\n\n\t}\n\n\t// Characters [].:/ are reserved for track binding syntax.\n\tconst _RESERVED_CHARS_RE = '\\\\[\\\\]\\\\.:\\\\/';\n\n\tconst _reservedRe = new RegExp('[' + _RESERVED_CHARS_RE + ']', 'g'); // Attempts to allow node names from any language. ES5's `\\w` regexp matches\n\t// only latin characters, and the unicode \\p{L} is not yet supported. So\n\t// instead, we exclude reserved characters and match everything else.\n\n\n\tconst _wordChar = '[^' + _RESERVED_CHARS_RE + ']';\n\n\tconst _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace('\\\\.', '') + ']'; // Parent directories, delimited by '/' or ':'. Currently unused, but must\n\t// be matched to parse the rest of the track name.\n\n\n\tconst _directoryRe = /((?:WC+[\\/:])*)/.source.replace('WC', _wordChar); // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.\n\n\n\tconst _nodeRe = /(WCOD+)?/.source.replace('WCOD', _wordCharOrDot); // Object on target node, and accessor. May not contain reserved\n\t// characters. Accessor may contain any character except closing bracket.\n\n\n\tconst _objectRe = /(?:\\.(WC+)(?:\\[(.+)\\])?)?/.source.replace('WC', _wordChar); // Property and accessor. May not contain reserved characters. Accessor may\n\t// contain any non-bracket characters.\n\n\n\tconst _propertyRe = /\\.(WC+)(?:\\[(.+)\\])?/.source.replace('WC', _wordChar);\n\n\tconst _trackRe = new RegExp('' + '^' + _directoryRe + _nodeRe + _objectRe + _propertyRe + '$');\n\n\tconst _supportedObjectNames = ['material', 'materials', 'bones'];\n\n\tclass Composite {\n\t\tconstructor(targetGroup, path, optionalParsedPath) {\n\t\t\tconst parsedPath = optionalParsedPath || PropertyBinding.parseTrackName(path);\n\t\t\tthis._targetGroup = targetGroup;\n\t\t\tthis._bindings = targetGroup.subscribe_(path, parsedPath);\n\t\t}\n\n\t\tgetValue(array, offset) {\n\t\t\tthis.bind(); // bind all binding\n\n\t\t\tconst firstValidIndex = this._targetGroup.nCachedObjects_,\n\t\t\t\t\t\tbinding = this._bindings[firstValidIndex]; // and only call .getValue on the first\n\n\t\t\tif (binding !== undefined) binding.getValue(array, offset);\n\t\t}\n\n\t\tsetValue(array, offset) {\n\t\t\tconst bindings = this._bindings;\n\n\t\t\tfor (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) {\n\t\t\t\tbindings[i].setValue(array, offset);\n\t\t\t}\n\t\t}\n\n\t\tbind() {\n\t\t\tconst bindings = this._bindings;\n\n\t\t\tfor (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) {\n\t\t\t\tbindings[i].bind();\n\t\t\t}\n\t\t}\n\n\t\tunbind() {\n\t\t\tconst bindings = this._bindings;\n\n\t\t\tfor (let i = this._targetGroup.nCachedObjects_, n = bindings.length; i !== n; ++i) {\n\t\t\t\tbindings[i].unbind();\n\t\t\t}\n\t\t}\n\n\t} // Note: This class uses a State pattern on a per-method basis:\n\t// 'bind' sets 'this.getValue' / 'setValue' and shadows the\n\t// prototype version of these methods with one that represents\n\t// the bound state. When the property is not found, the methods\n\t// become no-ops.\n\n\n\tclass PropertyBinding {\n\t\tconstructor(rootNode, path, parsedPath) {\n\t\t\tthis.path = path;\n\t\t\tthis.parsedPath = parsedPath || PropertyBinding.parseTrackName(path);\n\t\t\tthis.node = PropertyBinding.findNode(rootNode, this.parsedPath.nodeName) || rootNode;\n\t\t\tthis.rootNode = rootNode; // initial state of these methods that calls 'bind'\n\n\t\t\tthis.getValue = this._getValue_unbound;\n\t\t\tthis.setValue = this._setValue_unbound;\n\t\t}\n\n\t\tstatic create(root, path, parsedPath) {\n\t\t\tif (!(root && root.isAnimationObjectGroup)) {\n\t\t\t\treturn new PropertyBinding(root, path, parsedPath);\n\t\t\t} else {\n\t\t\t\treturn new PropertyBinding.Composite(root, path, parsedPath);\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * Replaces spaces with underscores and removes unsupported characters from\n\t\t * node names, to ensure compatibility with parseTrackName().\n\t\t *\n\t\t * @param {string} name Node name to be sanitized.\n\t\t * @return {string}\n\t\t */\n\n\n\t\tstatic sanitizeNodeName(name) {\n\t\t\treturn name.replace(/\\s/g, '_').replace(_reservedRe, '');\n\t\t}\n\n\t\tstatic parseTrackName(trackName) {\n\t\t\tconst matches = _trackRe.exec(trackName);\n\n\t\t\tif (!matches) {\n\t\t\t\tthrow new Error('PropertyBinding: Cannot parse trackName: ' + trackName);\n\t\t\t}\n\n\t\t\tconst results = {\n\t\t\t\t// directoryName: matches[ 1 ], // (tschw) currently unused\n\t\t\t\tnodeName: matches[2],\n\t\t\t\tobjectName: matches[3],\n\t\t\t\tobjectIndex: matches[4],\n\t\t\t\tpropertyName: matches[5],\n\t\t\t\t// required\n\t\t\t\tpropertyIndex: matches[6]\n\t\t\t};\n\t\t\tconst lastDot = results.nodeName && results.nodeName.lastIndexOf('.');\n\n\t\t\tif (lastDot !== undefined && lastDot !== -1) {\n\t\t\t\tconst objectName = results.nodeName.substring(lastDot + 1); // Object names must be checked against an allowlist. Otherwise, there\n\t\t\t\t// is no way to parse 'foo.bar.baz': 'baz' must be a property, but\n\t\t\t\t// 'bar' could be the objectName, or part of a nodeName (which can\n\t\t\t\t// include '.' characters).\n\n\t\t\t\tif (_supportedObjectNames.indexOf(objectName) !== -1) {\n\t\t\t\t\tresults.nodeName = results.nodeName.substring(0, lastDot);\n\t\t\t\t\tresults.objectName = objectName;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (results.propertyName === null || results.propertyName.length === 0) {\n\t\t\t\tthrow new Error('PropertyBinding: can not parse propertyName from trackName: ' + trackName);\n\t\t\t}\n\n\t\t\treturn results;\n\t\t}\n\n\t\tstatic findNode(root, nodeName) {\n\t\t\tif (!nodeName || nodeName === '' || nodeName === '.' || nodeName === -1 || nodeName === root.name || nodeName === root.uuid) {\n\t\t\t\treturn root;\n\t\t\t} // search into skeleton bones.\n\n\n\t\t\tif (root.skeleton) {\n\t\t\t\tconst bone = root.skeleton.getBoneByName(nodeName);\n\n\t\t\t\tif (bone !== undefined) {\n\t\t\t\t\treturn bone;\n\t\t\t\t}\n\t\t\t} // search into node subtree.\n\n\n\t\t\tif (root.children) {\n\t\t\t\tconst searchNodeSubtree = function (children) {\n\t\t\t\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\t\t\t\tconst childNode = children[i];\n\n\t\t\t\t\t\tif (childNode.name === nodeName || childNode.uuid === nodeName) {\n\t\t\t\t\t\t\treturn childNode;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst result = searchNodeSubtree(childNode.children);\n\t\t\t\t\t\tif (result) return result;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn null;\n\t\t\t\t};\n\n\t\t\t\tconst subTreeNode = searchNodeSubtree(root.children);\n\n\t\t\t\tif (subTreeNode) {\n\t\t\t\t\treturn subTreeNode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} // these are used to \"bind\" a nonexistent property\n\n\n\t\t_getValue_unavailable() {}\n\n\t\t_setValue_unavailable() {} // Getters\n\n\n\t\t_getValue_direct(buffer, offset) {\n\t\t\tbuffer[offset] = this.targetObject[this.propertyName];\n\t\t}\n\n\t\t_getValue_array(buffer, offset) {\n\t\t\tconst source = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = source.length; i !== n; ++i) {\n\t\t\t\tbuffer[offset++] = source[i];\n\t\t\t}\n\t\t}\n\n\t\t_getValue_arrayElement(buffer, offset) {\n\t\t\tbuffer[offset] = this.resolvedProperty[this.propertyIndex];\n\t\t}\n\n\t\t_getValue_toArray(buffer, offset) {\n\t\t\tthis.resolvedProperty.toArray(buffer, offset);\n\t\t} // Direct\n\n\n\t\t_setValue_direct(buffer, offset) {\n\t\t\tthis.targetObject[this.propertyName] = buffer[offset];\n\t\t}\n\n\t\t_setValue_direct_setNeedsUpdate(buffer, offset) {\n\t\t\tthis.targetObject[this.propertyName] = buffer[offset];\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_direct_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tthis.targetObject[this.propertyName] = buffer[offset];\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t} // EntireArray\n\n\n\t\t_setValue_array(buffer, offset) {\n\t\t\tconst dest = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = dest.length; i !== n; ++i) {\n\t\t\t\tdest[i] = buffer[offset++];\n\t\t\t}\n\t\t}\n\n\t\t_setValue_array_setNeedsUpdate(buffer, offset) {\n\t\t\tconst dest = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = dest.length; i !== n; ++i) {\n\t\t\t\tdest[i] = buffer[offset++];\n\t\t\t}\n\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_array_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tconst dest = this.resolvedProperty;\n\n\t\t\tfor (let i = 0, n = dest.length; i !== n; ++i) {\n\t\t\t\tdest[i] = buffer[offset++];\n\t\t\t}\n\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t} // ArrayElement\n\n\n\t\t_setValue_arrayElement(buffer, offset) {\n\t\t\tthis.resolvedProperty[this.propertyIndex] = buffer[offset];\n\t\t}\n\n\t\t_setValue_arrayElement_setNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty[this.propertyIndex] = buffer[offset];\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty[this.propertyIndex] = buffer[offset];\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t} // HasToFromArray\n\n\n\t\t_setValue_fromArray(buffer, offset) {\n\t\t\tthis.resolvedProperty.fromArray(buffer, offset);\n\t\t}\n\n\t\t_setValue_fromArray_setNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty.fromArray(buffer, offset);\n\t\t\tthis.targetObject.needsUpdate = true;\n\t\t}\n\n\t\t_setValue_fromArray_setMatrixWorldNeedsUpdate(buffer, offset) {\n\t\t\tthis.resolvedProperty.fromArray(buffer, offset);\n\t\t\tthis.targetObject.matrixWorldNeedsUpdate = true;\n\t\t}\n\n\t\t_getValue_unbound(targetArray, offset) {\n\t\t\tthis.bind();\n\t\t\tthis.getValue(targetArray, offset);\n\t\t}\n\n\t\t_setValue_unbound(sourceArray, offset) {\n\t\t\tthis.bind();\n\t\t\tthis.setValue(sourceArray, offset);\n\t\t} // create getter / setter pair for a property in the scene graph\n\n\n\t\tbind() {\n\t\t\tlet targetObject = this.node;\n\t\t\tconst parsedPath = this.parsedPath;\n\t\t\tconst objectName = parsedPath.objectName;\n\t\t\tconst propertyName = parsedPath.propertyName;\n\t\t\tlet propertyIndex = parsedPath.propertyIndex;\n\n\t\t\tif (!targetObject) {\n\t\t\t\ttargetObject = PropertyBinding.findNode(this.rootNode, parsedPath.nodeName) || this.rootNode;\n\t\t\t\tthis.node = targetObject;\n\t\t\t} // set fail state so we can just 'return' on error\n\n\n\t\t\tthis.getValue = this._getValue_unavailable;\n\t\t\tthis.setValue = this._setValue_unavailable; // ensure there is a value node\n\n\t\t\tif (!targetObject) {\n\t\t\t\tconsole.error('THREE.PropertyBinding: Trying to update node for track: ' + this.path + ' but it wasn\\'t found.');\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (objectName) {\n\t\t\t\tlet objectIndex = parsedPath.objectIndex; // special cases were we need to reach deeper into the hierarchy to get the face materials....\n\n\t\t\t\tswitch (objectName) {\n\t\t\t\t\tcase 'materials':\n\t\t\t\t\t\tif (!targetObject.material) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to material as node does not have a material.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!targetObject.material.materials) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttargetObject = targetObject.material.materials;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'bones':\n\t\t\t\t\t\tif (!targetObject.skeleton) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t} // potential future optimization: skip this if propertyIndex is already an integer\n\t\t\t\t\t\t// and convert the integer string to a true integer.\n\n\n\t\t\t\t\t\ttargetObject = targetObject.skeleton.bones; // support resolving morphTarget names into indices.\n\n\t\t\t\t\t\tfor (let i = 0; i < targetObject.length; i++) {\n\t\t\t\t\t\t\tif (targetObject[i].name === objectIndex) {\n\t\t\t\t\t\t\t\tobjectIndex = i;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif (targetObject[objectName] === undefined) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to objectName of node undefined.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttargetObject = targetObject[objectName];\n\t\t\t\t}\n\n\t\t\t\tif (objectIndex !== undefined) {\n\t\t\t\t\tif (targetObject[objectIndex] === undefined) {\n\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\ttargetObject = targetObject[objectIndex];\n\t\t\t\t}\n\t\t\t} // resolve property\n\n\n\t\t\tconst nodeProperty = targetObject[propertyName];\n\n\t\t\tif (nodeProperty === undefined) {\n\t\t\t\tconst nodeName = parsedPath.nodeName;\n\t\t\t\tconsole.error('THREE.PropertyBinding: Trying to update property for track: ' + nodeName + '.' + propertyName + ' but it wasn\\'t found.', targetObject);\n\t\t\t\treturn;\n\t\t\t} // determine versioning scheme\n\n\n\t\t\tlet versioning = this.Versioning.None;\n\t\t\tthis.targetObject = targetObject;\n\n\t\t\tif (targetObject.needsUpdate !== undefined) {\n\t\t\t\t// material\n\t\t\t\tversioning = this.Versioning.NeedsUpdate;\n\t\t\t} else if (targetObject.matrixWorldNeedsUpdate !== undefined) {\n\t\t\t\t// node transform\n\t\t\t\tversioning = this.Versioning.MatrixWorldNeedsUpdate;\n\t\t\t} // determine how the property gets bound\n\n\n\t\t\tlet bindingType = this.BindingType.Direct;\n\n\t\t\tif (propertyIndex !== undefined) {\n\t\t\t\t// access a sub element of the property array (only primitives are supported right now)\n\t\t\t\tif (propertyName === 'morphTargetInfluences') {\n\t\t\t\t\t// potential optimization, skip this if propertyIndex is already an integer, and convert the integer string to a true integer.\n\t\t\t\t\t// support resolving morphTarget names into indices.\n\t\t\t\t\tif (!targetObject.geometry) {\n\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (targetObject.geometry.isBufferGeometry) {\n\t\t\t\t\t\tif (!targetObject.geometry.morphAttributes) {\n\t\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (targetObject.morphTargetDictionary[propertyIndex] !== undefined) {\n\t\t\t\t\t\t\tpropertyIndex = targetObject.morphTargetDictionary[propertyIndex];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.error('THREE.PropertyBinding: Can not bind to morphTargetInfluences on THREE.Geometry. Use THREE.BufferGeometry instead.', this);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tbindingType = this.BindingType.ArrayElement;\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t\tthis.propertyIndex = propertyIndex;\n\t\t\t} else if (nodeProperty.fromArray !== undefined && nodeProperty.toArray !== undefined) {\n\t\t\t\t// must use copy for Object3D.Euler/Quaternion\n\t\t\t\tbindingType = this.BindingType.HasFromToArray;\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t} else if (Array.isArray(nodeProperty)) {\n\t\t\t\tbindingType = this.BindingType.EntireArray;\n\t\t\t\tthis.resolvedProperty = nodeProperty;\n\t\t\t} else {\n\t\t\t\tthis.propertyName = propertyName;\n\t\t\t} // select getter / setter\n\n\n\t\t\tthis.getValue = this.GetterByBindingType[bindingType];\n\t\t\tthis.setValue = this.SetterByBindingTypeAndVersioning[bindingType][versioning];\n\t\t}\n\n\t\tunbind() {\n\t\t\tthis.node = null; // back to the prototype version of getValue / setValue\n\t\t\t// note: avoiding to mutate the shape of 'this' via 'delete'\n\n\t\t\tthis.getValue = this._getValue_unbound;\n\t\t\tthis.setValue = this._setValue_unbound;\n\t\t}\n\n\t}\n\n\tPropertyBinding.Composite = Composite;\n\tPropertyBinding.prototype.BindingType = {\n\t\tDirect: 0,\n\t\tEntireArray: 1,\n\t\tArrayElement: 2,\n\t\tHasFromToArray: 3\n\t};\n\tPropertyBinding.prototype.Versioning = {\n\t\tNone: 0,\n\t\tNeedsUpdate: 1,\n\t\tMatrixWorldNeedsUpdate: 2\n\t};\n\tPropertyBinding.prototype.GetterByBindingType = [PropertyBinding.prototype._getValue_direct, PropertyBinding.prototype._getValue_array, PropertyBinding.prototype._getValue_arrayElement, PropertyBinding.prototype._getValue_toArray];\n\tPropertyBinding.prototype.SetterByBindingTypeAndVersioning = [[// Direct\n\tPropertyBinding.prototype._setValue_direct, PropertyBinding.prototype._setValue_direct_setNeedsUpdate, PropertyBinding.prototype._setValue_direct_setMatrixWorldNeedsUpdate], [// EntireArray\n\tPropertyBinding.prototype._setValue_array, PropertyBinding.prototype._setValue_array_setNeedsUpdate, PropertyBinding.prototype._setValue_array_setMatrixWorldNeedsUpdate], [// ArrayElement\n\tPropertyBinding.prototype._setValue_arrayElement, PropertyBinding.prototype._setValue_arrayElement_setNeedsUpdate, PropertyBinding.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate], [// HasToFromArray\n\tPropertyBinding.prototype._setValue_fromArray, PropertyBinding.prototype._setValue_fromArray_setNeedsUpdate, PropertyBinding.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];\n\n\t/**\n\t *\n\t * A group of objects that receives a shared animation state.\n\t *\n\t * Usage:\n\t *\n\t *\t- Add objects you would otherwise pass as 'root' to the\n\t *\t\tconstructor or the .clipAction method of AnimationMixer.\n\t *\n\t *\t- Instead pass this object as 'root'.\n\t *\n\t *\t- You can also add and remove objects later when the mixer\n\t *\t\tis running.\n\t *\n\t * Note:\n\t *\n\t *\t\tObjects of this class appear as one object to the mixer,\n\t *\t\tso cache control of the individual objects must be done\n\t *\t\ton the group.\n\t *\n\t * Limitation:\n\t *\n\t *\t- The animated properties must be compatible among the\n\t *\t\tall objects in the group.\n\t *\n\t *\t- A single property can either be controlled through a\n\t *\t\ttarget group or directly, but not both.\n\t */\n\n\tclass AnimationObjectGroup {\n\t\tconstructor() {\n\t\t\tthis.uuid = generateUUID(); // cached objects followed by the active ones\n\n\t\t\tthis._objects = Array.prototype.slice.call(arguments);\n\t\t\tthis.nCachedObjects_ = 0; // threshold\n\t\t\t// note: read by PropertyBinding.Composite\n\n\t\t\tconst indices = {};\n\t\t\tthis._indicesByUUID = indices; // for bookkeeping\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tindices[arguments[i].uuid] = i;\n\t\t\t}\n\n\t\t\tthis._paths = []; // inside: string\n\n\t\t\tthis._parsedPaths = []; // inside: { we don't care, here }\n\n\t\t\tthis._bindings = []; // inside: Array< PropertyBinding >\n\n\t\t\tthis._bindingsIndicesByPath = {}; // inside: indices in these arrays\n\n\t\t\tconst scope = this;\n\t\t\tthis.stats = {\n\t\t\t\tobjects: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._objects.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn this.total - scope.nCachedObjects_;\n\t\t\t\t\t}\n\n\t\t\t\t},\n\n\t\t\t\tget bindingsPerObject() {\n\t\t\t\t\treturn scope._bindings.length;\n\t\t\t\t}\n\n\t\t\t};\n\t\t}\n\n\t\tadd() {\n\t\t\tconst objects = this._objects,\n\t\t\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\t\t\tpaths = this._paths,\n\t\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\tnBindings = bindings.length;\n\t\t\tlet knownObject = undefined,\n\t\t\t\t\tnObjects = objects.length,\n\t\t\t\t\tnCachedObjects = this.nCachedObjects_;\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tconst object = arguments[i],\n\t\t\t\t\t\t\tuuid = object.uuid;\n\t\t\t\tlet index = indicesByUUID[uuid];\n\n\t\t\t\tif (index === undefined) {\n\t\t\t\t\t// unknown object -> add it to the ACTIVE region\n\t\t\t\t\tindex = nObjects++;\n\t\t\t\t\tindicesByUUID[uuid] = index;\n\t\t\t\t\tobjects.push(object); // accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\tbindings[j].push(new PropertyBinding(object, paths[j], parsedPaths[j]));\n\t\t\t\t\t}\n\t\t\t\t} else if (index < nCachedObjects) {\n\t\t\t\t\tknownObject = objects[index]; // move existing object to the ACTIVE region\n\n\t\t\t\t\tconst firstActiveIndex = --nCachedObjects,\n\t\t\t\t\t\t\t\tlastCachedObject = objects[firstActiveIndex];\n\t\t\t\t\tindicesByUUID[lastCachedObject.uuid] = index;\n\t\t\t\t\tobjects[index] = lastCachedObject;\n\t\t\t\t\tindicesByUUID[uuid] = firstActiveIndex;\n\t\t\t\t\tobjects[firstActiveIndex] = object; // accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\tconst bindingsForPath = bindings[j],\n\t\t\t\t\t\t\t\t\tlastCached = bindingsForPath[firstActiveIndex];\n\t\t\t\t\t\tlet binding = bindingsForPath[index];\n\t\t\t\t\t\tbindingsForPath[index] = lastCached;\n\n\t\t\t\t\t\tif (binding === undefined) {\n\t\t\t\t\t\t\t// since we do not bother to create new bindings\n\t\t\t\t\t\t\t// for objects that are cached, the binding may\n\t\t\t\t\t\t\t// or may not exist\n\t\t\t\t\t\t\tbinding = new PropertyBinding(object, paths[j], parsedPaths[j]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbindingsForPath[firstActiveIndex] = binding;\n\t\t\t\t\t}\n\t\t\t\t} else if (objects[index] !== knownObject) {\n\t\t\t\t\tconsole.error('THREE.AnimationObjectGroup: Different objects with the same UUID ' + 'detected. Clean the caches or recreate your infrastructure when reloading scenes.');\n\t\t\t\t} // else the object is already where we want it to be\n\n\t\t\t} // for arguments\n\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\t\t}\n\n\t\tremove() {\n\t\t\tconst objects = this._objects,\n\t\t\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\tnBindings = bindings.length;\n\t\t\tlet nCachedObjects = this.nCachedObjects_;\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tconst object = arguments[i],\n\t\t\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\t\t\tindex = indicesByUUID[uuid];\n\n\t\t\t\tif (index !== undefined && index >= nCachedObjects) {\n\t\t\t\t\t// move existing object into the CACHED region\n\t\t\t\t\tconst lastCachedIndex = nCachedObjects++,\n\t\t\t\t\t\t\t\tfirstActiveObject = objects[lastCachedIndex];\n\t\t\t\t\tindicesByUUID[firstActiveObject.uuid] = index;\n\t\t\t\t\tobjects[index] = firstActiveObject;\n\t\t\t\t\tindicesByUUID[uuid] = lastCachedIndex;\n\t\t\t\t\tobjects[lastCachedIndex] = object; // accounting is done, now do the same for all bindings\n\n\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\tconst bindingsForPath = bindings[j],\n\t\t\t\t\t\t\t\t\tfirstActive = bindingsForPath[lastCachedIndex],\n\t\t\t\t\t\t\t\t\tbinding = bindingsForPath[index];\n\t\t\t\t\t\tbindingsForPath[index] = firstActive;\n\t\t\t\t\t\tbindingsForPath[lastCachedIndex] = binding;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // for arguments\n\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\t\t} // remove & forget\n\n\n\t\tuncache() {\n\t\t\tconst objects = this._objects,\n\t\t\t\t\t\tindicesByUUID = this._indicesByUUID,\n\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\tnBindings = bindings.length;\n\t\t\tlet nCachedObjects = this.nCachedObjects_,\n\t\t\t\t\tnObjects = objects.length;\n\n\t\t\tfor (let i = 0, n = arguments.length; i !== n; ++i) {\n\t\t\t\tconst object = arguments[i],\n\t\t\t\t\t\t\tuuid = object.uuid,\n\t\t\t\t\t\t\tindex = indicesByUUID[uuid];\n\n\t\t\t\tif (index !== undefined) {\n\t\t\t\t\tdelete indicesByUUID[uuid];\n\n\t\t\t\t\tif (index < nCachedObjects) {\n\t\t\t\t\t\t// object is cached, shrink the CACHED region\n\t\t\t\t\t\tconst firstActiveIndex = --nCachedObjects,\n\t\t\t\t\t\t\t\t\tlastCachedObject = objects[firstActiveIndex],\n\t\t\t\t\t\t\t\t\tlastIndex = --nObjects,\n\t\t\t\t\t\t\t\t\tlastObject = objects[lastIndex]; // last cached object takes this object's place\n\n\t\t\t\t\t\tindicesByUUID[lastCachedObject.uuid] = index;\n\t\t\t\t\t\tobjects[index] = lastCachedObject; // last object goes to the activated slot and pop\n\n\t\t\t\t\t\tindicesByUUID[lastObject.uuid] = firstActiveIndex;\n\t\t\t\t\t\tobjects[firstActiveIndex] = lastObject;\n\t\t\t\t\t\tobjects.pop(); // accounting is done, now do the same for all bindings\n\n\t\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\t\tconst bindingsForPath = bindings[j],\n\t\t\t\t\t\t\t\t\t\tlastCached = bindingsForPath[firstActiveIndex],\n\t\t\t\t\t\t\t\t\t\tlast = bindingsForPath[lastIndex];\n\t\t\t\t\t\t\tbindingsForPath[index] = lastCached;\n\t\t\t\t\t\t\tbindingsForPath[firstActiveIndex] = last;\n\t\t\t\t\t\t\tbindingsForPath.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// object is active, just swap with the last and pop\n\t\t\t\t\t\tconst lastIndex = --nObjects,\n\t\t\t\t\t\t\t\t\tlastObject = objects[lastIndex];\n\n\t\t\t\t\t\tif (lastIndex > 0) {\n\t\t\t\t\t\t\tindicesByUUID[lastObject.uuid] = index;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tobjects[index] = lastObject;\n\t\t\t\t\t\tobjects.pop(); // accounting is done, now do the same for all bindings\n\n\t\t\t\t\t\tfor (let j = 0, m = nBindings; j !== m; ++j) {\n\t\t\t\t\t\t\tconst bindingsForPath = bindings[j];\n\t\t\t\t\t\t\tbindingsForPath[index] = bindingsForPath[lastIndex];\n\t\t\t\t\t\t\tbindingsForPath.pop();\n\t\t\t\t\t\t}\n\t\t\t\t\t} // cached or active\n\n\t\t\t\t} // if object is known\n\n\t\t\t} // for arguments\n\n\n\t\t\tthis.nCachedObjects_ = nCachedObjects;\n\t\t} // Internal interface used by befriended PropertyBinding.Composite:\n\n\n\t\tsubscribe_(path, parsedPath) {\n\t\t\t// returns an array of bindings for the given path that is changed\n\t\t\t// according to the contained objects in the group\n\t\t\tconst indicesByPath = this._bindingsIndicesByPath;\n\t\t\tlet index = indicesByPath[path];\n\t\t\tconst bindings = this._bindings;\n\t\t\tif (index !== undefined) return bindings[index];\n\t\t\tconst paths = this._paths,\n\t\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\t\tobjects = this._objects,\n\t\t\t\t\t\tnObjects = objects.length,\n\t\t\t\t\t\tnCachedObjects = this.nCachedObjects_,\n\t\t\t\t\t\tbindingsForPath = new Array(nObjects);\n\t\t\tindex = bindings.length;\n\t\t\tindicesByPath[path] = index;\n\t\t\tpaths.push(path);\n\t\t\tparsedPaths.push(parsedPath);\n\t\t\tbindings.push(bindingsForPath);\n\n\t\t\tfor (let i = nCachedObjects, n = objects.length; i !== n; ++i) {\n\t\t\t\tconst object = objects[i];\n\t\t\t\tbindingsForPath[i] = new PropertyBinding(object, path, parsedPath);\n\t\t\t}\n\n\t\t\treturn bindingsForPath;\n\t\t}\n\n\t\tunsubscribe_(path) {\n\t\t\t// tells the group to forget about a property path and no longer\n\t\t\t// update the array previously obtained with 'subscribe_'\n\t\t\tconst indicesByPath = this._bindingsIndicesByPath,\n\t\t\t\t\t\tindex = indicesByPath[path];\n\n\t\t\tif (index !== undefined) {\n\t\t\t\tconst paths = this._paths,\n\t\t\t\t\t\t\tparsedPaths = this._parsedPaths,\n\t\t\t\t\t\t\tbindings = this._bindings,\n\t\t\t\t\t\t\tlastBindingsIndex = bindings.length - 1,\n\t\t\t\t\t\t\tlastBindings = bindings[lastBindingsIndex],\n\t\t\t\t\t\t\tlastBindingsPath = path[lastBindingsIndex];\n\t\t\t\tindicesByPath[lastBindingsPath] = index;\n\t\t\t\tbindings[index] = lastBindings;\n\t\t\t\tbindings.pop();\n\t\t\t\tparsedPaths[index] = parsedPaths[lastBindingsIndex];\n\t\t\t\tparsedPaths.pop();\n\t\t\t\tpaths[index] = paths[lastBindingsIndex];\n\t\t\t\tpaths.pop();\n\t\t\t}\n\t\t}\n\n\t}\n\n\tAnimationObjectGroup.prototype.isAnimationObjectGroup = true;\n\n\tclass AnimationAction {\n\t\tconstructor(mixer, clip, localRoot = null, blendMode = clip.blendMode) {\n\t\t\tthis._mixer = mixer;\n\t\t\tthis._clip = clip;\n\t\t\tthis._localRoot = localRoot;\n\t\t\tthis.blendMode = blendMode;\n\t\t\tconst tracks = clip.tracks,\n\t\t\t\t\t\tnTracks = tracks.length,\n\t\t\t\t\t\tinterpolants = new Array(nTracks);\n\t\t\tconst interpolantSettings = {\n\t\t\t\tendingStart: ZeroCurvatureEnding,\n\t\t\t\tendingEnd: ZeroCurvatureEnding\n\t\t\t};\n\n\t\t\tfor (let i = 0; i !== nTracks; ++i) {\n\t\t\t\tconst interpolant = tracks[i].createInterpolant(null);\n\t\t\t\tinterpolants[i] = interpolant;\n\t\t\t\tinterpolant.settings = interpolantSettings;\n\t\t\t}\n\n\t\t\tthis._interpolantSettings = interpolantSettings;\n\t\t\tthis._interpolants = interpolants; // bound by the mixer\n\t\t\t// inside: PropertyMixer (managed by the mixer)\n\n\t\t\tthis._propertyBindings = new Array(nTracks);\n\t\t\tthis._cacheIndex = null; // for the memory manager\n\n\t\t\tthis._byClipCacheIndex = null; // for the memory manager\n\n\t\t\tthis._timeScaleInterpolant = null;\n\t\t\tthis._weightInterpolant = null;\n\t\t\tthis.loop = LoopRepeat;\n\t\t\tthis._loopCount = -1; // global mixer time when the action is to be started\n\t\t\t// it's set back to 'null' upon start of the action\n\n\t\t\tthis._startTime = null; // scaled local time of the action\n\t\t\t// gets clamped or wrapped to 0..clip.duration according to loop\n\n\t\t\tthis.time = 0;\n\t\t\tthis.timeScale = 1;\n\t\t\tthis._effectiveTimeScale = 1;\n\t\t\tthis.weight = 1;\n\t\t\tthis._effectiveWeight = 1;\n\t\t\tthis.repetitions = Infinity; // no. of repetitions when looping\n\n\t\t\tthis.paused = false; // true -> zero effective time scale\n\n\t\t\tthis.enabled = true; // false -> zero effective weight\n\n\t\t\tthis.clampWhenFinished = false; // keep feeding the last frame?\n\n\t\t\tthis.zeroSlopeAtStart = true; // for smooth interpolation w/o separate\n\n\t\t\tthis.zeroSlopeAtEnd = true; // clips for start, loop and end\n\t\t} // State & Scheduling\n\n\n\t\tplay() {\n\t\t\tthis._mixer._activateAction(this);\n\n\t\t\treturn this;\n\t\t}\n\n\t\tstop() {\n\t\t\tthis._mixer._deactivateAction(this);\n\n\t\t\treturn this.reset();\n\t\t}\n\n\t\treset() {\n\t\t\tthis.paused = false;\n\t\t\tthis.enabled = true;\n\t\t\tthis.time = 0; // restart clip\n\n\t\t\tthis._loopCount = -1; // forget previous loops\n\n\t\t\tthis._startTime = null; // forget scheduling\n\n\t\t\treturn this.stopFading().stopWarping();\n\t\t}\n\n\t\tisRunning() {\n\t\t\treturn this.enabled && !this.paused && this.timeScale !== 0 && this._startTime === null && this._mixer._isActiveAction(this);\n\t\t} // return true when play has been called\n\n\n\t\tisScheduled() {\n\t\t\treturn this._mixer._isActiveAction(this);\n\t\t}\n\n\t\tstartAt(time) {\n\t\t\tthis._startTime = time;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetLoop(mode, repetitions) {\n\t\t\tthis.loop = mode;\n\t\t\tthis.repetitions = repetitions;\n\t\t\treturn this;\n\t\t} // Weight\n\t\t// set the weight stopping any scheduled fading\n\t\t// although .enabled = false yields an effective weight of zero, this\n\t\t// method does *not* change .enabled, because it would be confusing\n\n\n\t\tsetEffectiveWeight(weight) {\n\t\t\tthis.weight = weight; // note: same logic as when updated at runtime\n\n\t\t\tthis._effectiveWeight = this.enabled ? weight : 0;\n\t\t\treturn this.stopFading();\n\t\t} // return the weight considering fading and .enabled\n\n\n\t\tgetEffectiveWeight() {\n\t\t\treturn this._effectiveWeight;\n\t\t}\n\n\t\tfadeIn(duration) {\n\t\t\treturn this._scheduleFading(duration, 0, 1);\n\t\t}\n\n\t\tfadeOut(duration) {\n\t\t\treturn this._scheduleFading(duration, 1, 0);\n\t\t}\n\n\t\tcrossFadeFrom(fadeOutAction, duration, warp) {\n\t\t\tfadeOutAction.fadeOut(duration);\n\t\t\tthis.fadeIn(duration);\n\n\t\t\tif (warp) {\n\t\t\t\tconst fadeInDuration = this._clip.duration,\n\t\t\t\t\t\t\tfadeOutDuration = fadeOutAction._clip.duration,\n\t\t\t\t\t\t\tstartEndRatio = fadeOutDuration / fadeInDuration,\n\t\t\t\t\t\t\tendStartRatio = fadeInDuration / fadeOutDuration;\n\t\t\t\tfadeOutAction.warp(1.0, startEndRatio, duration);\n\t\t\t\tthis.warp(endStartRatio, 1.0, duration);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tcrossFadeTo(fadeInAction, duration, warp) {\n\t\t\treturn fadeInAction.crossFadeFrom(this, duration, warp);\n\t\t}\n\n\t\tstopFading() {\n\t\t\tconst weightInterpolant = this._weightInterpolant;\n\n\t\t\tif (weightInterpolant !== null) {\n\t\t\t\tthis._weightInterpolant = null;\n\n\t\t\t\tthis._mixer._takeBackControlInterpolant(weightInterpolant);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // Time Scale Control\n\t\t// set the time scale stopping any scheduled warping\n\t\t// although .paused = true yields an effective time scale of zero, this\n\t\t// method does *not* change .paused, because it would be confusing\n\n\n\t\tsetEffectiveTimeScale(timeScale) {\n\t\t\tthis.timeScale = timeScale;\n\t\t\tthis._effectiveTimeScale = this.paused ? 0 : timeScale;\n\t\t\treturn this.stopWarping();\n\t\t} // return the time scale considering warping and .paused\n\n\n\t\tgetEffectiveTimeScale() {\n\t\t\treturn this._effectiveTimeScale;\n\t\t}\n\n\t\tsetDuration(duration) {\n\t\t\tthis.timeScale = this._clip.duration / duration;\n\t\t\treturn this.stopWarping();\n\t\t}\n\n\t\tsyncWith(action) {\n\t\t\tthis.time = action.time;\n\t\t\tthis.timeScale = action.timeScale;\n\t\t\treturn this.stopWarping();\n\t\t}\n\n\t\thalt(duration) {\n\t\t\treturn this.warp(this._effectiveTimeScale, 0, duration);\n\t\t}\n\n\t\twarp(startTimeScale, endTimeScale, duration) {\n\t\t\tconst mixer = this._mixer,\n\t\t\t\t\t\tnow = mixer.time,\n\t\t\t\t\t\ttimeScale = this.timeScale;\n\t\t\tlet interpolant = this._timeScaleInterpolant;\n\n\t\t\tif (interpolant === null) {\n\t\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\t\tthis._timeScaleInterpolant = interpolant;\n\t\t\t}\n\n\t\t\tconst times = interpolant.parameterPositions,\n\t\t\t\t\t\tvalues = interpolant.sampleValues;\n\t\t\ttimes[0] = now;\n\t\t\ttimes[1] = now + duration;\n\t\t\tvalues[0] = startTimeScale / timeScale;\n\t\t\tvalues[1] = endTimeScale / timeScale;\n\t\t\treturn this;\n\t\t}\n\n\t\tstopWarping() {\n\t\t\tconst timeScaleInterpolant = this._timeScaleInterpolant;\n\n\t\t\tif (timeScaleInterpolant !== null) {\n\t\t\t\tthis._timeScaleInterpolant = null;\n\n\t\t\t\tthis._mixer._takeBackControlInterpolant(timeScaleInterpolant);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // Object Accessors\n\n\n\t\tgetMixer() {\n\t\t\treturn this._mixer;\n\t\t}\n\n\t\tgetClip() {\n\t\t\treturn this._clip;\n\t\t}\n\n\t\tgetRoot() {\n\t\t\treturn this._localRoot || this._mixer._root;\n\t\t} // Interna\n\n\n\t\t_update(time, deltaTime, timeDirection, accuIndex) {\n\t\t\t// called by the mixer\n\t\t\tif (!this.enabled) {\n\t\t\t\t// call ._updateWeight() to update ._effectiveWeight\n\t\t\t\tthis._updateWeight(time);\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst startTime = this._startTime;\n\n\t\t\tif (startTime !== null) {\n\t\t\t\t// check for scheduled start of action\n\t\t\t\tconst timeRunning = (time - startTime) * timeDirection;\n\n\t\t\t\tif (timeRunning < 0 || timeDirection === 0) {\n\t\t\t\t\treturn; // yet to come / don't decide when delta = 0\n\t\t\t\t} // start\n\n\n\t\t\t\tthis._startTime = null; // unschedule\n\n\t\t\t\tdeltaTime = timeDirection * timeRunning;\n\t\t\t} // apply time scale and advance time\n\n\n\t\t\tdeltaTime *= this._updateTimeScale(time);\n\n\t\t\tconst clipTime = this._updateTime(deltaTime); // note: _updateTime may disable the action resulting in\n\t\t\t// an effective weight of 0\n\n\n\t\t\tconst weight = this._updateWeight(time);\n\n\t\t\tif (weight > 0) {\n\t\t\t\tconst interpolants = this._interpolants;\n\t\t\t\tconst propertyMixers = this._propertyBindings;\n\n\t\t\t\tswitch (this.blendMode) {\n\t\t\t\t\tcase AdditiveAnimationBlendMode:\n\t\t\t\t\t\tfor (let j = 0, m = interpolants.length; j !== m; ++j) {\n\t\t\t\t\t\t\tinterpolants[j].evaluate(clipTime);\n\t\t\t\t\t\t\tpropertyMixers[j].accumulateAdditive(weight);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase NormalAnimationBlendMode:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfor (let j = 0, m = interpolants.length; j !== m; ++j) {\n\t\t\t\t\t\t\tinterpolants[j].evaluate(clipTime);\n\t\t\t\t\t\t\tpropertyMixers[j].accumulate(accuIndex, weight);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_updateWeight(time) {\n\t\t\tlet weight = 0;\n\n\t\t\tif (this.enabled) {\n\t\t\t\tweight = this.weight;\n\t\t\t\tconst interpolant = this._weightInterpolant;\n\n\t\t\t\tif (interpolant !== null) {\n\t\t\t\t\tconst interpolantValue = interpolant.evaluate(time)[0];\n\t\t\t\t\tweight *= interpolantValue;\n\n\t\t\t\t\tif (time > interpolant.parameterPositions[1]) {\n\t\t\t\t\t\tthis.stopFading();\n\n\t\t\t\t\t\tif (interpolantValue === 0) {\n\t\t\t\t\t\t\t// faded out, disable\n\t\t\t\t\t\t\tthis.enabled = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._effectiveWeight = weight;\n\t\t\treturn weight;\n\t\t}\n\n\t\t_updateTimeScale(time) {\n\t\t\tlet timeScale = 0;\n\n\t\t\tif (!this.paused) {\n\t\t\t\ttimeScale = this.timeScale;\n\t\t\t\tconst interpolant = this._timeScaleInterpolant;\n\n\t\t\t\tif (interpolant !== null) {\n\t\t\t\t\tconst interpolantValue = interpolant.evaluate(time)[0];\n\t\t\t\t\ttimeScale *= interpolantValue;\n\n\t\t\t\t\tif (time > interpolant.parameterPositions[1]) {\n\t\t\t\t\t\tthis.stopWarping();\n\n\t\t\t\t\t\tif (timeScale === 0) {\n\t\t\t\t\t\t\t// motion has halted, pause\n\t\t\t\t\t\t\tthis.paused = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// warp done - apply final time scale\n\t\t\t\t\t\t\tthis.timeScale = timeScale;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis._effectiveTimeScale = timeScale;\n\t\t\treturn timeScale;\n\t\t}\n\n\t\t_updateTime(deltaTime) {\n\t\t\tconst duration = this._clip.duration;\n\t\t\tconst loop = this.loop;\n\t\t\tlet time = this.time + deltaTime;\n\t\t\tlet loopCount = this._loopCount;\n\t\t\tconst pingPong = loop === LoopPingPong;\n\n\t\t\tif (deltaTime === 0) {\n\t\t\t\tif (loopCount === -1) return time;\n\t\t\t\treturn pingPong && (loopCount & 1) === 1 ? duration - time : time;\n\t\t\t}\n\n\t\t\tif (loop === LoopOnce) {\n\t\t\t\tif (loopCount === -1) {\n\t\t\t\t\t// just started\n\t\t\t\t\tthis._loopCount = 0;\n\n\t\t\t\t\tthis._setEndings(true, true, false);\n\t\t\t\t}\n\n\t\t\t\thandle_stop: {\n\t\t\t\t\tif (time >= duration) {\n\t\t\t\t\t\ttime = duration;\n\t\t\t\t\t} else if (time < 0) {\n\t\t\t\t\t\ttime = 0;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.time = time;\n\t\t\t\t\t\tbreak handle_stop;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (this.clampWhenFinished) this.paused = true;else this.enabled = false;\n\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\tthis._mixer.dispatchEvent({\n\t\t\t\t\t\ttype: 'finished',\n\t\t\t\t\t\taction: this,\n\t\t\t\t\t\tdirection: deltaTime < 0 ? -1 : 1\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// repetitive Repeat or PingPong\n\t\t\t\tif (loopCount === -1) {\n\t\t\t\t\t// just started\n\t\t\t\t\tif (deltaTime >= 0) {\n\t\t\t\t\t\tloopCount = 0;\n\n\t\t\t\t\t\tthis._setEndings(true, this.repetitions === 0, pingPong);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// when looping in reverse direction, the initial\n\t\t\t\t\t\t// transition through zero counts as a repetition,\n\t\t\t\t\t\t// so leave loopCount at -1\n\t\t\t\t\t\tthis._setEndings(this.repetitions === 0, true, pingPong);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (time >= duration || time < 0) {\n\t\t\t\t\t// wrap around\n\t\t\t\t\tconst loopDelta = Math.floor(time / duration); // signed\n\n\t\t\t\t\ttime -= duration * loopDelta;\n\t\t\t\t\tloopCount += Math.abs(loopDelta);\n\t\t\t\t\tconst pending = this.repetitions - loopCount;\n\n\t\t\t\t\tif (pending <= 0) {\n\t\t\t\t\t\t// have to stop (switch state, clamp time, fire event)\n\t\t\t\t\t\tif (this.clampWhenFinished) this.paused = true;else this.enabled = false;\n\t\t\t\t\t\ttime = deltaTime > 0 ? duration : 0;\n\t\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\t\tthis._mixer.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'finished',\n\t\t\t\t\t\t\taction: this,\n\t\t\t\t\t\t\tdirection: deltaTime > 0 ? 1 : -1\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// keep running\n\t\t\t\t\t\tif (pending === 1) {\n\t\t\t\t\t\t\t// entering the last round\n\t\t\t\t\t\t\tconst atStart = deltaTime < 0;\n\n\t\t\t\t\t\t\tthis._setEndings(atStart, !atStart, pingPong);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis._setEndings(false, false, pingPong);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._loopCount = loopCount;\n\t\t\t\t\t\tthis.time = time;\n\n\t\t\t\t\t\tthis._mixer.dispatchEvent({\n\t\t\t\t\t\t\ttype: 'loop',\n\t\t\t\t\t\t\taction: this,\n\t\t\t\t\t\t\tloopDelta: loopDelta\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.time = time;\n\t\t\t\t}\n\n\t\t\t\tif (pingPong && (loopCount & 1) === 1) {\n\t\t\t\t\t// invert time for the \"pong round\"\n\t\t\t\t\treturn duration - time;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn time;\n\t\t}\n\n\t\t_setEndings(atStart, atEnd, pingPong) {\n\t\t\tconst settings = this._interpolantSettings;\n\n\t\t\tif (pingPong) {\n\t\t\t\tsettings.endingStart = ZeroSlopeEnding;\n\t\t\t\tsettings.endingEnd = ZeroSlopeEnding;\n\t\t\t} else {\n\t\t\t\t// assuming for LoopOnce atStart == atEnd == true\n\t\t\t\tif (atStart) {\n\t\t\t\t\tsettings.endingStart = this.zeroSlopeAtStart ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\t\t\t\t} else {\n\t\t\t\t\tsettings.endingStart = WrapAroundEnding;\n\t\t\t\t}\n\n\t\t\t\tif (atEnd) {\n\t\t\t\t\tsettings.endingEnd = this.zeroSlopeAtEnd ? ZeroSlopeEnding : ZeroCurvatureEnding;\n\t\t\t\t} else {\n\t\t\t\t\tsettings.endingEnd = WrapAroundEnding;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_scheduleFading(duration, weightNow, weightThen) {\n\t\t\tconst mixer = this._mixer,\n\t\t\t\t\t\tnow = mixer.time;\n\t\t\tlet interpolant = this._weightInterpolant;\n\n\t\t\tif (interpolant === null) {\n\t\t\t\tinterpolant = mixer._lendControlInterpolant();\n\t\t\t\tthis._weightInterpolant = interpolant;\n\t\t\t}\n\n\t\t\tconst times = interpolant.parameterPositions,\n\t\t\t\t\t\tvalues = interpolant.sampleValues;\n\t\t\ttimes[0] = now;\n\t\t\tvalues[0] = weightNow;\n\t\t\ttimes[1] = now + duration;\n\t\t\tvalues[1] = weightThen;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass AnimationMixer extends EventDispatcher {\n\t\tconstructor(root) {\n\t\t\tsuper();\n\t\t\tthis._root = root;\n\n\t\t\tthis._initMemoryManager();\n\n\t\t\tthis._accuIndex = 0;\n\t\t\tthis.time = 0;\n\t\t\tthis.timeScale = 1.0;\n\t\t}\n\n\t\t_bindAction(action, prototypeAction) {\n\t\t\tconst root = action._localRoot || this._root,\n\t\t\t\t\t\ttracks = action._clip.tracks,\n\t\t\t\t\t\tnTracks = tracks.length,\n\t\t\t\t\t\tbindings = action._propertyBindings,\n\t\t\t\t\t\tinterpolants = action._interpolants,\n\t\t\t\t\t\trootUuid = root.uuid,\n\t\t\t\t\t\tbindingsByRoot = this._bindingsByRootAndName;\n\t\t\tlet bindingsByName = bindingsByRoot[rootUuid];\n\n\t\t\tif (bindingsByName === undefined) {\n\t\t\t\tbindingsByName = {};\n\t\t\t\tbindingsByRoot[rootUuid] = bindingsByName;\n\t\t\t}\n\n\t\t\tfor (let i = 0; i !== nTracks; ++i) {\n\t\t\t\tconst track = tracks[i],\n\t\t\t\t\t\t\ttrackName = track.name;\n\t\t\t\tlet binding = bindingsByName[trackName];\n\n\t\t\t\tif (binding !== undefined) {\n\t\t\t\t\tbindings[i] = binding;\n\t\t\t\t} else {\n\t\t\t\t\tbinding = bindings[i];\n\n\t\t\t\t\tif (binding !== undefined) {\n\t\t\t\t\t\t// existing binding, make sure the cache knows\n\t\t\t\t\t\tif (binding._cacheIndex === null) {\n\t\t\t\t\t\t\t++binding.referenceCount;\n\n\t\t\t\t\t\t\tthis._addInactiveBinding(binding, rootUuid, trackName);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst path = prototypeAction && prototypeAction._propertyBindings[i].binding.parsedPath;\n\t\t\t\t\tbinding = new PropertyMixer(PropertyBinding.create(root, trackName, path), track.ValueTypeName, track.getValueSize());\n\t\t\t\t\t++binding.referenceCount;\n\n\t\t\t\t\tthis._addInactiveBinding(binding, rootUuid, trackName);\n\n\t\t\t\t\tbindings[i] = binding;\n\t\t\t\t}\n\n\t\t\t\tinterpolants[i].resultBuffer = binding.buffer;\n\t\t\t}\n\t\t}\n\n\t\t_activateAction(action) {\n\t\t\tif (!this._isActiveAction(action)) {\n\t\t\t\tif (action._cacheIndex === null) {\n\t\t\t\t\t// this action has been forgotten by the cache, but the user\n\t\t\t\t\t// appears to be still using it -> rebind\n\t\t\t\t\tconst rootUuid = (action._localRoot || this._root).uuid,\n\t\t\t\t\t\t\t\tclipUuid = action._clip.uuid,\n\t\t\t\t\t\t\t\tactionsForClip = this._actionsByClip[clipUuid];\n\n\t\t\t\t\tthis._bindAction(action, actionsForClip && actionsForClip.knownActions[0]);\n\n\t\t\t\t\tthis._addInactiveAction(action, clipUuid, rootUuid);\n\t\t\t\t}\n\n\t\t\t\tconst bindings = action._propertyBindings; // increment reference counts / sort out state\n\n\t\t\t\tfor (let i = 0, n = bindings.length; i !== n; ++i) {\n\t\t\t\t\tconst binding = bindings[i];\n\n\t\t\t\t\tif (binding.useCount++ === 0) {\n\t\t\t\t\t\tthis._lendBinding(binding);\n\n\t\t\t\t\t\tbinding.saveOriginalState();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._lendAction(action);\n\t\t\t}\n\t\t}\n\n\t\t_deactivateAction(action) {\n\t\t\tif (this._isActiveAction(action)) {\n\t\t\t\tconst bindings = action._propertyBindings; // decrement reference counts / sort out state\n\n\t\t\t\tfor (let i = 0, n = bindings.length; i !== n; ++i) {\n\t\t\t\t\tconst binding = bindings[i];\n\n\t\t\t\t\tif (--binding.useCount === 0) {\n\t\t\t\t\t\tbinding.restoreOriginalState();\n\n\t\t\t\t\t\tthis._takeBackBinding(binding);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tthis._takeBackAction(action);\n\t\t\t}\n\t\t} // Memory manager\n\n\n\t\t_initMemoryManager() {\n\t\t\tthis._actions = []; // 'nActiveActions' followed by inactive ones\n\n\t\t\tthis._nActiveActions = 0;\n\t\t\tthis._actionsByClip = {}; // inside:\n\t\t\t// {\n\t\t\t// \tknownActions: Array< AnimationAction > - used as prototypes\n\t\t\t// \tactionByRoot: AnimationAction - lookup\n\t\t\t// }\n\n\t\t\tthis._bindings = []; // 'nActiveBindings' followed by inactive ones\n\n\t\t\tthis._nActiveBindings = 0;\n\t\t\tthis._bindingsByRootAndName = {}; // inside: Map< name, PropertyMixer >\n\n\t\t\tthis._controlInterpolants = []; // same game as above\n\n\t\t\tthis._nActiveControlInterpolants = 0;\n\t\t\tconst scope = this;\n\t\t\tthis.stats = {\n\t\t\t\tactions: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._actions.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn scope._nActiveActions;\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tbindings: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._bindings.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn scope._nActiveBindings;\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\tcontrolInterpolants: {\n\t\t\t\t\tget total() {\n\t\t\t\t\t\treturn scope._controlInterpolants.length;\n\t\t\t\t\t},\n\n\t\t\t\t\tget inUse() {\n\t\t\t\t\t\treturn scope._nActiveControlInterpolants;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t};\n\t\t} // Memory management for AnimationAction objects\n\n\n\t\t_isActiveAction(action) {\n\t\t\tconst index = action._cacheIndex;\n\t\t\treturn index !== null && index < this._nActiveActions;\n\t\t}\n\n\t\t_addInactiveAction(action, clipUuid, rootUuid) {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip;\n\t\t\tlet actionsForClip = actionsByClip[clipUuid];\n\n\t\t\tif (actionsForClip === undefined) {\n\t\t\t\tactionsForClip = {\n\t\t\t\t\tknownActions: [action],\n\t\t\t\t\tactionByRoot: {}\n\t\t\t\t};\n\t\t\t\taction._byClipCacheIndex = 0;\n\t\t\t\tactionsByClip[clipUuid] = actionsForClip;\n\t\t\t} else {\n\t\t\t\tconst knownActions = actionsForClip.knownActions;\n\t\t\t\taction._byClipCacheIndex = knownActions.length;\n\t\t\t\tknownActions.push(action);\n\t\t\t}\n\n\t\t\taction._cacheIndex = actions.length;\n\t\t\tactions.push(action);\n\t\t\tactionsForClip.actionByRoot[rootUuid] = action;\n\t\t}\n\n\t\t_removeInactiveAction(action) {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tlastInactiveAction = actions[actions.length - 1],\n\t\t\t\t\t\tcacheIndex = action._cacheIndex;\n\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\tactions[cacheIndex] = lastInactiveAction;\n\t\t\tactions.pop();\n\t\t\taction._cacheIndex = null;\n\t\t\tconst clipUuid = action._clip.uuid,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\t\t\tactionsForClip = actionsByClip[clipUuid],\n\t\t\t\t\t\tknownActionsForClip = actionsForClip.knownActions,\n\t\t\t\t\t\tlastKnownAction = knownActionsForClip[knownActionsForClip.length - 1],\n\t\t\t\t\t\tbyClipCacheIndex = action._byClipCacheIndex;\n\t\t\tlastKnownAction._byClipCacheIndex = byClipCacheIndex;\n\t\t\tknownActionsForClip[byClipCacheIndex] = lastKnownAction;\n\t\t\tknownActionsForClip.pop();\n\t\t\taction._byClipCacheIndex = null;\n\t\t\tconst actionByRoot = actionsForClip.actionByRoot,\n\t\t\t\t\t\trootUuid = (action._localRoot || this._root).uuid;\n\t\t\tdelete actionByRoot[rootUuid];\n\n\t\t\tif (knownActionsForClip.length === 0) {\n\t\t\t\tdelete actionsByClip[clipUuid];\n\t\t\t}\n\n\t\t\tthis._removeInactiveBindingsForAction(action);\n\t\t}\n\n\t\t_removeInactiveBindingsForAction(action) {\n\t\t\tconst bindings = action._propertyBindings;\n\n\t\t\tfor (let i = 0, n = bindings.length; i !== n; ++i) {\n\t\t\t\tconst binding = bindings[i];\n\n\t\t\t\tif (--binding.referenceCount === 0) {\n\t\t\t\t\tthis._removeInactiveBinding(binding);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t_lendAction(action) {\n\t\t\t// [ active actions |\tinactive actions\t]\n\t\t\t// [\tactive actions >| inactive actions ]\n\t\t\t//\t\t\t\t\t\t\t\t s\t\t\t\ta\n\t\t\t//\t\t\t\t\t\t\t\t\t<-swap->\n\t\t\t//\t\t\t\t\t\t\t\t a\t\t\t\ts\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tprevIndex = action._cacheIndex,\n\t\t\t\t\t\tlastActiveIndex = this._nActiveActions++,\n\t\t\t\t\t\tfirstInactiveAction = actions[lastActiveIndex];\n\t\t\taction._cacheIndex = lastActiveIndex;\n\t\t\tactions[lastActiveIndex] = action;\n\t\t\tfirstInactiveAction._cacheIndex = prevIndex;\n\t\t\tactions[prevIndex] = firstInactiveAction;\n\t\t}\n\n\t\t_takeBackAction(action) {\n\t\t\t// [\tactive actions\t| inactive actions ]\n\t\t\t// [ active actions |< inactive actions\t]\n\t\t\t//\t\t\t\ta\t\t\t\ts\n\t\t\t//\t\t\t\t <-swap->\n\t\t\t//\t\t\t\ts\t\t\t\ta\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tprevIndex = action._cacheIndex,\n\t\t\t\t\t\tfirstInactiveIndex = --this._nActiveActions,\n\t\t\t\t\t\tlastActiveAction = actions[firstInactiveIndex];\n\t\t\taction._cacheIndex = firstInactiveIndex;\n\t\t\tactions[firstInactiveIndex] = action;\n\t\t\tlastActiveAction._cacheIndex = prevIndex;\n\t\t\tactions[prevIndex] = lastActiveAction;\n\t\t} // Memory management for PropertyMixer objects\n\n\n\t\t_addInactiveBinding(binding, rootUuid, trackName) {\n\t\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\t\t\tbindings = this._bindings;\n\t\t\tlet bindingByName = bindingsByRoot[rootUuid];\n\n\t\t\tif (bindingByName === undefined) {\n\t\t\t\tbindingByName = {};\n\t\t\t\tbindingsByRoot[rootUuid] = bindingByName;\n\t\t\t}\n\n\t\t\tbindingByName[trackName] = binding;\n\t\t\tbinding._cacheIndex = bindings.length;\n\t\t\tbindings.push(binding);\n\t\t}\n\n\t\t_removeInactiveBinding(binding) {\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tpropBinding = binding.binding,\n\t\t\t\t\t\trootUuid = propBinding.rootNode.uuid,\n\t\t\t\t\t\ttrackName = propBinding.path,\n\t\t\t\t\t\tbindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\t\t\tbindingByName = bindingsByRoot[rootUuid],\n\t\t\t\t\t\tlastInactiveBinding = bindings[bindings.length - 1],\n\t\t\t\t\t\tcacheIndex = binding._cacheIndex;\n\t\t\tlastInactiveBinding._cacheIndex = cacheIndex;\n\t\t\tbindings[cacheIndex] = lastInactiveBinding;\n\t\t\tbindings.pop();\n\t\t\tdelete bindingByName[trackName];\n\n\t\t\tif (Object.keys(bindingByName).length === 0) {\n\t\t\t\tdelete bindingsByRoot[rootUuid];\n\t\t\t}\n\t\t}\n\n\t\t_lendBinding(binding) {\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tprevIndex = binding._cacheIndex,\n\t\t\t\t\t\tlastActiveIndex = this._nActiveBindings++,\n\t\t\t\t\t\tfirstInactiveBinding = bindings[lastActiveIndex];\n\t\t\tbinding._cacheIndex = lastActiveIndex;\n\t\t\tbindings[lastActiveIndex] = binding;\n\t\t\tfirstInactiveBinding._cacheIndex = prevIndex;\n\t\t\tbindings[prevIndex] = firstInactiveBinding;\n\t\t}\n\n\t\t_takeBackBinding(binding) {\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tprevIndex = binding._cacheIndex,\n\t\t\t\t\t\tfirstInactiveIndex = --this._nActiveBindings,\n\t\t\t\t\t\tlastActiveBinding = bindings[firstInactiveIndex];\n\t\t\tbinding._cacheIndex = firstInactiveIndex;\n\t\t\tbindings[firstInactiveIndex] = binding;\n\t\t\tlastActiveBinding._cacheIndex = prevIndex;\n\t\t\tbindings[prevIndex] = lastActiveBinding;\n\t\t} // Memory management of Interpolants for weight and time scale\n\n\n\t\t_lendControlInterpolant() {\n\t\t\tconst interpolants = this._controlInterpolants,\n\t\t\t\t\t\tlastActiveIndex = this._nActiveControlInterpolants++;\n\t\t\tlet interpolant = interpolants[lastActiveIndex];\n\n\t\t\tif (interpolant === undefined) {\n\t\t\t\tinterpolant = new LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer);\n\t\t\t\tinterpolant.__cacheIndex = lastActiveIndex;\n\t\t\t\tinterpolants[lastActiveIndex] = interpolant;\n\t\t\t}\n\n\t\t\treturn interpolant;\n\t\t}\n\n\t\t_takeBackControlInterpolant(interpolant) {\n\t\t\tconst interpolants = this._controlInterpolants,\n\t\t\t\t\t\tprevIndex = interpolant.__cacheIndex,\n\t\t\t\t\t\tfirstInactiveIndex = --this._nActiveControlInterpolants,\n\t\t\t\t\t\tlastActiveInterpolant = interpolants[firstInactiveIndex];\n\t\t\tinterpolant.__cacheIndex = firstInactiveIndex;\n\t\t\tinterpolants[firstInactiveIndex] = interpolant;\n\t\t\tlastActiveInterpolant.__cacheIndex = prevIndex;\n\t\t\tinterpolants[prevIndex] = lastActiveInterpolant;\n\t\t} // return an action for a clip optionally using a custom root target\n\t\t// object (this method allocates a lot of dynamic memory in case a\n\t\t// previously unknown clip/root combination is specified)\n\n\n\t\tclipAction(clip, optionalRoot, blendMode) {\n\t\t\tconst root = optionalRoot || this._root,\n\t\t\t\t\t\trootUuid = root.uuid;\n\t\t\tlet clipObject = typeof clip === 'string' ? AnimationClip.findByName(root, clip) : clip;\n\t\t\tconst clipUuid = clipObject !== null ? clipObject.uuid : clip;\n\t\t\tconst actionsForClip = this._actionsByClip[clipUuid];\n\t\t\tlet prototypeAction = null;\n\n\t\t\tif (blendMode === undefined) {\n\t\t\t\tif (clipObject !== null) {\n\t\t\t\t\tblendMode = clipObject.blendMode;\n\t\t\t\t} else {\n\t\t\t\t\tblendMode = NormalAnimationBlendMode;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (actionsForClip !== undefined) {\n\t\t\t\tconst existingAction = actionsForClip.actionByRoot[rootUuid];\n\n\t\t\t\tif (existingAction !== undefined && existingAction.blendMode === blendMode) {\n\t\t\t\t\treturn existingAction;\n\t\t\t\t} // we know the clip, so we don't have to parse all\n\t\t\t\t// the bindings again but can just copy\n\n\n\t\t\t\tprototypeAction = actionsForClip.knownActions[0]; // also, take the clip from the prototype action\n\n\t\t\t\tif (clipObject === null) clipObject = prototypeAction._clip;\n\t\t\t} // clip must be known when specified via string\n\n\n\t\t\tif (clipObject === null) return null; // allocate all resources required to run it\n\n\t\t\tconst newAction = new AnimationAction(this, clipObject, optionalRoot, blendMode);\n\n\t\t\tthis._bindAction(newAction, prototypeAction); // and make the action known to the memory manager\n\n\n\t\t\tthis._addInactiveAction(newAction, clipUuid, rootUuid);\n\n\t\t\treturn newAction;\n\t\t} // get an existing action\n\n\n\t\texistingAction(clip, optionalRoot) {\n\t\t\tconst root = optionalRoot || this._root,\n\t\t\t\t\t\trootUuid = root.uuid,\n\t\t\t\t\t\tclipObject = typeof clip === 'string' ? AnimationClip.findByName(root, clip) : clip,\n\t\t\t\t\t\tclipUuid = clipObject ? clipObject.uuid : clip,\n\t\t\t\t\t\tactionsForClip = this._actionsByClip[clipUuid];\n\n\t\t\tif (actionsForClip !== undefined) {\n\t\t\t\treturn actionsForClip.actionByRoot[rootUuid] || null;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} // deactivates all previously scheduled actions\n\n\n\t\tstopAllAction() {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tnActions = this._nActiveActions;\n\n\t\t\tfor (let i = nActions - 1; i >= 0; --i) {\n\t\t\t\tactions[i].stop();\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // advance the time and update apply the animation\n\n\n\t\tupdate(deltaTime) {\n\t\t\tdeltaTime *= this.timeScale;\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tnActions = this._nActiveActions,\n\t\t\t\t\t\ttime = this.time += deltaTime,\n\t\t\t\t\t\ttimeDirection = Math.sign(deltaTime),\n\t\t\t\t\t\taccuIndex = this._accuIndex ^= 1; // run active actions\n\n\t\t\tfor (let i = 0; i !== nActions; ++i) {\n\t\t\t\tconst action = actions[i];\n\n\t\t\t\taction._update(time, deltaTime, timeDirection, accuIndex);\n\t\t\t} // update scene graph\n\n\n\t\t\tconst bindings = this._bindings,\n\t\t\t\t\t\tnBindings = this._nActiveBindings;\n\n\t\t\tfor (let i = 0; i !== nBindings; ++i) {\n\t\t\t\tbindings[i].apply(accuIndex);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t} // Allows you to seek to a specific time in an animation.\n\n\n\t\tsetTime(timeInSeconds) {\n\t\t\tthis.time = 0; // Zero out time attribute for AnimationMixer object;\n\n\t\t\tfor (let i = 0; i < this._actions.length; i++) {\n\t\t\t\tthis._actions[i].time = 0; // Zero out time attribute for all associated AnimationAction objects.\n\t\t\t}\n\n\t\t\treturn this.update(timeInSeconds); // Update used to set exact time. Returns \"this\" AnimationMixer object.\n\t\t} // return this mixer's root target object\n\n\n\t\tgetRoot() {\n\t\t\treturn this._root;\n\t\t} // free all resources specific to a particular clip\n\n\n\t\tuncacheClip(clip) {\n\t\t\tconst actions = this._actions,\n\t\t\t\t\t\tclipUuid = clip.uuid,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip,\n\t\t\t\t\t\tactionsForClip = actionsByClip[clipUuid];\n\n\t\t\tif (actionsForClip !== undefined) {\n\t\t\t\t// note: just calling _removeInactiveAction would mess up the\n\t\t\t\t// iteration state and also require updating the state we can\n\t\t\t\t// just throw away\n\t\t\t\tconst actionsToRemove = actionsForClip.knownActions;\n\n\t\t\t\tfor (let i = 0, n = actionsToRemove.length; i !== n; ++i) {\n\t\t\t\t\tconst action = actionsToRemove[i];\n\n\t\t\t\t\tthis._deactivateAction(action);\n\n\t\t\t\t\tconst cacheIndex = action._cacheIndex,\n\t\t\t\t\t\t\t\tlastInactiveAction = actions[actions.length - 1];\n\t\t\t\t\taction._cacheIndex = null;\n\t\t\t\t\taction._byClipCacheIndex = null;\n\t\t\t\t\tlastInactiveAction._cacheIndex = cacheIndex;\n\t\t\t\t\tactions[cacheIndex] = lastInactiveAction;\n\t\t\t\t\tactions.pop();\n\n\t\t\t\t\tthis._removeInactiveBindingsForAction(action);\n\t\t\t\t}\n\n\t\t\t\tdelete actionsByClip[clipUuid];\n\t\t\t}\n\t\t} // free all resources specific to a particular root target object\n\n\n\t\tuncacheRoot(root) {\n\t\t\tconst rootUuid = root.uuid,\n\t\t\t\t\t\tactionsByClip = this._actionsByClip;\n\n\t\t\tfor (const clipUuid in actionsByClip) {\n\t\t\t\tconst actionByRoot = actionsByClip[clipUuid].actionByRoot,\n\t\t\t\t\t\t\taction = actionByRoot[rootUuid];\n\n\t\t\t\tif (action !== undefined) {\n\t\t\t\t\tthis._deactivateAction(action);\n\n\t\t\t\t\tthis._removeInactiveAction(action);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst bindingsByRoot = this._bindingsByRootAndName,\n\t\t\t\t\t\tbindingByName = bindingsByRoot[rootUuid];\n\n\t\t\tif (bindingByName !== undefined) {\n\t\t\t\tfor (const trackName in bindingByName) {\n\t\t\t\t\tconst binding = bindingByName[trackName];\n\t\t\t\t\tbinding.restoreOriginalState();\n\n\t\t\t\t\tthis._removeInactiveBinding(binding);\n\t\t\t\t}\n\t\t\t}\n\t\t} // remove a targeted clip from the cache\n\n\n\t\tuncacheAction(clip, optionalRoot) {\n\t\t\tconst action = this.existingAction(clip, optionalRoot);\n\n\t\t\tif (action !== null) {\n\t\t\t\tthis._deactivateAction(action);\n\n\t\t\t\tthis._removeInactiveAction(action);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tAnimationMixer.prototype._controlInterpolantsResultBuffer = new Float32Array(1);\n\n\tclass Uniform {\n\t\tconstructor(value) {\n\t\t\tif (typeof value === 'string') {\n\t\t\t\tconsole.warn('THREE.Uniform: Type parameter is no longer needed.');\n\t\t\t\tvalue = arguments[1];\n\t\t\t}\n\n\t\t\tthis.value = value;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new Uniform(this.value.clone === undefined ? this.value : this.value.clone());\n\t\t}\n\n\t}\n\n\tclass InstancedInterleavedBuffer extends InterleavedBuffer {\n\t\tconstructor(array, stride, meshPerAttribute = 1) {\n\t\t\tsuper(array, stride);\n\t\t\tthis.meshPerAttribute = meshPerAttribute;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source);\n\t\t\tthis.meshPerAttribute = source.meshPerAttribute;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone(data) {\n\t\t\tconst ib = super.clone(data);\n\t\t\tib.meshPerAttribute = this.meshPerAttribute;\n\t\t\treturn ib;\n\t\t}\n\n\t\ttoJSON(data) {\n\t\t\tconst json = super.toJSON(data);\n\t\t\tjson.isInstancedInterleavedBuffer = true;\n\t\t\tjson.meshPerAttribute = this.meshPerAttribute;\n\t\t\treturn json;\n\t\t}\n\n\t}\n\n\tInstancedInterleavedBuffer.prototype.isInstancedInterleavedBuffer = true;\n\n\tclass GLBufferAttribute {\n\t\tconstructor(buffer, type, itemSize, elementSize, count) {\n\t\t\tthis.buffer = buffer;\n\t\t\tthis.type = type;\n\t\t\tthis.itemSize = itemSize;\n\t\t\tthis.elementSize = elementSize;\n\t\t\tthis.count = count;\n\t\t\tthis.version = 0;\n\t\t}\n\n\t\tset needsUpdate(value) {\n\t\t\tif (value === true) this.version++;\n\t\t}\n\n\t\tsetBuffer(buffer) {\n\t\t\tthis.buffer = buffer;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetType(type, elementSize) {\n\t\t\tthis.type = type;\n\t\t\tthis.elementSize = elementSize;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetItemSize(itemSize) {\n\t\t\tthis.itemSize = itemSize;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetCount(count) {\n\t\t\tthis.count = count;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tGLBufferAttribute.prototype.isGLBufferAttribute = true;\n\n\tclass Raycaster {\n\t\tconstructor(origin, direction, near = 0, far = Infinity) {\n\t\t\tthis.ray = new Ray(origin, direction); // direction is assumed to be normalized (for accurate distance calculations)\n\n\t\t\tthis.near = near;\n\t\t\tthis.far = far;\n\t\t\tthis.camera = null;\n\t\t\tthis.layers = new Layers();\n\t\t\tthis.params = {\n\t\t\t\tMesh: {},\n\t\t\t\tLine: {\n\t\t\t\t\tthreshold: 1\n\t\t\t\t},\n\t\t\t\tLOD: {},\n\t\t\t\tPoints: {\n\t\t\t\t\tthreshold: 1\n\t\t\t\t},\n\t\t\t\tSprite: {}\n\t\t\t};\n\t\t}\n\n\t\tset(origin, direction) {\n\t\t\t// direction is assumed to be normalized (for accurate distance calculations)\n\t\t\tthis.ray.set(origin, direction);\n\t\t}\n\n\t\tsetFromCamera(coords, camera) {\n\t\t\tif (camera && camera.isPerspectiveCamera) {\n\t\t\t\tthis.ray.origin.setFromMatrixPosition(camera.matrixWorld);\n\t\t\t\tthis.ray.direction.set(coords.x, coords.y, 0.5).unproject(camera).sub(this.ray.origin).normalize();\n\t\t\t\tthis.camera = camera;\n\t\t\t} else if (camera && camera.isOrthographicCamera) {\n\t\t\t\tthis.ray.origin.set(coords.x, coords.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); // set origin in plane of camera\n\n\t\t\t\tthis.ray.direction.set(0, 0, -1).transformDirection(camera.matrixWorld);\n\t\t\t\tthis.camera = camera;\n\t\t\t} else {\n\t\t\t\tconsole.error('THREE.Raycaster: Unsupported camera type: ' + camera.type);\n\t\t\t}\n\t\t}\n\n\t\tintersectObject(object, recursive = true, intersects = []) {\n\t\t\tintersectObject(object, this, intersects, recursive);\n\t\t\tintersects.sort(ascSort);\n\t\t\treturn intersects;\n\t\t}\n\n\t\tintersectObjects(objects, recursive = true, intersects = []) {\n\t\t\tfor (let i = 0, l = objects.length; i < l; i++) {\n\t\t\t\tintersectObject(objects[i], this, intersects, recursive);\n\t\t\t}\n\n\t\t\tintersects.sort(ascSort);\n\t\t\treturn intersects;\n\t\t}\n\n\t}\n\n\tfunction ascSort(a, b) {\n\t\treturn a.distance - b.distance;\n\t}\n\n\tfunction intersectObject(object, raycaster, intersects, recursive) {\n\t\tif (object.layers.test(raycaster.layers)) {\n\t\t\tobject.raycast(raycaster, intersects);\n\t\t}\n\n\t\tif (recursive === true) {\n\t\t\tconst children = object.children;\n\n\t\t\tfor (let i = 0, l = children.length; i < l; i++) {\n\t\t\t\tintersectObject(children[i], raycaster, intersects, true);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Ref: https://en.wikipedia.org/wiki/Spherical_coordinate_system\n\t *\n\t * The polar angle (phi) is measured from the positive y-axis. The positive y-axis is up.\n\t * The azimuthal angle (theta) is measured from the positive z-axis.\n\t */\n\n\tclass Spherical {\n\t\tconstructor(radius = 1, phi = 0, theta = 0) {\n\t\t\tthis.radius = radius;\n\t\t\tthis.phi = phi; // polar angle\n\n\t\t\tthis.theta = theta; // azimuthal angle\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(radius, phi, theta) {\n\t\t\tthis.radius = radius;\n\t\t\tthis.phi = phi;\n\t\t\tthis.theta = theta;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(other) {\n\t\t\tthis.radius = other.radius;\n\t\t\tthis.phi = other.phi;\n\t\t\tthis.theta = other.theta;\n\t\t\treturn this;\n\t\t} // restrict phi to be betwee EPS and PI-EPS\n\n\n\t\tmakeSafe() {\n\t\t\tconst EPS = 0.000001;\n\t\t\tthis.phi = Math.max(EPS, Math.min(Math.PI - EPS, this.phi));\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromVector3(v) {\n\t\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t\t}\n\n\t\tsetFromCartesianCoords(x, y, z) {\n\t\t\tthis.radius = Math.sqrt(x * x + y * y + z * z);\n\n\t\t\tif (this.radius === 0) {\n\t\t\t\tthis.theta = 0;\n\t\t\t\tthis.phi = 0;\n\t\t\t} else {\n\t\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\t\tthis.phi = Math.acos(clamp(y / this.radius, -1, 1));\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\t/**\n\t * Ref: https://en.wikipedia.org/wiki/Cylindrical_coordinate_system\n\t */\n\tclass Cylindrical {\n\t\tconstructor(radius = 1, theta = 0, y = 0) {\n\t\t\tthis.radius = radius; // distance from the origin to a point in the x-z plane\n\n\t\t\tthis.theta = theta; // counterclockwise angle in the x-z plane measured in radians from the positive z-axis\n\n\t\t\tthis.y = y; // height above the x-z plane\n\n\t\t\treturn this;\n\t\t}\n\n\t\tset(radius, theta, y) {\n\t\t\tthis.radius = radius;\n\t\t\tthis.theta = theta;\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(other) {\n\t\t\tthis.radius = other.radius;\n\t\t\tthis.theta = other.theta;\n\t\t\tthis.y = other.y;\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromVector3(v) {\n\t\t\treturn this.setFromCartesianCoords(v.x, v.y, v.z);\n\t\t}\n\n\t\tsetFromCartesianCoords(x, y, z) {\n\t\t\tthis.radius = Math.sqrt(x * x + z * z);\n\t\t\tthis.theta = Math.atan2(x, z);\n\t\t\tthis.y = y;\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tconst _vector$4 = /*@__PURE__*/new Vector2();\n\n\tclass Box2 {\n\t\tconstructor(min = new Vector2(+Infinity, +Infinity), max = new Vector2(-Infinity, -Infinity)) {\n\t\t\tthis.min = min;\n\t\t\tthis.max = max;\n\t\t}\n\n\t\tset(min, max) {\n\t\t\tthis.min.copy(min);\n\t\t\tthis.max.copy(max);\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromPoints(points) {\n\t\t\tthis.makeEmpty();\n\n\t\t\tfor (let i = 0, il = points.length; i < il; i++) {\n\t\t\t\tthis.expandByPoint(points[i]);\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tsetFromCenterAndSize(center, size) {\n\t\t\tconst halfSize = _vector$4.copy(size).multiplyScalar(0.5);\n\n\t\t\tthis.min.copy(center).sub(halfSize);\n\t\t\tthis.max.copy(center).add(halfSize);\n\t\t\treturn this;\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t\tcopy(box) {\n\t\t\tthis.min.copy(box.min);\n\t\t\tthis.max.copy(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tmakeEmpty() {\n\t\t\tthis.min.x = this.min.y = +Infinity;\n\t\t\tthis.max.x = this.max.y = -Infinity;\n\t\t\treturn this;\n\t\t}\n\n\t\tisEmpty() {\n\t\t\t// this is a more robust check for empty than ( volume <= 0 ) because volume can get positive with two negative axes\n\t\t\treturn this.max.x < this.min.x || this.max.y < this.min.y;\n\t\t}\n\n\t\tgetCenter(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0) : target.addVectors(this.min, this.max).multiplyScalar(0.5);\n\t\t}\n\n\t\tgetSize(target) {\n\t\t\treturn this.isEmpty() ? target.set(0, 0) : target.subVectors(this.max, this.min);\n\t\t}\n\n\t\texpandByPoint(point) {\n\t\t\tthis.min.min(point);\n\t\t\tthis.max.max(point);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByVector(vector) {\n\t\t\tthis.min.sub(vector);\n\t\t\tthis.max.add(vector);\n\t\t\treturn this;\n\t\t}\n\n\t\texpandByScalar(scalar) {\n\t\t\tthis.min.addScalar(-scalar);\n\t\t\tthis.max.addScalar(scalar);\n\t\t\treturn this;\n\t\t}\n\n\t\tcontainsPoint(point) {\n\t\t\treturn point.x < this.min.x || point.x > this.max.x || point.y < this.min.y || point.y > this.max.y ? false : true;\n\t\t}\n\n\t\tcontainsBox(box) {\n\t\t\treturn this.min.x <= box.min.x && box.max.x <= this.max.x && this.min.y <= box.min.y && box.max.y <= this.max.y;\n\t\t}\n\n\t\tgetParameter(point, target) {\n\t\t\t// This can potentially have a divide by zero if the box\n\t\t\t// has a size dimension of 0.\n\t\t\treturn target.set((point.x - this.min.x) / (this.max.x - this.min.x), (point.y - this.min.y) / (this.max.y - this.min.y));\n\t\t}\n\n\t\tintersectsBox(box) {\n\t\t\t// using 4 splitting planes to rule out intersections\n\t\t\treturn box.max.x < this.min.x || box.min.x > this.max.x || box.max.y < this.min.y || box.min.y > this.max.y ? false : true;\n\t\t}\n\n\t\tclampPoint(point, target) {\n\t\t\treturn target.copy(point).clamp(this.min, this.max);\n\t\t}\n\n\t\tdistanceToPoint(point) {\n\t\t\tconst clampedPoint = _vector$4.copy(point).clamp(this.min, this.max);\n\n\t\t\treturn clampedPoint.sub(point).length();\n\t\t}\n\n\t\tintersect(box) {\n\t\t\tthis.min.max(box.min);\n\t\t\tthis.max.min(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\tunion(box) {\n\t\t\tthis.min.min(box.min);\n\t\t\tthis.max.max(box.max);\n\t\t\treturn this;\n\t\t}\n\n\t\ttranslate(offset) {\n\t\t\tthis.min.add(offset);\n\t\t\tthis.max.add(offset);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(box) {\n\t\t\treturn box.min.equals(this.min) && box.max.equals(this.max);\n\t\t}\n\n\t}\n\n\tBox2.prototype.isBox2 = true;\n\n\tconst _startP = /*@__PURE__*/new Vector3();\n\n\tconst _startEnd = /*@__PURE__*/new Vector3();\n\n\tclass Line3 {\n\t\tconstructor(start = new Vector3(), end = new Vector3()) {\n\t\t\tthis.start = start;\n\t\t\tthis.end = end;\n\t\t}\n\n\t\tset(start, end) {\n\t\t\tthis.start.copy(start);\n\t\t\tthis.end.copy(end);\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(line) {\n\t\t\tthis.start.copy(line.start);\n\t\t\tthis.end.copy(line.end);\n\t\t\treturn this;\n\t\t}\n\n\t\tgetCenter(target) {\n\t\t\treturn target.addVectors(this.start, this.end).multiplyScalar(0.5);\n\t\t}\n\n\t\tdelta(target) {\n\t\t\treturn target.subVectors(this.end, this.start);\n\t\t}\n\n\t\tdistanceSq() {\n\t\t\treturn this.start.distanceToSquared(this.end);\n\t\t}\n\n\t\tdistance() {\n\t\t\treturn this.start.distanceTo(this.end);\n\t\t}\n\n\t\tat(t, target) {\n\t\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t\t}\n\n\t\tclosestPointToPointParameter(point, clampToLine) {\n\t\t\t_startP.subVectors(point, this.start);\n\n\t\t\t_startEnd.subVectors(this.end, this.start);\n\n\t\t\tconst startEnd2 = _startEnd.dot(_startEnd);\n\n\t\t\tconst startEnd_startP = _startEnd.dot(_startP);\n\n\t\t\tlet t = startEnd_startP / startEnd2;\n\n\t\t\tif (clampToLine) {\n\t\t\t\tt = clamp(t, 0, 1);\n\t\t\t}\n\n\t\t\treturn t;\n\t\t}\n\n\t\tclosestPointToPoint(point, clampToLine, target) {\n\t\t\tconst t = this.closestPointToPointParameter(point, clampToLine);\n\t\t\treturn this.delta(target).multiplyScalar(t).add(this.start);\n\t\t}\n\n\t\tapplyMatrix4(matrix) {\n\t\t\tthis.start.applyMatrix4(matrix);\n\t\t\tthis.end.applyMatrix4(matrix);\n\t\t\treturn this;\n\t\t}\n\n\t\tequals(line) {\n\t\t\treturn line.start.equals(this.start) && line.end.equals(this.end);\n\t\t}\n\n\t\tclone() {\n\t\t\treturn new this.constructor().copy(this);\n\t\t}\n\n\t}\n\n\tclass ImmediateRenderObject extends Object3D {\n\t\tconstructor(material) {\n\t\t\tsuper();\n\t\t\tthis.material = material;\n\n\t\t\tthis.render = function () {};\n\n\t\t\tthis.hasPositions = false;\n\t\t\tthis.hasNormals = false;\n\t\t\tthis.hasColors = false;\n\t\t\tthis.hasUvs = false;\n\t\t\tthis.positionArray = null;\n\t\t\tthis.normalArray = null;\n\t\t\tthis.colorArray = null;\n\t\t\tthis.uvArray = null;\n\t\t\tthis.count = 0;\n\t\t}\n\n\t}\n\n\tImmediateRenderObject.prototype.isImmediateRenderObject = true;\n\n\tconst _vector$3 = /*@__PURE__*/new Vector3();\n\n\tclass SpotLightHelper extends Object3D {\n\t\tconstructor(light, color) {\n\t\t\tsuper();\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.matrix = light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.color = color;\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst positions = [0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, -1, 1];\n\n\t\t\tfor (let i = 0, j = 1, l = 32; i < l; i++, j++) {\n\t\t\t\tconst p1 = i / l * Math.PI * 2;\n\t\t\t\tconst p2 = j / l * Math.PI * 2;\n\t\t\t\tpositions.push(Math.cos(p1), Math.sin(p1), 1, Math.cos(p2), Math.sin(p2), 1);\n\t\t\t}\n\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(positions, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tthis.cone = new LineSegments(geometry, material);\n\t\t\tthis.add(this.cone);\n\t\t\tthis.update();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.cone.geometry.dispose();\n\t\t\tthis.cone.material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\t\tconst coneWidth = coneLength * Math.tan(this.light.angle);\n\t\t\tthis.cone.scale.set(coneWidth, coneWidth, coneLength);\n\n\t\t\t_vector$3.setFromMatrixPosition(this.light.target.matrixWorld);\n\n\t\t\tthis.cone.lookAt(_vector$3);\n\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.cone.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tthis.cone.material.color.copy(this.light.color);\n\t\t\t}\n\t\t}\n\n\t}\n\n\tconst _vector$2 = /*@__PURE__*/new Vector3();\n\n\tconst _boneMatrix = /*@__PURE__*/new Matrix4();\n\n\tconst _matrixWorldInv = /*@__PURE__*/new Matrix4();\n\n\tclass SkeletonHelper extends LineSegments {\n\t\tconstructor(object) {\n\t\t\tconst bones = getBoneList(object);\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst vertices = [];\n\t\t\tconst colors = [];\n\t\t\tconst color1 = new Color(0, 0, 1);\n\t\t\tconst color2 = new Color(0, 1, 0);\n\n\t\t\tfor (let i = 0; i < bones.length; i++) {\n\t\t\t\tconst bone = bones[i];\n\n\t\t\t\tif (bone.parent && bone.parent.isBone) {\n\t\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\t\tcolors.push(color1.r, color1.g, color1.b);\n\t\t\t\t\tcolors.push(color2.r, color2.g, color2.b);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\tdepthTest: false,\n\t\t\t\tdepthWrite: false,\n\t\t\t\ttoneMapped: false,\n\t\t\t\ttransparent: true\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'SkeletonHelper';\n\t\t\tthis.isSkeletonHelper = true;\n\t\t\tthis.root = object;\n\t\t\tthis.bones = bones;\n\t\t\tthis.matrix = object.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tconst bones = this.bones;\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst position = geometry.getAttribute('position');\n\n\t\t\t_matrixWorldInv.copy(this.root.matrixWorld).invert();\n\n\t\t\tfor (let i = 0, j = 0; i < bones.length; i++) {\n\t\t\t\tconst bone = bones[i];\n\n\t\t\t\tif (bone.parent && bone.parent.isBone) {\n\t\t\t\t\t_boneMatrix.multiplyMatrices(_matrixWorldInv, bone.matrixWorld);\n\n\t\t\t\t\t_vector$2.setFromMatrixPosition(_boneMatrix);\n\n\t\t\t\t\tposition.setXYZ(j, _vector$2.x, _vector$2.y, _vector$2.z);\n\n\t\t\t\t\t_boneMatrix.multiplyMatrices(_matrixWorldInv, bone.parent.matrixWorld);\n\n\t\t\t\t\t_vector$2.setFromMatrixPosition(_boneMatrix);\n\n\t\t\t\t\tposition.setXYZ(j + 1, _vector$2.x, _vector$2.y, _vector$2.z);\n\t\t\t\t\tj += 2;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tgeometry.getAttribute('position').needsUpdate = true;\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t}\n\n\t}\n\n\tfunction getBoneList(object) {\n\t\tconst boneList = [];\n\n\t\tif (object && object.isBone) {\n\t\t\tboneList.push(object);\n\t\t}\n\n\t\tfor (let i = 0; i < object.children.length; i++) {\n\t\t\tboneList.push.apply(boneList, getBoneList(object.children[i]));\n\t\t}\n\n\t\treturn boneList;\n\t}\n\n\tclass PointLightHelper extends Mesh {\n\t\tconstructor(light, sphereSize, color) {\n\t\t\tconst geometry = new SphereGeometry(sphereSize, 4, 2);\n\t\t\tconst material = new MeshBasicMaterial({\n\t\t\t\twireframe: true,\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.color = color;\n\t\t\tthis.type = 'PointLightHelper';\n\t\t\tthis.matrix = this.light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.update();\n\t\t\t/*\n\t\t\t// TODO: delete this comment?\n\t\t\tconst distanceGeometry = new THREE.IcosahedronBufferGeometry( 1, 2 );\n\t\t\tconst distanceMaterial = new THREE.MeshBasicMaterial( { color: hexColor, fog: false, wireframe: true, opacity: 0.1, transparent: true } );\n\t\t\tthis.lightSphere = new THREE.Mesh( bulbGeometry, bulbMaterial );\n\t\t\tthis.lightDistance = new THREE.Mesh( distanceGeometry, distanceMaterial );\n\t\t\tconst d = light.distance;\n\t\t\tif ( d === 0.0 ) {\n\t\t\t\tthis.lightDistance.visible = false;\n\t\t\t} else {\n\t\t\t\tthis.lightDistance.scale.set( d, d, d );\n\t\t\t}\n\t\t\tthis.add( this.lightDistance );\n\t\t\t*/\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tthis.material.color.copy(this.light.color);\n\t\t\t}\n\t\t\t/*\n\t\t\tconst d = this.light.distance;\n\t\t\t\tif ( d === 0.0 ) {\n\t\t\t\t\tthis.lightDistance.visible = false;\n\t\t\t\t} else {\n\t\t\t\t\tthis.lightDistance.visible = true;\n\t\t\t\tthis.lightDistance.scale.set( d, d, d );\n\t\t\t\t}\n\t\t\t*/\n\n\t\t}\n\n\t}\n\n\tconst _vector$1 = /*@__PURE__*/new Vector3();\n\n\tconst _color1 = /*@__PURE__*/new Color();\n\n\tconst _color2 = /*@__PURE__*/new Color();\n\n\tclass HemisphereLightHelper extends Object3D {\n\t\tconstructor(light, size, color) {\n\t\t\tsuper();\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.matrix = light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.color = color;\n\t\t\tconst geometry = new OctahedronGeometry(size);\n\t\t\tgeometry.rotateY(Math.PI * 0.5);\n\t\t\tthis.material = new MeshBasicMaterial({\n\t\t\t\twireframe: true,\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tif (this.color === undefined) this.material.vertexColors = true;\n\t\t\tconst position = geometry.getAttribute('position');\n\t\t\tconst colors = new Float32Array(position.count * 3);\n\t\t\tgeometry.setAttribute('color', new BufferAttribute(colors, 3));\n\t\t\tthis.add(new Mesh(geometry, this.material));\n\t\t\tthis.update();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.children[0].geometry.dispose();\n\t\t\tthis.children[0].material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst mesh = this.children[0];\n\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tconst colors = mesh.geometry.getAttribute('color');\n\n\t\t\t\t_color1.copy(this.light.color);\n\n\t\t\t\t_color2.copy(this.light.groundColor);\n\n\t\t\t\tfor (let i = 0, l = colors.count; i < l; i++) {\n\t\t\t\t\tconst color = i < l / 2 ? _color1 : _color2;\n\t\t\t\t\tcolors.setXYZ(i, color.r, color.g, color.b);\n\t\t\t\t}\n\n\t\t\t\tcolors.needsUpdate = true;\n\t\t\t}\n\n\t\t\tmesh.lookAt(_vector$1.setFromMatrixPosition(this.light.matrixWorld).negate());\n\t\t}\n\n\t}\n\n\tclass GridHelper extends LineSegments {\n\t\tconstructor(size = 10, divisions = 10, color1 = 0x444444, color2 = 0x888888) {\n\t\t\tcolor1 = new Color(color1);\n\t\t\tcolor2 = new Color(color2);\n\t\t\tconst center = divisions / 2;\n\t\t\tconst step = size / divisions;\n\t\t\tconst halfSize = size / 2;\n\t\t\tconst vertices = [],\n\t\t\t\t\t\tcolors = [];\n\n\t\t\tfor (let i = 0, j = 0, k = -halfSize; i <= divisions; i++, k += step) {\n\t\t\t\tvertices.push(-halfSize, 0, k, halfSize, 0, k);\n\t\t\t\tvertices.push(k, 0, -halfSize, k, 0, halfSize);\n\t\t\t\tconst color = i === center ? color1 : color2;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t\tcolor.toArray(colors, j);\n\t\t\t\tj += 3;\n\t\t\t}\n\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'GridHelper';\n\t\t}\n\n\t}\n\n\tclass PolarGridHelper extends LineSegments {\n\t\tconstructor(radius = 10, radials = 16, circles = 8, divisions = 64, color1 = 0x444444, color2 = 0x888888) {\n\t\t\tcolor1 = new Color(color1);\n\t\t\tcolor2 = new Color(color2);\n\t\t\tconst vertices = [];\n\t\t\tconst colors = []; // create the radials\n\n\t\t\tfor (let i = 0; i <= radials; i++) {\n\t\t\t\tconst v = i / radials * (Math.PI * 2);\n\t\t\t\tconst x = Math.sin(v) * radius;\n\t\t\t\tconst z = Math.cos(v) * radius;\n\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\tvertices.push(x, 0, z);\n\t\t\t\tconst color = i & 1 ? color1 : color2;\n\t\t\t\tcolors.push(color.r, color.g, color.b);\n\t\t\t\tcolors.push(color.r, color.g, color.b);\n\t\t\t} // create the circles\n\n\n\t\t\tfor (let i = 0; i <= circles; i++) {\n\t\t\t\tconst color = i & 1 ? color1 : color2;\n\t\t\t\tconst r = radius - radius / circles * i;\n\n\t\t\t\tfor (let j = 0; j < divisions; j++) {\n\t\t\t\t\t// first vertex\n\t\t\t\t\tlet v = j / divisions * (Math.PI * 2);\n\t\t\t\t\tlet x = Math.sin(v) * r;\n\t\t\t\t\tlet z = Math.cos(v) * r;\n\t\t\t\t\tvertices.push(x, 0, z);\n\t\t\t\t\tcolors.push(color.r, color.g, color.b); // second vertex\n\n\t\t\t\t\tv = (j + 1) / divisions * (Math.PI * 2);\n\t\t\t\t\tx = Math.sin(v) * r;\n\t\t\t\t\tz = Math.cos(v) * r;\n\t\t\t\t\tvertices.push(x, 0, z);\n\t\t\t\t\tcolors.push(color.r, color.g, color.b);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'PolarGridHelper';\n\t\t}\n\n\t}\n\n\tconst _v1 = /*@__PURE__*/new Vector3();\n\n\tconst _v2 = /*@__PURE__*/new Vector3();\n\n\tconst _v3 = /*@__PURE__*/new Vector3();\n\n\tclass DirectionalLightHelper extends Object3D {\n\t\tconstructor(light, size, color) {\n\t\t\tsuper();\n\t\t\tthis.light = light;\n\t\t\tthis.light.updateMatrixWorld();\n\t\t\tthis.matrix = light.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.color = color;\n\t\t\tif (size === undefined) size = 1;\n\t\t\tlet geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute([-size, size, 0, size, size, 0, size, -size, 0, -size, -size, 0, -size, size, 0], 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tfog: false,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tthis.lightPlane = new Line(geometry, material);\n\t\t\tthis.add(this.lightPlane);\n\t\t\tgeometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute([0, 0, 0, 0, 0, 1], 3));\n\t\t\tthis.targetLine = new Line(geometry, material);\n\t\t\tthis.add(this.targetLine);\n\t\t\tthis.update();\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.lightPlane.geometry.dispose();\n\t\t\tthis.lightPlane.material.dispose();\n\t\t\tthis.targetLine.geometry.dispose();\n\t\t\tthis.targetLine.material.dispose();\n\t\t}\n\n\t\tupdate() {\n\t\t\t_v1.setFromMatrixPosition(this.light.matrixWorld);\n\n\t\t\t_v2.setFromMatrixPosition(this.light.target.matrixWorld);\n\n\t\t\t_v3.subVectors(_v2, _v1);\n\n\t\t\tthis.lightPlane.lookAt(_v2);\n\n\t\t\tif (this.color !== undefined) {\n\t\t\t\tthis.lightPlane.material.color.set(this.color);\n\t\t\t\tthis.targetLine.material.color.set(this.color);\n\t\t\t} else {\n\t\t\t\tthis.lightPlane.material.color.copy(this.light.color);\n\t\t\t\tthis.targetLine.material.color.copy(this.light.color);\n\t\t\t}\n\n\t\t\tthis.targetLine.lookAt(_v2);\n\t\t\tthis.targetLine.scale.z = _v3.length();\n\t\t}\n\n\t}\n\n\tconst _vector = /*@__PURE__*/new Vector3();\n\n\tconst _camera = /*@__PURE__*/new Camera();\n\t/**\n\t *\t- shows frustum, line of sight and up of the camera\n\t *\t- suitable for fast updates\n\t * \t- based on frustum visualization in lightgl.js shadowmap example\n\t *\t\thttp://evanw.github.com/lightgl.js/tests/shadowmap.html\n\t */\n\n\n\tclass CameraHelper extends LineSegments {\n\t\tconstructor(camera) {\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tcolor: 0xffffff,\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tconst vertices = [];\n\t\t\tconst colors = [];\n\t\t\tconst pointMap = {}; // colors\n\n\t\t\tconst colorFrustum = new Color(0xffaa00);\n\t\t\tconst colorCone = new Color(0xff0000);\n\t\t\tconst colorUp = new Color(0x00aaff);\n\t\t\tconst colorTarget = new Color(0xffffff);\n\t\t\tconst colorCross = new Color(0x333333); // near\n\n\t\t\taddLine('n1', 'n2', colorFrustum);\n\t\t\taddLine('n2', 'n4', colorFrustum);\n\t\t\taddLine('n4', 'n3', colorFrustum);\n\t\t\taddLine('n3', 'n1', colorFrustum); // far\n\n\t\t\taddLine('f1', 'f2', colorFrustum);\n\t\t\taddLine('f2', 'f4', colorFrustum);\n\t\t\taddLine('f4', 'f3', colorFrustum);\n\t\t\taddLine('f3', 'f1', colorFrustum); // sides\n\n\t\t\taddLine('n1', 'f1', colorFrustum);\n\t\t\taddLine('n2', 'f2', colorFrustum);\n\t\t\taddLine('n3', 'f3', colorFrustum);\n\t\t\taddLine('n4', 'f4', colorFrustum); // cone\n\n\t\t\taddLine('p', 'n1', colorCone);\n\t\t\taddLine('p', 'n2', colorCone);\n\t\t\taddLine('p', 'n3', colorCone);\n\t\t\taddLine('p', 'n4', colorCone); // up\n\n\t\t\taddLine('u1', 'u2', colorUp);\n\t\t\taddLine('u2', 'u3', colorUp);\n\t\t\taddLine('u3', 'u1', colorUp); // target\n\n\t\t\taddLine('c', 't', colorTarget);\n\t\t\taddLine('p', 'c', colorCross); // cross\n\n\t\t\taddLine('cn1', 'cn2', colorCross);\n\t\t\taddLine('cn3', 'cn4', colorCross);\n\t\t\taddLine('cf1', 'cf2', colorCross);\n\t\t\taddLine('cf3', 'cf4', colorCross);\n\n\t\t\tfunction addLine(a, b, color) {\n\t\t\t\taddPoint(a, color);\n\t\t\t\taddPoint(b, color);\n\t\t\t}\n\n\t\t\tfunction addPoint(id, color) {\n\t\t\t\tvertices.push(0, 0, 0);\n\t\t\t\tcolors.push(color.r, color.g, color.b);\n\n\t\t\t\tif (pointMap[id] === undefined) {\n\t\t\t\t\tpointMap[id] = [];\n\t\t\t\t}\n\n\t\t\t\tpointMap[id].push(vertices.length / 3 - 1);\n\t\t\t}\n\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'CameraHelper';\n\t\t\tthis.camera = camera;\n\t\t\tif (this.camera.updateProjectionMatrix) this.camera.updateProjectionMatrix();\n\t\t\tthis.matrix = camera.matrixWorld;\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.pointMap = pointMap;\n\t\t\tthis.update();\n\t\t}\n\n\t\tupdate() {\n\t\t\tconst geometry = this.geometry;\n\t\t\tconst pointMap = this.pointMap;\n\t\t\tconst w = 1,\n\t\t\t\t\t\th = 1; // we need just camera projection matrix inverse\n\t\t\t// world matrix must be identity\n\n\t\t\t_camera.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse); // center / target\n\n\n\t\t\tsetPoint('c', pointMap, geometry, _camera, 0, 0, -1);\n\t\t\tsetPoint('t', pointMap, geometry, _camera, 0, 0, 1); // near\n\n\t\t\tsetPoint('n1', pointMap, geometry, _camera, -w, -h, -1);\n\t\t\tsetPoint('n2', pointMap, geometry, _camera, w, -h, -1);\n\t\t\tsetPoint('n3', pointMap, geometry, _camera, -w, h, -1);\n\t\t\tsetPoint('n4', pointMap, geometry, _camera, w, h, -1); // far\n\n\t\t\tsetPoint('f1', pointMap, geometry, _camera, -w, -h, 1);\n\t\t\tsetPoint('f2', pointMap, geometry, _camera, w, -h, 1);\n\t\t\tsetPoint('f3', pointMap, geometry, _camera, -w, h, 1);\n\t\t\tsetPoint('f4', pointMap, geometry, _camera, w, h, 1); // up\n\n\t\t\tsetPoint('u1', pointMap, geometry, _camera, w * 0.7, h * 1.1, -1);\n\t\t\tsetPoint('u2', pointMap, geometry, _camera, -w * 0.7, h * 1.1, -1);\n\t\t\tsetPoint('u3', pointMap, geometry, _camera, 0, h * 2, -1); // cross\n\n\t\t\tsetPoint('cf1', pointMap, geometry, _camera, -w, 0, 1);\n\t\t\tsetPoint('cf2', pointMap, geometry, _camera, w, 0, 1);\n\t\t\tsetPoint('cf3', pointMap, geometry, _camera, 0, -h, 1);\n\t\t\tsetPoint('cf4', pointMap, geometry, _camera, 0, h, 1);\n\t\t\tsetPoint('cn1', pointMap, geometry, _camera, -w, 0, -1);\n\t\t\tsetPoint('cn2', pointMap, geometry, _camera, w, 0, -1);\n\t\t\tsetPoint('cn3', pointMap, geometry, _camera, 0, -h, -1);\n\t\t\tsetPoint('cn4', pointMap, geometry, _camera, 0, h, -1);\n\t\t\tgeometry.getAttribute('position').needsUpdate = true;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material.dispose();\n\t\t}\n\n\t}\n\n\tfunction setPoint(point, pointMap, geometry, camera, x, y, z) {\n\t\t_vector.set(x, y, z).unproject(camera);\n\n\t\tconst points = pointMap[point];\n\n\t\tif (points !== undefined) {\n\t\t\tconst position = geometry.getAttribute('position');\n\n\t\t\tfor (let i = 0, l = points.length; i < l; i++) {\n\t\t\t\tposition.setXYZ(points[i], _vector.x, _vector.y, _vector.z);\n\t\t\t}\n\t\t}\n\t}\n\n\tconst _box = /*@__PURE__*/new Box3();\n\n\tclass BoxHelper extends LineSegments {\n\t\tconstructor(object, color = 0xffff00) {\n\t\t\tconst indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]);\n\t\t\tconst positions = new Float32Array(8 * 3);\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setIndex(new BufferAttribute(indices, 1));\n\t\t\tgeometry.setAttribute('position', new BufferAttribute(positions, 3));\n\t\t\tsuper(geometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.object = object;\n\t\t\tthis.type = 'BoxHelper';\n\t\t\tthis.matrixAutoUpdate = false;\n\t\t\tthis.update();\n\t\t}\n\n\t\tupdate(object) {\n\t\t\tif (object !== undefined) {\n\t\t\t\tconsole.warn('THREE.BoxHelper: .update() has no longer arguments.');\n\t\t\t}\n\n\t\t\tif (this.object !== undefined) {\n\t\t\t\t_box.setFromObject(this.object);\n\t\t\t}\n\n\t\t\tif (_box.isEmpty()) return;\n\t\t\tconst min = _box.min;\n\t\t\tconst max = _box.max;\n\t\t\t/*\n\t\t\t\t5____4\n\t\t\t1/___0/|\n\t\t\t| 6__|_7\n\t\t\t2/___3/\n\t\t\t\t0: max.x, max.y, max.z\n\t\t\t1: min.x, max.y, max.z\n\t\t\t2: min.x, min.y, max.z\n\t\t\t3: max.x, min.y, max.z\n\t\t\t4: max.x, max.y, min.z\n\t\t\t5: min.x, max.y, min.z\n\t\t\t6: min.x, min.y, min.z\n\t\t\t7: max.x, min.y, min.z\n\t\t\t*/\n\n\t\t\tconst position = this.geometry.attributes.position;\n\t\t\tconst array = position.array;\n\t\t\tarray[0] = max.x;\n\t\t\tarray[1] = max.y;\n\t\t\tarray[2] = max.z;\n\t\t\tarray[3] = min.x;\n\t\t\tarray[4] = max.y;\n\t\t\tarray[5] = max.z;\n\t\t\tarray[6] = min.x;\n\t\t\tarray[7] = min.y;\n\t\t\tarray[8] = max.z;\n\t\t\tarray[9] = max.x;\n\t\t\tarray[10] = min.y;\n\t\t\tarray[11] = max.z;\n\t\t\tarray[12] = max.x;\n\t\t\tarray[13] = max.y;\n\t\t\tarray[14] = min.z;\n\t\t\tarray[15] = min.x;\n\t\t\tarray[16] = max.y;\n\t\t\tarray[17] = min.z;\n\t\t\tarray[18] = min.x;\n\t\t\tarray[19] = min.y;\n\t\t\tarray[20] = min.z;\n\t\t\tarray[21] = max.x;\n\t\t\tarray[22] = min.y;\n\t\t\tarray[23] = min.z;\n\t\t\tposition.needsUpdate = true;\n\t\t\tthis.geometry.computeBoundingSphere();\n\t\t}\n\n\t\tsetFromObject(object) {\n\t\t\tthis.object = object;\n\t\t\tthis.update();\n\t\t\treturn this;\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tLineSegments.prototype.copy.call(this, source);\n\t\t\tthis.object = source.object;\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass Box3Helper extends LineSegments {\n\t\tconstructor(box, color = 0xffff00) {\n\t\t\tconst indices = new Uint16Array([0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7]);\n\t\t\tconst positions = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, -1, -1, 1, -1, -1, -1, -1, 1, -1, -1];\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setIndex(new BufferAttribute(indices, 1));\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(positions, 3));\n\t\t\tsuper(geometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.box = box;\n\t\t\tthis.type = 'Box3Helper';\n\t\t\tthis.geometry.computeBoundingSphere();\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tconst box = this.box;\n\t\t\tif (box.isEmpty()) return;\n\t\t\tbox.getCenter(this.position);\n\t\t\tbox.getSize(this.scale);\n\t\t\tthis.scale.multiplyScalar(0.5);\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t}\n\n\t}\n\n\tclass PlaneHelper extends Line {\n\t\tconstructor(plane, size = 1, hex = 0xffff00) {\n\t\t\tconst color = hex;\n\t\t\tconst positions = [1, -1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0];\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(positions, 3));\n\t\t\tgeometry.computeBoundingSphere();\n\t\t\tsuper(geometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.type = 'PlaneHelper';\n\t\t\tthis.plane = plane;\n\t\t\tthis.size = size;\n\t\t\tconst positions2 = [1, 1, 1, -1, 1, 1, -1, -1, 1, 1, 1, 1, -1, -1, 1, 1, -1, 1];\n\t\t\tconst geometry2 = new BufferGeometry();\n\t\t\tgeometry2.setAttribute('position', new Float32BufferAttribute(positions2, 3));\n\t\t\tgeometry2.computeBoundingSphere();\n\t\t\tthis.add(new Mesh(geometry2, new MeshBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\topacity: 0.2,\n\t\t\t\ttransparent: true,\n\t\t\t\tdepthWrite: false,\n\t\t\t\ttoneMapped: false\n\t\t\t})));\n\t\t}\n\n\t\tupdateMatrixWorld(force) {\n\t\t\tlet scale = -this.plane.constant;\n\t\t\tif (Math.abs(scale) < 1e-8) scale = 1e-8; // sign does not matter\n\n\t\t\tthis.scale.set(0.5 * this.size, 0.5 * this.size, scale);\n\t\t\tthis.children[0].material.side = scale < 0 ? BackSide : FrontSide; // renderer flips side when determinant < 0; flipping not wanted here\n\n\t\t\tthis.lookAt(this.plane.normal);\n\t\t\tsuper.updateMatrixWorld(force);\n\t\t}\n\n\t}\n\n\tconst _axis = /*@__PURE__*/new Vector3();\n\n\tlet _lineGeometry, _coneGeometry;\n\n\tclass ArrowHelper extends Object3D {\n\t\t// dir is assumed to be normalized\n\t\tconstructor(dir = new Vector3(0, 0, 1), origin = new Vector3(0, 0, 0), length = 1, color = 0xffff00, headLength = length * 0.2, headWidth = headLength * 0.2) {\n\t\t\tsuper();\n\t\t\tthis.type = 'ArrowHelper';\n\n\t\t\tif (_lineGeometry === undefined) {\n\t\t\t\t_lineGeometry = new BufferGeometry();\n\n\t\t\t\t_lineGeometry.setAttribute('position', new Float32BufferAttribute([0, 0, 0, 0, 1, 0], 3));\n\n\t\t\t\t_coneGeometry = new CylinderGeometry(0, 0.5, 1, 5, 1);\n\n\t\t\t\t_coneGeometry.translate(0, -0.5, 0);\n\t\t\t}\n\n\t\t\tthis.position.copy(origin);\n\t\t\tthis.line = new Line(_lineGeometry, new LineBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.line.matrixAutoUpdate = false;\n\t\t\tthis.add(this.line);\n\t\t\tthis.cone = new Mesh(_coneGeometry, new MeshBasicMaterial({\n\t\t\t\tcolor: color,\n\t\t\t\ttoneMapped: false\n\t\t\t}));\n\t\t\tthis.cone.matrixAutoUpdate = false;\n\t\t\tthis.add(this.cone);\n\t\t\tthis.setDirection(dir);\n\t\t\tthis.setLength(length, headLength, headWidth);\n\t\t}\n\n\t\tsetDirection(dir) {\n\t\t\t// dir is assumed to be normalized\n\t\t\tif (dir.y > 0.99999) {\n\t\t\t\tthis.quaternion.set(0, 0, 0, 1);\n\t\t\t} else if (dir.y < -0.99999) {\n\t\t\t\tthis.quaternion.set(1, 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t_axis.set(dir.z, 0, -dir.x).normalize();\n\n\t\t\t\tconst radians = Math.acos(dir.y);\n\t\t\t\tthis.quaternion.setFromAxisAngle(_axis, radians);\n\t\t\t}\n\t\t}\n\n\t\tsetLength(length, headLength = length * 0.2, headWidth = headLength * 0.2) {\n\t\t\tthis.line.scale.set(1, Math.max(0.0001, length - headLength), 1); // see #17458\n\n\t\t\tthis.line.updateMatrix();\n\t\t\tthis.cone.scale.set(headWidth, headLength, headWidth);\n\t\t\tthis.cone.position.y = length;\n\t\t\tthis.cone.updateMatrix();\n\t\t}\n\n\t\tsetColor(color) {\n\t\t\tthis.line.material.color.set(color);\n\t\t\tthis.cone.material.color.set(color);\n\t\t}\n\n\t\tcopy(source) {\n\t\t\tsuper.copy(source, false);\n\t\t\tthis.line.copy(source.line);\n\t\t\tthis.cone.copy(source.cone);\n\t\t\treturn this;\n\t\t}\n\n\t}\n\n\tclass AxesHelper extends LineSegments {\n\t\tconstructor(size = 1) {\n\t\t\tconst vertices = [0, 0, 0, size, 0, 0, 0, 0, 0, 0, size, 0, 0, 0, 0, 0, 0, size];\n\t\t\tconst colors = [1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1];\n\t\t\tconst geometry = new BufferGeometry();\n\t\t\tgeometry.setAttribute('position', new Float32BufferAttribute(vertices, 3));\n\t\t\tgeometry.setAttribute('color', new Float32BufferAttribute(colors, 3));\n\t\t\tconst material = new LineBasicMaterial({\n\t\t\t\tvertexColors: true,\n\t\t\t\ttoneMapped: false\n\t\t\t});\n\t\t\tsuper(geometry, material);\n\t\t\tthis.type = 'AxesHelper';\n\t\t}\n\n\t\tsetColors(xAxisColor, yAxisColor, zAxisColor) {\n\t\t\tconst color = new Color();\n\t\t\tconst array = this.geometry.attributes.color.array;\n\t\t\tcolor.set(xAxisColor);\n\t\t\tcolor.toArray(array, 0);\n\t\t\tcolor.toArray(array, 3);\n\t\t\tcolor.set(yAxisColor);\n\t\t\tcolor.toArray(array, 6);\n\t\t\tcolor.toArray(array, 9);\n\t\t\tcolor.set(zAxisColor);\n\t\t\tcolor.toArray(array, 12);\n\t\t\tcolor.toArray(array, 15);\n\t\t\tthis.geometry.attributes.color.needsUpdate = true;\n\t\t\treturn this;\n\t\t}\n\n\t\tdispose() {\n\t\t\tthis.geometry.dispose();\n\t\t\tthis.material.dispose();\n\t\t}\n\n\t}\n\n\tclass ShapePath {\n\t\tconstructor() {\n\t\t\tthis.type = 'ShapePath';\n\t\t\tthis.color = new Color();\n\t\t\tthis.subPaths = [];\n\t\t\tthis.currentPath = null;\n\t\t}\n\n\t\tmoveTo(x, y) {\n\t\t\tthis.currentPath = new Path();\n\t\t\tthis.subPaths.push(this.currentPath);\n\t\t\tthis.currentPath.moveTo(x, y);\n\t\t\treturn this;\n\t\t}\n\n\t\tlineTo(x, y) {\n\t\t\tthis.currentPath.lineTo(x, y);\n\t\t\treturn this;\n\t\t}\n\n\t\tquadraticCurveTo(aCPx, aCPy, aX, aY) {\n\t\t\tthis.currentPath.quadraticCurveTo(aCPx, aCPy, aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tbezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY) {\n\t\t\tthis.currentPath.bezierCurveTo(aCP1x, aCP1y, aCP2x, aCP2y, aX, aY);\n\t\t\treturn this;\n\t\t}\n\n\t\tsplineThru(pts) {\n\t\t\tthis.currentPath.splineThru(pts);\n\t\t\treturn this;\n\t\t}\n\n\t\ttoShapes(isCCW, noHoles) {\n\t\t\tfunction toShapesNoHoles(inSubpaths) {\n\t\t\t\tconst shapes = [];\n\n\t\t\t\tfor (let i = 0, l = inSubpaths.length; i < l; i++) {\n\t\t\t\t\tconst tmpPath = inSubpaths[i];\n\t\t\t\t\tconst tmpShape = new Shape();\n\t\t\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\t\t\tshapes.push(tmpShape);\n\t\t\t\t}\n\n\t\t\t\treturn shapes;\n\t\t\t}\n\n\t\t\tfunction isPointInsidePolygon(inPt, inPolygon) {\n\t\t\t\tconst polyLen = inPolygon.length; // inPt on polygon contour => immediate success\t\tor\n\t\t\t\t// toggling of inside/outside at every single! intersection point of an edge\n\t\t\t\t//\twith the horizontal line through inPt, left of inPt\n\t\t\t\t//\tnot counting lowerY endpoints of edges and whole edges on that line\n\n\t\t\t\tlet inside = false;\n\n\t\t\t\tfor (let p = polyLen - 1, q = 0; q < polyLen; p = q++) {\n\t\t\t\t\tlet edgeLowPt = inPolygon[p];\n\t\t\t\t\tlet edgeHighPt = inPolygon[q];\n\t\t\t\t\tlet edgeDx = edgeHighPt.x - edgeLowPt.x;\n\t\t\t\t\tlet edgeDy = edgeHighPt.y - edgeLowPt.y;\n\n\t\t\t\t\tif (Math.abs(edgeDy) > Number.EPSILON) {\n\t\t\t\t\t\t// not parallel\n\t\t\t\t\t\tif (edgeDy < 0) {\n\t\t\t\t\t\t\tedgeLowPt = inPolygon[q];\n\t\t\t\t\t\t\tedgeDx = -edgeDx;\n\t\t\t\t\t\t\tedgeHighPt = inPolygon[p];\n\t\t\t\t\t\t\tedgeDy = -edgeDy;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (inPt.y < edgeLowPt.y || inPt.y > edgeHighPt.y) continue;\n\n\t\t\t\t\t\tif (inPt.y === edgeLowPt.y) {\n\t\t\t\t\t\t\tif (inPt.x === edgeLowPt.x) return true; // inPt is on contour ?\n\t\t\t\t\t\t\t// continue;\t\t\t\t// no intersection or edgeLowPt => doesn't count !!!\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst perpEdge = edgeDy * (inPt.x - edgeLowPt.x) - edgeDx * (inPt.y - edgeLowPt.y);\n\t\t\t\t\t\t\tif (perpEdge === 0) return true; // inPt is on contour ?\n\n\t\t\t\t\t\t\tif (perpEdge < 0) continue;\n\t\t\t\t\t\t\tinside = !inside; // true intersection left of inPt\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// parallel or collinear\n\t\t\t\t\t\tif (inPt.y !== edgeLowPt.y) continue; // parallel\n\t\t\t\t\t\t// edge lies on the same horizontal line as inPt\n\n\t\t\t\t\t\tif (edgeHighPt.x <= inPt.x && inPt.x <= edgeLowPt.x || edgeLowPt.x <= inPt.x && inPt.x <= edgeHighPt.x) return true; // inPt: Point on contour !\n\t\t\t\t\t\t// continue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn inside;\n\t\t\t}\n\n\t\t\tconst isClockWise = ShapeUtils.isClockWise;\n\t\t\tconst subPaths = this.subPaths;\n\t\t\tif (subPaths.length === 0) return [];\n\t\t\tif (noHoles === true) return toShapesNoHoles(subPaths);\n\t\t\tlet solid, tmpPath, tmpShape;\n\t\t\tconst shapes = [];\n\n\t\t\tif (subPaths.length === 1) {\n\t\t\t\ttmpPath = subPaths[0];\n\t\t\t\ttmpShape = new Shape();\n\t\t\t\ttmpShape.curves = tmpPath.curves;\n\t\t\t\tshapes.push(tmpShape);\n\t\t\t\treturn shapes;\n\t\t\t}\n\n\t\t\tlet holesFirst = !isClockWise(subPaths[0].getPoints());\n\t\t\tholesFirst = isCCW ? !holesFirst : holesFirst; // console.log(\"Holes first\", holesFirst);\n\n\t\t\tconst betterShapeHoles = [];\n\t\t\tconst newShapes = [];\n\t\t\tlet newShapeHoles = [];\n\t\t\tlet mainIdx = 0;\n\t\t\tlet tmpPoints;\n\t\t\tnewShapes[mainIdx] = undefined;\n\t\t\tnewShapeHoles[mainIdx] = [];\n\n\t\t\tfor (let i = 0, l = subPaths.length; i < l; i++) {\n\t\t\t\ttmpPath = subPaths[i];\n\t\t\t\ttmpPoints = tmpPath.getPoints();\n\t\t\t\tsolid = isClockWise(tmpPoints);\n\t\t\t\tsolid = isCCW ? !solid : solid;\n\n\t\t\t\tif (solid) {\n\t\t\t\t\tif (!holesFirst && newShapes[mainIdx]) mainIdx++;\n\t\t\t\t\tnewShapes[mainIdx] = {\n\t\t\t\t\t\ts: new Shape(),\n\t\t\t\t\t\tp: tmpPoints\n\t\t\t\t\t};\n\t\t\t\t\tnewShapes[mainIdx].s.curves = tmpPath.curves;\n\t\t\t\t\tif (holesFirst) mainIdx++;\n\t\t\t\t\tnewShapeHoles[mainIdx] = []; //console.log('cw', i);\n\t\t\t\t} else {\n\t\t\t\t\tnewShapeHoles[mainIdx].push({\n\t\t\t\t\t\th: tmpPath,\n\t\t\t\t\t\tp: tmpPoints[0]\n\t\t\t\t\t}); //console.log('ccw', i);\n\t\t\t\t}\n\t\t\t} // only Holes? -> probably all Shapes with wrong orientation\n\n\n\t\t\tif (!newShapes[0]) return toShapesNoHoles(subPaths);\n\n\t\t\tif (newShapes.length > 1) {\n\t\t\t\tlet ambiguous = false;\n\t\t\t\tconst toChange = [];\n\n\t\t\t\tfor (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) {\n\t\t\t\t\tbetterShapeHoles[sIdx] = [];\n\t\t\t\t}\n\n\t\t\t\tfor (let sIdx = 0, sLen = newShapes.length; sIdx < sLen; sIdx++) {\n\t\t\t\t\tconst sho = newShapeHoles[sIdx];\n\n\t\t\t\t\tfor (let hIdx = 0; hIdx < sho.length; hIdx++) {\n\t\t\t\t\t\tconst ho = sho[hIdx];\n\t\t\t\t\t\tlet hole_unassigned = true;\n\n\t\t\t\t\t\tfor (let s2Idx = 0; s2Idx < newShapes.length; s2Idx++) {\n\t\t\t\t\t\t\tif (isPointInsidePolygon(ho.p, newShapes[s2Idx].p)) {\n\t\t\t\t\t\t\t\tif (sIdx !== s2Idx) toChange.push({\n\t\t\t\t\t\t\t\t\tfroms: sIdx,\n\t\t\t\t\t\t\t\t\ttos: s2Idx,\n\t\t\t\t\t\t\t\t\thole: hIdx\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tif (hole_unassigned) {\n\t\t\t\t\t\t\t\t\thole_unassigned = false;\n\t\t\t\t\t\t\t\t\tbetterShapeHoles[s2Idx].push(ho);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tambiguous = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (hole_unassigned) {\n\t\t\t\t\t\t\tbetterShapeHoles[sIdx].push(ho);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // console.log(\"ambiguous: \", ambiguous);\n\n\n\t\t\t\tif (toChange.length > 0) {\n\t\t\t\t\t// console.log(\"to change: \", toChange);\n\t\t\t\t\tif (!ambiguous) newShapeHoles = betterShapeHoles;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tlet tmpHoles;\n\n\t\t\tfor (let i = 0, il = newShapes.length; i < il; i++) {\n\t\t\t\ttmpShape = newShapes[i].s;\n\t\t\t\tshapes.push(tmpShape);\n\t\t\t\ttmpHoles = newShapeHoles[i];\n\n\t\t\t\tfor (let j = 0, jl = tmpHoles.length; j < jl; j++) {\n\t\t\t\t\ttmpShape.holes.push(tmpHoles[j].h);\n\t\t\t\t}\n\t\t\t} //console.log(\"shape\", shapes);\n\n\n\t\t\treturn shapes;\n\t\t}\n\n\t}\n\n\tconst _floatView = new Float32Array(1);\n\n\tconst _int32View = new Int32Array(_floatView.buffer);\n\n\tclass DataUtils {\n\t\t// Converts float32 to float16 (stored as uint16 value).\n\t\tstatic toHalfFloat(val) {\n\t\t\tif (val > 65504) {\n\t\t\t\tconsole.warn('THREE.DataUtils.toHalfFloat(): value exceeds 65504.');\n\t\t\t\tval = 65504; // maximum representable value in float16\n\t\t\t} // Source: http://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410\n\n\t\t\t/* This method is faster than the OpenEXR implementation (very often\n\t\t\t* used, eg. in Ogre), with the additional benefit of rounding, inspired\n\t\t\t* by James Tursa?s half-precision code. */\n\n\n\t\t\t_floatView[0] = val;\n\t\t\tconst x = _int32View[0];\n\t\t\tlet bits = x >> 16 & 0x8000;\n\t\t\t/* Get the sign */\n\n\t\t\tlet m = x >> 12 & 0x07ff;\n\t\t\t/* Keep one extra bit for rounding */\n\n\t\t\tconst e = x >> 23 & 0xff;\n\t\t\t/* Using int is faster here */\n\n\t\t\t/* If zero, or denormal, or exponent underflows too much for a denormal\n\t\t\t\t* half, return signed zero. */\n\n\t\t\tif (e < 103) return bits;\n\t\t\t/* If NaN, return NaN. If Inf or exponent overflow, return Inf. */\n\n\t\t\tif (e > 142) {\n\t\t\t\tbits |= 0x7c00;\n\t\t\t\t/* If exponent was 0xff and one mantissa bit was set, it means NaN,\n\t\t\t\t\t\t\t* not Inf, so make sure we set one mantissa bit too. */\n\n\t\t\t\tbits |= (e == 255 ? 0 : 1) && x & 0x007fffff;\n\t\t\t\treturn bits;\n\t\t\t}\n\t\t\t/* If exponent underflows but not too much, return a denormal */\n\n\n\t\t\tif (e < 113) {\n\t\t\t\tm |= 0x0800;\n\t\t\t\t/* Extra rounding may overflow and set mantissa to 0 and exponent\n\t\t\t\t\t* to 1, which is OK. */\n\n\t\t\t\tbits |= (m >> 114 - e) + (m >> 113 - e & 1);\n\t\t\t\treturn bits;\n\t\t\t}\n\n\t\t\tbits |= e - 112 << 10 | m >> 1;\n\t\t\t/* Extra rounding. An overflow will set mantissa to 0 and increment\n\t\t\t\t* the exponent, which is OK. */\n\n\t\t\tbits += m & 1;\n\t\t\treturn bits;\n\t\t}\n\n\t}\n\n\tconst LineStrip = 0;\n\tconst LinePieces = 1;\n\tconst NoColors = 0;\n\tconst FaceColors = 1;\n\tconst VertexColors = 2;\n\tfunction MeshFaceMaterial(materials) {\n\t\tconsole.warn('THREE.MeshFaceMaterial has been removed. Use an Array instead.');\n\t\treturn materials;\n\t}\n\tfunction MultiMaterial(materials = []) {\n\t\tconsole.warn('THREE.MultiMaterial has been removed. Use an Array instead.');\n\t\tmaterials.isMultiMaterial = true;\n\t\tmaterials.materials = materials;\n\n\t\tmaterials.clone = function () {\n\t\t\treturn materials.slice();\n\t\t};\n\n\t\treturn materials;\n\t}\n\tfunction PointCloud(geometry, material) {\n\t\tconsole.warn('THREE.PointCloud has been renamed to THREE.Points.');\n\t\treturn new Points(geometry, material);\n\t}\n\tfunction Particle(material) {\n\t\tconsole.warn('THREE.Particle has been renamed to THREE.Sprite.');\n\t\treturn new Sprite(material);\n\t}\n\tfunction ParticleSystem(geometry, material) {\n\t\tconsole.warn('THREE.ParticleSystem has been renamed to THREE.Points.');\n\t\treturn new Points(geometry, material);\n\t}\n\tfunction PointCloudMaterial(parameters) {\n\t\tconsole.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.');\n\t\treturn new PointsMaterial(parameters);\n\t}\n\tfunction ParticleBasicMaterial(parameters) {\n\t\tconsole.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.');\n\t\treturn new PointsMaterial(parameters);\n\t}\n\tfunction ParticleSystemMaterial(parameters) {\n\t\tconsole.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.');\n\t\treturn new PointsMaterial(parameters);\n\t}\n\tfunction Vertex(x, y, z) {\n\t\tconsole.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.');\n\t\treturn new Vector3(x, y, z);\n\t} //\n\n\tfunction DynamicBufferAttribute(array, itemSize) {\n\t\tconsole.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setUsage( THREE.DynamicDrawUsage ) instead.');\n\t\treturn new BufferAttribute(array, itemSize).setUsage(DynamicDrawUsage);\n\t}\n\tfunction Int8Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Int8Attribute has been removed. Use new THREE.Int8BufferAttribute() instead.');\n\t\treturn new Int8BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint8Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint8Attribute has been removed. Use new THREE.Uint8BufferAttribute() instead.');\n\t\treturn new Uint8BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint8ClampedAttribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint8ClampedAttribute has been removed. Use new THREE.Uint8ClampedBufferAttribute() instead.');\n\t\treturn new Uint8ClampedBufferAttribute(array, itemSize);\n\t}\n\tfunction Int16Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Int16Attribute has been removed. Use new THREE.Int16BufferAttribute() instead.');\n\t\treturn new Int16BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint16Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint16Attribute has been removed. Use new THREE.Uint16BufferAttribute() instead.');\n\t\treturn new Uint16BufferAttribute(array, itemSize);\n\t}\n\tfunction Int32Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Int32Attribute has been removed. Use new THREE.Int32BufferAttribute() instead.');\n\t\treturn new Int32BufferAttribute(array, itemSize);\n\t}\n\tfunction Uint32Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Uint32Attribute has been removed. Use new THREE.Uint32BufferAttribute() instead.');\n\t\treturn new Uint32BufferAttribute(array, itemSize);\n\t}\n\tfunction Float32Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Float32Attribute has been removed. Use new THREE.Float32BufferAttribute() instead.');\n\t\treturn new Float32BufferAttribute(array, itemSize);\n\t}\n\tfunction Float64Attribute(array, itemSize) {\n\t\tconsole.warn('THREE.Float64Attribute has been removed. Use new THREE.Float64BufferAttribute() instead.');\n\t\treturn new Float64BufferAttribute(array, itemSize);\n\t} //\n\n\tCurve.create = function (construct, getPoint) {\n\t\tconsole.log('THREE.Curve.create() has been deprecated');\n\t\tconstruct.prototype = Object.create(Curve.prototype);\n\t\tconstruct.prototype.constructor = construct;\n\t\tconstruct.prototype.getPoint = getPoint;\n\t\treturn construct;\n\t}; //\n\n\n\tPath.prototype.fromPoints = function (points) {\n\t\tconsole.warn('THREE.Path: .fromPoints() has been renamed to .setFromPoints().');\n\t\treturn this.setFromPoints(points);\n\t}; //\n\n\n\tfunction AxisHelper(size) {\n\t\tconsole.warn('THREE.AxisHelper has been renamed to THREE.AxesHelper.');\n\t\treturn new AxesHelper(size);\n\t}\n\tfunction BoundingBoxHelper(object, color) {\n\t\tconsole.warn('THREE.BoundingBoxHelper has been deprecated. Creating a THREE.BoxHelper instead.');\n\t\treturn new BoxHelper(object, color);\n\t}\n\tfunction EdgesHelper(object, hex) {\n\t\tconsole.warn('THREE.EdgesHelper has been removed. Use THREE.EdgesGeometry instead.');\n\t\treturn new LineSegments(new EdgesGeometry(object.geometry), new LineBasicMaterial({\n\t\t\tcolor: hex !== undefined ? hex : 0xffffff\n\t\t}));\n\t}\n\n\tGridHelper.prototype.setColors = function () {\n\t\tconsole.error('THREE.GridHelper: setColors() has been deprecated, pass them in the constructor instead.');\n\t};\n\n\tSkeletonHelper.prototype.update = function () {\n\t\tconsole.error('THREE.SkeletonHelper: update() no longer needs to be called.');\n\t};\n\n\tfunction WireframeHelper(object, hex) {\n\t\tconsole.warn('THREE.WireframeHelper has been removed. Use THREE.WireframeGeometry instead.');\n\t\treturn new LineSegments(new WireframeGeometry(object.geometry), new LineBasicMaterial({\n\t\t\tcolor: hex !== undefined ? hex : 0xffffff\n\t\t}));\n\t} //\n\n\tLoader.prototype.extractUrlBase = function (url) {\n\t\tconsole.warn('THREE.Loader: .extractUrlBase() has been deprecated. Use THREE.LoaderUtils.extractUrlBase() instead.');\n\t\treturn LoaderUtils.extractUrlBase(url);\n\t};\n\n\tLoader.Handlers = {\n\t\tadd: function () {\n\t\t\tconsole.error('THREE.Loader: Handlers.add() has been removed. Use LoadingManager.addHandler() instead.');\n\t\t},\n\t\tget: function () {\n\t\t\tconsole.error('THREE.Loader: Handlers.get() has been removed. Use LoadingManager.getHandler() instead.');\n\t\t}\n\t};\n\tfunction XHRLoader(manager) {\n\t\tconsole.warn('THREE.XHRLoader has been renamed to THREE.FileLoader.');\n\t\treturn new FileLoader(manager);\n\t}\n\tfunction BinaryTextureLoader(manager) {\n\t\tconsole.warn('THREE.BinaryTextureLoader has been renamed to THREE.DataTextureLoader.');\n\t\treturn new DataTextureLoader(manager);\n\t} //\n\n\tBox2.prototype.center = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box2: .center() has been renamed to .getCenter().');\n\t\treturn this.getCenter(optionalTarget);\n\t};\n\n\tBox2.prototype.empty = function () {\n\t\tconsole.warn('THREE.Box2: .empty() has been renamed to .isEmpty().');\n\t\treturn this.isEmpty();\n\t};\n\n\tBox2.prototype.isIntersectionBox = function (box) {\n\t\tconsole.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().');\n\t\treturn this.intersectsBox(box);\n\t};\n\n\tBox2.prototype.size = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box2: .size() has been renamed to .getSize().');\n\t\treturn this.getSize(optionalTarget);\n\t}; //\n\n\n\tBox3.prototype.center = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box3: .center() has been renamed to .getCenter().');\n\t\treturn this.getCenter(optionalTarget);\n\t};\n\n\tBox3.prototype.empty = function () {\n\t\tconsole.warn('THREE.Box3: .empty() has been renamed to .isEmpty().');\n\t\treturn this.isEmpty();\n\t};\n\n\tBox3.prototype.isIntersectionBox = function (box) {\n\t\tconsole.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().');\n\t\treturn this.intersectsBox(box);\n\t};\n\n\tBox3.prototype.isIntersectionSphere = function (sphere) {\n\t\tconsole.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().');\n\t\treturn this.intersectsSphere(sphere);\n\t};\n\n\tBox3.prototype.size = function (optionalTarget) {\n\t\tconsole.warn('THREE.Box3: .size() has been renamed to .getSize().');\n\t\treturn this.getSize(optionalTarget);\n\t}; //\n\n\n\tSphere.prototype.empty = function () {\n\t\tconsole.warn('THREE.Sphere: .empty() has been renamed to .isEmpty().');\n\t\treturn this.isEmpty();\n\t}; //\n\n\n\tFrustum.prototype.setFromMatrix = function (m) {\n\t\tconsole.warn('THREE.Frustum: .setFromMatrix() has been renamed to .setFromProjectionMatrix().');\n\t\treturn this.setFromProjectionMatrix(m);\n\t}; //\n\n\n\tLine3.prototype.center = function (optionalTarget) {\n\t\tconsole.warn('THREE.Line3: .center() has been renamed to .getCenter().');\n\t\treturn this.getCenter(optionalTarget);\n\t}; //\n\n\n\tMatrix3.prototype.flattenToArrayOffset = function (array, offset) {\n\t\tconsole.warn('THREE.Matrix3: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.');\n\t\treturn this.toArray(array, offset);\n\t};\n\n\tMatrix3.prototype.multiplyVector3 = function (vector) {\n\t\tconsole.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.');\n\t\treturn vector.applyMatrix3(this);\n\t};\n\n\tMatrix3.prototype.multiplyVector3Array = function () {\n\t\tconsole.error('THREE.Matrix3: .multiplyVector3Array() has been removed.');\n\t};\n\n\tMatrix3.prototype.applyToBufferAttribute = function (attribute) {\n\t\tconsole.warn('THREE.Matrix3: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix3( matrix ) instead.');\n\t\treturn attribute.applyMatrix3(this);\n\t};\n\n\tMatrix3.prototype.applyToVector3Array = function () {\n\t\tconsole.error('THREE.Matrix3: .applyToVector3Array() has been removed.');\n\t};\n\n\tMatrix3.prototype.getInverse = function (matrix) {\n\t\tconsole.warn('THREE.Matrix3: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.');\n\t\treturn this.copy(matrix).invert();\n\t}; //\n\n\n\tMatrix4.prototype.extractPosition = function (m) {\n\t\tconsole.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().');\n\t\treturn this.copyPosition(m);\n\t};\n\n\tMatrix4.prototype.flattenToArrayOffset = function (array, offset) {\n\t\tconsole.warn('THREE.Matrix4: .flattenToArrayOffset() has been deprecated. Use .toArray() instead.');\n\t\treturn this.toArray(array, offset);\n\t};\n\n\tMatrix4.prototype.getPosition = function () {\n\t\tconsole.warn('THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.');\n\t\treturn new Vector3().setFromMatrixColumn(this, 3);\n\t};\n\n\tMatrix4.prototype.setRotationFromQuaternion = function (q) {\n\t\tconsole.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().');\n\t\treturn this.makeRotationFromQuaternion(q);\n\t};\n\n\tMatrix4.prototype.multiplyToArray = function () {\n\t\tconsole.warn('THREE.Matrix4: .multiplyToArray() has been removed.');\n\t};\n\n\tMatrix4.prototype.multiplyVector3 = function (vector) {\n\t\tconsole.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) instead.');\n\t\treturn vector.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.multiplyVector4 = function (vector) {\n\t\tconsole.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.');\n\t\treturn vector.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.multiplyVector3Array = function () {\n\t\tconsole.error('THREE.Matrix4: .multiplyVector3Array() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateAxis = function (v) {\n\t\tconsole.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.');\n\t\tv.transformDirection(this);\n\t};\n\n\tMatrix4.prototype.crossVector = function (vector) {\n\t\tconsole.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.');\n\t\treturn vector.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.translate = function () {\n\t\tconsole.error('THREE.Matrix4: .translate() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateX = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateX() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateY = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateY() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateZ = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateZ() has been removed.');\n\t};\n\n\tMatrix4.prototype.rotateByAxis = function () {\n\t\tconsole.error('THREE.Matrix4: .rotateByAxis() has been removed.');\n\t};\n\n\tMatrix4.prototype.applyToBufferAttribute = function (attribute) {\n\t\tconsole.warn('THREE.Matrix4: .applyToBufferAttribute() has been removed. Use attribute.applyMatrix4( matrix ) instead.');\n\t\treturn attribute.applyMatrix4(this);\n\t};\n\n\tMatrix4.prototype.applyToVector3Array = function () {\n\t\tconsole.error('THREE.Matrix4: .applyToVector3Array() has been removed.');\n\t};\n\n\tMatrix4.prototype.makeFrustum = function (left, right, bottom, top, near, far) {\n\t\tconsole.warn('THREE.Matrix4: .makeFrustum() has been removed. Use .makePerspective( left, right, top, bottom, near, far ) instead.');\n\t\treturn this.makePerspective(left, right, top, bottom, near, far);\n\t};\n\n\tMatrix4.prototype.getInverse = function (matrix) {\n\t\tconsole.warn('THREE.Matrix4: .getInverse() has been removed. Use matrixInv.copy( matrix ).invert(); instead.');\n\t\treturn this.copy(matrix).invert();\n\t}; //\n\n\n\tPlane.prototype.isIntersectionLine = function (line) {\n\t\tconsole.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().');\n\t\treturn this.intersectsLine(line);\n\t}; //\n\n\n\tQuaternion.prototype.multiplyVector3 = function (vector) {\n\t\tconsole.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.');\n\t\treturn vector.applyQuaternion(this);\n\t};\n\n\tQuaternion.prototype.inverse = function () {\n\t\tconsole.warn('THREE.Quaternion: .inverse() has been renamed to invert().');\n\t\treturn this.invert();\n\t}; //\n\n\n\tRay.prototype.isIntersectionBox = function (box) {\n\t\tconsole.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().');\n\t\treturn this.intersectsBox(box);\n\t};\n\n\tRay.prototype.isIntersectionPlane = function (plane) {\n\t\tconsole.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().');\n\t\treturn this.intersectsPlane(plane);\n\t};\n\n\tRay.prototype.isIntersectionSphere = function (sphere) {\n\t\tconsole.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().');\n\t\treturn this.intersectsSphere(sphere);\n\t}; //\n\n\n\tTriangle.prototype.area = function () {\n\t\tconsole.warn('THREE.Triangle: .area() has been renamed to .getArea().');\n\t\treturn this.getArea();\n\t};\n\n\tTriangle.prototype.barycoordFromPoint = function (point, target) {\n\t\tconsole.warn('THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().');\n\t\treturn this.getBarycoord(point, target);\n\t};\n\n\tTriangle.prototype.midpoint = function (target) {\n\t\tconsole.warn('THREE.Triangle: .midpoint() has been renamed to .getMidpoint().');\n\t\treturn this.getMidpoint(target);\n\t};\n\n\tTriangle.prototypenormal = function (target) {\n\t\tconsole.warn('THREE.Triangle: .normal() has been renamed to .getNormal().');\n\t\treturn this.getNormal(target);\n\t};\n\n\tTriangle.prototype.plane = function (target) {\n\t\tconsole.warn('THREE.Triangle: .plane() has been renamed to .getPlane().');\n\t\treturn this.getPlane(target);\n\t};\n\n\tTriangle.barycoordFromPoint = function (point, a, b, c, target) {\n\t\tconsole.warn('THREE.Triangle: .barycoordFromPoint() has been renamed to .getBarycoord().');\n\t\treturn Triangle.getBarycoord(point, a, b, c, target);\n\t};\n\n\tTriangle.normal = function (a, b, c, target) {\n\t\tconsole.warn('THREE.Triangle: .normal() has been renamed to .getNormal().');\n\t\treturn Triangle.getNormal(a, b, c, target);\n\t}; //\n\n\n\tShape.prototype.extractAllPoints = function (divisions) {\n\t\tconsole.warn('THREE.Shape: .extractAllPoints() has been removed. Use .extractPoints() instead.');\n\t\treturn this.extractPoints(divisions);\n\t};\n\n\tShape.prototype.extrude = function (options) {\n\t\tconsole.warn('THREE.Shape: .extrude() has been removed. Use ExtrudeGeometry() instead.');\n\t\treturn new ExtrudeGeometry(this, options);\n\t};\n\n\tShape.prototype.makeGeometry = function (options) {\n\t\tconsole.warn('THREE.Shape: .makeGeometry() has been removed. Use ShapeGeometry() instead.');\n\t\treturn new ShapeGeometry(this, options);\n\t}; //\n\n\n\tVector2.prototype.fromAttribute = function (attribute, index, offset) {\n\t\tconsole.warn('THREE.Vector2: .fromAttribute() has been renamed to .fromBufferAttribute().');\n\t\treturn this.fromBufferAttribute(attribute, index, offset);\n\t};\n\n\tVector2.prototype.distanceToManhattan = function (v) {\n\t\tconsole.warn('THREE.Vector2: .distanceToManhattan() has been renamed to .manhattanDistanceTo().');\n\t\treturn this.manhattanDistanceTo(v);\n\t};\n\n\tVector2.prototype.lengthManhattan = function () {\n\t\tconsole.warn('THREE.Vector2: .lengthManhattan() has been renamed to .manhattanLength().');\n\t\treturn this.manhattanLength();\n\t}; //\n\n\n\tVector3.prototype.setEulerFromRotationMatrix = function () {\n\t\tconsole.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.');\n\t};\n\n\tVector3.prototype.setEulerFromQuaternion = function () {\n\t\tconsole.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.');\n\t};\n\n\tVector3.prototype.getPositionFromMatrix = function (m) {\n\t\tconsole.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().');\n\t\treturn this.setFromMatrixPosition(m);\n\t};\n\n\tVector3.prototype.getScaleFromMatrix = function (m) {\n\t\tconsole.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().');\n\t\treturn this.setFromMatrixScale(m);\n\t};\n\n\tVector3.prototype.getColumnFromMatrix = function (index, matrix) {\n\t\tconsole.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().');\n\t\treturn this.setFromMatrixColumn(matrix, index);\n\t};\n\n\tVector3.prototype.applyProjection = function (m) {\n\t\tconsole.warn('THREE.Vector3: .applyProjection() has been removed. Use .applyMatrix4( m ) instead.');\n\t\treturn this.applyMatrix4(m);\n\t};\n\n\tVector3.prototype.fromAttribute = function (attribute, index, offset) {\n\t\tconsole.warn('THREE.Vector3: .fromAttribute() has been renamed to .fromBufferAttribute().');\n\t\treturn this.fromBufferAttribute(attribute, index, offset);\n\t};\n\n\tVector3.prototype.distanceToManhattan = function (v) {\n\t\tconsole.warn('THREE.Vector3: .distanceToManhattan() has been renamed to .manhattanDistanceTo().');\n\t\treturn this.manhattanDistanceTo(v);\n\t};\n\n\tVector3.prototype.lengthManhattan = function () {\n\t\tconsole.warn('THREE.Vector3: .lengthManhattan() has been renamed to .manhattanLength().');\n\t\treturn this.manhattanLength();\n\t}; //\n\n\n\tVector4.prototype.fromAttribute = function (attribute, index, offset) {\n\t\tconsole.warn('THREE.Vector4: .fromAttribute() has been renamed to .fromBufferAttribute().');\n\t\treturn this.fromBufferAttribute(attribute, index, offset);\n\t};\n\n\tVector4.prototype.lengthManhattan = function () {\n\t\tconsole.warn('THREE.Vector4: .lengthManhattan() has been renamed to .manhattanLength().');\n\t\treturn this.manhattanLength();\n\t}; //\n\n\n\tObject3D.prototype.getChildByName = function (name) {\n\t\tconsole.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().');\n\t\treturn this.getObjectByName(name);\n\t};\n\n\tObject3D.prototype.renderDepth = function () {\n\t\tconsole.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.');\n\t};\n\n\tObject3D.prototype.translate = function (distance, axis) {\n\t\tconsole.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.');\n\t\treturn this.translateOnAxis(axis, distance);\n\t};\n\n\tObject3D.prototype.getWorldRotation = function () {\n\t\tconsole.error('THREE.Object3D: .getWorldRotation() has been removed. Use THREE.Object3D.getWorldQuaternion( target ) instead.');\n\t};\n\n\tObject3D.prototype.applyMatrix = function (matrix) {\n\t\tconsole.warn('THREE.Object3D: .applyMatrix() has been renamed to .applyMatrix4().');\n\t\treturn this.applyMatrix4(matrix);\n\t};\n\n\tObject.defineProperties(Object3D.prototype, {\n\t\teulerOrder: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Object3D: .eulerOrder is now .rotation.order.');\n\t\t\t\treturn this.rotation.order;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Object3D: .eulerOrder is now .rotation.order.');\n\t\t\t\tthis.rotation.order = value;\n\t\t\t}\n\t\t},\n\t\tuseQuaternion: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.');\n\t\t\t}\n\t\t}\n\t});\n\n\tMesh.prototype.setDrawMode = function () {\n\t\tconsole.error('THREE.Mesh: .setDrawMode() has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.');\n\t};\n\n\tObject.defineProperties(Mesh.prototype, {\n\t\tdrawMode: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error('THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode.');\n\t\t\t\treturn TrianglesDrawMode;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.error('THREE.Mesh: .drawMode has been removed. The renderer now always assumes THREE.TrianglesDrawMode. Transform your geometry via BufferGeometryUtils.toTrianglesDrawMode() if necessary.');\n\t\t\t}\n\t\t}\n\t});\n\n\tSkinnedMesh.prototype.initBones = function () {\n\t\tconsole.error('THREE.SkinnedMesh: initBones() has been removed.');\n\t}; //\n\n\n\tPerspectiveCamera.prototype.setLens = function (focalLength, filmGauge) {\n\t\tconsole.warn('THREE.PerspectiveCamera.setLens is deprecated. ' + 'Use .setFocalLength and .filmGauge for a photographic setup.');\n\t\tif (filmGauge !== undefined) this.filmGauge = filmGauge;\n\t\tthis.setFocalLength(focalLength);\n\t}; //\n\n\n\tObject.defineProperties(Light.prototype, {\n\t\tonlyShadow: {\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Light: .onlyShadow has been removed.');\n\t\t\t}\n\t\t},\n\t\tshadowCameraFov: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.');\n\t\t\t\tthis.shadow.camera.fov = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraLeft: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.');\n\t\t\t\tthis.shadow.camera.left = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraRight: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.');\n\t\t\t\tthis.shadow.camera.right = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraTop: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.');\n\t\t\t\tthis.shadow.camera.top = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraBottom: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.');\n\t\t\t\tthis.shadow.camera.bottom = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraNear: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.');\n\t\t\t\tthis.shadow.camera.near = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraFar: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.');\n\t\t\t\tthis.shadow.camera.far = value;\n\t\t\t}\n\t\t},\n\t\tshadowCameraVisible: {\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.');\n\t\t\t}\n\t\t},\n\t\tshadowBias: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowBias is now .shadow.bias.');\n\t\t\t\tthis.shadow.bias = value;\n\t\t\t}\n\t\t},\n\t\tshadowDarkness: {\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Light: .shadowDarkness has been removed.');\n\t\t\t}\n\t\t},\n\t\tshadowMapWidth: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.');\n\t\t\t\tthis.shadow.mapSize.width = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapHeight: {\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.');\n\t\t\t\tthis.shadow.mapSize.height = value;\n\t\t\t}\n\t\t}\n\t}); //\n\n\tObject.defineProperties(BufferAttribute.prototype, {\n\t\tlength: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.BufferAttribute: .length has been deprecated. Use .count instead.');\n\t\t\t\treturn this.array.length;\n\t\t\t}\n\t\t},\n\t\tdynamic: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.');\n\t\t\t\treturn this.usage === DynamicDrawUsage;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.BufferAttribute: .dynamic has been deprecated. Use .usage instead.');\n\t\t\t\tthis.setUsage(DynamicDrawUsage);\n\t\t\t}\n\t\t}\n\t});\n\n\tBufferAttribute.prototype.setDynamic = function (value) {\n\t\tconsole.warn('THREE.BufferAttribute: .setDynamic() has been deprecated. Use .setUsage() instead.');\n\t\tthis.setUsage(value === true ? DynamicDrawUsage : StaticDrawUsage);\n\t\treturn this;\n\t};\n\n\tBufferAttribute.prototype.copyIndicesArray = function () {\n\t\tconsole.error('THREE.BufferAttribute: .copyIndicesArray() has been removed.');\n\t}, BufferAttribute.prototype.setArray = function () {\n\t\tconsole.error('THREE.BufferAttribute: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers');\n\t}; //\n\n\tBufferGeometry.prototype.addIndex = function (index) {\n\t\tconsole.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().');\n\t\tthis.setIndex(index);\n\t};\n\n\tBufferGeometry.prototype.addAttribute = function (name, attribute) {\n\t\tconsole.warn('THREE.BufferGeometry: .addAttribute() has been renamed to .setAttribute().');\n\n\t\tif (!(attribute && attribute.isBufferAttribute) && !(attribute && attribute.isInterleavedBufferAttribute)) {\n\t\t\tconsole.warn('THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).');\n\t\t\treturn this.setAttribute(name, new BufferAttribute(arguments[1], arguments[2]));\n\t\t}\n\n\t\tif (name === 'index') {\n\t\t\tconsole.warn('THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.');\n\t\t\tthis.setIndex(attribute);\n\t\t\treturn this;\n\t\t}\n\n\t\treturn this.setAttribute(name, attribute);\n\t};\n\n\tBufferGeometry.prototype.addDrawCall = function (start, count, indexOffset) {\n\t\tif (indexOffset !== undefined) {\n\t\t\tconsole.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.');\n\t\t}\n\n\t\tconsole.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().');\n\t\tthis.addGroup(start, count);\n\t};\n\n\tBufferGeometry.prototype.clearDrawCalls = function () {\n\t\tconsole.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().');\n\t\tthis.clearGroups();\n\t};\n\n\tBufferGeometry.prototype.computeOffsets = function () {\n\t\tconsole.warn('THREE.BufferGeometry: .computeOffsets() has been removed.');\n\t};\n\n\tBufferGeometry.prototype.removeAttribute = function (name) {\n\t\tconsole.warn('THREE.BufferGeometry: .removeAttribute() has been renamed to .deleteAttribute().');\n\t\treturn this.deleteAttribute(name);\n\t};\n\n\tBufferGeometry.prototype.applyMatrix = function (matrix) {\n\t\tconsole.warn('THREE.BufferGeometry: .applyMatrix() has been renamed to .applyMatrix4().');\n\t\treturn this.applyMatrix4(matrix);\n\t};\n\n\tObject.defineProperties(BufferGeometry.prototype, {\n\t\tdrawcalls: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.');\n\t\t\t\treturn this.groups;\n\t\t\t}\n\t\t},\n\t\toffsets: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.');\n\t\t\t\treturn this.groups;\n\t\t\t}\n\t\t}\n\t});\n\n\tInterleavedBuffer.prototype.setDynamic = function (value) {\n\t\tconsole.warn('THREE.InterleavedBuffer: .setDynamic() has been deprecated. Use .setUsage() instead.');\n\t\tthis.setUsage(value === true ? DynamicDrawUsage : StaticDrawUsage);\n\t\treturn this;\n\t};\n\n\tInterleavedBuffer.prototype.setArray = function () {\n\t\tconsole.error('THREE.InterleavedBuffer: .setArray has been removed. Use BufferGeometry .setAttribute to replace/resize attribute buffers');\n\t}; //\n\n\n\tExtrudeGeometry.prototype.getArrays = function () {\n\t\tconsole.error('THREE.ExtrudeGeometry: .getArrays() has been removed.');\n\t};\n\n\tExtrudeGeometry.prototype.addShapeList = function () {\n\t\tconsole.error('THREE.ExtrudeGeometry: .addShapeList() has been removed.');\n\t};\n\n\tExtrudeGeometry.prototype.addShape = function () {\n\t\tconsole.error('THREE.ExtrudeGeometry: .addShape() has been removed.');\n\t}; //\n\n\n\tScene.prototype.dispose = function () {\n\t\tconsole.error('THREE.Scene: .dispose() has been removed.');\n\t}; //\n\n\n\tUniform.prototype.onUpdate = function () {\n\t\tconsole.warn('THREE.Uniform: .onUpdate() has been removed. Use object.onBeforeRender() instead.');\n\t\treturn this;\n\t}; //\n\n\n\tObject.defineProperties(Material.prototype, {\n\t\twrapAround: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Material: .wrapAround has been removed.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Material: .wrapAround has been removed.');\n\t\t\t}\n\t\t},\n\t\toverdraw: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Material: .overdraw has been removed.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.Material: .overdraw has been removed.');\n\t\t\t}\n\t\t},\n\t\twrapRGB: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.Material: .wrapRGB has been removed.');\n\t\t\t\treturn new Color();\n\t\t\t}\n\t\t},\n\t\tshading: {\n\t\t\tget: function () {\n\t\t\t\tconsole.error('THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.');\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .shading has been removed. Use the boolean .flatShading instead.');\n\t\t\t\tthis.flatShading = value === FlatShading;\n\t\t\t}\n\t\t},\n\t\tstencilMask: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.');\n\t\t\t\treturn this.stencilFuncMask;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .stencilMask has been removed. Use .stencilFuncMask instead.');\n\t\t\t\tthis.stencilFuncMask = value;\n\t\t\t}\n\t\t},\n\t\tvertexTangents: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .vertexTangents has been removed.');\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.' + this.type + ': .vertexTangents has been removed.');\n\t\t\t}\n\t\t}\n\t});\n\tObject.defineProperties(ShaderMaterial.prototype, {\n\t\tderivatives: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.');\n\t\t\t\treturn this.extensions.derivatives;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.');\n\t\t\t\tthis.extensions.derivatives = value;\n\t\t\t}\n\t\t}\n\t}); //\n\n\tWebGLRenderer.prototype.clearTarget = function (renderTarget, color, depth, stencil) {\n\t\tconsole.warn('THREE.WebGLRenderer: .clearTarget() has been deprecated. Use .setRenderTarget() and .clear() instead.');\n\t\tthis.setRenderTarget(renderTarget);\n\t\tthis.clear(color, depth, stencil);\n\t};\n\n\tWebGLRenderer.prototype.animate = function (callback) {\n\t\tconsole.warn('THREE.WebGLRenderer: .animate() is now .setAnimationLoop().');\n\t\tthis.setAnimationLoop(callback);\n\t};\n\n\tWebGLRenderer.prototype.getCurrentRenderTarget = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getCurrentRenderTarget() is now .getRenderTarget().');\n\t\treturn this.getRenderTarget();\n\t};\n\n\tWebGLRenderer.prototype.getMaxAnisotropy = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getMaxAnisotropy() is now .capabilities.getMaxAnisotropy().');\n\t\treturn this.capabilities.getMaxAnisotropy();\n\t};\n\n\tWebGLRenderer.prototype.getPrecision = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getPrecision() is now .capabilities.precision.');\n\t\treturn this.capabilities.precision;\n\t};\n\n\tWebGLRenderer.prototype.resetGLState = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .resetGLState() is now .state.reset().');\n\t\treturn this.state.reset();\n\t};\n\n\tWebGLRenderer.prototype.supportsFloatTextures = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( \\'OES_texture_float\\' ).');\n\t\treturn this.extensions.get('OES_texture_float');\n\t};\n\n\tWebGLRenderer.prototype.supportsHalfFloatTextures = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( \\'OES_texture_half_float\\' ).');\n\t\treturn this.extensions.get('OES_texture_half_float');\n\t};\n\n\tWebGLRenderer.prototype.supportsStandardDerivatives = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( \\'OES_standard_derivatives\\' ).');\n\t\treturn this.extensions.get('OES_standard_derivatives');\n\t};\n\n\tWebGLRenderer.prototype.supportsCompressedTextureS3TC = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( \\'WEBGL_compressed_texture_s3tc\\' ).');\n\t\treturn this.extensions.get('WEBGL_compressed_texture_s3tc');\n\t};\n\n\tWebGLRenderer.prototype.supportsCompressedTexturePVRTC = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( \\'WEBGL_compressed_texture_pvrtc\\' ).');\n\t\treturn this.extensions.get('WEBGL_compressed_texture_pvrtc');\n\t};\n\n\tWebGLRenderer.prototype.supportsBlendMinMax = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( \\'EXT_blend_minmax\\' ).');\n\t\treturn this.extensions.get('EXT_blend_minmax');\n\t};\n\n\tWebGLRenderer.prototype.supportsVertexTextures = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsVertexTextures() is now .capabilities.vertexTextures.');\n\t\treturn this.capabilities.vertexTextures;\n\t};\n\n\tWebGLRenderer.prototype.supportsInstancedArrays = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( \\'ANGLE_instanced_arrays\\' ).');\n\t\treturn this.extensions.get('ANGLE_instanced_arrays');\n\t};\n\n\tWebGLRenderer.prototype.enableScissorTest = function (boolean) {\n\t\tconsole.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().');\n\t\tthis.setScissorTest(boolean);\n\t};\n\n\tWebGLRenderer.prototype.initMaterial = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .initMaterial() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.addPrePlugin = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.addPostPlugin = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.updateShadowMap = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.setFaceCulling = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .setFaceCulling() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.setTexture = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .setTexture() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.setTextureCube = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .setTextureCube() has been removed.');\n\t};\n\n\tWebGLRenderer.prototype.getActiveMipMapLevel = function () {\n\t\tconsole.warn('THREE.WebGLRenderer: .getActiveMipMapLevel() is now .getActiveMipmapLevel().');\n\t\treturn this.getActiveMipmapLevel();\n\t};\n\n\tObject.defineProperties(WebGLRenderer.prototype, {\n\t\tshadowMapEnabled: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.enabled;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.');\n\t\t\t\tthis.shadowMap.enabled = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapType: {\n\t\t\tget: function () {\n\t\t\t\treturn this.shadowMap.type;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.');\n\t\t\t\tthis.shadowMap.type = value;\n\t\t\t}\n\t\t},\n\t\tshadowMapCullFace: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMapCullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t},\n\t\tcontext: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .context has been removed. Use .getContext() instead.');\n\t\t\t\treturn this.getContext();\n\t\t\t}\n\t\t},\n\t\tvr: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .vr has been renamed to .xr');\n\t\t\t\treturn this.xr;\n\t\t\t}\n\t\t},\n\t\tgammaInput: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.');\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaInput has been removed. Set the encoding for textures via Texture.encoding instead.');\n\t\t\t}\n\t\t},\n\t\tgammaOutput: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.');\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .gammaOutput has been removed. Set WebGLRenderer.outputEncoding instead.');\n\t\t\t\tthis.outputEncoding = value === true ? sRGBEncoding : LinearEncoding;\n\t\t\t}\n\t\t},\n\t\ttoneMappingWhitePoint: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.');\n\t\t\t\treturn 1.0;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .toneMappingWhitePoint has been removed.');\n\t\t\t}\n\t\t}\n\t});\n\tObject.defineProperties(WebGLShadowMap.prototype, {\n\t\tcullFace: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.cullFace has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t},\n\t\trenderReverseSided: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderReverseSided has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t},\n\t\trenderSingleSided: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.');\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t\tset: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderer: .shadowMap.renderSingleSided has been removed. Set Material.shadowSide instead.');\n\t\t\t}\n\t\t}\n\t});\n\tfunction WebGLRenderTargetCube(width, height, options) {\n\t\tconsole.warn('THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).');\n\t\treturn new WebGLCubeRenderTarget(width, options);\n\t} //\n\n\tObject.defineProperties(WebGLRenderTarget.prototype, {\n\t\twrapS: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.');\n\t\t\t\treturn this.texture.wrapS;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.');\n\t\t\t\tthis.texture.wrapS = value;\n\t\t\t}\n\t\t},\n\t\twrapT: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.');\n\t\t\t\treturn this.texture.wrapT;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.');\n\t\t\t\tthis.texture.wrapT = value;\n\t\t\t}\n\t\t},\n\t\tmagFilter: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.');\n\t\t\t\treturn this.texture.magFilter;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.');\n\t\t\t\tthis.texture.magFilter = value;\n\t\t\t}\n\t\t},\n\t\tminFilter: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.');\n\t\t\t\treturn this.texture.minFilter;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.');\n\t\t\t\tthis.texture.minFilter = value;\n\t\t\t}\n\t\t},\n\t\tanisotropy: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.');\n\t\t\t\treturn this.texture.anisotropy;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.');\n\t\t\t\tthis.texture.anisotropy = value;\n\t\t\t}\n\t\t},\n\t\toffset: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.');\n\t\t\t\treturn this.texture.offset;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.');\n\t\t\t\tthis.texture.offset = value;\n\t\t\t}\n\t\t},\n\t\trepeat: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.');\n\t\t\t\treturn this.texture.repeat;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.');\n\t\t\t\tthis.texture.repeat = value;\n\t\t\t}\n\t\t},\n\t\tformat: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .format is now .texture.format.');\n\t\t\t\treturn this.texture.format;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .format is now .texture.format.');\n\t\t\t\tthis.texture.format = value;\n\t\t\t}\n\t\t},\n\t\ttype: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .type is now .texture.type.');\n\t\t\t\treturn this.texture.type;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .type is now .texture.type.');\n\t\t\t\tthis.texture.type = value;\n\t\t\t}\n\t\t},\n\t\tgenerateMipmaps: {\n\t\t\tget: function () {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.');\n\t\t\t\treturn this.texture.generateMipmaps;\n\t\t\t},\n\t\t\tset: function (value) {\n\t\t\t\tconsole.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.');\n\t\t\t\tthis.texture.generateMipmaps = value;\n\t\t\t}\n\t\t}\n\t}); //\n\n\tAudio.prototype.load = function (file) {\n\t\tconsole.warn('THREE.Audio: .load has been deprecated. Use THREE.AudioLoader instead.');\n\t\tconst scope = this;\n\t\tconst audioLoader = new AudioLoader();\n\t\taudioLoader.load(file, function (buffer) {\n\t\t\tscope.setBuffer(buffer);\n\t\t});\n\t\treturn this;\n\t};\n\n\tAudioAnalyser.prototype.getData = function () {\n\t\tconsole.warn('THREE.AudioAnalyser: .getData() is now .getFrequencyData().');\n\t\treturn this.getFrequencyData();\n\t}; //\n\n\n\tCubeCamera.prototype.updateCubeMap = function (renderer, scene) {\n\t\tconsole.warn('THREE.CubeCamera: .updateCubeMap() is now .update().');\n\t\treturn this.update(renderer, scene);\n\t};\n\n\tCubeCamera.prototype.clear = function (renderer, color, depth, stencil) {\n\t\tconsole.warn('THREE.CubeCamera: .clear() is now .renderTarget.clear().');\n\t\treturn this.renderTarget.clear(renderer, color, depth, stencil);\n\t};\n\n\tImageUtils.crossOrigin = undefined;\n\n\tImageUtils.loadTexture = function (url, mapping, onLoad, onError) {\n\t\tconsole.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.');\n\t\tconst loader = new TextureLoader();\n\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\tconst texture = loader.load(url, onLoad, undefined, onError);\n\t\tif (mapping) texture.mapping = mapping;\n\t\treturn texture;\n\t};\n\n\tImageUtils.loadTextureCube = function (urls, mapping, onLoad, onError) {\n\t\tconsole.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.');\n\t\tconst loader = new CubeTextureLoader();\n\t\tloader.setCrossOrigin(this.crossOrigin);\n\t\tconst texture = loader.load(urls, onLoad, undefined, onError);\n\t\tif (mapping) texture.mapping = mapping;\n\t\treturn texture;\n\t};\n\n\tImageUtils.loadCompressedTexture = function () {\n\t\tconsole.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.');\n\t};\n\n\tImageUtils.loadCompressedTextureCube = function () {\n\t\tconsole.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.');\n\t}; //\n\n\n\tfunction CanvasRenderer() {\n\t\tconsole.error('THREE.CanvasRenderer has been removed');\n\t} //\n\n\tfunction JSONLoader() {\n\t\tconsole.error('THREE.JSONLoader has been removed.');\n\t} //\n\n\tconst SceneUtils = {\n\t\tcreateMultiMaterialObject: function () {\n\t\t\tconsole.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');\n\t\t},\n\t\tdetach: function () {\n\t\t\tconsole.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');\n\t\t},\n\t\tattach: function () {\n\t\t\tconsole.error('THREE.SceneUtils has been moved to /examples/jsm/utils/SceneUtils.js');\n\t\t}\n\t}; //\n\n\tfunction LensFlare() {\n\t\tconsole.error('THREE.LensFlare has been moved to /examples/jsm/objects/Lensflare.js');\n\t} //\n\n\tfunction ParametricGeometry() {\n\t\tconsole.error('THREE.ParametricGeometry has been moved to /examples/jsm/geometries/ParametricGeometry.js');\n\t\treturn new BufferGeometry();\n\t}\n\tfunction TextGeometry() {\n\t\tconsole.error('THREE.TextGeometry has been moved to /examples/jsm/geometries/TextGeometry.js');\n\t\treturn new BufferGeometry();\n\t}\n\tfunction FontLoader() {\n\t\tconsole.error('THREE.FontLoader has been moved to /examples/jsm/loaders/FontLoader.js');\n\t}\n\tfunction Font() {\n\t\tconsole.error('THREE.Font has been moved to /examples/jsm/loaders/FontLoader.js');\n\t}\n\n\tif (typeof __THREE_DEVTOOLS__ !== 'undefined') {\n\t\t/* eslint-disable no-undef */\n\t\t__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent('register', {\n\t\t\tdetail: {\n\t\t\t\trevision: REVISION\n\t\t\t}\n\t\t}));\n\t\t/* eslint-enable no-undef */\n\n\t}\n\n\tif (typeof window !== 'undefined') {\n\t\tif (window.__THREE__) {\n\t\t\tconsole.warn('WARNING: Multiple instances of Three.js being imported.');\n\t\t} else {\n\t\t\twindow.__THREE__ = REVISION;\n\t\t}\n\t}\n\n\texports.ACESFilmicToneMapping = ACESFilmicToneMapping;\n\texports.AddEquation = AddEquation;\n\texports.AddOperation = AddOperation;\n\texports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;\n\texports.AdditiveBlending = AdditiveBlending;\n\texports.AlphaFormat = AlphaFormat;\n\texports.AlwaysDepth = AlwaysDepth;\n\texports.AlwaysStencilFunc = AlwaysStencilFunc;\n\texports.AmbientLight = AmbientLight;\n\texports.AmbientLightProbe = AmbientLightProbe;\n\texports.AnimationClip = AnimationClip;\n\texports.AnimationLoader = AnimationLoader;\n\texports.AnimationMixer = AnimationMixer;\n\texports.AnimationObjectGroup = AnimationObjectGroup;\n\texports.AnimationUtils = AnimationUtils;\n\texports.ArcCurve = ArcCurve;\n\texports.ArrayCamera = ArrayCamera;\n\texports.ArrowHelper = ArrowHelper;\n\texports.Audio = Audio;\n\texports.AudioAnalyser = AudioAnalyser;\n\texports.AudioContext = AudioContext;\n\texports.AudioListener = AudioListener;\n\texports.AudioLoader = AudioLoader;\n\texports.AxesHelper = AxesHelper;\n\texports.AxisHelper = AxisHelper;\n\texports.BackSide = BackSide;\n\texports.BasicDepthPacking = BasicDepthPacking;\n\texports.BasicShadowMap = BasicShadowMap;\n\texports.BinaryTextureLoader = BinaryTextureLoader;\n\texports.Bone = Bone;\n\texports.BooleanKeyframeTrack = BooleanKeyframeTrack;\n\texports.BoundingBoxHelper = BoundingBoxHelper;\n\texports.Box2 = Box2;\n\texports.Box3 = Box3;\n\texports.Box3Helper = Box3Helper;\n\texports.BoxBufferGeometry = BoxGeometry;\n\texports.BoxGeometry = BoxGeometry;\n\texports.BoxHelper = BoxHelper;\n\texports.BufferAttribute = BufferAttribute;\n\texports.BufferGeometry = BufferGeometry;\n\texports.BufferGeometryLoader = BufferGeometryLoader;\n\texports.ByteType = ByteType;\n\texports.Cache = Cache;\n\texports.Camera = Camera;\n\texports.CameraHelper = CameraHelper;\n\texports.CanvasRenderer = CanvasRenderer;\n\texports.CanvasTexture = CanvasTexture;\n\texports.CatmullRomCurve3 = CatmullRomCurve3;\n\texports.CineonToneMapping = CineonToneMapping;\n\texports.CircleBufferGeometry = CircleGeometry;\n\texports.CircleGeometry = CircleGeometry;\n\texports.ClampToEdgeWrapping = ClampToEdgeWrapping;\n\texports.Clock = Clock;\n\texports.Color = Color;\n\texports.ColorKeyframeTrack = ColorKeyframeTrack;\n\texports.CompressedTexture = CompressedTexture;\n\texports.CompressedTextureLoader = CompressedTextureLoader;\n\texports.ConeBufferGeometry = ConeGeometry;\n\texports.ConeGeometry = ConeGeometry;\n\texports.CubeCamera = CubeCamera;\n\texports.CubeReflectionMapping = CubeReflectionMapping;\n\texports.CubeRefractionMapping = CubeRefractionMapping;\n\texports.CubeTexture = CubeTexture;\n\texports.CubeTextureLoader = CubeTextureLoader;\n\texports.CubeUVReflectionMapping = CubeUVReflectionMapping;\n\texports.CubeUVRefractionMapping = CubeUVRefractionMapping;\n\texports.CubicBezierCurve = CubicBezierCurve;\n\texports.CubicBezierCurve3 = CubicBezierCurve3;\n\texports.CubicInterpolant = CubicInterpolant;\n\texports.CullFaceBack = CullFaceBack;\n\texports.CullFaceFront = CullFaceFront;\n\texports.CullFaceFrontBack = CullFaceFrontBack;\n\texports.CullFaceNone = CullFaceNone;\n\texports.Curve = Curve;\n\texports.CurvePath = CurvePath;\n\texports.CustomBlending = CustomBlending;\n\texports.CustomToneMapping = CustomToneMapping;\n\texports.CylinderBufferGeometry = CylinderGeometry;\n\texports.CylinderGeometry = CylinderGeometry;\n\texports.Cylindrical = Cylindrical;\n\texports.DataTexture = DataTexture;\n\texports.DataTexture2DArray = DataTexture2DArray;\n\texports.DataTexture3D = DataTexture3D;\n\texports.DataTextureLoader = DataTextureLoader;\n\texports.DataUtils = DataUtils;\n\texports.DecrementStencilOp = DecrementStencilOp;\n\texports.DecrementWrapStencilOp = DecrementWrapStencilOp;\n\texports.DefaultLoadingManager = DefaultLoadingManager;\n\texports.DepthFormat = DepthFormat;\n\texports.DepthStencilFormat = DepthStencilFormat;\n\texports.DepthTexture = DepthTexture;\n\texports.DirectionalLight = DirectionalLight;\n\texports.DirectionalLightHelper = DirectionalLightHelper;\n\texports.DiscreteInterpolant = DiscreteInterpolant;\n\texports.DodecahedronBufferGeometry = DodecahedronGeometry;\n\texports.DodecahedronGeometry = DodecahedronGeometry;\n\texports.DoubleSide = DoubleSide;\n\texports.DstAlphaFactor = DstAlphaFactor;\n\texports.DstColorFactor = DstColorFactor;\n\texports.DynamicBufferAttribute = DynamicBufferAttribute;\n\texports.DynamicCopyUsage = DynamicCopyUsage;\n\texports.DynamicDrawUsage = DynamicDrawUsage;\n\texports.DynamicReadUsage = DynamicReadUsage;\n\texports.EdgesGeometry = EdgesGeometry;\n\texports.EdgesHelper = EdgesHelper;\n\texports.EllipseCurve = EllipseCurve;\n\texports.EqualDepth = EqualDepth;\n\texports.EqualStencilFunc = EqualStencilFunc;\n\texports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;\n\texports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;\n\texports.Euler = Euler;\n\texports.EventDispatcher = EventDispatcher;\n\texports.ExtrudeBufferGeometry = ExtrudeGeometry;\n\texports.ExtrudeGeometry = ExtrudeGeometry;\n\texports.FaceColors = FaceColors;\n\texports.FileLoader = FileLoader;\n\texports.FlatShading = FlatShading;\n\texports.Float16BufferAttribute = Float16BufferAttribute;\n\texports.Float32Attribute = Float32Attribute;\n\texports.Float32BufferAttribute = Float32BufferAttribute;\n\texports.Float64Attribute = Float64Attribute;\n\texports.Float64BufferAttribute = Float64BufferAttribute;\n\texports.FloatType = FloatType;\n\texports.Fog = Fog;\n\texports.FogExp2 = FogExp2;\n\texports.Font = Font;\n\texports.FontLoader = FontLoader;\n\texports.FrontSide = FrontSide;\n\texports.Frustum = Frustum;\n\texports.GLBufferAttribute = GLBufferAttribute;\n\texports.GLSL1 = GLSL1;\n\texports.GLSL3 = GLSL3;\n\texports.GammaEncoding = GammaEncoding;\n\texports.GreaterDepth = GreaterDepth;\n\texports.GreaterEqualDepth = GreaterEqualDepth;\n\texports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;\n\texports.GreaterStencilFunc = GreaterStencilFunc;\n\texports.GridHelper = GridHelper;\n\texports.Group = Group;\n\texports.HalfFloatType = HalfFloatType;\n\texports.HemisphereLight = HemisphereLight;\n\texports.HemisphereLightHelper = HemisphereLightHelper;\n\texports.HemisphereLightProbe = HemisphereLightProbe;\n\texports.IcosahedronBufferGeometry = IcosahedronGeometry;\n\texports.IcosahedronGeometry = IcosahedronGeometry;\n\texports.ImageBitmapLoader = ImageBitmapLoader;\n\texports.ImageLoader = ImageLoader;\n\texports.ImageUtils = ImageUtils;\n\texports.ImmediateRenderObject = ImmediateRenderObject;\n\texports.IncrementStencilOp = IncrementStencilOp;\n\texports.IncrementWrapStencilOp = IncrementWrapStencilOp;\n\texports.InstancedBufferAttribute = InstancedBufferAttribute;\n\texports.InstancedBufferGeometry = InstancedBufferGeometry;\n\texports.InstancedInterleavedBuffer = InstancedInterleavedBuffer;\n\texports.InstancedMesh = InstancedMesh;\n\texports.Int16Attribute = Int16Attribute;\n\texports.Int16BufferAttribute = Int16BufferAttribute;\n\texports.Int32Attribute = Int32Attribute;\n\texports.Int32BufferAttribute = Int32BufferAttribute;\n\texports.Int8Attribute = Int8Attribute;\n\texports.Int8BufferAttribute = Int8BufferAttribute;\n\texports.IntType = IntType;\n\texports.InterleavedBuffer = InterleavedBuffer;\n\texports.InterleavedBufferAttribute = InterleavedBufferAttribute;\n\texports.Interpolant = Interpolant;\n\texports.InterpolateDiscrete = InterpolateDiscrete;\n\texports.InterpolateLinear = InterpolateLinear;\n\texports.InterpolateSmooth = InterpolateSmooth;\n\texports.InvertStencilOp = InvertStencilOp;\n\texports.JSONLoader = JSONLoader;\n\texports.KeepStencilOp = KeepStencilOp;\n\texports.KeyframeTrack = KeyframeTrack;\n\texports.LOD = LOD;\n\texports.LatheBufferGeometry = LatheGeometry;\n\texports.LatheGeometry = LatheGeometry;\n\texports.Layers = Layers;\n\texports.LensFlare = LensFlare;\n\texports.LessDepth = LessDepth;\n\texports.LessEqualDepth = LessEqualDepth;\n\texports.LessEqualStencilFunc = LessEqualStencilFunc;\n\texports.LessStencilFunc = LessStencilFunc;\n\texports.Light = Light;\n\texports.LightProbe = LightProbe;\n\texports.Line = Line;\n\texports.Line3 = Line3;\n\texports.LineBasicMaterial = LineBasicMaterial;\n\texports.LineCurve = LineCurve;\n\texports.LineCurve3 = LineCurve3;\n\texports.LineDashedMaterial = LineDashedMaterial;\n\texports.LineLoop = LineLoop;\n\texports.LinePieces = LinePieces;\n\texports.LineSegments = LineSegments;\n\texports.LineStrip = LineStrip;\n\texports.LinearEncoding = LinearEncoding;\n\texports.LinearFilter = LinearFilter;\n\texports.LinearInterpolant = LinearInterpolant;\n\texports.LinearMipMapLinearFilter = LinearMipMapLinearFilter;\n\texports.LinearMipMapNearestFilter = LinearMipMapNearestFilter;\n\texports.LinearMipmapLinearFilter = LinearMipmapLinearFilter;\n\texports.LinearMipmapNearestFilter = LinearMipmapNearestFilter;\n\texports.LinearToneMapping = LinearToneMapping;\n\texports.Loader = Loader;\n\texports.LoaderUtils = LoaderUtils;\n\texports.LoadingManager = LoadingManager;\n\texports.LogLuvEncoding = LogLuvEncoding;\n\texports.LoopOnce = LoopOnce;\n\texports.LoopPingPong = LoopPingPong;\n\texports.LoopRepeat = LoopRepeat;\n\texports.LuminanceAlphaFormat = LuminanceAlphaFormat;\n\texports.LuminanceFormat = LuminanceFormat;\n\texports.MOUSE = MOUSE;\n\texports.Material = Material;\n\texports.MaterialLoader = MaterialLoader;\n\texports.Math = MathUtils;\n\texports.MathUtils = MathUtils;\n\texports.Matrix3 = Matrix3;\n\texports.Matrix4 = Matrix4;\n\texports.MaxEquation = MaxEquation;\n\texports.Mesh = Mesh;\n\texports.MeshBasicMaterial = MeshBasicMaterial;\n\texports.MeshDepthMaterial = MeshDepthMaterial;\n\texports.MeshDistanceMaterial = MeshDistanceMaterial;\n\texports.MeshFaceMaterial = MeshFaceMaterial;\n\texports.MeshLambertMaterial = MeshLambertMaterial;\n\texports.MeshMatcapMaterial = MeshMatcapMaterial;\n\texports.MeshNormalMaterial = MeshNormalMaterial;\n\texports.MeshPhongMaterial = MeshPhongMaterial;\n\texports.MeshPhysicalMaterial = MeshPhysicalMaterial;\n\texports.MeshStandardMaterial = MeshStandardMaterial;\n\texports.MeshToonMaterial = MeshToonMaterial;\n\texports.MinEquation = MinEquation;\n\texports.MirroredRepeatWrapping = MirroredRepeatWrapping;\n\texports.MixOperation = MixOperation;\n\texports.MultiMaterial = MultiMaterial;\n\texports.MultiplyBlending = MultiplyBlending;\n\texports.MultiplyOperation = MultiplyOperation;\n\texports.NearestFilter = NearestFilter;\n\texports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;\n\texports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;\n\texports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;\n\texports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;\n\texports.NeverDepth = NeverDepth;\n\texports.NeverStencilFunc = NeverStencilFunc;\n\texports.NoBlending = NoBlending;\n\texports.NoColors = NoColors;\n\texports.NoToneMapping = NoToneMapping;\n\texports.NormalAnimationBlendMode = NormalAnimationBlendMode;\n\texports.NormalBlending = NormalBlending;\n\texports.NotEqualDepth = NotEqualDepth;\n\texports.NotEqualStencilFunc = NotEqualStencilFunc;\n\texports.NumberKeyframeTrack = NumberKeyframeTrack;\n\texports.Object3D = Object3D;\n\texports.ObjectLoader = ObjectLoader;\n\texports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;\n\texports.OctahedronBufferGeometry = OctahedronGeometry;\n\texports.OctahedronGeometry = OctahedronGeometry;\n\texports.OneFactor = OneFactor;\n\texports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;\n\texports.OneMinusDstColorFactor = OneMinusDstColorFactor;\n\texports.OneMinusSrcAlphaFactor = OneMinusSrcAlphaFactor;\n\texports.OneMinusSrcColorFactor = OneMinusSrcColorFactor;\n\texports.OrthographicCamera = OrthographicCamera;\n\texports.PCFShadowMap = PCFShadowMap;\n\texports.PCFSoftShadowMap = PCFSoftShadowMap;\n\texports.PMREMGenerator = PMREMGenerator;\n\texports.ParametricGeometry = ParametricGeometry;\n\texports.Particle = Particle;\n\texports.ParticleBasicMaterial = ParticleBasicMaterial;\n\texports.ParticleSystem = ParticleSystem;\n\texports.ParticleSystemMaterial = ParticleSystemMaterial;\n\texports.Path = Path;\n\texports.PerspectiveCamera = PerspectiveCamera;\n\texports.Plane = Plane;\n\texports.PlaneBufferGeometry = PlaneGeometry;\n\texports.PlaneGeometry = PlaneGeometry;\n\texports.PlaneHelper = PlaneHelper;\n\texports.PointCloud = PointCloud;\n\texports.PointCloudMaterial = PointCloudMaterial;\n\texports.PointLight = PointLight;\n\texports.PointLightHelper = PointLightHelper;\n\texports.Points = Points;\n\texports.PointsMaterial = PointsMaterial;\n\texports.PolarGridHelper = PolarGridHelper;\n\texports.PolyhedronBufferGeometry = PolyhedronGeometry;\n\texports.PolyhedronGeometry = PolyhedronGeometry;\n\texports.PositionalAudio = PositionalAudio;\n\texports.PropertyBinding = PropertyBinding;\n\texports.PropertyMixer = PropertyMixer;\n\texports.QuadraticBezierCurve = QuadraticBezierCurve;\n\texports.QuadraticBezierCurve3 = QuadraticBezierCurve3;\n\texports.Quaternion = Quaternion;\n\texports.QuaternionKeyframeTrack = QuaternionKeyframeTrack;\n\texports.QuaternionLinearInterpolant = QuaternionLinearInterpolant;\n\texports.REVISION = REVISION;\n\texports.RGBADepthPacking = RGBADepthPacking;\n\texports.RGBAFormat = RGBAFormat;\n\texports.RGBAIntegerFormat = RGBAIntegerFormat;\n\texports.RGBA_ASTC_10x10_Format = RGBA_ASTC_10x10_Format;\n\texports.RGBA_ASTC_10x5_Format = RGBA_ASTC_10x5_Format;\n\texports.RGBA_ASTC_10x6_Format = RGBA_ASTC_10x6_Format;\n\texports.RGBA_ASTC_10x8_Format = RGBA_ASTC_10x8_Format;\n\texports.RGBA_ASTC_12x10_Format = RGBA_ASTC_12x10_Format;\n\texports.RGBA_ASTC_12x12_Format = RGBA_ASTC_12x12_Format;\n\texports.RGBA_ASTC_4x4_Format = RGBA_ASTC_4x4_Format;\n\texports.RGBA_ASTC_5x4_Format = RGBA_ASTC_5x4_Format;\n\texports.RGBA_ASTC_5x5_Format = RGBA_ASTC_5x5_Format;\n\texports.RGBA_ASTC_6x5_Format = RGBA_ASTC_6x5_Format;\n\texports.RGBA_ASTC_6x6_Format = RGBA_ASTC_6x6_Format;\n\texports.RGBA_ASTC_8x5_Format = RGBA_ASTC_8x5_Format;\n\texports.RGBA_ASTC_8x6_Format = RGBA_ASTC_8x6_Format;\n\texports.RGBA_ASTC_8x8_Format = RGBA_ASTC_8x8_Format;\n\texports.RGBA_BPTC_Format = RGBA_BPTC_Format;\n\texports.RGBA_ETC2_EAC_Format = RGBA_ETC2_EAC_Format;\n\texports.RGBA_PVRTC_2BPPV1_Format = RGBA_PVRTC_2BPPV1_Format;\n\texports.RGBA_PVRTC_4BPPV1_Format = RGBA_PVRTC_4BPPV1_Format;\n\texports.RGBA_S3TC_DXT1_Format = RGBA_S3TC_DXT1_Format;\n\texports.RGBA_S3TC_DXT3_Format = RGBA_S3TC_DXT3_Format;\n\texports.RGBA_S3TC_DXT5_Format = RGBA_S3TC_DXT5_Format;\n\texports.RGBDEncoding = RGBDEncoding;\n\texports.RGBEEncoding = RGBEEncoding;\n\texports.RGBEFormat = RGBEFormat;\n\texports.RGBFormat = RGBFormat;\n\texports.RGBIntegerFormat = RGBIntegerFormat;\n\texports.RGBM16Encoding = RGBM16Encoding;\n\texports.RGBM7Encoding = RGBM7Encoding;\n\texports.RGB_ETC1_Format = RGB_ETC1_Format;\n\texports.RGB_ETC2_Format = RGB_ETC2_Format;\n\texports.RGB_PVRTC_2BPPV1_Format = RGB_PVRTC_2BPPV1_Format;\n\texports.RGB_PVRTC_4BPPV1_Format = RGB_PVRTC_4BPPV1_Format;\n\texports.RGB_S3TC_DXT1_Format = RGB_S3TC_DXT1_Format;\n\texports.RGFormat = RGFormat;\n\texports.RGIntegerFormat = RGIntegerFormat;\n\texports.RawShaderMaterial = RawShaderMaterial;\n\texports.Ray = Ray;\n\texports.Raycaster = Raycaster;\n\texports.RectAreaLight = RectAreaLight;\n\texports.RedFormat = RedFormat;\n\texports.RedIntegerFormat = RedIntegerFormat;\n\texports.ReinhardToneMapping = ReinhardToneMapping;\n\texports.RepeatWrapping = RepeatWrapping;\n\texports.ReplaceStencilOp = ReplaceStencilOp;\n\texports.ReverseSubtractEquation = ReverseSubtractEquation;\n\texports.RingBufferGeometry = RingGeometry;\n\texports.RingGeometry = RingGeometry;\n\texports.SRGB8_ALPHA8_ASTC_10x10_Format = SRGB8_ALPHA8_ASTC_10x10_Format;\n\texports.SRGB8_ALPHA8_ASTC_10x5_Format = SRGB8_ALPHA8_ASTC_10x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_10x6_Format = SRGB8_ALPHA8_ASTC_10x6_Format;\n\texports.SRGB8_ALPHA8_ASTC_10x8_Format = SRGB8_ALPHA8_ASTC_10x8_Format;\n\texports.SRGB8_ALPHA8_ASTC_12x10_Format = SRGB8_ALPHA8_ASTC_12x10_Format;\n\texports.SRGB8_ALPHA8_ASTC_12x12_Format = SRGB8_ALPHA8_ASTC_12x12_Format;\n\texports.SRGB8_ALPHA8_ASTC_4x4_Format = SRGB8_ALPHA8_ASTC_4x4_Format;\n\texports.SRGB8_ALPHA8_ASTC_5x4_Format = SRGB8_ALPHA8_ASTC_5x4_Format;\n\texports.SRGB8_ALPHA8_ASTC_5x5_Format = SRGB8_ALPHA8_ASTC_5x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_6x5_Format = SRGB8_ALPHA8_ASTC_6x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_6x6_Format = SRGB8_ALPHA8_ASTC_6x6_Format;\n\texports.SRGB8_ALPHA8_ASTC_8x5_Format = SRGB8_ALPHA8_ASTC_8x5_Format;\n\texports.SRGB8_ALPHA8_ASTC_8x6_Format = SRGB8_ALPHA8_ASTC_8x6_Format;\n\texports.SRGB8_ALPHA8_ASTC_8x8_Format = SRGB8_ALPHA8_ASTC_8x8_Format;\n\texports.Scene = Scene;\n\texports.SceneUtils = SceneUtils;\n\texports.ShaderChunk = ShaderChunk;\n\texports.ShaderLib = ShaderLib;\n\texports.ShaderMaterial = ShaderMaterial;\n\texports.ShadowMaterial = ShadowMaterial;\n\texports.Shape = Shape;\n\texports.ShapeBufferGeometry = ShapeGeometry;\n\texports.ShapeGeometry = ShapeGeometry;\n\texports.ShapePath = ShapePath;\n\texports.ShapeUtils = ShapeUtils;\n\texports.ShortType = ShortType;\n\texports.Skeleton = Skeleton;\n\texports.SkeletonHelper = SkeletonHelper;\n\texports.SkinnedMesh = SkinnedMesh;\n\texports.SmoothShading = SmoothShading;\n\texports.Sphere = Sphere;\n\texports.SphereBufferGeometry = SphereGeometry;\n\texports.SphereGeometry = SphereGeometry;\n\texports.Spherical = Spherical;\n\texports.SphericalHarmonics3 = SphericalHarmonics3;\n\texports.SplineCurve = SplineCurve;\n\texports.SpotLight = SpotLight;\n\texports.SpotLightHelper = SpotLightHelper;\n\texports.Sprite = Sprite;\n\texports.SpriteMaterial = SpriteMaterial;\n\texports.SrcAlphaFactor = SrcAlphaFactor;\n\texports.SrcAlphaSaturateFactor = SrcAlphaSaturateFactor;\n\texports.SrcColorFactor = SrcColorFactor;\n\texports.StaticCopyUsage = StaticCopyUsage;\n\texports.StaticDrawUsage = StaticDrawUsage;\n\texports.StaticReadUsage = StaticReadUsage;\n\texports.StereoCamera = StereoCamera;\n\texports.StreamCopyUsage = StreamCopyUsage;\n\texports.StreamDrawUsage = StreamDrawUsage;\n\texports.StreamReadUsage = StreamReadUsage;\n\texports.StringKeyframeTrack = StringKeyframeTrack;\n\texports.SubtractEquation = SubtractEquation;\n\texports.SubtractiveBlending = SubtractiveBlending;\n\texports.TOUCH = TOUCH;\n\texports.TangentSpaceNormalMap = TangentSpaceNormalMap;\n\texports.TetrahedronBufferGeometry = TetrahedronGeometry;\n\texports.TetrahedronGeometry = TetrahedronGeometry;\n\texports.TextGeometry = TextGeometry;\n\texports.Texture = Texture;\n\texports.TextureLoader = TextureLoader;\n\texports.TorusBufferGeometry = TorusGeometry;\n\texports.TorusGeometry = TorusGeometry;\n\texports.TorusKnotBufferGeometry = TorusKnotGeometry;\n\texports.TorusKnotGeometry = TorusKnotGeometry;\n\texports.Triangle = Triangle;\n\texports.TriangleFanDrawMode = TriangleFanDrawMode;\n\texports.TriangleStripDrawMode = TriangleStripDrawMode;\n\texports.TrianglesDrawMode = TrianglesDrawMode;\n\texports.TubeBufferGeometry = TubeGeometry;\n\texports.TubeGeometry = TubeGeometry;\n\texports.UVMapping = UVMapping;\n\texports.Uint16Attribute = Uint16Attribute;\n\texports.Uint16BufferAttribute = Uint16BufferAttribute;\n\texports.Uint32Attribute = Uint32Attribute;\n\texports.Uint32BufferAttribute = Uint32BufferAttribute;\n\texports.Uint8Attribute = Uint8Attribute;\n\texports.Uint8BufferAttribute = Uint8BufferAttribute;\n\texports.Uint8ClampedAttribute = Uint8ClampedAttribute;\n\texports.Uint8ClampedBufferAttribute = Uint8ClampedBufferAttribute;\n\texports.Uniform = Uniform;\n\texports.UniformsLib = UniformsLib;\n\texports.UniformsUtils = UniformsUtils;\n\texports.UnsignedByteType = UnsignedByteType;\n\texports.UnsignedInt248Type = UnsignedInt248Type;\n\texports.UnsignedIntType = UnsignedIntType;\n\texports.UnsignedShort4444Type = UnsignedShort4444Type;\n\texports.UnsignedShort5551Type = UnsignedShort5551Type;\n\texports.UnsignedShort565Type = UnsignedShort565Type;\n\texports.UnsignedShortType = UnsignedShortType;\n\texports.VSMShadowMap = VSMShadowMap;\n\texports.Vector2 = Vector2;\n\texports.Vector3 = Vector3;\n\texports.Vector4 = Vector4;\n\texports.VectorKeyframeTrack = VectorKeyframeTrack;\n\texports.Vertex = Vertex;\n\texports.VertexColors = VertexColors;\n\texports.VideoTexture = VideoTexture;\n\texports.WebGL1Renderer = WebGL1Renderer;\n\texports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;\n\texports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;\n\texports.WebGLMultisampleRenderTarget = WebGLMultisampleRenderTarget;\n\texports.WebGLRenderTarget = WebGLRenderTarget;\n\texports.WebGLRenderTargetCube = WebGLRenderTargetCube;\n\texports.WebGLRenderer = WebGLRenderer;\n\texports.WebGLUtils = WebGLUtils;\n\texports.WireframeGeometry = WireframeGeometry;\n\texports.WireframeHelper = WireframeHelper;\n\texports.WrapAroundEnding = WrapAroundEnding;\n\texports.XHRLoader = XHRLoader;\n\texports.ZeroCurvatureEnding = ZeroCurvatureEnding;\n\texports.ZeroFactor = ZeroFactor;\n\texports.ZeroSlopeEnding = ZeroSlopeEnding;\n\texports.ZeroStencilOp = ZeroStencilOp;\n\texports.sRGBEncoding = sRGBEncoding;\n\n\tObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n",
  294. "( function () {\n\n\tclass LightProbeGenerator {\n\n\t\t// https://www.ppsloan.org/publications/StupidSH36.pdf\n\t\tstatic fromCubeTexture( cubeTexture ) {\n\n\t\t\tlet totalWeight = 0;\n\t\t\tconst coord = new THREE.Vector3();\n\t\t\tconst dir = new THREE.Vector3();\n\t\t\tconst color = new THREE.Color();\n\t\t\tconst shBasis = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n\t\t\tconst sh = new THREE.SphericalHarmonics3();\n\t\t\tconst shCoefficients = sh.coefficients;\n\n\t\t\tfor ( let faceIndex = 0; faceIndex < 6; faceIndex ++ ) {\n\n\t\t\t\tconst image = cubeTexture.image[ faceIndex ];\n\t\t\t\tconst width = image.width;\n\t\t\t\tconst height = image.height;\n\t\t\t\tconst canvas = document.createElement( 'canvas' );\n\t\t\t\tcanvas.width = width;\n\t\t\t\tcanvas.height = height;\n\t\t\t\tconst context = canvas.getContext( '2d' );\n\t\t\t\tcontext.drawImage( image, 0, 0, width, height );\n\t\t\t\tconst imageData = context.getImageData( 0, 0, width, height );\n\t\t\t\tconst data = imageData.data;\n\t\t\t\tconst imageWidth = imageData.width; // assumed to be square\n\n\t\t\t\tconst pixelSize = 2 / imageWidth;\n\n\t\t\t\tfor ( let i = 0, il = data.length; i < il; i += 4 ) {\n\n\t\t\t\t\t// RGBA assumed\n\t\t\t\t\t// pixel color\n\t\t\t\t\tcolor.setRGB( data[ i ] / 255, data[ i + 1 ] / 255, data[ i + 2 ] / 255 ); // convert to linear color space\n\n\t\t\t\t\tconvertColorToLinear( color, cubeTexture.encoding ); // pixel coordinate on unit cube\n\n\t\t\t\t\tconst pixelIndex = i / 4;\n\t\t\t\t\tconst col = - 1 + ( pixelIndex % imageWidth + 0.5 ) * pixelSize;\n\t\t\t\t\tconst row = 1 - ( Math.floor( pixelIndex / imageWidth ) + 0.5 ) * pixelSize;\n\n\t\t\t\t\tswitch ( faceIndex ) {\n\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tcoord.set( - 1, row, - col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tcoord.set( 1, row, col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tcoord.set( - col, 1, - row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tcoord.set( - col, - 1, row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tcoord.set( - col, row, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tcoord.set( col, row, - 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} // weight assigned to this pixel\n\n\n\t\t\t\t\tconst lengthSq = coord.lengthSq();\n\t\t\t\t\tconst weight = 4 / ( Math.sqrt( lengthSq ) * lengthSq );\n\t\t\t\t\ttotalWeight += weight; // direction vector to this pixel\n\n\t\t\t\t\tdir.copy( coord ).normalize(); // evaluate SH basis functions in direction dir\n\n\t\t\t\t\tTHREE.SphericalHarmonics3.getBasisAt( dir, shBasis ); // accummuulate\n\n\t\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\t\tshCoefficients[ j ].x += shBasis[ j ] * color.r * weight;\n\t\t\t\t\t\tshCoefficients[ j ].y += shBasis[ j ] * color.g * weight;\n\t\t\t\t\t\tshCoefficients[ j ].z += shBasis[ j ] * color.b * weight;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // normalize\n\n\n\t\t\tconst norm = 4 * Math.PI / totalWeight;\n\n\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\tshCoefficients[ j ].x *= norm;\n\t\t\t\tshCoefficients[ j ].y *= norm;\n\t\t\t\tshCoefficients[ j ].z *= norm;\n\n\t\t\t}\n\n\t\t\treturn new THREE.LightProbe( sh );\n\n\t\t}\n\n\t\tstatic fromCubeRenderTarget( renderer, cubeRenderTarget ) {\n\n\t\t\t// The renderTarget must be set to RGBA in order to make readRenderTargetPixels works\n\t\t\tlet totalWeight = 0;\n\t\t\tconst coord = new THREE.Vector3();\n\t\t\tconst dir = new THREE.Vector3();\n\t\t\tconst color = new THREE.Color();\n\t\t\tconst shBasis = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ];\n\t\t\tconst sh = new THREE.SphericalHarmonics3();\n\t\t\tconst shCoefficients = sh.coefficients;\n\n\t\t\tfor ( let faceIndex = 0; faceIndex < 6; faceIndex ++ ) {\n\n\t\t\t\tconst imageWidth = cubeRenderTarget.width; // assumed to be square\n\n\t\t\t\tconst data = new Uint8Array( imageWidth * imageWidth * 4 );\n\t\t\t\trenderer.readRenderTargetPixels( cubeRenderTarget, 0, 0, imageWidth, imageWidth, data, faceIndex );\n\t\t\t\tconst pixelSize = 2 / imageWidth;\n\n\t\t\t\tfor ( let i = 0, il = data.length; i < il; i += 4 ) {\n\n\t\t\t\t\t// RGBA assumed\n\t\t\t\t\t// pixel color\n\t\t\t\t\tcolor.setRGB( data[ i ] / 255, data[ i + 1 ] / 255, data[ i + 2 ] / 255 ); // convert to linear color space\n\n\t\t\t\t\tconvertColorToLinear( color, cubeRenderTarget.texture.encoding ); // pixel coordinate on unit cube\n\n\t\t\t\t\tconst pixelIndex = i / 4;\n\t\t\t\t\tconst col = - 1 + ( pixelIndex % imageWidth + 0.5 ) * pixelSize;\n\t\t\t\t\tconst row = 1 - ( Math.floor( pixelIndex / imageWidth ) + 0.5 ) * pixelSize;\n\n\t\t\t\t\tswitch ( faceIndex ) {\n\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tcoord.set( 1, row, - col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tcoord.set( - 1, row, col );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tcoord.set( col, 1, - row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tcoord.set( col, - 1, row );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tcoord.set( col, row, 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tcoord.set( - col, row, - 1 );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t} // weight assigned to this pixel\n\n\n\t\t\t\t\tconst lengthSq = coord.lengthSq();\n\t\t\t\t\tconst weight = 4 / ( Math.sqrt( lengthSq ) * lengthSq );\n\t\t\t\t\ttotalWeight += weight; // direction vector to this pixel\n\n\t\t\t\t\tdir.copy( coord ).normalize(); // evaluate SH basis functions in direction dir\n\n\t\t\t\t\tTHREE.SphericalHarmonics3.getBasisAt( dir, shBasis ); // accummuulate\n\n\t\t\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\t\t\tshCoefficients[ j ].x += shBasis[ j ] * color.r * weight;\n\t\t\t\t\t\tshCoefficients[ j ].y += shBasis[ j ] * color.g * weight;\n\t\t\t\t\t\tshCoefficients[ j ].z += shBasis[ j ] * color.b * weight;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // normalize\n\n\n\t\t\tconst norm = 4 * Math.PI / totalWeight;\n\n\t\t\tfor ( let j = 0; j < 9; j ++ ) {\n\n\t\t\t\tshCoefficients[ j ].x *= norm;\n\t\t\t\tshCoefficients[ j ].y *= norm;\n\t\t\t\tshCoefficients[ j ].z *= norm;\n\n\t\t\t}\n\n\t\t\treturn new THREE.LightProbe( sh );\n\n\t\t}\n\n\t}\n\n\tfunction convertColorToLinear( color, encoding ) {\n\n\t\tswitch ( encoding ) {\n\n\t\t\tcase THREE.sRGBEncoding:\n\t\t\t\tcolor.convertSRGBToLinear();\n\t\t\t\tbreak;\n\n\t\t\tcase THREE.LinearEncoding:\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tconsole.warn( 'WARNING: LightProbeGenerator convertColorToLinear() encountered an unsupported encoding.' );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn color;\n\n\t}\n\n\tTHREE.LightProbeGenerator = LightProbeGenerator;\n\n} )();\n",
  295. "( function () {\n\n\tconst _taskCache = new WeakMap();\n\n\tclass DRACOLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\t\t\tthis.decoderPath = '';\n\t\t\tthis.decoderConfig = {};\n\t\t\tthis.decoderBinary = null;\n\t\t\tthis.decoderPending = null;\n\t\t\tthis.workerLimit = 4;\n\t\t\tthis.workerPool = [];\n\t\t\tthis.workerNextTaskID = 1;\n\t\t\tthis.workerSourceURL = '';\n\t\t\tthis.defaultAttributeIDs = {\n\t\t\t\tposition: 'POSITION',\n\t\t\t\tnormal: 'NORMAL',\n\t\t\t\tcolor: 'COLOR',\n\t\t\t\tuv: 'TEX_COORD'\n\t\t\t};\n\t\t\tthis.defaultAttributeTypes = {\n\t\t\t\tposition: 'Float32Array',\n\t\t\t\tnormal: 'Float32Array',\n\t\t\t\tcolor: 'Float32Array',\n\t\t\t\tuv: 'Float32Array'\n\t\t\t};\n\n\t\t}\n\n\t\tsetDecoderPath( path ) {\n\n\t\t\tthis.decoderPath = path;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetDecoderConfig( config ) {\n\n\t\t\tthis.decoderConfig = config;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetWorkerLimit( workerLimit ) {\n\n\t\t\tthis.workerLimit = workerLimit;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, buffer => {\n\n\t\t\t\tconst taskConfig = {\n\t\t\t\t\tattributeIDs: this.defaultAttributeIDs,\n\t\t\t\t\tattributeTypes: this.defaultAttributeTypes,\n\t\t\t\t\tuseUniqueIDs: false\n\t\t\t\t};\n\t\t\t\tthis.decodeGeometry( buffer, taskConfig ).then( onLoad ).catch( onError );\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\t\t/** @deprecated Kept for backward-compatibility with previous DRACOLoader versions. */\n\n\n\t\tdecodeDracoFile( buffer, callback, attributeIDs, attributeTypes ) {\n\n\t\t\tconst taskConfig = {\n\t\t\t\tattributeIDs: attributeIDs || this.defaultAttributeIDs,\n\t\t\t\tattributeTypes: attributeTypes || this.defaultAttributeTypes,\n\t\t\t\tuseUniqueIDs: !! attributeIDs\n\t\t\t};\n\t\t\tthis.decodeGeometry( buffer, taskConfig ).then( callback );\n\n\t\t}\n\n\t\tdecodeGeometry( buffer, taskConfig ) {\n\n\t\t\t// TODO: For backward-compatibility, support 'attributeTypes' objects containing\n\t\t\t// references (rather than names) to typed array constructors. These must be\n\t\t\t// serialized before sending them to the worker.\n\t\t\tfor ( const attribute in taskConfig.attributeTypes ) {\n\n\t\t\t\tconst type = taskConfig.attributeTypes[ attribute ];\n\n\t\t\t\tif ( type.BYTES_PER_ELEMENT !== undefined ) {\n\n\t\t\t\t\ttaskConfig.attributeTypes[ attribute ] = type.name;\n\n\t\t\t\t}\n\n\t\t\t} //\n\n\n\t\t\tconst taskKey = JSON.stringify( taskConfig ); // Check for an existing task using this buffer. A transferred buffer cannot be transferred\n\t\t\t// again from this thread.\n\n\t\t\tif ( _taskCache.has( buffer ) ) {\n\n\t\t\t\tconst cachedTask = _taskCache.get( buffer );\n\n\t\t\t\tif ( cachedTask.key === taskKey ) {\n\n\t\t\t\t\treturn cachedTask.promise;\n\n\t\t\t\t} else if ( buffer.byteLength === 0 ) {\n\n\t\t\t\t\t// Technically, it would be possible to wait for the previous task to complete,\n\t\t\t\t\t// transfer the buffer back, and decode again with the second configuration. That\n\t\t\t\t\t// is complex, and I don't know of any reason to decode a Draco buffer twice in\n\t\t\t\t\t// different ways, so this is left unimplemented.\n\t\t\t\t\tthrow new Error( 'THREE.DRACOLoader: Unable to re-decode a buffer with different ' + 'settings. Buffer has already been transferred.' );\n\n\t\t\t\t}\n\n\t\t\t} //\n\n\n\t\t\tlet worker;\n\t\t\tconst taskID = this.workerNextTaskID ++;\n\t\t\tconst taskCost = buffer.byteLength; // Obtain a worker and assign a task, and construct a geometry instance\n\t\t\t// when the task completes.\n\n\t\t\tconst geometryPending = this._getWorker( taskID, taskCost ).then( _worker => {\n\n\t\t\t\tworker = _worker;\n\t\t\t\treturn new Promise( ( resolve, reject ) => {\n\n\t\t\t\t\tworker._callbacks[ taskID ] = {\n\t\t\t\t\t\tresolve,\n\t\t\t\t\t\treject\n\t\t\t\t\t};\n\t\t\t\t\tworker.postMessage( {\n\t\t\t\t\t\ttype: 'decode',\n\t\t\t\t\t\tid: taskID,\n\t\t\t\t\t\ttaskConfig,\n\t\t\t\t\t\tbuffer\n\t\t\t\t\t}, [ buffer ] ); // this.debug();\n\n\t\t\t\t} );\n\n\t\t\t} ).then( message => this._createGeometry( message.geometry ) ); // Remove task from the task list.\n\t\t\t// Note: replaced '.finally()' with '.catch().then()' block - iOS 11 support (#19416)\n\n\n\t\t\tgeometryPending.catch( () => true ).then( () => {\n\n\t\t\t\tif ( worker && taskID ) {\n\n\t\t\t\t\tthis._releaseTask( worker, taskID ); // this.debug();\n\n\t\t\t\t}\n\n\t\t\t} ); // Cache the task result.\n\n\t\t\t_taskCache.set( buffer, {\n\t\t\t\tkey: taskKey,\n\t\t\t\tpromise: geometryPending\n\t\t\t} );\n\n\t\t\treturn geometryPending;\n\n\t\t}\n\n\t\t_createGeometry( geometryData ) {\n\n\t\t\tconst geometry = new THREE.BufferGeometry();\n\n\t\t\tif ( geometryData.index ) {\n\n\t\t\t\tgeometry.setIndex( new THREE.BufferAttribute( geometryData.index.array, 1 ) );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < geometryData.attributes.length; i ++ ) {\n\n\t\t\t\tconst attribute = geometryData.attributes[ i ];\n\t\t\t\tconst name = attribute.name;\n\t\t\t\tconst array = attribute.array;\n\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\tgeometry.setAttribute( name, new THREE.BufferAttribute( array, itemSize ) );\n\n\t\t\t}\n\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\t_loadLibrary( url, responseType ) {\n\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.decoderPath );\n\t\t\tloader.setResponseType( responseType );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\treturn new Promise( ( resolve, reject ) => {\n\n\t\t\t\tloader.load( url, resolve, undefined, reject );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tpreload() {\n\n\t\t\tthis._initDecoder();\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\t_initDecoder() {\n\n\t\t\tif ( this.decoderPending ) return this.decoderPending;\n\t\t\tconst useJS = typeof WebAssembly !== 'object' || this.decoderConfig.type === 'js';\n\t\t\tconst librariesPending = [];\n\n\t\t\tif ( useJS ) {\n\n\t\t\t\tlibrariesPending.push( this._loadLibrary( 'draco_decoder.js', 'text' ) );\n\n\t\t\t} else {\n\n\t\t\t\tlibrariesPending.push( this._loadLibrary( 'draco_wasm_wrapper.js', 'text' ) );\n\t\t\t\tlibrariesPending.push( this._loadLibrary( 'draco_decoder.wasm', 'arraybuffer' ) );\n\n\t\t\t}\n\n\t\t\tthis.decoderPending = Promise.all( librariesPending ).then( libraries => {\n\n\t\t\t\tconst jsContent = libraries[ 0 ];\n\n\t\t\t\tif ( ! useJS ) {\n\n\t\t\t\t\tthis.decoderConfig.wasmBinary = libraries[ 1 ];\n\n\t\t\t\t}\n\n\t\t\t\tconst fn = DRACOWorker.toString();\n\t\t\t\tconst body = [ '/* draco decoder */', jsContent, '', '/* worker */', fn.substring( fn.indexOf( '{' ) + 1, fn.lastIndexOf( '}' ) ) ].join( '\\n' );\n\t\t\t\tthis.workerSourceURL = URL.createObjectURL( new Blob( [ body ] ) );\n\n\t\t\t} );\n\t\t\treturn this.decoderPending;\n\n\t\t}\n\n\t\t_getWorker( taskID, taskCost ) {\n\n\t\t\treturn this._initDecoder().then( () => {\n\n\t\t\t\tif ( this.workerPool.length < this.workerLimit ) {\n\n\t\t\t\t\tconst worker = new Worker( this.workerSourceURL );\n\t\t\t\t\tworker._callbacks = {};\n\t\t\t\t\tworker._taskCosts = {};\n\t\t\t\t\tworker._taskLoad = 0;\n\t\t\t\t\tworker.postMessage( {\n\t\t\t\t\t\ttype: 'init',\n\t\t\t\t\t\tdecoderConfig: this.decoderConfig\n\t\t\t\t\t} );\n\n\t\t\t\t\tworker.onmessage = function ( e ) {\n\n\t\t\t\t\t\tconst message = e.data;\n\n\t\t\t\t\t\tswitch ( message.type ) {\n\n\t\t\t\t\t\t\tcase 'decode':\n\t\t\t\t\t\t\t\tworker._callbacks[ message.id ].resolve( message );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tcase 'error':\n\t\t\t\t\t\t\t\tworker._callbacks[ message.id ].reject( message );\n\n\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\tconsole.error( 'THREE.DRACOLoader: Unexpected message, \"' + message.type + '\"' );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.workerPool.push( worker );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.workerPool.sort( function ( a, b ) {\n\n\t\t\t\t\t\treturn a._taskLoad > b._taskLoad ? - 1 : 1;\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tconst worker = this.workerPool[ this.workerPool.length - 1 ];\n\t\t\t\tworker._taskCosts[ taskID ] = taskCost;\n\t\t\t\tworker._taskLoad += taskCost;\n\t\t\t\treturn worker;\n\n\t\t\t} );\n\n\t\t}\n\n\t\t_releaseTask( worker, taskID ) {\n\n\t\t\tworker._taskLoad -= worker._taskCosts[ taskID ];\n\t\t\tdelete worker._callbacks[ taskID ];\n\t\t\tdelete worker._taskCosts[ taskID ];\n\n\t\t}\n\n\t\tdebug() {\n\n\t\t\tconsole.log( 'Task load: ', this.workerPool.map( worker => worker._taskLoad ) );\n\n\t\t}\n\n\t\tdispose() {\n\n\t\t\tfor ( let i = 0; i < this.workerPool.length; ++ i ) {\n\n\t\t\t\tthis.workerPool[ i ].terminate();\n\n\t\t\t}\n\n\t\t\tthis.workerPool.length = 0;\n\t\t\treturn this;\n\n\t\t}\n\n\t}\n\t/* WEB WORKER */\n\n\n\tfunction DRACOWorker() {\n\n\t\tlet decoderConfig;\n\t\tlet decoderPending;\n\n\t\tonmessage = function ( e ) {\n\n\t\t\tconst message = e.data;\n\n\t\t\tswitch ( message.type ) {\n\n\t\t\t\tcase 'init':\n\t\t\t\t\tdecoderConfig = message.decoderConfig;\n\t\t\t\t\tdecoderPending = new Promise( function ( resolve\n\t\t\t\t\t\t/*, reject*/\n\t\t\t\t\t) {\n\n\t\t\t\t\t\tdecoderConfig.onModuleLoaded = function ( draco ) {\n\n\t\t\t\t\t\t\t// Module is Promise-like. Wrap before resolving to avoid loop.\n\t\t\t\t\t\t\tresolve( {\n\t\t\t\t\t\t\t\tdraco: draco\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tDracoDecoderModule( decoderConfig ); // eslint-disable-line no-undef\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'decode':\n\t\t\t\t\tconst buffer = message.buffer;\n\t\t\t\t\tconst taskConfig = message.taskConfig;\n\t\t\t\t\tdecoderPending.then( module => {\n\n\t\t\t\t\t\tconst draco = module.draco;\n\t\t\t\t\t\tconst decoder = new draco.Decoder();\n\t\t\t\t\t\tconst decoderBuffer = new draco.DecoderBuffer();\n\t\t\t\t\t\tdecoderBuffer.Init( new Int8Array( buffer ), buffer.byteLength );\n\n\t\t\t\t\t\ttry {\n\n\t\t\t\t\t\t\tconst geometry = decodeGeometry( draco, decoder, decoderBuffer, taskConfig );\n\t\t\t\t\t\t\tconst buffers = geometry.attributes.map( attr => attr.array.buffer );\n\t\t\t\t\t\t\tif ( geometry.index ) buffers.push( geometry.index.array.buffer );\n\t\t\t\t\t\t\tself.postMessage( {\n\t\t\t\t\t\t\t\ttype: 'decode',\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\tgeometry\n\t\t\t\t\t\t\t}, buffers );\n\n\t\t\t\t\t\t} catch ( error ) {\n\n\t\t\t\t\t\t\tconsole.error( error );\n\t\t\t\t\t\t\tself.postMessage( {\n\t\t\t\t\t\t\t\ttype: 'error',\n\t\t\t\t\t\t\t\tid: message.id,\n\t\t\t\t\t\t\t\terror: error.message\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t} finally {\n\n\t\t\t\t\t\t\tdraco.destroy( decoderBuffer );\n\t\t\t\t\t\t\tdraco.destroy( decoder );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t};\n\n\t\tfunction decodeGeometry( draco, decoder, decoderBuffer, taskConfig ) {\n\n\t\t\tconst attributeIDs = taskConfig.attributeIDs;\n\t\t\tconst attributeTypes = taskConfig.attributeTypes;\n\t\t\tlet dracoGeometry;\n\t\t\tlet decodingStatus;\n\t\t\tconst geometryType = decoder.GetEncodedGeometryType( decoderBuffer );\n\n\t\t\tif ( geometryType === draco.TRIANGULAR_MESH ) {\n\n\t\t\t\tdracoGeometry = new draco.Mesh();\n\t\t\t\tdecodingStatus = decoder.DecodeBufferToMesh( decoderBuffer, dracoGeometry );\n\n\t\t\t} else if ( geometryType === draco.POINT_CLOUD ) {\n\n\t\t\t\tdracoGeometry = new draco.PointCloud();\n\t\t\t\tdecodingStatus = decoder.DecodeBufferToPointCloud( decoderBuffer, dracoGeometry );\n\n\t\t\t} else {\n\n\t\t\t\tthrow new Error( 'THREE.DRACOLoader: Unexpected geometry type.' );\n\n\t\t\t}\n\n\t\t\tif ( ! decodingStatus.ok() || dracoGeometry.ptr === 0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.DRACOLoader: Decoding failed: ' + decodingStatus.error_msg() );\n\n\t\t\t}\n\n\t\t\tconst geometry = {\n\t\t\t\tindex: null,\n\t\t\t\tattributes: []\n\t\t\t}; // Gather all vertex attributes.\n\n\t\t\tfor ( const attributeName in attributeIDs ) {\n\n\t\t\t\tconst attributeType = self[ attributeTypes[ attributeName ] ];\n\t\t\t\tlet attribute;\n\t\t\t\tlet attributeID; // A Draco file may be created with default vertex attributes, whose attribute IDs\n\t\t\t\t// are mapped 1:1 from their semantic name (POSITION, NORMAL, ...). Alternatively,\n\t\t\t\t// a Draco file may contain a custom set of attributes, identified by known unique\n\t\t\t\t// IDs. glTF files always do the latter, and `.drc` files typically do the former.\n\n\t\t\t\tif ( taskConfig.useUniqueIDs ) {\n\n\t\t\t\t\tattributeID = attributeIDs[ attributeName ];\n\t\t\t\t\tattribute = decoder.GetAttributeByUniqueId( dracoGeometry, attributeID );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tattributeID = decoder.GetAttributeId( dracoGeometry, draco[ attributeIDs[ attributeName ] ] );\n\t\t\t\t\tif ( attributeID === - 1 ) continue;\n\t\t\t\t\tattribute = decoder.GetAttribute( dracoGeometry, attributeID );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.attributes.push( decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) );\n\n\t\t\t} // Add index.\n\n\n\t\t\tif ( geometryType === draco.TRIANGULAR_MESH ) {\n\n\t\t\t\tgeometry.index = decodeIndex( draco, decoder, dracoGeometry );\n\n\t\t\t}\n\n\t\t\tdraco.destroy( dracoGeometry );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tfunction decodeIndex( draco, decoder, dracoGeometry ) {\n\n\t\t\tconst numFaces = dracoGeometry.num_faces();\n\t\t\tconst numIndices = numFaces * 3;\n\t\t\tconst byteLength = numIndices * 4;\n\n\t\t\tconst ptr = draco._malloc( byteLength );\n\n\t\t\tdecoder.GetTrianglesUInt32Array( dracoGeometry, byteLength, ptr );\n\t\t\tconst index = new Uint32Array( draco.HEAPF32.buffer, ptr, numIndices ).slice();\n\n\t\t\tdraco._free( ptr );\n\n\t\t\treturn {\n\t\t\t\tarray: index,\n\t\t\t\titemSize: 1\n\t\t\t};\n\n\t\t}\n\n\t\tfunction decodeAttribute( draco, decoder, dracoGeometry, attributeName, attributeType, attribute ) {\n\n\t\t\tconst numComponents = attribute.num_components();\n\t\t\tconst numPoints = dracoGeometry.num_points();\n\t\t\tconst numValues = numPoints * numComponents;\n\t\t\tconst byteLength = numValues * attributeType.BYTES_PER_ELEMENT;\n\t\t\tconst dataType = getDracoDataType( draco, attributeType );\n\n\t\t\tconst ptr = draco._malloc( byteLength );\n\n\t\t\tdecoder.GetAttributeDataArrayForAllPoints( dracoGeometry, attribute, dataType, byteLength, ptr );\n\t\t\tconst array = new attributeType( draco.HEAPF32.buffer, ptr, numValues ).slice();\n\n\t\t\tdraco._free( ptr );\n\n\t\t\treturn {\n\t\t\t\tname: attributeName,\n\t\t\t\tarray: array,\n\t\t\t\titemSize: numComponents\n\t\t\t};\n\n\t\t}\n\n\t\tfunction getDracoDataType( draco, attributeType ) {\n\n\t\t\tswitch ( attributeType ) {\n\n\t\t\t\tcase Float32Array:\n\t\t\t\t\treturn draco.DT_FLOAT32;\n\n\t\t\t\tcase Int8Array:\n\t\t\t\t\treturn draco.DT_INT8;\n\n\t\t\t\tcase Int16Array:\n\t\t\t\t\treturn draco.DT_INT16;\n\n\t\t\t\tcase Int32Array:\n\t\t\t\t\treturn draco.DT_INT32;\n\n\t\t\t\tcase Uint8Array:\n\t\t\t\t\treturn draco.DT_UINT8;\n\n\t\t\t\tcase Uint16Array:\n\t\t\t\t\treturn draco.DT_UINT16;\n\n\t\t\t\tcase Uint32Array:\n\t\t\t\t\treturn draco.DT_UINT32;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tTHREE.DRACOLoader = DRACOLoader;\n\n} )();\n",
  296. "( function () {\n\n\tclass GLTFLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\t\t\tthis.dracoLoader = null;\n\t\t\tthis.ktx2Loader = null;\n\t\t\tthis.meshoptDecoder = null;\n\t\t\tthis.pluginCallbacks = [];\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsClearcoatExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFTextureBasisUExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFTextureWebPExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsTransmissionExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsVolumeExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsIorExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMaterialsSpecularExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFLightsExtension( parser );\n\n\t\t\t} );\n\t\t\tthis.register( function ( parser ) {\n\n\t\t\t\treturn new GLTFMeshoptCompression( parser );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst scope = this;\n\t\t\tlet resourcePath;\n\n\t\t\tif ( this.resourcePath !== '' ) {\n\n\t\t\t\tresourcePath = this.resourcePath;\n\n\t\t\t} else if ( this.path !== '' ) {\n\n\t\t\t\tresourcePath = this.path;\n\n\t\t\t} else {\n\n\t\t\t\tresourcePath = THREE.LoaderUtils.extractUrlBase( url );\n\n\t\t\t} // Tells the LoadingManager to track an extra item, which resolves after\n\t\t\t// the model is fully loaded. This means the count of items loaded will\n\t\t\t// be incorrect, but ensures manager.onLoad() does not fire early.\n\n\n\t\t\tthis.manager.itemStart( url );\n\n\t\t\tconst _onError = function ( e ) {\n\n\t\t\t\tif ( onError ) {\n\n\t\t\t\t\tonError( e );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t}\n\n\t\t\t\tscope.manager.itemError( url );\n\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t};\n\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setResponseType( 'arraybuffer' );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( data ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tscope.parse( data, resourcePath, function ( gltf ) {\n\n\t\t\t\t\t\tonLoad( gltf );\n\t\t\t\t\t\tscope.manager.itemEnd( url );\n\n\t\t\t\t\t}, _onError );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\t_onError( e );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, _onError );\n\n\t\t}\n\n\t\tsetDRACOLoader( dracoLoader ) {\n\n\t\t\tthis.dracoLoader = dracoLoader;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetDDSLoader() {\n\n\t\t\tthrow new Error( 'THREE.GLTFLoader: \"MSFT_texture_dds\" no longer supported. Please update to \"KHR_texture_basisu\".' );\n\n\t\t}\n\n\t\tsetKTX2Loader( ktx2Loader ) {\n\n\t\t\tthis.ktx2Loader = ktx2Loader;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetMeshoptDecoder( meshoptDecoder ) {\n\n\t\t\tthis.meshoptDecoder = meshoptDecoder;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tregister( callback ) {\n\n\t\t\tif ( this.pluginCallbacks.indexOf( callback ) === - 1 ) {\n\n\t\t\t\tthis.pluginCallbacks.push( callback );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tunregister( callback ) {\n\n\t\t\tif ( this.pluginCallbacks.indexOf( callback ) !== - 1 ) {\n\n\t\t\t\tthis.pluginCallbacks.splice( this.pluginCallbacks.indexOf( callback ), 1 );\n\n\t\t\t}\n\n\t\t\treturn this;\n\n\t\t}\n\n\t\tparse( data, path, onLoad, onError ) {\n\n\t\t\tlet content;\n\t\t\tconst extensions = {};\n\t\t\tconst plugins = {};\n\n\t\t\tif ( typeof data === 'string' ) {\n\n\t\t\t\tcontent = data;\n\n\t\t\t} else {\n\n\t\t\t\tconst magic = THREE.LoaderUtils.decodeText( new Uint8Array( data, 0, 4 ) );\n\n\t\t\t\tif ( magic === BINARY_EXTENSION_HEADER_MAGIC ) {\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\textensions[ EXTENSIONS.KHR_BINARY_GLTF ] = new GLTFBinaryExtension( data );\n\n\t\t\t\t\t} catch ( error ) {\n\n\t\t\t\t\t\tif ( onError ) onError( error );\n\t\t\t\t\t\treturn;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tcontent = extensions[ EXTENSIONS.KHR_BINARY_GLTF ].content;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tcontent = THREE.LoaderUtils.decodeText( new Uint8Array( data ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst json = JSON.parse( content );\n\n\t\t\tif ( json.asset === undefined || json.asset.version[ 0 ] < 2 ) {\n\n\t\t\t\tif ( onError ) onError( new Error( 'THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported.' ) );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tconst parser = new GLTFParser( json, {\n\t\t\t\tpath: path || this.resourcePath || '',\n\t\t\t\tcrossOrigin: this.crossOrigin,\n\t\t\t\trequestHeader: this.requestHeader,\n\t\t\t\tmanager: this.manager,\n\t\t\t\tktx2Loader: this.ktx2Loader,\n\t\t\t\tmeshoptDecoder: this.meshoptDecoder\n\t\t\t} );\n\t\t\tparser.fileLoader.setRequestHeader( this.requestHeader );\n\n\t\t\tfor ( let i = 0; i < this.pluginCallbacks.length; i ++ ) {\n\n\t\t\t\tconst plugin = this.pluginCallbacks[ i ]( parser );\n\t\t\t\tplugins[ plugin.name ] = plugin; // Workaround to avoid determining as unknown extension\n\t\t\t\t// in addUnknownExtensionsToUserData().\n\t\t\t\t// Remove this workaround if we move all the existing\n\t\t\t\t// extension handlers to plugin system\n\n\t\t\t\textensions[ plugin.name ] = true;\n\n\t\t\t}\n\n\t\t\tif ( json.extensionsUsed ) {\n\n\t\t\t\tfor ( let i = 0; i < json.extensionsUsed.length; ++ i ) {\n\n\t\t\t\t\tconst extensionName = json.extensionsUsed[ i ];\n\t\t\t\t\tconst extensionsRequired = json.extensionsRequired || [];\n\n\t\t\t\t\tswitch ( extensionName ) {\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_MATERIALS_UNLIT:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFMaterialsUnlitExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFMaterialsPbrSpecularGlossinessExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_DRACO_MESH_COMPRESSION:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_TEXTURE_TRANSFORM:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFTextureTransformExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase EXTENSIONS.KHR_MESH_QUANTIZATION:\n\t\t\t\t\t\t\textensions[ extensionName ] = new GLTFMeshQuantizationExtension();\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tif ( extensionsRequired.indexOf( extensionName ) >= 0 && plugins[ extensionName ] === undefined ) {\n\n\t\t\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Unknown extension \"' + extensionName + '\".' );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tparser.setExtensions( extensions );\n\t\t\tparser.setPlugins( plugins );\n\t\t\tparser.parse( onLoad, onError );\n\n\t\t}\n\n\t}\n\t/* GLTFREGISTRY */\n\n\n\tfunction GLTFRegistry() {\n\n\t\tlet objects = {};\n\t\treturn {\n\t\t\tget: function ( key ) {\n\n\t\t\t\treturn objects[ key ];\n\n\t\t\t},\n\t\t\tadd: function ( key, object ) {\n\n\t\t\t\tobjects[ key ] = object;\n\n\t\t\t},\n\t\t\tremove: function ( key ) {\n\n\t\t\t\tdelete objects[ key ];\n\n\t\t\t},\n\t\t\tremoveAll: function () {\n\n\t\t\t\tobjects = {};\n\n\t\t\t}\n\t\t};\n\n\t}\n\t/*********************************/\n\n\t/********** EXTENSIONS ***********/\n\n\t/*********************************/\n\n\n\tconst EXTENSIONS = {\n\t\tKHR_BINARY_GLTF: 'KHR_binary_glTF',\n\t\tKHR_DRACO_MESH_COMPRESSION: 'KHR_draco_mesh_compression',\n\t\tKHR_LIGHTS_PUNCTUAL: 'KHR_lights_punctual',\n\t\tKHR_MATERIALS_CLEARCOAT: 'KHR_materials_clearcoat',\n\t\tKHR_MATERIALS_IOR: 'KHR_materials_ior',\n\t\tKHR_MATERIALS_PBR_SPECULAR_GLOSSINESS: 'KHR_materials_pbrSpecularGlossiness',\n\t\tKHR_MATERIALS_SPECULAR: 'KHR_materials_specular',\n\t\tKHR_MATERIALS_TRANSMISSION: 'KHR_materials_transmission',\n\t\tKHR_MATERIALS_UNLIT: 'KHR_materials_unlit',\n\t\tKHR_MATERIALS_VOLUME: 'KHR_materials_volume',\n\t\tKHR_TEXTURE_BASISU: 'KHR_texture_basisu',\n\t\tKHR_TEXTURE_TRANSFORM: 'KHR_texture_transform',\n\t\tKHR_MESH_QUANTIZATION: 'KHR_mesh_quantization',\n\t\tEXT_TEXTURE_WEBP: 'EXT_texture_webp',\n\t\tEXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression'\n\t};\n\t/**\n * Punctual Lights Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual\n */\n\n\tclass GLTFLightsExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_LIGHTS_PUNCTUAL; // THREE.Object3D instance caches\n\n\t\t\tthis.cache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\n\t\t}\n\n\t\t_markDefs() {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst nodeDefs = this.parser.json.nodes || [];\n\n\t\t\tfor ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {\n\n\t\t\t\tconst nodeDef = nodeDefs[ nodeIndex ];\n\n\t\t\t\tif ( nodeDef.extensions && nodeDef.extensions[ this.name ] && nodeDef.extensions[ this.name ].light !== undefined ) {\n\n\t\t\t\t\tparser._addNodeRef( this.cache, nodeDef.extensions[ this.name ].light );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t_loadLight( lightIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst cacheKey = 'light:' + lightIndex;\n\t\t\tlet dependency = parser.cache.get( cacheKey );\n\t\t\tif ( dependency ) return dependency;\n\t\t\tconst json = parser.json;\n\t\t\tconst extensions = json.extensions && json.extensions[ this.name ] || {};\n\t\t\tconst lightDefs = extensions.lights || [];\n\t\t\tconst lightDef = lightDefs[ lightIndex ];\n\t\t\tlet lightNode;\n\t\t\tconst color = new THREE.Color( 0xffffff );\n\t\t\tif ( lightDef.color !== undefined ) color.fromArray( lightDef.color );\n\t\t\tconst range = lightDef.range !== undefined ? lightDef.range : 0;\n\n\t\t\tswitch ( lightDef.type ) {\n\n\t\t\t\tcase 'directional':\n\t\t\t\t\tlightNode = new THREE.DirectionalLight( color );\n\t\t\t\t\tlightNode.target.position.set( 0, 0, - 1 );\n\t\t\t\t\tlightNode.add( lightNode.target );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'point':\n\t\t\t\t\tlightNode = new THREE.PointLight( color );\n\t\t\t\t\tlightNode.distance = range;\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'spot':\n\t\t\t\t\tlightNode = new THREE.SpotLight( color );\n\t\t\t\t\tlightNode.distance = range; // Handle spotlight properties.\n\n\t\t\t\t\tlightDef.spot = lightDef.spot || {};\n\t\t\t\t\tlightDef.spot.innerConeAngle = lightDef.spot.innerConeAngle !== undefined ? lightDef.spot.innerConeAngle : 0;\n\t\t\t\t\tlightDef.spot.outerConeAngle = lightDef.spot.outerConeAngle !== undefined ? lightDef.spot.outerConeAngle : Math.PI / 4.0;\n\t\t\t\t\tlightNode.angle = lightDef.spot.outerConeAngle;\n\t\t\t\t\tlightNode.penumbra = 1.0 - lightDef.spot.innerConeAngle / lightDef.spot.outerConeAngle;\n\t\t\t\t\tlightNode.target.position.set( 0, 0, - 1 );\n\t\t\t\t\tlightNode.add( lightNode.target );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unexpected light type: ' + lightDef.type );\n\n\t\t\t} // Some lights (e.g. spot) default to a position other than the origin. Reset the position\n\t\t\t// here, because node-level parsing will only override position if explicitly specified.\n\n\n\t\t\tlightNode.position.set( 0, 0, 0 );\n\t\t\tlightNode.decay = 2;\n\t\t\tif ( lightDef.intensity !== undefined ) lightNode.intensity = lightDef.intensity;\n\t\t\tlightNode.name = parser.createUniqueName( lightDef.name || 'light_' + lightIndex );\n\t\t\tdependency = Promise.resolve( lightNode );\n\t\t\tparser.cache.add( cacheKey, dependency );\n\t\t\treturn dependency;\n\n\t\t}\n\n\t\tcreateNodeAttachment( nodeIndex ) {\n\n\t\t\tconst self = this;\n\t\t\tconst parser = this.parser;\n\t\t\tconst json = parser.json;\n\t\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\t\t\tconst lightDef = nodeDef.extensions && nodeDef.extensions[ this.name ] || {};\n\t\t\tconst lightIndex = lightDef.light;\n\t\t\tif ( lightIndex === undefined ) return null;\n\t\t\treturn this._loadLight( lightIndex ).then( function ( light ) {\n\n\t\t\t\treturn parser._getNodeRef( self.cache, lightIndex, light );\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\t/**\n * Unlit Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_unlit\n */\n\n\n\tclass GLTFMaterialsUnlitExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_UNLIT;\n\n\t\t}\n\n\t\tgetMaterialType() {\n\n\t\t\treturn THREE.MeshBasicMaterial;\n\n\t\t}\n\n\t\textendParams( materialParams, materialDef, parser ) {\n\n\t\t\tconst pending = [];\n\t\t\tmaterialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );\n\t\t\tmaterialParams.opacity = 1.0;\n\t\t\tconst metallicRoughness = materialDef.pbrMetallicRoughness;\n\n\t\t\tif ( metallicRoughness ) {\n\n\t\t\t\tif ( Array.isArray( metallicRoughness.baseColorFactor ) ) {\n\n\t\t\t\t\tconst array = metallicRoughness.baseColorFactor;\n\t\t\t\t\tmaterialParams.color.fromArray( array );\n\t\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t\t}\n\n\t\t\t\tif ( metallicRoughness.baseColorTexture !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Clearcoat Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_clearcoat\n */\n\n\n\tclass GLTFMaterialsClearcoatExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_CLEARCOAT;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\t\tif ( extension.clearcoatFactor !== undefined ) {\n\n\t\t\t\tmaterialParams.clearcoat = extension.clearcoatFactor;\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatMap', extension.clearcoatTexture ) );\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatRoughnessFactor !== undefined ) {\n\n\t\t\t\tmaterialParams.clearcoatRoughness = extension.clearcoatRoughnessFactor;\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatRoughnessTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatRoughnessMap', extension.clearcoatRoughnessTexture ) );\n\n\t\t\t}\n\n\t\t\tif ( extension.clearcoatNormalTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'clearcoatNormalMap', extension.clearcoatNormalTexture ) );\n\n\t\t\t\tif ( extension.clearcoatNormalTexture.scale !== undefined ) {\n\n\t\t\t\t\tconst scale = extension.clearcoatNormalTexture.scale;\n\t\t\t\t\tmaterialParams.clearcoatNormalScale = new THREE.Vector2( scale, scale );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Transmission Materials Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_transmission\n * Draft: https://github.com/KhronosGroup/glTF/pull/1698\n */\n\n\n\tclass GLTFMaterialsTransmissionExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_TRANSMISSION;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\n\t\t\tif ( extension.transmissionFactor !== undefined ) {\n\n\t\t\t\tmaterialParams.transmission = extension.transmissionFactor;\n\n\t\t\t}\n\n\t\t\tif ( extension.transmissionTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'transmissionMap', extension.transmissionTexture ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Materials Volume Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume\n */\n\n\n\tclass GLTFMaterialsVolumeExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_VOLUME;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.thickness = extension.thicknessFactor !== undefined ? extension.thicknessFactor : 0;\n\n\t\t\tif ( extension.thicknessTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'thicknessMap', extension.thicknessTexture ) );\n\n\t\t\t}\n\n\t\t\tmaterialParams.attenuationDistance = extension.attenuationDistance || 0;\n\t\t\tconst colorArray = extension.attenuationColor || [ 1, 1, 1 ];\n\t\t\tmaterialParams.attenuationTint = new THREE.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * Materials ior Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_ior\n */\n\n\n\tclass GLTFMaterialsIorExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_IOR;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.ior = extension.ior !== undefined ? extension.ior : 1.5;\n\t\t\treturn Promise.resolve();\n\n\t\t}\n\n\t}\n\t/**\n * Materials specular Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_specular\n */\n\n\n\tclass GLTFMaterialsSpecularExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_SPECULAR;\n\n\t\t}\n\n\t\tgetMaterialType( materialIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) return null;\n\t\t\treturn THREE.MeshPhysicalMaterial;\n\n\t\t}\n\n\t\textendMaterialParams( materialIndex, materialParams ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst materialDef = parser.json.materials[ materialIndex ];\n\n\t\t\tif ( ! materialDef.extensions || ! materialDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn Promise.resolve();\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\t\t\tconst extension = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.specularIntensity = extension.specularFactor !== undefined ? extension.specularFactor : 1.0;\n\n\t\t\tif ( extension.specularTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'specularIntensityMap', extension.specularTexture ) );\n\n\t\t\t}\n\n\t\t\tconst colorArray = extension.specularColorFactor || [ 1, 1, 1 ];\n\t\t\tmaterialParams.specularTint = new THREE.Color( colorArray[ 0 ], colorArray[ 1 ], colorArray[ 2 ] );\n\n\t\t\tif ( extension.specularColorTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'specularTintMap', extension.specularColorTexture ).then( function ( texture ) {\n\n\t\t\t\t\ttexture.encoding = THREE.sRGBEncoding;\n\n\t\t\t\t} ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t}\n\t/**\n * BasisU THREE.Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu\n */\n\n\n\tclass GLTFTextureBasisUExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.KHR_TEXTURE_BASISU;\n\n\t\t}\n\n\t\tloadTexture( textureIndex ) {\n\n\t\t\tconst parser = this.parser;\n\t\t\tconst json = parser.json;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ this.name ] ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tconst extension = textureDef.extensions[ this.name ];\n\t\t\tconst source = json.images[ extension.source ];\n\t\t\tconst loader = parser.options.ktx2Loader;\n\n\t\t\tif ( ! loader ) {\n\n\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures' );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Assumes that the extension is optional and that a fallback texture is present\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn parser.loadTextureImage( textureIndex, source, loader );\n\n\t\t}\n\n\t}\n\t/**\n * WebP THREE.Texture Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_texture_webp\n */\n\n\n\tclass GLTFTextureWebPExtension {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.parser = parser;\n\t\t\tthis.name = EXTENSIONS.EXT_TEXTURE_WEBP;\n\t\t\tthis.isSupported = null;\n\n\t\t}\n\n\t\tloadTexture( textureIndex ) {\n\n\t\t\tconst name = this.name;\n\t\t\tconst parser = this.parser;\n\t\t\tconst json = parser.json;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\n\t\t\tif ( ! textureDef.extensions || ! textureDef.extensions[ name ] ) {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tconst extension = textureDef.extensions[ name ];\n\t\t\tconst source = json.images[ extension.source ];\n\t\t\tlet loader = parser.textureLoader;\n\n\t\t\tif ( source.uri ) {\n\n\t\t\t\tconst handler = parser.options.manager.getHandler( source.uri );\n\t\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t\t}\n\n\t\t\treturn this.detectSupport().then( function ( isSupported ) {\n\n\t\t\t\tif ( isSupported ) return parser.loadTextureImage( textureIndex, source, loader );\n\n\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( name ) >= 0 ) {\n\n\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: WebP required by asset but unsupported.' );\n\n\t\t\t\t} // Fall back to PNG or JPEG.\n\n\n\t\t\t\treturn parser.loadTexture( textureIndex );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tdetectSupport() {\n\n\t\t\tif ( ! this.isSupported ) {\n\n\t\t\t\tthis.isSupported = new Promise( function ( resolve ) {\n\n\t\t\t\t\tconst image = new Image(); // Lossy test image. Support for lossy images doesn't guarantee support for all\n\t\t\t\t\t// WebP images, unfortunately.\n\n\t\t\t\t\timage.src = 'data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA';\n\n\t\t\t\t\timage.onload = image.onerror = function () {\n\n\t\t\t\t\t\tresolve( image.height === 1 );\n\n\t\t\t\t\t};\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\treturn this.isSupported;\n\n\t\t}\n\n\t}\n\t/**\n * meshopt BufferView Compression Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/EXT_meshopt_compression\n */\n\n\n\tclass GLTFMeshoptCompression {\n\n\t\tconstructor( parser ) {\n\n\t\t\tthis.name = EXTENSIONS.EXT_MESHOPT_COMPRESSION;\n\t\t\tthis.parser = parser;\n\n\t\t}\n\n\t\tloadBufferView( index ) {\n\n\t\t\tconst json = this.parser.json;\n\t\t\tconst bufferView = json.bufferViews[ index ];\n\n\t\t\tif ( bufferView.extensions && bufferView.extensions[ this.name ] ) {\n\n\t\t\t\tconst extensionDef = bufferView.extensions[ this.name ];\n\t\t\t\tconst buffer = this.parser.getDependency( 'buffer', extensionDef.buffer );\n\t\t\t\tconst decoder = this.parser.options.meshoptDecoder;\n\n\t\t\t\tif ( ! decoder || ! decoder.supported ) {\n\n\t\t\t\t\tif ( json.extensionsRequired && json.extensionsRequired.indexOf( this.name ) >= 0 ) {\n\n\t\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files' );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Assumes that the extension is optional and that fallback buffer data is present\n\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn Promise.all( [ buffer, decoder.ready ] ).then( function ( res ) {\n\n\t\t\t\t\tconst byteOffset = extensionDef.byteOffset || 0;\n\t\t\t\t\tconst byteLength = extensionDef.byteLength || 0;\n\t\t\t\t\tconst count = extensionDef.count;\n\t\t\t\t\tconst stride = extensionDef.byteStride;\n\t\t\t\t\tconst result = new ArrayBuffer( count * stride );\n\t\t\t\t\tconst source = new Uint8Array( res[ 0 ], byteOffset, byteLength );\n\t\t\t\t\tdecoder.decodeGltfBuffer( new Uint8Array( result ), count, stride, source, extensionDef.mode, extensionDef.filter );\n\t\t\t\t\treturn result;\n\n\t\t\t\t} );\n\n\t\t\t} else {\n\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/* BINARY EXTENSION */\n\n\n\tconst BINARY_EXTENSION_HEADER_MAGIC = 'glTF';\n\tconst BINARY_EXTENSION_HEADER_LENGTH = 12;\n\tconst BINARY_EXTENSION_CHUNK_TYPES = {\n\t\tJSON: 0x4E4F534A,\n\t\tBIN: 0x004E4942\n\t};\n\n\tclass GLTFBinaryExtension {\n\n\t\tconstructor( data ) {\n\n\t\t\tthis.name = EXTENSIONS.KHR_BINARY_GLTF;\n\t\t\tthis.content = null;\n\t\t\tthis.body = null;\n\t\t\tconst headerView = new DataView( data, 0, BINARY_EXTENSION_HEADER_LENGTH );\n\t\t\tthis.header = {\n\t\t\t\tmagic: THREE.LoaderUtils.decodeText( new Uint8Array( data.slice( 0, 4 ) ) ),\n\t\t\t\tversion: headerView.getUint32( 4, true ),\n\t\t\t\tlength: headerView.getUint32( 8, true )\n\t\t\t};\n\n\t\t\tif ( this.header.magic !== BINARY_EXTENSION_HEADER_MAGIC ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unsupported glTF-Binary header.' );\n\n\t\t\t} else if ( this.header.version < 2.0 ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Legacy binary file detected.' );\n\n\t\t\t}\n\n\t\t\tconst chunkContentsLength = this.header.length - BINARY_EXTENSION_HEADER_LENGTH;\n\t\t\tconst chunkView = new DataView( data, BINARY_EXTENSION_HEADER_LENGTH );\n\t\t\tlet chunkIndex = 0;\n\n\t\t\twhile ( chunkIndex < chunkContentsLength ) {\n\n\t\t\t\tconst chunkLength = chunkView.getUint32( chunkIndex, true );\n\t\t\t\tchunkIndex += 4;\n\t\t\t\tconst chunkType = chunkView.getUint32( chunkIndex, true );\n\t\t\t\tchunkIndex += 4;\n\n\t\t\t\tif ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.JSON ) {\n\n\t\t\t\t\tconst contentArray = new Uint8Array( data, BINARY_EXTENSION_HEADER_LENGTH + chunkIndex, chunkLength );\n\t\t\t\t\tthis.content = THREE.LoaderUtils.decodeText( contentArray );\n\n\t\t\t\t} else if ( chunkType === BINARY_EXTENSION_CHUNK_TYPES.BIN ) {\n\n\t\t\t\t\tconst byteOffset = BINARY_EXTENSION_HEADER_LENGTH + chunkIndex;\n\t\t\t\t\tthis.body = data.slice( byteOffset, byteOffset + chunkLength );\n\n\t\t\t\t} // Clients must ignore chunks with unknown types.\n\n\n\t\t\t\tchunkIndex += chunkLength;\n\n\t\t\t}\n\n\t\t\tif ( this.content === null ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: JSON content not found.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/**\n * DRACO THREE.Mesh Compression Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression\n */\n\n\n\tclass GLTFDracoMeshCompressionExtension {\n\n\t\tconstructor( json, dracoLoader ) {\n\n\t\t\tif ( ! dracoLoader ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: No DRACOLoader instance provided.' );\n\n\t\t\t}\n\n\t\t\tthis.name = EXTENSIONS.KHR_DRACO_MESH_COMPRESSION;\n\t\t\tthis.json = json;\n\t\t\tthis.dracoLoader = dracoLoader;\n\t\t\tthis.dracoLoader.preload();\n\n\t\t}\n\n\t\tdecodePrimitive( primitive, parser ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst dracoLoader = this.dracoLoader;\n\t\t\tconst bufferViewIndex = primitive.extensions[ this.name ].bufferView;\n\t\t\tconst gltfAttributeMap = primitive.extensions[ this.name ].attributes;\n\t\t\tconst threeAttributeMap = {};\n\t\t\tconst attributeNormalizedMap = {};\n\t\t\tconst attributeTypeMap = {};\n\n\t\t\tfor ( const attributeName in gltfAttributeMap ) {\n\n\t\t\t\tconst threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase();\n\t\t\t\tthreeAttributeMap[ threeAttributeName ] = gltfAttributeMap[ attributeName ];\n\n\t\t\t}\n\n\t\t\tfor ( const attributeName in primitive.attributes ) {\n\n\t\t\t\tconst threeAttributeName = ATTRIBUTES[ attributeName ] || attributeName.toLowerCase();\n\n\t\t\t\tif ( gltfAttributeMap[ attributeName ] !== undefined ) {\n\n\t\t\t\t\tconst accessorDef = json.accessors[ primitive.attributes[ attributeName ] ];\n\t\t\t\t\tconst componentType = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ];\n\t\t\t\t\tattributeTypeMap[ threeAttributeName ] = componentType;\n\t\t\t\t\tattributeNormalizedMap[ threeAttributeName ] = accessorDef.normalized === true;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn parser.getDependency( 'bufferView', bufferViewIndex ).then( function ( bufferView ) {\n\n\t\t\t\treturn new Promise( function ( resolve ) {\n\n\t\t\t\t\tdracoLoader.decodeDracoFile( bufferView, function ( geometry ) {\n\n\t\t\t\t\t\tfor ( const attributeName in geometry.attributes ) {\n\n\t\t\t\t\t\t\tconst attribute = geometry.attributes[ attributeName ];\n\t\t\t\t\t\t\tconst normalized = attributeNormalizedMap[ attributeName ];\n\t\t\t\t\t\t\tif ( normalized !== undefined ) attribute.normalized = normalized;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tresolve( geometry );\n\n\t\t\t\t\t}, threeAttributeMap, attributeTypeMap );\n\n\t\t\t\t} );\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\t/**\n * THREE.Texture Transform Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_transform\n */\n\n\n\tclass GLTFTextureTransformExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_TEXTURE_TRANSFORM;\n\n\t\t}\n\n\t\textendTexture( texture, transform ) {\n\n\t\t\tif ( transform.texCoord !== undefined ) {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Custom UV sets in \"' + this.name + '\" extension not yet supported.' );\n\n\t\t\t}\n\n\t\t\tif ( transform.offset === undefined && transform.rotation === undefined && transform.scale === undefined ) {\n\n\t\t\t\t// See https://github.com/mrdoob/three.js/issues/21819.\n\t\t\t\treturn texture;\n\n\t\t\t}\n\n\t\t\ttexture = texture.clone();\n\n\t\t\tif ( transform.offset !== undefined ) {\n\n\t\t\t\ttexture.offset.fromArray( transform.offset );\n\n\t\t\t}\n\n\t\t\tif ( transform.rotation !== undefined ) {\n\n\t\t\t\ttexture.rotation = transform.rotation;\n\n\t\t\t}\n\n\t\t\tif ( transform.scale !== undefined ) {\n\n\t\t\t\ttexture.repeat.fromArray( transform.scale );\n\n\t\t\t}\n\n\t\t\ttexture.needsUpdate = true;\n\t\t\treturn texture;\n\n\t\t}\n\n\t}\n\t/**\n * Specular-Glossiness Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness\n */\n\n\t/**\n * A sub class of StandardMaterial with some of the functionality\n * changed via the `onBeforeCompile` callback\n * @pailhead\n */\n\n\n\tclass GLTFMeshStandardSGMaterial extends THREE.MeshStandardMaterial {\n\n\t\tconstructor( params ) {\n\n\t\t\tsuper();\n\t\t\tthis.isGLTFSpecularGlossinessMaterial = true; //various chunks that need replacing\n\n\t\t\tconst specularMapParsFragmentChunk = [ '#ifdef USE_SPECULARMAP', '\tuniform sampler2D specularMap;', '#endif' ].join( '\\n' );\n\t\t\tconst glossinessMapParsFragmentChunk = [ '#ifdef USE_GLOSSINESSMAP', '\tuniform sampler2D glossinessMap;', '#endif' ].join( '\\n' );\n\t\t\tconst specularMapFragmentChunk = [ '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' );\n\t\t\tconst glossinessMapFragmentChunk = [ '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' );\n\t\t\tconst lightPhysicalFragmentChunk = [ 'PhysicalMaterial material;', 'material.diffuseColor = diffuseColor.rgb * ( 1. - max( specularFactor.r, max( specularFactor.g, specularFactor.b ) ) );', 'vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );', 'float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );', 'material.roughness = max( 1.0 - glossinessFactor, 0.0525 ); // 0.0525 corresponds to the base mip of a 256 cubemap.', 'material.roughness += geometryRoughness;', 'material.roughness = min( material.roughness, 1.0 );', 'material.specularColor = specularFactor;' ].join( '\\n' );\n\t\t\tconst uniforms = {\n\t\t\t\tspecular: {\n\t\t\t\t\tvalue: new THREE.Color().setHex( 0xffffff )\n\t\t\t\t},\n\t\t\t\tglossiness: {\n\t\t\t\t\tvalue: 1\n\t\t\t\t},\n\t\t\t\tspecularMap: {\n\t\t\t\t\tvalue: null\n\t\t\t\t},\n\t\t\t\tglossinessMap: {\n\t\t\t\t\tvalue: null\n\t\t\t\t}\n\t\t\t};\n\t\t\tthis._extraUniforms = uniforms;\n\n\t\t\tthis.onBeforeCompile = function ( shader ) {\n\n\t\t\t\tfor ( const uniformName in uniforms ) {\n\n\t\t\t\t\tshader.uniforms[ uniformName ] = uniforms[ uniformName ];\n\n\t\t\t\t}\n\n\t\t\t\tshader.fragmentShader = shader.fragmentShader.replace( 'uniform float roughness;', 'uniform vec3 specular;' ).replace( 'uniform float metalness;', 'uniform float glossiness;' ).replace( '#include <roughnessmap_pars_fragment>', specularMapParsFragmentChunk ).replace( '#include <metalnessmap_pars_fragment>', glossinessMapParsFragmentChunk ).replace( '#include <roughnessmap_fragment>', specularMapFragmentChunk ).replace( '#include <metalnessmap_fragment>', glossinessMapFragmentChunk ).replace( '#include <lights_physical_fragment>', lightPhysicalFragmentChunk );\n\n\t\t\t};\n\n\t\t\tObject.defineProperties( this, {\n\t\t\t\tspecular: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.specular.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.specular.value = v;\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tspecularMap: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.specularMap.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.specularMap.value = v;\n\n\t\t\t\t\t\tif ( v ) {\n\n\t\t\t\t\t\t\tthis.defines.USE_SPECULARMAP = ''; // USE_UV is set by the renderer for specular maps\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tdelete this.defines.USE_SPECULARMAP;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tglossiness: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.glossiness.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.glossiness.value = v;\n\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tglossinessMap: {\n\t\t\t\t\tget: function () {\n\n\t\t\t\t\t\treturn uniforms.glossinessMap.value;\n\n\t\t\t\t\t},\n\t\t\t\t\tset: function ( v ) {\n\n\t\t\t\t\t\tuniforms.glossinessMap.value = v;\n\n\t\t\t\t\t\tif ( v ) {\n\n\t\t\t\t\t\t\tthis.defines.USE_GLOSSINESSMAP = '';\n\t\t\t\t\t\t\tthis.defines.USE_UV = '';\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tdelete this.defines.USE_GLOSSINESSMAP;\n\t\t\t\t\t\t\tdelete this.defines.USE_UV;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t\tdelete this.metalness;\n\t\t\tdelete this.roughness;\n\t\t\tdelete this.metalnessMap;\n\t\t\tdelete this.roughnessMap;\n\t\t\tthis.setValues( params );\n\n\t\t}\n\n\t\tcopy( source ) {\n\n\t\t\tsuper.copy( source );\n\t\t\tthis.specularMap = source.specularMap;\n\t\t\tthis.specular.copy( source.specular );\n\t\t\tthis.glossinessMap = source.glossinessMap;\n\t\t\tthis.glossiness = source.glossiness;\n\t\t\tdelete this.metalness;\n\t\t\tdelete this.roughness;\n\t\t\tdelete this.metalnessMap;\n\t\t\tdelete this.roughnessMap;\n\t\t\treturn this;\n\n\t\t}\n\n\t}\n\n\tclass GLTFMaterialsPbrSpecularGlossinessExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS;\n\t\t\tthis.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' ];\n\n\t\t}\n\n\t\tgetMaterialType() {\n\n\t\t\treturn GLTFMeshStandardSGMaterial;\n\n\t\t}\n\n\t\textendParams( materialParams, materialDef, parser ) {\n\n\t\t\tconst pbrSpecularGlossiness = materialDef.extensions[ this.name ];\n\t\t\tmaterialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );\n\t\t\tmaterialParams.opacity = 1.0;\n\t\t\tconst pending = [];\n\n\t\t\tif ( Array.isArray( pbrSpecularGlossiness.diffuseFactor ) ) {\n\n\t\t\t\tconst array = pbrSpecularGlossiness.diffuseFactor;\n\t\t\t\tmaterialParams.color.fromArray( array );\n\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t}\n\n\t\t\tif ( pbrSpecularGlossiness.diffuseTexture !== undefined ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', pbrSpecularGlossiness.diffuseTexture ) );\n\n\t\t\t}\n\n\t\t\tmaterialParams.emissive = new THREE.Color( 0.0, 0.0, 0.0 );\n\t\t\tmaterialParams.glossiness = pbrSpecularGlossiness.glossinessFactor !== undefined ? pbrSpecularGlossiness.glossinessFactor : 1.0;\n\t\t\tmaterialParams.specular = new THREE.Color( 1.0, 1.0, 1.0 );\n\n\t\t\tif ( Array.isArray( pbrSpecularGlossiness.specularFactor ) ) {\n\n\t\t\t\tmaterialParams.specular.fromArray( pbrSpecularGlossiness.specularFactor );\n\n\t\t\t}\n\n\t\t\tif ( pbrSpecularGlossiness.specularGlossinessTexture !== undefined ) {\n\n\t\t\t\tconst specGlossMapDef = pbrSpecularGlossiness.specularGlossinessTexture;\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'glossinessMap', specGlossMapDef ) );\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'specularMap', specGlossMapDef ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\n\t\tcreateMaterial( materialParams ) {\n\n\t\t\tconst material = new GLTFMeshStandardSGMaterial( materialParams );\n\t\t\tmaterial.fog = true;\n\t\t\tmaterial.color = materialParams.color;\n\t\t\tmaterial.map = materialParams.map === undefined ? null : materialParams.map;\n\t\t\tmaterial.lightMap = null;\n\t\t\tmaterial.lightMapIntensity = 1.0;\n\t\t\tmaterial.aoMap = materialParams.aoMap === undefined ? null : materialParams.aoMap;\n\t\t\tmaterial.aoMapIntensity = 1.0;\n\t\t\tmaterial.emissive = materialParams.emissive;\n\t\t\tmaterial.emissiveIntensity = 1.0;\n\t\t\tmaterial.emissiveMap = materialParams.emissiveMap === undefined ? null : materialParams.emissiveMap;\n\t\t\tmaterial.bumpMap = materialParams.bumpMap === undefined ? null : materialParams.bumpMap;\n\t\t\tmaterial.bumpScale = 1;\n\t\t\tmaterial.normalMap = materialParams.normalMap === undefined ? null : materialParams.normalMap;\n\t\t\tmaterial.normalMapType = THREE.TangentSpaceNormalMap;\n\t\t\tif ( materialParams.normalScale ) material.normalScale = materialParams.normalScale;\n\t\t\tmaterial.displacementMap = null;\n\t\t\tmaterial.displacementScale = 1;\n\t\t\tmaterial.displacementBias = 0;\n\t\t\tmaterial.specularMap = materialParams.specularMap === undefined ? null : materialParams.specularMap;\n\t\t\tmaterial.specular = materialParams.specular;\n\t\t\tmaterial.glossinessMap = materialParams.glossinessMap === undefined ? null : materialParams.glossinessMap;\n\t\t\tmaterial.glossiness = materialParams.glossiness;\n\t\t\tmaterial.alphaMap = null;\n\t\t\tmaterial.envMap = materialParams.envMap === undefined ? null : materialParams.envMap;\n\t\t\tmaterial.envMapIntensity = 1.0;\n\t\t\tmaterial.refractionRatio = 0.98;\n\t\t\treturn material;\n\n\t\t}\n\n\t}\n\t/**\n * THREE.Mesh Quantization Extension\n *\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization\n */\n\n\n\tclass GLTFMeshQuantizationExtension {\n\n\t\tconstructor() {\n\n\t\t\tthis.name = EXTENSIONS.KHR_MESH_QUANTIZATION;\n\n\t\t}\n\n\t}\n\t/*********************************/\n\n\t/********** INTERPOLATION ********/\n\n\t/*********************************/\n\t// Spline Interpolation\n\t// Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#appendix-c-spline-interpolation\n\n\n\tclass GLTFCubicSplineInterpolant extends THREE.Interpolant {\n\n\t\tconstructor( parameterPositions, sampleValues, sampleSize, resultBuffer ) {\n\n\t\t\tsuper( parameterPositions, sampleValues, sampleSize, resultBuffer );\n\n\t\t}\n\n\t\tcopySampleValue_( index ) {\n\n\t\t\t// Copies a sample value to the result buffer. See description of glTF\n\t\t\t// CUBICSPLINE values layout in interpolate_() function below.\n\t\t\tconst result = this.resultBuffer,\n\t\t\t\tvalues = this.sampleValues,\n\t\t\t\tvalueSize = this.valueSize,\n\t\t\t\toffset = index * valueSize * 3 + valueSize;\n\n\t\t\tfor ( let i = 0; i !== valueSize; i ++ ) {\n\n\t\t\t\tresult[ i ] = values[ offset + i ];\n\n\t\t\t}\n\n\t\t\treturn result;\n\n\t\t}\n\n\t}\n\n\tGLTFCubicSplineInterpolant.prototype.beforeStart_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_;\n\tGLTFCubicSplineInterpolant.prototype.afterEnd_ = GLTFCubicSplineInterpolant.prototype.copySampleValue_;\n\n\tGLTFCubicSplineInterpolant.prototype.interpolate_ = function ( i1, t0, t, t1 ) {\n\n\t\tconst result = this.resultBuffer;\n\t\tconst values = this.sampleValues;\n\t\tconst stride = this.valueSize;\n\t\tconst stride2 = stride * 2;\n\t\tconst stride3 = stride * 3;\n\t\tconst td = t1 - t0;\n\t\tconst p = ( t - t0 ) / td;\n\t\tconst pp = p * p;\n\t\tconst ppp = pp * p;\n\t\tconst offset1 = i1 * stride3;\n\t\tconst offset0 = offset1 - stride3;\n\t\tconst s2 = - 2 * ppp + 3 * pp;\n\t\tconst s3 = ppp - pp;\n\t\tconst s0 = 1 - s2;\n\t\tconst s1 = s3 - pp + p; // Layout of keyframe output values for CUBICSPLINE animations:\n\t\t// [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, ... ]\n\n\t\tfor ( let i = 0; i !== stride; i ++ ) {\n\n\t\t\tconst p0 = values[ offset0 + i + stride ]; // splineVertex_k\n\n\t\t\tconst m0 = values[ offset0 + i + stride2 ] * td; // outTangent_k * (t_k+1 - t_k)\n\n\t\t\tconst p1 = values[ offset1 + i + stride ]; // splineVertex_k+1\n\n\t\t\tconst m1 = values[ offset1 + i ] * td; // inTangent_k+1 * (t_k+1 - t_k)\n\n\t\t\tresult[ i ] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1;\n\n\t\t}\n\n\t\treturn result;\n\n\t};\n\n\tconst _q = new THREE.Quaternion();\n\n\tclass GLTFCubicSplineQuaternionInterpolant extends GLTFCubicSplineInterpolant {\n\n\t\tinterpolate_( i1, t0, t, t1 ) {\n\n\t\t\tconst result = super.interpolate_( i1, t0, t, t1 );\n\n\t\t\t_q.fromArray( result ).normalize().toArray( result );\n\n\t\t\treturn result;\n\n\t\t}\n\n\t}\n\t/*********************************/\n\n\t/********** INTERNALS ************/\n\n\t/*********************************/\n\n\t/* CONSTANTS */\n\n\n\tconst WEBGL_CONSTANTS = {\n\t\tFLOAT: 5126,\n\t\t//FLOAT_MAT2: 35674,\n\t\tFLOAT_MAT3: 35675,\n\t\tFLOAT_MAT4: 35676,\n\t\tFLOAT_VEC2: 35664,\n\t\tFLOAT_VEC3: 35665,\n\t\tFLOAT_VEC4: 35666,\n\t\tLINEAR: 9729,\n\t\tREPEAT: 10497,\n\t\tSAMPLER_2D: 35678,\n\t\tPOINTS: 0,\n\t\tLINES: 1,\n\t\tLINE_LOOP: 2,\n\t\tLINE_STRIP: 3,\n\t\tTRIANGLES: 4,\n\t\tTRIANGLE_STRIP: 5,\n\t\tTRIANGLE_FAN: 6,\n\t\tUNSIGNED_BYTE: 5121,\n\t\tUNSIGNED_SHORT: 5123\n\t};\n\tconst WEBGL_COMPONENT_TYPES = {\n\t\t5120: Int8Array,\n\t\t5121: Uint8Array,\n\t\t5122: Int16Array,\n\t\t5123: Uint16Array,\n\t\t5125: Uint32Array,\n\t\t5126: Float32Array\n\t};\n\tconst WEBGL_FILTERS = {\n\t\t9728: THREE.NearestFilter,\n\t\t9729: THREE.LinearFilter,\n\t\t9984: THREE.NearestMipmapNearestFilter,\n\t\t9985: THREE.LinearMipmapNearestFilter,\n\t\t9986: THREE.NearestMipmapLinearFilter,\n\t\t9987: THREE.LinearMipmapLinearFilter\n\t};\n\tconst WEBGL_WRAPPINGS = {\n\t\t33071: THREE.ClampToEdgeWrapping,\n\t\t33648: THREE.MirroredRepeatWrapping,\n\t\t10497: THREE.RepeatWrapping\n\t};\n\tconst WEBGL_TYPE_SIZES = {\n\t\t'SCALAR': 1,\n\t\t'VEC2': 2,\n\t\t'VEC3': 3,\n\t\t'VEC4': 4,\n\t\t'MAT2': 4,\n\t\t'MAT3': 9,\n\t\t'MAT4': 16\n\t};\n\tconst ATTRIBUTES = {\n\t\tPOSITION: 'position',\n\t\tNORMAL: 'normal',\n\t\tTANGENT: 'tangent',\n\t\tTEXCOORD_0: 'uv',\n\t\tTEXCOORD_1: 'uv2',\n\t\tCOLOR_0: 'color',\n\t\tWEIGHTS_0: 'skinWeight',\n\t\tJOINTS_0: 'skinIndex'\n\t};\n\tconst PATH_PROPERTIES = {\n\t\tscale: 'scale',\n\t\ttranslation: 'position',\n\t\trotation: 'quaternion',\n\t\tweights: 'morphTargetInfluences'\n\t};\n\tconst INTERPOLATION = {\n\t\tCUBICSPLINE: undefined,\n\t\t// We use a custom interpolant (GLTFCubicSplineInterpolation) for CUBICSPLINE tracks. Each\n\t\t// keyframe track will be initialized with a default interpolation type, then modified.\n\t\tLINEAR: THREE.InterpolateLinear,\n\t\tSTEP: THREE.InterpolateDiscrete\n\t};\n\tconst ALPHA_MODES = {\n\t\tOPAQUE: 'OPAQUE',\n\t\tMASK: 'MASK',\n\t\tBLEND: 'BLEND'\n\t};\n\t/* UTILITY FUNCTIONS */\n\n\tfunction resolveURL( url, path ) {\n\n\t\t// Invalid URL\n\t\tif ( typeof url !== 'string' || url === '' ) return ''; // Host Relative URL\n\n\t\tif ( /^https?:\\/\\//i.test( path ) && /^\\//.test( url ) ) {\n\n\t\t\tpath = path.replace( /(^https?:\\/\\/[^\\/]+).*/i, '$1' );\n\n\t\t} // Absolute URL http://,https://,//\n\n\n\t\tif ( /^(https?:)?\\/\\//i.test( url ) ) return url; // Data URI\n\n\t\tif ( /^data:.*,.*$/i.test( url ) ) return url; // Blob URL\n\n\t\tif ( /^blob:.*$/i.test( url ) ) return url; // Relative URL\n\n\t\treturn path + url;\n\n\t}\n\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#default-material\n */\n\n\n\tfunction createDefaultMaterial( cache ) {\n\n\t\tif ( cache[ 'DefaultMaterial' ] === undefined ) {\n\n\t\t\tcache[ 'DefaultMaterial' ] = new THREE.MeshStandardMaterial( {\n\t\t\t\tcolor: 0xFFFFFF,\n\t\t\t\temissive: 0x000000,\n\t\t\t\tmetalness: 1,\n\t\t\t\troughness: 1,\n\t\t\t\ttransparent: false,\n\t\t\t\tdepthTest: true,\n\t\t\t\tside: THREE.FrontSide\n\t\t\t} );\n\n\t\t}\n\n\t\treturn cache[ 'DefaultMaterial' ];\n\n\t}\n\n\tfunction addUnknownExtensionsToUserData( knownExtensions, object, objectDef ) {\n\n\t\t// Add unknown glTF extensions to an object's userData.\n\t\tfor ( const name in objectDef.extensions ) {\n\n\t\t\tif ( knownExtensions[ name ] === undefined ) {\n\n\t\t\t\tobject.userData.gltfExtensions = object.userData.gltfExtensions || {};\n\t\t\t\tobject.userData.gltfExtensions[ name ] = objectDef.extensions[ name ];\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/**\n * @param {Object3D|Material|BufferGeometry} object\n * @param {GLTF.definition} gltfDef\n */\n\n\n\tfunction assignExtrasToUserData( object, gltfDef ) {\n\n\t\tif ( gltfDef.extras !== undefined ) {\n\n\t\t\tif ( typeof gltfDef.extras === 'object' ) {\n\n\t\t\t\tObject.assign( object.userData, gltfDef.extras );\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Ignoring primitive type .extras, ' + gltfDef.extras );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#morph-targets\n *\n * @param {BufferGeometry} geometry\n * @param {Array<GLTF.Target>} targets\n * @param {GLTFParser} parser\n * @return {Promise<BufferGeometry>}\n */\n\n\n\tfunction addMorphTargets( geometry, targets, parser ) {\n\n\t\tlet hasMorphPosition = false;\n\t\tlet hasMorphNormal = false;\n\n\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\tconst target = targets[ i ];\n\t\t\tif ( target.POSITION !== undefined ) hasMorphPosition = true;\n\t\t\tif ( target.NORMAL !== undefined ) hasMorphNormal = true;\n\t\t\tif ( hasMorphPosition && hasMorphNormal ) break;\n\n\t\t}\n\n\t\tif ( ! hasMorphPosition && ! hasMorphNormal ) return Promise.resolve( geometry );\n\t\tconst pendingPositionAccessors = [];\n\t\tconst pendingNormalAccessors = [];\n\n\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\tconst target = targets[ i ];\n\n\t\t\tif ( hasMorphPosition ) {\n\n\t\t\t\tconst pendingAccessor = target.POSITION !== undefined ? parser.getDependency( 'accessor', target.POSITION ) : geometry.attributes.position;\n\t\t\t\tpendingPositionAccessors.push( pendingAccessor );\n\n\t\t\t}\n\n\t\t\tif ( hasMorphNormal ) {\n\n\t\t\t\tconst pendingAccessor = target.NORMAL !== undefined ? parser.getDependency( 'accessor', target.NORMAL ) : geometry.attributes.normal;\n\t\t\t\tpendingNormalAccessors.push( pendingAccessor );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn Promise.all( [ Promise.all( pendingPositionAccessors ), Promise.all( pendingNormalAccessors ) ] ).then( function ( accessors ) {\n\n\t\t\tconst morphPositions = accessors[ 0 ];\n\t\t\tconst morphNormals = accessors[ 1 ];\n\t\t\tif ( hasMorphPosition ) geometry.morphAttributes.position = morphPositions;\n\t\t\tif ( hasMorphNormal ) geometry.morphAttributes.normal = morphNormals;\n\t\t\tgeometry.morphTargetsRelative = true;\n\t\t\treturn geometry;\n\n\t\t} );\n\n\t}\n\t/**\n * @param {Mesh} mesh\n * @param {GLTF.Mesh} meshDef\n */\n\n\n\tfunction updateMorphTargets( mesh, meshDef ) {\n\n\t\tmesh.updateMorphTargets();\n\n\t\tif ( meshDef.weights !== undefined ) {\n\n\t\t\tfor ( let i = 0, il = meshDef.weights.length; i < il; i ++ ) {\n\n\t\t\t\tmesh.morphTargetInfluences[ i ] = meshDef.weights[ i ];\n\n\t\t\t}\n\n\t\t} // .extras has user-defined data, so check that .extras.targetNames is an array.\n\n\n\t\tif ( meshDef.extras && Array.isArray( meshDef.extras.targetNames ) ) {\n\n\t\t\tconst targetNames = meshDef.extras.targetNames;\n\n\t\t\tif ( mesh.morphTargetInfluences.length === targetNames.length ) {\n\n\t\t\t\tmesh.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let i = 0, il = targetNames.length; i < il; i ++ ) {\n\n\t\t\t\t\tmesh.morphTargetDictionary[ targetNames[ i ] ] = i;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.' );\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tfunction createPrimitiveKey( primitiveDef ) {\n\n\t\tconst dracoExtension = primitiveDef.extensions && primitiveDef.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ];\n\t\tlet geometryKey;\n\n\t\tif ( dracoExtension ) {\n\n\t\t\tgeometryKey = 'draco:' + dracoExtension.bufferView + ':' + dracoExtension.indices + ':' + createAttributesKey( dracoExtension.attributes );\n\n\t\t} else {\n\n\t\t\tgeometryKey = primitiveDef.indices + ':' + createAttributesKey( primitiveDef.attributes ) + ':' + primitiveDef.mode;\n\n\t\t}\n\n\t\treturn geometryKey;\n\n\t}\n\n\tfunction createAttributesKey( attributes ) {\n\n\t\tlet attributesKey = '';\n\t\tconst keys = Object.keys( attributes ).sort();\n\n\t\tfor ( let i = 0, il = keys.length; i < il; i ++ ) {\n\n\t\t\tattributesKey += keys[ i ] + ':' + attributes[ keys[ i ] ] + ';';\n\n\t\t}\n\n\t\treturn attributesKey;\n\n\t}\n\n\tfunction getNormalizedComponentScale( constructor ) {\n\n\t\t// Reference:\n\t\t// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization#encoding-quantized-data\n\t\tswitch ( constructor ) {\n\n\t\t\tcase Int8Array:\n\t\t\t\treturn 1 / 127;\n\n\t\t\tcase Uint8Array:\n\t\t\t\treturn 1 / 255;\n\n\t\t\tcase Int16Array:\n\t\t\t\treturn 1 / 32767;\n\n\t\t\tcase Uint16Array:\n\t\t\t\treturn 1 / 65535;\n\n\t\t\tdefault:\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Unsupported normalized accessor component type.' );\n\n\t\t}\n\n\t}\n\t/* GLTF PARSER */\n\n\n\tclass GLTFParser {\n\n\t\tconstructor( json = {}, options = {} ) {\n\n\t\t\tthis.json = json;\n\t\t\tthis.extensions = {};\n\t\t\tthis.plugins = {};\n\t\t\tthis.options = options; // loader object cache\n\n\t\t\tthis.cache = new GLTFRegistry(); // associations between Three.js objects and glTF elements\n\n\t\t\tthis.associations = new Map(); // THREE.BufferGeometry caching\n\n\t\t\tthis.primitiveCache = {}; // THREE.Object3D instance caches\n\n\t\t\tthis.meshCache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\t\t\tthis.cameraCache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\t\t\tthis.lightCache = {\n\t\t\t\trefs: {},\n\t\t\t\tuses: {}\n\t\t\t};\n\t\t\tthis.textureCache = {}; // Track node names, to ensure no duplicates\n\n\t\t\tthis.nodeNamesUsed = {}; // Use an THREE.ImageBitmapLoader if imageBitmaps are supported. Moves much of the\n\t\t\t// expensive work of uploading a texture to the GPU off the main thread.\n\n\t\t\tif ( typeof createImageBitmap !== 'undefined' && /Firefox/.test( navigator.userAgent ) === false ) {\n\n\t\t\t\tthis.textureLoader = new THREE.ImageBitmapLoader( this.options.manager );\n\n\t\t\t} else {\n\n\t\t\t\tthis.textureLoader = new THREE.TextureLoader( this.options.manager );\n\n\t\t\t}\n\n\t\t\tthis.textureLoader.setCrossOrigin( this.options.crossOrigin );\n\t\t\tthis.textureLoader.setRequestHeader( this.options.requestHeader );\n\t\t\tthis.fileLoader = new THREE.FileLoader( this.options.manager );\n\t\t\tthis.fileLoader.setResponseType( 'arraybuffer' );\n\n\t\t\tif ( this.options.crossOrigin === 'use-credentials' ) {\n\n\t\t\t\tthis.fileLoader.setWithCredentials( true );\n\n\t\t\t}\n\n\t\t}\n\n\t\tsetExtensions( extensions ) {\n\n\t\t\tthis.extensions = extensions;\n\n\t\t}\n\n\t\tsetPlugins( plugins ) {\n\n\t\t\tthis.plugins = plugins;\n\n\t\t}\n\n\t\tparse( onLoad, onError ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions; // Clear the loader cache\n\n\t\t\tthis.cache.removeAll(); // Mark the special nodes/meshes in json for efficient parse\n\n\t\t\tthis._invokeAll( function ( ext ) {\n\n\t\t\t\treturn ext._markDefs && ext._markDefs();\n\n\t\t\t} );\n\n\t\t\tPromise.all( this._invokeAll( function ( ext ) {\n\n\t\t\t\treturn ext.beforeRoot && ext.beforeRoot();\n\n\t\t\t} ) ).then( function () {\n\n\t\t\t\treturn Promise.all( [ parser.getDependencies( 'scene' ), parser.getDependencies( 'animation' ), parser.getDependencies( 'camera' ) ] );\n\n\t\t\t} ).then( function ( dependencies ) {\n\n\t\t\t\tconst result = {\n\t\t\t\t\tscene: dependencies[ 0 ][ json.scene || 0 ],\n\t\t\t\t\tscenes: dependencies[ 0 ],\n\t\t\t\t\tanimations: dependencies[ 1 ],\n\t\t\t\t\tcameras: dependencies[ 2 ],\n\t\t\t\t\tasset: json.asset,\n\t\t\t\t\tparser: parser,\n\t\t\t\t\tuserData: {}\n\t\t\t\t};\n\t\t\t\taddUnknownExtensionsToUserData( extensions, result, json );\n\t\t\t\tassignExtrasToUserData( result, json );\n\t\t\t\tPromise.all( parser._invokeAll( function ( ext ) {\n\n\t\t\t\t\treturn ext.afterRoot && ext.afterRoot( result );\n\n\t\t\t\t} ) ).then( function () {\n\n\t\t\t\t\tonLoad( result );\n\n\t\t\t\t} );\n\n\t\t\t} ).catch( onError );\n\n\t\t}\n\t\t/**\n * Marks the special nodes/meshes in json for efficient parse.\n */\n\n\n\t\t_markDefs() {\n\n\t\t\tconst nodeDefs = this.json.nodes || [];\n\t\t\tconst skinDefs = this.json.skins || [];\n\t\t\tconst meshDefs = this.json.meshes || []; // Nothing in the node definition indicates whether it is a THREE.Bone or an\n\t\t\t// THREE.Object3D. Use the skins' joint references to mark bones.\n\n\t\t\tfor ( let skinIndex = 0, skinLength = skinDefs.length; skinIndex < skinLength; skinIndex ++ ) {\n\n\t\t\t\tconst joints = skinDefs[ skinIndex ].joints;\n\n\t\t\t\tfor ( let i = 0, il = joints.length; i < il; i ++ ) {\n\n\t\t\t\t\tnodeDefs[ joints[ i ] ].isBone = true;\n\n\t\t\t\t}\n\n\t\t\t} // Iterate over all nodes, marking references to shared resources,\n\t\t\t// as well as skeleton joints.\n\n\n\t\t\tfor ( let nodeIndex = 0, nodeLength = nodeDefs.length; nodeIndex < nodeLength; nodeIndex ++ ) {\n\n\t\t\t\tconst nodeDef = nodeDefs[ nodeIndex ];\n\n\t\t\t\tif ( nodeDef.mesh !== undefined ) {\n\n\t\t\t\t\tthis._addNodeRef( this.meshCache, nodeDef.mesh ); // Nothing in the mesh definition indicates whether it is\n\t\t\t\t\t// a THREE.SkinnedMesh or THREE.Mesh. Use the node's mesh reference\n\t\t\t\t\t// to mark THREE.SkinnedMesh if node has skin.\n\n\n\t\t\t\t\tif ( nodeDef.skin !== undefined ) {\n\n\t\t\t\t\t\tmeshDefs[ nodeDef.mesh ].isSkinnedMesh = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.camera !== undefined ) {\n\n\t\t\t\t\tthis._addNodeRef( this.cameraCache, nodeDef.camera );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\t\t/**\n * Counts references to shared node / THREE.Object3D resources. These resources\n * can be reused, or \"instantiated\", at multiple nodes in the scene\n * hierarchy. THREE.Mesh, Camera, and Light instances are instantiated and must\n * be marked. Non-scenegraph resources (like Materials, Geometries, and\n * Textures) can be reused directly and are not marked here.\n *\n * Example: CesiumMilkTruck sample model reuses \"Wheel\" meshes.\n */\n\n\n\t\t_addNodeRef( cache, index ) {\n\n\t\t\tif ( index === undefined ) return;\n\n\t\t\tif ( cache.refs[ index ] === undefined ) {\n\n\t\t\t\tcache.refs[ index ] = cache.uses[ index ] = 0;\n\n\t\t\t}\n\n\t\t\tcache.refs[ index ] ++;\n\n\t\t}\n\t\t/** Returns a reference to a shared resource, cloning it if necessary. */\n\n\n\t\t_getNodeRef( cache, index, object ) {\n\n\t\t\tif ( cache.refs[ index ] <= 1 ) return object;\n\t\t\tconst ref = object.clone(); // Propagates mappings to the cloned object, prevents mappings on the\n\t\t\t// original object from being lost.\n\n\t\t\tconst updateMappings = ( original, clone ) => {\n\n\t\t\t\tconst mappings = this.associations.get( original );\n\n\t\t\t\tif ( mappings != null ) {\n\n\t\t\t\t\tthis.associations.set( clone, mappings );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( const [ i, child ] of original.children.entries() ) {\n\n\t\t\t\t\tupdateMappings( child, clone.children[ i ] );\n\n\t\t\t\t}\n\n\t\t\t};\n\n\t\t\tupdateMappings( object, ref );\n\t\t\tref.name += '_instance_' + cache.uses[ index ] ++;\n\t\t\treturn ref;\n\n\t\t}\n\n\t\t_invokeOne( func ) {\n\n\t\t\tconst extensions = Object.values( this.plugins );\n\t\t\textensions.push( this );\n\n\t\t\tfor ( let i = 0; i < extensions.length; i ++ ) {\n\n\t\t\t\tconst result = func( extensions[ i ] );\n\t\t\t\tif ( result ) return result;\n\n\t\t\t}\n\n\t\t\treturn null;\n\n\t\t}\n\n\t\t_invokeAll( func ) {\n\n\t\t\tconst extensions = Object.values( this.plugins );\n\t\t\textensions.unshift( this );\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0; i < extensions.length; i ++ ) {\n\n\t\t\t\tconst result = func( extensions[ i ] );\n\t\t\t\tif ( result ) pending.push( result );\n\n\t\t\t}\n\n\t\t\treturn pending;\n\n\t\t}\n\t\t/**\n * Requests the specified dependency asynchronously, with caching.\n * @param {string} type\n * @param {number} index\n * @return {Promise<Object3D|Material|THREE.Texture|AnimationClip|ArrayBuffer|Object>}\n */\n\n\n\t\tgetDependency( type, index ) {\n\n\t\t\tconst cacheKey = type + ':' + index;\n\t\t\tlet dependency = this.cache.get( cacheKey );\n\n\t\t\tif ( ! dependency ) {\n\n\t\t\t\tswitch ( type ) {\n\n\t\t\t\t\tcase 'scene':\n\t\t\t\t\t\tdependency = this.loadScene( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'node':\n\t\t\t\t\t\tdependency = this.loadNode( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'mesh':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadMesh && ext.loadMesh( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'accessor':\n\t\t\t\t\t\tdependency = this.loadAccessor( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'bufferView':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadBufferView && ext.loadBufferView( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'buffer':\n\t\t\t\t\t\tdependency = this.loadBuffer( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'material':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadMaterial && ext.loadMaterial( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'texture':\n\t\t\t\t\t\tdependency = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\t\t\treturn ext.loadTexture && ext.loadTexture( index );\n\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'skin':\n\t\t\t\t\t\tdependency = this.loadSkin( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'animation':\n\t\t\t\t\t\tdependency = this.loadAnimation( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'camera':\n\t\t\t\t\t\tdependency = this.loadCamera( index );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new Error( 'Unknown type: ' + type );\n\n\t\t\t\t}\n\n\t\t\t\tthis.cache.add( cacheKey, dependency );\n\n\t\t\t}\n\n\t\t\treturn dependency;\n\n\t\t}\n\t\t/**\n * Requests all dependencies of the specified type asynchronously, with caching.\n * @param {string} type\n * @return {Promise<Array<Object>>}\n */\n\n\n\t\tgetDependencies( type ) {\n\n\t\t\tlet dependencies = this.cache.get( type );\n\n\t\t\tif ( ! dependencies ) {\n\n\t\t\t\tconst parser = this;\n\t\t\t\tconst defs = this.json[ type + ( type === 'mesh' ? 'es' : 's' ) ] || [];\n\t\t\t\tdependencies = Promise.all( defs.map( function ( def, index ) {\n\n\t\t\t\t\treturn parser.getDependency( type, index );\n\n\t\t\t\t} ) );\n\t\t\t\tthis.cache.add( type, dependencies );\n\n\t\t\t}\n\n\t\t\treturn dependencies;\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views\n * @param {number} bufferIndex\n * @return {Promise<ArrayBuffer>}\n */\n\n\n\t\tloadBuffer( bufferIndex ) {\n\n\t\t\tconst bufferDef = this.json.buffers[ bufferIndex ];\n\t\t\tconst loader = this.fileLoader;\n\n\t\t\tif ( bufferDef.type && bufferDef.type !== 'arraybuffer' ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: ' + bufferDef.type + ' buffer type is not supported.' );\n\n\t\t\t} // If present, GLB container is required to be the first buffer.\n\n\n\t\t\tif ( bufferDef.uri === undefined && bufferIndex === 0 ) {\n\n\t\t\t\treturn Promise.resolve( this.extensions[ EXTENSIONS.KHR_BINARY_GLTF ].body );\n\n\t\t\t}\n\n\t\t\tconst options = this.options;\n\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\tloader.load( resolveURL( bufferDef.uri, options.path ), resolve, undefined, function () {\n\n\t\t\t\t\treject( new Error( 'THREE.GLTFLoader: Failed to load buffer \"' + bufferDef.uri + '\".' ) );\n\n\t\t\t\t} );\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#buffers-and-buffer-views\n * @param {number} bufferViewIndex\n * @return {Promise<ArrayBuffer>}\n */\n\n\n\t\tloadBufferView( bufferViewIndex ) {\n\n\t\t\tconst bufferViewDef = this.json.bufferViews[ bufferViewIndex ];\n\t\t\treturn this.getDependency( 'buffer', bufferViewDef.buffer ).then( function ( buffer ) {\n\n\t\t\t\tconst byteLength = bufferViewDef.byteLength || 0;\n\t\t\t\tconst byteOffset = bufferViewDef.byteOffset || 0;\n\t\t\t\treturn buffer.slice( byteOffset, byteOffset + byteLength );\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#accessors\n * @param {number} accessorIndex\n * @return {Promise<BufferAttribute|InterleavedBufferAttribute>}\n */\n\n\n\t\tloadAccessor( accessorIndex ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst accessorDef = this.json.accessors[ accessorIndex ];\n\n\t\t\tif ( accessorDef.bufferView === undefined && accessorDef.sparse === undefined ) {\n\n\t\t\t\t// Ignore empty accessors, which may be used to declare runtime\n\t\t\t\t// information about attributes coming from another source (e.g. Draco\n\t\t\t\t// compression extension).\n\t\t\t\treturn Promise.resolve( null );\n\n\t\t\t}\n\n\t\t\tconst pendingBufferViews = [];\n\n\t\t\tif ( accessorDef.bufferView !== undefined ) {\n\n\t\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.bufferView ) );\n\n\t\t\t} else {\n\n\t\t\t\tpendingBufferViews.push( null );\n\n\t\t\t}\n\n\t\t\tif ( accessorDef.sparse !== undefined ) {\n\n\t\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.indices.bufferView ) );\n\t\t\t\tpendingBufferViews.push( this.getDependency( 'bufferView', accessorDef.sparse.values.bufferView ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pendingBufferViews ).then( function ( bufferViews ) {\n\n\t\t\t\tconst bufferView = bufferViews[ 0 ];\n\t\t\t\tconst itemSize = WEBGL_TYPE_SIZES[ accessorDef.type ];\n\t\t\t\tconst TypedArray = WEBGL_COMPONENT_TYPES[ accessorDef.componentType ]; // For VEC3: itemSize is 3, elementBytes is 4, itemBytes is 12.\n\n\t\t\t\tconst elementBytes = TypedArray.BYTES_PER_ELEMENT;\n\t\t\t\tconst itemBytes = elementBytes * itemSize;\n\t\t\t\tconst byteOffset = accessorDef.byteOffset || 0;\n\t\t\t\tconst byteStride = accessorDef.bufferView !== undefined ? json.bufferViews[ accessorDef.bufferView ].byteStride : undefined;\n\t\t\t\tconst normalized = accessorDef.normalized === true;\n\t\t\t\tlet array, bufferAttribute; // The buffer is not interleaved if the stride is the item size in bytes.\n\n\t\t\t\tif ( byteStride && byteStride !== itemBytes ) {\n\n\t\t\t\t\t// Each \"slice\" of the buffer, as defined by 'count' elements of 'byteStride' bytes, gets its own THREE.InterleavedBuffer\n\t\t\t\t\t// This makes sure that IBA.count reflects accessor.count properly\n\t\t\t\t\tconst ibSlice = Math.floor( byteOffset / byteStride );\n\t\t\t\t\tconst ibCacheKey = 'InterleavedBuffer:' + accessorDef.bufferView + ':' + accessorDef.componentType + ':' + ibSlice + ':' + accessorDef.count;\n\t\t\t\t\tlet ib = parser.cache.get( ibCacheKey );\n\n\t\t\t\t\tif ( ! ib ) {\n\n\t\t\t\t\t\tarray = new TypedArray( bufferView, ibSlice * byteStride, accessorDef.count * byteStride / elementBytes ); // Integer parameters to IB/IBA are in array elements, not bytes.\n\n\t\t\t\t\t\tib = new THREE.InterleavedBuffer( array, byteStride / elementBytes );\n\t\t\t\t\t\tparser.cache.add( ibCacheKey, ib );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbufferAttribute = new THREE.InterleavedBufferAttribute( ib, itemSize, byteOffset % byteStride / elementBytes, normalized );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( bufferView === null ) {\n\n\t\t\t\t\t\tarray = new TypedArray( accessorDef.count * itemSize );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tarray = new TypedArray( bufferView, byteOffset, accessorDef.count * itemSize );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tbufferAttribute = new THREE.BufferAttribute( array, itemSize, normalized );\n\n\t\t\t\t} // https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#sparse-accessors\n\n\n\t\t\t\tif ( accessorDef.sparse !== undefined ) {\n\n\t\t\t\t\tconst itemSizeIndices = WEBGL_TYPE_SIZES.SCALAR;\n\t\t\t\t\tconst TypedArrayIndices = WEBGL_COMPONENT_TYPES[ accessorDef.sparse.indices.componentType ];\n\t\t\t\t\tconst byteOffsetIndices = accessorDef.sparse.indices.byteOffset || 0;\n\t\t\t\t\tconst byteOffsetValues = accessorDef.sparse.values.byteOffset || 0;\n\t\t\t\t\tconst sparseIndices = new TypedArrayIndices( bufferViews[ 1 ], byteOffsetIndices, accessorDef.sparse.count * itemSizeIndices );\n\t\t\t\t\tconst sparseValues = new TypedArray( bufferViews[ 2 ], byteOffsetValues, accessorDef.sparse.count * itemSize );\n\n\t\t\t\t\tif ( bufferView !== null ) {\n\n\t\t\t\t\t\t// Avoid modifying the original ArrayBuffer, if the bufferView wasn't initialized with zeroes.\n\t\t\t\t\t\tbufferAttribute = new THREE.BufferAttribute( bufferAttribute.array.slice(), bufferAttribute.itemSize, bufferAttribute.normalized );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let i = 0, il = sparseIndices.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tconst index = sparseIndices[ i ];\n\t\t\t\t\t\tbufferAttribute.setX( index, sparseValues[ i * itemSize ] );\n\t\t\t\t\t\tif ( itemSize >= 2 ) bufferAttribute.setY( index, sparseValues[ i * itemSize + 1 ] );\n\t\t\t\t\t\tif ( itemSize >= 3 ) bufferAttribute.setZ( index, sparseValues[ i * itemSize + 2 ] );\n\t\t\t\t\t\tif ( itemSize >= 4 ) bufferAttribute.setW( index, sparseValues[ i * itemSize + 3 ] );\n\t\t\t\t\t\tif ( itemSize >= 5 ) throw new Error( 'THREE.GLTFLoader: Unsupported itemSize in sparse THREE.BufferAttribute.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\treturn bufferAttribute;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#textures\n * @param {number} textureIndex\n * @return {Promise<THREE.Texture>}\n */\n\n\n\t\tloadTexture( textureIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst options = this.options;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\t\t\tconst source = json.images[ textureDef.source ];\n\t\t\tlet loader = this.textureLoader;\n\n\t\t\tif ( source.uri ) {\n\n\t\t\t\tconst handler = options.manager.getHandler( source.uri );\n\t\t\t\tif ( handler !== null ) loader = handler;\n\n\t\t\t}\n\n\t\t\treturn this.loadTextureImage( textureIndex, source, loader );\n\n\t\t}\n\n\t\tloadTextureImage( textureIndex, source, loader ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst options = this.options;\n\t\t\tconst textureDef = json.textures[ textureIndex ];\n\t\t\tconst cacheKey = ( source.uri || source.bufferView ) + ':' + textureDef.sampler;\n\n\t\t\tif ( this.textureCache[ cacheKey ] ) {\n\n\t\t\t\t// See https://github.com/mrdoob/three.js/issues/21559.\n\t\t\t\treturn this.textureCache[ cacheKey ];\n\n\t\t\t}\n\n\t\t\tconst URL = self.URL || self.webkitURL;\n\t\t\tlet sourceURI = source.uri || '';\n\t\t\tlet isObjectURL = false;\n\n\t\t\tif ( source.bufferView !== undefined ) {\n\n\t\t\t\t// Load binary image data from bufferView, if provided.\n\t\t\t\tsourceURI = parser.getDependency( 'bufferView', source.bufferView ).then( function ( bufferView ) {\n\n\t\t\t\t\tisObjectURL = true;\n\t\t\t\t\tconst blob = new Blob( [ bufferView ], {\n\t\t\t\t\t\ttype: source.mimeType\n\t\t\t\t\t} );\n\t\t\t\t\tsourceURI = URL.createObjectURL( blob );\n\t\t\t\t\treturn sourceURI;\n\n\t\t\t\t} );\n\n\t\t\t} else if ( source.uri === undefined ) {\n\n\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Image ' + textureIndex + ' is missing URI and bufferView' );\n\n\t\t\t}\n\n\t\t\tconst promise = Promise.resolve( sourceURI ).then( function ( sourceURI ) {\n\n\t\t\t\treturn new Promise( function ( resolve, reject ) {\n\n\t\t\t\t\tlet onLoad = resolve;\n\n\t\t\t\t\tif ( loader.isImageBitmapLoader === true ) {\n\n\t\t\t\t\t\tonLoad = function ( imageBitmap ) {\n\n\t\t\t\t\t\t\tconst texture = new THREE.Texture( imageBitmap );\n\t\t\t\t\t\t\ttexture.needsUpdate = true;\n\t\t\t\t\t\t\tresolve( texture );\n\n\t\t\t\t\t\t};\n\n\t\t\t\t\t}\n\n\t\t\t\t\tloader.load( resolveURL( sourceURI, options.path ), onLoad, undefined, reject );\n\n\t\t\t\t} );\n\n\t\t\t} ).then( function ( texture ) {\n\n\t\t\t\t// Clean up resources and configure THREE.Texture.\n\t\t\t\tif ( isObjectURL === true ) {\n\n\t\t\t\t\tURL.revokeObjectURL( sourceURI );\n\n\t\t\t\t}\n\n\t\t\t\ttexture.flipY = false;\n\t\t\t\tif ( textureDef.name ) texture.name = textureDef.name;\n\t\t\t\tconst samplers = json.samplers || {};\n\t\t\t\tconst sampler = samplers[ textureDef.sampler ] || {};\n\t\t\t\ttexture.magFilter = WEBGL_FILTERS[ sampler.magFilter ] || THREE.LinearFilter;\n\t\t\t\ttexture.minFilter = WEBGL_FILTERS[ sampler.minFilter ] || THREE.LinearMipmapLinearFilter;\n\t\t\t\ttexture.wrapS = WEBGL_WRAPPINGS[ sampler.wrapS ] || THREE.RepeatWrapping;\n\t\t\t\ttexture.wrapT = WEBGL_WRAPPINGS[ sampler.wrapT ] || THREE.RepeatWrapping;\n\t\t\t\tparser.associations.set( texture, {\n\t\t\t\t\ttextures: textureIndex\n\t\t\t\t} );\n\t\t\t\treturn texture;\n\n\t\t\t} ).catch( function () {\n\n\t\t\t\tconsole.error( 'THREE.GLTFLoader: Couldn\\'t load texture', sourceURI );\n\t\t\t\treturn null;\n\n\t\t\t} );\n\t\t\tthis.textureCache[ cacheKey ] = promise;\n\t\t\treturn promise;\n\n\t\t}\n\t\t/**\n * Asynchronously assigns a texture to the given material parameters.\n * @param {Object} materialParams\n * @param {string} mapName\n * @param {Object} mapDef\n * @return {Promise<Texture>}\n */\n\n\n\t\tassignTexture( materialParams, mapName, mapDef ) {\n\n\t\t\tconst parser = this;\n\t\t\treturn this.getDependency( 'texture', mapDef.index ).then( function ( texture ) {\n\n\t\t\t\t// Materials sample aoMap from UV set 1 and other maps from UV set 0 - this can't be configured\n\t\t\t\t// However, we will copy UV set 0 to UV set 1 on demand for aoMap\n\t\t\t\tif ( mapDef.texCoord !== undefined && mapDef.texCoord != 0 && ! ( mapName === 'aoMap' && mapDef.texCoord == 1 ) ) {\n\n\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Custom UV set ' + mapDef.texCoord + ' for texture ' + mapName + ' not yet supported.' );\n\n\t\t\t\t}\n\n\t\t\t\tif ( parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] ) {\n\n\t\t\t\t\tconst transform = mapDef.extensions !== undefined ? mapDef.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ] : undefined;\n\n\t\t\t\t\tif ( transform ) {\n\n\t\t\t\t\t\tconst gltfReference = parser.associations.get( texture );\n\t\t\t\t\t\ttexture = parser.extensions[ EXTENSIONS.KHR_TEXTURE_TRANSFORM ].extendTexture( texture, transform );\n\t\t\t\t\t\tparser.associations.set( texture, gltfReference );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tmaterialParams[ mapName ] = texture;\n\t\t\t\treturn texture;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Assigns final material to a THREE.Mesh, THREE.Line, or THREE.Points instance. The instance\n * already has a material (generated from the glTF material options alone)\n * but reuse of the same glTF material may require multiple threejs materials\n * to accommodate different primitive types, defines, etc. New materials will\n * be created if necessary, and reused from a cache.\n * @param {Object3D} mesh THREE.Mesh, THREE.Line, or THREE.Points instance.\n */\n\n\n\t\tassignFinalMaterial( mesh ) {\n\n\t\t\tconst geometry = mesh.geometry;\n\t\t\tlet material = mesh.material;\n\t\t\tconst useDerivativeTangents = geometry.attributes.tangent === undefined;\n\t\t\tconst useVertexColors = geometry.attributes.color !== undefined;\n\t\t\tconst useFlatShading = geometry.attributes.normal === undefined;\n\n\t\t\tif ( mesh.isPoints ) {\n\n\t\t\t\tconst cacheKey = 'PointsMaterial:' + material.uuid;\n\t\t\t\tlet pointsMaterial = this.cache.get( cacheKey );\n\n\t\t\t\tif ( ! pointsMaterial ) {\n\n\t\t\t\t\tpointsMaterial = new THREE.PointsMaterial();\n\t\t\t\t\tTHREE.Material.prototype.copy.call( pointsMaterial, material );\n\t\t\t\t\tpointsMaterial.color.copy( material.color );\n\t\t\t\t\tpointsMaterial.map = material.map;\n\t\t\t\t\tpointsMaterial.sizeAttenuation = false; // glTF spec says points should be 1px\n\n\t\t\t\t\tthis.cache.add( cacheKey, pointsMaterial );\n\n\t\t\t\t}\n\n\t\t\t\tmaterial = pointsMaterial;\n\n\t\t\t} else if ( mesh.isLine ) {\n\n\t\t\t\tconst cacheKey = 'LineBasicMaterial:' + material.uuid;\n\t\t\t\tlet lineMaterial = this.cache.get( cacheKey );\n\n\t\t\t\tif ( ! lineMaterial ) {\n\n\t\t\t\t\tlineMaterial = new THREE.LineBasicMaterial();\n\t\t\t\t\tTHREE.Material.prototype.copy.call( lineMaterial, material );\n\t\t\t\t\tlineMaterial.color.copy( material.color );\n\t\t\t\t\tthis.cache.add( cacheKey, lineMaterial );\n\n\t\t\t\t}\n\n\t\t\t\tmaterial = lineMaterial;\n\n\t\t\t} // Clone the material if it will be modified\n\n\n\t\t\tif ( useDerivativeTangents || useVertexColors || useFlatShading ) {\n\n\t\t\t\tlet cacheKey = 'ClonedMaterial:' + material.uuid + ':';\n\t\t\t\tif ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';\n\t\t\t\tif ( useDerivativeTangents ) cacheKey += 'derivative-tangents:';\n\t\t\t\tif ( useVertexColors ) cacheKey += 'vertex-colors:';\n\t\t\t\tif ( useFlatShading ) cacheKey += 'flat-shading:';\n\t\t\t\tlet cachedMaterial = this.cache.get( cacheKey );\n\n\t\t\t\tif ( ! cachedMaterial ) {\n\n\t\t\t\t\tcachedMaterial = material.clone();\n\t\t\t\t\tif ( useVertexColors ) cachedMaterial.vertexColors = true;\n\t\t\t\t\tif ( useFlatShading ) cachedMaterial.flatShading = true;\n\n\t\t\t\t\tif ( useDerivativeTangents ) {\n\n\t\t\t\t\t\t// https://github.com/mrdoob/three.js/issues/11438#issuecomment-507003995\n\t\t\t\t\t\tif ( cachedMaterial.normalScale ) cachedMaterial.normalScale.y *= - 1;\n\t\t\t\t\t\tif ( cachedMaterial.clearcoatNormalScale ) cachedMaterial.clearcoatNormalScale.y *= - 1;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.cache.add( cacheKey, cachedMaterial );\n\t\t\t\t\tthis.associations.set( cachedMaterial, this.associations.get( material ) );\n\n\t\t\t\t}\n\n\t\t\t\tmaterial = cachedMaterial;\n\n\t\t\t} // workarounds for mesh and geometry\n\n\n\t\t\tif ( material.aoMap && geometry.attributes.uv2 === undefined && geometry.attributes.uv !== undefined ) {\n\n\t\t\t\tgeometry.setAttribute( 'uv2', geometry.attributes.uv );\n\n\t\t\t}\n\n\t\t\tmesh.material = material;\n\n\t\t}\n\n\t\tgetMaterialType() {\n\n\t\t\treturn THREE.MeshStandardMaterial;\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#materials\n * @param {number} materialIndex\n * @return {Promise<Material>}\n */\n\n\n\t\tloadMaterial( materialIndex ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst materialDef = json.materials[ materialIndex ];\n\t\t\tlet materialType;\n\t\t\tconst materialParams = {};\n\t\t\tconst materialExtensions = materialDef.extensions || {};\n\t\t\tconst pending = [];\n\n\t\t\tif ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ] ) {\n\n\t\t\t\tconst sgExtension = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ];\n\t\t\t\tmaterialType = sgExtension.getMaterialType();\n\t\t\t\tpending.push( sgExtension.extendParams( materialParams, materialDef, parser ) );\n\n\t\t\t} else if ( materialExtensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ] ) {\n\n\t\t\t\tconst kmuExtension = extensions[ EXTENSIONS.KHR_MATERIALS_UNLIT ];\n\t\t\t\tmaterialType = kmuExtension.getMaterialType();\n\t\t\t\tpending.push( kmuExtension.extendParams( materialParams, materialDef, parser ) );\n\n\t\t\t} else {\n\n\t\t\t\t// Specification:\n\t\t\t\t// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#metallic-roughness-material\n\t\t\t\tconst metallicRoughness = materialDef.pbrMetallicRoughness || {};\n\t\t\t\tmaterialParams.color = new THREE.Color( 1.0, 1.0, 1.0 );\n\t\t\t\tmaterialParams.opacity = 1.0;\n\n\t\t\t\tif ( Array.isArray( metallicRoughness.baseColorFactor ) ) {\n\n\t\t\t\t\tconst array = metallicRoughness.baseColorFactor;\n\t\t\t\t\tmaterialParams.color.fromArray( array );\n\t\t\t\t\tmaterialParams.opacity = array[ 3 ];\n\n\t\t\t\t}\n\n\t\t\t\tif ( metallicRoughness.baseColorTexture !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'map', metallicRoughness.baseColorTexture ) );\n\n\t\t\t\t}\n\n\t\t\t\tmaterialParams.metalness = metallicRoughness.metallicFactor !== undefined ? metallicRoughness.metallicFactor : 1.0;\n\t\t\t\tmaterialParams.roughness = metallicRoughness.roughnessFactor !== undefined ? metallicRoughness.roughnessFactor : 1.0;\n\n\t\t\t\tif ( metallicRoughness.metallicRoughnessTexture !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'metalnessMap', metallicRoughness.metallicRoughnessTexture ) );\n\t\t\t\t\tpending.push( parser.assignTexture( materialParams, 'roughnessMap', metallicRoughness.metallicRoughnessTexture ) );\n\n\t\t\t\t}\n\n\t\t\t\tmaterialType = this._invokeOne( function ( ext ) {\n\n\t\t\t\t\treturn ext.getMaterialType && ext.getMaterialType( materialIndex );\n\n\t\t\t\t} );\n\t\t\t\tpending.push( Promise.all( this._invokeAll( function ( ext ) {\n\n\t\t\t\t\treturn ext.extendMaterialParams && ext.extendMaterialParams( materialIndex, materialParams );\n\n\t\t\t\t} ) ) );\n\n\t\t\t}\n\n\t\t\tif ( materialDef.doubleSided === true ) {\n\n\t\t\t\tmaterialParams.side = THREE.DoubleSide;\n\n\t\t\t}\n\n\t\t\tconst alphaMode = materialDef.alphaMode || ALPHA_MODES.OPAQUE;\n\n\t\t\tif ( alphaMode === ALPHA_MODES.BLEND ) {\n\n\t\t\t\tmaterialParams.transparent = true; // See: https://github.com/mrdoob/three.js/issues/17706\n\n\t\t\t\tmaterialParams.depthWrite = false;\n\n\t\t\t} else {\n\n\t\t\t\tmaterialParams.format = THREE.RGBFormat;\n\t\t\t\tmaterialParams.transparent = false;\n\n\t\t\t\tif ( alphaMode === ALPHA_MODES.MASK ) {\n\n\t\t\t\t\tmaterialParams.alphaTest = materialDef.alphaCutoff !== undefined ? materialDef.alphaCutoff : 0.5;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( materialDef.normalTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'normalMap', materialDef.normalTexture ) );\n\t\t\t\tmaterialParams.normalScale = new THREE.Vector2( 1, 1 );\n\n\t\t\t\tif ( materialDef.normalTexture.scale !== undefined ) {\n\n\t\t\t\t\tconst scale = materialDef.normalTexture.scale;\n\t\t\t\t\tmaterialParams.normalScale.set( scale, scale );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( materialDef.occlusionTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'aoMap', materialDef.occlusionTexture ) );\n\n\t\t\t\tif ( materialDef.occlusionTexture.strength !== undefined ) {\n\n\t\t\t\t\tmaterialParams.aoMapIntensity = materialDef.occlusionTexture.strength;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( materialDef.emissiveFactor !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tmaterialParams.emissive = new THREE.Color().fromArray( materialDef.emissiveFactor );\n\n\t\t\t}\n\n\t\t\tif ( materialDef.emissiveTexture !== undefined && materialType !== THREE.MeshBasicMaterial ) {\n\n\t\t\t\tpending.push( parser.assignTexture( materialParams, 'emissiveMap', materialDef.emissiveTexture ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\t\tlet material;\n\n\t\t\t\tif ( materialType === GLTFMeshStandardSGMaterial ) {\n\n\t\t\t\t\tmaterial = extensions[ EXTENSIONS.KHR_MATERIALS_PBR_SPECULAR_GLOSSINESS ].createMaterial( materialParams );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tmaterial = new materialType( materialParams );\n\n\t\t\t\t}\n\n\t\t\t\tif ( materialDef.name ) material.name = materialDef.name; // baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding.\n\n\t\t\t\tif ( material.map ) material.map.encoding = THREE.sRGBEncoding;\n\t\t\t\tif ( material.emissiveMap ) material.emissiveMap.encoding = THREE.sRGBEncoding;\n\t\t\t\tassignExtrasToUserData( material, materialDef );\n\t\t\t\tparser.associations.set( material, {\n\t\t\t\t\tmaterials: materialIndex\n\t\t\t\t} );\n\t\t\t\tif ( materialDef.extensions ) addUnknownExtensionsToUserData( extensions, material, materialDef );\n\t\t\t\treturn material;\n\n\t\t\t} );\n\n\t\t}\n\t\t/** When THREE.Object3D instances are targeted by animation, they need unique names. */\n\n\n\t\tcreateUniqueName( originalName ) {\n\n\t\t\tconst sanitizedName = THREE.PropertyBinding.sanitizeNodeName( originalName || '' );\n\t\t\tlet name = sanitizedName;\n\n\t\t\tfor ( let i = 1; this.nodeNamesUsed[ name ]; ++ i ) {\n\n\t\t\t\tname = sanitizedName + '_' + i;\n\n\t\t\t}\n\n\t\t\tthis.nodeNamesUsed[ name ] = true;\n\t\t\treturn name;\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#geometry\n *\n * Creates BufferGeometries from primitives.\n *\n * @param {Array<GLTF.Primitive>} primitives\n * @return {Promise<Array<BufferGeometry>>}\n */\n\n\n\t\tloadGeometries( primitives ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst cache = this.primitiveCache;\n\n\t\t\tfunction createDracoPrimitive( primitive ) {\n\n\t\t\t\treturn extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ].decodePrimitive( primitive, parser ).then( function ( geometry ) {\n\n\t\t\t\t\treturn addPrimitiveAttributes( geometry, primitive, parser );\n\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0, il = primitives.length; i < il; i ++ ) {\n\n\t\t\t\tconst primitive = primitives[ i ];\n\t\t\t\tconst cacheKey = createPrimitiveKey( primitive ); // See if we've already created this geometry\n\n\t\t\t\tconst cached = cache[ cacheKey ];\n\n\t\t\t\tif ( cached ) {\n\n\t\t\t\t\t// Use the cached geometry if it exists\n\t\t\t\t\tpending.push( cached.promise );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tlet geometryPromise;\n\n\t\t\t\t\tif ( primitive.extensions && primitive.extensions[ EXTENSIONS.KHR_DRACO_MESH_COMPRESSION ] ) {\n\n\t\t\t\t\t\t// Use DRACO geometry if available\n\t\t\t\t\t\tgeometryPromise = createDracoPrimitive( primitive );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// Otherwise create a new geometry\n\t\t\t\t\t\tgeometryPromise = addPrimitiveAttributes( new THREE.BufferGeometry(), primitive, parser );\n\n\t\t\t\t\t} // Cache this geometry\n\n\n\t\t\t\t\tcache[ cacheKey ] = {\n\t\t\t\t\t\tprimitive: primitive,\n\t\t\t\t\t\tpromise: geometryPromise\n\t\t\t\t\t};\n\t\t\t\t\tpending.push( geometryPromise );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/README.md#meshes\n * @param {number} meshIndex\n * @return {Promise<Group|Mesh|SkinnedMesh>}\n */\n\n\n\t\tloadMesh( meshIndex ) {\n\n\t\t\tconst parser = this;\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst meshDef = json.meshes[ meshIndex ];\n\t\t\tconst primitives = meshDef.primitives;\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0, il = primitives.length; i < il; i ++ ) {\n\n\t\t\t\tconst material = primitives[ i ].material === undefined ? createDefaultMaterial( this.cache ) : this.getDependency( 'material', primitives[ i ].material );\n\t\t\t\tpending.push( material );\n\n\t\t\t}\n\n\t\t\tpending.push( parser.loadGeometries( primitives ) );\n\t\t\treturn Promise.all( pending ).then( function ( results ) {\n\n\t\t\t\tconst materials = results.slice( 0, results.length - 1 );\n\t\t\t\tconst geometries = results[ results.length - 1 ];\n\t\t\t\tconst meshes = [];\n\n\t\t\t\tfor ( let i = 0, il = geometries.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst geometry = geometries[ i ];\n\t\t\t\t\tconst primitive = primitives[ i ]; // 1. create THREE.Mesh\n\n\t\t\t\t\tlet mesh;\n\t\t\t\t\tconst material = materials[ i ];\n\n\t\t\t\t\tif ( primitive.mode === WEBGL_CONSTANTS.TRIANGLES || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP || primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN || primitive.mode === undefined ) {\n\n\t\t\t\t\t\t// .isSkinnedMesh isn't in glTF spec. See ._markDefs()\n\t\t\t\t\t\tmesh = meshDef.isSkinnedMesh === true ? new THREE.SkinnedMesh( geometry, material ) : new THREE.Mesh( geometry, material );\n\n\t\t\t\t\t\tif ( mesh.isSkinnedMesh === true && ! mesh.geometry.attributes.skinWeight.normalized ) {\n\n\t\t\t\t\t\t\t// we normalize floating point skin weight array to fix malformed assets (see #15319)\n\t\t\t\t\t\t\t// it's important to skip this for non-float32 data since normalizeSkinWeights assumes non-normalized inputs\n\t\t\t\t\t\t\tmesh.normalizeSkinWeights();\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_STRIP ) {\n\n\t\t\t\t\t\t\tmesh.geometry = toTrianglesDrawMode( mesh.geometry, THREE.TriangleStripDrawMode );\n\n\t\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.TRIANGLE_FAN ) {\n\n\t\t\t\t\t\t\tmesh.geometry = toTrianglesDrawMode( mesh.geometry, THREE.TriangleFanDrawMode );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINES ) {\n\n\t\t\t\t\t\tmesh = new THREE.LineSegments( geometry, material );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_STRIP ) {\n\n\t\t\t\t\t\tmesh = new THREE.Line( geometry, material );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.LINE_LOOP ) {\n\n\t\t\t\t\t\tmesh = new THREE.LineLoop( geometry, material );\n\n\t\t\t\t\t} else if ( primitive.mode === WEBGL_CONSTANTS.POINTS ) {\n\n\t\t\t\t\t\tmesh = new THREE.Points( geometry, material );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthrow new Error( 'THREE.GLTFLoader: Primitive mode unsupported: ' + primitive.mode );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( Object.keys( mesh.geometry.morphAttributes ).length > 0 ) {\n\n\t\t\t\t\t\tupdateMorphTargets( mesh, meshDef );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmesh.name = parser.createUniqueName( meshDef.name || 'mesh_' + meshIndex );\n\t\t\t\t\tassignExtrasToUserData( mesh, meshDef );\n\t\t\t\t\tif ( primitive.extensions ) addUnknownExtensionsToUserData( extensions, mesh, primitive );\n\t\t\t\t\tparser.assignFinalMaterial( mesh );\n\t\t\t\t\tmeshes.push( mesh );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0, il = meshes.length; i < il; i ++ ) {\n\n\t\t\t\t\tparser.associations.set( meshes[ i ], {\n\t\t\t\t\t\tmeshes: meshIndex,\n\t\t\t\t\t\tprimitives: i\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\tif ( meshes.length === 1 ) {\n\n\t\t\t\t\treturn meshes[ 0 ];\n\n\t\t\t\t}\n\n\t\t\t\tconst group = new THREE.Group();\n\t\t\t\tparser.associations.set( group, {\n\t\t\t\t\tmeshes: meshIndex\n\t\t\t\t} );\n\n\t\t\t\tfor ( let i = 0, il = meshes.length; i < il; i ++ ) {\n\n\t\t\t\t\tgroup.add( meshes[ i ] );\n\n\t\t\t\t}\n\n\t\t\t\treturn group;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#cameras\n * @param {number} cameraIndex\n * @return {Promise<THREE.Camera>}\n */\n\n\n\t\tloadCamera( cameraIndex ) {\n\n\t\t\tlet camera;\n\t\t\tconst cameraDef = this.json.cameras[ cameraIndex ];\n\t\t\tconst params = cameraDef[ cameraDef.type ];\n\n\t\t\tif ( ! params ) {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing camera parameters.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tif ( cameraDef.type === 'perspective' ) {\n\n\t\t\t\tcamera = new THREE.PerspectiveCamera( THREE.MathUtils.radToDeg( params.yfov ), params.aspectRatio || 1, params.znear || 1, params.zfar || 2e6 );\n\n\t\t\t} else if ( cameraDef.type === 'orthographic' ) {\n\n\t\t\t\tcamera = new THREE.OrthographicCamera( - params.xmag, params.xmag, params.ymag, - params.ymag, params.znear, params.zfar );\n\n\t\t\t}\n\n\t\t\tif ( cameraDef.name ) camera.name = this.createUniqueName( cameraDef.name );\n\t\t\tassignExtrasToUserData( camera, cameraDef );\n\t\t\treturn Promise.resolve( camera );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#skins\n * @param {number} skinIndex\n * @return {Promise<Object>}\n */\n\n\n\t\tloadSkin( skinIndex ) {\n\n\t\t\tconst skinDef = this.json.skins[ skinIndex ];\n\t\t\tconst skinEntry = {\n\t\t\t\tjoints: skinDef.joints\n\t\t\t};\n\n\t\t\tif ( skinDef.inverseBindMatrices === undefined ) {\n\n\t\t\t\treturn Promise.resolve( skinEntry );\n\n\t\t\t}\n\n\t\t\treturn this.getDependency( 'accessor', skinDef.inverseBindMatrices ).then( function ( accessor ) {\n\n\t\t\t\tskinEntry.inverseBindMatrices = accessor;\n\t\t\t\treturn skinEntry;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animations\n * @param {number} animationIndex\n * @return {Promise<AnimationClip>}\n */\n\n\n\t\tloadAnimation( animationIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst animationDef = json.animations[ animationIndex ];\n\t\t\tconst pendingNodes = [];\n\t\t\tconst pendingInputAccessors = [];\n\t\t\tconst pendingOutputAccessors = [];\n\t\t\tconst pendingSamplers = [];\n\t\t\tconst pendingTargets = [];\n\n\t\t\tfor ( let i = 0, il = animationDef.channels.length; i < il; i ++ ) {\n\n\t\t\t\tconst channel = animationDef.channels[ i ];\n\t\t\t\tconst sampler = animationDef.samplers[ channel.sampler ];\n\t\t\t\tconst target = channel.target;\n\t\t\t\tconst name = target.node !== undefined ? target.node : target.id; // NOTE: target.id is deprecated.\n\n\t\t\t\tconst input = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.input ] : sampler.input;\n\t\t\t\tconst output = animationDef.parameters !== undefined ? animationDef.parameters[ sampler.output ] : sampler.output;\n\t\t\t\tpendingNodes.push( this.getDependency( 'node', name ) );\n\t\t\t\tpendingInputAccessors.push( this.getDependency( 'accessor', input ) );\n\t\t\t\tpendingOutputAccessors.push( this.getDependency( 'accessor', output ) );\n\t\t\t\tpendingSamplers.push( sampler );\n\t\t\t\tpendingTargets.push( target );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( [ Promise.all( pendingNodes ), Promise.all( pendingInputAccessors ), Promise.all( pendingOutputAccessors ), Promise.all( pendingSamplers ), Promise.all( pendingTargets ) ] ).then( function ( dependencies ) {\n\n\t\t\t\tconst nodes = dependencies[ 0 ];\n\t\t\t\tconst inputAccessors = dependencies[ 1 ];\n\t\t\t\tconst outputAccessors = dependencies[ 2 ];\n\t\t\t\tconst samplers = dependencies[ 3 ];\n\t\t\t\tconst targets = dependencies[ 4 ];\n\t\t\t\tconst tracks = [];\n\n\t\t\t\tfor ( let i = 0, il = nodes.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst node = nodes[ i ];\n\t\t\t\t\tconst inputAccessor = inputAccessors[ i ];\n\t\t\t\t\tconst outputAccessor = outputAccessors[ i ];\n\t\t\t\t\tconst sampler = samplers[ i ];\n\t\t\t\t\tconst target = targets[ i ];\n\t\t\t\t\tif ( node === undefined ) continue;\n\t\t\t\t\tnode.updateMatrix();\n\t\t\t\t\tnode.matrixAutoUpdate = true;\n\t\t\t\t\tlet TypedKeyframeTrack;\n\n\t\t\t\t\tswitch ( PATH_PROPERTIES[ target.path ] ) {\n\n\t\t\t\t\t\tcase PATH_PROPERTIES.weights:\n\t\t\t\t\t\t\tTypedKeyframeTrack = THREE.NumberKeyframeTrack;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase PATH_PROPERTIES.rotation:\n\t\t\t\t\t\t\tTypedKeyframeTrack = THREE.QuaternionKeyframeTrack;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase PATH_PROPERTIES.position:\n\t\t\t\t\t\tcase PATH_PROPERTIES.scale:\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tTypedKeyframeTrack = THREE.VectorKeyframeTrack;\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst targetName = node.name ? node.name : node.uuid;\n\t\t\t\t\tconst interpolation = sampler.interpolation !== undefined ? INTERPOLATION[ sampler.interpolation ] : THREE.InterpolateLinear;\n\t\t\t\t\tconst targetNames = [];\n\n\t\t\t\t\tif ( PATH_PROPERTIES[ target.path ] === PATH_PROPERTIES.weights ) {\n\n\t\t\t\t\t\t// Node may be a THREE.Group (glTF mesh with several primitives) or a THREE.Mesh.\n\t\t\t\t\t\tnode.traverse( function ( object ) {\n\n\t\t\t\t\t\t\tif ( object.isMesh === true && object.morphTargetInfluences ) {\n\n\t\t\t\t\t\t\t\ttargetNames.push( object.name ? object.name : object.uuid );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\ttargetNames.push( targetName );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tlet outputArray = outputAccessor.array;\n\n\t\t\t\t\tif ( outputAccessor.normalized ) {\n\n\t\t\t\t\t\tconst scale = getNormalizedComponentScale( outputArray.constructor );\n\t\t\t\t\t\tconst scaled = new Float32Array( outputArray.length );\n\n\t\t\t\t\t\tfor ( let j = 0, jl = outputArray.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\t\tscaled[ j ] = outputArray[ j ] * scale;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\toutputArray = scaled;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tfor ( let j = 0, jl = targetNames.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst track = new TypedKeyframeTrack( targetNames[ j ] + '.' + PATH_PROPERTIES[ target.path ], inputAccessor.array, outputArray, interpolation ); // Override interpolation with custom factory method.\n\n\t\t\t\t\t\tif ( sampler.interpolation === 'CUBICSPLINE' ) {\n\n\t\t\t\t\t\t\ttrack.createInterpolant = function InterpolantFactoryMethodGLTFCubicSpline( result ) {\n\n\t\t\t\t\t\t\t\t// A CUBICSPLINE keyframe in glTF has three output values for each input value,\n\t\t\t\t\t\t\t\t// representing inTangent, splineVertex, and outTangent. As a result, track.getValueSize()\n\t\t\t\t\t\t\t\t// must be divided by three to get the interpolant's sampleSize argument.\n\t\t\t\t\t\t\t\tconst interpolantType = this instanceof THREE.QuaternionKeyframeTrack ? GLTFCubicSplineQuaternionInterpolant : GLTFCubicSplineInterpolant;\n\t\t\t\t\t\t\t\treturn new interpolantType( this.times, this.values, this.getValueSize() / 3, result );\n\n\t\t\t\t\t\t\t}; // Mark as CUBICSPLINE. `track.getInterpolation()` doesn't support custom interpolants.\n\n\n\t\t\t\t\t\t\ttrack.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\ttracks.push( track );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tconst name = animationDef.name ? animationDef.name : 'animation_' + animationIndex;\n\t\t\t\treturn new THREE.AnimationClip( name, undefined, tracks );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tcreateNodeMesh( nodeIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst parser = this;\n\t\t\tconst nodeDef = json.nodes[ nodeIndex ];\n\t\t\tif ( nodeDef.mesh === undefined ) return null;\n\t\t\treturn parser.getDependency( 'mesh', nodeDef.mesh ).then( function ( mesh ) {\n\n\t\t\t\tconst node = parser._getNodeRef( parser.meshCache, nodeDef.mesh, mesh ); // if weights are provided on the node, override weights on the mesh.\n\n\n\t\t\t\tif ( nodeDef.weights !== undefined ) {\n\n\t\t\t\t\tnode.traverse( function ( o ) {\n\n\t\t\t\t\t\tif ( ! o.isMesh ) return;\n\n\t\t\t\t\t\tfor ( let i = 0, il = nodeDef.weights.length; i < il; i ++ ) {\n\n\t\t\t\t\t\t\to.morphTargetInfluences[ i ] = nodeDef.weights[ i ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\n\t\t\t\t}\n\n\t\t\t\treturn node;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#nodes-and-hierarchy\n * @param {number} nodeIndex\n * @return {Promise<Object3D>}\n */\n\n\n\t\tloadNode( nodeIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst parser = this;\n\t\t\tconst nodeDef = json.nodes[ nodeIndex ]; // reserve node's name before its dependencies, so the root has the intended name.\n\n\t\t\tconst nodeName = nodeDef.name ? parser.createUniqueName( nodeDef.name ) : '';\n\t\t\treturn function () {\n\n\t\t\t\tconst pending = [];\n\n\t\t\t\tconst meshPromise = parser._invokeOne( function ( ext ) {\n\n\t\t\t\t\treturn ext.createNodeMesh && ext.createNodeMesh( nodeIndex );\n\n\t\t\t\t} );\n\n\t\t\t\tif ( meshPromise ) {\n\n\t\t\t\t\tpending.push( meshPromise );\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.camera !== undefined ) {\n\n\t\t\t\t\tpending.push( parser.getDependency( 'camera', nodeDef.camera ).then( function ( camera ) {\n\n\t\t\t\t\t\treturn parser._getNodeRef( parser.cameraCache, nodeDef.camera, camera );\n\n\t\t\t\t\t} ) );\n\n\t\t\t\t}\n\n\t\t\t\tparser._invokeAll( function ( ext ) {\n\n\t\t\t\t\treturn ext.createNodeAttachment && ext.createNodeAttachment( nodeIndex );\n\n\t\t\t\t} ).forEach( function ( promise ) {\n\n\t\t\t\t\tpending.push( promise );\n\n\t\t\t\t} );\n\n\t\t\t\treturn Promise.all( pending );\n\n\t\t\t}().then( function ( objects ) {\n\n\t\t\t\tlet node; // .isBone isn't in glTF spec. See ._markDefs\n\n\t\t\t\tif ( nodeDef.isBone === true ) {\n\n\t\t\t\t\tnode = new THREE.Bone();\n\n\t\t\t\t} else if ( objects.length > 1 ) {\n\n\t\t\t\t\tnode = new THREE.Group();\n\n\t\t\t\t} else if ( objects.length === 1 ) {\n\n\t\t\t\t\tnode = objects[ 0 ];\n\n\t\t\t\t} else {\n\n\t\t\t\t\tnode = new THREE.Object3D();\n\n\t\t\t\t}\n\n\t\t\t\tif ( node !== objects[ 0 ] ) {\n\n\t\t\t\t\tfor ( let i = 0, il = objects.length; i < il; i ++ ) {\n\n\t\t\t\t\t\tnode.add( objects[ i ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( nodeDef.name ) {\n\n\t\t\t\t\tnode.userData.name = nodeDef.name;\n\t\t\t\t\tnode.name = nodeName;\n\n\t\t\t\t}\n\n\t\t\t\tassignExtrasToUserData( node, nodeDef );\n\t\t\t\tif ( nodeDef.extensions ) addUnknownExtensionsToUserData( extensions, node, nodeDef );\n\n\t\t\t\tif ( nodeDef.matrix !== undefined ) {\n\n\t\t\t\t\tconst matrix = new THREE.Matrix4();\n\t\t\t\t\tmatrix.fromArray( nodeDef.matrix );\n\t\t\t\t\tnode.applyMatrix4( matrix );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( nodeDef.translation !== undefined ) {\n\n\t\t\t\t\t\tnode.position.fromArray( nodeDef.translation );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( nodeDef.rotation !== undefined ) {\n\n\t\t\t\t\t\tnode.quaternion.fromArray( nodeDef.rotation );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( nodeDef.scale !== undefined ) {\n\n\t\t\t\t\t\tnode.scale.fromArray( nodeDef.scale );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tif ( ! parser.associations.has( node ) ) {\n\n\t\t\t\t\tparser.associations.set( node, {} );\n\n\t\t\t\t}\n\n\t\t\t\tparser.associations.get( node ).nodes = nodeIndex;\n\t\t\t\treturn node;\n\n\t\t\t} );\n\n\t\t}\n\t\t/**\n * Specification: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#scenes\n * @param {number} sceneIndex\n * @return {Promise<Group>}\n */\n\n\n\t\tloadScene( sceneIndex ) {\n\n\t\t\tconst json = this.json;\n\t\t\tconst extensions = this.extensions;\n\t\t\tconst sceneDef = this.json.scenes[ sceneIndex ];\n\t\t\tconst parser = this; // THREE.Loader returns THREE.Group, not Scene.\n\t\t\t// See: https://github.com/mrdoob/three.js/issues/18342#issuecomment-578981172\n\n\t\t\tconst scene = new THREE.Group();\n\t\t\tif ( sceneDef.name ) scene.name = parser.createUniqueName( sceneDef.name );\n\t\t\tassignExtrasToUserData( scene, sceneDef );\n\t\t\tif ( sceneDef.extensions ) addUnknownExtensionsToUserData( extensions, scene, sceneDef );\n\t\t\tconst nodeIds = sceneDef.nodes || [];\n\t\t\tconst pending = [];\n\n\t\t\tfor ( let i = 0, il = nodeIds.length; i < il; i ++ ) {\n\n\t\t\t\tpending.push( buildNodeHierarchy( nodeIds[ i ], scene, json, parser ) );\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\t\t// Removes dangling associations, associations that reference a node that\n\t\t\t\t// didn't make it into the scene.\n\t\t\t\tconst reduceAssociations = node => {\n\n\t\t\t\t\tconst reducedAssociations = new Map();\n\n\t\t\t\t\tfor ( const [ key, value ] of parser.associations ) {\n\n\t\t\t\t\t\tif ( key instanceof THREE.Material || key instanceof THREE.Texture ) {\n\n\t\t\t\t\t\t\treducedAssociations.set( key, value );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tnode.traverse( node => {\n\n\t\t\t\t\t\tconst mappings = parser.associations.get( node );\n\n\t\t\t\t\t\tif ( mappings != null ) {\n\n\t\t\t\t\t\t\treducedAssociations.set( node, mappings );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} );\n\t\t\t\t\treturn reducedAssociations;\n\n\t\t\t\t};\n\n\t\t\t\tparser.associations = reduceAssociations( scene );\n\t\t\t\treturn scene;\n\n\t\t\t} );\n\n\t\t}\n\n\t}\n\n\tfunction buildNodeHierarchy( nodeId, parentObject, json, parser ) {\n\n\t\tconst nodeDef = json.nodes[ nodeId ];\n\t\treturn parser.getDependency( 'node', nodeId ).then( function ( node ) {\n\n\t\t\tif ( nodeDef.skin === undefined ) return node; // build skeleton here as well\n\n\t\t\tlet skinEntry;\n\t\t\treturn parser.getDependency( 'skin', nodeDef.skin ).then( function ( skin ) {\n\n\t\t\t\tskinEntry = skin;\n\t\t\t\tconst pendingJoints = [];\n\n\t\t\t\tfor ( let i = 0, il = skinEntry.joints.length; i < il; i ++ ) {\n\n\t\t\t\t\tpendingJoints.push( parser.getDependency( 'node', skinEntry.joints[ i ] ) );\n\n\t\t\t\t}\n\n\t\t\t\treturn Promise.all( pendingJoints );\n\n\t\t\t} ).then( function ( jointNodes ) {\n\n\t\t\t\tnode.traverse( function ( mesh ) {\n\n\t\t\t\t\tif ( ! mesh.isMesh ) return;\n\t\t\t\t\tconst bones = [];\n\t\t\t\t\tconst boneInverses = [];\n\n\t\t\t\t\tfor ( let j = 0, jl = jointNodes.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst jointNode = jointNodes[ j ];\n\n\t\t\t\t\t\tif ( jointNode ) {\n\n\t\t\t\t\t\t\tbones.push( jointNode );\n\t\t\t\t\t\t\tconst mat = new THREE.Matrix4();\n\n\t\t\t\t\t\t\tif ( skinEntry.inverseBindMatrices !== undefined ) {\n\n\t\t\t\t\t\t\t\tmat.fromArray( skinEntry.inverseBindMatrices.array, j * 16 );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tboneInverses.push( mat );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Joint \"%s\" could not be found.', skinEntry.joints[ j ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmesh.bind( new THREE.Skeleton( bones, boneInverses ), mesh.matrixWorld );\n\n\t\t\t\t} );\n\t\t\t\treturn node;\n\n\t\t\t} );\n\n\t\t} ).then( function ( node ) {\n\n\t\t\t// build node hierachy\n\t\t\tparentObject.add( node );\n\t\t\tconst pending = [];\n\n\t\t\tif ( nodeDef.children ) {\n\n\t\t\t\tconst children = nodeDef.children;\n\n\t\t\t\tfor ( let i = 0, il = children.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst child = children[ i ];\n\t\t\t\t\tpending.push( buildNodeHierarchy( child, node, json, parser ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn Promise.all( pending );\n\n\t\t} );\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {GLTF.Primitive} primitiveDef\n * @param {GLTFParser} parser\n */\n\n\n\tfunction computeBounds( geometry, primitiveDef, parser ) {\n\n\t\tconst attributes = primitiveDef.attributes;\n\t\tconst box = new THREE.Box3();\n\n\t\tif ( attributes.POSITION !== undefined ) {\n\n\t\t\tconst accessor = parser.json.accessors[ attributes.POSITION ];\n\t\t\tconst min = accessor.min;\n\t\t\tconst max = accessor.max; // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.\n\n\t\t\tif ( min !== undefined && max !== undefined ) {\n\n\t\t\t\tbox.set( new THREE.Vector3( min[ 0 ], min[ 1 ], min[ 2 ] ), new THREE.Vector3( max[ 0 ], max[ 1 ], max[ 2 ] ) );\n\n\t\t\t\tif ( accessor.normalized ) {\n\n\t\t\t\t\tconst boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );\n\t\t\t\t\tbox.min.multiplyScalar( boxScale );\n\t\t\t\t\tbox.max.multiplyScalar( boxScale );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tconst targets = primitiveDef.targets;\n\n\t\tif ( targets !== undefined ) {\n\n\t\t\tconst maxDisplacement = new THREE.Vector3();\n\t\t\tconst vector = new THREE.Vector3();\n\n\t\t\tfor ( let i = 0, il = targets.length; i < il; i ++ ) {\n\n\t\t\t\tconst target = targets[ i ];\n\n\t\t\t\tif ( target.POSITION !== undefined ) {\n\n\t\t\t\t\tconst accessor = parser.json.accessors[ target.POSITION ];\n\t\t\t\t\tconst min = accessor.min;\n\t\t\t\t\tconst max = accessor.max; // glTF requires 'min' and 'max', but VRM (which extends glTF) currently ignores that requirement.\n\n\t\t\t\t\tif ( min !== undefined && max !== undefined ) {\n\n\t\t\t\t\t\t// we need to get max of absolute components because target weight is [-1,1]\n\t\t\t\t\t\tvector.setX( Math.max( Math.abs( min[ 0 ] ), Math.abs( max[ 0 ] ) ) );\n\t\t\t\t\t\tvector.setY( Math.max( Math.abs( min[ 1 ] ), Math.abs( max[ 1 ] ) ) );\n\t\t\t\t\t\tvector.setZ( Math.max( Math.abs( min[ 2 ] ), Math.abs( max[ 2 ] ) ) );\n\n\t\t\t\t\t\tif ( accessor.normalized ) {\n\n\t\t\t\t\t\t\tconst boxScale = getNormalizedComponentScale( WEBGL_COMPONENT_TYPES[ accessor.componentType ] );\n\t\t\t\t\t\t\tvector.multiplyScalar( boxScale );\n\n\t\t\t\t\t\t} // Note: this assumes that the sum of all weights is at most 1. This isn't quite correct - it's more conservative\n\t\t\t\t\t\t// to assume that each target can have a max weight of 1. However, for some use cases - notably, when morph targets\n\t\t\t\t\t\t// are used to implement key-frame animations and as such only two are active at a time - this results in very large\n\t\t\t\t\t\t// boxes. So for now we make a box that's sometimes a touch too small but is hopefully mostly of reasonable size.\n\n\n\t\t\t\t\t\tmaxDisplacement.max( vector );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.warn( 'THREE.GLTFLoader: Missing min/max properties for accessor POSITION.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} // As per comment above this box isn't conservative, but has a reasonable size for a very large number of morph targets.\n\n\n\t\t\tbox.expandByVector( maxDisplacement );\n\n\t\t}\n\n\t\tgeometry.boundingBox = box;\n\t\tconst sphere = new THREE.Sphere();\n\t\tbox.getCenter( sphere.center );\n\t\tsphere.radius = box.min.distanceTo( box.max ) / 2;\n\t\tgeometry.boundingSphere = sphere;\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {GLTF.Primitive} primitiveDef\n * @param {GLTFParser} parser\n * @return {Promise<BufferGeometry>}\n */\n\n\n\tfunction addPrimitiveAttributes( geometry, primitiveDef, parser ) {\n\n\t\tconst attributes = primitiveDef.attributes;\n\t\tconst pending = [];\n\n\t\tfunction assignAttributeAccessor( accessorIndex, attributeName ) {\n\n\t\t\treturn parser.getDependency( 'accessor', accessorIndex ).then( function ( accessor ) {\n\n\t\t\t\tgeometry.setAttribute( attributeName, accessor );\n\n\t\t\t} );\n\n\t\t}\n\n\t\tfor ( const gltfAttributeName in attributes ) {\n\n\t\t\tconst threeAttributeName = ATTRIBUTES[ gltfAttributeName ] || gltfAttributeName.toLowerCase(); // Skip attributes already provided by e.g. Draco extension.\n\n\t\t\tif ( threeAttributeName in geometry.attributes ) continue;\n\t\t\tpending.push( assignAttributeAccessor( attributes[ gltfAttributeName ], threeAttributeName ) );\n\n\t\t}\n\n\t\tif ( primitiveDef.indices !== undefined && ! geometry.index ) {\n\n\t\t\tconst accessor = parser.getDependency( 'accessor', primitiveDef.indices ).then( function ( accessor ) {\n\n\t\t\t\tgeometry.setIndex( accessor );\n\n\t\t\t} );\n\t\t\tpending.push( accessor );\n\n\t\t}\n\n\t\tassignExtrasToUserData( geometry, primitiveDef );\n\t\tcomputeBounds( geometry, primitiveDef, parser );\n\t\treturn Promise.all( pending ).then( function () {\n\n\t\t\treturn primitiveDef.targets !== undefined ? addMorphTargets( geometry, primitiveDef.targets, parser ) : geometry;\n\n\t\t} );\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {Number} drawMode\n * @return {BufferGeometry}\n */\n\n\n\tfunction toTrianglesDrawMode( geometry, drawMode ) {\n\n\t\tlet index = geometry.getIndex(); // generate index if not present\n\n\t\tif ( index === null ) {\n\n\t\t\tconst indices = [];\n\t\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t\tif ( position !== undefined ) {\n\n\t\t\t\tfor ( let i = 0; i < position.count; i ++ ) {\n\n\t\t\t\t\tindices.push( i );\n\n\t\t\t\t}\n\n\t\t\t\tgeometry.setIndex( indices );\n\t\t\t\tindex = geometry.getIndex();\n\n\t\t\t} else {\n\n\t\t\t\tconsole.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );\n\t\t\t\treturn geometry;\n\n\t\t\t}\n\n\t\t} //\n\n\n\t\tconst numberOfTriangles = index.count - 2;\n\t\tconst newIndices = [];\n\n\t\tif ( drawMode === THREE.TriangleFanDrawMode ) {\n\n\t\t\t// gl.TRIANGLE_FAN\n\t\t\tfor ( let i = 1; i <= numberOfTriangles; i ++ ) {\n\n\t\t\t\tnewIndices.push( index.getX( 0 ) );\n\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t// gl.TRIANGLE_STRIP\n\t\t\tfor ( let i = 0; i < numberOfTriangles; i ++ ) {\n\n\t\t\t\tif ( i % 2 === 0 ) {\n\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( newIndices.length / 3 !== numberOfTriangles ) {\n\n\t\t\tconsole.error( 'THREE.GLTFLoader.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );\n\n\t\t} // build final geometry\n\n\n\t\tconst newGeometry = geometry.clone();\n\t\tnewGeometry.setIndex( newIndices );\n\t\treturn newGeometry;\n\n\t}\n\n\tTHREE.GLTFLoader = GLTFLoader;\n\n} )();\n",
  297. "( function () {\n\n\t/**\n * Loads a Wavefront .mtl file specifying materials\n */\n\n\tclass MTLLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\n\t\t}\n\t\t/**\n * Loads and parses a MTL asset from a URL.\n *\n * @param {String} url - URL to the MTL file.\n * @param {Function} [onLoad] - Callback invoked with the loaded object.\n * @param {Function} [onProgress] - Callback for download progress.\n * @param {Function} [onError] - Callback for download errors.\n *\n * @see setPath setResourcePath\n *\n * @note In order for relative texture references to resolve correctly\n * you must call setResourcePath() explicitly prior to load.\n */\n\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst scope = this;\n\t\t\tconst path = this.path === '' ? THREE.LoaderUtils.extractUrlBase( url ) : this.path;\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tonLoad( scope.parse( text, path ) );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\tif ( onError ) {\n\n\t\t\t\t\t\tonError( e );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tsetMaterialOptions( value ) {\n\n\t\t\tthis.materialOptions = value;\n\t\t\treturn this;\n\n\t\t}\n\t\t/**\n * Parses a MTL file.\n *\n * @param {String} text - Content of MTL file\n * @return {MaterialCreator}\n *\n * @see setPath setResourcePath\n *\n * @note In order for relative texture references to resolve correctly\n * you must call setResourcePath() explicitly prior to parse.\n */\n\n\n\t\tparse( text, path ) {\n\n\t\t\tconst lines = text.split( '\\n' );\n\t\t\tlet info = {};\n\t\t\tconst delimiter_pattern = /\\s+/;\n\t\t\tconst materialsInfo = {};\n\n\t\t\tfor ( let i = 0; i < lines.length; i ++ ) {\n\n\t\t\t\tlet line = lines[ i ];\n\t\t\t\tline = line.trim();\n\n\t\t\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' ) {\n\n\t\t\t\t\t// Blank line or comment ignore\n\t\t\t\t\tcontinue;\n\n\t\t\t\t}\n\n\t\t\t\tconst pos = line.indexOf( ' ' );\n\t\t\t\tlet key = pos >= 0 ? line.substring( 0, pos ) : line;\n\t\t\t\tkey = key.toLowerCase();\n\t\t\t\tlet value = pos >= 0 ? line.substring( pos + 1 ) : '';\n\t\t\t\tvalue = value.trim();\n\n\t\t\t\tif ( key === 'newmtl' ) {\n\n\t\t\t\t\t// New material\n\t\t\t\t\tinfo = {\n\t\t\t\t\t\tname: value\n\t\t\t\t\t};\n\t\t\t\t\tmaterialsInfo[ value ] = info;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif ( key === 'ka' || key === 'kd' || key === 'ks' || key === 'ke' ) {\n\n\t\t\t\t\t\tconst ss = value.split( delimiter_pattern, 3 );\n\t\t\t\t\t\tinfo[ key ] = [ parseFloat( ss[ 0 ] ), parseFloat( ss[ 1 ] ), parseFloat( ss[ 2 ] ) ];\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tinfo[ key ] = value;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst materialCreator = new MaterialCreator( this.resourcePath || path, this.materialOptions );\n\t\t\tmaterialCreator.setCrossOrigin( this.crossOrigin );\n\t\t\tmaterialCreator.setManager( this.manager );\n\t\t\tmaterialCreator.setMaterials( materialsInfo );\n\t\t\treturn materialCreator;\n\n\t\t}\n\n\t}\n\t/**\n * Create a new MTLLoader.MaterialCreator\n * @param baseUrl - Url relative to which textures are loaded\n * @param options - Set of options on how to construct the materials\n * side: Which side to apply the material\n * THREE.FrontSide (default), THREE.BackSide, THREE.DoubleSide\n * wrap: What type of wrapping to apply for textures\n * THREE.RepeatWrapping (default), THREE.ClampToEdgeWrapping, THREE.MirroredRepeatWrapping\n * normalizeRGB: RGBs need to be normalized to 0-1 from 0-255\n * Default: false, assumed to be already normalized\n * ignoreZeroRGBs: Ignore values of RGBs (Ka,Kd,Ks) that are all 0's\n * Default: false\n * @constructor\n */\n\n\n\tclass MaterialCreator {\n\n\t\tconstructor( baseUrl = '', options = {} ) {\n\n\t\t\tthis.baseUrl = baseUrl;\n\t\t\tthis.options = options;\n\t\t\tthis.materialsInfo = {};\n\t\t\tthis.materials = {};\n\t\t\tthis.materialsArray = [];\n\t\t\tthis.nameLookup = {};\n\t\t\tthis.crossOrigin = 'anonymous';\n\t\t\tthis.side = this.options.side !== undefined ? this.options.side : THREE.FrontSide;\n\t\t\tthis.wrap = this.options.wrap !== undefined ? this.options.wrap : THREE.RepeatWrapping;\n\n\t\t}\n\n\t\tsetCrossOrigin( value ) {\n\n\t\t\tthis.crossOrigin = value;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tsetManager( value ) {\n\n\t\t\tthis.manager = value;\n\n\t\t}\n\n\t\tsetMaterials( materialsInfo ) {\n\n\t\t\tthis.materialsInfo = this.convert( materialsInfo );\n\t\t\tthis.materials = {};\n\t\t\tthis.materialsArray = [];\n\t\t\tthis.nameLookup = {};\n\n\t\t}\n\n\t\tconvert( materialsInfo ) {\n\n\t\t\tif ( ! this.options ) return materialsInfo;\n\t\t\tconst converted = {};\n\n\t\t\tfor ( const mn in materialsInfo ) {\n\n\t\t\t\t// Convert materials info into normalized form based on options\n\t\t\t\tconst mat = materialsInfo[ mn ];\n\t\t\t\tconst covmat = {};\n\t\t\t\tconverted[ mn ] = covmat;\n\n\t\t\t\tfor ( const prop in mat ) {\n\n\t\t\t\t\tlet save = true;\n\t\t\t\t\tlet value = mat[ prop ];\n\t\t\t\t\tconst lprop = prop.toLowerCase();\n\n\t\t\t\t\tswitch ( lprop ) {\n\n\t\t\t\t\t\tcase 'kd':\n\t\t\t\t\t\tcase 'ka':\n\t\t\t\t\t\tcase 'ks':\n\t\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\t\t\t\t\t\t\tif ( this.options && this.options.normalizeRGB ) {\n\n\t\t\t\t\t\t\t\tvalue = [ value[ 0 ] / 255, value[ 1 ] / 255, value[ 2 ] / 255 ];\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif ( this.options && this.options.ignoreZeroRGBs ) {\n\n\t\t\t\t\t\t\t\tif ( value[ 0 ] === 0 && value[ 1 ] === 0 && value[ 2 ] === 0 ) {\n\n\t\t\t\t\t\t\t\t\t// ignore\n\t\t\t\t\t\t\t\t\tsave = false;\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( save ) {\n\n\t\t\t\t\t\tcovmat[ lprop ] = value;\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn converted;\n\n\t\t}\n\n\t\tpreload() {\n\n\t\t\tfor ( const mn in this.materialsInfo ) {\n\n\t\t\t\tthis.create( mn );\n\n\t\t\t}\n\n\t\t}\n\n\t\tgetIndex( materialName ) {\n\n\t\t\treturn this.nameLookup[ materialName ];\n\n\t\t}\n\n\t\tgetAsArray() {\n\n\t\t\tlet index = 0;\n\n\t\t\tfor ( const mn in this.materialsInfo ) {\n\n\t\t\t\tthis.materialsArray[ index ] = this.create( mn );\n\t\t\t\tthis.nameLookup[ mn ] = index;\n\t\t\t\tindex ++;\n\n\t\t\t}\n\n\t\t\treturn this.materialsArray;\n\n\t\t}\n\n\t\tcreate( materialName ) {\n\n\t\t\tif ( this.materials[ materialName ] === undefined ) {\n\n\t\t\t\tthis.createMaterial_( materialName );\n\n\t\t\t}\n\n\t\t\treturn this.materials[ materialName ];\n\n\t\t}\n\n\t\tcreateMaterial_( materialName ) {\n\n\t\t\t// Create material\n\t\t\tconst scope = this;\n\t\t\tconst mat = this.materialsInfo[ materialName ];\n\t\t\tconst params = {\n\t\t\t\tname: materialName,\n\t\t\t\tside: this.side\n\t\t\t};\n\n\t\t\tfunction resolveURL( baseUrl, url ) {\n\n\t\t\t\tif ( typeof url !== 'string' || url === '' ) return ''; // Absolute URL\n\n\t\t\t\tif ( /^https?:\\/\\//i.test( url ) ) return url;\n\t\t\t\treturn baseUrl + url;\n\n\t\t\t}\n\n\t\t\tfunction setMapForType( mapType, value ) {\n\n\t\t\t\tif ( params[ mapType ] ) return; // Keep the first encountered texture\n\n\t\t\t\tconst texParams = scope.getTextureParams( value, params );\n\t\t\t\tconst map = scope.loadTexture( resolveURL( scope.baseUrl, texParams.url ) );\n\t\t\t\tmap.repeat.copy( texParams.scale );\n\t\t\t\tmap.offset.copy( texParams.offset );\n\t\t\t\tmap.wrapS = scope.wrap;\n\t\t\t\tmap.wrapT = scope.wrap;\n\t\t\t\tparams[ mapType ] = map;\n\n\t\t\t}\n\n\t\t\tfor ( const prop in mat ) {\n\n\t\t\t\tconst value = mat[ prop ];\n\t\t\t\tlet n;\n\t\t\t\tif ( value === '' ) continue;\n\n\t\t\t\tswitch ( prop.toLowerCase() ) {\n\n\t\t\t\t\t// Ns is material specular exponent\n\t\t\t\t\tcase 'kd':\n\t\t\t\t\t\t// Diffuse color (color under white light) using RGB values\n\t\t\t\t\t\tparams.color = new THREE.Color().fromArray( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ks':\n\t\t\t\t\t\t// Specular color (color when light is reflected from shiny surface) using RGB values\n\t\t\t\t\t\tparams.specular = new THREE.Color().fromArray( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ke':\n\t\t\t\t\t\t// Emissive using RGB values\n\t\t\t\t\t\tparams.emissive = new THREE.Color().fromArray( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_kd':\n\t\t\t\t\t\t// Diffuse texture map\n\t\t\t\t\t\tsetMapForType( 'map', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_ks':\n\t\t\t\t\t\t// Specular map\n\t\t\t\t\t\tsetMapForType( 'specularMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_ke':\n\t\t\t\t\t\t// Emissive map\n\t\t\t\t\t\tsetMapForType( 'emissiveMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'norm':\n\t\t\t\t\t\tsetMapForType( 'normalMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_bump':\n\t\t\t\t\tcase 'bump':\n\t\t\t\t\t\t// Bump texture map\n\t\t\t\t\t\tsetMapForType( 'bumpMap', value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'map_d':\n\t\t\t\t\t\t// Alpha map\n\t\t\t\t\t\tsetMapForType( 'alphaMap', value );\n\t\t\t\t\t\tparams.transparent = true;\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'ns':\n\t\t\t\t\t\t// The specular exponent (defines the focus of the specular highlight)\n\t\t\t\t\t\t// A high exponent results in a tight, concentrated highlight. Ns values normally range from 0 to 1000.\n\t\t\t\t\t\tparams.shininess = parseFloat( value );\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'd':\n\t\t\t\t\t\tn = parseFloat( value );\n\n\t\t\t\t\t\tif ( n < 1 ) {\n\n\t\t\t\t\t\t\tparams.opacity = n;\n\t\t\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'tr':\n\t\t\t\t\t\tn = parseFloat( value );\n\t\t\t\t\t\tif ( this.options && this.options.invertTrProperty ) n = 1 - n;\n\n\t\t\t\t\t\tif ( n > 0 ) {\n\n\t\t\t\t\t\t\tparams.opacity = 1 - n;\n\t\t\t\t\t\t\tparams.transparent = true;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.materials[ materialName ] = new THREE.MeshPhongMaterial( params );\n\t\t\treturn this.materials[ materialName ];\n\n\t\t}\n\n\t\tgetTextureParams( value, matParams ) {\n\n\t\t\tconst texParams = {\n\t\t\t\tscale: new THREE.Vector2( 1, 1 ),\n\t\t\t\toffset: new THREE.Vector2( 0, 0 )\n\t\t\t};\n\t\t\tconst items = value.split( /\\s+/ );\n\t\t\tlet pos;\n\t\t\tpos = items.indexOf( '-bm' );\n\n\t\t\tif ( pos >= 0 ) {\n\n\t\t\t\tmatParams.bumpScale = parseFloat( items[ pos + 1 ] );\n\t\t\t\titems.splice( pos, 2 );\n\n\t\t\t}\n\n\t\t\tpos = items.indexOf( '-s' );\n\n\t\t\tif ( pos >= 0 ) {\n\n\t\t\t\ttexParams.scale.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n\t\t\t\titems.splice( pos, 4 ); // we expect 3 parameters here!\n\n\t\t\t}\n\n\t\t\tpos = items.indexOf( '-o' );\n\n\t\t\tif ( pos >= 0 ) {\n\n\t\t\t\ttexParams.offset.set( parseFloat( items[ pos + 1 ] ), parseFloat( items[ pos + 2 ] ) );\n\t\t\t\titems.splice( pos, 4 ); // we expect 3 parameters here!\n\n\t\t\t}\n\n\t\t\ttexParams.url = items.join( ' ' ).trim();\n\t\t\treturn texParams;\n\n\t\t}\n\n\t\tloadTexture( url, mapping, onLoad, onProgress, onError ) {\n\n\t\t\tconst manager = this.manager !== undefined ? this.manager : THREE.DefaultLoadingManager;\n\t\t\tlet loader = manager.getHandler( url );\n\n\t\t\tif ( loader === null ) {\n\n\t\t\t\tloader = new THREE.TextureLoader( manager );\n\n\t\t\t}\n\n\t\t\tif ( loader.setCrossOrigin ) loader.setCrossOrigin( this.crossOrigin );\n\t\t\tconst texture = loader.load( url, onLoad, onProgress, onError );\n\t\t\tif ( mapping !== undefined ) texture.mapping = mapping;\n\t\t\treturn texture;\n\n\t\t}\n\n\t}\n\n\tTHREE.MTLLoader = MTLLoader;\n\n} )();\n",
  298. "( function () {\n\n\tconst _object_pattern = /^[og]\\s*(.+)?/; // mtllib file_reference\n\n\tconst _material_library_pattern = /^mtllib /; // usemtl material_name\n\n\tconst _material_use_pattern = /^usemtl /; // usemap map_name\n\n\tconst _map_use_pattern = /^usemap /;\n\n\tconst _vA = new THREE.Vector3();\n\n\tconst _vB = new THREE.Vector3();\n\n\tconst _vC = new THREE.Vector3();\n\n\tconst _ab = new THREE.Vector3();\n\n\tconst _cb = new THREE.Vector3();\n\n\tfunction ParserState() {\n\n\t\tconst state = {\n\t\t\tobjects: [],\n\t\t\tobject: {},\n\t\t\tvertices: [],\n\t\t\tnormals: [],\n\t\t\tcolors: [],\n\t\t\tuvs: [],\n\t\t\tmaterials: {},\n\t\t\tmaterialLibraries: [],\n\t\t\tstartObject: function ( name, fromDeclaration ) {\n\n\t\t\t\t// If the current object (initial from reset) is not from a g/o declaration in the parsed\n\t\t\t\t// file. We need to use it for the first parsed g/o to keep things in sync.\n\t\t\t\tif ( this.object && this.object.fromDeclaration === false ) {\n\n\t\t\t\t\tthis.object.name = name;\n\t\t\t\t\tthis.object.fromDeclaration = fromDeclaration !== false;\n\t\t\t\t\treturn;\n\n\t\t\t\t}\n\n\t\t\t\tconst previousMaterial = this.object && typeof this.object.currentMaterial === 'function' ? this.object.currentMaterial() : undefined;\n\n\t\t\t\tif ( this.object && typeof this.object._finalize === 'function' ) {\n\n\t\t\t\t\tthis.object._finalize( true );\n\n\t\t\t\t}\n\n\t\t\t\tthis.object = {\n\t\t\t\t\tname: name || '',\n\t\t\t\t\tfromDeclaration: fromDeclaration !== false,\n\t\t\t\t\tgeometry: {\n\t\t\t\t\t\tvertices: [],\n\t\t\t\t\t\tnormals: [],\n\t\t\t\t\t\tcolors: [],\n\t\t\t\t\t\tuvs: [],\n\t\t\t\t\t\thasUVIndices: false\n\t\t\t\t\t},\n\t\t\t\t\tmaterials: [],\n\t\t\t\t\tsmooth: true,\n\t\t\t\t\tstartMaterial: function ( name, libraries ) {\n\n\t\t\t\t\t\tconst previous = this._finalize( false ); // New usemtl declaration overwrites an inherited material, except if faces were declared\n\t\t\t\t\t\t// after the material, then it must be preserved for proper MultiMaterial continuation.\n\n\n\t\t\t\t\t\tif ( previous && ( previous.inherited || previous.groupCount <= 0 ) ) {\n\n\t\t\t\t\t\t\tthis.materials.splice( previous.index, 1 );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst material = {\n\t\t\t\t\t\t\tindex: this.materials.length,\n\t\t\t\t\t\t\tname: name || '',\n\t\t\t\t\t\t\tmtllib: Array.isArray( libraries ) && libraries.length > 0 ? libraries[ libraries.length - 1 ] : '',\n\t\t\t\t\t\t\tsmooth: previous !== undefined ? previous.smooth : this.smooth,\n\t\t\t\t\t\t\tgroupStart: previous !== undefined ? previous.groupEnd : 0,\n\t\t\t\t\t\t\tgroupEnd: - 1,\n\t\t\t\t\t\t\tgroupCount: - 1,\n\t\t\t\t\t\t\tinherited: false,\n\t\t\t\t\t\t\tclone: function ( index ) {\n\n\t\t\t\t\t\t\t\tconst cloned = {\n\t\t\t\t\t\t\t\t\tindex: typeof index === 'number' ? index : this.index,\n\t\t\t\t\t\t\t\t\tname: this.name,\n\t\t\t\t\t\t\t\t\tmtllib: this.mtllib,\n\t\t\t\t\t\t\t\t\tsmooth: this.smooth,\n\t\t\t\t\t\t\t\t\tgroupStart: 0,\n\t\t\t\t\t\t\t\t\tgroupEnd: - 1,\n\t\t\t\t\t\t\t\t\tgroupCount: - 1,\n\t\t\t\t\t\t\t\t\tinherited: false\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tcloned.clone = this.clone.bind( cloned );\n\t\t\t\t\t\t\t\treturn cloned;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\tthis.materials.push( material );\n\t\t\t\t\t\treturn material;\n\n\t\t\t\t\t},\n\t\t\t\t\tcurrentMaterial: function () {\n\n\t\t\t\t\t\tif ( this.materials.length > 0 ) {\n\n\t\t\t\t\t\t\treturn this.materials[ this.materials.length - 1 ];\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn undefined;\n\n\t\t\t\t\t},\n\t\t\t\t\t_finalize: function ( end ) {\n\n\t\t\t\t\t\tconst lastMultiMaterial = this.currentMaterial();\n\n\t\t\t\t\t\tif ( lastMultiMaterial && lastMultiMaterial.groupEnd === - 1 ) {\n\n\t\t\t\t\t\t\tlastMultiMaterial.groupEnd = this.geometry.vertices.length / 3;\n\t\t\t\t\t\t\tlastMultiMaterial.groupCount = lastMultiMaterial.groupEnd - lastMultiMaterial.groupStart;\n\t\t\t\t\t\t\tlastMultiMaterial.inherited = false;\n\n\t\t\t\t\t\t} // Ignore objects tail materials if no face declarations followed them before a new o/g started.\n\n\n\t\t\t\t\t\tif ( end && this.materials.length > 1 ) {\n\n\t\t\t\t\t\t\tfor ( let mi = this.materials.length - 1; mi >= 0; mi -- ) {\n\n\t\t\t\t\t\t\t\tif ( this.materials[ mi ].groupCount <= 0 ) {\n\n\t\t\t\t\t\t\t\t\tthis.materials.splice( mi, 1 );\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} // Guarantee at least one empty material, this makes the creation later more straight forward.\n\n\n\t\t\t\t\t\tif ( end && this.materials.length === 0 ) {\n\n\t\t\t\t\t\t\tthis.materials.push( {\n\t\t\t\t\t\t\t\tname: '',\n\t\t\t\t\t\t\t\tsmooth: this.smooth\n\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn lastMultiMaterial;\n\n\t\t\t\t\t}\n\t\t\t\t}; // Inherit previous objects material.\n\t\t\t\t// Spec tells us that a declared material must be set to all objects until a new material is declared.\n\t\t\t\t// If a usemtl declaration is encountered while this new object is being parsed, it will\n\t\t\t\t// overwrite the inherited material. Exception being that there was already face declarations\n\t\t\t\t// to the inherited material, then it will be preserved for proper MultiMaterial continuation.\n\n\t\t\t\tif ( previousMaterial && previousMaterial.name && typeof previousMaterial.clone === 'function' ) {\n\n\t\t\t\t\tconst declared = previousMaterial.clone( 0 );\n\t\t\t\t\tdeclared.inherited = true;\n\t\t\t\t\tthis.object.materials.push( declared );\n\n\t\t\t\t}\n\n\t\t\t\tthis.objects.push( this.object );\n\n\t\t\t},\n\t\t\tfinalize: function () {\n\n\t\t\t\tif ( this.object && typeof this.object._finalize === 'function' ) {\n\n\t\t\t\t\tthis.object._finalize( true );\n\n\t\t\t\t}\n\n\t\t\t},\n\t\t\tparseVertexIndex: function ( value, len ) {\n\n\t\t\t\tconst index = parseInt( value, 10 );\n\t\t\t\treturn ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n\t\t\t},\n\t\t\tparseNormalIndex: function ( value, len ) {\n\n\t\t\t\tconst index = parseInt( value, 10 );\n\t\t\t\treturn ( index >= 0 ? index - 1 : index + len / 3 ) * 3;\n\n\t\t\t},\n\t\t\tparseUVIndex: function ( value, len ) {\n\n\t\t\t\tconst index = parseInt( value, 10 );\n\t\t\t\treturn ( index >= 0 ? index - 1 : index + len / 2 ) * 2;\n\n\t\t\t},\n\t\t\taddVertex: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.vertices;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t\t},\n\t\t\taddVertexPoint: function ( a ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.vertices;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\n\t\t\t},\n\t\t\taddVertexLine: function ( a ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.vertices;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\n\t\t\t},\n\t\t\taddNormal: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.normals;\n\t\t\t\tconst dst = this.object.geometry.normals;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t\t},\n\t\t\taddFaceNormal: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.vertices;\n\t\t\t\tconst dst = this.object.geometry.normals;\n\n\t\t\t\t_vA.fromArray( src, a );\n\n\t\t\t\t_vB.fromArray( src, b );\n\n\t\t\t\t_vC.fromArray( src, c );\n\n\t\t\t\t_cb.subVectors( _vC, _vB );\n\n\t\t\t\t_ab.subVectors( _vA, _vB );\n\n\t\t\t\t_cb.cross( _ab );\n\n\t\t\t\t_cb.normalize();\n\n\t\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\t\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\t\t\t\tdst.push( _cb.x, _cb.y, _cb.z );\n\n\t\t\t},\n\t\t\taddColor: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.colors;\n\t\t\t\tconst dst = this.object.geometry.colors;\n\t\t\t\tif ( src[ a ] !== undefined ) dst.push( src[ a + 0 ], src[ a + 1 ], src[ a + 2 ] );\n\t\t\t\tif ( src[ b ] !== undefined ) dst.push( src[ b + 0 ], src[ b + 1 ], src[ b + 2 ] );\n\t\t\t\tif ( src[ c ] !== undefined ) dst.push( src[ c + 0 ], src[ c + 1 ], src[ c + 2 ] );\n\n\t\t\t},\n\t\t\taddUV: function ( a, b, c ) {\n\n\t\t\t\tconst src = this.uvs;\n\t\t\t\tconst dst = this.object.geometry.uvs;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ] );\n\t\t\t\tdst.push( src[ b + 0 ], src[ b + 1 ] );\n\t\t\t\tdst.push( src[ c + 0 ], src[ c + 1 ] );\n\n\t\t\t},\n\t\t\taddDefaultUV: function () {\n\n\t\t\t\tconst dst = this.object.geometry.uvs;\n\t\t\t\tdst.push( 0, 0 );\n\t\t\t\tdst.push( 0, 0 );\n\t\t\t\tdst.push( 0, 0 );\n\n\t\t\t},\n\t\t\taddUVLine: function ( a ) {\n\n\t\t\t\tconst src = this.uvs;\n\t\t\t\tconst dst = this.object.geometry.uvs;\n\t\t\t\tdst.push( src[ a + 0 ], src[ a + 1 ] );\n\n\t\t\t},\n\t\t\taddFace: function ( a, b, c, ua, ub, uc, na, nb, nc ) {\n\n\t\t\t\tconst vLen = this.vertices.length;\n\t\t\t\tlet ia = this.parseVertexIndex( a, vLen );\n\t\t\t\tlet ib = this.parseVertexIndex( b, vLen );\n\t\t\t\tlet ic = this.parseVertexIndex( c, vLen );\n\t\t\t\tthis.addVertex( ia, ib, ic );\n\t\t\t\tthis.addColor( ia, ib, ic ); // normals\n\n\t\t\t\tif ( na !== undefined && na !== '' ) {\n\n\t\t\t\t\tconst nLen = this.normals.length;\n\t\t\t\t\tia = this.parseNormalIndex( na, nLen );\n\t\t\t\t\tib = this.parseNormalIndex( nb, nLen );\n\t\t\t\t\tic = this.parseNormalIndex( nc, nLen );\n\t\t\t\t\tthis.addNormal( ia, ib, ic );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.addFaceNormal( ia, ib, ic );\n\n\t\t\t\t} // uvs\n\n\n\t\t\t\tif ( ua !== undefined && ua !== '' ) {\n\n\t\t\t\t\tconst uvLen = this.uvs.length;\n\t\t\t\t\tia = this.parseUVIndex( ua, uvLen );\n\t\t\t\t\tib = this.parseUVIndex( ub, uvLen );\n\t\t\t\t\tic = this.parseUVIndex( uc, uvLen );\n\t\t\t\t\tthis.addUV( ia, ib, ic );\n\t\t\t\t\tthis.object.geometry.hasUVIndices = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// add placeholder values (for inconsistent face definitions)\n\t\t\t\t\tthis.addDefaultUV();\n\n\t\t\t\t}\n\n\t\t\t},\n\t\t\taddPointGeometry: function ( vertices ) {\n\n\t\t\t\tthis.object.geometry.type = 'Points';\n\t\t\t\tconst vLen = this.vertices.length;\n\n\t\t\t\tfor ( let vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n\t\t\t\t\tconst index = this.parseVertexIndex( vertices[ vi ], vLen );\n\t\t\t\t\tthis.addVertexPoint( index );\n\t\t\t\t\tthis.addColor( index );\n\n\t\t\t\t}\n\n\t\t\t},\n\t\t\taddLineGeometry: function ( vertices, uvs ) {\n\n\t\t\t\tthis.object.geometry.type = 'Line';\n\t\t\t\tconst vLen = this.vertices.length;\n\t\t\t\tconst uvLen = this.uvs.length;\n\n\t\t\t\tfor ( let vi = 0, l = vertices.length; vi < l; vi ++ ) {\n\n\t\t\t\t\tthis.addVertexLine( this.parseVertexIndex( vertices[ vi ], vLen ) );\n\n\t\t\t\t}\n\n\t\t\t\tfor ( let uvi = 0, l = uvs.length; uvi < l; uvi ++ ) {\n\n\t\t\t\t\tthis.addUVLine( this.parseUVIndex( uvs[ uvi ], uvLen ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t};\n\t\tstate.startObject( '', false );\n\t\treturn state;\n\n\t} //\n\n\n\tclass OBJLoader extends THREE.Loader {\n\n\t\tconstructor( manager ) {\n\n\t\t\tsuper( manager );\n\t\t\tthis.materials = null;\n\n\t\t}\n\n\t\tload( url, onLoad, onProgress, onError ) {\n\n\t\t\tconst scope = this;\n\t\t\tconst loader = new THREE.FileLoader( this.manager );\n\t\t\tloader.setPath( this.path );\n\t\t\tloader.setRequestHeader( this.requestHeader );\n\t\t\tloader.setWithCredentials( this.withCredentials );\n\t\t\tloader.load( url, function ( text ) {\n\n\t\t\t\ttry {\n\n\t\t\t\t\tonLoad( scope.parse( text ) );\n\n\t\t\t\t} catch ( e ) {\n\n\t\t\t\t\tif ( onError ) {\n\n\t\t\t\t\t\tonError( e );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tconsole.error( e );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tscope.manager.itemError( url );\n\n\t\t\t\t}\n\n\t\t\t}, onProgress, onError );\n\n\t\t}\n\n\t\tsetMaterials( materials ) {\n\n\t\t\tthis.materials = materials;\n\t\t\treturn this;\n\n\t\t}\n\n\t\tparse( text ) {\n\n\t\t\tconst state = new ParserState();\n\n\t\t\tif ( text.indexOf( '\\r\\n' ) !== - 1 ) {\n\n\t\t\t\t// This is faster than String.split with regex that splits on both\n\t\t\t\ttext = text.replace( /\\r\\n/g, '\\n' );\n\n\t\t\t}\n\n\t\t\tif ( text.indexOf( '\\\\\\n' ) !== - 1 ) {\n\n\t\t\t\t// join lines separated by a line continuation character (\\)\n\t\t\t\ttext = text.replace( /\\\\\\n/g, '' );\n\n\t\t\t}\n\n\t\t\tconst lines = text.split( '\\n' );\n\t\t\tlet line = '',\n\t\t\t\tlineFirstChar = '';\n\t\t\tlet lineLength = 0;\n\t\t\tlet result = []; // Faster to just trim left side of the line. Use if available.\n\n\t\t\tconst trimLeft = typeof ''.trimLeft === 'function';\n\n\t\t\tfor ( let i = 0, l = lines.length; i < l; i ++ ) {\n\n\t\t\t\tline = lines[ i ];\n\t\t\t\tline = trimLeft ? line.trimLeft() : line.trim();\n\t\t\t\tlineLength = line.length;\n\t\t\t\tif ( lineLength === 0 ) continue;\n\t\t\t\tlineFirstChar = line.charAt( 0 ); // @todo invoke passed in handler if any\n\n\t\t\t\tif ( lineFirstChar === '#' ) continue;\n\n\t\t\t\tif ( lineFirstChar === 'v' ) {\n\n\t\t\t\t\tconst data = line.split( /\\s+/ );\n\n\t\t\t\t\tswitch ( data[ 0 ] ) {\n\n\t\t\t\t\t\tcase 'v':\n\t\t\t\t\t\t\tstate.vertices.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 3 ] ) );\n\n\t\t\t\t\t\t\tif ( data.length >= 7 ) {\n\n\t\t\t\t\t\t\t\tstate.colors.push( parseFloat( data[ 4 ] ), parseFloat( data[ 5 ] ), parseFloat( data[ 6 ] ) );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// if no colors are defined, add placeholders so color and vertex indices match\n\t\t\t\t\t\t\t\tstate.colors.push( undefined, undefined, undefined );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'vn':\n\t\t\t\t\t\t\tstate.normals.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ), parseFloat( data[ 3 ] ) );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\tcase 'vt':\n\t\t\t\t\t\t\tstate.uvs.push( parseFloat( data[ 1 ] ), parseFloat( data[ 2 ] ) );\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( lineFirstChar === 'f' ) {\n\n\t\t\t\t\tconst lineData = line.substr( 1 ).trim();\n\t\t\t\t\tconst vertexData = lineData.split( /\\s+/ );\n\t\t\t\t\tconst faceVertices = []; // Parse the face vertex data into an easy to work with format\n\n\t\t\t\t\tfor ( let j = 0, jl = vertexData.length; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst vertex = vertexData[ j ];\n\n\t\t\t\t\t\tif ( vertex.length > 0 ) {\n\n\t\t\t\t\t\t\tconst vertexParts = vertex.split( '/' );\n\t\t\t\t\t\t\tfaceVertices.push( vertexParts );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} // Draw an edge between the first vertex and all subsequent vertices to form an n-gon\n\n\n\t\t\t\t\tconst v1 = faceVertices[ 0 ];\n\n\t\t\t\t\tfor ( let j = 1, jl = faceVertices.length - 1; j < jl; j ++ ) {\n\n\t\t\t\t\t\tconst v2 = faceVertices[ j ];\n\t\t\t\t\t\tconst v3 = faceVertices[ j + 1 ];\n\t\t\t\t\t\tstate.addFace( v1[ 0 ], v2[ 0 ], v3[ 0 ], v1[ 1 ], v2[ 1 ], v3[ 1 ], v1[ 2 ], v2[ 2 ], v3[ 2 ] );\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( lineFirstChar === 'l' ) {\n\n\t\t\t\t\tconst lineParts = line.substring( 1 ).trim().split( ' ' );\n\t\t\t\t\tlet lineVertices = [];\n\t\t\t\t\tconst lineUVs = [];\n\n\t\t\t\t\tif ( line.indexOf( '/' ) === - 1 ) {\n\n\t\t\t\t\t\tlineVertices = lineParts;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tfor ( let li = 0, llen = lineParts.length; li < llen; li ++ ) {\n\n\t\t\t\t\t\t\tconst parts = lineParts[ li ].split( '/' );\n\t\t\t\t\t\t\tif ( parts[ 0 ] !== '' ) lineVertices.push( parts[ 0 ] );\n\t\t\t\t\t\t\tif ( parts[ 1 ] !== '' ) lineUVs.push( parts[ 1 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tstate.addLineGeometry( lineVertices, lineUVs );\n\n\t\t\t\t} else if ( lineFirstChar === 'p' ) {\n\n\t\t\t\t\tconst lineData = line.substr( 1 ).trim();\n\t\t\t\t\tconst pointData = lineData.split( ' ' );\n\t\t\t\t\tstate.addPointGeometry( pointData );\n\n\t\t\t\t} else if ( ( result = _object_pattern.exec( line ) ) !== null ) {\n\n\t\t\t\t\t// o object_name\n\t\t\t\t\t// or\n\t\t\t\t\t// g group_name\n\t\t\t\t\t// WORKAROUND: https://bugs.chromium.org/p/v8/issues/detail?id=2869\n\t\t\t\t\t// let name = result[ 0 ].substr( 1 ).trim();\n\t\t\t\t\tconst name = ( ' ' + result[ 0 ].substr( 1 ).trim() ).substr( 1 );\n\t\t\t\t\tstate.startObject( name );\n\n\t\t\t\t} else if ( _material_use_pattern.test( line ) ) {\n\n\t\t\t\t\t// material\n\t\t\t\t\tstate.object.startMaterial( line.substring( 7 ).trim(), state.materialLibraries );\n\n\t\t\t\t} else if ( _material_library_pattern.test( line ) ) {\n\n\t\t\t\t\t// mtl file\n\t\t\t\t\tstate.materialLibraries.push( line.substring( 7 ).trim() );\n\n\t\t\t\t} else if ( _map_use_pattern.test( line ) ) {\n\n\t\t\t\t\t// the line is parsed but ignored since the loader assumes textures are defined MTL files\n\t\t\t\t\t// (according to https://www.okino.com/conv/imp_wave.htm, 'usemap' is the old-style Wavefront texture reference method)\n\t\t\t\t\tconsole.warn( 'THREE.OBJLoader: Rendering identifier \"usemap\" not supported. Textures must be defined in MTL files.' );\n\n\t\t\t\t} else if ( lineFirstChar === 's' ) {\n\n\t\t\t\t\tresult = line.split( ' ' ); // smooth shading\n\t\t\t\t\t// @todo Handle files that have varying smooth values for a set of faces inside one geometry,\n\t\t\t\t\t// but does not define a usemtl for each face set.\n\t\t\t\t\t// This should be detected and a dummy material created (later MultiMaterial and geometry groups).\n\t\t\t\t\t// This requires some care to not create extra material on each smooth value for \"normal\" obj files.\n\t\t\t\t\t// where explicit usemtl defines geometry groups.\n\t\t\t\t\t// Example asset: examples/models/obj/cerberus/Cerberus.obj\n\n\t\t\t\t\t/*\n \t * http://paulbourke.net/dataformats/obj/\n \t * or\n \t * http://www.cs.utah.edu/~boulos/cs3505/obj_spec.pdf\n \t *\n \t * From chapter \"Grouping\" Syntax explanation \"s group_number\":\n \t * \"group_number is the smoothing group number. To turn off smoothing groups, use a value of 0 or off.\n \t * Polygonal elements use group numbers to put elements in different smoothing groups. For free-form\n \t * surfaces, smoothing groups are either turned on or off; there is no difference between values greater\n \t * than 0.\"\n \t */\n\n\t\t\t\t\tif ( result.length > 1 ) {\n\n\t\t\t\t\t\tconst value = result[ 1 ].trim().toLowerCase();\n\t\t\t\t\t\tstate.object.smooth = value !== '0' && value !== 'off';\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// ZBrush can produce \"s\" lines #11707\n\t\t\t\t\t\tstate.object.smooth = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst material = state.object.currentMaterial();\n\t\t\t\t\tif ( material ) material.smooth = state.object.smooth;\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// Handle null terminated files without exception\n\t\t\t\t\tif ( line === '\\0' ) continue;\n\t\t\t\t\tconsole.warn( 'THREE.OBJLoader: Unexpected line: \"' + line + '\"' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tstate.finalize();\n\t\t\tconst container = new THREE.Group();\n\t\t\tcontainer.materialLibraries = [].concat( state.materialLibraries );\n\t\t\tconst hasPrimitives = ! ( state.objects.length === 1 && state.objects[ 0 ].geometry.vertices.length === 0 );\n\n\t\t\tif ( hasPrimitives === true ) {\n\n\t\t\t\tfor ( let i = 0, l = state.objects.length; i < l; i ++ ) {\n\n\t\t\t\t\tconst object = state.objects[ i ];\n\t\t\t\t\tconst geometry = object.geometry;\n\t\t\t\t\tconst materials = object.materials;\n\t\t\t\t\tconst isLine = geometry.type === 'Line';\n\t\t\t\t\tconst isPoints = geometry.type === 'Points';\n\t\t\t\t\tlet hasVertexColors = false; // Skip o/g line declarations that did not follow with any faces\n\n\t\t\t\t\tif ( geometry.vertices.length === 0 ) continue;\n\t\t\t\t\tconst buffergeometry = new THREE.BufferGeometry();\n\t\t\t\t\tbuffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( geometry.vertices, 3 ) );\n\n\t\t\t\t\tif ( geometry.normals.length > 0 ) {\n\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'normal', new THREE.Float32BufferAttribute( geometry.normals, 3 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( geometry.colors.length > 0 ) {\n\n\t\t\t\t\t\thasVertexColors = true;\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( geometry.colors, 3 ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( geometry.hasUVIndices === true ) {\n\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( geometry.uvs, 2 ) );\n\n\t\t\t\t\t} // Create materials\n\n\n\t\t\t\t\tconst createdMaterials = [];\n\n\t\t\t\t\tfor ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {\n\n\t\t\t\t\t\tconst sourceMaterial = materials[ mi ];\n\t\t\t\t\t\tconst materialHash = sourceMaterial.name + '_' + sourceMaterial.smooth + '_' + hasVertexColors;\n\t\t\t\t\t\tlet material = state.materials[ materialHash ];\n\n\t\t\t\t\t\tif ( this.materials !== null ) {\n\n\t\t\t\t\t\t\tmaterial = this.materials.create( sourceMaterial.name ); // mtl etc. loaders probably can't create line materials correctly, copy properties to a line material.\n\n\t\t\t\t\t\t\tif ( isLine && material && ! ( material instanceof THREE.LineBasicMaterial ) ) {\n\n\t\t\t\t\t\t\t\tconst materialLine = new THREE.LineBasicMaterial();\n\t\t\t\t\t\t\t\tTHREE.Material.prototype.copy.call( materialLine, material );\n\t\t\t\t\t\t\t\tmaterialLine.color.copy( material.color );\n\t\t\t\t\t\t\t\tmaterial = materialLine;\n\n\t\t\t\t\t\t\t} else if ( isPoints && material && ! ( material instanceof THREE.PointsMaterial ) ) {\n\n\t\t\t\t\t\t\t\tconst materialPoints = new THREE.PointsMaterial( {\n\t\t\t\t\t\t\t\t\tsize: 10,\n\t\t\t\t\t\t\t\t\tsizeAttenuation: false\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\tTHREE.Material.prototype.copy.call( materialPoints, material );\n\t\t\t\t\t\t\t\tmaterialPoints.color.copy( material.color );\n\t\t\t\t\t\t\t\tmaterialPoints.map = material.map;\n\t\t\t\t\t\t\t\tmaterial = materialPoints;\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( material === undefined ) {\n\n\t\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.LineBasicMaterial();\n\n\t\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.PointsMaterial( {\n\t\t\t\t\t\t\t\t\tsize: 1,\n\t\t\t\t\t\t\t\t\tsizeAttenuation: false\n\t\t\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\tmaterial = new THREE.MeshPhongMaterial();\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tmaterial.name = sourceMaterial.name;\n\t\t\t\t\t\t\tmaterial.flatShading = sourceMaterial.smooth ? false : true;\n\t\t\t\t\t\t\tmaterial.vertexColors = hasVertexColors;\n\t\t\t\t\t\t\tstate.materials[ materialHash ] = material;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcreatedMaterials.push( material );\n\n\t\t\t\t\t} // Create mesh\n\n\n\t\t\t\t\tlet mesh;\n\n\t\t\t\t\tif ( createdMaterials.length > 1 ) {\n\n\t\t\t\t\t\tfor ( let mi = 0, miLen = materials.length; mi < miLen; mi ++ ) {\n\n\t\t\t\t\t\t\tconst sourceMaterial = materials[ mi ];\n\t\t\t\t\t\t\tbuffergeometry.addGroup( sourceMaterial.groupStart, sourceMaterial.groupCount, mi );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.LineSegments( buffergeometry, createdMaterials );\n\n\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.Points( buffergeometry, createdMaterials );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tmesh = new THREE.Mesh( buffergeometry, createdMaterials );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tif ( isLine ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.LineSegments( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t\t} else if ( isPoints ) {\n\n\t\t\t\t\t\t\tmesh = new THREE.Points( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\tmesh = new THREE.Mesh( buffergeometry, createdMaterials[ 0 ] );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tmesh.name = object.name;\n\t\t\t\t\tcontainer.add( mesh );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// if there is only the default parser state object with no geometry data, interpret data as point cloud\n\t\t\t\tif ( state.vertices.length > 0 ) {\n\n\t\t\t\t\tconst material = new THREE.PointsMaterial( {\n\t\t\t\t\t\tsize: 1,\n\t\t\t\t\t\tsizeAttenuation: false\n\t\t\t\t\t} );\n\t\t\t\t\tconst buffergeometry = new THREE.BufferGeometry();\n\t\t\t\t\tbuffergeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( state.vertices, 3 ) );\n\n\t\t\t\t\tif ( state.colors.length > 0 && state.colors[ 0 ] !== undefined ) {\n\n\t\t\t\t\t\tbuffergeometry.setAttribute( 'color', new THREE.Float32BufferAttribute( state.colors, 3 ) );\n\t\t\t\t\t\tmaterial.vertexColors = true;\n\n\t\t\t\t\t}\n\n\t\t\t\t\tconst points = new THREE.Points( buffergeometry, material );\n\t\t\t\t\tcontainer.add( points );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\treturn container;\n\n\t\t}\n\n\t}\n\n\tTHREE.OBJLoader = OBJLoader;\n\n} )();\n",
  299. "( function () {\n\n\tfunction computeTangents( geometry ) {\n\n\t\tgeometry.computeTangents();\n\t\tconsole.warn( 'THREE.BufferGeometryUtils: .computeTangents() has been removed. Use THREE.BufferGeometry.computeTangents() instead.' );\n\n\t}\n\t/**\n\t * @param {Array<BufferGeometry>} geometries\n\t * @param {Boolean} useGroups\n\t * @return {BufferGeometry}\n\t */\n\n\n\tfunction mergeBufferGeometries( geometries, useGroups = false ) {\n\n\t\tconst isIndexed = geometries[ 0 ].index !== null;\n\t\tconst attributesUsed = new Set( Object.keys( geometries[ 0 ].attributes ) );\n\t\tconst morphAttributesUsed = new Set( Object.keys( geometries[ 0 ].morphAttributes ) );\n\t\tconst attributes = {};\n\t\tconst morphAttributes = {};\n\t\tconst morphTargetsRelative = geometries[ 0 ].morphTargetsRelative;\n\t\tconst mergedGeometry = new THREE.BufferGeometry();\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\t\tconst geometry = geometries[ i ];\n\t\t\tlet attributesCount = 0; // ensure that all geometries are indexed, or none\n\n\t\t\tif ( isIndexed !== ( geometry.index !== null ) ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them.' );\n\t\t\t\treturn null;\n\n\t\t\t} // gather attributes, exit early if they're different\n\n\n\t\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\t\tif ( ! attributesUsed.has( name ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. All geometries must have compatible attributes; make sure \"' + name + '\" attribute exists among all geometries, or in none of them.' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tif ( attributes[ name ] === undefined ) attributes[ name ] = [];\n\t\t\t\tattributes[ name ].push( geometry.attributes[ name ] );\n\t\t\t\tattributesCount ++;\n\n\t\t\t} // ensure geometries have the same number of attributes\n\n\n\t\t\tif ( attributesCount !== attributesUsed.size ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. Make sure all geometries have the same number of attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t} // gather morph attributes, exit early if they're different\n\n\n\t\t\tif ( morphTargetsRelative !== geometry.morphTargetsRelative ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphTargetsRelative must be consistent throughout all geometries.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tfor ( const name in geometry.morphAttributes ) {\n\n\t\t\t\tif ( ! morphAttributesUsed.has( name ) ) {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. .morphAttributes must be consistent throughout all geometries.' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tif ( morphAttributes[ name ] === undefined ) morphAttributes[ name ] = [];\n\t\t\t\tmorphAttributes[ name ].push( geometry.morphAttributes[ name ] );\n\n\t\t\t} // gather .userData\n\n\n\t\t\tmergedGeometry.userData.mergedUserData = mergedGeometry.userData.mergedUserData || [];\n\t\t\tmergedGeometry.userData.mergedUserData.push( geometry.userData );\n\n\t\t\tif ( useGroups ) {\n\n\t\t\t\tlet count;\n\n\t\t\t\tif ( isIndexed ) {\n\n\t\t\t\t\tcount = geometry.index.count;\n\n\t\t\t\t} else if ( geometry.attributes.position !== undefined ) {\n\n\t\t\t\t\tcount = geometry.attributes.position.count;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index ' + i + '. The geometry must have either an index or a position attribute' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tmergedGeometry.addGroup( offset, count, i );\n\t\t\t\toffset += count;\n\n\t\t\t}\n\n\t\t} // merge indices\n\n\n\t\tif ( isIndexed ) {\n\n\t\t\tlet indexOffset = 0;\n\t\t\tconst mergedIndex = [];\n\n\t\t\tfor ( let i = 0; i < geometries.length; ++ i ) {\n\n\t\t\t\tconst index = geometries[ i ].index;\n\n\t\t\t\tfor ( let j = 0; j < index.count; ++ j ) {\n\n\t\t\t\t\tmergedIndex.push( index.getX( j ) + indexOffset );\n\n\t\t\t\t}\n\n\t\t\t\tindexOffset += geometries[ i ].attributes.position.count;\n\n\t\t\t}\n\n\t\t\tmergedGeometry.setIndex( mergedIndex );\n\n\t\t} // merge attributes\n\n\n\t\tfor ( const name in attributes ) {\n\n\t\t\tconst mergedAttribute = mergeBufferAttributes( attributes[ name ] );\n\n\t\t\tif ( ! mergedAttribute ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + name + ' attribute.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tmergedGeometry.setAttribute( name, mergedAttribute );\n\n\t\t} // merge morph attributes\n\n\n\t\tfor ( const name in morphAttributes ) {\n\n\t\t\tconst numMorphTargets = morphAttributes[ name ][ 0 ].length;\n\t\t\tif ( numMorphTargets === 0 ) break;\n\t\t\tmergedGeometry.morphAttributes = mergedGeometry.morphAttributes || {};\n\t\t\tmergedGeometry.morphAttributes[ name ] = [];\n\n\t\t\tfor ( let i = 0; i < numMorphTargets; ++ i ) {\n\n\t\t\t\tconst morphAttributesToMerge = [];\n\n\t\t\t\tfor ( let j = 0; j < morphAttributes[ name ].length; ++ j ) {\n\n\t\t\t\t\tmorphAttributesToMerge.push( morphAttributes[ name ][ j ][ i ] );\n\n\t\t\t\t}\n\n\t\t\t\tconst mergedMorphAttribute = mergeBufferAttributes( morphAttributesToMerge );\n\n\t\t\t\tif ( ! mergedMorphAttribute ) {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferGeometries() failed while trying to merge the ' + name + ' morphAttribute.' );\n\t\t\t\t\treturn null;\n\n\t\t\t\t}\n\n\t\t\t\tmergedGeometry.morphAttributes[ name ].push( mergedMorphAttribute );\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn mergedGeometry;\n\n\t}\n\t/**\n * @param {Array<BufferAttribute>} attributes\n * @return {BufferAttribute}\n */\n\n\n\tfunction mergeBufferAttributes( attributes ) {\n\n\t\tlet TypedArray;\n\t\tlet itemSize;\n\t\tlet normalized;\n\t\tlet arrayLength = 0;\n\n\t\tfor ( let i = 0; i < attributes.length; ++ i ) {\n\n\t\t\tconst attribute = attributes[ i ];\n\n\t\t\tif ( attribute.isInterleavedBufferAttribute ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. InterleavedBufferAttributes are not supported.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( TypedArray === undefined ) TypedArray = attribute.array.constructor;\n\n\t\t\tif ( TypedArray !== attribute.array.constructor ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.array must be of consistent array types across matching attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( itemSize === undefined ) itemSize = attribute.itemSize;\n\n\t\t\tif ( itemSize !== attribute.itemSize ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.itemSize must be consistent across matching attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tif ( normalized === undefined ) normalized = attribute.normalized;\n\n\t\t\tif ( normalized !== attribute.normalized ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. THREE.BufferAttribute.normalized must be consistent across matching attributes.' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tarrayLength += attribute.array.length;\n\n\t\t}\n\n\t\tconst array = new TypedArray( arrayLength );\n\t\tlet offset = 0;\n\n\t\tfor ( let i = 0; i < attributes.length; ++ i ) {\n\n\t\t\tarray.set( attributes[ i ].array, offset );\n\t\t\toffset += attributes[ i ].array.length;\n\n\t\t}\n\n\t\treturn new THREE.BufferAttribute( array, itemSize, normalized );\n\n\t}\n\t/**\n * @param {Array<BufferAttribute>} attributes\n * @return {Array<InterleavedBufferAttribute>}\n */\n\n\n\tfunction interleaveAttributes( attributes ) {\n\n\t\t// Interleaves the provided attributes into an THREE.InterleavedBuffer and returns\n\t\t// a set of InterleavedBufferAttributes for each attribute\n\t\tlet TypedArray;\n\t\tlet arrayLength = 0;\n\t\tlet stride = 0; // calculate the the length and type of the interleavedBuffer\n\n\t\tfor ( let i = 0, l = attributes.length; i < l; ++ i ) {\n\n\t\t\tconst attribute = attributes[ i ];\n\t\t\tif ( TypedArray === undefined ) TypedArray = attribute.array.constructor;\n\n\t\t\tif ( TypedArray !== attribute.array.constructor ) {\n\n\t\t\t\tconsole.error( 'AttributeBuffers of different types cannot be interleaved' );\n\t\t\t\treturn null;\n\n\t\t\t}\n\n\t\t\tarrayLength += attribute.array.length;\n\t\t\tstride += attribute.itemSize;\n\n\t\t} // Create the set of buffer attributes\n\n\n\t\tconst interleavedBuffer = new THREE.InterleavedBuffer( new TypedArray( arrayLength ), stride );\n\t\tlet offset = 0;\n\t\tconst res = [];\n\t\tconst getters = [ 'getX', 'getY', 'getZ', 'getW' ];\n\t\tconst setters = [ 'setX', 'setY', 'setZ', 'setW' ];\n\n\t\tfor ( let j = 0, l = attributes.length; j < l; j ++ ) {\n\n\t\t\tconst attribute = attributes[ j ];\n\t\t\tconst itemSize = attribute.itemSize;\n\t\t\tconst count = attribute.count;\n\t\t\tconst iba = new THREE.InterleavedBufferAttribute( interleavedBuffer, itemSize, offset, attribute.normalized );\n\t\t\tres.push( iba );\n\t\t\toffset += itemSize; // Move the data for each attribute into the new interleavedBuffer\n\t\t\t// at the appropriate offset\n\n\t\t\tfor ( let c = 0; c < count; c ++ ) {\n\n\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\tiba[ setters[ k ] ]( c, attribute[ getters[ k ] ]( c ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn res;\n\n\t}\n\t/**\n * @param {Array<BufferGeometry>} geometry\n * @return {number}\n */\n\n\n\tfunction estimateBytesUsed( geometry ) {\n\n\t\t// Return the estimated memory used by this geometry in bytes\n\t\t// Calculate using itemSize, count, and BYTES_PER_ELEMENT to account\n\t\t// for InterleavedBufferAttributes.\n\t\tlet mem = 0;\n\n\t\tfor ( const name in geometry.attributes ) {\n\n\t\t\tconst attr = geometry.getAttribute( name );\n\t\t\tmem += attr.count * attr.itemSize * attr.array.BYTES_PER_ELEMENT;\n\n\t\t}\n\n\t\tconst indices = geometry.getIndex();\n\t\tmem += indices ? indices.count * indices.itemSize * indices.array.BYTES_PER_ELEMENT : 0;\n\t\treturn mem;\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {number} tolerance\n * @return {BufferGeometry>}\n */\n\n\n\tfunction mergeVertices( geometry, tolerance = 1e-4 ) {\n\n\t\ttolerance = Math.max( tolerance, Number.EPSILON ); // Generate an index buffer if the geometry doesn't have one, or optimize it\n\t\t// if it's already available.\n\n\t\tconst hashToIndex = {};\n\t\tconst indices = geometry.getIndex();\n\t\tconst positions = geometry.getAttribute( 'position' );\n\t\tconst vertexCount = indices ? indices.count : positions.count; // next value for triangle indices\n\n\t\tlet nextIndex = 0; // attributes and new attribute arrays\n\n\t\tconst attributeNames = Object.keys( geometry.attributes );\n\t\tconst attrArrays = {};\n\t\tconst morphAttrsArrays = {};\n\t\tconst newIndices = [];\n\t\tconst getters = [ 'getX', 'getY', 'getZ', 'getW' ]; // initialize the arrays\n\n\t\tfor ( let i = 0, l = attributeNames.length; i < l; i ++ ) {\n\n\t\t\tconst name = attributeNames[ i ];\n\t\t\tattrArrays[ name ] = [];\n\t\t\tconst morphAttr = geometry.morphAttributes[ name ];\n\n\t\t\tif ( morphAttr ) {\n\n\t\t\t\tmorphAttrsArrays[ name ] = new Array( morphAttr.length ).fill().map( () => [] );\n\n\t\t\t}\n\n\t\t} // convert the error tolerance to an amount of decimal places to truncate to\n\n\n\t\tconst decimalShift = Math.log10( 1 / tolerance );\n\t\tconst shiftMultiplier = Math.pow( 10, decimalShift );\n\n\t\tfor ( let i = 0; i < vertexCount; i ++ ) {\n\n\t\t\tconst index = indices ? indices.getX( i ) : i; // Generate a hash for the vertex attributes at the current index 'i'\n\n\t\t\tlet hash = '';\n\n\t\t\tfor ( let j = 0, l = attributeNames.length; j < l; j ++ ) {\n\n\t\t\t\tconst name = attributeNames[ j ];\n\t\t\t\tconst attribute = geometry.getAttribute( name );\n\t\t\t\tconst itemSize = attribute.itemSize;\n\n\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\t// double tilde truncates the decimal value\n\t\t\t\t\thash += `${~ ~ ( attribute[ getters[ k ] ]( index ) * shiftMultiplier )},`;\n\n\t\t\t\t}\n\n\t\t\t} // Add another reference to the vertex if it's already\n\t\t\t// used by another index\n\n\n\t\t\tif ( hash in hashToIndex ) {\n\n\t\t\t\tnewIndices.push( hashToIndex[ hash ] );\n\n\t\t\t} else {\n\n\t\t\t\t// copy data to the new index in the attribute arrays\n\t\t\t\tfor ( let j = 0, l = attributeNames.length; j < l; j ++ ) {\n\n\t\t\t\t\tconst name = attributeNames[ j ];\n\t\t\t\t\tconst attribute = geometry.getAttribute( name );\n\t\t\t\t\tconst morphAttr = geometry.morphAttributes[ name ];\n\t\t\t\t\tconst itemSize = attribute.itemSize;\n\t\t\t\t\tconst newarray = attrArrays[ name ];\n\t\t\t\t\tconst newMorphArrays = morphAttrsArrays[ name ];\n\n\t\t\t\t\tfor ( let k = 0; k < itemSize; k ++ ) {\n\n\t\t\t\t\t\tconst getterFunc = getters[ k ];\n\t\t\t\t\t\tnewarray.push( attribute[ getterFunc ]( index ) );\n\n\t\t\t\t\t\tif ( morphAttr ) {\n\n\t\t\t\t\t\t\tfor ( let m = 0, ml = morphAttr.length; m < ml; m ++ ) {\n\n\t\t\t\t\t\t\t\tnewMorphArrays[ m ].push( morphAttr[ m ][ getterFunc ]( index ) );\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\thashToIndex[ hash ] = nextIndex;\n\t\t\t\tnewIndices.push( nextIndex );\n\t\t\t\tnextIndex ++;\n\n\t\t\t}\n\n\t\t} // Generate typed arrays from new attribute arrays and update\n\t\t// the attributeBuffers\n\n\n\t\tconst result = geometry.clone();\n\n\t\tfor ( let i = 0, l = attributeNames.length; i < l; i ++ ) {\n\n\t\t\tconst name = attributeNames[ i ];\n\t\t\tconst oldAttribute = geometry.getAttribute( name );\n\t\t\tconst buffer = new oldAttribute.array.constructor( attrArrays[ name ] );\n\t\t\tconst attribute = new THREE.BufferAttribute( buffer, oldAttribute.itemSize, oldAttribute.normalized );\n\t\t\tresult.setAttribute( name, attribute ); // Update the attribute arrays\n\n\t\t\tif ( name in morphAttrsArrays ) {\n\n\t\t\t\tfor ( let j = 0; j < morphAttrsArrays[ name ].length; j ++ ) {\n\n\t\t\t\t\tconst oldMorphAttribute = geometry.morphAttributes[ name ][ j ];\n\t\t\t\t\tconst buffer = new oldMorphAttribute.array.constructor( morphAttrsArrays[ name ][ j ] );\n\t\t\t\t\tconst morphAttribute = new THREE.BufferAttribute( buffer, oldMorphAttribute.itemSize, oldMorphAttribute.normalized );\n\t\t\t\t\tresult.morphAttributes[ name ][ j ] = morphAttribute;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} // indices\n\n\n\t\tresult.setIndex( newIndices );\n\t\treturn result;\n\n\t}\n\t/**\n * @param {BufferGeometry} geometry\n * @param {number} drawMode\n * @return {BufferGeometry>}\n */\n\n\n\tfunction toTrianglesDrawMode( geometry, drawMode ) {\n\n\t\tif ( drawMode === THREE.TrianglesDrawMode ) {\n\n\t\t\tconsole.warn( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles.' );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t\tif ( drawMode === THREE.TriangleFanDrawMode || drawMode === THREE.TriangleStripDrawMode ) {\n\n\t\t\tlet index = geometry.getIndex(); // generate index if not present\n\n\t\t\tif ( index === null ) {\n\n\t\t\t\tconst indices = [];\n\t\t\t\tconst position = geometry.getAttribute( 'position' );\n\n\t\t\t\tif ( position !== undefined ) {\n\n\t\t\t\t\tfor ( let i = 0; i < position.count; i ++ ) {\n\n\t\t\t\t\t\tindices.push( i );\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeometry.setIndex( indices );\n\t\t\t\t\tindex = geometry.getIndex();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible.' );\n\t\t\t\t\treturn geometry;\n\n\t\t\t\t}\n\n\t\t\t} //\n\n\n\t\t\tconst numberOfTriangles = index.count - 2;\n\t\t\tconst newIndices = [];\n\n\t\t\tif ( drawMode === THREE.TriangleFanDrawMode ) {\n\n\t\t\t\t// gl.TRIANGLE_FAN\n\t\t\t\tfor ( let i = 1; i <= numberOfTriangles; i ++ ) {\n\n\t\t\t\t\tnewIndices.push( index.getX( 0 ) );\n\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// gl.TRIANGLE_STRIP\n\t\t\t\tfor ( let i = 0; i < numberOfTriangles; i ++ ) {\n\n\t\t\t\t\tif ( i % 2 === 0 ) {\n\n\t\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 2 ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i + 1 ) );\n\t\t\t\t\t\tnewIndices.push( index.getX( i ) );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( newIndices.length / 3 !== numberOfTriangles ) {\n\n\t\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.' );\n\n\t\t\t} // build final geometry\n\n\n\t\t\tconst newGeometry = geometry.clone();\n\t\t\tnewGeometry.setIndex( newIndices );\n\t\t\tnewGeometry.clearGroups();\n\t\t\treturn newGeometry;\n\n\t\t} else {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:', drawMode );\n\t\t\treturn geometry;\n\n\t\t}\n\n\t}\n\t/**\n * Calculates the morphed attributes of a morphed/skinned THREE.BufferGeometry.\n * Helpful for Raytracing or Decals.\n * @param {Mesh | Line | Points} object An instance of Mesh, Line or Points.\n * @return {Object} An Object with original position/normal attributes and morphed ones.\n */\n\n\n\tfunction computeMorphedAttributes( object ) {\n\n\t\tif ( object.geometry.isBufferGeometry !== true ) {\n\n\t\t\tconsole.error( 'THREE.BufferGeometryUtils: Geometry is not of type THREE.BufferGeometry.' );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst _vA = new THREE.Vector3();\n\n\t\tconst _vB = new THREE.Vector3();\n\n\t\tconst _vC = new THREE.Vector3();\n\n\t\tconst _tempA = new THREE.Vector3();\n\n\t\tconst _tempB = new THREE.Vector3();\n\n\t\tconst _tempC = new THREE.Vector3();\n\n\t\tconst _morphA = new THREE.Vector3();\n\n\t\tconst _morphB = new THREE.Vector3();\n\n\t\tconst _morphC = new THREE.Vector3();\n\n\t\tfunction _calculateMorphedAttributeData( object, material, attribute, morphAttribute, morphTargetsRelative, a, b, c, modifiedAttributeArray ) {\n\n\t\t\t_vA.fromBufferAttribute( attribute, a );\n\n\t\t\t_vB.fromBufferAttribute( attribute, b );\n\n\t\t\t_vC.fromBufferAttribute( attribute, c );\n\n\t\t\tconst morphInfluences = object.morphTargetInfluences;\n\n\t\t\tif ( material.morphTargets && morphAttribute && morphInfluences ) {\n\n\t\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\t\t_morphB.set( 0, 0, 0 );\n\n\t\t\t\t_morphC.set( 0, 0, 0 );\n\n\t\t\t\tfor ( let i = 0, il = morphAttribute.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\t\tconst morph = morphAttribute[ i ];\n\t\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t\t_tempA.fromBufferAttribute( morph, a );\n\n\t\t\t\t\t_tempB.fromBufferAttribute( morph, b );\n\n\t\t\t\t\t_tempC.fromBufferAttribute( morph, c );\n\n\t\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t\t\t_morphB.addScaledVector( _tempB, influence );\n\n\t\t\t\t\t\t_morphC.addScaledVector( _tempC, influence );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( _vA ), influence );\n\n\t\t\t\t\t\t_morphB.addScaledVector( _tempB.sub( _vB ), influence );\n\n\t\t\t\t\t\t_morphC.addScaledVector( _tempC.sub( _vC ), influence );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t_vA.add( _morphA );\n\n\t\t\t\t_vB.add( _morphB );\n\n\t\t\t\t_vC.add( _morphC );\n\n\t\t\t}\n\n\t\t\tif ( object.isSkinnedMesh ) {\n\n\t\t\t\tobject.boneTransform( a, _vA );\n\t\t\t\tobject.boneTransform( b, _vB );\n\t\t\t\tobject.boneTransform( c, _vC );\n\n\t\t\t}\n\n\t\t\tmodifiedAttributeArray[ a * 3 + 0 ] = _vA.x;\n\t\t\tmodifiedAttributeArray[ a * 3 + 1 ] = _vA.y;\n\t\t\tmodifiedAttributeArray[ a * 3 + 2 ] = _vA.z;\n\t\t\tmodifiedAttributeArray[ b * 3 + 0 ] = _vB.x;\n\t\t\tmodifiedAttributeArray[ b * 3 + 1 ] = _vB.y;\n\t\t\tmodifiedAttributeArray[ b * 3 + 2 ] = _vB.z;\n\t\t\tmodifiedAttributeArray[ c * 3 + 0 ] = _vC.x;\n\t\t\tmodifiedAttributeArray[ c * 3 + 1 ] = _vC.y;\n\t\t\tmodifiedAttributeArray[ c * 3 + 2 ] = _vC.z;\n\n\t\t}\n\n\t\tconst geometry = object.geometry;\n\t\tconst material = object.material;\n\t\tlet a, b, c;\n\t\tconst index = geometry.index;\n\t\tconst positionAttribute = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\t\tconst normalAttribute = geometry.attributes.normal;\n\t\tconst morphNormal = geometry.morphAttributes.position;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\t\tlet i, j, il, jl;\n\t\tlet group, groupMaterial;\n\t\tlet start, end;\n\t\tconst modifiedPosition = new Float32Array( positionAttribute.count * positionAttribute.itemSize );\n\t\tconst modifiedNormal = new Float32Array( normalAttribute.count * normalAttribute.itemSize );\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tgroup = groups[ i ];\n\t\t\t\t\tgroupMaterial = material[ group.materialIndex ];\n\t\t\t\t\tstart = Math.max( group.start, drawRange.start );\n\t\t\t\t\tend = Math.min( group.start + group.count, drawRange.start + drawRange.count );\n\n\t\t\t\t\tfor ( j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\ta = index.getX( j );\n\t\t\t\t\t\tb = index.getX( j + 1 );\n\t\t\t\t\t\tc = index.getX( j + 2 );\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstart = Math.max( 0, drawRange.start );\n\t\t\t\tend = Math.min( index.count, drawRange.start + drawRange.count );\n\n\t\t\t\tfor ( i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\ta = index.getX( i );\n\t\t\t\t\tb = index.getX( i + 1 );\n\t\t\t\t\tc = index.getX( i + 2 );\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( positionAttribute !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tgroup = groups[ i ];\n\t\t\t\t\tgroupMaterial = material[ group.materialIndex ];\n\t\t\t\t\tstart = Math.max( group.start, drawRange.start );\n\t\t\t\t\tend = Math.min( group.start + group.count, drawRange.start + drawRange.count );\n\n\t\t\t\t\tfor ( j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\ta = j;\n\t\t\t\t\t\tb = j + 1;\n\t\t\t\t\t\tc = j + 2;\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t\t_calculateMorphedAttributeData( object, groupMaterial, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tstart = Math.max( 0, drawRange.start );\n\t\t\t\tend = Math.min( positionAttribute.count, drawRange.start + drawRange.count );\n\n\t\t\t\tfor ( i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\ta = i;\n\t\t\t\t\tb = i + 1;\n\t\t\t\t\tc = i + 2;\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, positionAttribute, morphPosition, morphTargetsRelative, a, b, c, modifiedPosition );\n\n\t\t\t\t\t_calculateMorphedAttributeData( object, material, normalAttribute, morphNormal, morphTargetsRelative, a, b, c, modifiedNormal );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst morphedPositionAttribute = new THREE.Float32BufferAttribute( modifiedPosition, 3 );\n\t\tconst morphedNormalAttribute = new THREE.Float32BufferAttribute( modifiedNormal, 3 );\n\t\treturn {\n\t\t\tpositionAttribute: positionAttribute,\n\t\t\tnormalAttribute: normalAttribute,\n\t\t\tmorphedPositionAttribute: morphedPositionAttribute,\n\t\t\tmorphedNormalAttribute: morphedNormalAttribute\n\t\t};\n\n\t}\n\n\tTHREE.BufferGeometryUtils = {};\n\tTHREE.BufferGeometryUtils.computeMorphedAttributes = computeMorphedAttributes;\n\tTHREE.BufferGeometryUtils.computeTangents = computeTangents;\n\tTHREE.BufferGeometryUtils.estimateBytesUsed = estimateBytesUsed;\n\tTHREE.BufferGeometryUtils.interleaveAttributes = interleaveAttributes;\n\tTHREE.BufferGeometryUtils.mergeBufferAttributes = mergeBufferAttributes;\n\tTHREE.BufferGeometryUtils.mergeBufferGeometries = mergeBufferGeometries;\n\tTHREE.BufferGeometryUtils.mergeVertices = mergeVertices;\n\tTHREE.BufferGeometryUtils.toTrianglesDrawMode = toTrianglesDrawMode;\n\n} )();\n",
  300. "var createLayout = require('layout-bmfont-text')\nvar inherits = require('inherits')\nvar createIndices = require('quad-indices')\nvar buffer = require('three-buffer-vertex-data')\nvar assign = require('object-assign')\n\nvar vertices = require('./lib/vertices')\nvar utils = require('./lib/utils')\n\n\nmodule.exports = function createTextGeometry (opt) {\n return new TextGeometry(opt)\n}\n\nclass TextGeometry extends THREE.BufferGeometry {\n constructor (opt) {\n super()\n \n if (typeof opt === 'string') {\n opt = { text: opt }\n }\n\n // use these as default values for any subsequent\n // calls to update()\n this._opt = assign({}, opt)\n\n // also do an initial setup...\n if (opt) this.update(opt)\n }\n\n update(opt) {\n if (typeof opt === 'string') {\n opt = { text: opt }\n }\n\n // use constructor defaults\n opt = assign({}, this._opt, opt)\n\n if (!opt.font) {\n throw new TypeError('must specify a { font } in options')\n }\n\n this.layout = createLayout(opt)\n\n // get vec2 texcoords\n var flipY = opt.flipY !== false\n\n // the desired BMFont data\n var font = opt.font\n\n // determine texture size from font file\n var texWidth = font.common.scaleW\n var texHeight = font.common.scaleH\n\n // get visible glyphs\n var glyphs = this.layout.glyphs.filter(function (glyph) {\n var bitmap = glyph.data\n return bitmap.width * bitmap.height > 0\n })\n\n // provide visible glyphs for convenience\n this.visibleGlyphs = glyphs\n\n // get common vertex data\n var positions = vertices.positions(glyphs)\n var uvs = vertices.uvs(glyphs, texWidth, texHeight, flipY)\n var indices = createIndices({\n clockwise: true,\n type: 'uint16',\n count: glyphs.length\n })\n\n // update vertex data\n buffer.index(this, indices, 1, 'uint16')\n buffer.attr(this, 'position', positions, 2)\n buffer.attr(this, 'uv', uvs, 2)\n\n // update multipage data\n if (!opt.multipage && 'page' in this.attributes) {\n // disable multipage rendering\n this.removeAttribute('page')\n } else if (opt.multipage) {\n var pages = vertices.pages(glyphs)\n // enable multipage rendering\n buffer.attr(this, 'page', pages, 1)\n }\n }\n\n computeBoundingSphere() {\n if (this.boundingSphere === null) {\n this.boundingSphere = new THREE.Sphere()\n }\n\n var positions = this.attributes.position.array\n var itemSize = this.attributes.position.itemSize\n if (!positions || !itemSize || positions.length < 2) {\n this.boundingSphere.radius = 0\n this.boundingSphere.center.set(0, 0, 0)\n return\n }\n utils.computeSphere(positions, this.boundingSphere)\n if (isNaN(this.boundingSphere.radius)) {\n console.error('THREE.BufferGeometry.computeBoundingSphere(): ' +\n 'Computed radius is NaN. The ' +\n '\"position\" attribute is likely to have NaN values.')\n }\n }\n\n computeBoundingBox() {\n if (this.boundingBox === null) {\n this.boundingBox = new THREE.Box3()\n }\n\n var bbox = this.boundingBox\n var positions = this.attributes.position.array\n var itemSize = this.attributes.position.itemSize\n if (!positions || !itemSize || positions.length < 2) {\n bbox.makeEmpty()\n return\n }\n utils.computeBox(positions, bbox)\n }\n\n}\n",
  301. "var itemSize = 2\nvar box = { min: [0, 0], max: [0, 0] }\n\nfunction bounds (positions) {\n var count = positions.length / itemSize\n box.min[0] = positions[0]\n box.min[1] = positions[1]\n box.max[0] = positions[0]\n box.max[1] = positions[1]\n\n for (var i = 0; i < count; i++) {\n var x = positions[i * itemSize + 0]\n var y = positions[i * itemSize + 1]\n box.min[0] = Math.min(x, box.min[0])\n box.min[1] = Math.min(y, box.min[1])\n box.max[0] = Math.max(x, box.max[0])\n box.max[1] = Math.max(y, box.max[1])\n }\n}\n\nmodule.exports.computeBox = function (positions, output) {\n bounds(positions)\n output.min.set(box.min[0], box.min[1], 0)\n output.max.set(box.max[0], box.max[1], 0)\n}\n\nmodule.exports.computeSphere = function (positions, output) {\n bounds(positions)\n var minX = box.min[0]\n var minY = box.min[1]\n var maxX = box.max[0]\n var maxY = box.max[1]\n var width = maxX - minX\n var height = maxY - minY\n var length = Math.sqrt(width * width + height * height)\n output.center.set(minX + width / 2, minY + height / 2, 0)\n output.radius = length / 2\n}\n",
  302. "module.exports.pages = function pages (glyphs) {\n var pages = new Float32Array(glyphs.length * 4 * 1)\n var i = 0\n glyphs.forEach(function (glyph) {\n var id = glyph.data.page || 0\n pages[i++] = id\n pages[i++] = id\n pages[i++] = id\n pages[i++] = id\n })\n return pages\n}\n\nmodule.exports.uvs = function uvs (glyphs, texWidth, texHeight, flipY) {\n var uvs = new Float32Array(glyphs.length * 4 * 2)\n var i = 0\n glyphs.forEach(function (glyph) {\n var bitmap = glyph.data\n var bw = (bitmap.x + bitmap.width)\n var bh = (bitmap.y + bitmap.height)\n\n // top left position\n var u0 = bitmap.x / texWidth\n var v1 = bitmap.y / texHeight\n var u1 = bw / texWidth\n var v0 = bh / texHeight\n\n if (flipY) {\n v1 = (texHeight - bitmap.y) / texHeight\n v0 = (texHeight - bh) / texHeight\n }\n\n // BL\n uvs[i++] = u0\n uvs[i++] = v1\n // TL\n uvs[i++] = u0\n uvs[i++] = v0\n // TR\n uvs[i++] = u1\n uvs[i++] = v0\n // BR\n uvs[i++] = u1\n uvs[i++] = v1\n })\n return uvs\n}\n\nmodule.exports.positions = function positions (glyphs) {\n var positions = new Float32Array(glyphs.length * 4 * 2)\n var i = 0\n glyphs.forEach(function (glyph) {\n var bitmap = glyph.data\n\n // bottom left position\n var x = glyph.position[0] + bitmap.xoffset\n var y = glyph.position[1] + bitmap.yoffset\n\n // quad size\n var w = bitmap.width\n var h = bitmap.height\n\n // BL\n positions[i++] = x\n positions[i++] = y\n // TL\n positions[i++] = x\n positions[i++] = y + h\n // TR\n positions[i++] = x + w\n positions[i++] = y + h\n // BR\n positions[i++] = x + w\n positions[i++] = y\n })\n return positions\n}\n",
  303. "var flatten = require('flatten-vertex-data')\nvar warned = false;\n\nmodule.exports.attr = setAttribute\nmodule.exports.index = setIndex\n\nfunction setIndex (geometry, data, itemSize, dtype) {\n if (typeof itemSize !== 'number') itemSize = 1\n if (typeof dtype !== 'string') dtype = 'uint16'\n\n var isR69 = !geometry.index && typeof geometry.setIndex !== 'function'\n var attrib = isR69 ? geometry.getAttribute('index') : geometry.index\n var newAttrib = updateAttribute(attrib, data, itemSize, dtype)\n if (newAttrib) {\n if (isR69) geometry.addAttribute('index', newAttrib)\n else geometry.index = newAttrib\n }\n}\n\nfunction setAttribute (geometry, key, data, itemSize, dtype) {\n if (typeof itemSize !== 'number') itemSize = 3\n if (typeof dtype !== 'string') dtype = 'float32'\n if (Array.isArray(data) &&\n Array.isArray(data[0]) &&\n data[0].length !== itemSize) {\n throw new Error('Nested vertex array has unexpected size; expected ' +\n itemSize + ' but found ' + data[0].length)\n }\n\n var attrib = geometry.getAttribute(key)\n var newAttrib = updateAttribute(attrib, data, itemSize, dtype)\n geometry.setAttribute(key, newAttrib)\n}\n\nfunction updateAttribute (attrib, data, itemSize, dtype) {\n data = data || []\n\n // create a new array with desired type\n data = flatten(data, dtype)\n\n attrib = new THREE.BufferAttribute(data, itemSize);\n attrib.itemSize = itemSize;\n attrib.needsUpdate = true;\n\n return attrib\n}\n\n// Test whether the attribute needs to be re-created,\n// returns false if we can re-use it as-is.\nfunction rebuildAttribute (attrib, data, itemSize) {\n if (attrib.itemSize !== itemSize) return true\n if (!attrib.array) return true\n var attribLength = attrib.array.length\n if (Array.isArray(data) && Array.isArray(data[0])) {\n // [ [ x, y, z ] ]\n return attribLength !== data.length * itemSize\n } else {\n // [ x, y, z ]\n return attribLength !== data.length\n }\n return false\n}\n",
  304. "var nextTick = require('process/browser.js').nextTick;\nvar apply = Function.prototype.apply;\nvar slice = Array.prototype.slice;\nvar immediateIds = {};\nvar nextImmediateId = 0;\n\n// DOM APIs, for completeness\n\nexports.setTimeout = function() {\n return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout);\n};\nexports.setInterval = function() {\n return new Timeout(apply.call(setInterval, window, arguments), clearInterval);\n};\nexports.clearTimeout =\nexports.clearInterval = function(timeout) { timeout.close(); };\n\nfunction Timeout(id, clearFn) {\n this._id = id;\n this._clearFn = clearFn;\n}\nTimeout.prototype.unref = Timeout.prototype.ref = function() {};\nTimeout.prototype.close = function() {\n this._clearFn.call(window, this._id);\n};\n\n// Does not start the time, just sets up the members needed.\nexports.enroll = function(item, msecs) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = msecs;\n};\n\nexports.unenroll = function(item) {\n clearTimeout(item._idleTimeoutId);\n item._idleTimeout = -1;\n};\n\nexports._unrefActive = exports.active = function(item) {\n clearTimeout(item._idleTimeoutId);\n\n var msecs = item._idleTimeout;\n if (msecs >= 0) {\n item._idleTimeoutId = setTimeout(function onTimeout() {\n if (item._onTimeout)\n item._onTimeout();\n }, msecs);\n }\n};\n\n// That's not how node.js implements it but the exposed api is the same.\nexports.setImmediate = typeof setImmediate === \"function\" ? setImmediate : function(fn) {\n var id = nextImmediateId++;\n var args = arguments.length < 2 ? false : slice.call(arguments, 1);\n\n immediateIds[id] = true;\n\n nextTick(function onNextTick() {\n if (immediateIds[id]) {\n // fn.call() is faster so we optimize for the common use-case\n // @see http://jsperf.com/call-apply-segu\n if (args) {\n fn.apply(null, args);\n } else {\n fn.call(null);\n }\n // Prevent ids from leaking\n exports.clearImmediate(id);\n }\n });\n\n return id;\n};\n\nexports.clearImmediate = typeof clearImmediate === \"function\" ? clearImmediate : function(id) {\n delete immediateIds[id];\n};",
  305. "/**\n * @license\n * webvr-polyfill\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * cardboard-vr-display\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * webvr-polyfill-dpdb \n * Copyright (c) 2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @license\n * wglu-preserve-state\n * Copyright (c) 2016, Brandon Jones.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n/**\n * @license\n * nosleep.js\n * Copyright (c) 2017, Rich Tibbett\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n\ttypeof define === 'function' && define.amd ? define(factory) :\n\t(global.WebVRPolyfill = factory());\n}(this, (function () { 'use strict';\n\nvar commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};\n\n\n\nfunction unwrapExports (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nfunction createCommonjsModule(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\n\nvar isMobile = function isMobile() {\n return (/Android/i.test(navigator.userAgent) || /iPhone|iPad|iPod/i.test(navigator.userAgent)\n );\n};\nvar copyArray = function copyArray(source, dest) {\n for (var i = 0, n = source.length; i < n; i++) {\n dest[i] = source[i];\n }\n};\nvar extend = function extend(dest, src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dest[key] = src[key];\n }\n }\n return dest;\n};\n\nvar cardboardVrDisplay = createCommonjsModule(function (module, exports) {\n/**\n * @license\n * cardboard-vr-display\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * gl-preserve-state\n * Copyright (c) 2016, Brandon Jones.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n/**\n * @license\n * webvr-polyfill-dpdb\n * Copyright (c) 2015-2017 Google\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/**\n * @license\n * nosleep.js\n * Copyright (c) 2017, Rich Tibbett\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n(function (global, factory) {\n\tmodule.exports = factory();\n}(commonjsGlobal, (function () { var classCallCheck = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};\nvar createClass = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n }\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n return _arr;\n }\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\nvar MIN_TIMESTEP = 0.001;\nvar MAX_TIMESTEP = 1;\nvar dataUri = function dataUri(mimeType, svg) {\n return 'data:' + mimeType + ',' + encodeURIComponent(svg);\n};\nvar lerp = function lerp(a, b, t) {\n return a + (b - a) * t;\n};\nvar isIOS = function () {\n var isIOS = /iPad|iPhone|iPod/.test(navigator.platform);\n return function () {\n return isIOS;\n };\n}();\nvar isWebViewAndroid = function () {\n var isWebViewAndroid = navigator.userAgent.indexOf('Version') !== -1 && navigator.userAgent.indexOf('Android') !== -1 && navigator.userAgent.indexOf('Chrome') !== -1;\n return function () {\n return isWebViewAndroid;\n };\n}();\nvar isSafari = function () {\n var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n return function () {\n return isSafari;\n };\n}();\nvar isFirefoxAndroid = function () {\n var isFirefoxAndroid = navigator.userAgent.indexOf('Firefox') !== -1 && navigator.userAgent.indexOf('Android') !== -1;\n return function () {\n return isFirefoxAndroid;\n };\n}();\nvar getChromeVersion = function () {\n var match = navigator.userAgent.match(/.*Chrome\\/([0-9]+)/);\n var value = match ? parseInt(match[1], 10) : null;\n return function () {\n return value;\n };\n}();\nvar isSafariWithoutDeviceMotion = function () {\n var value = false;\n value = isIOS() && isSafari() && navigator.userAgent.indexOf('13_4') !== -1;\n return function () {\n return value;\n };\n}();\nvar isChromeWithoutDeviceMotion = function () {\n var value = false;\n if (getChromeVersion() === 65) {\n var match = navigator.userAgent.match(/.*Chrome\\/([0-9\\.]*)/);\n if (match) {\n var _match$1$split = match[1].split('.'),\n _match$1$split2 = slicedToArray(_match$1$split, 4),\n major = _match$1$split2[0],\n minor = _match$1$split2[1],\n branch = _match$1$split2[2],\n build = _match$1$split2[3];\n value = parseInt(branch, 10) === 3325 && parseInt(build, 10) < 148;\n }\n }\n return function () {\n return value;\n };\n}();\nvar isR7 = function () {\n var isR7 = navigator.userAgent.indexOf('R7 Build') !== -1;\n return function () {\n return isR7;\n };\n}();\nvar isLandscapeMode = function isLandscapeMode() {\n var rtn = window.orientation == 90 || window.orientation == -90;\n return isR7() ? !rtn : rtn;\n};\nvar isTimestampDeltaValid = function isTimestampDeltaValid(timestampDeltaS) {\n if (isNaN(timestampDeltaS)) {\n return false;\n }\n if (timestampDeltaS <= MIN_TIMESTEP) {\n return false;\n }\n if (timestampDeltaS > MAX_TIMESTEP) {\n return false;\n }\n return true;\n};\nvar getScreenWidth = function getScreenWidth() {\n return Math.max(window.screen.width, window.screen.height) * window.devicePixelRatio;\n};\nvar getScreenHeight = function getScreenHeight() {\n return Math.min(window.screen.width, window.screen.height) * window.devicePixelRatio;\n};\nvar requestFullscreen = function requestFullscreen(element) {\n if (isWebViewAndroid()) {\n return false;\n }\n if (element.requestFullscreen) {\n element.requestFullscreen();\n } else if (element.webkitRequestFullscreen) {\n element.webkitRequestFullscreen();\n } else if (element.mozRequestFullScreen) {\n element.mozRequestFullScreen();\n } else if (element.msRequestFullscreen) {\n element.msRequestFullscreen();\n } else {\n return false;\n }\n return true;\n};\nvar exitFullscreen = function exitFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.msExitFullscreen) {\n document.msExitFullscreen();\n } else {\n return false;\n }\n return true;\n};\nvar getFullscreenElement = function getFullscreenElement() {\n return document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement;\n};\nvar linkProgram = function linkProgram(gl, vertexSource, fragmentSource, attribLocationMap) {\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexSource);\n gl.compileShader(vertexShader);\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentSource);\n gl.compileShader(fragmentShader);\n var program = gl.createProgram();\n gl.attachShader(program, vertexShader);\n gl.attachShader(program, fragmentShader);\n for (var attribName in attribLocationMap) {\n gl.bindAttribLocation(program, attribLocationMap[attribName], attribName);\n }gl.linkProgram(program);\n gl.deleteShader(vertexShader);\n gl.deleteShader(fragmentShader);\n return program;\n};\nvar getProgramUniforms = function getProgramUniforms(gl, program) {\n var uniforms = {};\n var uniformCount = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n var uniformName = '';\n for (var i = 0; i < uniformCount; i++) {\n var uniformInfo = gl.getActiveUniform(program, i);\n uniformName = uniformInfo.name.replace('[0]', '');\n uniforms[uniformName] = gl.getUniformLocation(program, uniformName);\n }\n return uniforms;\n};\nvar orthoMatrix = function orthoMatrix(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right),\n bt = 1 / (bottom - top),\n nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n};\nvar isMobile = function isMobile() {\n var check = false;\n (function (a) {\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) check = true;\n })(navigator.userAgent || navigator.vendor || window.opera);\n return check;\n};\nvar extend = function extend(dest, src) {\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n dest[key] = src[key];\n }\n }\n return dest;\n};\nvar safariCssSizeWorkaround = function safariCssSizeWorkaround(canvas) {\n if (isIOS()) {\n var width = canvas.style.width;\n var height = canvas.style.height;\n canvas.style.width = parseInt(width) + 1 + 'px';\n canvas.style.height = parseInt(height) + 'px';\n setTimeout(function () {\n canvas.style.width = width;\n canvas.style.height = height;\n }, 100);\n }\n window.canvas = canvas;\n};\nvar frameDataFromPose = function () {\n var piOver180 = Math.PI / 180.0;\n var rad45 = Math.PI * 0.25;\n function mat4_perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov ? fov.upDegrees * piOver180 : rad45),\n downTan = Math.tan(fov ? fov.downDegrees * piOver180 : rad45),\n leftTan = Math.tan(fov ? fov.leftDegrees * piOver180 : rad45),\n rightTan = Math.tan(fov ? fov.rightDegrees * piOver180 : rad45),\n xScale = 2.0 / (leftTan + rightTan),\n yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n }\n function mat4_fromRotationTranslation(out, q, v) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3],\n x2 = x + x,\n y2 = y + y,\n z2 = z + z,\n xx = x * x2,\n xy = x * y2,\n xz = x * z2,\n yy = y * y2,\n yz = y * z2,\n zz = z * z2,\n wx = w * x2,\n wy = w * y2,\n wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n }\n function mat4_translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2],\n a00,\n a01,\n a02,\n a03,\n a10,\n a11,\n a12,\n a13,\n a20,\n a21,\n a22,\n a23;\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];a01 = a[1];a02 = a[2];a03 = a[3];\n a10 = a[4];a11 = a[5];a12 = a[6];a13 = a[7];\n a20 = a[8];a21 = a[9];a22 = a[10];a23 = a[11];\n out[0] = a00;out[1] = a01;out[2] = a02;out[3] = a03;\n out[4] = a10;out[5] = a11;out[6] = a12;out[7] = a13;\n out[8] = a20;out[9] = a21;out[10] = a22;out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n return out;\n }\n function mat4_invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3],\n a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7],\n a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11],\n a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15],\n b00 = a00 * a11 - a01 * a10,\n b01 = a00 * a12 - a02 * a10,\n b02 = a00 * a13 - a03 * a10,\n b03 = a01 * a12 - a02 * a11,\n b04 = a01 * a13 - a03 * a11,\n b05 = a02 * a13 - a03 * a12,\n b06 = a20 * a31 - a21 * a30,\n b07 = a20 * a32 - a22 * a30,\n b08 = a20 * a33 - a23 * a30,\n b09 = a21 * a32 - a22 * a31,\n b10 = a21 * a33 - a23 * a31,\n b11 = a22 * a33 - a23 * a32,\n det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n if (!det) {\n return null;\n }\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n }\n var defaultOrientation = new Float32Array([0, 0, 0, 1]);\n var defaultPosition = new Float32Array([0, 0, 0]);\n function updateEyeMatrices(projection, view, pose, fov, offset, vrDisplay) {\n mat4_perspectiveFromFieldOfView(projection, fov || null, vrDisplay.depthNear, vrDisplay.depthFar);\n var orientation = pose.orientation || defaultOrientation;\n var position = pose.position || defaultPosition;\n mat4_fromRotationTranslation(view, orientation, position);\n if (offset) mat4_translate(view, view, offset);\n mat4_invert(view, view);\n }\n return function (frameData, pose, vrDisplay) {\n if (!frameData || !pose) return false;\n frameData.pose = pose;\n frameData.timestamp = pose.timestamp;\n updateEyeMatrices(frameData.leftProjectionMatrix, frameData.leftViewMatrix, pose, vrDisplay._getFieldOfView(\"left\"), vrDisplay._getEyeOffset(\"left\"), vrDisplay);\n updateEyeMatrices(frameData.rightProjectionMatrix, frameData.rightViewMatrix, pose, vrDisplay._getFieldOfView(\"right\"), vrDisplay._getEyeOffset(\"right\"), vrDisplay);\n return true;\n };\n}();\nvar isInsideCrossOriginIFrame = function isInsideCrossOriginIFrame() {\n var isFramed = window.self !== window.top;\n var refOrigin = getOriginFromUrl(document.referrer);\n var thisOrigin = getOriginFromUrl(window.location.href);\n return isFramed && refOrigin !== thisOrigin;\n};\nvar getOriginFromUrl = function getOriginFromUrl(url) {\n var domainIdx;\n var protoSepIdx = url.indexOf(\"://\");\n if (protoSepIdx !== -1) {\n domainIdx = protoSepIdx + 3;\n } else {\n domainIdx = 0;\n }\n var domainEndIdx = url.indexOf('/', domainIdx);\n if (domainEndIdx === -1) {\n domainEndIdx = url.length;\n }\n return url.substring(0, domainEndIdx);\n};\nvar getQuaternionAngle = function getQuaternionAngle(quat) {\n if (quat.w > 1) {\n console.warn('getQuaternionAngle: w > 1');\n return 0;\n }\n var angle = 2 * Math.acos(quat.w);\n return angle;\n};\nvar warnOnce = function () {\n var observedWarnings = {};\n return function (key, message) {\n if (observedWarnings[key] === undefined) {\n console.warn('webvr-polyfill: ' + message);\n observedWarnings[key] = true;\n }\n };\n}();\nvar deprecateWarning = function deprecateWarning(deprecated, suggested) {\n var alternative = suggested ? 'Please use ' + suggested + ' instead.' : '';\n warnOnce(deprecated, deprecated + ' has been deprecated. ' + 'This may not work on native WebVR displays. ' + alternative);\n};\nfunction WGLUPreserveGLState(gl, bindings, callback) {\n if (!bindings) {\n callback(gl);\n return;\n }\n var boundValues = [];\n var activeTexture = null;\n for (var i = 0; i < bindings.length; ++i) {\n var binding = bindings[i];\n switch (binding) {\n case gl.TEXTURE_BINDING_2D:\n case gl.TEXTURE_BINDING_CUBE_MAP:\n var textureUnit = bindings[++i];\n if (textureUnit < gl.TEXTURE0 || textureUnit > gl.TEXTURE31) {\n console.error(\"TEXTURE_BINDING_2D or TEXTURE_BINDING_CUBE_MAP must be followed by a valid texture unit\");\n boundValues.push(null, null);\n break;\n }\n if (!activeTexture) {\n activeTexture = gl.getParameter(gl.ACTIVE_TEXTURE);\n }\n gl.activeTexture(textureUnit);\n boundValues.push(gl.getParameter(binding), null);\n break;\n case gl.ACTIVE_TEXTURE:\n activeTexture = gl.getParameter(gl.ACTIVE_TEXTURE);\n boundValues.push(null);\n break;\n default:\n boundValues.push(gl.getParameter(binding));\n break;\n }\n }\n callback(gl);\n for (var i = 0; i < bindings.length; ++i) {\n var binding = bindings[i];\n var boundValue = boundValues[i];\n switch (binding) {\n case gl.ACTIVE_TEXTURE:\n break;\n case gl.ARRAY_BUFFER_BINDING:\n gl.bindBuffer(gl.ARRAY_BUFFER, boundValue);\n break;\n case gl.COLOR_CLEAR_VALUE:\n gl.clearColor(boundValue[0], boundValue[1], boundValue[2], boundValue[3]);\n break;\n case gl.COLOR_WRITEMASK:\n gl.colorMask(boundValue[0], boundValue[1], boundValue[2], boundValue[3]);\n break;\n case gl.CURRENT_PROGRAM:\n gl.useProgram(boundValue);\n break;\n case gl.ELEMENT_ARRAY_BUFFER_BINDING:\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, boundValue);\n break;\n case gl.FRAMEBUFFER_BINDING:\n gl.bindFramebuffer(gl.FRAMEBUFFER, boundValue);\n break;\n case gl.RENDERBUFFER_BINDING:\n gl.bindRenderbuffer(gl.RENDERBUFFER, boundValue);\n break;\n case gl.TEXTURE_BINDING_2D:\n var textureUnit = bindings[++i];\n if (textureUnit < gl.TEXTURE0 || textureUnit > gl.TEXTURE31)\n break;\n gl.activeTexture(textureUnit);\n gl.bindTexture(gl.TEXTURE_2D, boundValue);\n break;\n case gl.TEXTURE_BINDING_CUBE_MAP:\n var textureUnit = bindings[++i];\n if (textureUnit < gl.TEXTURE0 || textureUnit > gl.TEXTURE31)\n break;\n gl.activeTexture(textureUnit);\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, boundValue);\n break;\n case gl.VIEWPORT:\n gl.viewport(boundValue[0], boundValue[1], boundValue[2], boundValue[3]);\n break;\n case gl.BLEND:\n case gl.CULL_FACE:\n case gl.DEPTH_TEST:\n case gl.SCISSOR_TEST:\n case gl.STENCIL_TEST:\n if (boundValue) {\n gl.enable(binding);\n } else {\n gl.disable(binding);\n }\n break;\n default:\n console.log(\"No GL restore behavior for 0x\" + binding.toString(16));\n break;\n }\n if (activeTexture) {\n gl.activeTexture(activeTexture);\n }\n }\n}\nvar glPreserveState = WGLUPreserveGLState;\nvar distortionVS = ['attribute vec2 position;', 'attribute vec3 texCoord;', 'varying vec2 vTexCoord;', 'uniform vec4 viewportOffsetScale[2];', 'void main() {', ' vec4 viewport = viewportOffsetScale[int(texCoord.z)];', ' vTexCoord = (texCoord.xy * viewport.zw) + viewport.xy;', ' gl_Position = vec4( position, 1.0, 1.0 );', '}'].join('\\n');\nvar distortionFS = ['precision mediump float;', 'uniform sampler2D diffuse;', 'varying vec2 vTexCoord;', 'void main() {', ' gl_FragColor = texture2D(diffuse, vTexCoord);', '}'].join('\\n');\nfunction CardboardDistorter(gl, cardboardUI, bufferScale, dirtySubmitFrameBindings) {\n this.gl = gl;\n this.cardboardUI = cardboardUI;\n this.bufferScale = bufferScale;\n this.dirtySubmitFrameBindings = dirtySubmitFrameBindings;\n this.ctxAttribs = gl.getContextAttributes();\n this.instanceExt = gl.getExtension('ANGLE_instanced_arrays');\n this.meshWidth = 20;\n this.meshHeight = 20;\n this.bufferWidth = gl.drawingBufferWidth;\n this.bufferHeight = gl.drawingBufferHeight;\n this.realBindFramebuffer = gl.bindFramebuffer;\n this.realEnable = gl.enable;\n this.realDisable = gl.disable;\n this.realColorMask = gl.colorMask;\n this.realClearColor = gl.clearColor;\n this.realViewport = gl.viewport;\n if (!isIOS()) {\n this.realCanvasWidth = Object.getOwnPropertyDescriptor(gl.canvas.__proto__, 'width');\n this.realCanvasHeight = Object.getOwnPropertyDescriptor(gl.canvas.__proto__, 'height');\n }\n this.isPatched = false;\n this.lastBoundFramebuffer = null;\n this.cullFace = false;\n this.depthTest = false;\n this.blend = false;\n this.scissorTest = false;\n this.stencilTest = false;\n this.viewport = [0, 0, 0, 0];\n this.colorMask = [true, true, true, true];\n this.clearColor = [0, 0, 0, 0];\n this.attribs = {\n position: 0,\n texCoord: 1\n };\n this.program = linkProgram(gl, distortionVS, distortionFS, this.attribs);\n this.uniforms = getProgramUniforms(gl, this.program);\n this.viewportOffsetScale = new Float32Array(8);\n this.setTextureBounds();\n this.vertexBuffer = gl.createBuffer();\n this.indexBuffer = gl.createBuffer();\n this.indexCount = 0;\n this.renderTarget = gl.createTexture();\n this.framebuffer = gl.createFramebuffer();\n this.depthStencilBuffer = null;\n this.depthBuffer = null;\n this.stencilBuffer = null;\n if (this.ctxAttribs.depth && this.ctxAttribs.stencil) {\n this.depthStencilBuffer = gl.createRenderbuffer();\n } else if (this.ctxAttribs.depth) {\n this.depthBuffer = gl.createRenderbuffer();\n } else if (this.ctxAttribs.stencil) {\n this.stencilBuffer = gl.createRenderbuffer();\n }\n this.patch();\n this.onResize();\n}\nCardboardDistorter.prototype.destroy = function () {\n var gl = this.gl;\n this.unpatch();\n gl.deleteProgram(this.program);\n gl.deleteBuffer(this.vertexBuffer);\n gl.deleteBuffer(this.indexBuffer);\n gl.deleteTexture(this.renderTarget);\n gl.deleteFramebuffer(this.framebuffer);\n if (this.depthStencilBuffer) {\n gl.deleteRenderbuffer(this.depthStencilBuffer);\n }\n if (this.depthBuffer) {\n gl.deleteRenderbuffer(this.depthBuffer);\n }\n if (this.stencilBuffer) {\n gl.deleteRenderbuffer(this.stencilBuffer);\n }\n if (this.cardboardUI) {\n this.cardboardUI.destroy();\n }\n};\nCardboardDistorter.prototype.onResize = function () {\n var gl = this.gl;\n var self = this;\n var glState = [gl.RENDERBUFFER_BINDING, gl.TEXTURE_BINDING_2D, gl.TEXTURE0];\n glPreserveState(gl, glState, function (gl) {\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, null);\n if (self.scissorTest) {\n self.realDisable.call(gl, gl.SCISSOR_TEST);\n }\n self.realColorMask.call(gl, true, true, true, true);\n self.realViewport.call(gl, 0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n self.realClearColor.call(gl, 0, 0, 0, 1);\n gl.clear(gl.COLOR_BUFFER_BIT);\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, self.framebuffer);\n gl.bindTexture(gl.TEXTURE_2D, self.renderTarget);\n gl.texImage2D(gl.TEXTURE_2D, 0, self.ctxAttribs.alpha ? gl.RGBA : gl.RGB, self.bufferWidth, self.bufferHeight, 0, self.ctxAttribs.alpha ? gl.RGBA : gl.RGB, gl.UNSIGNED_BYTE, null);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, self.renderTarget, 0);\n if (self.ctxAttribs.depth && self.ctxAttribs.stencil) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, self.depthStencilBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, self.bufferWidth, self.bufferHeight);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, self.depthStencilBuffer);\n } else if (self.ctxAttribs.depth) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, self.depthBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_COMPONENT16, self.bufferWidth, self.bufferHeight);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_ATTACHMENT, gl.RENDERBUFFER, self.depthBuffer);\n } else if (self.ctxAttribs.stencil) {\n gl.bindRenderbuffer(gl.RENDERBUFFER, self.stencilBuffer);\n gl.renderbufferStorage(gl.RENDERBUFFER, gl.STENCIL_INDEX8, self.bufferWidth, self.bufferHeight);\n gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.STENCIL_ATTACHMENT, gl.RENDERBUFFER, self.stencilBuffer);\n }\n if (!gl.checkFramebufferStatus(gl.FRAMEBUFFER) === gl.FRAMEBUFFER_COMPLETE) {\n console.error('Framebuffer incomplete!');\n }\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, self.lastBoundFramebuffer);\n if (self.scissorTest) {\n self.realEnable.call(gl, gl.SCISSOR_TEST);\n }\n self.realColorMask.apply(gl, self.colorMask);\n self.realViewport.apply(gl, self.viewport);\n self.realClearColor.apply(gl, self.clearColor);\n });\n if (this.cardboardUI) {\n this.cardboardUI.onResize();\n }\n};\nCardboardDistorter.prototype.patch = function () {\n if (this.isPatched) {\n return;\n }\n var self = this;\n var canvas = this.gl.canvas;\n var gl = this.gl;\n if (!isIOS()) {\n canvas.width = getScreenWidth() * this.bufferScale;\n canvas.height = getScreenHeight() * this.bufferScale;\n Object.defineProperty(canvas, 'width', {\n configurable: true,\n enumerable: true,\n get: function get() {\n return self.bufferWidth;\n },\n set: function set(value) {\n self.bufferWidth = value;\n self.realCanvasWidth.set.call(canvas, value);\n self.onResize();\n }\n });\n Object.defineProperty(canvas, 'height', {\n configurable: true,\n enumerable: true,\n get: function get() {\n return self.bufferHeight;\n },\n set: function set(value) {\n self.bufferHeight = value;\n self.realCanvasHeight.set.call(canvas, value);\n self.onResize();\n }\n });\n }\n this.lastBoundFramebuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n if (this.lastBoundFramebuffer == null) {\n this.lastBoundFramebuffer = this.framebuffer;\n this.gl.bindFramebuffer(gl.FRAMEBUFFER, this.framebuffer);\n }\n this.gl.bindFramebuffer = function (target, framebuffer) {\n self.lastBoundFramebuffer = framebuffer ? framebuffer : self.framebuffer;\n self.realBindFramebuffer.call(gl, target, self.lastBoundFramebuffer);\n };\n this.cullFace = gl.getParameter(gl.CULL_FACE);\n this.depthTest = gl.getParameter(gl.DEPTH_TEST);\n this.blend = gl.getParameter(gl.BLEND);\n this.scissorTest = gl.getParameter(gl.SCISSOR_TEST);\n this.stencilTest = gl.getParameter(gl.STENCIL_TEST);\n gl.enable = function (pname) {\n switch (pname) {\n case gl.CULL_FACE:\n self.cullFace = true;break;\n case gl.DEPTH_TEST:\n self.depthTest = true;break;\n case gl.BLEND:\n self.blend = true;break;\n case gl.SCISSOR_TEST:\n self.scissorTest = true;break;\n case gl.STENCIL_TEST:\n self.stencilTest = true;break;\n }\n self.realEnable.call(gl, pname);\n };\n gl.disable = function (pname) {\n switch (pname) {\n case gl.CULL_FACE:\n self.cullFace = false;break;\n case gl.DEPTH_TEST:\n self.depthTest = false;break;\n case gl.BLEND:\n self.blend = false;break;\n case gl.SCISSOR_TEST:\n self.scissorTest = false;break;\n case gl.STENCIL_TEST:\n self.stencilTest = false;break;\n }\n self.realDisable.call(gl, pname);\n };\n this.colorMask = gl.getParameter(gl.COLOR_WRITEMASK);\n gl.colorMask = function (r, g, b, a) {\n self.colorMask[0] = r;\n self.colorMask[1] = g;\n self.colorMask[2] = b;\n self.colorMask[3] = a;\n self.realColorMask.call(gl, r, g, b, a);\n };\n this.clearColor = gl.getParameter(gl.COLOR_CLEAR_VALUE);\n gl.clearColor = function (r, g, b, a) {\n self.clearColor[0] = r;\n self.clearColor[1] = g;\n self.clearColor[2] = b;\n self.clearColor[3] = a;\n self.realClearColor.call(gl, r, g, b, a);\n };\n this.viewport = gl.getParameter(gl.VIEWPORT);\n gl.viewport = function (x, y, w, h) {\n self.viewport[0] = x;\n self.viewport[1] = y;\n self.viewport[2] = w;\n self.viewport[3] = h;\n self.realViewport.call(gl, x, y, w, h);\n };\n this.isPatched = true;\n safariCssSizeWorkaround(canvas);\n};\nCardboardDistorter.prototype.unpatch = function () {\n if (!this.isPatched) {\n return;\n }\n var gl = this.gl;\n var canvas = this.gl.canvas;\n if (!isIOS()) {\n Object.defineProperty(canvas, 'width', this.realCanvasWidth);\n Object.defineProperty(canvas, 'height', this.realCanvasHeight);\n }\n canvas.width = this.bufferWidth;\n canvas.height = this.bufferHeight;\n gl.bindFramebuffer = this.realBindFramebuffer;\n gl.enable = this.realEnable;\n gl.disable = this.realDisable;\n gl.colorMask = this.realColorMask;\n gl.clearColor = this.realClearColor;\n gl.viewport = this.realViewport;\n if (this.lastBoundFramebuffer == this.framebuffer) {\n gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n }\n this.isPatched = false;\n setTimeout(function () {\n safariCssSizeWorkaround(canvas);\n }, 1);\n};\nCardboardDistorter.prototype.setTextureBounds = function (leftBounds, rightBounds) {\n if (!leftBounds) {\n leftBounds = [0, 0, 0.5, 1];\n }\n if (!rightBounds) {\n rightBounds = [0.5, 0, 0.5, 1];\n }\n this.viewportOffsetScale[0] = leftBounds[0];\n this.viewportOffsetScale[1] = leftBounds[1];\n this.viewportOffsetScale[2] = leftBounds[2];\n this.viewportOffsetScale[3] = leftBounds[3];\n this.viewportOffsetScale[4] = rightBounds[0];\n this.viewportOffsetScale[5] = rightBounds[1];\n this.viewportOffsetScale[6] = rightBounds[2];\n this.viewportOffsetScale[7] = rightBounds[3];\n};\nCardboardDistorter.prototype.submitFrame = function () {\n var gl = this.gl;\n var self = this;\n var glState = [];\n if (!this.dirtySubmitFrameBindings) {\n glState.push(gl.CURRENT_PROGRAM, gl.ARRAY_BUFFER_BINDING, gl.ELEMENT_ARRAY_BUFFER_BINDING, gl.TEXTURE_BINDING_2D, gl.TEXTURE0);\n }\n glPreserveState(gl, glState, function (gl) {\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, null);\n var positionDivisor = 0;\n var texCoordDivisor = 0;\n if (self.instanceExt) {\n positionDivisor = gl.getVertexAttrib(self.attribs.position, self.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);\n texCoordDivisor = gl.getVertexAttrib(self.attribs.texCoord, self.instanceExt.VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE);\n }\n if (self.cullFace) {\n self.realDisable.call(gl, gl.CULL_FACE);\n }\n if (self.depthTest) {\n self.realDisable.call(gl, gl.DEPTH_TEST);\n }\n if (self.blend) {\n self.realDisable.call(gl, gl.BLEND);\n }\n if (self.scissorTest) {\n self.realDisable.call(gl, gl.SCISSOR_TEST);\n }\n if (self.stencilTest) {\n self.realDisable.call(gl, gl.STENCIL_TEST);\n }\n self.realColorMask.call(gl, true, true, true, true);\n self.realViewport.call(gl, 0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n if (self.ctxAttribs.alpha || isIOS()) {\n self.realClearColor.call(gl, 0, 0, 0, 1);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n gl.useProgram(self.program);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, self.indexBuffer);\n gl.bindBuffer(gl.ARRAY_BUFFER, self.vertexBuffer);\n gl.enableVertexAttribArray(self.attribs.position);\n gl.enableVertexAttribArray(self.attribs.texCoord);\n gl.vertexAttribPointer(self.attribs.position, 2, gl.FLOAT, false, 20, 0);\n gl.vertexAttribPointer(self.attribs.texCoord, 3, gl.FLOAT, false, 20, 8);\n if (self.instanceExt) {\n if (positionDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.position, 0);\n }\n if (texCoordDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.texCoord, 0);\n }\n }\n gl.activeTexture(gl.TEXTURE0);\n gl.uniform1i(self.uniforms.diffuse, 0);\n gl.bindTexture(gl.TEXTURE_2D, self.renderTarget);\n gl.uniform4fv(self.uniforms.viewportOffsetScale, self.viewportOffsetScale);\n gl.drawElements(gl.TRIANGLES, self.indexCount, gl.UNSIGNED_SHORT, 0);\n if (self.cardboardUI) {\n self.cardboardUI.renderNoState();\n }\n self.realBindFramebuffer.call(self.gl, gl.FRAMEBUFFER, self.framebuffer);\n if (!self.ctxAttribs.preserveDrawingBuffer) {\n self.realClearColor.call(gl, 0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n }\n if (!self.dirtySubmitFrameBindings) {\n self.realBindFramebuffer.call(gl, gl.FRAMEBUFFER, self.lastBoundFramebuffer);\n }\n if (self.cullFace) {\n self.realEnable.call(gl, gl.CULL_FACE);\n }\n if (self.depthTest) {\n self.realEnable.call(gl, gl.DEPTH_TEST);\n }\n if (self.blend) {\n self.realEnable.call(gl, gl.BLEND);\n }\n if (self.scissorTest) {\n self.realEnable.call(gl, gl.SCISSOR_TEST);\n }\n if (self.stencilTest) {\n self.realEnable.call(gl, gl.STENCIL_TEST);\n }\n self.realColorMask.apply(gl, self.colorMask);\n self.realViewport.apply(gl, self.viewport);\n if (self.ctxAttribs.alpha || !self.ctxAttribs.preserveDrawingBuffer) {\n self.realClearColor.apply(gl, self.clearColor);\n }\n if (self.instanceExt) {\n if (positionDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.position, positionDivisor);\n }\n if (texCoordDivisor != 0) {\n self.instanceExt.vertexAttribDivisorANGLE(self.attribs.texCoord, texCoordDivisor);\n }\n }\n });\n if (isIOS()) {\n var canvas = gl.canvas;\n if (canvas.width != self.bufferWidth || canvas.height != self.bufferHeight) {\n self.bufferWidth = canvas.width;\n self.bufferHeight = canvas.height;\n self.onResize();\n }\n }\n};\nCardboardDistorter.prototype.updateDeviceInfo = function (deviceInfo) {\n var gl = this.gl;\n var self = this;\n var glState = [gl.ARRAY_BUFFER_BINDING, gl.ELEMENT_ARRAY_BUFFER_BINDING];\n glPreserveState(gl, glState, function (gl) {\n var vertices = self.computeMeshVertices_(self.meshWidth, self.meshHeight, deviceInfo);\n gl.bindBuffer(gl.ARRAY_BUFFER, self.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, vertices, gl.STATIC_DRAW);\n if (!self.indexCount) {\n var indices = self.computeMeshIndices_(self.meshWidth, self.meshHeight);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, self.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices, gl.STATIC_DRAW);\n self.indexCount = indices.length;\n }\n });\n};\nCardboardDistorter.prototype.computeMeshVertices_ = function (width, height, deviceInfo) {\n var vertices = new Float32Array(2 * width * height * 5);\n var lensFrustum = deviceInfo.getLeftEyeVisibleTanAngles();\n var noLensFrustum = deviceInfo.getLeftEyeNoLensTanAngles();\n var viewport = deviceInfo.getLeftEyeVisibleScreenRect(noLensFrustum);\n var vidx = 0;\n for (var e = 0; e < 2; e++) {\n for (var j = 0; j < height; j++) {\n for (var i = 0; i < width; i++, vidx++) {\n var u = i / (width - 1);\n var v = j / (height - 1);\n var s = u;\n var t = v;\n var x = lerp(lensFrustum[0], lensFrustum[2], u);\n var y = lerp(lensFrustum[3], lensFrustum[1], v);\n var d = Math.sqrt(x * x + y * y);\n var r = deviceInfo.distortion.distortInverse(d);\n var p = x * r / d;\n var q = y * r / d;\n u = (p - noLensFrustum[0]) / (noLensFrustum[2] - noLensFrustum[0]);\n v = (q - noLensFrustum[3]) / (noLensFrustum[1] - noLensFrustum[3]);\n u = (viewport.x + u * viewport.width - 0.5) * 2.0;\n v = (viewport.y + v * viewport.height - 0.5) * 2.0;\n vertices[vidx * 5 + 0] = u;\n vertices[vidx * 5 + 1] = v;\n vertices[vidx * 5 + 2] = s;\n vertices[vidx * 5 + 3] = t;\n vertices[vidx * 5 + 4] = e;\n }\n }\n var w = lensFrustum[2] - lensFrustum[0];\n lensFrustum[0] = -(w + lensFrustum[0]);\n lensFrustum[2] = w - lensFrustum[2];\n w = noLensFrustum[2] - noLensFrustum[0];\n noLensFrustum[0] = -(w + noLensFrustum[0]);\n noLensFrustum[2] = w - noLensFrustum[2];\n viewport.x = 1 - (viewport.x + viewport.width);\n }\n return vertices;\n};\nCardboardDistorter.prototype.computeMeshIndices_ = function (width, height) {\n var indices = new Uint16Array(2 * (width - 1) * (height - 1) * 6);\n var halfwidth = width / 2;\n var halfheight = height / 2;\n var vidx = 0;\n var iidx = 0;\n for (var e = 0; e < 2; e++) {\n for (var j = 0; j < height; j++) {\n for (var i = 0; i < width; i++, vidx++) {\n if (i == 0 || j == 0) continue;\n if (i <= halfwidth == j <= halfheight) {\n indices[iidx++] = vidx;\n indices[iidx++] = vidx - width - 1;\n indices[iidx++] = vidx - width;\n indices[iidx++] = vidx - width - 1;\n indices[iidx++] = vidx;\n indices[iidx++] = vidx - 1;\n } else {\n indices[iidx++] = vidx - 1;\n indices[iidx++] = vidx - width;\n indices[iidx++] = vidx;\n indices[iidx++] = vidx - width;\n indices[iidx++] = vidx - 1;\n indices[iidx++] = vidx - width - 1;\n }\n }\n }\n }\n return indices;\n};\nCardboardDistorter.prototype.getOwnPropertyDescriptor_ = function (proto, attrName) {\n var descriptor = Object.getOwnPropertyDescriptor(proto, attrName);\n if (descriptor.get === undefined || descriptor.set === undefined) {\n descriptor.configurable = true;\n descriptor.enumerable = true;\n descriptor.get = function () {\n return this.getAttribute(attrName);\n };\n descriptor.set = function (val) {\n this.setAttribute(attrName, val);\n };\n }\n return descriptor;\n};\nvar uiVS = ['attribute vec2 position;', 'uniform mat4 projectionMat;', 'void main() {', ' gl_Position = projectionMat * vec4( position, -1.0, 1.0 );', '}'].join('\\n');\nvar uiFS = ['precision mediump float;', 'uniform vec4 color;', 'void main() {', ' gl_FragColor = color;', '}'].join('\\n');\nvar DEG2RAD = Math.PI / 180.0;\nvar kAnglePerGearSection = 60;\nvar kOuterRimEndAngle = 12;\nvar kInnerRimBeginAngle = 20;\nvar kOuterRadius = 1;\nvar kMiddleRadius = 0.75;\nvar kInnerRadius = 0.3125;\nvar kCenterLineThicknessDp = 4;\nvar kButtonWidthDp = 28;\nvar kTouchSlopFactor = 1.5;\nfunction CardboardUI(gl) {\n this.gl = gl;\n this.attribs = {\n position: 0\n };\n this.program = linkProgram(gl, uiVS, uiFS, this.attribs);\n this.uniforms = getProgramUniforms(gl, this.program);\n this.vertexBuffer = gl.createBuffer();\n this.gearOffset = 0;\n this.gearVertexCount = 0;\n this.arrowOffset = 0;\n this.arrowVertexCount = 0;\n this.projMat = new Float32Array(16);\n this.listener = null;\n this.onResize();\n}\nCardboardUI.prototype.destroy = function () {\n var gl = this.gl;\n if (this.listener) {\n gl.canvas.removeEventListener('click', this.listener, false);\n }\n gl.deleteProgram(this.program);\n gl.deleteBuffer(this.vertexBuffer);\n};\nCardboardUI.prototype.listen = function (optionsCallback, backCallback) {\n var canvas = this.gl.canvas;\n this.listener = function (event) {\n var midline = canvas.clientWidth / 2;\n var buttonSize = kButtonWidthDp * kTouchSlopFactor;\n if (event.clientX > midline - buttonSize && event.clientX < midline + buttonSize && event.clientY > canvas.clientHeight - buttonSize) {\n optionsCallback(event);\n }\n else if (event.clientX < buttonSize && event.clientY < buttonSize) {\n backCallback(event);\n }\n };\n canvas.addEventListener('click', this.listener, false);\n};\nCardboardUI.prototype.onResize = function () {\n var gl = this.gl;\n var self = this;\n var glState = [gl.ARRAY_BUFFER_BINDING];\n glPreserveState(gl, glState, function (gl) {\n var vertices = [];\n var midline = gl.drawingBufferWidth / 2;\n var physicalPixels = Math.max(screen.width, screen.height) * window.devicePixelRatio;\n var scalingRatio = gl.drawingBufferWidth / physicalPixels;\n var dps = scalingRatio * window.devicePixelRatio;\n var lineWidth = kCenterLineThicknessDp * dps / 2;\n var buttonSize = kButtonWidthDp * kTouchSlopFactor * dps;\n var buttonScale = kButtonWidthDp * dps / 2;\n var buttonBorder = (kButtonWidthDp * kTouchSlopFactor - kButtonWidthDp) * dps;\n vertices.push(midline - lineWidth, buttonSize);\n vertices.push(midline - lineWidth, gl.drawingBufferHeight);\n vertices.push(midline + lineWidth, buttonSize);\n vertices.push(midline + lineWidth, gl.drawingBufferHeight);\n self.gearOffset = vertices.length / 2;\n function addGearSegment(theta, r) {\n var angle = (90 - theta) * DEG2RAD;\n var x = Math.cos(angle);\n var y = Math.sin(angle);\n vertices.push(kInnerRadius * x * buttonScale + midline, kInnerRadius * y * buttonScale + buttonScale);\n vertices.push(r * x * buttonScale + midline, r * y * buttonScale + buttonScale);\n }\n for (var i = 0; i <= 6; i++) {\n var segmentTheta = i * kAnglePerGearSection;\n addGearSegment(segmentTheta, kOuterRadius);\n addGearSegment(segmentTheta + kOuterRimEndAngle, kOuterRadius);\n addGearSegment(segmentTheta + kInnerRimBeginAngle, kMiddleRadius);\n addGearSegment(segmentTheta + (kAnglePerGearSection - kInnerRimBeginAngle), kMiddleRadius);\n addGearSegment(segmentTheta + (kAnglePerGearSection - kOuterRimEndAngle), kOuterRadius);\n }\n self.gearVertexCount = vertices.length / 2 - self.gearOffset;\n self.arrowOffset = vertices.length / 2;\n function addArrowVertex(x, y) {\n vertices.push(buttonBorder + x, gl.drawingBufferHeight - buttonBorder - y);\n }\n var angledLineWidth = lineWidth / Math.sin(45 * DEG2RAD);\n addArrowVertex(0, buttonScale);\n addArrowVertex(buttonScale, 0);\n addArrowVertex(buttonScale + angledLineWidth, angledLineWidth);\n addArrowVertex(angledLineWidth, buttonScale + angledLineWidth);\n addArrowVertex(angledLineWidth, buttonScale - angledLineWidth);\n addArrowVertex(0, buttonScale);\n addArrowVertex(buttonScale, buttonScale * 2);\n addArrowVertex(buttonScale + angledLineWidth, buttonScale * 2 - angledLineWidth);\n addArrowVertex(angledLineWidth, buttonScale - angledLineWidth);\n addArrowVertex(0, buttonScale);\n addArrowVertex(angledLineWidth, buttonScale - lineWidth);\n addArrowVertex(kButtonWidthDp * dps, buttonScale - lineWidth);\n addArrowVertex(angledLineWidth, buttonScale + lineWidth);\n addArrowVertex(kButtonWidthDp * dps, buttonScale + lineWidth);\n self.arrowVertexCount = vertices.length / 2 - self.arrowOffset;\n gl.bindBuffer(gl.ARRAY_BUFFER, self.vertexBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);\n });\n};\nCardboardUI.prototype.render = function () {\n var gl = this.gl;\n var self = this;\n var glState = [gl.CULL_FACE, gl.DEPTH_TEST, gl.BLEND, gl.SCISSOR_TEST, gl.STENCIL_TEST, gl.COLOR_WRITEMASK, gl.VIEWPORT, gl.CURRENT_PROGRAM, gl.ARRAY_BUFFER_BINDING];\n glPreserveState(gl, glState, function (gl) {\n gl.disable(gl.CULL_FACE);\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.BLEND);\n gl.disable(gl.SCISSOR_TEST);\n gl.disable(gl.STENCIL_TEST);\n gl.colorMask(true, true, true, true);\n gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);\n self.renderNoState();\n });\n};\nCardboardUI.prototype.renderNoState = function () {\n var gl = this.gl;\n gl.useProgram(this.program);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n gl.enableVertexAttribArray(this.attribs.position);\n gl.vertexAttribPointer(this.attribs.position, 2, gl.FLOAT, false, 8, 0);\n gl.uniform4f(this.uniforms.color, 1.0, 1.0, 1.0, 1.0);\n orthoMatrix(this.projMat, 0, gl.drawingBufferWidth, 0, gl.drawingBufferHeight, 0.1, 1024.0);\n gl.uniformMatrix4fv(this.uniforms.projectionMat, false, this.projMat);\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n gl.drawArrays(gl.TRIANGLE_STRIP, this.gearOffset, this.gearVertexCount);\n gl.drawArrays(gl.TRIANGLE_STRIP, this.arrowOffset, this.arrowVertexCount);\n};\nfunction Distortion(coefficients) {\n this.coefficients = coefficients;\n}\nDistortion.prototype.distortInverse = function (radius) {\n var r0 = 0;\n var r1 = 1;\n var dr0 = radius - this.distort(r0);\n while (Math.abs(r1 - r0) > 0.0001 ) {\n var dr1 = radius - this.distort(r1);\n var r2 = r1 - dr1 * ((r1 - r0) / (dr1 - dr0));\n r0 = r1;\n r1 = r2;\n dr0 = dr1;\n }\n return r1;\n};\nDistortion.prototype.distort = function (radius) {\n var r2 = radius * radius;\n var ret = 0;\n for (var i = 0; i < this.coefficients.length; i++) {\n ret = r2 * (ret + this.coefficients[i]);\n }\n return (ret + 1) * radius;\n};\nvar degToRad = Math.PI / 180;\nvar radToDeg = 180 / Math.PI;\nvar Vector3 = function Vector3(x, y, z) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n};\nVector3.prototype = {\n constructor: Vector3,\n set: function set(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n return this;\n },\n copy: function copy(v) {\n this.x = v.x;\n this.y = v.y;\n this.z = v.z;\n return this;\n },\n length: function length() {\n return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z);\n },\n normalize: function normalize() {\n var scalar = this.length();\n if (scalar !== 0) {\n var invScalar = 1 / scalar;\n this.multiplyScalar(invScalar);\n } else {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n }\n return this;\n },\n multiplyScalar: function multiplyScalar(scalar) {\n this.x *= scalar;\n this.y *= scalar;\n this.z *= scalar;\n },\n applyQuaternion: function applyQuaternion(q) {\n var x = this.x;\n var y = this.y;\n var z = this.z;\n var qx = q.x;\n var qy = q.y;\n var qz = q.z;\n var qw = q.w;\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z;\n this.x = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n this.y = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n this.z = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n return this;\n },\n dot: function dot(v) {\n return this.x * v.x + this.y * v.y + this.z * v.z;\n },\n crossVectors: function crossVectors(a, b) {\n var ax = a.x,\n ay = a.y,\n az = a.z;\n var bx = b.x,\n by = b.y,\n bz = b.z;\n this.x = ay * bz - az * by;\n this.y = az * bx - ax * bz;\n this.z = ax * by - ay * bx;\n return this;\n }\n};\nvar Quaternion = function Quaternion(x, y, z, w) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n this.w = w !== undefined ? w : 1;\n};\nQuaternion.prototype = {\n constructor: Quaternion,\n set: function set(x, y, z, w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n return this;\n },\n copy: function copy(quaternion) {\n this.x = quaternion.x;\n this.y = quaternion.y;\n this.z = quaternion.z;\n this.w = quaternion.w;\n return this;\n },\n setFromEulerXYZ: function setFromEulerXYZ(x, y, z) {\n var c1 = Math.cos(x / 2);\n var c2 = Math.cos(y / 2);\n var c3 = Math.cos(z / 2);\n var s1 = Math.sin(x / 2);\n var s2 = Math.sin(y / 2);\n var s3 = Math.sin(z / 2);\n this.x = s1 * c2 * c3 + c1 * s2 * s3;\n this.y = c1 * s2 * c3 - s1 * c2 * s3;\n this.z = c1 * c2 * s3 + s1 * s2 * c3;\n this.w = c1 * c2 * c3 - s1 * s2 * s3;\n return this;\n },\n setFromEulerYXZ: function setFromEulerYXZ(x, y, z) {\n var c1 = Math.cos(x / 2);\n var c2 = Math.cos(y / 2);\n var c3 = Math.cos(z / 2);\n var s1 = Math.sin(x / 2);\n var s2 = Math.sin(y / 2);\n var s3 = Math.sin(z / 2);\n this.x = s1 * c2 * c3 + c1 * s2 * s3;\n this.y = c1 * s2 * c3 - s1 * c2 * s3;\n this.z = c1 * c2 * s3 - s1 * s2 * c3;\n this.w = c1 * c2 * c3 + s1 * s2 * s3;\n return this;\n },\n setFromAxisAngle: function setFromAxisAngle(axis, angle) {\n var halfAngle = angle / 2,\n s = Math.sin(halfAngle);\n this.x = axis.x * s;\n this.y = axis.y * s;\n this.z = axis.z * s;\n this.w = Math.cos(halfAngle);\n return this;\n },\n multiply: function multiply(q) {\n return this.multiplyQuaternions(this, q);\n },\n multiplyQuaternions: function multiplyQuaternions(a, b) {\n var qax = a.x,\n qay = a.y,\n qaz = a.z,\n qaw = a.w;\n var qbx = b.x,\n qby = b.y,\n qbz = b.z,\n qbw = b.w;\n this.x = qax * qbw + qaw * qbx + qay * qbz - qaz * qby;\n this.y = qay * qbw + qaw * qby + qaz * qbx - qax * qbz;\n this.z = qaz * qbw + qaw * qbz + qax * qby - qay * qbx;\n this.w = qaw * qbw - qax * qbx - qay * qby - qaz * qbz;\n return this;\n },\n inverse: function inverse() {\n this.x *= -1;\n this.y *= -1;\n this.z *= -1;\n this.normalize();\n return this;\n },\n normalize: function normalize() {\n var l = Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w);\n if (l === 0) {\n this.x = 0;\n this.y = 0;\n this.z = 0;\n this.w = 1;\n } else {\n l = 1 / l;\n this.x = this.x * l;\n this.y = this.y * l;\n this.z = this.z * l;\n this.w = this.w * l;\n }\n return this;\n },\n slerp: function slerp(qb, t) {\n if (t === 0) return this;\n if (t === 1) return this.copy(qb);\n var x = this.x,\n y = this.y,\n z = this.z,\n w = this.w;\n var cosHalfTheta = w * qb.w + x * qb.x + y * qb.y + z * qb.z;\n if (cosHalfTheta < 0) {\n this.w = -qb.w;\n this.x = -qb.x;\n this.y = -qb.y;\n this.z = -qb.z;\n cosHalfTheta = -cosHalfTheta;\n } else {\n this.copy(qb);\n }\n if (cosHalfTheta >= 1.0) {\n this.w = w;\n this.x = x;\n this.y = y;\n this.z = z;\n return this;\n }\n var halfTheta = Math.acos(cosHalfTheta);\n var sinHalfTheta = Math.sqrt(1.0 - cosHalfTheta * cosHalfTheta);\n if (Math.abs(sinHalfTheta) < 0.001) {\n this.w = 0.5 * (w + this.w);\n this.x = 0.5 * (x + this.x);\n this.y = 0.5 * (y + this.y);\n this.z = 0.5 * (z + this.z);\n return this;\n }\n var ratioA = Math.sin((1 - t) * halfTheta) / sinHalfTheta,\n ratioB = Math.sin(t * halfTheta) / sinHalfTheta;\n this.w = w * ratioA + this.w * ratioB;\n this.x = x * ratioA + this.x * ratioB;\n this.y = y * ratioA + this.y * ratioB;\n this.z = z * ratioA + this.z * ratioB;\n return this;\n },\n setFromUnitVectors: function () {\n var v1, r;\n var EPS = 0.000001;\n return function (vFrom, vTo) {\n if (v1 === undefined) v1 = new Vector3();\n r = vFrom.dot(vTo) + 1;\n if (r < EPS) {\n r = 0;\n if (Math.abs(vFrom.x) > Math.abs(vFrom.z)) {\n v1.set(-vFrom.y, vFrom.x, 0);\n } else {\n v1.set(0, -vFrom.z, vFrom.y);\n }\n } else {\n v1.crossVectors(vFrom, vTo);\n }\n this.x = v1.x;\n this.y = v1.y;\n this.z = v1.z;\n this.w = r;\n this.normalize();\n return this;\n };\n }()\n};\nfunction Device(params) {\n this.width = params.width || getScreenWidth();\n this.height = params.height || getScreenHeight();\n this.widthMeters = params.widthMeters;\n this.heightMeters = params.heightMeters;\n this.bevelMeters = params.bevelMeters;\n}\nvar DEFAULT_ANDROID = new Device({\n widthMeters: 0.110,\n heightMeters: 0.062,\n bevelMeters: 0.004\n});\nvar DEFAULT_IOS = new Device({\n widthMeters: 0.1038,\n heightMeters: 0.0584,\n bevelMeters: 0.004\n});\nvar Viewers = {\n CardboardV1: new CardboardViewer({\n id: 'CardboardV1',\n label: 'Cardboard I/O 2014',\n fov: 40,\n interLensDistance: 0.060,\n baselineLensDistance: 0.035,\n screenLensDistance: 0.042,\n distortionCoefficients: [0.441, 0.156],\n inverseCoefficients: [-0.4410035, 0.42756155, -0.4804439, 0.5460139, -0.58821183, 0.5733938, -0.48303202, 0.33299083, -0.17573841, 0.0651772, -0.01488963, 0.001559834]\n }),\n CardboardV2: new CardboardViewer({\n id: 'CardboardV2',\n label: 'Cardboard I/O 2015',\n fov: 60,\n interLensDistance: 0.064,\n baselineLensDistance: 0.035,\n screenLensDistance: 0.039,\n distortionCoefficients: [0.34, 0.55],\n inverseCoefficients: [-0.33836704, -0.18162185, 0.862655, -1.2462051, 1.0560602, -0.58208317, 0.21609078, -0.05444823, 0.009177956, -9.904169E-4, 6.183535E-5, -1.6981803E-6]\n })\n};\nfunction DeviceInfo(deviceParams, additionalViewers) {\n this.viewer = Viewers.CardboardV2;\n this.updateDeviceParams(deviceParams);\n this.distortion = new Distortion(this.viewer.distortionCoefficients);\n for (var i = 0; i < additionalViewers.length; i++) {\n var viewer = additionalViewers[i];\n Viewers[viewer.id] = new CardboardViewer(viewer);\n }\n}\nDeviceInfo.prototype.updateDeviceParams = function (deviceParams) {\n this.device = this.determineDevice_(deviceParams) || this.device;\n};\nDeviceInfo.prototype.getDevice = function () {\n return this.device;\n};\nDeviceInfo.prototype.setViewer = function (viewer) {\n this.viewer = viewer;\n this.distortion = new Distortion(this.viewer.distortionCoefficients);\n};\nDeviceInfo.prototype.determineDevice_ = function (deviceParams) {\n if (!deviceParams) {\n if (isIOS()) {\n console.warn('Using fallback iOS device measurements.');\n return DEFAULT_IOS;\n } else {\n console.warn('Using fallback Android device measurements.');\n return DEFAULT_ANDROID;\n }\n }\n var METERS_PER_INCH = 0.0254;\n var metersPerPixelX = METERS_PER_INCH / deviceParams.xdpi;\n var metersPerPixelY = METERS_PER_INCH / deviceParams.ydpi;\n var width = getScreenWidth();\n var height = getScreenHeight();\n return new Device({\n widthMeters: metersPerPixelX * width,\n heightMeters: metersPerPixelY * height,\n bevelMeters: deviceParams.bevelMm * 0.001\n });\n};\nDeviceInfo.prototype.getDistortedFieldOfViewLeftEye = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var eyeToScreenDistance = viewer.screenLensDistance;\n var outerDist = (device.widthMeters - viewer.interLensDistance) / 2;\n var innerDist = viewer.interLensDistance / 2;\n var bottomDist = viewer.baselineLensDistance - device.bevelMeters;\n var topDist = device.heightMeters - bottomDist;\n var outerAngle = radToDeg * Math.atan(distortion.distort(outerDist / eyeToScreenDistance));\n var innerAngle = radToDeg * Math.atan(distortion.distort(innerDist / eyeToScreenDistance));\n var bottomAngle = radToDeg * Math.atan(distortion.distort(bottomDist / eyeToScreenDistance));\n var topAngle = radToDeg * Math.atan(distortion.distort(topDist / eyeToScreenDistance));\n return {\n leftDegrees: Math.min(outerAngle, viewer.fov),\n rightDegrees: Math.min(innerAngle, viewer.fov),\n downDegrees: Math.min(bottomAngle, viewer.fov),\n upDegrees: Math.min(topAngle, viewer.fov)\n };\n};\nDeviceInfo.prototype.getLeftEyeVisibleTanAngles = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var fovLeft = Math.tan(-degToRad * viewer.fov);\n var fovTop = Math.tan(degToRad * viewer.fov);\n var fovRight = Math.tan(degToRad * viewer.fov);\n var fovBottom = Math.tan(-degToRad * viewer.fov);\n var halfWidth = device.widthMeters / 4;\n var halfHeight = device.heightMeters / 2;\n var verticalLensOffset = viewer.baselineLensDistance - device.bevelMeters - halfHeight;\n var centerX = viewer.interLensDistance / 2 - halfWidth;\n var centerY = -verticalLensOffset;\n var centerZ = viewer.screenLensDistance;\n var screenLeft = distortion.distort((centerX - halfWidth) / centerZ);\n var screenTop = distortion.distort((centerY + halfHeight) / centerZ);\n var screenRight = distortion.distort((centerX + halfWidth) / centerZ);\n var screenBottom = distortion.distort((centerY - halfHeight) / centerZ);\n var result = new Float32Array(4);\n result[0] = Math.max(fovLeft, screenLeft);\n result[1] = Math.min(fovTop, screenTop);\n result[2] = Math.min(fovRight, screenRight);\n result[3] = Math.max(fovBottom, screenBottom);\n return result;\n};\nDeviceInfo.prototype.getLeftEyeNoLensTanAngles = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var result = new Float32Array(4);\n var fovLeft = distortion.distortInverse(Math.tan(-degToRad * viewer.fov));\n var fovTop = distortion.distortInverse(Math.tan(degToRad * viewer.fov));\n var fovRight = distortion.distortInverse(Math.tan(degToRad * viewer.fov));\n var fovBottom = distortion.distortInverse(Math.tan(-degToRad * viewer.fov));\n var halfWidth = device.widthMeters / 4;\n var halfHeight = device.heightMeters / 2;\n var verticalLensOffset = viewer.baselineLensDistance - device.bevelMeters - halfHeight;\n var centerX = viewer.interLensDistance / 2 - halfWidth;\n var centerY = -verticalLensOffset;\n var centerZ = viewer.screenLensDistance;\n var screenLeft = (centerX - halfWidth) / centerZ;\n var screenTop = (centerY + halfHeight) / centerZ;\n var screenRight = (centerX + halfWidth) / centerZ;\n var screenBottom = (centerY - halfHeight) / centerZ;\n result[0] = Math.max(fovLeft, screenLeft);\n result[1] = Math.min(fovTop, screenTop);\n result[2] = Math.min(fovRight, screenRight);\n result[3] = Math.max(fovBottom, screenBottom);\n return result;\n};\nDeviceInfo.prototype.getLeftEyeVisibleScreenRect = function (undistortedFrustum) {\n var viewer = this.viewer;\n var device = this.device;\n var dist = viewer.screenLensDistance;\n var eyeX = (device.widthMeters - viewer.interLensDistance) / 2;\n var eyeY = viewer.baselineLensDistance - device.bevelMeters;\n var left = (undistortedFrustum[0] * dist + eyeX) / device.widthMeters;\n var top = (undistortedFrustum[1] * dist + eyeY) / device.heightMeters;\n var right = (undistortedFrustum[2] * dist + eyeX) / device.widthMeters;\n var bottom = (undistortedFrustum[3] * dist + eyeY) / device.heightMeters;\n return {\n x: left,\n y: bottom,\n width: right - left,\n height: top - bottom\n };\n};\nDeviceInfo.prototype.getFieldOfViewLeftEye = function (opt_isUndistorted) {\n return opt_isUndistorted ? this.getUndistortedFieldOfViewLeftEye() : this.getDistortedFieldOfViewLeftEye();\n};\nDeviceInfo.prototype.getFieldOfViewRightEye = function (opt_isUndistorted) {\n var fov = this.getFieldOfViewLeftEye(opt_isUndistorted);\n return {\n leftDegrees: fov.rightDegrees,\n rightDegrees: fov.leftDegrees,\n upDegrees: fov.upDegrees,\n downDegrees: fov.downDegrees\n };\n};\nDeviceInfo.prototype.getUndistortedFieldOfViewLeftEye = function () {\n var p = this.getUndistortedParams_();\n return {\n leftDegrees: radToDeg * Math.atan(p.outerDist),\n rightDegrees: radToDeg * Math.atan(p.innerDist),\n downDegrees: radToDeg * Math.atan(p.bottomDist),\n upDegrees: radToDeg * Math.atan(p.topDist)\n };\n};\nDeviceInfo.prototype.getUndistortedViewportLeftEye = function () {\n var p = this.getUndistortedParams_();\n var viewer = this.viewer;\n var device = this.device;\n var eyeToScreenDistance = viewer.screenLensDistance;\n var screenWidth = device.widthMeters / eyeToScreenDistance;\n var screenHeight = device.heightMeters / eyeToScreenDistance;\n var xPxPerTanAngle = device.width / screenWidth;\n var yPxPerTanAngle = device.height / screenHeight;\n var x = Math.round((p.eyePosX - p.outerDist) * xPxPerTanAngle);\n var y = Math.round((p.eyePosY - p.bottomDist) * yPxPerTanAngle);\n return {\n x: x,\n y: y,\n width: Math.round((p.eyePosX + p.innerDist) * xPxPerTanAngle) - x,\n height: Math.round((p.eyePosY + p.topDist) * yPxPerTanAngle) - y\n };\n};\nDeviceInfo.prototype.getUndistortedParams_ = function () {\n var viewer = this.viewer;\n var device = this.device;\n var distortion = this.distortion;\n var eyeToScreenDistance = viewer.screenLensDistance;\n var halfLensDistance = viewer.interLensDistance / 2 / eyeToScreenDistance;\n var screenWidth = device.widthMeters / eyeToScreenDistance;\n var screenHeight = device.heightMeters / eyeToScreenDistance;\n var eyePosX = screenWidth / 2 - halfLensDistance;\n var eyePosY = (viewer.baselineLensDistance - device.bevelMeters) / eyeToScreenDistance;\n var maxFov = viewer.fov;\n var viewerMax = distortion.distortInverse(Math.tan(degToRad * maxFov));\n var outerDist = Math.min(eyePosX, viewerMax);\n var innerDist = Math.min(halfLensDistance, viewerMax);\n var bottomDist = Math.min(eyePosY, viewerMax);\n var topDist = Math.min(screenHeight - eyePosY, viewerMax);\n return {\n outerDist: outerDist,\n innerDist: innerDist,\n topDist: topDist,\n bottomDist: bottomDist,\n eyePosX: eyePosX,\n eyePosY: eyePosY\n };\n};\nfunction CardboardViewer(params) {\n this.id = params.id;\n this.label = params.label;\n this.fov = params.fov;\n this.interLensDistance = params.interLensDistance;\n this.baselineLensDistance = params.baselineLensDistance;\n this.screenLensDistance = params.screenLensDistance;\n this.distortionCoefficients = params.distortionCoefficients;\n this.inverseCoefficients = params.inverseCoefficients;\n}\nDeviceInfo.Viewers = Viewers;\nvar format = 1;\nvar last_updated = \"2019-11-09T17:36:14Z\";\nvar devices = [{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/Nexus 7/*\"},{\"ua\":\"Nexus 7\"}],\"dpi\":[320.8,323],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/ASUS_X00PD/*\"},{\"ua\":\"ASUS_X00PD\"}],\"dpi\":245,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/ASUS_X008D/*\"},{\"ua\":\"ASUS_X008D\"}],\"dpi\":282,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"asus/*/ASUS_Z00AD/*\"},{\"ua\":\"ASUS_Z00AD\"}],\"dpi\":[403,404.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 2 XL/*\"},{\"ua\":\"Pixel 2 XL\"}],\"dpi\":537.9,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 3 XL/*\"},{\"ua\":\"Pixel 3 XL\"}],\"dpi\":[558.5,553.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel XL/*\"},{\"ua\":\"Pixel XL\"}],\"dpi\":[537.9,533],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 3/*\"},{\"ua\":\"Pixel 3\"}],\"dpi\":442.4,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel 2/*\"},{\"ua\":\"Pixel 2\"}],\"dpi\":441,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Google/*/Pixel/*\"},{\"ua\":\"Pixel\"}],\"dpi\":[432.6,436.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC6435LVW/*\"},{\"ua\":\"HTC6435LVW\"}],\"dpi\":[449.7,443.3],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One XL/*\"},{\"ua\":\"HTC One XL\"}],\"dpi\":[315.3,314.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"htc/*/Nexus 9/*\"},{\"ua\":\"Nexus 9\"}],\"dpi\":289,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One M9/*\"},{\"ua\":\"HTC One M9\"}],\"dpi\":[442.5,443.3],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One_M8/*\"},{\"ua\":\"HTC One_M8\"}],\"dpi\":[449.7,447.4],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"HTC/*/HTC One/*\"},{\"ua\":\"HTC One\"}],\"dpi\":472.8,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/Nexus 6P/*\"},{\"ua\":\"Nexus 6P\"}],\"dpi\":[515.1,518],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/BLN-L24/*\"},{\"ua\":\"HONORBLN-L24\"}],\"dpi\":480,\"bw\":4,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/BKL-L09/*\"},{\"ua\":\"BKL-L09\"}],\"dpi\":403,\"bw\":3.47,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LENOVO/*/Lenovo PB2-690Y/*\"},{\"ua\":\"Lenovo PB2-690Y\"}],\"dpi\":[457.2,454.713],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/Nexus 5X/*\"},{\"ua\":\"Nexus 5X\"}],\"dpi\":[422,419.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LGMS345/*\"},{\"ua\":\"LGMS345\"}],\"dpi\":[221.7,219.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LG-D800/*\"},{\"ua\":\"LG-D800\"}],\"dpi\":[422,424.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LG-D850/*\"},{\"ua\":\"LG-D850\"}],\"dpi\":[537.9,541.9],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/VS985 4G/*\"},{\"ua\":\"VS985 4G\"}],\"dpi\":[537.9,535.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/Nexus 5/*\"},{\"ua\":\"Nexus 5 B\"}],\"dpi\":[442.4,444.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/Nexus 4/*\"},{\"ua\":\"Nexus 4\"}],\"dpi\":[319.8,318.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LG-P769/*\"},{\"ua\":\"LG-P769\"}],\"dpi\":[240.6,247.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LGMS323/*\"},{\"ua\":\"LGMS323\"}],\"dpi\":[206.6,204.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"LGE/*/LGLS996/*\"},{\"ua\":\"LGLS996\"}],\"dpi\":[403.4,401.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Micromax/*/4560MMX/*\"},{\"ua\":\"4560MMX\"}],\"dpi\":[240,219.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Micromax/*/A250/*\"},{\"ua\":\"Micromax A250\"}],\"dpi\":[480,446.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Micromax/*/Micromax AQ4501/*\"},{\"ua\":\"Micromax AQ4501\"}],\"dpi\":240,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/G5/*\"},{\"ua\":\"Moto G (5) Plus\"}],\"dpi\":[403.4,403],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/DROID RAZR/*\"},{\"ua\":\"DROID RAZR\"}],\"dpi\":[368.1,256.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT830C/*\"},{\"ua\":\"XT830C\"}],\"dpi\":[254,255.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1021/*\"},{\"ua\":\"XT1021\"}],\"dpi\":[254,256.7],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1023/*\"},{\"ua\":\"XT1023\"}],\"dpi\":[254,256.7],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1028/*\"},{\"ua\":\"XT1028\"}],\"dpi\":[326.6,327.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1034/*\"},{\"ua\":\"XT1034\"}],\"dpi\":[326.6,328.4],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1053/*\"},{\"ua\":\"XT1053\"}],\"dpi\":[315.3,316.1],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1562/*\"},{\"ua\":\"XT1562\"}],\"dpi\":[403.4,402.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/Nexus 6/*\"},{\"ua\":\"Nexus 6 B\"}],\"dpi\":[494.3,489.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1063/*\"},{\"ua\":\"XT1063\"}],\"dpi\":[295,296.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1064/*\"},{\"ua\":\"XT1064\"}],\"dpi\":[295,295.6],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1092/*\"},{\"ua\":\"XT1092\"}],\"dpi\":[422,424.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/XT1095/*\"},{\"ua\":\"XT1095\"}],\"dpi\":[422,423.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"motorola/*/G4/*\"},{\"ua\":\"Moto G (4)\"}],\"dpi\":401,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/A0001/*\"},{\"ua\":\"A0001\"}],\"dpi\":[403.4,401],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE E1001/*\"},{\"ua\":\"ONE E1001\"}],\"dpi\":[442.4,441.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE E1003/*\"},{\"ua\":\"ONE E1003\"}],\"dpi\":[442.4,441.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE E1005/*\"},{\"ua\":\"ONE E1005\"}],\"dpi\":[442.4,441.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A2001/*\"},{\"ua\":\"ONE A2001\"}],\"dpi\":[391.9,405.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A2003/*\"},{\"ua\":\"ONE A2003\"}],\"dpi\":[391.9,405.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A2005/*\"},{\"ua\":\"ONE A2005\"}],\"dpi\":[391.9,405.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A3000/*\"},{\"ua\":\"ONEPLUS A3000\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A3003/*\"},{\"ua\":\"ONEPLUS A3003\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A3010/*\"},{\"ua\":\"ONEPLUS A3010\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A5000/*\"},{\"ua\":\"ONEPLUS A5000 \"}],\"dpi\":[403.411,399.737],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONE A5010/*\"},{\"ua\":\"ONEPLUS A5010\"}],\"dpi\":[403,400],\"bw\":2,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6000/*\"},{\"ua\":\"ONEPLUS A6000\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6003/*\"},{\"ua\":\"ONEPLUS A6003\"}],\"dpi\":401,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6010/*\"},{\"ua\":\"ONEPLUS A6010\"}],\"dpi\":401,\"bw\":2,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OnePlus/*/ONEPLUS A6013/*\"},{\"ua\":\"ONEPLUS A6013\"}],\"dpi\":401,\"bw\":2,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"OPPO/*/X909/*\"},{\"ua\":\"X909\"}],\"dpi\":[442.4,444.1],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9082/*\"},{\"ua\":\"GT-I9082\"}],\"dpi\":[184.7,185.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G360P/*\"},{\"ua\":\"SM-G360P\"}],\"dpi\":[196.7,205.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/Nexus S/*\"},{\"ua\":\"Nexus S\"}],\"dpi\":[234.5,229.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9300/*\"},{\"ua\":\"GT-I9300\"}],\"dpi\":[304.8,303.9],\"bw\":5,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-T230NU/*\"},{\"ua\":\"SM-T230NU\"}],\"dpi\":216,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SGH-T399/*\"},{\"ua\":\"SGH-T399\"}],\"dpi\":[217.7,231.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SGH-M919/*\"},{\"ua\":\"SGH-M919\"}],\"dpi\":[440.8,437.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N9005/*\"},{\"ua\":\"SM-N9005\"}],\"dpi\":[386.4,387],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SAMSUNG-SM-N900A/*\"},{\"ua\":\"SAMSUNG-SM-N900A\"}],\"dpi\":[386.4,387.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9500/*\"},{\"ua\":\"GT-I9500\"}],\"dpi\":[442.5,443.3],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9505/*\"},{\"ua\":\"GT-I9505\"}],\"dpi\":439.4,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G900F/*\"},{\"ua\":\"SM-G900F\"}],\"dpi\":[415.6,431.6],\"bw\":5,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G900M/*\"},{\"ua\":\"SM-G900M\"}],\"dpi\":[415.6,431.6],\"bw\":5,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G800F/*\"},{\"ua\":\"SM-G800F\"}],\"dpi\":326.8,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G906S/*\"},{\"ua\":\"SM-G906S\"}],\"dpi\":[562.7,572.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9300/*\"},{\"ua\":\"GT-I9300\"}],\"dpi\":[306.7,304.8],\"bw\":5,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-T535/*\"},{\"ua\":\"SM-T535\"}],\"dpi\":[142.6,136.4],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N920C/*\"},{\"ua\":\"SM-N920C\"}],\"dpi\":[515.1,518.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N920P/*\"},{\"ua\":\"SM-N920P\"}],\"dpi\":[386.3655,390.144],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N920W8/*\"},{\"ua\":\"SM-N920W8\"}],\"dpi\":[515.1,518.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9300I/*\"},{\"ua\":\"GT-I9300I\"}],\"dpi\":[304.8,305.8],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-I9195/*\"},{\"ua\":\"GT-I9195\"}],\"dpi\":[249.4,256.7],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SPH-L520/*\"},{\"ua\":\"SPH-L520\"}],\"dpi\":[249.4,255.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SAMSUNG-SGH-I717/*\"},{\"ua\":\"SAMSUNG-SGH-I717\"}],\"dpi\":285.8,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SPH-D710/*\"},{\"ua\":\"SPH-D710\"}],\"dpi\":[217.7,204.2],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/GT-N7100/*\"},{\"ua\":\"GT-N7100\"}],\"dpi\":265.1,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SCH-I605/*\"},{\"ua\":\"SCH-I605\"}],\"dpi\":265.1,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/Galaxy Nexus/*\"},{\"ua\":\"Galaxy Nexus\"}],\"dpi\":[315.3,314.2],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N910H/*\"},{\"ua\":\"SM-N910H\"}],\"dpi\":[515.1,518],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-N910C/*\"},{\"ua\":\"SM-N910C\"}],\"dpi\":[515.2,520.2],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G130M/*\"},{\"ua\":\"SM-G130M\"}],\"dpi\":[165.9,164.8],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G928I/*\"},{\"ua\":\"SM-G928I\"}],\"dpi\":[515.1,518.4],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G920F/*\"},{\"ua\":\"SM-G920F\"}],\"dpi\":580.6,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G920P/*\"},{\"ua\":\"SM-G920P\"}],\"dpi\":[522.5,577],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G925F/*\"},{\"ua\":\"SM-G925F\"}],\"dpi\":580.6,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G925V/*\"},{\"ua\":\"SM-G925V\"}],\"dpi\":[522.5,576.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G930F/*\"},{\"ua\":\"SM-G930F\"}],\"dpi\":576.6,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G935F/*\"},{\"ua\":\"SM-G935F\"}],\"dpi\":533,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G950F/*\"},{\"ua\":\"SM-G950F\"}],\"dpi\":[562.707,565.293],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G955U/*\"},{\"ua\":\"SM-G955U\"}],\"dpi\":[522.514,525.762],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G955F/*\"},{\"ua\":\"SM-G955F\"}],\"dpi\":[522.514,525.762],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960F/*\"},{\"ua\":\"SM-G960F\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G9600/*\"},{\"ua\":\"SM-G9600\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960T/*\"},{\"ua\":\"SM-G960T\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960N/*\"},{\"ua\":\"SM-G960N\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960U/*\"},{\"ua\":\"SM-G960U\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G9608/*\"},{\"ua\":\"SM-G9608\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960FD/*\"},{\"ua\":\"SM-G960FD\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G960W/*\"},{\"ua\":\"SM-G960W\"}],\"dpi\":[569.575,571.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G965F/*\"},{\"ua\":\"SM-G965F\"}],\"dpi\":529,\"bw\":2,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/C6903/*\"},{\"ua\":\"C6903\"}],\"dpi\":[442.5,443.3],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/D6653/*\"},{\"ua\":\"D6653\"}],\"dpi\":[428.6,427.6],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/E6653/*\"},{\"ua\":\"E6653\"}],\"dpi\":[428.6,425.7],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/E6853/*\"},{\"ua\":\"E6853\"}],\"dpi\":[403.4,401.9],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Sony/*/SGP321/*\"},{\"ua\":\"SGP321\"}],\"dpi\":[224.7,224.1],\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"TCT/*/ALCATEL ONE TOUCH Fierce/*\"},{\"ua\":\"ALCATEL ONE TOUCH Fierce\"}],\"dpi\":[240,247.5],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"THL/*/thl 5000/*\"},{\"ua\":\"thl 5000\"}],\"dpi\":[480,443.3],\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Fly/*/IQ4412/*\"},{\"ua\":\"IQ4412\"}],\"dpi\":307.9,\"bw\":3,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"ZTE/*/ZTE Blade L2/*\"},{\"ua\":\"ZTE Blade L2\"}],\"dpi\":240,\"bw\":3,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"BENEVE/*/VR518/*\"},{\"ua\":\"VR518\"}],\"dpi\":480,\"bw\":3,\"ac\":500},{\"type\":\"ios\",\"rules\":[{\"res\":[640,960]}],\"dpi\":[325.1,328.4],\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[640,1136]}],\"dpi\":[317.1,320.2],\"bw\":3,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[750,1334]}],\"dpi\":326.4,\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[1242,2208]}],\"dpi\":[453.6,458.4],\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[1125,2001]}],\"dpi\":[410.9,415.4],\"bw\":4,\"ac\":1000},{\"type\":\"ios\",\"rules\":[{\"res\":[1125,2436]}],\"dpi\":458,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Huawei/*/EML-L29/*\"},{\"ua\":\"EML-L29\"}],\"dpi\":428,\"bw\":3.45,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"Nokia/*/Nokia 7.1/*\"},{\"ua\":\"Nokia 7.1\"}],\"dpi\":[432,431.9],\"bw\":3,\"ac\":500},{\"type\":\"ios\",\"rules\":[{\"res\":[1242,2688]}],\"dpi\":458,\"bw\":4,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G570M/*\"},{\"ua\":\"SM-G570M\"}],\"dpi\":320,\"bw\":3.684,\"ac\":1000},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G970F/*\"},{\"ua\":\"SM-G970F\"}],\"dpi\":438,\"bw\":2.281,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G973F/*\"},{\"ua\":\"SM-G973F\"}],\"dpi\":550,\"bw\":2.002,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G975F/*\"},{\"ua\":\"SM-G975F\"}],\"dpi\":522,\"bw\":2.054,\"ac\":500},{\"type\":\"android\",\"rules\":[{\"mdmh\":\"samsung/*/SM-G977F/*\"},{\"ua\":\"SM-G977F\"}],\"dpi\":505,\"bw\":2.334,\"ac\":500},{\"type\":\"ios\",\"rules\":[{\"res\":[828,1792]}],\"dpi\":326,\"bw\":5,\"ac\":500}];\nvar DPDB_CACHE = {\n\tformat: format,\n\tlast_updated: last_updated,\n\tdevices: devices\n};\nfunction Dpdb(url, onDeviceParamsUpdated) {\n this.dpdb = DPDB_CACHE;\n this.recalculateDeviceParams_();\n if (url) {\n this.onDeviceParamsUpdated = onDeviceParamsUpdated;\n var xhr = new XMLHttpRequest();\n var obj = this;\n xhr.open('GET', url, true);\n xhr.addEventListener('load', function () {\n obj.loading = false;\n if (xhr.status >= 200 && xhr.status <= 299) {\n obj.dpdb = JSON.parse(xhr.response);\n obj.recalculateDeviceParams_();\n } else {\n console.error('Error loading online DPDB!');\n }\n });\n xhr.send();\n }\n}\nDpdb.prototype.getDeviceParams = function () {\n return this.deviceParams;\n};\nDpdb.prototype.recalculateDeviceParams_ = function () {\n var newDeviceParams = this.calcDeviceParams_();\n if (newDeviceParams) {\n this.deviceParams = newDeviceParams;\n if (this.onDeviceParamsUpdated) {\n this.onDeviceParamsUpdated(this.deviceParams);\n }\n } else {\n console.error('Failed to recalculate device parameters.');\n }\n};\nDpdb.prototype.calcDeviceParams_ = function () {\n var db = this.dpdb;\n if (!db) {\n console.error('DPDB not available.');\n return null;\n }\n if (db.format != 1) {\n console.error('DPDB has unexpected format version.');\n return null;\n }\n if (!db.devices || !db.devices.length) {\n console.error('DPDB does not have a devices section.');\n return null;\n }\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n var width = getScreenWidth();\n var height = getScreenHeight();\n if (!db.devices) {\n console.error('DPDB has no devices section.');\n return null;\n }\n for (var i = 0; i < db.devices.length; i++) {\n var device = db.devices[i];\n if (!device.rules) {\n console.warn('Device[' + i + '] has no rules section.');\n continue;\n }\n if (device.type != 'ios' && device.type != 'android') {\n console.warn('Device[' + i + '] has invalid type.');\n continue;\n }\n if (isIOS() != (device.type == 'ios')) continue;\n var matched = false;\n for (var j = 0; j < device.rules.length; j++) {\n var rule = device.rules[j];\n if (this.ruleMatches_(rule, userAgent, width, height)) {\n matched = true;\n break;\n }\n }\n if (!matched) continue;\n var xdpi = device.dpi[0] || device.dpi;\n var ydpi = device.dpi[1] || device.dpi;\n return new DeviceParams({ xdpi: xdpi, ydpi: ydpi, bevelMm: device.bw });\n }\n console.warn('No DPDB device match.');\n return null;\n};\nDpdb.prototype.ruleMatches_ = function (rule, ua, screenWidth, screenHeight) {\n if (!rule.ua && !rule.res) return false;\n if (rule.ua && rule.ua.substring(0, 2) === 'SM') rule.ua = rule.ua.substring(0, 7);\n if (rule.ua && ua.indexOf(rule.ua) < 0) return false;\n if (rule.res) {\n if (!rule.res[0] || !rule.res[1]) return false;\n var resX = rule.res[0];\n var resY = rule.res[1];\n if (Math.min(screenWidth, screenHeight) != Math.min(resX, resY) || Math.max(screenWidth, screenHeight) != Math.max(resX, resY)) {\n return false;\n }\n }\n return true;\n};\nfunction DeviceParams(params) {\n this.xdpi = params.xdpi;\n this.ydpi = params.ydpi;\n this.bevelMm = params.bevelMm;\n}\nfunction SensorSample(sample, timestampS) {\n this.set(sample, timestampS);\n}\nSensorSample.prototype.set = function (sample, timestampS) {\n this.sample = sample;\n this.timestampS = timestampS;\n};\nSensorSample.prototype.copy = function (sensorSample) {\n this.set(sensorSample.sample, sensorSample.timestampS);\n};\nfunction ComplementaryFilter(kFilter, isDebug) {\n this.kFilter = kFilter;\n this.isDebug = isDebug;\n this.currentAccelMeasurement = new SensorSample();\n this.currentGyroMeasurement = new SensorSample();\n this.previousGyroMeasurement = new SensorSample();\n if (isIOS()) {\n this.filterQ = new Quaternion(-1, 0, 0, 1);\n } else {\n this.filterQ = new Quaternion(1, 0, 0, 1);\n }\n this.previousFilterQ = new Quaternion();\n this.previousFilterQ.copy(this.filterQ);\n this.accelQ = new Quaternion();\n this.isOrientationInitialized = false;\n this.estimatedGravity = new Vector3();\n this.measuredGravity = new Vector3();\n this.gyroIntegralQ = new Quaternion();\n}\nComplementaryFilter.prototype.addAccelMeasurement = function (vector, timestampS) {\n this.currentAccelMeasurement.set(vector, timestampS);\n};\nComplementaryFilter.prototype.addGyroMeasurement = function (vector, timestampS) {\n this.currentGyroMeasurement.set(vector, timestampS);\n var deltaT = timestampS - this.previousGyroMeasurement.timestampS;\n if (isTimestampDeltaValid(deltaT)) {\n this.run_();\n }\n this.previousGyroMeasurement.copy(this.currentGyroMeasurement);\n};\nComplementaryFilter.prototype.run_ = function () {\n if (!this.isOrientationInitialized) {\n this.accelQ = this.accelToQuaternion_(this.currentAccelMeasurement.sample);\n this.previousFilterQ.copy(this.accelQ);\n this.isOrientationInitialized = true;\n return;\n }\n var deltaT = this.currentGyroMeasurement.timestampS - this.previousGyroMeasurement.timestampS;\n var gyroDeltaQ = this.gyroToQuaternionDelta_(this.currentGyroMeasurement.sample, deltaT);\n this.gyroIntegralQ.multiply(gyroDeltaQ);\n this.filterQ.copy(this.previousFilterQ);\n this.filterQ.multiply(gyroDeltaQ);\n var invFilterQ = new Quaternion();\n invFilterQ.copy(this.filterQ);\n invFilterQ.inverse();\n this.estimatedGravity.set(0, 0, -1);\n this.estimatedGravity.applyQuaternion(invFilterQ);\n this.estimatedGravity.normalize();\n this.measuredGravity.copy(this.currentAccelMeasurement.sample);\n this.measuredGravity.normalize();\n var deltaQ = new Quaternion();\n deltaQ.setFromUnitVectors(this.estimatedGravity, this.measuredGravity);\n deltaQ.inverse();\n if (this.isDebug) {\n console.log('Delta: %d deg, G_est: (%s, %s, %s), G_meas: (%s, %s, %s)', radToDeg * getQuaternionAngle(deltaQ), this.estimatedGravity.x.toFixed(1), this.estimatedGravity.y.toFixed(1), this.estimatedGravity.z.toFixed(1), this.measuredGravity.x.toFixed(1), this.measuredGravity.y.toFixed(1), this.measuredGravity.z.toFixed(1));\n }\n var targetQ = new Quaternion();\n targetQ.copy(this.filterQ);\n targetQ.multiply(deltaQ);\n this.filterQ.slerp(targetQ, 1 - this.kFilter);\n this.previousFilterQ.copy(this.filterQ);\n};\nComplementaryFilter.prototype.getOrientation = function () {\n return this.filterQ;\n};\nComplementaryFilter.prototype.accelToQuaternion_ = function (accel) {\n var normAccel = new Vector3();\n normAccel.copy(accel);\n normAccel.normalize();\n var quat = new Quaternion();\n quat.setFromUnitVectors(new Vector3(0, 0, -1), normAccel);\n quat.inverse();\n return quat;\n};\nComplementaryFilter.prototype.gyroToQuaternionDelta_ = function (gyro, dt) {\n var quat = new Quaternion();\n var axis = new Vector3();\n axis.copy(gyro);\n axis.normalize();\n quat.setFromAxisAngle(axis, gyro.length() * dt);\n return quat;\n};\nfunction PosePredictor(predictionTimeS, isDebug) {\n this.predictionTimeS = predictionTimeS;\n this.isDebug = isDebug;\n this.previousQ = new Quaternion();\n this.previousTimestampS = null;\n this.deltaQ = new Quaternion();\n this.outQ = new Quaternion();\n}\nPosePredictor.prototype.getPrediction = function (currentQ, gyro, timestampS) {\n if (!this.previousTimestampS) {\n this.previousQ.copy(currentQ);\n this.previousTimestampS = timestampS;\n return currentQ;\n }\n var axis = new Vector3();\n axis.copy(gyro);\n axis.normalize();\n var angularSpeed = gyro.length();\n if (angularSpeed < degToRad * 20) {\n if (this.isDebug) {\n console.log('Moving slowly, at %s deg/s: no prediction', (radToDeg * angularSpeed).toFixed(1));\n }\n this.outQ.copy(currentQ);\n this.previousQ.copy(currentQ);\n return this.outQ;\n }\n var predictAngle = angularSpeed * this.predictionTimeS;\n this.deltaQ.setFromAxisAngle(axis, predictAngle);\n this.outQ.copy(this.previousQ);\n this.outQ.multiply(this.deltaQ);\n this.previousQ.copy(currentQ);\n this.previousTimestampS = timestampS;\n return this.outQ;\n};\nfunction FusionPoseSensor(kFilter, predictionTime, yawOnly, isDebug) {\n this.yawOnly = yawOnly;\n this.accelerometer = new Vector3();\n this.gyroscope = new Vector3();\n this.filter = new ComplementaryFilter(kFilter, isDebug);\n this.posePredictor = new PosePredictor(predictionTime, isDebug);\n this.isFirefoxAndroid = isFirefoxAndroid();\n this.isIOS = isIOS();\n var chromeVersion = getChromeVersion();\n this.isDeviceMotionInRadians = !this.isIOS && chromeVersion && chromeVersion < 66;\n this.isWithoutDeviceMotion = isChromeWithoutDeviceMotion() || isSafariWithoutDeviceMotion();\n this.filterToWorldQ = new Quaternion();\n if (isIOS()) {\n this.filterToWorldQ.setFromAxisAngle(new Vector3(1, 0, 0), Math.PI / 2);\n } else {\n this.filterToWorldQ.setFromAxisAngle(new Vector3(1, 0, 0), -Math.PI / 2);\n }\n this.inverseWorldToScreenQ = new Quaternion();\n this.worldToScreenQ = new Quaternion();\n this.originalPoseAdjustQ = new Quaternion();\n this.originalPoseAdjustQ.setFromAxisAngle(new Vector3(0, 0, 1), -window.orientation * Math.PI / 180);\n this.setScreenTransform_();\n if (isLandscapeMode()) {\n this.filterToWorldQ.multiply(this.inverseWorldToScreenQ);\n }\n this.resetQ = new Quaternion();\n this.orientationOut_ = new Float32Array(4);\n this.start();\n}\nFusionPoseSensor.prototype.getPosition = function () {\n return null;\n};\nFusionPoseSensor.prototype.getOrientation = function () {\n var orientation = void 0;\n if (this.isWithoutDeviceMotion && this._deviceOrientationQ) {\n this.deviceOrientationFixQ = this.deviceOrientationFixQ || function () {\n var z = new Quaternion().setFromAxisAngle(new Vector3(0, 0, -1), 0);\n var y = new Quaternion();\n if (window.orientation === -90) {\n y.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI / -2);\n } else {\n y.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI / 2);\n }\n return z.multiply(y);\n }();\n this.deviceOrientationFilterToWorldQ = this.deviceOrientationFilterToWorldQ || function () {\n var q = new Quaternion();\n q.setFromAxisAngle(new Vector3(1, 0, 0), -Math.PI / 2);\n return q;\n }();\n orientation = this._deviceOrientationQ;\n var out = new Quaternion();\n out.copy(orientation);\n out.multiply(this.deviceOrientationFilterToWorldQ);\n out.multiply(this.resetQ);\n out.multiply(this.worldToScreenQ);\n out.multiplyQuaternions(this.deviceOrientationFixQ, out);\n if (this.yawOnly) {\n out.x = 0;\n out.z = 0;\n out.normalize();\n }\n this.orientationOut_[0] = out.x;\n this.orientationOut_[1] = out.y;\n this.orientationOut_[2] = out.z;\n this.orientationOut_[3] = out.w;\n return this.orientationOut_;\n } else {\n var filterOrientation = this.filter.getOrientation();\n orientation = this.posePredictor.getPrediction(filterOrientation, this.gyroscope, this.previousTimestampS);\n }\n var out = new Quaternion();\n out.copy(this.filterToWorldQ);\n out.multiply(this.resetQ);\n out.multiply(orientation);\n out.multiply(this.worldToScreenQ);\n if (this.yawOnly) {\n out.x = 0;\n out.z = 0;\n out.normalize();\n }\n this.orientationOut_[0] = out.x;\n this.orientationOut_[1] = out.y;\n this.orientationOut_[2] = out.z;\n this.orientationOut_[3] = out.w;\n return this.orientationOut_;\n};\nFusionPoseSensor.prototype.resetPose = function () {\n this.resetQ.copy(this.filter.getOrientation());\n this.resetQ.x = 0;\n this.resetQ.y = 0;\n this.resetQ.z *= -1;\n this.resetQ.normalize();\n if (isLandscapeMode()) {\n this.resetQ.multiply(this.inverseWorldToScreenQ);\n }\n this.resetQ.multiply(this.originalPoseAdjustQ);\n};\nFusionPoseSensor.prototype.onDeviceOrientation_ = function (e) {\n this._deviceOrientationQ = this._deviceOrientationQ || new Quaternion();\n var alpha = e.alpha,\n beta = e.beta,\n gamma = e.gamma;\n alpha = (alpha || 0) * Math.PI / 180;\n beta = (beta || 0) * Math.PI / 180;\n gamma = (gamma || 0) * Math.PI / 180;\n this._deviceOrientationQ.setFromEulerYXZ(beta, alpha, -gamma);\n};\nFusionPoseSensor.prototype.onDeviceMotion_ = function (deviceMotion) {\n this.updateDeviceMotion_(deviceMotion);\n};\nFusionPoseSensor.prototype.updateDeviceMotion_ = function (deviceMotion) {\n var accGravity = deviceMotion.accelerationIncludingGravity;\n var rotRate = deviceMotion.rotationRate;\n var timestampS = deviceMotion.timeStamp / 1000;\n var deltaS = timestampS - this.previousTimestampS;\n if (deltaS < 0) {\n warnOnce('fusion-pose-sensor:invalid:non-monotonic', 'Invalid timestamps detected: non-monotonic timestamp from devicemotion');\n this.previousTimestampS = timestampS;\n return;\n } else if (deltaS <= MIN_TIMESTEP || deltaS > MAX_TIMESTEP) {\n warnOnce('fusion-pose-sensor:invalid:outside-threshold', 'Invalid timestamps detected: Timestamp from devicemotion outside expected range.');\n this.previousTimestampS = timestampS;\n return;\n }\n this.accelerometer.set(-accGravity.x, -accGravity.y, -accGravity.z);\n if (rotRate) {\n if (isR7()) {\n this.gyroscope.set(-rotRate.beta, rotRate.alpha, rotRate.gamma);\n } else {\n this.gyroscope.set(rotRate.alpha, rotRate.beta, rotRate.gamma);\n }\n if (!this.isDeviceMotionInRadians) {\n this.gyroscope.multiplyScalar(Math.PI / 180);\n }\n this.filter.addGyroMeasurement(this.gyroscope, timestampS);\n }\n this.filter.addAccelMeasurement(this.accelerometer, timestampS);\n this.previousTimestampS = timestampS;\n};\nFusionPoseSensor.prototype.onOrientationChange_ = function (screenOrientation) {\n this.setScreenTransform_();\n};\nFusionPoseSensor.prototype.onMessage_ = function (event) {\n var message = event.data;\n if (!message || !message.type) {\n return;\n }\n var type = message.type.toLowerCase();\n if (type !== 'devicemotion') {\n return;\n }\n this.updateDeviceMotion_(message.deviceMotionEvent);\n};\nFusionPoseSensor.prototype.setScreenTransform_ = function () {\n this.worldToScreenQ.set(0, 0, 0, 1);\n switch (window.orientation) {\n case 0:\n break;\n case 90:\n this.worldToScreenQ.setFromAxisAngle(new Vector3(0, 0, 1), -Math.PI / 2);\n break;\n case -90:\n this.worldToScreenQ.setFromAxisAngle(new Vector3(0, 0, 1), Math.PI / 2);\n break;\n case 180:\n break;\n }\n this.inverseWorldToScreenQ.copy(this.worldToScreenQ);\n this.inverseWorldToScreenQ.inverse();\n};\nFusionPoseSensor.prototype.start = function () {\n this.onDeviceMotionCallback_ = this.onDeviceMotion_.bind(this);\n this.onOrientationChangeCallback_ = this.onOrientationChange_.bind(this);\n this.onMessageCallback_ = this.onMessage_.bind(this);\n this.onDeviceOrientationCallback_ = this.onDeviceOrientation_.bind(this);\n if (isIOS() && isInsideCrossOriginIFrame()) {\n window.addEventListener('message', this.onMessageCallback_);\n }\n window.addEventListener('orientationchange', this.onOrientationChangeCallback_);\n if (this.isWithoutDeviceMotion) {\n window.addEventListener('deviceorientation', this.onDeviceOrientationCallback_);\n } else {\n window.addEventListener('devicemotion', this.onDeviceMotionCallback_);\n }\n};\nFusionPoseSensor.prototype.stop = function () {\n window.removeEventListener('devicemotion', this.onDeviceMotionCallback_);\n window.removeEventListener('deviceorientation', this.onDeviceOrientationCallback_);\n window.removeEventListener('orientationchange', this.onOrientationChangeCallback_);\n window.removeEventListener('message', this.onMessageCallback_);\n};\nvar SENSOR_FREQUENCY = 60;\nvar X_AXIS = new Vector3(1, 0, 0);\nvar Z_AXIS = new Vector3(0, 0, 1);\nvar SENSOR_TO_VR = new Quaternion();\nSENSOR_TO_VR.setFromAxisAngle(X_AXIS, -Math.PI / 2);\nSENSOR_TO_VR.multiply(new Quaternion().setFromAxisAngle(Z_AXIS, Math.PI / 2));\nvar PoseSensor = function () {\n function PoseSensor(config) {\n classCallCheck(this, PoseSensor);\n this.config = config;\n this.sensor = null;\n this.fusionSensor = null;\n this._out = new Float32Array(4);\n this.api = null;\n this.errors = [];\n this._sensorQ = new Quaternion();\n this._outQ = new Quaternion();\n this._onSensorRead = this._onSensorRead.bind(this);\n this._onSensorError = this._onSensorError.bind(this);\n this.init();\n }\n createClass(PoseSensor, [{\n key: 'init',\n value: function init() {\n var sensor = null;\n try {\n sensor = new RelativeOrientationSensor({\n frequency: SENSOR_FREQUENCY,\n referenceFrame: 'screen'\n });\n sensor.addEventListener('error', this._onSensorError);\n } catch (error) {\n this.errors.push(error);\n if (error.name === 'SecurityError') {\n console.error('Cannot construct sensors due to the Feature Policy');\n console.warn('Attempting to fall back using \"devicemotion\"; however this will ' + 'fail in the future without correct permissions.');\n this.useDeviceMotion();\n } else if (error.name === 'ReferenceError') {\n this.useDeviceMotion();\n } else {\n console.error(error);\n }\n }\n if (sensor) {\n this.api = 'sensor';\n this.sensor = sensor;\n this.sensor.addEventListener('reading', this._onSensorRead);\n this.sensor.start();\n }\n }\n }, {\n key: 'useDeviceMotion',\n value: function useDeviceMotion() {\n this.api = 'devicemotion';\n this.fusionSensor = new FusionPoseSensor(this.config.K_FILTER, this.config.PREDICTION_TIME_S, this.config.YAW_ONLY, this.config.DEBUG);\n if (this.sensor) {\n this.sensor.removeEventListener('reading', this._onSensorRead);\n this.sensor.removeEventListener('error', this._onSensorError);\n this.sensor = null;\n }\n }\n }, {\n key: 'getOrientation',\n value: function getOrientation() {\n if (this.fusionSensor) {\n return this.fusionSensor.getOrientation();\n }\n if (!this.sensor || !this.sensor.quaternion) {\n this._out[0] = this._out[1] = this._out[2] = 0;\n this._out[3] = 1;\n return this._out;\n }\n var q = this.sensor.quaternion;\n this._sensorQ.set(q[0], q[1], q[2], q[3]);\n var out = this._outQ;\n out.copy(SENSOR_TO_VR);\n out.multiply(this._sensorQ);\n if (this.config.YAW_ONLY) {\n out.x = out.z = 0;\n out.normalize();\n }\n this._out[0] = out.x;\n this._out[1] = out.y;\n this._out[2] = out.z;\n this._out[3] = out.w;\n return this._out;\n }\n }, {\n key: '_onSensorError',\n value: function _onSensorError(event) {\n this.errors.push(event.error);\n if (event.error.name === 'NotAllowedError') {\n console.error('Permission to access sensor was denied');\n } else if (event.error.name === 'NotReadableError') {\n console.error('Sensor could not be read');\n } else {\n console.error(event.error);\n }\n this.useDeviceMotion();\n }\n }, {\n key: '_onSensorRead',\n value: function _onSensorRead() {}\n }]);\n return PoseSensor;\n}();\nvar rotateInstructionsAsset = \"<svg width='198' height='240' viewBox='0 0 198 240' xmlns='http://www.w3.org/2000/svg'><g fill='none' fill-rule='evenodd'><path d='M149.625 109.527l6.737 3.891v.886c0 .177.013.36.038.549.01.081.02.162.027.242.14 1.415.974 2.998 2.105 3.999l5.72 5.062.081-.09s4.382-2.53 5.235-3.024l25.97 14.993v54.001c0 .771-.386 1.217-.948 1.217-.233 0-.495-.076-.772-.236l-23.967-13.838-.014.024-27.322 15.775-.85-1.323c-4.731-1.529-9.748-2.74-14.951-3.61a.27.27 0 0 0-.007.024l-5.067 16.961-7.891 4.556-.037-.063v27.59c0 .772-.386 1.217-.948 1.217-.232 0-.495-.076-.772-.236l-42.473-24.522c-.95-.549-1.72-1.877-1.72-2.967v-1.035l-.021.047a5.111 5.111 0 0 0-1.816-.399 5.682 5.682 0 0 0-.546.001 13.724 13.724 0 0 1-1.918-.041c-1.655-.153-3.2-.6-4.404-1.296l-46.576-26.89.005.012-10.278-18.75c-1.001-1.827-.241-4.216 1.698-5.336l56.011-32.345a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.659 3.227 1.853l.005-.003.227.413-.006.004a9.63 9.63 0 0 0 1.477 2.018l.277.27c1.914 1.85 4.468 2.801 7.113 2.801 1.949 0 3.948-.517 5.775-1.572.013 0 7.319-4.219 7.319-4.219a4.194 4.194 0 0 1 2.099-.572c1.326 0 2.572.658 3.226 1.853l3.25 5.928.022-.018 6.785 3.917-.105-.182 46.881-26.965m0-1.635c-.282 0-.563.073-.815.218l-46.169 26.556-5.41-3.124-3.005-5.481c-.913-1.667-2.699-2.702-4.66-2.703-1.011 0-2.02.274-2.917.792a3825 3825 0 0 1-7.275 4.195l-.044.024a9.937 9.937 0 0 1-4.957 1.353c-2.292 0-4.414-.832-5.976-2.342l-.252-.245a7.992 7.992 0 0 1-1.139-1.534 1.379 1.379 0 0 0-.06-.122l-.227-.414a1.718 1.718 0 0 0-.095-.154c-.938-1.574-2.673-2.545-4.571-2.545-1.011 0-2.02.274-2.917.792L3.125 155.502c-2.699 1.559-3.738 4.94-2.314 7.538l10.278 18.75c.177.323.448.563.761.704l46.426 26.804c1.403.81 3.157 1.332 5.072 1.508a15.661 15.661 0 0 0 2.146.046 4.766 4.766 0 0 1 .396 0c.096.004.19.011.283.022.109 1.593 1.159 3.323 2.529 4.114l42.472 24.522c.524.302 1.058.455 1.59.455 1.497 0 2.583-1.2 2.583-2.852v-26.562l7.111-4.105a1.64 1.64 0 0 0 .749-.948l4.658-15.593c4.414.797 8.692 1.848 12.742 3.128l.533.829a1.634 1.634 0 0 0 2.193.531l26.532-15.317L193 192.433c.523.302 1.058.455 1.59.455 1.497 0 2.583-1.199 2.583-2.852v-54.001c0-.584-.312-1.124-.818-1.416l-25.97-14.993a1.633 1.633 0 0 0-1.636.001c-.606.351-2.993 1.73-4.325 2.498l-4.809-4.255c-.819-.725-1.461-1.933-1.561-2.936a7.776 7.776 0 0 0-.033-.294 2.487 2.487 0 0 1-.023-.336v-.886c0-.584-.312-1.123-.817-1.416l-6.739-3.891a1.633 1.633 0 0 0-.817-.219' fill='#455A64'/><path d='M96.027 132.636l46.576 26.891c1.204.695 1.979 1.587 2.242 2.541l-.01.007-81.374 46.982h-.001c-1.654-.152-3.199-.6-4.403-1.295l-46.576-26.891 83.546-48.235' fill='#FAFAFA'/><path d='M63.461 209.174c-.008 0-.015 0-.022-.002-1.693-.156-3.228-.609-4.441-1.309l-46.576-26.89a.118.118 0 0 1 0-.203l83.546-48.235a.117.117 0 0 1 .117 0l46.576 26.891c1.227.708 2.021 1.612 2.296 2.611a.116.116 0 0 1-.042.124l-.021.016-81.375 46.981a.11.11 0 0 1-.058.016zm-50.747-28.303l46.401 26.79c1.178.68 2.671 1.121 4.32 1.276l81.272-46.922c-.279-.907-1.025-1.73-2.163-2.387l-46.517-26.857-83.313 48.1z' fill='#607D8B'/><path d='M148.327 165.471a5.85 5.85 0 0 1-.546.001c-1.894-.083-3.302-1.038-3.145-2.132a2.693 2.693 0 0 0-.072-1.105l-81.103 46.822c.628.058 1.272.073 1.918.042.182-.009.364-.009.546-.001 1.894.083 3.302 1.038 3.145 2.132l79.257-45.759' fill='#FFF'/><path d='M69.07 211.347a.118.118 0 0 1-.115-.134c.045-.317-.057-.637-.297-.925-.505-.61-1.555-1.022-2.738-1.074a5.966 5.966 0 0 0-.535.001 14.03 14.03 0 0 1-1.935-.041.117.117 0 0 1-.103-.092.116.116 0 0 1 .055-.126l81.104-46.822a.117.117 0 0 1 .171.07c.104.381.129.768.074 1.153-.045.316.057.637.296.925.506.61 1.555 1.021 2.739 1.073.178.008.357.008.535-.001a.117.117 0 0 1 .064.218l-79.256 45.759a.114.114 0 0 1-.059.016zm-3.405-2.372c.089 0 .177.002.265.006 1.266.056 2.353.488 2.908 1.158.227.274.35.575.36.882l78.685-45.429c-.036 0-.072-.001-.107-.003-1.267-.056-2.354-.489-2.909-1.158-.282-.34-.402-.724-.347-1.107a2.604 2.604 0 0 0-.032-.91L63.846 208.97a13.91 13.91 0 0 0 1.528.012c.097-.005.194-.007.291-.007z' fill='#607D8B'/><path d='M2.208 162.134c-1.001-1.827-.241-4.217 1.698-5.337l56.011-32.344c1.939-1.12 4.324-.546 5.326 1.281l.232.41a9.344 9.344 0 0 0 1.47 2.021l.278.27c3.325 3.214 8.583 3.716 12.888 1.23l7.319-4.22c1.94-1.119 4.324-.546 5.325 1.282l3.25 5.928-83.519 48.229-10.278-18.75z' fill='#FAFAFA'/><path d='M12.486 181.001a.112.112 0 0 1-.031-.005.114.114 0 0 1-.071-.056L2.106 162.19c-1.031-1.88-.249-4.345 1.742-5.494l56.01-32.344a4.328 4.328 0 0 1 2.158-.588c1.415 0 2.65.702 3.311 1.882.01.008.018.017.024.028l.227.414a.122.122 0 0 1 .013.038 9.508 9.508 0 0 0 1.439 1.959l.275.266c1.846 1.786 4.344 2.769 7.031 2.769 1.977 0 3.954-.538 5.717-1.557a.148.148 0 0 1 .035-.013l7.284-4.206a4.321 4.321 0 0 1 2.157-.588c1.427 0 2.672.716 3.329 1.914l3.249 5.929a.116.116 0 0 1-.044.157l-83.518 48.229a.116.116 0 0 1-.059.016zm49.53-57.004c-.704 0-1.41.193-2.041.557l-56.01 32.345c-1.882 1.086-2.624 3.409-1.655 5.179l10.221 18.645 83.317-48.112-3.195-5.829c-.615-1.122-1.783-1.792-3.124-1.792a4.08 4.08 0 0 0-2.04.557l-7.317 4.225a.148.148 0 0 1-.035.013 11.7 11.7 0 0 1-5.801 1.569c-2.748 0-5.303-1.007-7.194-2.835l-.278-.27a9.716 9.716 0 0 1-1.497-2.046.096.096 0 0 1-.013-.037l-.191-.347a.11.11 0 0 1-.023-.029c-.615-1.123-1.783-1.793-3.124-1.793z' fill='#607D8B'/><path d='M42.434 155.808c-2.51-.001-4.697-1.258-5.852-3.365-1.811-3.304-.438-7.634 3.059-9.654l12.291-7.098a7.599 7.599 0 0 1 3.789-1.033c2.51 0 4.697 1.258 5.852 3.365 1.811 3.304.439 7.634-3.059 9.654l-12.291 7.098a7.606 7.606 0 0 1-3.789 1.033zm13.287-20.683a7.128 7.128 0 0 0-3.555.971l-12.291 7.098c-3.279 1.893-4.573 5.942-2.883 9.024 1.071 1.955 3.106 3.122 5.442 3.122a7.13 7.13 0 0 0 3.556-.97l12.291-7.098c3.279-1.893 4.572-5.942 2.883-9.024-1.072-1.955-3.106-3.123-5.443-3.123z' fill='#607D8B'/><path d='M149.588 109.407l6.737 3.89v.887c0 .176.013.36.037.549.011.081.02.161.028.242.14 1.415.973 2.998 2.105 3.999l7.396 6.545c.177.156.358.295.541.415 1.579 1.04 2.95.466 3.062-1.282.049-.784.057-1.595.023-2.429l-.003-.16v-1.151l25.987 15.003v54c0 1.09-.77 1.53-1.72.982l-42.473-24.523c-.95-.548-1.72-1.877-1.72-2.966v-34.033' fill='#FAFAFA'/><path d='M194.553 191.25c-.257 0-.54-.085-.831-.253l-42.472-24.521c-.981-.567-1.779-1.943-1.779-3.068v-34.033h.234v34.033c0 1.051.745 2.336 1.661 2.866l42.473 24.521c.424.245.816.288 1.103.122.285-.164.442-.52.442-1.002v-53.933l-25.753-14.868.003 1.106c.034.832.026 1.654-.024 2.439-.054.844-.396 1.464-.963 1.746-.619.309-1.45.173-2.28-.373a5.023 5.023 0 0 1-.553-.426l-7.397-6.544c-1.158-1.026-1.999-2.625-2.143-4.076a9.624 9.624 0 0 0-.027-.238 4.241 4.241 0 0 1-.038-.564v-.82l-6.68-3.856.117-.202 6.738 3.89.058.034v.954c0 .171.012.351.036.533.011.083.021.165.029.246.138 1.395.948 2.935 2.065 3.923l7.397 6.545c.173.153.35.289.527.406.758.499 1.504.63 2.047.359.49-.243.786-.795.834-1.551.05-.778.057-1.591.024-2.417l-.004-.163v-1.355l.175.1 25.987 15.004.059.033v54.068c0 .569-.198.996-.559 1.204a1.002 1.002 0 0 1-.506.131' fill='#607D8B'/><path d='M145.685 163.161l24.115 13.922-25.978 14.998-1.462-.307c-6.534-2.17-13.628-3.728-21.019-4.616-4.365-.524-8.663 1.096-9.598 3.62a2.746 2.746 0 0 0-.011 1.928c1.538 4.267 4.236 8.363 7.995 12.135l.532.845-25.977 14.997-24.115-13.922 75.518-43.6' fill='#FFF'/><path d='M94.282 220.818l-.059-.033-24.29-14.024.175-.101 75.577-43.634.058.033 24.29 14.024-26.191 15.122-.045-.01-1.461-.307c-6.549-2.174-13.613-3.725-21.009-4.614a13.744 13.744 0 0 0-1.638-.097c-3.758 0-7.054 1.531-7.837 3.642a2.62 2.62 0 0 0-.01 1.848c1.535 4.258 4.216 8.326 7.968 12.091l.016.021.526.835.006.01.064.102-.105.061-25.977 14.998-.058.033zm-23.881-14.057l23.881 13.788 24.802-14.32c.546-.315.846-.489 1.017-.575l-.466-.74c-3.771-3.787-6.467-7.881-8.013-12.168a2.851 2.851 0 0 1 .011-2.008c.815-2.199 4.203-3.795 8.056-3.795.557 0 1.117.033 1.666.099 7.412.891 14.491 2.445 21.041 4.621.836.175 1.215.254 1.39.304l25.78-14.884-23.881-13.788-75.284 43.466z' fill='#607D8B'/><path d='M167.23 125.979v50.871l-27.321 15.773-6.461-14.167c-.91-1.996-3.428-1.738-5.624.574a10.238 10.238 0 0 0-2.33 4.018l-6.46 21.628-27.322 15.774v-50.871l75.518-43.6' fill='#FFF'/><path d='M91.712 220.567a.127.127 0 0 1-.059-.016.118.118 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.519-43.6a.117.117 0 0 1 .175.101v50.871c0 .041-.023.08-.059.1l-27.321 15.775a.118.118 0 0 1-.094.01.12.12 0 0 1-.071-.063l-6.46-14.168c-.375-.822-1.062-1.275-1.934-1.275-1.089 0-2.364.686-3.5 1.881a10.206 10.206 0 0 0-2.302 3.972l-6.46 21.627a.118.118 0 0 1-.054.068L91.77 220.551a.12.12 0 0 1-.058.016zm.117-50.92v50.601l27.106-15.65 6.447-21.583a10.286 10.286 0 0 1 2.357-4.065c1.18-1.242 2.517-1.954 3.669-1.954.969 0 1.731.501 2.146 1.411l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M168.543 126.213v50.87l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.624.574a10.248 10.248 0 0 0-2.33 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6' fill='#FFF'/><path d='M93.025 220.8a.123.123 0 0 1-.059-.015.12.12 0 0 1-.058-.101v-50.871c0-.042.023-.08.058-.101l75.518-43.6a.112.112 0 0 1 .117 0c.036.02.059.059.059.1v50.871a.116.116 0 0 1-.059.101l-27.321 15.774a.111.111 0 0 1-.094.01.115.115 0 0 1-.071-.062l-6.46-14.168c-.375-.823-1.062-1.275-1.935-1.275-1.088 0-2.363.685-3.499 1.881a10.19 10.19 0 0 0-2.302 3.971l-6.461 21.628a.108.108 0 0 1-.053.067l-27.322 15.775a.12.12 0 0 1-.058.015zm.117-50.919v50.6l27.106-15.649 6.447-21.584a10.293 10.293 0 0 1 2.357-4.065c1.179-1.241 2.516-1.954 3.668-1.954.969 0 1.732.502 2.147 1.412l6.407 14.051 27.152-15.676v-50.601l-75.284 43.466z' fill='#607D8B'/><path d='M169.8 177.083l-27.322 15.774-6.46-14.168c-.91-1.995-3.428-1.738-5.625.574a10.246 10.246 0 0 0-2.329 4.019l-6.461 21.627-27.321 15.774v-50.87l75.518-43.6v50.87z' fill='#FAFAFA'/><path d='M94.282 220.917a.234.234 0 0 1-.234-.233v-50.871c0-.083.045-.161.117-.202l75.518-43.601a.234.234 0 1 1 .35.202v50.871a.233.233 0 0 1-.116.202l-27.322 15.775a.232.232 0 0 1-.329-.106l-6.461-14.168c-.36-.789-.992-1.206-1.828-1.206-1.056 0-2.301.672-3.415 1.844a10.099 10.099 0 0 0-2.275 3.924l-6.46 21.628a.235.235 0 0 1-.107.136l-27.322 15.774a.23.23 0 0 1-.116.031zm.233-50.969v50.331l26.891-15.525 6.434-21.539a10.41 10.41 0 0 1 2.384-4.112c1.201-1.265 2.569-1.991 3.753-1.991 1.018 0 1.818.526 2.253 1.48l6.354 13.934 26.982-15.578v-50.331l-75.051 43.331z' fill='#607D8B'/><path d='M109.894 199.943c-1.774 0-3.241-.725-4.244-2.12a.224.224 0 0 1 .023-.294.233.233 0 0 1 .301-.023c.78.547 1.705.827 2.75.827 1.323 0 2.754-.439 4.256-1.306 5.311-3.067 9.631-10.518 9.631-16.611 0-1.927-.442-3.56-1.278-4.724a.232.232 0 0 1 .323-.327c1.671 1.172 2.591 3.381 2.591 6.219 0 6.242-4.426 13.863-9.865 17.003-1.574.908-3.084 1.356-4.488 1.356zm-2.969-1.542c.813.651 1.82.877 2.968.877h.001c1.321 0 2.753-.327 4.254-1.194 5.311-3.067 9.632-10.463 9.632-16.556 0-1.979-.463-3.599-1.326-4.761.411 1.035.625 2.275.625 3.635 0 6.243-4.426 13.883-9.865 17.023-1.574.909-3.084 1.317-4.49 1.317-.641 0-1.243-.149-1.799-.341z' fill='#607D8B'/><path d='M113.097 197.23c5.384-3.108 9.748-10.636 9.748-16.814 0-2.051-.483-3.692-1.323-4.86-1.784-1.252-4.374-1.194-7.257.47-5.384 3.108-9.748 10.636-9.748 16.814 0 2.051.483 3.692 1.323 4.86 1.784 1.252 4.374 1.194 7.257-.47' fill='#FAFAFA'/><path d='M108.724 198.614c-1.142 0-2.158-.213-3.019-.817-.021-.014-.04.014-.055-.007-.894-1.244-1.367-2.948-1.367-4.973 0-6.242 4.426-13.864 9.865-17.005 1.574-.908 3.084-1.363 4.49-1.363 1.142 0 2.158.309 3.018.913a.23.23 0 0 1 .056.056c.894 1.244 1.367 2.972 1.367 4.997 0 6.243-4.426 13.783-9.865 16.923-1.574.909-3.084 1.276-4.49 1.276zm-2.718-1.109c.774.532 1.688.776 2.718.776 1.323 0 2.754-.413 4.256-1.28 5.311-3.066 9.631-10.505 9.631-16.598 0-1.909-.434-3.523-1.255-4.685-.774-.533-1.688-.799-2.718-.799-1.323 0-2.755.441-4.256 1.308-5.311 3.066-9.631 10.506-9.631 16.599 0 1.909.434 3.517 1.255 4.679z' fill='#607D8B'/><path d='M149.318 114.262l-9.984 8.878 15.893 11.031 5.589-6.112-11.498-13.797' fill='#FAFAFA'/><path d='M169.676 120.84l-9.748 5.627c-3.642 2.103-9.528 2.113-13.147.024-3.62-2.089-3.601-5.488.041-7.591l9.495-5.608-6.729-3.885-81.836 47.071 45.923 26.514 3.081-1.779c.631-.365.869-.898.618-1.39-2.357-4.632-2.593-9.546-.683-14.262 5.638-13.92 24.509-24.815 48.618-28.07 8.169-1.103 16.68-.967 24.704.394.852.145 1.776.008 2.407-.357l3.081-1.778-25.825-14.91' fill='#FAFAFA'/><path d='M113.675 183.459a.47.47 0 0 1-.233-.062l-45.924-26.515a.468.468 0 0 1 .001-.809l81.836-47.071a.467.467 0 0 1 .466 0l6.729 3.885a.467.467 0 0 1-.467.809l-6.496-3.75-80.9 46.533 44.988 25.973 2.848-1.644c.192-.111.62-.409.435-.773-2.416-4.748-2.658-9.814-.7-14.65 2.806-6.927 8.885-13.242 17.582-18.263 8.657-4.998 19.518-8.489 31.407-10.094 8.198-1.107 16.79-.97 24.844.397.739.125 1.561.007 2.095-.301l2.381-1.374-25.125-14.506a.467.467 0 0 1 .467-.809l25.825 14.91a.467.467 0 0 1 0 .809l-3.081 1.779c-.721.417-1.763.575-2.718.413-7.963-1.351-16.457-1.486-24.563-.392-11.77 1.589-22.512 5.039-31.065 9.977-8.514 4.916-14.456 11.073-17.183 17.805-1.854 4.578-1.623 9.376.666 13.875.37.725.055 1.513-.8 2.006l-3.081 1.78a.476.476 0 0 1-.234.062' fill='#455A64'/><path d='M153.316 128.279c-2.413 0-4.821-.528-6.652-1.586-1.818-1.049-2.82-2.461-2.82-3.975 0-1.527 1.016-2.955 2.861-4.02l9.493-5.607a.233.233 0 1 1 .238.402l-9.496 5.609c-1.696.979-2.628 2.263-2.628 3.616 0 1.34.918 2.608 2.585 3.571 3.549 2.049 9.343 2.038 12.914-.024l9.748-5.628a.234.234 0 0 1 .234.405l-9.748 5.628c-1.858 1.072-4.296 1.609-6.729 1.609' fill='#607D8B'/><path d='M113.675 182.992l-45.913-26.508M113.675 183.342a.346.346 0 0 1-.175-.047l-45.913-26.508a.35.35 0 1 1 .35-.607l45.913 26.508a.35.35 0 0 1-.175.654' fill='#455A64'/><path d='M67.762 156.484v54.001c0 1.09.77 2.418 1.72 2.967l42.473 24.521c.95.549 1.72.11 1.72-.98v-54.001' fill='#FAFAFA'/><path d='M112.727 238.561c-.297 0-.62-.095-.947-.285l-42.473-24.521c-1.063-.613-1.895-2.05-1.895-3.27v-54.001a.35.35 0 1 1 .701 0v54.001c0 .96.707 2.18 1.544 2.663l42.473 24.522c.344.198.661.243.87.122.206-.119.325-.411.325-.799v-54.001a.35.35 0 1 1 .7 0v54.001c0 .655-.239 1.154-.675 1.406a1.235 1.235 0 0 1-.623.162' fill='#455A64'/><path d='M112.86 147.512h-.001c-2.318 0-4.499-.522-6.142-1.471-1.705-.984-2.643-2.315-2.643-3.749 0-1.445.952-2.791 2.68-3.788l12.041-6.953c1.668-.962 3.874-1.493 6.212-1.493 2.318 0 4.499.523 6.143 1.472 1.704.984 2.643 2.315 2.643 3.748 0 1.446-.952 2.791-2.68 3.789l-12.042 6.952c-1.668.963-3.874 1.493-6.211 1.493zm12.147-16.753c-2.217 0-4.298.497-5.861 1.399l-12.042 6.952c-1.502.868-2.33 1.998-2.33 3.182 0 1.173.815 2.289 2.293 3.142 1.538.889 3.596 1.378 5.792 1.378h.001c2.216 0 4.298-.497 5.861-1.399l12.041-6.953c1.502-.867 2.33-1.997 2.33-3.182 0-1.172-.814-2.288-2.292-3.142-1.539-.888-3.596-1.377-5.793-1.377z' fill='#607D8B'/><path d='M165.63 123.219l-5.734 3.311c-3.167 1.828-8.286 1.837-11.433.02-3.147-1.817-3.131-4.772.036-6.601l5.734-3.31 11.397 6.58' fill='#FAFAFA'/><path d='M154.233 117.448l9.995 5.771-4.682 2.704c-1.434.827-3.352 1.283-5.399 1.283-2.029 0-3.923-.449-5.333-1.263-1.29-.744-2-1.694-2-2.674 0-.991.723-1.955 2.036-2.713l5.383-3.108m0-.809l-5.734 3.31c-3.167 1.829-3.183 4.784-.036 6.601 1.568.905 3.623 1.357 5.684 1.357 2.077 0 4.159-.46 5.749-1.377l5.734-3.311-11.397-6.58M145.445 179.667c-1.773 0-3.241-.85-4.243-2.245-.067-.092-.057-.275.023-.356.08-.081.207-.12.3-.055.781.548 1.706.812 2.751.811 1.322 0 2.754-.446 4.256-1.313 5.31-3.066 9.631-10.522 9.631-16.615 0-1.927-.442-3.562-1.279-4.726a.235.235 0 0 1 .024-.301.232.232 0 0 1 .3-.027c1.67 1.172 2.59 3.38 2.59 6.219 0 6.242-4.425 13.987-9.865 17.127-1.573.908-3.083 1.481-4.488 1.481zM142.476 178c.814.651 1.82 1.002 2.969 1.002 1.322 0 2.753-.452 4.255-1.32 5.31-3.065 9.631-10.523 9.631-16.617 0-1.98-.463-3.63-1.325-4.793.411 1.035.624 2.26.624 3.62 0 6.242-4.425 13.875-9.865 17.015-1.573.909-3.084 1.376-4.489 1.376a5.49 5.49 0 0 1-1.8-.283z' fill='#607D8B'/><path d='M148.648 176.704c5.384-3.108 9.748-10.636 9.748-16.813 0-2.052-.483-3.693-1.322-4.861-1.785-1.252-4.375-1.194-7.258.471-5.383 3.108-9.748 10.636-9.748 16.813 0 2.051.484 3.692 1.323 4.86 1.785 1.253 4.374 1.195 7.257-.47' fill='#FAFAFA'/><path d='M144.276 178.276c-1.143 0-2.158-.307-3.019-.911a.217.217 0 0 1-.055-.054c-.895-1.244-1.367-2.972-1.367-4.997 0-6.241 4.425-13.875 9.865-17.016 1.573-.908 3.084-1.369 4.489-1.369 1.143 0 2.158.307 3.019.91a.24.24 0 0 1 .055.055c.894 1.244 1.367 2.971 1.367 4.997 0 6.241-4.425 13.875-9.865 17.016-1.573.908-3.084 1.369-4.489 1.369zm-2.718-1.172c.773.533 1.687.901 2.718.901 1.322 0 2.754-.538 4.256-1.405 5.31-3.066 9.631-10.567 9.631-16.661 0-1.908-.434-3.554-1.256-4.716-.774-.532-1.688-.814-2.718-.814-1.322 0-2.754.433-4.256 1.3-5.31 3.066-9.631 10.564-9.631 16.657 0 1.91.434 3.576 1.256 4.738z' fill='#607D8B'/><path d='M150.72 172.361l-.363-.295a24.105 24.105 0 0 0 2.148-3.128 24.05 24.05 0 0 0 1.977-4.375l.443.149a24.54 24.54 0 0 1-2.015 4.46 24.61 24.61 0 0 1-2.19 3.189M115.917 191.514l-.363-.294a24.174 24.174 0 0 0 2.148-3.128 24.038 24.038 0 0 0 1.976-4.375l.443.148a24.48 24.48 0 0 1-2.015 4.461 24.662 24.662 0 0 1-2.189 3.188M114 237.476V182.584 237.476' fill='#607D8B'/><g><path d='M81.822 37.474c.017-.135-.075-.28-.267-.392-.327-.188-.826-.21-1.109-.045l-6.012 3.471c-.131.076-.194.178-.191.285.002.132.002.461.002.578v.043l-.007.128-6.591 3.779c-.001 0-2.077 1.046-2.787 5.192 0 0-.912 6.961-.898 19.745.015 12.57.606 17.07 1.167 21.351.22 1.684 3.001 2.125 3.001 2.125.331.04.698-.027 1.08-.248l75.273-43.551c1.808-1.069 2.667-3.719 3.056-6.284 1.213-7.99 1.675-32.978-.275-39.878-.196-.693-.51-1.083-.868-1.282l-2.086-.79c-.727.028-1.416.467-1.534.535L82.032 37.072l-.21.402' fill='#FFF'/><path d='M144.311 1.701l2.085.79c.358.199.672.589.868 1.282 1.949 6.9 1.487 31.887.275 39.878-.39 2.565-1.249 5.215-3.056 6.284L69.21 93.486a1.78 1.78 0 0 1-.896.258l-.183-.011c0 .001-2.782-.44-3.003-2.124-.56-4.282-1.151-8.781-1.165-21.351-.015-12.784.897-19.745.897-19.745.71-4.146 2.787-5.192 2.787-5.192l6.591-3.779.007-.128v-.043c0-.117 0-.446-.002-.578-.003-.107.059-.21.191-.285l6.012-3.472a.98.98 0 0 1 .481-.11c.218 0 .449.053.627.156.193.112.285.258.268.392l.211-.402 60.744-34.836c.117-.068.806-.507 1.534-.535m0-.997l-.039.001c-.618.023-1.283.244-1.974.656l-.021.012-60.519 34.706a2.358 2.358 0 0 0-.831-.15c-.365 0-.704.084-.98.244l-6.012 3.471c-.442.255-.699.69-.689 1.166l.001.15-6.08 3.487c-.373.199-2.542 1.531-3.29 5.898l-.006.039c-.009.07-.92 7.173-.906 19.875.014 12.62.603 17.116 1.172 21.465l.002.015c.308 2.355 3.475 2.923 3.836 2.98l.034.004c.101.013.204.019.305.019a2.77 2.77 0 0 0 1.396-.392l75.273-43.552c1.811-1.071 2.999-3.423 3.542-6.997 1.186-7.814 1.734-33.096-.301-40.299-.253-.893-.704-1.527-1.343-1.882l-.132-.062-2.085-.789a.973.973 0 0 0-.353-.065' fill='#455A64'/><path d='M128.267 11.565l1.495.434-56.339 32.326' fill='#FFF'/><path d='M74.202 90.545a.5.5 0 0 1-.25-.931l18.437-10.645a.499.499 0 1 1 .499.864L74.451 90.478l-.249.067M75.764 42.654l-.108-.062.046-.171 5.135-2.964.17.045-.045.171-5.135 2.964-.063.017M70.52 90.375V46.421l.063-.036L137.84 7.554v43.954l-.062.036L70.52 90.375zm.25-43.811v43.38l66.821-38.579V7.985L70.77 46.564z' fill='#607D8B'/><path d='M86.986 83.182c-.23.149-.612.384-.849.523l-11.505 6.701c-.237.139-.206.252.068.252h.565c.275 0 .693-.113.93-.252L87.7 83.705c.237-.139.428-.253.425-.256a11.29 11.29 0 0 1-.006-.503c0-.274-.188-.377-.418-.227l-.715.463' fill='#607D8B'/><path d='M75.266 90.782H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.236-.138.615-.371.844-.519l.715-.464a.488.488 0 0 1 .266-.089c.172 0 .345.13.345.421 0 .214.001.363.003.437l.006.004-.004.069c-.003.075-.003.075-.486.356l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.108.866-.234l11.505-6.702c.168-.098.294-.173.361-.214-.004-.084-.004-.218-.004-.437l-.095-.171-.131.049-.714.463c-.232.15-.616.386-.854.525l-11.505 6.702-.029.018z' fill='#607D8B'/><path d='M75.266 89.871H74.7c-.2 0-.316-.056-.346-.166-.03-.11.043-.217.215-.317l11.505-6.702c.258-.151.694-.268.993-.268h.565c.2 0 .316.056.346.166.03.11-.043.217-.215.317l-11.505 6.702a2.282 2.282 0 0 1-.992.268zm-.6-.25l.034.001h.566c.252 0 .649-.107.866-.234l11.505-6.702.03-.018-.035-.001h-.565c-.252 0-.649.108-.867.234l-11.505 6.702-.029.018zM74.37 90.801v-1.247 1.247' fill='#607D8B'/><path d='M68.13 93.901c-.751-.093-1.314-.737-1.439-1.376-.831-4.238-1.151-8.782-1.165-21.352-.015-12.784.897-19.745.897-19.745.711-4.146 2.787-5.192 2.787-5.192l74.859-43.219c.223-.129 2.487-1.584 3.195.923 1.95 6.9 1.488 31.887.275 39.878-.389 2.565-1.248 5.215-3.056 6.283L69.21 93.653c-.382.221-.749.288-1.08.248 0 0-2.781-.441-3.001-2.125-.561-4.281-1.152-8.781-1.167-21.351-.014-12.784.898-19.745.898-19.745.71-4.146 2.787-5.191 2.787-5.191l6.598-3.81.871-.119 6.599-3.83.046-.461L68.13 93.901' fill='#FAFAFA'/><path d='M68.317 94.161l-.215-.013h-.001l-.244-.047c-.719-.156-2.772-.736-2.976-2.292-.568-4.34-1.154-8.813-1.168-21.384-.014-12.654.891-19.707.9-19.777.725-4.231 2.832-5.338 2.922-5.382l6.628-3.827.87-.119 6.446-3.742.034-.334a.248.248 0 0 1 .273-.223.248.248 0 0 1 .223.272l-.059.589-6.752 3.919-.87.118-6.556 3.785c-.031.016-1.99 1.068-2.666 5.018-.007.06-.908 7.086-.894 19.702.014 12.539.597 16.996 1.161 21.305.091.691.689 1.154 1.309 1.452a1.95 1.95 0 0 1-.236-.609c-.781-3.984-1.155-8.202-1.17-21.399-.014-12.653.891-19.707.9-19.777.725-4.231 2.832-5.337 2.922-5.382-.004.001 74.444-42.98 74.846-43.212l.028-.017c.904-.538 1.72-.688 2.36-.433.555.221.949.733 1.172 1.52 2.014 7.128 1.46 32.219.281 39.983-.507 3.341-1.575 5.515-3.175 6.462L69.335 93.869a2.023 2.023 0 0 1-1.018.292zm-.147-.507c.293.036.604-.037.915-.217l75.273-43.551c1.823-1.078 2.602-3.915 2.934-6.106 1.174-7.731 1.731-32.695-.268-39.772-.178-.631-.473-1.032-.876-1.192-.484-.193-1.166-.052-1.921.397l-.034.021-74.858 43.218c-.031.017-1.989 1.069-2.666 5.019-.007.059-.908 7.085-.894 19.702.015 13.155.386 17.351 1.161 21.303.09.461.476.983 1.037 1.139.114.025.185.037.196.039h.001z' fill='#455A64'/><path d='M69.317 68.982c.489-.281.885-.056.885.505 0 .56-.396 1.243-.885 1.525-.488.282-.884.057-.884-.504 0-.56.396-1.243.884-1.526' fill='#FFF'/><path d='M68.92 71.133c-.289 0-.487-.228-.487-.625 0-.56.396-1.243.884-1.526a.812.812 0 0 1 .397-.121c.289 0 .488.229.488.626 0 .56-.396 1.243-.885 1.525a.812.812 0 0 1-.397.121m.794-2.459a.976.976 0 0 0-.49.147c-.548.317-.978 1.058-.978 1.687 0 .486.271.812.674.812a.985.985 0 0 0 .491-.146c.548-.317.978-1.057.978-1.687 0-.486-.272-.813-.675-.813' fill='#8097A2'/><path d='M68.92 70.947c-.271 0-.299-.307-.299-.439 0-.491.361-1.116.79-1.363a.632.632 0 0 1 .303-.096c.272 0 .301.306.301.438 0 .491-.363 1.116-.791 1.364a.629.629 0 0 1-.304.096m.794-2.086a.812.812 0 0 0-.397.121c-.488.283-.884.966-.884 1.526 0 .397.198.625.487.625a.812.812 0 0 0 .397-.121c.489-.282.885-.965.885-1.525 0-.397-.199-.626-.488-.626' fill='#8097A2'/><path d='M69.444 85.35c.264-.152.477-.031.477.272 0 .303-.213.67-.477.822-.263.153-.477.031-.477-.271 0-.302.214-.671.477-.823' fill='#FFF'/><path d='M69.23 86.51c-.156 0-.263-.123-.263-.337 0-.302.214-.671.477-.823a.431.431 0 0 1 .214-.066c.156 0 .263.124.263.338 0 .303-.213.67-.477.822a.431.431 0 0 1-.214.066m.428-1.412c-.1 0-.203.029-.307.09-.32.185-.57.618-.57.985 0 .309.185.524.449.524a.63.63 0 0 0 .308-.09c.32-.185.57-.618.57-.985 0-.309-.185-.524-.45-.524' fill='#8097A2'/><path d='M69.23 86.322l-.076-.149c0-.235.179-.544.384-.661l.12-.041.076.151c0 .234-.179.542-.383.66l-.121.04m.428-1.038a.431.431 0 0 0-.214.066c-.263.152-.477.521-.477.823 0 .214.107.337.263.337a.431.431 0 0 0 .214-.066c.264-.152.477-.519.477-.822 0-.214-.107-.338-.263-.338' fill='#8097A2'/><path d='M139.278 7.769v43.667L72.208 90.16V46.493l67.07-38.724' fill='#455A64'/><path d='M72.083 90.375V46.421l.063-.036 67.257-38.831v43.954l-.062.036-67.258 38.831zm.25-43.811v43.38l66.821-38.579V7.985L72.333 46.564z' fill='#607D8B'/></g><path d='M125.737 88.647l-7.639 3.334V84l-11.459 4.713v8.269L99 100.315l13.369 3.646 13.368-15.314' fill='#455A64'/></g></svg>\";\nfunction RotateInstructions() {\n this.loadIcon_();\n var overlay = document.createElement('div');\n var s = overlay.style;\n s.position = 'fixed';\n s.top = 0;\n s.right = 0;\n s.bottom = 0;\n s.left = 0;\n s.backgroundColor = 'gray';\n s.fontFamily = 'sans-serif';\n s.zIndex = 1000000;\n var img = document.createElement('img');\n img.src = this.icon;\n var s = img.style;\n s.marginLeft = '25%';\n s.marginTop = '25%';\n s.width = '50%';\n overlay.appendChild(img);\n var text = document.createElement('div');\n var s = text.style;\n s.textAlign = 'center';\n s.fontSize = '16px';\n s.lineHeight = '24px';\n s.margin = '24px 25%';\n s.width = '50%';\n text.innerHTML = 'Place your phone into your Cardboard viewer.';\n overlay.appendChild(text);\n var snackbar = document.createElement('div');\n var s = snackbar.style;\n s.backgroundColor = '#CFD8DC';\n s.position = 'fixed';\n s.bottom = 0;\n s.width = '100%';\n s.height = '48px';\n s.padding = '14px 24px';\n s.boxSizing = 'border-box';\n s.color = '#656A6B';\n overlay.appendChild(snackbar);\n var snackbarText = document.createElement('div');\n snackbarText.style.float = 'left';\n snackbarText.innerHTML = 'No Cardboard viewer?';\n var snackbarButton = document.createElement('a');\n snackbarButton.href = 'https://www.google.com/get/cardboard/get-cardboard/';\n snackbarButton.innerHTML = 'get one';\n snackbarButton.target = '_blank';\n var s = snackbarButton.style;\n s.float = 'right';\n s.fontWeight = 600;\n s.textTransform = 'uppercase';\n s.borderLeft = '1px solid gray';\n s.paddingLeft = '24px';\n s.textDecoration = 'none';\n s.color = '#656A6B';\n snackbar.appendChild(snackbarText);\n snackbar.appendChild(snackbarButton);\n this.overlay = overlay;\n this.text = text;\n this.hide();\n}\nRotateInstructions.prototype.show = function (parent) {\n if (!parent && !this.overlay.parentElement) {\n document.body.appendChild(this.overlay);\n } else if (parent) {\n if (this.overlay.parentElement && this.overlay.parentElement != parent) this.overlay.parentElement.removeChild(this.overlay);\n parent.appendChild(this.overlay);\n }\n this.overlay.style.display = 'block';\n var img = this.overlay.querySelector('img');\n var s = img.style;\n if (isLandscapeMode()) {\n s.width = '20%';\n s.marginLeft = '40%';\n s.marginTop = '3%';\n } else {\n s.width = '50%';\n s.marginLeft = '25%';\n s.marginTop = '25%';\n }\n};\nRotateInstructions.prototype.hide = function () {\n this.overlay.style.display = 'none';\n};\nRotateInstructions.prototype.showTemporarily = function (ms, parent) {\n this.show(parent);\n this.timer = setTimeout(this.hide.bind(this), ms);\n};\nRotateInstructions.prototype.disableShowTemporarily = function () {\n clearTimeout(this.timer);\n};\nRotateInstructions.prototype.update = function () {\n this.disableShowTemporarily();\n if (!isLandscapeMode() && isMobile()) {\n this.show();\n } else {\n this.hide();\n }\n};\nRotateInstructions.prototype.loadIcon_ = function () {\n this.icon = dataUri('image/svg+xml', rotateInstructionsAsset);\n};\nvar DEFAULT_VIEWER = 'CardboardV1';\nvar VIEWER_KEY = 'WEBVR_CARDBOARD_VIEWER';\nvar CLASS_NAME = 'webvr-polyfill-viewer-selector';\nfunction ViewerSelector(defaultViewer) {\n try {\n this.selectedKey = localStorage.getItem(VIEWER_KEY);\n } catch (error) {\n console.error('Failed to load viewer profile: %s', error);\n }\n if (!this.selectedKey) {\n this.selectedKey = defaultViewer || DEFAULT_VIEWER;\n }\n this.dialog = this.createDialog_(DeviceInfo.Viewers);\n this.root = null;\n this.onChangeCallbacks_ = [];\n}\nViewerSelector.prototype.show = function (root) {\n this.root = root;\n root.appendChild(this.dialog);\n var selected = this.dialog.querySelector('#' + this.selectedKey);\n selected.checked = true;\n this.dialog.style.display = 'block';\n};\nViewerSelector.prototype.hide = function () {\n if (this.root && this.root.contains(this.dialog)) {\n this.root.removeChild(this.dialog);\n }\n this.dialog.style.display = 'none';\n};\nViewerSelector.prototype.getCurrentViewer = function () {\n return DeviceInfo.Viewers[this.selectedKey];\n};\nViewerSelector.prototype.getSelectedKey_ = function () {\n var input = this.dialog.querySelector('input[name=field]:checked');\n if (input) {\n return input.id;\n }\n return null;\n};\nViewerSelector.prototype.onChange = function (cb) {\n this.onChangeCallbacks_.push(cb);\n};\nViewerSelector.prototype.fireOnChange_ = function (viewer) {\n for (var i = 0; i < this.onChangeCallbacks_.length; i++) {\n this.onChangeCallbacks_[i](viewer);\n }\n};\nViewerSelector.prototype.onSave_ = function () {\n this.selectedKey = this.getSelectedKey_();\n if (!this.selectedKey || !DeviceInfo.Viewers[this.selectedKey]) {\n console.error('ViewerSelector.onSave_: this should never happen!');\n return;\n }\n this.fireOnChange_(DeviceInfo.Viewers[this.selectedKey]);\n try {\n localStorage.setItem(VIEWER_KEY, this.selectedKey);\n } catch (error) {\n console.error('Failed to save viewer profile: %s', error);\n }\n this.hide();\n};\nViewerSelector.prototype.createDialog_ = function (options) {\n var container = document.createElement('div');\n container.classList.add(CLASS_NAME);\n container.style.display = 'none';\n var overlay = document.createElement('div');\n var s = overlay.style;\n s.position = 'fixed';\n s.left = 0;\n s.top = 0;\n s.width = '100%';\n s.height = '100%';\n s.background = 'rgba(0, 0, 0, 0.3)';\n overlay.addEventListener('click', this.hide.bind(this));\n var width = 280;\n var dialog = document.createElement('div');\n var s = dialog.style;\n s.boxSizing = 'border-box';\n s.position = 'fixed';\n s.top = '24px';\n s.left = '50%';\n s.marginLeft = -width / 2 + 'px';\n s.width = width + 'px';\n s.padding = '24px';\n s.overflow = 'hidden';\n s.background = '#fafafa';\n s.fontFamily = \"'Roboto', sans-serif\";\n s.boxShadow = '0px 5px 20px #666';\n dialog.appendChild(this.createH1_('Select your viewer'));\n for (var id in options) {\n dialog.appendChild(this.createChoice_(id, options[id].label));\n }\n dialog.appendChild(this.createButton_('Save', this.onSave_.bind(this)));\n container.appendChild(overlay);\n container.appendChild(dialog);\n return container;\n};\nViewerSelector.prototype.createH1_ = function (name) {\n var h1 = document.createElement('h1');\n var s = h1.style;\n s.color = 'black';\n s.fontSize = '20px';\n s.fontWeight = 'bold';\n s.marginTop = 0;\n s.marginBottom = '24px';\n h1.innerHTML = name;\n return h1;\n};\nViewerSelector.prototype.createChoice_ = function (id, name) {\n var div = document.createElement('div');\n div.style.marginTop = '8px';\n div.style.color = 'black';\n var input = document.createElement('input');\n input.style.fontSize = '30px';\n input.setAttribute('id', id);\n input.setAttribute('type', 'radio');\n input.setAttribute('value', id);\n input.setAttribute('name', 'field');\n var label = document.createElement('label');\n label.style.marginLeft = '4px';\n label.setAttribute('for', id);\n label.innerHTML = name;\n div.appendChild(input);\n div.appendChild(label);\n return div;\n};\nViewerSelector.prototype.createButton_ = function (label, onclick) {\n var button = document.createElement('button');\n button.innerHTML = label;\n var s = button.style;\n s.float = 'right';\n s.textTransform = 'uppercase';\n s.color = '#1094f7';\n s.fontSize = '14px';\n s.letterSpacing = 0;\n s.border = 0;\n s.background = 'none';\n s.marginTop = '16px';\n button.addEventListener('click', onclick);\n return button;\n};\nvar commonjsGlobal$$1 = typeof window !== 'undefined' ? window : typeof commonjsGlobal !== 'undefined' ? commonjsGlobal : typeof self !== 'undefined' ? self : {};\nfunction unwrapExports$$1 (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\nfunction createCommonjsModule$$1(fn, module) {\n\treturn module = { exports: {} }, fn(module, module.exports), module.exports;\n}\nvar NoSleep = createCommonjsModule$$1(function (module, exports) {\n(function webpackUniversalModuleDefinition(root, factory) {\n\tmodule.exports = factory();\n})(commonjsGlobal$$1, function() {\nreturn (function(modules) {\n \tvar installedModules = {};\n \tfunction __webpack_require__(moduleId) {\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n \t\tmodule.l = true;\n \t\treturn module.exports;\n \t}\n \t__webpack_require__.m = modules;\n \t__webpack_require__.c = installedModules;\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n \t__webpack_require__.p = \"\";\n \treturn __webpack_require__(__webpack_require__.s = 0);\n })\n ([\n (function(module, exports, __webpack_require__) {\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar mediaFile = __webpack_require__(1);\nvar oldIOS = typeof navigator !== 'undefined' && parseFloat(('' + (/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent) || [0, ''])[1]).replace('undefined', '3_2').replace('_', '.').replace('_', '')) < 10 && !window.MSStream;\nvar NoSleep = function () {\n function NoSleep() {\n _classCallCheck(this, NoSleep);\n if (oldIOS) {\n this.noSleepTimer = null;\n } else {\n this.noSleepVideo = document.createElement('video');\n this.noSleepVideo.setAttribute('playsinline', '');\n this.noSleepVideo.setAttribute('src', mediaFile);\n this.noSleepVideo.addEventListener('timeupdate', function (e) {\n if (this.noSleepVideo.currentTime > 0.5) {\n this.noSleepVideo.currentTime = Math.random();\n }\n }.bind(this));\n }\n }\n _createClass(NoSleep, [{\n key: 'enable',\n value: function enable() {\n if (oldIOS) {\n this.disable();\n this.noSleepTimer = window.setInterval(function () {\n window.location.href = '/';\n window.setTimeout(window.stop, 0);\n }, 15000);\n } else {\n this.noSleepVideo.play();\n }\n }\n }, {\n key: 'disable',\n value: function disable() {\n if (oldIOS) {\n if (this.noSleepTimer) {\n window.clearInterval(this.noSleepTimer);\n this.noSleepTimer = null;\n }\n } else {\n this.noSleepVideo.pause();\n }\n }\n }]);\n return NoSleep;\n}();\nmodule.exports = NoSleep;\n }),\n (function(module, exports, __webpack_require__) {\nmodule.exports = 'data:video/mp4;base64,AAAAIGZ0eXBtcDQyAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAACKBtZGF0AAAC8wYF///v3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE0MiByMjQ3OSBkZDc5YTYxIC0gSC4yNjQvTVBFRy00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxNCAtIGh0dHA6Ly93d3cudmlkZW9sYW4ub3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTEgZGVibG9jaz0xOjA6MCBhbmFseXNlPTB4MToweDExMSBtZT1oZXggc3VibWU9MiBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVkX3JlZj0wIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MCA4eDhkY3Q9MCBjcW09MCBkZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0wIHRocmVhZHM9NiBsb29rYWhlYWRfdGhyZWFkcz0xIHNsaWNlZF90aHJlYWRzPTAgbnI9MCBkZWNpbWF0ZT0xIGludGVybGFjZWQ9MCBibHVyYXlfY29tcGF0PTAgY29uc3RyYWluZWRfaW50cmE9MCBiZnJhbWVzPTMgYl9weXJhbWlkPTIgYl9hZGFwdD0xIGJfYmlhcz0wIGRpcmVjdD0xIHdlaWdodGI9MSBvcGVuX2dvcD0wIHdlaWdodHA9MSBrZXlpbnQ9MzAwIGtleWludF9taW49MzAgc2NlbmVjdXQ9NDAgaW50cmFfcmVmcmVzaD0wIHJjX2xvb2thaGVhZD0xMCByYz1jcmYgbWJ0cmVlPTEgY3JmPTIwLjAgcWNvbXA9MC42MCBxcG1pbj0wIHFwbWF4PTY5IHFwc3RlcD00IHZidl9tYXhyYXRlPTIwMDAwIHZidl9idWZzaXplPTI1MDAwIGNyZl9tYXg9MC4wIG5hbF9ocmQ9bm9uZSBmaWxsZXI9MCBpcF9yYXRpbz0xLjQwIGFxPTE6MS4wMACAAAAAOWWIhAA3//p+C7v8tDDSTjf97w55i3SbRPO4ZY+hkjD5hbkAkL3zpJ6h/LR1CAABzgB1kqqzUorlhQAAAAxBmiQYhn/+qZYADLgAAAAJQZ5CQhX/AAj5IQADQGgcIQADQGgcAAAACQGeYUQn/wALKCEAA0BoHAAAAAkBnmNEJ/8ACykhAANAaBwhAANAaBwAAAANQZpoNExDP/6plgAMuSEAA0BoHAAAAAtBnoZFESwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBnqVEJ/8ACykhAANAaBwAAAAJAZ6nRCf/AAsoIQADQGgcIQADQGgcAAAADUGarDRMQz/+qZYADLghAANAaBwAAAALQZ7KRRUsK/8ACPkhAANAaBwAAAAJAZ7pRCf/AAsoIQADQGgcIQADQGgcAAAACQGe60Qn/wALKCEAA0BoHAAAAA1BmvA0TEM//qmWAAy5IQADQGgcIQADQGgcAAAAC0GfDkUVLCv/AAj5IQADQGgcAAAACQGfLUQn/wALKSEAA0BoHCEAA0BoHAAAAAkBny9EJ/8ACyghAANAaBwAAAANQZs0NExDP/6plgAMuCEAA0BoHAAAAAtBn1JFFSwr/wAI+SEAA0BoHCEAA0BoHAAAAAkBn3FEJ/8ACyghAANAaBwAAAAJAZ9zRCf/AAsoIQADQGgcIQADQGgcAAAADUGbeDRMQz/+qZYADLkhAANAaBwAAAALQZ+WRRUsK/8ACPghAANAaBwhAANAaBwAAAAJAZ+1RCf/AAspIQADQGgcAAAACQGft0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bm7w0TEM//qmWAAy4IQADQGgcAAAAC0Gf2kUVLCv/AAj5IQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHAAAAAkBn/tEJ/8ACykhAANAaBwAAAANQZvgNExDP/6plgAMuSEAA0BoHCEAA0BoHAAAAAtBnh5FFSwr/wAI+CEAA0BoHAAAAAkBnj1EJ/8ACyghAANAaBwhAANAaBwAAAAJAZ4/RCf/AAspIQADQGgcAAAADUGaJDRMQz/+qZYADLghAANAaBwAAAALQZ5CRRUsK/8ACPkhAANAaBwhAANAaBwAAAAJAZ5hRCf/AAsoIQADQGgcAAAACQGeY0Qn/wALKSEAA0BoHCEAA0BoHAAAAA1Bmmg0TEM//qmWAAy5IQADQGgcAAAAC0GehkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGepUQn/wALKSEAA0BoHAAAAAkBnqdEJ/8ACyghAANAaBwAAAANQZqsNExDP/6plgAMuCEAA0BoHCEAA0BoHAAAAAtBnspFFSwr/wAI+SEAA0BoHAAAAAkBnulEJ/8ACyghAANAaBwhAANAaBwAAAAJAZ7rRCf/AAsoIQADQGgcAAAADUGa8DRMQz/+qZYADLkhAANAaBwhAANAaBwAAAALQZ8ORRUsK/8ACPkhAANAaBwAAAAJAZ8tRCf/AAspIQADQGgcIQADQGgcAAAACQGfL0Qn/wALKCEAA0BoHAAAAA1BmzQ0TEM//qmWAAy4IQADQGgcAAAAC0GfUkUVLCv/AAj5IQADQGgcIQADQGgcAAAACQGfcUQn/wALKCEAA0BoHAAAAAkBn3NEJ/8ACyghAANAaBwhAANAaBwAAAANQZt4NExC//6plgAMuSEAA0BoHAAAAAtBn5ZFFSwr/wAI+CEAA0BoHCEAA0BoHAAAAAkBn7VEJ/8ACykhAANAaBwAAAAJAZ+3RCf/AAspIQADQGgcAAAADUGbuzRMQn/+nhAAYsAhAANAaBwhAANAaBwAAAAJQZ/aQhP/AAspIQADQGgcAAAACQGf+UQn/wALKCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHCEAA0BoHAAACiFtb292AAAAbG12aGQAAAAA1YCCX9WAgl8AAAPoAAAH/AABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAGGlvZHMAAAAAEICAgAcAT////v7/AAAF+XRyYWsAAABcdGtoZAAAAAPVgIJf1YCCXwAAAAEAAAAAAAAH0AAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAygAAAMoAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAB9AAABdwAAEAAAAABXFtZGlhAAAAIG1kaGQAAAAA1YCCX9WAgl8AAV+QAAK/IFXEAAAAAAAtaGRscgAAAAAAAAAAdmlkZQAAAAAAAAAAAAAAAFZpZGVvSGFuZGxlcgAAAAUcbWluZgAAABR2bWhkAAAAAQAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAAE3HN0YmwAAACYc3RzZAAAAAAAAAABAAAAiGF2YzEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAygDKAEgAAABIAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY//8AAAAyYXZjQwFNQCj/4QAbZ01AKOyho3ySTUBAQFAAAAMAEAAr8gDxgxlgAQAEaO+G8gAAABhzdHRzAAAAAAAAAAEAAAA8AAALuAAAABRzdHNzAAAAAAAAAAEAAAABAAAB8GN0dHMAAAAAAAAAPAAAAAEAABdwAAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAADqYAAAAAQAAF3AAAAABAAAAAAAAAAEAAAu4AAAAAQAAOpgAAAABAAAXcAAAAAEAAAAAAAAAAQAAC7gAAAABAAA6mAAAAAEAABdwAAAAAQAAAAAAAAABAAALuAAAAAEAAC7gAAAAAQAAF3AAAAABAAAAAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAEEc3RzegAAAAAAAAAAAAAAPAAAAzQAAAAQAAAADQAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAAPAAAADQAAAA0AAAARAAAADwAAAA0AAAANAAAAEQAAAA8AAAANAAAADQAAABEAAAANAAAADQAAAQBzdGNvAAAAAAAAADwAAAAwAAADZAAAA3QAAAONAAADoAAAA7kAAAPQAAAD6wAAA/4AAAQXAAAELgAABEMAAARcAAAEbwAABIwAAAShAAAEugAABM0AAATkAAAE/wAABRIAAAUrAAAFQgAABV0AAAVwAAAFiQAABaAAAAW1AAAFzgAABeEAAAX+AAAGEwAABiwAAAY/AAAGVgAABnEAAAaEAAAGnQAABrQAAAbPAAAG4gAABvUAAAcSAAAHJwAAB0AAAAdTAAAHcAAAB4UAAAeeAAAHsQAAB8gAAAfjAAAH9gAACA8AAAgmAAAIQQAACFQAAAhnAAAIhAAACJcAAAMsdHJhawAAAFx0a2hkAAAAA9WAgl/VgIJfAAAAAgAAAAAAAAf8AAAAAAAAAAAAAAABAQAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAACsm1kaWEAAAAgbWRoZAAAAADVgIJf1YCCXwAArEQAAWAAVcQAAAAAACdoZGxyAAAAAAAAAABzb3VuAAAAAAAAAAAAAAAAU3RlcmVvAAAAAmNtaW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAidzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAIABICAgBRAFQAAAAADDUAAAAAABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAABYAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAUc3RzegAAAAAAAAAGAAAAWAAAAXBzdGNvAAAAAAAAAFgAAAOBAAADhwAAA5oAAAOtAAADswAAA8oAAAPfAAAD5QAAA/gAAAQLAAAEEQAABCgAAAQ9AAAEUAAABFYAAARpAAAEgAAABIYAAASbAAAErgAABLQAAATHAAAE3gAABPMAAAT5AAAFDAAABR8AAAUlAAAFPAAABVEAAAVXAAAFagAABX0AAAWDAAAFmgAABa8AAAXCAAAFyAAABdsAAAXyAAAF+AAABg0AAAYgAAAGJgAABjkAAAZQAAAGZQAABmsAAAZ+AAAGkQAABpcAAAauAAAGwwAABskAAAbcAAAG7wAABwYAAAcMAAAHIQAABzQAAAc6AAAHTQAAB2QAAAdqAAAHfwAAB5IAAAeYAAAHqwAAB8IAAAfXAAAH3QAAB/AAAAgDAAAICQAACCAAAAg1AAAIOwAACE4AAAhhAAAIeAAACH4AAAiRAAAIpAAACKoAAAiwAAAItgAACLwAAAjCAAAAFnVkdGEAAAAObmFtZVN0ZXJlbwAAAHB1ZHRhAAAAaG1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAAO2lsc3QAAAAzqXRvbwAAACtkYXRhAAAAAQAAAABIYW5kQnJha2UgMC4xMC4yIDIwMTUwNjExMDA=';\n })\n ]);\n});\n});\nvar NoSleep$1 = unwrapExports$$1(NoSleep);\nvar nextDisplayId = 1000;\nvar defaultLeftBounds = [0, 0, 0.5, 1];\nvar defaultRightBounds = [0.5, 0, 0.5, 1];\nvar raf = window.requestAnimationFrame;\nvar caf = window.cancelAnimationFrame;\nfunction VRFrameData() {\n this.leftProjectionMatrix = new Float32Array(16);\n this.leftViewMatrix = new Float32Array(16);\n this.rightProjectionMatrix = new Float32Array(16);\n this.rightViewMatrix = new Float32Array(16);\n this.pose = null;\n}\nfunction VRDisplayCapabilities(config) {\n Object.defineProperties(this, {\n hasPosition: {\n writable: false, enumerable: true, value: config.hasPosition\n },\n hasExternalDisplay: {\n writable: false, enumerable: true, value: config.hasExternalDisplay\n },\n canPresent: {\n writable: false, enumerable: true, value: config.canPresent\n },\n maxLayers: {\n writable: false, enumerable: true, value: config.maxLayers\n },\n hasOrientation: {\n enumerable: true, get: function get() {\n deprecateWarning('VRDisplayCapabilities.prototype.hasOrientation', 'VRDisplay.prototype.getFrameData');\n return config.hasOrientation;\n }\n }\n });\n}\nfunction VRDisplay(config) {\n config = config || {};\n var USE_WAKELOCK = 'wakelock' in config ? config.wakelock : true;\n this.isPolyfilled = true;\n this.displayId = nextDisplayId++;\n this.displayName = '';\n this.depthNear = 0.01;\n this.depthFar = 10000.0;\n this.isPresenting = false;\n Object.defineProperty(this, 'isConnected', {\n get: function get() {\n deprecateWarning('VRDisplay.prototype.isConnected', 'VRDisplayCapabilities.prototype.hasExternalDisplay');\n return false;\n }\n });\n this.capabilities = new VRDisplayCapabilities({\n hasPosition: false,\n hasOrientation: false,\n hasExternalDisplay: false,\n canPresent: false,\n maxLayers: 1\n });\n this.stageParameters = null;\n this.waitingForPresent_ = false;\n this.layer_ = null;\n this.originalParent_ = null;\n this.fullscreenElement_ = null;\n this.fullscreenWrapper_ = null;\n this.fullscreenElementCachedStyle_ = null;\n this.fullscreenEventTarget_ = null;\n this.fullscreenChangeHandler_ = null;\n this.fullscreenErrorHandler_ = null;\n if (USE_WAKELOCK && isMobile()) {\n this.wakelock_ = new NoSleep$1();\n }\n}\nVRDisplay.prototype.getFrameData = function (frameData) {\n return frameDataFromPose(frameData, this._getPose(), this);\n};\nVRDisplay.prototype.getPose = function () {\n deprecateWarning('VRDisplay.prototype.getPose', 'VRDisplay.prototype.getFrameData');\n return this._getPose();\n};\nVRDisplay.prototype.resetPose = function () {\n deprecateWarning('VRDisplay.prototype.resetPose');\n return this._resetPose();\n};\nVRDisplay.prototype.getImmediatePose = function () {\n deprecateWarning('VRDisplay.prototype.getImmediatePose', 'VRDisplay.prototype.getFrameData');\n return this._getPose();\n};\nVRDisplay.prototype.requestAnimationFrame = function (callback) {\n return raf(callback);\n};\nVRDisplay.prototype.cancelAnimationFrame = function (id) {\n return caf(id);\n};\nVRDisplay.prototype.wrapForFullscreen = function (element) {\n if (isIOS()) {\n return element;\n }\n if (!this.fullscreenWrapper_) {\n this.fullscreenWrapper_ = document.createElement('div');\n var cssProperties = ['height: ' + Math.min(screen.height, screen.width) + 'px !important', 'top: 0 !important', 'left: 0 !important', 'right: 0 !important', 'border: 0', 'margin: 0', 'padding: 0', 'z-index: 999999 !important', 'position: fixed'];\n this.fullscreenWrapper_.setAttribute('style', cssProperties.join('; ') + ';');\n this.fullscreenWrapper_.classList.add('webvr-polyfill-fullscreen-wrapper');\n }\n if (this.fullscreenElement_ == element) {\n return this.fullscreenWrapper_;\n }\n if (this.fullscreenElement_) {\n if (this.originalParent_) {\n this.originalParent_.appendChild(this.fullscreenElement_);\n } else {\n this.fullscreenElement_.parentElement.removeChild(this.fullscreenElement_);\n }\n }\n this.fullscreenElement_ = element;\n this.originalParent_ = element.parentElement;\n if (!this.originalParent_) {\n document.body.appendChild(element);\n }\n if (!this.fullscreenWrapper_.parentElement) {\n var parent = this.fullscreenElement_.parentElement;\n parent.insertBefore(this.fullscreenWrapper_, this.fullscreenElement_);\n parent.removeChild(this.fullscreenElement_);\n }\n this.fullscreenWrapper_.insertBefore(this.fullscreenElement_, this.fullscreenWrapper_.firstChild);\n this.fullscreenElementCachedStyle_ = this.fullscreenElement_.getAttribute('style');\n var self = this;\n function applyFullscreenElementStyle() {\n if (!self.fullscreenElement_) {\n return;\n }\n var cssProperties = ['position: absolute', 'top: 0', 'left: 0', 'width: ' + Math.max(screen.width, screen.height) + 'px', 'height: ' + Math.min(screen.height, screen.width) + 'px', 'border: 0', 'margin: 0', 'padding: 0'];\n self.fullscreenElement_.setAttribute('style', cssProperties.join('; ') + ';');\n }\n applyFullscreenElementStyle();\n return this.fullscreenWrapper_;\n};\nVRDisplay.prototype.removeFullscreenWrapper = function () {\n if (!this.fullscreenElement_) {\n return;\n }\n var element = this.fullscreenElement_;\n if (this.fullscreenElementCachedStyle_) {\n element.setAttribute('style', this.fullscreenElementCachedStyle_);\n } else {\n element.removeAttribute('style');\n }\n this.fullscreenElement_ = null;\n this.fullscreenElementCachedStyle_ = null;\n var parent = this.fullscreenWrapper_.parentElement;\n this.fullscreenWrapper_.removeChild(element);\n if (this.originalParent_ === parent) {\n parent.insertBefore(element, this.fullscreenWrapper_);\n }\n else if (this.originalParent_) {\n this.originalParent_.appendChild(element);\n }\n parent.removeChild(this.fullscreenWrapper_);\n return element;\n};\nVRDisplay.prototype.requestPresent = function (layers) {\n var wasPresenting = this.isPresenting;\n var self = this;\n if (!(layers instanceof Array)) {\n deprecateWarning('VRDisplay.prototype.requestPresent with non-array argument', 'an array of VRLayers as the first argument');\n layers = [layers];\n }\n return new Promise(function (resolve, reject) {\n if (!self.capabilities.canPresent) {\n reject(new Error('VRDisplay is not capable of presenting.'));\n return;\n }\n if (layers.length == 0 || layers.length > self.capabilities.maxLayers) {\n reject(new Error('Invalid number of layers.'));\n return;\n }\n var incomingLayer = layers[0];\n if (!incomingLayer.source) {\n resolve();\n return;\n }\n var leftBounds = incomingLayer.leftBounds || defaultLeftBounds;\n var rightBounds = incomingLayer.rightBounds || defaultRightBounds;\n if (wasPresenting) {\n var layer = self.layer_;\n if (layer.source !== incomingLayer.source) {\n layer.source = incomingLayer.source;\n }\n for (var i = 0; i < 4; i++) {\n layer.leftBounds[i] = leftBounds[i];\n layer.rightBounds[i] = rightBounds[i];\n }\n self.wrapForFullscreen(self.layer_.source);\n self.updatePresent_();\n resolve();\n return;\n }\n self.layer_ = {\n predistorted: incomingLayer.predistorted,\n source: incomingLayer.source,\n leftBounds: leftBounds.slice(0),\n rightBounds: rightBounds.slice(0)\n };\n self.waitingForPresent_ = false;\n if (self.layer_ && self.layer_.source) {\n var fullscreenElement = self.wrapForFullscreen(self.layer_.source);\n var onFullscreenChange = function onFullscreenChange() {\n var actualFullscreenElement = getFullscreenElement();\n self.isPresenting = fullscreenElement === actualFullscreenElement;\n if (self.isPresenting) {\n if (screen.orientation && screen.orientation.lock) {\n screen.orientation.lock('landscape-primary').catch(function (error) {\n console.error('screen.orientation.lock() failed due to', error.message);\n });\n }\n self.waitingForPresent_ = false;\n self.beginPresent_();\n resolve();\n } else {\n if (screen.orientation && screen.orientation.unlock) {\n screen.orientation.unlock();\n }\n self.removeFullscreenWrapper();\n self.disableWakeLock();\n self.endPresent_();\n self.removeFullscreenListeners_();\n }\n self.fireVRDisplayPresentChange_();\n };\n var onFullscreenError = function onFullscreenError() {\n if (!self.waitingForPresent_) {\n return;\n }\n self.removeFullscreenWrapper();\n self.removeFullscreenListeners_();\n self.disableWakeLock();\n self.waitingForPresent_ = false;\n self.isPresenting = false;\n reject(new Error('Unable to present.'));\n };\n self.addFullscreenListeners_(fullscreenElement, onFullscreenChange, onFullscreenError);\n if (requestFullscreen(fullscreenElement)) {\n self.enableWakeLock();\n self.waitingForPresent_ = true;\n } else if (isIOS() || isWebViewAndroid()) {\n self.enableWakeLock();\n self.isPresenting = true;\n self.beginPresent_();\n self.fireVRDisplayPresentChange_();\n resolve();\n }\n }\n if (!self.waitingForPresent_ && !isIOS()) {\n exitFullscreen();\n reject(new Error('Unable to present.'));\n }\n });\n};\nVRDisplay.prototype.exitPresent = function () {\n var wasPresenting = this.isPresenting;\n var self = this;\n this.isPresenting = false;\n this.layer_ = null;\n this.disableWakeLock();\n return new Promise(function (resolve, reject) {\n if (wasPresenting) {\n if (!exitFullscreen() && isIOS()) {\n self.endPresent_();\n self.fireVRDisplayPresentChange_();\n }\n if (isWebViewAndroid()) {\n self.removeFullscreenWrapper();\n self.removeFullscreenListeners_();\n self.endPresent_();\n self.fireVRDisplayPresentChange_();\n }\n resolve();\n } else {\n reject(new Error('Was not presenting to VRDisplay.'));\n }\n });\n};\nVRDisplay.prototype.getLayers = function () {\n if (this.layer_) {\n return [this.layer_];\n }\n return [];\n};\nVRDisplay.prototype.fireVRDisplayPresentChange_ = function () {\n var event = new CustomEvent('vrdisplaypresentchange', { detail: { display: this } });\n window.dispatchEvent(event);\n};\nVRDisplay.prototype.fireVRDisplayConnect_ = function () {\n var event = new CustomEvent('vrdisplayconnect', { detail: { display: this } });\n window.dispatchEvent(event);\n};\nVRDisplay.prototype.addFullscreenListeners_ = function (element, changeHandler, errorHandler) {\n this.removeFullscreenListeners_();\n this.fullscreenEventTarget_ = element;\n this.fullscreenChangeHandler_ = changeHandler;\n this.fullscreenErrorHandler_ = errorHandler;\n if (changeHandler) {\n if (document.fullscreenEnabled) {\n element.addEventListener('fullscreenchange', changeHandler, false);\n } else if (document.webkitFullscreenEnabled) {\n element.addEventListener('webkitfullscreenchange', changeHandler, false);\n } else if (document.mozFullScreenEnabled) {\n document.addEventListener('mozfullscreenchange', changeHandler, false);\n } else if (document.msFullscreenEnabled) {\n element.addEventListener('msfullscreenchange', changeHandler, false);\n }\n }\n if (errorHandler) {\n if (document.fullscreenEnabled) {\n element.addEventListener('fullscreenerror', errorHandler, false);\n } else if (document.webkitFullscreenEnabled) {\n element.addEventListener('webkitfullscreenerror', errorHandler, false);\n } else if (document.mozFullScreenEnabled) {\n document.addEventListener('mozfullscreenerror', errorHandler, false);\n } else if (document.msFullscreenEnabled) {\n element.addEventListener('msfullscreenerror', errorHandler, false);\n }\n }\n};\nVRDisplay.prototype.removeFullscreenListeners_ = function () {\n if (!this.fullscreenEventTarget_) return;\n var element = this.fullscreenEventTarget_;\n if (this.fullscreenChangeHandler_) {\n var changeHandler = this.fullscreenChangeHandler_;\n element.removeEventListener('fullscreenchange', changeHandler, false);\n element.removeEventListener('webkitfullscreenchange', changeHandler, false);\n document.removeEventListener('mozfullscreenchange', changeHandler, false);\n element.removeEventListener('msfullscreenchange', changeHandler, false);\n }\n if (this.fullscreenErrorHandler_) {\n var errorHandler = this.fullscreenErrorHandler_;\n element.removeEventListener('fullscreenerror', errorHandler, false);\n element.removeEventListener('webkitfullscreenerror', errorHandler, false);\n document.removeEventListener('mozfullscreenerror', errorHandler, false);\n element.removeEventListener('msfullscreenerror', errorHandler, false);\n }\n this.fullscreenEventTarget_ = null;\n this.fullscreenChangeHandler_ = null;\n this.fullscreenErrorHandler_ = null;\n};\nVRDisplay.prototype.enableWakeLock = function () {\n if (this.wakelock_) {\n this.wakelock_.enable();\n }\n};\nVRDisplay.prototype.disableWakeLock = function () {\n if (this.wakelock_) {\n this.wakelock_.disable();\n }\n};\nVRDisplay.prototype.beginPresent_ = function () {\n};\nVRDisplay.prototype.endPresent_ = function () {\n};\nVRDisplay.prototype.submitFrame = function (pose) {\n};\nVRDisplay.prototype.getEyeParameters = function (whichEye) {\n return null;\n};\nvar config = {\n ADDITIONAL_VIEWERS: [],\n DEFAULT_VIEWER: '',\n MOBILE_WAKE_LOCK: true,\n DEBUG: false,\n DPDB_URL: 'https://dpdb.webvr.rocks/dpdb.json',\n K_FILTER: 0.98,\n PREDICTION_TIME_S: 0.040,\n CARDBOARD_UI_DISABLED: false,\n ROTATE_INSTRUCTIONS_DISABLED: false,\n YAW_ONLY: false,\n BUFFER_SCALE: 0.5,\n DIRTY_SUBMIT_FRAME_BINDINGS: false\n};\nvar Eye = {\n LEFT: 'left',\n RIGHT: 'right'\n};\nfunction CardboardVRDisplay(config$$1) {\n var defaults = extend({}, config);\n config$$1 = extend(defaults, config$$1 || {});\n VRDisplay.call(this, {\n wakelock: config$$1.MOBILE_WAKE_LOCK\n });\n this.config = config$$1;\n this.displayName = 'Cardboard VRDisplay';\n this.capabilities = new VRDisplayCapabilities({\n hasPosition: false,\n hasOrientation: true,\n hasExternalDisplay: false,\n canPresent: true,\n maxLayers: 1\n });\n this.stageParameters = null;\n this.bufferScale_ = this.config.BUFFER_SCALE;\n this.poseSensor_ = new PoseSensor(this.config);\n this.distorter_ = null;\n this.cardboardUI_ = null;\n this.dpdb_ = new Dpdb(this.config.DPDB_URL, this.onDeviceParamsUpdated_.bind(this));\n this.deviceInfo_ = new DeviceInfo(this.dpdb_.getDeviceParams(), config$$1.ADDITIONAL_VIEWERS);\n this.viewerSelector_ = new ViewerSelector(config$$1.DEFAULT_VIEWER);\n this.viewerSelector_.onChange(this.onViewerChanged_.bind(this));\n this.deviceInfo_.setViewer(this.viewerSelector_.getCurrentViewer());\n if (!this.config.ROTATE_INSTRUCTIONS_DISABLED) {\n this.rotateInstructions_ = new RotateInstructions();\n }\n if (isIOS()) {\n window.addEventListener('resize', this.onResize_.bind(this));\n }\n}\nCardboardVRDisplay.prototype = Object.create(VRDisplay.prototype);\nCardboardVRDisplay.prototype._getPose = function () {\n return {\n position: null,\n orientation: this.poseSensor_.getOrientation(),\n linearVelocity: null,\n linearAcceleration: null,\n angularVelocity: null,\n angularAcceleration: null\n };\n};\nCardboardVRDisplay.prototype._resetPose = function () {\n if (this.poseSensor_.resetPose) {\n this.poseSensor_.resetPose();\n }\n};\nCardboardVRDisplay.prototype._getFieldOfView = function (whichEye) {\n var fieldOfView;\n if (whichEye == Eye.LEFT) {\n fieldOfView = this.deviceInfo_.getFieldOfViewLeftEye();\n } else if (whichEye == Eye.RIGHT) {\n fieldOfView = this.deviceInfo_.getFieldOfViewRightEye();\n } else {\n console.error('Invalid eye provided: %s', whichEye);\n return null;\n }\n return fieldOfView;\n};\nCardboardVRDisplay.prototype._getEyeOffset = function (whichEye) {\n var offset;\n if (whichEye == Eye.LEFT) {\n offset = [-this.deviceInfo_.viewer.interLensDistance * 0.5, 0.0, 0.0];\n } else if (whichEye == Eye.RIGHT) {\n offset = [this.deviceInfo_.viewer.interLensDistance * 0.5, 0.0, 0.0];\n } else {\n console.error('Invalid eye provided: %s', whichEye);\n return null;\n }\n return offset;\n};\nCardboardVRDisplay.prototype.getEyeParameters = function (whichEye) {\n var offset = this._getEyeOffset(whichEye);\n var fieldOfView = this._getFieldOfView(whichEye);\n var eyeParams = {\n offset: offset,\n renderWidth: this.deviceInfo_.device.width * 0.5 * this.bufferScale_,\n renderHeight: this.deviceInfo_.device.height * this.bufferScale_\n };\n Object.defineProperty(eyeParams, 'fieldOfView', {\n enumerable: true,\n get: function get() {\n deprecateWarning('VRFieldOfView', 'VRFrameData\\'s projection matrices');\n return fieldOfView;\n }\n });\n return eyeParams;\n};\nCardboardVRDisplay.prototype.onDeviceParamsUpdated_ = function (newParams) {\n if (this.config.DEBUG) {\n console.log('DPDB reported that device params were updated.');\n }\n this.deviceInfo_.updateDeviceParams(newParams);\n if (this.distorter_) {\n this.distorter_.updateDeviceInfo(this.deviceInfo_);\n }\n};\nCardboardVRDisplay.prototype.updateBounds_ = function () {\n if (this.layer_ && this.distorter_ && (this.layer_.leftBounds || this.layer_.rightBounds)) {\n this.distorter_.setTextureBounds(this.layer_.leftBounds, this.layer_.rightBounds);\n }\n};\nCardboardVRDisplay.prototype.beginPresent_ = function () {\n var gl = this.layer_.source.getContext('webgl');\n if (!gl) gl = this.layer_.source.getContext('experimental-webgl');\n if (!gl) gl = this.layer_.source.getContext('webgl2');\n if (!gl) return;\n if (this.layer_.predistorted) {\n if (!this.config.CARDBOARD_UI_DISABLED) {\n gl.canvas.width = getScreenWidth() * this.bufferScale_;\n gl.canvas.height = getScreenHeight() * this.bufferScale_;\n this.cardboardUI_ = new CardboardUI(gl);\n }\n } else {\n if (!this.config.CARDBOARD_UI_DISABLED) {\n this.cardboardUI_ = new CardboardUI(gl);\n }\n this.distorter_ = new CardboardDistorter(gl, this.cardboardUI_, this.config.BUFFER_SCALE, this.config.DIRTY_SUBMIT_FRAME_BINDINGS);\n this.distorter_.updateDeviceInfo(this.deviceInfo_);\n }\n if (this.cardboardUI_) {\n this.cardboardUI_.listen(function (e) {\n this.viewerSelector_.show(this.layer_.source.parentElement);\n e.stopPropagation();\n e.preventDefault();\n }.bind(this), function (e) {\n this.exitPresent();\n e.stopPropagation();\n e.preventDefault();\n }.bind(this));\n }\n if (this.rotateInstructions_) {\n if (isLandscapeMode() && isMobile()) {\n this.rotateInstructions_.showTemporarily(3000, this.layer_.source.parentElement);\n } else {\n this.rotateInstructions_.update();\n }\n }\n this.orientationHandler = this.onOrientationChange_.bind(this);\n window.addEventListener('orientationchange', this.orientationHandler);\n this.vrdisplaypresentchangeHandler = this.updateBounds_.bind(this);\n window.addEventListener('vrdisplaypresentchange', this.vrdisplaypresentchangeHandler);\n this.fireVRDisplayDeviceParamsChange_();\n};\nCardboardVRDisplay.prototype.endPresent_ = function () {\n if (this.distorter_) {\n this.distorter_.destroy();\n this.distorter_ = null;\n }\n if (this.cardboardUI_) {\n this.cardboardUI_.destroy();\n this.cardboardUI_ = null;\n }\n if (this.rotateInstructions_) {\n this.rotateInstructions_.hide();\n }\n this.viewerSelector_.hide();\n window.removeEventListener('orientationchange', this.orientationHandler);\n window.removeEventListener('vrdisplaypresentchange', this.vrdisplaypresentchangeHandler);\n};\nCardboardVRDisplay.prototype.updatePresent_ = function () {\n this.endPresent_();\n this.beginPresent_();\n};\nCardboardVRDisplay.prototype.submitFrame = function (pose) {\n if (this.distorter_) {\n this.updateBounds_();\n this.distorter_.submitFrame();\n } else if (this.cardboardUI_ && this.layer_) {\n var gl = this.layer_.source.getContext('webgl');\n if (!gl) gl = this.layer_.source.getContext('experimental-webgl');\n if (!gl) gl = this.layer_.source.getContext('webgl2');\n var canvas = gl.canvas;\n if (canvas.width != this.lastWidth || canvas.height != this.lastHeight) {\n this.cardboardUI_.onResize();\n }\n this.lastWidth = canvas.width;\n this.lastHeight = canvas.height;\n this.cardboardUI_.render();\n }\n};\nCardboardVRDisplay.prototype.onOrientationChange_ = function (e) {\n this.viewerSelector_.hide();\n if (this.rotateInstructions_) {\n this.rotateInstructions_.update();\n }\n this.onResize_();\n};\nCardboardVRDisplay.prototype.onResize_ = function (e) {\n if (this.layer_) {\n var gl = this.layer_.source.getContext('webgl');\n if (!gl) gl = this.layer_.source.getContext('experimental-webgl');\n if (!gl) gl = this.layer_.source.getContext('webgl2');\n var cssProperties = ['position: absolute', 'top: 0', 'left: 0',\n 'width: 100vw', 'height: 100vh', 'border: 0', 'margin: 0',\n 'padding: 0px', 'box-sizing: content-box'];\n gl.canvas.setAttribute('style', cssProperties.join('; ') + ';');\n safariCssSizeWorkaround(gl.canvas);\n }\n};\nCardboardVRDisplay.prototype.onViewerChanged_ = function (viewer) {\n this.deviceInfo_.setViewer(viewer);\n if (this.distorter_) {\n this.distorter_.updateDeviceInfo(this.deviceInfo_);\n }\n this.fireVRDisplayDeviceParamsChange_();\n};\nCardboardVRDisplay.prototype.fireVRDisplayDeviceParamsChange_ = function () {\n var event = new CustomEvent('vrdisplaydeviceparamschange', {\n detail: {\n vrdisplay: this,\n deviceInfo: this.deviceInfo_\n }\n });\n window.dispatchEvent(event);\n};\nCardboardVRDisplay.VRFrameData = VRFrameData;\nCardboardVRDisplay.VRDisplay = VRDisplay;\nreturn CardboardVRDisplay;\n})));\n});\nvar CardboardVRDisplay = unwrapExports(cardboardVrDisplay);\n\nvar version = \"0.10.12\";\n\nvar DefaultConfig = {\n ADDITIONAL_VIEWERS: [],\n DEFAULT_VIEWER: '',\n PROVIDE_MOBILE_VRDISPLAY: true,\n MOBILE_WAKE_LOCK: true,\n DEBUG: false,\n DPDB_URL: 'https://dpdb.webvr.rocks/dpdb.json',\n K_FILTER: 0.98,\n PREDICTION_TIME_S: 0.040,\n CARDBOARD_UI_DISABLED: false,\n ROTATE_INSTRUCTIONS_DISABLED: false,\n YAW_ONLY: false,\n BUFFER_SCALE: 0.5,\n DIRTY_SUBMIT_FRAME_BINDINGS: false\n};\n\nfunction WebVRPolyfill(config) {\n this.config = extend(extend({}, DefaultConfig), config);\n this.polyfillDisplays = [];\n this.enabled = false;\n this.hasNative = 'getVRDisplays' in navigator;\n this.native = {};\n this.native.getVRDisplays = navigator.getVRDisplays;\n this.native.VRFrameData = window.VRFrameData;\n this.native.VRDisplay = window.VRDisplay;\n if (!this.hasNative || this.config.PROVIDE_MOBILE_VRDISPLAY && isMobile()) {\n this.enable();\n this.getVRDisplays().then(function (displays) {\n if (displays && displays[0] && displays[0].fireVRDisplayConnect_) {\n displays[0].fireVRDisplayConnect_();\n }\n });\n }\n}\nWebVRPolyfill.prototype.getPolyfillDisplays = function () {\n if (this._polyfillDisplaysPopulated) {\n return this.polyfillDisplays;\n }\n if (isMobile()) {\n var vrDisplay = new CardboardVRDisplay({\n ADDITIONAL_VIEWERS: this.config.ADDITIONAL_VIEWERS,\n DEFAULT_VIEWER: this.config.DEFAULT_VIEWER,\n MOBILE_WAKE_LOCK: this.config.MOBILE_WAKE_LOCK,\n DEBUG: this.config.DEBUG,\n DPDB_URL: this.config.DPDB_URL,\n CARDBOARD_UI_DISABLED: this.config.CARDBOARD_UI_DISABLED,\n K_FILTER: this.config.K_FILTER,\n PREDICTION_TIME_S: this.config.PREDICTION_TIME_S,\n ROTATE_INSTRUCTIONS_DISABLED: this.config.ROTATE_INSTRUCTIONS_DISABLED,\n YAW_ONLY: this.config.YAW_ONLY,\n BUFFER_SCALE: this.config.BUFFER_SCALE,\n DIRTY_SUBMIT_FRAME_BINDINGS: this.config.DIRTY_SUBMIT_FRAME_BINDINGS\n });\n this.polyfillDisplays.push(vrDisplay);\n }\n this._polyfillDisplaysPopulated = true;\n return this.polyfillDisplays;\n};\nWebVRPolyfill.prototype.enable = function () {\n this.enabled = true;\n if (this.hasNative && this.native.VRFrameData) {\n var NativeVRFrameData = this.native.VRFrameData;\n var nativeFrameData = new this.native.VRFrameData();\n var nativeGetFrameData = this.native.VRDisplay.prototype.getFrameData;\n window.VRDisplay.prototype.getFrameData = function (frameData) {\n if (frameData instanceof NativeVRFrameData) {\n nativeGetFrameData.call(this, frameData);\n return;\n }\n nativeGetFrameData.call(this, nativeFrameData);\n frameData.pose = nativeFrameData.pose;\n copyArray(nativeFrameData.leftProjectionMatrix, frameData.leftProjectionMatrix);\n copyArray(nativeFrameData.rightProjectionMatrix, frameData.rightProjectionMatrix);\n copyArray(nativeFrameData.leftViewMatrix, frameData.leftViewMatrix);\n copyArray(nativeFrameData.rightViewMatrix, frameData.rightViewMatrix);\n };\n }\n navigator.getVRDisplays = this.getVRDisplays.bind(this);\n window.VRDisplay = CardboardVRDisplay.VRDisplay;\n window.VRFrameData = CardboardVRDisplay.VRFrameData;\n};\nWebVRPolyfill.prototype.getVRDisplays = function () {\n var _this = this;\n var config = this.config;\n if (!this.hasNative) {\n return Promise.resolve(this.getPolyfillDisplays());\n }\n return this.native.getVRDisplays.call(navigator).then(function (nativeDisplays) {\n return nativeDisplays.length > 0 ? nativeDisplays : _this.getPolyfillDisplays();\n });\n};\nWebVRPolyfill.version = version;\nWebVRPolyfill.VRFrameData = CardboardVRDisplay.VRFrameData;\nWebVRPolyfill.VRDisplay = CardboardVRDisplay.VRDisplay;\n\n\nvar webvrPolyfill = Object.freeze({\n\tdefault: WebVRPolyfill\n});\n\nvar require$$0 = ( webvrPolyfill && WebVRPolyfill ) || webvrPolyfill;\n\nif (typeof commonjsGlobal !== 'undefined' && commonjsGlobal.window) {\n if (!commonjsGlobal.document) {\n commonjsGlobal.document = commonjsGlobal.window.document;\n }\n if (!commonjsGlobal.navigator) {\n commonjsGlobal.navigator = commonjsGlobal.window.navigator;\n }\n}\nvar src = require$$0;\n\nreturn src;\n\n})));\n",
  306. "var newline = /\\n/\nvar newlineChar = '\\n'\nvar whitespace = /\\s/\n\nmodule.exports = function(text, opt) {\n var lines = module.exports.lines(text, opt)\n return lines.map(function(line) {\n return text.substring(line.start, line.end)\n }).join('\\n')\n}\n\nmodule.exports.lines = function wordwrap(text, opt) {\n opt = opt||{}\n\n //zero width results in nothing visible\n if (opt.width === 0 && opt.mode !== 'nowrap') \n return []\n\n text = text||''\n var width = typeof opt.width === 'number' ? opt.width : Number.MAX_VALUE\n var start = Math.max(0, opt.start||0)\n var end = typeof opt.end === 'number' ? opt.end : text.length\n var mode = opt.mode\n\n var measure = opt.measure || monospace\n if (mode === 'pre')\n return pre(measure, text, start, end, width)\n else\n return greedy(measure, text, start, end, width, mode)\n}\n\nfunction idxOf(text, chr, start, end) {\n var idx = text.indexOf(chr, start)\n if (idx === -1 || idx > end)\n return end\n return idx\n}\n\nfunction isWhitespace(chr) {\n return whitespace.test(chr)\n}\n\nfunction pre(measure, text, start, end, width) {\n var lines = []\n var lineStart = start\n for (var i=start; i<end && i<text.length; i++) {\n var chr = text.charAt(i)\n var isNewline = newline.test(chr)\n\n //If we've reached a newline, then step down a line\n //Or if we've reached the EOF\n if (isNewline || i===end-1) {\n var lineEnd = isNewline ? i : i+1\n var measured = measure(text, lineStart, lineEnd, width)\n lines.push(measured)\n \n lineStart = i+1\n }\n }\n return lines\n}\n\nfunction greedy(measure, text, start, end, width, mode) {\n //A greedy word wrapper based on LibGDX algorithm\n //https://github.com/libgdx/libgdx/blob/master/gdx/src/com/badlogic/gdx/graphics/g2d/BitmapFontCache.java\n var lines = []\n\n var testWidth = width\n //if 'nowrap' is specified, we only wrap on newline chars\n if (mode === 'nowrap')\n testWidth = Number.MAX_VALUE\n\n while (start < end && start < text.length) {\n //get next newline position\n var newLine = idxOf(text, newlineChar, start, end)\n\n //eat whitespace at start of line\n while (start < newLine) {\n if (!isWhitespace( text.charAt(start) ))\n break\n start++\n }\n\n //determine visible # of glyphs for the available width\n var measured = measure(text, start, newLine, testWidth)\n\n var lineEnd = start + (measured.end-measured.start)\n var nextStart = lineEnd + newlineChar.length\n\n //if we had to cut the line before the next newline...\n if (lineEnd < newLine) {\n //find char to break on\n while (lineEnd > start) {\n if (isWhitespace(text.charAt(lineEnd)))\n break\n lineEnd--\n }\n if (lineEnd === start) {\n if (nextStart > start + newlineChar.length) nextStart--\n lineEnd = nextStart // If no characters to break, show all.\n } else {\n nextStart = lineEnd\n //eat whitespace at end of line\n while (lineEnd > start) {\n if (!isWhitespace(text.charAt(lineEnd - newlineChar.length)))\n break\n lineEnd--\n }\n }\n }\n if (lineEnd >= start) {\n var result = measure(text, start, lineEnd, testWidth)\n lines.push(result)\n }\n start = nextStart\n }\n return lines\n}\n\n//determines the visible number of glyphs within a given width\nfunction monospace(text, start, end, width) {\n var glyphs = Math.min(width, end-start)\n return {\n start: start,\n end: start+glyphs\n }\n}",
  307. "\"use strict\";\nvar window = require(\"global/window\")\nvar isFunction = require(\"is-function\")\nvar parseHeaders = require(\"parse-headers\")\nvar xtend = require(\"xtend\")\n\nmodule.exports = createXHR\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = createXHR;\ncreateXHR.XMLHttpRequest = window.XMLHttpRequest || noop\ncreateXHR.XDomainRequest = \"withCredentials\" in (new createXHR.XMLHttpRequest()) ? createXHR.XMLHttpRequest : window.XDomainRequest\n\nforEachArray([\"get\", \"put\", \"post\", \"patch\", \"head\", \"delete\"], function(method) {\n createXHR[method === \"delete\" ? \"del\" : method] = function(uri, options, callback) {\n options = initParams(uri, options, callback)\n options.method = method.toUpperCase()\n return _createXHR(options)\n }\n})\n\nfunction forEachArray(array, iterator) {\n for (var i = 0; i < array.length; i++) {\n iterator(array[i])\n }\n}\n\nfunction isEmpty(obj){\n for(var i in obj){\n if(obj.hasOwnProperty(i)) return false\n }\n return true\n}\n\nfunction initParams(uri, options, callback) {\n var params = uri\n\n if (isFunction(options)) {\n callback = options\n if (typeof uri === \"string\") {\n params = {uri:uri}\n }\n } else {\n params = xtend(options, {uri: uri})\n }\n\n params.callback = callback\n return params\n}\n\nfunction createXHR(uri, options, callback) {\n options = initParams(uri, options, callback)\n return _createXHR(options)\n}\n\nfunction _createXHR(options) {\n if(typeof options.callback === \"undefined\"){\n throw new Error(\"callback argument missing\")\n }\n\n var called = false\n var callback = function cbOnce(err, response, body){\n if(!called){\n called = true\n options.callback(err, response, body)\n }\n }\n\n function readystatechange() {\n if (xhr.readyState === 4) {\n setTimeout(loadFunc, 0)\n }\n }\n\n function getBody() {\n // Chrome with requestType=blob throws errors arround when even testing access to responseText\n var body = undefined\n\n if (xhr.response) {\n body = xhr.response\n } else {\n body = xhr.responseText || getXml(xhr)\n }\n\n if (isJson) {\n try {\n body = JSON.parse(body)\n } catch (e) {}\n }\n\n return body\n }\n\n function errorFunc(evt) {\n clearTimeout(timeoutTimer)\n if(!(evt instanceof Error)){\n evt = new Error(\"\" + (evt || \"Unknown XMLHttpRequest Error\") )\n }\n evt.statusCode = 0\n return callback(evt, failureResponse)\n }\n\n // will load the data & process the response in a special response object\n function loadFunc() {\n if (aborted) return\n var status\n clearTimeout(timeoutTimer)\n if(options.useXDR && xhr.status===undefined) {\n //IE8 CORS GET successful response doesn't have a status field, but body is fine\n status = 200\n } else {\n status = (xhr.status === 1223 ? 204 : xhr.status)\n }\n var response = failureResponse\n var err = null\n\n if (status !== 0){\n response = {\n body: getBody(),\n statusCode: status,\n method: method,\n headers: {},\n url: uri,\n rawRequest: xhr\n }\n if(xhr.getAllResponseHeaders){ //remember xhr can in fact be XDR for CORS in IE\n response.headers = parseHeaders(xhr.getAllResponseHeaders())\n }\n } else {\n err = new Error(\"Internal XMLHttpRequest Error\")\n }\n return callback(err, response, response.body)\n }\n\n var xhr = options.xhr || null\n\n if (!xhr) {\n if (options.cors || options.useXDR) {\n xhr = new createXHR.XDomainRequest()\n }else{\n xhr = new createXHR.XMLHttpRequest()\n }\n }\n\n var key\n var aborted\n var uri = xhr.url = options.uri || options.url\n var method = xhr.method = options.method || \"GET\"\n var body = options.body || options.data\n var headers = xhr.headers = options.headers || {}\n var sync = !!options.sync\n var isJson = false\n var timeoutTimer\n var failureResponse = {\n body: undefined,\n headers: {},\n statusCode: 0,\n method: method,\n url: uri,\n rawRequest: xhr\n }\n\n if (\"json\" in options && options.json !== false) {\n isJson = true\n headers[\"accept\"] || headers[\"Accept\"] || (headers[\"Accept\"] = \"application/json\") //Don't override existing accept header declared by user\n if (method !== \"GET\" && method !== \"HEAD\") {\n headers[\"content-type\"] || headers[\"Content-Type\"] || (headers[\"Content-Type\"] = \"application/json\") //Don't override existing accept header declared by user\n body = JSON.stringify(options.json === true ? body : options.json)\n }\n }\n\n xhr.onreadystatechange = readystatechange\n xhr.onload = loadFunc\n xhr.onerror = errorFunc\n // IE9 must have onprogress be set to a unique function.\n xhr.onprogress = function () {\n // IE must die\n }\n xhr.onabort = function(){\n aborted = true;\n }\n xhr.ontimeout = errorFunc\n xhr.open(method, uri, !sync, options.username, options.password)\n //has to be after open\n if(!sync) {\n xhr.withCredentials = !!options.withCredentials\n }\n // Cannot set timeout with sync request\n // not setting timeout on the xhr object, because of old webkits etc. not handling that correctly\n // both npm's request and jquery 1.x use this kind of timeout, so this is being consistent\n if (!sync && options.timeout > 0 ) {\n timeoutTimer = setTimeout(function(){\n if (aborted) return\n aborted = true//IE9 may still call readystatechange\n xhr.abort(\"timeout\")\n var e = new Error(\"XMLHttpRequest timeout\")\n e.code = \"ETIMEDOUT\"\n errorFunc(e)\n }, options.timeout )\n }\n\n if (xhr.setRequestHeader) {\n for(key in headers){\n if(headers.hasOwnProperty(key)){\n xhr.setRequestHeader(key, headers[key])\n }\n }\n } else if (options.headers && !isEmpty(options.headers)) {\n throw new Error(\"Headers cannot be set on an XDomainRequest object\")\n }\n\n if (\"responseType\" in options) {\n xhr.responseType = options.responseType\n }\n\n if (\"beforeSend\" in options &&\n typeof options.beforeSend === \"function\"\n ) {\n options.beforeSend(xhr)\n }\n\n // Microsoft Edge browser sends \"undefined\" when send is called with undefined value.\n // XMLHttpRequest spec says to pass null as body to indicate no body\n // See https://github.com/naugtur/xhr/issues/100.\n xhr.send(body || null)\n\n return xhr\n\n\n}\n\nfunction getXml(xhr) {\n // xhr.responseXML will throw Exception \"InvalidStateError\" or \"DOMException\"\n // See https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/responseXML.\n try {\n if (xhr.responseType === \"document\") {\n return xhr.responseXML\n }\n var firefoxBugTakenEffect = xhr.responseXML && xhr.responseXML.documentElement.nodeName === \"parsererror\"\n if (xhr.responseType === \"\" && !firefoxBugTakenEffect) {\n return xhr.responseXML\n }\n } catch (e) {}\n\n return null\n}\n\nfunction noop() {}\n",
  308. "module.exports = (function xmlparser() {\n //common browsers\n if (typeof self.DOMParser !== 'undefined') {\n return function(str) {\n var parser = new self.DOMParser()\n return parser.parseFromString(str, 'application/xml')\n }\n } \n\n //IE8 fallback\n if (typeof self.ActiveXObject !== 'undefined'\n && new self.ActiveXObject('Microsoft.XMLDOM')) {\n return function(str) {\n var xmlDoc = new self.ActiveXObject(\"Microsoft.XMLDOM\")\n xmlDoc.async = \"false\"\n xmlDoc.loadXML(str)\n return xmlDoc\n }\n }\n\n //last resort fallback\n return function(str) {\n var div = document.createElement('div')\n div.innerHTML = str\n return div\n }\n})()\n",
  309. "module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n",
  310. "module.exports={\n \"name\": \"aframe\",\n \"version\": \"1.2.0\",\n \"description\": \"A web framework for building virtual reality experiences.\",\n \"homepage\": \"https://aframe.io/\",\n \"main\": \"dist/aframe-master.js\",\n \"scripts\": {\n \"browserify\": \"browserify src/index.js -s 'AFRAME' -p browserify-derequire\",\n \"build\": \"shx mkdir -p build/ && npm run browserify -- --debug -t [ envify --INSPECTOR_VERSION dev ] -o build/aframe.js\",\n \"codecov\": \"codecov\",\n \"dev\": \"npm run build && cross-env INSPECTOR_VERSION=dev node ./scripts/budo -t envify\",\n \"dist\": \"node scripts/updateVersionLog.js && npm run dist:min && npm run dist:max\",\n \"dist:max\": \"npm run browserify -s -- --debug | exorcist dist/aframe-master.js.map > dist/aframe-master.js\",\n \"dist:min\": \"npm run browserify -s -- --debug -p [ minifyify --map aframe-master.min.js.map --output dist/aframe-master.min.js.map ] -o dist/aframe-master.min.js\",\n \"docs\": \"markserv --dir docs --port 9001\",\n \"preghpages\": \"node ./scripts/preghpages.js\",\n \"ghpages\": \"ghpages -p gh-pages/\",\n \"lint\": \"semistandard -v | snazzy\",\n \"lint:fix\": \"semistandard --fix\",\n \"precommit\": \"npm run lint\",\n \"prepush\": \"node scripts/testOnlyCheck.js\",\n \"prerelease\": \"node scripts/release.js 1.1.0 1.2.0\",\n \"start\": \"npm run dev\",\n \"start:https\": \"cross-env SSL=true npm run dev\",\n \"test\": \"karma start ./tests/karma.conf.js\",\n \"test:docs\": \"node scripts/docsLint.js\",\n \"test:firefox\": \"npm test -- --browsers Firefox\",\n \"test:chrome\": \"npm test -- --browsers Chrome\",\n \"test:nobrowser\": \"NO_BROWSER=true npm test\",\n \"test:node\": \"mocha --ui tdd tests/node\"\n },\n \"repository\": \"aframevr/aframe\",\n \"license\": \"MIT\",\n \"files\": [\n \"dist/*\",\n \"docs/**/*\",\n \"src/**/*\",\n \"vendor/**/*\"\n ],\n \"dependencies\": {\n \"custom-event-polyfill\": \"^1.0.6\",\n \"debug\": \"ngokevin/debug#noTimestamp\",\n \"deep-assign\": \"^2.0.0\",\n \"document-register-element\": \"dmarcos/document-register-element#8ccc532b7f3744be954574caf3072a5fd260ca90\",\n \"load-bmfont\": \"^1.2.3\",\n \"object-assign\": \"^4.0.1\",\n \"present\": \"0.0.6\",\n \"promise-polyfill\": \"^3.1.0\",\n \"super-animejs\": \"^3.1.0\",\n \"super-three\": \"^0.133.5\",\n \"three-bmfont-text\": \"dmarcos/three-bmfont-text#21d017046216e318362c48abd1a48bddfb6e0733\",\n \"webvr-polyfill\": \"^0.10.12\"\n },\n \"devDependencies\": {\n \"browserify\": \"^13.1.0\",\n \"browserify-css\": \"^0.8.4\",\n \"browserify-derequire\": \"^0.9.4\",\n \"browserify-istanbul\": \"^2.0.0\",\n \"budo\": \"^9.2.0\",\n \"chai\": \"^3.5.0\",\n \"chai-shallow-deep-equal\": \"^1.4.0\",\n \"chalk\": \"^1.1.3\",\n \"codecov\": \"^1.0.1\",\n \"cross-env\": \"^5.0.1\",\n \"envify\": \"^3.4.1\",\n \"exorcist\": \"^0.4.0\",\n \"ghpages\": \"0.0.8\",\n \"git-rev\": \"^0.2.1\",\n \"glob\": \"^7.1.1\",\n \"husky\": \"^0.11.7\",\n \"istanbul\": \"^0.4.5\",\n \"jsdom\": \"^9.11.0\",\n \"karma\": \"1.4.1\",\n \"karma-browserify\": \"^5.1.0\",\n \"karma-chai-shallow-deep-equal\": \"0.0.4\",\n \"karma-chrome-launcher\": \"^2.0.0\",\n \"karma-coverage\": \"^1.1.1\",\n \"karma-env-preprocessor\": \"^0.1.1\",\n \"karma-firefox-launcher\": \"^1.2.0\",\n \"karma-mocha\": \"^1.1.1\",\n \"karma-mocha-reporter\": \"^2.1.0\",\n \"karma-sinon-chai\": \"1.2.4\",\n \"lolex\": \"^1.5.1\",\n \"markserv\": \"github:sukima/markserv#feature/fix-broken-websoketio-link\",\n \"minifyify\": \"^7.3.3\",\n \"mocha\": \"^3.0.2\",\n \"mozilla-download\": \"^1.1.1\",\n \"replace-in-file\": \"^2.5.3\",\n \"semistandard\": \"^9.0.0\",\n \"shelljs\": \"^0.7.7\",\n \"shx\": \"^0.2.2\",\n \"sinon\": \"^1.17.5\",\n \"sinon-chai\": \"2.8.0\",\n \"snazzy\": \"^5.0.0\",\n \"too-wordy\": \"ngokevin/too-wordy\",\n \"uglifyjs\": \"^2.4.10\",\n \"write-good\": \"^0.9.1\"\n },\n \"link\": true,\n \"browserify\": {\n \"transform\": [\n \"browserify-css\",\n \"envify\"\n ]\n },\n \"semistandard\": {\n \"ignore\": [\n \"build/**\",\n \"dist/**\",\n \"examples/**/shaders/*.js\",\n \"**/vendor/**\"\n ]\n },\n \"keywords\": [\n \"3d\",\n \"aframe\",\n \"cardboard\",\n \"components\",\n \"oculus\",\n \"three\",\n \"three.js\",\n \"rift\",\n \"vive\",\n \"vr\",\n \"web-components\",\n \"webvr\"\n ],\n \"browserify-css\": {\n \"minify\": true\n },\n \"engines\": {\n \"node\": \">= 4.6.0\",\n \"npm\": \"^2.15.9\"\n }\n}\n",
  311. "var anime = require('super-animejs');\nvar components = require('../core/component').components;\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils');\n\nvar colorHelperFrom = new THREE.Color();\nvar colorHelperTo = new THREE.Color();\n\nvar getComponentProperty = utils.entity.getComponentProperty;\nvar setComponentProperty = utils.entity.setComponentProperty;\nvar splitCache = {};\n\nvar TYPE_COLOR = 'color';\nvar PROP_POSITION = 'position';\nvar PROP_ROTATION = 'rotation';\nvar PROP_SCALE = 'scale';\nvar STRING_COMPONENTS = 'components';\nvar STRING_OBJECT3D = 'object3D';\n\n/**\n * Animation component for A-Frame using anime.js.\n *\n * The component manually controls the tick by setting `autoplay: false` on anime.js and\n * manually * calling `animation.tick()` in the tick handler. To pause or resume, we toggle a\n * boolean * flag * `isAnimationPlaying`.\n *\n * anime.js animation config for tweenining Javascript objects and values works as:\n *\n * config = {\n * targets: {foo: 0.0, bar: '#000'},\n * foo: 1.0,\n * bar: '#FFF'\n * }\n *\n * The above will tween each property in `targets`. The `to` values are set in the root of\n * the config.\n *\n * @member {object} animation - anime.js instance.\n * @member {boolean} animationIsPlaying - Control if animation is playing.\n */\nmodule.exports.Component = registerComponent('animation', {\n schema: {\n autoplay: {default: true},\n delay: {default: 0},\n dir: {default: ''},\n dur: {default: 1000},\n easing: {default: 'easeInQuad'},\n elasticity: {default: 400},\n enabled: {default: true},\n from: {default: ''},\n loop: {\n default: 0,\n parse: function (value) {\n // Boolean or integer.\n if (value === true || value === 'true') { return true; }\n if (value === false || value === 'false') { return false; }\n return parseInt(value, 10);\n }\n },\n property: {default: ''},\n startEvents: {type: 'array'},\n pauseEvents: {type: 'array'},\n resumeEvents: {type: 'array'},\n round: {default: false},\n to: {default: ''},\n type: {default: ''},\n isRawProperty: {default: false}\n },\n\n multiple: true,\n\n init: function () {\n var self = this;\n\n this.eventDetail = {name: this.attrName};\n this.time = 0;\n\n this.animation = null;\n this.animationIsPlaying = false;\n this.onStartEvent = this.onStartEvent.bind(this);\n this.beginAnimation = this.beginAnimation.bind(this);\n this.pauseAnimation = this.pauseAnimation.bind(this);\n this.resumeAnimation = this.resumeAnimation.bind(this);\n\n this.fromColor = {};\n this.toColor = {};\n this.targets = {};\n this.targetsArray = [];\n\n this.updateConfigForDefault = this.updateConfigForDefault.bind(this);\n this.updateConfigForRawColor = this.updateConfigForRawColor.bind(this);\n\n this.config = {\n complete: function () {\n self.animationIsPlaying = false;\n self.el.emit('animationcomplete', self.eventDetail, false);\n if (self.id) {\n self.el.emit('animationcomplete__' + self.id, self.eventDetail, false);\n }\n }\n };\n },\n\n update: function (oldData) {\n var config = this.config;\n var data = this.data;\n\n this.animationIsPlaying = false;\n\n if (!this.data.enabled) { return; }\n\n if (!data.property) { return; }\n\n // Base config.\n config.autoplay = false;\n config.direction = data.dir;\n config.duration = data.dur;\n config.easing = data.easing;\n config.elasticity = data.elasticity;\n config.loop = data.loop;\n config.round = data.round;\n\n // Start new animation.\n this.createAndStartAnimation();\n },\n\n tick: function (t, dt) {\n if (!this.animationIsPlaying) { return; }\n this.time += dt;\n this.animation.tick(this.time);\n },\n\n remove: function () {\n this.pauseAnimation();\n this.removeEventListeners();\n },\n\n pause: function () {\n this.paused = true;\n this.pausedWasPlaying = this.animationIsPlaying;\n this.pauseAnimation();\n this.removeEventListeners();\n },\n\n /**\n * `play` handler only for resuming scene.\n */\n play: function () {\n if (!this.paused) { return; }\n this.paused = false;\n this.addEventListeners();\n if (this.pausedWasPlaying) {\n this.resumeAnimation();\n this.pausedWasPlaying = false;\n }\n },\n\n /**\n * Start animation from scratch.\n */\n createAndStartAnimation: function () {\n var data = this.data;\n\n this.updateConfig();\n this.animationIsPlaying = false;\n this.animation = anime(this.config);\n this.animation.began = true;\n\n this.removeEventListeners();\n this.addEventListeners();\n\n // Wait for start events for animation.\n if (!data.autoplay || data.startEvents && data.startEvents.length) { return; }\n\n // Delay animation.\n if (data.delay) {\n setTimeout(this.beginAnimation, data.delay);\n return;\n }\n\n // Play animation.\n this.beginAnimation();\n },\n\n /**\n * This is before animation start (including from startEvents).\n * Set to initial state (config.from, time = 0, seekTime = 0).\n */\n beginAnimation: function () {\n this.updateConfig();\n this.animation.began = true;\n this.time = 0;\n this.animationIsPlaying = true;\n this.stopRelatedAnimations();\n this.el.emit('animationbegin', this.eventDetail, false);\n },\n\n pauseAnimation: function () {\n this.animationIsPlaying = false;\n },\n\n resumeAnimation: function () {\n this.animationIsPlaying = true;\n },\n\n /**\n * startEvents callback.\n */\n onStartEvent: function () {\n if (!this.data.enabled) { return; }\n\n this.updateConfig();\n if (this.animation) {\n this.animation.pause();\n }\n this.animation = anime(this.config);\n\n // Include the delay before each start event.\n if (this.data.delay) {\n setTimeout(this.beginAnimation, this.data.delay);\n return;\n }\n this.beginAnimation();\n },\n\n /**\n * rawProperty: true and type: color;\n */\n updateConfigForRawColor: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var from;\n var key;\n var to;\n\n if (this.waitComponentInitRawProperty(this.updateConfigForRawColor)) {\n return;\n }\n\n from = data.from === '' ? getRawProperty(el, data.property) : data.from;\n to = data.to;\n\n // Use r/g/b vector for color type.\n this.setColorConfig(from, to);\n from = this.fromColor;\n to = this.toColor;\n\n this.targetsArray.length = 0;\n this.targetsArray.push(from);\n config.targets = this.targetsArray;\n for (key in to) { config[key] = to[key]; }\n\n config.update = (function () {\n var lastValue = {};\n return function (anim) {\n var value;\n value = anim.animatables[0].target;\n // For animation timeline.\n if (value.r === lastValue.r &&\n value.g === lastValue.g &&\n value.b === lastValue.b) { return; }\n\n setRawProperty(el, data.property, value, data.type);\n };\n })();\n },\n\n /**\n * Stuff property into generic `property` key.\n */\n updateConfigForDefault: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var from;\n var isBoolean;\n var isNumber;\n var to;\n\n if (this.waitComponentInitRawProperty(this.updateConfigForDefault)) {\n return;\n }\n\n if (data.from === '') {\n // Infer from.\n from = isRawProperty(data)\n ? getRawProperty(el, data.property)\n : getComponentProperty(el, data.property);\n } else {\n // Explicit from.\n from = data.from;\n }\n\n to = data.to;\n\n isNumber = !isNaN(from || to);\n if (isNumber) {\n from = parseFloat(from);\n to = parseFloat(to);\n } else {\n from = from ? from.toString() : from;\n to = to ? to.toString() : to;\n }\n\n // Convert booleans to integer to allow boolean flipping.\n isBoolean = data.to === 'true' || data.to === 'false' ||\n data.to === true || data.to === false;\n if (isBoolean) {\n from = data.from === 'true' || data.from === true ? 1 : 0;\n to = data.to === 'true' || data.to === true ? 1 : 0;\n }\n\n this.targets.aframeProperty = from;\n config.targets = this.targets;\n config.aframeProperty = to;\n config.update = (function () {\n var lastValue;\n\n return function (anim) {\n var value;\n value = anim.animatables[0].target.aframeProperty;\n\n // Need to do a last value check for animation timeline since all the tweening\n // begins simultaenously even if the value has not changed. Also better for perf\n // anyways.\n if (value === lastValue) { return; }\n lastValue = value;\n\n if (isBoolean) { value = value >= 1; }\n\n if (isRawProperty(data)) {\n setRawProperty(el, data.property, value, data.type);\n } else {\n setComponentProperty(el, data.property, value);\n }\n };\n })();\n },\n\n /**\n * Extend x/y/z/w onto the config.\n * Update vector by modifying object3D.\n */\n updateConfigForVector: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var key;\n var from;\n var to;\n\n // Parse coordinates.\n from = data.from !== ''\n ? utils.coordinates.parse(data.from) // If data.from defined, use that.\n : getComponentProperty(el, data.property); // If data.from not defined, get on the fly.\n to = utils.coordinates.parse(data.to);\n\n if (data.property === PROP_ROTATION) {\n toRadians(from);\n toRadians(to);\n }\n\n // Set to and from.\n this.targetsArray.length = 0;\n this.targetsArray.push(from);\n config.targets = this.targetsArray;\n for (key in to) { config[key] = to[key]; }\n\n // If animating object3D transformation, run more optimized updater.\n if (data.property === PROP_POSITION || data.property === PROP_ROTATION ||\n data.property === PROP_SCALE) {\n config.update = (function () {\n var lastValue = {};\n return function (anim) {\n var value = anim.animatables[0].target;\n\n if (data.property === PROP_SCALE) {\n value.x = Math.max(0.0001, value.x);\n value.y = Math.max(0.0001, value.y);\n value.z = Math.max(0.0001, value.z);\n }\n\n // For animation timeline.\n if (value.x === lastValue.x &&\n value.y === lastValue.y &&\n value.z === lastValue.z) { return; }\n\n lastValue.x = value.x;\n lastValue.y = value.y;\n lastValue.z = value.z;\n\n el.object3D[data.property].set(value.x, value.y, value.z);\n };\n })();\n return;\n }\n\n // Animating some vector.\n config.update = (function () {\n var lastValue = {};\n return function (anim) {\n var value = anim.animatables[0].target;\n\n // Animate rotation through radians.\n // For animation timeline.\n if (value.x === lastValue.x &&\n value.y === lastValue.y &&\n value.z === lastValue.z) { return; }\n lastValue.x = value.x;\n lastValue.y = value.y;\n lastValue.z = value.z;\n setComponentProperty(el, data.property, value);\n };\n })();\n },\n\n /**\n * Update the config before each run.\n */\n updateConfig: function () {\n var propType;\n\n // Route config type.\n propType = getPropertyType(this.el, this.data.property);\n if (isRawProperty(this.data) && this.data.type === TYPE_COLOR) {\n this.updateConfigForRawColor();\n } else if (propType === 'vec2' || propType === 'vec3' || propType === 'vec4') {\n this.updateConfigForVector();\n } else {\n this.updateConfigForDefault();\n }\n },\n\n /**\n * Wait for component to initialize.\n */\n waitComponentInitRawProperty: function (cb) {\n var componentName;\n var data = this.data;\n var el = this.el;\n var self = this;\n\n if (data.from !== '') { return false; }\n\n if (!data.property.startsWith(STRING_COMPONENTS)) { return false; }\n\n componentName = splitDot(data.property)[1];\n if (el.components[componentName]) { return false; }\n\n el.addEventListener('componentinitialized', function wait (evt) {\n if (evt.detail.name !== componentName) { return; }\n cb();\n // Since the config was created async, create the animation now since we missed it\n // earlier.\n self.animation = anime(self.config);\n el.removeEventListener('componentinitialized', wait);\n });\n return true;\n },\n\n /**\n * Make sure two animations on the same property don't fight each other.\n * e.g., animation__mouseenter=\"property: material.opacity\"\n * animation__mouseleave=\"property: material.opacity\"\n */\n stopRelatedAnimations: function () {\n var component;\n var componentName;\n for (componentName in this.el.components) {\n component = this.el.components[componentName];\n if (componentName === this.attrName) { continue; }\n if (component.name !== 'animation') { continue; }\n if (!component.animationIsPlaying) { continue; }\n if (component.data.property !== this.data.property) { continue; }\n component.animationIsPlaying = false;\n }\n },\n\n addEventListeners: function () {\n var data = this.data;\n var el = this.el;\n addEventListeners(el, data.startEvents, this.onStartEvent);\n addEventListeners(el, data.pauseEvents, this.pauseAnimation);\n addEventListeners(el, data.resumeEvents, this.resumeAnimation);\n },\n\n removeEventListeners: function () {\n var data = this.data;\n var el = this.el;\n removeEventListeners(el, data.startEvents, this.onStartEvent);\n removeEventListeners(el, data.pauseEvents, this.pauseAnimation);\n removeEventListeners(el, data.resumeEvents, this.resumeAnimation);\n },\n\n setColorConfig: function (from, to) {\n colorHelperFrom.set(from);\n colorHelperTo.set(to);\n from = this.fromColor;\n to = this.toColor;\n from.r = colorHelperFrom.r;\n from.g = colorHelperFrom.g;\n from.b = colorHelperFrom.b;\n to.r = colorHelperTo.r;\n to.g = colorHelperTo.g;\n to.b = colorHelperTo.b;\n }\n});\n\n/**\n * Given property name, check schema to see what type we are animating.\n * We just care whether the property is a vector.\n */\nfunction getPropertyType (el, property) {\n var component;\n var componentName;\n var split;\n var propertyName;\n\n split = property.split('.');\n componentName = split[0];\n propertyName = split[1];\n component = el.components[componentName] || components[componentName];\n\n // Primitives.\n if (!component) { return null; }\n\n // Dynamic schema. We only care about vectors anyways.\n if (propertyName && !component.schema[propertyName]) { return null; }\n\n // Multi-prop.\n if (propertyName) { return component.schema[propertyName].type; }\n\n // Single-prop.\n return component.schema.type;\n}\n\n/**\n * Convert object to radians.\n */\nfunction toRadians (obj) {\n obj.x = THREE.Math.degToRad(obj.x);\n obj.y = THREE.Math.degToRad(obj.y);\n obj.z = THREE.Math.degToRad(obj.z);\n}\n\nfunction addEventListeners (el, eventNames, handler) {\n var i;\n for (i = 0; i < eventNames.length; i++) {\n el.addEventListener(eventNames[i], handler);\n }\n}\n\nfunction removeEventListeners (el, eventNames, handler) {\n var i;\n for (i = 0; i < eventNames.length; i++) {\n el.removeEventListener(eventNames[i], handler);\n }\n}\n\nfunction getRawProperty (el, path) {\n var i;\n var split;\n var value;\n split = splitDot(path);\n value = el;\n for (i = 0; i < split.length; i++) {\n value = value[split[i]];\n }\n if (value === undefined) {\n console.log(el);\n throw new Error('[animation] property (' + path + ') could not be found');\n }\n return value;\n}\n\nfunction setRawProperty (el, path, value, type) {\n var i;\n var split;\n var propertyName;\n var targetValue;\n\n if (path.startsWith('object3D.rotation')) {\n value = THREE.Math.degToRad(value);\n }\n\n // Walk.\n split = splitDot(path);\n targetValue = el;\n for (i = 0; i < split.length - 1; i++) { targetValue = targetValue[split[i]]; }\n propertyName = split[split.length - 1];\n\n // Raw color.\n if (type === TYPE_COLOR) {\n if ('r' in targetValue[propertyName]) {\n targetValue[propertyName].r = value.r;\n targetValue[propertyName].g = value.g;\n targetValue[propertyName].b = value.b;\n } else {\n targetValue[propertyName].x = value.r;\n targetValue[propertyName].y = value.g;\n targetValue[propertyName].z = value.b;\n }\n return;\n }\n\n targetValue[propertyName] = value;\n}\n\nfunction splitDot (path) {\n if (path in splitCache) { return splitCache[path]; }\n splitCache[path] = path.split('.');\n return splitCache[path];\n}\n\nfunction isRawProperty (data) {\n return data.isRawProperty || data.property.startsWith(STRING_COMPONENTS) ||\n data.property.startsWith(STRING_OBJECT3D);\n}\n",
  312. "var registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\n/**\n * Camera component.\n * Pairs along with camera system to handle tracking the active camera.\n */\nmodule.exports.Component = registerComponent('camera', {\n schema: {\n active: {default: true},\n far: {default: 10000},\n fov: {default: 80, min: 0},\n near: {default: 0.005, min: 0},\n spectator: {default: false},\n zoom: {default: 1, min: 0}\n },\n\n /**\n * Initialize three.js camera and add it to the entity.\n * Add reference from scene to this entity as the camera.\n */\n init: function () {\n var camera;\n var el = this.el;\n\n // Create camera.\n camera = this.camera = new THREE.PerspectiveCamera();\n el.setObject3D('camera', camera);\n },\n\n /**\n * Update three.js camera.\n */\n update: function (oldData) {\n var data = this.data;\n var camera = this.camera;\n\n // Update properties.\n camera.aspect = data.aspect || (window.innerWidth / window.innerHeight);\n camera.far = data.far;\n camera.fov = data.fov;\n camera.near = data.near;\n camera.zoom = data.zoom;\n camera.updateProjectionMatrix();\n\n this.updateActiveCamera(oldData);\n this.updateSpectatorCamera(oldData);\n },\n\n updateActiveCamera: function (oldData) {\n var data = this.data;\n var el = this.el;\n var system = this.system;\n // Active property did not change.\n if (oldData && oldData.active === data.active || data.spectator) { return; }\n\n // If `active` property changes, or first update, handle active camera with system.\n if (data.active && system.activeCameraEl !== el) {\n // Camera enabled. Set camera to this camera.\n system.setActiveCamera(el);\n } else if (!data.active && system.activeCameraEl === el) {\n // Camera disabled. Set camera to another camera.\n system.disableActiveCamera();\n }\n },\n\n updateSpectatorCamera: function (oldData) {\n var data = this.data;\n var el = this.el;\n var system = this.system;\n // spectator property did not change.\n if (oldData && oldData.spectator === data.spectator) { return; }\n\n // If `spectator` property changes, or first update, handle spectator camera with system.\n if (data.spectator && system.spectatorCameraEl !== el) {\n // Camera enabled. Set camera to this camera.\n system.setSpectatorCamera(el);\n } else if (!data.spectator && system.spectatorCameraEl === el) {\n // Camera disabled. Set camera to another camera.\n system.disableSpectatorCamera();\n }\n },\n\n /**\n * Remove camera on remove (callback).\n */\n remove: function () {\n this.el.removeObject3D('camera');\n }\n});\n",
  313. "/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\nvar utils = require('../utils/');\n\nvar bind = utils.bind;\n\nvar EVENTS = {\n CLICK: 'click',\n FUSING: 'fusing',\n MOUSEENTER: 'mouseenter',\n MOUSEDOWN: 'mousedown',\n MOUSELEAVE: 'mouseleave',\n MOUSEUP: 'mouseup'\n};\n\nvar STATES = {\n FUSING: 'cursor-fusing',\n HOVERING: 'cursor-hovering',\n HOVERED: 'cursor-hovered'\n};\n\nvar CANVAS_EVENTS = {\n DOWN: ['mousedown', 'touchstart'],\n UP: ['mouseup', 'touchend']\n};\n\nvar WEBXR_EVENTS = {\n DOWN: ['selectstart'],\n UP: ['selectend']\n};\n\nvar CANVAS_HOVER_CLASS = 'a-mouse-cursor-hover';\n\n/**\n * Cursor component. Applies the raycaster component specifically for starting the raycaster\n * from the camera and pointing from camera's facing direction, and then only returning the\n * closest intersection. Cursor can be fine-tuned by setting raycaster properties.\n *\n * @member {object} fuseTimeout - Timeout to trigger fuse-click.\n * @member {Element} cursorDownEl - Entity that was last mousedowned during current click.\n * @member {object} intersection - Attributes of the current intersection event, including\n * 3D- and 2D-space coordinates. See: http://threejs.org/docs/api/core/Raycaster.html\n * @member {Element} intersectedEl - Currently-intersected entity. Used to keep track to\n * emit events when unintersecting.\n */\nmodule.exports.Component = registerComponent('cursor', {\n dependencies: ['raycaster'],\n\n schema: {\n downEvents: {default: []},\n fuse: {default: utils.device.isMobile()},\n fuseTimeout: {default: 1500, min: 0},\n mouseCursorStylesEnabled: {default: true},\n upEvents: {default: []},\n rayOrigin: {default: 'entity', oneOf: ['mouse', 'entity']}\n },\n\n init: function () {\n var self = this;\n\n this.fuseTimeout = undefined;\n this.cursorDownEl = null;\n this.intersectedEl = null;\n this.canvasBounds = document.body.getBoundingClientRect();\n this.isCursorDown = false;\n\n // Debounce.\n this.updateCanvasBounds = utils.debounce(function updateCanvasBounds () {\n self.canvasBounds = self.el.sceneEl.canvas.getBoundingClientRect();\n }, 500);\n\n this.eventDetail = {};\n this.intersectedEventDetail = {cursorEl: this.el};\n\n // Bind methods.\n this.onCursorDown = bind(this.onCursorDown, this);\n this.onCursorUp = bind(this.onCursorUp, this);\n this.onIntersection = bind(this.onIntersection, this);\n this.onIntersectionCleared = bind(this.onIntersectionCleared, this);\n this.onMouseMove = bind(this.onMouseMove, this);\n this.onEnterVR = bind(this.onEnterVR, this);\n },\n\n update: function (oldData) {\n if (this.data.rayOrigin === oldData.rayOrigin) { return; }\n this.updateMouseEventListeners();\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n },\n\n remove: function () {\n var el = this.el;\n el.removeState(STATES.HOVERING);\n el.removeState(STATES.FUSING);\n clearTimeout(this.fuseTimeout);\n if (this.intersectedEl) { this.intersectedEl.removeState(STATES.HOVERED); }\n this.removeEventListeners();\n },\n\n addEventListeners: function () {\n var canvas;\n var data = this.data;\n var el = this.el;\n var self = this;\n\n function addCanvasListeners () {\n canvas = el.sceneEl.canvas;\n if (data.downEvents.length || data.upEvents.length) { return; }\n CANVAS_EVENTS.DOWN.forEach(function (downEvent) {\n canvas.addEventListener(downEvent, self.onCursorDown);\n });\n CANVAS_EVENTS.UP.forEach(function (upEvent) {\n canvas.addEventListener(upEvent, self.onCursorUp);\n });\n }\n\n canvas = el.sceneEl.canvas;\n if (canvas) {\n addCanvasListeners();\n } else {\n el.sceneEl.addEventListener('render-target-loaded', addCanvasListeners);\n }\n\n data.downEvents.forEach(function (downEvent) {\n el.addEventListener(downEvent, self.onCursorDown);\n });\n data.upEvents.forEach(function (upEvent) {\n el.addEventListener(upEvent, self.onCursorUp);\n });\n el.addEventListener('raycaster-intersection', this.onIntersection);\n el.addEventListener('raycaster-intersection-cleared', this.onIntersectionCleared);\n\n el.sceneEl.addEventListener('rendererresize', this.updateCanvasBounds);\n el.sceneEl.addEventListener('enter-vr', this.onEnterVR);\n window.addEventListener('resize', this.updateCanvasBounds);\n window.addEventListener('scroll', this.updateCanvasBounds);\n\n this.updateMouseEventListeners();\n },\n\n removeEventListeners: function () {\n var canvas;\n var data = this.data;\n var el = this.el;\n var self = this;\n\n canvas = el.sceneEl.canvas;\n if (canvas && !data.downEvents.length && !data.upEvents.length) {\n CANVAS_EVENTS.DOWN.forEach(function (downEvent) {\n canvas.removeEventListener(downEvent, self.onCursorDown);\n });\n CANVAS_EVENTS.UP.forEach(function (upEvent) {\n canvas.removeEventListener(upEvent, self.onCursorUp);\n });\n }\n\n data.downEvents.forEach(function (downEvent) {\n el.removeEventListener(downEvent, self.onCursorDown);\n });\n data.upEvents.forEach(function (upEvent) {\n el.removeEventListener(upEvent, self.onCursorUp);\n });\n el.removeEventListener('raycaster-intersection', this.onIntersection);\n el.removeEventListener('raycaster-intersection-cleared', this.onIntersectionCleared);\n canvas.removeEventListener('mousemove', this.onMouseMove);\n canvas.removeEventListener('touchstart', this.onMouseMove);\n canvas.removeEventListener('touchmove', this.onMouseMove);\n\n el.sceneEl.removeEventListener('rendererresize', this.updateCanvasBounds);\n el.sceneEl.removeEventListener('enter-vr', this.onEnterVR);\n window.removeEventListener('resize', this.updateCanvasBounds);\n window.removeEventListener('scroll', this.updateCanvasBounds);\n },\n\n updateMouseEventListeners: function () {\n var canvas;\n var el = this.el;\n\n canvas = el.sceneEl.canvas;\n canvas.removeEventListener('mousemove', this.onMouseMove);\n canvas.removeEventListener('touchmove', this.onMouseMove);\n el.setAttribute('raycaster', 'useWorldCoordinates', false);\n if (this.data.rayOrigin !== 'mouse') { return; }\n canvas.addEventListener('mousemove', this.onMouseMove, false);\n canvas.addEventListener('touchmove', this.onMouseMove, false);\n el.setAttribute('raycaster', 'useWorldCoordinates', true);\n this.updateCanvasBounds();\n },\n\n onMouseMove: (function () {\n var direction = new THREE.Vector3();\n var mouse = new THREE.Vector2();\n var origin = new THREE.Vector3();\n var rayCasterConfig = {origin: origin, direction: direction};\n\n return function (evt) {\n var bounds = this.canvasBounds;\n var camera = this.el.sceneEl.camera;\n var left;\n var point;\n var top;\n\n camera.parent.updateMatrixWorld();\n\n // Calculate mouse position based on the canvas element\n if (evt.type === 'touchmove' || evt.type === 'touchstart') {\n // Track the first touch for simplicity.\n point = evt.touches.item(0);\n } else {\n point = evt;\n }\n\n left = point.clientX - bounds.left;\n top = point.clientY - bounds.top;\n mouse.x = (left / bounds.width) * 2 - 1;\n mouse.y = -(top / bounds.height) * 2 + 1;\n\n if (camera && camera.isPerspectiveCamera) {\n origin.setFromMatrixPosition(camera.matrixWorld);\n direction.set(mouse.x, mouse.y, 0.5).unproject(camera).sub(origin).normalize();\n } else if (camera && camera.isOrthographicCamera) {\n origin.set(mouse.x, mouse.y, (camera.near + camera.far) / (camera.near - camera.far)).unproject(camera); // set origin in plane of camera\n direction.set(0, 0, -1).transformDirection(camera.matrixWorld);\n } else {\n console.error('AFRAME.Raycaster: Unsupported camera type: ' + camera.type);\n }\n\n this.el.setAttribute('raycaster', rayCasterConfig);\n if (evt.type === 'touchmove') { evt.preventDefault(); }\n };\n })(),\n\n /**\n * Trigger mousedown and keep track of the mousedowned entity.\n */\n onCursorDown: function (evt) {\n this.isCursorDown = true;\n // Raycast again for touch.\n if (this.data.rayOrigin === 'mouse' && evt.type === 'touchstart') {\n this.onMouseMove(evt);\n this.el.components.raycaster.checkIntersections();\n evt.preventDefault();\n }\n\n this.twoWayEmit(EVENTS.MOUSEDOWN);\n this.cursorDownEl = this.intersectedEl;\n },\n\n /**\n * Trigger mouseup if:\n * - Not fusing (mobile has no mouse).\n * - Currently intersecting an entity.\n * - Currently-intersected entity is the same as the one when mousedown was triggered,\n * in case user mousedowned one entity, dragged to another, and mouseupped.\n */\n onCursorUp: function (evt) {\n if (!this.isCursorDown) { return; }\n\n this.isCursorDown = false;\n\n var data = this.data;\n this.twoWayEmit(EVENTS.MOUSEUP);\n\n // If intersected entity has changed since the cursorDown, still emit mouseUp on the\n // previously cursorUp entity.\n if (this.cursorDownEl && this.cursorDownEl !== this.intersectedEl) {\n this.intersectedEventDetail.intersection = null;\n this.cursorDownEl.emit(EVENTS.MOUSEUP, this.intersectedEventDetail);\n }\n\n if ((!data.fuse || data.rayOrigin === 'mouse') &&\n this.intersectedEl && this.cursorDownEl === this.intersectedEl) {\n this.twoWayEmit(EVENTS.CLICK);\n }\n\n this.cursorDownEl = null;\n if (evt.type === 'touchend') { evt.preventDefault(); }\n },\n\n /**\n * Handle intersection.\n */\n onIntersection: function (evt) {\n var currentIntersection;\n var cursorEl = this.el;\n var index;\n var intersectedEl;\n var intersection;\n\n // Select closest object, excluding the cursor.\n index = evt.detail.els[0] === cursorEl ? 1 : 0;\n intersection = evt.detail.intersections[index];\n intersectedEl = evt.detail.els[index];\n\n // If cursor is the only intersected object, ignore the event.\n if (!intersectedEl) { return; }\n\n // Already intersecting this entity.\n if (this.intersectedEl === intersectedEl) { return; }\n\n // Ignore events further away than active intersection.\n if (this.intersectedEl) {\n currentIntersection = this.el.components.raycaster.getIntersection(this.intersectedEl);\n if (currentIntersection && currentIntersection.distance <= intersection.distance) { return; }\n }\n\n // Unset current intersection.\n this.clearCurrentIntersection(true);\n\n this.setIntersection(intersectedEl, intersection);\n },\n\n /**\n * Handle intersection cleared.\n */\n onIntersectionCleared: function (evt) {\n var clearedEls = evt.detail.clearedEls;\n // Check if the current intersection has ended\n if (clearedEls.indexOf(this.intersectedEl) === -1) { return; }\n this.clearCurrentIntersection();\n },\n\n onEnterVR: function () {\n this.clearCurrentIntersection(true);\n var xrSession = this.el.sceneEl.xrSession;\n var self = this;\n if (!xrSession) { return; }\n if (this.data.rayOrigin === 'mouse') { return; }\n WEBXR_EVENTS.DOWN.forEach(function (downEvent) {\n xrSession.addEventListener(downEvent, self.onCursorDown);\n });\n WEBXR_EVENTS.UP.forEach(function (upEvent) {\n xrSession.addEventListener(upEvent, self.onCursorUp);\n });\n },\n\n setIntersection: function (intersectedEl, intersection) {\n var cursorEl = this.el;\n var data = this.data;\n var self = this;\n\n // Already intersecting.\n if (this.intersectedEl === intersectedEl) { return; }\n\n // Set new intersection.\n this.intersectedEl = intersectedEl;\n\n // Hovering.\n cursorEl.addState(STATES.HOVERING);\n intersectedEl.addState(STATES.HOVERED);\n this.twoWayEmit(EVENTS.MOUSEENTER);\n\n if (this.data.mouseCursorStylesEnabled && this.data.rayOrigin === 'mouse') {\n this.el.sceneEl.canvas.classList.add(CANVAS_HOVER_CLASS);\n }\n\n // Begin fuse if necessary.\n if (data.fuseTimeout === 0 || !data.fuse) { return; }\n cursorEl.addState(STATES.FUSING);\n this.twoWayEmit(EVENTS.FUSING);\n this.fuseTimeout = setTimeout(function fuse () {\n cursorEl.removeState(STATES.FUSING);\n self.twoWayEmit(EVENTS.CLICK);\n }, data.fuseTimeout);\n },\n\n clearCurrentIntersection: function (ignoreRemaining) {\n var index;\n var intersection;\n var intersections;\n var cursorEl = this.el;\n\n // Nothing to be cleared.\n if (!this.intersectedEl) { return; }\n\n // No longer hovering (or fusing).\n this.intersectedEl.removeState(STATES.HOVERED);\n cursorEl.removeState(STATES.HOVERING);\n cursorEl.removeState(STATES.FUSING);\n this.twoWayEmit(EVENTS.MOUSELEAVE);\n\n if (this.data.mouseCursorStylesEnabled && this.data.rayOrigin === 'mouse') {\n this.el.sceneEl.canvas.classList.remove(CANVAS_HOVER_CLASS);\n }\n\n // Unset intersected entity (after emitting the event).\n this.intersectedEl = null;\n\n // Clear fuseTimeout.\n clearTimeout(this.fuseTimeout);\n\n // Set intersection to another raycasted element if any.\n if (ignoreRemaining === true) { return; }\n intersections = this.el.components.raycaster.intersections;\n if (intersections.length === 0) { return; }\n // Exclude the cursor.\n index = intersections[0].object.el === cursorEl ? 1 : 0;\n intersection = intersections[index];\n if (!intersection) { return; }\n this.setIntersection(intersection.object.el, intersection);\n },\n\n /**\n * Helper to emit on both the cursor and the intersected entity (if exists).\n */\n twoWayEmit: function (evtName) {\n var el = this.el;\n var intersectedEl = this.intersectedEl;\n var intersection;\n\n intersection = this.el.components.raycaster.getIntersection(intersectedEl);\n this.eventDetail.intersectedEl = intersectedEl;\n this.eventDetail.intersection = intersection;\n el.emit(evtName, this.eventDetail);\n\n if (!intersectedEl) { return; }\n\n this.intersectedEventDetail.intersection = intersection;\n intersectedEl.emit(evtName, this.intersectedEventDetail);\n }\n});\n",
  314. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar DAYDREAM_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/google/';\nvar DAYDREAM_CONTROLLER_MODEL_OBJ_URL = DAYDREAM_CONTROLLER_MODEL_BASE_URL + 'vr_controller_daydream.obj';\nvar DAYDREAM_CONTROLLER_MODEL_OBJ_MTL = DAYDREAM_CONTROLLER_MODEL_BASE_URL + 'vr_controller_daydream.mtl';\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'google-daydream';\nvar GAMEPAD_ID_WEBVR = 'Daydream Controller';\n\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button indices:\n * 0 - trackpad\n * 1 - menu (never dispatched on this layer)\n * 2 - system (never dispatched on this layer)\n *\n * Axis:\n * 0 - trackpad x\n * 1 - trackpad y\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'menu', 'system']\n};\n\n/**\n * Button indices:\n * 0 - none\n * 1 - none\n * 2 - touchpad\n *\n * Axis:\n * 0 - touchpad x\n * 1 - touchpad y\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/google/google-daydream.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['none', 'none', 'touchpad', 'menu', 'system']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Daydream controls.\n * Interface with Daydream controller and map Gamepad events to\n * controller buttons: trackpad, menu, system\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('daydream-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonColor: {type: 'color', default: '#000000'},\n buttonTouchedColor: {type: 'color', default: '#777777'},\n buttonHighlightColor: {type: 'color', default: '#FFFFFF'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n id: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('obj-model', {\n obj: DAYDREAM_CONTROLLER_MODEL_OBJ_URL,\n mtl: DAYDREAM_CONTROLLER_MODEL_OBJ_MTL\n });\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.menu = controllerObject3D.getObjectByName('AppButton_AppButton_Cylinder.004');\n buttonMeshes.system = controllerObject3D.getObjectByName('HomeButton_HomeButton_Cylinder.005');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');\n buttonMeshes.touchpad = controllerObject3D.getObjectByName('TouchPad_TouchPad_Cylinder.003');\n // Offset pivot point.\n controllerObject3D.position.set(0, 0, -0.04);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }\n var color;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n default:\n color = this.data.buttonColor;\n }\n buttonMeshes[buttonName].material.color.set(color);\n }\n});\n",
  315. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GEARVR_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/samsung/';\nvar GEARVR_CONTROLLER_MODEL_OBJ_URL = GEARVR_CONTROLLER_MODEL_BASE_URL + 'gear_vr_controller.obj';\nvar GEARVR_CONTROLLER_MODEL_OBJ_MTL = GEARVR_CONTROLLER_MODEL_BASE_URL + 'gear_vr_controller.mtl';\n\nvar GAMEPAD_ID_WEBXR = 'samsung-gearvr';\nvar GAMEPAD_ID_WEBVR = 'Gear VR';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button indices:\n * 0 - trackpad\n * 1 - trigger\n *\n * Axis:\n * 0 - trackpad x\n * 1 - trackpad y\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger']\n};\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - none\n * 2 - touchpad\n * 3 - menu\n *\n * Axis:\n * 0 - touchpad x\n * 1 - touchpad y\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/samsung/samsung-gearvr.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['trigger', 'none', 'touchpad', 'none', 'menu']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Gear VR controls.\n * Interface with Gear VR controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('gearvr-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonColor: {type: 'color', default: '#000000'},\n buttonTouchedColor: {type: 'color', default: '#777777'},\n buttonHighlightColor: {type: 'color', default: '#FFFFFF'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n id: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('obj-model', {\n obj: GEARVR_CONTROLLER_MODEL_OBJ_URL,\n mtl: GEARVR_CONTROLLER_MODEL_OBJ_MTL\n });\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n // No need for onButtonChanged, since Gear VR controller has no analog buttons.\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.trigger = controllerObject3D.children[2];\n buttonMeshes.trackpad = controllerObject3D.children[1];\n buttonMeshes.touchpad = controllerObject3D.children[1];\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }\n var color;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n default:\n color = this.data.buttonColor;\n }\n buttonMeshes[buttonName].material.color.set(color);\n }\n});\n",
  316. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar GAMEPAD_ID_PREFIX = 'generic';\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - squeeze\n * 2 - touchpad\n * 3 - thumbstick\n *\n * Axis:\n * 0 - touchpad\n * 1 - thumbstick\n *\n */\nvar INPUT_MAPPING = {\n axes: {\n touchpad: [0, 1],\n thumbstick: [2, 3]\n },\n buttons: ['trigger', 'squeeze', 'touchpad', 'thumbstick']\n};\n\n/**\n * Oculus Go controls.\n * Interface with Oculus Go controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('generic-tracked-controller-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n defaultModel: {default: true},\n defaultModelColor: {default: 'gray'},\n orientationOffset: {type: 'vec3'},\n disabled: {default: false}\n },\n\n /**\n * Button IDs:\n * 0 - trackpad\n * 1 - trigger\n */\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.wasControllerConnected = false;\n this.lastControllerCheck = 0;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.bindMethods();\n\n // generic-tracked-controller-controls has the lowest precedence.\n // We must diable this component if there are more specialized controls components.\n this.el.addEventListener('controllerconnected', function (evt) {\n if (evt.detail.name === self.name) { return; }\n self.wasControllerConnected = true;\n self.removeEventListeners();\n self.removeControllersUpdateListener();\n });\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n var hand = data.hand ? data.hand : undefined;\n checkControllerPresentAndSetup(\n this, GAMEPAD_ID_PREFIX,\n {hand: hand, iterateControllerProfiles: true});\n },\n\n play: function () {\n if (this.wasControllerConnected) { return; }\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n // Do nothing if tracked-controls already set.\n // Generic controls have the lowest precedence.\n if (this.el.components['tracked-controls']) {\n this.removeEventListeners();\n return;\n }\n el.setAttribute('tracked-controls', {\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset,\n iterateControllerProfiles: true\n });\n if (!this.data.defaultModel) { return; }\n this.initDefaultModel();\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n initDefaultModel: function () {\n var modelEl = this.modelEl = document.createElement('a-entity');\n modelEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 0.03\n });\n modelEl.setAttribute('material', {color: this.data.color});\n this.el.appendChild(modelEl);\n }\n});\n",
  317. "var geometries = require('../core/geometry').geometries;\nvar geometryNames = require('../core/geometry').geometryNames;\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar dummyGeometry = new THREE.BufferGeometry();\n\n/**\n * Geometry component. Combined with material component to make a mesh in 3D object.\n * Extended with registered geometries.\n */\nmodule.exports.Component = registerComponent('geometry', {\n schema: {\n buffer: {default: true},\n primitive: {default: 'box', oneOf: geometryNames, schemaChange: true},\n skipCache: {default: false}\n },\n\n init: function () {\n this.geometry = null;\n },\n\n /**\n * Talk to geometry system to get or create geometry.\n */\n update: function (previousData) {\n var data = this.data;\n var el = this.el;\n var mesh;\n var system = this.system;\n\n // Dispose old geometry if we created one.\n if (this.geometry) {\n system.unuseGeometry(previousData);\n this.geometry = null;\n }\n\n // Create new geometry.\n this.geometry = system.getOrCreateGeometry(data);\n\n // Set on mesh. If mesh does not exist, create it.\n mesh = el.getObject3D('mesh');\n if (mesh) {\n mesh.geometry = this.geometry;\n } else {\n mesh = new THREE.Mesh();\n mesh.geometry = this.geometry;\n // Default material if not defined on the entity.\n if (!this.el.getAttribute('material')) {\n mesh.material = new THREE.MeshStandardMaterial({\n color: Math.random() * 0xFFFFFF,\n metalness: 0,\n roughness: 0.5\n });\n }\n el.setObject3D('mesh', mesh);\n }\n },\n\n /**\n * Tell geometry system that entity is no longer using the geometry.\n * Unset the geometry on the mesh\n */\n remove: function () {\n this.system.unuseGeometry(this.data);\n this.el.getObject3D('mesh').geometry = dummyGeometry;\n this.geometry = null;\n },\n\n /**\n * Update geometry component schema based on geometry type.\n */\n updateSchema: function (data) {\n var currentGeometryType = this.oldData && this.oldData.primitive;\n var newGeometryType = data.primitive;\n var schema = geometries[newGeometryType] && geometries[newGeometryType].schema;\n\n // Geometry has no schema.\n if (!schema) { throw new Error('Unknown geometry schema `' + newGeometryType + '`'); }\n // Nothing has changed.\n if (currentGeometryType && currentGeometryType === newGeometryType) { return; }\n\n this.extendSchema(schema);\n }\n});\n",
  318. "var registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\nvar warn = utils.debug('components:gltf-model:warn');\n\n/**\n * glTF model loader.\n */\nmodule.exports.Component = registerComponent('gltf-model', {\n schema: {type: 'model'},\n\n init: function () {\n var self = this;\n var dracoLoader = this.system.getDRACOLoader();\n var meshoptDecoder = this.system.getMeshoptDecoder();\n this.model = null;\n this.loader = new THREE.GLTFLoader();\n if (dracoLoader) {\n this.loader.setDRACOLoader(dracoLoader);\n }\n if (meshoptDecoder) {\n this.ready = meshoptDecoder.then(function (meshoptDecoder) {\n self.loader.setMeshoptDecoder(meshoptDecoder);\n });\n } else {\n this.ready = Promise.resolve();\n }\n },\n\n update: function () {\n var self = this;\n var el = this.el;\n var src = this.data;\n\n if (!src) { return; }\n\n this.remove();\n\n this.ready.then(function () {\n self.loader.load(src, function gltfLoaded (gltfModel) {\n self.model = gltfModel.scene || gltfModel.scenes[0];\n self.model.animations = gltfModel.animations;\n el.setObject3D('mesh', self.model);\n el.emit('model-loaded', {format: 'gltf', model: self.model});\n }, undefined /* onProgress */, function gltfFailed (error) {\n var message = (error && error.message) ? error.message : 'Failed to load glTF model';\n warn(message);\n el.emit('model-error', {format: 'gltf', src: src});\n });\n });\n },\n\n remove: function () {\n if (!this.model) { return; }\n this.el.removeObject3D('mesh');\n }\n});\n",
  319. "/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\n\n// Found at https://github.com/aframevr/assets.\nvar MODEL_URLS = {\n toonLeft: 'https://cdn.aframe.io/controllers/hands/leftHand.glb',\n toonRight: 'https://cdn.aframe.io/controllers/hands/rightHand.glb',\n lowPolyLeft: 'https://cdn.aframe.io/controllers/hands/leftHandLow.glb',\n lowPolyRight: 'https://cdn.aframe.io/controllers/hands/rightHandLow.glb',\n highPolyLeft: 'https://cdn.aframe.io/controllers/hands/leftHandHigh.glb',\n highPolyRight: 'https://cdn.aframe.io/controllers/hands/rightHandHigh.glb'\n};\n\n// Poses.\nvar ANIMATIONS = {\n open: 'Open',\n // point: grip active, trackpad surface active, trigger inactive.\n point: 'Point',\n // pointThumb: grip active, trigger inactive, trackpad surface inactive.\n pointThumb: 'Point + Thumb',\n // fist: grip active, trigger active, trackpad surface active.\n fist: 'Fist',\n // hold: trigger active, grip inactive.\n hold: 'Hold',\n // thumbUp: grip active, trigger active, trackpad surface inactive.\n thumbUp: 'Thumb Up'\n};\n\n// Map animation to public events for the API.\nvar EVENTS = {};\nEVENTS[ANIMATIONS.fist] = 'grip';\nEVENTS[ANIMATIONS.thumbUp] = 'pistol';\nEVENTS[ANIMATIONS.point] = 'pointing';\n\n/**\n * Hand controls component that abstracts 6DoF controls:\n * oculus-touch-controls, vive-controls, windows-motion-controls.\n *\n * Originally meant to be a sample implementation of applications-specific controls that\n * abstracts multiple types of controllers.\n *\n * Auto-detect appropriate controller.\n * Handle common events coming from the detected vendor-specific controls.\n * Translate button events to semantic hand-related event names:\n * (gripclose, gripopen, thumbup, thumbdown, pointup, pointdown)\n * Load hand model with gestures that are applied based on the button pressed.\n *\n * @property {string} Hand mapping (`left`, `right`).\n */\nmodule.exports.Component = registerComponent('hand-controls', {\n schema: {\n color: {default: 'white', type: 'color'},\n hand: { default: 'left' },\n handModelStyle: {default: 'lowPoly', oneOf: ['lowPoly', 'highPoly', 'toon']}\n },\n\n init: function () {\n var self = this;\n var el = this.el;\n // Current pose.\n this.gesture = ANIMATIONS.open;\n // Active buttons populated by events provided by the attached controls.\n this.pressedButtons = {};\n this.touchedButtons = {};\n this.loader = new THREE.GLTFLoader();\n this.loader.setCrossOrigin('anonymous');\n\n this.onGripDown = function () { self.handleButton('grip', 'down'); };\n this.onGripUp = function () { self.handleButton('grip', 'up'); };\n this.onTrackpadDown = function () { self.handleButton('trackpad', 'down'); };\n this.onTrackpadUp = function () { self.handleButton('trackpad', 'up'); };\n this.onTrackpadTouchStart = function () { self.handleButton('trackpad', 'touchstart'); };\n this.onTrackpadTouchEnd = function () { self.handleButton('trackpad', 'touchend'); };\n this.onTriggerDown = function () { self.handleButton('trigger', 'down'); };\n this.onTriggerUp = function () { self.handleButton('trigger', 'up'); };\n this.onTriggerTouchStart = function () { self.handleButton('trigger', 'touchstart'); };\n this.onTriggerTouchEnd = function () { self.handleButton('trigger', 'touchend'); };\n this.onGripTouchStart = function () { self.handleButton('grip', 'touchstart'); };\n this.onGripTouchEnd = function () { self.handleButton('grip', 'touchend'); };\n this.onThumbstickDown = function () { self.handleButton('thumbstick', 'down'); };\n this.onThumbstickUp = function () { self.handleButton('thumbstick', 'up'); };\n this.onAorXTouchStart = function () { self.handleButton('AorX', 'touchstart'); };\n this.onAorXTouchEnd = function () { self.handleButton('AorX', 'touchend'); };\n this.onBorYTouchStart = function () { self.handleButton('BorY', 'touchstart'); };\n this.onBorYTouchEnd = function () { self.handleButton('BorY', 'touchend'); };\n this.onSurfaceTouchStart = function () { self.handleButton('surface', 'touchstart'); };\n this.onSurfaceTouchEnd = function () { self.handleButton('surface', 'touchend'); };\n this.onControllerConnected = this.onControllerConnected.bind(this);\n this.onControllerDisconnected = this.onControllerDisconnected.bind(this);\n\n el.addEventListener('controllerconnected', this.onControllerConnected);\n el.addEventListener('controllerdisconnected', this.onControllerDisconnected);\n\n // Hidden by default.\n el.object3D.visible = false;\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n },\n\n tick: function (time, delta) {\n var mesh = this.el.getObject3D('mesh');\n\n if (!mesh || !mesh.mixer) { return; }\n\n mesh.mixer.update(delta / 1000);\n },\n\n onControllerConnected: function () {\n this.el.object3D.visible = true;\n },\n\n onControllerDisconnected: function () {\n this.el.object3D.visible = false;\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('gripdown', this.onGripDown);\n el.addEventListener('gripup', this.onGripUp);\n el.addEventListener('trackpaddown', this.onTrackpadDown);\n el.addEventListener('trackpadup', this.onTrackpadUp);\n el.addEventListener('trackpadtouchstart', this.onTrackpadTouchStart);\n el.addEventListener('trackpadtouchend', this.onTrackpadTouchEnd);\n el.addEventListener('triggerdown', this.onTriggerDown);\n el.addEventListener('triggerup', this.onTriggerUp);\n el.addEventListener('triggertouchstart', this.onTriggerTouchStart);\n el.addEventListener('triggertouchend', this.onTriggerTouchEnd);\n el.addEventListener('griptouchstart', this.onGripTouchStart);\n el.addEventListener('griptouchend', this.onGripTouchEnd);\n el.addEventListener('thumbstickdown', this.onThumbstickDown);\n el.addEventListener('thumbstickup', this.onThumbstickUp);\n el.addEventListener('abuttontouchstart', this.onAorXTouchStart);\n el.addEventListener('abuttontouchend', this.onAorXTouchEnd);\n el.addEventListener('bbuttontouchstart', this.onBorYTouchStart);\n el.addEventListener('bbuttontouchend', this.onBorYTouchEnd);\n el.addEventListener('xbuttontouchstart', this.onAorXTouchStart);\n el.addEventListener('xbuttontouchend', this.onAorXTouchEnd);\n el.addEventListener('ybuttontouchstart', this.onBorYTouchStart);\n el.addEventListener('ybuttontouchend', this.onBorYTouchEnd);\n el.addEventListener('surfacetouchstart', this.onSurfaceTouchStart);\n el.addEventListener('surfacetouchend', this.onSurfaceTouchEnd);\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('gripdown', this.onGripDown);\n el.removeEventListener('gripup', this.onGripUp);\n el.removeEventListener('trackpaddown', this.onTrackpadDown);\n el.removeEventListener('trackpadup', this.onTrackpadUp);\n el.removeEventListener('trackpadtouchstart', this.onTrackpadTouchStart);\n el.removeEventListener('trackpadtouchend', this.onTrackpadTouchEnd);\n el.removeEventListener('triggerdown', this.onTriggerDown);\n el.removeEventListener('triggerup', this.onTriggerUp);\n el.removeEventListener('triggertouchstart', this.onTriggerTouchStart);\n el.removeEventListener('triggertouchend', this.onTriggerTouchEnd);\n el.removeEventListener('griptouchstart', this.onGripTouchStart);\n el.removeEventListener('griptouchend', this.onGripTouchEnd);\n el.removeEventListener('thumbstickdown', this.onThumbstickDown);\n el.removeEventListener('thumbstickup', this.onThumbstickUp);\n el.removeEventListener('abuttontouchstart', this.onAorXTouchStart);\n el.removeEventListener('abuttontouchend', this.onAorXTouchEnd);\n el.removeEventListener('bbuttontouchstart', this.onBorYTouchStart);\n el.removeEventListener('bbuttontouchend', this.onBorYTouchEnd);\n el.removeEventListener('xbuttontouchstart', this.onAorXTouchStart);\n el.removeEventListener('xbuttontouchend', this.onAorXTouchEnd);\n el.removeEventListener('ybuttontouchstart', this.onBorYTouchStart);\n el.removeEventListener('ybuttontouchend', this.onBorYTouchEnd);\n el.removeEventListener('surfacetouchstart', this.onSurfaceTouchStart);\n el.removeEventListener('surfacetouchend', this.onSurfaceTouchEnd);\n },\n\n /**\n * Update handler. More like the `init` handler since the only property is the hand, and\n * that won't be changing much.\n */\n update: function (previousHand) {\n var controlConfiguration;\n var el = this.el;\n var hand = this.data.hand;\n var handModelStyle = this.data.handModelStyle;\n var handColor = this.data.color;\n var self = this;\n\n // Get common configuration to abstract different vendor controls.\n controlConfiguration = {\n hand: hand,\n model: false\n };\n\n // Set model.\n if (hand !== previousHand) {\n var handmodelUrl = MODEL_URLS[handModelStyle + hand.charAt(0).toUpperCase() + hand.slice(1)];\n this.loader.load(handmodelUrl, function (gltf) {\n var mesh = gltf.scene.children[0];\n var handModelOrientation = hand === 'left' ? Math.PI / 2 : -Math.PI / 2;\n mesh.mixer = new THREE.AnimationMixer(mesh);\n self.clips = gltf.animations;\n el.setObject3D('mesh', mesh);\n\n var handMaterial = mesh.children[1].material;\n handMaterial.color = new THREE.Color(handColor);\n mesh.position.set(0, 0, 0);\n mesh.rotation.set(0, 0, handModelOrientation);\n el.setAttribute('magicleap-controls', controlConfiguration);\n el.setAttribute('vive-controls', controlConfiguration);\n el.setAttribute('oculus-touch-controls', controlConfiguration);\n el.setAttribute('windows-motion-controls', controlConfiguration);\n el.setAttribute('hp-mixed-reality-controls', controlConfiguration);\n });\n }\n },\n\n remove: function () {\n this.el.removeObject3D('mesh');\n },\n\n /**\n * Play model animation, based on which button was pressed and which kind of event.\n *\n * 1. Process buttons.\n * 2. Determine gesture (this.determineGesture()).\n * 3. Animation gesture (this.animationGesture()).\n * 4. Emit gesture events (this.emitGestureEvents()).\n *\n * @param {string} button - Name of the button.\n * @param {string} evt - Type of event for the button (i.e., down/up/touchstart/touchend).\n */\n handleButton: function (button, evt) {\n var lastGesture;\n var isPressed = evt === 'down';\n var isTouched = evt === 'touchstart';\n\n // Update objects.\n if (evt.indexOf('touch') === 0) {\n // Update touch object.\n if (isTouched === this.touchedButtons[button]) { return; }\n this.touchedButtons[button] = isTouched;\n } else {\n // Update button object.\n if (isPressed === this.pressedButtons[button]) { return; }\n this.pressedButtons[button] = isPressed;\n }\n\n // Determine the gesture.\n lastGesture = this.gesture;\n this.gesture = this.determineGesture();\n\n // Same gesture.\n if (this.gesture === lastGesture) { return; }\n // Animate gesture.\n this.animateGesture(this.gesture, lastGesture);\n\n // Emit events.\n this.emitGestureEvents(this.gesture, lastGesture);\n },\n\n /**\n * Determine which pose hand should be in considering active and touched buttons.\n */\n determineGesture: function () {\n var gesture;\n var isGripActive = this.pressedButtons.grip;\n var isSurfaceActive = this.pressedButtons.surface || this.touchedButtons.surface;\n var isTrackpadActive = this.pressedButtons.trackpad || this.touchedButtons.trackpad;\n var isTriggerActive = this.pressedButtons.trigger || this.touchedButtons.trigger;\n var isABXYActive = this.touchedButtons.AorX || this.touchedButtons.BorY;\n var isVive = isViveController(this.el.components['tracked-controls']);\n\n // Works well with Oculus Touch and Windows Motion Controls, but Vive needs tweaks.\n if (isVive) {\n if (isGripActive || isTriggerActive) {\n gesture = ANIMATIONS.fist;\n } else if (isTrackpadActive) {\n gesture = ANIMATIONS.point;\n }\n } else {\n if (isGripActive) {\n if (isSurfaceActive || isABXYActive || isTrackpadActive) {\n gesture = isTriggerActive ? ANIMATIONS.fist : ANIMATIONS.point;\n } else {\n gesture = isTriggerActive ? ANIMATIONS.thumbUp : ANIMATIONS.pointThumb;\n }\n } else if (isTriggerActive) {\n gesture = ANIMATIONS.hold;\n }\n }\n\n return gesture;\n },\n\n /**\n * Play corresponding clip to a gesture\n */\n getClip: function (gesture) {\n var clip;\n var i;\n for (i = 0; i < this.clips.length; i++) {\n clip = this.clips[i];\n if (clip.name !== gesture) { continue; }\n return clip;\n }\n },\n\n /**\n * Play gesture animation.\n *\n * @param {string} gesture - Which pose to animate to. If absent, then animate to open.\n * @param {string} lastGesture - Previous gesture, to reverse back to open if needed.\n */\n animateGesture: function (gesture, lastGesture) {\n if (gesture) {\n this.playAnimation(gesture || ANIMATIONS.open, lastGesture, false);\n return;\n }\n\n // If no gesture, then reverse the current gesture back to open pose.\n this.playAnimation(lastGesture, lastGesture, true);\n },\n\n /**\n * Emit `hand-controls`-specific events.\n */\n emitGestureEvents: function (gesture, lastGesture) {\n var el = this.el;\n var eventName;\n\n if (lastGesture === gesture) { return; }\n\n // Emit event for lastGesture not inactive.\n eventName = getGestureEventName(lastGesture, false);\n if (eventName) { el.emit(eventName); }\n\n // Emit event for current gesture now active.\n eventName = getGestureEventName(gesture, true);\n if (eventName) { el.emit(eventName); }\n },\n\n /**\n * Play hand animation based on button state.\n *\n * @param {string} gesture - Name of the animation as specified by the model.\n * @param {string} lastGesture - Previous pose.\n * @param {boolean} reverse - Whether animation should play in reverse.\n */\n playAnimation: function (gesture, lastGesture, reverse) {\n var clip;\n var fromAction;\n var mesh = this.el.getObject3D('mesh');\n var toAction;\n\n if (!mesh) { return; }\n\n // Stop all current animations.\n mesh.mixer.stopAllAction();\n\n // Grab clip action.\n clip = this.getClip(gesture);\n toAction = mesh.mixer.clipAction(clip);\n toAction.clampWhenFinished = true;\n toAction.loop = THREE.LoopRepeat;\n toAction.repetitions = 0;\n toAction.timeScale = reverse ? -1 : 1;\n toAction.time = reverse ? clip.duration : 0;\n toAction.weight = 1;\n\n // No gesture to gesture or gesture to no gesture.\n if (!lastGesture || gesture === lastGesture) {\n // Stop all current animations.\n mesh.mixer.stopAllAction();\n // Play animation.\n toAction.play();\n return;\n }\n\n // Animate or crossfade from gesture to gesture.\n clip = this.getClip(lastGesture);\n fromAction = mesh.mixer.clipAction(clip);\n fromAction.weight = 0.15;\n fromAction.play();\n toAction.play();\n fromAction.crossFadeTo(toAction, 0.15, true);\n }\n});\n\n/**\n * Suffix gestures based on toggle state (e.g., open/close, up/down, start/end).\n *\n * @param {string} gesture\n * @param {boolean} active\n */\nfunction getGestureEventName (gesture, active) {\n var eventName;\n\n if (!gesture) { return; }\n\n eventName = EVENTS[gesture];\n if (eventName === 'grip') {\n return eventName + (active ? 'close' : 'open');\n }\n if (eventName === 'point') {\n return eventName + (active ? 'up' : 'down');\n }\n if (eventName === 'pointing' || eventName === 'pistol') {\n return eventName + (active ? 'start' : 'end');\n }\n}\n\nfunction isViveController (trackedControls) {\n var controller = trackedControls && trackedControls.controller;\n var isVive = controller && (controller.id && controller.id.indexOf('OpenVR ') === 0 ||\n (controller.profiles &&\n controller.profiles[0] &&\n controller.profiles[0] === 'htc-vive'));\n return isVive;\n}\n",
  320. "/* global THREE, XRRigidTransform */\nvar registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\n\nvar LEFT_HAND_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus-hands/v3/left.glb';\nvar RIGHT_HAND_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus-hands/v3/right.glb';\n\nvar BONE_PREFIX = {\n left: 'b_l_',\n right: 'b_r_'\n};\n\nvar JOINTS = [\n 'wrist',\n 'thumb-metacarpal',\n 'thumb-phalanx-proximal',\n 'thumb-phalanx-distal',\n 'thumb-tip',\n 'index-finger-metacarpal',\n 'index-finger-phalanx-proximal',\n 'index-finger-phalanx-intermediate',\n 'index-finger-phalanx-distal',\n 'index-finger-tip',\n 'middle-finger-metacarpal',\n 'middle-finger-phalanx-proximal',\n 'middle-finger-phalanx-intermediate',\n 'middle-finger-phalanx-distal',\n 'middle-finger-tip',\n 'ring-finger-metacarpal',\n 'ring-finger-phalanx-proximal',\n 'ring-finger-phalanx-intermediate',\n 'ring-finger-phalanx-distal',\n 'ring-finger-tip',\n 'pinky-finger-metacarpal',\n 'pinky-finger-phalanx-proximal',\n 'pinky-finger-phalanx-intermediate',\n 'pinky-finger-phalanx-distal',\n 'pinky-finger-tip'\n];\n\nvar BONE_MAPPING = {\n 'wrist': 'wrist',\n 'thumb-metacarpal': 'thumb1',\n 'thumb-phalanx-proximal': 'thumb2',\n 'thumb-phalanx-distal': 'thumb3',\n 'thumb-tip': 'thumb_null',\n 'index-finger-metacarpal': 'index0',\n 'index-finger-phalanx-proximal': 'index1',\n 'index-finger-phalanx-intermediate': 'index2',\n 'index-finger-phalanx-distal': 'index3',\n 'index-finger-tip': 'index_null',\n 'middle-finger-metacarpal': 'middle0',\n 'middle-finger-phalanx-proximal': 'middle1',\n 'middle-finger-phalanx-intermediate': 'middle2',\n 'middle-finger-phalanx-distal': 'middle3',\n 'middle-finger-tip': 'middle_null',\n 'ring-finger-metacarpal': 'ring0',\n 'ring-finger-phalanx-proximal': 'ring1',\n 'ring-finger-phalanx-intermediate': 'ring2',\n 'ring-finger-phalanx-distal': 'ring3',\n 'ring-finger-tip': 'ring_null',\n 'pinky-finger-metacarpal': 'pinky0',\n 'pinky-finger-phalanx-proximal': 'pinky1',\n 'pinky-finger-phalanx-intermediate': 'pinky2',\n 'pinky-finger-phalanx-distal': 'pinky3',\n 'pinky-finger-tip': 'pinky_null'\n};\n\nvar PINCH_START_DISTANCE = 0.015;\nvar PINCH_END_DISTANCE = 0.03;\nvar PINCH_POSITION_INTERPOLATION = 0.5;\n\n/**\n * Controls for hand tracking\n */\nmodule.exports.Component = registerComponent('hand-tracking-controls', {\n schema: {\n hand: {default: 'right', oneOf: ['left', 'right']},\n modelStyle: {default: 'mesh', oneOf: ['dots', 'mesh']},\n modelColor: {default: 'white'}\n },\n\n bindMethods: function () {\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n },\n\n addEventListeners: function () {\n this.el.addEventListener('model-loaded', this.onModelLoaded);\n for (var i = 0; i < this.jointEls.length; ++i) {\n this.jointEls[i].object3D.visible = true;\n }\n },\n\n removeEventListeners: function () {\n this.el.removeEventListener('model-loaded', this.onModelLoaded);\n for (var i = 0; i < this.jointEls.length; ++i) {\n this.jointEls[i].object3D.visible = false;\n }\n },\n\n init: function () {\n var sceneEl = this.el.sceneEl;\n var webXROptionalAttributes = sceneEl.getAttribute('webxr').optionalFeatures;\n webXROptionalAttributes.push('hand-tracking');\n sceneEl.setAttribute('webxr', {optionalFeatures: webXROptionalAttributes});\n this.onModelLoaded = this.onModelLoaded.bind(this);\n this.jointEls = [];\n this.controllerPresent = false;\n this.isPinched = false;\n this.pinchEventDetail = {position: new THREE.Vector3()};\n this.indexTipPosition = new THREE.Vector3();\n\n this.bindMethods();\n\n this.updateReferenceSpace = this.updateReferenceSpace.bind(this);\n this.el.sceneEl.addEventListener('enter-vr', this.updateReferenceSpace);\n this.el.sceneEl.addEventListener('exit-vr', this.updateReferenceSpace);\n },\n\n updateReferenceSpace: function () {\n var self = this;\n var xrSession = this.el.sceneEl.xrSession;\n this.referenceSpace = undefined;\n if (!xrSession) { return; }\n var referenceSpaceType = self.el.sceneEl.systems.webxr.sessionReferenceSpaceType;\n xrSession.requestReferenceSpace(referenceSpaceType).then(function (referenceSpace) {\n self.referenceSpace = referenceSpace.getOffsetReferenceSpace(new XRRigidTransform({x: 0, y: 1.5, z: 0}));\n }).catch(function (error) {\n self.el.sceneEl.systems.webxr.warnIfFeatureNotRequested(referenceSpaceType, 'tracked-controls-webxr uses reference space ' + referenceSpaceType);\n throw error;\n });\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n var hand = data.hand ? data.hand : undefined;\n checkControllerPresentAndSetup(\n this, '',\n {hand: hand, iterateControllerProfiles: true, handTracking: true});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n tick: function () {\n var sceneEl = this.el.sceneEl;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var frame = sceneEl.frame;\n var trackedControlsWebXR = this.el.components['tracked-controls-webxr'];\n if (!controller || !frame || !trackedControlsWebXR) { return; }\n if (controller.hand) {\n this.el.object3D.position.set(0, 0, 0);\n this.el.object3D.rotation.set(0, 0, 0);\n if (frame.getJointPose) { this.updateHandModel(); }\n this.detectGesture();\n }\n },\n\n updateHandModel: function () {\n if (this.data.modelStyle === 'dots') {\n this.updateHandDotsModel();\n }\n\n if (this.data.modelStyle === 'mesh') {\n this.updateHandMeshModel();\n }\n },\n\n getBone: function (name) {\n var bones = this.bones;\n for (var i = 0; i < bones.length; i++) {\n if (bones[i].name === name) { return bones[i]; }\n }\n return null;\n },\n\n updateHandMeshModel: function () {\n var frame = this.el.sceneEl.frame;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var referenceSpace = this.referenceSpace;\n\n if (!controller || !this.mesh || !referenceSpace) { return; }\n this.mesh.visible = false;\n for (var inputjoint of controller.hand.values()) {\n var bone;\n var jointPose;\n var jointTransform;\n jointPose = frame.getJointPose(inputjoint, referenceSpace);\n if (!BONE_MAPPING[inputjoint.jointName]) { continue; }\n bone = this.getBone(BONE_PREFIX[this.data.hand] + BONE_MAPPING[inputjoint.jointName]);\n if (bone != null && jointPose) {\n jointTransform = jointPose.transform;\n this.mesh.visible = true;\n bone.position.copy(jointTransform.position).multiplyScalar(100);\n bone.quaternion.set(jointTransform.orientation.x, jointTransform.orientation.y, jointTransform.orientation.z, jointTransform.orientation.w);\n }\n }\n },\n\n updateHandDotsModel: function () {\n var frame = this.el.sceneEl.frame;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var trackedControlsWebXR = this.el.components['tracked-controls-webxr'];\n var referenceSpace = trackedControlsWebXR.system.referenceSpace;\n var jointEl;\n var object3D;\n var jointPose;\n var i = 0;\n\n for (var inputjoint of controller.hand.values()) {\n jointEl = this.jointEls[i++];\n object3D = jointEl.object3D;\n jointPose = frame.getJointPose(inputjoint, referenceSpace);\n jointEl.object3D.visible = !!jointPose;\n if (!jointPose) { continue; }\n object3D.matrix.elements = jointPose.transform.matrix;\n object3D.matrix.decompose(object3D.position, object3D.rotation, object3D.scale);\n jointEl.setAttribute('scale', {x: jointPose.radius, y: jointPose.radius, z: jointPose.radius});\n }\n },\n\n detectGesture: function () {\n this.detectPinch();\n },\n\n detectPinch: (function () {\n var thumbTipPosition = new THREE.Vector3();\n return function () {\n var frame = this.el.sceneEl.frame;\n var indexTipPosition = this.indexTipPosition;\n var controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n var trackedControlsWebXR = this.el.components['tracked-controls-webxr'];\n var referenceSpace = this.referenceSpace || trackedControlsWebXR.system.referenceSpace;\n var indexTip = controller.hand.get('index-finger-tip');\n var thumbTip = controller.hand.get('thumb-tip');\n if (!indexTip ||\n !thumbTip) { return; }\n var indexTipPose = frame.getJointPose(indexTip, referenceSpace);\n var thumbTipPose = frame.getJointPose(thumbTip, referenceSpace);\n\n if (!indexTipPose || !thumbTipPose) { return; }\n\n thumbTipPosition.copy(thumbTipPose.transform.position);\n indexTipPosition.copy(indexTipPose.transform.position);\n\n var distance = indexTipPosition.distanceTo(thumbTipPosition);\n\n if (distance < PINCH_START_DISTANCE && this.isPinched === false) {\n this.isPinched = true;\n this.pinchEventDetail.position.copy(indexTipPosition).lerp(thumbTipPosition, PINCH_POSITION_INTERPOLATION);\n this.pinchEventDetail.position.y += 1.5;\n this.el.emit('pinchstarted', this.pinchEventDetail);\n }\n\n if (distance > PINCH_END_DISTANCE && this.isPinched === true) {\n this.isPinched = false;\n this.pinchEventDetail.position.copy(indexTipPosition).lerp(thumbTipPosition, PINCH_POSITION_INTERPOLATION);\n this.pinchEventDetail.position.y += 1.5;\n this.el.emit('pinchended', this.pinchEventDetail);\n }\n\n if (this.isPinched) {\n this.pinchEventDetail.position.copy(indexTipPosition).lerp(thumbTipPosition, PINCH_POSITION_INTERPOLATION);\n this.pinchEventDetail.position.y += 1.5;\n this.el.emit('pinchmoved', this.pinchEventDetail);\n }\n\n indexTipPosition.y += 1.5;\n };\n })(),\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n hand: data.hand,\n iterateControllerProfiles: true,\n handTrackingEnabled: true\n });\n this.initDefaultModel();\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n var controller;\n this.checkIfControllerPresent();\n controller = this.el.components['tracked-controls'] && this.el.components['tracked-controls'].controller;\n if (!this.el.getObject3D('mesh')) { return; }\n if (!controller || !controller.hand || !controller.hand[0]) {\n this.el.getObject3D('mesh').visible = false;\n }\n },\n\n initDefaultModel: function () {\n if (this.el.getObject3D('mesh')) { return; }\n if (this.data.modelStyle === 'dots') {\n this.initDotsModel();\n }\n\n if (this.data.modelStyle === 'mesh') {\n this.initMeshHandModel();\n }\n },\n\n initDotsModel: function () {\n // Add models just once.\n if (this.jointEls.length !== 0) { return; }\n for (var i = 0; i < JOINTS.length; ++i) {\n var jointEl = this.jointEl = document.createElement('a-entity');\n jointEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 1.0\n });\n jointEl.setAttribute('material', {color: this.data.modelColor});\n jointEl.object3D.visible = false;\n this.el.appendChild(jointEl);\n this.jointEls.push(jointEl);\n }\n },\n\n initMeshHandModel: function () {\n var modelURL = this.data.hand === 'left' ? LEFT_HAND_MODEL_URL : RIGHT_HAND_MODEL_URL;\n this.el.setAttribute('gltf-model', modelURL);\n },\n\n onModelLoaded: function () {\n var mesh = this.mesh = this.el.getObject3D('mesh').children[0];\n var skinnedMesh = this.skinnedMesh = mesh.children[30];\n if (!this.skinnedMesh) { return; }\n this.bones = skinnedMesh.skeleton.bones;\n this.el.removeObject3D('mesh');\n mesh.position.set(0, 1.5, 0);\n mesh.rotation.set(0, 0, 0);\n skinnedMesh.frustumCulled = false;\n skinnedMesh.material = new THREE.MeshStandardMaterial({skinning: true, color: this.data.modelColor});\n this.el.setObject3D('mesh', mesh);\n }\n});\n\n",
  321. "var register = require('../core/component').registerComponent;\n\nmodule.exports.Component = register('hide-on-enter-ar', {\n init: function () {\n var self = this;\n this.el.sceneEl.addEventListener('enter-vr', function () {\n if (self.el.sceneEl.is('ar-mode')) {\n self.el.object3D.visible = false;\n }\n });\n this.el.sceneEl.addEventListener('exit-vr', function () {\n self.el.object3D.visible = true;\n });\n }\n});\n",
  322. "var bind = require('../utils/bind');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\n// See Profiles Registry:\n// https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/registry\n// TODO: Add a more robust system for deriving gamepad name.\nvar GAMEPAD_ID = 'hp-mixed-reality';\n\nvar HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL = 'https://cdn.aframe.io/controllers/hp/mixed-reality/';\n\nvar HP_MIXED_REALITY_POSITION_OFFSET = {x: 0, y: 0, z: 0.06};\nvar HP_MIXED_REALITY_ROTATION_OFFSET = {_x: Math.PI / 4, _y: 0, _z: 0, _order: 'XYZ'};\n\n/**\n * Button IDs:\n * 0 - trigger\n * 1 - grip\n * 3 - X / A\n * 4 - Y / B\n *\n * Axis:\n * 2 - joystick x axis\n * 3 - joystick y axis\n */\nvar INPUT_MAPPING_WEBXR = {\n left: {\n axes: {touchpad: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'xbutton', 'ybutton']\n },\n right: {\n axes: {touchpad: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'abutton', 'bbutton']\n }\n};\n\n/**\n * HP Mixed Reality Controls\n */\nmodule.exports.Component = registerComponent('hp-mixed-reality-controls', {\n schema: {\n hand: {default: 'none'},\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: INPUT_MAPPING_WEBXR,\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self, self.data.hand); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self, self.data.hand); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self, self.data.hand); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self, self.data.hand); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n update: function () {\n var data = this.data;\n this.controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n checkControllerPresentAndSetup(this, GAMEPAD_ID,\n {index: this.controllerIndex, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n el.setAttribute('tracked-controls', {\n // TODO: verify expected behavior between reserved prefixes.\n idPrefix: GAMEPAD_ID,\n hand: data.hand,\n controller: this.controllerIndex,\n orientationOffset: data.orientationOffset\n });\n\n // Load model.\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', HP_MIXEDL_REALITY_MODEL_GLB_BASE_URL + this.data.hand + '.glb');\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n // Note that due to gamepadconnected event propagation issues, we don't rely on events.\n this.checkIfControllerPresent();\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping[this.data.hand].buttons[evt.detail.id];\n var analogValue;\n\n if (!button) { return; }\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n console.log('analog value of trigger press: ' + analogValue);\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n\n if (!this.data.model) { return; }\n\n controllerObject3D.position.copy(HP_MIXED_REALITY_POSITION_OFFSET);\n controllerObject3D.rotation.copy(HP_MIXED_REALITY_ROTATION_OFFSET);\n\n this.el.emit('controllermodelready', {\n name: 'hp-mixed-reality-controls',\n model: this.data.model,\n rayOrigin: new THREE.Vector3(0, 0, 0)\n });\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n }\n});\n",
  323. "require('./animation');\nrequire('./camera');\nrequire('./cursor');\nrequire('./daydream-controls');\nrequire('./gearvr-controls');\nrequire('./geometry');\nrequire('./generic-tracked-controller-controls');\nrequire('./gltf-model');\nrequire('./hand-tracking-controls');\nrequire('./hand-controls');\nrequire('./hide-on-enter-ar');\nrequire('./hp-mixed-reality-controls');\nrequire('./layer');\nrequire('./laser-controls');\nrequire('./light');\nrequire('./line');\nrequire('./link');\nrequire('./look-controls');\nrequire('./magicleap-controls');\nrequire('./material');\nrequire('./obj-model');\nrequire('./oculus-go-controls');\nrequire('./oculus-touch-controls');\nrequire('./position');\nrequire('./raycaster');\nrequire('./rotation');\nrequire('./scale');\nrequire('./shadow');\nrequire('./sound');\nrequire('./text');\nrequire('./tracked-controls');\nrequire('./tracked-controls-webvr');\nrequire('./tracked-controls-webxr');\nrequire('./visible');\nrequire('./valve-index-controls');\nrequire('./vive-controls');\nrequire('./vive-focus-controls');\nrequire('./wasd-controls');\nrequire('./windows-motion-controls');\n\nrequire('./scene/ar-hit-test');\nrequire('./scene/background');\nrequire('./scene/debug');\nrequire('./scene/device-orientation-permission-ui');\nrequire('./scene/embedded');\nrequire('./scene/inspector');\nrequire('./scene/fog');\nrequire('./scene/keyboard-shortcuts');\nrequire('./scene/pool');\nrequire('./scene/screenshot');\nrequire('./scene/stats');\nrequire('./scene/vr-mode-ui');\n",
  324. "var registerComponent = require('../core/component').registerComponent;\nvar utils = require('../utils/');\n\nregisterComponent('laser-controls', {\n schema: {\n hand: {default: 'right'},\n model: {default: true},\n defaultModelColor: {type: 'color', default: 'grey'}\n },\n\n init: function () {\n var config = this.config;\n var data = this.data;\n var el = this.el;\n var self = this;\n var controlsConfiguration = {hand: data.hand, model: data.model};\n\n // Set all controller models.\n el.setAttribute('daydream-controls', controlsConfiguration);\n el.setAttribute('gearvr-controls', controlsConfiguration);\n el.setAttribute('hp-mixed-reality-controls', controlsConfiguration);\n el.setAttribute('magicleap-controls', controlsConfiguration);\n el.setAttribute('oculus-go-controls', controlsConfiguration);\n el.setAttribute('oculus-touch-controls', controlsConfiguration);\n el.setAttribute('valve-index-controls', controlsConfiguration);\n el.setAttribute('vive-controls', controlsConfiguration);\n el.setAttribute('vive-focus-controls', controlsConfiguration);\n el.setAttribute('windows-motion-controls', controlsConfiguration);\n el.setAttribute('generic-tracked-controller-controls', controlsConfiguration);\n\n // Wait for controller to connect, or have a valid pointing pose, before creating ray\n el.addEventListener('controllerconnected', createRay);\n el.addEventListener('controllerdisconnected', hideRay);\n el.addEventListener('controllermodelready', function (evt) {\n createRay(evt);\n self.modelReady = true;\n });\n\n function createRay (evt) {\n var controllerConfig = config[evt.detail.name];\n\n if (!controllerConfig) { return; }\n\n // Show the line unless a particular config opts to hide it, until a controllermodelready\n // event comes through.\n var raycasterConfig = utils.extend({\n showLine: true\n }, controllerConfig.raycaster || {});\n\n // The controllermodelready event contains a rayOrigin that takes into account\n // offsets specific to the loaded model.\n if (evt.detail.rayOrigin) {\n raycasterConfig.origin = evt.detail.rayOrigin.origin;\n raycasterConfig.direction = evt.detail.rayOrigin.direction;\n raycasterConfig.showLine = true;\n }\n\n // Only apply a default raycaster if it does not yet exist. This prevents it overwriting\n // config applied from a controllermodelready event.\n if (evt.detail.rayOrigin || !self.modelReady) {\n el.setAttribute('raycaster', raycasterConfig);\n } else {\n el.setAttribute('raycaster', 'showLine', true);\n }\n\n el.setAttribute('cursor', utils.extend({\n fuse: false\n }, controllerConfig.cursor));\n }\n\n function hideRay () {\n el.setAttribute('raycaster', 'showLine', false);\n }\n },\n\n config: {\n 'daydream-controls': {\n cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']}\n },\n\n 'gearvr-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0.0010, z: 0}}\n },\n\n 'generic-tracked-controller-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']}\n },\n\n 'hp-mixed-reality-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0, z: 0}}\n },\n\n 'magicleap-controls': {\n cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']}\n },\n\n 'oculus-go-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0.0005, z: 0}}\n },\n\n 'oculus-touch-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {origin: {x: 0, y: 0, z: 0}}\n },\n\n 'valve-index-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']}\n },\n\n 'vive-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']}\n },\n\n 'vive-focus-controls': {\n cursor: {downEvents: ['trackpaddown', 'triggerdown'], upEvents: ['trackpadup', 'triggerup']}\n },\n\n 'windows-motion-controls': {\n cursor: {downEvents: ['triggerdown'], upEvents: ['triggerup']},\n raycaster: {showLine: false}\n }\n }\n});\n",
  325. "/* global THREE, XRRigidTransform, XRWebGLBinding */\nvar registerComponent = require('../core/component').registerComponent;\nvar utils = require('../utils/');\nvar warn = utils.debug('components:layer:warn');\n\nmodule.exports.Component = registerComponent('layer', {\n schema: {\n type: {default: 'quad', oneOf: ['quad', 'monocubemap', 'stereocubemap']},\n src: {type: 'map'},\n rotateCubemap: {default: false},\n width: {default: 0},\n height: {default: 0}\n },\n\n init: function () {\n var gl = this.el.sceneEl.renderer.getContext();\n\n this.quaternion = new THREE.Quaternion();\n this.position = new THREE.Vector3();\n\n this.bindMethods();\n this.needsRedraw = false;\n this.frameBuffer = gl.createFramebuffer();\n var requiredFeatures = this.el.sceneEl.getAttribute('webxr').requiredFeatures;\n requiredFeatures.push('layers');\n this.el.sceneEl.getAttribute('webxr', 'requiredFeatures', requiredFeatures);\n this.el.sceneEl.addEventListener('enter-vr', this.onEnterVR);\n this.el.sceneEl.addEventListener('exit-vr', this.onExitVR);\n },\n\n bindMethods: function () {\n this.onRequestedReferenceSpace = this.onRequestedReferenceSpace.bind(this);\n this.onEnterVR = this.onEnterVR.bind(this);\n this.onExitVR = this.onExitVR.bind(this);\n },\n\n update: function (oldData) {\n if (this.data.src !== oldData.src) { this.updateSrc(); }\n },\n\n updateSrc: function () {\n var type = this.data.type;\n this.texture = undefined;\n if (type === 'quad') {\n this.loadQuadImage();\n return;\n }\n\n if (type === 'monocubemap' || type === 'stereocubemap') {\n this.loadCubeMapImages();\n return;\n }\n },\n\n loadCubeMapImages: function () {\n var type = this.data.type;\n var glayer;\n var xrGLFactory = this.xrGLFactory;\n var frame = this.el.sceneEl.frame;\n var src = this.data.src;\n\n this.visibilityChanged = false;\n if (!this.layer) { return; }\n if (!src.complete) {\n this.pendingCubeMapUpdate = true;\n } else {\n this.pendingCubeMapUpdate = false;\n }\n\n if (!this.loadingScreen) {\n this.loadingScreen = true;\n } else {\n this.loadingScreen = false;\n }\n\n if (type === 'monocubemap') {\n glayer = xrGLFactory.getSubImage(this.layer, frame);\n this.loadCubeMapImage(glayer.colorTexture, src, 0);\n } else {\n glayer = xrGLFactory.getSubImage(this.layer, frame, 'left');\n this.loadCubeMapImage(glayer.colorTexture, src, 0);\n glayer = xrGLFactory.getSubImage(this.layer, frame, 'right');\n this.loadCubeMapImage(glayer.colorTexture, src, 6);\n }\n },\n\n loadQuadImage: function () {\n var src = this.data.src;\n var self = this;\n this.el.sceneEl.systems.material.loadTexture(src, {src: src}, function textureLoaded (texture) {\n self.el.sceneEl.renderer.initTexture(texture);\n self.texture = texture;\n if (src.tagName === 'VIDEO') { setTimeout(function () { self.textureIsVideo = true; }, 1000); }\n if (self.layer) {\n self.layer.height = self.data.height / 2 || self.texture.image.height / 1000;\n self.layer.width = self.data.width / 2 || self.texture.image.width / 1000;\n self.needsRedraw = true;\n }\n self.updateQuadPanel();\n });\n },\n\n preGenerateCubeMapTextures: function (src, callback) {\n if (this.data.type === 'monocubemap') {\n this.generateCubeMapTextures(src, 0, callback);\n } else {\n this.generateCubeMapTextures(src, 0, callback);\n this.generateCubeMapTextures(src, 6, callback);\n }\n },\n\n generateCubeMapTextures: function (src, faceOffset, callback) {\n var data = this.data;\n var cubeFaceSize = this.cubeFaceSize;\n var textureSourceCubeFaceSize = Math.min(src.width, src.height);\n var cubefaceTextures = [];\n var imgTmp0;\n var imgTmp2;\n\n for (var i = 0; i < 6; i++) {\n var tempCanvas = document.createElement('CANVAS');\n tempCanvas.width = tempCanvas.height = cubeFaceSize;\n var tempCanvasContext = tempCanvas.getContext('2d');\n\n if (data.rotateCubemap) {\n if (i === 2 || i === 3) {\n tempCanvasContext.save();\n tempCanvasContext.translate(cubeFaceSize, cubeFaceSize);\n tempCanvasContext.rotate(Math.PI);\n }\n }\n\n // Note that this call to drawImage will not only copy the bytes to the\n // canvas but also could resized the image if our cube face size is\n // smaller than the source image due to GL max texture size.\n tempCanvasContext.drawImage(\n src,\n (i + faceOffset) * textureSourceCubeFaceSize, // top left x coord in source\n 0, // top left y coord in source\n textureSourceCubeFaceSize, // x pixel count from source\n textureSourceCubeFaceSize, // y pixel count from source\n 0, // dest x offset in the canvas\n 0, // dest y offset in the canvas\n cubeFaceSize, // x pixel count in dest\n cubeFaceSize // y pixel count in dest\n );\n\n tempCanvasContext.restore();\n\n if (callback) { callback(); }\n cubefaceTextures.push(tempCanvas);\n }\n\n if (data.rotateCubemap) {\n imgTmp0 = cubefaceTextures[0];\n imgTmp2 = cubefaceTextures[1];\n\n cubefaceTextures[0] = imgTmp2;\n cubefaceTextures[1] = imgTmp0;\n\n imgTmp0 = cubefaceTextures[4];\n imgTmp2 = cubefaceTextures[5];\n\n cubefaceTextures[4] = imgTmp2;\n cubefaceTextures[5] = imgTmp0;\n }\n\n if (callback) { callback(); }\n return cubefaceTextures;\n },\n\n loadCubeMapImage: function (layerColorTexture, src, faceOffset) {\n var gl = this.el.sceneEl.renderer.getContext();\n var cubefaceTextures;\n\n // dont flip the pixels as we load them into the texture buffer.\n // TEXTURE_CUBE_MAP expects the Y to be flipped for the faces and it already\n // is flipped in our texture image.\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, layerColorTexture);\n\n if (!src.complete || this.loadingScreen) {\n cubefaceTextures = this.loadingScreenImages;\n } else {\n cubefaceTextures = this.generateCubeMapTextures(src, faceOffset);\n }\n\n var errorCode = 0;\n cubefaceTextures.forEach(function (canvas, i) {\n gl.texSubImage2D(\n gl.TEXTURE_CUBE_MAP_POSITIVE_X + i,\n 0,\n 0, 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n canvas\n );\n errorCode = gl.getError();\n });\n\n if (errorCode !== 0) {\n console.log('renderingError, WebGL Error Code: ' + errorCode);\n }\n gl.bindTexture(gl.TEXTURE_CUBE_MAP, null);\n },\n\n tick: function () {\n if (!this.el.sceneEl.xrSession) { return; }\n if (!this.layer && this.el.sceneEl.is('vr-mode')) { this.initLayer(); }\n this.updateTransform();\n if (this.data.src.complete && (this.pendingCubeMapUpdate || this.loadingScreen || this.visibilityChanged)) { this.loadCubeMapImages(); }\n if (!this.needsRedraw && !this.layer.needsRedraw && !this.textureIsVideo) { return; }\n if (this.data.type === 'quad') { this.draw(); }\n this.needsRedraw = false;\n },\n\n initLayer: function () {\n var self = this;\n var type = this.data.type;\n\n this.el.sceneEl.xrSession.onvisibilitychange = function (evt) {\n self.visibilityChanged = evt.session.visibilityState !== 'hidden';\n };\n\n if (type === 'quad') {\n this.initQuadLayer();\n return;\n }\n\n if (type === 'monocubemap' || type === 'stereocubemap') {\n this.initCubeMapLayer();\n return;\n }\n },\n\n initQuadLayer: function () {\n var sceneEl = this.el.sceneEl;\n var gl = sceneEl.renderer.getContext();\n var xrGLFactory = this.xrGLFactory = new XRWebGLBinding(sceneEl.xrSession, gl);\n if (!this.texture) { return; }\n this.layer = xrGLFactory.createQuadLayer({\n space: this.referenceSpace,\n viewPixelHeight: 2048,\n viewPixelWidth: 2048,\n height: this.data.height / 2 || this.texture.image.height / 1000,\n width: this.data.width / 2 || this.texture.image.width / 1000\n });\n sceneEl.renderer.xr.addLayer(this.layer);\n },\n\n initCubeMapLayer: function () {\n var src = this.data.src;\n var sceneEl = this.el.sceneEl;\n var gl = sceneEl.renderer.getContext();\n var glSizeLimit = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n var cubeFaceSize = this.cubeFaceSize = Math.min(glSizeLimit, Math.min(src.width, src.height));\n var xrGLFactory = this.xrGLFactory = new XRWebGLBinding(sceneEl.xrSession, gl);\n this.layer = xrGLFactory.createCubeLayer({\n space: this.referenceSpace,\n viewPixelWidth: cubeFaceSize,\n viewPixelHeight: cubeFaceSize,\n layout: this.data.type === 'monocubemap' ? 'mono' : 'stereo',\n isStatic: false\n });\n\n this.initLoadingScreenImages();\n this.loadCubeMapImages();\n sceneEl.renderer.xr.addLayer(this.layer);\n },\n\n initLoadingScreenImages: function () {\n var cubeFaceSize = this.cubeFaceSize;\n var loadingScreenImages = this.loadingScreenImages = [];\n for (var i = 0; i < 6; i++) {\n var tempCanvas = document.createElement('CANVAS');\n tempCanvas.width = tempCanvas.height = cubeFaceSize;\n var tempCanvasContext = tempCanvas.getContext('2d');\n tempCanvas.width = tempCanvas.height = cubeFaceSize;\n tempCanvasContext.fillStyle = 'black';\n tempCanvasContext.fillRect(0, 0, cubeFaceSize, cubeFaceSize);\n if (i !== 2 && i !== 3) {\n tempCanvasContext.translate(cubeFaceSize, 0);\n tempCanvasContext.scale(-1, 1);\n tempCanvasContext.fillStyle = 'white';\n tempCanvasContext.font = '30px Arial';\n tempCanvasContext.fillText('Loading', cubeFaceSize / 2, cubeFaceSize / 2);\n }\n loadingScreenImages.push(tempCanvas);\n }\n },\n\n destroyLayer: function () {\n if (!this.layer) { return; }\n this.el.sceneEl.renderer.xr.removeLayer(this.layer);\n this.layer.destroy();\n this.layer = undefined;\n },\n\n toggleCompositorLayer: function () {\n this.enableCompositorLayer(!this.layerEnabled);\n },\n\n enableCompositorLayer: function (enable) {\n this.layerEnabled = enable;\n this.quadPanelEl.object3D.visible = !this.layerEnabled;\n },\n\n updateQuadPanel: function () {\n var quadPanelEl = this.quadPanelEl;\n if (!this.quadPanelEl) {\n quadPanelEl = this.quadPanelEl = document.createElement('a-entity');\n this.el.appendChild(quadPanelEl);\n }\n\n quadPanelEl.setAttribute('material', {\n shader: 'flat',\n src: this.data.src,\n transparent: true\n });\n\n quadPanelEl.setAttribute('geometry', {\n primitive: 'plane',\n height: this.data.height || this.texture.image.height / 1000,\n width: this.data.width || this.texture.image.height / 1000\n });\n },\n\n draw: function () {\n var sceneEl = this.el.sceneEl;\n var gl = this.el.sceneEl.renderer.getContext();\n var glayer = this.xrGLFactory.getSubImage(this.layer, sceneEl.frame);\n var texture = sceneEl.renderer.properties.get(this.texture).__webglTexture;\n var previousFrameBuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);\n\n gl.viewport(glayer.viewport.x, glayer.viewport.y, glayer.viewport.width, glayer.viewport.height);\n gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);\n gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, glayer.colorTexture, 0);\n\n blitTexture(gl, texture, glayer, this.data.src);\n\n gl.bindFramebuffer(gl.FRAMEBUFFER, previousFrameBuffer);\n },\n\n updateTransform: function () {\n var el = this.el;\n var position = this.position;\n var quaternion = this.quaternion;\n el.object3D.updateMatrixWorld();\n position.setFromMatrixPosition(el.object3D.matrixWorld);\n quaternion.setFromRotationMatrix(el.object3D.matrixWorld);\n if (!this.layerEnabled) { position.set(0, 0, 100000000); }\n this.layer.transform = new XRRigidTransform(position, quaternion);\n },\n\n onEnterVR: function () {\n var sceneEl = this.el.sceneEl;\n var xrSession = sceneEl.xrSession;\n if (!sceneEl.hasWebXR || !XRWebGLBinding || !xrSession) {\n warn('The layer component requires WebXR and the layers API enabled');\n return;\n }\n xrSession.requestReferenceSpace('local').then(this.onRequestedReferenceSpace);\n this.needsRedraw = true;\n this.layerEnabled = true;\n if (this.quadPanelEl) {\n this.quadPanelEl.object3D.visible = false;\n }\n if (this.data.src.play) { this.data.src.play(); }\n },\n\n onExitVR: function () {\n if (this.quadPanelEl) {\n this.quadPanelEl.object3D.visible = true;\n }\n this.destroyLayer();\n },\n\n onRequestedReferenceSpace: function (referenceSpace) {\n this.referenceSpace = referenceSpace;\n }\n});\n\nfunction blitTexture (gl, texture, subImage, textureEl) {\n var xrReadFramebuffer = gl.createFramebuffer();\n let x1offset = subImage.viewport.x;\n let y1offset = subImage.viewport.y;\n let x2offset = subImage.viewport.x + subImage.viewport.width;\n let y2offset = subImage.viewport.y + subImage.viewport.height;\n\n // Update video texture.\n if (textureEl.tagName === 'VIDEO') {\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, textureEl.width, textureEl.height, gl.RGB, gl.UNSIGNED_BYTE, textureEl);\n }\n\n // Bind texture to read framebuffer.\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, xrReadFramebuffer);\n gl.framebufferTexture2D(gl.READ_FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);\n\n // Blit into layer buffer.\n gl.readBuffer(gl.COLOR_ATTACHMENT0);\n gl.blitFramebuffer(0, 0, textureEl.width, textureEl.height, x1offset, y1offset, x2offset, y2offset, gl.COLOR_BUFFER_BIT, gl.NEAREST);\n\n gl.bindFramebuffer(gl.READ_FRAMEBUFFER, null);\n gl.deleteFramebuffer(xrReadFramebuffer);\n}\n",
  326. "var bind = require('../utils/bind');\nvar utils = require('../utils');\nvar diff = utils.diff;\nvar debug = require('../utils/debug');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\nvar warn = debug('components:light:warn');\nvar CubeLoader = new THREE.CubeTextureLoader();\n\nvar probeCache = {};\n\n/**\n * Light component.\n */\nmodule.exports.Component = registerComponent('light', {\n schema: {\n angle: {default: 60, if: {type: ['spot']}},\n color: {type: 'color', if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot']}},\n envMap: {default: '', if: {type: ['probe']}},\n groundColor: {type: 'color', if: {type: ['hemisphere']}},\n decay: {default: 1, if: {type: ['point', 'spot']}},\n distance: {default: 0.0, min: 0, if: {type: ['point', 'spot']}},\n intensity: {default: 1.0, min: 0, if: {type: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe']}},\n penumbra: {default: 0, min: 0, max: 1, if: {type: ['spot']}},\n type: {\n default: 'directional',\n oneOf: ['ambient', 'directional', 'hemisphere', 'point', 'spot', 'probe'],\n schemaChange: true\n },\n target: {type: 'selector', if: {type: ['spot', 'directional']}},\n\n // Shadows.\n castShadow: {default: false, if: {type: ['point', 'spot', 'directional']}},\n shadowBias: {default: 0, if: {castShadow: true}},\n shadowCameraFar: {default: 500, if: {castShadow: true}},\n shadowCameraFov: {default: 90, if: {castShadow: true}},\n shadowCameraNear: {default: 0.5, if: {castShadow: true}},\n shadowCameraTop: {default: 5, if: {castShadow: true}},\n shadowCameraRight: {default: 5, if: {castShadow: true}},\n shadowCameraBottom: {default: -5, if: {castShadow: true}},\n shadowCameraLeft: {default: -5, if: {castShadow: true}},\n shadowCameraVisible: {default: false, if: {castShadow: true}},\n shadowMapHeight: {default: 512, if: {castShadow: true}},\n shadowMapWidth: {default: 512, if: {castShadow: true}},\n shadowRadius: {default: 1, if: {castShadow: true}}\n },\n\n /**\n * Notifies scene a light has been added to remove default lighting.\n */\n init: function () {\n var el = this.el;\n this.light = null;\n this.defaultTarget = null;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.system.registerLight(el);\n },\n\n /**\n * (Re)create or update light.\n */\n update: function (oldData) {\n var data = this.data;\n var diffData = diff(data, oldData);\n var light = this.light;\n var rendererSystem = this.rendererSystem;\n var self = this;\n\n // Existing light.\n if (light && !('type' in diffData)) {\n var shadowsLoaded = false;\n // Light type has not changed. Update light.\n Object.keys(diffData).forEach(function (key) {\n var value = data[key];\n\n switch (key) {\n case 'color': {\n light.color.set(value);\n rendererSystem.applyColorCorrection(light.color);\n break;\n }\n\n case 'groundColor': {\n light.groundColor.set(value);\n rendererSystem.applyColorCorrection(light.groundColor);\n break;\n }\n\n case 'angle': {\n light.angle = degToRad(value);\n break;\n }\n\n case 'target': {\n // Reset target if selector is null.\n if (value === null) {\n if (data.type === 'spot' || data.type === 'directional') {\n light.target = self.defaultTarget;\n }\n } else {\n // Target specified, set target to entity's `object3D` when it is loaded.\n if (value.hasLoaded) {\n self.onSetTarget(value, light);\n } else {\n value.addEventListener('loaded', bind(self.onSetTarget, self, value, light));\n }\n }\n break;\n }\n\n case 'envMap':\n this.updateProbeMap(data, light);\n break;\n\n case 'castShadow':\n case 'shadowBias':\n case 'shadowCameraFar':\n case 'shadowCameraFov':\n case 'shadowCameraNear':\n case 'shadowCameraTop':\n case 'shadowCameraRight':\n case 'shadowCameraBottom':\n case 'shadowCameraLeft':\n case 'shadowCameraVisible':\n case 'shadowMapHeight':\n case 'shadowMapWidth':\n case 'shadowRadius':\n if (!shadowsLoaded) {\n self.updateShadow();\n shadowsLoaded = true;\n }\n break;\n\n default: {\n light[key] = value;\n }\n }\n });\n return;\n }\n\n // No light yet or light type has changed. Create and add light.\n this.setLight(this.data);\n this.updateShadow();\n },\n\n setLight: function (data) {\n var el = this.el;\n var newLight = this.getLight(data);\n if (newLight) {\n if (this.light) {\n el.removeObject3D('light');\n }\n\n this.light = newLight;\n this.light.el = el;\n el.setObject3D('light', this.light);\n\n // HACK solution for issue #1624\n if (data.type === 'spot' || data.type === 'directional' || data.type === 'hemisphere') {\n el.getObject3D('light').translateY(-1);\n }\n\n // set and position default lighttarget as a child to enable spotlight orientation\n if (data.type === 'spot') {\n el.setObject3D('light-target', this.defaultTarget);\n el.getObject3D('light-target').position.set(0, 0, -1);\n }\n }\n },\n\n /**\n * Updates shadow-related properties on the current light.\n */\n updateShadow: function () {\n var el = this.el;\n var data = this.data;\n var light = this.light;\n\n light.castShadow = data.castShadow;\n\n // Shadow camera helper.\n var cameraHelper = el.getObject3D('cameraHelper');\n if (data.shadowCameraVisible && !cameraHelper) {\n el.setObject3D('cameraHelper', new THREE.CameraHelper(light.shadow.camera));\n } else if (!data.shadowCameraVisible && cameraHelper) {\n el.removeObject3D('cameraHelper');\n }\n\n if (!data.castShadow) { return light; }\n\n // Shadow appearance.\n light.shadow.bias = data.shadowBias;\n light.shadow.radius = data.shadowRadius;\n light.shadow.mapSize.height = data.shadowMapHeight;\n light.shadow.mapSize.width = data.shadowMapWidth;\n\n // Shadow camera.\n light.shadow.camera.near = data.shadowCameraNear;\n light.shadow.camera.far = data.shadowCameraFar;\n if (light.shadow.camera instanceof THREE.OrthographicCamera) {\n light.shadow.camera.top = data.shadowCameraTop;\n light.shadow.camera.right = data.shadowCameraRight;\n light.shadow.camera.bottom = data.shadowCameraBottom;\n light.shadow.camera.left = data.shadowCameraLeft;\n } else {\n light.shadow.camera.fov = data.shadowCameraFov;\n }\n light.shadow.camera.updateProjectionMatrix();\n\n if (cameraHelper) { cameraHelper.update(); }\n },\n\n /**\n * Creates a new three.js light object given data object defining the light.\n *\n * @param {object} data\n */\n getLight: function (data) {\n var angle = data.angle;\n var color = new THREE.Color(data.color);\n this.rendererSystem.applyColorCorrection(color);\n color = color.getHex();\n var decay = data.decay;\n var distance = data.distance;\n var groundColor = new THREE.Color(data.groundColor);\n this.rendererSystem.applyColorCorrection(groundColor);\n groundColor = groundColor.getHex();\n var intensity = data.intensity;\n var type = data.type;\n var target = data.target;\n var light = null;\n\n switch (type.toLowerCase()) {\n case 'ambient': {\n return new THREE.AmbientLight(color, intensity);\n }\n\n case 'directional': {\n light = new THREE.DirectionalLight(color, intensity);\n this.defaultTarget = light.target;\n if (target) {\n if (target.hasLoaded) {\n this.onSetTarget(target, light);\n } else {\n target.addEventListener('loaded', bind(this.onSetTarget, this, target, light));\n }\n }\n return light;\n }\n\n case 'hemisphere': {\n return new THREE.HemisphereLight(color, groundColor, intensity);\n }\n\n case 'point': {\n return new THREE.PointLight(color, intensity, distance, decay);\n }\n\n case 'spot': {\n light = new THREE.SpotLight(color, intensity, distance, degToRad(angle), data.penumbra, decay);\n this.defaultTarget = light.target;\n if (target) {\n if (target.hasLoaded) {\n this.onSetTarget(target, light);\n } else {\n target.addEventListener('loaded', bind(this.onSetTarget, this, target, light));\n }\n }\n return light;\n }\n\n case 'probe': {\n light = new THREE.LightProbe();\n this.updateProbeMap(data, light);\n return light;\n }\n\n default: {\n warn('%s is not a valid light type. ' +\n 'Choose from ambient, directional, hemisphere, point, spot.', type);\n }\n }\n },\n\n /**\n * Generate the spherical harmonics for the LightProbe from a cube map\n */\n updateProbeMap: function (data, light) {\n if (!data.envMap) {\n // reset parameters if no map\n light.copy(new THREE.LightProbe());\n }\n\n if (probeCache[data.envMap] instanceof window.Promise) {\n probeCache[data.envMap].then(function (tempLightProbe) {\n light.copy(tempLightProbe);\n });\n }\n if (probeCache[data.envMap] instanceof THREE.LightProbe) {\n light.copy(probeCache[data.envMap]);\n }\n probeCache[data.envMap] = new window.Promise(function (resolve) {\n utils.srcLoader.validateCubemapSrc(data.envMap, function loadEnvMap (urls) {\n CubeLoader.load(urls, function (cube) {\n var tempLightProbe = THREE.LightProbeGenerator.fromCubeTexture(cube);\n probeCache[data.envMap] = tempLightProbe;\n light.copy(tempLightProbe);\n });\n });\n });\n },\n\n onSetTarget: function (targetEl, light) {\n light.target = targetEl.object3D;\n },\n\n /**\n * Remove light on remove (callback).\n */\n remove: function () {\n var el = this.el;\n el.removeObject3D('light');\n if (el.getObject3D('cameraHelper')) {\n el.removeObject3D('cameraHelper');\n }\n }\n});\n",
  327. "/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\n\nmodule.exports.Component = registerComponent('line', {\n schema: {\n start: {type: 'vec3', default: {x: 0, y: 0, z: 0}},\n end: {type: 'vec3', default: {x: 0, y: 0, z: 0}},\n color: {type: 'color', default: '#74BEC1'},\n opacity: {type: 'number', default: 1},\n visible: {default: true}\n },\n\n multiple: true,\n\n init: function () {\n var data = this.data;\n var geometry;\n var material;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n material = this.material = new THREE.LineBasicMaterial({\n color: data.color,\n opacity: data.opacity,\n transparent: data.opacity < 1,\n visible: data.visible\n });\n geometry = this.geometry = new THREE.BufferGeometry();\n geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(2 * 3), 3));\n\n this.rendererSystem.applyColorCorrection(material.color);\n this.line = new THREE.Line(geometry, material);\n this.el.setObject3D(this.attrName, this.line);\n },\n\n update: function (oldData) {\n var data = this.data;\n var geometry = this.geometry;\n var geoNeedsUpdate = false;\n var material = this.material;\n var positionArray = geometry.attributes.position.array;\n\n // Update geometry.\n if (!isEqualVec3(data.start, oldData.start)) {\n positionArray[0] = data.start.x;\n positionArray[1] = data.start.y;\n positionArray[2] = data.start.z;\n geoNeedsUpdate = true;\n }\n\n if (!isEqualVec3(data.end, oldData.end)) {\n positionArray[3] = data.end.x;\n positionArray[4] = data.end.y;\n positionArray[5] = data.end.z;\n geoNeedsUpdate = true;\n }\n\n if (geoNeedsUpdate) {\n geometry.attributes.position.needsUpdate = true;\n geometry.computeBoundingSphere();\n }\n\n material.color.setStyle(data.color);\n this.rendererSystem.applyColorCorrection(material.color);\n material.opacity = data.opacity;\n material.transparent = data.opacity < 1;\n material.visible = data.visible;\n },\n\n remove: function () {\n this.el.removeObject3D('line', this.line);\n }\n});\n\nfunction isEqualVec3 (a, b) {\n if (!a || !b) { return false; }\n return (a.x === b.x && a.y === b.y && a.z === b.z);\n}\n",
  328. "var registerComponent = require('../core/component').registerComponent;\nvar registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\n\n/**\n * Link component. Connect experiences and traverse between them in VR\n *\n * @member {object} hiddenEls - Store the hidden elements during peek mode.\n */\nmodule.exports.Component = registerComponent('link', {\n schema: {\n backgroundColor: {default: 'red', type: 'color'},\n borderColor: {default: 'white', type: 'color'},\n highlighted: {default: false},\n highlightedColor: {default: '#24CAFF', type: 'color'},\n href: {default: ''},\n image: {type: 'asset'},\n on: {default: 'click'},\n peekMode: {default: false},\n title: {default: ''},\n titleColor: {default: 'white', type: 'color'},\n visualAspectEnabled: {default: false}\n },\n\n init: function () {\n this.navigate = this.navigate.bind(this);\n this.previousQuaternion = undefined;\n this.quaternionClone = new THREE.Quaternion();\n // Store hidden elements during peek mode so we can show them again later.\n this.hiddenEls = [];\n },\n\n update: function (oldData) {\n var data = this.data;\n var el = this.el;\n var backgroundColor;\n var strokeColor;\n\n if (!data.visualAspectEnabled) { return; }\n\n this.initVisualAspect();\n\n backgroundColor = data.highlighted ? data.highlightedColor : data.backgroundColor;\n strokeColor = data.highlighted ? data.highlightedColor : data.borderColor;\n el.setAttribute('material', 'backgroundColor', backgroundColor);\n el.setAttribute('material', 'strokeColor', strokeColor);\n\n if (data.on !== oldData.on) { this.updateEventListener(); }\n\n if (oldData.peekMode !== undefined &&\n data.peekMode !== oldData.peekMode) { this.updatePeekMode(); }\n\n if (!data.image || oldData.image === data.image) { return; }\n\n el.setAttribute('material', 'pano',\n typeof data.image === 'string' ? data.image : data.image.src);\n },\n\n /*\n * Toggle all elements and full 360 preview of the linked page.\n */\n updatePeekMode: function () {\n var el = this.el;\n var sphereEl = this.sphereEl;\n if (this.data.peekMode) {\n this.hideAll();\n el.getObject3D('mesh').visible = false;\n sphereEl.setAttribute('visible', true);\n } else {\n this.showAll();\n el.getObject3D('mesh').visible = true;\n sphereEl.setAttribute('visible', false);\n }\n },\n\n play: function () {\n this.updateEventListener();\n },\n\n pause: function () {\n this.removeEventListener();\n },\n\n updateEventListener: function () {\n var el = this.el;\n if (!el.isPlaying) { return; }\n this.removeEventListener();\n el.addEventListener(this.data.on, this.navigate);\n },\n\n removeEventListener: function () {\n var on = this.data.on;\n if (!on) { return; }\n this.el.removeEventListener(on, this.navigate);\n },\n\n initVisualAspect: function () {\n var el = this.el;\n var semiSphereEl;\n var sphereEl;\n var textEl;\n\n if (!this.data.visualAspectEnabled || this.visualAspectInitialized) { return; }\n\n textEl = this.textEl = this.textEl || document.createElement('a-entity');\n sphereEl = this.sphereEl = this.sphereEl || document.createElement('a-entity');\n semiSphereEl = this.semiSphereEl = this.semiSphereEl || document.createElement('a-entity');\n\n // Set portal.\n el.setAttribute('geometry', {primitive: 'circle', radius: 1.0, segments: 64});\n el.setAttribute('material', {shader: 'portal', pano: this.data.image, side: 'double'});\n\n // Set text that displays the link title and URL.\n textEl.setAttribute('text', {\n color: this.data.titleColor,\n align: 'center',\n font: 'kelsonsans',\n value: this.data.title || this.data.href,\n width: 4\n });\n textEl.setAttribute('position', '0 1.5 0');\n el.appendChild(textEl);\n\n // Set sphere rendered when camera is close to portal to allow user to peek inside.\n semiSphereEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 1.0,\n phiStart: 0,\n segmentsWidth: 64,\n segmentsHeight: 64,\n phiLength: 180,\n thetaStart: 0,\n thetaLength: 360\n });\n semiSphereEl.setAttribute('material', {\n shader: 'portal',\n borderEnabled: 0.0,\n pano: this.data.image,\n side: 'back'\n });\n semiSphereEl.setAttribute('rotation', '0 180 0');\n semiSphereEl.setAttribute('position', '0 0 0');\n semiSphereEl.setAttribute('visible', false);\n el.appendChild(semiSphereEl);\n\n // Set sphere rendered when camera is close to portal to allow user to peek inside.\n sphereEl.setAttribute('geometry', {\n primitive: 'sphere',\n radius: 10,\n segmentsWidth: 64,\n segmentsHeight: 64\n });\n sphereEl.setAttribute('material', {\n shader: 'portal',\n borderEnabled: 0.0,\n pano: this.data.image,\n side: 'back'\n });\n sphereEl.setAttribute('visible', false);\n el.appendChild(sphereEl);\n\n this.visualAspectInitialized = true;\n },\n\n navigate: function () {\n window.location = this.data.href;\n },\n\n /**\n * 1. Swap plane that represents portal with sphere with a hole when the camera is close\n * so user can peek inside portal. Sphere is rendered on oposite side of portal\n * from where user enters.\n * 2. Place the url/title above or inside portal depending on distance to camera.\n * 3. Face portal to camera when far away from user.\n */\n tick: (function () {\n var cameraWorldPosition = new THREE.Vector3();\n var elWorldPosition = new THREE.Vector3();\n var quaternion = new THREE.Quaternion();\n var scale = new THREE.Vector3();\n\n return function () {\n var el = this.el;\n var object3D = el.object3D;\n var camera = el.sceneEl.camera;\n var cameraPortalOrientation;\n var distance;\n var textEl = this.textEl;\n\n if (!this.data.visualAspectEnabled) { return; }\n\n // Update matrices\n object3D.updateMatrixWorld();\n camera.parent.updateMatrixWorld();\n camera.updateMatrixWorld();\n\n object3D.matrix.decompose(elWorldPosition, quaternion, scale);\n elWorldPosition.setFromMatrixPosition(object3D.matrixWorld);\n cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld);\n distance = elWorldPosition.distanceTo(cameraWorldPosition);\n\n if (distance > 20) {\n // Store original orientation to be restored when the portal stops facing the camera.\n if (!this.previousQuaternion) {\n this.quaternionClone.copy(quaternion);\n this.previousQuaternion = this.quaternionClone;\n }\n // If the portal is far away from the user, face portal to camera.\n object3D.lookAt(cameraWorldPosition);\n } else {\n // When portal is close to the user/camera.\n cameraPortalOrientation = this.calculateCameraPortalOrientation();\n // If user gets very close to portal, replace with holed sphere they can peek in.\n if (distance < 0.5) {\n // Configure text size and sphere orientation depending side user approaches portal.\n if (this.semiSphereEl.getAttribute('visible') === true) { return; }\n textEl.setAttribute('text', 'width', 1.5);\n if (cameraPortalOrientation <= 0.0) {\n textEl.setAttribute('position', '0 0 0.75');\n textEl.setAttribute('rotation', '0 180 0');\n this.semiSphereEl.setAttribute('rotation', '0 0 0');\n } else {\n textEl.setAttribute('position', '0 0 -0.75');\n textEl.setAttribute('rotation', '0 0 0');\n this.semiSphereEl.setAttribute('rotation', '0 180 0');\n }\n el.getObject3D('mesh').visible = false;\n this.semiSphereEl.setAttribute('visible', true);\n this.peekCameraPortalOrientation = cameraPortalOrientation;\n } else {\n // Calculate wich side the camera is approaching the camera (back / front).\n // Adjust text orientation based on camera position.\n if (cameraPortalOrientation <= 0.0) {\n textEl.setAttribute('rotation', '0 180 0');\n } else {\n textEl.setAttribute('rotation', '0 0 0');\n }\n textEl.setAttribute('text', 'width', 5);\n textEl.setAttribute('position', '0 1.5 0');\n el.getObject3D('mesh').visible = true;\n this.semiSphereEl.setAttribute('visible', false);\n this.peekCameraPortalOrientation = undefined;\n }\n if (this.previousQuaternion) {\n object3D.quaternion.copy(this.previousQuaternion);\n this.previousQuaternion = undefined;\n }\n }\n };\n })(),\n\n hideAll: function () {\n var el = this.el;\n var hiddenEls = this.hiddenEls;\n var self = this;\n if (hiddenEls.length > 0) { return; }\n el.sceneEl.object3D.traverse(function (object) {\n if (object && object.el && object.el.hasAttribute('link-controls')) { return; }\n if (!object.el || object === el.sceneEl.object3D || object.el === el ||\n object.el === self.sphereEl || object.el === el.sceneEl.cameraEl ||\n object.el.getAttribute('visible') === false || object.el === self.textEl ||\n object.el === self.semiSphereEl) {\n return;\n }\n object.el.setAttribute('visible', false);\n hiddenEls.push(object.el);\n });\n },\n\n showAll: function () {\n this.hiddenEls.forEach(function (el) { el.setAttribute('visible', true); });\n this.hiddenEls = [];\n },\n\n /**\n * Calculate whether the camera faces the front or back face of the portal.\n * @returns {number} > 0 if camera faces front of portal, < 0 if it faces back of portal.\n */\n calculateCameraPortalOrientation: (function () {\n var mat4 = new THREE.Matrix4();\n var cameraPosition = new THREE.Vector3();\n var portalNormal = new THREE.Vector3(0, 0, 1);\n var portalPosition = new THREE.Vector3(0, 0, 0);\n\n return function () {\n var el = this.el;\n var camera = el.sceneEl.camera;\n\n // Reset tmp variables.\n cameraPosition.set(0, 0, 0);\n portalNormal.set(0, 0, 1);\n portalPosition.set(0, 0, 0);\n\n // Apply portal orientation to the normal.\n el.object3D.matrixWorld.extractRotation(mat4);\n portalNormal.applyMatrix4(mat4);\n\n // Calculate portal world position.\n el.object3D.updateMatrixWorld();\n el.object3D.localToWorld(portalPosition);\n\n // Calculate camera world position.\n camera.parent.parent.updateMatrixWorld();\n camera.parent.updateMatrixWorld();\n camera.updateMatrixWorld();\n camera.localToWorld(cameraPosition);\n\n // Calculate vector from portal to camera.\n // (portal) -------> (camera)\n cameraPosition.sub(portalPosition).normalize();\n portalNormal.normalize();\n\n // Side where camera approaches portal is given by sign of dot product of portal normal\n // and portal to camera vectors.\n return Math.sign(portalNormal.dot(cameraPosition));\n };\n })(),\n\n remove: function () {\n this.removeEventListener();\n }\n});\n\n/* eslint-disable */\nregisterShader('portal', {\n schema: {\n borderEnabled: {default: 1.0, type: 'int', is: 'uniform'},\n backgroundColor: {default: 'red', type: 'color', is: 'uniform'},\n pano: {type: 'map', is: 'uniform'},\n strokeColor: {default: 'white', type: 'color', is: 'uniform'}\n },\n\n vertexShader: [\n 'vec3 portalPosition;',\n 'varying vec3 vWorldPosition;',\n 'varying float vDistanceToCenter;',\n 'varying float vDistance;',\n 'void main() {',\n 'vDistanceToCenter = clamp(length(position - vec3(0.0, 0.0, 0.0)), 0.0, 1.0);',\n 'portalPosition = (modelMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;',\n 'vDistance = length(portalPosition - cameraPosition);',\n 'vWorldPosition = (modelMatrix * vec4(position, 1.0)).xyz;',\n 'gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n '}'\n ].join('\\n'),\n\n fragmentShader: [\n '#define RECIPROCAL_PI2 0.15915494',\n 'uniform sampler2D pano;',\n 'uniform vec3 strokeColor;',\n 'uniform vec3 backgroundColor;',\n 'uniform float borderEnabled;',\n 'varying float vDistanceToCenter;',\n 'varying float vDistance;',\n 'varying vec3 vWorldPosition;',\n 'void main() {',\n 'vec3 direction = normalize(vWorldPosition - cameraPosition);',\n 'vec2 sampleUV;',\n 'float borderThickness = clamp(exp(-vDistance / 50.0), 0.6, 0.95);',\n 'sampleUV.y = clamp(direction.y * 0.5 + 0.5, 0.0, 1.0);',\n 'sampleUV.x = atan(direction.z, -direction.x) * -RECIPROCAL_PI2 + 0.5;',\n 'if (vDistanceToCenter > borderThickness && borderEnabled == 1.0) {',\n 'gl_FragColor = vec4(strokeColor, 1.0);',\n '} else {',\n 'gl_FragColor = mix(texture2D(pano, sampleUV), vec4(backgroundColor, 1.0), clamp(pow((vDistance / 15.0), 2.0), 0.0, 1.0));',\n '}',\n '}'\n ].join('\\n')\n});\n/* eslint-enable */\n",
  329. "/* global DeviceOrientationEvent */\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\nvar bind = utils.bind;\n\n// To avoid recalculation at every mouse movement tick\nvar PI_2 = Math.PI / 2;\n\n/**\n * look-controls. Update entity pose, factoring mouse, touch, and WebVR API data.\n */\nmodule.exports.Component = registerComponent('look-controls', {\n dependencies: ['position', 'rotation'],\n\n schema: {\n enabled: {default: true},\n magicWindowTrackingEnabled: {default: true},\n pointerLockEnabled: {default: false},\n reverseMouseDrag: {default: false},\n reverseTouchDrag: {default: false},\n touchEnabled: {default: true},\n mouseEnabled: {default: true}\n },\n\n init: function () {\n this.deltaYaw = 0;\n this.previousHMDPosition = new THREE.Vector3();\n this.hmdQuaternion = new THREE.Quaternion();\n this.magicWindowAbsoluteEuler = new THREE.Euler();\n this.magicWindowDeltaEuler = new THREE.Euler();\n this.position = new THREE.Vector3();\n this.magicWindowObject = new THREE.Object3D();\n this.rotation = {};\n this.deltaRotation = {};\n this.savedPose = null;\n this.pointerLocked = false;\n this.setupMouseControls();\n this.bindMethods();\n this.previousMouseEvent = {};\n\n this.setupMagicWindowControls();\n\n // To save / restore camera pose\n this.savedPose = {\n position: new THREE.Vector3(),\n rotation: new THREE.Euler()\n };\n\n // Call enter VR handler if the scene has entered VR before the event listeners attached.\n if (this.el.sceneEl.is('vr-mode') || this.el.sceneEl.is('ar-mode')) { this.onEnterVR(); }\n },\n\n setupMagicWindowControls: function () {\n var magicWindowControls;\n var data = this.data;\n\n // Only on mobile devices and only enabled if DeviceOrientation permission has been granted.\n if (utils.device.isMobile() || utils.device.isMobileDeviceRequestingDesktopSite()) {\n magicWindowControls = this.magicWindowControls = new THREE.DeviceOrientationControls(this.magicWindowObject);\n if (typeof DeviceOrientationEvent !== 'undefined' && DeviceOrientationEvent.requestPermission) {\n magicWindowControls.enabled = false;\n if (this.el.sceneEl.components['device-orientation-permission-ui'].permissionGranted) {\n magicWindowControls.enabled = data.magicWindowTrackingEnabled;\n } else {\n this.el.sceneEl.addEventListener('deviceorientationpermissiongranted', function () {\n magicWindowControls.enabled = data.magicWindowTrackingEnabled;\n });\n }\n }\n }\n },\n\n update: function (oldData) {\n var data = this.data;\n\n // Disable grab cursor classes if no longer enabled.\n if (data.enabled !== oldData.enabled) {\n this.updateGrabCursor(data.enabled);\n }\n\n // Reset magic window eulers if tracking is disabled.\n if (oldData && !data.magicWindowTrackingEnabled && oldData.magicWindowTrackingEnabled) {\n this.magicWindowAbsoluteEuler.set(0, 0, 0);\n this.magicWindowDeltaEuler.set(0, 0, 0);\n }\n\n // Pass on magic window tracking setting to magicWindowControls.\n if (this.magicWindowControls) {\n this.magicWindowControls.enabled = data.magicWindowTrackingEnabled;\n }\n\n if (oldData && !data.pointerLockEnabled !== oldData.pointerLockEnabled) {\n this.removeEventListeners();\n this.addEventListeners();\n if (this.pointerLocked) { this.exitPointerLock(); }\n }\n },\n\n tick: function (t) {\n var data = this.data;\n if (!data.enabled) { return; }\n this.updateOrientation();\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n if (this.pointerLocked) { this.exitPointerLock(); }\n },\n\n remove: function () {\n this.removeEventListeners();\n if (this.pointerLocked) { this.exitPointerLock(); }\n },\n\n bindMethods: function () {\n this.onMouseDown = bind(this.onMouseDown, this);\n this.onMouseMove = bind(this.onMouseMove, this);\n this.onMouseUp = bind(this.onMouseUp, this);\n this.onTouchStart = bind(this.onTouchStart, this);\n this.onTouchMove = bind(this.onTouchMove, this);\n this.onTouchEnd = bind(this.onTouchEnd, this);\n this.onEnterVR = bind(this.onEnterVR, this);\n this.onExitVR = bind(this.onExitVR, this);\n this.onPointerLockChange = bind(this.onPointerLockChange, this);\n this.onPointerLockError = bind(this.onPointerLockError, this);\n },\n\n /**\n * Set up states and Object3Ds needed to store rotation data.\n */\n setupMouseControls: function () {\n this.mouseDown = false;\n this.pitchObject = new THREE.Object3D();\n this.yawObject = new THREE.Object3D();\n this.yawObject.position.y = 10;\n this.yawObject.add(this.pitchObject);\n },\n\n /**\n * Add mouse and touch event listeners to canvas.\n */\n addEventListeners: function () {\n var sceneEl = this.el.sceneEl;\n var canvasEl = sceneEl.canvas;\n\n // Wait for canvas to load.\n if (!canvasEl) {\n sceneEl.addEventListener('render-target-loaded', bind(this.addEventListeners, this));\n return;\n }\n\n // Mouse events.\n canvasEl.addEventListener('mousedown', this.onMouseDown, false);\n window.addEventListener('mousemove', this.onMouseMove, false);\n window.addEventListener('mouseup', this.onMouseUp, false);\n\n // Touch events.\n canvasEl.addEventListener('touchstart', this.onTouchStart);\n window.addEventListener('touchmove', this.onTouchMove);\n window.addEventListener('touchend', this.onTouchEnd);\n\n // sceneEl events.\n sceneEl.addEventListener('enter-vr', this.onEnterVR);\n sceneEl.addEventListener('exit-vr', this.onExitVR);\n\n // Pointer Lock events.\n if (this.data.pointerLockEnabled) {\n document.addEventListener('pointerlockchange', this.onPointerLockChange, false);\n document.addEventListener('mozpointerlockchange', this.onPointerLockChange, false);\n document.addEventListener('pointerlockerror', this.onPointerLockError, false);\n }\n },\n\n /**\n * Remove mouse and touch event listeners from canvas.\n */\n removeEventListeners: function () {\n var sceneEl = this.el.sceneEl;\n var canvasEl = sceneEl && sceneEl.canvas;\n\n if (!canvasEl) { return; }\n\n // Mouse events.\n canvasEl.removeEventListener('mousedown', this.onMouseDown);\n window.removeEventListener('mousemove', this.onMouseMove);\n window.removeEventListener('mouseup', this.onMouseUp);\n\n // Touch events.\n canvasEl.removeEventListener('touchstart', this.onTouchStart);\n window.removeEventListener('touchmove', this.onTouchMove);\n window.removeEventListener('touchend', this.onTouchEnd);\n\n // sceneEl events.\n sceneEl.removeEventListener('enter-vr', this.onEnterVR);\n sceneEl.removeEventListener('exit-vr', this.onExitVR);\n\n // Pointer Lock events.\n document.removeEventListener('pointerlockchange', this.onPointerLockChange, false);\n document.removeEventListener('mozpointerlockchange', this.onPointerLockChange, false);\n document.removeEventListener('pointerlockerror', this.onPointerLockError, false);\n },\n\n /**\n * Update orientation for mobile, mouse drag, and headset.\n * Mouse-drag only enabled if HMD is not active.\n */\n updateOrientation: function () {\n var object3D = this.el.object3D;\n var pitchObject = this.pitchObject;\n var yawObject = this.yawObject;\n var sceneEl = this.el.sceneEl;\n\n // In VR or AR mode, THREE is in charge of updating the camera pose.\n if ((sceneEl.is('vr-mode') || sceneEl.is('ar-mode')) && sceneEl.checkHeadsetConnected()) {\n // With WebXR THREE applies headset pose to the object3D internally.\n return;\n }\n\n this.updateMagicWindowOrientation();\n\n // On mobile, do camera rotation with touch events and sensors.\n object3D.rotation.x = this.magicWindowDeltaEuler.x + pitchObject.rotation.x;\n object3D.rotation.y = this.magicWindowDeltaEuler.y + yawObject.rotation.y;\n object3D.rotation.z = this.magicWindowDeltaEuler.z;\n },\n\n updateMagicWindowOrientation: function () {\n var magicWindowAbsoluteEuler = this.magicWindowAbsoluteEuler;\n var magicWindowDeltaEuler = this.magicWindowDeltaEuler;\n // Calculate magic window HMD quaternion.\n if (this.magicWindowControls && this.magicWindowControls.enabled) {\n this.magicWindowControls.update();\n magicWindowAbsoluteEuler.setFromQuaternion(this.magicWindowObject.quaternion, 'YXZ');\n if (!this.previousMagicWindowYaw && magicWindowAbsoluteEuler.y !== 0) {\n this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;\n }\n if (this.previousMagicWindowYaw) {\n magicWindowDeltaEuler.x = magicWindowAbsoluteEuler.x;\n magicWindowDeltaEuler.y += magicWindowAbsoluteEuler.y - this.previousMagicWindowYaw;\n magicWindowDeltaEuler.z = magicWindowAbsoluteEuler.z;\n this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;\n }\n }\n },\n\n /**\n * Translate mouse drag into rotation.\n *\n * Dragging up and down rotates the camera around the X-axis (yaw).\n * Dragging left and right rotates the camera around the Y-axis (pitch).\n */\n onMouseMove: function (evt) {\n var direction;\n var movementX;\n var movementY;\n var pitchObject = this.pitchObject;\n var previousMouseEvent = this.previousMouseEvent;\n var yawObject = this.yawObject;\n\n // Not dragging or not enabled.\n if (!this.data.enabled || (!this.mouseDown && !this.pointerLocked)) { return; }\n\n // Calculate delta.\n if (this.pointerLocked) {\n movementX = evt.movementX || evt.mozMovementX || 0;\n movementY = evt.movementY || evt.mozMovementY || 0;\n } else {\n movementX = evt.screenX - previousMouseEvent.screenX;\n movementY = evt.screenY - previousMouseEvent.screenY;\n }\n this.previousMouseEvent.screenX = evt.screenX;\n this.previousMouseEvent.screenY = evt.screenY;\n\n // Calculate rotation.\n direction = this.data.reverseMouseDrag ? 1 : -1;\n yawObject.rotation.y += movementX * 0.002 * direction;\n pitchObject.rotation.x += movementY * 0.002 * direction;\n pitchObject.rotation.x = Math.max(-PI_2, Math.min(PI_2, pitchObject.rotation.x));\n },\n\n /**\n * Register mouse down to detect mouse drag.\n */\n onMouseDown: function (evt) {\n var sceneEl = this.el.sceneEl;\n if (!this.data.enabled || !this.data.mouseEnabled || ((sceneEl.is('vr-mode') || sceneEl.is('ar-mode')) && sceneEl.checkHeadsetConnected())) { return; }\n // Handle only primary button.\n if (evt.button !== 0) { return; }\n\n var canvasEl = sceneEl && sceneEl.canvas;\n\n this.mouseDown = true;\n this.previousMouseEvent.screenX = evt.screenX;\n this.previousMouseEvent.screenY = evt.screenY;\n this.showGrabbingCursor();\n\n if (this.data.pointerLockEnabled && !this.pointerLocked) {\n if (canvasEl.requestPointerLock) {\n canvasEl.requestPointerLock();\n } else if (canvasEl.mozRequestPointerLock) {\n canvasEl.mozRequestPointerLock();\n }\n }\n },\n\n /**\n * Shows grabbing cursor on scene\n */\n showGrabbingCursor: function () {\n this.el.sceneEl.canvas.style.cursor = 'grabbing';\n },\n\n /**\n * Hides grabbing cursor on scene\n */\n hideGrabbingCursor: function () {\n this.el.sceneEl.canvas.style.cursor = '';\n },\n\n /**\n * Register mouse up to detect release of mouse drag.\n */\n onMouseUp: function () {\n this.mouseDown = false;\n this.hideGrabbingCursor();\n },\n\n /**\n * Register touch down to detect touch drag.\n */\n onTouchStart: function (evt) {\n if (evt.touches.length !== 1 ||\n !this.data.touchEnabled ||\n this.el.sceneEl.is('vr-mode') ||\n this.el.sceneEl.is('ar-mode')) { return; }\n this.touchStart = {\n x: evt.touches[0].pageX,\n y: evt.touches[0].pageY\n };\n this.touchStarted = true;\n },\n\n /**\n * Translate touch move to Y-axis rotation.\n */\n onTouchMove: function (evt) {\n var direction;\n var canvas = this.el.sceneEl.canvas;\n var deltaY;\n var yawObject = this.yawObject;\n\n if (!this.touchStarted || !this.data.touchEnabled) { return; }\n\n deltaY = 2 * Math.PI * (evt.touches[0].pageX - this.touchStart.x) / canvas.clientWidth;\n\n direction = this.data.reverseTouchDrag ? 1 : -1;\n // Limit touch orientaion to to yaw (y axis).\n yawObject.rotation.y -= deltaY * 0.5 * direction;\n this.touchStart = {\n x: evt.touches[0].pageX,\n y: evt.touches[0].pageY\n };\n },\n\n /**\n * Register touch end to detect release of touch drag.\n */\n onTouchEnd: function () {\n this.touchStarted = false;\n },\n\n /**\n * Save pose.\n */\n onEnterVR: function () {\n var sceneEl = this.el.sceneEl;\n if (!sceneEl.checkHeadsetConnected()) { return; }\n this.saveCameraPose();\n this.el.object3D.position.set(0, 0, 0);\n this.el.object3D.rotation.set(0, 0, 0);\n if (sceneEl.hasWebXR) {\n this.el.object3D.matrixAutoUpdate = false;\n this.el.object3D.updateMatrix();\n }\n },\n\n /**\n * Restore the pose.\n */\n onExitVR: function () {\n if (!this.el.sceneEl.checkHeadsetConnected()) { return; }\n this.restoreCameraPose();\n this.previousHMDPosition.set(0, 0, 0);\n this.el.object3D.matrixAutoUpdate = true;\n },\n\n /**\n * Update Pointer Lock state.\n */\n onPointerLockChange: function () {\n this.pointerLocked = !!(document.pointerLockElement || document.mozPointerLockElement);\n },\n\n /**\n * Recover from Pointer Lock error.\n */\n onPointerLockError: function () {\n this.pointerLocked = false;\n },\n\n // Exits pointer-locked mode.\n exitPointerLock: function () {\n document.exitPointerLock();\n this.pointerLocked = false;\n },\n\n /**\n * Toggle the feature of showing/hiding the grab cursor.\n */\n updateGrabCursor: function (enabled) {\n var sceneEl = this.el.sceneEl;\n\n function enableGrabCursor () { sceneEl.canvas.classList.add('a-grab-cursor'); }\n function disableGrabCursor () { sceneEl.canvas.classList.remove('a-grab-cursor'); }\n\n if (!sceneEl.canvas) {\n if (enabled) {\n sceneEl.addEventListener('render-target-loaded', enableGrabCursor);\n } else {\n sceneEl.addEventListener('render-target-loaded', disableGrabCursor);\n }\n return;\n }\n\n if (enabled) {\n enableGrabCursor();\n return;\n }\n disableGrabCursor();\n },\n\n /**\n * Save camera pose before entering VR to restore later if exiting.\n */\n saveCameraPose: function () {\n var el = this.el;\n\n this.savedPose.position.copy(el.object3D.position);\n this.savedPose.rotation.copy(el.object3D.rotation);\n this.hasSavedPose = true;\n },\n\n /**\n * Reset camera pose to before entering VR.\n */\n restoreCameraPose: function () {\n var el = this.el;\n var savedPose = this.savedPose;\n\n if (!this.hasSavedPose) { return; }\n\n // Reset camera orientation.\n el.object3D.position.copy(savedPose.position);\n el.object3D.rotation.copy(savedPose.rotation);\n this.hasSavedPose = false;\n }\n});\n",
  330. "var bind = require('../utils/bind');\nvar registerComponent = require('../core/component').registerComponent;\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\n// See Profiles Registry:\n// https://github.com/immersive-web/webxr-input-profiles/tree/master/packages/registry\n// TODO: Add a more robust system for deriving gamepad name.\nvar GAMEPAD_ID_PREFIX = 'magicleap';\nvar GAMEPAD_ID_SUFFIX = '-one';\nvar GAMEPAD_ID_COMPOSITE = GAMEPAD_ID_PREFIX + GAMEPAD_ID_SUFFIX;\n\nvar MAGICLEAP_CONTROLLER_MODEL_GLB_URL = 'https://cdn.aframe.io/controllers/magicleap/magicleap-one-controller.glb';\n\n/**\n * Button IDs:\n * 0 - trigger\n * 1 - grip\n * 2 - touchpad\n * 3 - menu (never dispatched on this layer)\n *\n * Axis:\n * 0 - touchpad x axis\n * 1 - touchpad y axis\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['trigger', 'grip', 'touchpad', 'menu']\n};\n\n/**\n * Magic Leap Controls\n * Interface with Magic Leap control and map Gamepad events to controller\n * buttons: trigger, grip, touchpad, and menu.\n * Load a controller model.\n */\nmodule.exports.Component = registerComponent('magicleap-controls', {\n schema: {\n hand: {default: 'none'},\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: INPUT_MAPPING_WEBXR,\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n update: function () {\n var data = this.data;\n this.controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n var data = this.data;\n checkControllerPresentAndSetup(this, GAMEPAD_ID_COMPOSITE,\n {index: this.controllerIndex, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n el.setAttribute('tracked-controls', {\n // TODO: verify expected behavior between reserved prefixes.\n idPrefix: GAMEPAD_ID_COMPOSITE,\n hand: data.hand,\n controller: this.controllerIndex,\n orientationOffset: data.orientationOffset\n });\n\n // Load model.\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', MAGICLEAP_CONTROLLER_MODEL_GLB_URL);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n // Note that due to gamepadconnected event propagation issues, we don't rely on events.\n this.checkIfControllerPresent();\n },\n\n /**\n * Rotate the trigger button based on how hard the trigger is pressed.\n */\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n var analogValue;\n\n if (!button) { return; }\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n console.log('analog value of trigger press: ' + analogValue);\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n // our glb scale is too large.\n controllerObject3D.scale.set(0.01, 0.01, 0.01);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {},\n\n setButtonColor: function (buttonName, color) {}\n\n});\n",
  331. "/* global Promise */\nvar utils = require('../utils/');\nvar component = require('../core/component');\nvar THREE = require('../lib/three');\nvar shader = require('../core/shader');\n\nvar error = utils.debug('components:material:error');\nvar registerComponent = component.registerComponent;\nvar shaders = shader.shaders;\nvar shaderNames = shader.shaderNames;\n\n/**\n * Material component.\n *\n * @member {object} shader - Determines how material is shaded. Defaults to `standard`,\n * three.js's implementation of PBR. Another standard shading model is `flat` which\n * uses MeshBasicMaterial.\n */\nmodule.exports.Component = registerComponent('material', {\n schema: {\n alphaTest: {default: 0.0, min: 0.0, max: 1.0},\n depthTest: {default: true},\n depthWrite: {default: true},\n flatShading: {default: false},\n npot: {default: false},\n offset: {type: 'vec2', default: {x: 0, y: 0}},\n opacity: {default: 1.0, min: 0.0, max: 1.0},\n repeat: {type: 'vec2', default: {x: 1, y: 1}},\n shader: {default: 'standard', oneOf: shaderNames, schemaChange: true},\n side: {default: 'front', oneOf: ['front', 'back', 'double']},\n transparent: {default: false},\n vertexColors: {type: 'string', default: 'none', oneOf: ['face', 'vertex']},\n visible: {default: true},\n blending: {default: 'normal', oneOf: ['none', 'normal', 'additive', 'subtractive', 'multiply']},\n dithering: {default: true}\n },\n\n init: function () {\n this.material = null;\n },\n\n /**\n * Update or create material.\n *\n * @param {object|null} oldData\n */\n update: function (oldData) {\n var data = this.data;\n if (!this.shader || data.shader !== oldData.shader) {\n this.updateShader(data.shader);\n }\n this.shader.update(this.data);\n this.updateMaterial(oldData);\n },\n\n updateSchema: function (data) {\n var currentShader;\n var newShader;\n var schema;\n var shader;\n\n newShader = data && data.shader;\n currentShader = this.oldData && this.oldData.shader;\n shader = newShader || currentShader;\n schema = shaders[shader] && shaders[shader].schema;\n\n if (!schema) { error('Unknown shader schema ' + shader); }\n if (currentShader && newShader === currentShader) { return; }\n this.extendSchema(schema);\n this.updateBehavior();\n },\n\n updateBehavior: function () {\n var key;\n var sceneEl = this.el.sceneEl;\n var schema = this.schema;\n var self = this;\n var tickProperties;\n\n function tickTime (time, delta) {\n var key;\n for (key in tickProperties) {\n tickProperties[key] = time;\n }\n self.shader.update(tickProperties);\n }\n\n this.tick = undefined;\n\n tickProperties = {};\n for (key in schema) {\n if (schema[key].type === 'time') {\n this.tick = tickTime;\n tickProperties[key] = true;\n }\n }\n\n if (!sceneEl) { return; }\n if (this.tick) {\n sceneEl.addBehavior(this);\n } else {\n sceneEl.removeBehavior(this);\n }\n },\n\n updateShader: function (shaderName) {\n var data = this.data;\n var Shader = shaders[shaderName] && shaders[shaderName].Shader;\n var shaderInstance;\n\n if (!Shader) { throw new Error('Unknown shader ' + shaderName); }\n\n // Get material from A-Frame shader.\n shaderInstance = this.shader = new Shader();\n shaderInstance.el = this.el;\n shaderInstance.init(data);\n this.setMaterial(shaderInstance.material);\n this.updateSchema(data);\n },\n\n /**\n * Set and update base material properties.\n * Set `needsUpdate` when needed.\n */\n updateMaterial: function (oldData) {\n var data = this.data;\n var material = this.material;\n var oldDataHasKeys;\n\n // Base material properties.\n material.alphaTest = data.alphaTest;\n material.depthTest = data.depthTest !== false;\n material.depthWrite = data.depthWrite !== false;\n material.opacity = data.opacity;\n material.flatShading = data.flatShading;\n material.side = parseSide(data.side);\n material.transparent = data.transparent !== false || data.opacity < 1.0;\n material.vertexColors = parseVertexColors(data.vertexColors);\n material.visible = data.visible;\n material.blending = parseBlending(data.blending);\n material.dithering = data.dithering;\n\n // Check if material needs update.\n for (oldDataHasKeys in oldData) { break; }\n if (oldDataHasKeys &&\n (oldData.alphaTest !== data.alphaTest ||\n oldData.side !== data.side ||\n oldData.vertexColors !== data.vertexColors)) {\n material.needsUpdate = true;\n }\n },\n\n /**\n * Remove material on remove (callback).\n * Dispose of it from memory and unsubscribe from scene updates.\n */\n remove: function () {\n var defaultMaterial = new THREE.MeshBasicMaterial();\n var material = this.material;\n var object3D = this.el.getObject3D('mesh');\n if (object3D) { object3D.material = defaultMaterial; }\n disposeMaterial(material, this.system);\n },\n\n /**\n * (Re)create new material. Has side-effects of setting `this.material` and updating\n * material registration in scene.\n *\n * @param {object} data - Material component data.\n * @param {object} type - Material type to create.\n * @returns {object} Material.\n */\n setMaterial: function (material) {\n var el = this.el;\n var mesh;\n var system = this.system;\n\n if (this.material) { disposeMaterial(this.material, system); }\n\n this.material = material;\n system.registerMaterial(material);\n\n // Set on mesh. If mesh does not exist, wait for it.\n mesh = el.getObject3D('mesh');\n if (mesh) {\n mesh.material = material;\n } else {\n el.addEventListener('object3dset', function waitForMesh (evt) {\n if (evt.detail.type !== 'mesh' || evt.target !== el) { return; }\n el.getObject3D('mesh').material = material;\n el.removeEventListener('object3dset', waitForMesh);\n });\n }\n }\n});\n\n/**\n * Return a three.js constant determining which material face sides to render\n * based on the side parameter (passed as a component property).\n *\n * @param {string} [side=front] - `front`, `back`, or `double`.\n * @returns {number} THREE.FrontSide, THREE.BackSide, or THREE.DoubleSide.\n */\nfunction parseSide (side) {\n switch (side) {\n case 'back': {\n return THREE.BackSide;\n }\n case 'double': {\n return THREE.DoubleSide;\n }\n default: {\n // Including case `front`.\n return THREE.FrontSide;\n }\n }\n}\n\n/**\n * Return a three.js constant determining vertex coloring.\n */\nfunction parseVertexColors (coloring) {\n switch (coloring) {\n case 'face': {\n return THREE.FaceColors;\n }\n case 'vertex': {\n return THREE.VertexColors;\n }\n default: {\n return THREE.NoColors;\n }\n }\n}\n\n/**\n * Return a three.js constant determining blending\n *\n * @param {string} [blending=normal]\n * - `none`, additive`, `subtractive`,`multiply` or `normal`.\n * @returns {number}\n */\nfunction parseBlending (blending) {\n switch (blending) {\n case 'none': {\n return THREE.NoBlending;\n }\n case 'additive': {\n return THREE.AdditiveBlending;\n }\n case 'subtractive': {\n return THREE.SubtractiveBlending;\n }\n case 'multiply': {\n return THREE.MultiplyBlending;\n }\n default: {\n return THREE.NormalBlending;\n }\n }\n}\n\n/**\n * Dispose of material from memory and unsubscribe material from scene updates like fog.\n */\nfunction disposeMaterial (material, system) {\n material.dispose();\n system.unregisterMaterial(material);\n}\n",
  332. "var debug = require('../utils/debug');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar warn = debug('components:obj-model:warn');\n\nmodule.exports.Component = registerComponent('obj-model', {\n schema: {\n mtl: {type: 'model'},\n obj: {type: 'model'}\n },\n\n init: function () {\n var self = this;\n\n this.model = null;\n this.objLoader = new THREE.OBJLoader();\n this.mtlLoader = new THREE.MTLLoader(this.objLoader.manager);\n // Allow cross-origin images to be loaded.\n this.mtlLoader.crossOrigin = '';\n\n this.el.addEventListener('componentinitialized', function (evt) {\n if (!self.model) { return; }\n if (evt.detail.name !== 'material') { return; }\n self.applyMaterial();\n });\n },\n\n update: function () {\n var data = this.data;\n if (!data.obj) { return; }\n this.resetMesh();\n this.loadObj(data.obj, data.mtl);\n },\n\n remove: function () {\n if (!this.model) { return; }\n this.resetMesh();\n },\n\n resetMesh: function () {\n this.el.removeObject3D('mesh');\n },\n\n loadObj: function (objUrl, mtlUrl) {\n var self = this;\n var el = this.el;\n var mtlLoader = this.mtlLoader;\n var objLoader = this.objLoader;\n var rendererSystem = this.el.sceneEl.systems.renderer;\n var BASE_PATH = mtlUrl.substr(0, mtlUrl.lastIndexOf('/') + 1);\n\n if (mtlUrl) {\n // .OBJ with an .MTL.\n if (el.hasAttribute('material')) {\n warn('Material component properties are ignored when a .MTL is provided');\n }\n mtlLoader.setResourcePath(BASE_PATH);\n mtlLoader.load(mtlUrl, function (materials) {\n materials.preload();\n objLoader.setMaterials(materials);\n objLoader.load(objUrl, function (objModel) {\n self.model = objModel;\n self.model.traverse(function (object) {\n if (object.isMesh) {\n var material = object.material;\n if (material.color) rendererSystem.applyColorCorrection(material.color);\n if (material.map) rendererSystem.applyColorCorrection(material.map);\n if (material.emissive) rendererSystem.applyColorCorrection(material.emissive);\n if (material.emissiveMap) rendererSystem.applyColorCorrection(material.emissiveMap);\n }\n });\n el.setObject3D('mesh', objModel);\n el.emit('model-loaded', {format: 'obj', model: objModel});\n });\n });\n return;\n }\n\n // .OBJ only.\n objLoader.load(objUrl, function loadObjOnly (objModel) {\n self.model = objModel;\n self.applyMaterial();\n el.setObject3D('mesh', objModel);\n el.emit('model-loaded', {format: 'obj', model: objModel});\n });\n },\n\n /**\n * Apply material from material component recursively.\n */\n applyMaterial: function () {\n var material = this.el.components.material;\n if (!material) { return; }\n this.model.traverse(function (child) {\n if (child instanceof THREE.Mesh) {\n child.material = material.material;\n }\n });\n }\n});\n",
  333. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'oculus-go';\nvar GAMEPAD_ID_WEBVR = 'Oculus Go';\n\nvar OCULUS_GO_CONTROLLER_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus/go/oculus-go-controller.gltf';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button indices:\n * 0 - trackpad\n * 1 - trigger\n *\n * Axis:\n * 0 - trackpad x\n * 1 - trackpad y\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger']\n};\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - none\n * 2 - touchpad\n *\n * Axis:\n * 0 - touchpad x\n * 1 - touchpad y\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/oculus/oculus-go.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {touchpad: [0, 1]},\n buttons: ['trigger', 'none', 'touchpad']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Oculus Go controls.\n * Interface with Oculus Go controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('oculus-go-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonColor: {type: 'color', default: '#FFFFFF'},\n buttonTouchedColor: {type: 'color', default: '#BBBBBB'},\n buttonHighlightColor: {type: 'color', default: '#7A7A7A'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n hand: data.hand,\n idPrefix: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', OCULUS_GO_CONTROLLER_MODEL_URL);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n // No need for onButtonChanged, since Oculus Go controller has no analog buttons.\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.trigger = controllerObject3D.getObjectByName('oculus_go_button_trigger');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('oculus_go_touchpad');\n buttonMeshes.touchpad = controllerObject3D.getObjectByName('oculus_go_touchpad');\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n if (!buttonMeshes || !buttonMeshes[buttonName]) { return; }\n var color;\n var button;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n default:\n color = this.data.buttonColor;\n }\n button = buttonMeshes[buttonName];\n button.material.color.set(color);\n this.rendererSystem.applyColorCorrection(button.material.color);\n }\n});\n",
  334. "var bind = require('../utils/bind');\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'oculus-touch';\nvar GAMEPAD_ID_WEBVR = 'Oculus Touch';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n// First generation model URL.\nvar TOUCH_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/oculus/oculus-touch-controller-';\n\nvar OCULUS_TOUCH_WEBVR = {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'left.gltf',\n rayOrigin: {origin: {x: 0.008, y: -0.01, z: 0}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(-0.005, 0.003, -0.055),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'right.gltf',\n rayOrigin: {origin: {x: -0.008, y: -0.01, z: 0}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(0.005, 0.003, -0.055),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n }\n};\n\nvar OCULUS_TOUCH_WEBXR = {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'left.gltf',\n rayOrigin: {origin: {x: 0.002, y: -0.005, z: -0.03}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(-0.005, 0.036, -0.037),\n modelPivotRotation: new THREE.Euler(Math.PI / 4.5, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'right.gltf',\n rayOrigin: {origin: {x: -0.002, y: -0.005, z: -0.03}, direction: {x: 0, y: -0.8, z: -1}},\n modelPivotOffset: new THREE.Vector3(0.005, 0.036, -0.037),\n modelPivotRotation: new THREE.Euler(Math.PI / 4.5, 0, 0)\n }\n};\n\nvar OCULUS_TOUCH_CONFIG = isWebXRAvailable ? OCULUS_TOUCH_WEBXR : OCULUS_TOUCH_WEBVR;\n\nvar CONTROLLER_DEFAULT = 'oculus-touch';\nvar CONTROLLER_PROPERTIES = {\n 'oculus-touch': OCULUS_TOUCH_CONFIG,\n 'oculus-touch-v2': {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'gen2-left.gltf',\n rayOrigin: {origin: {x: -0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},\n modelPivotOffset: new THREE.Vector3(0, 0, 0),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'gen2-right.gltf',\n rayOrigin: {origin: {x: 0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},\n modelPivotOffset: new THREE.Vector3(0, 0, 0),\n modelPivotRotation: new THREE.Euler(0, 0, 0)\n }\n },\n 'oculus-touch-v3': {\n left: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'v3-left.glb',\n rayOrigin: {origin: {x: 0.015, y: 0.005, z: 0}, direction: {x: 0, y: 0, z: -1}},\n modelPivotOffset: new THREE.Vector3(0.01, -0.01, 0.05),\n modelPivotRotation: new THREE.Euler(Math.PI / 4, 0, 0)\n },\n right: {\n modelUrl: TOUCH_CONTROLLER_MODEL_BASE_URL + 'v3-right.glb',\n rayOrigin: {origin: {x: -0.015, y: 0.005, z: 0}, direction: {x: 0, y: 0, z: -1}},\n modelPivotOffset: new THREE.Vector3(-0.01, -0.01, 0.05),\n modelPivotRotation: new THREE.Euler(Math.PI / 4, 0, 0)\n }\n }\n};\n\n/**\n * Button indices:\n * 0 - thumbstick (which has separate axismove / thumbstickmoved events)\n * 1 - trigger (with analog value, which goes up to 1)\n * 2 - grip (with analog value, which goes up to 1)\n * 3 - X (left) or A (right)\n * 4 - Y (left) or B (right)\n * 5 - surface (touch only)\n */\nvar INPUT_MAPPING_WEBVR = {\n left: {\n axes: {thumbstick: [0, 1]},\n buttons: ['thumbstick', 'trigger', 'grip', 'xbutton', 'ybutton', 'surface']\n },\n right: {\n axes: {thumbstick: [0, 1]},\n buttons: ['thumbstick', 'trigger', 'grip', 'abutton', 'bbutton', 'surface']\n }\n};\n\n/**\n * Button indices:\n * 0 - trigger\n * 1 - grip\n * 2 - none\n * 3 - thumbstick\n * 4 - X or A button\n * 5 - Y or B button\n * 6 - surface\n *\n * Axis:\n * 0 - none\n * 1 - none\n * 2 - thumbstick\n * 3 - thumbstick\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/oculus/oculus-touch.json\n */\nvar INPUT_MAPPING_WEBXR = {\n left: {\n axes: {thumbstick: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'xbutton', 'ybutton', 'surface']\n },\n right: {\n axes: {thumbstick: [2, 3]},\n buttons: ['trigger', 'grip', 'none', 'thumbstick', 'abutton', 'bbutton', 'surface']\n }\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Oculus Touch controls.\n * Interface with Oculus Touch controllers and map Gamepad events to\n * controller buttons: thumbstick, trigger, grip, xbutton, ybutton, surface\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('oculus-touch-controls', {\n schema: {\n hand: {default: 'left'},\n buttonColor: {type: 'color', default: '#999'}, // Off-white.\n buttonTouchColor: {type: 'color', default: '#8AB'},\n buttonHighlightColor: {type: 'color', default: '#2DF'}, // Light blue.\n model: {default: true},\n controllerType: {default: 'auto', oneOf: ['auto', 'oculus-touch', 'oculus-touch-v2', 'oculus-touch-v3']},\n orientationOffset: {type: 'vec3', default: {x: 43, y: 0, z: 0}}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self, self.data.hand); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self, self.data.hand); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self, self.data.hand); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self, self.data.hand); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {\n hand: this.data.hand\n });\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n loadModel: function (controller) {\n var data = this.data;\n var controllerId;\n\n if (!data.model) { return; }\n // Set the controller display model based on the data passed in.\n this.displayModel = CONTROLLER_PROPERTIES[data.controllerType] || CONTROLLER_PROPERTIES[CONTROLLER_DEFAULT];\n // If the developer is asking for auto-detection, see if the displayName can be retrieved to identify the specific unit.\n // This only works for WebVR currently.\n if (data.controllerType === 'auto') {\n var trackedControlsSystem = this.el.sceneEl.systems['tracked-controls-webvr'];\n // WebVR\n if (trackedControlsSystem && trackedControlsSystem.vrDisplay) {\n var displayName = trackedControlsSystem.vrDisplay.displayName;\n // The Oculus Quest uses the updated generation 2 inside-out tracked controllers so update the displayModel.\n if (/^Oculus Quest$/.test(displayName)) {\n this.displayModel = CONTROLLER_PROPERTIES['oculus-touch-v2'];\n }\n } else { // WebXR\n controllerId = CONTROLLER_DEFAULT;\n controllerId = controller.profiles.indexOf('oculus-touch-v2') !== -1 ? 'oculus-touch-v2' : controllerId;\n controllerId = controller.profiles.indexOf('oculus-touch-v3') !== -1 ? 'oculus-touch-v3' : controllerId;\n this.displayModel = CONTROLLER_PROPERTIES[controllerId];\n }\n }\n var modelUrl = this.displayModel[data.hand].modelUrl;\n this.el.setAttribute('gltf-model', modelUrl);\n },\n\n injectTrackedControls: function (controller) {\n var data = this.data;\n var webXRId = GAMEPAD_ID_WEBXR;\n var webVRId = data.hand === 'right' ? 'Oculus Touch (Right)' : 'Oculus Touch (Left)';\n var id = isWebXRAvailable ? webXRId : webVRId;\n this.el.setAttribute('tracked-controls', {\n id: id,\n hand: data.hand,\n orientationOffset: data.orientationOffset,\n handTrackingEnabled: false\n });\n this.loadModel(controller);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n // Note that due to gamepadconnected event propagation issues, we don't rely on events.\n this.checkIfControllerPresent();\n },\n\n onButtonChanged: function (evt) {\n var button = this.mapping[this.data.hand].buttons[evt.detail.id];\n var buttonMeshes = this.buttonMeshes;\n var analogValue;\n if (!button) { return; }\n\n if (button === 'trigger' || button === 'grip') { analogValue = evt.detail.state.value; }\n\n // Update trigger and/or grip meshes, if any.\n if (buttonMeshes) {\n if (button === 'trigger' && buttonMeshes.trigger) {\n buttonMeshes.trigger.rotation.x = this.originalXRotationTrigger - analogValue * (Math.PI / 26);\n }\n if (button === 'grip' && buttonMeshes.grip) {\n buttonMeshes.grip.position.x = this.originalXPositionGrip + (this.data.hand === 'left' ? -1 : 1) * analogValue * 0.004;\n }\n }\n\n // Pass along changed event with button state, using the buttom mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = this.controllerObject3D = evt.detail.model;\n var buttonMeshes;\n\n if (!this.data.model) { return; }\n\n buttonMeshes = this.buttonMeshes = {};\n\n buttonMeshes.grip = controllerObject3D.getObjectByName('buttonHand');\n this.originalXPositionGrip = buttonMeshes.grip && buttonMeshes.grip.position.x;\n buttonMeshes.thumbstick = controllerObject3D.getObjectByName('stick');\n buttonMeshes.trigger = controllerObject3D.getObjectByName('buttonTrigger');\n this.originalXRotationTrigger = buttonMeshes.trigger && buttonMeshes.trigger.rotation.x;\n buttonMeshes.xbutton = controllerObject3D.getObjectByName('buttonX');\n buttonMeshes.abutton = controllerObject3D.getObjectByName('buttonA');\n buttonMeshes.ybutton = controllerObject3D.getObjectByName('buttonY');\n buttonMeshes.bbutton = controllerObject3D.getObjectByName('buttonB');\n\n // Offset pivot point\n controllerObject3D.position.copy(this.displayModel[this.data.hand].modelPivotOffset);\n controllerObject3D.rotation.copy(this.displayModel[this.data.hand].modelPivotRotation);\n\n this.el.emit('controllermodelready', {\n name: 'oculus-touch-controls',\n model: this.data.model,\n rayOrigin: this.displayModel[this.data.hand].rayOrigin\n });\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping[this.data.hand].axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var button;\n var color = (state === 'up' || state === 'touchend') ? this.data.buttonColor : state === 'touchstart' ? this.data.buttonTouchColor : this.data.buttonHighlightColor;\n var buttonMeshes = this.buttonMeshes;\n if (!this.data.model) { return; }\n if (buttonMeshes && buttonMeshes[buttonName]) {\n button = buttonMeshes[buttonName];\n button.material.color.set(color);\n this.rendererSystem.applyColorCorrection(button.material.color);\n }\n }\n});\n",
  335. "var registerComponent = require('../core/component').registerComponent;\n\nmodule.exports.Component = registerComponent('position', {\n schema: {type: 'vec3'},\n\n update: function () {\n var object3D = this.el.object3D;\n var data = this.data;\n object3D.position.set(data.x, data.y, data.z);\n },\n\n remove: function () {\n // Pretty much for mixins.\n this.el.object3D.position.set(0, 0, 0);\n }\n});\n",
  336. "/* global MutationObserver */\n\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar warn = utils.debug('components:raycaster:warn');\n\n// Defines selectors that should be 'safe' for the MutationObserver used to\n// refresh the whitelist. Matches classnames, IDs, and presence of attributes.\n// Selectors for the value of an attribute, like [position=0 2 0], cannot be\n// reliably detected and are therefore disallowed.\nvar OBSERVER_SELECTOR_RE = /^[\\w\\s-.,[\\]#]*$/;\n\n// Configuration for the MutationObserver used to refresh the whitelist.\n// Listens for addition/removal of elements and attributes within the scene.\nvar OBSERVER_CONFIG = {\n childList: true,\n attributes: true,\n subtree: true\n};\n\nvar EVENTS = {\n INTERSECT: 'raycaster-intersected',\n INTERSECTION: 'raycaster-intersection',\n INTERSECT_CLEAR: 'raycaster-intersected-cleared',\n INTERSECTION_CLEAR: 'raycaster-intersection-cleared'\n};\n\n/**\n * Raycaster component.\n *\n * Pass options to three.js Raycaster including which objects to test.\n * Poll for intersections.\n * Emit event on origin entity and on target entity on intersect.\n *\n * @member {array} intersectedEls - List of currently intersected entities.\n * @member {array} objects - Cached list of meshes to intersect.\n * @member {number} prevCheckTime - Previous time intersection was checked. To help interval.\n * @member {object} raycaster - three.js Raycaster.\n */\nmodule.exports.Component = registerComponent('raycaster', {\n schema: {\n autoRefresh: {default: true},\n direction: {type: 'vec3', default: {x: 0, y: 0, z: -1}},\n enabled: {default: true},\n far: {default: 1000},\n interval: {default: 0},\n near: {default: 0},\n objects: {default: ''},\n origin: {type: 'vec3'},\n showLine: {default: false},\n lineColor: {default: 'white'},\n lineOpacity: {default: 1},\n useWorldCoordinates: {default: false}\n },\n\n multiple: true,\n\n init: function () {\n this.clearedIntersectedEls = [];\n this.unitLineEndVec3 = new THREE.Vector3();\n this.intersectedEls = [];\n this.intersections = [];\n this.newIntersectedEls = [];\n this.newIntersections = [];\n this.objects = [];\n this.prevCheckTime = undefined;\n this.prevIntersectedEls = [];\n this.rawIntersections = [];\n this.raycaster = new THREE.Raycaster();\n this.updateOriginDirection();\n this.setDirty = this.setDirty.bind(this);\n this.updateLine = this.updateLine.bind(this);\n this.observer = new MutationObserver(this.setDirty);\n this.dirty = true;\n this.lineEndVec3 = new THREE.Vector3();\n this.otherLineEndVec3 = new THREE.Vector3();\n this.lineData = {end: this.lineEndVec3};\n\n this.getIntersection = this.getIntersection.bind(this);\n this.intersectedDetail = {el: this.el, getIntersection: this.getIntersection};\n this.intersectedClearedDetail = {el: this.el};\n this.intersectionClearedDetail = {clearedEls: this.clearedIntersectedEls};\n this.intersectionDetail = {};\n },\n\n /**\n * Create or update raycaster object.\n */\n update: function (oldData) {\n var data = this.data;\n var el = this.el;\n var raycaster = this.raycaster;\n\n // Set raycaster properties.\n raycaster.far = data.far;\n raycaster.near = data.near;\n\n // Draw line.\n if (data.showLine &&\n (data.far !== oldData.far || data.origin !== oldData.origin ||\n data.direction !== oldData.direction || !oldData.showLine)) {\n // Calculate unit vector for line direction. Can be multiplied via scalar to performantly\n // adjust line length.\n this.unitLineEndVec3.copy(data.origin).add(data.direction).normalize();\n this.drawLine();\n }\n\n if (!data.showLine && oldData.showLine) {\n el.removeAttribute('line');\n }\n\n if (data.objects !== oldData.objects && !OBSERVER_SELECTOR_RE.test(data.objects)) {\n warn('[raycaster] Selector \"' + data.objects +\n '\" may not update automatically with DOM changes.');\n }\n\n if (!data.objects) {\n warn('[raycaster] For performance, please define raycaster.objects when using ' +\n 'raycaster or cursor components to whitelist which entities to intersect with. ' +\n 'e.g., raycaster=\"objects: [data-raycastable]\".');\n }\n\n if (data.autoRefresh !== oldData.autoRefresh && el.isPlaying) {\n data.autoRefresh\n ? this.addEventListeners()\n : this.removeEventListeners();\n }\n\n if (oldData.enabled && !data.enabled) { this.clearAllIntersections(); }\n\n this.setDirty();\n },\n\n play: function () {\n this.addEventListeners();\n },\n\n pause: function () {\n this.removeEventListeners();\n },\n\n remove: function () {\n if (this.data.showLine) {\n this.el.removeAttribute('line');\n }\n this.clearAllIntersections();\n },\n\n addEventListeners: function () {\n if (!this.data.autoRefresh) { return; }\n this.observer.observe(this.el.sceneEl, OBSERVER_CONFIG);\n this.el.sceneEl.addEventListener('object3dset', this.setDirty);\n this.el.sceneEl.addEventListener('object3dremove', this.setDirty);\n },\n\n removeEventListeners: function () {\n this.observer.disconnect();\n this.el.sceneEl.removeEventListener('object3dset', this.setDirty);\n this.el.sceneEl.removeEventListener('object3dremove', this.setDirty);\n },\n\n /**\n * Mark the object list as dirty, to be refreshed before next raycast.\n */\n setDirty: function () {\n this.dirty = true;\n },\n\n /**\n * Update list of objects to test for intersection.\n */\n refreshObjects: function () {\n var data = this.data;\n var els;\n\n // If objects not defined, intersect with everything.\n els = data.objects\n ? this.el.sceneEl.querySelectorAll(data.objects)\n : this.el.sceneEl.querySelectorAll('*');\n this.objects = this.flattenObject3DMaps(els);\n this.dirty = false;\n },\n\n /**\n * Check for intersections and cleared intersections on an interval.\n */\n tock: function (time) {\n var data = this.data;\n var prevCheckTime = this.prevCheckTime;\n\n if (!data.enabled) { return; }\n\n // Only check for intersection if interval time has passed.\n if (prevCheckTime && (time - prevCheckTime < data.interval)) { return; }\n\n // Update check time.\n this.prevCheckTime = time;\n this.checkIntersections();\n },\n\n /**\n * Raycast for intersections and emit events for current and cleared intersections.\n */\n checkIntersections: function () {\n var clearedIntersectedEls = this.clearedIntersectedEls;\n var el = this.el;\n var data = this.data;\n var i;\n var intersectedEls = this.intersectedEls;\n var intersection;\n var intersections = this.intersections;\n var newIntersectedEls = this.newIntersectedEls;\n var newIntersections = this.newIntersections;\n var prevIntersectedEls = this.prevIntersectedEls;\n var rawIntersections = this.rawIntersections;\n\n // Refresh the object whitelist if needed.\n if (this.dirty) { this.refreshObjects(); }\n\n // Store old previously intersected entities.\n copyArray(this.prevIntersectedEls, this.intersectedEls);\n\n // Raycast.\n this.updateOriginDirection();\n rawIntersections.length = 0;\n this.raycaster.intersectObjects(this.objects, true, rawIntersections);\n\n // Only keep intersections against objects that have a reference to an entity.\n intersections.length = 0;\n intersectedEls.length = 0;\n for (i = 0; i < rawIntersections.length; i++) {\n intersection = rawIntersections[i];\n // Don't intersect with own line.\n if (data.showLine && intersection.object === el.getObject3D('line')) {\n continue;\n }\n if (intersection.object.el) {\n intersections.push(intersection);\n intersectedEls.push(intersection.object.el);\n }\n }\n\n // Get newly intersected entities.\n newIntersections.length = 0;\n newIntersectedEls.length = 0;\n for (i = 0; i < intersections.length; i++) {\n if (prevIntersectedEls.indexOf(intersections[i].object.el) === -1) {\n newIntersections.push(intersections[i]);\n newIntersectedEls.push(intersections[i].object.el);\n }\n }\n\n // Emit intersection cleared on both entities per formerly intersected entity.\n clearedIntersectedEls.length = 0;\n for (i = 0; i < prevIntersectedEls.length; i++) {\n if (intersectedEls.indexOf(prevIntersectedEls[i]) !== -1) { continue; }\n prevIntersectedEls[i].emit(EVENTS.INTERSECT_CLEAR,\n this.intersectedClearedDetail);\n clearedIntersectedEls.push(prevIntersectedEls[i]);\n }\n if (clearedIntersectedEls.length) {\n el.emit(EVENTS.INTERSECTION_CLEAR, this.intersectionClearedDetail);\n }\n\n // Emit intersected on intersected entity per intersected entity.\n for (i = 0; i < newIntersectedEls.length; i++) {\n newIntersectedEls[i].emit(EVENTS.INTERSECT, this.intersectedDetail);\n }\n\n // Emit all intersections at once on raycasting entity.\n if (newIntersections.length) {\n this.intersectionDetail.els = newIntersectedEls;\n this.intersectionDetail.intersections = newIntersections;\n el.emit(EVENTS.INTERSECTION, this.intersectionDetail);\n }\n\n // Update line length.\n if (data.showLine) { setTimeout(this.updateLine); }\n },\n\n updateLine: function () {\n var el = this.el;\n var intersections = this.intersections;\n var lineLength;\n\n if (intersections.length) {\n if (intersections[0].object.el === el && intersections[1]) {\n lineLength = intersections[1].distance;\n } else {\n lineLength = intersections[0].distance;\n }\n }\n this.drawLine(lineLength);\n },\n\n /**\n * Return the most recent intersection details for a given entity, if any.\n * @param {AEntity} el\n * @return {Object}\n */\n getIntersection: function (el) {\n var i;\n var intersection;\n for (i = 0; i < this.intersections.length; i++) {\n intersection = this.intersections[i];\n if (intersection.object.el === el) { return intersection; }\n }\n return null;\n },\n\n /**\n * Update origin and direction of raycaster using entity transforms and supplied origin or\n * direction offsets.\n */\n updateOriginDirection: (function () {\n var direction = new THREE.Vector3();\n var originVec3 = new THREE.Vector3();\n\n // Closure to make quaternion/vector3 objects private.\n return function updateOriginDirection () {\n var el = this.el;\n var data = this.data;\n\n if (data.useWorldCoordinates) {\n this.raycaster.set(data.origin, data.direction);\n return;\n }\n\n el.object3D.updateMatrixWorld();\n originVec3.setFromMatrixPosition(el.object3D.matrixWorld);\n\n // If non-zero origin, translate the origin into world space.\n if (data.origin.x !== 0 || data.origin.y !== 0 || data.origin.z !== 0) {\n originVec3 = el.object3D.localToWorld(originVec3.copy(data.origin));\n }\n\n // three.js raycaster direction is relative to 0, 0, 0 NOT the origin / offset we\n // provide. Apply the offset to the direction, then rotation from the object,\n // and normalize.\n direction.copy(data.direction).transformDirection(el.object3D.matrixWorld).normalize();\n\n // Apply offset and direction, in world coordinates.\n this.raycaster.set(originVec3, direction);\n };\n })(),\n\n /**\n * Create or update line to give raycaster visual representation.\n * Customize the line through through line component.\n * We draw the line in the raycaster component to customize the line to the\n * raycaster's origin, direction, and far.\n *\n * Unlike the raycaster, we create the line as a child of the object. The line will\n * be affected by the transforms of the objects, so we don't have to calculate transforms\n * like we do with the raycaster.\n *\n * @param {number} length - Length of line. Pass in to shorten the line to the intersection\n * point. If not provided, length will default to the max length, `raycaster.far`.\n */\n drawLine: function (length) {\n var data = this.data;\n var el = this.el;\n var endVec3;\n\n // Switch each time vector so line update triggered and to avoid unnecessary vector clone.\n endVec3 = this.lineData.end === this.lineEndVec3\n ? this.otherLineEndVec3\n : this.lineEndVec3;\n\n // Treat Infinity as 1000m for the line.\n if (length === undefined) {\n length = data.far === Infinity ? 1000 : data.far;\n }\n\n // Update the length of the line if given. `unitLineEndVec3` is the direction\n // given by data.direction, then we apply a scalar to give it a length.\n this.lineData.start = data.origin;\n this.lineData.end = endVec3.copy(this.unitLineEndVec3).multiplyScalar(length);\n this.lineData.color = data.lineColor;\n this.lineData.opacity = data.lineOpacity;\n el.setAttribute('line', this.lineData);\n },\n\n /**\n * Return A-Frame attachments of each element's object3D group (e.g., mesh).\n * Children are flattened by one level, removing the THREE.Group wrapper,\n * so that non-recursive raycasting remains useful.\n *\n * Only push children defined as component attachements (e.g., setObject3D),\n * NOT actual children in the scene graph hierarchy.\n *\n * @param {Array<Element>} els\n * @return {Array<THREE.Object3D>}\n */\n flattenObject3DMaps: function (els) {\n var key;\n var i;\n var objects = this.objects;\n\n // Push meshes and other attachments onto list of objects to intersect.\n objects.length = 0;\n for (i = 0; i < els.length; i++) {\n if (els[i].isEntity && els[i].object3D) {\n for (key in els[i].object3DMap) {\n objects.push(els[i].getObject3D(key));\n }\n }\n }\n\n return objects;\n },\n\n clearAllIntersections: function () {\n var i;\n for (i = 0; i < this.intersectedEls.length; i++) {\n this.intersectedEls[i].emit(EVENTS.INTERSECT_CLEAR,\n this.intersectedClearedDetail);\n }\n copyArray(this.clearedIntersectedEls, this.intersectedEls);\n this.intersectedEls.length = 0;\n this.intersections.length = 0;\n this.el.emit(EVENTS.INTERSECTION_CLEAR, this.intersectionClearedDetail);\n }\n});\n\n/**\n * Copy contents of one array to another without allocating new array.\n */\nfunction copyArray (a, b) {\n var i;\n a.length = b.length;\n for (i = 0; i < b.length; i++) {\n a[i] = b[i];\n }\n}\n",
  337. "var degToRad = require('../lib/three').Math.degToRad;\nvar registerComponent = require('../core/component').registerComponent;\n\nmodule.exports.Component = registerComponent('rotation', {\n schema: {type: 'vec3'},\n\n /**\n * Updates object3D rotation.\n */\n update: function () {\n var data = this.data;\n var object3D = this.el.object3D;\n object3D.rotation.set(degToRad(data.x), degToRad(data.y), degToRad(data.z));\n object3D.rotation.order = 'YXZ';\n },\n\n remove: function () {\n // Pretty much for mixins.\n this.el.object3D.rotation.set(0, 0, 0);\n }\n});\n",
  338. "var registerComponent = require('../core/component').registerComponent;\n\n// Avoids triggering a zero-determinant which makes object3D matrix non-invertible.\nvar zeroScale = 0.00001;\n\nmodule.exports.Component = registerComponent('scale', {\n schema: {\n type: 'vec3',\n default: {x: 1, y: 1, z: 1}\n },\n\n update: function () {\n var data = this.data;\n var object3D = this.el.object3D;\n var x = data.x === 0 ? zeroScale : data.x;\n var y = data.y === 0 ? zeroScale : data.y;\n var z = data.z === 0 ? zeroScale : data.z;\n object3D.scale.set(x, y, z);\n },\n\n remove: function () {\n // Pretty much for mixins.\n this.el.object3D.scale.set(1, 1, 1);\n }\n});\n",
  339. "/* global ImageData, Map, Set */\nvar arrowURL = 'data:image/webp;base64,UklGRkQHAABXRUJQVlA4WAoAAAAQAAAA/wEA/wEAQUxQSL0DAAARDzD/ERGCjrY9sYYFfgo6aa1kJ7K0w9Lo3AadLSVeFxevQwj5kuM8RfR/Atw/C0+ozB/oUBrloFZs6ElSW88j1KA4yExNWQaqRZquIDF0JYmlq0hAuUDTFu66tng3teW7pa3cQf1V1edvur54M/Slm6Wv3Gx9zw0MXlQLntcsBN6wkHjTQuYtC4W3LTw8mGRVG57TbAROtxHfZNhInGkjc5aNwtk2Hg6Mvki14k+NkZzCwQgCxalcAv3kddRTPI1DcUrXId1FLf1uHpzaQz4tquhZVLlKesbVpqKeTj0n0F5PpXDlFN9UqmhalL/ImuZFo6KmToWLoKlddMprqlS8cKovBvHo2kTiFV2LN4msaxKZl3QNiair8xYRdDWivIvXVXmbcMqJ51UebZuFXxZt6xd4laxtciqRtA3Cv0nU1t+kEUFbI8JvCa+tvkm3FDlO/W+OR99+kWEp/YYo+tYfTVnf/K8cE/F///3vv//993eeL+a+uvjawLcX3xjYvJotBFY3kVjTRGFtE+BU2AiMbiQyhpHMWEYeBozAH5qNBYRDB5KBCaTDBKKBAZTDBoKBDjwHAN5ABeCJBsAZcAAC0YHHxAYSMYBiYgGZWEA2MYFCbCCZGAAIANFEB+AnYgMQTDQAYSJ2AN5EBZAm4gDgTDgAeSIu4DGygTIRN1CMLOCZiACykQlg4jsAycgA8AO+BxCNdJyDkcbwRirDGXGnx8w+FDPrkM3MQ9JQZMYhiiwV/RDMtIM3U1/DmXHUo+IR2kSR2ToWkQ1NIn2qf2J8LCqJKiDUiSADHY3whirhdHgZ94HKaR97PhE+twEUJUFoAcgyTct8hfSxSkShASDKdMJ/ritKHwgyQ0sD4D/miCxU5SbhOOUDTnZpccCjYP/i0bZ/8bAgtVGEoGapWIQXyzKVKLwgNJFk2rtMIgoNRJlOZF7SNSSyUEeQmbxBFKEmtYjEe8S8zOZ1AkJVCmS88FJOtF40Ksg4oUaFiygk3C8qlTVNyl8UTevCUdAE2t14PfVqU1FPp57TopKeQZWromddTQp6QOfTOEQt/ZDuipZ11w/wOiqO8dRORcc6BQEkDQMClaHcn5wV9yLbxsNZNgpn2sicYSNxuo34Js1G4FQbnuNsOPa28PCWhcKbFjJvWEi8ZiHwqgXPcxbc5db33Cx95WboSzddX7yp+vyN0+eul7ZyN7Xlu64t3jVt4c5pc4JLV5EYupJE0xUknC4nOjVlmaYpyLit53HCQ0+ScnqceNcS5dzUkd0/CwMAVlA4IGADAAAQXwCdASoAAgACP8ne6Wy/tjCpqJ/IA/A5CWlu4XYBG/Pz8AfwD8APz//f3v8E1fuHZnxKYACtfuHZnxKYACrYTb5mOslhxu843ecbvON3nG7zjd3a0VCn7G1MABVxwH/Xd25gAK1+4dmfEpe2+PHhQaj75++riG6FuYACtfuHZnxKYACRrK3q9xO8Ss3uWKnMhs/rDF1hi6wxdYYusMXWGI5QRcCFDZog5OgqNlse1NDuz/UoFa/cOzPiUwAEsAOK4/nu5eZHK2tlXxJfNYlMABWv3Dsz4bvNJ5YA/LtxJ38SmAArX7h2Z8Sk5vdZUYv7mZPiUwAFa/cOzPh21s5OgZxf1mfEpemRyFr/rM+JS9noA/LtxJ38SmAAlUJIotzAASn6TjdhK+D3Dsz4dyvB7h2Z8O2tnJ0DOL+sz4lL2nKLT4lL/+iSLOocxq639w7M34MNZdm55uJ8v8ra2cpVZnxKTq2F3PN/cNksAfl24k7+JTAASqrD37h2Z7b1W+VtbOUqsz4lJ1bC7nm/uGyWAPy7cSd/EpgAJVVh79w7M9t6rfK2tnKVWZ8Sk6thdzzf3DZLAH5duJO/iUwAEqqw9+4dme29VvlbWzlKrM+JSdWwu55v7hslgD8u3EnfxKYACVVYe/cOzPbeq3ytrZylVme0kYJ8557FLerqFrzIbPrrf3DZLAH5duJO/iUvaVMS9BoaF4p7pSDFTP1XMyfElelrM0DOL+sz4eBJ13nV1OppBGPuKb4YzXQgq9uH19uS/0+JS9t9fr6ZUlQBelDG6GMgq97otb5QMPJwtKyBTbFp8Sl7b6/X0ykkawEOsgdiE6Fi0vb/Eve6xkwsmug0Z4nGNHQO8839bpTsjpz7SWIJxKagvd1QWMa6FYT1KEw3j4XDT6vJ9Xk+nyfT5Pq8n1eEmk5dinMM/9Fcfz4Z3Dsz3KD2dw7LxBRxKrqUUGQPH/7zxr1KIfNpLEJ0MZB2ITM/0Z2EFoh12NlXnEcpYcbvON3nG7zjd5xu84vfcNIAAP7+y8ceyzbVxkakPYY4lcr72fqOnDwipv+yxC71wAADBrjKnAAAAAAAAAAAAAAw7oNGHttqWONcoFN/2WIDc2pa6WVFtFYROlsaMaTXdcOjXHz93+YxAglKa4AAAAA=';\nvar register = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\nvar CAM_LAYER = 21;\n\nvar applyPose = (function () {\n var tempQuaternion = new THREE.Quaternion();\n var tempVec3 = new THREE.Vector3();\n function applyPose (pose, object3D, offset) {\n object3D.position.copy(pose.transform.position);\n object3D.quaternion.copy(pose.transform.orientation);\n\n tempVec3.copy(offset);\n tempQuaternion.copy(pose.transform.orientation);\n tempVec3.applyQuaternion(tempQuaternion);\n object3D.position.sub(tempVec3);\n }\n return applyPose;\n}());\n\napplyPose.tempFakePose = {\n transform: {\n orientation: new THREE.Quaternion(),\n position: new THREE.Vector3()\n }\n};\n\n/**\n * Class to handle hit-test from a single source\n *\n * For a normal space provide it as a space option\n * new HitTest(renderer, {\n * space: viewerSpace\n * });\n *\n * this is also useful for the targetRaySpace of an XRInputSource\n *\n * It can also describe a transient input source like so:\n *\n * var profileToSupport = 'generic-touchscreen';\n * var transientHitTest = new HitTest(renderer, {\n * profile: profileToSupport\n * });\n *\n * Where the profile matches an item in a type of controller, profiles matching 'generic-touchscreen'\n * will always be a transient input and as of 08/2021 all transient inputs are 'generic-touchscreen'\n *\n * @param {WebGLRenderer} renderer THREE.JS Renderer\n * @param {} hitTestSourceDetails The source information either as the information for a transient hit-test or a regular hit-test\n */\nfunction HitTest (renderer, hitTestSourceDetails) {\n this.renderer = renderer;\n this.xrHitTestSource = null;\n\n renderer.xr.addEventListener('sessionend', function () {\n this.xrHitTestSource = null;\n }.bind(this));\n renderer.xr.addEventListener('sessionstart', function () {\n this.sessionStart(hitTestSourceDetails);\n }.bind(this));\n\n if (this.renderer.xr.isPresenting) {\n this.sessionStart(hitTestSourceDetails);\n }\n}\n\nHitTest.prototype.previousFrameAnchors = new Set();\nHitTest.prototype.anchorToObject3D = new Map();\n\nfunction warnAboutHitTest (e) {\n console.warn(e.message);\n console.warn('Cannot requestHitTestSource Are you missing: webxr=\"optionalFeatures: hit-test;\" from <a-scene>?');\n}\n\nHitTest.prototype.sessionStart = function sessionStart (hitTestSourceDetails) {\n this.session = this.renderer.xr.getSession();\n if (!('requestHitTestSource' in this.session)) {\n warnAboutHitTest({message: 'No requestHitTestSource on the session.'});\n return;\n }\n if (hitTestSourceDetails.space) {\n this.session.requestHitTestSource(hitTestSourceDetails)\n .then(function (xrHitTestSource) {\n this.xrHitTestSource = xrHitTestSource;\n }.bind(this))\n .catch(warnAboutHitTest);\n } else if (hitTestSourceDetails.profile) {\n this.session.requestHitTestSourceForTransientInput(hitTestSourceDetails)\n .then(function (xrHitTestSource) {\n this.xrHitTestSource = xrHitTestSource;\n this.transient = true;\n }.bind(this))\n .catch(warnAboutHitTest);\n }\n};\n\n/**\n * Turns the last hit test into an anchor, the provided Object3D will have it's\n * position update to track the anchor.\n *\n * @param {Object3D} object3D object to track\n * @param {Vector3} offset offset of the object from the origin that gets subtracted\n * @returns\n */\nHitTest.prototype.anchorFromLastHitTestResult = function (object3D, offset) {\n var hitTest = this.lastHitTest;\n\n if (!hitTest) { return; }\n\n var object3DOptions = {\n object3D: object3D,\n offset: offset\n };\n\n Array.from(this.anchorToObject3D.entries())\n .forEach(function (entry) {\n var entryObject = entry[1].object3D;\n var anchor = entry[0];\n if (entryObject === object3D) {\n this.anchorToObject3D.delete(anchor);\n anchor.delete();\n }\n }.bind(this));\n\n if (hitTest.createAnchor) {\n hitTest.createAnchor()\n .then(function (anchor) {\n this.anchorToObject3D.set(anchor, object3DOptions);\n }.bind(this))\n .catch(function (e) {\n console.warn(e.message);\n console.warn('Cannot create anchor, are you missing: webxr=\"optionalFeatures: anchors;\" from <a-scene>?');\n });\n }\n};\n\nHitTest.prototype.doHit = function doHit (frame) {\n if (!this.renderer.xr.isPresenting) { return; }\n var refSpace = this.renderer.xr.getReferenceSpace();\n var xrViewerPose = frame.getViewerPose(refSpace);\n var hitTestResults;\n var results;\n\n if (this.xrHitTestSource && xrViewerPose) {\n if (this.transient) {\n hitTestResults = frame.getHitTestResultsForTransientInput(this.xrHitTestSource);\n if (hitTestResults.length > 0) {\n results = hitTestResults[0].results;\n if (results.length > 0) {\n this.lastHitTest = results[0];\n return results[0].getPose(refSpace);\n } else {\n return false;\n }\n } else {\n return false;\n }\n } else {\n hitTestResults = frame.getHitTestResults(this.xrHitTestSource);\n if (hitTestResults.length > 0) {\n this.lastHitTest = hitTestResults[0];\n return hitTestResults[0].getPose(refSpace);\n } else {\n return false;\n }\n }\n }\n};\n\n// static function\nHitTest.updateAnchorPoses = function (frame, refSpace) {\n // If tracked anchors isn't defined because it's not supported then just use the empty set\n var trackedAnchors = frame.trackedAnchors || HitTest.prototype.previousFrameAnchors;\n\n HitTest.prototype.previousFrameAnchors.forEach(function (anchor) {\n // Handle anchor tracking loss - `anchor` was present\n // in the present frame but is no longer tracked.\n if (!trackedAnchors.has(anchor)) {\n HitTest.prototype.anchorToObject3D.delete(anchor);\n }\n });\n\n trackedAnchors.forEach(function (anchor) {\n var anchorPose;\n var object3DOptions;\n var offset;\n var object3D;\n\n try {\n // Query most recent pose of the anchor relative to some reference space:\n anchorPose = frame.getPose(anchor.anchorSpace, refSpace);\n } catch (e) {\n // This will fail if the anchor has been deleted that frame\n }\n\n if (anchorPose) {\n object3DOptions = HitTest.prototype.anchorToObject3D.get(anchor);\n offset = object3DOptions.offset;\n object3D = object3DOptions.object3D;\n\n applyPose(anchorPose, object3D, offset);\n }\n });\n};\n\nvar hitTestCache;\nmodule.exports.Component = register('ar-hit-test', {\n schema: {\n target: { type: 'selector' },\n enabled: { default: true },\n src: {\n default: arrowURL,\n type: 'map'\n },\n type: {\n default: 'footprint',\n oneOf: ['footprint', 'map']\n },\n footprintDepth: {\n default: 0.1\n },\n mapSize: {\n type: 'vec2',\n default: {\n x: 0.5,\n y: 0.5\n }\n }\n },\n\n init: function () {\n this.hitTest = null;\n this.imageDataArray = new Uint8ClampedArray(512 * 512 * 4);\n this.imageData = new ImageData(this.imageDataArray, 512, 512);\n\n this.textureCache = new Map();\n\n this.orthoCam = new THREE.OrthographicCamera();\n this.orthoCam.layers.set(CAM_LAYER);\n this.textureTarget = new THREE.WebGLRenderTarget(512, 512, {});\n this.basicMaterial = new THREE.MeshBasicMaterial({\n color: 0x000000,\n side: THREE.DoubleSide\n });\n this.canvas = document.createElement('canvas');\n this.context = this.canvas.getContext('2d');\n this.context.imageSmoothingEnabled = false;\n this.canvas.width = 512;\n this.canvas.height = 512;\n this.canvasTexture = new THREE.CanvasTexture(this.canvas, {\n alpha: true\n });\n this.canvasTexture.flipY = false;\n\n // Update WebXR to support hit-test and anchors\n var webxrData = this.el.getAttribute('webxr');\n var optionalFeaturesArray = webxrData.optionalFeatures;\n if (\n !optionalFeaturesArray.includes('hit-test') ||\n !optionalFeaturesArray.includes('anchors')\n ) {\n optionalFeaturesArray.push('hit-test');\n optionalFeaturesArray.push('anchors');\n this.el.setAttribute('webxr', webxrData);\n }\n\n this.el.sceneEl.renderer.xr.addEventListener('sessionend', function () {\n this.hitTest = null;\n }.bind(this));\n\n this.el.sceneEl.renderer.xr.addEventListener('sessionstart', function () {\n var renderer = this.el.sceneEl.renderer;\n var session = this.session = renderer.xr.getSession();\n this.hasPosedOnce = false;\n this.bboxMesh.visible = false;\n\n if (!hitTestCache) { hitTestCache = new Map(); }\n\n // Default to selecting through the face\n session.requestReferenceSpace('viewer')\n .then(function (viewerSpace) {\n this.hitTest = new HitTest(renderer, {\n space: viewerSpace\n });\n\n hitTestCache.set(viewerSpace, this.hitTest);\n\n this.el.emit('ar-hit-test-start');\n }.bind(this));\n\n // These are transient inputs so need to be handled seperately\n var profileToSupport = 'generic-touchscreen';\n var transientHitTest = new HitTest(renderer, {\n profile: profileToSupport\n });\n\n session.addEventListener('selectstart', function (e) {\n if (this.data.enabled !== true) { return; }\n\n var inputSource = e.inputSource;\n\n this.bboxMesh.visible = true;\n\n if (this.hasPosedOnce === true) {\n this.el.emit('ar-hit-test-select-start', {\n inputSource: inputSource,\n position: this.bboxMesh.position,\n orientation: this.bboxMesh.quaternion\n });\n\n if (inputSource.profiles[0] === profileToSupport) {\n this.hitTest = transientHitTest;\n } else {\n this.hitTest = hitTestCache.get(inputSource) || new HitTest(renderer, {\n space: inputSource.targetRaySpace\n });\n hitTestCache.set(inputSource, this.hitTest);\n }\n }\n }.bind(this));\n\n session.addEventListener('selectend', function (e) {\n if (!this.hitTest || this.data.enabled !== true) {\n this.hitTest = null;\n return;\n }\n\n var inputSource = e.inputSource;\n var object;\n\n if (this.hasPosedOnce === true) {\n this.bboxMesh.visible = false;\n\n // if we have a target with a 3D object then automatically generate an anchor for it.\n if (this.data.target) {\n object = this.data.target.object3D;\n\n if (object) {\n applyPose.tempFakePose.transform.position.copy(this.bboxMesh.position);\n applyPose.tempFakePose.transform.orientation.copy(this.bboxMesh.quaternion);\n applyPose(applyPose.tempFakePose, object, this.bboxOffset);\n object.visible = true;\n\n // create an anchor attatched to the object\n this.hitTest.anchorFromLastHitTestResult(object, this.bboxOffset);\n }\n }\n\n this.el.emit('ar-hit-test-select', {\n inputSource: inputSource,\n position: this.bboxMesh.position,\n orientation: this.bboxMesh.quaternion\n });\n }\n\n this.hitTest = null;\n }.bind(this));\n }.bind(this));\n\n this.bboxOffset = new THREE.Vector3();\n this.update = this.update.bind(this);\n this.makeBBox();\n },\n update: function () {\n if (this.data.target) {\n if (this.data.target.object3D) {\n this.data.target.addEventListener('model-loaded', this.update);\n this.data.target.object3D.layers.enable(CAM_LAYER);\n this.data.target.object3D.traverse(function (child) {\n child.layers.enable(CAM_LAYER);\n });\n } else {\n this.data.target.addEventListener('loaded', this.update, {once: true});\n }\n }\n this.bboxNeedsUpdate = true;\n },\n makeBBox: function () {\n var geometry = new THREE.PlaneGeometry(1, 1);\n var material = new THREE.MeshBasicMaterial({\n transparent: true,\n color: 0xffffff\n });\n geometry.rotateX(-Math.PI / 2);\n geometry.rotateY(-Math.PI / 2);\n this.bbox = new THREE.Box3();\n this.bboxMesh = new THREE.Mesh(geometry, material);\n this.el.setObject3D('ar-hit-test', this.bboxMesh);\n this.bboxMesh.visible = false;\n },\n updateFootprint: function () {\n var tempImageData;\n var renderer = this.el.sceneEl.renderer;\n var oldRenderTarget, oldBackground;\n var isXREnabled = renderer.xr.enabled;\n this.bboxMesh.material.map = this.canvasTexture;\n this.bboxMesh.material.needsUpdate = true;\n this.orthoCam.rotation.set(-Math.PI / 2, 0, -Math.PI / 2);\n this.orthoCam.position.copy(this.bboxMesh.position);\n this.orthoCam.position.y -= this.bboxMesh.scale.y / 2;\n this.orthoCam.near = 0.1;\n this.orthoCam.far = this.orthoCam.near + (this.data.footprintDepth * this.bboxMesh.scale.y);\n this.orthoCam.position.y += this.orthoCam.far;\n this.orthoCam.right = this.bboxMesh.scale.z / 2;\n this.orthoCam.left = -this.bboxMesh.scale.z / 2;\n this.orthoCam.top = this.bboxMesh.scale.x / 2;\n this.orthoCam.bottom = -this.bboxMesh.scale.x / 2;\n this.orthoCam.updateProjectionMatrix();\n\n oldRenderTarget = renderer.getRenderTarget();\n renderer.setRenderTarget(this.textureTarget);\n renderer.xr.enabled = false;\n oldBackground = this.el.object3D.background;\n this.el.object3D.overrideMaterial = this.basicMaterial;\n this.el.object3D.background = null;\n renderer.render(this.el.object3D, this.orthoCam);\n this.el.object3D.background = oldBackground;\n this.el.object3D.overrideMaterial = null;\n renderer.xr.enabled = isXREnabled;\n renderer.setRenderTarget(oldRenderTarget);\n renderer.readRenderTargetPixels(this.textureTarget, 0, 0, 512, 512, this.imageDataArray);\n\n this.context.putImageData(this.imageData, 0, 0);\n this.context.shadowColor = 'white';\n this.context.shadowBlur = 10;\n this.context.drawImage(this.canvas, 0, 0);\n tempImageData = this.context.getImageData(0, 0, 512, 512);\n for (var i = 0; i < 512 * 512; i++) {\n // if it's a little bit transparent but not opaque make it middle transparent\n if (tempImageData.data[ i * 4 + 3 ] !== 0 && tempImageData.data[ i * 4 + 3 ] !== 255) {\n tempImageData.data[ i * 4 + 3 ] = 128;\n }\n }\n this.context.putImageData(tempImageData, 0, 0);\n this.canvasTexture.needsUpdate = true;\n },\n tick: function () {\n var pose;\n var frame = this.el.sceneEl.frame;\n var renderer = this.el.sceneEl.renderer;\n\n if (frame) {\n // if we are in XR then update the positions of the objects attatched to anchors\n HitTest.updateAnchorPoses(frame, renderer.xr.getReferenceSpace());\n }\n if (this.bboxNeedsUpdate) {\n this.bboxNeedsUpdate = false;\n\n if (!this.data.target || this.data.type === 'map') {\n var texture;\n if (this.textureCache.has(this.data.src)) {\n texture = this.textureCache.get(this.data.src);\n } else {\n texture = new THREE.TextureLoader().load(this.data.src);\n this.textureCache.set(this.data.src, texture);\n }\n this.bboxMesh.material.map = texture;\n this.bboxMesh.material.needsUpdate = true;\n }\n\n if (this.data.target && this.data.target.object3D) {\n this.bbox.setFromObject(this.data.target.object3D);\n this.bbox.getCenter(this.bboxMesh.position);\n this.bbox.getSize(this.bboxMesh.scale);\n\n if (this.data.type === 'footprint') {\n // Add a little buffer for the footprint border\n this.bboxMesh.scale.x *= 1.04;\n this.bboxMesh.scale.z *= 1.04;\n this.updateFootprint();\n }\n\n this.bboxMesh.position.y -= this.bboxMesh.scale.y / 2;\n this.bboxOffset.copy(this.bboxMesh.position);\n this.bboxOffset.sub(this.data.target.object3D.position);\n } else {\n this.bboxMesh.scale.set(this.data.mapSize.x, 1, this.data.mapSize.y);\n }\n }\n\n if (this.hitTest) {\n pose = this.hitTest.doHit(frame);\n if (pose) {\n if (this.hasPosedOnce !== true) {\n this.hasPosedOnce = true;\n this.el.emit('ar-hit-test-achieved');\n }\n this.bboxMesh.visible = true;\n this.bboxMesh.position.copy(pose.transform.position);\n this.bboxMesh.quaternion.copy(pose.transform.orientation);\n }\n }\n }\n});\n",
  340. "/* global THREE, XRWebGLBinding */\nvar register = require('../../core/component').registerComponent;\nvar COMPONENTS = require('../../core/component').components;\n\n// source: view-source:https://storage.googleapis.com/chromium-webxr-test/r886480/proposals/lighting-estimation.html\nfunction updateLights (estimate, probeLight, directionalLight, directionalLightPosition) {\n var intensityScalar =\n Math.max(1.0,\n Math.max(estimate.primaryLightIntensity.x,\n Math.max(estimate.primaryLightIntensity.y,\n estimate.primaryLightIntensity.z)));\n\n probeLight.sh.fromArray(estimate.sphericalHarmonicsCoefficients);\n probeLight.intensity = 1;\n\n directionalLight.color.setRGB(\n estimate.primaryLightIntensity.x / intensityScalar,\n estimate.primaryLightIntensity.y / intensityScalar,\n estimate.primaryLightIntensity.z / intensityScalar);\n\n directionalLight.intensity = intensityScalar;\n directionalLightPosition.copy(estimate.primaryLightDirection);\n}\n\nmodule.exports.Component = register('background', {\n schema: {\n color: { type: 'color', default: 'black' },\n transparent: { default: false },\n generateEnvironment: { default: true },\n directionalLight: { type: 'selector' }\n },\n init: function () {\n var self = this;\n\n this.pmremGenerator = new THREE.PMREMGenerator(this.el.renderer);\n this.pmremGenerator.compileCubemapShader();\n this.cubeRenderTarget = new THREE.WebGLCubeRenderTarget(256, { format: THREE.RGBFormat, generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter });\n this.lightProbeTarget = new THREE.WebGLCubeRenderTarget(16, { format: THREE.RGBFormat, generateMipmaps: false });\n this.cubeCamera = new THREE.CubeCamera(0.1, 1000, this.cubeRenderTarget);\n this.needsEnvironmentUpdate = true;\n this.timeSinceUpdate = 0;\n\n // Update WebXR to support light-estimation\n var webxrData = this.el.getAttribute('webxr');\n var optionalFeaturesArray = webxrData.optionalFeatures;\n if (!optionalFeaturesArray.includes('light-estimation')) {\n optionalFeaturesArray.push('light-estimation');\n this.el.setAttribute('webxr', webxrData);\n }\n\n this.el.sceneEl.addEventListener('enter-vr', function () {\n var renderer = self.el.renderer;\n var session = renderer.xr.getSession();\n if (\n session.requestLightProbe && self.el.sceneEl.is('ar-mode')\n ) {\n self.startLightProbe();\n }\n });\n\n this.el.sceneEl.addEventListener('exit-vr', function () {\n self.stopLightProbe();\n });\n },\n stopLightProbe: function () {\n var data = this.data;\n var scene = this.el.sceneEl.object3D;\n this.xrLightProbe = null;\n\n this.probeLight.components.light.light.intensity = 0;\n if (this.ownDirectionalLight) {\n this.ownDirectionalLight.components.light.light.intensity = 0;\n }\n\n if (data.generateEnvironment) {\n this.needsEnvironmentUpdate = true;\n } else {\n scene.environment = null;\n }\n },\n setupLightsForLightingEstimation: function () {\n // Make a directionalLight if required\n if (this.data.directionalLight) {\n this.directionalLight = this.data.directionalLight;\n } else {\n var directionalLight = this.ownDirectionalLight || document.createElement('a-light');\n directionalLight.setAttribute('type', 'directional');\n directionalLight.setAttribute('intensity', 0);\n this.el.appendChild(directionalLight);\n this.directionalLight = directionalLight;\n this.ownDirectionalLight = directionalLight;\n }\n\n if (!this.probeLight) {\n var probeLight = document.createElement('a-light');\n probeLight.setAttribute('type', 'probe');\n probeLight.setAttribute('intensity', 0);\n this.el.appendChild(probeLight);\n this.probeLight = probeLight;\n }\n },\n startLightProbe: function () {\n var data = this.data;\n var scene = this.el.sceneEl.object3D;\n\n if (data.generateEnvironment) {\n this.needsLightProbeUpdate = true;\n this.needsEnvironmentUpdate = true;\n } else {\n scene.environment = null;\n }\n },\n setupLightProbe: function () {\n var scene = this.el.object3D;\n var renderer = this.el.renderer;\n var xrSession = renderer.xr.getSession();\n var self = this;\n var gl = renderer.getContext();\n\n this.setupLightsForLightingEstimation();\n\n this.glBinding = new XRWebGLBinding(xrSession, gl);\n gl.getExtension('EXT_sRGB');\n gl.getExtension('OES_texture_half_float');\n\n xrSession.requestLightProbe()\n .then(function (lightProbe) {\n scene.environment = self.lightProbeTarget.texture;\n\n self.xrLightProbe = lightProbe;\n lightProbe.addEventListener('reflectionchange', function onReflectionChanged () {\n self.needsEnvironmentUpdate = true;\n });\n })\n .catch(function (err) {\n console.warn('Lighting estimation not supported: ' + err.message);\n console.warn('Are you missing: webxr=\"optionalFeatures: light-estimation;\" from <a-scene>?');\n });\n },\n update: function () {\n var scene = this.el.sceneEl.object3D;\n var data = this.data;\n var object3D = this.el.object3D;\n\n if (data.transparent) {\n object3D.background = null;\n } else {\n object3D.background = new THREE.Color(data.color);\n }\n\n if (data.generateEnvironment) {\n this.needsEnvironmentUpdate = true;\n } else {\n scene.environment = null;\n }\n },\n\n updateXRCubeMap: function () {\n // Update Cube Map, cubeMap maybe some unavailable on some hardware\n var renderer = this.el.renderer;\n var cubeMap = this.glBinding.getReflectionCubeMap(this.xrLightProbe);\n if (cubeMap) {\n var rendererProps = renderer.properties.get(this.lightProbeTarget.texture);\n rendererProps.__webglTexture = cubeMap;\n }\n },\n\n tick: function () {\n var scene = this.el.object3D;\n var renderer = this.el.renderer;\n var frame = this.el.sceneEl.frame;\n\n if (frame && this.xrLightProbe) {\n // light estimate may not yet be available, it takes a few frames to start working\n var estimate = frame.getLightEstimate(this.xrLightProbe);\n\n if (estimate) {\n updateLights(\n estimate,\n this.probeLight.components.light.light,\n this.directionalLight.components.light.light,\n this.directionalLight.object3D.position\n );\n }\n }\n\n if (!this.needsEnvironmentUpdate) {\n return;\n }\n\n if (this.needsLightProbeUpdate) {\n // wait until the XR Session has started before trying to make\n // the light probe\n if (!frame) {\n return;\n }\n this.needsLightProbeUpdate = false;\n this.setupLightProbe();\n }\n\n if (this.xrLightProbe) {\n this.updateXRCubeMap();\n } else {\n this.cubeCamera.position.set(0, 1.6, 0);\n scene.environment = null;\n this.cubeCamera.update(renderer, scene);\n scene.environment = this.pmremGenerator.fromCubemap(\n this.cubeRenderTarget.texture\n ).texture;\n }\n\n this.needsEnvironmentUpdate = false;\n },\n\n remove: function () {\n var data = this.data;\n var object3D = this.el.object3D;\n if (data.transparent) {\n object3D.background = null;\n return;\n }\n this.pmremGenerator.dispose();\n object3D.background = COMPONENTS[this.name].schema.color.default;\n }\n});\n",
  341. "var register = require('../../core/component').registerComponent;\n\nmodule.exports.Component = register('debug', {\n schema: {default: true}\n});\n",
  342. "/* global DeviceOrientationEvent, location */\nvar registerComponent = require('../../core/component').registerComponent;\nvar utils = require('../../utils/');\nvar bind = utils.bind;\n\nvar constants = require('../../constants/');\n\nvar MODAL_CLASS = 'a-modal';\nvar DIALOG_CLASS = 'a-dialog';\nvar DIALOG_TEXT_CLASS = 'a-dialog-text';\nvar DIALOG_TEXT_CONTAINER_CLASS = 'a-dialog-text-container';\nvar DIALOG_BUTTONS_CONTAINER_CLASS = 'a-dialog-buttons-container';\nvar DIALOG_BUTTON_CLASS = 'a-dialog-button';\nvar DIALOG_ALLOW_BUTTON_CLASS = 'a-dialog-allow-button';\nvar DIALOG_DENY_BUTTON_CLASS = 'a-dialog-deny-button';\nvar DIALOG_OK_BUTTON_CLASS = 'a-dialog-ok-button';\n\n/**\n * UI for enabling device motion permission\n */\nmodule.exports.Component = registerComponent('device-orientation-permission-ui', {\n schema: {\n enabled: {default: true},\n deviceMotionMessage: {\n default: 'This immersive website requires access to your device motion sensors.'\n },\n httpsMessage: {\n default: 'Access this site over HTTPS to enter VR mode and grant access to the device sensors.'\n },\n denyButtonText: {default: 'Deny'},\n allowButtonText: {default: 'Allow'},\n cancelButtonText: {default: 'Cancel'}\n },\n\n init: function () {\n var self = this;\n\n if (!this.data.enabled) { return; }\n\n if (location.hostname !== 'localhost' &&\n location.hostname !== '127.0.0.1' &&\n location.protocol === 'http:') {\n this.showHTTPAlert();\n }\n\n // Browser doesn't support or doesn't require permission to DeviceOrientationEvent API.\n if (typeof DeviceOrientationEvent === 'undefined' || !DeviceOrientationEvent.requestPermission) {\n this.permissionGranted = true;\n return;\n }\n\n this.onDeviceMotionDialogAllowClicked = bind(this.onDeviceMotionDialogAllowClicked, this);\n this.onDeviceMotionDialogDenyClicked = bind(this.onDeviceMotionDialogDenyClicked, this);\n // Show dialog only if permission has not yet been granted.\n DeviceOrientationEvent.requestPermission().catch(function () {\n self.devicePermissionDialogEl = createPermissionDialog(\n self.data.denyButtonText,\n self.data.allowButtonText,\n self.data.deviceMotionMessage,\n self.onDeviceMotionDialogAllowClicked,\n self.onDeviceMotionDialogDenyClicked);\n self.el.appendChild(self.devicePermissionDialogEl);\n }).then(function () {\n self.el.emit('deviceorientationpermissiongranted');\n self.permissionGranted = true;\n });\n },\n\n remove: function () {\n // This removes the modal screen\n if (this.devicePermissionDialogEl) { this.el.removeChild(this.devicePermissionDialogEl); }\n },\n\n onDeviceMotionDialogDenyClicked: function () {\n this.remove();\n },\n\n showHTTPAlert: function () {\n var self = this;\n var httpAlertEl = createAlertDialog(\n self.data.cancelButtonText,\n self.data.httpsMessage,\n function () { self.el.removeChild(httpAlertEl); });\n this.el.appendChild(httpAlertEl);\n },\n\n /**\n * Enable device motion permission when clicked.\n */\n onDeviceMotionDialogAllowClicked: function () {\n var self = this;\n this.el.emit('deviceorientationpermissionrequested');\n DeviceOrientationEvent.requestPermission().then(function (response) {\n if (response === 'granted') {\n self.el.emit('deviceorientationpermissiongranted');\n self.permissionGranted = true;\n } else {\n self.el.emit('deviceorientationpermissionrejected');\n }\n self.remove();\n }).catch(console.error);\n }\n});\n\n/**\n * Create a modal dialog that request users permission to access the Device Motion API.\n *\n * @param {function} onAllowClicked - click event handler\n * @param {function} onDenyClicked - click event handler\n *\n * @returns {Element} Wrapper <div>.\n */\nfunction createPermissionDialog (\n denyText, allowText, dialogText, onAllowClicked, onDenyClicked) {\n var buttonsContainer;\n var denyButton;\n var acceptButton;\n\n buttonsContainer = document.createElement('div');\n buttonsContainer.classList.add(DIALOG_BUTTONS_CONTAINER_CLASS);\n\n // Buttons\n denyButton = document.createElement('button');\n denyButton.classList.add(DIALOG_BUTTON_CLASS, DIALOG_DENY_BUTTON_CLASS);\n denyButton.setAttribute(constants.AFRAME_INJECTED, '');\n denyButton.innerHTML = denyText;\n buttonsContainer.appendChild(denyButton);\n\n acceptButton = document.createElement('button');\n acceptButton.classList.add(DIALOG_BUTTON_CLASS, DIALOG_ALLOW_BUTTON_CLASS);\n acceptButton.setAttribute(constants.AFRAME_INJECTED, '');\n acceptButton.innerHTML = allowText;\n buttonsContainer.appendChild(acceptButton);\n\n // Ask for sensor events to be used\n acceptButton.addEventListener('click', function (evt) {\n evt.stopPropagation();\n onAllowClicked();\n });\n\n denyButton.addEventListener('click', function (evt) {\n evt.stopPropagation();\n onDenyClicked();\n });\n\n return createDialog(dialogText, buttonsContainer);\n}\n\nfunction createAlertDialog (closeText, dialogText, onOkClicked) {\n var buttonsContainer;\n var okButton;\n\n buttonsContainer = document.createElement('div');\n buttonsContainer.classList.add(DIALOG_BUTTONS_CONTAINER_CLASS);\n\n // Buttons\n okButton = document.createElement('button');\n okButton.classList.add(DIALOG_BUTTON_CLASS, DIALOG_OK_BUTTON_CLASS);\n okButton.setAttribute(constants.AFRAME_INJECTED, '');\n okButton.innerHTML = closeText;\n buttonsContainer.appendChild(okButton);\n\n // Ask for sensor events to be used\n okButton.addEventListener('click', function (evt) {\n evt.stopPropagation();\n onOkClicked();\n });\n\n return createDialog(dialogText, buttonsContainer);\n}\n\nfunction createDialog (text, buttonsContainerEl) {\n var modalContainer;\n var dialog;\n var dialogTextContainer;\n var dialogText;\n\n modalContainer = document.createElement('div');\n modalContainer.classList.add(MODAL_CLASS);\n modalContainer.setAttribute(constants.AFRAME_INJECTED, '');\n\n dialog = document.createElement('div');\n dialog.className = DIALOG_CLASS;\n dialog.setAttribute(constants.AFRAME_INJECTED, '');\n modalContainer.appendChild(dialog);\n\n dialogTextContainer = document.createElement('div');\n dialogTextContainer.classList.add(DIALOG_TEXT_CONTAINER_CLASS);\n dialog.appendChild(dialogTextContainer);\n\n dialogText = document.createElement('div');\n dialogText.classList.add(DIALOG_TEXT_CLASS);\n dialogText.innerHTML = text;\n dialogTextContainer.appendChild(dialogText);\n\n dialog.appendChild(buttonsContainerEl);\n\n return modalContainer;\n}\n",
  343. "var registerComponent = require('../../core/component').registerComponent;\n\n/**\n * Component to embed an a-frame scene within the layout of a 2D page.\n */\nmodule.exports.Component = registerComponent('embedded', {\n dependencies: ['vr-mode-ui'],\n\n schema: {default: true},\n\n update: function () {\n var sceneEl = this.el;\n var enterVREl = sceneEl.querySelector('.a-enter-vr');\n if (this.data === true) {\n if (enterVREl) { enterVREl.classList.add('embedded'); }\n sceneEl.removeFullScreenStyles();\n } else {\n if (enterVREl) { enterVREl.classList.remove('embedded'); }\n sceneEl.addFullScreenStyles();\n }\n }\n\n});\n",
  344. "var register = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\nvar debug = require('../../utils/debug');\n\nvar warn = debug('components:fog:warn');\n\n/**\n * Fog component.\n * Applies only to the scene entity.\n */\nmodule.exports.Component = register('fog', {\n schema: {\n color: {type: 'color', default: '#000'},\n density: {default: 0.00025},\n far: {default: 1000, min: 0},\n near: {default: 1, min: 0},\n type: {default: 'linear', oneOf: ['linear', 'exponential']}\n },\n\n update: function () {\n var data = this.data;\n var el = this.el;\n var fog = this.el.object3D.fog;\n\n if (!el.isScene) {\n warn('Fog component can only be applied to <a-scene>');\n return;\n }\n\n // (Re)create fog if fog doesn't exist or fog type changed.\n if (!fog || data.type !== fog.name) {\n el.object3D.fog = getFog(data);\n el.systems.material.updateMaterials();\n return;\n }\n\n // Fog data changed. Update fog.\n Object.keys(this.schema).forEach(function (key) {\n var value = data[key];\n if (key === 'color') { value = new THREE.Color(value); }\n fog[key] = value;\n });\n },\n\n /**\n * Remove fog on remove (callback).\n */\n remove: function () {\n var fog = this.el.object3D.fog;\n if (!fog) { return; }\n fog.far = 0;\n fog.near = 0.1;\n }\n});\n\n/**\n * Creates a fog object. Sets fog.name to be able to detect fog type changes.\n *\n * @param {object} data - Fog data.\n * @returns {object} fog\n */\nfunction getFog (data) {\n var fog;\n if (data.type === 'exponential') {\n fog = new THREE.FogExp2(data.color, data.density);\n } else {\n fog = new THREE.Fog(data.color, data.near, data.far);\n }\n fog.name = data.type;\n return fog;\n}\n",
  345. "/* global AFRAME */\nvar AFRAME_INJECTED = require('../../constants').AFRAME_INJECTED;\nvar pkg = require('../../../package');\nvar registerComponent = require('../../core/component').registerComponent;\nvar utils = require('../../utils/');\n\n/**\n * 0.4.2 to 0.4.x\n * Will need to update this when A-Frame goes to 1.x.x.\n */\nfunction getFuzzyPatchVersion (version) {\n var split = version.split('.');\n split[2] = 'x';\n return split.join('.');\n}\n\nvar INSPECTOR_DEV_URL = 'https://aframe.io/aframe-inspector/dist/aframe-inspector.js';\nvar INSPECTOR_RELEASE_URL = 'https://unpkg.com/aframe-inspector@' + getFuzzyPatchVersion(pkg.version) + '/dist/aframe-inspector.min.js';\nvar INSPECTOR_URL = process.env.INSPECTOR_VERSION === 'dev' ? INSPECTOR_DEV_URL : INSPECTOR_RELEASE_URL;\nvar LOADING_MESSAGE = 'Loading Inspector';\nvar LOADING_ERROR_MESSAGE = 'Error loading Inspector';\n\nmodule.exports.Component = registerComponent('inspector', {\n schema: {\n url: {default: INSPECTOR_URL}\n },\n\n init: function () {\n this.firstPlay = true;\n this.onKeydown = this.onKeydown.bind(this);\n this.onMessage = this.onMessage.bind(this);\n this.initOverlay();\n window.addEventListener('keydown', this.onKeydown);\n window.addEventListener('message', this.onMessage);\n },\n\n play: function () {\n var urlParam;\n if (!this.firstPlay) { return; }\n urlParam = utils.getUrlParameter('inspector');\n if (urlParam !== 'false' && !!urlParam) {\n this.openInspector();\n this.firstPlay = false;\n }\n },\n\n initOverlay: function () {\n var dotsHTML = '<span class=\"dots\"><span>.</span><span>.</span><span>.</span></span>';\n this.loadingMessageEl = document.createElement('div');\n this.loadingMessageEl.classList.add('a-inspector-loader');\n this.loadingMessageEl.innerHTML = LOADING_MESSAGE + dotsHTML;\n },\n\n remove: function () {\n this.removeEventListeners();\n },\n\n /**\n * <ctrl> + <alt> + i keyboard shortcut.\n */\n onKeydown: function (evt) {\n var shortcutPressed = evt.keyCode === 73 && (evt.ctrlKey && evt.altKey || evt.getModifierState('AltGraph'));\n if (!shortcutPressed) { return; }\n this.openInspector();\n },\n\n showLoader: function () {\n document.body.appendChild(this.loadingMessageEl);\n },\n\n hideLoader: function () {\n document.body.removeChild(this.loadingMessageEl);\n },\n\n /**\n * postMessage. aframe.io uses this to create a button on examples to open Inspector.\n */\n onMessage: function (evt) {\n if (evt.data === 'INJECT_AFRAME_INSPECTOR') { this.openInspector(); }\n },\n\n openInspector: function (focusEl) {\n var self = this;\n var script;\n\n // Already injected. Open.\n if (AFRAME.INSPECTOR || AFRAME.inspectorInjected) {\n AFRAME.INSPECTOR.open(focusEl);\n return;\n }\n\n this.showLoader();\n\n // Inject.\n script = document.createElement('script');\n script.src = this.data.url;\n script.setAttribute('data-name', 'aframe-inspector');\n script.setAttribute(AFRAME_INJECTED, '');\n script.onload = function () {\n AFRAME.INSPECTOR.open(focusEl);\n self.hideLoader();\n self.removeEventListeners();\n };\n script.onerror = function () {\n self.loadingMessageEl.innerHTML = LOADING_ERROR_MESSAGE;\n };\n document.head.appendChild(script);\n AFRAME.inspectorInjected = true;\n },\n\n removeEventListeners: function () {\n window.removeEventListener('keydown', this.onKeydown);\n window.removeEventListener('message', this.onMessage);\n }\n});\n",
  346. "var registerComponent = require('../../core/component').registerComponent;\nvar shouldCaptureKeyEvent = require('../../utils/').shouldCaptureKeyEvent;\n\nmodule.exports.Component = registerComponent('keyboard-shortcuts', {\n schema: {\n enterVR: {default: true},\n exitVR: {default: true}\n },\n\n init: function () {\n this.onKeyup = this.onKeyup.bind(this);\n },\n\n update: function (oldData) {\n var data = this.data;\n this.enterVREnabled = data.enterVR;\n },\n\n play: function () {\n window.addEventListener('keyup', this.onKeyup, false);\n },\n\n pause: function () {\n window.removeEventListener('keyup', this.onKeyup);\n },\n\n onKeyup: function (evt) {\n var scene = this.el;\n if (!shouldCaptureKeyEvent(evt)) { return; }\n if (this.enterVREnabled && evt.keyCode === 70) { // f.\n scene.enterVR();\n }\n if (this.enterVREnabled && evt.keyCode === 27) { // escape.\n scene.exitVR();\n }\n }\n});\n",
  347. "var debug = require('../../utils/debug');\nvar registerComponent = require('../../core/component').registerComponent;\n\nvar warn = debug('components:pool:warn');\n\n/**\n * Pool component to reuse entities.\n * Avoids creating and destroying the same kind of entities.\n * Helps reduce GC pauses. For example in a game to reuse enemies entities.\n *\n * @member {array} availableEls - Available entities in the pool.\n * @member {array} usedEls - Entities of the pool in use.\n */\nmodule.exports.Component = registerComponent('pool', {\n schema: {\n container: {default: ''},\n mixin: {default: ''},\n size: {default: 0},\n dynamic: {default: false}\n },\n\n multiple: true,\n\n initPool: function () {\n var i;\n\n this.availableEls = [];\n this.usedEls = [];\n\n if (!this.data.mixin) {\n warn('No mixin provided for pool component.');\n }\n\n if (this.data.container) {\n this.container = document.querySelector(this.data.container);\n if (!this.container) {\n warn('Container ' + this.data.container + ' not found.');\n }\n }\n this.container = this.container || this.el;\n\n for (i = 0; i < this.data.size; ++i) {\n this.createEntity();\n }\n },\n\n update: function (oldData) {\n var data = this.data;\n if (oldData.mixin !== data.mixin || oldData.size !== data.size) {\n this.initPool();\n }\n },\n\n /**\n * Add a new entity to the list of available entities.\n */\n createEntity: function () {\n var el;\n el = document.createElement('a-entity');\n el.play = this.wrapPlay(el.play);\n el.setAttribute('mixin', this.data.mixin);\n el.object3D.visible = false;\n el.pause();\n this.container.appendChild(el);\n this.availableEls.push(el);\n },\n\n /**\n * Play wrapper for pooled entities. When pausing and playing a scene, don't want to play\n * entities that are not in use.\n */\n wrapPlay: function (playMethod) {\n var usedEls = this.usedEls;\n return function () {\n if (usedEls.indexOf(this) === -1) { return; }\n playMethod.call(this);\n };\n },\n\n /**\n * Used to request one of the available entities of the pool.\n */\n requestEntity: function () {\n var el;\n if (this.availableEls.length === 0) {\n if (this.data.dynamic === false) {\n warn('Requested entity from empty pool: ' + this.attrName);\n return;\n } else {\n warn('Requested entity from empty pool. This pool is dynamic and will resize ' +\n 'automatically. You might want to increase its initial size: ' + this.attrName);\n }\n this.createEntity();\n }\n el = this.availableEls.shift();\n this.usedEls.push(el);\n el.object3D.visible = true;\n return el;\n },\n\n /**\n * Used to return a used entity to the pool.\n */\n returnEntity: function (el) {\n var index = this.usedEls.indexOf(el);\n if (index === -1) {\n warn('The returned entity was not previously pooled from ' + this.attrName);\n return;\n }\n this.usedEls.splice(index, 1);\n this.availableEls.push(el);\n el.object3D.visible = false;\n el.pause();\n return el;\n }\n});\n",
  348. "/* global ImageData, URL */\nvar registerComponent = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\n\nvar VERTEX_SHADER = [\n 'attribute vec3 position;',\n 'attribute vec2 uv;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'varying vec2 vUv;',\n 'void main() {',\n ' vUv = vec2( 1.- uv.x, uv.y );',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER = [\n 'precision mediump float;',\n 'uniform samplerCube map;',\n 'varying vec2 vUv;',\n '#define M_PI 3.141592653589793238462643383279',\n 'void main() {',\n ' vec2 uv = vUv;',\n ' float longitude = uv.x * 2. * M_PI - M_PI + M_PI / 2.;',\n ' float latitude = uv.y * M_PI;',\n ' vec3 dir = vec3(',\n ' - sin( longitude ) * sin( latitude ),',\n ' cos( latitude ),',\n ' - cos( longitude ) * sin( latitude )',\n ' );',\n ' normalize( dir );',\n ' gl_FragColor = vec4( textureCube( map, dir ).rgb, 1.0 );',\n '}'\n].join('\\n');\n\n/**\n * Component to take screenshots of the scene using a keboard shortcut (alt+s).\n * It can be configured to either take 360&deg; captures (`equirectangular`)\n * or regular screenshots (`projection`)\n *\n * This is based on https://github.com/spite/THREE.CubemapToEquirectangular\n * To capture an equirectangular projection of the scene a THREE.CubeCamera is used\n * The cube map produced by the CubeCamera is projected on a quad and then rendered to\n * WebGLRenderTarget with an ortographic camera.\n */\nmodule.exports.Component = registerComponent('screenshot', {\n schema: {\n width: {default: 4096},\n height: {default: 2048},\n camera: {type: 'selector'}\n },\n\n init: function () {\n var el = this.el;\n var self = this;\n\n if (el.renderer) {\n setup();\n } else {\n el.addEventListener('render-target-loaded', setup);\n }\n\n function setup () {\n var gl = el.renderer.getContext();\n if (!gl) { return; }\n self.cubeMapSize = gl.getParameter(gl.MAX_CUBE_MAP_TEXTURE_SIZE);\n self.material = new THREE.RawShaderMaterial({\n uniforms: {map: {type: 't', value: null}},\n vertexShader: VERTEX_SHADER,\n fragmentShader: FRAGMENT_SHADER,\n side: THREE.DoubleSide\n });\n self.quad = new THREE.Mesh(\n new THREE.PlaneBufferGeometry(1, 1),\n self.material\n );\n self.quad.visible = false;\n self.camera = new THREE.OrthographicCamera(-1 / 2, 1 / 2, 1 / 2, -1 / 2, -10000, 10000);\n self.canvas = document.createElement('canvas');\n self.ctx = self.canvas.getContext('2d');\n el.object3D.add(self.quad);\n self.onKeyDown = self.onKeyDown.bind(self);\n }\n },\n\n getRenderTarget: function (width, height) {\n return new THREE.WebGLRenderTarget(width, height, {\n encoding: THREE.sRGBEncoding,\n minFilter: THREE.LinearFilter,\n magFilter: THREE.LinearFilter,\n wrapS: THREE.ClampToEdgeWrapping,\n wrapT: THREE.ClampToEdgeWrapping,\n format: THREE.RGBAFormat,\n type: THREE.UnsignedByteType\n });\n },\n\n resize: function (width, height) {\n // Resize quad.\n this.quad.scale.set(width, height, 1);\n\n // Resize camera.\n this.camera.left = -1 * width / 2;\n this.camera.right = width / 2;\n this.camera.top = height / 2;\n this.camera.bottom = -1 * height / 2;\n this.camera.updateProjectionMatrix();\n\n // Resize canvas.\n this.canvas.width = width;\n this.canvas.height = height;\n },\n\n play: function () {\n window.addEventListener('keydown', this.onKeyDown);\n },\n\n /**\n * <ctrl> + <alt> + s = Regular screenshot.\n * <ctrl> + <alt> + <shift> + s = Equirectangular screenshot.\n */\n onKeyDown: function (evt) {\n var shortcutPressed = evt.keyCode === 83 && evt.ctrlKey && evt.altKey;\n if (!this.data || !shortcutPressed) { return; }\n var projection = evt.shiftKey ? 'equirectangular' : 'perspective';\n this.capture(projection);\n },\n\n /**\n * Capture a screenshot of the scene.\n *\n * @param {string} projection - Screenshot projection (equirectangular or perspective).\n */\n setCapture: function (projection) {\n var el = this.el;\n var size;\n var camera;\n var cubeCamera;\n var cubeRenderTarget;\n // Configure camera.\n if (projection === 'perspective') {\n // Quad is only used in equirectangular mode. Hide it in this case.\n this.quad.visible = false;\n // Use scene camera.\n camera = (this.data.camera && this.data.camera.components.camera.camera) || el.camera;\n size = {width: this.data.width, height: this.data.height};\n } else {\n // Use ortho camera.\n camera = this.camera;\n cubeRenderTarget = new THREE.WebGLCubeRenderTarget(\n Math.min(this.cubeMapSize, 2048),\n {\n format: THREE.RGBFormat,\n generateMipmaps: true,\n minFilter: THREE.LinearMipmapLinearFilter,\n encoding: THREE.sRGBEncoding\n });\n // Create cube camera and copy position from scene camera.\n cubeCamera = new THREE.CubeCamera(el.camera.near, el.camera.far, cubeRenderTarget);\n // Copy camera position into cube camera;\n el.camera.getWorldPosition(cubeCamera.position);\n el.camera.getWorldQuaternion(cubeCamera.quaternion);\n // Render scene with cube camera.\n cubeCamera.update(el.renderer, el.object3D);\n this.quad.material.uniforms.map.value = cubeCamera.renderTarget.texture;\n size = {width: this.data.width, height: this.data.height};\n // Use quad to project image taken by the cube camera.\n this.quad.visible = true;\n }\n return {\n camera: camera,\n size: size,\n projection: projection\n };\n },\n\n /**\n * Maintained for backwards compatibility.\n */\n capture: function (projection) {\n var isVREnabled = this.el.renderer.xr.enabled;\n var renderer = this.el.renderer;\n var params;\n // Disable VR.\n renderer.xr.enabled = false;\n params = this.setCapture(projection);\n this.renderCapture(params.camera, params.size, params.projection);\n // Trigger file download.\n this.saveCapture();\n // Restore VR.\n renderer.xr.enabled = isVREnabled;\n },\n\n /**\n * Return canvas instead of triggering download (e.g., for uploading blob to server).\n */\n getCanvas: function (projection) {\n var isVREnabled = this.el.renderer.xr.enabled;\n var renderer = this.el.renderer;\n // Disable VR.\n var params = this.setCapture(projection);\n renderer.xr.enabled = false;\n this.renderCapture(params.camera, params.size, params.projection);\n // Restore VR.\n renderer.xr.enabled = isVREnabled;\n return this.canvas;\n },\n\n renderCapture: function (camera, size, projection) {\n var autoClear = this.el.renderer.autoClear;\n var el = this.el;\n var imageData;\n var output;\n var pixels;\n var renderer = el.renderer;\n // Create rendering target and buffer to store the read pixels.\n output = this.getRenderTarget(size.width, size.height);\n pixels = new Uint8Array(4 * size.width * size.height);\n // Resize quad, camera, and canvas.\n this.resize(size.width, size.height);\n // Render scene to render target.\n renderer.autoClear = true;\n renderer.clear();\n renderer.setRenderTarget(output);\n renderer.render(el.object3D, camera);\n renderer.autoClear = autoClear;\n // Read image pizels back.\n renderer.readRenderTargetPixels(output, 0, 0, size.width, size.height, pixels);\n renderer.setRenderTarget(null);\n if (projection === 'perspective') {\n pixels = this.flipPixelsVertically(pixels, size.width, size.height);\n }\n imageData = new ImageData(new Uint8ClampedArray(pixels), size.width, size.height);\n // Hide quad after projecting the image.\n this.quad.visible = false;\n // Copy pixels into canvas.\n this.ctx.putImageData(imageData, 0, 0);\n },\n\n flipPixelsVertically: function (pixels, width, height) {\n var flippedPixels = pixels.slice(0);\n for (var x = 0; x < width; ++x) {\n for (var y = 0; y < height; ++y) {\n flippedPixels[x * 4 + y * width * 4] = pixels[x * 4 + (height - y) * width * 4];\n flippedPixels[x * 4 + 1 + y * width * 4] = pixels[x * 4 + 1 + (height - y) * width * 4];\n flippedPixels[x * 4 + 2 + y * width * 4] = pixels[x * 4 + 2 + (height - y) * width * 4];\n flippedPixels[x * 4 + 3 + y * width * 4] = pixels[x * 4 + 3 + (height - y) * width * 4];\n }\n }\n return flippedPixels;\n },\n\n /**\n * Download capture to file.\n */\n saveCapture: function () {\n this.canvas.toBlob(function (blob) {\n var fileName = 'screenshot-' + document.title.toLowerCase() + '-' + Date.now() + '.png';\n var linkEl = document.createElement('a');\n var url = URL.createObjectURL(blob);\n linkEl.href = url;\n linkEl.setAttribute('download', fileName);\n linkEl.innerHTML = 'downloading...';\n linkEl.style.display = 'none';\n document.body.appendChild(linkEl);\n setTimeout(function () {\n linkEl.click();\n document.body.removeChild(linkEl);\n }, 1);\n }, 'image/png');\n }\n});\n",
  349. "var registerComponent = require('../../core/component').registerComponent;\nvar RStats = require('../../../vendor/rStats');\nvar utils = require('../../utils');\nrequire('../../../vendor/rStats.extras');\nrequire('../../lib/rStatsAframe');\n\nvar AFrameStats = window.aframeStats;\nvar bind = utils.bind;\nvar HIDDEN_CLASS = 'a-hidden';\nvar ThreeStats = window.threeStats;\n\n/**\n * Stats appended to document.body by RStats.\n */\nmodule.exports.Component = registerComponent('stats', {\n schema: {default: true},\n\n init: function () {\n var scene = this.el;\n\n if (utils.getUrlParameter('stats') === 'false') { return; }\n\n this.stats = createStats(scene);\n this.statsEl = document.querySelector('.rs-base');\n\n this.hideBound = bind(this.hide, this);\n this.showBound = bind(this.show, this);\n\n scene.addEventListener('enter-vr', this.hideBound);\n scene.addEventListener('exit-vr', this.showBound);\n },\n\n update: function () {\n if (!this.stats) { return; }\n return (!this.data) ? this.hide() : this.show();\n },\n\n remove: function () {\n this.el.removeEventListener('enter-vr', this.hideBound);\n this.el.removeEventListener('exit-vr', this.showBound);\n if (!this.statsEl) { return; } // Scene detached.\n this.statsEl.parentNode.removeChild(this.statsEl);\n },\n\n tick: function () {\n var stats = this.stats;\n\n if (!stats) { return; }\n\n stats('rAF').tick();\n stats('FPS').frame();\n stats().update();\n },\n\n hide: function () {\n this.statsEl.classList.add(HIDDEN_CLASS);\n },\n\n show: function () {\n this.statsEl.classList.remove(HIDDEN_CLASS);\n }\n});\n\nfunction createStats (scene) {\n var threeStats = new ThreeStats(scene.renderer);\n var aframeStats = new AFrameStats(scene);\n var plugins = scene.isMobile ? [] : [threeStats, aframeStats];\n return new RStats({\n css: [], // Our stylesheet is injected from `src/index.js`.\n values: {\n fps: {caption: 'fps', below: 30}\n },\n groups: [\n {caption: 'Framerate', values: ['fps', 'raf']}\n ],\n plugins: plugins\n });\n}\n",
  350. "var registerComponent = require('../../core/component').registerComponent;\nvar constants = require('../../constants/');\nvar utils = require('../../utils/');\nvar bind = utils.bind;\n\nvar ENTER_VR_CLASS = 'a-enter-vr';\nvar ENTER_AR_CLASS = 'a-enter-ar';\nvar ENTER_VR_BTN_CLASS = 'a-enter-vr-button';\nvar ENTER_AR_BTN_CLASS = 'a-enter-ar-button';\nvar HIDDEN_CLASS = 'a-hidden';\nvar ORIENTATION_MODAL_CLASS = 'a-orientation-modal';\n\n/**\n * UI for entering VR mode.\n */\nmodule.exports.Component = registerComponent('vr-mode-ui', {\n dependencies: ['canvas'],\n\n schema: {\n enabled: {default: true},\n enterVRButton: {default: ''},\n enterARButton: {default: ''}\n },\n\n init: function () {\n var self = this;\n var sceneEl = this.el;\n\n if (utils.getUrlParameter('ui') === 'false') { return; }\n\n this.insideLoader = false;\n this.enterVREl = null;\n this.enterAREl = null;\n this.orientationModalEl = null;\n this.bindMethods();\n\n // Hide/show VR UI when entering/exiting VR mode.\n sceneEl.addEventListener('enter-vr', this.updateEnterInterfaces);\n sceneEl.addEventListener('exit-vr', this.updateEnterInterfaces);\n sceneEl.addEventListener('update-vr-devices', this.updateEnterInterfaces);\n\n window.addEventListener('message', function (event) {\n if (event.data.type === 'loaderReady') {\n self.insideLoader = true;\n self.remove();\n }\n });\n\n // Modal that tells the user to change orientation if in portrait.\n window.addEventListener('orientationchange', this.toggleOrientationModalIfNeeded);\n },\n\n bindMethods: function () {\n this.onEnterVRButtonClick = bind(this.onEnterVRButtonClick, this);\n this.onEnterARButtonClick = bind(this.onEnterARButtonClick, this);\n this.onModalClick = bind(this.onModalClick, this);\n this.toggleOrientationModalIfNeeded = bind(this.toggleOrientationModalIfNeeded, this);\n this.updateEnterInterfaces = bind(this.updateEnterInterfaces, this);\n },\n\n /**\n * Exit VR when modal clicked.\n */\n onModalClick: function () {\n this.el.exitVR();\n },\n\n /**\n * Enter VR when clicked.\n */\n onEnterVRButtonClick: function () {\n this.el.enterVR();\n },\n\n /**\n * Enter AR when clicked.\n */\n onEnterARButtonClick: function () {\n this.el.enterAR();\n },\n\n update: function () {\n var data = this.data;\n var sceneEl = this.el;\n\n if (!data.enabled || this.insideLoader || utils.getUrlParameter('ui') === 'false') {\n return this.remove();\n }\n\n if (this.enterVREl || this.enterAREl || this.orientationModalEl) { return; }\n\n // Add UI if enabled and not already present.\n if (data.enterVRButton) {\n // Custom button.\n this.enterVREl = document.querySelector(data.enterVRButton);\n this.enterVREl.addEventListener('click', this.onEnterVRButtonClick);\n } else {\n this.enterVREl = createEnterVRButton(this.onEnterVRButtonClick);\n sceneEl.appendChild(this.enterVREl);\n }\n if (data.enterARButton) {\n // Custom button.\n this.enterAREl = document.querySelector(data.enterARButton);\n this.enterAREl.addEventListener('click', this.onEnterARButtonClick);\n } else {\n this.enterAREl = createEnterARButton(this.onEnterARButtonClick);\n sceneEl.appendChild(this.enterAREl);\n }\n\n this.orientationModalEl = createOrientationModal(this.onModalClick);\n sceneEl.appendChild(this.orientationModalEl);\n\n this.updateEnterInterfaces();\n },\n\n remove: function () {\n [this.enterVREl, this.enterAREl, this.orientationModalEl].forEach(function (uiElement) {\n if (uiElement && uiElement.parentNode) {\n uiElement.parentNode.removeChild(uiElement);\n }\n });\n this.enterVREl = undefined;\n this.enterAREl = undefined;\n this.orientationModalEl = undefined;\n },\n\n updateEnterInterfaces: function () {\n this.toggleEnterVRButtonIfNeeded();\n this.toggleEnterARButtonIfNeeded();\n this.toggleOrientationModalIfNeeded();\n },\n\n toggleEnterVRButtonIfNeeded: function () {\n var sceneEl = this.el;\n if (!this.enterVREl) { return; }\n if (sceneEl.is('vr-mode')) {\n this.enterVREl.classList.add(HIDDEN_CLASS);\n } else {\n this.enterVREl.classList.remove(HIDDEN_CLASS);\n }\n },\n\n toggleEnterARButtonIfNeeded: function () {\n var sceneEl = this.el;\n if (!this.enterAREl) { return; }\n // Hide the button while in a session, or if AR is not supported.\n if (sceneEl.is('vr-mode') || !utils.device.checkARSupport()) {\n this.enterAREl.classList.add(HIDDEN_CLASS);\n } else {\n this.enterAREl.classList.remove(HIDDEN_CLASS);\n }\n },\n\n toggleOrientationModalIfNeeded: function () {\n var sceneEl = this.el;\n var orientationModalEl = this.orientationModalEl;\n if (!orientationModalEl || !sceneEl.isMobile) { return; }\n if (!utils.device.isLandscape() && sceneEl.is('vr-mode')) {\n // Show if in VR mode on portrait.\n orientationModalEl.classList.remove(HIDDEN_CLASS);\n } else {\n orientationModalEl.classList.add(HIDDEN_CLASS);\n }\n }\n});\n\n/**\n * Create a button that when clicked will enter into stereo-rendering mode for VR.\n *\n * Structure: <div><button></div>\n *\n * @param {function} onClick - click event handler\n * @returns {Element} Wrapper <div>.\n */\nfunction createEnterVRButton (onClick) {\n var vrButton;\n var wrapper;\n\n // Create elements.\n wrapper = document.createElement('div');\n wrapper.classList.add(ENTER_VR_CLASS);\n wrapper.setAttribute(constants.AFRAME_INJECTED, '');\n vrButton = document.createElement('button');\n vrButton.className = ENTER_VR_BTN_CLASS;\n vrButton.setAttribute('title',\n 'Enter VR mode with a headset or fullscreen mode on a desktop. ' +\n 'Visit https://webvr.rocks or https://webvr.info for more information.');\n vrButton.setAttribute(constants.AFRAME_INJECTED, '');\n if (utils.device.isMobile()) { applyStickyHoverFix(vrButton); }\n // Insert elements.\n wrapper.appendChild(vrButton);\n vrButton.addEventListener('click', function (evt) {\n onClick();\n evt.stopPropagation();\n });\n return wrapper;\n}\n\n/**\n * Create a button that when clicked will enter into AR mode\n *\n * Structure: <div><button></div>\n *\n * @param {function} onClick - click event handler\n * @returns {Element} Wrapper <div>.\n */\nfunction createEnterARButton (onClick) {\n var arButton;\n var wrapper;\n\n // Create elements.\n wrapper = document.createElement('div');\n wrapper.classList.add(ENTER_AR_CLASS);\n wrapper.setAttribute(constants.AFRAME_INJECTED, '');\n arButton = document.createElement('button');\n arButton.className = ENTER_AR_BTN_CLASS;\n arButton.setAttribute('title',\n 'Enter AR mode with a headset or handheld device. ' +\n 'Visit https://webvr.rocks or https://webvr.info for more information.');\n arButton.setAttribute(constants.AFRAME_INJECTED, '');\n if (utils.device.isMobile()) { applyStickyHoverFix(arButton); }\n // Insert elements.\n wrapper.appendChild(arButton);\n arButton.addEventListener('click', function (evt) {\n onClick();\n evt.stopPropagation();\n });\n return wrapper;\n}\n\n/**\n * Creates a modal dialog to request the user to switch to landscape orientation.\n *\n * @param {function} onClick - click event handler\n * @returns {Element} Wrapper <div>.\n */\nfunction createOrientationModal (onClick) {\n var modal = document.createElement('div');\n modal.className = ORIENTATION_MODAL_CLASS;\n modal.classList.add(HIDDEN_CLASS);\n modal.setAttribute(constants.AFRAME_INJECTED, '');\n\n var exit = document.createElement('button');\n exit.setAttribute(constants.AFRAME_INJECTED, '');\n exit.innerHTML = 'Exit VR';\n\n // Exit VR on close.\n exit.addEventListener('click', onClick);\n\n modal.appendChild(exit);\n\n return modal;\n}\n\n/**\n * CSS hover state is sticky in iOS (as in 12/18/2019)\n * They are not removed on mouseleave and this function applies a class\n * to resets the style.\n *\n * @param {function} buttonEl - Button element\n */\nfunction applyStickyHoverFix (buttonEl) {\n buttonEl.addEventListener('touchstart', function () {\n buttonEl.classList.remove('resethover');\n });\n buttonEl.addEventListener('touchend', function () {\n buttonEl.classList.add('resethover');\n });\n}\n",
  351. "var component = require('../core/component');\nvar THREE = require('../lib/three');\nvar bind = require('../utils/bind');\nvar registerComponent = component.registerComponent;\n\n/**\n * Shadow component.\n *\n * When applied to an entity, that entity's geometry and any descendants will cast or receive\n * shadows as specified by the `cast` and `receive` properties.\n */\nmodule.exports.Component = registerComponent('shadow', {\n schema: {\n cast: {default: true},\n receive: {default: true}\n },\n\n init: function () {\n this.onMeshChanged = bind(this.update, this);\n this.el.addEventListener('object3dset', this.onMeshChanged);\n this.system.setShadowMapEnabled(true);\n },\n\n update: function () {\n var data = this.data;\n this.updateDescendants(data.cast, data.receive);\n },\n\n remove: function () {\n var el = this.el;\n el.removeEventListener('object3dset', this.onMeshChanged);\n this.updateDescendants(false, false);\n },\n\n updateDescendants: function (cast, receive) {\n var sceneEl = this.el.sceneEl;\n this.el.object3D.traverse(function (node) {\n if (!(node instanceof THREE.Mesh)) { return; }\n\n node.castShadow = cast;\n node.receiveShadow = receive;\n\n // If scene has already rendered, materials must be updated.\n if (sceneEl.hasLoaded && node.material) {\n var materials = Array.isArray(node.material) ? node.material : [node.material];\n for (var i = 0; i < materials.length; i++) {\n materials[i].needsUpdate = true;\n }\n }\n });\n }\n});\n",
  352. "var registerComponent = require('../core/component').registerComponent;\nvar debug = require('../utils/debug');\nvar THREE = require('../lib/three');\n\nvar warn = debug('components:sound:warn');\n\n/**\n * Sound component.\n */\nmodule.exports.Component = registerComponent('sound', {\n schema: {\n autoplay: {default: false},\n distanceModel: {default: 'inverse', oneOf: ['linear', 'inverse', 'exponential']},\n loop: {default: false},\n maxDistance: {default: 10000},\n on: {default: ''},\n poolSize: {default: 1},\n positional: {default: true},\n refDistance: {default: 1},\n rolloffFactor: {default: 1},\n src: {type: 'audio'},\n volume: {default: 1}\n },\n\n multiple: true,\n\n init: function () {\n var self = this;\n\n this.listener = null;\n this.audioLoader = new THREE.AudioLoader();\n this.pool = new THREE.Group();\n this.loaded = false;\n this.mustPlay = false;\n\n // Don't pass evt because playSound takes a function as parameter.\n this.playSoundBound = function () { self.playSound(); };\n },\n\n update: function (oldData) {\n var data = this.data;\n var i;\n var sound;\n var srcChanged = data.src !== oldData.src;\n\n // Create new sound if not yet created or changing `src`.\n if (srcChanged) {\n if (!data.src) { return; }\n this.setupSound();\n }\n\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (data.positional) {\n sound.setDistanceModel(data.distanceModel);\n sound.setMaxDistance(data.maxDistance);\n sound.setRefDistance(data.refDistance);\n sound.setRolloffFactor(data.rolloffFactor);\n }\n sound.setLoop(data.loop);\n sound.setVolume(data.volume);\n sound.isPaused = false;\n }\n\n if (data.on !== oldData.on) {\n this.updateEventListener(oldData.on);\n }\n\n // All sound values set. Load in `src`.\n if (srcChanged) {\n var self = this;\n\n this.loaded = false;\n this.audioLoader.load(data.src, function (buffer) {\n for (i = 0; i < self.pool.children.length; i++) {\n sound = self.pool.children[i];\n sound.setBuffer(buffer);\n }\n self.loaded = true;\n\n // Remove this key from cache, otherwise we can't play it again\n THREE.Cache.remove(data.src);\n if (self.data.autoplay || self.mustPlay) { self.playSound(); }\n self.el.emit('sound-loaded', self.evtDetail, false);\n });\n }\n },\n\n pause: function () {\n this.stopSound();\n this.removeEventListener();\n },\n\n play: function () {\n if (this.data.autoplay) { this.playSound(); }\n this.updateEventListener();\n },\n\n remove: function () {\n var i;\n var sound;\n\n this.removeEventListener();\n\n if (this.el.getObject3D(this.attrName)) {\n this.el.removeObject3D(this.attrName);\n }\n\n try {\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n sound.disconnect();\n }\n } catch (e) {\n // disconnect() will throw if it was never connected initially.\n warn('Audio source not properly disconnected');\n }\n },\n\n /**\n * Update listener attached to the user defined on event.\n */\n updateEventListener: function (oldEvt) {\n var el = this.el;\n if (oldEvt) { el.removeEventListener(oldEvt, this.playSoundBound); }\n el.addEventListener(this.data.on, this.playSoundBound);\n },\n\n removeEventListener: function () {\n this.el.removeEventListener(this.data.on, this.playSoundBound);\n },\n\n /**\n * Removes current sound object, creates new sound object, adds to entity.\n *\n * @returns {object} sound\n */\n setupSound: function () {\n var el = this.el;\n var i;\n var sceneEl = el.sceneEl;\n var self = this;\n var sound;\n\n if (this.pool.children.length > 0) {\n this.stopSound();\n el.removeObject3D('sound');\n }\n\n // Only want one AudioListener. Cache it on the scene.\n var listener = this.listener = sceneEl.audioListener || new THREE.AudioListener();\n sceneEl.audioListener = listener;\n\n if (sceneEl.camera) {\n sceneEl.camera.add(listener);\n }\n\n // Wait for camera if necessary.\n sceneEl.addEventListener('camera-set-active', function (evt) {\n evt.detail.cameraEl.getObject3D('camera').add(listener);\n });\n\n // Create [poolSize] audio instances and attach them to pool\n this.pool = new THREE.Group();\n for (i = 0; i < this.data.poolSize; i++) {\n sound = this.data.positional\n ? new THREE.PositionalAudio(listener)\n : new THREE.Audio(listener);\n this.pool.add(sound);\n }\n el.setObject3D(this.attrName, this.pool);\n\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n sound.onEnded = function () {\n this.isPlaying = false;\n self.el.emit('sound-ended', self.evtDetail, false);\n };\n }\n },\n\n /**\n * Pause all the sounds in the pool.\n */\n pauseSound: function () {\n var i;\n var sound;\n\n this.isPlaying = false;\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (!sound.source || !sound.source.buffer || !sound.isPlaying || sound.isPaused) {\n continue;\n }\n sound.isPaused = true;\n sound.pause();\n }\n },\n\n /**\n * Look for an unused sound in the pool and play it if found.\n */\n playSound: function (processSound) {\n var found;\n var i;\n var sound;\n\n if (!this.loaded) {\n warn('Sound not loaded yet. It will be played once it finished loading');\n this.mustPlay = true;\n return;\n }\n\n found = false;\n this.isPlaying = true;\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (!sound.isPlaying && sound.buffer && !found) {\n if (processSound) { processSound(sound); }\n sound.play();\n sound.isPaused = false;\n found = true;\n continue;\n }\n }\n\n if (!found) {\n warn('All the sounds are playing. If you need to play more sounds simultaneously ' +\n 'consider increasing the size of pool with the `poolSize` attribute.', this.el);\n return;\n }\n\n this.mustPlay = false;\n },\n\n /**\n * Stop all the sounds in the pool.\n */\n stopSound: function () {\n var i;\n var sound;\n this.isPlaying = false;\n for (i = 0; i < this.pool.children.length; i++) {\n sound = this.pool.children[i];\n if (!sound.source || !sound.source.buffer) { return; }\n sound.stop();\n }\n }\n});\n",
  353. "var createTextGeometry = require('three-bmfont-text');\nvar loadBMFont = require('load-bmfont');\n\nvar registerComponent = require('../core/component').registerComponent;\nvar coreShader = require('../core/shader');\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar error = utils.debug('components:text:error');\nvar shaders = coreShader.shaders;\nvar warn = utils.debug('components:text:warn');\n\n// 1 to match other A-Frame default widths.\nvar DEFAULT_WIDTH = 1;\n\n// @bryik set anisotropy to 16. Improves look of large amounts of text when viewed from angle.\nvar MAX_ANISOTROPY = 16;\n\nvar FONT_BASE_URL = 'https://cdn.aframe.io/fonts/';\nvar FONTS = {\n aileronsemibold: FONT_BASE_URL + 'Aileron-Semibold.fnt',\n dejavu: FONT_BASE_URL + 'DejaVu-sdf.fnt',\n exo2bold: FONT_BASE_URL + 'Exo2Bold.fnt',\n exo2semibold: FONT_BASE_URL + 'Exo2SemiBold.fnt',\n kelsonsans: FONT_BASE_URL + 'KelsonSans.fnt',\n monoid: FONT_BASE_URL + 'Monoid.fnt',\n mozillavr: FONT_BASE_URL + 'mozillavr.fnt',\n roboto: FONT_BASE_URL + 'Roboto-msdf.json',\n sourcecodepro: FONT_BASE_URL + 'SourceCodePro.fnt'\n};\nvar MSDF_FONTS = ['roboto'];\nvar DEFAULT_FONT = 'roboto';\nmodule.exports.FONTS = FONTS;\n\nvar cache = new PromiseCache();\nvar fontWidthFactors = {};\nvar textures = {};\n\n// Regular expression for detecting a URLs with a protocol prefix.\nvar protocolRe = /^\\w+:/;\n\n/**\n * SDF-based text component.\n * Based on https://github.com/Jam3/three-bmfont-text.\n *\n * All the stock fonts are for the `sdf` registered shader, an improved version of jam3's\n * original `sdf` shader.\n */\nmodule.exports.Component = registerComponent('text', {\n multiple: true,\n\n schema: {\n align: {type: 'string', default: 'left', oneOf: ['left', 'right', 'center']},\n alphaTest: {default: 0.5},\n // `anchor` defaults to center to match geometries.\n anchor: {default: 'center', oneOf: ['left', 'right', 'center', 'align']},\n baseline: {default: 'center', oneOf: ['top', 'center', 'bottom']},\n color: {type: 'color', default: '#FFF'},\n font: {type: 'string', default: DEFAULT_FONT},\n // `fontImage` defaults to the font name as a .png (e.g., mozillavr.fnt -> mozillavr.png).\n fontImage: {type: 'string'},\n // `height` has no default, will be populated at layout.\n height: {type: 'number'},\n letterSpacing: {type: 'number', default: 0},\n // `lineHeight` defaults to font's `lineHeight` value.\n lineHeight: {type: 'number'},\n // `negate` must be true for fonts generated with older versions of msdfgen (white background).\n negate: {type: 'boolean', default: true},\n opacity: {type: 'number', default: 1.0},\n shader: {default: 'sdf', oneOf: shaders},\n side: {default: 'front', oneOf: ['front', 'back', 'double']},\n tabSize: {default: 4},\n transparent: {default: true},\n value: {type: 'string'},\n whiteSpace: {default: 'normal', oneOf: ['normal', 'pre', 'nowrap']},\n // `width` defaults to geometry width if present, else `DEFAULT_WIDTH`.\n width: {type: 'number'},\n // `wrapCount` units are about one default font character. Wrap roughly at this number.\n wrapCount: {type: 'number', default: 40},\n // `wrapPixels` will wrap using bmfont pixel units (e.g., dejavu's is 32 pixels).\n wrapPixels: {type: 'number'},\n // `xOffset` to add padding.\n xOffset: {type: 'number', default: 0},\n // `yOffset` to adjust generated fonts from tools that may have incorrect metrics.\n yOffset: {type: 'number', default: 0},\n // `zOffset` will provide a small z offset to avoid z-fighting.\n zOffset: {type: 'number', default: 0.001}\n },\n\n init: function () {\n this.shaderData = {};\n this.geometry = createTextGeometry();\n this.createOrUpdateMaterial();\n },\n\n update: function (oldData) {\n var data = this.data;\n var font = this.currentFont;\n if (textures[data.font]) {\n this.texture = textures[data.font];\n } else {\n // Create texture per font.\n this.texture = textures[data.font] = new THREE.Texture();\n this.texture.anisotropy = MAX_ANISOTROPY;\n }\n\n // Update material.\n this.createOrUpdateMaterial();\n\n // New font. `updateFont` will later change data and layout.\n if (oldData.font !== data.font) {\n this.updateFont();\n return;\n }\n\n // Update geometry and layout.\n if (font) {\n this.updateGeometry(this.geometry, font);\n this.updateLayout();\n }\n },\n\n /**\n * Clean up geometry, material, texture, mesh, objects.\n */\n remove: function () {\n this.geometry.dispose();\n this.geometry = null;\n this.el.removeObject3D(this.attrName);\n this.material.dispose();\n this.material = null;\n this.texture.dispose();\n this.texture = null;\n if (this.shaderObject) { delete this.shaderObject; }\n },\n\n /**\n * Update the shader of the material.\n */\n createOrUpdateMaterial: function () {\n var data = this.data;\n var hasChangedShader;\n var material = this.material;\n var NewShader;\n var shaderData = this.shaderData;\n var shaderName;\n\n // Infer shader if using a stock font (or from `-msdf` filename convention).\n shaderName = data.shader;\n if (MSDF_FONTS.indexOf(data.font) !== -1 || data.font.indexOf('-msdf.') >= 0) {\n shaderName = 'msdf';\n } else if (data.font in FONTS && MSDF_FONTS.indexOf(data.font) === -1) {\n shaderName = 'sdf';\n }\n\n hasChangedShader = (this.shaderObject && this.shaderObject.name) !== shaderName;\n\n shaderData.alphaTest = data.alphaTest;\n shaderData.color = data.color;\n shaderData.map = this.texture;\n shaderData.opacity = data.opacity;\n shaderData.side = parseSide(data.side);\n shaderData.transparent = data.transparent;\n shaderData.negate = data.negate;\n\n // Shader has not changed, do an update.\n if (!hasChangedShader) {\n // Update shader material.\n this.shaderObject.update(shaderData);\n // Apparently, was not set on `init` nor `update`.\n material.transparent = shaderData.transparent;\n material.side = shaderData.side;\n return;\n }\n\n // Shader has changed. Create a shader material.\n NewShader = createShader(this.el, shaderName, shaderData);\n this.material = NewShader.material;\n this.shaderObject = NewShader.shader;\n\n // Set new shader material.\n this.material.side = shaderData.side;\n if (this.mesh) { this.mesh.material = this.material; }\n },\n\n /**\n * Load font for geometry, load font image for material, and apply.\n */\n updateFont: function () {\n var data = this.data;\n var el = this.el;\n var fontSrc;\n var geometry = this.geometry;\n var self = this;\n\n if (!data.font) { warn('No font specified. Using the default font.'); }\n\n // Make invisible during font swap.\n if (this.mesh) { this.mesh.visible = false; }\n\n // Look up font URL to use, and perform cached load.\n fontSrc = this.lookupFont(data.font || DEFAULT_FONT) || data.font;\n cache.get(fontSrc, function doLoadFont () {\n return loadFont(fontSrc, data.yOffset);\n }).then(function setFont (font) {\n var fontImgSrc;\n\n if (font.pages.length !== 1) {\n throw new Error('Currently only single-page bitmap fonts are supported.');\n }\n\n if (!fontWidthFactors[fontSrc]) {\n font.widthFactor = fontWidthFactors[font] = computeFontWidthFactor(font);\n }\n self.currentFont = font;\n // Look up font image URL to use, and perform cached load.\n fontImgSrc = self.getFontImageSrc();\n cache.get(fontImgSrc, function () {\n return loadTexture(fontImgSrc);\n }).then(function (image) {\n // Make mesh visible and apply font image as texture.\n var texture = self.texture;\n texture.image = image;\n texture.needsUpdate = true;\n textures[data.font] = texture;\n self.texture = texture;\n self.initMesh();\n self.currentFont = font;\n // Update geometry given font metrics.\n self.updateGeometry(geometry, font);\n self.updateLayout();\n self.mesh.visible = true;\n el.emit('textfontset', {font: data.font, fontObj: font});\n }).catch(function (err) {\n error(err.message);\n error(err.stack);\n });\n }).catch(function (err) {\n error(err.message);\n error(err.stack);\n });\n },\n\n initMesh: function () {\n if (this.mesh) { return; }\n this.mesh = new THREE.Mesh(this.geometry, this.material);\n this.el.setObject3D(this.attrName, this.mesh);\n },\n\n getFontImageSrc: function () {\n if (this.data.fontImage) { return this.data.fontImage; }\n var fontSrc = this.lookupFont(this.data.font || DEFAULT_FONT) || this.data.font;\n var imageSrc = this.currentFont.pages[0];\n // If the image URL contains a non-HTTP(S) protocol, assume it's an absolute\n // path on disk and try to infer the path from the font source instead.\n if (imageSrc.match(protocolRe) && imageSrc.indexOf('http') !== 0) {\n return fontSrc.replace(/(\\.fnt)|(\\.json)/, '.png');\n }\n return THREE.LoaderUtils.extractUrlBase(fontSrc) + imageSrc;\n },\n\n /**\n * Update layout with anchor, alignment, baseline, and considering any meshes.\n */\n updateLayout: function () {\n var anchor;\n var baseline;\n var el = this.el;\n var data = this.data;\n var geometry = this.geometry;\n var geometryComponent;\n var height;\n var layout;\n var mesh = this.mesh;\n var textRenderWidth;\n var textScale;\n var width;\n var x;\n var y;\n\n if (!mesh || !geometry.layout) { return; }\n\n // Determine width to use (defined width, geometry's width, or default width).\n geometryComponent = el.getAttribute('geometry');\n width = data.width || (geometryComponent && geometryComponent.width) || DEFAULT_WIDTH;\n\n // Determine wrap pixel count. Either specified or by experimental fudge factor.\n // Note that experimental factor will never be correct for variable width fonts.\n textRenderWidth = computeWidth(data.wrapPixels, data.wrapCount,\n this.currentFont.widthFactor);\n textScale = width / textRenderWidth;\n\n // Determine height to use.\n layout = geometry.layout;\n height = textScale * (layout.height + layout.descender);\n\n // Update geometry dimensions to match text layout if width and height are set to 0.\n // For example, scales a plane to fit text.\n if (geometryComponent && geometryComponent.primitive === 'plane') {\n if (!geometryComponent.width) { el.setAttribute('geometry', 'width', width); }\n if (!geometryComponent.height) { el.setAttribute('geometry', 'height', height); }\n }\n\n // Calculate X position to anchor text left, center, or right.\n anchor = data.anchor === 'align' ? data.align : data.anchor;\n if (anchor === 'left') {\n x = 0;\n } else if (anchor === 'right') {\n x = -1 * layout.width;\n } else if (anchor === 'center') {\n x = -1 * layout.width / 2;\n } else {\n throw new TypeError('Invalid text.anchor property value', anchor);\n }\n\n // Calculate Y position to anchor text top, center, or bottom.\n baseline = data.baseline;\n if (baseline === 'bottom') {\n y = 0;\n } else if (baseline === 'top') {\n y = -1 * layout.height + layout.ascender;\n } else if (baseline === 'center') {\n y = -1 * layout.height / 2;\n } else {\n throw new TypeError('Invalid text.baseline property value', baseline);\n }\n\n // Position and scale mesh to apply layout.\n mesh.position.x = x * textScale + data.xOffset;\n mesh.position.y = y * textScale;\n // Place text slightly in front to avoid Z-fighting.\n mesh.position.z = data.zOffset;\n mesh.scale.set(textScale, -1 * textScale, textScale);\n },\n\n /**\n * Grab font from the constant.\n * Set as a method for test stubbing purposes.\n */\n lookupFont: function (key) {\n return FONTS[key];\n },\n\n /**\n * Update the text geometry using `three-bmfont-text.update`.\n */\n updateGeometry: (function () {\n var geometryUpdateBase = {};\n var geometryUpdateData = {};\n var newLineRegex = /\\\\n/g;\n var tabRegex = /\\\\t/g;\n\n return function (geometry, font) {\n var data = this.data;\n\n geometryUpdateData.font = font;\n geometryUpdateData.lineHeight = data.lineHeight && isFinite(data.lineHeight)\n ? data.lineHeight\n : font.common.lineHeight;\n geometryUpdateData.text = data.value.toString().replace(newLineRegex, '\\n')\n .replace(tabRegex, '\\t');\n geometryUpdateData.width = computeWidth(data.wrapPixels, data.wrapCount,\n font.widthFactor);\n geometry.update(utils.extend(geometryUpdateBase, data, geometryUpdateData));\n };\n })()\n});\n\n/**\n * Due to using negative scale, we return the opposite side specified.\n * https://github.com/mrdoob/three.js/pull/12787/\n */\nfunction parseSide (side) {\n switch (side) {\n case 'back': {\n return THREE.FrontSide;\n }\n case 'double': {\n return THREE.DoubleSide;\n }\n default: {\n return THREE.BackSide;\n }\n }\n}\n\n/**\n * @returns {Promise}\n */\nfunction loadFont (src, yOffset) {\n return new Promise(function (resolve, reject) {\n loadBMFont(src, function (err, font) {\n if (err) {\n error('Error loading font', src);\n reject(err);\n return;\n }\n\n // Fix negative Y offsets for Roboto MSDF font from tool. Experimentally determined.\n if (src.indexOf('/Roboto-msdf.json') >= 0) { yOffset = 30; }\n if (yOffset) { font.chars.map(function doOffset (ch) { ch.yoffset += yOffset; }); }\n\n resolve(font);\n });\n });\n}\n\n/**\n * @returns {Promise}\n */\nfunction loadTexture (src) {\n return new Promise(function (resolve, reject) {\n new THREE.ImageLoader().load(src, function (image) {\n resolve(image);\n }, undefined, function () {\n error('Error loading font image', src);\n reject(null);\n });\n });\n}\n\nfunction createShader (el, shaderName, data) {\n var shader;\n var shaderObject;\n\n // Set up Shader.\n shaderObject = new shaders[shaderName].Shader();\n shaderObject.el = el;\n shaderObject.init(data);\n shaderObject.update(data);\n\n // Get material.\n shader = shaderObject.material;\n // Apparently, was not set on `init` nor `update`.\n shader.transparent = data.transparent;\n\n return {\n material: shader,\n shader: shaderObject\n };\n}\n\n/**\n * Determine wrap pixel count. Either specified or by experimental fudge factor.\n * Note that experimental factor will never be correct for variable width fonts.\n */\nfunction computeWidth (wrapPixels, wrapCount, widthFactor) {\n return wrapPixels || ((0.5 + wrapCount) * widthFactor);\n}\n\n/**\n * Compute default font width factor to use.\n */\nfunction computeFontWidthFactor (font) {\n var sum = 0;\n var digitsum = 0;\n var digits = 0;\n font.chars.map(function (ch) {\n sum += ch.xadvance;\n if (ch.id >= 48 && ch.id <= 57) {\n digits++;\n digitsum += ch.xadvance;\n }\n });\n return digits ? digitsum / digits : sum / font.chars.length;\n}\n\n/**\n * Get or create a promise given a key and promise generator.\n * @todo Move to a utility and use in other parts of A-Frame.\n */\nfunction PromiseCache () {\n var cache = this.cache = {};\n\n this.get = function (key, promiseGenerator) {\n if (key in cache) {\n return cache[key];\n }\n cache[key] = promiseGenerator();\n return cache[key];\n };\n}\n",
  354. "var registerComponent = require('../core/component').registerComponent;\nvar controllerUtils = require('../utils/tracked-controls');\nvar DEFAULT_CAMERA_HEIGHT = require('../constants').DEFAULT_CAMERA_HEIGHT;\nvar THREE = require('../lib/three');\n\nvar DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS;\n// Vector from eyes to elbow (divided by user height).\nvar EYES_TO_ELBOW = {x: 0.175, y: -0.3, z: -0.03};\n// Vector from eyes to elbow (divided by user height).\nvar FOREARM = {x: 0, y: 0, z: -0.175};\n\n// Due to unfortunate name collision, add empty touches array to avoid Daydream error.\nvar EMPTY_DAYDREAM_TOUCHES = {touches: []};\n\nvar EVENTS = {\n AXISMOVE: 'axismove',\n BUTTONCHANGED: 'buttonchanged',\n BUTTONDOWN: 'buttondown',\n BUTTONUP: 'buttonup',\n TOUCHSTART: 'touchstart',\n TOUCHEND: 'touchend'\n};\n\n/**\n * Tracked controls component.\n * Wrap the gamepad API for pose and button states.\n * Select the appropriate controller and apply pose to the entity.\n * Observe button states and emit appropriate events.\n *\n * @property {number} controller - Index of controller in array returned by Gamepad API.\n * Only used if hand property is not set.\n * @property {string} id - Selected controller among those returned by Gamepad API.\n * @property {number} hand - If multiple controllers found with id, choose the one with the\n * given value for hand. If set, we ignore 'controller' property\n */\nmodule.exports.Component = registerComponent('tracked-controls-webvr', {\n schema: {\n autoHide: {default: true},\n controller: {default: 0},\n id: {type: 'string', default: ''},\n hand: {type: 'string', default: ''},\n idPrefix: {type: 'string', default: ''},\n orientationOffset: {type: 'vec3'},\n // Arm model parameters when not 6DoF.\n armModel: {default: false},\n headElement: {type: 'selector'}\n },\n\n init: function () {\n // Copy variables back to tracked-controls for backwards compatibility.\n // Some 3rd components rely on them.\n this.axis = this.el.components['tracked-controls'].axis = [0, 0, 0];\n this.buttonStates = this.el.components['tracked-controls'].buttonStates = {};\n this.changedAxes = [];\n this.targetControllerNumber = this.data.controller;\n\n this.axisMoveEventDetail = {axis: this.axis, changed: this.changedAxes};\n this.deltaControllerPosition = new THREE.Vector3();\n this.controllerQuaternion = new THREE.Quaternion();\n this.controllerEuler = new THREE.Euler();\n\n this.updateGamepad();\n\n this.buttonEventDetails = {};\n },\n\n tick: function (time, delta) {\n var mesh = this.el.getObject3D('mesh');\n // Update mesh animations.\n if (mesh && mesh.update) { mesh.update(delta / 1000); }\n this.updateGamepad();\n this.updatePose();\n this.updateButtons();\n },\n\n /**\n * Return default user height to use for non-6DOF arm model.\n */\n defaultUserHeight: function () {\n return DEFAULT_CAMERA_HEIGHT;\n },\n\n /**\n * Return head element to use for non-6DOF arm model.\n */\n getHeadElement: function () {\n return this.data.headElement || this.el.sceneEl.camera.el;\n },\n\n /**\n * Handle update controller match criteria (such as `id`, `idPrefix`, `hand`, `controller`)\n */\n updateGamepad: function () {\n var data = this.data;\n var controller = controllerUtils.findMatchingControllerWebVR(\n this.system.controllers,\n data.id,\n data.idPrefix,\n data.hand,\n data.controller\n );\n\n this.controller = controller;\n // Legacy handle to the controller for old components.\n this.el.components['tracked-controls'].controller = controller;\n\n if (this.data.autoHide) { this.el.object3D.visible = !!this.controller; }\n },\n\n /**\n * Applies an artificial arm model to simulate elbow to wrist positioning\n * based on the orientation of the controller.\n *\n * @param {object} controllerPosition - Existing vector to update with controller position.\n */\n applyArmModel: function (controllerPosition) {\n // Use controllerPosition and deltaControllerPosition to avoid creating variables.\n var controller = this.controller;\n var controllerEuler = this.controllerEuler;\n var controllerQuaternion = this.controllerQuaternion;\n var deltaControllerPosition = this.deltaControllerPosition;\n var hand;\n var headEl;\n var headObject3D;\n var pose;\n var userHeight;\n\n headEl = this.getHeadElement();\n headObject3D = headEl.object3D;\n userHeight = this.defaultUserHeight();\n\n pose = controller.pose;\n hand = (controller ? controller.hand : undefined) || DEFAULT_HANDEDNESS;\n\n // Use camera position as head position.\n controllerPosition.copy(headObject3D.position);\n // Set offset for degenerate \"arm model\" to elbow.\n deltaControllerPosition.set(\n EYES_TO_ELBOW.x * (hand === 'left' ? -1 : hand === 'right' ? 1 : 0),\n EYES_TO_ELBOW.y, // Lower than our eyes.\n EYES_TO_ELBOW.z); // Slightly out in front.\n // Scale offset by user height.\n deltaControllerPosition.multiplyScalar(userHeight);\n // Apply camera Y rotation (not X or Z, so you can look down at your hand).\n deltaControllerPosition.applyAxisAngle(headObject3D.up, headObject3D.rotation.y);\n // Apply rotated offset to position.\n controllerPosition.add(deltaControllerPosition);\n\n // Set offset for degenerate \"arm model\" forearm. Forearm sticking out from elbow.\n deltaControllerPosition.set(FOREARM.x, FOREARM.y, FOREARM.z);\n // Scale offset by user height.\n deltaControllerPosition.multiplyScalar(userHeight);\n // Apply controller X/Y rotation (tilting up/down/left/right is usually moving the arm).\n if (pose.orientation) {\n controllerQuaternion.fromArray(pose.orientation);\n } else {\n controllerQuaternion.copy(headObject3D.quaternion);\n }\n controllerEuler.setFromQuaternion(controllerQuaternion);\n controllerEuler.set(controllerEuler.x, controllerEuler.y, 0);\n deltaControllerPosition.applyEuler(controllerEuler);\n // Apply rotated offset to position.\n controllerPosition.add(deltaControllerPosition);\n },\n\n /**\n * Read pose from controller (from Gamepad API), apply transforms, apply to entity.\n */\n updatePose: function () {\n var controller = this.controller;\n var data = this.data;\n var object3D = this.el.object3D;\n var pose;\n var vrDisplay = this.system.vrDisplay;\n var standingMatrix;\n\n if (!controller) { return; }\n\n // Compose pose from Gamepad.\n pose = controller.pose;\n\n if (pose.position) {\n object3D.position.fromArray(pose.position);\n } else {\n // Controller not 6DOF, apply arm model.\n if (data.armModel) { this.applyArmModel(object3D.position); }\n }\n\n if (pose.orientation) {\n object3D.quaternion.fromArray(pose.orientation);\n }\n\n // Apply transforms, if 6DOF and in VR.\n if (vrDisplay && pose.position) {\n standingMatrix = this.el.sceneEl.renderer.xr.getStandingMatrix();\n object3D.matrix.compose(object3D.position, object3D.quaternion, object3D.scale);\n object3D.matrix.multiplyMatrices(standingMatrix, object3D.matrix);\n object3D.matrix.decompose(object3D.position, object3D.quaternion, object3D.scale);\n }\n\n object3D.rotateX(this.data.orientationOffset.x * THREE.Math.DEG2RAD);\n object3D.rotateY(this.data.orientationOffset.y * THREE.Math.DEG2RAD);\n object3D.rotateZ(this.data.orientationOffset.z * THREE.Math.DEG2RAD);\n },\n\n /**\n * Handle button changes including axes, presses, touches, values.\n */\n updateButtons: function () {\n var buttonState;\n var controller = this.controller;\n var id;\n\n if (!controller) { return; }\n\n // Check every button.\n for (id = 0; id < controller.buttons.length; ++id) {\n // Initialize button state.\n if (!this.buttonStates[id]) {\n this.buttonStates[id] = {pressed: false, touched: false, value: 0};\n }\n if (!this.buttonEventDetails[id]) {\n this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};\n }\n\n buttonState = controller.buttons[id];\n this.handleButton(id, buttonState);\n }\n // Check axes.\n this.handleAxes();\n },\n\n /**\n * Handle presses and touches for a single button.\n *\n * @param {number} id - Index of button in Gamepad button array.\n * @param {number} buttonState - Value of button state from 0 to 1.\n * @returns {boolean} Whether button has changed in any way.\n */\n handleButton: function (id, buttonState) {\n var changed;\n changed = this.handlePress(id, buttonState) |\n this.handleTouch(id, buttonState) |\n this.handleValue(id, buttonState);\n if (!changed) { return false; }\n this.el.emit(EVENTS.BUTTONCHANGED, this.buttonEventDetails[id], false);\n return true;\n },\n\n /**\n * An axis is an array of values from -1 (up, left) to 1 (down, right).\n * Compare each component of the axis to the previous value to determine change.\n *\n * @returns {boolean} Whether axes changed.\n */\n handleAxes: function () {\n var changed = false;\n var controllerAxes = this.controller.axes;\n var i;\n var previousAxis = this.axis;\n var changedAxes = this.changedAxes;\n\n // Check if axis changed.\n this.changedAxes.splice(0, this.changedAxes.length);\n for (i = 0; i < controllerAxes.length; ++i) {\n changedAxes.push(previousAxis[i] !== controllerAxes[i]);\n if (changedAxes[i]) { changed = true; }\n }\n if (!changed) { return false; }\n\n this.axis.splice(0, this.axis.length);\n for (i = 0; i < controllerAxes.length; i++) {\n this.axis.push(controllerAxes[i]);\n }\n this.el.emit(EVENTS.AXISMOVE, this.axisMoveEventDetail, false);\n return true;\n },\n\n /**\n * Determine whether a button press has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button press state changed.\n */\n handlePress: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.pressed === previousButtonState.pressed) { return false; }\n\n evtName = buttonState.pressed ? EVENTS.BUTTONDOWN : EVENTS.BUTTONUP;\n this.el.emit(evtName, this.buttonEventDetails[id], false);\n previousButtonState.pressed = buttonState.pressed;\n return true;\n },\n\n /**\n * Determine whether a button touch has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button touch state changed.\n */\n handleTouch: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.touched === previousButtonState.touched) { return false; }\n\n evtName = buttonState.touched ? EVENTS.TOUCHSTART : EVENTS.TOUCHEND;\n this.el.emit(evtName, this.buttonEventDetails[id], false, EMPTY_DAYDREAM_TOUCHES);\n previousButtonState.touched = buttonState.touched;\n return true;\n },\n\n /**\n * Determine whether a button value has changed.\n *\n * @param {string} id - Id of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button value changed.\n */\n handleValue: function (id, buttonState) {\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.value === previousButtonState.value) { return false; }\n\n previousButtonState.value = buttonState.value;\n return true;\n }\n});\n",
  355. "var controllerUtils = require('../utils/tracked-controls');\nvar registerComponent = require('../core/component').registerComponent;\n\nvar EVENTS = {\n AXISMOVE: 'axismove',\n BUTTONCHANGED: 'buttonchanged',\n BUTTONDOWN: 'buttondown',\n BUTTONUP: 'buttonup',\n TOUCHSTART: 'touchstart',\n TOUCHEND: 'touchend'\n};\n\nmodule.exports.Component = registerComponent('tracked-controls-webxr', {\n schema: {\n id: {type: 'string', default: ''},\n hand: {type: 'string', default: ''},\n handTrackingEnabled: {default: false},\n index: {type: 'int', default: -1},\n iterateControllerProfiles: {default: false}\n },\n\n init: function () {\n this.updateController = this.updateController.bind(this);\n this.buttonEventDetails = {};\n this.buttonStates = this.el.components['tracked-controls'].buttonStates = {};\n this.axis = this.el.components['tracked-controls'].axis = [0, 0, 0];\n this.changedAxes = [];\n this.axisMoveEventDetail = {axis: this.axis, changed: this.changedAxes};\n },\n\n update: function () {\n this.updateController();\n },\n\n play: function () {\n var sceneEl = this.el.sceneEl;\n this.updateController();\n sceneEl.addEventListener('controllersupdated', this.updateController);\n },\n\n pause: function () {\n var sceneEl = this.el.sceneEl;\n sceneEl.removeEventListener('controllersupdated', this.updateController);\n },\n\n isControllerPresent: function (evt) {\n if (!this.controller || this.controller.gamepad) { return false; }\n if (evt.inputSource.handedness !== 'none' &&\n evt.inputSource.handedness !== this.data.hand) {\n return false;\n }\n return true;\n },\n\n /**\n * Handle update controller match criteria (such as `id`, `idPrefix`, `hand`, `controller`)\n */\n updateController: function () {\n this.controller = controllerUtils.findMatchingControllerWebXR(\n this.system.controllers,\n this.data.id,\n this.data.hand,\n this.data.index,\n this.data.iterateControllerProfiles,\n this.data.handTrackingEnabled\n );\n // Legacy handle to the controller for old components.\n this.el.components['tracked-controls'].controller = this.controller;\n if (this.data.autoHide) { this.el.object3D.visible = !!this.controller; }\n },\n\n tick: function () {\n var sceneEl = this.el.sceneEl;\n var controller = this.controller;\n var frame = sceneEl.frame;\n if (!controller || !sceneEl.frame || !this.system.referenceSpace) { return; }\n if (!controller.hand) {\n this.pose = frame.getPose(controller.targetRaySpace, this.system.referenceSpace);\n this.updatePose();\n this.updateButtons();\n }\n },\n\n updatePose: function () {\n var object3D = this.el.object3D;\n var pose = this.pose;\n if (!pose) { return; }\n object3D.matrix.elements = pose.transform.matrix;\n object3D.matrix.decompose(object3D.position, object3D.rotation, object3D.scale);\n },\n\n /**\n * Handle button changes including axes, presses, touches, values.\n */\n updateButtons: function () {\n var buttonState;\n var id;\n var controller = this.controller;\n var gamepad;\n if (!controller || !controller.gamepad) { return; }\n\n gamepad = controller.gamepad;\n // Check every button.\n for (id = 0; id < gamepad.buttons.length; ++id) {\n // Initialize button state.\n if (!this.buttonStates[id]) {\n this.buttonStates[id] = {pressed: false, touched: false, value: 0};\n }\n if (!this.buttonEventDetails[id]) {\n this.buttonEventDetails[id] = {id: id, state: this.buttonStates[id]};\n }\n\n buttonState = gamepad.buttons[id];\n this.handleButton(id, buttonState);\n }\n // Check axes.\n this.handleAxes();\n },\n\n /**\n * Handle presses and touches for a single button.\n *\n * @param {number} id - Index of button in Gamepad button array.\n * @param {number} buttonState - Value of button state from 0 to 1.\n * @returns {boolean} Whether button has changed in any way.\n */\n handleButton: function (id, buttonState) {\n var changed;\n changed = this.handlePress(id, buttonState) |\n this.handleTouch(id, buttonState) |\n this.handleValue(id, buttonState);\n if (!changed) { return false; }\n this.el.emit(EVENTS.BUTTONCHANGED, this.buttonEventDetails[id], false);\n return true;\n },\n\n /**\n * An axis is an array of values from -1 (up, left) to 1 (down, right).\n * Compare each component of the axis to the previous value to determine change.\n *\n * @returns {boolean} Whether axes changed.\n */\n handleAxes: function () {\n var changed = false;\n var controllerAxes = this.controller.gamepad.axes;\n var i;\n var previousAxis = this.axis;\n var changedAxes = this.changedAxes;\n\n // Check if axis changed.\n this.changedAxes.splice(0, this.changedAxes.length);\n for (i = 0; i < controllerAxes.length; ++i) {\n changedAxes.push(previousAxis[i] !== controllerAxes[i]);\n if (changedAxes[i]) { changed = true; }\n }\n if (!changed) { return false; }\n\n this.axis.splice(0, this.axis.length);\n for (i = 0; i < controllerAxes.length; i++) {\n this.axis.push(controllerAxes[i]);\n }\n this.el.emit(EVENTS.AXISMOVE, this.axisMoveEventDetail, false);\n return true;\n },\n\n /**\n * Determine whether a button press has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button press state changed.\n */\n handlePress: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.pressed === previousButtonState.pressed) { return false; }\n\n evtName = buttonState.pressed ? EVENTS.BUTTONDOWN : EVENTS.BUTTONUP;\n this.el.emit(evtName, this.buttonEventDetails[id], false);\n previousButtonState.pressed = buttonState.pressed;\n return true;\n },\n\n /**\n * Determine whether a button touch has occured and emit events as appropriate.\n *\n * @param {string} id - ID of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button touch state changed.\n */\n handleTouch: function (id, buttonState) {\n var evtName;\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.touched === previousButtonState.touched) { return false; }\n\n evtName = buttonState.touched ? EVENTS.TOUCHSTART : EVENTS.TOUCHEND;\n this.el.emit(evtName, this.buttonEventDetails[id], false);\n previousButtonState.touched = buttonState.touched;\n return true;\n },\n\n /**\n * Determine whether a button value has changed.\n *\n * @param {string} id - Id of the button to check.\n * @param {object} buttonState - State of the button to check.\n * @returns {boolean} Whether button value changed.\n */\n handleValue: function (id, buttonState) {\n var previousButtonState = this.buttonStates[id];\n\n // Not changed.\n if (buttonState.value === previousButtonState.value) { return false; }\n\n previousButtonState.value = buttonState.value;\n return true;\n }\n});\n",
  356. "var registerComponent = require('../core/component').registerComponent;\n\n/**\n * Tracked controls.\n * Abstract controls that decide if the WebVR or WebXR version is going to be applied.\n *\n * @property {number} controller - Index of controller in array returned by Gamepad API.\n * Only used if hand property is not set.\n * @property {string} id - Selected controller among those returned by Gamepad API.\n * @property {number} hand - If multiple controllers found with id, choose the one with the\n * given value for hand. If set, we ignore 'controller' property\n */\nmodule.exports.Component = registerComponent('tracked-controls', {\n schema: {\n autoHide: {default: true},\n controller: {default: -1},\n id: {type: 'string', default: ''},\n hand: {type: 'string', default: ''},\n idPrefix: {type: 'string', default: ''},\n handTrackingEnabled: {default: false},\n orientationOffset: {type: 'vec3'},\n // Arm model parameters when not 6DoF.\n armModel: {default: false},\n headElement: {type: 'selector'},\n iterateControllerProfiles: {default: false}\n },\n\n update: function () {\n var data = this.data;\n var el = this.el;\n if (el.sceneEl.hasWebXR) {\n el.setAttribute('tracked-controls-webxr', {\n id: data.id,\n hand: data.hand,\n index: data.controller,\n iterateControllerProfiles: data.iterateControllerProfiles,\n handTrackingEnabled: data.handTrackingEnabled\n });\n } else {\n el.setAttribute('tracked-controls-webvr', data);\n }\n }\n});\n",
  357. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\nvar THREE = require('../lib/three');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar INDEX_CONTROLLER_MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/valve/index/valve-index-';\nvar INDEX_CONTROLLER_MODEL_URL = {\n left: INDEX_CONTROLLER_MODEL_BASE_URL + 'left.glb',\n right: INDEX_CONTROLLER_MODEL_BASE_URL + 'right.glb'\n};\n\nvar GAMEPAD_ID_PREFIX = 'valve';\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar INDEX_CONTROLLER_POSITION_OFFSET_WEBVR = {\n left: {x: -0.00023692678902063457, y: 0.04724540367838371, z: -0.061959880395271096},\n right: {x: 0.002471558599671131, y: 0.055765208987076195, z: -0.061068168708348844}\n};\n\nvar INDEX_CONTROLLER_POSITION_OFFSET_WEBXR = {\n left: {x: 0, y: -0.05, z: 0.06},\n right: {x: 0, y: -0.05, z: 0.06}\n};\n\nvar INDEX_CONTROLLER_ROTATION_OFFSET_WEBVR = {\n left: {_x: 0.692295102620542, _y: -0.0627618864318427, _z: -0.06265893149611756, _order: 'XYZ'},\n right: {_x: 0.6484021229942998, _y: -0.032563619881892894, _z: -0.1327973171917482, _order: 'XYZ'}\n};\n\nvar INDEX_CONTROLLER_ROTATION_OFFSET_WEBXR = {\n left: {_x: Math.PI / 3, _y: 0, _z: 0, _order: 'XYZ'},\n right: {_x: Math.PI / 3, _y: 0, _z: 0, _order: 'XYZ'}\n};\n\nvar INDEX_CONTROLLER_ROTATION_OFFSET = isWebXRAvailable ? INDEX_CONTROLLER_ROTATION_OFFSET_WEBXR : INDEX_CONTROLLER_ROTATION_OFFSET_WEBVR;\n\nvar INDEX_CONTROLLER_POSITION_OFFSET = isWebXRAvailable ? INDEX_CONTROLLER_POSITION_OFFSET_WEBXR : INDEX_CONTROLLER_POSITION_OFFSET_WEBVR;\n/**\n * Vive controls.\n * Interface with Vive controllers and map Gamepad events to controller buttons:\n * trackpad, trigger, grip, menu, system\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('valve-index-controls', {\n schema: {\n hand: {default: 'left'},\n buttonColor: {type: 'color', default: '#FAFAFA'}, // Off-white.\n buttonHighlightColor: {type: 'color', default: '#22D1EE'}, // Light blue.\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: {\n axes: {\n trackpad: [0, 1],\n thumbstick: [2, 3]\n },\n buttons: ['trigger', 'grip', 'trackpad', 'thumbstick', 'abutton']\n },\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n /**\n * Once OpenVR returns correct hand data in supporting browsers, we can use hand property.\n * var isPresent = checkControllerPresentAndSetup(this.el.sceneEl, GAMEPAD_ID_PREFIX,\n { hand: data.hand });\n * Until then, use hardcoded index.\n */\n checkIfControllerPresent: function () {\n var data = this.data;\n var controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {index: controllerIndex, iterateControllerProfiles: true, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n // If we have an OpenVR Gamepad, use the fixed mapping.\n el.setAttribute('tracked-controls', {\n idPrefix: GAMEPAD_ID_PREFIX,\n // Hand IDs: 1 = right, 0 = left, 2 = anything else.\n controller: data.hand === 'right' ? 1 : data.hand === 'left' ? 0 : 2,\n hand: data.hand,\n orientationOffset: data.orientationOffset\n });\n\n this.loadModel();\n },\n\n loadModel: function () {\n var data = this.data;\n if (!data.model) { return; }\n this.el.setAttribute('gltf-model', '' + INDEX_CONTROLLER_MODEL_URL[data.hand] + '');\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n /**\n * Rotate the trigger button based on how hard the trigger is pressed.\n */\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n var buttonMeshes = this.buttonMeshes;\n var analogValue;\n\n if (!button) { return; }\n\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n // Update trigger rotation depending on button value.\n if (buttonMeshes && buttonMeshes.trigger) {\n buttonMeshes.trigger.rotation.x = this.triggerOriginalRotationX - analogValue * (Math.PI / 40);\n }\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var buttonMeshes;\n var controllerObject3D = evt.detail.model;\n var self = this;\n\n if (!this.data.model) { return; }\n\n // Store button meshes object to be able to change their colors.\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.grip = {\n left: controllerObject3D.getObjectByName('leftgrip'),\n right: controllerObject3D.getObjectByName('rightgrip')\n };\n buttonMeshes.menu = controllerObject3D.getObjectByName('menubutton');\n buttonMeshes.system = controllerObject3D.getObjectByName('systembutton');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('touchpad');\n buttonMeshes.trigger = controllerObject3D.getObjectByName('trigger');\n this.triggerOriginalRotationX = buttonMeshes.trigger.rotation.x;\n\n // Set default colors.\n Object.keys(buttonMeshes).forEach(function (buttonName) {\n self.setButtonColor(buttonName, self.data.buttonColor);\n });\n\n // Offset pivot point.\n controllerObject3D.position.copy(INDEX_CONTROLLER_POSITION_OFFSET[this.data.hand]);\n controllerObject3D.rotation.copy(INDEX_CONTROLLER_ROTATION_OFFSET[this.data.hand]);\n\n this.el.emit('controllermodelready', {\n name: 'valve-index-controlls',\n model: this.data.model,\n rayOrigin: new THREE.Vector3(0, 0, 0)\n });\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n var color;\n var isTouch;\n if (!this.data.model) { return; }\n\n isTouch = evtName.indexOf('touch') !== -1;\n // Don't change color for trackpad touch.\n if (isTouch) { return; }\n\n // Update colors.\n color = evtName === 'up' ? this.data.buttonColor : this.data.buttonHighlightColor;\n this.setButtonColor(buttonName, color);\n },\n setButtonColor: function (buttonName, color) {\n // TODO: The meshes aren't set up correctly now, skipping for the moment\n return;\n }\n});\n",
  358. "var registerComponent = require('../core/component').registerComponent;\n\n/**\n * Visibility component.\n */\nmodule.exports.Component = registerComponent('visible', {\n schema: {default: true},\n\n update: function () {\n this.el.object3D.visible = this.data;\n }\n});\n",
  359. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar VIVE_CONTROLLER_MODEL_OBJ_URL = 'https://cdn.aframe.io/controllers/vive/vr_controller_vive.obj';\nvar VIVE_CONTROLLER_MODEL_OBJ_MTL = 'https://cdn.aframe.io/controllers/vive/vr_controller_vive.mtl';\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'htc-vive';\nvar GAMEPAD_ID_WEBVR = 'OpenVR ';\n\n// Prefix for Gen1 and Gen2 Oculus Touch Controllers.\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\n/**\n * Button IDs:\n * 0 - trackpad\n * 1 - trigger (intensity value from 0.5 to 1)\n * 2 - grip\n * 3 - menu (dispatch but better for menu options)\n * 4 - system (never dispatched on this layer)\n */\nvar INPUT_MAPPING_WEBVR = {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger', 'grip', 'menu', 'system']\n};\n\n/**\n * Button IDs:\n * 0 - trigger\n * 1 - squeeze\n * 2 - touchpad\n * 3 - none (dispatch but better for menu options)\n * 4 - menu (never dispatched on this layer)\n *\n * Axis:\n * 0 - touchpad x axis\n * 1 - touchpad y axis\n * Reference: https://github.com/immersive-web/webxr-input-profiles/blob/master/packages/registry/profiles/htc/htc-vive.json\n */\nvar INPUT_MAPPING_WEBXR = {\n axes: {thumbstick: [0, 1]},\n buttons: ['trigger', 'grip', 'trackpad', 'none', 'menu']\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Vive controls.\n * Interface with Vive controllers and map Gamepad events to controller buttons:\n * trackpad, trigger, grip, menu, system\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('vive-controls', {\n schema: {\n hand: {default: 'left'},\n buttonColor: {type: 'color', default: '#FAFAFA'}, // Off-white.\n buttonHighlightColor: {type: 'color', default: '#22D1EE'}, // Light blue.\n model: {default: true},\n orientationOffset: {type: 'vec3'}\n },\n\n mapping: INPUT_MAPPING,\n\n init: function () {\n var self = this;\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.previousButtonValues = {};\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n\n this.bindMethods();\n },\n\n update: function () {\n var data = this.data;\n this.controllerIndex = data.hand === 'right' ? 0 : data.hand === 'left' ? 1 : 2;\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n },\n\n /**\n * Once OpenVR returns correct hand data in supporting browsers, we can use hand property.\n * var isPresent = checkControllerPresentAndSetup(this.el.sceneEl, GAMEPAD_ID_PREFIX,\n { hand: data.hand });\n * Until then, use hardcoded index.\n */\n checkIfControllerPresent: function () {\n var data = this.data;\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {index: this.controllerIndex, hand: data.hand});\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n\n // If we have an OpenVR Gamepad, use the fixed mapping.\n el.setAttribute('tracked-controls', {\n idPrefix: GAMEPAD_ID_PREFIX,\n hand: data.hand,\n controller: this.controllerIndex,\n orientationOffset: data.orientationOffset\n });\n\n // Load model.\n if (!this.data.model) { return; }\n this.el.setAttribute('obj-model', {\n obj: VIVE_CONTROLLER_MODEL_OBJ_URL,\n mtl: VIVE_CONTROLLER_MODEL_OBJ_MTL\n });\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n /**\n * Rotate the trigger button based on how hard the trigger is pressed.\n */\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n var buttonMeshes = this.buttonMeshes;\n var analogValue;\n\n if (!button) { return; }\n\n if (button === 'trigger') {\n analogValue = evt.detail.state.value;\n // Update trigger rotation depending on button value.\n if (buttonMeshes && buttonMeshes.trigger) {\n buttonMeshes.trigger.rotation.x = -analogValue * (Math.PI / 12);\n }\n }\n\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onModelLoaded: function (evt) {\n var buttonMeshes;\n var controllerObject3D = evt.detail.model;\n var self = this;\n\n if (!this.data.model) { return; }\n\n // Store button meshes object to be able to change their colors.\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.grip = {\n left: controllerObject3D.getObjectByName('leftgrip'),\n right: controllerObject3D.getObjectByName('rightgrip')\n };\n buttonMeshes.menu = controllerObject3D.getObjectByName('menubutton');\n buttonMeshes.system = controllerObject3D.getObjectByName('systembutton');\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('touchpad');\n buttonMeshes.trigger = controllerObject3D.getObjectByName('trigger');\n\n // Set default colors.\n Object.keys(buttonMeshes).forEach(function (buttonName) {\n self.setButtonColor(buttonName, self.data.buttonColor);\n });\n\n // Offset pivot point.\n controllerObject3D.position.set(0, -0.015, 0.04);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n var color;\n var isTouch;\n if (!this.data.model) { return; }\n\n isTouch = evtName.indexOf('touch') !== -1;\n // Don't change color for trackpad touch.\n if (isTouch) { return; }\n\n // Update colors.\n color = evtName === 'up' ? this.data.buttonColor : this.data.buttonHighlightColor;\n this.setButtonColor(buttonName, color);\n },\n\n setButtonColor: function (buttonName, color) {\n var buttonMeshes = this.buttonMeshes;\n var rendererSystem = this.rendererSystem;\n\n if (!buttonMeshes) { return; }\n\n // Need to do both left and right sides for grip.\n if (buttonName === 'grip') {\n buttonMeshes.grip.left.material.color.set(color);\n buttonMeshes.grip.right.material.color.set(color);\n rendererSystem.applyColorCorrection(buttonMeshes.grip.left.material.color);\n rendererSystem.applyColorCorrection(buttonMeshes.grip.right.material.color);\n return;\n }\n buttonMeshes[buttonName].material.color.set(color);\n rendererSystem.applyColorCorrection(buttonMeshes[buttonName].material.color);\n }\n});\n",
  360. "var registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar GAMEPAD_ID_PREFIX = 'HTC Vive Focus';\n\nvar VIVE_FOCUS_CONTROLLER_MODEL_URL = 'https://cdn.aframe.io/controllers/vive/focus-controller/focus-controller.gltf';\n\n/**\n * Vive Focus controls.\n * Interface with Vive Focus controller and map Gamepad events to\n * controller buttons: trackpad, trigger\n * Load a controller model and highlight the pressed buttons.\n */\nmodule.exports.Component = registerComponent('vive-focus-controls', {\n schema: {\n hand: {default: ''}, // This informs the degenerate arm model.\n buttonTouchedColor: {type: 'color', default: '#BBBBBB'},\n buttonHighlightColor: {type: 'color', default: '#7A7A7A'},\n model: {default: true},\n orientationOffset: {type: 'vec3'},\n armModel: {default: true}\n },\n\n /**\n * Button IDs:\n * 0 - trackpad\n * 1 - trigger\n */\n mapping: {\n axes: {trackpad: [0, 1]},\n buttons: ['trackpad', 'trigger']\n },\n\n bindMethods: function () {\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.removeControllersUpdateListener = bind(this.removeControllersUpdateListener, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.bindMethods();\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('model-loaded', this.onModelLoaded);\n el.addEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = true;\n this.addControllersUpdateListener();\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n el.removeEventListener('axismove', this.onAxisMoved);\n this.controllerEventsActive = false;\n this.removeControllersUpdateListener();\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX,\n this.data.hand ? {hand: this.data.hand} : {});\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n injectTrackedControls: function () {\n var el = this.el;\n var data = this.data;\n el.setAttribute('tracked-controls', {\n armModel: data.armModel,\n idPrefix: GAMEPAD_ID_PREFIX,\n orientationOffset: data.orientationOffset\n });\n if (!this.data.model) { return; }\n this.el.setAttribute('gltf-model', VIVE_FOCUS_CONTROLLER_MODEL_URL);\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onModelLoaded: function (evt) {\n var controllerObject3D = evt.detail.model;\n var buttonMeshes;\n\n if (!this.data.model) { return; }\n buttonMeshes = this.buttonMeshes = {};\n buttonMeshes.trigger = controllerObject3D.getObjectByName('BumperKey');\n buttonMeshes.triggerPressed = controllerObject3D.getObjectByName('BumperKey_Press');\n if (buttonMeshes.triggerPressed) {\n buttonMeshes.triggerPressed.visible = false;\n }\n buttonMeshes.trackpad = controllerObject3D.getObjectByName('TouchPad');\n buttonMeshes.trackpadPressed = controllerObject3D.getObjectByName('TouchPad_Press');\n if (buttonMeshes.trackpadPressed) {\n buttonMeshes.trackpadPressed.visible = false;\n }\n },\n\n // No analog buttons, only emits 0/1 values\n onButtonChanged: function (evt) {\n var button = this.mapping.buttons[evt.detail.id];\n if (!button) return;\n // Pass along changed event with button state, using button mapping for convenience.\n this.el.emit(button + 'changed', evt.detail.state);\n },\n\n onAxisMoved: function (evt) {\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n updateModel: function (buttonName, evtName) {\n if (!this.data.model) { return; }\n this.updateButtonModel(buttonName, evtName);\n },\n\n updateButtonModel: function (buttonName, state) {\n var buttonMeshes = this.buttonMeshes;\n var pressedName = buttonName + 'Pressed';\n if (!buttonMeshes || !buttonMeshes[buttonName] || !buttonMeshes[pressedName]) {\n return;\n }\n var color;\n switch (state) {\n case 'down':\n color = this.data.buttonHighlightColor;\n break;\n case 'touchstart':\n color = this.data.buttonTouchedColor;\n break;\n }\n if (color) {\n buttonMeshes[pressedName].material.color.set(color);\n }\n buttonMeshes[pressedName].visible = !!color;\n buttonMeshes[buttonName].visible = !color;\n }\n});\n",
  361. "var KEYCODE_TO_CODE = require('../constants').keyboardevent.KEYCODE_TO_CODE;\nvar registerComponent = require('../core/component').registerComponent;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar bind = utils.bind;\nvar shouldCaptureKeyEvent = utils.shouldCaptureKeyEvent;\n\nvar CLAMP_VELOCITY = 0.00001;\nvar MAX_DELTA = 0.2;\nvar KEYS = [\n 'KeyW', 'KeyA', 'KeyS', 'KeyD',\n 'ArrowUp', 'ArrowLeft', 'ArrowRight', 'ArrowDown'\n];\n\n/**\n * WASD component to control entities using WASD keys.\n */\nmodule.exports.Component = registerComponent('wasd-controls', {\n schema: {\n acceleration: {default: 65},\n adAxis: {default: 'x', oneOf: ['x', 'y', 'z']},\n adEnabled: {default: true},\n adInverted: {default: false},\n enabled: {default: true},\n fly: {default: false},\n wsAxis: {default: 'z', oneOf: ['x', 'y', 'z']},\n wsEnabled: {default: true},\n wsInverted: {default: false}\n },\n\n init: function () {\n // To keep track of the pressed keys.\n this.keys = {};\n this.easing = 1.1;\n\n this.velocity = new THREE.Vector3();\n\n // Bind methods and add event listeners.\n this.onBlur = bind(this.onBlur, this);\n this.onContextMenu = bind(this.onContextMenu, this);\n this.onFocus = bind(this.onFocus, this);\n this.onKeyDown = bind(this.onKeyDown, this);\n this.onKeyUp = bind(this.onKeyUp, this);\n this.onVisibilityChange = bind(this.onVisibilityChange, this);\n this.attachVisibilityEventListeners();\n },\n\n tick: function (time, delta) {\n var data = this.data;\n var el = this.el;\n var velocity = this.velocity;\n\n if (!velocity[data.adAxis] && !velocity[data.wsAxis] &&\n isEmptyObject(this.keys)) { return; }\n\n // Update velocity.\n delta = delta / 1000;\n this.updateVelocity(delta);\n\n if (!velocity[data.adAxis] && !velocity[data.wsAxis]) { return; }\n\n // Get movement vector and translate position.\n el.object3D.position.add(this.getMovementVector(delta));\n },\n\n remove: function () {\n this.removeKeyEventListeners();\n this.removeVisibilityEventListeners();\n },\n\n play: function () {\n this.attachKeyEventListeners();\n },\n\n pause: function () {\n this.keys = {};\n this.removeKeyEventListeners();\n },\n\n updateVelocity: function (delta) {\n var acceleration;\n var adAxis;\n var adSign;\n var data = this.data;\n var keys = this.keys;\n var velocity = this.velocity;\n var wsAxis;\n var wsSign;\n\n adAxis = data.adAxis;\n wsAxis = data.wsAxis;\n\n // If FPS too low, reset velocity.\n if (delta > MAX_DELTA) {\n velocity[adAxis] = 0;\n velocity[wsAxis] = 0;\n return;\n }\n\n // https://gamedev.stackexchange.com/questions/151383/frame-rate-independant-movement-with-acceleration\n var scaledEasing = Math.pow(1 / this.easing, delta * 60);\n // Velocity Easing.\n if (velocity[adAxis] !== 0) {\n velocity[adAxis] = velocity[adAxis] * scaledEasing;\n }\n if (velocity[wsAxis] !== 0) {\n velocity[wsAxis] = velocity[wsAxis] * scaledEasing;\n }\n\n // Clamp velocity easing.\n if (Math.abs(velocity[adAxis]) < CLAMP_VELOCITY) { velocity[adAxis] = 0; }\n if (Math.abs(velocity[wsAxis]) < CLAMP_VELOCITY) { velocity[wsAxis] = 0; }\n\n if (!data.enabled) { return; }\n\n // Update velocity using keys pressed.\n acceleration = data.acceleration;\n if (data.adEnabled) {\n adSign = data.adInverted ? -1 : 1;\n if (keys.KeyA || keys.ArrowLeft) { velocity[adAxis] -= adSign * acceleration * delta; }\n if (keys.KeyD || keys.ArrowRight) { velocity[adAxis] += adSign * acceleration * delta; }\n }\n if (data.wsEnabled) {\n wsSign = data.wsInverted ? -1 : 1;\n if (keys.KeyW || keys.ArrowUp) { velocity[wsAxis] -= wsSign * acceleration * delta; }\n if (keys.KeyS || keys.ArrowDown) { velocity[wsAxis] += wsSign * acceleration * delta; }\n }\n },\n\n getMovementVector: (function () {\n var directionVector = new THREE.Vector3(0, 0, 0);\n var rotationEuler = new THREE.Euler(0, 0, 0, 'YXZ');\n\n return function (delta) {\n var rotation = this.el.getAttribute('rotation');\n var velocity = this.velocity;\n var xRotation;\n\n directionVector.copy(velocity);\n directionVector.multiplyScalar(delta);\n\n // Absolute.\n if (!rotation) { return directionVector; }\n\n xRotation = this.data.fly ? rotation.x : 0;\n\n // Transform direction relative to heading.\n rotationEuler.set(THREE.Math.degToRad(xRotation), THREE.Math.degToRad(rotation.y), 0);\n directionVector.applyEuler(rotationEuler);\n return directionVector;\n };\n })(),\n\n attachVisibilityEventListeners: function () {\n window.oncontextmenu = this.onContextMenu;\n window.addEventListener('blur', this.onBlur);\n window.addEventListener('focus', this.onFocus);\n document.addEventListener('visibilitychange', this.onVisibilityChange);\n },\n\n removeVisibilityEventListeners: function () {\n window.removeEventListener('blur', this.onBlur);\n window.removeEventListener('focus', this.onFocus);\n document.removeEventListener('visibilitychange', this.onVisibilityChange);\n },\n\n attachKeyEventListeners: function () {\n window.addEventListener('keydown', this.onKeyDown);\n window.addEventListener('keyup', this.onKeyUp);\n },\n\n removeKeyEventListeners: function () {\n window.removeEventListener('keydown', this.onKeyDown);\n window.removeEventListener('keyup', this.onKeyUp);\n },\n\n onContextMenu: function () {\n var keys = Object.keys(this.keys);\n for (var i = 0; i < keys.length; i++) {\n delete this.keys[keys[i]];\n }\n },\n\n onBlur: function () {\n this.pause();\n },\n\n onFocus: function () {\n this.play();\n },\n\n onVisibilityChange: function () {\n if (document.hidden) {\n this.onBlur();\n } else {\n this.onFocus();\n }\n },\n\n onKeyDown: function (event) {\n var code;\n if (!shouldCaptureKeyEvent(event)) { return; }\n code = event.code || KEYCODE_TO_CODE[event.keyCode];\n if (KEYS.indexOf(code) !== -1) { this.keys[code] = true; }\n },\n\n onKeyUp: function (event) {\n var code;\n code = event.code || KEYCODE_TO_CODE[event.keyCode];\n delete this.keys[code];\n }\n});\n\nfunction isEmptyObject (keys) {\n var key;\n for (key in keys) { return false; }\n return true;\n}\n",
  362. "/* global THREE */\nvar registerComponent = require('../core/component').registerComponent;\nvar bind = require('../utils/bind');\n\nvar trackedControlsUtils = require('../utils/tracked-controls');\nvar checkControllerPresentAndSetup = trackedControlsUtils.checkControllerPresentAndSetup;\nvar emitIfAxesChanged = trackedControlsUtils.emitIfAxesChanged;\nvar onButtonEvent = trackedControlsUtils.onButtonEvent;\n\nvar utils = require('../utils/');\n\nvar debug = utils.debug('components:windows-motion-controls:debug');\nvar warn = utils.debug('components:windows-motion-controls:warn');\n\nvar DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS;\n\nvar MODEL_BASE_URL = 'https://cdn.aframe.io/controllers/microsoft/';\nvar MODEL_FILENAMES = { left: 'left.glb', right: 'right.glb', default: 'universal.glb' };\n\nvar isWebXRAvailable = require('../utils/').device.isWebXRAvailable;\n\nvar GAMEPAD_ID_WEBXR = 'windows-mixed-reality';\nvar GAMEPAD_ID_WEBVR = 'Spatial Controller (Spatial Interaction Source) ';\nvar GAMEPAD_ID_PATTERN = /([0-9a-zA-Z]+-[0-9a-zA-Z]+)$/;\n\nvar GAMEPAD_ID_PREFIX = isWebXRAvailable ? GAMEPAD_ID_WEBXR : GAMEPAD_ID_WEBVR;\n\nvar INPUT_MAPPING_WEBVR = {\n // A-Frame specific semantic axis names\n axes: {'thumbstick': [0, 1], 'trackpad': [2, 3]},\n // A-Frame specific semantic button names\n buttons: ['thumbstick', 'trigger', 'grip', 'menu', 'trackpad'],\n // A mapping of the semantic name to node name in the glTF model file,\n // that should be transformed by axis value.\n // This array mirrors the browser Gamepad.axes array, such that\n // the mesh corresponding to axis 0 is in this array index 0.\n axisMeshNames: [\n 'THUMBSTICK_X',\n 'THUMBSTICK_Y',\n 'TOUCHPAD_TOUCH_X',\n 'TOUCHPAD_TOUCH_Y'\n ],\n // A mapping of the semantic name to button node name in the glTF model file,\n // that should be transformed by button value.\n buttonMeshNames: {\n 'trigger': 'SELECT',\n 'menu': 'MENU',\n 'grip': 'GRASP',\n 'thumbstick': 'THUMBSTICK_PRESS',\n 'trackpad': 'TOUCHPAD_PRESS'\n },\n pointingPoseMeshName: 'POINTING_POSE'\n};\n\nvar INPUT_MAPPING_WEBXR = {\n // A-Frame specific semantic axis names\n axes: {'touchpad': [0, 1], 'thumbstick': [2, 3]},\n // A-Frame specific semantic button names\n buttons: ['trigger', 'squeeze', 'touchpad', 'thumbstick', 'menu'],\n // A mapping of the semantic name to node name in the glTF model file,\n // that should be transformed by axis value.\n // This array mirrors the browser Gamepad.axes array, such that\n // the mesh corresponding to axis 0 is in this array index 0.\n axisMeshNames: [\n 'TOUCHPAD_TOUCH_X',\n 'TOUCHPAD_TOUCH_X',\n 'THUMBSTICK_X',\n 'THUMBSTICK_Y'\n ],\n // A mapping of the semantic name to button node name in the glTF model file,\n // that should be transformed by button value.\n buttonMeshNames: {\n 'trigger': 'SELECT',\n 'menu': 'MENU',\n 'squeeze': 'GRASP',\n 'thumbstick': 'THUMBSTICK_PRESS',\n 'touchpad': 'TOUCHPAD_PRESS'\n },\n pointingPoseMeshName: 'POINTING_POSE'\n};\n\nvar INPUT_MAPPING = isWebXRAvailable ? INPUT_MAPPING_WEBXR : INPUT_MAPPING_WEBVR;\n\n/**\n * Windows Motion Controller controls.\n * Interface with Windows Motion Controller controllers and map Gamepad events to\n * controller buttons: trackpad, trigger, grip, menu, thumbstick\n * Load a controller model and transform the pressed buttons.\n */\nmodule.exports.Component = registerComponent('windows-motion-controls', {\n schema: {\n hand: {default: DEFAULT_HANDEDNESS},\n // It is possible to have multiple pairs of controllers attached (a pair has both left and right).\n // Set this to 1 to use a controller from the second pair, 2 from the third pair, etc.\n pair: {default: 0},\n // If true, loads the controller glTF asset.\n model: {default: true},\n // If true, will hide the model from the scene if no matching gamepad (based on ID & hand) is connected.\n hideDisconnected: {default: true}\n },\n\n mapping: INPUT_MAPPING,\n\n bindMethods: function () {\n this.onModelError = bind(this.onModelError, this);\n this.onModelLoaded = bind(this.onModelLoaded, this);\n this.onControllersUpdate = bind(this.onControllersUpdate, this);\n this.checkIfControllerPresent = bind(this.checkIfControllerPresent, this);\n this.onAxisMoved = bind(this.onAxisMoved, this);\n },\n\n init: function () {\n var self = this;\n var el = this.el;\n this.onButtonChanged = bind(this.onButtonChanged, this);\n this.onButtonDown = function (evt) { onButtonEvent(evt.detail.id, 'down', self); };\n this.onButtonUp = function (evt) { onButtonEvent(evt.detail.id, 'up', self); };\n this.onButtonTouchStart = function (evt) { onButtonEvent(evt.detail.id, 'touchstart', self); };\n this.onButtonTouchEnd = function (evt) { onButtonEvent(evt.detail.id, 'touchend', self); };\n this.onControllerConnected = function () { self.setModelVisibility(true); };\n this.onControllerDisconnected = function () { self.setModelVisibility(false); };\n this.controllerPresent = false;\n this.lastControllerCheck = 0;\n this.previousButtonValues = {};\n this.bindMethods();\n\n // Cache for submeshes that we have looked up by name.\n this.loadedMeshInfo = {\n buttonMeshes: null,\n axisMeshes: null\n };\n\n // Pointing poses\n this.rayOrigin = {\n origin: new THREE.Vector3(),\n direction: new THREE.Vector3(0, 0, -1),\n createdFromMesh: false\n };\n\n el.addEventListener('controllerconnected', this.onControllerConnected);\n el.addEventListener('controllerdisconnected', this.onControllerDisconnected);\n },\n\n addEventListeners: function () {\n var el = this.el;\n el.addEventListener('buttonchanged', this.onButtonChanged);\n el.addEventListener('buttondown', this.onButtonDown);\n el.addEventListener('buttonup', this.onButtonUp);\n el.addEventListener('touchstart', this.onButtonTouchStart);\n el.addEventListener('touchend', this.onButtonTouchEnd);\n el.addEventListener('axismove', this.onAxisMoved);\n el.addEventListener('model-error', this.onModelError);\n el.addEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = true;\n },\n\n removeEventListeners: function () {\n var el = this.el;\n el.removeEventListener('buttonchanged', this.onButtonChanged);\n el.removeEventListener('buttondown', this.onButtonDown);\n el.removeEventListener('buttonup', this.onButtonUp);\n el.removeEventListener('touchstart', this.onButtonTouchStart);\n el.removeEventListener('touchend', this.onButtonTouchEnd);\n el.removeEventListener('axismove', this.onAxisMoved);\n el.removeEventListener('model-error', this.onModelError);\n el.removeEventListener('model-loaded', this.onModelLoaded);\n this.controllerEventsActive = false;\n },\n\n checkIfControllerPresent: function () {\n checkControllerPresentAndSetup(this, GAMEPAD_ID_PREFIX, {\n hand: this.data.hand,\n index: this.data.pair,\n iterateControllerProfiles: true\n });\n },\n\n play: function () {\n this.checkIfControllerPresent();\n this.addControllersUpdateListener();\n },\n\n pause: function () {\n this.removeEventListeners();\n this.removeControllersUpdateListener();\n },\n\n updateControllerModel: function () {\n // If we do not want to load a model, or, have already loaded the model, emit the controllermodelready event.\n if (!this.data.model || this.rayOrigin.createdFromMesh) {\n this.modelReady();\n return;\n }\n\n var sourceUrl = this.createControllerModelUrl();\n this.loadModel(sourceUrl);\n },\n\n /**\n * Helper function that constructs a URL from the controller ID suffix, for future proofed\n * art assets.\n */\n createControllerModelUrl: function (forceDefault) {\n // Determine the device specific folder based on the ID suffix\n var trackedControlsComponent = this.el.components['tracked-controls'];\n var controller = trackedControlsComponent ? trackedControlsComponent.controller : null;\n var device = 'default';\n var hand = this.data.hand;\n var filename;\n\n if (controller && !window.hasNativeWebXRImplementation) {\n // Read hand directly from the controller, rather than this.data, as in the case that the controller\n // is unhanded this.data will still have 'left' or 'right' (depending on what the user inserted in to the scene).\n // In this case, we want to load the universal model, so need to get the '' from the controller.\n hand = controller.hand;\n\n if (!forceDefault) {\n var match = controller.id.match(GAMEPAD_ID_PATTERN);\n device = ((match && match[0]) || device);\n }\n }\n\n // Hand\n filename = MODEL_FILENAMES[hand] || MODEL_FILENAMES.default;\n\n // Final url\n return MODEL_BASE_URL + device + '/' + filename;\n },\n\n injectTrackedControls: function () {\n var data = this.data;\n this.el.setAttribute('tracked-controls', {\n idPrefix: GAMEPAD_ID_PREFIX,\n controller: data.pair,\n hand: data.hand,\n armModel: false\n });\n\n this.updateControllerModel();\n },\n\n addControllersUpdateListener: function () {\n this.el.sceneEl.addEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n removeControllersUpdateListener: function () {\n this.el.sceneEl.removeEventListener('controllersupdated', this.onControllersUpdate, false);\n },\n\n onControllersUpdate: function () {\n this.checkIfControllerPresent();\n },\n\n onModelError: function (evt) {\n var defaultUrl = this.createControllerModelUrl(true);\n if (evt.detail.src !== defaultUrl) {\n warn('Failed to load controller model for device, attempting to load default.');\n this.loadModel(defaultUrl);\n } else {\n warn('Failed to load default controller model.');\n }\n },\n\n loadModel: function (url) {\n // The model is loaded by the gltf-model compoent when this attribute is initially set,\n // removed and re-loaded if the given url changes.\n this.el.setAttribute('gltf-model', 'url(' + url + ')');\n },\n\n onModelLoaded: function (evt) {\n var rootNode = this.controllerModel = evt.detail.model;\n var loadedMeshInfo = this.loadedMeshInfo;\n var i;\n var meshName;\n var mesh;\n var meshInfo;\n\n debug('Processing model');\n\n // Reset the caches\n loadedMeshInfo.buttonMeshes = {};\n loadedMeshInfo.axisMeshes = {};\n\n // Cache our meshes so we aren't traversing the hierarchy per frame\n if (rootNode) {\n // Button Meshes\n for (i = 0; i < this.mapping.buttons.length; i++) {\n meshName = this.mapping.buttonMeshNames[this.mapping.buttons[i]];\n if (!meshName) {\n debug('Skipping unknown button at index: ' + i + ' with mapped name: ' + this.mapping.buttons[i]);\n continue;\n }\n\n mesh = rootNode.getObjectByName(meshName);\n if (!mesh) {\n warn('Missing button mesh with name: ' + meshName);\n continue;\n }\n\n meshInfo = {\n index: i,\n value: getImmediateChildByName(mesh, 'VALUE'),\n pressed: getImmediateChildByName(mesh, 'PRESSED'),\n unpressed: getImmediateChildByName(mesh, 'UNPRESSED')\n };\n if (meshInfo.value && meshInfo.pressed && meshInfo.unpressed) {\n loadedMeshInfo.buttonMeshes[this.mapping.buttons[i]] = meshInfo;\n } else {\n // If we didn't find the mesh, it simply means this button won't have transforms applied as mapped button value changes.\n warn('Missing button submesh under mesh with name: ' + meshName +\n '(VALUE: ' + !!meshInfo.value +\n ', PRESSED: ' + !!meshInfo.pressed +\n ', UNPRESSED:' + !!meshInfo.unpressed +\n ')');\n }\n }\n\n // Axis Meshes\n for (i = 0; i < this.mapping.axisMeshNames.length; i++) {\n meshName = this.mapping.axisMeshNames[i];\n if (!meshName) {\n debug('Skipping unknown axis at index: ' + i);\n continue;\n }\n\n mesh = rootNode.getObjectByName(meshName);\n if (!mesh) {\n warn('Missing axis mesh with name: ' + meshName);\n continue;\n }\n\n meshInfo = {\n index: i,\n value: getImmediateChildByName(mesh, 'VALUE'),\n min: getImmediateChildByName(mesh, 'MIN'),\n max: getImmediateChildByName(mesh, 'MAX')\n };\n if (meshInfo.value && meshInfo.min && meshInfo.max) {\n loadedMeshInfo.axisMeshes[i] = meshInfo;\n } else {\n // If we didn't find the mesh, it simply means this axis won't have transforms applied as mapped axis values change.\n warn('Missing axis submesh under mesh with name: ' + meshName +\n '(VALUE: ' + !!meshInfo.value +\n ', MIN: ' + !!meshInfo.min +\n ', MAX:' + !!meshInfo.max +\n ')');\n }\n }\n\n this.calculateRayOriginFromMesh(rootNode);\n // Determine if the model has to be visible or not.\n this.setModelVisibility();\n }\n\n debug('Model load complete.');\n\n // Look through only immediate children. This will return null if no mesh exists with the given name.\n function getImmediateChildByName (object3d, value) {\n for (var i = 0, l = object3d.children.length; i < l; i++) {\n var obj = object3d.children[i];\n if (obj && obj['name'] === value) {\n return obj;\n }\n }\n return undefined;\n }\n },\n\n calculateRayOriginFromMesh: (function () {\n var quaternion = new THREE.Quaternion();\n return function (rootNode) {\n var mesh;\n\n // Calculate the pointer pose (used for rays), by applying the world transform of th POINTER_POSE node\n // in the glTF (assumes that root node is at world origin)\n this.rayOrigin.origin.set(0, 0, 0);\n this.rayOrigin.direction.set(0, 0, -1);\n this.rayOrigin.createdFromMesh = true;\n\n // Try to read Pointing pose from the source model\n mesh = rootNode.getObjectByName(this.mapping.pointingPoseMeshName);\n if (mesh) {\n var parent = rootNode.parent;\n\n // We need to read pose transforms accumulated from the root of the glTF, not the scene.\n if (parent) {\n rootNode.parent = null;\n rootNode.updateMatrixWorld(true);\n rootNode.parent = parent;\n }\n\n mesh.getWorldPosition(this.rayOrigin.origin);\n mesh.getWorldQuaternion(quaternion);\n this.rayOrigin.direction.applyQuaternion(quaternion);\n\n // Recalculate the world matrices now that the rootNode is re-attached to the parent.\n if (parent) {\n rootNode.updateMatrixWorld(true);\n }\n } else {\n debug('Mesh does not contain pointing origin data, defaulting to none.');\n }\n\n // Emit event stating that our pointing ray is now accurate.\n this.modelReady();\n };\n })(),\n\n lerpAxisTransform: (function () {\n var quaternion = new THREE.Quaternion();\n return function (axis, axisValue) {\n var axisMeshInfo = this.loadedMeshInfo.axisMeshes[axis];\n if (!axisMeshInfo) return;\n\n var min = axisMeshInfo.min;\n var max = axisMeshInfo.max;\n var target = axisMeshInfo.value;\n\n // Convert from gamepad value range (-1 to +1) to lerp range (0 to 1)\n var lerpValue = axisValue * 0.5 + 0.5;\n target.setRotationFromQuaternion(quaternion.copy(min.quaternion).slerp(max.quaternion, lerpValue));\n target.position.lerpVectors(min.position, max.position, lerpValue);\n };\n })(),\n\n lerpButtonTransform: (function () {\n var quaternion = new THREE.Quaternion();\n return function (buttonName, buttonValue) {\n var buttonMeshInfo = this.loadedMeshInfo.buttonMeshes[buttonName];\n if (!buttonMeshInfo) return;\n\n var min = buttonMeshInfo.unpressed;\n var max = buttonMeshInfo.pressed;\n var target = buttonMeshInfo.value;\n\n target.setRotationFromQuaternion(quaternion.copy(min.quaternion).slerp(max.quaternion, buttonValue));\n target.position.lerpVectors(min.position, max.position, buttonValue);\n };\n })(),\n\n modelReady: function () {\n this.el.emit('controllermodelready', {\n name: 'windows-motion-controls',\n model: this.data.model,\n rayOrigin: this.rayOrigin\n });\n },\n\n onButtonChanged: function (evt) {\n var buttonName = this.mapping.buttons[evt.detail.id];\n\n if (buttonName) {\n // Update the button mesh transform\n if (this.loadedMeshInfo && this.loadedMeshInfo.buttonMeshes) {\n this.lerpButtonTransform(buttonName, evt.detail.state.value);\n }\n\n // Only emit events for buttons that we know how to map from index to name\n this.el.emit(buttonName + 'changed', evt.detail.state);\n }\n },\n\n onAxisMoved: function (evt) {\n var numAxes = this.mapping.axisMeshNames.length;\n\n // Only attempt to update meshes if we have valid data.\n if (this.loadedMeshInfo && this.loadedMeshInfo.axisMeshes) {\n for (var axis = 0; axis < numAxes; axis++) {\n // Update the button mesh transform\n this.lerpAxisTransform(axis, evt.detail.axis[axis] || 0.0);\n }\n }\n\n emitIfAxesChanged(this, this.mapping.axes, evt);\n },\n\n setModelVisibility: function (visible) {\n var model = this.el.getObject3D('mesh');\n visible = visible !== undefined ? visible : this.modelVisible;\n this.modelVisible = visible;\n if (!model) { return; }\n model.visible = visible;\n }\n});\n",
  363. "module.exports = {\n AFRAME_INJECTED: 'aframe-injected',\n DEFAULT_CAMERA_HEIGHT: 1.6,\n DEFAULT_HANDEDNESS: 'right',\n keyboardevent: require('./keyboardevent')\n};\n",
  364. "module.exports = {\n // Tiny KeyboardEvent.code polyfill.\n KEYCODE_TO_CODE: {\n '38': 'ArrowUp',\n '37': 'ArrowLeft',\n '40': 'ArrowDown',\n '39': 'ArrowRight',\n '87': 'KeyW',\n '65': 'KeyA',\n '83': 'KeyS',\n '68': 'KeyD'\n }\n};\n",
  365. "var ANode = require('./a-node');\nvar bind = require('../utils/bind');\nvar debug = require('../utils/debug');\nvar registerElement = require('./a-register-element').registerElement;\nvar THREE = require('../lib/three');\n\nvar fileLoader = new THREE.FileLoader();\nvar warn = debug('core:a-assets:warn');\n\n/**\n * Asset management system. Handles blocking on asset loading.\n */\nmodule.exports = registerElement('a-assets', {\n prototype: Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.isAssets = true;\n this.fileLoader = fileLoader;\n this.timeout = null;\n }\n },\n\n attachedCallback: {\n value: function () {\n var self = this;\n var i;\n var loaded = [];\n var mediaEl;\n var mediaEls;\n var imgEl;\n var imgEls;\n var timeout;\n\n if (!this.parentNode.isScene) {\n throw new Error('<a-assets> must be a child of a <a-scene>.');\n }\n\n // Wait for <img>s.\n imgEls = this.querySelectorAll('img');\n for (i = 0; i < imgEls.length; i++) {\n imgEl = fixUpMediaElement(imgEls[i]);\n loaded.push(new Promise(function (resolve, reject) {\n // Set in cache because we won't be needing to call three.js loader if we have.\n // a loaded media element.\n THREE.Cache.add(imgEls[i].getAttribute('src'), imgEl);\n imgEl.onload = resolve;\n imgEl.onerror = reject;\n }));\n }\n\n // Wait for <audio>s and <video>s.\n mediaEls = this.querySelectorAll('audio, video');\n for (i = 0; i < mediaEls.length; i++) {\n mediaEl = fixUpMediaElement(mediaEls[i]);\n if (!mediaEl.src && !mediaEl.srcObject) {\n warn('Audio/video asset has neither `src` nor `srcObject` attributes.');\n }\n loaded.push(mediaElementLoaded(mediaEl));\n }\n\n // Trigger loaded for scene to start rendering.\n Promise.all(loaded).then(bind(this.load, this));\n\n // Timeout to start loading anyways.\n timeout = parseInt(this.getAttribute('timeout'), 10) || 3000;\n this.timeout = setTimeout(function () {\n if (self.hasLoaded) { return; }\n warn('Asset loading timed out in ', timeout, 'ms');\n self.emit('timeout');\n self.load();\n }, timeout);\n }\n },\n\n detachedCallback: {\n value: function () {\n if (this.timeout) { clearTimeout(this.timeout); }\n }\n },\n\n load: {\n value: function () {\n ANode.prototype.load.call(this, null, function waitOnFilter (el) {\n return el.isAssetItem && el.hasAttribute('src');\n });\n }\n }\n })\n});\n\n/**\n * Preload using XHRLoader for any type of asset.\n */\nregisterElement('a-asset-item', {\n prototype: Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.data = null;\n this.isAssetItem = true;\n }\n },\n\n attachedCallback: {\n value: function () {\n var self = this;\n var src = this.getAttribute('src');\n fileLoader.setResponseType(\n this.getAttribute('response-type') || inferResponseType(src));\n fileLoader.load(src, function handleOnLoad (response) {\n self.data = response;\n /*\n Workaround for a Chrome bug. If another XHR is sent to the same url before the\n previous one closes, the second request never finishes.\n setTimeout finishes the first request and lets the logic triggered by load open\n subsequent requests.\n setTimeout can be removed once the fix for the bug below ships:\n https://bugs.chromium.org/p/chromium/issues/detail?id=633696&q=component%3ABlink%3ENetwork%3EXHR%20&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified\n */\n setTimeout(function load () { ANode.prototype.load.call(self); });\n }, function handleOnProgress (xhr) {\n self.emit('progress', {\n loadedBytes: xhr.loaded,\n totalBytes: xhr.total,\n xhr: xhr\n });\n }, function handleOnError (xhr) {\n self.emit('error', {xhr: xhr});\n });\n }\n }\n })\n});\n\n/**\n * Create a Promise that resolves once the media element has finished buffering.\n *\n * @param {Element} el - HTMLMediaElement.\n * @returns {Promise}\n */\nfunction mediaElementLoaded (el) {\n if (!el.hasAttribute('autoplay') && el.getAttribute('preload') !== 'auto') {\n return;\n }\n\n // If media specifies autoplay or preload, wait until media is completely buffered.\n return new Promise(function (resolve, reject) {\n if (el.readyState === 4) { return resolve(); } // Already loaded.\n if (el.error) { return reject(); } // Error.\n\n el.addEventListener('loadeddata', checkProgress, false);\n el.addEventListener('progress', checkProgress, false);\n el.addEventListener('error', reject, false);\n\n function checkProgress () {\n // Add up the seconds buffered.\n var secondsBuffered = 0;\n for (var i = 0; i < el.buffered.length; i++) {\n secondsBuffered += el.buffered.end(i) - el.buffered.start(i);\n }\n\n // Compare seconds buffered to media duration.\n if (secondsBuffered >= el.duration) {\n // Set in cache because we won't be needing to call three.js loader if we have.\n // a loaded media element.\n // Store video elements only. three.js loader is used for audio elements.\n // See assetParse too.\n if (el.tagName === 'VIDEO') {\n THREE.Cache.add(el.getAttribute('src'), el);\n }\n resolve();\n }\n }\n });\n}\n\n/**\n * Automatically add attributes to media elements where convenient.\n * crossorigin, playsinline.\n */\nfunction fixUpMediaElement (mediaEl) {\n // Cross-origin.\n var newMediaEl = setCrossOrigin(mediaEl);\n\n // Plays inline for mobile.\n if (newMediaEl.tagName && newMediaEl.tagName.toLowerCase() === 'video') {\n newMediaEl.setAttribute('playsinline', '');\n newMediaEl.setAttribute('webkit-playsinline', '');\n }\n\n if (newMediaEl !== mediaEl) {\n mediaEl.parentNode.appendChild(newMediaEl);\n mediaEl.parentNode.removeChild(mediaEl);\n }\n return newMediaEl;\n}\n\n/**\n * Automatically set `crossorigin` if not defined on the media element.\n * If it is not defined, we must create and re-append a new media element <img> and\n * have the browser re-request it with `crossorigin` set.\n *\n * @param {Element} Media element (e.g., <img>, <audio>, <video>).\n * @returns {Element} Media element to be used to listen to for loaded events.\n */\nfunction setCrossOrigin (mediaEl) {\n var newMediaEl;\n var src;\n\n // Already has crossorigin set.\n if (mediaEl.hasAttribute('crossorigin')) { return mediaEl; }\n\n src = mediaEl.getAttribute('src');\n\n if (src !== null) {\n // Does not have protocol.\n if (src.indexOf('://') === -1) { return mediaEl; }\n\n // Determine if cross origin is actually needed.\n if (extractDomain(src) === window.location.host) { return mediaEl; }\n }\n\n warn('Cross-origin element (e.g., <img>) was requested without `crossorigin` set. ' +\n 'A-Frame will re-request the asset with `crossorigin` attribute set. ' +\n 'Please set `crossorigin` on the element (e.g., <img crossorigin=\"anonymous\">)', src);\n mediaEl.crossOrigin = 'anonymous';\n newMediaEl = mediaEl.cloneNode(true);\n return newMediaEl;\n}\n\n/**\n * Extract domain out of URL.\n *\n * @param {string} url\n * @returns {string}\n */\nfunction extractDomain (url) {\n // Find and remove protocol (e.g., http, ftp, etc.) to get domain.\n var domain = url.indexOf('://') > -1 ? url.split('/')[2] : url.split('/')[0];\n\n // Find and remove port number.\n return domain.substring(0, domain.indexOf(':'));\n}\n\n/**\n * Infer response-type attribute from src.\n * Default is text (default XMLHttpRequest.responseType)\n * and arraybuffer for .glb files.\n *\n * @param {string} src\n * @returns {string}\n */\nfunction inferResponseType (src) {\n var fileName = getFileNameFromURL(src);\n var dotLastIndex = fileName.lastIndexOf('.');\n if (dotLastIndex >= 0) {\n var extension = fileName.slice(dotLastIndex, src.search(/\\?|#|$/));\n if (extension === '.glb') {\n return 'arraybuffer';\n }\n }\n return 'text';\n}\nmodule.exports.inferResponseType = inferResponseType;\n\n/**\n * Extract filename from URL\n *\n * @param {string} url\n * @returns {string}\n */\nfunction getFileNameFromURL (url) {\n var parser = document.createElement('a');\n parser.href = url;\n var query = parser.search.replace(/^\\?/, '');\n var filePath = url.replace(query, '').replace('?', '');\n return filePath.substring(filePath.lastIndexOf('/') + 1);\n}\nmodule.exports.getFileNameFromURL = getFileNameFromURL;\n",
  366. "var debug = require('../utils/debug');\nvar registerElement = require('./a-register-element').registerElement;\n\nvar warn = debug('core:cubemap:warn');\n\n/**\n * Cubemap element that handles validation and exposes list of URLs.\n * Does not listen to updates.\n */\nmodule.exports = registerElement('a-cubemap', {\n prototype: Object.create(window.HTMLElement.prototype, {\n /**\n * Calculates this.srcs.\n */\n attachedCallback: {\n value: function () {\n this.srcs = this.validate();\n },\n writable: window.debug\n },\n\n /**\n * Checks for exactly six elements with [src].\n * Does not check explicitly for <img>s in case user does not want\n * prefetching.\n *\n * @returns {Array|null} - six URLs if valid, else null.\n */\n validate: {\n value: function () {\n var elements = this.querySelectorAll('[src]');\n var i;\n var srcs = [];\n if (elements.length === 6) {\n for (i = 0; i < elements.length; i++) {\n srcs.push(elements[i].getAttribute('src'));\n }\n return srcs;\n }\n // Else if there are not six elements, throw a warning.\n warn(\n '<a-cubemap> did not contain exactly six elements each with a ' +\n '`src` attribute.');\n },\n writable: window.debug\n }\n })\n});\n",
  367. "var ANode = require('./a-node');\nvar COMPONENTS = require('./component').components;\nvar registerElement = require('./a-register-element').registerElement;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar AEntity;\nvar debug = utils.debug('core:a-entity:debug');\nvar warn = utils.debug('core:a-entity:warn');\n\nvar MULTIPLE_COMPONENT_DELIMITER = '__';\nvar OBJECT3D_COMPONENTS = ['position', 'rotation', 'scale', 'visible'];\nvar ONCE = {once: true};\n\n/**\n * Entity is a container object that components are plugged into to comprise everything in\n * the scene. In A-Frame, they inherently have position, rotation, and scale.\n *\n * To be able to take components, the scene element inherits from the entity definition.\n *\n * @member {object} components - entity's currently initialized components.\n * @member {object} object3D - three.js object.\n * @member {array} states\n * @member {boolean} isPlaying - false if dynamic behavior of the entity is paused.\n */\nvar proto = Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.components = {};\n // To avoid double initializations and infinite loops.\n this.initializingComponents = {};\n this.componentsToUpdate = {};\n this.isEntity = true;\n this.isPlaying = false;\n this.object3D = new THREE.Group();\n this.object3D.el = this;\n this.object3DMap = {};\n this.parentEl = null;\n this.rotationObj = {};\n this.states = [];\n }\n },\n\n /**\n * Handle changes coming from the browser DOM inspector.\n */\n attributeChangedCallback: {\n value: function (attr, oldVal, newVal) {\n var component = this.components[attr];\n // If the empty string is passed by the component initialization\n // logic we ignore the component update.\n if (component && component.justInitialized && newVal === '') {\n delete component.justInitialized;\n return;\n }\n // When a component is removed after calling el.removeAttribute('material')\n if (!component && newVal === null) { return; }\n this.setEntityAttribute(attr, oldVal, newVal);\n }\n },\n\n /**\n * Add to parent, load, play.\n */\n attachedCallback: {\n value: function () {\n var assetsEl; // Asset management system element.\n var sceneEl = this.sceneEl;\n var self = this; // Component.\n\n this.addToParent();\n\n // Don't .load() scene on attachedCallback.\n if (this.isScene) { return; }\n\n // Gracefully not error when outside of <a-scene> (e.g., tests).\n if (!sceneEl) {\n this.load();\n return;\n }\n\n // Wait for asset management system to finish before loading.\n assetsEl = sceneEl.querySelector('a-assets');\n if (assetsEl && !assetsEl.hasLoaded) {\n assetsEl.addEventListener('loaded', function () { self.load(); });\n return;\n }\n this.load();\n }\n },\n\n /**\n * Tell parent to remove this element's object3D from its object3D.\n * Do not call on scene element because that will cause a call to document.body.remove().\n */\n detachedCallback: {\n value: function () {\n var componentName;\n\n if (!this.parentEl) { return; }\n\n // Remove components.\n for (componentName in this.components) {\n this.removeComponent(componentName, false);\n }\n\n if (this.isScene) { return; }\n\n this.removeFromParent();\n ANode.prototype.detachedCallback.call(this);\n\n // Remove cyclic reference.\n this.object3D.el = null;\n }\n },\n\n getObject3D: {\n value: function (type) {\n return this.object3DMap[type];\n }\n },\n\n /**\n * Set a THREE.Object3D into the map.\n *\n * @param {string} type - Developer-set name of the type of object, will be unique per type.\n * @param {object} obj - A THREE.Object3D.\n */\n setObject3D: {\n value: function (type, obj) {\n var oldObj;\n var self = this;\n\n if (!(obj instanceof THREE.Object3D)) {\n throw new Error(\n '`Entity.setObject3D` was called with an object that was not an instance of ' +\n 'THREE.Object3D.'\n );\n }\n\n // Remove existing object of the type.\n oldObj = this.getObject3D(type);\n if (oldObj) { this.object3D.remove(oldObj); }\n\n // Set references to A-Frame entity.\n obj.el = this;\n if (obj.children.length) {\n obj.traverse(function bindEl (child) {\n child.el = self;\n });\n }\n\n // Add.\n this.object3D.add(obj);\n this.object3DMap[type] = obj;\n this.emit('object3dset', {object: obj, type: type});\n }\n },\n\n /**\n * Remove object from scene and entity object3D map.\n */\n removeObject3D: {\n value: function (type) {\n var obj = this.getObject3D(type);\n if (!obj) {\n warn('Tried to remove `Object3D` of type:', type, 'which was not defined.');\n return;\n }\n this.object3D.remove(obj);\n delete this.object3DMap[type];\n this.emit('object3dremove', {type: type});\n }\n },\n\n /**\n * Gets or creates an object3D of a given type.\n *\n * @param {string} type - Type of the object3D.\n * @param {string} Constructor - Constructor to use to create the object3D if needed.\n * @returns {object}\n */\n getOrCreateObject3D: {\n value: function (type, Constructor) {\n var object3D = this.getObject3D(type);\n if (!object3D && Constructor) {\n object3D = new Constructor();\n this.setObject3D(type, object3D);\n }\n warn('`getOrCreateObject3D` has been deprecated. Use `setObject3D()` ' +\n 'and `object3dset` event instead.');\n return object3D;\n }\n },\n\n /**\n * Add child entity.\n *\n * @param {Element} el - Child entity.\n */\n add: {\n value: function (el) {\n if (!el.object3D) {\n throw new Error(\"Trying to add an element that doesn't have an `object3D`\");\n }\n this.object3D.add(el.object3D);\n this.emit('child-attached', {el: el});\n }\n },\n\n /**\n * Tell parentNode to add this entity to itself.\n */\n addToParent: {\n value: function () {\n var parentNode = this.parentEl = this.parentNode;\n\n // `!parentNode` check primarily for unit tests.\n if (!parentNode || !parentNode.add || this.attachedToParent) { return; }\n\n parentNode.add(this);\n this.attachedToParent = true; // To prevent multiple attachments to same parent.\n }\n },\n\n /**\n * Tell parentNode to remove this entity from itself.\n */\n removeFromParent: {\n value: function () {\n var parentEl = this.parentEl;\n this.parentEl.remove(this);\n this.attachedToParent = false;\n this.parentEl = null;\n parentEl.emit('child-detached', {el: this});\n }\n },\n\n load: {\n value: function () {\n var self = this;\n\n if (this.hasLoaded || !this.parentEl) { return; }\n\n ANode.prototype.load.call(this, function entityLoadCallback () {\n // Check if entity was detached while it was waiting to load.\n if (!self.parentEl) { return; }\n\n self.updateComponents();\n if (self.isScene || self.parentEl.isPlaying) { self.play(); }\n });\n },\n writable: window.debug\n },\n\n /**\n * Remove child entity.\n *\n * @param {Element} el - Child entity.\n */\n remove: {\n value: function (el) {\n if (el) {\n this.object3D.remove(el.object3D);\n } else {\n this.parentNode.removeChild(this);\n }\n }\n },\n\n /**\n * @returns {array} Direct children that are entities.\n */\n getChildEntities: {\n value: function () {\n var children = this.children;\n var childEntities = [];\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child instanceof AEntity) {\n childEntities.push(child);\n }\n }\n\n return childEntities;\n }\n },\n\n /**\n * Initialize component.\n *\n * @param {string} attrName - Attribute name asociated to the component.\n * @param {object} data - Component data\n * @param {boolean} isDependency - True if the component is a dependency.\n */\n initComponent: {\n value: function (attrName, data, isDependency) {\n var component;\n var componentId;\n var componentInfo;\n var componentName;\n var isComponentDefined;\n\n componentInfo = utils.split(attrName, MULTIPLE_COMPONENT_DELIMITER);\n componentName = componentInfo[0];\n componentId = componentInfo.length > 2\n ? componentInfo.slice(1).join('__')\n : componentInfo[1];\n\n // Not a registered component.\n if (!COMPONENTS[componentName]) { return; }\n\n // Component is not a dependency and is undefined.\n // If a component is a dependency, then it is okay to have no data.\n isComponentDefined = checkComponentDefined(this, attrName) ||\n data !== undefined;\n if (!isComponentDefined && !isDependency) { return; }\n\n // Component already initialized.\n if (attrName in this.components) { return; }\n\n // Initialize dependencies first\n this.initComponentDependencies(componentName);\n\n // If component name has an id we check component type multiplic\n if (componentId && !COMPONENTS[componentName].multiple) {\n throw new Error('Trying to initialize multiple ' +\n 'components of type `' + componentName +\n '`. There can only be one component of this type per entity.');\n }\n component = new COMPONENTS[componentName].Component(this, data, componentId);\n if (this.isPlaying) { component.play(); }\n\n // Components are reflected in the DOM as attributes but the state is not shown\n // hence we set the attribute to empty string.\n // The flag justInitialized is for attributeChangedCallback to not overwrite\n // the component with the empty string.\n if (!this.hasAttribute(attrName)) {\n component.justInitialized = true;\n window.HTMLElement.prototype.setAttribute.call(this, attrName, '');\n }\n\n debug('Component initialized: %s', attrName);\n },\n writable: window.debug\n },\n\n /**\n * Initialize dependencies of a component.\n *\n * @param {string} name - Root component name.\n */\n initComponentDependencies: {\n value: function (name) {\n var self = this;\n var component = COMPONENTS[name];\n var dependencies;\n var i;\n\n // Not a component.\n if (!component) { return; }\n\n // No dependencies.\n dependencies = COMPONENTS[name].dependencies;\n\n if (!dependencies) { return; }\n\n // Initialize dependencies.\n for (i = 0; i < dependencies.length; i++) {\n // Call getAttribute to initialize the data from the DOM.\n self.initComponent(\n dependencies[i],\n window.HTMLElement.prototype.getAttribute.call(self, dependencies[i]) || undefined,\n true\n );\n }\n }\n },\n\n removeComponent: {\n value: function (name, destroy) {\n var component;\n\n component = this.components[name];\n if (!component) { return; }\n\n // Wait for component to initialize.\n if (!component.initialized) {\n this.addEventListener('componentinitialized', function tryRemoveLater (evt) {\n if (evt.detail.name !== name) { return; }\n this.removeComponent(name, destroy);\n this.removeEventListener('componentinitialized', tryRemoveLater);\n });\n return;\n }\n\n component.pause();\n component.remove();\n\n // Keep component attached to entity in case of just full entity detach.\n if (destroy) {\n component.destroy();\n delete this.components[name];\n }\n\n this.emit('componentremoved', component.evtDetail, false);\n },\n writable: window.debug\n },\n\n /**\n * Initialize or update all components.\n * Build data using initial components, defined attributes, mixins, and defaults.\n * Update default components before the rest.\n *\n * @member {function} getExtraComponents - Can be implemented to include component data\n * from other sources (e.g., implemented by primitives).\n */\n updateComponents: {\n value: function () {\n var data;\n var extraComponents;\n var i;\n var name;\n var componentsToUpdate = this.componentsToUpdate;\n\n if (!this.hasLoaded) { return; }\n\n // Gather mixin-defined components.\n for (i = 0; i < this.mixinEls.length; i++) {\n for (name in this.mixinEls[i].componentCache) {\n if (isComponent(name)) { componentsToUpdate[name] = true; }\n }\n }\n\n // Gather from extra initial component data if defined (e.g., primitives).\n if (this.getExtraComponents) {\n extraComponents = this.getExtraComponents();\n for (name in extraComponents) {\n if (isComponent(name)) { componentsToUpdate[name] = true; }\n }\n }\n\n // Gather entity-defined components.\n for (i = 0; i < this.attributes.length; ++i) {\n name = this.attributes[i].name;\n if (OBJECT3D_COMPONENTS.indexOf(name) !== -1) { continue; }\n if (isComponent(name)) { componentsToUpdate[name] = true; }\n }\n\n // object3D components first (position, rotation, scale, visible).\n for (i = 0; i < OBJECT3D_COMPONENTS.length; i++) {\n name = OBJECT3D_COMPONENTS[i];\n if (!this.hasAttribute(name)) { continue; }\n this.updateComponent(name, this.getDOMAttribute(name));\n }\n\n // Initialize or update rest of components.\n for (name in componentsToUpdate) {\n data = mergeComponentData(this.getDOMAttribute(name),\n extraComponents && extraComponents[name]);\n this.updateComponent(name, data);\n delete componentsToUpdate[name];\n }\n },\n writable: window.debug\n },\n\n /**\n * Initialize, update, or remove a single component.\n *\n * When initializing, we set the component on `this.components`.\n *\n * @param {string} attr - Component name.\n * @param {object} attrValue - Value of the DOM attribute.\n * @param {boolean} clobber - If new attrValue completely replaces previous properties.\n */\n updateComponent: {\n value: function (attr, attrValue, clobber) {\n var component = this.components[attr];\n\n if (component) {\n // Remove component.\n if (attrValue === null && !checkComponentDefined(this, attr)) {\n this.removeComponent(attr, true);\n return;\n }\n // Component already initialized. Update component.\n component.updateProperties(attrValue, clobber);\n return;\n }\n\n // Component not yet initialized. Initialize component.\n this.initComponent(attr, attrValue, false);\n }\n },\n\n /**\n * If `attr` is a component name, detach the component from the entity.\n *\n * If `propertyName` is given, reset the component property value to its default.\n *\n * @param {string} attr - Attribute name, which could also be a component name.\n * @param {string} propertyName - Component prop name, if resetting an individual prop.\n */\n removeAttribute: {\n value: function (attr, propertyName) {\n var component = this.components[attr];\n\n // Remove component.\n if (component && propertyName === undefined) {\n this.removeComponent(attr, true);\n }\n\n // Reset component property value.\n if (component && propertyName !== undefined) {\n component.resetProperty(propertyName);\n return;\n }\n\n // Remove mixins.\n if (attr === 'mixin') {\n this.mixinUpdate('');\n }\n\n window.HTMLElement.prototype.removeAttribute.call(this, attr);\n }\n },\n\n /**\n * Start dynamic behavior associated with entity such as dynamic components and animations.\n * Tell all children entities to also play.\n */\n play: {\n value: function () {\n var entities;\n var i;\n var key;\n\n // Already playing.\n if (this.isPlaying || !this.hasLoaded) { return; }\n this.isPlaying = true;\n\n // Wake up all components.\n for (key in this.components) { this.components[key].play(); }\n\n // Tell all child entities to play.\n entities = this.getChildEntities();\n for (i = 0; i < entities.length; i++) { entities[i].play(); }\n\n this.emit('play');\n },\n writable: true\n },\n\n /**\n * Pause dynamic behavior associated with entity such as dynamic components and animations.\n * Tell all children entities to also pause.\n */\n pause: {\n value: function () {\n var entities;\n var i;\n var key;\n\n if (!this.isPlaying) { return; }\n this.isPlaying = false;\n\n // Sleep all components.\n for (key in this.components) { this.components[key].pause(); }\n\n // Tell all child entities to pause.\n entities = this.getChildEntities();\n for (i = 0; i < entities.length; i++) { entities[i].pause(); }\n\n this.emit('pause');\n },\n writable: true\n },\n\n /**\n * Deals with updates on entity-specific attributes (i.e., components and mixins).\n *\n * @param {string} attr\n * @param {string} oldVal\n * @param {string|object} newVal\n */\n setEntityAttribute: {\n value: function (attr, oldVal, newVal) {\n if (COMPONENTS[attr] || this.components[attr]) {\n this.updateComponent(attr, newVal);\n return;\n }\n if (attr === 'mixin') {\n // Ignore if `<a-node>` code is just updating computed mixin in the DOM.\n if (newVal === this.computedMixinStr) { return; }\n this.mixinUpdate(newVal, oldVal);\n }\n }\n },\n\n /**\n * When mixins updated, trigger init or optimized-update of relevant components.\n */\n mixinUpdate: {\n value: (function () {\n var componentsUpdated = [];\n\n return function (newMixins, oldMixins) {\n var component;\n var mixinEl;\n var mixinIds;\n var i;\n var self = this;\n\n if (!this.hasLoaded) {\n this.addEventListener('loaded', function () {\n self.mixinUpdate(newMixins, oldMixins);\n }, ONCE);\n return;\n }\n\n oldMixins = oldMixins || this.getAttribute('mixin');\n mixinIds = this.updateMixins(newMixins, oldMixins);\n\n // Loop over current mixins.\n componentsUpdated.length = 0;\n for (i = 0; i < this.mixinEls.length; i++) {\n for (component in this.mixinEls[i].componentCache) {\n if (componentsUpdated.indexOf(component) === -1) {\n if (this.components[component]) {\n // Update. Just rebuild data.\n this.components[component].handleMixinUpdate();\n } else {\n // Init. buildData will gather mixin values.\n this.initComponent(component, null);\n }\n componentsUpdated.push(component);\n }\n }\n }\n\n // Loop over old mixins to call for data rebuild.\n for (i = 0; i < mixinIds.oldMixinIds.length; i++) {\n mixinEl = document.getElementById(mixinIds.oldMixinIds[i]);\n if (!mixinEl) { continue; }\n for (component in mixinEl.componentCache) {\n if (componentsUpdated.indexOf(component) === -1) {\n if (this.components[component]) {\n if (this.getDOMAttribute(component)) {\n // Update component if explicitly defined.\n this.components[component].handleMixinUpdate();\n } else {\n // Remove component if not explicitly defined.\n this.removeComponent(component, true);\n }\n }\n }\n }\n }\n };\n })()\n },\n\n /**\n * setAttribute can:\n *\n * 1. Set a single property of a multi-property component.\n * 2. Set multiple properties of a multi-property component.\n * 3. Replace properties of a multi-property component.\n * 4. Set a value for a single-property component, mixin, or normal HTML attribute.\n *\n * @param {string} attrName - Component or attribute name.\n * @param {*} arg1 - Can be a value, property name, CSS-style property string, or\n * object of properties.\n * @param {*|bool} arg2 - If arg1 is a property name, this should be a value. Otherwise,\n * it is a boolean indicating whether to clobber previous values (defaults to false).\n */\n setAttribute: {\n value: (function () {\n var singlePropUpdate = {};\n\n return function (attrName, arg1, arg2) {\n var newAttrValue;\n var clobber;\n var componentName;\n var delimiterIndex;\n var isDebugMode;\n var key;\n\n delimiterIndex = attrName.indexOf(MULTIPLE_COMPONENT_DELIMITER);\n componentName = delimiterIndex > 0 ? attrName.substring(0, delimiterIndex) : attrName;\n\n // Not a component. Normal set attribute.\n if (!COMPONENTS[componentName]) {\n if (attrName === 'mixin') { this.mixinUpdate(arg1); }\n ANode.prototype.setAttribute.call(this, attrName, arg1);\n return;\n }\n\n // Initialize component first if not yet initialized.\n if (!this.components[attrName] && this.hasAttribute(attrName)) {\n this.updateComponent(\n attrName,\n window.HTMLElement.prototype.getAttribute.call(this, attrName));\n }\n\n // Determine new attributes from the arguments\n if (typeof arg2 !== 'undefined' &&\n typeof arg1 === 'string' &&\n arg1.length > 0 &&\n typeof utils.styleParser.parse(arg1) === 'string') {\n // Update a single property of a multi-property component\n for (key in singlePropUpdate) { delete singlePropUpdate[key]; }\n newAttrValue = singlePropUpdate;\n newAttrValue[arg1] = arg2;\n clobber = false;\n } else {\n // Update with a value, object, or CSS-style property string, with the possiblity\n // of clobbering previous values.\n newAttrValue = arg1;\n clobber = (arg2 === true);\n }\n\n // Update component\n this.updateComponent(attrName, newAttrValue, clobber);\n\n // In debug mode, write component data up to the DOM.\n isDebugMode = this.sceneEl && this.sceneEl.getAttribute('debug');\n if (isDebugMode) { this.components[attrName].flushToDOM(); }\n };\n })(),\n writable: window.debug\n },\n\n /**\n * Reflect component data in the DOM (as seen from the browser DOM Inspector).\n *\n * @param {bool} recursive - Also flushToDOM on the children.\n **/\n flushToDOM: {\n value: function (recursive) {\n var components = this.components;\n var child;\n var children = this.children;\n var i;\n var key;\n\n // Flush entity's components to DOM.\n for (key in components) {\n components[key].flushToDOM();\n }\n\n // Recurse.\n if (!recursive) { return; }\n for (i = 0; i < children.length; ++i) {\n child = children[i];\n if (!child.flushToDOM) { continue; }\n child.flushToDOM(recursive);\n }\n }\n },\n\n /**\n * If `attr` is a component, returns ALL component data including applied mixins and\n * defaults.\n *\n * If `attr` is not a component, fall back to HTML getAttribute.\n *\n * @param {string} attr\n * @returns {object|string} Object if component, else string.\n */\n getAttribute: {\n value: function (attr) {\n // If component, return component data.\n var component;\n if (attr === 'position') { return this.object3D.position; }\n if (attr === 'rotation') { return getRotation(this); }\n if (attr === 'scale') { return this.object3D.scale; }\n if (attr === 'visible') { return this.object3D.visible; }\n component = this.components[attr];\n if (component) { return component.data; }\n return window.HTMLElement.prototype.getAttribute.call(this, attr);\n },\n writable: window.debug\n },\n\n /**\n * If `attr` is a component, returns JUST the component data defined on the entity.\n * Like a partial version of `getComputedAttribute` as returned component data\n * does not include applied mixins or defaults.\n *\n * If `attr` is not a component, fall back to HTML getAttribute.\n *\n * @param {string} attr\n * @returns {object|string} Object if component, else string.\n */\n getDOMAttribute: {\n value: function (attr) {\n // If cached value exists, return partial component data.\n var component = this.components[attr];\n if (component) { return component.attrValue; }\n return window.HTMLElement.prototype.getAttribute.call(this, attr);\n },\n writable: window.debug\n },\n\n addState: {\n value: function (state) {\n if (this.is(state)) { return; }\n this.states.push(state);\n this.emit('stateadded', state);\n }\n },\n\n removeState: {\n value: function (state) {\n var stateIndex = this.states.indexOf(state);\n if (stateIndex === -1) { return; }\n this.states.splice(stateIndex, 1);\n this.emit('stateremoved', state);\n }\n },\n\n /**\n * Checks if the element is in a given state. e.g. el.is('alive');\n * @type {string} state - Name of the state we want to check\n */\n is: {\n value: function (state) {\n return this.states.indexOf(state) !== -1;\n }\n },\n\n /**\n * Open Inspector to this entity.\n */\n inspect: {\n value: function () {\n this.sceneEl.components.inspector.openInspector(this);\n }\n },\n\n /**\n * Clean up memory and return memory to object pools.\n */\n destroy: {\n value: function () {\n var key;\n if (this.parentNode) {\n warn('Entity can only be destroyed if detached from scenegraph.');\n return;\n }\n for (key in this.components) {\n this.components[key].destroy();\n }\n }\n }\n});\n\n/**\n * Check if a component is *defined* for an entity, including defaults and mixins.\n * Does not check whether the component has been *initialized* for an entity.\n *\n * @param {string} el - Entity.\n * @param {string} name - Component name.\n * @returns {boolean}\n */\nfunction checkComponentDefined (el, name) {\n // Check if element contains the component.\n if (el.components[name] && el.components[name].attrValue) { return true; }\n\n return isComponentMixedIn(name, el.mixinEls);\n}\n\n/**\n * Check if any mixins contains a component.\n *\n * @param {string} name - Component name.\n * @param {array} mixinEls - Array of <a-mixin>s.\n */\nfunction isComponentMixedIn (name, mixinEls) {\n var i;\n var inMixin = false;\n for (i = 0; i < mixinEls.length; ++i) {\n inMixin = mixinEls[i].hasAttribute(name);\n if (inMixin) { break; }\n }\n return inMixin;\n}\n\n/**\n * Given entity defined value, merge in extra data if necessary.\n * Handle both single and multi-property components.\n *\n * @param {string} attrValue - Entity data.\n * @param extraData - Entity data from another source to merge in.\n */\nfunction mergeComponentData (attrValue, extraData) {\n // Extra data not defined, just return attrValue.\n if (!extraData) { return attrValue; }\n\n // Merge multi-property data.\n if (extraData.constructor === Object) {\n return utils.extend(extraData, utils.styleParser.parse(attrValue || {}));\n }\n\n // Return data, precendence to the defined value.\n return attrValue || extraData;\n}\n\nfunction isComponent (componentName) {\n if (componentName.indexOf(MULTIPLE_COMPONENT_DELIMITER) !== -1) {\n componentName = utils.split(componentName, MULTIPLE_COMPONENT_DELIMITER)[0];\n }\n if (!COMPONENTS[componentName]) { return false; }\n return true;\n}\n\nfunction getRotation (entityEl) {\n var radToDeg = THREE.Math.radToDeg;\n var rotation = entityEl.object3D.rotation;\n var rotationObj = entityEl.rotationObj;\n rotationObj.x = radToDeg(rotation.x);\n rotationObj.y = radToDeg(rotation.y);\n rotationObj.z = radToDeg(rotation.z);\n return rotationObj;\n}\n\nAEntity = registerElement('a-entity', {prototype: proto});\nmodule.exports = AEntity;\n",
  368. "var ANode = require('./a-node');\nvar registerElement = require('./a-register-element').registerElement;\nvar components = require('./component').components;\nvar utils = require('../utils');\n\nvar MULTIPLE_COMPONENT_DELIMITER = '__';\n\n/**\n * @member {object} componentCache - Cache of pre-parsed values. An object where the keys\n * are component names and the values are already parsed by the component.\n */\nmodule.exports = registerElement('a-mixin', {\n prototype: Object.create(ANode.prototype, {\n createdCallback: {\n value: function () {\n this.componentCache = {};\n this.id = this.getAttribute('id');\n this.isMixin = true;\n }\n },\n\n attributeChangedCallback: {\n value: function (attr, oldVal, newVal) {\n this.cacheAttribute(attr, newVal);\n this.updateEntities();\n }\n },\n\n attachedCallback: {\n value: function () {\n this.sceneEl = this.closestScene();\n this.cacheAttributes();\n this.updateEntities();\n this.load();\n }\n },\n\n /**\n * setAttribute that parses and caches component values.\n */\n setAttribute: {\n value: function (attr, value) {\n window.HTMLElement.prototype.setAttribute.call(this, attr, value);\n this.cacheAttribute(attr, value);\n }\n },\n\n /**\n * If `attr` is a component, then parse the value using the schema and store it.\n */\n cacheAttribute: {\n value: function (attr, value) {\n var component;\n var componentName;\n\n // Get component data.\n componentName = utils.split(attr, MULTIPLE_COMPONENT_DELIMITER)[0];\n component = components[componentName];\n if (!component) { return; }\n if (value === undefined) {\n value = window.HTMLElement.prototype.getAttribute.call(this, attr);\n }\n this.componentCache[attr] = component.parseAttrValueForCache(value);\n }\n },\n\n /**\n * If `attr` is a component, then grab pre-parsed value from the cache.\n * Else do a normal getAttribute.\n */\n getAttribute: {\n value: function (attr) {\n return this.componentCache[attr] ||\n window.HTMLElement.prototype.getAttribute.call(this, attr);\n }\n },\n\n /**\n * Parse and cache every component defined on the mixin.\n */\n cacheAttributes: {\n value: function () {\n var attributes = this.attributes;\n var attrName;\n var i;\n for (i = 0; i < attributes.length; i++) {\n attrName = attributes[i].name;\n this.cacheAttribute(attrName);\n }\n }\n },\n\n /**\n * For entities that already have been loaded by the time the mixin was attached, tell\n * those entities to register the mixin and refresh their component data.\n */\n updateEntities: {\n value: function () {\n var entity;\n var entities;\n var i;\n\n if (!this.sceneEl) { return; }\n\n entities = this.sceneEl.querySelectorAll('[mixin~=' + this.id + ']');\n for (i = 0; i < entities.length; i++) {\n entity = entities[i];\n if (!entity.hasLoaded || entity.isMixin) { continue; }\n entity.mixinUpdate(this.id);\n }\n }\n }\n })\n});\n",
  369. "/* global CustomEvent */\nvar registerElement = require('./a-register-element').registerElement;\nvar isNode = require('./a-register-element').isNode;\nvar utils = require('../utils/');\n\nvar warn = utils.debug('core:a-node:warn');\nvar error = utils.debug('core:a-node:error');\n\n/**\n * Base class for A-Frame that manages loading of objects.\n *\n * Nodes can be modified using mixins.\n * Nodes emit a `loaded` event when they and their children have initialized.\n */\nmodule.exports = registerElement('a-node', {\n prototype: Object.create(window.HTMLElement.prototype, {\n createdCallback: {\n value: function () {\n this.computedMixinStr = '';\n this.hasLoaded = false;\n this.isNode = true;\n this.mixinEls = [];\n },\n writable: window.debug\n },\n\n attachedCallback: {\n value: function () {\n var mixins;\n this.sceneEl = this.closestScene();\n\n if (!this.sceneEl) {\n warn('You are attempting to attach <' + this.tagName + '> outside of an A-Frame ' +\n 'scene. Append this element to `<a-scene>` instead.');\n }\n\n this.hasLoaded = false;\n this.emit('nodeready', undefined, false);\n\n if (!this.isMixin) {\n mixins = this.getAttribute('mixin');\n if (mixins) { this.updateMixins(mixins); }\n }\n },\n writable: window.debug\n },\n\n /**\n * Handle mixin.\n */\n attributeChangedCallback: {\n value: function (attr, oldVal, newVal) {\n // Ignore if `<a-node>` code is just updating computed mixin in the DOM.\n if (newVal === this.computedMixinStr) { return; }\n\n if (attr === 'mixin' && !this.isMixin) {\n this.updateMixins(newVal, oldVal);\n }\n }\n },\n\n /**\n * Returns the first scene by traversing up the tree starting from and\n * including receiver element.\n */\n closestScene: {\n value: function closest () {\n var element = this;\n while (element) {\n if (element.isScene) { break; }\n element = element.parentElement;\n }\n return element;\n }\n },\n\n /**\n * Returns first element matching a selector by traversing up the tree starting\n * from and including receiver element.\n *\n * @param {string} selector - Selector of element to find.\n */\n closest: {\n value: function closest (selector) {\n var matches = this.matches || this.mozMatchesSelector ||\n this.msMatchesSelector || this.oMatchesSelector || this.webkitMatchesSelector;\n var element = this;\n while (element) {\n if (matches.call(element, selector)) { break; }\n element = element.parentElement;\n }\n return element;\n }\n },\n\n detachedCallback: {\n value: function () {\n this.hasLoaded = false;\n }\n },\n\n /**\n * Wait for children to load, if any.\n * Then emit `loaded` event and set `hasLoaded`.\n */\n load: {\n value: function (cb, childFilter) {\n var children;\n var childrenLoaded;\n var self = this;\n\n if (this.hasLoaded) { return; }\n\n // Default to waiting for all nodes.\n childFilter = childFilter || isNode;\n // Wait for children to load (if any), then load.\n children = this.getChildren();\n childrenLoaded = children.filter(childFilter).map(function (child) {\n return new Promise(function waitForLoaded (resolve) {\n if (child.hasLoaded) { return resolve(); }\n child.addEventListener('loaded', resolve);\n });\n });\n\n Promise.all(childrenLoaded).then(function emitLoaded () {\n self.hasLoaded = true;\n if (cb) { cb(); }\n self.emit('loaded', undefined, false);\n }).catch(function (err) {\n error('Failure loading node: ', err);\n });\n },\n writable: true\n },\n\n getChildren: {\n value: function () {\n return Array.prototype.slice.call(this.children, 0);\n }\n },\n\n /**\n * Unregister old mixins and listeners.\n * Register new mixins and listeners.\n * Registering means to update `this.mixinEls` with listeners.\n */\n updateMixins: {\n value: (function () {\n var newMixinIdArray = [];\n var oldMixinIdArray = [];\n var mixinIds = {};\n\n return function (newMixins, oldMixins) {\n var i;\n var newMixinIds;\n var oldMixinIds;\n\n newMixinIdArray.length = 0;\n oldMixinIdArray.length = 0;\n newMixinIds = newMixins ? utils.split(newMixins.trim(), /\\s+/) : newMixinIdArray;\n oldMixinIds = oldMixins ? utils.split(oldMixins.trim(), /\\s+/) : oldMixinIdArray;\n\n mixinIds.newMixinIds = newMixinIds;\n mixinIds.oldMixinIds = oldMixinIds;\n\n // Unregister old mixins.\n for (i = 0; i < oldMixinIds.length; i++) {\n if (newMixinIds.indexOf(oldMixinIds[i]) === -1) {\n this.unregisterMixin(oldMixinIds[i]);\n }\n }\n\n // Register new mixins.\n this.computedMixinStr = '';\n this.mixinEls.length = 0;\n for (i = 0; i < newMixinIds.length; i++) {\n this.registerMixin(document.getElementById(newMixinIds[i]));\n }\n\n // Update DOM. Keep track of `computedMixinStr` to not recurse back here after\n // update.\n if (this.computedMixinStr) {\n this.computedMixinStr = this.computedMixinStr.trim();\n window.HTMLElement.prototype.setAttribute.call(this, 'mixin',\n this.computedMixinStr);\n }\n\n return mixinIds;\n };\n })()\n },\n\n /**\n * From mixin ID, add mixin element to `mixinEls`.\n *\n * @param {Element} mixinEl\n */\n registerMixin: {\n value: function (mixinEl) {\n var compositedMixinIds;\n var i;\n var mixin;\n\n if (!mixinEl) { return; }\n\n // Register composited mixins (if mixin has mixins).\n mixin = mixinEl.getAttribute('mixin');\n if (mixin) {\n compositedMixinIds = utils.split(mixin.trim(), /\\s+/);\n for (i = 0; i < compositedMixinIds.length; i++) {\n this.registerMixin(document.getElementById(compositedMixinIds[i]));\n }\n }\n\n // Register mixin.\n this.computedMixinStr = this.computedMixinStr + ' ' + mixinEl.id;\n this.mixinEls.push(mixinEl);\n }\n },\n\n setAttribute: {\n value: function (attr, newValue) {\n if (attr === 'mixin') { this.updateMixins(newValue); }\n window.HTMLElement.prototype.setAttribute.call(this, attr, newValue);\n }\n },\n\n unregisterMixin: {\n value: function (mixinId) {\n var i;\n var mixinEls = this.mixinEls;\n var mixinEl;\n for (i = 0; i < mixinEls.length; ++i) {\n mixinEl = mixinEls[i];\n if (mixinId === mixinEl.id) {\n mixinEls.splice(i, 1);\n break;\n }\n }\n }\n },\n\n /**\n * Emit a DOM event.\n *\n * @param {string} name - Name of event.\n * @param {object} [detail={}] - Custom data to pass as `detail` to the event.\n * @param {boolean} [bubbles=true] - Whether the event should bubble.\n * @param {object} [extraData] - Extra data to pass to the event, if any.\n */\n emit: {\n value: (function () {\n var data = {};\n\n return function (name, detail, bubbles, extraData) {\n if (bubbles === undefined) { bubbles = true; }\n data.bubbles = !!bubbles;\n data.detail = detail;\n\n // If extra data is present, we need to create a new object.\n if (extraData) { data = utils.extend({}, extraData, data); }\n\n this.dispatchEvent(new CustomEvent(name, data));\n };\n })(),\n writable: window.debug\n }\n })\n});\n",
  370. "/*\n ------------------------------------------------------------\n ------------- WARNING WARNING WARNING WARNING --------------\n ------------------------------------------------------------\n\n This module wraps registerElement to deal with components that inherit from\n `ANode` and `AEntity`. It's a pass through in any other case.\n\n It wraps some of the prototype methods of the created element to make sure\n that the corresponding functions in the base prototypes (`AEntity` and `ANode`)\n are also invoked. The method in the base prototype is always called before the one\n in the derived prototype.\n*/\n\n// Polyfill `document.registerElement`.\nrequire('document-register-element');\n\nvar ANode; // Must declare before AEntity. Initialized at the bottom.\nvar AEntity;\nvar knownTags = module.exports.knownTags = {};\n\nfunction addTagName (tagName) {\n knownTags[tagName.toLowerCase()] = true;\n}\n\n/**\n * Return whether the element type is one of our known registered ones.\n *\n * @param {string} node - The name of the tag to register.\n * @returns {boolean} Whether the tag name matches that of our registered custom elements.\n */\nmodule.exports.isNode = function (node) {\n return node.tagName.toLowerCase() in knownTags || node.isNode;\n};\n\n/**\n * @param {string} tagName - The name of the tag to register.\n * @param {object} obj - The prototype of the new element.\n * @returns {object} The prototype of the new element.\n */\nmodule.exports.registerElement = function (tagName, obj) {\n var proto = Object.getPrototypeOf(obj.prototype);\n var newObj = obj;\n var isANode = ANode && proto === ANode.prototype;\n var isAEntity = AEntity && proto === AEntity.prototype;\n\n if (isANode || isAEntity) { addTagName(tagName); }\n\n // Wrap if element inherits from `ANode`.\n if (isANode) {\n newObj = wrapANodeMethods(obj.prototype);\n newObj = {prototype: Object.create(proto, newObj)};\n }\n\n // Wrap if element inherits from `AEntity`.\n if (isAEntity) {\n newObj = wrapAEntityMethods(obj.prototype);\n newObj = {prototype: Object.create(proto, newObj)};\n }\n\n // Give all functions their proper name.\n Object.getOwnPropertyNames(newObj.prototype).forEach(function (propName) {\n var propVal = newObj.prototype[propName];\n if (typeof propVal === 'function') {\n propVal.displayName = propName;\n }\n });\n\n return document.registerElement(tagName, newObj);\n};\n\n/**\n * Wrap some obj methods to call those on `ANode` base prototype.\n *\n * @param {object} obj - Object that contains the methods that will be wrapped.\n * @return {object} An object with the same properties as the input parameter but\n * with some of methods wrapped.\n */\nfunction wrapANodeMethods (obj) {\n var newObj = {};\n var ANodeMethods = [\n 'attachedCallback',\n 'attributeChangedCallback',\n 'createdCallback',\n 'detachedCallback'\n ];\n wrapMethods(newObj, ANodeMethods, obj, ANode.prototype);\n copyProperties(obj, newObj);\n return newObj;\n}\n\n/**\n * This wraps some of the obj methods to call those on `AEntity` base prototype.\n *\n * @param {object} obj - The objects that contains the methods that will be wrapped.\n * @return {object} - An object with the same properties as the input parameter but\n * with some of methods wrapped.\n */\nfunction wrapAEntityMethods (obj) {\n var newObj = {};\n var ANodeMethods = [\n 'attachedCallback',\n 'attributeChangedCallback',\n 'createdCallback',\n 'detachedCallback'\n ];\n var AEntityMethods = [\n 'attachedCallback',\n 'attributeChangedCallback',\n 'createdCallback',\n 'detachedCallback'\n ];\n\n wrapMethods(newObj, ANodeMethods, obj, ANode.prototype);\n wrapMethods(newObj, AEntityMethods, obj, AEntity.prototype);\n // Copies the remaining properties into the new object.\n copyProperties(obj, newObj);\n return newObj;\n}\n\n/**\n * Wrap a list a methods to ensure that those in the base prototype are called\n * before the derived one.\n *\n * @param {object} targetObj - Object that will contain the wrapped methods.\n * @param {array} methodList - List of methods from the derivedObj that will be wrapped.\n * @param {object} derivedObject - Object that inherits from the baseObj.\n * @param {object} baseObj - Object that derivedObj inherits from.\n */\nfunction wrapMethods (targetObj, methodList, derivedObj, baseObj) {\n methodList.forEach(function (methodName) {\n wrapMethod(targetObj, methodName, derivedObj, baseObj);\n });\n}\nmodule.exports.wrapMethods = wrapMethods;\n\n/**\n * Wrap one method to ensure that the one in the base prototype is called before\n * the one in the derived one.\n *\n * @param {object} obj - Object that will contain the wrapped method.\n * @param {string} methodName - The name of the method that will be wrapped.\n * @param {object} derivedObject - Object that inherits from the baseObj.\n * @param {object} baseObj - Object that derivedObj inherits from.\n */\nfunction wrapMethod (obj, methodName, derivedObj, baseObj) {\n var derivedMethod = derivedObj[methodName];\n var baseMethod = baseObj[methodName];\n\n // Derived prototype does not define method, no need to wrap.\n if (!derivedMethod || !baseMethod) { return; }\n\n // Derived prototype doesn't override the one in the base one, no need to wrap.\n if (derivedMethod === baseMethod) { return; }\n\n // Wrap to ensure the base method is called before the one in the derived prototype.\n obj[methodName] = {\n value: function wrappedMethod () {\n baseMethod.apply(this, arguments);\n return derivedMethod.apply(this, arguments);\n },\n writable: window.debug\n };\n}\n\n/**\n * It copies the properties from source to destination object if they don't\n * exist already.\n *\n * @param {object} source - The object where properties are copied from.\n * @param {type} destination - The object where properties are copied to.\n */\nfunction copyProperties (source, destination) {\n var props = Object.getOwnPropertyNames(source);\n props.forEach(function (prop) {\n var desc;\n if (!destination[prop]) {\n desc = Object.getOwnPropertyDescriptor(source, prop);\n destination[prop] = {value: source[prop], writable: desc.writable};\n }\n });\n}\n\nANode = require('./a-node');\nAEntity = require('./a-entity');\n",
  371. "/* global Node */\nvar schema = require('./schema');\nvar scenes = require('./scene/scenes');\nvar systems = require('./system');\nvar utils = require('../utils/');\n\nvar components = module.exports.components = {}; // Keep track of registered components.\nvar parseProperties = schema.parseProperties;\nvar parseProperty = schema.parseProperty;\nvar processSchema = schema.process;\nvar isSingleProp = schema.isSingleProperty;\nvar stringifyProperties = schema.stringifyProperties;\nvar stringifyProperty = schema.stringifyProperty;\nvar styleParser = utils.styleParser;\nvar warn = utils.debug('core:component:warn');\n\nvar aframeScript = document.currentScript;\nvar upperCaseRegExp = new RegExp('[A-Z]+');\n\n// Object pools by component, created upon registration.\nvar objectPools = {};\n\n/**\n * Component class definition.\n *\n * Components configure appearance, modify behavior, or add functionality to\n * entities. The behavior and appearance of an entity can be changed at runtime\n * by adding, removing, or updating components. Entities do not share instances\n * of components.\n *\n * @member {object} el - Reference to the entity element.\n * @member {string} attrValue - Value of the corresponding HTML attribute.\n * @member {object} data - Component data populated by parsing the\n * mapped attribute of the component plus applying defaults and mixins.\n */\nvar Component = module.exports.Component = function (el, attrValue, id) {\n var self = this;\n this.el = el;\n this.id = id;\n this.attrName = this.name + (id ? '__' + id : '');\n this.evtDetail = {id: this.id, name: this.name};\n this.initialized = false;\n this.isSingleProperty = isSingleProp(this.schema);\n this.isSinglePropertyObject = this.isSingleProperty &&\n isObject(parseProperty(undefined, this.schema)) &&\n !(this.schema.default instanceof window.HTMLElement);\n this.isObjectBased = !this.isSingleProperty || this.isSinglePropertyObject;\n this.el.components[this.attrName] = this;\n this.objectPool = objectPools[this.name];\n\n const events = this.events;\n this.events = {};\n eventsBind(this, events);\n\n // Store component data from previous update call.\n this.attrValue = undefined;\n if (this.isObjectBased) {\n this.nextData = this.objectPool.use();\n // Drop any properties added by dynamic schemas in previous use\n utils.objectPool.removeUnusedKeys(this.nextData, this.schema);\n this.oldData = this.objectPool.use();\n utils.objectPool.removeUnusedKeys(this.oldData, this.schema);\n this.previousOldData = this.objectPool.use();\n utils.objectPool.removeUnusedKeys(this.previousOldData, this.schema);\n this.parsingAttrValue = this.objectPool.use();\n utils.objectPool.removeUnusedKeys(this.parsingAttrValue, this.schema);\n } else {\n this.nextData = undefined;\n this.oldData = undefined;\n this.previousOldData = undefined;\n this.parsingAttrValue = undefined;\n }\n\n // Last value passed to updateProperties.\n this.throttledEmitComponentChanged = utils.throttle(function emitChange () {\n el.emit('componentchanged', self.evtDetail, false);\n }, 200);\n this.updateProperties(attrValue);\n};\n\nComponent.prototype = {\n /**\n * Contains the type schema and defaults for the data values.\n * Data is coerced into the types of the values of the defaults.\n */\n schema: {},\n\n /**\n * Init handler. Similar to attachedCallback.\n * Called during component initialization and is only run once.\n * Components can use this to set initial state.\n */\n init: function () { /* no-op */ },\n\n /**\n * Map of event names to binded event handlers that will be lifecycle-handled.\n * Will be detached on pause / remove.\n * Will be attached on play.\n */\n events: {},\n\n /**\n * Update handler. Similar to attributeChangedCallback.\n * Called whenever component's data changes.\n * Also called on component initialization when the component receives initial data.\n *\n * @param {object} prevData - Previous attributes of the component.\n */\n update: function (prevData) { /* no-op */ },\n\n updateSchema: undefined,\n\n /**\n * Tick handler.\n * Called on each tick of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n */\n tick: undefined,\n\n /**\n * Tock handler.\n * Called on each tock of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n * @param {object} camera - Camera used to render the last frame.\n */\n tock: undefined,\n\n /**\n * Called to start any dynamic behavior (e.g., animation, AI, events, physics).\n */\n play: function () { /* no-op */ },\n\n /**\n * Called to stop any dynamic behavior (e.g., animation, AI, events, physics).\n */\n pause: function () { /* no-op */ },\n\n /**\n * Remove handler. Similar to detachedCallback.\n * Called whenever component is removed from the entity (i.e., removeAttribute).\n * Components can use this to reset behavior on the entity.\n */\n remove: function () { /* no-op */ },\n\n /**\n * Parses each property based on property type.\n * If component is single-property, then parses the single property value.\n *\n * @param {string} value - HTML attribute value.\n * @param {boolean} silent - Suppress warning messages.\n * @returns {object} Component data.\n */\n parse: function (value, silent) {\n var schema = this.schema;\n if (this.isSingleProperty) { return parseProperty(value, schema); }\n return parseProperties(styleParser.parse(value), schema, true, this.name, silent);\n },\n\n /**\n * Stringify properties if necessary.\n *\n * Only called from `Entity.setAttribute` for properties whose parsers accept a non-string\n * value (e.g., selector, vec3 property types).\n *\n * @param {object} data - Complete component data.\n * @returns {string}\n */\n stringify: function (data) {\n var schema = this.schema;\n if (typeof data === 'string') { return data; }\n if (this.isSingleProperty) { return stringifyProperty(data, schema); }\n data = stringifyProperties(data, schema);\n return styleParser.stringify(data);\n },\n\n /**\n * Update the cache of the pre-parsed attribute value.\n *\n * @param {string} value - New data.\n * @param {boolean } clobber - Whether to wipe out and replace previous data.\n */\n updateCachedAttrValue: function (value, clobber) {\n var newAttrValue;\n var tempObject;\n var property;\n\n if (value === undefined) { return; }\n\n // If null value is the new attribute value, make the attribute value falsy.\n if (value === null) {\n if (this.isObjectBased && this.attrValue) {\n this.objectPool.recycle(this.attrValue);\n }\n this.attrValue = undefined;\n return;\n }\n\n if (value instanceof Object && !(value instanceof window.HTMLElement)) {\n // If value is an object, copy it to our pooled newAttrValue object to use to update\n // the attrValue.\n tempObject = this.objectPool.use();\n newAttrValue = utils.extend(tempObject, value);\n } else {\n newAttrValue = this.parseAttrValueForCache(value);\n }\n\n // Merge new data with previous `attrValue` if updating and not clobbering.\n if (this.isObjectBased && !clobber && this.attrValue) {\n for (property in this.attrValue) {\n if (newAttrValue[property] === undefined) {\n newAttrValue[property] = this.attrValue[property];\n }\n }\n }\n\n // Update attrValue.\n if (this.isObjectBased && !this.attrValue) {\n this.attrValue = this.objectPool.use();\n }\n utils.objectPool.clearObject(this.attrValue);\n this.attrValue = extendProperties(this.attrValue, newAttrValue, this.isObjectBased);\n utils.objectPool.clearObject(tempObject);\n },\n\n /**\n * Given an HTML attribute value parses the string based on the component schema.\n * To avoid double parsings of strings into strings we store the original instead\n * of the parsed one\n *\n * @param {string} value - HTML attribute value\n */\n parseAttrValueForCache: function (value) {\n var parsedValue;\n if (typeof value !== 'string') { return value; }\n if (this.isSingleProperty) {\n parsedValue = this.schema.parse(value);\n /**\n * To avoid bogus double parsings. Cached values will be parsed when building\n * component data. For instance when parsing a src id to its url, we want to cache\n * original string and not the parsed one (#monster -> models/monster.dae)\n * so when building data we parse the expected value.\n */\n if (typeof parsedValue === 'string') { parsedValue = value; }\n } else {\n // Parse using the style parser to avoid double parsing of individual properties.\n utils.objectPool.clearObject(this.parsingAttrValue);\n parsedValue = styleParser.parse(value, this.parsingAttrValue);\n }\n return parsedValue;\n },\n\n /**\n * Write cached attribute data to the entity DOM element.\n *\n * @param {boolean} isDefault - Whether component is a default component. Always flush for\n * default components.\n */\n flushToDOM: function (isDefault) {\n var attrValue = isDefault ? this.data : this.attrValue;\n if (attrValue === null || attrValue === undefined) { return; }\n window.HTMLElement.prototype.setAttribute.call(this.el, this.attrName,\n this.stringify(attrValue));\n },\n\n /**\n * Apply new component data if data has changed (from setAttribute).\n *\n * @param {string} attrValue - HTML attribute value.\n * If undefined, use the cached attribute value and continue updating properties.\n * @param {boolean} clobber - The previous component data is overwritten by the atrrValue\n */\n updateProperties: function (attrValue, clobber) {\n var el = this.el;\n\n // Just cache the attribute if the entity has not loaded\n // Components are not initialized until the entity has loaded\n if (!el.hasLoaded) {\n this.updateCachedAttrValue(attrValue);\n return;\n }\n\n // Parse the attribute value.\n // Cache current attrValue for future updates. Updates `this.attrValue`.\n // `null` means no value on purpose, do not set a default value, let mixins take over.\n if (attrValue !== null) {\n attrValue = this.parseAttrValueForCache(attrValue);\n }\n\n // Cache current attrValue for future updates.\n this.updateCachedAttrValue(attrValue, clobber);\n\n if (this.initialized) {\n this.updateComponent(attrValue, clobber);\n this.callUpdateHandler();\n } else {\n this.initComponent();\n }\n },\n\n initComponent: function () {\n var el = this.el;\n var initialOldData;\n\n // Build data.\n if (this.updateSchema) { this.updateSchema(this.buildData(this.attrValue, false, true)); }\n this.data = this.buildData(this.attrValue);\n\n // Component is being already initialized.\n if (el.initializingComponents[this.name]) { return; }\n\n // Prevent infinite loop in case of init method setting same component on the entity.\n el.initializingComponents[this.name] = true;\n // Initialize component.\n this.init();\n this.initialized = true;\n delete el.initializingComponents[this.name];\n\n // Store current data as previous data for future updates.\n this.oldData = extendProperties(this.oldData, this.data, this.isObjectBased);\n\n // For oldData, pass empty object to multiple-prop schemas or object single-prop schema.\n // Pass undefined to rest of types.\n initialOldData = this.isObjectBased ? this.objectPool.use() : undefined;\n this.update(initialOldData);\n if (this.isObjectBased) { this.objectPool.recycle(initialOldData); }\n\n // Play the component if the entity is playing.\n if (el.isPlaying) { this.play(); }\n el.emit('componentinitialized', this.evtDetail, false);\n },\n\n /**\n * @param attrValue - Passed argument from setAttribute.\n */\n updateComponent: function (attrValue, clobber) {\n var key;\n var mayNeedSchemaUpdate;\n\n if (clobber) {\n // Clobber. Rebuild.\n if (this.updateSchema) {\n this.updateSchema(this.buildData(this.attrValue, true, true));\n }\n this.data = this.buildData(this.attrValue, true, false);\n return;\n }\n\n // Apply new value to this.data in place since direct update.\n if (this.isSingleProperty) {\n if (this.isObjectBased) {\n parseProperty(attrValue, this.schema);\n }\n // Single-property (already parsed).\n this.data = attrValue;\n return;\n }\n\n parseProperties(attrValue, this.schema, true, this.name);\n\n // Check if we need to update schema.\n if (this.schemaChangeKeys.length) {\n for (key in attrValue) {\n if (this.schema[key].schemaChange) {\n mayNeedSchemaUpdate = true;\n break;\n }\n }\n }\n if (mayNeedSchemaUpdate) {\n // Rebuild data if need schema update.\n if (this.updateSchema) {\n this.updateSchema(this.buildData(this.attrValue, true, true));\n }\n this.data = this.buildData(this.attrValue, true, false);\n return;\n }\n\n // Normal update.\n for (key in attrValue) {\n if (attrValue[key] === undefined) { continue; }\n this.data[key] = attrValue[key];\n }\n },\n\n /**\n * Check if component should fire update and fire update lifecycle handler.\n */\n callUpdateHandler: function () {\n var hasComponentChanged;\n\n // Store the previous old data before we calculate the new oldData.\n if (this.previousOldData instanceof Object) {\n utils.objectPool.clearObject(this.previousOldData);\n }\n if (this.isObjectBased) {\n copyData(this.previousOldData, this.oldData);\n } else {\n this.previousOldData = this.oldData;\n }\n\n hasComponentChanged = !utils.deepEqual(this.oldData, this.data);\n\n // Don't update if properties haven't changed.\n // Always update rotation, position, scale.\n if (!this.isPositionRotationScale && !hasComponentChanged) { return; }\n\n // Store current data as previous data for future updates.\n // Reuse `this.oldData` object to try not to allocate another one.\n if (this.oldData instanceof Object) { utils.objectPool.clearObject(this.oldData); }\n this.oldData = extendProperties(this.oldData, this.data, this.isObjectBased);\n\n // Update component with the previous old data.\n this.update(this.previousOldData);\n\n this.throttledEmitComponentChanged();\n },\n\n handleMixinUpdate: function () {\n this.data = this.buildData(this.attrValue);\n this.callUpdateHandler();\n },\n\n /**\n * Reset value of a property to the property's default value.\n * If single-prop component, reset value to component's default value.\n *\n * @param {string} propertyName - Name of property to reset.\n */\n resetProperty: function (propertyName) {\n if (this.isObjectBased) {\n if (!(propertyName in this.attrValue)) { return; }\n delete this.attrValue[propertyName];\n this.data[propertyName] = this.schema[propertyName].default;\n } else {\n this.attrValue = this.schema.default;\n this.data = this.schema.default;\n }\n this.updateProperties(this.attrValue);\n },\n\n /**\n * Extend schema of component given a partial schema.\n *\n * Some components might want to mutate their schema based on certain properties.\n * e.g., Material component changes its schema based on `shader` to account for different\n * uniforms\n *\n * @param {object} schemaAddon - Schema chunk that extend base schema.\n */\n extendSchema: function (schemaAddon) {\n var extendedSchema;\n // Clone base schema.\n extendedSchema = utils.extend({}, components[this.name].schema);\n // Extend base schema with new schema chunk.\n utils.extend(extendedSchema, schemaAddon);\n this.schema = processSchema(extendedSchema);\n this.el.emit('schemachanged', this.evtDetail);\n },\n\n /**\n * Build component data from the current state of the entity.data.\n *\n * Precedence:\n * 1. Defaults data\n * 2. Mixin data.\n * 3. Attribute data.\n *\n * Finally coerce the data to the types of the defaults.\n *\n * @param {object} newData - Element new data.\n * @param {boolean} clobber - The previous data is completely replaced by the new one.\n * @param {boolean} silent - Suppress warning messages.\n * @return {object} The component data\n */\n buildData: function (newData, clobber, silent) {\n var componentDefined;\n var data;\n var defaultValue;\n var key;\n var mixinData;\n var nextData = this.nextData;\n var schema = this.schema;\n var i;\n var mixinEls = this.el.mixinEls;\n var previousData;\n\n // Whether component has a defined value. For arrays, treat empty as not defined.\n componentDefined = newData && newData.constructor === Array\n ? newData.length\n : newData !== undefined && newData !== null;\n\n if (this.isObjectBased) { utils.objectPool.clearObject(nextData); }\n\n // 1. Gather default values (lowest precendence).\n if (this.isSingleProperty) {\n if (this.isObjectBased) {\n // If object-based single-prop, then copy over the data to our pooled object.\n data = copyData(nextData, schema.default);\n } else {\n // If is plain single-prop, copy by value the default.\n data = isObjectOrArray(schema.default)\n ? utils.clone(schema.default)\n : schema.default;\n }\n } else {\n // Preserve previously set properties if clobber not enabled.\n previousData = !clobber && this.attrValue;\n\n // Clone default value if object so components don't share object\n data = previousData instanceof Object\n ? copyData(nextData, previousData)\n : nextData;\n\n // Apply defaults.\n for (key in schema) {\n defaultValue = schema[key].default;\n if (data[key] !== undefined) { continue; }\n // Clone default value if object so components don't share object\n data[key] = isObjectOrArray(defaultValue)\n ? utils.clone(defaultValue)\n : defaultValue;\n }\n }\n\n // 2. Gather mixin values.\n for (i = 0; i < mixinEls.length; i++) {\n mixinData = mixinEls[i].getAttribute(this.attrName);\n if (!mixinData) { continue; }\n data = extendProperties(data, mixinData, this.isObjectBased);\n }\n\n // 3. Gather attribute values (highest precendence).\n if (componentDefined) {\n if (this.isSingleProperty) {\n // If object-based, copy the value to not modify the original.\n if (isObject(newData)) {\n copyData(this.parsingAttrValue, newData);\n return parseProperty(this.parsingAttrValue, schema);\n }\n return parseProperty(newData, schema);\n }\n data = extendProperties(data, newData, this.isObjectBased);\n } else {\n // Parse and coerce using the schema.\n if (this.isSingleProperty) { return parseProperty(data, schema); }\n }\n\n return parseProperties(data, schema, undefined, this.name, silent);\n },\n\n /**\n * Attach events from component-defined events map.\n */\n eventsAttach: function () {\n var eventName;\n // Safety detach to prevent double-registration.\n this.eventsDetach();\n for (eventName in this.events) {\n this.el.addEventListener(eventName, this.events[eventName]);\n }\n },\n\n /**\n * Detach events from component-defined events map.\n */\n eventsDetach: function () {\n var eventName;\n for (eventName in this.events) {\n this.el.removeEventListener(eventName, this.events[eventName]);\n }\n },\n\n /**\n * Release and free memory.\n */\n destroy: function () {\n this.objectPool.recycle(this.attrValue);\n this.objectPool.recycle(this.oldData);\n this.objectPool.recycle(this.parsingAttrValue);\n this.attrValue = this.oldData = this.parsingAttrValue = undefined;\n }\n};\n\nfunction eventsBind (component, events) {\n var eventName;\n for (eventName in events) {\n component.events[eventName] = events[eventName].bind(component);\n }\n}\n\n// For testing.\nif (window.debug) {\n var registrationOrderWarnings = module.exports.registrationOrderWarnings = {};\n}\n\n/**\n * Register a component to A-Frame.\n *\n * @param {string} name - Component name.\n * @param {object} definition - Component schema and lifecycle method handlers.\n * @returns {object} Component.\n */\nmodule.exports.registerComponent = function (name, definition) {\n var NewComponent;\n var propertyName;\n var proto = {};\n var schema;\n var schemaIsSingleProp;\n\n // Warning if component is statically registered after the scene.\n if (document.currentScript && document.currentScript !== aframeScript) {\n scenes.forEach(function checkPosition (sceneEl) {\n // Okay to register component after the scene at runtime.\n if (sceneEl.hasLoaded) { return; }\n\n // Check that component is declared before the scene.\n if (document.currentScript.compareDocumentPosition(sceneEl) ===\n Node.DOCUMENT_POSITION_FOLLOWING) { return; }\n\n warn('The component `' + name + '` was registered in a <script> tag after the scene. ' +\n 'Component <script> tags in an HTML file should be declared *before* the scene ' +\n 'such that the component is available to entities during scene initialization.');\n\n // For testing.\n if (window.debug) { registrationOrderWarnings[name] = true; }\n });\n }\n\n if (upperCaseRegExp.test(name) === true) {\n warn('The component name `' + name + '` contains uppercase characters, but ' +\n 'HTML will ignore the capitalization of attribute names. ' +\n 'Change the name to be lowercase: `' + name.toLowerCase() + '`');\n }\n\n if (name.indexOf('__') !== -1) {\n throw new Error('The component name `' + name + '` is not allowed. ' +\n 'The sequence __ (double underscore) is reserved to specify an id' +\n ' for multiple components of the same type');\n }\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (components[name]) {\n throw new Error('The component `' + name + '` has been already registered. ' +\n 'Check that you are not loading two versions of the same component ' +\n 'or two different components of the same name.');\n }\n\n NewComponent = function (el, attr, id) {\n Component.call(this, el, attr, id);\n };\n\n NewComponent.prototype = Object.create(Component.prototype, proto);\n NewComponent.prototype.name = name;\n NewComponent.prototype.isPositionRotationScale =\n name === 'position' || name === 'rotation' || name === 'scale';\n NewComponent.prototype.constructor = NewComponent;\n NewComponent.prototype.system = systems && systems.systems[name];\n NewComponent.prototype.play = wrapPlay(NewComponent.prototype.play);\n NewComponent.prototype.pause = wrapPause(NewComponent.prototype.pause);\n\n schema = utils.extend(processSchema(NewComponent.prototype.schema,\n NewComponent.prototype.name));\n schemaIsSingleProp = isSingleProp(NewComponent.prototype.schema);\n\n // Keep track of keys that may potentially change the schema.\n if (!schemaIsSingleProp) {\n NewComponent.prototype.schemaChangeKeys = [];\n for (propertyName in schema) {\n if (schema[propertyName].schemaChange) {\n NewComponent.prototype.schemaChangeKeys.push(propertyName);\n }\n }\n }\n\n // Create object pool for class of components.\n objectPools[name] = utils.objectPool.createPool();\n\n components[name] = {\n Component: NewComponent,\n dependencies: NewComponent.prototype.dependencies,\n isSingleProp: schemaIsSingleProp,\n multiple: NewComponent.prototype.multiple,\n name: name,\n parse: NewComponent.prototype.parse,\n parseAttrValueForCache: NewComponent.prototype.parseAttrValueForCache,\n schema: schema,\n stringify: NewComponent.prototype.stringify,\n type: NewComponent.prototype.type\n };\n return NewComponent;\n};\n\n/**\n* Clone component data.\n* Clone only the properties that are plain objects while keeping a reference for the rest.\n*\n* @param data - Component data to clone.\n* @returns Cloned data.\n*/\nfunction copyData (dest, sourceData) {\n var parsedProperty;\n var key;\n for (key in sourceData) {\n if (sourceData[key] === undefined) { continue; }\n parsedProperty = sourceData[key];\n dest[key] = isObjectOrArray(parsedProperty)\n ? utils.clone(parsedProperty)\n : parsedProperty;\n }\n return dest;\n}\n\n/**\n* Object extending with checking for single-property schema.\n*\n* @param dest - Destination object or value.\n* @param source - Source object or value\n* @param {boolean} isObjectBased - Whether values are objects.\n* @returns Overridden object or value.\n*/\nfunction extendProperties (dest, source, isObjectBased) {\n var key;\n if (isObjectBased && source.constructor === Object) {\n for (key in source) {\n if (source[key] === undefined) { continue; }\n if (source[key] && source[key].constructor === Object) {\n dest[key] = utils.clone(source[key]);\n } else {\n dest[key] = source[key];\n }\n }\n return dest;\n }\n return source;\n}\n\n/**\n * Checks if a component has defined a method that needs to run every frame.\n */\nfunction hasBehavior (component) {\n return component.tick || component.tock;\n}\n\n/**\n * Wrapper for defined pause method.\n * Pause component by removing tick behavior and calling user's pause method.\n *\n * @param pauseMethod {function}\n */\nfunction wrapPause (pauseMethod) {\n return function pause () {\n var sceneEl = this.el.sceneEl;\n if (!this.isPlaying) { return; }\n pauseMethod.call(this);\n this.isPlaying = false;\n this.eventsDetach();\n // Remove tick behavior.\n if (!hasBehavior(this)) { return; }\n sceneEl.removeBehavior(this);\n };\n}\n\n/**\n * Wrapper for defined play method.\n * Play component by adding tick behavior and calling user's play method.\n *\n * @param playMethod {function}\n */\nfunction wrapPlay (playMethod) {\n return function play () {\n var sceneEl = this.el.sceneEl;\n var shouldPlay = this.el.isPlaying && !this.isPlaying;\n if (!this.initialized || !shouldPlay) { return; }\n playMethod.call(this);\n this.isPlaying = true;\n this.eventsAttach();\n // Add tick behavior.\n if (!hasBehavior(this)) { return; }\n sceneEl.addBehavior(this);\n };\n}\n\nfunction isObject (value) {\n return value && value.constructor === Object && !(value instanceof window.HTMLElement);\n}\n\nfunction isObjectOrArray (value) {\n return value && (value.constructor === Object || value.constructor === Array) &&\n !(value instanceof window.HTMLElement);\n}\n",
  372. "var schema = require('./schema');\n\nvar processSchema = schema.process;\nvar geometries = module.exports.geometries = {}; // Registered geometries.\nvar geometryNames = module.exports.geometryNames = []; // Names of registered geometries.\nvar THREE = require('../lib/three');\n\n/**\n * Geometry class definition.\n *\n * Geometries extend the geometry component API to create and register geometry types.\n */\nvar Geometry = module.exports.Geometry = function () {};\n\nGeometry.prototype = {\n /**\n * Contains the type schema and defaults for the data values.\n * Data is coerced into the types of the values of the defaults.\n */\n schema: {},\n\n /**\n * Init handler. Similar to attachedCallback.\n * Called during shader initialization and is only run once.\n */\n init: function (data) {\n this.geometry = new THREE.BufferGeometry();\n return this.geometry;\n },\n\n /**\n * Update handler. Similar to attributeChangedCallback.\n * Called whenever the associated geometry data changes.\n *\n * @param {object} data - New geometry data.\n */\n update: function (data) { /* no-op */ }\n};\n\n/**\n * Registers a geometry to A-Frame.\n *\n * @param {string} name - Geometry name.\n * @param {object} definition - Geometry property and methods.\n * @returns {object} Geometry.\n */\nmodule.exports.registerGeometry = function (name, definition) {\n var NewGeometry;\n var proto = {};\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function expandDefinition (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (geometries[name]) {\n throw new Error('The geometry `' + name + '` has been already registered');\n }\n NewGeometry = function () { Geometry.call(this); };\n NewGeometry.prototype = Object.create(Geometry.prototype, proto);\n NewGeometry.prototype.name = name;\n NewGeometry.prototype.constructor = NewGeometry;\n geometries[name] = {\n Geometry: NewGeometry,\n schema: processSchema(NewGeometry.prototype.schema)\n };\n geometryNames.push(name);\n return NewGeometry;\n};\n",
  373. "var coordinates = require('../utils/coordinates');\nvar debug = require('debug');\n\nvar error = debug('core:propertyTypes:warn');\nvar warn = debug('core:propertyTypes:warn');\n\nvar propertyTypes = module.exports.propertyTypes = {};\nvar nonCharRegex = /[,> .[\\]:]/;\nvar urlRegex = /\\url\\((.+)\\)/;\n\n// Built-in property types.\nregisterPropertyType('audio', '', assetParse);\nregisterPropertyType('array', [], arrayParse, arrayStringify);\nregisterPropertyType('asset', '', assetParse);\nregisterPropertyType('boolean', false, boolParse);\nregisterPropertyType('color', '#FFF', defaultParse, defaultStringify);\nregisterPropertyType('int', 0, intParse);\nregisterPropertyType('number', 0, numberParse);\nregisterPropertyType('map', '', assetParse);\nregisterPropertyType('model', '', assetParse);\nregisterPropertyType('selector', null, selectorParse, selectorStringify);\nregisterPropertyType('selectorAll', null, selectorAllParse, selectorAllStringify);\nregisterPropertyType('src', '', srcParse);\nregisterPropertyType('string', '', defaultParse, defaultStringify);\nregisterPropertyType('time', 0, intParse);\nregisterPropertyType('vec2', {x: 0, y: 0}, vecParse, coordinates.stringify);\nregisterPropertyType('vec3', {x: 0, y: 0, z: 0}, vecParse, coordinates.stringify);\nregisterPropertyType('vec4', {x: 0, y: 0, z: 0, w: 1}, vecParse, coordinates.stringify);\n\n/**\n * Register a parser for re-use such that when someone uses `type` in the schema,\n * `schema.process` will set the property `parse` and `stringify`.\n *\n * @param {string} type - Type name.\n * @param [defaultValue=null] -\n * Default value to use if component does not define default value.\n * @param {function} [parse=defaultParse] - Parse string function.\n * @param {function} [stringify=defaultStringify] - Stringify to DOM function.\n */\nfunction registerPropertyType (type, defaultValue, parse, stringify) {\n if ('type' in propertyTypes) {\n error('Property type ' + type + ' is already registered.');\n return;\n }\n\n propertyTypes[type] = {\n default: defaultValue,\n parse: parse || defaultParse,\n stringify: stringify || defaultStringify\n };\n}\nmodule.exports.registerPropertyType = registerPropertyType;\n\nfunction arrayParse (value) {\n if (Array.isArray(value)) { return value; }\n if (!value || typeof value !== 'string') { return []; }\n return value.split(',').map(trim);\n function trim (str) { return str.trim(); }\n}\n\nfunction arrayStringify (value) {\n return value.join(', ');\n}\n\n/**\n * For general assets.\n *\n * @param {string} value - Can either be `url(<value>)`, an ID selector to an asset, or\n * just string.\n * @returns {string} Parsed value from `url(<value>)`, src from `<someasset src>`, or\n * just string.\n */\nfunction assetParse (value) {\n var el;\n var parsedUrl;\n\n // If an element was provided (e.g. canvas or video), just return it.\n if (typeof value !== 'string') { return value; }\n\n // Wrapped `url()` in case of data URI.\n parsedUrl = value.match(urlRegex);\n if (parsedUrl) { return parsedUrl[1]; }\n\n // ID.\n if (value.charAt(0) === '#') {\n el = document.getElementById(value.substring(1));\n if (el) {\n // Pass through media elements. If we have the elements, we don't have to call\n // three.js loaders which would re-request the assets.\n if (el.tagName === 'CANVAS' || el.tagName === 'VIDEO' || el.tagName === 'IMG') {\n return el;\n }\n return el.getAttribute('src');\n }\n warn('\"' + value + '\" asset not found.');\n return;\n }\n\n // Non-wrapped url().\n return value;\n}\n\nfunction defaultParse (value) {\n return value;\n}\n\nfunction defaultStringify (value) {\n if (value === null) { return 'null'; }\n return value.toString();\n}\n\nfunction boolParse (value) {\n return value !== 'false' && value !== false;\n}\n\nfunction intParse (value) {\n return parseInt(value, 10);\n}\n\nfunction numberParse (value) {\n return parseFloat(value, 10);\n}\n\nfunction selectorParse (value) {\n if (!value) { return null; }\n if (typeof value !== 'string') { return value; }\n if (value[0] === '#' && !nonCharRegex.test(value)) {\n // When selecting element by ID only, use getElementById for better performance.\n // Don't match like #myId .child.\n return document.getElementById(value.substring(1));\n }\n return document.querySelector(value);\n}\n\nfunction selectorAllParse (value) {\n if (!value) { return null; }\n if (typeof value !== 'string') { return value; }\n return Array.prototype.slice.call(document.querySelectorAll(value), 0);\n}\n\nfunction selectorStringify (value) {\n if (value.getAttribute) {\n return '#' + value.getAttribute('id');\n }\n return defaultStringify(value);\n}\n\nfunction selectorAllStringify (value) {\n if (value instanceof Array) {\n return value.map(function (element) {\n return '#' + element.getAttribute('id');\n }).join(', ');\n }\n return defaultStringify(value);\n}\n\nfunction srcParse (value) {\n warn('`src` property type is deprecated. Use `asset` instead.');\n return assetParse(value);\n}\n\nfunction vecParse (value) {\n return coordinates.parse(value, this.default);\n}\n\n/**\n * Validate the default values in a schema to match their type.\n *\n * @param {string} type - Property type name.\n * @param defaultVal - Property type default value.\n * @returns {boolean} Whether default value is accurate given the type.\n */\nfunction isValidDefaultValue (type, defaultVal) {\n if (type === 'audio' && typeof defaultVal !== 'string') { return false; }\n if (type === 'array' && !Array.isArray(defaultVal)) { return false; }\n if (type === 'asset' && typeof defaultVal !== 'string') { return false; }\n if (type === 'boolean' && typeof defaultVal !== 'boolean') { return false; }\n if (type === 'color' && typeof defaultVal !== 'string') { return false; }\n if (type === 'int' && typeof defaultVal !== 'number') { return false; }\n if (type === 'number' && typeof defaultVal !== 'number') { return false; }\n if (type === 'map' && typeof defaultVal !== 'string') { return false; }\n if (type === 'model' && typeof defaultVal !== 'string') { return false; }\n if (type === 'selector' && typeof defaultVal !== 'string' &&\n defaultVal !== null) { return false; }\n if (type === 'selectorAll' && typeof defaultVal !== 'string' &&\n defaultVal !== null) { return false; }\n if (type === 'src' && typeof defaultVal !== 'string') { return false; }\n if (type === 'string' && typeof defaultVal !== 'string') { return false; }\n if (type === 'time' && typeof defaultVal !== 'number') { return false; }\n if (type === 'vec2') { return isValidDefaultCoordinate(defaultVal, 2); }\n if (type === 'vec3') { return isValidDefaultCoordinate(defaultVal, 3); }\n if (type === 'vec4') { return isValidDefaultCoordinate(defaultVal, 4); }\n return true;\n}\nmodule.exports.isValidDefaultValue = isValidDefaultValue;\n\n/**\n * Checks if default coordinates are valid.\n *\n * @param possibleCoordinates\n * @param {number} dimensions - 2 for 2D Vector, 3 for 3D vector.\n * @returns {boolean} Whether coordinates are parsed correctly.\n */\nfunction isValidDefaultCoordinate (possibleCoordinates, dimensions) {\n if (possibleCoordinates === null) { return true; }\n if (typeof possibleCoordinates !== 'object') { return false; }\n\n if (Object.keys(possibleCoordinates).length !== dimensions) {\n return false;\n } else {\n var x = possibleCoordinates.x;\n var y = possibleCoordinates.y;\n var z = possibleCoordinates.z;\n var w = possibleCoordinates.w;\n\n if (typeof x !== 'number' || typeof y !== 'number') { return false; }\n if (dimensions > 2 && typeof z !== 'number') { return false; }\n if (dimensions > 3 && typeof w !== 'number') { return false; }\n }\n\n return true;\n}\nmodule.exports.isValidDefaultCoordinate = isValidDefaultCoordinate;\n",
  374. "/* global Promise, screen, CustomEvent */\nvar initMetaTags = require('./metaTags').inject;\nvar initWakelock = require('./wakelock');\nvar loadingScreen = require('./loadingScreen');\nvar re = require('../a-register-element');\nvar scenes = require('./scenes');\nvar systems = require('../system').systems;\nvar THREE = require('../../lib/three');\nvar utils = require('../../utils/');\n// Require after.\nvar AEntity = require('../a-entity');\nvar ANode = require('../a-node');\nvar initPostMessageAPI = require('./postMessage');\n\nvar bind = utils.bind;\nvar isIOS = utils.device.isIOS();\nvar isMobile = utils.device.isMobile();\nvar isWebXRAvailable = utils.device.isWebXRAvailable;\nvar registerElement = re.registerElement;\nvar warn = utils.debug('core:a-scene:warn');\n\nif (isIOS) { require('../../utils/ios-orientationchange-blank-bug'); }\n\n/**\n * Scene element, holds all entities.\n *\n * @member {array} behaviors - Component instances that have registered themselves to be\n updated on every tick.\n * @member {object} camera - three.js Camera object.\n * @member {object} canvas\n * @member {bool} isScene - Differentiates as scene entity as opposed to other entites.\n * @member {bool} isMobile - Whether browser is mobile (via UA detection).\n * @member {object} object3D - Root three.js Scene object.\n * @member {object} renderer\n * @member {bool} renderStarted\n * @member {object} systems - Registered instantiated systems.\n * @member {number} time\n */\nmodule.exports.AScene = registerElement('a-scene', {\n prototype: Object.create(AEntity.prototype, {\n createdCallback: {\n value: function () {\n this.clock = new THREE.Clock();\n this.isIOS = isIOS;\n this.isMobile = isMobile;\n this.hasWebXR = isWebXRAvailable;\n this.isAR = false;\n this.isScene = true;\n this.object3D = new THREE.Scene();\n var self = this;\n this.object3D.onAfterRender = function (renderer, scene, camera) {\n // THREE may swap the camera used for the rendering if in VR, so we pass it to tock\n if (self.isPlaying) { self.tock(self.time, self.delta, camera); }\n };\n this.resize = bind(this.resize, this);\n this.render = bind(this.render, this);\n this.systems = {};\n this.systemNames = [];\n this.time = this.delta = 0;\n\n this.behaviors = {tick: [], tock: []};\n this.hasLoaded = false;\n this.isPlaying = false;\n this.originalHTML = this.innerHTML;\n\n // Default components.\n this.setAttribute('inspector', '');\n this.setAttribute('keyboard-shortcuts', '');\n this.setAttribute('screenshot', '');\n this.setAttribute('vr-mode-ui', '');\n this.setAttribute('device-orientation-permission-ui', '');\n }\n },\n\n addFullScreenStyles: {\n value: function () {\n document.documentElement.classList.add('a-fullscreen');\n }\n },\n\n removeFullScreenStyles: {\n value: function () {\n document.documentElement.classList.remove('a-fullscreen');\n }\n },\n\n attachedCallback: {\n value: function () {\n var self = this;\n var embedded = this.hasAttribute('embedded');\n // Renderer initialization\n setupCanvas(this);\n this.setupRenderer();\n loadingScreen.setup(this, getCanvasSize);\n\n this.resize();\n if (!embedded) { this.addFullScreenStyles(); }\n initPostMessageAPI(this);\n\n initMetaTags(this);\n initWakelock(this);\n\n // Handler to exit VR (e.g., Oculus Browser back button).\n this.onVRPresentChangeBound = bind(this.onVRPresentChange, this);\n window.addEventListener('vrdisplaypresentchange', this.onVRPresentChangeBound);\n\n // Bind functions.\n this.enterVRBound = function () { self.enterVR(); };\n this.exitVRBound = function () { self.exitVR(); };\n this.exitVRTrueBound = function () { self.exitVR(true); };\n this.pointerRestrictedBound = function () { self.pointerRestricted(); };\n this.pointerUnrestrictedBound = function () { self.pointerUnrestricted(); };\n\n if (!isWebXRAvailable) {\n // Exit VR on `vrdisplaydeactivate` (e.g. taking off Rift headset).\n window.addEventListener('vrdisplaydeactivate', this.exitVRBound);\n\n // Exit VR on `vrdisplaydisconnect` (e.g. unplugging Rift headset).\n window.addEventListener('vrdisplaydisconnect', this.exitVRTrueBound);\n\n // Register for mouse restricted events while in VR\n // (e.g. mouse no longer available on desktop 2D view)\n window.addEventListener('vrdisplaypointerrestricted', this.pointerRestrictedBound);\n\n // Register for mouse unrestricted events while in VR\n // (e.g. mouse once again available on desktop 2D view)\n window.addEventListener('vrdisplaypointerunrestricted',\n this.pointerUnrestrictedBound);\n }\n\n window.addEventListener('sessionend', this.resize);\n // Camera set up by camera system.\n this.addEventListener('cameraready', function () {\n self.attachedCallbackPostCamera();\n });\n\n this.initSystems();\n\n // WebXR Immersive navigation handler.\n if (this.hasWebXR && navigator.xr && navigator.xr.addEventListener) {\n navigator.xr.addEventListener('sessiongranted', function () { self.enterVR(); });\n }\n }\n },\n\n attachedCallbackPostCamera: {\n value: function () {\n var resize;\n var self = this;\n\n window.addEventListener('load', resize);\n window.addEventListener('resize', function () {\n // Workaround for a Webkit bug (https://bugs.webkit.org/show_bug.cgi?id=170595)\n // where the window does not contain the correct viewport size\n // after an orientation change. The window size is correct if the operation\n // is postponed a few milliseconds.\n // self.resize can be called directly once the bug above is fixed.\n if (self.isIOS) {\n setTimeout(self.resize, 100);\n } else {\n self.resize();\n }\n });\n this.play();\n\n // Add to scene index.\n scenes.push(this);\n },\n writable: window.debug\n },\n\n /**\n * Initialize all systems.\n */\n initSystems: {\n value: function () {\n var name;\n\n // Initialize camera system first.\n this.initSystem('camera');\n\n for (name in systems) {\n if (name === 'camera') { continue; }\n this.initSystem(name);\n }\n }\n },\n\n /**\n * Initialize a system.\n */\n initSystem: {\n value: function (name) {\n if (this.systems[name]) { return; }\n this.systems[name] = new systems[name](this);\n this.systemNames.push(name);\n }\n },\n\n /**\n * Shut down scene on detach.\n */\n detachedCallback: {\n value: function () {\n // Remove from scene index.\n var sceneIndex = scenes.indexOf(this);\n scenes.splice(sceneIndex, 1);\n\n window.removeEventListener('vrdisplaypresentchange', this.onVRPresentChangeBound);\n window.removeEventListener('vrdisplayactivate', this.enterVRBound);\n window.removeEventListener('vrdisplaydeactivate', this.exitVRBound);\n window.removeEventListener('vrdisplayconnect', this.enterVRBound);\n window.removeEventListener('vrdisplaydisconnect', this.exitVRTrueBound);\n window.removeEventListener('vrdisplaypointerrestricted', this.pointerRestrictedBound);\n window.removeEventListener('vrdisplaypointerunrestricted', this.pointerUnrestrictedBound);\n window.removeEventListener('sessionend', this.resize);\n this.renderer.xr.dispose();\n }\n },\n\n /**\n * Add ticks and tocks.\n *\n * @param {object} behavior - A component.\n */\n addBehavior: {\n value: function (behavior) {\n var behaviorArr;\n var behaviors = this.behaviors;\n var behaviorType;\n\n // Check if behavior has tick and/or tock and add the behavior to the appropriate list.\n for (behaviorType in behaviors) {\n if (!behavior[behaviorType]) { continue; }\n behaviorArr = this.behaviors[behaviorType];\n if (behaviorArr.indexOf(behavior) === -1) {\n behaviorArr.push(behavior);\n }\n }\n }\n },\n\n /**\n * For tests.\n */\n getPointerLockElement: {\n value: function () {\n return document.pointerLockElement;\n },\n writable: window.debug\n },\n\n /**\n * For tests.\n */\n checkHeadsetConnected: {\n value: utils.device.checkHeadsetConnected,\n writable: window.debug\n },\n\n enterAR: {\n value: function () {\n var errorMessage;\n if (!this.hasWebXR) {\n errorMessage = 'Failed to enter AR mode, WebXR not supported.';\n throw new Error(errorMessage);\n }\n if (!utils.device.checkARSupport()) {\n errorMessage = 'Failed to enter AR, WebXR immersive-ar mode not supported in your browser or device.';\n throw new Error(errorMessage);\n }\n return this.enterVR(true);\n }\n },\n\n /**\n * Call `requestPresent` if WebVR or WebVR polyfill.\n * Call `requestFullscreen` on desktop.\n * Handle events, states, fullscreen styles.\n *\n * @param {bool?} useAR - if true, try immersive-ar mode\n * @returns {Promise}\n */\n enterVR: {\n value: function (useAR) {\n var self = this;\n var vrDisplay;\n var vrManager = self.renderer.xr;\n var xrInit;\n\n // Don't enter VR if already in VR.\n if (this.is('vr-mode')) { return Promise.resolve('Already in VR.'); }\n\n // Has VR.\n if (this.checkHeadsetConnected() || this.isMobile) {\n vrManager.enabled = true;\n\n if (this.hasWebXR) {\n // XR API.\n if (this.xrSession) {\n this.xrSession.removeEventListener('end', this.exitVRBound);\n }\n var refspace = this.sceneEl.systems.webxr.sessionReferenceSpaceType;\n vrManager.setReferenceSpaceType(refspace);\n var xrMode = useAR ? 'immersive-ar' : 'immersive-vr';\n xrInit = this.sceneEl.systems.webxr.sessionConfiguration;\n return new Promise(function (resolve, reject) {\n navigator.xr.requestSession(xrMode, xrInit).then(\n function requestSuccess (xrSession) {\n self.xrSession = xrSession;\n vrManager.layersEnabled = xrInit.requiredFeatures.indexOf('layers') !== -1;\n vrManager.setSession(xrSession);\n xrSession.addEventListener('end', self.exitVRBound);\n enterVRSuccess(resolve);\n },\n function requestFail (error) {\n var useAR = xrMode === 'immersive-ar';\n var mode = useAR ? 'AR' : 'VR';\n throw new Error('Failed to enter ' + mode + ' mode (`requestSession`) ' + error);\n }\n );\n });\n } else {\n vrDisplay = utils.device.getVRDisplay();\n vrManager.setDevice(vrDisplay);\n if (vrDisplay.isPresenting &&\n !window.hasNativeWebVRImplementation) {\n enterVRSuccess();\n return Promise.resolve();\n }\n var rendererSystem = this.getAttribute('renderer');\n var presentationAttributes = {\n highRefreshRate: rendererSystem.highRefreshRate,\n foveationLevel: rendererSystem.foveationLevel\n };\n\n return vrDisplay.requestPresent([{\n source: this.canvas,\n attributes: presentationAttributes\n }]).then(enterVRSuccess, enterVRFailure);\n }\n }\n\n // No VR.\n enterVRSuccess();\n return Promise.resolve();\n\n // Callback that happens on enter VR success or enter fullscreen (any API).\n function enterVRSuccess (resolve) {\n // vrdisplaypresentchange fires only once when the first requestPresent is completed;\n // the first requestPresent could be called from ondisplayactivate and there is no way\n // to setup everything from there. Thus, we need to emulate another vrdisplaypresentchange\n // for the actual requestPresent. Need to make sure there are no issues with firing the\n // vrdisplaypresentchange multiple times.\n var event;\n if (window.hasNativeWebVRImplementation && !window.hasNativeWebXRImplementation) {\n event = new CustomEvent('vrdisplaypresentchange', {detail: {display: utils.device.getVRDisplay()}});\n window.dispatchEvent(event);\n }\n\n if (useAR) {\n self.addState('ar-mode');\n } else {\n self.addState('vr-mode');\n }\n self.emit('enter-vr', {target: self});\n // Lock to landscape orientation on mobile.\n if (!isWebXRAvailable && self.isMobile && screen.orientation && screen.orientation.lock) {\n screen.orientation.lock('landscape');\n }\n self.addFullScreenStyles();\n\n // On mobile, the polyfill handles fullscreen.\n // TODO: 07/16 Chromium builds break when `requestFullscreen`ing on a canvas\n // that we are also `requestPresent`ing. Until then, don't fullscreen if headset\n // connected.\n if (!self.isMobile && !self.checkHeadsetConnected()) {\n requestFullscreen(self.canvas);\n }\n\n self.resize();\n if (resolve) { resolve(); }\n }\n\n function enterVRFailure (err) {\n self.removeState('vr-mode');\n if (err && err.message) {\n throw new Error('Failed to enter VR mode (`requestPresent`): ' + err.message);\n } else {\n throw new Error('Failed to enter VR mode (`requestPresent`).');\n }\n }\n },\n writable: true\n },\n /**\n * Call `exitPresent` if WebVR / WebXR or WebVR polyfill.\n * Handle events, states, fullscreen styles.\n *\n * @returns {Promise}\n */\n exitVR: {\n value: function () {\n var self = this;\n var vrDisplay;\n var vrManager = this.renderer.xr;\n\n // Don't exit VR if not in VR.\n if (!this.is('vr-mode') && !this.is('ar-mode')) { return Promise.resolve('Not in immersive mode.'); }\n\n // Handle exiting VR if not yet already and in a headset or polyfill.\n if (this.checkHeadsetConnected() || this.isMobile) {\n vrManager.enabled = false;\n vrDisplay = utils.device.getVRDisplay();\n if (this.hasWebXR) {\n this.xrSession.removeEventListener('end', this.exitVRBound);\n // Capture promise to avoid errors.\n this.xrSession.end().then(function () {}, function () {});\n this.xrSession = undefined;\n vrManager.setSession(null);\n } else {\n if (vrDisplay.isPresenting) {\n return vrDisplay.exitPresent().then(exitVRSuccess, exitVRFailure);\n }\n }\n } else {\n exitFullscreen();\n }\n\n // Handle exiting VR in all other cases (2D fullscreen, external exit VR event).\n exitVRSuccess();\n\n return Promise.resolve();\n\n function exitVRSuccess () {\n self.removeState('vr-mode');\n self.removeState('ar-mode');\n // Lock to landscape orientation on mobile.\n if (self.isMobile && screen.orientation && screen.orientation.unlock) {\n screen.orientation.unlock();\n }\n // Exiting VR in embedded mode, no longer need fullscreen styles.\n if (self.hasAttribute('embedded')) { self.removeFullScreenStyles(); }\n\n self.resize();\n if (self.isIOS) { utils.forceCanvasResizeSafariMobile(self.canvas); }\n self.renderer.setPixelRatio(window.devicePixelRatio);\n self.emit('exit-vr', {target: self});\n }\n\n function exitVRFailure (err) {\n if (err && err.message) {\n throw new Error('Failed to exit VR mode (`exitPresent`): ' + err.message);\n } else {\n throw new Error('Failed to exit VR mode (`exitPresent`).');\n }\n }\n },\n writable: true\n },\n\n pointerRestricted: {\n value: function () {\n if (this.canvas) {\n var pointerLockElement = this.getPointerLockElement();\n if (pointerLockElement && pointerLockElement !== this.canvas && document.exitPointerLock) {\n // Recreate pointer lock on the canvas, if taken on another element.\n document.exitPointerLock();\n }\n\n if (this.canvas.requestPointerLock) {\n this.canvas.requestPointerLock();\n }\n }\n }\n },\n\n pointerUnrestricted: {\n value: function () {\n var pointerLockElement = this.getPointerLockElement();\n if (pointerLockElement && pointerLockElement === this.canvas && document.exitPointerLock) {\n document.exitPointerLock();\n }\n }\n },\n\n /**\n * Handle `vrdisplaypresentchange` event for exiting VR through other means than\n * `<ESC>` key. For example, GearVR back button on Oculus Browser.\n */\n onVRPresentChange: {\n value: function (evt) {\n // Polyfill places display inside the detail property\n var display = evt.display || evt.detail.display;\n // Entering VR.\n if (display && display.isPresenting) {\n this.enterVR();\n return;\n }\n // Exiting VR.\n this.exitVR();\n }\n },\n\n /**\n * Wraps Entity.getAttribute to take into account for systems.\n * If system exists, then return system data rather than possible component data.\n */\n getAttribute: {\n value: function (attr) {\n var system = this.systems[attr];\n if (system) { return system.data; }\n return AEntity.prototype.getAttribute.call(this, attr);\n }\n },\n\n /**\n * `getAttribute` used to be `getDOMAttribute` and `getComputedAttribute` used to be\n * what `getAttribute` is now. Now legacy code.\n */\n getComputedAttribute: {\n value: function (attr) {\n warn('`getComputedAttribute` is deprecated. Use `getAttribute` instead.');\n this.getAttribute(attr);\n }\n },\n\n /**\n * Wraps Entity.getDOMAttribute to take into account for systems.\n * If system exists, then return system data rather than possible component data.\n */\n getDOMAttribute: {\n value: function (attr) {\n var system = this.systems[attr];\n if (system) { return system.data; }\n return AEntity.prototype.getDOMAttribute.call(this, attr);\n }\n },\n\n /**\n * Wrap Entity.setAttribute to take into account for systems.\n * If system exists, then skip component initialization checks and do a normal\n * setAttribute.\n */\n setAttribute: {\n value: function (attr, value, componentPropValue) {\n var system = this.systems[attr];\n if (system) {\n ANode.prototype.setAttribute.call(this, attr, value);\n system.updateProperties(value);\n return;\n }\n AEntity.prototype.setAttribute.call(this, attr, value, componentPropValue);\n }\n },\n\n /**\n * @param {object} behavior - A component.\n */\n removeBehavior: {\n value: function (behavior) {\n var behaviorArr;\n var behaviorType;\n var behaviors = this.behaviors;\n var index;\n\n // Check if behavior has tick and/or tock and remove the behavior from the appropriate\n // array.\n for (behaviorType in behaviors) {\n if (!behavior[behaviorType]) { continue; }\n behaviorArr = this.behaviors[behaviorType];\n index = behaviorArr.indexOf(behavior);\n if (index !== -1) { behaviorArr.splice(index, 1); }\n }\n }\n },\n\n resize: {\n value: function () {\n var camera = this.camera;\n var canvas = this.canvas;\n var embedded;\n var isVRPresenting;\n var size;\n var isPresenting = this.renderer.xr.isPresenting;\n isVRPresenting = this.renderer.xr.enabled && isPresenting;\n\n // Do not update renderer, if a camera or a canvas have not been injected.\n // In VR mode, three handles canvas resize based on the dimensions returned by\n // the getEyeParameters function of the WebVR API. These dimensions are independent of\n // the window size, therefore should not be overwritten with the window's width and\n // height, // except when in fullscreen mode.\n if (!camera || !canvas || (this.is('vr-mode') && (this.isMobile || isVRPresenting))) {\n return;\n }\n\n // Update camera.\n embedded = this.getAttribute('embedded') && !this.is('vr-mode');\n size = getCanvasSize(canvas, embedded, this.maxCanvasSize, this.is('vr-mode'));\n camera.aspect = size.width / size.height;\n camera.updateProjectionMatrix();\n\n // Notify renderer of size change.\n this.renderer.setSize(size.width, size.height, false);\n this.emit('rendererresize', null, false);\n },\n writable: true\n },\n\n setupRenderer: {\n value: function () {\n var self = this;\n var renderer;\n var rendererAttr;\n var rendererAttrString;\n var rendererConfig;\n\n rendererConfig = {\n alpha: true,\n antialias: !isMobile,\n canvas: this.canvas,\n logarithmicDepthBuffer: false,\n powerPreference: 'high-performance'\n };\n\n this.maxCanvasSize = {height: 1920, width: 1920};\n\n if (this.hasAttribute('renderer')) {\n rendererAttrString = this.getAttribute('renderer');\n rendererAttr = utils.styleParser.parse(rendererAttrString);\n\n if (rendererAttr.precision) {\n rendererConfig.precision = rendererAttr.precision + 'p';\n }\n\n if (rendererAttr.antialias && rendererAttr.antialias !== 'auto') {\n rendererConfig.antialias = rendererAttr.antialias === 'true';\n }\n\n if (rendererAttr.logarithmicDepthBuffer && rendererAttr.logarithmicDepthBuffer !== 'auto') {\n rendererConfig.logarithmicDepthBuffer = rendererAttr.logarithmicDepthBuffer === 'true';\n }\n\n if (rendererAttr.alpha) {\n rendererConfig.alpha = rendererAttr.alpha === 'true';\n }\n\n this.maxCanvasSize = {\n width: rendererAttr.maxCanvasWidth\n ? parseInt(rendererAttr.maxCanvasWidth)\n : this.maxCanvasSize.width,\n height: rendererAttr.maxCanvasHeight\n ? parseInt(rendererAttr.maxCanvasHeight)\n : this.maxCanvasSize.height\n };\n }\n\n renderer = this.renderer = new THREE.WebGLRenderer(rendererConfig);\n renderer.setPixelRatio(window.devicePixelRatio);\n renderer.sortObjects = false;\n if (this.camera) { renderer.xr.setPoseTarget(this.camera.el.object3D); }\n this.addEventListener('camera-set-active', function () {\n renderer.xr.setPoseTarget(self.camera.el.object3D);\n });\n },\n writable: window.debug\n },\n\n /**\n * Handler attached to elements to help scene know when to kick off.\n * Scene waits for all entities to load.\n */\n play: {\n value: function () {\n var self = this;\n var sceneEl = this;\n\n if (this.renderStarted) {\n AEntity.prototype.play.call(this);\n return;\n }\n\n this.addEventListener('loaded', function () {\n var renderer = this.renderer;\n var vrDisplay;\n var vrManager = this.renderer.xr;\n AEntity.prototype.play.call(this); // .play() *before* render.\n\n if (sceneEl.renderStarted) { return; }\n sceneEl.resize();\n\n // Kick off render loop.\n if (sceneEl.renderer) {\n if (window.performance) { window.performance.mark('render-started'); }\n loadingScreen.remove();\n vrDisplay = utils.device.getVRDisplay();\n if (vrDisplay && vrDisplay.isPresenting) {\n vrManager.setDevice(vrDisplay);\n vrManager.enabled = true;\n sceneEl.enterVR();\n }\n renderer.setAnimationLoop(this.render);\n sceneEl.renderStarted = true;\n sceneEl.emit('renderstart');\n }\n });\n\n // setTimeout to wait for all nodes to attach and run their callbacks.\n setTimeout(function () {\n AEntity.prototype.load.call(self);\n });\n }\n },\n\n /**\n * Wrap `updateComponent` to not initialize the component if the component has a system\n * (aframevr/aframe#2365).\n */\n updateComponent: {\n value: function (componentName) {\n if (componentName in systems) { return; }\n AEntity.prototype.updateComponent.apply(this, arguments);\n }\n },\n\n /**\n * Behavior-updater meant to be called from scene render.\n * Abstracted to a different function to facilitate unit testing (`scene.tick()`) without\n * needing to render.\n */\n tick: {\n value: function (time, timeDelta) {\n var i;\n var systems = this.systems;\n\n // Components.\n for (i = 0; i < this.behaviors.tick.length; i++) {\n if (!this.behaviors.tick[i].el.isPlaying) { continue; }\n this.behaviors.tick[i].tick(time, timeDelta);\n }\n\n // Systems.\n for (i = 0; i < this.systemNames.length; i++) {\n if (!systems[this.systemNames[i]].tick) { continue; }\n systems[this.systemNames[i]].tick(time, timeDelta);\n }\n }\n },\n\n /**\n * Behavior-updater meant to be called after scene render for post processing purposes.\n * Abstracted to a different function to facilitate unit testing (`scene.tock()`) without\n * needing to render.\n */\n tock: {\n value: function (time, timeDelta, camera) {\n var i;\n var systems = this.systems;\n\n // Components.\n for (i = 0; i < this.behaviors.tock.length; i++) {\n if (!this.behaviors.tock[i].el.isPlaying) { continue; }\n this.behaviors.tock[i].tock(time, timeDelta, camera);\n }\n\n // Systems.\n for (i = 0; i < this.systemNames.length; i++) {\n if (!systems[this.systemNames[i]].tock) { continue; }\n systems[this.systemNames[i]].tock(time, timeDelta, camera);\n }\n }\n },\n\n /**\n * The render loop.\n *\n * Updates animations.\n * Updates behaviors.\n * Renders with request animation frame.\n */\n render: {\n value: function (time, frame) {\n var renderer = this.renderer;\n\n this.frame = frame;\n this.delta = this.clock.getDelta() * 1000;\n this.time = this.clock.elapsedTime * 1000;\n\n if (this.isPlaying) { this.tick(this.time, this.delta); }\n var savedBackground = null;\n if (this.is('ar-mode')) {\n // In AR mode, don't render the default background. Hide it, then\n // restore it again after rendering.\n savedBackground = this.object3D.background;\n this.object3D.background = null;\n }\n renderer.render(this.object3D, this.camera);\n if (savedBackground) {\n this.object3D.background = savedBackground;\n }\n },\n writable: true\n }\n })\n});\n\n/**\n * Return the canvas size where the scene will be rendered.\n * Will be always the window size except when the scene is embedded.\n * The parent size (less than max size) will be returned in that case.\n *\n * @param {object} canvasEl - the canvas element\n * @param {boolean} embedded - Is the scene embedded?\n * @param {object} max - Max size parameters\n * @param {boolean} isVR - If in VR\n */\nfunction getCanvasSize (canvasEl, embedded, maxSize, isVR) {\n if (!canvasEl.parentElement) { return {height: 0, width: 0}; }\n if (embedded) {\n return {\n height: canvasEl.parentElement.offsetHeight,\n width: canvasEl.parentElement.offsetWidth\n };\n }\n return getMaxSize(maxSize, isVR);\n}\n\n/**\n * Return the canvas size. Will be the window size unless that size is greater than the\n * maximum size (1920x1920 by default). The constrained size will be returned in that case,\n * maintaining aspect ratio\n *\n * @param {object} maxSize - Max size parameters (width and height).\n * @param {boolean} isVR - If in VR.\n * @returns {object} Width and height.\n */\nfunction getMaxSize (maxSize, isVR) {\n var aspectRatio;\n var size;\n var pixelRatio = window.devicePixelRatio;\n\n size = {height: document.body.offsetHeight, width: document.body.offsetWidth};\n if (!maxSize || isVR || (maxSize.width === -1 && maxSize.height === -1)) {\n return size;\n }\n\n if (size.width * pixelRatio < maxSize.width &&\n size.height * pixelRatio < maxSize.height) {\n return size;\n }\n\n aspectRatio = size.width / size.height;\n\n if ((size.width * pixelRatio) > maxSize.width && maxSize.width !== -1) {\n size.width = Math.round(maxSize.width / pixelRatio);\n size.height = Math.round(maxSize.width / aspectRatio / pixelRatio);\n }\n\n if ((size.height * pixelRatio) > maxSize.height && maxSize.height !== -1) {\n size.height = Math.round(maxSize.height / pixelRatio);\n size.width = Math.round(maxSize.height * aspectRatio / pixelRatio);\n }\n\n return size;\n}\n\nfunction requestFullscreen (canvas) {\n var requestFullscreen =\n canvas.requestFullscreen ||\n canvas.webkitRequestFullscreen ||\n canvas.mozRequestFullScreen || // The capitalized `S` is not a typo.\n canvas.msRequestFullscreen;\n // Hide navigation buttons on Android.\n requestFullscreen.apply(canvas, [{navigationUI: 'hide'}]);\n}\n\nfunction exitFullscreen () {\n var fullscreenEl =\n document.fullscreenElement ||\n document.webkitFullscreenElement ||\n document.mozFullScreenElement;\n if (!fullscreenEl) { return; }\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) {\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) {\n document.webkitExitFullscreen();\n }\n}\n\nfunction setupCanvas (sceneEl) {\n var canvasEl;\n\n canvasEl = document.createElement('canvas');\n canvasEl.classList.add('a-canvas');\n // Mark canvas as provided/injected by A-Frame.\n canvasEl.dataset.aframeCanvas = true;\n sceneEl.appendChild(canvasEl);\n\n document.addEventListener('fullscreenchange', onFullScreenChange);\n document.addEventListener('mozfullscreenchange', onFullScreenChange);\n document.addEventListener('webkitfullscreenchange', onFullScreenChange);\n document.addEventListener('MSFullscreenChange', onFullScreenChange);\n\n // Prevent overscroll on mobile.\n canvasEl.addEventListener('touchmove', function (event) { event.preventDefault(); });\n\n // Set canvas on scene.\n sceneEl.canvas = canvasEl;\n sceneEl.emit('render-target-loaded', {target: canvasEl});\n // For unknown reasons a synchronous resize does not work on desktop when\n // entering/exiting fullscreen.\n setTimeout(bind(sceneEl.resize, sceneEl), 0);\n\n function onFullScreenChange () {\n var fullscreenEl =\n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement;\n // No fullscren element === exit fullscreen\n if (!fullscreenEl) { sceneEl.exitVR(); }\n document.activeElement.blur();\n document.body.focus();\n }\n}\nmodule.exports.setupCanvas = setupCanvas; // For testing.\n",
  375. "/* global THREE */\nvar utils = require('../../utils/');\nvar styleParser = utils.styleParser;\n\nvar sceneEl;\nvar titleEl;\nvar getSceneCanvasSize;\n\nvar ATTR_NAME = 'loading-screen';\nvar LOADER_TITLE_CLASS = 'a-loader-title';\n\nmodule.exports.setup = function setup (el, getCanvasSize) {\n sceneEl = el;\n getSceneCanvasSize = getCanvasSize;\n var loaderAttribute = sceneEl.hasAttribute(ATTR_NAME) ? styleParser.parse(sceneEl.getAttribute(ATTR_NAME)) : undefined;\n var dotsColor = loaderAttribute && loaderAttribute.dotsColor || 'white';\n var backgroundColor = loaderAttribute && loaderAttribute.backgroundColor || '#24CAFF';\n var loaderEnabled = loaderAttribute === undefined || loaderAttribute.enabled === 'true' || loaderAttribute.enabled === undefined; // true default\n var loaderScene;\n var sphereGeometry;\n var sphereMaterial;\n var sphereMesh1;\n var sphereMesh2;\n var sphereMesh3;\n var camera;\n var clock;\n var time;\n var render;\n\n if (!loaderEnabled) { return; }\n\n // Setup Scene.\n loaderScene = new THREE.Scene();\n sphereGeometry = new THREE.SphereGeometry(0.20, 36, 18, 0, 2 * Math.PI, 0, Math.PI);\n sphereMaterial = new THREE.MeshBasicMaterial({color: dotsColor});\n sphereMesh1 = new THREE.Mesh(sphereGeometry, sphereMaterial);\n sphereMesh2 = sphereMesh1.clone();\n sphereMesh3 = sphereMesh1.clone();\n camera = new THREE.PerspectiveCamera(80, window.innerWidth / window.innerHeight, 0.0005, 10000);\n clock = new THREE.Clock();\n time = 0;\n render = function () {\n sceneEl.renderer.render(loaderScene, camera);\n time = clock.getElapsedTime() % 4;\n sphereMesh1.visible = time >= 1;\n sphereMesh2.visible = time >= 2;\n sphereMesh3.visible = time >= 3;\n };\n\n loaderScene.background = new THREE.Color(backgroundColor);\n loaderScene.add(camera);\n sphereMesh1.position.set(-1, 0, -15);\n sphereMesh2.position.set(0, 0, -15);\n sphereMesh3.position.set(1, 0, -15);\n camera.add(sphereMesh1);\n camera.add(sphereMesh2);\n camera.add(sphereMesh3);\n setupTitle();\n\n // Delay 200ms to avoid loader flashes.\n setTimeout(function () {\n if (sceneEl.hasLoaded) { return; }\n resize(camera);\n titleEl.style.display = 'block';\n window.addEventListener('resize', function () { resize(camera); });\n sceneEl.renderer.setAnimationLoop(render);\n }, 200);\n};\n\nmodule.exports.remove = function remove () {\n window.removeEventListener('resize', resize);\n if (!titleEl) { return; }\n // Hide title.\n titleEl.style.display = 'none';\n};\n\nfunction resize (camera) {\n var embedded = sceneEl.hasAttribute('embedded');\n var size = getSceneCanvasSize(sceneEl.canvas, embedded, sceneEl.maxCanvasSize, sceneEl.is('vr-mode'));\n camera.aspect = size.width / size.height;\n camera.updateProjectionMatrix();\n // Notify renderer of size change.\n sceneEl.renderer.setSize(size.width, size.height, false);\n}\n\nfunction setupTitle () {\n titleEl = document.createElement('div');\n titleEl.className = LOADER_TITLE_CLASS;\n titleEl.innerHTML = document.title;\n titleEl.style.display = 'none';\n sceneEl.appendChild(titleEl);\n}\n",
  376. "var constants = require('../../constants/');\nvar extend = require('../../utils').extend;\n\nvar MOBILE_HEAD_TAGS = module.exports.MOBILE_HEAD_TAGS = [\n Meta({name: 'viewport', content: 'width=device-width,initial-scale=1,maximum-scale=1,shrink-to-fit=no,user-scalable=no,minimal-ui,viewport-fit=cover'}),\n\n // W3C-standardised meta tags.\n Meta({name: 'mobile-web-app-capable', content: 'yes'}),\n Meta({name: 'theme-color', content: 'black'})\n];\n\nvar MOBILE_IOS_HEAD_TAGS = [\n // iOS-specific meta tags for fullscreen when pinning to homescreen.\n Meta({name: 'apple-mobile-web-app-capable', content: 'yes'}),\n Meta({name: 'apple-mobile-web-app-status-bar-style', content: 'black'}),\n Link({rel: 'apple-touch-icon', href: 'https://aframe.io/images/aframe-logo-152.png'})\n];\n\nfunction Meta (attrs) {\n return {\n tagName: 'meta',\n attributes: attrs,\n exists: function () { return document.querySelector('meta[name=\"' + attrs.name + '\"]'); }\n };\n}\n\nfunction Link (attrs) {\n return {\n tagName: 'link',\n attributes: attrs,\n exists: function () { return document.querySelector('link[rel=\"' + attrs.rel + '\"]'); }\n };\n}\n\n/**\n * Injects the necessary metatags in the document for mobile support:\n * 1. Prevent the user to zoom in the document.\n * 2. Ensure that window.innerWidth and window.innerHeight have the correct\n * values and the canvas is properly scaled.\n * 3. To allow fullscreen mode when pinning a web app on the home screen on\n * iOS.\n * Adapted from https://www.reddit.com/r/web_design/comments/3la04p/\n *\n * @param {object} scene - Scene element\n * @returns {Array}\n */\nmodule.exports.inject = function injectHeadTags (scene) {\n var headEl = document.head;\n var headScriptEl = headEl.querySelector('script');\n var tag;\n var headTags = [];\n MOBILE_HEAD_TAGS.forEach(createAndInjectTag);\n if (scene.isIOS) {\n MOBILE_IOS_HEAD_TAGS.forEach(createAndInjectTag);\n }\n return headTags;\n\n function createAndInjectTag (tagObj) {\n if (!tagObj || tagObj.exists()) { return; }\n\n tag = createTag(tagObj);\n if (!tag) { return; }\n\n if (headScriptEl) {\n headScriptEl.parentNode.insertBefore(tag, headScriptEl);\n } else {\n headEl.appendChild(tag);\n }\n\n headTags.push(tag);\n }\n};\n\nfunction createTag (tagObj) {\n if (!tagObj || !tagObj.tagName) { return; }\n var meta = document.createElement(tagObj.tagName);\n meta.setAttribute(constants.AFRAME_INJECTED, '');\n return extend(meta, tagObj.attributes);\n}\n",
  377. "var bind = require('../../utils/bind');\nvar isIframed = require('../../utils/').isIframed;\n\n/**\n * Provides a post message API for scenes contained\n * in an iframe.\n */\nmodule.exports = function initPostMessageAPI (scene) {\n // Handles fullscreen behavior when inside an iframe.\n if (!isIframed()) { return; }\n // postMessage API handler\n window.addEventListener('message', bind(postMessageAPIHandler, scene));\n};\n\nfunction postMessageAPIHandler (event) {\n var scene = this;\n if (!event.data) { return; }\n\n switch (event.data.type) {\n case 'vr': {\n switch (event.data.data) {\n case 'enter':\n scene.enterVR();\n break;\n case 'exit':\n scene.exitVR();\n break;\n }\n }\n }\n}\n",
  378. "/*\n Scene index for keeping track of created scenes.\n*/\nmodule.exports = [];\n",
  379. "var Wakelock = require('../../../vendor/wakelock/wakelock');\n\nmodule.exports = function initWakelock (scene) {\n if (!scene.isMobile) { return; }\n\n var wakelock = scene.wakelock = new Wakelock();\n scene.addEventListener('enter-vr', function () { wakelock.request(); });\n scene.addEventListener('exit-vr', function () { wakelock.release(); });\n};\n",
  380. "var utils = require('../utils/');\nvar PropertyTypes = require('./propertyTypes');\n\nvar debug = utils.debug;\nvar isValidDefaultValue = PropertyTypes.isValidDefaultValue;\nvar propertyTypes = PropertyTypes.propertyTypes;\n\nvar warn = debug('core:schema:warn');\n\n/**\n * A schema is classified as a schema for a single property if:\n * - `type` is defined on the schema as a string.\n * - OR `default` is defined on the schema, as a reserved keyword.\n * - OR schema is empty.\n */\nfunction isSingleProperty (schema) {\n if ('type' in schema) {\n return typeof schema.type === 'string';\n }\n return 'default' in schema;\n}\nmodule.exports.isSingleProperty = isSingleProperty;\n\n/**\n * Build step to schema to use `type` to inject default value, parser, and stringifier.\n *\n * @param {object} schema\n * @param {string} componentName\n * @returns {object} Schema.\n */\nmodule.exports.process = function (schema, componentName) {\n var propName;\n\n // For single property schema, run processPropDefinition over the whole schema.\n if (isSingleProperty(schema)) {\n return processPropertyDefinition(schema, componentName);\n }\n\n // For multi-property schema, run processPropDefinition over each property definition.\n for (propName in schema) {\n schema[propName] = processPropertyDefinition(schema[propName], componentName);\n }\n return schema;\n};\n\n/**\n * Inject default value, parser, stringifier for single property.\n *\n * @param {object} propDefinition\n * @param {string} componentName\n */\nfunction processPropertyDefinition (propDefinition, componentName) {\n var defaultVal = propDefinition.default;\n var isCustomType;\n var propType;\n var typeName = propDefinition.type;\n\n // Type inference.\n if (!propDefinition.type) {\n if (defaultVal !== undefined &&\n (typeof defaultVal === 'boolean' || typeof defaultVal === 'number')) {\n // Type inference.\n typeName = typeof defaultVal;\n } else if (Array.isArray(defaultVal)) {\n typeName = 'array';\n } else {\n // Fall back to string.\n typeName = 'string';\n }\n } else if (propDefinition.type === 'bool') {\n typeName = 'boolean';\n } else if (propDefinition.type === 'float') {\n typeName = 'number';\n }\n\n propType = propertyTypes[typeName];\n if (!propType) {\n warn('Unknown property type for component `' + componentName + '`: ' + typeName);\n }\n\n // Fill in parse and stringify using property types.\n isCustomType = !!propDefinition.parse;\n propDefinition.parse = propDefinition.parse || propType.parse;\n propDefinition.stringify = propDefinition.stringify || propType.stringify;\n\n // Fill in type name.\n propDefinition.type = typeName;\n\n // Check that default value exists.\n if ('default' in propDefinition) {\n // Check that default values are valid.\n if (!isCustomType && !isValidDefaultValue(typeName, defaultVal)) {\n warn('Default value `' + defaultVal + '` does not match type `' + typeName +\n '` in component `' + componentName + '`');\n }\n } else {\n // Fill in default value.\n propDefinition.default = propType.default;\n }\n\n return propDefinition;\n}\nmodule.exports.processPropertyDefinition = processPropertyDefinition;\n\n/**\n * Parse propData using schema. Use default values if not existing in propData.\n *\n * @param {object} propData - Unparsed properties.\n * @param {object} schema - Property types definition.\n * @param {boolean} getPartialData - Whether to return full component data or just the data\n * with keys in `propData`.\n * @param {string } componentName - Name of the component, used for the property warning.\n * @param {boolean} silent - Suppress warning messages.\n */\nmodule.exports.parseProperties = (function () {\n var propNames = [];\n\n return function (propData, schema, getPartialData, componentName, silent) {\n var i;\n var propName;\n var propDefinition;\n var propValue;\n\n propNames.length = 0;\n for (propName in (getPartialData ? propData : schema)) {\n if (getPartialData && propData[propName] === undefined) { continue; }\n propNames.push(propName);\n }\n\n if (propData === null || typeof propData !== 'object') { return propData; }\n\n // Validation errors.\n for (propName in propData) {\n if (propData[propName] !== undefined && !schema[propName] && !silent) {\n warn('Unknown property `' + propName +\n '` for component/system `' + componentName + '`.');\n }\n }\n\n for (i = 0; i < propNames.length; i++) {\n propName = propNames[i];\n propDefinition = schema[propName];\n propValue = propData[propName];\n if (!(schema[propName])) { return; }\n propData[propName] = parseProperty(propValue, propDefinition);\n }\n\n return propData;\n };\n})();\n\n/**\n * Deserialize a single property.\n */\nfunction parseProperty (value, propDefinition) {\n // Use default value if value is falsy.\n if (value === undefined || value === null || value === '') {\n value = propDefinition.default;\n if (Array.isArray(value)) { value = value.slice(); }\n }\n // Invoke property type parser.\n return propDefinition.parse(value, propDefinition.default);\n}\nmodule.exports.parseProperty = parseProperty;\n\n/**\n * Serialize a group of properties.\n */\nmodule.exports.stringifyProperties = function (propData, schema) {\n var propName;\n var propDefinition;\n var propValue;\n var stringifiedData = {};\n var value;\n\n for (propName in propData) {\n propDefinition = schema[propName];\n propValue = propData[propName];\n value = propValue;\n if (typeof value === 'object') {\n value = stringifyProperty(propValue, propDefinition);\n if (!propDefinition) { warn('Unknown component property: ' + propName); }\n }\n stringifiedData[propName] = value;\n }\n return stringifiedData;\n};\n\n/**\n * Serialize a single property.\n */\nfunction stringifyProperty (value, propDefinition) {\n // This function stringifies but it's used in a context where\n // there's always second stringification pass. By returning the original\n // value when it's not an object we save one unnecessary call\n // to JSON.stringify.\n if (typeof value !== 'object') { return value; }\n // if there's no schema for the property we use standar JSON stringify\n if (!propDefinition || value === null) { return JSON.stringify(value); }\n return propDefinition.stringify(value);\n}\nmodule.exports.stringifyProperty = stringifyProperty;\n",
  381. "var schema = require('./schema');\n\nvar processSchema = schema.process;\nvar shaders = module.exports.shaders = {}; // Keep track of registered shaders.\nvar shaderNames = module.exports.shaderNames = []; // Keep track of the names of registered shaders.\nvar THREE = require('../lib/three');\nvar utils = require('../utils');\n\n// A-Frame properties to three.js uniform types.\nvar propertyToThreeMapping = {\n array: 'v3',\n color: 'v3',\n int: 'i',\n number: 'f',\n map: 't',\n time: 'f',\n vec2: 'v2',\n vec3: 'v3',\n vec4: 'v4'\n};\n\n/**\n * Shader class definition.\n *\n * Shaders extend the material component API so you can create your own library\n * of customized materials\n *\n */\nvar Shader = module.exports.Shader = function () {};\n\nShader.prototype = {\n /**\n * Contains the type schema and defaults for the data values.\n * Data is coerced into the types of the values of the defaults.\n */\n schema: {},\n\n vertexShader:\n 'void main() {' +\n 'gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);' +\n '}',\n\n fragmentShader:\n 'void main() {' +\n 'gl_FragColor = vec4(1.0, 0.0, 1.0, 1.0);' +\n '}',\n\n /**\n * Init handler. Similar to attachedCallback.\n * Called during shader initialization and is only run once.\n */\n init: function (data) {\n this.attributes = this.initVariables(data, 'attribute');\n this.uniforms = this.initVariables(data, 'uniform');\n this.material = new (this.raw ? THREE.RawShaderMaterial : THREE.ShaderMaterial)({\n // attributes: this.attributes,\n uniforms: this.uniforms,\n vertexShader: this.vertexShader,\n fragmentShader: this.fragmentShader\n });\n return this.material;\n },\n\n initVariables: function (data, type) {\n var key;\n var schema = this.schema;\n var variables = {};\n var varType;\n\n for (key in schema) {\n if (schema[key].is !== type) { continue; }\n varType = propertyToThreeMapping[schema[key].type];\n variables[key] = {\n type: varType,\n value: undefined // Let updateVariables handle setting these.\n };\n }\n return variables;\n },\n\n /**\n * Update handler. Similar to attributeChangedCallback.\n * Called whenever the associated material data changes.\n *\n * @param {object} data - New material data.\n */\n update: function (data) {\n this.updateVariables(data, 'attribute');\n this.updateVariables(data, 'uniform');\n },\n\n updateVariables: function (data, type) {\n var key;\n var materialKey;\n var schema = this.schema;\n var variables;\n\n variables = type === 'uniform' ? this.uniforms : this.attributes;\n for (key in data) {\n if (!schema[key] || schema[key].is !== type) { continue; }\n\n if (schema[key].type === 'map') {\n // If data unchanged, get out early.\n if (!variables[key] || variables[key].value === data[key]) { continue; }\n\n // Special handling is needed for textures.\n materialKey = '_texture_' + key;\n\n // We can't actually set the variable correctly until we've loaded the texture.\n this.setMapOnTextureLoad(variables, key, materialKey);\n\n // Kick off the texture update now that handler is added.\n utils.material.updateMapMaterialFromData(materialKey, key, this, data);\n continue;\n }\n variables[key].value = this.parseValue(schema[key].type, data[key]);\n variables[key].needsUpdate = true;\n }\n },\n\n parseValue: function (type, value) {\n var color;\n switch (type) {\n case 'vec2': {\n return new THREE.Vector2(value.x, value.y);\n }\n case 'vec3': {\n return new THREE.Vector3(value.x, value.y, value.z);\n }\n case 'vec4': {\n return new THREE.Vector4(value.x, value.y, value.z, value.w);\n }\n case 'color': {\n color = new THREE.Color(value);\n return new THREE.Vector3(color.r, color.g, color.b);\n }\n case 'map': {\n return THREE.ImageUtils.loadTexture(value);\n }\n default: {\n return value;\n }\n }\n },\n\n setMapOnTextureLoad: function (variables, key, materialKey) {\n var self = this;\n this.el.addEventListener('materialtextureloaded', function () {\n variables[key].value = self.material[materialKey];\n variables[key].needsUpdate = true;\n });\n }\n};\n\n/**\n * Registers a shader to A-Frame.\n *\n * @param {string} name - shader name.\n * @param {object} definition - shader property and methods.\n * @returns {object} Shader.\n */\nmodule.exports.registerShader = function (name, definition) {\n var NewShader;\n var proto = {};\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (shaders[name]) {\n throw new Error('The shader ' + name + ' has been already registered');\n }\n NewShader = function () { Shader.call(this); };\n NewShader.prototype = Object.create(Shader.prototype, proto);\n NewShader.prototype.name = name;\n NewShader.prototype.constructor = NewShader;\n shaders[name] = {\n Shader: NewShader,\n schema: processSchema(NewShader.prototype.schema)\n };\n shaderNames.push(name);\n return NewShader;\n};\n",
  382. "var components = require('./component');\nvar schema = require('./schema');\nvar utils = require('../utils/');\n\nvar parseProperties = schema.parseProperties;\nvar parseProperty = schema.parseProperty;\nvar processSchema = schema.process;\nvar isSingleProp = schema.isSingleProperty;\nvar styleParser = utils.styleParser;\n\nvar systems = module.exports.systems = {}; // Keep track of registered systems.\n\n/**\n * System class definition.\n *\n * Systems provide global scope and services to a group of instantiated components of the\n * same class. They can also help abstract logic away from components such that components\n * only have to worry about data.\n *\n * For example, a physics component that creates a physics world that oversees\n * all entities with a physics or rigid body component.\n *\n * TODO: Have the System prototype reuse the Component prototype. Most code is copied\n * and some pieces are missing from the Component facilities (e.g., attribute caching,\n * setAttribute behavior).\n *\n * @member {string} name - Name that system is registered under.\n * @member {Element} sceneEl - Handle to the scene element where system applies to.\n */\nvar System = module.exports.System = function (sceneEl) {\n var component = components && components.components[this.name];\n\n // Set reference to scene.\n this.el = sceneEl;\n this.sceneEl = sceneEl;\n\n // Set reference to matching component (if exists).\n if (component) { component.Component.prototype.system = this; }\n\n // Process system configuration.\n this.buildData();\n this.init();\n this.update({});\n};\n\nSystem.prototype = {\n /**\n * Schema to configure system.\n */\n schema: {},\n\n /**\n * Init handler. Called during scene initialization and is only run once.\n * Systems can use this to set initial state.\n */\n init: function () { /* no-op */ },\n\n /**\n * Update handler. Called during scene attribute updates.\n * Systems can use this to dynamically update their state.\n */\n update: function (oldData) { /* no-op */ },\n\n /**\n * Build data and call update handler.\n *\n * @private\n */\n updateProperties: function (rawData) {\n var oldData = this.data;\n if (!Object.keys(schema).length) { return; }\n this.buildData(rawData);\n this.update(oldData);\n },\n\n /**\n * Parse data.\n */\n buildData: function (rawData) {\n var schema = this.schema;\n if (!Object.keys(schema).length) { return; }\n rawData = rawData || window.HTMLElement.prototype.getAttribute.call(this.sceneEl, this.name);\n if (isSingleProp(schema)) {\n this.data = parseProperty(rawData, schema);\n } else {\n this.data = parseProperties(styleParser.parse(rawData) || {}, schema);\n }\n },\n\n /**\n * Tick handler.\n * Called on each tick of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n */\n tick: undefined,\n\n /**\n * Tock handler.\n * Called on each tock of the scene render loop.\n * Affected by play and pause.\n *\n * @param {number} time - Scene tick time.\n * @param {number} timeDelta - Difference in current render time and previous render time.\n */\n tock: undefined,\n\n /**\n * Called to start any dynamic behavior (e.g., animation, AI, events, physics).\n */\n play: function () { /* no-op */ },\n\n /**\n * Called to stop any dynamic behavior (e.g., animation, AI, events, physics).\n */\n pause: function () { /* no-op */ }\n};\n\n/**\n * Registers a system to A-Frame.\n *\n * @param {string} name - Component name.\n * @param {object} definition - Component property and methods.\n * @returns {object} Component.\n */\nmodule.exports.registerSystem = function (name, definition) {\n var i;\n var NewSystem;\n var proto = {};\n var scenes = utils.findAllScenes(document);\n\n // Format definition object to prototype object.\n Object.keys(definition).forEach(function (key) {\n proto[key] = {\n value: definition[key],\n writable: true\n };\n });\n\n if (systems[name]) {\n throw new Error('The system `' + name + '` has been already registered. ' +\n 'Check that you are not loading two versions of the same system ' +\n 'or two different systems of the same name.');\n }\n NewSystem = function (sceneEl) { System.call(this, sceneEl); };\n NewSystem.prototype = Object.create(System.prototype, proto);\n NewSystem.prototype.name = name;\n NewSystem.prototype.constructor = NewSystem;\n NewSystem.prototype.schema = utils.extend(processSchema(NewSystem.prototype.schema));\n systems[name] = NewSystem;\n\n // Initialize systems for existing scenes\n for (i = 0; i < scenes.length; i++) { scenes[i].initSystem(name); }\n};\n",
  383. "require('./pivot');\n",
  384. "var registerComponent = require('../../core/component').registerComponent;\nvar THREE = require('../../lib/three');\n\nvar originalPosition = new THREE.Vector3();\nvar originalRotation = new THREE.Vector3();\n\n/**\n * Wrap el.object3D within an outer group. Apply pivot to el.object3D as position.\n */\nregisterComponent('pivot', {\n dependencies: ['position'],\n\n schema: {type: 'vec3'},\n\n init: function () {\n var data = this.data;\n var el = this.el;\n var originalParent = el.object3D.parent;\n var originalGroup = el.object3D;\n var outerGroup = new THREE.Group();\n\n originalPosition.copy(originalGroup.position);\n originalRotation.copy(originalGroup.rotation);\n\n // Detach current group from parent.\n originalParent.remove(originalGroup);\n outerGroup.add(originalGroup);\n\n // Set new group as the outer group.\n originalParent.add(outerGroup);\n\n // Set outer group as new object3D.\n el.object3D = outerGroup;\n\n // Apply pivot to original group.\n originalGroup.position.set(-1 * data.x, -1 * data.y, -1 * data.z);\n\n // Offset the pivot so that world position not affected.\n // And restore position onto outer group.\n outerGroup.position.set(data.x + originalPosition.x, data.y + originalPosition.y,\n data.z + originalPosition.z);\n\n // Transfer rotation to outer group.\n outerGroup.rotation.copy(originalGroup.rotation);\n originalGroup.rotation.set(0, 0, 0);\n }\n});\n",
  385. "/**\n * Common mesh defaults, mappings, and transforms.\n */\nvar components = require('../../core/component').components;\nvar shaders = require('../../core/shader').shaders;\nvar utils = require('../../utils/');\n\nvar materialMappings = {};\nObject.keys(components.material.schema).forEach(addMapping);\nObject.keys(shaders.standard.schema).forEach(addMapping);\n\nfunction addMapping (prop) {\n // To hyphenated.\n var htmlAttrName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n if (prop === 'fog') { htmlAttrName = 'material-fog'; }\n if (prop === 'visible') { htmlAttrName = 'material-visible'; }\n materialMappings[htmlAttrName] = 'material.' + prop;\n}\n\nmodule.exports = function getMeshMixin () {\n return {\n defaultComponents: {material: {}},\n mappings: utils.extend({}, materialMappings)\n };\n};\n",
  386. "require('./primitives/a-camera');\nrequire('./primitives/a-cursor');\nrequire('./primitives/a-curvedimage');\nrequire('./primitives/a-gltf-model');\nrequire('./primitives/a-image');\nrequire('./primitives/a-light');\nrequire('./primitives/a-link');\nrequire('./primitives/a-obj-model');\nrequire('./primitives/a-sky');\nrequire('./primitives/a-sound');\nrequire('./primitives/a-text');\nrequire('./primitives/a-video');\nrequire('./primitives/a-videosphere');\nrequire('./primitives/meshPrimitives');\n",
  387. "var AEntity = require('../../core/a-entity');\nvar components = require('../../core/component').components;\nvar registerElement = require('../../core/a-register-element').registerElement;\nvar utils = require('../../utils/');\n\nvar debug = utils.debug;\nvar setComponentProperty = utils.entity.setComponentProperty;\nvar log = debug('extras:primitives:debug');\nvar warn = debug('extras:primitives:warn');\n\nvar primitives = module.exports.primitives = {};\n\nmodule.exports.registerPrimitive = function registerPrimitive (name, definition) {\n name = name.toLowerCase();\n log('Registering <%s>', name);\n\n // Deprecation warning for defaultAttributes usage.\n if (definition.defaultAttributes) {\n warn(\"The 'defaultAttributes' object is deprecated. Use 'defaultComponents' instead.\");\n }\n\n var primitive = registerElement(name, {\n prototype: Object.create(AEntity.prototype, {\n defaultComponentsFromPrimitive: {\n value: definition.defaultComponents || definition.defaultAttributes || {}\n },\n deprecated: {value: definition.deprecated || null},\n deprecatedMappings: {value: definition.deprecatedMappings || {}},\n mappings: {value: definition.mappings || {}},\n\n createdCallback: {\n value: function () {\n if (definition.deprecated) { console.warn(definition.deprecated); }\n this.resolveMappingCollisions();\n }\n },\n\n /**\n * If a mapping collides with a registered component name\n * it renames the mapping to componentname-property\n */\n resolveMappingCollisions: {\n value: function () {\n var mappings = this.mappings;\n var self = this;\n Object.keys(mappings).forEach(function resolveCollision (key) {\n var newAttribute;\n if (key !== key.toLowerCase()) { warn('Mapping keys should be specified in lower case. The mapping key ' + key + ' may not be recognized'); }\n if (components[key]) {\n newAttribute = mappings[key].replace('.', '-');\n mappings[newAttribute] = mappings[key];\n delete mappings[key];\n console.warn('The primitive ' + self.tagName.toLowerCase() + ' has a mapping collision. ' +\n 'The attribute ' + key + ' has the same name as a registered component and' +\n ' has been renamed to ' + newAttribute);\n }\n });\n }\n },\n\n getExtraComponents: {\n value: function () {\n var attr;\n var data;\n var i;\n var mapping;\n var mixins;\n var path;\n var self = this;\n\n // Gather component data from default components.\n data = utils.clone(this.defaultComponentsFromPrimitive);\n\n // Factor in mixins to overwrite default components.\n mixins = this.getAttribute('mixin');\n if (mixins) {\n mixins = mixins.trim().split(' ');\n mixins.forEach(function applyMixin (mixinId) {\n var mixinComponents = self.sceneEl.querySelector('#' + mixinId).componentCache;\n Object.keys(mixinComponents).forEach(function setComponent (name) {\n data[name] = extend(data[name], mixinComponents[name]);\n });\n });\n }\n\n // Gather component data from mappings.\n for (i = 0; i < this.attributes.length; i++) {\n attr = this.attributes[i];\n mapping = this.mappings[attr.name];\n if (mapping) {\n path = utils.entity.getComponentPropertyPath(mapping);\n if (path.constructor === Array) {\n data[path[0]] = data[path[0]] || {};\n data[path[0]][path[1]] = attr.value.trim();\n } else {\n data[path] = attr.value.trim();\n }\n continue;\n }\n }\n\n return data;\n\n /**\n * For the base to be extensible, both objects must be pure JavaScript objects.\n * The function assumes that base is undefined, or null or a pure object.\n */\n function extend (base, extension) {\n if (isUndefined(base)) {\n return copy(extension);\n }\n if (isUndefined(extension)) {\n return copy(base);\n }\n if (isPureObject(base) && isPureObject(extension)) {\n return utils.extendDeep(base, extension);\n }\n return copy(extension);\n }\n\n function isUndefined (value) {\n return typeof value === 'undefined';\n }\n\n function copy (value) {\n if (isPureObject(value)) {\n return utils.extendDeep({}, value);\n }\n return value;\n }\n\n function isPureObject (value) {\n return value !== null && value.constructor === Object;\n }\n }\n },\n\n /**\n * Sync to attribute to component property whenever mapped attribute changes.\n * If attribute is mapped to a component property, set the component property using\n * the attribute value.\n */\n attributeChangedCallback: {\n value: function (attr, oldVal, value) {\n var componentName = this.mappings[attr];\n\n if (attr in this.deprecatedMappings) {\n console.warn(this.deprecatedMappings[attr]);\n }\n\n if (!attr || !componentName) { return; }\n\n // Set value.\n setComponentProperty(this, componentName, value);\n }\n }\n })\n });\n\n // Store.\n primitives[name] = primitive;\n return primitive;\n};\n\n/**\n * Add component mappings using schema.\n */\nfunction addComponentMapping (componentName, mappings) {\n var schema = components[componentName].schema;\n Object.keys(schema).map(function (prop) {\n // Hyphenate where there is camelCase.\n var attrName = prop.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n // If there is a mapping collision, prefix with component name and hyphen.\n if (mappings[attrName] !== undefined) { attrName = componentName + '-' + prop; }\n mappings[attrName] = componentName + '.' + prop;\n });\n}\n\n/**\n * Helper to define a primitive, building mappings using a component schema.\n */\nfunction definePrimitive (tagName, defaultComponents, mappings) {\n // If no initial mappings provided, start from empty map.\n mappings = mappings || {};\n\n // From the default components, add mapping automagically.\n Object.keys(defaultComponents).map(function buildMappings (componentName) {\n addComponentMapping(componentName, mappings);\n });\n\n // Register the primitive.\n module.exports.registerPrimitive(tagName, utils.extendDeep({}, null, {\n defaultComponents: defaultComponents,\n mappings: mappings\n }));\n}\nmodule.exports.definePrimitive = definePrimitive;\n",
  388. "var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-camera', {\n defaultComponents: {\n 'camera': {},\n 'look-controls': {},\n 'wasd-controls': {},\n 'position': {x: 0, y: 1.6, z: 0}\n },\n\n mappings: {\n active: 'camera.active',\n far: 'camera.far',\n fov: 'camera.fov',\n 'look-controls-enabled': 'look-controls.enabled',\n near: 'camera.near',\n 'pointer-lock-enabled': 'look-controls.pointerLockEnabled',\n 'wasd-controls-enabled': 'wasd-controls.enabled',\n 'reverse-mouse-drag': 'look-controls.reverseMouseDrag',\n zoom: 'camera.zoom'\n }\n});\n",
  389. "var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-cursor', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n cursor: {},\n geometry: {\n primitive: 'ring',\n radiusOuter: 0.016,\n radiusInner: 0.01,\n segmentsTheta: 32\n },\n material: {\n color: '#000',\n shader: 'flat',\n opacity: 0.8\n },\n position: {\n x: 0,\n y: 0,\n z: -1\n }\n },\n\n mappings: {\n far: 'raycaster.far',\n fuse: 'cursor.fuse',\n 'fuse-timeout': 'cursor.fuseTimeout',\n interval: 'raycaster.interval',\n objects: 'raycaster.objects'\n }\n}));\n",
  390. "var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-curvedimage', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n height: 1,\n primitive: 'cylinder',\n radius: 2,\n segmentsRadial: 48,\n thetaLength: 270,\n openEnded: true,\n thetaStart: 0\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true,\n repeat: '-1 1'\n }\n },\n\n mappings: {\n height: 'geometry.height',\n 'open-ended': 'geometry.openEnded',\n radius: 'geometry.radius',\n segments: 'geometry.segmentsRadial',\n start: 'geometry.thetaStart',\n 'theta-length': 'geometry.thetaLength',\n 'theta-start': 'geometry.thetaStart',\n 'width': 'geometry.thetaLength'\n }\n}));\n",
  391. "var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-gltf-model', {\n mappings: {\n src: 'gltf-model'\n }\n});\n",
  392. "var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-image', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'plane'\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true\n }\n },\n\n mappings: {\n height: 'geometry.height',\n width: 'geometry.width'\n }\n}));\n",
  393. "var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-light', {\n defaultComponents: {\n light: {}\n },\n\n mappings: {\n angle: 'light.angle',\n color: 'light.color',\n 'ground-color': 'light.groundColor',\n decay: 'light.decay',\n distance: 'light.distance',\n intensity: 'light.intensity',\n penumbra: 'light.penumbra',\n type: 'light.type',\n target: 'light.target',\n envmap: 'light.envMap'\n }\n});\n",
  394. "var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-link', {\n defaultComponents: {\n link: {\n visualAspectEnabled: true\n }\n },\n\n mappings: {\n href: 'link.href',\n image: 'link.image',\n title: 'link.title'\n }\n});\n",
  395. "var meshMixin = require('../getMeshMixin')();\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-obj-model', utils.extendDeep({}, meshMixin, {\n defaultComponents: {\n 'obj-model': {}\n },\n\n mappings: {\n src: 'obj-model.obj',\n mtl: 'obj-model.mtl'\n }\n}));\n",
  396. "var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\nvar meshPrimitives = require('./meshPrimitives');\n\nregisterPrimitive('a-sky', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'sphere',\n radius: 500,\n segmentsWidth: 64,\n segmentsHeight: 32\n },\n material: {\n color: '#FFF',\n side: 'back',\n shader: 'flat',\n npot: true\n },\n scale: '-1 1 1'\n },\n\n mappings: utils.extendDeep({}, meshPrimitives['a-sphere'].prototype.mappings)\n}));\n",
  397. "var registerPrimitive = require('../primitives').registerPrimitive;\n\nregisterPrimitive('a-sound', {\n defaultComponents: {\n sound: {}\n },\n\n mappings: {\n src: 'sound.src',\n on: 'sound.on',\n autoplay: 'sound.autoplay',\n loop: 'sound.loop',\n volume: 'sound.volume'\n }\n});\n",
  398. "// <a-text> using `definePrimitive` helper.\nvar definePrimitive = require('../primitives').definePrimitive;\ndefinePrimitive('a-text', {text: {anchor: 'align', width: 5}});\n",
  399. "var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-video', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'plane'\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'double',\n transparent: true\n }\n },\n\n mappings: {\n height: 'geometry.height',\n width: 'geometry.width'\n }\n}));\n",
  400. "var getMeshMixin = require('../getMeshMixin');\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\nregisterPrimitive('a-videosphere', utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {\n geometry: {\n primitive: 'sphere',\n radius: 500,\n segmentsWidth: 64,\n segmentsHeight: 32\n },\n material: {\n color: '#FFF',\n shader: 'flat',\n side: 'back',\n npot: true\n },\n scale: '-1 1 1'\n },\n\n mappings: {\n radius: 'geometry.radius',\n 'segments-height': 'geometry.segmentsHeight',\n 'segments-width': 'geometry.segmentsWidth'\n }\n}));\n",
  401. "/**\n * Automated mesh primitive registration.\n */\nvar getMeshMixin = require('../getMeshMixin');\nvar geometries = require('../../../core/geometry').geometries;\nvar geometryNames = require('../../../core/geometry').geometryNames;\nvar registerPrimitive = require('../primitives').registerPrimitive;\nvar utils = require('../../../utils/');\n\n// For testing.\nvar meshPrimitives = module.exports = {};\n\n// Generate primitive for each geometry type.\ngeometryNames.forEach(function registerMeshPrimitive (geometryName) {\n var geometry = geometries[geometryName];\n var geometryHyphened = unCamelCase(geometryName);\n\n // Generate mappings.\n var mappings = {};\n Object.keys(geometry.schema).forEach(function createMapping (property) {\n mappings[unCamelCase(property)] = 'geometry.' + property;\n });\n\n // Register.\n var tagName = 'a-' + geometryHyphened;\n var primitive = registerPrimitive(tagName, utils.extendDeep({}, getMeshMixin(), {\n defaultComponents: {geometry: {primitive: geometryName}},\n mappings: mappings\n }));\n meshPrimitives[tagName] = primitive;\n});\n\n/**\n * camelCase to hyphened-string.\n */\nfunction unCamelCase (str) {\n return str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();\n}\n",
  402. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('box', {\n schema: {\n depth: {default: 1, min: 0},\n height: {default: 1, min: 0},\n width: {default: 1, min: 0},\n segmentsHeight: {default: 1, min: 1, max: 20, type: 'int'},\n segmentsWidth: {default: 1, min: 1, max: 20, type: 'int'},\n segmentsDepth: {default: 1, min: 1, max: 20, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.BoxGeometry(\n data.width, data.height, data.depth,\n data.segmentsWidth, data.segmentsHeight, data.segmentsDepth);\n }\n});\n",
  403. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('circle', {\n schema: {\n radius: {default: 1, min: 0},\n segments: {default: 32, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.CircleGeometry(\n data.radius, data.segments, degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n",
  404. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('cone', {\n schema: {\n height: {default: 1, min: 0},\n openEnded: {default: false},\n radiusBottom: {default: 1, min: 0},\n radiusTop: {default: 0.01, min: 0},\n segmentsHeight: {default: 18, min: 1, type: 'int'},\n segmentsRadial: {default: 36, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.CylinderGeometry(\n data.radiusTop, data.radiusBottom, data.height, data.segmentsRadial,\n data.segmentsHeight, data.openEnded, degToRad(data.thetaStart),\n degToRad(data.thetaLength));\n }\n});\n",
  405. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('cylinder', {\n schema: {\n height: {default: 1, min: 0},\n openEnded: {default: false},\n radius: {default: 1, min: 0},\n segmentsHeight: {default: 18, min: 1, type: 'int'},\n segmentsRadial: {default: 36, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.CylinderGeometry(\n data.radius, data.radius, data.height, data.segmentsRadial, data.segmentsHeight,\n data.openEnded, degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n",
  406. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('dodecahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.DodecahedronGeometry(data.radius, data.detail);\n }\n});\n",
  407. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('icosahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.IcosahedronGeometry(data.radius, data.detail);\n }\n});\n",
  408. "require('./box.js');\nrequire('./circle.js');\nrequire('./cone.js');\nrequire('./cylinder.js');\nrequire('./dodecahedron.js');\nrequire('./icosahedron.js');\nrequire('./octahedron.js');\nrequire('./plane.js');\nrequire('./ring.js');\nrequire('./sphere.js');\nrequire('./tetrahedron.js');\nrequire('./torus.js');\nrequire('./torusKnot.js');\nrequire('./triangle.js');\n",
  409. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('octahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.OctahedronGeometry(data.radius, data.detail);\n }\n});\n",
  410. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('plane', {\n schema: {\n height: {default: 1, min: 0},\n width: {default: 1, min: 0},\n segmentsHeight: {default: 1, min: 1, max: 20, type: 'int'},\n segmentsWidth: {default: 1, min: 1, max: 20, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.PlaneGeometry(data.width, data.height, data.segmentsWidth, data.segmentsHeight);\n }\n});\n",
  411. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('ring', {\n schema: {\n radiusInner: {default: 0.8, min: 0},\n radiusOuter: {default: 1.2, min: 0},\n segmentsPhi: {default: 10, min: 1, type: 'int'},\n segmentsTheta: {default: 32, min: 3, type: 'int'},\n thetaLength: {default: 360, min: 0},\n thetaStart: {default: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.RingGeometry(\n data.radiusInner, data.radiusOuter, data.segmentsTheta, data.segmentsPhi,\n degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n",
  412. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('sphere', {\n schema: {\n radius: {default: 1, min: 0},\n phiLength: {default: 360},\n phiStart: {default: 0, min: 0},\n thetaLength: {default: 180, min: 0},\n thetaStart: {default: 0},\n segmentsHeight: {default: 18, min: 2, type: 'int'},\n segmentsWidth: {default: 36, min: 3, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.SphereGeometry(\n data.radius, data.segmentsWidth, data.segmentsHeight, degToRad(data.phiStart),\n degToRad(data.phiLength), degToRad(data.thetaStart), degToRad(data.thetaLength));\n }\n});\n",
  413. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('tetrahedron', {\n schema: {\n detail: {default: 0, min: 0, max: 5, type: 'int'},\n radius: {default: 1, min: 0}\n },\n\n init: function (data) {\n this.geometry = new THREE.TetrahedronGeometry(data.radius, data.detail);\n }\n});\n",
  414. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar degToRad = THREE.Math.degToRad;\n\nregisterGeometry('torus', {\n schema: {\n arc: {default: 360},\n radius: {default: 1, min: 0},\n radiusTubular: {default: 0.2, min: 0},\n segmentsRadial: {default: 36, min: 2, type: 'int'},\n segmentsTubular: {default: 32, min: 3, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.TorusGeometry(\n data.radius, data.radiusTubular * 2, data.segmentsRadial, data.segmentsTubular,\n degToRad(data.arc));\n }\n});\n",
  415. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nregisterGeometry('torusKnot', {\n schema: {\n p: {default: 2, min: 1},\n q: {default: 3, min: 1},\n radius: {default: 1, min: 0},\n radiusTubular: {default: 0.2, min: 0},\n segmentsRadial: {default: 8, min: 3, type: 'int'},\n segmentsTubular: {default: 100, min: 3, type: 'int'}\n },\n\n init: function (data) {\n this.geometry = new THREE.TorusKnotGeometry(\n data.radius, data.radiusTubular * 2, data.segmentsTubular, data.segmentsRadial,\n data.p, data.q);\n }\n});\n",
  416. "var registerGeometry = require('../core/geometry').registerGeometry;\nvar THREE = require('../lib/three');\n\nvar quaternion = new THREE.Quaternion();\nvar rotateVector = new THREE.Vector3(0, 0, 1);\nvar uvMinVector = new THREE.Vector2();\nvar uvMaxVector = new THREE.Vector2();\nvar uvScaleVector = new THREE.Vector2();\n\nregisterGeometry('triangle', {\n schema: {\n vertexA: {type: 'vec3', default: {x: 0, y: 0.5, z: 0}},\n vertexB: {type: 'vec3', default: {x: -0.5, y: -0.5, z: 0}},\n vertexC: {type: 'vec3', default: {x: 0.5, y: -0.5, z: 0}}\n },\n\n init: function (data) {\n var geometry;\n var normal;\n var triangle;\n var uvA;\n var uvB;\n var uvC;\n\n var vertices;\n var normals;\n var uvs;\n\n triangle = new THREE.Triangle();\n triangle.a.set(data.vertexA.x, data.vertexA.y, data.vertexA.z);\n triangle.b.set(data.vertexB.x, data.vertexB.y, data.vertexB.z);\n triangle.c.set(data.vertexC.x, data.vertexC.y, data.vertexC.z);\n normal = triangle.getNormal(new THREE.Vector3());\n\n // Rotate the 3D triangle to be parallel to XY plane.\n quaternion.setFromUnitVectors(normal, rotateVector);\n uvA = triangle.a.clone().applyQuaternion(quaternion);\n uvB = triangle.b.clone().applyQuaternion(quaternion);\n uvC = triangle.c.clone().applyQuaternion(quaternion);\n\n // Compute UVs.\n // Normalize x/y values of UV so they are within 0 to 1.\n uvMinVector.set(Math.min(uvA.x, uvB.x, uvC.x), Math.min(uvA.y, uvB.y, uvC.y));\n uvMaxVector.set(Math.max(uvA.x, uvB.x, uvC.x), Math.max(uvA.y, uvB.y, uvC.y));\n uvScaleVector.set(0, 0).subVectors(uvMaxVector, uvMinVector);\n uvA = new THREE.Vector2().subVectors(uvA, uvMinVector).divide(uvScaleVector);\n uvB = new THREE.Vector2().subVectors(uvB, uvMinVector).divide(uvScaleVector);\n uvC = new THREE.Vector2().subVectors(uvC, uvMinVector).divide(uvScaleVector);\n\n geometry = this.geometry = new THREE.BufferGeometry();\n vertices = [\n triangle.a.x, triangle.a.y, triangle.a.z,\n triangle.b.x, triangle.b.y, triangle.b.z,\n triangle.c.x, triangle.c.y, triangle.c.z\n ];\n normals = [\n normal.x, normal.y, normal.z,\n normal.x, normal.y, normal.z,\n normal.x, normal.y, normal.z\n ];\n uvs = [\n uvA.x, uvA.y,\n uvB.x, uvB.y,\n uvC.x, uvC.y\n ];\n\n geometry.setAttribute('position', new THREE.Float32BufferAttribute(vertices, 3));\n geometry.setAttribute('normal', new THREE.Float32BufferAttribute(normals, 3));\n geometry.setAttribute('uv', new THREE.Float32BufferAttribute(uvs, 2));\n }\n});\n",
  417. "// Polyfill `Promise`.\nwindow.Promise = window.Promise || require('promise-polyfill');\n\n// WebVR polyfill\n// Check before the polyfill runs.\nwindow.hasNativeWebVRImplementation = !!window.navigator.getVRDisplays ||\n !!window.navigator.getVRDevices;\nwindow.hasNativeWebXRImplementation = navigator.xr !== undefined;\n\n// If native WebXR or WebVR are defined WebVRPolyfill does not initialize.\nif (!window.hasNativeWebXRImplementation && !window.hasNativeWebVRImplementation) {\n var isIOSOlderThan10 = require('./utils/isIOSOlderThan10');\n // Workaround for iOS Safari canvas sizing issues in stereo (webvr-polyfill/issues/102).\n // Only for iOS on versions older than 10.\n var bufferScale = isIOSOlderThan10(window.navigator.userAgent) ? 1 / window.devicePixelRatio : 1;\n var WebVRPolyfill = require('webvr-polyfill');\n var polyfillConfig = {\n BUFFER_SCALE: bufferScale,\n CARDBOARD_UI_DISABLED: true,\n ROTATE_INSTRUCTIONS_DISABLED: true,\n MOBILE_WAKE_LOCK: !!window.cordova\n };\n window.webvrpolyfill = new WebVRPolyfill(polyfillConfig);\n}\n\nvar utils = require('./utils/');\nvar debug = utils.debug;\n\nif (utils.isIE11) {\n // Polyfill `CustomEvent`.\n require('custom-event-polyfill');\n // Polyfill String.startsWith.\n require('../vendor/starts-with-polyfill');\n}\n\nvar error = debug('A-Frame:error');\nvar warn = debug('A-Frame:warn');\n\nif (window.document.currentScript && window.document.currentScript.parentNode !==\n window.document.head && !window.debug) {\n warn('Put the A-Frame <script> tag in the <head> of the HTML *before* the scene to ' +\n 'ensure everything for A-Frame is properly registered before they are used from ' +\n 'HTML.');\n}\n\n// Error if not using a server.\nif (!window.cordova && window.location.protocol === 'file:') {\n error(\n 'This HTML file is currently being served via the file:// protocol. ' +\n 'Assets, textures, and models WILL NOT WORK due to cross-origin policy! ' +\n 'Please use a local or hosted server: ' +\n 'https://aframe.io/docs/0.5.0/introduction/getting-started.html#using-a-local-server.');\n}\n\nrequire('present'); // Polyfill `performance.now()`.\n\n// CSS.\nif (utils.device.isBrowserEnvironment) {\n require('./style/aframe.css');\n require('./style/rStats.css');\n}\n\n// Required before `AEntity` so that all components are registered.\nvar AScene = require('./core/scene/a-scene').AScene;\nvar components = require('./core/component').components;\nvar registerComponent = require('./core/component').registerComponent;\nvar registerGeometry = require('./core/geometry').registerGeometry;\nvar registerPrimitive = require('./extras/primitives/primitives').registerPrimitive;\nvar registerShader = require('./core/shader').registerShader;\nvar registerSystem = require('./core/system').registerSystem;\nvar shaders = require('./core/shader').shaders;\nvar systems = require('./core/system').systems;\n// Exports THREE to window so three.js can be used without alteration.\nvar THREE = window.THREE = require('./lib/three');\n\nvar pkg = require('../package');\n\nrequire('./components/index'); // Register standard components.\nrequire('./geometries/index'); // Register standard geometries.\nrequire('./shaders/index'); // Register standard shaders.\nrequire('./systems/index'); // Register standard systems.\nvar ANode = require('./core/a-node');\nvar AEntity = require('./core/a-entity'); // Depends on ANode and core components.\n\nrequire('./core/a-assets');\nrequire('./core/a-cubemap');\nrequire('./core/a-mixin');\n\n// Extras.\nrequire('./extras/components/');\nrequire('./extras/primitives/');\n\nconsole.log('A-Frame Version: 1.2.0 (Date 2021-11-22, Commit #cf65f451)');\nconsole.log('THREE Version (https://github.com/supermedium/three.js):',\n pkg.dependencies['super-three']);\nconsole.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);\n\nmodule.exports = window.AFRAME = {\n AComponent: require('./core/component').Component,\n AEntity: AEntity,\n ANode: ANode,\n ANIME: require('super-animejs'),\n AScene: AScene,\n components: components,\n coreComponents: Object.keys(components),\n geometries: require('./core/geometry').geometries,\n registerComponent: registerComponent,\n registerElement: require('./core/a-register-element').registerElement,\n registerGeometry: registerGeometry,\n registerPrimitive: registerPrimitive,\n registerShader: registerShader,\n registerSystem: registerSystem,\n primitives: {\n getMeshMixin: require('./extras/primitives/getMeshMixin'),\n primitives: require('./extras/primitives/primitives').primitives\n },\n scenes: require('./core/scene/scenes'),\n schema: require('./core/schema'),\n shaders: shaders,\n systems: systems,\n THREE: THREE,\n utils: utils,\n version: pkg.version\n};\n",
  418. "window.aframeStats = function (scene) {\n var _rS = null;\n var _scene = scene;\n var _values = {\n te: {\n caption: 'Entities'\n },\n lt: {\n caption: 'Load Time'\n }\n };\n var _groups = [ {\n caption: 'A-Frame',\n values: [ 'te', 'lt' ]\n } ];\n\n function _update () {\n _rS('te').set(getEntityCount());\n if (window.performance.getEntriesByName) {\n _rS('lt').set(window.performance.getEntriesByName('render-started')[0].startTime.toFixed(0));\n }\n }\n\n function getEntityCount () {\n var elements = _scene.querySelectorAll('*');\n Array.prototype.slice.call(elements).filter(function (el) {\n return el.isEntity;\n });\n return elements.length;\n }\n\n function _start () {}\n\n function _end () {}\n\n function _attach (r) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: []\n };\n};\n\nif (typeof module === 'object') {\n module.exports = {\n aframeStats: window.aframeStats\n };\n}\n",
  419. "var THREE = global.THREE = require('super-three');\n\n// Allow cross-origin images to be loaded.\n\n// This should not be on `THREE.Loader` nor `THREE.ImageUtils`.\n// Must be on `THREE.TextureLoader`.\nif (THREE.TextureLoader) {\n THREE.TextureLoader.prototype.crossOrigin = 'anonymous';\n}\n\n// This is for images loaded from the model loaders.\nif (THREE.ImageLoader) {\n THREE.ImageLoader.prototype.crossOrigin = 'anonymous';\n}\n\n// In-memory caching for XHRs (for images, audio files, textures, etc.).\nif (THREE.Cache) {\n THREE.Cache.enabled = true;\n}\n\n// TODO: Eventually include these only if they are needed by a component.\nrequire('../../vendor/DeviceOrientationControls'); // THREE.DeviceOrientationControls\nrequire('super-three/examples/js/loaders/DRACOLoader'); // THREE.DRACOLoader\nrequire('super-three/examples/js/loaders/GLTFLoader'); // THREE.GLTFLoader\nrequire('super-three/examples/js/loaders/OBJLoader'); // THREE.OBJLoader\nrequire('super-three/examples/js/loaders/MTLLoader'); // THREE.MTLLoader\nrequire('super-three/examples/js/utils/BufferGeometryUtils'); // THREE.BufferGeometryUtils\nrequire('super-three/examples/js/lights/LightProbeGenerator'); // THREE.LightProbeGenerator\n\nTHREE.DRACOLoader.prototype.crossOrigin = 'anonymous';\nTHREE.GLTFLoader.prototype.crossOrigin = 'anonymous';\nTHREE.MTLLoader.prototype.crossOrigin = 'anonymous';\nTHREE.OBJLoader.prototype.crossOrigin = 'anonymous';\n\nmodule.exports = THREE;\n",
  420. "var registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\n/**\n * Flat shader using THREE.MeshBasicMaterial.\n */\nmodule.exports.Shader = registerShader('flat', {\n schema: {\n color: {type: 'color'},\n fog: {default: true},\n height: {default: 256},\n offset: {type: 'vec2', default: {x: 0, y: 0}},\n repeat: {type: 'vec2', default: {x: 1, y: 1}},\n src: {type: 'map'},\n width: {default: 512},\n wireframe: {default: false},\n wireframeLinewidth: {default: 2}\n },\n\n /**\n * Initializes the shader.\n * Adds a reference from the scene to this entity as the camera.\n */\n init: function (data) {\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.materialData = {color: new THREE.Color()};\n this.textureSrc = null;\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n this.material = new THREE.MeshBasicMaterial(this.materialData);\n utils.material.updateMap(this, data);\n },\n\n update: function (data) {\n this.updateMaterial(data);\n utils.material.updateMap(this, data);\n },\n\n /**\n * Updating existing material.\n *\n * @param {object} data - Material component data.\n */\n updateMaterial: function (data) {\n var key;\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n for (key in this.materialData) {\n this.material[key] = this.materialData[key];\n }\n }\n});\n\n/**\n * Builds and normalize material data, normalizing stuff along the way.\n *\n * @param {object} data - Material data.\n * @param {object} materialData - Object to reuse.\n * @returns {object} Updated material data.\n */\nfunction getMaterialData (data, materialData) {\n materialData.color.set(data.color);\n materialData.fog = data.fog;\n materialData.wireframe = data.wireframe;\n materialData.wireframeLinewidth = data.wireframeLinewidth;\n return materialData;\n}\n",
  421. "require('./flat');\nrequire('./standard');\nrequire('./sdf');\nrequire('./msdf');\nrequire('./ios10hls');\nrequire('./shadow');\n",
  422. "var registerShader = require('../core/shader').registerShader;\n\n/**\n * Custom shader for iOS 10 HTTP Live Streaming (HLS).\n * For more information on HLS, see https://datatracker.ietf.org/doc/draft-pantos-http-live-streaming/\n */\nmodule.exports.Shader = registerShader('ios10hls', {\n schema: {\n src: {type: 'map', is: 'uniform'},\n opacity: {type: 'number', is: 'uniform', default: 1}\n },\n\n vertexShader: [\n 'varying vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n ].join('\\n'),\n\n fragmentShader: [\n 'uniform sampler2D src;',\n 'uniform float opacity;',\n 'varying vec2 vUV;',\n 'void main() {',\n ' vec2 offset = vec2(0, 0);',\n ' vec2 repeat = vec2(1, 1);',\n ' vec4 color = texture2D(src, vec2(vUV.x / repeat.x + offset.x, (1.0 - vUV.y) / repeat.y + offset.y)).bgra;',\n ' gl_FragColor = vec4(color.rgb, opacity);',\n '}'\n ].join('\\n')\n});\n\n",
  423. "var registerShader = require('../core/shader').registerShader;\n\nvar isWebGL2AVailable = !!document.createElement('canvas').getContext('webgl2');\n\nvar VERTEX_SHADER_WEBGL1 = [\n 'attribute vec2 uv;',\n 'attribute vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'varying vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER_WEBGL2 = [\n '#version 300 es',\n 'in vec2 uv;',\n 'in vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'out vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER = isWebGL2AVailable ? VERTEX_SHADER_WEBGL2 : VERTEX_SHADER_WEBGL1;\n\nvar FRAGMENT_SHADER_WEBGL1 = [\n '#ifdef GL_OES_standard_derivatives',\n '#extension GL_OES_standard_derivatives: enable',\n '#endif',\n 'precision highp float;',\n 'uniform bool negate;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'varying vec2 vUV;',\n\n 'float median(float r, float g, float b) {',\n ' return max(min(r, g), min(max(r, g), b));',\n '}',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n\n 'void main() {',\n ' vec3 sampleColor = texture2D(map, vUV).rgb;',\n ' if (negate) { sampleColor = 1.0 - sampleColor; }',\n\n ' float sigDist = median(sampleColor.r, sampleColor.g, sampleColor.b) - 0.5;',\n ' float alpha = clamp(sigDist / fwidth(sigDist) + 0.5, 0.0, 1.0);',\n ' float dscale = 0.353505;',\n ' vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: Experimentally determined constant.\n ' // Do modified alpha test.',\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);',\n ' }',\n\n ' // Do modified alpha test.',\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n ' gl_FragColor = vec4(color.xyz, alpha * opacity);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER_WEBGL2 = [\n '#version 300 es',\n 'precision highp float;',\n 'uniform bool negate;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'in vec2 vUV;',\n 'out vec4 fragColor;',\n\n 'float median(float r, float g, float b) {',\n ' return max(min(r, g), min(max(r, g), b));',\n '}',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n\n 'void main() {',\n ' vec3 sampleColor = texture(map, vUV).rgb;',\n ' if (negate) { sampleColor = 1.0 - sampleColor; }',\n\n ' float sigDist = median(sampleColor.r, sampleColor.g, sampleColor.b) - 0.5;',\n ' float alpha = clamp(sigDist / fwidth(sigDist) + 0.5, 0.0, 1.0);',\n ' float dscale = 0.353505;',\n ' vec2 duv = dscale * (dFdx(vUV) + dFdy(vUV));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: Experimentally determined constant.\n ' // Do modified alpha test.',\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * (sigDist + 0.5);',\n ' }',\n\n ' // Do modified alpha test.',\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n ' fragColor = vec4(color.xyz, alpha * opacity);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER = isWebGL2AVailable ? FRAGMENT_SHADER_WEBGL2 : FRAGMENT_SHADER_WEBGL1;\n\n/**\n * Multi-channel signed distance field.\n * Used by text component.\n */\nmodule.exports.Shader = registerShader('msdf', {\n schema: {\n alphaTest: {type: 'number', is: 'uniform', default: 0.5},\n color: {type: 'color', is: 'uniform', default: 'white'},\n map: {type: 'map', is: 'uniform'},\n negate: {type: 'boolean', is: 'uniform', default: true},\n opacity: {type: 'number', is: 'uniform', default: 1.0}\n },\n\n raw: true,\n\n vertexShader: VERTEX_SHADER,\n\n fragmentShader: FRAGMENT_SHADER\n});\n",
  424. "var registerShader = require('../core/shader').registerShader;\n\nvar isWebGL2AVailable = !!document.createElement('canvas').getContext('webgl2');\n\nvar VERTEX_SHADER_WEBGL1 = [\n 'attribute vec2 uv;',\n 'attribute vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'varying vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER_WEBGL2 = [\n '#version 300 es',\n 'in vec2 uv;',\n 'in vec3 position;',\n 'uniform mat4 projectionMatrix;',\n 'uniform mat4 modelViewMatrix;',\n 'out vec2 vUV;',\n 'void main(void) {',\n ' gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);',\n ' vUV = uv;',\n '}'\n].join('\\n');\n\nvar VERTEX_SHADER = isWebGL2AVailable ? VERTEX_SHADER_WEBGL2 : VERTEX_SHADER_WEBGL1;\n\nvar FRAGMENT_SHADER_WEBGL1 = [\n '#ifdef GL_OES_standard_derivatives',\n '#extension GL_OES_standard_derivatives: enable',\n '#endif',\n\n 'precision highp float;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'varying vec2 vUV;',\n\n '#ifdef GL_OES_standard_derivatives',\n ' float contour(float width, float value) {',\n ' return smoothstep(0.5 - value, 0.5 + value, width);',\n ' }',\n '#else',\n ' float aastep(float value, float afwidth) {',\n ' return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);',\n ' }',\n '#endif',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n '#define ALL_SMOOTH 0.4',\n '#define ALL_ROUGH 0.02',\n '#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))',\n\n 'void main() {',\n // When we have derivatives and can get texel size for supersampling.\n ' #ifdef GL_OES_standard_derivatives',\n ' vec2 uv = vUV;',\n ' vec4 texColor = texture2D(map, uv);',\n ' float dist = texColor.a;',\n ' float width = fwidth(dist);',\n ' float alpha = contour(dist, width);',\n ' float dscale = 0.353505;',\n\n ' vec2 duv = dscale * (dFdx(uv) + dFdy(uv));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: experimentally determined constant\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * dist;',\n ' }',\n\n // Otherwise do weighted supersampling.\n // FIXME: why this weighting?\n ' if (isBigEnough <= BIG_ENOUGH) {',\n ' vec4 box = vec4 (uv - duv, uv + duv);',\n ' alpha = (alpha + 0.5 * (',\n ' contour(texture2D(map, box.xy).a, width)',\n ' + contour(texture2D(map, box.zw).a, width)',\n ' + contour(texture2D(map, box.xw).a, width)',\n ' + contour(texture2D(map, box.zy).a, width)',\n ' )) / 3.0;',\n ' }',\n\n // Do modified alpha test.\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n\n ' #else',\n // When we don't have derivatives, use approximations.\n ' vec4 texColor = texture2D(map, vUV);',\n ' float value = texColor.a;',\n // FIXME: if we understood font pixel dimensions, this could probably be improved\n ' float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));',\n ' float alpha = aastep(value, afwidth);',\n\n // Use gl_FragCoord.w to guess when we should blend.\n // FIXME: If we understood font pixel dimensions, this could probably be improved.\n ' float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);',\n ' if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }',\n ' alpha = alpha * ratio + (1.0 - ratio) * value;',\n ' if (ratio < 1.0 && alpha <= DISCARD_ALPHA) { discard; return; }',\n ' #endif',\n\n ' gl_FragColor = vec4(color, opacity * alpha);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER_WEBGL2 = [\n '#version 300 es',\n 'precision highp float;',\n 'uniform float alphaTest;',\n 'uniform float opacity;',\n 'uniform sampler2D map;',\n 'uniform vec3 color;',\n 'in vec2 vUV;',\n 'out vec4 fragColor;',\n\n '#ifdef GL_OES_standard_derivatives',\n ' float contour(float width, float value) {',\n ' return smoothstep(0.5 - value, 0.5 + value, width);',\n ' }',\n '#else',\n ' float aastep(float value, float afwidth) {',\n ' return smoothstep(0.5 - afwidth, 0.5 + afwidth, value);',\n ' }',\n '#endif',\n\n // FIXME: Experimentally determined constants.\n '#define BIG_ENOUGH 0.001',\n '#define MODIFIED_ALPHATEST (0.02 * isBigEnough / BIG_ENOUGH)',\n '#define ALL_SMOOTH 0.4',\n '#define ALL_ROUGH 0.02',\n '#define DISCARD_ALPHA (alphaTest / (2.2 - 1.2 * ratio))',\n\n 'void main() {',\n // When we have derivatives and can get texel size for supersampling.\n ' #ifdef GL_OES_standard_derivatives',\n ' vec2 uv = vUV;',\n ' vec4 texColor = texture(map, uv);',\n ' float dist = texColor.a;',\n ' float width = fwidth(dist);',\n ' float alpha = contour(dist, width);',\n ' float dscale = 0.353505;',\n\n ' vec2 duv = dscale * (dFdx(uv) + dFdy(uv));',\n ' float isBigEnough = max(abs(duv.x), abs(duv.y));',\n\n // When texel is too small, blend raw alpha value rather than supersampling.\n // FIXME: experimentally determined constant\n ' if (isBigEnough > BIG_ENOUGH) {',\n ' float ratio = BIG_ENOUGH / isBigEnough;',\n ' alpha = ratio * alpha + (1.0 - ratio) * dist;',\n ' }',\n\n // Otherwise do weighted supersampling.\n // FIXME: why this weighting?\n ' if (isBigEnough <= BIG_ENOUGH) {',\n ' vec4 box = vec4 (uv - duv, uv + duv);',\n ' alpha = (alpha + 0.5 * (',\n ' contour(texture(map, box.xy).a, width)',\n ' + contour(texture(map, box.zw).a, width)',\n ' + contour(texture(map, box.xw).a, width)',\n ' + contour(texture(map, box.zy).a, width)',\n ' )) / 3.0;',\n ' }',\n\n // Do modified alpha test.\n ' if (alpha < alphaTest * MODIFIED_ALPHATEST) { discard; return; }',\n\n ' #else',\n // When we don't have derivatives, use approximations.\n ' vec4 texColor = texture(map, vUV);',\n ' float value = texColor.a;',\n // FIXME: if we understood font pixel dimensions, this could probably be improved\n ' float afwidth = (1.0 / 32.0) * (1.4142135623730951 / (2.0 * gl_FragCoord.w));',\n ' float alpha = aastep(value, afwidth);',\n\n // Use gl_FragCoord.w to guess when we should blend.\n // FIXME: If we understood font pixel dimensions, this could probably be improved.\n ' float ratio = (gl_FragCoord.w >= ALL_SMOOTH) ? 1.0 : (gl_FragCoord.w < ALL_ROUGH) ? 0.0 : (gl_FragCoord.w - ALL_ROUGH) / (ALL_SMOOTH - ALL_ROUGH);',\n ' if (alpha < alphaTest) { if (ratio >= 1.0) { discard; return; } alpha = 0.0; }',\n ' alpha = alpha * ratio + (1.0 - ratio) * value;',\n ' if (ratio < 1.0 && alpha <= DISCARD_ALPHA) { discard; return; }',\n ' #endif',\n\n ' fragColor = vec4(color, opacity * alpha);',\n '}'\n].join('\\n');\n\nvar FRAGMENT_SHADER = isWebGL2AVailable ? FRAGMENT_SHADER_WEBGL2 : FRAGMENT_SHADER_WEBGL1;\n\n/**\n * Signed distance field.\n * Used by text component.\n */\nmodule.exports.Shader = registerShader('sdf', {\n schema: {\n alphaTest: {type: 'number', is: 'uniform', default: 0.5},\n color: {type: 'color', is: 'uniform', default: 'white'},\n map: {type: 'map', is: 'uniform'},\n opacity: {type: 'number', is: 'uniform', default: 1.0}\n },\n\n raw: true,\n\n vertexShader: VERTEX_SHADER,\n\n fragmentShader: FRAGMENT_SHADER\n});\n",
  425. "var registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\n\n/**\n * Flat shader using THREE.ShadowMaterial.\n */\nmodule.exports.Shader = registerShader('shadow', {\n schema: {\n opacity: {default: 0.5},\n transparent: {default: true},\n alphaToCoverage: {default: true}\n },\n\n /**\n * Initializes the shader.\n * Adds a reference from the scene to this entity as the camera.\n */\n init: function (data) {\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.material = new THREE.ShadowMaterial();\n },\n\n update: function (data) {\n this.material.opacity = data.opacity;\n this.material.alphaToCoverage = data.alphaToCoverage;\n this.material.transparent = data.transparent;\n }\n});\n\n",
  426. "var registerShader = require('../core/shader').registerShader;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\n\nvar CubeLoader = new THREE.CubeTextureLoader();\nvar texturePromises = {};\n\n/**\n * Standard (physically-based) shader using THREE.MeshStandardMaterial.\n */\nmodule.exports.Shader = registerShader('standard', {\n schema: {\n ambientOcclusionMap: {type: 'map'},\n ambientOcclusionMapIntensity: {default: 1},\n ambientOcclusionTextureOffset: {type: 'vec2'},\n ambientOcclusionTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n color: {type: 'color'},\n\n displacementMap: {type: 'map'},\n displacementScale: {default: 1},\n displacementBias: {default: 0.5},\n displacementTextureOffset: {type: 'vec2'},\n displacementTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n emissive: {type: 'color', default: '#000'},\n emissiveIntensity: {default: 1},\n envMap: {default: ''},\n\n fog: {default: true},\n height: {default: 256},\n\n metalness: {default: 0.0, min: 0.0, max: 1.0},\n metalnessMap: {type: 'map'},\n metalnessTextureOffset: {type: 'vec2'},\n metalnessTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n normalMap: {type: 'map'},\n normalScale: {type: 'vec2', default: {x: 1, y: 1}},\n normalTextureOffset: {type: 'vec2'},\n normalTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n offset: {type: 'vec2', default: {x: 0, y: 0}},\n repeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n roughness: {default: 0.5, min: 0.0, max: 1.0},\n roughnessMap: {type: 'map'},\n roughnessTextureOffset: {type: 'vec2'},\n roughnessTextureRepeat: {type: 'vec2', default: {x: 1, y: 1}},\n\n sphericalEnvMap: {type: 'map'},\n src: {type: 'map'},\n width: {default: 512},\n wireframe: {default: false},\n wireframeLinewidth: {default: 2}\n },\n\n /**\n * Initializes the shader.\n * Adds a reference from the scene to this entity as the camera.\n */\n init: function (data) {\n this.rendererSystem = this.el.sceneEl.systems.renderer;\n this.materialData = {color: new THREE.Color(), emissive: new THREE.Color()};\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n this.rendererSystem.applyColorCorrection(this.materialData.emissive);\n this.material = new THREE.MeshStandardMaterial(this.materialData);\n\n utils.material.updateMap(this, data);\n if (data.normalMap) { utils.material.updateDistortionMap('normal', this, data); }\n if (data.displacementMap) { utils.material.updateDistortionMap('displacement', this, data); }\n if (data.ambientOcclusionMap) { utils.material.updateDistortionMap('ambientOcclusion', this, data); }\n if (data.metalnessMap) { utils.material.updateDistortionMap('metalness', this, data); }\n if (data.roughnessMap) { utils.material.updateDistortionMap('roughness', this, data); }\n this.updateEnvMap(data);\n },\n\n update: function (data) {\n this.updateMaterial(data);\n utils.material.updateMap(this, data);\n if (data.normalMap) { utils.material.updateDistortionMap('normal', this, data); }\n if (data.displacementMap) { utils.material.updateDistortionMap('displacement', this, data); }\n if (data.ambientOcclusionMap) { utils.material.updateDistortionMap('ambientOcclusion', this, data); }\n if (data.metalnessMap) { utils.material.updateDistortionMap('metalness', this, data); }\n if (data.roughnessMap) { utils.material.updateDistortionMap('roughness', this, data); }\n this.updateEnvMap(data);\n },\n\n /**\n * Updating existing material.\n *\n * @param {object} data - Material component data.\n * @returns {object} Material.\n */\n updateMaterial: function (data) {\n var key;\n var material = this.material;\n getMaterialData(data, this.materialData);\n this.rendererSystem.applyColorCorrection(this.materialData.color);\n this.rendererSystem.applyColorCorrection(this.materialData.emissive);\n for (key in this.materialData) {\n material[key] = this.materialData[key];\n }\n },\n\n /**\n * Handle environment cubemap. Textures are cached in texturePromises.\n */\n updateEnvMap: function (data) {\n var self = this;\n var material = this.material;\n var envMap = data.envMap;\n var sphericalEnvMap = data.sphericalEnvMap;\n\n // No envMap defined or already loading.\n if ((!envMap && !sphericalEnvMap) || this.isLoadingEnvMap) {\n material.envMap = null;\n material.needsUpdate = true;\n return;\n }\n this.isLoadingEnvMap = true;\n\n // if a spherical env map is defined then use it.\n if (sphericalEnvMap) {\n this.el.sceneEl.systems.material.loadTexture(sphericalEnvMap, {src: sphericalEnvMap}, function textureLoaded (texture) {\n self.isLoadingEnvMap = false;\n texture.mapping = THREE.EquirectangularReflectionMapping;\n material.envMap = texture;\n utils.material.handleTextureEvents(self.el, texture);\n material.needsUpdate = true;\n });\n return;\n }\n\n // Another material is already loading this texture. Wait on promise.\n if (texturePromises[envMap]) {\n texturePromises[envMap].then(function (cube) {\n self.isLoadingEnvMap = false;\n material.envMap = cube;\n utils.material.handleTextureEvents(self.el, cube);\n material.needsUpdate = true;\n });\n return;\n }\n\n // Material is first to load this texture. Load and resolve texture.\n texturePromises[envMap] = new Promise(function (resolve) {\n utils.srcLoader.validateCubemapSrc(envMap, function loadEnvMap (urls) {\n CubeLoader.load(urls, function (cube) {\n // Texture loaded.\n self.isLoadingEnvMap = false;\n material.envMap = cube;\n utils.material.handleTextureEvents(self.el, cube);\n resolve(cube);\n });\n });\n });\n }\n});\n\n/**\n * Builds and normalize material data, normalizing stuff along the way.\n *\n * @param {object} data - Material data.\n * @param {object} materialData - Object to use.\n * @returns {object} Updated materialData.\n */\nfunction getMaterialData (data, materialData) {\n materialData.color.set(data.color);\n materialData.emissive.set(data.emissive);\n materialData.emissiveIntensity = data.emissiveIntensity;\n materialData.fog = data.fog;\n materialData.metalness = data.metalness;\n materialData.roughness = data.roughness;\n materialData.wireframe = data.wireframe;\n materialData.wireframeLinewidth = data.wireframeLinewidth;\n\n if (data.normalMap) { materialData.normalScale = data.normalScale; }\n\n if (data.ambientOcclusionMap) {\n materialData.aoMapIntensity = data.ambientOcclusionMapIntensity;\n }\n\n if (data.displacementMap) {\n materialData.displacementScale = data.displacementScale;\n materialData.displacementBias = data.displacementBias;\n }\n\n return materialData;\n}\n",
  427. "var css = \"html.a-fullscreen{bottom:0;left:0;position:fixed;right:0;top:0}html.a-fullscreen body{height:100%;margin:0;overflow:hidden;padding:0;width:100%}html.a-fullscreen .a-canvas{width:100%!important;height:100%!important;top:0!important;left:0!important;right:0!important;bottom:0!important;position:fixed!important}html:not(.a-fullscreen) .a-enter-ar,html:not(.a-fullscreen) .a-enter-vr{right:5px;bottom:5px}:-webkit-full-screen{background-color:transparent}.a-hidden{display:none!important}.a-canvas{height:100%;left:0;position:absolute;top:0;width:100%}.a-canvas.a-grab-cursor:hover{cursor:grab;cursor:-moz-grab;cursor:-webkit-grab}canvas.a-canvas.a-mouse-cursor-hover:hover{cursor:pointer}.a-inspector-loader{background-color:#ed3160;position:fixed;left:3px;top:3px;padding:6px 10px;color:#fff;text-decoration:none;font-size:12px;font-family:Roboto,sans-serif;text-align:center;z-index:99999;width:204px}@keyframes dots-1{from{opacity:0}25%{opacity:1}}@keyframes dots-2{from{opacity:0}50%{opacity:1}}@keyframes dots-3{from{opacity:0}75%{opacity:1}}@-webkit-keyframes dots-1{from{opacity:0}25%{opacity:1}}@-webkit-keyframes dots-2{from{opacity:0}50%{opacity:1}}@-webkit-keyframes dots-3{from{opacity:0}75%{opacity:1}}.a-inspector-loader .dots span{animation:dots-1 2s infinite steps(1);-webkit-animation:dots-1 2s infinite steps(1)}.a-inspector-loader .dots span:first-child+span{animation-name:dots-2;-webkit-animation-name:dots-2}.a-inspector-loader .dots span:first-child+span+span{animation-name:dots-3;-webkit-animation-name:dots-3}a-scene{display:block;position:relative;height:100%;width:100%}a-assets,a-scene audio,a-scene img,a-scene video{display:none}.a-enter-vr-modal,.a-orientation-modal{font-family:Consolas,Andale Mono,Courier New,monospace}.a-enter-vr-modal a{border-bottom:1px solid #fff;padding:2px 0;text-decoration:none;transition:.1s color ease-in}.a-enter-vr-modal a:hover{background-color:#fff;color:#111;padding:2px 4px;position:relative;left:-4px}.a-enter-ar,.a-enter-vr{font-family:sans-serif,monospace;font-size:13px;width:100%;font-weight:200;line-height:16px;position:absolute;right:20px;bottom:20px}.a-enter-ar{right:80px}.a-enter-vr-button,.a-enter-vr-modal,.a-enter-vr-modal a{color:#fff;user-select:none;outline:0}.a-enter-vr-button{background:url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='108' height='62' viewBox='0 0 108 62'%3E%3Ctitle%3Eaframe-vrmode-noborder-reduced-tracking%3C/title%3E%3Cpath d='M68.81,21.56H64.23v8.27h4.58a4.13,4.13,0,0,0,3.1-1.09,4.2,4.2,0,0,0,1-3,4.24,4.24,0,0,0-1-3A4.05,4.05,0,0,0,68.81,21.56Z' fill='%23fff'/%3E%3Cpath d='M96,0H12A12,12,0,0,0,0,12V50A12,12,0,0,0,12,62H96a12,12,0,0,0,12-12V12A12,12,0,0,0,96,0ZM41.9,46H34L24,16h8l6,21.84,6-21.84H52Zm39.29,0H73.44L68.15,35.39H64.23V46H57V16H68.81q5.32,0,8.34,2.37a8,8,0,0,1,3,6.69,9.68,9.68,0,0,1-1.27,5.18,8.9,8.9,0,0,1-4,3.34l6.26,12.11Z' fill='%23fff'/%3E%3C/svg%3E\\\") 50% 50% no-repeat rgba(0,0,0,.35)}.a-enter-ar-button{background:url(\\\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='108' height='62' viewBox='0 0 108 62'%3E%3Ctitle%3Eaframe-armode-noborder-reduced-tracking%3C/title%3E%3Cpath d='M96,0H12A12,12,0,0,0,0,12V50A12,12,0,0,0,12,62H96a12,12,0,0,0,12-12V12A12,12,0,0,0,96,0Zm8,50a8,8,0,0,1-8,8H12a8,8,0,0,1-8-8V12a8,8,0,0,1,8-8H96a8,8,0,0,1,8,8Z' fill='%23fff'/%3E%3Cpath d='M43.35,39.82H32.51L30.45,46H23.88L35,16h5.73L52,46H45.43Zm-9.17-5h7.5L37.91,23.58Z' fill='%23fff'/%3E%3Cpath d='M68.11,35H63.18V46H57V16H68.15q5.31,0,8.2,2.37a8.18,8.18,0,0,1,2.88,6.7,9.22,9.22,0,0,1-1.33,5.12,9.09,9.09,0,0,1-4,3.26l6.49,12.26V46H73.73Zm-4.93-5h5a5.09,5.09,0,0,0,3.6-1.18,4.21,4.21,0,0,0,1.28-3.27,4.56,4.56,0,0,0-1.2-3.34A5,5,0,0,0,68.15,21h-5Z' fill='%23fff'/%3E%3C/svg%3E\\\") 50% 50% no-repeat rgba(0,0,0,.2)}.a-enter-ar-button,.a-enter-vr-button{background-size:90% 90%;border:0;bottom:0;cursor:pointer;min-width:58px;min-height:34px;padding-right:0;padding-top:0;position:absolute;right:0;transition:background-color .05s ease;-webkit-transition:background-color .05s ease;z-index:9999;border-radius:8px;touch-action:manipulation}.a-enter-ar-button{background-size:100% 90%;margin-right:10px;border-radius:7px}.a-enter-ar-button:active,.a-enter-ar-button:hover,.a-enter-vr-button:active,.a-enter-vr-button:hover{background-color:#ef2d5e}.a-enter-vr-button.resethover{background-color:rgba(0,0,0,.35)}[data-a-enter-vr-no-webvr] .a-enter-vr-button{border-color:#666;opacity:.65}[data-a-enter-vr-no-webvr] .a-enter-vr-button:active,[data-a-enter-vr-no-webvr] .a-enter-vr-button:hover{background-color:rgba(0,0,0,.35);cursor:not-allowed}.a-enter-vr-modal{background-color:#666;border-radius:0;display:none;min-height:32px;margin-right:70px;padding:9px;width:280px;right:2%;position:absolute}.a-enter-vr-modal:after{border-bottom:10px solid transparent;border-left:10px solid #666;border-top:10px solid transparent;display:inline-block;content:'';position:absolute;right:-5px;top:5px;width:0;height:0}.a-enter-vr-modal a,.a-enter-vr-modal p{display:inline}.a-enter-vr-modal p{margin:0}.a-enter-vr-modal p:after{content:' '}[data-a-enter-vr-no-headset].a-enter-vr:hover .a-enter-vr-modal,[data-a-enter-vr-no-webvr].a-enter-vr:hover .a-enter-vr-modal{display:block}.a-orientation-modal{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2090%2090%22%20enable-background%3D%22new%200%200%2090%2090%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpolygon%20points%3D%220%2C0%200%2C0%200%2C0%20%22%3E%3C/polygon%3E%3Cg%3E%3Cpath%20d%3D%22M71.545%2C48.145h-31.98V20.743c0-2.627-2.138-4.765-4.765-4.765H18.456c-2.628%2C0-4.767%2C2.138-4.767%2C4.765v42.789%20%20%20c0%2C2.628%2C2.138%2C4.766%2C4.767%2C4.766h5.535v0.959c0%2C2.628%2C2.138%2C4.765%2C4.766%2C4.765h42.788c2.628%2C0%2C4.766-2.137%2C4.766-4.765V52.914%20%20%20C76.311%2C50.284%2C74.173%2C48.145%2C71.545%2C48.145z%20M18.455%2C16.935h16.344c2.1%2C0%2C3.808%2C1.708%2C3.808%2C3.808v27.401H37.25V22.636%20%20%20c0-0.264-0.215-0.478-0.479-0.478H16.482c-0.264%2C0-0.479%2C0.214-0.479%2C0.478v36.585c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h7.507v7.644%20%20%20h-5.534c-2.101%2C0-3.81-1.709-3.81-3.81V20.743C14.645%2C18.643%2C16.354%2C16.935%2C18.455%2C16.935z%20M16.96%2C23.116h19.331v25.031h-7.535%20%20%20c-2.628%2C0-4.766%2C2.139-4.766%2C4.768v5.828h-7.03V23.116z%20M71.545%2C73.064H28.757c-2.101%2C0-3.81-1.708-3.81-3.808V52.914%20%20%20c0-2.102%2C1.709-3.812%2C3.81-3.812h42.788c2.1%2C0%2C3.809%2C1.71%2C3.809%2C3.812v16.343C75.354%2C71.356%2C73.645%2C73.064%2C71.545%2C73.064z%22%3E%3C/path%3E%3Cpath%20d%3D%22M28.919%2C58.424c-1.466%2C0-2.659%2C1.193-2.659%2C2.66c0%2C1.466%2C1.193%2C2.658%2C2.659%2C2.658c1.468%2C0%2C2.662-1.192%2C2.662-2.658%20%20%20C31.581%2C59.617%2C30.387%2C58.424%2C28.919%2C58.424z%20M28.919%2C62.786c-0.939%2C0-1.703-0.764-1.703-1.702c0-0.939%2C0.764-1.704%2C1.703-1.704%20%20%20c0.94%2C0%2C1.705%2C0.765%2C1.705%2C1.704C30.623%2C62.022%2C29.858%2C62.786%2C28.919%2C62.786z%22%3E%3C/path%3E%3Cpath%20d%3D%22M69.654%2C50.461H33.069c-0.264%2C0-0.479%2C0.215-0.479%2C0.479v20.288c0%2C0.264%2C0.215%2C0.478%2C0.479%2C0.478h36.585%20%20%20c0.263%2C0%2C0.477-0.214%2C0.477-0.478V50.939C70.131%2C50.676%2C69.917%2C50.461%2C69.654%2C50.461z%20M69.174%2C51.417V70.75H33.548V51.417H69.174z%22%3E%3C/path%3E%3Cpath%20d%3D%22M45.201%2C30.296c6.651%2C0%2C12.233%2C5.351%2C12.551%2C11.977l-3.033-2.638c-0.193-0.165-0.507-0.142-0.675%2C0.048%20%20%20c-0.174%2C0.198-0.153%2C0.501%2C0.045%2C0.676l3.883%2C3.375c0.09%2C0.075%2C0.198%2C0.115%2C0.312%2C0.115c0.141%2C0%2C0.273-0.061%2C0.362-0.166%20%20%20l3.371-3.877c0.173-0.2%2C0.151-0.502-0.047-0.675c-0.194-0.166-0.508-0.144-0.676%2C0.048l-2.592%2C2.979%20%20%20c-0.18-3.417-1.629-6.605-4.099-9.001c-2.538-2.461-5.877-3.817-9.404-3.817c-0.264%2C0-0.479%2C0.215-0.479%2C0.479%20%20%20C44.72%2C30.083%2C44.936%2C30.296%2C45.201%2C30.296z%22%3E%3C/path%3E%3C/g%3E%3C/svg%3E) center/50% 50% no-repeat rgba(244,244,244,1);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-orientation-modal:after{color:#666;content:\\\"Insert phone into Cardboard holder.\\\";display:block;position:absolute;text-align:center;top:70%;transform:translateY(-70%);width:100%}.a-orientation-modal button{background:url(data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20xmlns%3Axlink%3D%22http%3A//www.w3.org/1999/xlink%22%20version%3D%221.1%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%20100%20100%22%20enable-background%3D%22new%200%200%20100%20100%22%20xml%3Aspace%3D%22preserve%22%3E%3Cpath%20fill%3D%22%23000000%22%20d%3D%22M55.209%2C50l17.803-17.803c1.416-1.416%2C1.416-3.713%2C0-5.129c-1.416-1.417-3.713-1.417-5.129%2C0L50.08%2C44.872%20%20L32.278%2C27.069c-1.416-1.417-3.714-1.417-5.129%2C0c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129L44.951%2C50L27.149%2C67.803%20%20c-1.417%2C1.416-1.417%2C3.713%2C0%2C5.129c0.708%2C0.708%2C1.636%2C1.062%2C2.564%2C1.062c0.928%2C0%2C1.856-0.354%2C2.564-1.062L50.08%2C55.13l17.803%2C17.802%20%20c0.708%2C0.708%2C1.637%2C1.062%2C2.564%2C1.062s1.856-0.354%2C2.564-1.062c1.416-1.416%2C1.416-3.713%2C0-5.129L55.209%2C50z%22%3E%3C/path%3E%3C/svg%3E) no-repeat;border:none;height:50px;text-indent:-9999px;width:50px}.a-loader-title{background-color:rgba(0,0,0,.6);font-family:sans-serif,monospace;text-align:center;font-size:20px;height:50px;font-weight:300;line-height:50px;position:absolute;right:0;left:0;top:0;color:#fff}.a-modal{background:0 0/50% 50% rgba(0,0,0,.6);bottom:0;font-size:14px;font-weight:600;left:0;line-height:20px;right:0;position:fixed;top:0;z-index:9999999}.a-dialog{position:relative;left:50%;top:50%;transform:translate(-50%,-50%);z-index:199995;width:300px;height:200px;background-size:contain;background-color:#fff;font-family:sans-serif,monospace;font-size:20px;border-radius:3px;padding:6px}.a-dialog-text-container{width:100%;height:70%;align-self:flex-start;display:flex;justify-content:center;align-content:center;flex-direction:column}.a-dialog-text{display:inline-block;font-weight:400;font-size:14pt;margin:8px}.a-dialog-buttons-container{display:inline-flex;align-self:flex-end;width:100%;height:30%}.a-dialog-button{cursor:pointer;align-self:center;opacity:.9;height:80%;width:50%;font-size:12pt;margin:4px;border-radius:2px;text-align:center;border:none;display:inline-block;-webkit-transition:all .25s ease-in-out;transition:all .25s ease-in-out;box-shadow:0 1px 3px rgba(0,0,0,.1),0 1px 2px rgba(0,0,0,.2);user-select:none}.a-dialog-permission-button:hover{box-shadow:0 7px 14px rgba(0,0,0,.2),0 2px 2px rgba(0,0,0,.2)}.a-dialog-allow-button{background-color:#00ceff}.a-dialog-deny-button{background-color:#ff005b}.a-dialog-ok-button{background-color:#00ceff;width:100%}.a-dom-overlay:not(.a-no-style){overflow:hidden;position:absolute;pointer-events:none;box-sizing:border-box;bottom:0;left:0;right:0;top:0;padding:1em}.a-dom-overlay:not(.a-no-style)>*{pointer-events:auto}\"; (require(\"browserify-css\").createStyle(css, { \"href\": \"src/style/aframe.css\"})); module.exports = css;",
  428. "var css = \".rs-base{background-color:#333;color:#fafafa;border-radius:0;font:10px monospace;left:5px;line-height:1em;opacity:.85;overflow:hidden;padding:10px;position:fixed;top:5px;width:300px;z-index:10000}.rs-base div.hidden{display:none}.rs-base h1{color:#fff;cursor:pointer;font-size:1.4em;font-weight:300;margin:0 0 5px;padding:0}.rs-group{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-direction:column-reverse;flex-direction:column-reverse;margin-bottom:5px}.rs-group:last-child{margin-bottom:0}.rs-counter-base{align-items:center;display:-webkit-box;display:-webkit-flex;display:flex;height:10px;-webkit-justify-content:space-between;justify-content:space-between;margin:2px 0}.rs-counter-base.alarm{color:#b70000;text-shadow:0 0 0 #b70000,0 0 1px #fff,0 0 1px #fff,0 0 2px #fff,0 0 2px #fff,0 0 3px #fff,0 0 3px #fff,0 0 4px #fff,0 0 4px #fff}.rs-counter-id{font-weight:300;-webkit-box-ordinal-group:0;-webkit-order:0;order:0;width:54px}.rs-counter-value{font-weight:300;-webkit-box-ordinal-group:1;-webkit-order:1;order:1;text-align:right;width:35px}.rs-canvas{-webkit-box-ordinal-group:2;-webkit-order:2;order:2}@media (min-width:480px){.rs-base{left:20px;top:20px}}\"; (require(\"browserify-css\").createStyle(css, { \"href\": \"src/style/rStats.css\"})); module.exports = css;",
  429. "var constants = require('../constants/');\nvar registerSystem = require('../core/system').registerSystem;\n\nvar DEFAULT_CAMERA_ATTR = 'data-aframe-default-camera';\n\n/**\n * Camera system. Manages which camera is active among multiple cameras in scene.\n *\n * @member {object} activeCameraEl - Active camera entity.\n */\nmodule.exports.System = registerSystem('camera', {\n init: function () {\n this.activeCameraEl = null;\n\n this.render = this.render.bind(this);\n this.unwrapRender = this.unwrapRender.bind(this);\n this.wrapRender = this.wrapRender.bind(this);\n\n this.initialCameraFound = false;\n this.numUserCameras = 0;\n this.numUserCamerasChecked = 0;\n this.setupInitialCamera();\n },\n\n /**\n * Setup initial camera, either searching for camera or\n * creating a default camera if user has not added one during the initial scene traversal.\n * We want sceneEl.camera to be ready, set, and initialized before the rest of the scene\n * loads.\n *\n * Default camera offset height is at average eye level (~1.6m).\n */\n setupInitialCamera: function () {\n var cameraEls;\n var i;\n var sceneEl = this.sceneEl;\n var self = this;\n\n // Camera already defined or the one defined it is an spectator one.\n if (sceneEl.camera && !sceneEl.camera.el.getAttribute('camera').spectator) {\n sceneEl.emit('cameraready', {cameraEl: sceneEl.camera.el});\n return;\n }\n\n // Search for initial user-defined camera.\n cameraEls = sceneEl.querySelectorAll('a-camera, [camera]');\n\n // No user cameras, create default one.\n if (!cameraEls.length) {\n this.createDefaultCamera();\n return;\n }\n\n this.numUserCameras = cameraEls.length;\n for (i = 0; i < cameraEls.length; i++) {\n cameraEls[i].addEventListener('object3dset', function (evt) {\n if (evt.detail.type !== 'camera') { return; }\n self.checkUserCamera(this);\n });\n\n // Load camera and wait for camera to initialize.\n if (cameraEls[i].isNode) {\n cameraEls[i].load();\n } else {\n cameraEls[i].addEventListener('nodeready', function () {\n this.load();\n });\n }\n }\n },\n\n /**\n * Check if a user-defined camera entity is appropriate to be initial camera.\n * (active + non-spectator).\n *\n * Keep track of the number of cameras we checked and whether we found one.\n */\n checkUserCamera: function (cameraEl) {\n var cameraData;\n var sceneEl = this.el.sceneEl;\n this.numUserCamerasChecked++;\n\n // Already found one.\n if (this.initialCameraFound) { return; }\n\n // Check if camera is appropriate for being the initial camera.\n cameraData = cameraEl.getAttribute('camera');\n if (!cameraData.active || cameraData.spectator) {\n // No user cameras eligible, create default camera.\n if (this.numUserCamerasChecked === this.numUserCameras) {\n this.createDefaultCamera();\n }\n return;\n }\n\n this.initialCameraFound = true;\n sceneEl.camera = cameraEl.getObject3D('camera');\n sceneEl.emit('cameraready', {cameraEl: cameraEl});\n },\n\n createDefaultCamera: function () {\n var defaultCameraEl;\n var sceneEl = this.sceneEl;\n\n // Set up default camera.\n defaultCameraEl = document.createElement('a-entity');\n defaultCameraEl.setAttribute('camera', {active: true});\n defaultCameraEl.setAttribute('position', {\n x: 0,\n y: constants.DEFAULT_CAMERA_HEIGHT,\n z: 0\n });\n defaultCameraEl.setAttribute('wasd-controls', '');\n defaultCameraEl.setAttribute('look-controls', '');\n defaultCameraEl.setAttribute(constants.AFRAME_INJECTED, '');\n\n defaultCameraEl.addEventListener('object3dset', function (evt) {\n if (evt.detail.type !== 'camera') { return; }\n sceneEl.camera = evt.detail.object;\n sceneEl.emit('cameraready', {cameraEl: defaultCameraEl});\n });\n\n sceneEl.appendChild(defaultCameraEl);\n },\n\n /**\n * Set a different active camera.\n * When we choose a (sort of) random scene camera as the replacement, set its `active` to\n * true. The camera component will call `setActiveCamera` and handle passing the torch to\n * the new camera.\n */\n disableActiveCamera: function () {\n var cameraEls;\n var newActiveCameraEl;\n cameraEls = this.sceneEl.querySelectorAll('[camera]');\n newActiveCameraEl = cameraEls[cameraEls.length - 1];\n newActiveCameraEl.setAttribute('camera', 'active', true);\n },\n\n /**\n * Set active camera to be used by renderer.\n * Removes the default camera (if present).\n * Disables all other cameras in the scene.\n *\n * @param {Element} newCameraEl - Entity with camera component.\n */\n setActiveCamera: function (newCameraEl) {\n var cameraEl;\n var cameraEls;\n var i;\n var newCamera;\n var previousCamera = this.activeCameraEl;\n var sceneEl = this.sceneEl;\n\n // Same camera.\n newCamera = newCameraEl.getObject3D('camera');\n if (!newCamera || newCameraEl === this.activeCameraEl) { return; }\n\n // Grab the default camera.\n var defaultCameraWrapper = sceneEl.querySelector('[' + DEFAULT_CAMERA_ATTR + ']');\n var defaultCameraEl = defaultCameraWrapper &&\n defaultCameraWrapper.querySelector('[camera]');\n\n // Remove default camera if new camera is not the default camera.\n if (newCameraEl !== defaultCameraEl) { removeDefaultCamera(sceneEl); }\n\n // Make new camera active.\n this.activeCameraEl = newCameraEl;\n this.activeCameraEl.play();\n sceneEl.camera = newCamera;\n\n // Disable current camera\n if (previousCamera) {\n previousCamera.setAttribute('camera', 'active', false);\n }\n\n // Disable other cameras in the scene\n cameraEls = sceneEl.querySelectorAll('[camera]');\n for (i = 0; i < cameraEls.length; i++) {\n cameraEl = cameraEls[i];\n if (!cameraEl.isEntity || newCameraEl === cameraEl) { continue; }\n cameraEl.setAttribute('camera', 'active', false);\n cameraEl.pause();\n }\n sceneEl.emit('camera-set-active', {cameraEl: newCameraEl});\n },\n\n /**\n * Set spectator camera to render the scene on a 2D display.\n *\n * @param {Element} newCameraEl - Entity with camera component.\n */\n setSpectatorCamera: function (newCameraEl) {\n var newCamera;\n var previousCamera = this.spectatorCameraEl;\n var sceneEl = this.sceneEl;\n var spectatorCameraEl;\n\n // Same camera.\n newCamera = newCameraEl.getObject3D('camera');\n if (!newCamera || newCameraEl === this.spectatorCameraEl) { return; }\n\n // Disable current camera\n if (previousCamera) {\n previousCamera.setAttribute('camera', 'spectator', false);\n }\n\n spectatorCameraEl = this.spectatorCameraEl = newCameraEl;\n\n sceneEl.addEventListener('enter-vr', this.wrapRender);\n sceneEl.addEventListener('exit-vr', this.unwrapRender);\n\n spectatorCameraEl.setAttribute('camera', 'active', false);\n spectatorCameraEl.play();\n\n sceneEl.emit('camera-set-spectator', {cameraEl: newCameraEl});\n },\n\n /**\n * Disables current spectator camera.\n */\n disableSpectatorCamera: function () {\n this.spectatorCameraEl = undefined;\n },\n\n /**\n * Wrap the render method of the renderer to render\n * the spectator camera after vrDisplay.submitFrame.\n */\n wrapRender: function () {\n if (!this.spectatorCameraEl || this.originalRender) { return; }\n this.originalRender = this.sceneEl.renderer.render;\n this.sceneEl.renderer.render = this.render;\n },\n\n unwrapRender: function () {\n if (!this.originalRender) { return; }\n this.sceneEl.renderer.render = this.originalRender;\n this.originalRender = undefined;\n },\n\n render: function (scene, camera) {\n var isVREnabled;\n var sceneEl = this.sceneEl;\n var spectatorCamera;\n\n isVREnabled = sceneEl.renderer.xr.enabled;\n this.originalRender.call(sceneEl.renderer, scene, camera);\n if (!this.spectatorCameraEl || sceneEl.isMobile || !isVREnabled) { return; }\n spectatorCamera = this.spectatorCameraEl.components.camera.camera;\n sceneEl.renderer.xr.enabled = false;\n this.originalRender.call(sceneEl.renderer, scene, spectatorCamera);\n sceneEl.renderer.xr.enabled = isVREnabled;\n }\n});\n\n/**\n * Remove injected default camera from scene, if present.\n *\n * @param {Element} sceneEl\n */\nfunction removeDefaultCamera (sceneEl) {\n var defaultCamera;\n var camera = sceneEl.camera;\n if (!camera) { return; }\n\n // Remove default camera if present.\n defaultCamera = sceneEl.querySelector('[' + DEFAULT_CAMERA_ATTR + ']');\n if (!defaultCamera) { return; }\n sceneEl.removeChild(defaultCamera);\n}\n",
  430. "var geometries = require('../core/geometry').geometries;\nvar registerSystem = require('../core/system').registerSystem;\n\n/**\n * System for geometry component.\n * Handle geometry caching.\n *\n * @member {object} cache - Mapping of stringified component data to THREE.BufferGeometry objects.\n * @member {object} cacheCount - Keep track of number of entities using a geometry to\n * know whether to dispose on removal.\n */\nmodule.exports.System = registerSystem('geometry', {\n init: function () {\n this.cache = {};\n this.cacheCount = {};\n },\n\n /**\n * Reset cache. Mainly for testing.\n */\n clearCache: function () {\n this.cache = {};\n this.cacheCount = {};\n },\n\n /**\n * Attempt to retrieve from cache.\n *\n * @returns {Object|null} A geometry if it exists, else null.\n */\n getOrCreateGeometry: function (data) {\n var cache = this.cache;\n var cachedGeometry;\n var hash;\n\n // Skip all caching logic.\n if (data.skipCache) { return createGeometry(data); }\n\n // Try to retrieve from cache first.\n hash = this.hash(data);\n cachedGeometry = cache[hash];\n incrementCacheCount(this.cacheCount, hash);\n\n if (cachedGeometry) { return cachedGeometry; }\n\n // Create geometry.\n cachedGeometry = createGeometry(data);\n\n // Cache and return geometry.\n cache[hash] = cachedGeometry;\n return cachedGeometry;\n },\n\n /**\n * Let system know that an entity is no longer using a geometry.\n */\n unuseGeometry: function (data) {\n var cache = this.cache;\n var cacheCount = this.cacheCount;\n var geometry;\n var hash;\n\n if (data.skipCache) { return; }\n\n hash = this.hash(data);\n\n if (!cache[hash]) { return; }\n\n decrementCacheCount(cacheCount, hash);\n\n // Another entity is still using this geometry. No need to do anything.\n if (cacheCount[hash] > 0) { return; }\n\n // No more entities are using this geometry. Dispose.\n geometry = cache[hash];\n geometry.dispose();\n delete cache[hash];\n delete cacheCount[hash];\n },\n\n /**\n * Use JSON.stringify to turn component data into hash.\n * Should be deterministic within a single browser engine.\n * If not, then look into json-stable-stringify.\n */\n hash: function (data) {\n return JSON.stringify(data);\n }\n});\n\n/**\n * Create geometry using component data.\n *\n * @param {object} data - Component data.\n * @returns {object} Geometry.\n */\nfunction createGeometry (data) {\n var geometryType = data.primitive;\n var GeometryClass = geometries[geometryType] && geometries[geometryType].Geometry;\n var geometryInstance = new GeometryClass();\n\n if (!GeometryClass) { throw new Error('Unknown geometry `' + geometryType + '`'); }\n\n geometryInstance.init(data);\n return geometryInstance.geometry;\n}\n\n/**\n * Decreate count of entity using a geometry.\n */\nfunction decrementCacheCount (cacheCount, hash) {\n cacheCount[hash]--;\n}\n\n/**\n * Increase count of entity using a geometry.\n */\nfunction incrementCacheCount (cacheCount, hash) {\n cacheCount[hash] = cacheCount[hash] === undefined ? 1 : cacheCount[hash] + 1;\n}\n",
  431. "var registerSystem = require('../core/system').registerSystem;\nvar THREE = require('../lib/three');\n\nfunction fetchScript (src) {\n return new Promise(function (resolve, reject) {\n var script = document.createElement('script');\n document.body.appendChild(script);\n script.onload = resolve;\n script.onerror = reject;\n script.async = true;\n script.src = src;\n });\n}\n\n/**\n * glTF model system.\n *\n * Configures glTF loading options. Models using glTF compression require that a Draco decoder be\n * provided externally.\n *\n * @param {string} dracoDecoderPath - Base path from which to load Draco decoder library.\n * @param {string} meshoptDecoderPath - Full path from which to load Meshopt decoder.\n */\nmodule.exports.System = registerSystem('gltf-model', {\n schema: {\n dracoDecoderPath: {default: ''},\n meshoptDecoderPath: {default: ''}\n },\n\n init: function () {\n this.update();\n },\n\n update: function () {\n var dracoDecoderPath = this.data.dracoDecoderPath;\n var meshoptDecoderPath = this.data.meshoptDecoderPath;\n if (!this.dracoLoader && dracoDecoderPath) {\n this.dracoLoader = new THREE.DRACOLoader();\n this.dracoLoader.setDecoderPath(dracoDecoderPath);\n }\n if (!this.meshoptDecoder && meshoptDecoderPath) {\n this.meshoptDecoder = fetchScript(meshoptDecoderPath)\n .then(function () { return window.MeshoptDecoder.ready; })\n .then(function () { return window.MeshoptDecoder; });\n }\n },\n\n getDRACOLoader: function () {\n return this.dracoLoader;\n },\n\n getMeshoptDecoder: function () {\n return this.meshoptDecoder;\n }\n});\n",
  432. "require('./camera');\nrequire('./geometry');\nrequire('./gltf-model');\nrequire('./light');\nrequire('./material');\nrequire('./renderer');\nrequire('./shadow');\nrequire('./tracked-controls-webvr');\nrequire('./tracked-controls-webxr');\nrequire('./webxr');\n",
  433. "var registerSystem = require('../core/system').registerSystem;\nvar bind = require('../utils/bind');\nvar constants = require('../constants/');\n\nvar DEFAULT_LIGHT_ATTR = 'data-aframe-default-light';\n\n/**\n * Light system.\n *\n * Prescribes default lighting if not specified (one ambient, one directional).\n * Removes default lighting from the scene when a new light is added.\n *\n * @param {bool} defaultLights - Whether default lighting are defined.\n * @param {bool} userDefinedLights - Whether user lighting is defined.\n */\nmodule.exports.System = registerSystem('light', {\n schema: {\n defaultLightsEnabled: {default: true}\n },\n\n init: function () {\n this.defaultLights = false;\n this.userDefinedLights = false;\n // Wait for all entities to fully load before checking for existence of lights.\n // Since entities wait for <a-assets> to load, any lights attaching to the scene\n // will do so asynchronously.\n this.sceneEl.addEventListener('loaded', bind(this.setupDefaultLights, this));\n },\n\n /**\n * Notify scene that light has been added and to remove the default.\n *\n * @param {object} el - element holding the light component.\n */\n registerLight: function (el) {\n if (!el.hasAttribute(DEFAULT_LIGHT_ATTR)) {\n // User added a light, remove default lights through DOM.\n this.removeDefaultLights();\n this.userDefinedLights = true;\n }\n },\n\n removeDefaultLights: function () {\n var defaultLights;\n var sceneEl = this.sceneEl;\n\n if (!this.defaultLights) { return; }\n defaultLights = document.querySelectorAll('[' + DEFAULT_LIGHT_ATTR + ']');\n for (var i = 0; i < defaultLights.length; i++) {\n sceneEl.removeChild(defaultLights[i]);\n }\n this.defaultLights = false;\n },\n\n /**\n * Prescibe default lights to the scene.\n * Does so by injecting markup such that this state is not invisible.\n * These lights are removed if the user adds any lights.\n */\n setupDefaultLights: function () {\n var sceneEl = this.sceneEl;\n var ambientLight;\n var directionalLight;\n\n if (this.userDefinedLights || this.defaultLights || !this.data.defaultLightsEnabled) {\n return;\n }\n\n ambientLight = document.createElement('a-entity');\n ambientLight.setAttribute('light', {color: '#BBB', type: 'ambient'});\n ambientLight.setAttribute(DEFAULT_LIGHT_ATTR, '');\n ambientLight.setAttribute(constants.AFRAME_INJECTED, '');\n sceneEl.appendChild(ambientLight);\n\n directionalLight = document.createElement('a-entity');\n directionalLight.setAttribute('light', {color: '#FFF', intensity: 0.6, castShadow: true});\n directionalLight.setAttribute('position', {x: -0.5, y: 1, z: 1});\n directionalLight.setAttribute(DEFAULT_LIGHT_ATTR, '');\n directionalLight.setAttribute(constants.AFRAME_INJECTED, '');\n sceneEl.appendChild(directionalLight);\n\n this.defaultLights = true;\n }\n});\n",
  434. "var registerSystem = require('../core/system').registerSystem;\nvar THREE = require('../lib/three');\nvar utils = require('../utils/');\nvar isHLS = require('../utils/material').isHLS;\nvar setTextureProperties = require('../utils/material').setTextureProperties;\n\nvar bind = utils.bind;\nvar debug = utils.debug;\nvar error = debug('components:texture:error');\nvar TextureLoader = new THREE.TextureLoader();\nvar warn = debug('components:texture:warn');\n\nTextureLoader.setCrossOrigin('anonymous');\n\n/**\n * System for material component.\n * Handle material registration, updates (for fog), and texture caching.\n *\n * @member {object} materials - Registered materials.\n * @member {object} textureCounts - Number of times each texture is used. Tracked\n * separately from textureCache, because the cache (1) is populated in\n * multiple places, and (2) may be cleared at any time.\n * @member {object} textureCache - Texture cache for:\n * - Images: textureCache has mapping of src -> repeat -> cached three.js texture.\n * - Videos: textureCache has mapping of videoElement -> cached three.js texture.\n */\nmodule.exports.System = registerSystem('material', {\n init: function () {\n this.materials = {};\n this.textureCounts = {};\n this.textureCache = {};\n\n this.sceneEl.addEventListener(\n 'materialtextureloaded',\n bind(this.onMaterialTextureLoaded, this)\n );\n },\n\n clearTextureCache: function () {\n this.textureCache = {};\n },\n\n /**\n * Determine whether `src` is a image or video. Then try to load the asset, then call back.\n *\n * @param {string, or element} src - Texture URL or element.\n * @param {string} data - Relevant texture data used for caching.\n * @param {function} cb - Callback to pass texture to.\n */\n loadTexture: function (src, data, cb) {\n var self = this;\n\n // Canvas.\n if (src.tagName === 'CANVAS') {\n this.loadCanvas(src, data, cb);\n return;\n }\n\n // Video element.\n if (src.tagName === 'VIDEO') {\n if (!src.src && !src.srcObject && !src.childElementCount) {\n warn('Video element was defined with neither `source` elements nor `src` / `srcObject` attributes.');\n }\n this.loadVideo(src, data, cb);\n return;\n }\n\n utils.srcLoader.validateSrc(src, loadImageCb, loadVideoCb);\n function loadImageCb (src) { self.loadImage(src, data, cb); }\n function loadVideoCb (src) { self.loadVideo(src, data, cb); }\n },\n\n /**\n * High-level function for loading image textures (THREE.Texture).\n *\n * @param {Element|string} src - Texture source.\n * @param {object} data - Texture data.\n * @param {function} cb - Callback to pass texture to.\n */\n loadImage: function (src, data, handleImageTextureLoaded) {\n var hash = this.hash(data);\n var textureCache = this.textureCache;\n\n // Texture already being loaded or already loaded. Wait on promise.\n if (textureCache[hash]) {\n textureCache[hash].then(handleImageTextureLoaded);\n return;\n }\n\n // Texture not yet being loaded. Start loading it.\n textureCache[hash] = loadImageTexture(src, data);\n textureCache[hash].then(handleImageTextureLoaded);\n },\n\n /**\n * High-level function for loading canvas textures (THREE.Texture).\n *\n * @param {Element|string} src - Texture source.\n * @param {object} data - Texture data.\n * @param {function} cb - Callback to pass texture to.\n */\n loadCanvas: function (src, data, cb) {\n var texture;\n texture = new THREE.CanvasTexture(src);\n setTextureProperties(texture, data);\n cb(texture);\n },\n\n /**\n * Load video texture (THREE.VideoTexture).\n * Which is just an image texture that RAFs + needsUpdate.\n * Note that creating a video texture is synchronous unlike loading an image texture.\n * Made asynchronous to be consistent with image textures.\n *\n * @param {Element|string} src - Texture source.\n * @param {object} data - Texture data.\n * @param {function} cb - Callback to pass texture to.\n */\n loadVideo: function (src, data, cb) {\n var hash;\n var texture;\n var textureCache = this.textureCache;\n var videoEl;\n var videoTextureResult;\n\n function handleVideoTextureLoaded (result) {\n result.texture.needsUpdate = true;\n cb(result.texture, result.videoEl);\n }\n\n // Video element provided.\n if (typeof src !== 'string') {\n // Check cache before creating texture.\n videoEl = src;\n hash = this.hashVideo(data, videoEl);\n if (textureCache[hash]) {\n textureCache[hash].then(handleVideoTextureLoaded);\n return;\n }\n // If not in cache, fix up the attributes then start to create the texture.\n fixVideoAttributes(videoEl);\n }\n\n // Only URL provided. Use video element to create texture.\n videoEl = videoEl || createVideoEl(src, data.width, data.height);\n\n // Generated video element already cached. Use that.\n hash = this.hashVideo(data, videoEl);\n if (textureCache[hash]) {\n textureCache[hash].then(handleVideoTextureLoaded);\n return;\n }\n\n // Create new video texture.\n texture = new THREE.VideoTexture(videoEl);\n texture.minFilter = THREE.LinearFilter;\n setTextureProperties(texture, data);\n\n // If iOS and video is HLS, do some hacks.\n if (this.sceneEl.isIOS &&\n isHLS(videoEl.src || videoEl.getAttribute('src'),\n videoEl.type || videoEl.getAttribute('type'))) {\n // Actually BGRA. Tell shader to correct later.\n texture.format = THREE.RGBAFormat;\n texture.needsCorrectionBGRA = true;\n // Apparently needed for HLS. Tell shader to correct later.\n texture.flipY = false;\n texture.needsCorrectionFlipY = true;\n }\n\n // Cache as promise to be consistent with image texture caching.\n videoTextureResult = {texture: texture, videoEl: videoEl};\n textureCache[hash] = Promise.resolve(videoTextureResult);\n handleVideoTextureLoaded(videoTextureResult);\n },\n\n /**\n * Create a hash of the material properties for texture cache key.\n */\n hash: function (data) {\n if (data.src.tagName) {\n // Since `data.src` can be an element, parse out the string if necessary for the hash.\n data = utils.extendDeep({}, data);\n data.src = data.src.src;\n }\n return JSON.stringify(data);\n },\n\n hashVideo: function (data, videoEl) {\n return calculateVideoCacheHash(data, videoEl);\n },\n\n /**\n * Keep track of material in case an update trigger is needed (e.g., fog).\n *\n * @param {object} material\n */\n registerMaterial: function (material) {\n this.materials[material.uuid] = material;\n },\n\n /**\n * Stop tracking material, and dispose of any textures not being used by\n * another material component.\n *\n * @param {object} material\n */\n unregisterMaterial: function (material) {\n delete this.materials[material.uuid];\n\n // If any textures on this material are no longer in use, dispose of them.\n var textureCounts = this.textureCounts;\n Object.keys(material)\n .filter(function (propName) {\n return material[propName] && material[propName].isTexture;\n })\n .forEach(function (mapName) {\n textureCounts[material[mapName].uuid]--;\n if (textureCounts[material[mapName].uuid] <= 0) {\n material[mapName].dispose();\n }\n });\n },\n\n /**\n * Trigger update to all registered materials.\n */\n updateMaterials: function (material) {\n var materials = this.materials;\n Object.keys(materials).forEach(function (uuid) {\n materials[uuid].needsUpdate = true;\n });\n },\n\n /**\n * Track textures used by material components, so that they can be safely\n * disposed when no longer in use. Textures must be registered here, and not\n * through registerMaterial(), because textures may not be attached at the\n * time the material is registered.\n *\n * @param {Event} e\n */\n onMaterialTextureLoaded: function (e) {\n if (!this.textureCounts[e.detail.texture.uuid]) {\n this.textureCounts[e.detail.texture.uuid] = 0;\n }\n this.textureCounts[e.detail.texture.uuid]++;\n }\n});\n\n/**\n * Calculates consistent hash from a video element using its attributes.\n * If the video element has an ID, use that.\n * Else build a hash that looks like `src:myvideo.mp4;height:200;width:400;`.\n *\n * @param data {object} - Texture data such as repeat.\n * @param videoEl {Element} - Video element.\n * @returns {string}\n */\nfunction calculateVideoCacheHash (data, videoEl) {\n var i;\n var id = videoEl.getAttribute('id');\n var hash;\n var videoAttributes;\n\n if (id) { return id; }\n\n // Calculate hash using sorted video attributes.\n hash = '';\n videoAttributes = data || {};\n for (i = 0; i < videoEl.attributes.length; i++) {\n videoAttributes[videoEl.attributes[i].name] = videoEl.attributes[i].value;\n }\n Object.keys(videoAttributes).sort().forEach(function (name) {\n hash += name + ':' + videoAttributes[name] + ';';\n });\n\n return hash;\n}\n\n/**\n * Load image texture.\n *\n * @private\n * @param {string|object} src - An <img> element or url to an image file.\n * @param {object} data - Data to set texture properties like `repeat`.\n * @returns {Promise} Resolves once texture is loaded.\n */\nfunction loadImageTexture (src, data) {\n return new Promise(doLoadImageTexture);\n\n function doLoadImageTexture (resolve, reject) {\n var isEl = typeof src !== 'string';\n\n function resolveTexture (texture) {\n setTextureProperties(texture, data);\n texture.needsUpdate = true;\n resolve(texture);\n }\n\n // Create texture from an element.\n if (isEl) {\n resolveTexture(new THREE.Texture(src));\n return;\n }\n\n // Request and load texture from src string. THREE will create underlying element.\n // Use THREE.TextureLoader (src, onLoad, onProgress, onError) to load texture.\n TextureLoader.load(\n src,\n resolveTexture,\n function () { /* no-op */ },\n function (xhr) {\n error('`$s` could not be fetched (Error code: %s; Response: %s)', xhr.status,\n xhr.statusText);\n }\n );\n }\n}\n\n/**\n * Create video element to be used as a texture.\n *\n * @param {string} src - Url to a video file.\n * @param {number} width - Width of the video.\n * @param {number} height - Height of the video.\n * @returns {Element} Video element.\n */\nfunction createVideoEl (src, width, height) {\n var videoEl = document.createElement('video');\n videoEl.width = width;\n videoEl.height = height;\n // Support inline videos for iOS webviews.\n videoEl.setAttribute('playsinline', '');\n videoEl.setAttribute('webkit-playsinline', '');\n videoEl.autoplay = true;\n videoEl.loop = true;\n videoEl.crossOrigin = 'anonymous';\n videoEl.addEventListener('error', function () {\n warn('`$s` is not a valid video', src);\n }, true);\n videoEl.src = src;\n return videoEl;\n}\n\n/**\n * Fixes a video element's attributes to prevent developers from accidentally passing the\n * wrong attribute values to commonly misused video attributes.\n *\n * <video> does not treat `autoplay`, `controls`, `crossorigin`, `loop`, and `preload` as\n * as booleans. Existence of those attributes will mean truthy.\n *\n * For example, translates <video loop=\"false\"> to <video>.\n *\n * @see https://developer.mozilla.org/docs/Web/HTML/Element/video#Attributes\n * @param {Element} videoEl - Video element.\n * @returns {Element} Video element with the correct properties updated.\n */\nfunction fixVideoAttributes (videoEl) {\n videoEl.autoplay = videoEl.hasAttribute('autoplay') && videoEl.getAttribute('autoplay') !== 'false';\n videoEl.controls = videoEl.hasAttribute('controls') && videoEl.getAttribute('controls') !== 'false';\n if (videoEl.getAttribute('loop') === 'false') {\n videoEl.removeAttribute('loop');\n }\n if (videoEl.getAttribute('preload') === 'false') {\n videoEl.preload = 'none';\n }\n videoEl.crossOrigin = videoEl.crossOrigin || 'anonymous';\n // To support inline videos in iOS webviews.\n videoEl.setAttribute('playsinline', '');\n videoEl.setAttribute('webkit-playsinline', '');\n return videoEl;\n}\n",
  435. "var registerSystem = require('../core/system').registerSystem;\nvar utils = require('../utils/');\nvar THREE = require('../lib/three');\n\nvar debug = utils.debug;\nvar warn = debug('components:renderer:warn');\n\n/**\n * Determines state of various renderer properties.\n */\nmodule.exports.System = registerSystem('renderer', {\n schema: {\n antialias: {default: 'auto', oneOf: ['true', 'false', 'auto']},\n highRefreshRate: {default: utils.device.isOculusBrowser()},\n logarithmicDepthBuffer: {default: 'auto', oneOf: ['true', 'false', 'auto']},\n maxCanvasWidth: {default: 1920},\n maxCanvasHeight: {default: 1920},\n physicallyCorrectLights: {default: false},\n precision: {default: 'high', oneOf: ['high', 'medium', 'low']},\n sortObjects: {default: false},\n colorManagement: {default: false},\n gammaOutput: {default: false},\n alpha: {default: true},\n foveationLevel: {default: 0}\n },\n\n init: function () {\n var data = this.data;\n var sceneEl = this.el;\n // This is the rendering engine, such as THREE.js so copy over any persistent properties from the rendering system.\n var renderer = sceneEl.renderer;\n renderer.sortObjects = data.sortObjects;\n renderer.physicallyCorrectLights = data.physicallyCorrectLights;\n\n if (data.colorManagement || data.gammaOutput) {\n renderer.outputEncoding = THREE.sRGBEncoding;\n if (data.gammaOutput) {\n warn('Property `gammaOutput` is deprecated. Use `renderer=\"colorManagement: true;\"` instead.');\n }\n }\n\n if (sceneEl.hasAttribute('antialias')) {\n warn('Component `antialias` is deprecated. Use `renderer=\"antialias: true\"` instead.');\n }\n\n if (sceneEl.hasAttribute('logarithmicDepthBuffer')) {\n warn('Component `logarithmicDepthBuffer` is deprecated. Use `renderer=\"logarithmicDepthBuffer: true\"` instead.');\n }\n },\n\n applyColorCorrection: function (colorOrTexture) {\n if (!this.data.colorManagement || !colorOrTexture) {\n return;\n } else if (colorOrTexture.isColor) {\n colorOrTexture.convertSRGBToLinear();\n } else if (colorOrTexture.isTexture) {\n colorOrTexture.encoding = THREE.sRGBEncoding;\n }\n }\n});\n",
  436. "var registerSystem = require('../core/system').registerSystem;\nvar THREE = require('../lib/three');\n\nvar SHADOW_MAP_TYPE_MAP = {\n basic: THREE.BasicShadowMap,\n pcf: THREE.PCFShadowMap,\n pcfsoft: THREE.PCFSoftShadowMap\n};\n\n/**\n * Shadow system.\n *\n * Enabled automatically when one or more shadow components are added to the scene, the system sets\n * options on the WebGLRenderer for configuring shadow appearance.\n */\nmodule.exports.System = registerSystem('shadow', {\n schema: {\n enabled: {default: true},\n autoUpdate: {default: true},\n type: {default: 'pcf', oneOf: ['basic', 'pcf', 'pcfsoft']}\n },\n\n init: function () {\n var sceneEl = this.sceneEl;\n var data = this.data;\n\n this.shadowMapEnabled = false;\n\n if (!sceneEl.renderer) { return; } // For tests.\n\n sceneEl.renderer.shadowMap.type = SHADOW_MAP_TYPE_MAP[data.type];\n sceneEl.renderer.shadowMap.autoUpdate = data.autoUpdate;\n this.setShadowMapEnabled(this.shadowMapEnabled);\n },\n\n update: function (prevData) {\n if (prevData.enabled !== this.data.enabled) {\n this.setShadowMapEnabled(this.data.enabled);\n }\n },\n\n /**\n * Enables/disables the renderer shadow map.\n * @param {boolean} enabled\n */\n setShadowMapEnabled: function (enabled) {\n var renderer = this.sceneEl.renderer;\n this.shadowMapEnabled = this.data.enabled && enabled;\n if (renderer) {\n renderer.shadowMap.enabled = this.shadowMapEnabled;\n }\n }\n});\n",
  437. "var registerSystem = require('../core/system').registerSystem;\nvar utils = require('../utils');\nvar isWebXRAvailable = utils.device.isWebXRAvailable;\n\n/**\n * Tracked controls system.\n * Maintain list with available tracked controllers.\n */\nmodule.exports.System = registerSystem('tracked-controls-webvr', {\n init: function () {\n var self = this;\n\n this.controllers = [];\n this.isChrome = navigator.userAgent.indexOf('Chrome') !== -1;\n\n this.updateControllerList();\n this.throttledUpdateControllerList = utils.throttle(this.updateControllerList, 500, this);\n\n // Don't use WebVR if WebXR is available?\n if (isWebXRAvailable) { return; }\n\n if (!navigator.getVRDisplays) { return; }\n\n this.sceneEl.addEventListener('enter-vr', function () {\n navigator.getVRDisplays().then(function (displays) {\n if (displays.length) { self.vrDisplay = displays[0]; }\n });\n });\n },\n\n tick: function () {\n if (this.isChrome) {\n // Retrieve new controller handlers with updated state (pose, buttons...)\n this.updateControllerList();\n } else {\n this.throttledUpdateControllerList();\n }\n },\n\n /**\n * Update controller list.\n */\n updateControllerList: function () {\n var controllers = this.controllers;\n var gamepad;\n var gamepads;\n var i;\n var prevCount;\n\n gamepads = navigator.getGamepads && navigator.getGamepads();\n if (!gamepads) { return; }\n\n prevCount = controllers.length;\n controllers.length = 0;\n for (i = 0; i < gamepads.length; ++i) {\n gamepad = gamepads[i];\n if (gamepad && gamepad.pose) {\n controllers.push(gamepad);\n }\n }\n\n if (controllers.length !== prevCount) {\n this.el.emit('controllersupdated', undefined, false);\n }\n }\n});\n",
  438. "var registerSystem = require('../core/system').registerSystem;\nvar utils = require('../utils');\n\n/**\n * Tracked controls system.\n * Maintain list with available tracked controllers.\n */\nmodule.exports.System = registerSystem('tracked-controls-webxr', {\n init: function () {\n this.controllers = [];\n this.oldControllers = [];\n this.oldControllersLength = 0;\n this.throttledUpdateControllerList = utils.throttle(this.updateControllerList, 500, this);\n this.updateReferenceSpace = this.updateReferenceSpace.bind(this);\n this.el.addEventListener('enter-vr', this.updateReferenceSpace);\n this.el.addEventListener('exit-vr', this.updateReferenceSpace);\n },\n\n tick: function () {\n this.throttledUpdateControllerList();\n },\n\n updateReferenceSpace: function () {\n var self = this;\n var xrSession = this.el.xrSession;\n\n if (!xrSession) {\n this.referenceSpace = undefined;\n this.controllers = [];\n if (this.oldControllersLength > 0) {\n this.oldControllersLength = 0;\n this.el.emit('controllersupdated', undefined, false);\n }\n return;\n }\n var refspace = self.el.sceneEl.systems.webxr.sessionReferenceSpaceType;\n xrSession.requestReferenceSpace(refspace).then(function (referenceSpace) {\n self.referenceSpace = referenceSpace;\n }).catch(function (err) {\n self.el.sceneEl.systems.webxr.warnIfFeatureNotRequested(\n refspace,\n 'tracked-controls-webxr uses reference space \"' + refspace + '\".');\n throw err;\n });\n },\n\n updateControllerList: function () {\n var xrSession = this.el.xrSession;\n var oldControllers = this.oldControllers;\n var i;\n if (!xrSession) {\n if (this.oldControllersLength === 0) { return; }\n // Broadcast that we now have zero controllers connected if there is\n // no session\n this.oldControllersLength = 0;\n this.controllers = [];\n this.el.emit('controllersupdated', undefined, false);\n return;\n }\n\n if (!xrSession.inputSources) { return; }\n this.controllers = xrSession.inputSources;\n if (this.oldControllersLength === this.controllers.length) {\n var equal = true;\n for (i = 0; i < this.controllers.length; ++i) {\n if (this.controllers[i] === oldControllers[i] &&\n this.controllers[i].gamepad === oldControllers[i].gamepad) { continue; }\n equal = false;\n break;\n }\n if (equal) { return; }\n }\n\n // Store reference to current controllers\n oldControllers.length = 0;\n for (i = 0; i < this.controllers.length; i++) {\n oldControllers.push(this.controllers[i]);\n }\n\n this.oldControllersLength = this.controllers.length;\n this.el.emit('controllersupdated', undefined, false);\n }\n});\n",
  439. "var registerSystem = require('../core/system').registerSystem;\n\nvar utils = require('../utils/');\nvar warn = utils.debug('systems:webxr:warn');\n\n/**\n * WebXR session initialization and XR module support.\n */\nmodule.exports.System = registerSystem('webxr', {\n schema: {\n referenceSpaceType: {type: 'string', default: 'local-floor'},\n requiredFeatures: {type: 'array', default: ['local-floor']},\n optionalFeatures: {type: 'array', default: ['bounded-floor']},\n overlayElement: {type: 'selector'}\n },\n\n update: function () {\n var data = this.data;\n this.sessionConfiguration = {\n requiredFeatures: data.requiredFeatures,\n optionalFeatures: data.optionalFeatures\n };\n this.sessionReferenceSpaceType = data.referenceSpaceType;\n\n if (data.overlayElement) {\n // Update WebXR to support light-estimation\n data.overlayElement.classList.remove('a-dom-overlay');\n if (!data.optionalFeatures.includes('dom-overlay')) {\n data.optionalFeatures.push('dom-overlay');\n this.el.setAttribute('webxr', data);\n }\n this.warnIfFeatureNotRequested('dom-overlay');\n this.sessionConfiguration.domOverlay = {root: data.overlayElement};\n data.overlayElement.classList.add('a-dom-overlay');\n }\n },\n\n wasFeatureRequested: function (feature) {\n // Features available by default for immersive sessions don't need to\n // be requested explicitly.\n if (feature === 'viewer' || feature === 'local') { return true; }\n\n if (this.sessionConfiguration.requiredFeatures.includes(feature) ||\n this.sessionConfiguration.optionalFeatures.includes(feature)) {\n return true;\n }\n\n return false;\n },\n\n warnIfFeatureNotRequested: function (feature, optIntro) {\n if (!this.wasFeatureRequested(feature)) {\n var msg = 'Please add the feature \"' + feature + '\" to a-scene\\'s ' +\n 'webxr system options in requiredFeatures/optionalFeatures.';\n warn((optIntro ? optIntro + ' ' : '') + msg);\n }\n }\n});\n",
  440. "/**\n * Faster version of Function.prototype.bind\n * @param {Function} fn - Function to wrap.\n * @param {Object} ctx - What to bind as context.\n * @param {...*} arguments - Arguments to pass through.\n */\nmodule.exports = function bind (fn, ctx/* , arg1, arg2 */) {\n return (function (prependedArgs) {\n return function bound () {\n // Concat the bound function arguments with those passed to original bind\n var args = prependedArgs.concat(Array.prototype.slice.call(arguments, 0));\n return fn.apply(ctx, args);\n };\n })(Array.prototype.slice.call(arguments, 2));\n};\n",
  441. "/* global THREE */\nvar debug = require('./debug');\nvar extend = require('object-assign');\n\nvar warn = debug('utils:coordinates:warn');\n\n// Order of coordinates parsed by coordinates.parse.\nvar COORDINATE_KEYS = ['x', 'y', 'z', 'w'];\n\n// Coordinate string regex. Handles negative, positive, and decimals.\nvar regex = /^\\s*((-?\\d*\\.{0,1}\\d+(e-?\\d+)?)\\s+){2,3}(-?\\d*\\.{0,1}\\d+(e-?\\d+)?)\\s*$/;\nmodule.exports.regex = regex;\n\nvar OBJECT = 'object';\nvar whitespaceRegex = /\\s+/g;\n\n/**\n * Parses coordinates from an \"x y z\" string.\n * Example: \"3 10 -5\" to {x: 3, y: 10, z: -5}.\n *\n * @param {string} val - An \"x y z\" string.\n * @param {string} defaults - fallback value.\n * @returns {object} An object with keys [x, y, z].\n */\nfunction parse (value, defaultVec) {\n var coordinate;\n var defaultVal;\n var key;\n var i;\n var vec;\n var x;\n var y;\n var z;\n var w;\n\n if (value && value instanceof Object) {\n x = value.x === undefined ? defaultVec && defaultVec.x : value.x;\n y = value.y === undefined ? defaultVec && defaultVec.y : value.y;\n z = value.z === undefined ? defaultVec && defaultVec.z : value.z;\n w = value.w === undefined ? defaultVec && defaultVec.w : value.w;\n if (x !== undefined && x !== null) { value.x = parseIfString(x); }\n if (y !== undefined && y !== null) { value.y = parseIfString(y); }\n if (z !== undefined && z !== null) { value.z = parseIfString(z); }\n if (w !== undefined && w !== null) { value.w = parseIfString(w); }\n return value;\n }\n\n if (value === null || value === undefined) {\n return typeof defaultVec === OBJECT ? extend({}, defaultVec) : defaultVec;\n }\n\n coordinate = value.trim().split(whitespaceRegex);\n vec = {};\n for (i = 0; i < COORDINATE_KEYS.length; i++) {\n key = COORDINATE_KEYS[i];\n if (coordinate[i]) {\n vec[key] = parseFloat(coordinate[i], 10);\n } else {\n defaultVal = defaultVec && defaultVec[key];\n if (defaultVal === undefined) { continue; }\n vec[key] = parseIfString(defaultVal);\n }\n }\n return vec;\n}\nmodule.exports.parse = parse;\n\n/**\n * Stringify coordinates from an object with keys [x y z].\n * Example: {x: 3, y: 10, z: -5} to \"3 10 -5\".\n *\n * @param {object|string} data - An object with keys [x y z].\n * @returns {string} An \"x y z\" string.\n */\nfunction stringify (data) {\n var str;\n if (typeof data !== OBJECT) { return data; }\n str = data.x + ' ' + data.y;\n if (data.z != null) { str += ' ' + data.z; }\n if (data.w != null) { str += ' ' + data.w; }\n return str;\n}\nmodule.exports.stringify = stringify;\n\n/**\n * @returns {bool}\n */\nfunction isCoordinates (value) {\n return regex.test(value);\n}\nmodule.exports.isCoordinates = isCoordinates;\n\nmodule.exports.isCoordinate = function (value) {\n warn('`AFRAME.utils.isCoordinate` has been renamed to `AFRAME.utils.isCoordinates`');\n return isCoordinates(value);\n};\n\nfunction parseIfString (val) {\n if (val !== null && val !== undefined && val.constructor === String) {\n return parseFloat(val, 10);\n }\n return val;\n}\n\n/**\n * Convert {x, y, z} object to three.js Vector3.\n */\nmodule.exports.toVector3 = function (vec3) {\n return new THREE.Vector3(vec3.x, vec3.y, vec3.z);\n};\n",
  442. "var debugLib = require('debug');\nvar extend = require('object-assign');\n\nvar settings = {\n colors: {\n debug: 'gray',\n error: 'red',\n info: 'gray',\n warn: 'orange'\n }\n};\n\n/**\n * Monkeypatches `debug` so we can colorize error/warning messages.\n *\n * (See issue: https://github.com/visionmedia/debug/issues/137)\n */\nvar debug = function (namespace) {\n var d = debugLib(namespace);\n\n d.color = getDebugNamespaceColor(namespace);\n\n return d;\n};\nextend(debug, debugLib);\n\n/**\n * Returns the type of the namespace (e.g., `error`, `warn`).\n *\n * @param {String} namespace\n * The debug logger's namespace (e.g., `components:geometry:warn`).\n * @returns {String} The type of the namespace (e.g., `warn`).\n * @api private\n */\nfunction getDebugNamespaceType (namespace) {\n var chunks = namespace.split(':');\n\n return chunks[chunks.length - 1]; // Return the last one\n}\n\n/**\n * Returns the color of the namespace (e.g., `orange`).\n *\n * @param {String} namespace\n * The debug logger's namespace (e.g., `components:geometry:warn`).\n * @returns {String} The color of the namespace (e.g., `orange`).\n * @api private\n */\nfunction getDebugNamespaceColor (namespace) {\n var type = getDebugNamespaceType(namespace);\n\n var color = settings.colors && settings.colors[type];\n\n return color || null;\n}\n\n/**\n * Returns `localStorage` if possible.\n *\n * This is necessary because Safari throws when a user disables\n * cookies or `localStorage` and you attempt to access it.\n *\n * @returns {localStorage}\n * @api private\n */\nfunction storage () {\n try {\n return window.localStorage;\n } catch (e) {\n }\n}\n\n/**\n * To enable console logging, type this in the Console of your Dev Tools:\n *\n * localStorage.logs = 1\n *\n * To disable console logging:\n *\n * localStorage.logs = 0\n *\n */\nvar ls = storage();\nif (ls && (parseInt(ls.logs, 10) || ls.logs === 'true')) {\n debug.enable('*');\n} else {\n debug.enable('*:error,*:info,*:warn');\n}\n\nif (process.browser) { window.logs = debug; }\n\nmodule.exports = debug;\n",
  443. "var error = require('debug')('device:error');\n\nvar vrDisplay;\nvar supportsVRSession = false;\nvar supportsARSession = false;\n\n/**\n * Oculus Browser 7 doesn't support the WebXR gamepads module.\n * We fallback to WebVR API and will hotfix when implementation is complete.\n */\nvar isWebXRAvailable = module.exports.isWebXRAvailable = !window.debug && navigator.xr !== undefined;\n\n// Catch vrdisplayactivate early to ensure we can enter VR mode after the scene loads.\nwindow.addEventListener('vrdisplayactivate', function (evt) {\n var canvasEl;\n // WebXR takes priority if available.\n if (isWebXRAvailable) { return; }\n canvasEl = document.createElement('canvas');\n vrDisplay = evt.display;\n // We need to make sure the canvas has a WebGL context associated with it.\n // Otherwise, the requestPresent could be denied.\n canvasEl.getContext('webgl', {});\n // Request present immediately. a-scene will be allowed to enter VR without user gesture.\n vrDisplay.requestPresent([{source: canvasEl}]).then(function () {}, function () {});\n});\n\n// Support both WebVR and WebXR APIs.\nif (isWebXRAvailable) {\n var updateEnterInterfaces = function () {\n var sceneEl = document.querySelector('a-scene');\n if (!sceneEl) {\n window.addEventListener('DOMContentLoaded', updateEnterInterfaces);\n return;\n }\n if (sceneEl.hasLoaded) {\n sceneEl.components['vr-mode-ui'].updateEnterInterfaces();\n } else {\n sceneEl.addEventListener('loaded', updateEnterInterfaces);\n }\n };\n var errorHandler = function (err) {\n error('WebXR session support error: ' + err.message);\n };\n if (navigator.xr.isSessionSupported) {\n // Current WebXR spec uses a boolean-returning isSessionSupported promise\n navigator.xr.isSessionSupported('immersive-vr').then(function (supported) {\n supportsVRSession = supported;\n updateEnterInterfaces();\n }).catch(errorHandler);\n\n navigator.xr.isSessionSupported('immersive-ar').then(function (supported) {\n supportsARSession = supported;\n updateEnterInterfaces();\n }).catch(function () {});\n } else if (navigator.xr.supportsSession) {\n // Fallback for implementations that haven't updated to the new spec yet,\n // the old version used supportsSession which is rejected for missing\n // support.\n navigator.xr.supportsSession('immersive-vr').then(function () {\n supportsVRSession = true;\n updateEnterInterfaces();\n }).catch(errorHandler);\n navigator.xr.supportsSession('immersive-ar').then(function () {\n supportsARSession = true;\n updateEnterInterfaces();\n }).catch(function () {});\n } else {\n error('WebXR has neither isSessionSupported or supportsSession?!');\n }\n} else {\n if (navigator.getVRDisplays) {\n navigator.getVRDisplays().then(function (displays) {\n var sceneEl = document.querySelector('a-scene');\n vrDisplay = displays.length && displays[0];\n if (sceneEl) { sceneEl.emit('displayconnected', {vrDisplay: vrDisplay}); }\n });\n }\n}\n\nfunction getVRDisplay () { return vrDisplay; }\nmodule.exports.getVRDisplay = getVRDisplay;\n\n/**\n * Determine if a headset is connected by checking if a vrDisplay is available.\n */\nfunction checkHeadsetConnected () {\n return supportsVRSession || supportsARSession || !!getVRDisplay();\n}\nmodule.exports.checkHeadsetConnected = checkHeadsetConnected;\n\nfunction checkARSupport () { return supportsARSession; }\nmodule.exports.checkARSupport = checkARSupport;\n\n/**\n * Checks if browser is mobile and not stand-alone dedicated vr device.\n * @return {Boolean} True if mobile browser detected.\n */\nvar isMobile = (function () {\n var _isMobile = false;\n (function (a) {\n // eslint-disable-next-line no-useless-escape\n if (/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0, 4))) {\n _isMobile = true;\n }\n if (isIOS() || isTablet() || isR7()) {\n _isMobile = true;\n }\n if (isMobileVR()) {\n _isMobile = false;\n }\n })(window.navigator.userAgent || window.navigator.vendor || window.opera);\n\n return function () { return _isMobile; };\n})();\nmodule.exports.isMobile = isMobile;\n\n/**\n * Detect tablet devices.\n * @param {string} mockUserAgent - Allow passing a mock user agent for testing.\n */\nfunction isTablet (mockUserAgent) {\n var userAgent = mockUserAgent || window.navigator.userAgent;\n return /ipad|Nexus (7|9)|xoom|sch-i800|playbook|tablet|kindle/i.test(userAgent);\n}\nmodule.exports.isTablet = isTablet;\n\nfunction isIOS () {\n return /iPad|iPhone|iPod/.test(window.navigator.platform);\n}\nmodule.exports.isIOS = isIOS;\n\nfunction isMobileDeviceRequestingDesktopSite () {\n return !isMobile() && !isMobileVR() && window.orientation !== undefined;\n}\nmodule.exports.isMobileDeviceRequestingDesktopSite = isMobileDeviceRequestingDesktopSite;\n\n/**\n * Detect Oculus Browser (standalone headset)\n */\nfunction isOculusBrowser () {\n return /(OculusBrowser)/i.test(window.navigator.userAgent);\n}\nmodule.exports.isOculusBrowser = isOculusBrowser;\n\n/**\n * Detect Firefox Reality (standalone headset)\n */\nfunction isFirefoxReality () {\n return /(Mobile VR)/i.test(window.navigator.userAgent);\n}\nmodule.exports.isFirefoxReality = isFirefoxReality;\n\n/**\n * Detect browsers in Stand-Alone headsets\n */\nfunction isMobileVR () {\n return isOculusBrowser() || isFirefoxReality();\n}\nmodule.exports.isMobileVR = isMobileVR;\n\nfunction isR7 () {\n return /R7 Build/.test(window.navigator.userAgent);\n}\nmodule.exports.isR7 = isR7;\n\n/**\n * Checks mobile device orientation.\n * @return {Boolean} True if landscape orientation.\n */\nmodule.exports.isLandscape = function () {\n var orientation = window.orientation;\n if (isR7()) { orientation += 90; }\n return orientation === 90 || orientation === -90;\n};\n\n/**\n * Check if running in a browser or spoofed browser (bundler).\n * We need to check a node api that isn't mocked on either side.\n * `require` and `module.exports` are mocked in browser by bundlers.\n * `window` is mocked in node.\n * `process` is also mocked by browserify, but has custom properties.\n */\nmodule.exports.isBrowserEnvironment = !!(!process || process.browser);\n\n/**\n * Check if running in node on the server.\n */\nmodule.exports.isNodeEnvironment = !module.exports.isBrowserEnvironment;\n",
  444. "/**\n * Split a delimited component property string (e.g., `material.color`) to an object\n * containing `component` name and `property` name. If there is no delimiter, just return the\n * string back.\n *\n * Cache arrays from splitting strings via delimiter to save on memory.\n *\n * @param {string} str - e.g., `material.opacity`.\n * @param {string} delimiter - e.g., `.`.\n * @returns {array} e.g., `['material', 'opacity']`.\n */\nvar propertyPathCache = {};\nfunction getComponentPropertyPath (str, delimiter) {\n delimiter = delimiter || '.';\n if (!propertyPathCache[delimiter]) { propertyPathCache[delimiter] = {}; }\n if (str.indexOf(delimiter) !== -1) {\n propertyPathCache[delimiter][str] = str.split(delimiter);\n } else {\n propertyPathCache[delimiter][str] = str;\n }\n return propertyPathCache[delimiter][str];\n}\nmodule.exports.getComponentPropertyPath = getComponentPropertyPath;\nmodule.exports.propertyPathCache = propertyPathCache;\n\n/**\n * Get component property using encoded component name + component property name with a\n * delimiter.\n */\nmodule.exports.getComponentProperty = function (el, name, delimiter) {\n var splitName;\n delimiter = delimiter || '.';\n if (name.indexOf(delimiter) !== -1) {\n splitName = getComponentPropertyPath(name, delimiter);\n if (splitName.constructor === String) {\n return el.getAttribute(splitName);\n }\n return el.getAttribute(splitName[0])[splitName[1]];\n }\n return el.getAttribute(name);\n};\n\n/**\n * Set component property using encoded component name + component property name with a\n * delimiter.\n */\nmodule.exports.setComponentProperty = function (el, name, value, delimiter) {\n var splitName;\n delimiter = delimiter || '.';\n if (name.indexOf(delimiter) !== -1) {\n splitName = getComponentPropertyPath(name, delimiter);\n if (splitName.constructor === String) {\n el.setAttribute(splitName, value);\n } else {\n el.setAttribute(splitName[0], splitName[1], value);\n }\n return;\n }\n el.setAttribute(name, value);\n};\n",
  445. "module.exports = function forceCanvasResizeSafariMobile (canvasEl) {\n var width = canvasEl.style.width;\n var height = canvasEl.style.height;\n // Taken from webvr-polyfill (https://github.com/borismus/webvr-polyfill/blob/85f657cd502ec9417bf26b87c3cb2afa6a70e079/src/util.js#L200)\n // iOS only workaround for https://bugs.webkit.org/show_bug.cgi?id=152556\n // By changing the size 1 pixel and restoring the previous value\n // we trigger a size recalculation cycle.\n canvasEl.style.width = (parseInt(width, 10) + 1) + 'px';\n canvasEl.style.height = (parseInt(height, 10) + 1) + 'px';\n setTimeout(function () {\n canvasEl.style.width = width;\n canvasEl.style.height = height;\n }, 200);\n};\n",
  446. "/* global location */\n\n/* Centralized place to reference utilities since utils is exposed to the user. */\nvar debug = require('./debug');\nvar deepAssign = require('deep-assign');\nvar device = require('./device');\nvar objectAssign = require('object-assign');\nvar objectPool = require('./object-pool');\n\nvar warn = debug('utils:warn');\n\nmodule.exports.bind = require('./bind');\nmodule.exports.coordinates = require('./coordinates');\nmodule.exports.debug = debug;\nmodule.exports.device = device;\nmodule.exports.entity = require('./entity');\nmodule.exports.forceCanvasResizeSafariMobile = require('./forceCanvasResizeSafariMobile');\nmodule.exports.isIE11 = require('./is-ie11');\nmodule.exports.material = require('./material');\nmodule.exports.objectPool = objectPool;\nmodule.exports.split = require('./split').split;\nmodule.exports.styleParser = require('./styleParser');\nmodule.exports.trackedControls = require('./tracked-controls');\n\nmodule.exports.checkHeadsetConnected = function () {\n warn('`utils.checkHeadsetConnected` has moved to `utils.device.checkHeadsetConnected`');\n return device.checkHeadsetConnected(arguments);\n};\nmodule.exports.isGearVR = module.exports.device.isGearVR = function () {\n warn('`utils.isGearVR` has been deprecated, use `utils.device.isMobileVR`');\n};\nmodule.exports.isIOS = function () {\n warn('`utils.isIOS` has moved to `utils.device.isIOS`');\n return device.isIOS(arguments);\n};\nmodule.exports.isOculusGo = module.exports.device.isOculusGo = function () {\n warn('`utils.isOculusGo` has been deprecated, use `utils.device.isMobileVR`');\n};\nmodule.exports.isMobile = function () {\n warn('`utils.isMobile has moved to `utils.device.isMobile`');\n return device.isMobile(arguments);\n};\n\n/**\n * Returns throttle function that gets called at most once every interval.\n *\n * @param {function} functionToThrottle\n * @param {number} minimumInterval - Minimal interval between calls (milliseconds).\n * @param {object} optionalContext - If given, bind function to throttle to this context.\n * @returns {function} Throttled function.\n */\nmodule.exports.throttle = function (functionToThrottle, minimumInterval, optionalContext) {\n var lastTime;\n if (optionalContext) {\n functionToThrottle = module.exports.bind(functionToThrottle, optionalContext);\n }\n return function () {\n var time = Date.now();\n var sinceLastTime = typeof lastTime === 'undefined' ? minimumInterval : time - lastTime;\n if (typeof lastTime === 'undefined' || (sinceLastTime >= minimumInterval)) {\n lastTime = time;\n functionToThrottle.apply(null, arguments);\n }\n };\n};\n\n/**\n * Returns throttle function that gets called at most once every interval.\n * Uses the time/timeDelta timestamps provided by the global render loop for better perf.\n *\n * @param {function} functionToThrottle\n * @param {number} minimumInterval - Minimal interval between calls (milliseconds).\n * @param {object} optionalContext - If given, bind function to throttle to this context.\n * @returns {function} Throttled function.\n */\nmodule.exports.throttleTick = function (functionToThrottle, minimumInterval, optionalContext) {\n var lastTime;\n if (optionalContext) {\n functionToThrottle = module.exports.bind(functionToThrottle, optionalContext);\n }\n return function (time, delta) {\n var sinceLastTime = typeof lastTime === 'undefined' ? delta : time - lastTime;\n if (typeof lastTime === 'undefined' || (sinceLastTime >= minimumInterval)) {\n lastTime = time;\n functionToThrottle(time, sinceLastTime);\n }\n };\n};\n\n/**\n * Returns debounce function that gets called only once after a set of repeated calls.\n *\n * @param {function} functionToDebounce\n * @param {number} wait - Time to wait for repeated function calls (milliseconds).\n * @param {boolean} immediate - Calls the function immediately regardless of if it should be waiting.\n * @returns {function} Debounced function.\n */\nmodule.exports.debounce = function (func, wait, immediate) {\n var timeout;\n return function () {\n var context = this;\n var args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\n\n/**\n * Mix the properties of source object(s) into a destination object.\n *\n * @param {object} dest - The object to which properties will be copied.\n * @param {...object} source - The object(s) from which properties will be copied.\n */\nmodule.exports.extend = objectAssign;\nmodule.exports.extendDeep = deepAssign;\n\nmodule.exports.clone = function (obj) {\n return JSON.parse(JSON.stringify(obj));\n};\n\n/**\n * Checks if two values are equal.\n * Includes objects and arrays and nested objects and arrays.\n * Try to keep this function performant as it will be called often to see if a component\n * should be updated.\n *\n * @param {object} a - First object.\n * @param {object} b - Second object.\n * @returns {boolean} Whether two objects are deeply equal.\n */\nvar deepEqual = (function () {\n var arrayPool = objectPool.createPool(function () { return []; });\n\n return function (a, b) {\n var key;\n var keysA;\n var keysB;\n var i;\n var valA;\n var valB;\n\n // If not objects or arrays, compare as values.\n if (a === undefined || b === undefined || a === null || b === null ||\n !(a && b && (a.constructor === Object && b.constructor === Object) ||\n (a.constructor === Array && b.constructor === Array))) {\n return a === b;\n }\n\n // Different number of keys, not equal.\n keysA = arrayPool.use();\n keysB = arrayPool.use();\n keysA.length = 0;\n keysB.length = 0;\n for (key in a) { keysA.push(key); }\n for (key in b) { keysB.push(key); }\n if (keysA.length !== keysB.length) {\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return false;\n }\n\n // Return `false` at the first sign of inequality.\n for (i = 0; i < keysA.length; ++i) {\n valA = a[keysA[i]];\n valB = b[keysA[i]];\n // Check nested array and object.\n if ((typeof valA === 'object' || typeof valB === 'object') ||\n (Array.isArray(valA) && Array.isArray(valB))) {\n if (valA === valB) { continue; }\n if (!deepEqual(valA, valB)) {\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return false;\n }\n } else if (valA !== valB) {\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return false;\n }\n }\n\n arrayPool.recycle(keysA);\n arrayPool.recycle(keysB);\n return true;\n };\n})();\nmodule.exports.deepEqual = deepEqual;\n\n/**\n * Computes the difference between two objects.\n *\n * @param {object} a - First object to compare (e.g., oldData).\n * @param {object} b - Second object to compare (e.g., newData).\n * @returns {object}\n * Difference object where set of keys note which values were not equal, and values are\n * `b`'s values.\n */\nmodule.exports.diff = (function () {\n var keys = [];\n\n return function (a, b, targetObject) {\n var aVal;\n var bVal;\n var bKey;\n var diff;\n var key;\n var i;\n var isComparingObjects;\n\n diff = targetObject || {};\n\n // Collect A keys.\n keys.length = 0;\n for (key in a) { keys.push(key); }\n\n if (!b) { return diff; }\n\n // Collect B keys.\n for (bKey in b) {\n if (keys.indexOf(bKey) === -1) {\n keys.push(bKey);\n }\n }\n\n for (i = 0; i < keys.length; i++) {\n key = keys[i];\n aVal = a[key];\n bVal = b[key];\n isComparingObjects = aVal && bVal &&\n aVal.constructor === Object && bVal.constructor === Object;\n if ((isComparingObjects && !deepEqual(aVal, bVal)) ||\n (!isComparingObjects && aVal !== bVal)) {\n diff[key] = bVal;\n }\n }\n return diff;\n };\n})();\n\n/**\n * Returns whether we should capture this keyboard event for keyboard shortcuts.\n * @param {Event} event Event object.\n * @returns {Boolean} Whether the key event should be captured.\n */\nmodule.exports.shouldCaptureKeyEvent = function (event) {\n if (event.metaKey) { return false; }\n return document.activeElement === document.body;\n};\n\n/**\n * Splits a string into an array based on a delimiter.\n *\n * @param {string=} [str=''] Source string\n * @param {string=} [delimiter=' '] Delimiter to use\n * @returns {array} Array of delimited strings\n */\nmodule.exports.splitString = function (str, delimiter) {\n if (typeof delimiter === 'undefined') { delimiter = ' '; }\n // First collapse the whitespace (or whatever the delimiter is).\n var regex = new RegExp(delimiter, 'g');\n str = (str || '').replace(regex, delimiter);\n // Then split.\n return str.split(delimiter);\n};\n\n/**\n * Extracts data from the element given an object that contains expected keys.\n *\n * @param {Element} Source element.\n * @param {Object} [defaults={}] Object of default key-value pairs.\n * @returns {Object}\n */\nmodule.exports.getElData = function (el, defaults) {\n defaults = defaults || {};\n var data = {};\n Object.keys(defaults).forEach(copyAttribute);\n function copyAttribute (key) {\n if (el.hasAttribute(key)) {\n data[key] = el.getAttribute(key);\n }\n }\n return data;\n};\n\n/**\n * Retrieves querystring value.\n * @param {String} name Name of querystring key.\n * @return {String} Value\n */\nmodule.exports.getUrlParameter = function (name) {\n // eslint-disable-next-line no-useless-escape\n name = name.replace(/[\\[]/, '\\\\[').replace(/[\\]]/, '\\\\]');\n var regex = new RegExp('[\\\\?&]' + name + '=([^&#]*)');\n var results = regex.exec(location.search);\n return results === null ? '' : decodeURIComponent(results[1].replace(/\\+/g, ' '));\n};\n\n/**\n * Detects whether context is within iframe.\n */\nmodule.exports.isIframed = function () {\n return window.top !== window.self;\n};\n\n/**\n * Finds all elements under the element that have the isScene\n * property set to true\n */\nmodule.exports.findAllScenes = function (el) {\n var matchingElements = [];\n var allElements = el.getElementsByTagName('*');\n for (var i = 0, n = allElements.length; i < n; i++) {\n if (allElements[i].isScene) {\n // Element exists with isScene set.\n matchingElements.push(allElements[i]);\n }\n }\n return matchingElements;\n};\n\n// Must be at bottom to avoid circular dependency.\nmodule.exports.srcLoader = require('./src-loader');\n",
  447. "// Safari regression introduced in iOS 12 and remains in iOS 13.\n// https://stackoverflow.com/questions/62717621/white-space-at-page-bottom-after-device-rotation-in-ios-safari\nwindow.addEventListener('orientationchange', function () {\n document.documentElement.style.height = `initial`;\n setTimeout(function () {\n document.documentElement.style.height = `100%`;\n setTimeout(function () {\n // this line prevents the content\n // from hiding behind the address bar\n window.scrollTo(0, 1);\n }, 500);\n }, 500);\n});\n",
  448. "// https://stackoverflow.com/a/17907562\nfunction getInternetExplorerVersion () {\n var version = -1;\n var userAgent = navigator.userAgent;\n var re;\n if (navigator.appName === 'Microsoft Internet Explorer') {\n re = new RegExp('MSIE ([0-9]{1,}[\\\\.0-9]{0,})');\n if (re.exec(userAgent) != null) { version = parseFloat(RegExp.$1); }\n } else if (navigator.appName === 'Netscape') {\n re = new RegExp('Trident/.*rv:([0-9]{1,}[\\\\.0-9]{0,})');\n if (re.exec(userAgent) != null) { version = parseFloat(RegExp.$1); }\n }\n return version;\n}\n\nmodule.exports = getInternetExplorerVersion() === 11;\n",
  449. "/**\n * Check if device is iOS and older than version 10.\n */\nmodule.exports = function isIOSOlderThan10 (userAgent) {\n return /(iphone|ipod|ipad).*os.(7_|8_|9_)/i.test(userAgent);\n};\n",
  450. "var THREE = require('../lib/three');\n\nvar HLS_MIMETYPES = ['application/x-mpegurl', 'application/vnd.apple.mpegurl'];\n\nvar COLOR_MAPS = new Set([\n 'emissiveMap',\n 'envMap',\n 'map',\n 'specularMap'\n]);\n\n/**\n * Set texture properties such as repeat and offset.\n *\n * @param {object} data - With keys like `repeat`.\n*/\nfunction setTextureProperties (texture, data) {\n var offset = data.offset || {x: 0, y: 0};\n var repeat = data.repeat || {x: 1, y: 1};\n var npot = data.npot || false;\n // To support NPOT textures, wrap must be ClampToEdge (not Repeat),\n // and filters must not use mipmaps (i.e. Nearest or Linear).\n if (npot) {\n texture.wrapS = THREE.ClampToEdgeWrapping;\n texture.wrapT = THREE.ClampToEdgeWrapping;\n texture.magFilter = THREE.LinearFilter;\n texture.minFilter = THREE.LinearFilter;\n }\n\n // Don't bother setting repeat if it is 1/1. Power-of-two is required to repeat.\n if (repeat.x !== 1 || repeat.y !== 1) {\n texture.wrapS = THREE.RepeatWrapping;\n texture.wrapT = THREE.RepeatWrapping;\n texture.repeat.set(repeat.x, repeat.y);\n }\n // Don't bother setting offset if it is 0/0.\n if (offset.x !== 0 || offset.y !== 0) {\n texture.offset.set(offset.x, offset.y);\n }\n}\nmodule.exports.setTextureProperties = setTextureProperties;\n\n/**\n * Update `material` texture property (usually but not always `map`)\n * from `data` property (usually but not always `src`)\n *\n * @param {object} shader - A-Frame shader instance.\n * @param {object} data\n */\nmodule.exports.updateMapMaterialFromData = function (materialName, dataName, shader, data) {\n var el = shader.el;\n var material = shader.material;\n var rendererSystem = el.sceneEl.systems.renderer;\n var src = data[dataName];\n\n // Because a single material / shader may have multiple textures,\n // we need to remember the source value for this data property\n // to avoid redundant operations which can be expensive otherwise\n // (e.g. video texture loads).\n if (!shader.materialSrcs) { shader.materialSrcs = {}; }\n\n if (!src) {\n // Forget the prior material src.\n delete shader.materialSrcs[materialName];\n // Remove the texture.\n setMap(null);\n return;\n }\n\n // Don't process if material src hasn't changed.\n if (src === shader.materialSrcs[materialName]) { return; }\n\n // Remember the new src for this texture (there may be multiple).\n shader.materialSrcs[materialName] = src;\n\n // If the new material src is already a texture, just use it.\n if (src instanceof THREE.Texture) { setMap(src); } else {\n // Load texture for the new material src.\n // (And check if we should still use it once available in callback.)\n el.sceneEl.systems.material.loadTexture(src,\n {src: src, repeat: data.repeat, offset: data.offset, npot: data.npot},\n checkSetMap);\n }\n\n function checkSetMap (texture) {\n // If the source has been changed, don't use loaded texture.\n if (shader.materialSrcs[materialName] !== src) { return; }\n setMap(texture);\n }\n\n function setMap (texture) {\n material[materialName] = texture;\n if (texture && COLOR_MAPS.has(materialName)) {\n rendererSystem.applyColorCorrection(texture);\n }\n material.needsUpdate = true;\n handleTextureEvents(el, texture);\n }\n};\n\n/**\n * Update `material.map` given `data.src`. For standard and flat shaders.\n *\n * @param {object} shader - A-Frame shader instance.\n * @param {object} data\n */\nmodule.exports.updateMap = function (shader, data) {\n return module.exports.updateMapMaterialFromData('map', 'src', shader, data);\n};\n\n/**\n * Updates the material's maps which give the illusion of extra geometry.\n *\n * @param {string} longType - The friendly name of the map from the component e.g. ambientOcclusionMap becomes aoMap in THREE.js\n * @param {object} shader - A-Frame shader instance\n * @param {object} data\n */\nmodule.exports.updateDistortionMap = function (longType, shader, data) {\n var shortType = longType;\n if (longType === 'ambientOcclusion') { shortType = 'ao'; }\n var el = shader.el;\n var material = shader.material;\n var rendererSystem = el.sceneEl.systems.renderer;\n var src = data[longType + 'Map'];\n var info = {};\n info.src = src;\n\n // Pass through the repeat and offset to be handled by the material loader.\n info.offset = data[longType + 'TextureOffset'];\n info.repeat = data[longType + 'TextureRepeat'];\n info.wrap = data[longType + 'TextureWrap'];\n\n if (src) {\n if (src === shader[longType + 'TextureSrc']) { return; }\n\n // Texture added or changed.\n shader[longType + 'TextureSrc'] = src;\n el.sceneEl.systems.material.loadTexture(src, info, setMap);\n return;\n }\n\n // Texture removed.\n if (!material.map) { return; }\n setMap(null);\n\n function setMap (texture) {\n var slot = shortType + 'Map';\n material[slot] = texture;\n if (texture && COLOR_MAPS.has(slot)) {\n rendererSystem.applyColorCorrection(texture);\n }\n if (texture) {\n setTextureProperties(texture, data);\n }\n material.needsUpdate = true;\n handleTextureEvents(el, texture);\n }\n};\n\n/**\n * Emit event on entities on texture-related events.\n *\n * @param {Element} el - Entity.\n * @param {object} texture - three.js Texture.\n */\nfunction handleTextureEvents (el, texture) {\n if (!texture) { return; }\n\n el.emit('materialtextureloaded', {src: texture.image, texture: texture});\n\n // Video events.\n if (!texture.image || texture.image.tagName !== 'VIDEO') { return; }\n\n texture.image.addEventListener('loadeddata', function emitVideoTextureLoadedDataAll () {\n // Check to see if we need to use iOS 10 HLS shader.\n // Only override the shader if it is stock shader that we know doesn't correct.\n if (!el.components || !el.components.material) { return; }\n\n if (texture.needsCorrectionBGRA && texture.needsCorrectionFlipY &&\n ['standard', 'flat'].indexOf(el.components.material.data.shader) !== -1) {\n el.setAttribute('material', 'shader', 'ios10hls');\n }\n\n el.emit('materialvideoloadeddata', {src: texture.image, texture: texture});\n });\n texture.image.addEventListener('ended', function emitVideoTextureEndedAll () {\n // Works for non-looping videos only.\n el.emit('materialvideoended', {src: texture.image, texture: texture});\n });\n}\nmodule.exports.handleTextureEvents = handleTextureEvents;\n\n/**\n * Given video element src and type, guess whether stream is HLS.\n *\n * @param {string} src - src from video element (generally URL to content).\n * @param {string} type - type from video element (generally MIME type if present).\n */\nmodule.exports.isHLS = function (src, type) {\n if (type && HLS_MIMETYPES.includes(type.toLowerCase())) { return true; }\n if (src && src.toLowerCase().indexOf('.m3u8') > 0) { return true; }\n return false;\n};\n",
  451. "/*\n Adapted deePool by Kyle Simpson.\n MIT License: http://getify.mit-license.org\n*/\nvar EMPTY_SLOT = Object.freeze(Object.create(null));\n\n// Default object factory.\nfunction defaultObjectFactory () { return {}; }\n\n/**\n * Create a new pool.\n */\nmodule.exports.createPool = function createPool (objectFactory) {\n var objPool = [];\n var nextFreeSlot = null; // Pool location to look for a free object to use.\n\n objectFactory = objectFactory || defaultObjectFactory;\n\n function use () {\n var objToUse;\n if (nextFreeSlot === null || nextFreeSlot === objPool.length) {\n grow(objPool.length || 5);\n }\n objToUse = objPool[nextFreeSlot];\n objPool[nextFreeSlot++] = EMPTY_SLOT;\n clearObject(objToUse);\n return objToUse;\n }\n\n function recycle (obj) {\n if (!(obj instanceof Object)) { return; }\n if (nextFreeSlot === null || nextFreeSlot === -1) {\n objPool[objPool.length] = obj;\n return;\n }\n objPool[--nextFreeSlot] = obj;\n }\n\n function grow (count) {\n var currentLength;\n var i;\n\n count = count === undefined ? objPool.length : count;\n if (count > 0 && nextFreeSlot == null) {\n nextFreeSlot = 0;\n }\n\n if (count > 0) {\n currentLength = objPool.length;\n objPool.length += Number(count);\n for (i = currentLength; i < objPool.length; i++) {\n // Add new obj to pool.\n objPool[i] = objectFactory();\n }\n }\n\n return objPool.length;\n }\n\n function size () {\n return objPool.length;\n }\n\n return {\n grow: grow,\n pool: objPool,\n recycle: recycle,\n size: size,\n use: use\n };\n};\n\nfunction clearObject (obj) {\n var key;\n if (!obj || obj.constructor !== Object) { return; }\n for (key in obj) { obj[key] = undefined; }\n}\nmodule.exports.clearObject = clearObject;\n\nfunction removeUnusedKeys (obj, schema) {\n var key;\n if (!obj || obj.constructor !== Object) { return; }\n for (key in obj) {\n if (!(key in schema)) {\n delete obj[key];\n }\n }\n}\nmodule.exports.removeUnusedKeys = removeUnusedKeys;\n",
  452. "/**\n * String split with cached result.\n */\nmodule.exports.split = (function () {\n var splitCache = {};\n\n return function (str, delimiter) {\n if (!(delimiter in splitCache)) { splitCache[delimiter] = {}; }\n\n if (str in splitCache[delimiter]) { return splitCache[delimiter][str]; }\n\n splitCache[delimiter][str] = str.split(delimiter);\n return splitCache[delimiter][str];\n };\n})();\n",
  453. "/* global Image, XMLHttpRequest */\nvar debug = require('./debug');\n\nvar warn = debug('utils:src-loader:warn');\n\n/**\n * Validate a texture, either as a selector or as a URL.\n * Detects whether `src` is pointing to an image or video and invokes the appropriate\n * callback.\n *\n * `src` will be passed into the callback\n *\n * @params {string|Element} src - URL or media element.\n * @params {function} isImageCb - callback if texture is an image.\n * @params {function} isVideoCb - callback if texture is a video.\n */\nfunction validateSrc (src, isImageCb, isVideoCb) {\n checkIsImage(src, function isAnImageUrl (isImage) {\n if (isImage) {\n isImageCb(src);\n return;\n }\n isVideoCb(src);\n });\n}\n\n/**\n * Validates six images as a cubemap, either as selector or comma-separated\n * URLs.\n *\n * @param {string} src - A selector or comma-separated image URLs. Image URLs\n must be wrapped by `url()`.\n * @param {string} src - A selector or comma-separated image URLs. Image URLs\n must be wrapped by `url()`.\n */\nfunction validateCubemapSrc (src, cb) {\n var aCubemap;\n var cubemapSrcRegex = '';\n var i;\n var urls;\n var validatedUrls = [];\n\n for (i = 0; i < 5; i++) {\n cubemapSrcRegex += '(url\\\\((?:[^\\\\)]+)\\\\),\\\\s*)';\n }\n cubemapSrcRegex += '(url\\\\((?:[^\\\\)]+)\\\\)\\\\s*)';\n urls = src.match(new RegExp(cubemapSrcRegex));\n\n // `src` is a comma-separated list of URLs.\n // In this case, re-use validateSrc for each side of the cube.\n function isImageCb (url) {\n validatedUrls.push(url);\n if (validatedUrls.length === 6) {\n cb(validatedUrls);\n }\n }\n if (urls) {\n for (i = 1; i < 7; i++) {\n validateSrc(parseUrl(urls[i]), isImageCb);\n }\n return;\n }\n\n // `src` is a query selector to <a-cubemap> containing six $([src])s.\n aCubemap = validateAndGetQuerySelector(src);\n if (!aCubemap) { return; }\n if (aCubemap.tagName === 'A-CUBEMAP' && aCubemap.srcs) {\n return cb(aCubemap.srcs);\n }\n // Else if aCubeMap is not a <a-cubemap>.\n warn('Selector \"%s\" does not point to <a-cubemap>', src);\n}\n\n/**\n * Parses src from `url(src)`.\n * @param {string} src - String to parse.\n * @return {string} The parsed src, if parseable.\n */\nfunction parseUrl (src) {\n var parsedSrc = src.match(/\\url\\((.+)\\)/);\n if (!parsedSrc) { return; }\n return parsedSrc[1];\n}\n\n/**\n * Call back whether `src` is an image.\n *\n * @param {string|Element} src - URL or element that will be tested.\n * @param {function} onResult - Callback with whether `src` is an image.\n */\nfunction checkIsImage (src, onResult) {\n var request;\n\n if (src.tagName) {\n onResult(src.tagName === 'IMG');\n return;\n }\n request = new XMLHttpRequest();\n\n // Try to send HEAD request to check if image first.\n request.open('HEAD', src);\n request.addEventListener('load', function (event) {\n var contentType;\n if (request.status >= 200 && request.status < 300) {\n contentType = request.getResponseHeader('Content-Type');\n if (contentType == null) {\n checkIsImageFallback(src, onResult);\n } else {\n if (contentType.startsWith('image')) {\n onResult(true);\n } else {\n onResult(false);\n }\n }\n } else {\n checkIsImageFallback(src, onResult);\n }\n request.abort();\n });\n request.send();\n}\n\nfunction checkIsImageFallback (src, onResult) {\n var tester = new Image();\n tester.addEventListener('load', onLoad);\n function onLoad () { onResult(true); }\n tester.addEventListener('error', onError);\n function onError () { onResult(false); }\n tester.src = src;\n}\n\n/**\n * Query and validate a query selector,\n *\n * @param {string} selector - DOM selector.\n * @return {object|null|undefined} Selected DOM element if exists.\n null if query yields no results.\n undefined if `selector` is not a valid selector.\n */\nfunction validateAndGetQuerySelector (selector) {\n try {\n var el = document.querySelector(selector);\n if (!el) {\n warn('No element was found matching the selector: \"%s\"', selector);\n }\n return el;\n } catch (e) { // Capture exception if it's not a valid selector.\n warn('\"%s\" is not a valid selector', selector);\n return undefined;\n }\n}\n\nmodule.exports = {\n parseUrl: parseUrl,\n validateSrc: validateSrc,\n validateCubemapSrc: validateCubemapSrc\n};\n",
  454. "/**\n * Utils for parsing style-like strings (e.g., \"primitive: box; width: 5; height: 4.5\").\n * Some code adapted from `style-attr` (https://github.com/joshwnj/style-attr)\n * by Josh Johnston (MIT License).\n */\nvar DASH_REGEX = /-([a-z])/g;\n\n/**\n * Deserialize style-like string into an object of properties.\n *\n * @param {string} value - HTML attribute value.\n * @param {object} obj - Reused object for object pooling.\n * @returns {object} Property data.\n */\nmodule.exports.parse = function (value, obj) {\n var parsedData;\n if (typeof value !== 'string') { return value; }\n parsedData = styleParse(value, obj);\n // The style parser returns an object { \"\" : \"test\"} when fed a string\n if (parsedData['']) { return value; }\n return transformKeysToCamelCase(parsedData);\n};\n\n/**\n * Serialize an object of properties into a style-like string.\n *\n * @param {object} data - Property data.\n * @returns {string}\n */\nmodule.exports.stringify = function (data) {\n if (typeof data === 'string') { return data; }\n return styleStringify(data);\n};\n\n/**\n * Converts string from hyphen to camelCase.\n *\n * @param {string} str - String to camelCase.\n * @return {string} CamelCased string.\n */\nfunction toCamelCase (str) {\n return str.replace(DASH_REGEX, upperCase);\n}\nmodule.exports.toCamelCase = toCamelCase;\n\n/**\n * Converts object's keys from hyphens to camelCase (e.g., `max-value` to\n * `maxValue`).\n *\n * @param {object} obj - The object to camelCase keys.\n * @return {object} The object with keys camelCased.\n */\nfunction transformKeysToCamelCase (obj) {\n var camelKey;\n var key;\n for (key in obj) {\n camelKey = toCamelCase(key);\n if (key === camelKey) { continue; }\n obj[camelKey] = obj[key];\n delete obj[key];\n }\n return obj;\n}\nmodule.exports.transformKeysToCamelCase = transformKeysToCamelCase;\n\n/**\n * Split a string into chunks matching `<key>: <value>`\n */\nvar getKeyValueChunks = (function () {\n var chunks = [];\n var hasUnclosedUrl = /url\\([^)]+$/;\n\n return function getKeyValueChunks (raw) {\n var chunk = '';\n var nextSplit;\n var offset = 0;\n var sep = ';';\n\n chunks.length = 0;\n\n while (offset < raw.length) {\n nextSplit = raw.indexOf(sep, offset);\n if (nextSplit === -1) { nextSplit = raw.length; }\n\n chunk += raw.substring(offset, nextSplit);\n\n // data URIs can contain semicolons, so make sure we get the whole thing\n if (hasUnclosedUrl.test(chunk)) {\n chunk += ';';\n offset = nextSplit + 1;\n continue;\n }\n\n chunks.push(chunk.trim());\n chunk = '';\n offset = nextSplit + 1;\n }\n\n return chunks;\n };\n})();\n\n/**\n * Convert a style attribute string to an object.\n *\n * @param {object} str - Attribute string.\n * @param {object} obj - Object to reuse as a base, else a new one will be allocated.\n */\nfunction styleParse (str, obj) {\n var chunks;\n var i;\n var item;\n var pos;\n var key;\n var val;\n\n obj = obj || {};\n\n chunks = getKeyValueChunks(str);\n for (i = 0; i < chunks.length; i++) {\n item = chunks[i];\n if (!item) { continue; }\n // Split with `.indexOf` rather than `.split` because the value may also contain colons.\n pos = item.indexOf(':');\n key = item.substr(0, pos).trim();\n val = item.substr(pos + 1).trim();\n obj[key] = val;\n }\n return obj;\n}\n\n/**\n * Convert an object into an attribute string\n **/\nfunction styleStringify (obj) {\n var key;\n var keyCount = 0;\n var i = 0;\n var str = '';\n\n for (key in obj) { keyCount++; }\n\n for (key in obj) {\n str += (key + ': ' + obj[key]);\n if (i < keyCount - 1) { str += '; '; }\n i++;\n }\n return str;\n}\n\nfunction upperCase (str) { return str[1].toUpperCase(); }\n",
  455. "var DEFAULT_HANDEDNESS = require('../constants').DEFAULT_HANDEDNESS;\nvar AXIS_LABELS = ['x', 'y', 'z', 'w'];\nvar NUM_HANDS = 2; // Number of hands in a pair. Should always be 2.\n\n/**\n * Called on controller component `.play` handlers.\n * Check if controller matches parameters and inject tracked-controls component.\n * Handle event listeners.\n * Generate controllerconnected or controllerdisconnected events.\n *\n * @param {object} component - Tracked controls component.\n * @param {object} idPrefix - Prefix to match in gamepad id if any.\n * @param {object} queryObject - Map of values to match.\n */\nmodule.exports.checkControllerPresentAndSetup = function (component, idPrefix, queryObject) {\n var el = component.el;\n var controller;\n var hasWebXR = el.sceneEl.hasWebXR;\n var isControllerPresent = hasWebXR ? isControllerPresentWebXR : isControllerPresentWebVR;\n var isPresent;\n\n controller = isControllerPresent(component, idPrefix, queryObject);\n isPresent = !!controller;\n\n // If component was previously paused and now playing, re-add event listeners.\n // Handle the event listeners here since this helper method is control of calling\n // `.addEventListeners` and `.removeEventListeners`.\n if (component.controllerPresent && !component.controllerEventsActive && !hasWebXR) {\n component.addEventListeners();\n }\n\n // Nothing changed, no need to do anything.\n if (isPresent === component.controllerPresent) { return isPresent; }\n\n component.controllerPresent = isPresent;\n\n // Update controller presence.\n if (isPresent) {\n component.addEventListeners();\n component.injectTrackedControls(controller);\n el.emit('controllerconnected', {name: component.name, component: component});\n } else {\n component.removeEventListeners();\n el.emit('controllerdisconnected', {name: component.name, component: component});\n }\n};\n\n/**\n * Enumerate controller (that have pose) and check if they match parameters for WebVR\n *\n * @param {object} component - Tracked controls component.\n * @param {object} idPrefix - Prefix to match in gamepad id if any.\n * @param {object} queryObject - Map of values to match.\n */\nfunction isControllerPresentWebVR (component, idPrefix, queryObject) {\n var gamepads;\n var sceneEl = component.el.sceneEl;\n var trackedControlsSystem;\n var filterControllerIndex = queryObject.index || 0;\n\n if (!idPrefix) { return false; }\n\n trackedControlsSystem = sceneEl && sceneEl.systems['tracked-controls-webvr'];\n if (!trackedControlsSystem) { return false; }\n\n gamepads = trackedControlsSystem.controllers;\n if (!gamepads.length) { return false; }\n\n return !!findMatchingControllerWebVR(gamepads, null, idPrefix, queryObject.hand,\n filterControllerIndex);\n}\n\n/**\n *\n * @param {object} component - Tracked controls component.\n */\nfunction isControllerPresentWebXR (component, id, queryObject) {\n var controllers;\n var sceneEl = component.el.sceneEl;\n var trackedControlsSystem = sceneEl && sceneEl.systems['tracked-controls-webxr'];\n if (!trackedControlsSystem) { return false; }\n\n controllers = trackedControlsSystem.controllers;\n if (!controllers || !controllers.length) { return false; }\n\n return findMatchingControllerWebXR(\n controllers, id,\n queryObject.hand, queryObject.index, queryObject.iterateControllerProfiles, queryObject.handTracking);\n}\n\nmodule.exports.isControllerPresentWebVR = isControllerPresentWebVR;\nmodule.exports.isControllerPresentWebXR = isControllerPresentWebXR;\n\n/**\n * Walk through the given controllers to find any where the device ID equals\n * filterIdExact, or startsWith filterIdPrefix.\n * A controller where this considered true is considered a 'match'.\n *\n * For each matching controller:\n * If filterHand is set, and the controller:\n * is handed, we further verify that controller.hand equals filterHand.\n * is unhanded (controller.hand is ''), we skip until we have found a\n * number of matching controllers that equals filterControllerIndex\n * If filterHand is not set, we skip until we have found the nth matching\n * controller, where n equals filterControllerIndex\n *\n * The method should be called with one of: [filterIdExact, filterIdPrefix] AND\n * one or both of: [filterHand, filterControllerIndex]\n *\n * @param {object} controllers - Array of gamepads to search\n * @param {string} filterIdExact - If set, used to find controllers with id === this value\n * @param {string} filterIdPrefix - If set, used to find controllers with id startsWith this value\n * @param {object} filterHand - If set, further filters controllers with matching 'hand' property\n * @param {object} filterControllerIndex - Find the nth matching controller,\n * where n equals filterControllerIndex. defaults to 0.\n */\nfunction findMatchingControllerWebVR (controllers, filterIdExact, filterIdPrefix, filterHand,\n filterControllerIndex) {\n var controller;\n var i;\n var matchingControllerOccurence = 0;\n var targetControllerMatch = filterControllerIndex >= 0 ? filterControllerIndex : 0;\n\n for (i = 0; i < controllers.length; i++) {\n controller = controllers[i];\n\n // Determine if the controller ID matches our criteria.\n if (filterIdPrefix && !controller.id.startsWith(filterIdPrefix)) {\n continue;\n }\n\n if (!filterIdPrefix && controller.id !== filterIdExact) { continue; }\n\n // If the hand filter and controller handedness are defined we compare them.\n if (filterHand && controller.hand && filterHand !== controller.hand) { continue; }\n\n // If we have detected an unhanded controller and the component was asking\n // for a particular hand, we need to treat the controllers in the array as\n // pairs of controllers. This effectively means that we need to skip\n // NUM_HANDS matches for each controller number, instead of 1.\n if (filterHand && !controller.hand) {\n targetControllerMatch = NUM_HANDS * filterControllerIndex + ((filterHand === DEFAULT_HANDEDNESS) ? 0 : 1);\n } else {\n return controller;\n }\n\n // We are looking for the nth occurence of a matching controller\n // (n equals targetControllerMatch).\n if (matchingControllerOccurence === targetControllerMatch) { return controller; }\n ++matchingControllerOccurence;\n }\n return undefined;\n}\n\nfunction findMatchingControllerWebXR (controllers, idPrefix, handedness, index, iterateProfiles, handTracking) {\n var i;\n var j;\n var controller;\n var controllerMatch = false;\n var controllerHasHandedness;\n var profiles;\n for (i = 0; i < controllers.length; i++) {\n controller = controllers[i];\n profiles = controller.profiles;\n if (handTracking) {\n controllerMatch = controller.hand;\n } else {\n if (iterateProfiles) {\n for (j = 0; j < profiles.length; j++) {\n controllerMatch = profiles[j].startsWith(idPrefix);\n if (controllerMatch) { break; }\n }\n } else {\n controllerMatch = profiles.length > 0 && profiles[0].startsWith(idPrefix);\n }\n }\n if (!controllerMatch) { continue; }\n // Vive controllers are assigned handedness at runtime and it might not be always available.\n controllerHasHandedness = controller.handedness === 'right' || controller.handedness === 'left';\n if (controllerHasHandedness) {\n if (controller.handedness === handedness) { return controllers[i]; }\n } else { // Fallback to index if controller has no handedness.\n if ((i === index)) { return controllers[i]; }\n }\n }\n return undefined;\n}\n\nmodule.exports.findMatchingControllerWebVR = findMatchingControllerWebVR;\nmodule.exports.findMatchingControllerWebXR = findMatchingControllerWebXR;\n\n/**\n * Emit specific `moved` event(s) if axes changed based on original axismoved event.\n *\n * @param {object} component - Controller component in use.\n * @param {array} axesMapping - For example `{thumbstick: [0, 1]}`.\n * @param {object} evt - Event to process.\n */\nmodule.exports.emitIfAxesChanged = function (component, axesMapping, evt) {\n var axes;\n var buttonType;\n var changed;\n var detail;\n var j;\n\n for (buttonType in axesMapping) {\n axes = axesMapping[buttonType];\n\n changed = false;\n for (j = 0; j < axes.length; j++) {\n if (evt.detail.changed[axes[j]]) { changed = true; }\n }\n\n if (!changed) { continue; }\n\n // Axis has changed. Emit the specific moved event with axis values in detail.\n detail = {};\n for (j = 0; j < axes.length; j++) {\n detail[AXIS_LABELS[j]] = evt.detail.axis[axes[j]];\n }\n component.el.emit(buttonType + 'moved', detail);\n }\n};\n\n/**\n * Handle a button event and reemits the events.\n *\n * @param {string} id - id of the button.\n * @param {string} evtName - name of the reemitted event\n * @param {object} component - reference to the component\n * @param {string} hand - handedness of the controller: left or right.\n */\nmodule.exports.onButtonEvent = function (id, evtName, component, hand) {\n var mapping = hand ? component.mapping[hand] : component.mapping;\n var buttonName = mapping.buttons[id];\n component.el.emit(buttonName + evtName);\n if (component.updateModel) {\n component.updateModel(buttonName, evtName);\n }\n};\n",
  456. "/**\n * @author richt / http://richt.me\n * @author WestLangley / http://github.com/WestLangley\n *\n * W3C Device Orientation control (http://w3c.github.io/deviceorientation/spec-source-orientation.html)\n */\n\nTHREE.DeviceOrientationControls = function ( object ) {\n\n var scope = this;\n\n this.object = object;\n this.object.rotation.reorder( 'YXZ' );\n\n this.enabled = true;\n\n this.deviceOrientation = {};\n this.screenOrientation = 0;\n\n this.alphaOffset = 0; // radians\n\n var onDeviceOrientationChangeEvent = function ( event ) {\n\n scope.deviceOrientation = event;\n\n };\n\n var onScreenOrientationChangeEvent = function () {\n\n scope.screenOrientation = window.orientation || 0;\n\n };\n\n // The angles alpha, beta and gamma form a set of intrinsic Tait-Bryan angles of type Z-X'-Y''\n\n var setObjectQuaternion = function () {\n\n var zee = new THREE.Vector3( 0, 0, 1 );\n\n var euler = new THREE.Euler();\n\n var q0 = new THREE.Quaternion();\n\n var q1 = new THREE.Quaternion( - Math.sqrt( 0.5 ), 0, 0, Math.sqrt( 0.5 ) ); // - PI/2 around the x-axis\n\n return function ( quaternion, alpha, beta, gamma, orient ) {\n\n euler.set( beta, alpha, - gamma, 'YXZ' ); // 'ZXY' for the device, but 'YXZ' for us\n\n quaternion.setFromEuler( euler ); // orient the device\n\n quaternion.multiply( q1 ); // camera looks out the back of the device, not the top\n\n quaternion.multiply( q0.setFromAxisAngle( zee, - orient ) ); // adjust for screen orientation\n\n };\n\n }();\n\n this.connect = function () {\n \n onScreenOrientationChangeEvent();\n\n window.addEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n window.addEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n scope.enabled = true;\n\n };\n\n this.disconnect = function () {\n\n window.removeEventListener( 'orientationchange', onScreenOrientationChangeEvent, false );\n window.removeEventListener( 'deviceorientation', onDeviceOrientationChangeEvent, false );\n\n scope.enabled = false;\n\n };\n\n this.update = function () {\n\n if ( scope.enabled === false ) return;\n\n var device = scope.deviceOrientation;\n\n if ( device ) {\n\n var alpha = device.alpha ? THREE.Math.degToRad( device.alpha ) + scope.alphaOffset : 0; // Z\n\n var beta = device.beta ? THREE.Math.degToRad( device.beta ) : 0; // X'\n\n var gamma = device.gamma ? THREE.Math.degToRad( device.gamma ) : 0; // Y''\n\n var orient = scope.screenOrientation ? THREE.Math.degToRad( scope.screenOrientation ) : 0; // O\n\n setObjectQuaternion( scope.object.quaternion, alpha, beta, gamma, orient );\n\n }\n\n\n };\n\n this.dispose = function () {\n\n scope.disconnect();\n\n };\n\n this.connect();\n\n};\n",
  457. "window.glStats = function () {\n\n var _rS = null;\n\n var _totalDrawArraysCalls = 0,\n _totalDrawElementsCalls = 0,\n _totalUseProgramCalls = 0,\n _totalFaces = 0,\n _totalVertices = 0,\n _totalPoints = 0,\n _totalBindTexures = 0;\n\n function _h ( f, c ) {\n return function () {\n c.apply( this, arguments );\n f.apply( this, arguments );\n };\n }\n\n WebGLRenderingContext.prototype.drawArrays = _h( WebGLRenderingContext.prototype.drawArrays, function () {\n _totalDrawArraysCalls++;\n if ( arguments[ 0 ] == this.POINTS ) _totalPoints += arguments[ 2 ];\n else _totalVertices += arguments[ 2 ];\n } );\n\n WebGLRenderingContext.prototype.drawElements = _h( WebGLRenderingContext.prototype.drawElements, function () {\n _totalDrawElementsCalls++;\n _totalFaces += arguments[ 1 ] / 3;\n _totalVertices += arguments[ 1 ];\n } );\n\n WebGLRenderingContext.prototype.useProgram = _h( WebGLRenderingContext.prototype.useProgram, function () {\n _totalUseProgramCalls++;\n } );\n\n WebGLRenderingContext.prototype.bindTexture = _h( WebGLRenderingContext.prototype.bindTexture, function () {\n _totalBindTexures++;\n } );\n\n var _values = {\n allcalls: {\n over: 3000,\n caption: 'Calls (hook)'\n },\n drawelements: {\n caption: 'drawElements (hook)'\n },\n drawarrays: {\n caption: 'drawArrays (hook)'\n }\n };\n\n var _groups = [ {\n caption: 'WebGL',\n values: [ 'allcalls', 'drawelements', 'drawarrays', 'useprogram', 'bindtexture', 'glfaces', 'glvertices', 'glpoints' ]\n } ];\n\n var _fractions = [ {\n base: 'allcalls',\n steps: [ 'drawelements', 'drawarrays' ]\n } ];\n\n function _update () {\n _rS( 'allcalls' ).set( _totalDrawArraysCalls + _totalDrawElementsCalls );\n _rS( 'drawElements' ).set( _totalDrawElementsCalls );\n _rS( 'drawArrays' ).set( _totalDrawArraysCalls );\n _rS( 'bindTexture' ).set( _totalBindTexures );\n _rS( 'useProgram' ).set( _totalUseProgramCalls );\n _rS( 'glfaces' ).set( _totalFaces );\n _rS( 'glvertices' ).set( _totalVertices );\n _rS( 'glpoints' ).set( _totalPoints );\n }\n\n function _start () {\n _totalDrawArraysCalls = 0;\n _totalDrawElementsCalls = 0;\n _totalUseProgramCalls = 0;\n _totalFaces = 0;\n _totalVertices = 0;\n _totalPoints = 0;\n _totalBindTexures = 0;\n }\n\n function _end () {}\n\n function _attach ( r ) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: _fractions\n };\n\n};\n\nwindow.threeStats = function ( renderer ) {\n\n var _rS = null;\n\n var _values = {\n 'renderer.info.memory.geometries': {\n caption: 'Geometries'\n },\n 'renderer.info.memory.textures': {\n caption: 'Textures'\n },\n 'renderer.info.programs': {\n caption: 'Programs'\n },\n 'renderer.info.render.calls': {\n caption: 'Calls'\n },\n 'renderer.info.render.triangles': {\n caption: 'Triangles',\n over: 1000\n },\n 'renderer.info.render.points': {\n caption: 'Points'\n }\n };\n\n var _groups = [ {\n caption: 'Three.js - Memory',\n values: [ 'renderer.info.memory.geometries', 'renderer.info.programs', 'renderer.info.memory.textures' ]\n }, {\n caption: 'Three.js - Render',\n values: [ 'renderer.info.render.calls', 'renderer.info.render.triangles', 'renderer.info.render.points' ]\n } ];\n\n var _fractions = [];\n\n function _update () {\n\n _rS( 'renderer.info.memory.geometries' ).set( renderer.info.memory.geometries );\n _rS( 'renderer.info.programs' ).set( renderer.info.programs.length );\n _rS( 'renderer.info.memory.textures' ).set( renderer.info.memory.textures );\n _rS( 'renderer.info.render.calls' ).set( renderer.info.render.calls );\n _rS( 'renderer.info.render.triangles' ).set( renderer.info.render.triangles );\n _rS( 'renderer.info.render.points' ).set( renderer.info.render.points );\n\n }\n\n function _start () {}\n\n function _end () {}\n\n function _attach ( r ) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: _fractions\n };\n\n};\n\n/*\n * From https://github.com/paulirish/memory-stats.js\n */\n\nwindow.BrowserStats = function () {\n\n var _rS = null;\n\n var _usedJSHeapSize = 0,\n _totalJSHeapSize = 0;\n\n if ( window.performance && !performance.memory ) {\n performance.memory = {\n usedJSHeapSize: 0,\n totalJSHeapSize: 0\n };\n }\n\n if ( performance.memory.totalJSHeapSize === 0 ) {\n console.warn( 'totalJSHeapSize === 0... performance.memory is only available in Chrome .' );\n }\n\n var _values = {\n memory: {\n caption: 'Used Memory',\n average: true,\n avgMs: 1000,\n over: 22\n },\n total: {\n caption: 'Total Memory'\n }\n };\n\n var _groups = [ {\n caption: 'Browser',\n values: [ 'memory', 'total' ]\n } ];\n\n var _fractions = [ {\n base: 'total',\n steps: [ 'memory' ]\n } ];\n\n var log1024 = Math.log( 1024 );\n\n function _size ( v ) {\n\n var precision = 100; //Math.pow(10, 2);\n var i = Math.floor( Math.log( v ) / log1024 );\n return Math.round( v * precision / Math.pow( 1024, i ) ) / precision; // + ' ' + sizes[i];\n\n }\n\n function _update () {\n _usedJSHeapSize = _size( performance.memory.usedJSHeapSize );\n _totalJSHeapSize = _size( performance.memory.totalJSHeapSize );\n\n _rS( 'memory' ).set( _usedJSHeapSize );\n _rS( 'total' ).set( _totalJSHeapSize );\n }\n\n function _start () {\n _usedJSHeapSize = 0;\n }\n\n function _end () {}\n\n function _attach ( r ) {\n _rS = r;\n }\n\n return {\n update: _update,\n start: _start,\n end: _end,\n attach: _attach,\n values: _values,\n groups: _groups,\n fractions: _fractions\n };\n\n};\n\nif (typeof module === 'object') {\n module.exports = {\n glStats: window.glStats,\n threeStats: window.threeStats,\n BrowserStats: window.BrowserStats\n };\n}\n",
  458. "// performance.now() polyfill from https://gist.github.com/paulirish/5438650\n'use strict';\n\n( function () {\n\n if ( 'performance' in window == false ) {\n window.performance = {};\n }\n\n var performance = window.performance;\n\n if ( 'now' in performance == false ) {\n\n var nowOffset = Date.now();\n\n if ( performance.timing && performance.timing.navigationStart ) {\n nowOffset = performance.timing.navigationStart;\n }\n\n performance.now = function now () {\n return Date.now() - nowOffset;\n };\n\n }\n\n if( !performance.mark ) {\n performance.mark = function(){}\n }\n\n if( !performance.measure ) {\n performance.measure = function(){}\n }\n\n} )();\n\nwindow.rStats = function rStats ( settings ) {\n\n function iterateKeys ( array, callback ) {\n var keys = Object.keys( array );\n for ( var j = 0, l = keys.length; j < l; j++ ) {\n callback( keys[ j ] );\n }\n }\n\n function importCSS ( url ) {\n\n var element = document.createElement( 'link' );\n element.href = url;\n element.rel = 'stylesheet';\n element.type = 'text/css';\n document.getElementsByTagName( 'head' )[ 0 ].appendChild( element );\n\n }\n\n var _settings = settings || {};\n var _colours = _settings.colours || [ '#850700', '#c74900', '#fcb300', '#284280', '#4c7c0c' ];\n\n var _cssFont = 'https://fonts.googleapis.com/css?family=Roboto+Condensed:400,700,300';\n var _cssRStats = ( _settings.CSSPath ? _settings.CSSPath : '' ) + 'rStats.css';\n\n var _css = _settings.css || [ _cssFont, _cssRStats ];\n _css.forEach(function (uri) {\n importCSS( uri );\n });\n\n if ( !_settings.values ) _settings.values = {};\n\n var _base, _div, _elHeight = 10, _elWidth = 200;\n var _perfCounters = {};\n\n\n function Graph ( _dom, _id, _defArg ) {\n\n var _def = _defArg || {};\n var _canvas = document.createElement( 'canvas' ),\n _ctx = _canvas.getContext( '2d' ),\n _max = 0,\n _current = 0;\n\n var c = _def.color ? _def.color : '#666666';\n\n var _dotCanvas = document.createElement( 'canvas' ),\n _dotCtx = _dotCanvas.getContext( '2d' );\n _dotCanvas.width = 1;\n _dotCanvas.height = 2 * _elHeight;\n _dotCtx.fillStyle = '#444444';\n _dotCtx.fillRect( 0, 0, 1, 2 * _elHeight );\n _dotCtx.fillStyle = c;\n _dotCtx.fillRect( 0, _elHeight, 1, _elHeight );\n _dotCtx.fillStyle = '#ffffff';\n _dotCtx.globalAlpha = 0.5;\n _dotCtx.fillRect( 0, _elHeight, 1, 1 );\n _dotCtx.globalAlpha = 1;\n\n var _alarmCanvas = document.createElement( 'canvas' ),\n _alarmCtx = _alarmCanvas.getContext( '2d' );\n _alarmCanvas.width = 1;\n _alarmCanvas.height = 2 * _elHeight;\n _alarmCtx.fillStyle = '#444444';\n _alarmCtx.fillRect( 0, 0, 1, 2 * _elHeight );\n _alarmCtx.fillStyle = '#b70000';\n _alarmCtx.fillRect( 0, _elHeight, 1, _elHeight );\n _alarmCtx.globalAlpha = 0.5;\n _alarmCtx.fillStyle = '#ffffff';\n _alarmCtx.fillRect( 0, _elHeight, 1, 1 );\n _alarmCtx.globalAlpha = 1;\n\n function _init () {\n\n _canvas.width = _elWidth;\n _canvas.height = _elHeight;\n _canvas.style.width = _canvas.width + 'px';\n _canvas.style.height = _canvas.height + 'px';\n _canvas.className = 'rs-canvas';\n _dom.appendChild( _canvas );\n\n _ctx.fillStyle = '#444444';\n _ctx.fillRect( 0, 0, _canvas.width, _canvas.height );\n\n }\n\n function _draw ( v, alarm ) {\n _current += ( v - _current ) * 0.1;\n _max *= 0.99;\n if ( _current > _max ) _max = _current;\n _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height );\n if ( alarm ) {\n _ctx.drawImage( _alarmCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight );\n } else {\n _ctx.drawImage( _dotCanvas, _canvas.width - 1, _canvas.height - _current * _canvas.height / _max - _elHeight );\n }\n }\n\n _init();\n\n return {\n draw: _draw\n };\n\n }\n\n function StackGraph ( _dom, _num ) {\n\n var _canvas = document.createElement( 'canvas' ),\n _ctx = _canvas.getContext( '2d' );\n\n function _init () {\n\n _canvas.width = _elWidth;\n _canvas.height = _elHeight * _num;\n _canvas.style.width = _canvas.width + 'px';\n _canvas.style.height = _canvas.height + 'px';\n _canvas.className = 'rs-canvas';\n _dom.appendChild( _canvas );\n\n _ctx.fillStyle = '#444444';\n _ctx.fillRect( 0, 0, _canvas.width, _canvas.height );\n\n }\n\n function _draw ( v ) {\n _ctx.drawImage( _canvas, 1, 0, _canvas.width - 1, _canvas.height, 0, 0, _canvas.width - 1, _canvas.height );\n var th = 0;\n iterateKeys( v, function ( j ) {\n var h = v[ j ] * _canvas.height;\n _ctx.fillStyle = _colours[ j ];\n _ctx.fillRect( _canvas.width - 1, th, 1, h );\n th += h;\n } );\n }\n\n _init();\n\n return {\n draw: _draw\n };\n\n }\n\n function PerfCounter ( id, group ) {\n\n var _id = id,\n _time,\n _value = 0,\n _total = 0,\n _averageValue = 0,\n _accumValue = 0,\n _accumStart = performance.now(),\n _accumSamples = 0,\n _dom = document.createElement( 'div' ),\n _spanId = document.createElement( 'span' ),\n _spanValue = document.createElement( 'div' ),\n _spanValueText = document.createTextNode( '' ),\n _def = _settings ? _settings.values[ _id.toLowerCase() ] : null,\n _graph = new Graph( _dom, _id, _def ),\n _started = false;\n\n _spanId.className = 'rs-counter-id';\n _spanId.textContent = ( _def && _def.caption ) ? _def.caption : _id;\n\n _spanValue.className = 'rs-counter-value';\n _spanValue.appendChild( _spanValueText );\n\n _dom.appendChild( _spanId );\n _dom.appendChild( _spanValue );\n if ( group ) group.div.appendChild( _dom );\n else _div.appendChild( _dom );\n\n _time = performance.now();\n\n function _average ( v ) {\n if ( _def && _def.average ) {\n _accumValue += v;\n _accumSamples++;\n var t = performance.now();\n if ( t - _accumStart >= ( _def.avgMs || 1000 ) ) {\n _averageValue = _accumValue / _accumSamples;\n _accumValue = 0;\n _accumStart = t;\n _accumSamples = 0;\n }\n }\n }\n\n function _start () {\n _time = performance.now();\n if( _settings.userTimingAPI ) performance.mark( _id + '-start' );\n _started = true;\n }\n\n function _end () {\n _value = performance.now() - _time;\n if( _settings.userTimingAPI ) {\n performance.mark( _id + '-end' );\n if( _started ) {\n performance.measure( _id, _id + '-start', _id + '-end' );\n }\n }\n _average( _value );\n }\n\n function _tick () {\n _end();\n _start();\n }\n\n function _draw () {\n var v = ( _def && _def.average ) ? _averageValue : _value;\n _spanValueText.nodeValue = Math.round( v * 100 ) / 100;\n var a = ( _def && ( ( _def.below && _value < _def.below ) || ( _def.over && _value > _def.over ) ) );\n _graph.draw( _value, a );\n _dom.className = a ? 'rs-counter-base alarm' : 'rs-counter-base';\n\n }\n\n function _frame () {\n var t = performance.now();\n var e = t - _time;\n _total++;\n if ( e > 1000 ) {\n if ( _def && _def.interpolate === false ) {\n _value = _total;\n } else {\n _value = _total * 1000 / e;\n }\n _total = 0;\n _time = t;\n _average( _value );\n }\n }\n\n function _set ( v ) {\n _value = v;\n _average( _value );\n }\n\n return {\n set: _set,\n start: _start,\n tick: _tick,\n end: _end,\n frame: _frame,\n value: function () {\n return _value;\n },\n draw: _draw\n };\n\n }\n\n function sample () {\n\n var _value = 0;\n\n function _set ( v ) {\n _value = v;\n }\n\n return {\n set: _set,\n value: function () {\n return _value;\n }\n };\n\n }\n\n function _perf ( idArg ) {\n\n var id = idArg.toLowerCase();\n if ( id === undefined ) id = 'default';\n if ( _perfCounters[ id ] ) return _perfCounters[ id ];\n\n var group = null;\n if ( _settings && _settings.groups ) {\n iterateKeys( _settings.groups, function ( j ) {\n var g = _settings.groups[ parseInt( j, 10 ) ];\n if ( !group && g.values.indexOf( id.toLowerCase() ) !== -1 ) {\n group = g;\n }\n } );\n }\n\n var p = new PerfCounter( id, group );\n _perfCounters[ id ] = p;\n return p;\n\n }\n\n function _init () {\n\n if ( _settings.plugins ) {\n if ( !_settings.values ) _settings.values = {};\n if ( !_settings.groups ) _settings.groups = [];\n if ( !_settings.fractions ) _settings.fractions = [];\n for ( var j = 0; j < _settings.plugins.length; j++ ) {\n _settings.plugins[ j ].attach( _perf );\n iterateKeys( _settings.plugins[ j ].values, function ( k ) {\n _settings.values[ k ] = _settings.plugins[ j ].values[ k ];\n } );\n _settings.groups = _settings.groups.concat( _settings.plugins[ j ].groups );\n _settings.fractions = _settings.fractions.concat( _settings.plugins[ j ].fractions );\n }\n } else {\n _settings.plugins = {};\n }\n\n _base = document.createElement( 'div' );\n _base.className = 'rs-base';\n _div = document.createElement( 'div' );\n _div.className = 'rs-container';\n _div.style.height = 'auto';\n _base.appendChild( _div );\n document.body.appendChild( _base );\n\n if ( !_settings ) return;\n\n if ( _settings.groups ) {\n iterateKeys( _settings.groups, function ( j ) {\n var g = _settings.groups[ parseInt( j, 10 ) ];\n var div = document.createElement( 'div' );\n div.className = 'rs-group';\n g.div = div;\n var h1 = document.createElement( 'h1' );\n h1.textContent = g.caption;\n h1.addEventListener( 'click', function ( e ) {\n this.classList.toggle( 'hidden' );\n e.preventDefault();\n }.bind( div ) );\n _div.appendChild( h1 );\n _div.appendChild( div );\n } );\n }\n\n if ( _settings.fractions ) {\n iterateKeys( _settings.fractions, function ( j ) {\n var f = _settings.fractions[ parseInt( j, 10 ) ];\n var div = document.createElement( 'div' );\n div.className = 'rs-fraction';\n var legend = document.createElement( 'div' );\n legend.className = 'rs-legend';\n\n var h = 0;\n iterateKeys( _settings.fractions[ j ].steps, function ( k ) {\n var p = document.createElement( 'p' );\n p.textContent = _settings.fractions[ j ].steps[ k ];\n p.style.color = _colours[ h ];\n legend.appendChild( p );\n h++;\n } );\n div.appendChild( legend );\n div.style.height = h * _elHeight + 'px';\n f.div = div;\n var graph = new StackGraph( div, h );\n f.graph = graph;\n _div.appendChild( div );\n } );\n }\n\n }\n\n function _update () {\n\n iterateKeys( _settings.plugins, function ( j ) {\n _settings.plugins[ j ].update();\n } );\n\n iterateKeys( _perfCounters, function ( j ) {\n _perfCounters[ j ].draw();\n } );\n\n if ( _settings && _settings.fractions ) {\n iterateKeys( _settings.fractions, function ( j ) {\n var f = _settings.fractions[ parseInt( j, 10 ) ];\n var v = [];\n var base = _perfCounters[ f.base.toLowerCase() ];\n if ( base ) {\n base = base.value();\n iterateKeys( _settings.fractions[ j ].steps, function ( k ) {\n var s = _settings.fractions[ j ].steps[ parseInt( k, 10 ) ].toLowerCase();\n var val = _perfCounters[ s ];\n if ( val ) {\n v.push( val.value() / base );\n }\n } );\n }\n f.graph.draw( v );\n } );\n }\n\n /*if( _height != _div.clientHeight ) {\n _height = _div.clientHeight;\n _base.style.height = _height + 2 * _elHeight + 'px';\n console.log( _base.clientHeight );\n }*/\n\n }\n\n _init();\n\n return function ( id ) {\n if ( id ) return _perf( id );\n return {\n element: _base,\n update: _update\n };\n };\n\n}\n\nif (typeof module === 'object') {\n module.exports = window.rStats;\n}\n",
  459. "// https://stackoverflow.com/a/36213464\nif (!String.prototype.startsWith) {\n String.prototype.startsWith = function(searchString, position){\n position = position || 0;\n return this.substr(position, searchString.length) === searchString;\n };\n}\n",
  460. "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar Util = {};\n\nUtil.base64 = function(mimeType, base64) {\n return 'data:' + mimeType + ';base64,' + base64;\n};\n\nUtil.isMobile = function() {\n var check = false;\n (function(a){if(/(android|bb\\d+|meego).+mobile|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\\-(n|u)|c55\\/|capi|ccwa|cdm\\-|cell|chtm|cldc|cmd\\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\\-s|devi|dica|dmob|do(c|p)o|ds(12|\\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\\-|_)|g1 u|g560|gene|gf\\-5|g\\-mo|go(\\.w|od)|gr(ad|un)|haie|hcit|hd\\-(m|p|t)|hei\\-|hi(pt|ta)|hp( i|ip)|hs\\-c|ht(c(\\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\\-(20|go|ma)|i230|iac( |\\-|\\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\\/)|klon|kpt |kwc\\-|kyo(c|k)|le(no|xi)|lg( g|\\/(k|l|u)|50|54|\\-[a-w])|libw|lynx|m1\\-w|m3ga|m50\\/|ma(te|ui|xo)|mc(01|21|ca)|m\\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\\-2|po(ck|rt|se)|prox|psio|pt\\-g|qa\\-a|qc(07|12|21|32|60|\\-[2-7]|i\\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\\-|oo|p\\-)|sdk\\/|se(c(\\-|0|1)|47|mc|nd|ri)|sgh\\-|shar|sie(\\-|m)|sk\\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\\-|v\\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\\-|tdg\\-|tel(i|m)|tim\\-|t\\-mo|to(pl|sh)|ts(70|m\\-|m3|m5)|tx\\-9|up(\\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\\-|your|zeto|zte\\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera);\n return check;\n};\n\nUtil.isIOS = function() {\n return /(iPad|iPhone|iPod)/g.test(navigator.userAgent);\n};\n\nUtil.isIFrame = function() {\n try {\n return window.self !== window.top;\n } catch (e) {\n return true;\n }\n};\n\nUtil.appendQueryParameter = function(url, key, value) {\n // Determine delimiter based on if the URL already GET parameters in it.\n var delimiter = (url.indexOf('?') < 0 ? '?' : '&');\n url += delimiter + key + '=' + value;\n return url;\n};\n\n// From http://goo.gl/4WX3tg\nUtil.getQueryParameter = function(name) {\n name = name.replace(/[\\[]/, \"\\\\[\").replace(/[\\]]/, \"\\\\]\");\n var regex = new RegExp(\"[\\\\?&]\" + name + \"=([^&#]*)\"),\n results = regex.exec(location.search);\n return results === null ? \"\" : decodeURIComponent(results[1].replace(/\\+/g, \" \"));\n};\n\nUtil.isLandscapeMode = function() {\n return (window.orientation == 90 || window.orientation == -90);\n};\n\n\nmodule.exports = Util;\n",
  461. "/*\n * Copyright 2015 Google Inc. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar Util = require('./util.js');\n\n/**\n * Android and iOS compatible wakelock implementation.\n *\n * Refactored thanks to dkovalev@.\n */\nfunction AndroidWakeLock() {\n var video = document.createElement('video');\n\n video.addEventListener('ended', function() {\n video.play();\n });\n\n this.request = function() {\n if (video.paused) {\n // Base64 version of videos_src/no-sleep-60s.webm.\n video.src = Util.base64('video/webm', 'GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4ECQoWBAhhTgGcBAAAAAAAH4xFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsggfG7AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU2LjQwLjEwMVdBjUxhdmY1Ni40MC4xMDFzpJAGSJTMbsLpDt/ySkipgX1fRImIQO1MAAAAAAAWVK5rAQAAAAAAADuuAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDmDgQEj44OEO5rKAOABAAAAAAAABrCBsLqBkB9DtnUBAAAAAAAAo+eBAKOmgQAAgKJJg0IAAV4BHsAHBIODCoAACmH2MAAAZxgz4dPSTFi5JACjloED6ACmAECSnABMQAADYAAAWi0quoCjloEH0ACmAECSnABNwAADYAAAWi0quoCjloELuACmAECSnABNgAADYAAAWi0quoCjloEPoACmAECSnABNYAADYAAAWi0quoCjloETiACmAECSnABNIAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTnghdwo5aBAAAApgBAkpwATOAAA2AAAFotKrqAo5aBA+gApgBAkpwATMAAA2AAAFotKrqAo5aBB9AApgBAkpwATIAAA2AAAFotKrqAo5aBC7gApgBAkpwATEAAA2AAAFotKrqAo5aBD6AApgDAkpwAQ2AAA2AAAFotKrqAo5aBE4gApgBAkpwATCAAA2AAAFotKrqAH0O2dQEAAAAAAACU54Iu4KOWgQAAAKYAQJKcAEvAAANgAABaLSq6gKOWgQPoAKYAQJKcAEtgAANgAABaLSq6gKOWgQfQAKYAQJKcAEsAAANgAABaLSq6gKOWgQu4AKYAQJKcAEqAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEogAANgAABaLSq6gKOWgROIAKYAQJKcAEnAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCRlCjloEAAACmAECSnABJgAADYAAAWi0quoCjloED6ACmAECSnABJIAADYAAAWi0quoCjloEH0ACmAMCSnABDYAADYAAAWi0quoCjloELuACmAECSnABI4AADYAAAWi0quoCjloEPoACmAECSnABIoAADYAAAWi0quoCjloETiACmAECSnABIYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngl3Ao5aBAAAApgBAkpwASCAAA2AAAFotKrqAo5aBA+gApgBAkpwASAAAA2AAAFotKrqAo5aBB9AApgBAkpwAR8AAA2AAAFotKrqAo5aBC7gApgBAkpwAR4AAA2AAAFotKrqAo5aBD6AApgBAkpwAR2AAA2AAAFotKrqAo5aBE4gApgBAkpwARyAAA2AAAFotKrqAH0O2dQEAAAAAAACU54J1MKOWgQAAAKYAwJKcAENgAANgAABaLSq6gKOWgQPoAKYAQJKcAEbgAANgAABaLSq6gKOWgQfQAKYAQJKcAEagAANgAABaLSq6gKOWgQu4AKYAQJKcAEaAAANgAABaLSq6gKOWgQ+gAKYAQJKcAEZAAANgAABaLSq6gKOWgROIAKYAQJKcAEYAAANgAABaLSq6gB9DtnUBAAAAAAAAlOeCjKCjloEAAACmAECSnABF4AADYAAAWi0quoCjloED6ACmAECSnABFwAADYAAAWi0quoCjloEH0ACmAECSnABFoAADYAAAWi0quoCjloELuACmAECSnABFgAADYAAAWi0quoCjloEPoACmAMCSnABDYAADYAAAWi0quoCjloETiACmAECSnABFYAADYAAAWi0quoAfQ7Z1AQAAAAAAAJTngqQQo5aBAAAApgBAkpwARUAAA2AAAFotKrqAo5aBA+gApgBAkpwARSAAA2AAAFotKrqAo5aBB9AApgBAkpwARQAAA2AAAFotKrqAo5aBC7gApgBAkpwARQAAA2AAAFotKrqAo5aBD6AApgBAkpwAROAAA2AAAFotKrqAo5aBE4gApgBAkpwARMAAA2AAAFotKrqAH0O2dQEAAAAAAACU54K7gKOWgQAAAKYAQJKcAESgAANgAABaLSq6gKOWgQPoAKYAQJKcAESAAANgAABaLSq6gKOWgQfQAKYAwJKcAENgAANgAABaLSq6gKOWgQu4AKYAQJKcAERgAANgAABaLSq6gKOWgQ+gAKYAQJKcAERAAANgAABaLSq6gKOWgROIAKYAQJKcAEQgAANgAABaLSq6gB9DtnUBAAAAAAAAlOeC0vCjloEAAACmAECSnABEIAADYAAAWi0quoCjloED6ACmAECSnABEAAADYAAAWi0quoCjloEH0ACmAECSnABD4AADYAAAWi0quoCjloELuACmAECSnABDwAADYAAAWi0quoCjloEPoACmAECSnABDoAADYAAAWi0quoCjloETiACmAECSnABDgAADYAAAWi0quoAcU7trAQAAAAAAABG7j7OBALeK94EB8YIBd/CBAw==');\n video.play();\n }\n };\n\n this.release = function() {\n video.pause();\n video.src = '';\n };\n}\n\nfunction iOSWakeLock() {\n var timer = null;\n\n this.request = function() {\n if (!timer) {\n timer = setInterval(function() {\n window.location.href = '/';\n setTimeout(window.stop, 0);\n }, 15000);\n }\n }\n\n this.release = function() {\n if (timer) {\n clearInterval(timer);\n timer = null;\n }\n }\n}\n\n\nfunction getWakeLock() {\n var userAgent = navigator.userAgent || navigator.vendor || window.opera;\n if (userAgent.match(/iPhone/i) || userAgent.match(/iPod/i)) {\n return iOSWakeLock;\n } else {\n return AndroidWakeLock;\n }\n}\n\nmodule.exports = getWakeLock();\n"
  462. ]
  463. }