box-content-preview 3.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/LICENSE +397 -0
  2. package/README.md +435 -0
  3. package/dist/lib/237.js +34 -0
  4. package/dist/lib/274.js +103 -0
  5. package/dist/lib/2a7d8bfaf2d43f53bd71.mjs +21 -0
  6. package/dist/lib/3683cfffdcbd73685ff2.svg +8 -0
  7. package/dist/lib/42e4e1954f25f8c7b965.svg +6 -0
  8. package/dist/lib/492.js +34 -0
  9. package/dist/lib/59fe962b3e6bd8bfdda7.svg +3 -0
  10. package/dist/lib/5ea0869845becef03a06.svg +4 -0
  11. package/dist/lib/671.js +34 -0
  12. package/dist/lib/76692c54994797ddfb04.svg +3 -0
  13. package/dist/lib/815.js +34 -0
  14. package/dist/lib/8475f8e672ed83e24520.svg +6 -0
  15. package/dist/lib/88.css +23 -0
  16. package/dist/lib/9fb032a1799ca2a1c751.svg +3 -0
  17. package/dist/lib/assets/loading_ghost.gif +0 -0
  18. package/dist/lib/bb72d81b39be40898db2.svg +3 -0
  19. package/dist/lib/cmaps/78-EUC-H.bcmap +0 -0
  20. package/dist/lib/cmaps/78-EUC-V.bcmap +0 -0
  21. package/dist/lib/cmaps/78-H.bcmap +0 -0
  22. package/dist/lib/cmaps/78-RKSJ-H.bcmap +0 -0
  23. package/dist/lib/cmaps/78-RKSJ-V.bcmap +0 -0
  24. package/dist/lib/cmaps/78-V.bcmap +0 -0
  25. package/dist/lib/cmaps/78ms-RKSJ-H.bcmap +0 -0
  26. package/dist/lib/cmaps/78ms-RKSJ-V.bcmap +0 -0
  27. package/dist/lib/cmaps/83pv-RKSJ-H.bcmap +0 -0
  28. package/dist/lib/cmaps/90ms-RKSJ-H.bcmap +0 -0
  29. package/dist/lib/cmaps/90ms-RKSJ-V.bcmap +0 -0
  30. package/dist/lib/cmaps/90msp-RKSJ-H.bcmap +0 -0
  31. package/dist/lib/cmaps/90msp-RKSJ-V.bcmap +0 -0
  32. package/dist/lib/cmaps/90pv-RKSJ-H.bcmap +0 -0
  33. package/dist/lib/cmaps/90pv-RKSJ-V.bcmap +0 -0
  34. package/dist/lib/cmaps/Add-H.bcmap +0 -0
  35. package/dist/lib/cmaps/Add-RKSJ-H.bcmap +0 -0
  36. package/dist/lib/cmaps/Add-RKSJ-V.bcmap +0 -0
  37. package/dist/lib/cmaps/Add-V.bcmap +0 -0
  38. package/dist/lib/cmaps/Adobe-CNS1-0.bcmap +0 -0
  39. package/dist/lib/cmaps/Adobe-CNS1-1.bcmap +0 -0
  40. package/dist/lib/cmaps/Adobe-CNS1-2.bcmap +0 -0
  41. package/dist/lib/cmaps/Adobe-CNS1-3.bcmap +0 -0
  42. package/dist/lib/cmaps/Adobe-CNS1-4.bcmap +0 -0
  43. package/dist/lib/cmaps/Adobe-CNS1-5.bcmap +0 -0
  44. package/dist/lib/cmaps/Adobe-CNS1-6.bcmap +0 -0
  45. package/dist/lib/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
  46. package/dist/lib/cmaps/Adobe-GB1-0.bcmap +0 -0
  47. package/dist/lib/cmaps/Adobe-GB1-1.bcmap +0 -0
  48. package/dist/lib/cmaps/Adobe-GB1-2.bcmap +0 -0
  49. package/dist/lib/cmaps/Adobe-GB1-3.bcmap +0 -0
  50. package/dist/lib/cmaps/Adobe-GB1-4.bcmap +0 -0
  51. package/dist/lib/cmaps/Adobe-GB1-5.bcmap +0 -0
  52. package/dist/lib/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
  53. package/dist/lib/cmaps/Adobe-Japan1-0.bcmap +0 -0
  54. package/dist/lib/cmaps/Adobe-Japan1-1.bcmap +0 -0
  55. package/dist/lib/cmaps/Adobe-Japan1-2.bcmap +0 -0
  56. package/dist/lib/cmaps/Adobe-Japan1-3.bcmap +0 -0
  57. package/dist/lib/cmaps/Adobe-Japan1-4.bcmap +0 -0
  58. package/dist/lib/cmaps/Adobe-Japan1-5.bcmap +0 -0
  59. package/dist/lib/cmaps/Adobe-Japan1-6.bcmap +0 -0
  60. package/dist/lib/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
  61. package/dist/lib/cmaps/Adobe-Korea1-0.bcmap +0 -0
  62. package/dist/lib/cmaps/Adobe-Korea1-1.bcmap +0 -0
  63. package/dist/lib/cmaps/Adobe-Korea1-2.bcmap +0 -0
  64. package/dist/lib/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
  65. package/dist/lib/cmaps/B5-H.bcmap +0 -0
  66. package/dist/lib/cmaps/B5-V.bcmap +0 -0
  67. package/dist/lib/cmaps/B5pc-H.bcmap +0 -0
  68. package/dist/lib/cmaps/B5pc-V.bcmap +0 -0
  69. package/dist/lib/cmaps/CNS-EUC-H.bcmap +0 -0
  70. package/dist/lib/cmaps/CNS-EUC-V.bcmap +0 -0
  71. package/dist/lib/cmaps/CNS1-H.bcmap +0 -0
  72. package/dist/lib/cmaps/CNS1-V.bcmap +0 -0
  73. package/dist/lib/cmaps/CNS2-H.bcmap +0 -0
  74. package/dist/lib/cmaps/CNS2-V.bcmap +3 -0
  75. package/dist/lib/cmaps/ETHK-B5-H.bcmap +0 -0
  76. package/dist/lib/cmaps/ETHK-B5-V.bcmap +0 -0
  77. package/dist/lib/cmaps/ETen-B5-H.bcmap +0 -0
  78. package/dist/lib/cmaps/ETen-B5-V.bcmap +0 -0
  79. package/dist/lib/cmaps/ETenms-B5-H.bcmap +3 -0
  80. package/dist/lib/cmaps/ETenms-B5-V.bcmap +0 -0
  81. package/dist/lib/cmaps/EUC-H.bcmap +0 -0
  82. package/dist/lib/cmaps/EUC-V.bcmap +0 -0
  83. package/dist/lib/cmaps/Ext-H.bcmap +0 -0
  84. package/dist/lib/cmaps/Ext-RKSJ-H.bcmap +0 -0
  85. package/dist/lib/cmaps/Ext-RKSJ-V.bcmap +0 -0
  86. package/dist/lib/cmaps/Ext-V.bcmap +0 -0
  87. package/dist/lib/cmaps/GB-EUC-H.bcmap +0 -0
  88. package/dist/lib/cmaps/GB-EUC-V.bcmap +0 -0
  89. package/dist/lib/cmaps/GB-H.bcmap +4 -0
  90. package/dist/lib/cmaps/GB-V.bcmap +0 -0
  91. package/dist/lib/cmaps/GBK-EUC-H.bcmap +0 -0
  92. package/dist/lib/cmaps/GBK-EUC-V.bcmap +0 -0
  93. package/dist/lib/cmaps/GBK2K-H.bcmap +0 -0
  94. package/dist/lib/cmaps/GBK2K-V.bcmap +0 -0
  95. package/dist/lib/cmaps/GBKp-EUC-H.bcmap +0 -0
  96. package/dist/lib/cmaps/GBKp-EUC-V.bcmap +0 -0
  97. package/dist/lib/cmaps/GBT-EUC-H.bcmap +0 -0
  98. package/dist/lib/cmaps/GBT-EUC-V.bcmap +0 -0
  99. package/dist/lib/cmaps/GBT-H.bcmap +0 -0
  100. package/dist/lib/cmaps/GBT-V.bcmap +0 -0
  101. package/dist/lib/cmaps/GBTpc-EUC-H.bcmap +0 -0
  102. package/dist/lib/cmaps/GBTpc-EUC-V.bcmap +0 -0
  103. package/dist/lib/cmaps/GBpc-EUC-H.bcmap +0 -0
  104. package/dist/lib/cmaps/GBpc-EUC-V.bcmap +0 -0
  105. package/dist/lib/cmaps/H.bcmap +0 -0
  106. package/dist/lib/cmaps/HKdla-B5-H.bcmap +0 -0
  107. package/dist/lib/cmaps/HKdla-B5-V.bcmap +0 -0
  108. package/dist/lib/cmaps/HKdlb-B5-H.bcmap +0 -0
  109. package/dist/lib/cmaps/HKdlb-B5-V.bcmap +0 -0
  110. package/dist/lib/cmaps/HKgccs-B5-H.bcmap +0 -0
  111. package/dist/lib/cmaps/HKgccs-B5-V.bcmap +0 -0
  112. package/dist/lib/cmaps/HKm314-B5-H.bcmap +0 -0
  113. package/dist/lib/cmaps/HKm314-B5-V.bcmap +0 -0
  114. package/dist/lib/cmaps/HKm471-B5-H.bcmap +0 -0
  115. package/dist/lib/cmaps/HKm471-B5-V.bcmap +0 -0
  116. package/dist/lib/cmaps/HKscs-B5-H.bcmap +0 -0
  117. package/dist/lib/cmaps/HKscs-B5-V.bcmap +0 -0
  118. package/dist/lib/cmaps/Hankaku.bcmap +0 -0
  119. package/dist/lib/cmaps/Hiragana.bcmap +0 -0
  120. package/dist/lib/cmaps/KSC-EUC-H.bcmap +0 -0
  121. package/dist/lib/cmaps/KSC-EUC-V.bcmap +0 -0
  122. package/dist/lib/cmaps/KSC-H.bcmap +0 -0
  123. package/dist/lib/cmaps/KSC-Johab-H.bcmap +0 -0
  124. package/dist/lib/cmaps/KSC-Johab-V.bcmap +0 -0
  125. package/dist/lib/cmaps/KSC-V.bcmap +0 -0
  126. package/dist/lib/cmaps/KSCms-UHC-H.bcmap +0 -0
  127. package/dist/lib/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
  128. package/dist/lib/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
  129. package/dist/lib/cmaps/KSCms-UHC-V.bcmap +0 -0
  130. package/dist/lib/cmaps/KSCpc-EUC-H.bcmap +0 -0
  131. package/dist/lib/cmaps/KSCpc-EUC-V.bcmap +0 -0
  132. package/dist/lib/cmaps/Katakana.bcmap +0 -0
  133. package/dist/lib/cmaps/LICENSE +36 -0
  134. package/dist/lib/cmaps/NWP-H.bcmap +0 -0
  135. package/dist/lib/cmaps/NWP-V.bcmap +0 -0
  136. package/dist/lib/cmaps/RKSJ-H.bcmap +0 -0
  137. package/dist/lib/cmaps/RKSJ-V.bcmap +0 -0
  138. package/dist/lib/cmaps/Roman.bcmap +0 -0
  139. package/dist/lib/cmaps/UniCNS-UCS2-H.bcmap +0 -0
  140. package/dist/lib/cmaps/UniCNS-UCS2-V.bcmap +0 -0
  141. package/dist/lib/cmaps/UniCNS-UTF16-H.bcmap +0 -0
  142. package/dist/lib/cmaps/UniCNS-UTF16-V.bcmap +0 -0
  143. package/dist/lib/cmaps/UniCNS-UTF32-H.bcmap +0 -0
  144. package/dist/lib/cmaps/UniCNS-UTF32-V.bcmap +0 -0
  145. package/dist/lib/cmaps/UniCNS-UTF8-H.bcmap +0 -0
  146. package/dist/lib/cmaps/UniCNS-UTF8-V.bcmap +0 -0
  147. package/dist/lib/cmaps/UniGB-UCS2-H.bcmap +0 -0
  148. package/dist/lib/cmaps/UniGB-UCS2-V.bcmap +0 -0
  149. package/dist/lib/cmaps/UniGB-UTF16-H.bcmap +0 -0
  150. package/dist/lib/cmaps/UniGB-UTF16-V.bcmap +0 -0
  151. package/dist/lib/cmaps/UniGB-UTF32-H.bcmap +0 -0
  152. package/dist/lib/cmaps/UniGB-UTF32-V.bcmap +0 -0
  153. package/dist/lib/cmaps/UniGB-UTF8-H.bcmap +0 -0
  154. package/dist/lib/cmaps/UniGB-UTF8-V.bcmap +0 -0
  155. package/dist/lib/cmaps/UniJIS-UCS2-H.bcmap +0 -0
  156. package/dist/lib/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
  157. package/dist/lib/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
  158. package/dist/lib/cmaps/UniJIS-UCS2-V.bcmap +0 -0
  159. package/dist/lib/cmaps/UniJIS-UTF16-H.bcmap +0 -0
  160. package/dist/lib/cmaps/UniJIS-UTF16-V.bcmap +0 -0
  161. package/dist/lib/cmaps/UniJIS-UTF32-H.bcmap +0 -0
  162. package/dist/lib/cmaps/UniJIS-UTF32-V.bcmap +0 -0
  163. package/dist/lib/cmaps/UniJIS-UTF8-H.bcmap +0 -0
  164. package/dist/lib/cmaps/UniJIS-UTF8-V.bcmap +0 -0
  165. package/dist/lib/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
  166. package/dist/lib/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
  167. package/dist/lib/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
  168. package/dist/lib/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
  169. package/dist/lib/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
  170. package/dist/lib/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
  171. package/dist/lib/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
  172. package/dist/lib/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
  173. package/dist/lib/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
  174. package/dist/lib/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
  175. package/dist/lib/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
  176. package/dist/lib/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
  177. package/dist/lib/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
  178. package/dist/lib/cmaps/UniKS-UCS2-H.bcmap +0 -0
  179. package/dist/lib/cmaps/UniKS-UCS2-V.bcmap +0 -0
  180. package/dist/lib/cmaps/UniKS-UTF16-H.bcmap +0 -0
  181. package/dist/lib/cmaps/UniKS-UTF16-V.bcmap +0 -0
  182. package/dist/lib/cmaps/UniKS-UTF32-H.bcmap +0 -0
  183. package/dist/lib/cmaps/UniKS-UTF32-V.bcmap +0 -0
  184. package/dist/lib/cmaps/UniKS-UTF8-H.bcmap +0 -0
  185. package/dist/lib/cmaps/UniKS-UTF8-V.bcmap +0 -0
  186. package/dist/lib/cmaps/V.bcmap +0 -0
  187. package/dist/lib/cmaps/WP-Symbol.bcmap +0 -0
  188. package/dist/lib/exif/exif-reader.min.js +8 -0
  189. package/dist/lib/exif/exif.js +822 -0
  190. package/dist/lib/exif/exif.min.js +21 -0
  191. package/dist/lib/fde82a50e6de20239861.svg +5 -0
  192. package/dist/lib/ff2dfa442d903d9d5e30.gif +0 -0
  193. package/dist/lib/index.css +84 -0
  194. package/dist/lib/index.d.ts +147 -0
  195. package/dist/lib/index.js +41639 -0
  196. package/dist/lib/pdfjs-lib.js +46 -0
  197. package/dist/lib/pdfjs-viewer-css.js +36 -0
  198. package/dist/lib/pdfjs-viewer.js +8118 -0
  199. package/dist/lib/third-party/media/0.127.0/shaka-player.compiled.js +371 -0
  200. package/dist/lib/third-party/media/1.30.0/shaka-player.compiled.js +438 -0
  201. package/dist/lib/third-party/media/1.33.0/shaka-player.compiled.js +438 -0
  202. package/dist/lib/third-party/media/1.8.0/shaka-player.compiled.js +376 -0
  203. package/dist/lib/third-party/media/2.14.0/shaka-player.compiled.js +609 -0
  204. package/dist/lib/third-party/media/2.66.0/manifest.json +8 -0
  205. package/dist/lib/third-party/media/2.66.0/shaka-player.compiled.js +752 -0
  206. package/dist/lib/third-party/media/2.93.0/manifest.json +8 -0
  207. package/dist/lib/third-party/media/2.93.0/shaka-player.compiled.js +975 -0
  208. package/dist/lib/third-party/media/3.25.0/manifest.json +8 -0
  209. package/dist/lib/third-party/media/3.25.0/shaka-player.compiled.js +1780 -0
  210. package/dist/lib/third-party/model3d/1.10.1/WebVR/VRConfig.js +49 -0
  211. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  212. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  213. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  214. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  215. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  216. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchCommon/entities.json +322 -0
  217. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchLeft/entities.json +755 -0
  218. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchLeft/geometry.bin +0 -0
  219. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchRight/entities.json +746 -0
  220. package/dist/lib/third-party/model3d/1.10.1/WebVR/oculusTouchRight/geometry.bin +0 -0
  221. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/entities.json +1811 -0
  222. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/geometry.bin +0 -0
  223. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/1024/1.png +0 -0
  224. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/1024/2.jpg +0 -0
  225. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/1024/3.jpg +0 -0
  226. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/1.png +0 -0
  227. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/2.jpg +0 -0
  228. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/3.jpg +0 -0
  229. package/dist/lib/third-party/model3d/1.10.1/WebVR/viveController/images/64/4.png +0 -0
  230. package/dist/lib/third-party/model3d/1.10.1/box3d-player.json +1 -0
  231. package/dist/lib/third-party/model3d/1.10.1/box3d-runtime.min.js +2 -0
  232. package/dist/lib/third-party/model3d/1.10.1/boxsdk.min.js +2 -0
  233. package/dist/lib/third-party/model3d/1.10.1/matcap.png +0 -0
  234. package/dist/lib/third-party/model3d/1.10.1/three.min.js +882 -0
  235. package/dist/lib/third-party/model3d/1.10.1/webvr-polyfill.js +6341 -0
  236. package/dist/lib/third-party/model3d/1.12.0/WebVR/VRConfig.js +49 -0
  237. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  238. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  239. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  240. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  241. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  242. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchCommon/entities.json +322 -0
  243. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchLeft/entities.json +755 -0
  244. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchLeft/geometry.bin +0 -0
  245. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchRight/entities.json +746 -0
  246. package/dist/lib/third-party/model3d/1.12.0/WebVR/oculusTouchRight/geometry.bin +0 -0
  247. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/entities.json +1811 -0
  248. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/geometry.bin +0 -0
  249. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/1024/1.png +0 -0
  250. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/1024/2.jpg +0 -0
  251. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/1024/3.jpg +0 -0
  252. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/1.png +0 -0
  253. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/2.jpg +0 -0
  254. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/3.jpg +0 -0
  255. package/dist/lib/third-party/model3d/1.12.0/WebVR/viveController/images/64/4.png +0 -0
  256. package/dist/lib/third-party/model3d/1.12.0/box3d-player.json +1 -0
  257. package/dist/lib/third-party/model3d/1.12.0/box3d-runtime.min.js +2 -0
  258. package/dist/lib/third-party/model3d/1.12.0/boxsdk.min.js +2 -0
  259. package/dist/lib/third-party/model3d/1.12.0/matcap.png +0 -0
  260. package/dist/lib/third-party/model3d/1.12.0/three.min.js +882 -0
  261. package/dist/lib/third-party/model3d/1.12.0/webvr-polyfill.js +6341 -0
  262. package/dist/lib/third-party/model3d/1.6.1/WebVR/VRConfig.js +49 -0
  263. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  264. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  265. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  266. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  267. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  268. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchCommon/entities.json +439 -0
  269. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchLeft/entities.json +755 -0
  270. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchLeft/geometry.bin +0 -0
  271. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchRight/entities.json +746 -0
  272. package/dist/lib/third-party/model3d/1.6.1/WebVR/oculusTouchRight/geometry.bin +0 -0
  273. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/entities.json +1869 -0
  274. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/geometry.bin +0 -0
  275. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/1024/1.png +0 -0
  276. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/1024/2.jpg +0 -0
  277. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/1024/3.jpg +0 -0
  278. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/1.png +0 -0
  279. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/2.jpg +0 -0
  280. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/3.jpg +0 -0
  281. package/dist/lib/third-party/model3d/1.6.1/WebVR/viveController/images/64/4.png +0 -0
  282. package/dist/lib/third-party/model3d/1.6.1/box3d-player.json +1 -0
  283. package/dist/lib/third-party/model3d/1.6.1/box3d-runtime.min.js +2 -0
  284. package/dist/lib/third-party/model3d/1.6.1/boxsdk.min.js +2 -0
  285. package/dist/lib/third-party/model3d/1.6.1/matcap.png +0 -0
  286. package/dist/lib/third-party/model3d/1.6.1/three.min.js +43300 -0
  287. package/dist/lib/third-party/model3d/1.6.1/webvr-polyfill.js +6341 -0
  288. package/dist/lib/third-party/model3d/1.9.1/WebVR/VRConfig.js +49 -0
  289. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/1024/1.jpg +0 -0
  290. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/256/3.jpg +0 -0
  291. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/512/2.jpg +0 -0
  292. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/64/1.jpg +0 -0
  293. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/64/2.jpg +0 -0
  294. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchCommon/entities.json +439 -0
  295. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchLeft/entities.json +755 -0
  296. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchLeft/geometry.bin +0 -0
  297. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchRight/entities.json +746 -0
  298. package/dist/lib/third-party/model3d/1.9.1/WebVR/oculusTouchRight/geometry.bin +0 -0
  299. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/entities.json +1869 -0
  300. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/geometry.bin +0 -0
  301. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/1024/1.png +0 -0
  302. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/1024/2.jpg +0 -0
  303. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/1024/3.jpg +0 -0
  304. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/1.png +0 -0
  305. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/2.jpg +0 -0
  306. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/3.jpg +0 -0
  307. package/dist/lib/third-party/model3d/1.9.1/WebVR/viveController/images/64/4.png +0 -0
  308. package/dist/lib/third-party/model3d/1.9.1/box3d-player.json +1 -0
  309. package/dist/lib/third-party/model3d/1.9.1/box3d-runtime.min.js +2 -0
  310. package/dist/lib/third-party/model3d/1.9.1/boxsdk.min.js +2 -0
  311. package/dist/lib/third-party/model3d/1.9.1/matcap.png +0 -0
  312. package/dist/lib/third-party/model3d/1.9.1/three.min.js +882 -0
  313. package/dist/lib/third-party/model3d/1.9.1/webvr-polyfill.js +6341 -0
  314. package/dist/lib/third-party/swf/0.112.0/swfobject.js +6 -0
  315. package/dist/lib/third-party/text/0.112.0/github-markdown.css +681 -0
  316. package/dist/lib/third-party/text/0.112.0/github.css +123 -0
  317. package/dist/lib/third-party/text/0.112.0/highlight.min.js +3 -0
  318. package/dist/lib/third-party/text/0.112.0/papaparse.js +1457 -0
  319. package/dist/lib/third-party/text/0.112.0/papaparse.min.js +34 -0
  320. package/dist/lib/third-party/text/0.112.0/remarkable.min.js +4 -0
  321. package/dist/lib/third-party/text/0.114.0/github-markdown.css +681 -0
  322. package/dist/lib/third-party/text/0.114.0/github-markdown.min.css +1 -0
  323. package/dist/lib/third-party/text/0.114.0/github.css +123 -0
  324. package/dist/lib/third-party/text/0.114.0/github.min.css +1 -0
  325. package/dist/lib/third-party/text/0.114.0/highlight.min.js +3 -0
  326. package/dist/lib/third-party/text/0.114.0/manifest.json +10 -0
  327. package/dist/lib/third-party/text/0.114.0/papaparse.js +1457 -0
  328. package/dist/lib/third-party/text/0.114.0/papaparse.min.js +34 -0
  329. package/dist/lib/third-party/text/0.114.0/remarkable.min.js +4 -0
  330. package/dist/lib/third-party/text/2.65.0/github-markdown.css +681 -0
  331. package/dist/lib/third-party/text/2.65.0/github-markdown.min.css +1 -0
  332. package/dist/lib/third-party/text/2.65.0/github.css +99 -0
  333. package/dist/lib/third-party/text/2.65.0/github.min.css +1 -0
  334. package/dist/lib/third-party/text/2.65.0/highlight.min.js +2 -0
  335. package/dist/lib/third-party/text/2.65.0/manifest.json +10 -0
  336. package/dist/lib/third-party/text/2.65.0/papaparse.js +1897 -0
  337. package/dist/lib/third-party/text/2.65.0/papaparse.min.js +7 -0
  338. package/dist/lib/third-party/text/2.65.0/remarkable.min.js +1 -0
  339. package/package.json +198 -0
@@ -0,0 +1,2 @@
1
+ (function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("THREE")):"function"==typeof define&&define.amd?define("Box3D",["THREE"],t):"object"==typeof exports?exports.Box3D=t(require("THREE")):e.Box3D=t(e.THREE)})(this,function(e){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=245)}([function(e,t,r){"use strict";function i(e,t){function r(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function n(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&(r[i[n]]=e[i[n]]);return r}function a(e,t,r,i){var n,a=arguments.length,o=a<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,r,o):n(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function o(e,t){return function(r,i){t(r,i,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,i){return new(r||(r=Promise))(function(n,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(o,s)}u((i=i.apply(e,t||[])).next())})}function p(e,t){function r(e){return function(t){return i([e,t])}}function i(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,a&&(o=a[2&r[0]?"return":r[0]?"throw":"next"])&&!(o=o.call(a,r[1])).done)return o;switch(a=0,o&&(r=[0,o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,a=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){u.label=r[1];break}if(6===r[0]&&u.label<o[1]){u.label=o[1],o=r;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(r);break}o[2]&&u.ops.pop(),u.trys.pop();continue}r=t.call(e,u)}catch(e){r=[6,e],a=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}var n,a,o,s,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s}function c(e,t){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}function l(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function h(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(d(arguments[t]));return e}function f(e){return this instanceof f?(this.v=e,this):new f(e)}function m(e,t,r){function i(e){c[e]&&(p[e]=function(t){return new Promise(function(r,i){l.push([e,t,r,i])>1||n(e,t)})})}function n(e,t){try{a(c[e](t))}catch(e){u(l[0][3],e)}}function a(e){e.value instanceof f?Promise.resolve(e.value.v).then(o,s):u(l[0][2],e)}function o(e){n("next",e)}function s(e){n("throw",e)}function u(e,t){e(t),l.shift(),l.length&&n(l[0][0],l[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var p,c=r.apply(e,t||[]),l=[];return p={},i("next"),i("throw"),i("return"),p[Symbol.asyncIterator]=function(){return this},p}function y(e){function t(t,n){e[t]&&(r[t]=function(r){return(i=!i)?{value:f(e[t](r)),done:"return"===t}:n?n(r):r})}var r,i;return r={},t("next"),t("throw",function(e){throw e}),t("return"),r[Symbol.iterator]=function(){return this},r}function g(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator];return t?t.call(e):"function"==typeof l?l(e):e[Symbol.iterator]()}Object.defineProperty(t,"__esModule",{value:!0}),t.__extends=i,r.d(t,"__assign",function(){return b}),t.__rest=n,t.__decorate=a,t.__param=o,t.__metadata=s,t.__awaiter=u,t.__generator=p,t.__exportStar=c,t.__values=l,t.__read=d,t.__spread=h,t.__await=f,t.__asyncGenerator=m,t.__asyncDelegator=y,t.__asyncValues=g;var v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},b=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}},function(t,r){t.exports=e},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(27),a=r(5),o=r(10),s=r(49),u=[{event:"awake",method:"onAwake",skippable:!0},{event:"startup",method:"onStartupInternal",skippable:!1},{event:"shutdown",method:"onShutdownInternal",skippable:!1},{event:"attributesChanged",method:"onAttributesChanged",skippable:!0}],p=[{event:"loadBase",method:"onEntityReady",testMethod:"isBaseLoaded",skippable:!0},{event:"loadDependencies",method:"onDependenciesLoaded",testMethod:"isDependenciesLoaded",skippable:!0},{event:"load",method:"onEntityLoaded",testMethod:"isLoaded",skippable:!0}],c=[{event:"preUpdate",method:"onPreUpdate",skippable:!0},{event:"update",method:"onUpdate",skippable:!0},{event:"postUpdate",method:"onPostUpdate",skippable:!0},{event:"preRender",method:"onPreRender",skippable:!0},{event:"render",method:"onRender",skippable:!0},{event:"postRender",method:"onPostRender",skippable:!0},{event:"preRenderView",method:"onPreRenderView",skippable:!0},{event:"postRenderView",method:"onPostRenderView",skippable:!0},{event:"blur",method:"onSuspend",skippable:!0},{event:"focus",method:"onResume",skippable:!0}];t.baseComponentMixins=s.default({},[n.default]);var l=function(e){function t(){var t=e.call(this)||this;return t.input=void 0,t}return i.__extends(t,e),t.prototype.getId=function(){return this.id},t.prototype.getIndex=function(){return this.getEntity().components.indexOf(this)},t.prototype.getName=function(){return this.name},t.prototype.getScriptAsset=function(){return this.getEngine().getAssetById(this.getScriptId())},t.prototype.getScriptName=function(){return this.getScriptAsset().getName()},t.prototype.getScriptId=function(){return this.scriptId},t.prototype.getAttributes=function(){var e=this,t=this.getScriptAsset().getProperty("attributes");return a.map(t,function(t,r){return e.getAttribute(r)})},t.prototype.getPreviousAttributes=function(){var e=this,t=this.getScriptAsset().getProperty("attributes");return a.map(t,function(t,r){return e.getPreviousAttribute(r)})},t.prototype.setName=function(e,t){void 0===t&&(t=!1);var r={name:e};this.getEngine().entityDispatcher.dispatchComponentChanged(this.entity.id,this.getIndex(),r,t)},t.prototype.setAttribute=function(e,t,r){var i={attributes:(n={},n[e]=a.deepClone(t),n)};this.getEngine().entityDispatcher.dispatchComponentChanged(this.entity.id,this.getIndex(),i);var n},t.prototype.setAttributes=function(e,t){var r={attributes:a.deepClone(e)};this.getEngine().entityDispatcher.dispatchComponentChanged(this.entity.id,this.getIndex(),r)},t.prototype.getAttribute=function(e){var t=this.getEntity(),r=t.getComponentDescriptorById(this.getId());if(r.attributes.hasOwnProperty(e))return a.deepClone(r.attributes[e]);if(t instanceof o.default){var i=t.getPrefabObject();if(i){var n=i.getComponentById(this.getId());if(n)return n.getAttribute(e)}}return this.getScriptAsset().getAttributeDefault(e)},t.prototype.getPreviousAttribute=function(e){var t=this.getEntity(),r=t.getPreviousComponentDescriptorById(this.getId());if(r&&r.attributes.hasOwnProperty(e))return r.attributes[e];if(t instanceof o.default){var i=t.getPrefabObject();if(i){var n=i.getComponentById(this.getId());if(n)return n.getPreviousAttribute(e)}}return this.getScriptAsset().getAttributeDefault(e)},t.prototype.getEntity=function(){return this.entity},t.prototype.getEngine=function(){return this.entity.engine},t.prototype.enable=function(){this.enabled||(this.enabled=!0,this.onEnable(),this.trigger("enable"))},t.prototype.disable=function(){this.enabled&&(this.enabled=!1,this.onDisable(),this.trigger("disable"))},t.prototype.toggle=function(){this.enabled?this.disable():this.enable()},t.prototype.registerDependency=function(e){this.getEntity().registerDependency(e)},t.prototype.unregisterDependency=function(e){this.getEntity().unregisterDependency(e)},t.prototype.isEnabled=function(){return this.enabled},t.prototype.hasRuntimeData=function(){return!(!this.entity||!this.entity.runtimeData)},t.prototype.getRuntimeData=function(){return this.entity.runtimeData},t.prototype.getGlobalEvents=function(){return this.entity.engine.globalEvents},t.prototype.getRenderer=function(){return this.getEngine().getRenderer()},t.prototype.getThreeRenderer=function(){var e=this.getEngine().getRenderer();return e?e.threeRenderer:null},t.prototype.getInput=function(){if(!this.input){var e=this.getEngine().getApplication();this.input=e.getComponentByScriptName("Input")}return this.input},t.prototype.getRootObject=function(){return this.entity instanceof o.default?this.entity.getRootObject():null},t.prototype.getRootThreeObject=function(){if(this.entity instanceof o.default){var e=this.entity.getRootObject();return e?e.runtimeData:null}return null},t.prototype.reload=function(){var e=this.getScriptId(),t=this.getEntity().getComponentDescriptor(function(t){return t.scriptId===e}).attributes,r=this.getName();this.getEntity().removeComponent(this),this.getEntity().addComponent(e,t,r)},t.prototype.onAwake=function(){},t.prototype.onStartup=function(){},t.prototype.onShutdown=function(){},t.prototype.onPreUpdate=function(e){},t.prototype.onUpdate=function(e){},t.prototype.onPostUpdate=function(e){},t.prototype.onPreRender=function(e){},t.prototype.onRender=function(e){},t.prototype.onPostRender=function(e){},t.prototype.onPreRenderView=function(e,t){},t.prototype.onPostRenderView=function(e,t){},t.prototype.onSuspend=function(){},t.prototype.onResume=function(){},t.prototype.onAttributesChanged=function(e){},t.prototype.onEntityReady=function(){},t.prototype.onEntityLoaded=function(){},t.prototype.onDependenciesLoaded=function(){},t.prototype.onEnable=function(){},t.prototype.onDisable=function(){},t.prototype.onStartupInternal=function(){var e=this;c.forEach(function(t){return e.eventBindHelper(e.getEngine(),t)}),this.onStartup(),p.forEach(function(t){return e.eventBindHelper(e.getEntity(),t)}),this.isEnabled()&&this.onEnable()},t.prototype.onShutdownInternal=function(){this.stopListening(),this.onShutdown(),this.bindSelfEvents()},t.prototype.eventBindHelper=function(e,r){if("function"==typeof this[r.method]){var i=this.getScriptAsset();if(i){var n=i.getProperty("executeIn"),a=this.getEngine().getRunMode();"all"!==n&&n!==a||r.skippable&&this[r.method]===t.prototype[r.method]||(this.listenTo(e,r.event,this[r.method]),r.testMethod&&e[r.testMethod]()&&this[r.method]())}}},t.prototype.bindSelfEvents=function(){var e=this;u.forEach(function(t){return e.eventBindHelper(e,t)})},t}(t.baseComponentMixins);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(281);t.default=i},function(e,t,r){"use strict";function i(e){if(!y[e]||!y[e].properties)throw new Error("Unknown schema: "+e);var t=f.getSchema(e),r={};return t(r),r}function n(e){if(!y[e]||!y[e].properties)throw new Error("Unknown schema: "+e);return c.map(y[e].properties,function(t,r){var i=e+"-"+r,n=f.getSchema(i);return n||f.addSchema(t,i),n||f.getSchema(i)})}function a(e){return f.getSchema(e)}function o(e){var t=c.deepClone(y[e]);return t||(t=c.deepClone(m[e])),Object.keys(t.properties).forEach(function(e){t.properties[e].$ref&&(t.properties[e]=u.__assign({},o(t.properties[e].$ref),t.properties[e]),delete t.properties[e].$ref)},{}),t}function s(e,t){var r=h[e];r?(t.validators=n(r),t.defaults=i(r),t.schema=o(r)):(l.default.warn("No schema file available for "+e),t.validators={},t.defaults={},t.schema={})}Object.defineProperty(t,"__esModule",{value:!0});var u=r(0),p=r(252),c=r(5),l=r(3),d=["accessor.json","animationChannel.json","animationClip.json","animationLayer.json","audioRepresentation.json","box3.json","commonImageProperties.json","dracoAttribute.json","eventScope.json","imageRepresentation.json","meshAttribute.json","meshPrimitive.json","representation.json","shaderConditions.json","shaderParameter.json","colorRgb.json","vector2.json","vector3.json","vector4.json","videoRepresentation.json"],h={AnimationAsset:"animationAssetProperties.json",ApplicationAsset:"applicationAssetProperties.json",AudioAsset:"audioAssetProperties.json",BufferAsset:"bufferAssetProperties.json",DocumentAsset:"documentAssetProperties.json",DracoGeometryAsset:"dracoGeometryAssetProperties.json",ImageAsset:"imageAssetProperties.json",MaterialAsset:"materialAssetProperties.json",MeshGeometryAsset:"meshGeometryAssetProperties.json",PrefabAsset:"prefabAssetProperties.json",PrimitiveGeometryAsset:"primitiveGeometryAssetProperties.json",RenderTexture2DAsset:"renderTexture2DAssetProperties.json",RenderTextureCubeAsset:"renderTextureCubeAssetProperties.json",ScriptAsset:"scriptAssetProperties.json",ShaderAsset:"shaderAssetProperties.json",SkinAsset:"skinAssetProperties.json",Texture2DAsset:"texture2DAssetProperties.json",TextureCubeAsset:"textureCubeAssetProperties.json",VideoAsset:"videoAssetProperties.json",BoneObject:"boneObjectProperties.json",CameraObject:"cameraObjectProperties.json",LightObject:"lightObjectProperties.json",MeshObject:"meshObjectProperties.json",NodeObject:"nodeObjectProperties.json",SceneObject:"sceneObjectProperties.json"},f=new p({useDefaults:!0}),m=d.reduce(function(e,t){return e[t]=r(204)("./"+t.replace(".json",".ts")).default,e},{});c.forEach(m,function(e,t){f.addSchema(e,t)});var y=c.values(h).reduce(function(e,t){return e[t]=r(204)("./"+t.replace(".json",".ts")).default,e},{});c.forEach(y,function(e,t){f.addSchema(e,t)}),t.getPropertyDefaultsForSchema=i,t.getPropertyValidatorsForSchema=n,t.getValidatorForSchema=a,t.getSchema=o,t.addSchemas=s,t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.map=function(e,t,r){if(void 0!==e&&null!==e)return Array.isArray(e)?e.map(t):Object.keys(e).reduce(function(i,n){return i[n]=(r?t.bind(r):t)(e[n],n),i},{})},t.forEach=function(e,t,r){if(void 0!==e&&null!==e)return Array.isArray(e)?e.forEach(t,r):Object.keys(e).forEach(function(i){(r?t.bind(r):t)(e[i],i)})},t.values=function(e){if(void 0!==e&&null!==e)return Array.isArray(e)?e:Object.keys(e).reduce(function(t,r){return t.push(e[r]),t},[])},t.deepClone=function(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"function":return;default:return e}},t.shallowEquals=function(e,t){return e===t||"object"==typeof e&&!(Object.keys(e).some(function(r){return!t.hasOwnProperty(r)||e[r]!==t[r]})||Object.keys(t).some(function(r){return!e.hasOwnProperty(r)||e[r]!==t[r]}))},t.groupBy=function(e,t,r){var i={};return e.forEach(function(e,n){var a=(r?t.bind(r):t)(e,n);i.hasOwnProperty(a)||(i[a]=[]),i[a].push(e)}),i}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(9),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.on("triggerLoad",this.load,this)},t.prototype.uninitialize=function(){this.off("triggerLoad",this.load,this),e.prototype.uninitialize.call(this)},t.prototype.getAssetById=function(e){return this.engine.getAssetById(e)},t.prototype.unload=function(){this.abortRequests(),e.prototype.unload.call(this)},t.prototype.destroy=function(){this.engine.trigger(this.type+"Deleted",this.id),this.engine.destroyAsset(this)},t.prototype.clone=function(t){var r=e.prototype.clone.call(this,t);return r.set("representations",this.get("representations")),r},t.events={triggerLoad:{scope:"local",parameters:[],action:!0,category:"Loading"}},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"baseAsset",title:"BaseAssetDef",properties:i.__assign({},n.default.properties,{properties:{$ref:"baseAssetProperties.json"},representations:{type:"array",description:"Available representations for the asset.",items:{$ref:"representation.json"}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(44),a=i.__assign({},n.default,{id:"baseAssetProperties",title:"BaseAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(19),a=r(3),o=r(27),s=r(211),u=r(216),p=r(210),c=r(232),l=r(49),d=r(5);t.baseEntityMixins=l.default({},[p.default,s.default,u.default,o.default,c.default]);var h;(function(e){e[e.Destroyed=1]="Destroyed",e[e.Pending=2]="Pending",e[e.InProgress=4]="InProgress",e[e.Partial=8]="Partial",e[e.Succeeded=16]="Succeeded",e[e.Aborted=32]="Aborted",e[e.Failed=64]="Failed"})(h=t.State||(t.State={}));var f;(function(e){e[e.Base=0]="Base",e[e.Dependencies=1]="Dependencies"})(f=t.StateType||(t.StateType={}));var m=function(e){function t(t,r){var i=e.call(this)||this;return i.events={},i.computePropertyFunctions={},i.engine=r,i.state=[h.Pending,h.Pending],i.runtimeData=void 0,i.sharedData=void 0,i.id=t.id,i.type=t.type,i.sharedData=t,i}return i.__extends(t,e),t.checkLoadFinished=function(e){return!!((h.Succeeded|h.Failed|h.Aborted)&e)},t.prototype.setState=function(e,t){if(t){var r=this.state[e];switch(this.state[e]=t,t){case h.Pending:this.isUnloaded()&&this.trigger("unload",this),e===f.Dependencies&&r!==t&&this.trigger("loadStateChange",this);break;case h.InProgress:case h.Partial:e===f.Dependencies&&r!==t&&this.trigger("loadStateChange",this);break;case h.Succeeded:case h.Failed:case h.Aborted:switch(e){case f.Base:this.trigger("loadBase",this);break;case f.Dependencies:this.trigger("loadDependencies",this)}if(r!==t&&this.trigger("loadStateChange",this),!this.isLoaded())return;this.trigger("load",this);break;default:throw Error("Unknown state "+t)}}},t.prototype.initialize=function(){this.on("change:properties",this.propertyChanged,this),this.on("startTimer",this.startTimer,this),this.initializeProperties(),this.initializeComponents()},t.prototype.uninitialize=function(){this.stopListening(),this.off("startTimer",this.startTimer,this),this.off("change:properties",this.propertyChanged,this),this.unregisterDependencies(),this.unload();for(var e=0;e<this.state.length;e++)this.state[e]=h.Destroyed;this.runtimeData=null},t.prototype.initializeProperties=function(){var e=this,t=this.getProperties();Object.keys(t).forEach(function(r){var i=t[r];e.verifyProperty(r,i)||a.default.warn('Property "'+r+'" on "'+e.constructor.name+'" does not exist or has an invalid value of "'+JSON.stringify(i,null,2)+'".')}),this.applyPropertiesUnloaded(t)},t.prototype.getName=function(){return this.getProperty("name")},t.prototype.getSid=function(){return this.get("sid")},t.prototype.setName=function(e,t){this.setProperty("name",e,t)},t.prototype.setSid=function(e,t){this.set("sid",e,t)},t.prototype.get=function(e){return this.sharedData[e]},t.prototype.set=function(e,t,r){this.engine.entityDispatcher.dispatchAttributeChanged(this.id,e,t)},t.prototype.unset=function(e,t){this.sharedData.hasOwnProperty(e)&&delete this.sharedData[e],this.engine.entityDispatcher.dispatchAttributeChanged(this.id,e,void 0)},t.prototype.verifyProperty=function(e,t){if(!this.constructor.validators[e])return a.default.warn("No validator available for property: "+e),!1;var r=this.constructor.validators[e],i=r(t);if(!i){a.default.warn('Verification failed for value "'+JSON.stringify(t)+'" for property "'+e+'"');var n=r.errors;n&&n instanceof Array&&a.default.warn(n&&n[0])}return i},t.prototype.setProperty=function(e,t,r){this.verifyProperty(e,t)&&this.engine.entityDispatcher.dispatchPropertyChanged(this.id,e,t,r)},t.prototype.unsetProperty=function(e,t){this.engine.entityDispatcher.dispatchPropertyChanged(this.id,e,void 0,t)},t.prototype.setProperties=function(e,t){this.engine.entityDispatcher.dispatchPropertiesChanged(this.id,e,t)},t.prototype.getOwnProperty=function(e){return this.sharedData.properties[e]},t.prototype.getPreviousProperty=function(e){var t=this.sharedData.previousProperties[e];return void 0!==t?t:this.getDefaultProperty(e)},t.prototype.getOwnProperties=function(){return this.sharedData.properties},t.prototype.copyProperties=function(e,t){this.setProperties(e.getOwnProperties(),t)},t.prototype.mergeProperties=function(e,t){this.setProperties(i.__assign({},e.getOwnProperties(),this.sharedData.properties),t)},t.prototype.getDefaultProperty=function(e){return d.deepClone(this.constructor.defaults[e])},t.prototype.getDefaultProperties=function(){return d.deepClone(this.constructor.defaults)},t.prototype.getProperty=function(e){var t=this.getOwnProperty(e);if(this.computePropertyFunctions[e]){var r=this.getDefaultProperty(e);return this.computePropertyFunctions[e](t,r)}return void 0!==t?t:this.getDefaultProperty(e)},t.prototype.revertProperty=function(e){this.unsetProperty(e)},t.prototype.getProperties=function(){var e=this.getOwnProperties(),t=this.getDefaultProperties();return Object.assign(t,e)},t.prototype.clone=function(e){var t=this.engine.createEntityByClass(this.engine.getEntityClass(this.getType()),this.getOwnProperties(),e||n.v4());return t.set("sid",this.get("sid")),t.setComponents(this.getComponentDescriptors()),t},t.prototype.destroy=function(){},t.prototype.getRuntimeData=function(){return this.runtimeData||this.load(),this.runtimeData},t.prototype.when=function(e,t,r){"function"==typeof t&&("load"===e&&this.isLoaded()||"loadBase"===e&&this.isBaseLoaded()||"loadDependencies"===e&&this.isDependenciesLoaded()?t.call(r,this):r?r.listenToOnce(this,e,t):this.once(e,t,r))},t.prototype.load=function(e){var t=this;this.when("load",function(){"function"==typeof e&&e(t)},this),this.loadBase(),this.loadDependencies(),this.checkIfOwnDependenciesLoaded()&&this.setState(f.Dependencies,h.Succeeded)},t.prototype.reset=function(){},t.prototype.getDataSizeLoaded=function(e){return this.getDataSize("getDataSizeLoadedSelf",e)},t.prototype.getDataSizeDownload=function(e){return this.getDataSize("getDataSizeDownloadSelf",e)},t.prototype.getDataSizeInMemory=function(e){return this.getDataSize("getDataSizeInMemorySelf",e)},t.prototype.getDataSizeDownloadSelf=function(){return 0},t.prototype.getDataSizeInMemorySelf=function(){return 0},t.prototype.getDataSizeLoadedSelf=function(){return 0},t.prototype.loadBase=function(e){var t=this;this.isBaseLoaded()?(this.trigger("loadBase",this),"function"==typeof e&&e(this)):this.isBaseUnloaded()&&(this.once("loadBase",e,this),this.setState(f.Base,h.InProgress),this.startComponents(),this.createRuntimeData(function(){t.isDestroyed()||(t.applyPropertiesLoaded(t.getProperties(),"init"),t.state[f.Base]<=h.Succeeded&&t.setState(f.Base,h.Succeeded))}))},t.prototype.reloadBase=function(e){this.stopComponents(),this.setState(f.Base,h.Pending),this.loadBase(function(){"function"==typeof e&&e()})},t.prototype.getLoadingProgress=function(){if(this.isLoaded())return 1;var e=this.getDataSizeLoaded(),t=this.getDataSizeDownload();return t?Math.min(e/t,.999999):this.isUnloaded()?0:.99},t.prototype.unload=function(){this.stopComponents(),this.setState(f.Base,h.Pending),this.setState(f.Dependencies,h.Pending),this.runtimeData=null},t.prototype.isUnloaded=function(){return h.Pending===(h.Pending&this.state[f.Base])},t.prototype.isLoaded=function(){for(var e=h.Succeeded|h.Failed|h.Aborted,t=0;t<this.state.length;t++)if(!(e&this.state[t]))return!1;return!0},t.prototype.isLoadFailed=function(){for(var e=0;e<this.state.length;e++)if(h.Failed&this.state[e])return!0;return!1},t.prototype.isLoading=function(){for(var e=0,t=0;t<this.state.length;t++)e|=this.state[t];return!!(e&h.InProgress)},t.prototype.isBaseLoaded=function(){return t.checkLoadFinished(this.state[f.Base])},t.prototype.isBaseUnloaded=function(){return this.state[f.Base]===h.Pending},t.prototype.isDestroyed=function(){return this.state[f.Base]===h.Destroyed},t.prototype.isDependenciesLoaded=function(){return t.checkLoadFinished(this.state[f.Dependencies])},t.prototype.isDependenciesUnloaded=function(){return h.Pending===this.state[f.Dependencies]},t.prototype.applyPropertiesLoaded=function(e,t){},t.prototype.applyPropertiesUnloaded=function(e){},t.prototype.getType=function(){return this.get("type")},t.prototype.getDescription=function(){return this.get("description")},t.prototype.setDescription=function(e){return this.set("description",e)},t.prototype.createRuntimeData=function(e){e()},t.prototype.getDataSize=function(e,t){return this.getDependencies().reduce(function(r,i){return!t||i instanceof t?r+i[e]():r},this[e]())},t.prototype.propertyChanged=function(e){t.checkLoadFinished(this.state[f.Base])&&this.applyPropertiesLoaded(e,"propertyChanged"),this.applyPropertiesUnloaded(e)},t.prototype.startTimer=function(e){var t=this,r=0,i=function(n){(r+=n)>=e&&(t.engine.off("update",i,t),t.trigger("endTimer"))};this.engine.on("update",i,this)},t.events={load:{parameters:[],action:!1,category:"Loading"},loadBase:{parameters:[],action:!1,category:"Loading"},loadDependencies:{parameters:[],action:!1,category:"Loading"},startTimer:{parameters:[{name:"time",description:"The time (in seconds) that will elapse before the 'endTimer' event will be fired.",type:"f",default:5}],action:!0,category:"General"},endTimer:{parameters:[],action:!1,category:"General"}},t.validators={},t.defaults={},t.schema={},t}(t.baseEntityMixins);t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.on("setVisible",this.setVisible,this),this.on("setInvisible",this.setInvisible,this),this.on("toggleVisibility",this.toggleVisibility,this),this.on("change:children",this.onChildrenChanged,this)},t.prototype.uninitialize=function(){this.off("setVisible",this.setVisible,this),this.off("setInvisible",this.setInvisible,this),this.off("toggleVisibility",this.toggleVisibility,this),this.off("change:children",this.onChildrenChanged,this),this.uninitPrefabBindings(),e.prototype.uninitialize.call(this)},t.prototype.getRootObject=function(){var e=this.getParentObject();return e?e.getRootObject():this},t.prototype.reset=function(){this.runtimeData&&(this.runtimeData.position.copy(this.getPosition()),this.runtimeData.quaternion.copy(this.getQuaternion()),this.runtimeData.scale.copy(this.getScale()))},t.prototype.createRuntimeData=function(e){this.runtimeData=new a.Object3D,this.runtimeData.name=this.getRuntimeName(),e()},t.prototype.clone=function(t,r){void 0===r&&(r=!0);var i=e.prototype.clone.call(this,t);if(i.set("parentId",null),i.set("prefabAssetId",this.get("prefabAssetId")),i.set("prefabObjectId",this.get("prefabObjectId")),r){this.getChildren().forEach(function(e){var t=e.clone(void 0,r);i.addChild(t)}),this.isInstanceTop()&&i.traverse(function(e){e.set("prefabInstanceId",i.id)})}return i},t.prototype.alignToPosition=function(e,t){var r=new a.Vector3(e.x||0,e.y||0,e.z||0),n=this.getQuaternion(),o=this.getScale(),s=this.getCenter(),u=new a.Quaternion(n.x,n.y,n.z,n.w),p=this.getBounds(),c={};c.min=new a.Vector3(p.min.x,p.min.y,p.min.z),c.max=new a.Vector3(p.max.x,p.max.y,p.max.z),(c.min.x>c.max.x||c.min.y>c.max.y||c.min.z>c.max.z)&&(c.min.x=c.min.y=c.min.z=0,c.max.x=c.max.y=c.max.z=0),c.min.applyQuaternion(u),c.max.applyQuaternion(u);var l=new a.Vector3(s.x,s.y,s.z);l.applyQuaternion(u),c.min.multiply(o),c.max.multiply(o),l.multiply(o),t&&Object.keys(t).forEach(function(e){var i=Math.min(c.min[e],c.max[e]),n=Math.max(c.min[e],c.max[e]),a=.5*t[e]+.5;r[e]-=(1-a)*i+a*n}),this.setProperty("position",i.__assign({},r))},t.prototype.getPosition=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("position")),t},t.prototype.setPosition=function(e,t,r){if(void 0===r)throw new Error("Calling setPosition with invalid arguments. Expected setPosition( x, y, z ).");this.setProperty("position",{x:e,y:t,z:r})},t.prototype.getQuaternion=function(e){var t=e||new a.Quaternion;return t.copy(this.getProperty("quaternion")),t},t.prototype.setQuaternion=function(e,t,r,i){if(void 0===i)throw new Error("Calling setQuaternion with invalid arguments. Expected setQuaternion( x, y, z, w ).");this.setProperty("quaternion",{x:e,y:t,z:r,w:i})},t.prototype.getScale=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("scale")),t},t.prototype.setScale=function(e,t,r){if(void 0===r)throw new Error("Calling setScale with invalid arguments. Expected setScale( x, y, z ).");this.setProperty("scale",{x:e,y:t,z:r})},t.prototype.getCenter=function(e){var t=e||new a.Vector3,r=this.getBounds();return t.copy(r.min),t.add(r.max),t.multiplyScalar(.5),t},t.prototype.setVisible=function(){this.setProperty("visible",!0),this.engine.needsRender=!0},t.prototype.setInvisible=function(){this.setProperty("visible",!1),this.engine.needsRender=!0},t.prototype.toggleVisibility=function(){var e=!this.getProperty("visible");this.setProperty("visible",e),this.engine.needsRender=!0},t.prototype.loadBase=function(t){e.prototype.loadBase.call(this,t),this.isInstance()&&this.initPrefabBindings()},t.prototype.reloadBase=function(t){var r=this;this.isInstance()&&this.uninitPrefabBindings();var i=this.runtimeData&&this.runtimeData.parent;i&&i.remove(this.runtimeData);var n=this.runtimeData&&this.runtimeData.children;e.prototype.reloadBase.call(this,function(){i&&i.add(r.runtimeData),n&&n.forEach(function(e){return r.runtimeData.add(e)}),"function"==typeof t&&t()})},t.prototype.unload=function(t){var r=this;if(void 0===t&&(t=!1),this.runtimeData&&this.runtimeData.parent&&this.runtimeData.parent.remove(this.runtimeData),t){this.getChildIds().forEach(function(e){var i=r.engine.getObjectById(e);i&&i.unload(t)})}e.prototype.unload.call(this)},t.prototype.destroy=function(){this.engine.destroyObjectById(this.id)},t.prototype.traverse=function(e){e(this,this.getParentObject()),this.getChildren().forEach(function(t){return t.traverse(e)})},t.prototype.traverseWhile=function(e){return!!e(this,this.getParentObject())||this.getChildren().some(function(t){return t.traverseWhile(e)})},t.prototype.traverseSome=function(e){e(this,this.getParentObject())||this.getChildren().forEach(function(t){return t.traverseSome(e)})},t.prototype.getAncestors=function(e){var t=this.getParentObject();return t?e&&!e(t)?t.getAncestors(e):[t].concat(t.getAncestors(e)):[]},t.prototype.getDescendants=function(e){var t=this,r=[],i="function"!=typeof e;return this.traverse(function(n){n!==t&&(i||e(n))&&r.push(n)}),r},t.prototype.getDescendant=function(e){var t,r=this,i="function"!=typeof e;return this.traverseWhile(function(n){if(n!==r&&!t&&(i||e(n)))return t=n,!0}),t},t.prototype.getDescendantById=function(e){return this.getDescendant(function(t){return t.id===e})},t.prototype.getDescendantByName=function(e){return this.getDescendant(function(t){return t.getName()===e})},t.prototype.getDescendantByType=function(e){return this.getDescendant(function(t){return t.type===e})},t.prototype.getDescendantByClass=function(e){return this.getDescendant(function(t){return t instanceof e})},t.prototype.getDescendantsByType=function(e){return this.getDescendants(function(t){return t.type===e})},t.prototype.getDescendantsByClass=function(e){return this.getDescendants(function(t){return t instanceof e})},t.prototype.getDescendantsByName=function(e){return this.getDescendants(function(t){return t.getName()===e})},t.prototype.getChildById=function(e){return-1!==this.sharedData.children.indexOf(e)?this.engine.getObjectById(e):null},t.prototype.getChild=function(e){var t=this.getChildren(e);return t.length?t[0]:null},t.prototype.getChildren=function(e){var t=this,r="function"!=typeof e;return this.getChildIds().filter(function(i){var n=t.getChildById(i);return n&&(r||e(n))}).map(function(e){return t.engine.getObjectById(e)})},t.prototype.getChildrenMap=function(e){var t={};return this.getChildren(e).forEach(function(e){e&&(t[e.id]=e)}),t},t.prototype.getParentObject=function(){return this.engine.getObjectById(this.get("parentId"))},t.prototype.addChild=function(e,t){this.addChildById(e.id,t)},t.prototype.addChildById=function(e,t){if(!this.engine.getObjectById(e))throw new Error("Can't find child object with id, "+e);this.engine.entityDispatcher.dispatchChildAdded(this.id,e,t)},t.prototype.removeChild=function(e,t){this.removeChildById(e.id,t)},t.prototype.removeChildById=function(e,t){if(!this.getChildById(e))return void n.default.warn("Object, "+e+", is not a child of this object");this.engine.entityDispatcher.dispatchChildRemoved(this.id,e,t)},t.prototype.getChildIds=function(e){return"function"!=typeof e?this.sharedData.children.slice():this.sharedData.children.filter(function(t){return e(t)})},t.prototype.setChildIds=function(e,t){void 0===t&&(t=!1),this.engine.entityDispatcher.dispatchChildChanged(this.id,e,t)},t.prototype.scaleToSize=function(e){var t={},r=this.getBounds();t.min=new a.Vector3(r.min.x,r.min.y,r.min.z),t.max=new a.Vector3(r.max.x,r.max.y,r.max.z);var i=t.min.x>t.max.x||t.min.y>t.max.y||t.min.z>t.max.z,n=t.min.distanceTo(t.max),o=n>0?e/n:1;(o<=0||i)&&(o=1),this.setProperty("scale",{x:o,y:o,z:o})},t.prototype.getBounds=function(e){var t=this.getProperty("bounds"),r=e||new a.Box3;return t?r.set(t.min,t.max):this.computeBounds(r)},t.prototype.getSphericalBounds=function(e){var t=e||new a.Sphere,r=this.getBounds();return t.radius=t.center.subVectors(r.max,r.min).multiplyScalar(.5).length(),t.center.addVectors(r.max,r.min).multiplyScalar(.5),t},t.prototype.getLocalBounds=function(e){var t=e||new a.Box3;return t.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),t.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),t},t.prototype.computeBounds=function(e){var t=this.getChildren(),r=this.getLocalBounds(e||new a.Box3),i=new a.Matrix4;return t.forEach(function(e){var t=e.computeBounds();t.isEmpty()||(i.compose(e.getPosition(),e.getQuaternion(),e.getScale()),t.applyMatrix4(i),r.union(t))}),this.setProperty("bounds",{min:{x:r.min.x,y:r.min.y,z:r.min.z},max:{x:r.max.x,y:r.max.y,z:r.max.z}}),r},t.prototype.getPreviousProperty=function(e){if(this.computePropertyFunctions[e]){var t=this.sharedData.previousProperties[e],r=void 0;return r=this.getPrefabObject()?this.getPrefabProperty(e):this.getDefaultProperty(e),this.computePropertyFunctions[e](t,r)}var i=this.sharedData.previousProperties[e];if(void 0!==i)return i;var n=this.getPrefabObject();return n?n.getProperty(e):this.getDefaultProperty(e)},t.prototype.getProperty=function(e){var t=this.getOwnProperty(e);if(this.computePropertyFunctions[e]){var r=void 0;return r=this.getPrefabObject()?this.getPrefabProperty(e):this.getDefaultProperty(e),this.computePropertyFunctions[e](t,r)}if(void 0!==t)return t;var i=this.getPrefabProperty(e);return i||this.getDefaultProperty(e)},t.prototype.getProperties=function(){var e=this,t=this.getDefaultProperties(),r={};return Object.keys(t).forEach(function(t){r[t]=e.getProperty(t)}),r},t.prototype.getInstanceTop=function(){var e=this.get("prefabInstanceId");return e?this.engine.getObjectById(e):null},t.prototype.getPrefabObject=function(){return this.engine.getObjectById(this.get("prefabObjectId"))},t.prototype.getPrefabProperty=function(e){var t=this.getPrefabObject();if(t)return t.getProperty(e)},t.prototype.isInstance=function(){return!!this.get("prefabObjectId")},t.prototype.isInstanceTop=function(){return this.get("prefabInstanceId")===this.id},t.prototype.breakPrefabLink=function(e){if(void 0===e&&(e=!0),!this.isInstance())throw new Error("breakPrefabLink: Can't call this on an entity that isn't an instance.");e&&this.getChildren().forEach(function(t){t.breakPrefabLink(e)}),this.uninitPrefabBindings(),this.mergeProperties(this.getPrefabObject());var t={};t.prefabInstanceId=void 0,t.prefabObjectId=void 0,t.prefabAssetId=void 0},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("static")){var i=this.getProperty("static");this.runtimeData.matrixAutoUpdate=!i,this.runtimeData.rotationAutoUpdate=!i,i&&(this.runtimeData.matrixWorldNeedsUpdate=!0,this.runtimeData.updateMatrix())}if(t.hasOwnProperty("visible")&&(this.runtimeData.visible=this.getProperty("visible")),t.hasOwnProperty("castShadow")&&(this.runtimeData.castShadow=this.getProperty("castShadow")),t.hasOwnProperty("receiveShadow")&&(this.runtimeData.receiveShadow=this.getProperty("receiveShadow")),t.hasOwnProperty("frustumCulled")&&(this.runtimeData.frustumCulled=this.getProperty("frustumCulled")),t.hasOwnProperty("position")){var n=this.getPosition();this.runtimeData.position.set(n.x,n.y,n.z)}if(t.hasOwnProperty("quaternion")){var a=this.getQuaternion();this.runtimeData.quaternion.set(a.x,a.y,a.z,a.w)}if(t.hasOwnProperty("scale")){var o=this.getScale();this.runtimeData.scale.set(o.x,o.y,o.z)}this.engine.needsRender=!0},t.prototype.getRuntimeName=function(){return this.engine.getRuntimeName(this.getSid())},t.prototype.initPrefabBindings=function(){var e=this.getPrefabObject();e&&e.on("change:properties",this.onPrefabEntityChanged,this)},t.prototype.uninitPrefabBindings=function(){var e=this.getPrefabObject();e&&e.off("change:properties",this.onPrefabEntityChanged,this)},t.prototype.onPrefabEntityChanged=function(){n.default.warn("TODO - re-implement updating from prefab changes")},t.prototype.onChildLoaded=function(e){var t=this;this.when("loadBase",function(){t.runtimeData.add(e.runtimeData),t.engine.needsRender=!0})},t.prototype.onChildrenChanged=function(e,t){var r=this;t.forEach(function(e){e&&(e.set("parentId",null),r.unregisterDependency(e),r.stopListening(e,"loadBase",r.onChildLoaded),r.isBaseLoaded()&&e.isBaseLoaded()&&(r.runtimeData.remove(e.runtimeData),r.engine.needsRender=!0))}),e.forEach(function(e){var t=e.getParentObject();t&&t.id!==r.id&&t.removeChildById(e.id,!0),e.set("parentId",r.id),r.listenTo(e,"loadBase",r.onChildLoaded),e.isBaseLoaded()&&(r.isBaseLoaded()?(r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0):r.when("loadBase",function(){r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0})),r.registerDependency(e)}),this.unsetProperty("bounds"),this.getAncestors().forEach(function(e){return e.unsetProperty("bounds")})},t.events={toggleVisibility:{parameters:[],action:!0,category:"Rendering"},setVisible:{parameters:[],action:!0,category:"Rendering"},setInvisible:{parameters:[],action:!0,category:"Rendering"}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={LOAD:"load",STATE_CHANGE:"state_change",CANCEL:"cancel",ERROR:"error",PROGRESS:"progress",DONE:"done"};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(6),o=r(3);(function(e){e[e.Normal=101]="Normal",e[e.Stereo2dOverUnder=102]="Stereo2dOverUnder",e[e.Stereo2dUnderOver=103]="Stereo2dUnderOver",e[e.Stereo2dLeftRight=104]="Stereo2dLeftRight",e[e.Stereo2dRightLeft=105]="Stereo2dRightLeft",e[e.StereoCubeHorizontal=106]="StereoCubeHorizontal"})(t.ImageLayout||(t.ImageLayout={}));var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadedBytes=0,t}return i.__extends(t,e),t.getThreeImageFormat=function(e){switch(e){case"alpha":return n.AlphaFormat;case"rgb":return n.RGBFormat;case"rgba":return n.RGBAFormat;case"luminance":return n.LuminanceFormat;case"luminanceAlpha":return n.LuminanceAlphaFormat;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.RGBFormat"),n.RGBFormat}},t.getThreeImageEncoding=function(e){switch(e){case"linear":return n.LinearEncoding;case"srgb":return n.sRGBEncoding;case"gamma":return n.GammaEncoding;case"rgbe":return n.RGBEEncoding;case"logLuv":return n.LogLuvEncoding;case"rgbm7":return n.RGBM7Encoding;case"rgbm16":return n.RGBM16Encoding;case"rgbd":return n.RGBDEncoding;case"depth":return n.BasicDepthPacking;case"rgbaDepth":return n.RGBADepthPacking;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.sRGBEncoding"),n.sRGBEncoding}},t.getThreeDataType=function(e){switch(e){case"uByte":return n.UnsignedByteType;case"byte":return n.ByteType;case"short":return n.ShortType;case"uShort":return n.UnsignedShortType;case"int":return n.IntType;case"uInt":return n.UnsignedIntType;case"float":return n.FloatType;case"halfFloat":return n.HalfFloatType;case"uShort4444":return n.UnsignedShort4444Type;case"uShort5551":return n.UnsignedShort5551Type;case"uShort565":return n.UnsignedShort565Type;default:return o.default.warn("Unexpected format: "+e+", defaulting to THREE.UnsignedByteType"),n.UnsignedByteType}},t.getChannelCountFromFormat=function(e){switch(e){case"alpha":case"luminance":return 1;case"luminanceAlpha":return 2;case"rgb":return 3;case"rgba":return 4;default:return 0}},t.prototype.unload=function(){this.loadedBytes=0,e.prototype.unload.call(this)},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.getDataSizeLoadedSelf=function(){return this.loadedBytes},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),this.engine.trigger("imageChanged",this.id,t)},t.prototype.getDataSizeDownloadSelf=function(){return this.chosenRepresentation?this.chosenRepresentation.contentLength:1},t.prototype.getFormat=function(){return"rgb"},t.prototype.isPowerOfTwo=function(){var e=this.getWidth(),t=this.getHeight();return n.Math.isPowerOfTwo(e)&&n.Math.isPowerOfTwo(t)},t.prototype.getWidth=function(){var e=this.getMaxRepresentationWidth(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getHeight=function(){var e=this.getMaxRepresentationHeight(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getMaxRepresentationWidth=function(){return 0},t.prototype.getMaxRepresentationHeight=function(){return 0},t.prototype.getOriginalWidth=function(){return 0},t.prototype.getOriginalHeight=function(){return 0},t.prototype.getMaxTextureSize=function(){return Number.MAX_VALUE},t}(a.default);t.default=s},function(e,t,r){"use strict";function i(e,t){if(void 0!==e&&null!==e)return Array.isArray(e)?e.forEach(t):void Object.keys(e).forEach(function(r){t(e[r],r)})}function n(e){return Array.isArray(e)?[].concat.apply([],e.map(function(e){return n(e)})):e}function a(e,t){return e.reduce(function(e,r){return e[r[t]]=r,e},{})}function o(e,t){return n(u(e,t))}function s(e){return e}function u(e,t){var r;return void 0===e||null===e?e:Array.isArray(e)?e.map(t):(r={},Object.keys(e).forEach(function(i){r[i]=t(e[i],i)}),r)}function p(e,t){return Object.keys(e).reduce(function(r,i){return-1===t.indexOf(i)&&(r[i]=e[i]),r},{})}e.exports={each:i,flatMap:o,flatten:n,identity:s,indexBy:a,map:u,omit:p}},function(e,t,r){"use strict";function i(e,t){var r=Math.floor(e);return t||{r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255}}Object.defineProperty(t,"__esModule",{value:!0});var n,a=r(0),o=r(3),s=r(1),u=r(6),p=r(5),c=r(4),l=r(240);(function(e){e[e.STANDIN_TEXTURE_WHITE=0]="STANDIN_TEXTURE_WHITE",e[e.STANDIN_TEXTURE_WHITE_CUBE=1]="STANDIN_TEXTURE_WHITE_CUBE",e[e.STANDIN_TEXTURE_BLACK=2]="STANDIN_TEXTURE_BLACK",e[e.STANDIN_TEXTURE_BLACK_CUBE=3]="STANDIN_TEXTURE_BLACK_CUBE",e[e.STANDIN_TEXTURE_NORMAL=4]="STANDIN_TEXTURE_NORMAL"})(n=t.StandInTexture||(t.StandInTexture={}));var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.listenTo(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.uninitialize=function(){e.prototype.uninitialize.call(this),this.stopListening(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.getProperty=function(t){var r=e.prototype.getProperty.call(this,t);if(void 0===r){var i=this.getShader().getProperty("parameters");i[t]&&(r=i[t].default)}return r},t.prototype.getDefaultProperties=function(){var t=e.prototype.getDefaultProperties.call(this),r=this.getShader().getProperty("parameters");return Object.keys(r).forEach(function(e){t[e]=r[e].default}),t},t.prototype.verifyProperty=function(r,i){return!t.schema.properties[r]||e.prototype.verifyProperty.call(this,r,i)},t.prototype.setProperty=function(r,n,a){if(t.schema.properties[r])return e.prototype.setProperty.call(this,r,n,a);var s=this.getShader(),u=s.getProperty("parameters");if(u[r]){var p,c=u[r].type;if("t"===c&&("string"==typeof n||null===n)||"f"===c&&"number"==typeof n||"b"===c&&"boolean"==typeof n||"i"===c&&"number"==typeof n&&Math.round(n)===n||"opt"===c&&u[r].options.hasOwnProperty(n))p=n;else if("c"===c){if(p=this.sharedData.properties.hasOwnProperty(r)&&"object"==typeof this.sharedData.properties[r]?this.sharedData.properties[r]:{r:0,g:0,b:0},"string"==typeof n){var l=n;"0x"!==l.slice(0,2)&&(l=String(parseInt(l,10)),l="0x"+l.toString()),i(parseInt(l,16),p)}else if("number"==typeof n){var d=Math.max(0,Math.max(16777215,n));i(d,p)}else if(n&&"number"==typeof n.r&&"number"==typeof n.g&&"number"==typeof n.b){p.r=n.r,p.g=n.g,p.b=n.b;var h=u[r].min,f=u[r].max;void 0!==h&&(p.r=Math.max(p.r,h),p.g=Math.max(p.g,h),p.b=Math.max(p.b,h)),void 0!==f&&(p.r=Math.min(p.r,f),p.g=Math.min(p.g,f),p.b=Math.min(p.b,f))}}else"v"===c.charAt(0)&&"number"==typeof n.x&&"number"==typeof n.y?(p=this.sharedData.properties.hasOwnProperty(r)?this.sharedData.properties[r]:{},p.x=n.x,p.y=n.y,"v3"===c&&"number"==typeof n.z?p.z=n.z:"v4"===c&&"number"==typeof n.z&&"number"==typeof n.w&&(p.z=n.z,p.w=n.w)):void 0===n?p=void 0:o.default.error("Wrong type specified for "+r);this.engine.entityDispatcher.dispatchPropertyChanged(this.id,r,p,a)}},t.prototype.getReferencedAssetsList=function(e){var t=this,r=[],i={},n=this.getShader(),a=n.getProperty("parameters");return p.forEach(a,function(n,a){var o,s;"t"===n.type&&(t.isParameterUsed(a)&&(o=t.getProperty(a)),o&&(s=t.engine.getAssetById(o),i[o]?e&&r.push(s):(i[o]=s,r.push(s))))}),r},t.prototype.getShader=function(){var t=e.prototype.getProperty.call(this,"shaderId");return this.engine.getAssetById(t)||(t=this.getDefaultProperty("shaderId")),this.engine.getAssetById(t)},t.prototype.isParameterEditable=function(e){var t=this.getShader();if(!t)return!1;var r=t.getProperty("parameters");return!!r[e]&&(!r[e].displayWhen||this.testParameterConditions(r[e].displayWhen))},t.prototype.getStandInTexture=function(e,t){var r=this.engine.getAssetById(this.getProperty(e));if(r){var i;return t?"normal"===t?i=n.STANDIN_TEXTURE_NORMAL:"bump"===t&&(i=r.isCubeMap()?n.STANDIN_TEXTURE_BLACK:n.STANDIN_TEXTURE_BLACK_CUBE):i=r.isCubeMap()?n.STANDIN_TEXTURE_WHITE_CUBE:n.STANDIN_TEXTURE_WHITE,this.engine.materialUtilities.getStandInTexture(i)}},t.prototype.unload=function(){var t=this;if(this.getDependencies().forEach(function(e){return t.stopListening(e,"load")}),this.runtimeData){this.engine.trigger("materialUnloaded",this.id),o.default.info(this.engine.getName()+" - Unloading material, "+this.getName());for(var r in this.runtimeData)this.runtimeData.hasOwnProperty(r)&&(this.runtimeData[r].dispose(),delete this.runtimeData[r]);this.runtimeData=null,e.prototype.unload.call(this)}},t.prototype.applyPropertiesLoaded=function(r,i){var n=this;if(e.prototype.applyPropertiesLoaded.call(this,r,i),r.hasOwnProperty("shaderId")){var a=this.getShader(),o=this.getPreviousProperty("shaderId");if(o!==a.id&&"init"!==i&&this.getThreeConstructor()!==this.getThreeConstructor(o))return void this.reloadBase();a.when("load",function(){p.forEach(t.materialObjectTypes,function(e,t){var r=n.runtimeData[t];r instanceof s.ShaderMaterial&&(r.vertexShader=a.runtimeData.vertexShader,r.fragmentShader=a.runtimeData.fragmentShader,r.uniforms=s.UniformsUtils.clone(a.runtimeData.uniforms),n.addSharedUniforms(r.uniforms)),r.needsUpdate=!0}),n.updateMaterialDefines(),n.updateShaderParameters(n.getProperties()),n.updateTransparency(),n.updateDerivatives(),n.engine.needsRender=!0}),a.isUnloaded()&&a.load()}else{var u=this.getShader(),c=u.getProperty("parameters"),l=!1,d=!1,h=!1;for(var f in r)if(r.hasOwnProperty(f)&&c[f]){if(c[f].transparency&&(l=!0),void 0!==c[f].derivatives&&(d=!0),u.getDependentParameters(f).length||c[f].forceUpdate){h=!0;break}this.updateShaderParameter(f)}h&&(this.updateMaterialDefines(),this.updateShaderParameters(this.getProperties()),l=!0,d=!0),l&&this.updateTransparency(),d&&this.updateDerivatives(),this.engine.needsRender=!0}},t.prototype.applyPropertiesUnloaded=function(t){var r=this;void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t);var i,n,a=this.getShader(),o=a.getProperty("parameters"),s=!1;t&&(t.hasOwnProperty("shaderId")&&this.cleanShaderParameters(),p.forEach(t,function(e,t){o[t]&&("t"===o[t].type&&(i=r.getProperty(t),n=r.getPreviousProperty(t),r.isParameterUsed(t)?n!==i&&(r.registerDependencyById(i),r.unregisterDependencyById(n)):n!==i&&(s=!0)),(a.getDependentParameters(t).length||o[t].forceUpdate)&&(s=!0))}),s&&this.resetDependencies())},t.prototype.createRuntimeData=function(e){var r=this,i=this.getShader();i.when("load",function(){r.runtimeData={};var n={},a=r.getThreeConstructor();a===s.ShaderMaterial&&(n.vertexShader=i.runtimeData.vertexShader,n.fragmentShader=i.runtimeData.fragmentShader,n.uniforms=s.UniformsUtils.clone(i.runtimeData.uniforms),r.addSharedUniforms(n.uniforms)),Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e]=new a(n),r.runtimeData[e].name=r.getName();var i=t.materialObjectTypes[e];p.forEach(i,function(t,i){r.runtimeData[e].hasOwnProperty(i)&&(r.runtimeData[e][i]=p.deepClone(t))})}),e()},this),i.isUnloaded()&&i.load()},t.prototype.getThreeConstructor=function(e){var t=e?this.engine.getAssetById(e):this.getShader();if(!t)throw new Error("Bad or unknown shader ID, "+e);t.isUnloaded()&&t.load();var r;switch(t.runtimeData.vertexShader){case"MeshStandardMaterial":r=s.MeshStandardMaterial;break;case"MeshPhysicalMaterial":r=s.MeshPhysicalMaterial;break;case"MeshPhongMaterial":r=s.MeshPhongMaterial;break;case"MeshLambertMaterial":r=s.MeshLambertMaterial;break;default:r=s.ShaderMaterial}return r},t.prototype.testParameterCondition=function(e,t){var r=this.getShader(),i=r.getProperty("parameters");if(!i[e])return!1;var n=this.getProperty(e);"t"===i[e].type&&(this.engine.getAssetById(n)||(n=null));for(var a in t)if(t.hasOwnProperty(a))switch(a){case"equals":if(!p.shallowEquals(n,t[a]))return!1;break;case"notEquals":if(p.shallowEquals(n,t[a]))return!1;break;case"equalsDefault":if(!p.shallowEquals(n,i[e].default))return!1;break;case"notEqualsDefault":if(p.shallowEquals(n,i[e].default))return!1;break;default:return!1}return!0},t.prototype.testParameterConditions=function(e){var t=!0;for(var r in e)if(e.hasOwnProperty(r))if("or"===r){if(!this.testParameterConditionsOr(e[r])){t=!1;break}}else if(!this.testParameterCondition(r,e[r])){t=!1;break}return t},t.prototype.testParameterConditionsOr=function(e){for(var t=!1,r=0,i=e;r<i.length;r++){var n=i[r];if(this.testParameterConditions(n)){t=!0;break}}return t},t.prototype.getPreprocessorDefines=function(){var e=this,t=this.getShader(),r=t.getProperty("parameters"),i={};return p.forEach(r,function(t,r){var n=!1;if(t.enabledWhen?e.testParameterConditions(t.enabledWhen)&&(n=!0):t.isRenderParam||(n=!0),n){var a=l.default(r);if(i[a]=0,"opt"===t.type)i[a]=t.options[e.getProperty(r)];else if("t"===t.type){var o=e.getProperty(r),s=e.engine.getAssetById(o),u=a+"_NUM_MIPS";if(i[u]=s?s.getMipCount():0,s){var p=a+"_USE_"+l.default(s.getProperty("textureUse"));i[p]=0;var c=a+"_TYPE_"+l.default(s.getProperty("mappingType"));i[c]=0;var d=a+"_TEX_TYPE_"+(s.isCubeMap()?"CUBE":"2D");i[d]=0;var h=a+"_ENCODING_"+l.default(s.getProperty("encoding"));i[h]=0}}t.defines&&Object.assign(i,t.defines)}}),i},t.prototype.updateMaterialDefines=function(){var e=this,r=this.getPreprocessorDefines(),i=t.materialObjectTypes;Object.keys(i).forEach(function(t){var n=a.__assign({},r),o=i[t];if(o.defines){Object.keys(o.defines).forEach(function(e){n[e]=o.defines[e]})}e.runtimeData[t].defines=n,e.runtimeData[t].needsUpdate=!0})},t.prototype.addSharedUniforms=function(e){e&&(e.time=t.sharedUniforms.time,e.screenDimensions=t.sharedUniforms.screenDimensions)},t.prototype.cleanShaderParameters=function(){var e=this,r=this.getShader(),i=this.getPreviousProperty("shaderId"),n=r.getProperty("parameters"),a=this.engine.getAssetById(i),o=i!==r.id?a.getProperty("parameters"):n;Object.keys(this.getOwnProperties()).forEach(function(r){n[r]||t.schema.properties[r]||(o[r]&&"t"===o[r].type&&e.unregisterDependencyById(e.getProperty(r)),e.unsetProperty(r,!0))})},t.prototype.updateShaderParameters=function(e){var t=this,r=this.getShader(),i=r.getProperty("parameters");p.forEach(e,function(e,r){i[r]&&t.updateShaderParameter(r)})},t.prototype.resetDependencies=function(){var e=this;this.unregisterDependencies(),this.getReferencedAssetsList(!0).forEach(function(t){return e.registerDependency(t)})},t.prototype.updateDerivatives=function(){var e=this,t=this.getShader(),r=t.getProperty("parameters"),i=!1;p.forEach(r,function(t,r){t.derivatives&&e.isParameterUsed(r)&&(i=!0)}),this.setExtension("derivatives",i)},t.prototype.updateTransparency=function(){var e=this,r=this.getShader(),i=r.getProperty("parameters"),n=!1;for(var a in i)if(i.hasOwnProperty(a)&&(n=this.testParameterTransparency(a)))break;this.runtimeData&&Object.keys(t.materialObjectTypes).forEach(function(t){e.runtimeData[t].transparent=n})},t.prototype.testParameterTransparency=function(e){var t,r=this.getShader(),i=r.getProperty("parameters");if(i.hasOwnProperty(e)&&(t=i[e].transparency)&&this.isParameterUsed(e)){if("LessThanOne"===t)return this.getProperty(e)<1;if("GreaterThanOne"===t)return this.getProperty(e)>1;if("NotFalsy"===t)return this.getProperty(e);if("HasAlpha"===t&&"t"===i[e].type){var n=this.engine.getAssetById(this.getProperty(e));return n&&"rgba"===n.getFormat()}}return!1},t.prototype.isParameterUsed=function(e){var t,r=this.getShader(),i=!1;if(r)return t=r.getProperty("parameters"),t[e]&&(i=!t[e].enabledWhen||this.testParameterConditions(t[e].enabledWhen)),i},t.prototype.onTextureLoaded=function(e){var r=this;if(!e.isLoadFailed()){var i=e.getThreeTexture();if(i){var n=this.getShader();if(n){var a=n.getProperty("parameters"),o=Object.keys(a).filter(function(t){return"t"===a[t].type&&r.isParameterUsed(t)&&r.getProperty(t)===e.id});o.forEach(function(e){r.setThreeValue(e,i)});o.some(function(e){return a[e].forceUpdate})&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0}),this.engine.needsRender=!0}}}},t.prototype.updateShaderParameter=function(e){var r=this,i=this.getShader(),n=i.getProperty("parameters"),a=n[e];if(a){var o=!0,s=this.getProperty(e);switch(a.type.charAt(0)){case"t":var u=this.engine.getAssetById(s);if(u&&this.isParameterUsed(e)){var p=this.getPreviousProperty(e);if(p!==this.getProperty(e)){var c=this.engine.getEntityById(p);c&&this.stopListening(c,"loadBase",this.onTextureLoaded)}this.stopListening(u,"loadBase",this.onTextureLoaded),this.listenTo(u,"loadBase",this.onTextureLoaded),s=this.getStandInTexture(e,a.textureUsage),this.engine.needsRender=!0,u.isUnloaded()?u.load():u.isBaseLoaded()&&this.onTextureLoaded.call(this,u),u.isBaseLoaded()&&(o=!1)}else s=null;break;case"b":a.animation&&s&&(t.timeValueInUse=!0),s=s?1:0;break;case"v":a.animation&&(s.x||s.y||s.z||s.w)&&(t.timeValueInUse=!0);break;case"o":s=a.options[s]}o&&this.setThreeValue(e,s),a.forceUpdate&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0})}},t.prototype.getThreeValue=function(e,t){var r,i=this.getShader(),n=i.getProperty("parameters"),a=n[e],o=a.uniformName||e;if(a.isRenderParam)r=this.runtimeData[t][o];else if(a.isUniform){var u=this.runtimeData[t].uniforms[o];r=u?u.value:null}if("c"===a.type)r||(r=new s.Color(a.default.r,a.default.g,a.default.b));else if("v"===a.type.charAt(0)&&!r){var p=a.default;switch(a.type.charAt(1)){case"4":r=new s.Vector4(p.x,p.y,p.z,p.w);break;case"3":r=new s.Vector3(p.x,p.y,p.z);break;case"2":r=new s.Vector2(p.x,p.y)}}return r},t.prototype.setThreeValue=function(e,r){var i=this;if(this.runtimeData){var n=this.getShader(),a=n.getProperty("parameters"),o=a[e],s=o.uniformName||e;Object.keys(t.materialObjectTypes).forEach(function(t){var n=i.getThreeValue(e,t);if("c"===o.type)n.setRGB(r.r,r.g,r.b);else if("b"===o.type)n=!!r;else if("v"===o.type.charAt(0))switch(o.type.charAt(1)){case"4":n.w=r.w;case"3":n.z=r.z;case"2":n.x=r.x,n.y=r.y}else"t"===o.type?(n&&r&&n.encoding===r.encoding&&n.mapping===r.mapping||(i.runtimeData[t].needsUpdate=!0),n=r):n=r;if(o.isUniform){var a=i.runtimeData[t].uniforms[s];if(!a)throw new Error("Trying to set non-existent uniform "+s);a.value=n}o.isRenderParam&&(i.runtimeData[t][s]=n)})}},t.prototype.setExtension=function(e,r){var i=this;this.runtimeData&&Object.keys(t.materialObjectTypes).forEach(function(t){i.runtimeData[t].extensions&&i.runtimeData[t].extensions.hasOwnProperty(e)&&(i.runtimeData[t].extensions[e]=r)})},t.prototype.onTextureDeleted=function(e){var t=this,r=this.getOwnProperties();Object.keys(r).filter(function(t){return r[t]===e}).forEach(function(e){t.setProperty(e,null)})},t.builtInAssetDescriptors={missingMaterial:{id:"missingMaterial",type:"material",properties:{name:"Missing Material",albedoColor:{r:.8275,g:.8275,b:.8275}}}},t.materialObjectTypes={static:{lights:!0,fog:!0,skinning:!1},skinned:{lights:!0,fog:!0,skinning:!0},staticTangents:{lights:!0,fog:!0,skinning:!1,defines:{USE_TANGENTS:!0}},skinnedTangents:{lights:!0,fog:!0,skinning:!0,defines:{USE_TANGENTS:!0}},depthStatic:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!1,defines:{DEPTH_PASS:!0}},depthSkinned:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!0,defines:{DEPTH_PASS:!0}}},t.sharedUniforms={time:{type:"f",value:0},screenDimensions:{type:"v4",value:new s.Vector4}},t.timeValueInUse=!1,t}(u.default);c.addSchemas("MaterialAsset",d),t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i;(function(e){e[e.BUFFER=1]="BUFFER",e[e.IMAGE=2]="IMAGE",e[e.VIDEO=3]="VIDEO",e[e.ENTITIES=4]="ENTITIES",e[e.JSON=5]="JSON"})(i||(i={})),t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"baseObject",title:"BaseObjectDef",properties:i.__assign({},n.default.properties,{parentId:{type:"string",description:"The ID of the entity's parent."},prefabAssetId:{type:"string"},prefabObjectId:{type:"string"},prefabInstanceId:{type:"string"},children:{type:"array",items:{type:"string"},default:[],description:"The IDs of this entity's children."},previousChildren:{type:"array",items:{type:"string"},default:[],description:"The previous IDs of this entity's children."},properties:{$ref:"baseObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(44),a=i.__assign({},n.default,{id:"baseObjectProperties",title:"BaseObjectPropertiesDef",properties:i.__assign({},n.default.properties,{position:{$ref:"vector3.json",description:"The local-space position of the object.",default:{x:0,y:0,z:0}},quaternion:{$ref:"vector4.json",description:"The local-space orientation of the object.",default:{x:0,y:0,z:0,w:1}},scale:{$ref:"vector3.json",description:"The local-space scale of the object.",default:{x:1,y:1,z:1}},castShadow:{type:"boolean",description:"Controls whether this object casts a shadow.",default:!0},receiveShadow:{type:"boolean",description:"Controls whether casted shadows render on this object.",default:!0},visible:{type:"boolean",description:"Controls whether this object is visible or not.",default:!0},bounds:{$ref:"box3.json",description:"The local-space minimum and maximum extents of this object.#read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){if("node"===e)return e;var t,r=e.match(/(edge(?=\/))\/?\s*(\d+)/i)||[],i=e.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return r.length&&(i=r),/trident/i.test(i[1])?(t=/\brv[ :]+(\d+)/g.exec(e)||[],"IE "+(t[1]||"")):"Chrome"===i[1]&&null!=(t=e.match(/\bOPR\/(\d+)/))?"Opera "+t[1]:(i=i[2]?[i[1],i[2]]:[navigator.appName,navigator.appVersion,"-?"],t=e.match(/version\/(\d+)/i),null!=t&&i.splice(1,1,t[1]),i.join(" "))},n={isMobile:void 0,isIOS:void 0,isAndroid:void 0,isMac:void 0,isLinux:void 0,isUnix:void 0,isWindows:void 0,isChrome:void 0,isFirefox:void 0,isSafari:void 0,isOpera:void 0,isEdge:void 0,isIpad:void 0,isNode:void 0,isIE:void 0,isIE11:void 0,isAndroidTablet:void 0,isTablet:void 0},a="undefined"!=typeof navigator?navigator.userAgent:"node",o=function(){var e=i(a),t={isMobile:/iphone|ipad|ipod|android|blackberry|bb10|mini|windows\sce|palm/i.test(a),isIOS:/iphone|ipad|ipod/i.test(a),isAndroid:/android/i.test(a),isMac:/mac/i.test(a),isLinux:/linux/i.test(a),isUnix:/x11/i.test(a),isWindows:/windows/i.test(a),isChrome:/chrome/i.test(a),isFirefox:/firefox/i.test(a),isSafari:/safari/i.test(a),isOpera:/opera/i.test(a),isEdge:/edge/i.test(a),isIpad:/ipad/i.test(a),isNode:"node"===a,isIE:/ie/i.test(e),isIE11:/ie 11/i.test(e)};t.isAndroidTablet=t.isAndroid&&!/mobile/i.test(a),t.isTablet=t.isIpad||t.isAndroidTablet,Object.keys(t).forEach(function(e){n[e]=t[e]})};o(),t.setUserAgent=function(e){a=e,o()},t.isMobile=function(){return n.isMobile},t.isIOS=function(){return n.isIOS},t.isAndroid=function(){return n.isAndroid},t.isMac=function(){return n.isMac},t.isLinux=function(){return n.isLinux},t.isUnix=function(){return n.isUnix},t.isWindows=function(){return n.isWindows},t.isChrome=function(){return n.isChrome},t.isFirefox=function(){return n.isFirefox},t.isSafari=function(){return n.isSafari},t.isOpera=function(){return n.isOpera},t.isEdge=function(){return n.isEdge},t.isAndroidTablet=function(){return n.isAndroidTablet},t.isIpad=function(){return n.isIpad},t.isTablet=function(){return n.isTablet},t.isIE=function(){return n.isIE},t.isIE11=function(){return n.isIE11},t.isNode=function(){return n.isNode}},function(e,t,r){var i=r(283),n=r(284),a=n;a.v1=i,a.v4=n,e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=r(6),u=r(12),p=r(12),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.createColorTexture=function(e,t,r,i){void 0===e&&(e=255),void 0===t&&(t=255),void 0===r&&(r=255);var n=a.RGBFormat,o=void 0!==i?4:3,s=new Uint8Array(o);s[0]=e,s[1]=t,s[2]=r,4===o&&(s[3]=i,n=a.RGBAFormat);var u=new a.DataTexture(s,1,1,n,void 0,void 0,void 0,void 0,void 0,void 0);return u.needsUpdate=!0,u},t.createColorTextureCube=function(e,r,i,n){void 0===e&&(e=255),void 0===r&&(r=255),void 0===i&&(i=255);var o=[0,1,2,3,4,5].map(function(a){return t.createColorTexture(e,r,i,n)}),s=new a.CubeTexture(o);return s.generateMipmaps=!1,s.format=o[0].format,s.minFilter=a.NearestFilter,s.magFilter=a.NearestFilter,s.needsUpdate=!0,s},t.getBytesPerPixel=function(e,t){var r=0;switch(t){case"float":case"uInt":case"int":r=4;break;case"halfFloat":case"short":case"uShort":r=2;break;case"uByte":case"byte":r=1;break;case"uShort4444":case"uShort5551":case"uShort565":return 2}return u.default.getChannelCountFromFormat(e)*r},t.getMissingTexture=function(){return t.missingTexture2d||(t.missingTexture2d=t.createColorTexture()),t.missingTexture2d},t.getMissingTextureCube=function(){return t.missingTextureCube||(t.missingTextureCube=t.createColorTextureCube()),t.missingTextureCube},t.prototype.initialize=function(){var t=this;e.prototype.initialize.call(this),this.listenTo(this.engine,"imageUnloaded",function(e){t.getProperty("imageId")===e&&t.unload()})},t.prototype.createRuntimeData=function(e){var r=this,i=function(){r.runtimeData=t.getMissingTexture(),r.setState(o.StateType.Base,o.State.Failed),r.trigger("loadProgress",r),"function"==typeof e&&e.call(r)},n=this.getImage();if(n){var a=function(t){if(!t.runtimeData)return void i();r.createTextureData(t.runtimeData),"function"==typeof e&&e.call(r)};this.listenTo(n,"load",a),n.isLoaded()&&a.call(this,n),n.isUnloaded()&&n.load()}else i()},t.prototype.createTextureData=function(e){n.default.warn("Need to implement createTextureData in derived class.")},t.prototype.reloadBase=function(){return this.runtimeData&&this.runtimeData.dispose(),e.prototype.reloadBase.call(this)},t.prototype.unload=function(){var t=this.getImage();t&&this.stopListening(t,"load"),this.runtimeData&&(this.engine.trigger("textureUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading texture, "+this.getName()),this.runtimeData.dispose()),e.prototype.unload.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r);var i=this.runtimeData instanceof a.WebGLRenderTarget?this.runtimeData.texture:this.runtimeData;t.hasOwnProperty("wrapModeU")&&(i.wrapS=this.getThreeAddressMode(this.getAddressModeU())),t.hasOwnProperty("wrapModeV")&&(i.wrapT=this.getThreeAddressMode(this.getAddressModeV())),t.hasOwnProperty("anisotropy")&&(i.anisotropy=this.getProperty("anisotropy")),t.hasOwnProperty("minFilter")&&(i.minFilter=this.getThreeFilter(this.getMinFilter())),t.hasOwnProperty("magFilter")&&(i.magFilter=this.getThreeFilter(this.getMagFilter())),t.hasOwnProperty("useMipmap")&&(i.generateMipmaps=this.isMipmapsEnabled()),t.hasOwnProperty("mapping")&&(i.mapping=this.getThreeMapping()),this.engine.needsRender=!0},t.prototype.applyPropertiesUnloaded=function(t){if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("imageId")){var r=this.getPreviousProperty("imageId");r&&this.unregisterDependencyById(r),t.imageId&&this.registerDependencyById(this.getProperty("imageId"))}this.engine.trigger("textureChanged",this.id,t)},t.prototype.getAddressModeU=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeU"))},t.prototype.getAddressModeV=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeV"))},t.prototype.getSupportedAddressMode=function(e){var t=this.getImage();return t&&!t.isPowerOfTwo()?"clampToEdge":e},t.prototype.getLayout=function(){var e=this.getProperty("layout");if(e)return e;var t=this.getImage();return t?t.getProperty("layout"):p.ImageLayout.Normal},t.prototype.getWidth=function(){var e=this.getImage();return e?e.getWidth():1},t.prototype.getHeight=function(){var e=this.getImage();return e?e.getHeight():1},t.prototype.getMinFilter=function(){return this.getSupportedFilter(this.getProperty("minFilter"))},t.prototype.getMagFilter=function(){return this.getSupportedFilter(this.getProperty("magFilter"))},t.prototype.getSupportedFilter=function(e){var t=this.getDataType();if(!this.isLinearFilterAvailableForType(t))return"nearest";if(!this.isMipmapsEnabled())switch(e){default:case"nearest":case"nearestWithNearestMipmap":case"nearestWithLinearMipmap":return"nearest";case"linear":case"linearWithNearestMipmap":case"linearWithLinearMipmap":return"linear"}return e},t.prototype.getBytesPerPixel=function(){return t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.getDataType=function(){var e=this.getProperty("type"),t=e,r=this.engine.getThreeRenderer(),i=r.extensions;switch(e){case"float":if(i.get("OES_texture_float")){t="float";break}case"halfFloat":t=i.get("OES_texture_half_float")?"halfFloat":"uByte";break;default:t=e}return t},t.prototype.getEncoding=function(){var e=this.getProperty("encoding");if(e)return e;var t=this.getImage();if(!t)return"srgb";var r=t.getChosenRepresentation();if(!r)return"srgb";switch(r.colorspace){case"rgb":case"gray":return"linear";default:return"srgb"}},t.prototype.getFormat=function(){if(!this.getOwnProperty("format")){var e=this.getImage();if(e)return e.getFormat()}return this.getProperty("format")},t.prototype.getThreeMapping=function(){switch(this.getProperty("mapping")){case"cubeReflection":return a.CubeReflectionMapping;case"cubeRefraction":return a.CubeRefractionMapping;case"equirectangularReflection":return a.EquirectangularReflectionMapping;case"EquirectangularRefraction":return a.EquirectangularRefractionMapping;case"sphericalReflection":return a.SphericalReflectionMapping;case"cubeUvReflection":return a.CubeUVReflectionMapping;case"cubeUvRefraction":return a.CubeUVRefractionMapping;default:return a.UVMapping}},t.prototype.getThreeFormat=function(){return u.default.getThreeImageFormat(this.getFormat())},t.prototype.getThreeDataType=function(){return u.default.getThreeDataType(this.getDataType())},t.prototype.getThreeEncoding=function(){return u.default.getThreeImageEncoding(this.getEncoding())},t.prototype.getMipCount=function(){if(!this.isMipmapsEnabled())return 1;var e=this.getWidth(),t=this.getHeight(),r=Math.max(e,t);return Math.floor(Math.log2(Math.max(r,1)))+1},t.prototype.getImage=function(){return this.engine.getAssetById(this.getProperty("imageId"))},t.prototype.getDataSizeInMemorySelf=function(){var e=this.getImage();if(e instanceof u.default){var r=e.getChosenRepresentation();if(!r)return e.getDataSizeInMemory();if(r.compression&&"zip"!==r.compression&&"jpeg"!==r.compression)return e.getDataSizeDownloadSelf();if(this.getHdrPackingType(r.channels))return this.getWidth()*this.getHeight()*t.getBytesPerPixel("rgb",this.getDataType())}return this.getWidth()*this.getHeight()*t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.isCubeMap=function(){return!1},t.prototype.isLinearFilterAvailableForType=function(e){var t=this.engine.getThreeRenderer(),r=t.extensions;switch(e){case"halfFloat":return!!r.get("OES_texture_half_float_linear");case"float":return!!r.get("OES_texture_float_linear");default:return!0}},t.prototype.isMipmapsEnabled=function(){if(!this.isLinearFilterAvailableForType(this.getDataType()))return!1;var e=this.getImage();return!(e&&!e.isPowerOfTwo())&&this.getProperty("useMipmap")},t.prototype.getHdrPackingType=function(e){return e&&4===e.length&&"exponent"===e[3]?"rgbe":null},t.prototype.createDdsTexture=function(e,t){var r=this.parseDDS(e,!0),i=new a.CompressedTexture(null,0,0);i.format=r.format,i.generateMipmaps=!1;var n=function(e){return e.width<=t&&e.height<=t};if(r.isCubemap){i.flipY=!1;for(var o=i.image=[],s=r.mipmaps.length/r.mipmapCount,u=0;u<s;u+=1){o[u]={mipmaps:[],format:r.format,width:0,height:0};for(var p=0;p<r.mipmapCount;p+=1){var c=r.mipmaps[u*r.mipmapCount+p];n(c)&&(o[u].mipmaps.push(c),o[u].width=Math.max(o[u].width,c.width),o[u].height=Math.max(o[u].height,c.height))}}}else i.mipmaps=r.mipmaps.filter(n),i.image.width=0,i.image.height=0,i.mipmaps.forEach(function(e){i.image.width=Math.max(i.image.width,e.width),i.image.height=Math.max(i.image.height,e.height)});return i},t.prototype.getThreeTexture=function(){return this.runtimeData?this.runtimeData.texture?this.runtimeData.texture:this.runtimeData:null},t.prototype.getThreeAddressMode=function(e){switch(e){case"repeat":return a.RepeatWrapping;case"clampToEdge":return a.ClampToEdgeWrapping;case"mirroredRepeat":return a.MirroredRepeatWrapping;default:return n.default.warn("Unexpected address mode setting: "+e+" defaulting to THREE.ClampToEdgeWrapping"),a.ClampToEdgeWrapping}},t.prototype.getThreeFilter=function(e){switch(e){case"nearest":return a.NearestFilter;case"nearestWithNearestMipmap":return a.NearestMipMapNearestFilter;case"nearestWithLinearMipmap":return a.NearestMipMapLinearFilter;case"linear":return a.LinearFilter;case"linearWithNearestMipmap":return a.LinearMipMapNearestFilter;case"linearWithLinearMipmap":return a.LinearMipMapLinearFilter;default:return n.default.warn("Unexpected filter setting: "+e+" defaulting to THREE.LinearFilter"),a.LinearFilter}},t.prototype.parseDDS=function(e,t){function r(e){return e.charCodeAt(0)+(e.charCodeAt(1)<<8)+(e.charCodeAt(2)<<16)+(e.charCodeAt(3)<<24)}var i,o,s,u,p,c,l,d,h,f,m,y,g=r("DXT1"),v=r("DXT3"),b=r("DXT5"),x={mipmaps:[],width:0,height:0,format:null,mipmapCount:1};if(i=new Int32Array(e,0,31),542327876!==i[0])return n.default.error("THREE.DDSLoader.parse: Invalid magic number in DDS header."),x;if(!(4&i[20]))return n.default.error("THREE.DDSLoader.parse: Unsupported format, must contain a FourCC code."),x;switch(s=i[21],u=!1,s){case g:o=8,x.format=a.RGB_S3TC_DXT1_Format;break;case v:o=16,x.format=a.RGBA_S3TC_DXT3_Format;break;case b:o=16,x.format=a.RGBA_S3TC_DXT5_Format;break;default:if(!(32===i[22]&&16711680&i[23]&&65280&i[24]&&255&i[25]&&4278190080&i[26]))return n.default.error("THREE.DDSLoader.parse: Unsupported FourCC code ",function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)}(s)),x;u=!0,o=64,x.format=a.RGBAFormat}for(x.mipmapCount=1,131072&i[2]&&!1!==t&&(x.mipmapCount=Math.max(1,i[7])),x.isCubemap=!!(512&i[28]),x.width=i[4],x.height=i[3],p=i[1]+4,c=x.width,l=x.height,h=x.isCubemap?6:1,d=0;d<h;d+=1){for(f=0;f<x.mipmapCount;f+=1)u?(m=function(e,t,r,i){var n,a,o,s,u,p,c=r*i*4,l=new Uint8Array(e,t,c),d=new Uint8Array(c),h=0,f=0;for(a=0;a<i;a+=1)for(n=0;n<r;n+=1)u=l[f],s=l[f+1],o=l[f+2],p=l[f+3],d[h]=o,d[h+1]=s,d[h+2]=u,d[h+3]=p,f+=4,h+=4;return d}(e,p,c,l),y=m.length):(y=Math.max(4,c)/4*Math.max(4,l)/4*o,m=new Uint8Array(e,p,y)),x.mipmaps.push({data:m,width:c,height:l}),p+=y,c=Math.max(.5*c,1),l=Math.max(.5*l,1);c=x.width,l=x.height}return x},t.missingTexture2d=null,t.missingTextureCube=null,t}(s.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(5),o=r(11),s=r(15),u=r(4),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadedBytes=0,t.buffer=null,t.arrays={},t}return i.__extends(t,e),t.getBufferAccessor=function(e,t){var r=t.split("#");if(2!==r.length)throw new Error(e.getName()+" - BufferAsset: Invalid accessorId, "+t);var i=r[0],n=r[1],a=e.getEntityById(i);if(!a)throw new Error(e.getName()+" - BufferAsset: BufferAsset not found, "+i);var o=a.getAccessor(n);if(!o)throw new Error(e.getName()+" - BufferAsset: Accessor not found, "+n);return o},t.getBufferArray=function(e,t){var r=t.split("#");if(2!==r.length)throw new Error(e.getName()+" - BufferAsset: Invalid accessorId, "+t);var i=r[0],n=r[1],a=e.getEntityById(i);if(!a)throw new Error(e.getName()+" - BufferAsset: BufferAsset not found, "+i);var o=a.getArray(n);if(!o)throw new Error(e.getName()+" - BufferAsset: Accessor not found, "+n);return o},t.getComponentTypeSize=function(e){if(!t.componentTypeSizes.hasOwnProperty(e))throw new Error("Unknown component type, "+e);return t.componentTypeSizes[e]},t.getTypeSize=function(e){if(!t.typeSizes.hasOwnProperty(e))throw new Error("Unknown attribute value type, "+e);return t.typeSizes[e]},t.prototype.unload=function(){this.buffer=null,this.arrays={},e.prototype.unload.call(this)},t.prototype.getAccessor=function(e){return this.getProperty("accessors")[e]},t.prototype.getArray=function(e){return this.arrays[e]},t.prototype.createRuntimeData=function(e){var t=this,r=this.loadResource(this.getProperty("src"),s.default.BUFFER,e,{size:1,priority:1,isExternal:this.getProperty("isExternal")});r.on(o.default.PROGRESS,function(e){t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t)}),r.on(o.default.LOAD,function(e){t.buffer=e,t.createArrays(),t.loadedBytes=t.getDataSizeDownload()})},t.prototype.getDataSizeDownloadSelf=function(){var e=this.getProperty("accessors");return Object.keys(e).map(function(r){var i=e[r];return t.getComponentTypeSize(i.componentType)*t.getTypeSize(i.type)*i.count}).reduce(function(e,t){return t+e},0)},t.prototype.getDataSizeLoadedSelf=function(){return this.loadedBytes},t.prototype.getArrayType=function(e){if(!t.arrayTypes.hasOwnProperty(e))throw new Error("Unknown component type, "+e);return t.arrayTypes[e]},t.prototype.createArray=function(e){var r=this.getArrayType(e.componentType),i=t.getTypeSize(e.type);return new r(this.buffer,e.byteOffset,e.count*i)},t.prototype.createArrays=function(){var e=this,t=this.getProperty("accessors");this.arrays=a.map(t,function(t){return e.createArray(t)})},t.arrayTypes={int8:Int8Array,uint8:Uint8Array,int16:Int16Array,uint16:Uint16Array,int32:Int32Array,uint32:Uint32Array,float32:Float32Array,float64:Float64Array},t.typeSizes={scalar:1,vec2:2,vec3:3,vec4:4,mat2:4,mat3:9,mat4:16},t.componentTypeSizes={int8:1,uint8:1,int16:2,uint16:2,int32:4,uint32:4,float16:2,float32:4,float64:8},t}(n.default);u.addSchemas("BufferAsset",p),t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(10),s=r(14),u=r(24),p=r(4),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.engine.on("materialDeleted",this.onMaterialDeleted,this),this.on("setMaterial",this.setMaterial,this),this.on("castShadowsEnable",this.castShadowsEnable,this),this.on("castShadowsDisable",this.castShadowsDisable,this),this.on("castShadowsToggle",this.castShadowsToggle,this),this.computePropertyFunctions.materials=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=[]);for(var r=Math.max(e.length,t.length),i=[],n=0;n<r;++n)i.push(void 0!==e[n]?e[n]:t[n]);return i}},t.prototype.uninitialize=function(){this.off("setMaterial",this.setMaterial,this),this.off("castShadowsEnable",this.castShadowsEnable,this),this.off("castShadowsDisable",this.castShadowsDisable,this),this.off("castShadowsToggle",this.castShadowsToggle,this),this.engine.off("materialDeleted",this.onMaterialDeleted,this),e.prototype.uninitialize.call(this)},t.prototype.unload=function(t){void 0===t&&(t=!1),this.runtimeData&&(this.runtimeData.material=null,this.runtimeData.geometry=null),e.prototype.unload.call(this,t)},t.prototype.castShadowsDisable=function(){this.setProperty("castShadow",!1)},t.prototype.castShadowsEnable=function(){this.setProperty("castShadow",!0)},t.prototype.castShadowsToggle=function(){var e=!this.getProperty("castShadow");this.setProperty("castShadow",e)},t.prototype.createRuntimeData=function(e){var t=this,r=this.getProperty("geometryId"),i=this.getProperty("skinId"),a=this.engine.materialUtilities.getMissingMaterial(),o=a?a.id:null;Promise.all([this.loadAsset(o),this.loadAsset(r),this.loadAsset(i)]).then(function(){t.createMeshLoaded(),e()}).catch(function(r){t.isDestroyed()||(n.default.error(t.engine.getName()+" - MeshObject: "+r.toString()),t.createDefaultMesh(),"function"==typeof e&&e())})},t.prototype.getGeometry=function(){var e=this.getGeometryAsset();return e?e.getGeometry(u.default.primitiveType.TRIANGLES):null},t.prototype.getGeometryAsset=function(){var e=this.getProperty("geometryId");return e?this.engine.getAssetById(e):null},t.prototype.getLocalBounds=function(e){var r=this.getGeometryAsset();return r?r.getBounds(e):e?e.set(t.defaultLocalBounds.min,t.defaultLocalBounds.max):t.defaultLocalBounds},t.prototype.getMaterial=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=!0),e<0||e>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getPreviousMaterial=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=!0),e<0||e>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getPreviousMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getMaterialCount=function(){return this.getMaterialIds().length},t.prototype.getMaterials=function(e){var t=this;void 0===e&&(e=!0);var r=this.getMaterialIds(),i=this.engine.materialUtilities.getMissingMaterial();return r.map(function(r){var n=t.engine.getAssetById(r);return n||(e?i:null)})},t.prototype.getSkinAsset=function(){var e=this.getProperty("skinId");return e?this.engine.getAssetById(e):null},t.prototype.isSkinned=function(){return null!==this.getSkinAsset()},t.prototype.applyPropertiesLoaded=function(t,r){var i=this;if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("geometryId")){var n=this.getPreviousProperty("geometryId"),a=this.getProperty("geometryId");if("init"===r&&this.registerChangeListener(a,this.onGeometryChanged,!1),this.registerChangeListener(n,this.onGeometryChanged,!1),this.registerChangeListener(a,this.onGeometryChanged,!0),"init"!==r)return void this.reloadBase()}if(t.hasOwnProperty("materials")){this.getPreviousMaterialIds().forEach(function(e){i.registerChangeListener(e,i.onMaterialChanged,!1)}),Array.isArray(this.runtimeData.material)||(this.runtimeData.material=[]);for(var o=this.getMaterialType(),s=this.getMaterialIds(),u=this.getGeometryAsset(),p=u?u.getMaxMaterialIndex("triangles"):0;s.length<=p;)s.push(null);s.forEach(function(e,t){i.registerChangeListener(e,i.onMaterialChanged,!0),i.loadAndAssignMaterial(i.runtimeData.material,t,e,o)})}if(t.hasOwnProperty("customDepthMaterial")){var c=this.getPreviousProperty("customDepthMaterial"),l=this.getProperty("customDepthMaterial");this.registerChangeListener(c,this.onMaterialChanged,!1),this.registerChangeListener(l,this.onMaterialChanged,!0),l&&this.loadAndAssignMaterial(this.runtimeData,"customDepthMaterial",l,this.getDepthMaterialType())}this.engine.needsRender=!0},t.prototype.loadAsset=function(e){if(!e)return Promise.resolve(null);var t=this.engine.getAssetById(e);return t?new Promise(function(r,i){t.when("load",function(){if(t.isLoadFailed())return void i(new Error('Asset "'+e+'" failed to load'));r(t)}),t.isLoaded()||t.load()}):Promise.reject(new Error('Asset "'+e+'" not found'))},t.prototype.onGeometryChanged=function(){this.reloadBase()},t.prototype.onMaterialChanged=function(e){var t=this;void 0===e&&(e={}),e.hasOwnProperty("shaderId")&&this.getMaterials().forEach(function(e,r){t.runtimeData.material[r]=e.getRuntimeData()[t.getMaterialType()]})},t.prototype.onMaterialDeleted=function(e){var t=this.getMaterialIds(),r=!1;t.forEach(function(i,n){i===e&&(t[n]=null,r=!0)}),r&&this.setProperty("materials",t)},t.prototype.revertMaterial=function(e){void 0===e&&(e=0),this.setMaterial(void 0,e)},t.prototype.setMaterial=function(e,t){if(void 0===t&&(t=0),t<0||t>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=e instanceof s.default?e.id:e,i=(this.getOwnProperty("materials")||[]).slice();i[t]!==r&&(i[t]=r,this.setProperty("materials",i))},t.prototype.getMaterialIds=function(){return this.getProperty("materials")},t.prototype.applyPropertiesUnloaded=function(t){var r=this;if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("materials")&&(this.getPreviousMaterials().forEach(function(e){return r.unregisterDependency(e)}),this.getMaterials().forEach(function(e){return r.registerDependency(e)})),t.hasOwnProperty("customDepthMaterial")){var i=this.getPreviousProperty("customDepthMaterial");i&&this.unregisterDependencyById(i);var n=this.getProperty("customDepthMaterial");n&&this.registerDependencyById(n)}if(t.hasOwnProperty("geometryId")){var a=this.getPreviousProperty("geometryId");a&&this.unregisterDependencyById(a);var o=this.getProperty("geometryId");o&&this.registerDependencyById(o)}},t.prototype.bindToHierarchy=function(){var e=this,t=this.getInstanceTop();t||(t=this.getRootObject());var r=this.getSkinAsset();if(!r)throw new Error("Cannot bind mesh to hierarchy because it does not have a skin asset");if(!r.isLoaded())throw new Error("Cannot bind mesh to hierarchy because the skin asset is not loaded");var i=this.runtimeData;if(!i)throw new Error("Cannot bind mesh to hierarchy because the mesh is not loaded");t.when("loadDependencies",function(){var n=t?t.getDescendants():[],o=n.map(function(e){return e.getRuntimeData()}),s=o.reduce(function(e,t){return e[t.name]=t,e},{}),u=r.getJointNames().map(function(t){var r=e.engine.getRuntimeName(t);return s[r]}),p=new a.Skeleton(u,r.getInverseBindMatrices());i.bind(p,r.getBindShapeMatrix())}),t.isUnloaded()||t.load()},t.prototype.createDefaultMesh=function(){var e=this.engine.geometryUtilities.getDefaultGeometry();this.createMesh(e)},t.prototype.createMesh=function(e){if(this.runtimeData)this.runtimeData.geometry=e;else{var t=this.isSkinned()?a.SkinnedMesh:a.Mesh,r=new t(e);r.name=this.getRuntimeName(),r.castShadow=!0,r.receiveShadow=!0,r.material=null,this.runtimeData=r}},t.prototype.createMeshLoaded=function(){var e=this.getGeometryAsset();if(e){if(!e.isLoaded())throw new Error("Cannot create mesh because geometry asset is not loaded");var t=this.getSkinAsset();if(t&&!t.isLoaded())throw new Error("Cannot create mesh because skin asset is not loaded");var r=u.default.primitiveType.TRIANGLES,i=e?e.getGeometry(r):void 0;this.createMesh(i),t&&this.bindToHierarchy()}},t.prototype.getDepthMaterialType=function(){var e=this.getMaterialType();return s.default.materialObjectTypes[e].skinning?"depthSkinned":"depthStatic"},t.prototype.getPreviousMaterials=function(e){void 0===e&&(e=!0);for(var t=[],r=this.getMaterialCount(),i=0;i<r;++i)t.push(this.getPreviousMaterial(i,e));return t},t.prototype.getMaterialType=function(){var e=this.getGeometry(),t=e&&e.hasTangents;return this.isSkinned()?t?"skinnedTangents":"skinned":t?"staticTangents":"static"},t.prototype.getPreviousMaterialIds=function(){return this.getPreviousProperty("materials")},t.prototype.loadAndAssignMaterial=function(e,t,r,i){var a=this.engine.materialUtilities.getMissingMaterial();if(a&&a.getRuntimeData()?e[t]=a.getRuntimeData()[i]:n.default.error(this.engine.getName()+" - MeshObject: \"Missing\" material needed, but can't be found or isn't loaded."),r){var o=this.engine.getAssetById(r);o&&(o.when("loadBase",function(){e[t]=o.getRuntimeData()[i]}),o.isLoaded()||o.load())}},t.prototype.registerChangeListener=function(e,t,r){if(e){var i=this.engine.getAssetById(e);i&&(r?i.on("change:properties",t,this):i.off("change:properties",t,this))}},t.events={setMaterial:{scope:"local",action:!0,category:"Materials",parameters:[{name:"material",type:"asset",filter:{material:!0}},{name:"index",type:"i",description:"Optional - the index of the material (default is 0).",default:0}]},castShadowsEnable:{parameters:[],action:!0,category:"Rendering"},castShadowsDisable:{parameters:[],action:!0,category:"Rendering"},castShadowsToggle:{parameters:[],action:!0,category:"Rendering"}},t.defaultLocalBounds=new a.Box3,t}(o.default);p.addSchemas("MeshObject",c),t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"baseTextureAssetProperties",title:"BaseTextureAssetPropertiesDef",properties:i.__assign({},n.default.properties,{useMaterial:{type:"boolean",description:"True if the material should be used.#unused",default:!1},useMipmap:{type:"boolean",description:"True if mipmaps should be used.",default:!0},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"standard"},alpha:{type:"number",description:"The default alpha value for the texture. #unused",default:1},alphaSource:{type:"string",enum:["none","rgbIntensity","black"],description:"Unused value #unused",default:"none"},cropLeft:{type:"integer",description:"Unused value #unused",default:0},cropRight:{type:"integer",description:"Unused value #unused",default:0},cropTop:{type:"integer",description:"Unused value #unused",default:0},cropBottom:{type:"integer",description:"Unused value #unused",default:0},mappingType:{type:"string",enum:["null","planar","spherical","cylindrical","box","face","uv","environment"],description:"Describes how the texture is mapped to a surface.",default:"uv"},mapping:{type:"string",default:"uv",description:"The mapping of the texture when applied to a material.",enum:["uv","equirectangularReflection","equirectangularRefraction","sphericalReflection","cubeUvReflection","cubeUvRefraction"]},planarMappingNormal:{type:"string",enum:["x","y","z"],description:"The normal orientation for planar mapping. #unused",default:"x"},wrapModeU:{type:"string",description:"The wrap mode along the texture's u-axis.",enum:["clampToEdge","mirroredRepeat","repeat"],default:"repeat"},wrapModeV:{type:"string",description:"The wrap mode along the texture's v-axis.",enum:["clampToEdge","mirroredRepeat","repeat"],default:"repeat"},uvSwap:{type:"boolean",description:"If true, swap the u and v coordinates. #unused",default:!1},premultiplyAlpha:{type:"boolean",description:"If true, the r, g, and b components of the texture have already been multiplied by the alpha. #unused",default:!0},translation:{$ref:"vector3.json",description:"The translation along the texture's u, v, and w axes. #unused"},rotation:{$ref:"vector3.json",description:"The rotation (in degrees) around the texture's u, v, and w axes. #unused"},scaling:{$ref:"vector3.json",description:"The amount of scaling along the texture's u, v, and w axes. #unused",default:{x:1,y:1,z:1}},uvSet:{type:"string",description:"The name of the UV set to use when mapping this texture to a surface. #unused",default:"default"},minFilter:{type:"string",description:"The minification filter (used when texture is small on screen).",enum:["nearest","nearestWithNearestMipmap","nearestWithLinearMipmap","linear","linearWithNearestMipmap","linearWithLinearMipmap"],default:"linearWithLinearMipmap"},magFilter:{type:"string",description:"The magnification filter (used when texture is large on screen).",enum:["nearest","nearestWithNearestMipmap","nearestWithLinearMipmap","linear","linearWithNearestMipmap","linearWithLinearMipmap"],default:"linear"},anisotropy:{type:"number",description:"Level of anisotropic filtering applied. Makes texture sharper when viewed at steep angles.",default:8},imageId:{type:["string","null"],default:null,description:"The ImageAsset that this textures loads its data from.#entity-BaseImageAsset"},type:{type:"string",description:'The pixel data type. e.g. "uByte", "float"',enum:["uByte","byte","short","uShort","int","uInt","float","halfFloat","uShort4444","uShort5551","uShort565"],default:"uByte"},format:{type:"string",description:'The pixel format. e.g. "rgb", "luminance", etc.',enum:["alpha","rgb","rgba","luminance","luminanceAlpha"],default:"rgb"},encoding:{type:"string",description:"The encoding of the image (e.g. 'srgb', 'linear', etc.).",enum:["srgb","linear","gamma","rgbe","logLuv","rgbm7","rgbm16","rgbd","depth","rgbaDepth"],default:void 0}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(6),s=r(5),u=function(e){function t(r,i){var n=e.call(this,r,i)||this;return n.geometries={},n.maxMaterialIndices={},s.forEach(t.primitiveType,function(e){n.maxMaterialIndices[e]=-1}),n}return i.__extends(t,e),t.computeMaxMaterialIndex=function(e){return t.getMaterialGroups(e).reduce(function(e,t){return Math.max(e,t.materialIndex)},-1)},t.fixNegativeMaterialIndices=function(e){var r=this.getMaterialGroups(e),i=r.filter(function(e){return e.materialIndex<0}),n=t.computeMaxMaterialIndex(e);i.forEach(function(e){e.materialIndex=n+1})},t.getMaterialGroups=function(e){return e instanceof a.BufferGeometry&&e.groups?e.groups:e instanceof a.Geometry&&e.faces?e.faces:[]},t.prototype.unload=function(){n.default.info(this.engine.getName()+" - BaseGeometryAsset: Unloading geometry, "+this.getName()+' - "'+this.id+'"'),s.forEach(this.geometries,function(e){e&&e.dispose()}),this.geometries={},e.prototype.unload.call(this)},t.prototype.getBounds=function(e){var t=this.getOwnProperty("bounds");if(t){return(e||new a.Box3).set(t.min,t.max)}return s.values(this.geometries).filter(function(e){return e}).reduce(function(e,t){return e.union(t.boundingBox)},e||new a.Box3)},t.prototype.getGeometries=function(){return s.values(this.geometries)},t.prototype.getGeometry=function(e){return void 0===e&&(e=t.primitiveType.TRIANGLES),this.geometries[e]},t.prototype.getMaxMaterialIndex=function(e){return void 0===e&&(e=t.primitiveType.TRIANGLES),this.maxMaterialIndices[e]},t.prototype.addMissingAttributes=function(e){void 0===e.attributes.position&&(n.default.warn(this.engine.getName()+' - BaseGeometryAsset: Mesh is missing "position" attribute.'),e.addAttribute("position",new a.BufferAttribute(new Float32Array(0),3))),void 0===e.attributes.normal&&(n.default.warn(this.engine.getName()+' - BaseGeometryAsset: Mesh is missing "normal" attribute.'),e.computeVertexNormals())},t.prototype.setGeometry=function(e,r){r&&(t.fixNegativeMaterialIndices(r),r.dynamic=this.getProperty("dynamic")||!1),this.geometries[e]=r,this.maxMaterialIndices[e]=r?t.computeMaxMaterialIndex(r):-1},t.primitiveType={POINTS:"points",LINES:"lines",TRIANGLES:"triangles"},t}(o.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(12),a=r(15),o=r(11),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.engine.on("update",this.onUpdate,this),this.on("pause",this.pause,this),this.on("play",this.play,this),this.on("stop",this.stop,this),this.on("toggle",this.toggle,this)},t.prototype.uninitialize=function(){this.engine.off("update",this.onUpdate,this),this.off("pause",this.pause,this),this.off("play",this.play,this),this.off("stop",this.stop,this),this.off("toggle",this.toggle,this),this.runtimeData&&this.runtimeData.image&&this.runtimeData.image.pause(),e.prototype.uninitialize.call(this)},t.prototype.createRuntimeData=function(e){var t=this,r=function(e){e&&(e.style.display="none",e.loop=t.getProperty("loop"),e.autoplay=t.getProperty("autoPlay"),e.muted=t.getProperty("muted"),t.runtimeData||(t.runtimeData={}),t.runtimeData.imageData=e,t.runtimeData.width=e.width,t.runtimeData.height=e.height,t.loadedBytes=t.getDataSizeDownload(),t.trigger("loadProgress",t))},i=this.engine.getRenderer().getCanvas().parentElement,n=this.getProperty("querySelector");if(n){var s=i.querySelector(n);r(s),e()}else{var u=this.findRepresentation();if(u){var p=this.loadResource(u.src,a.default.VIDEO,e);p.on(o.default.PROGRESS,function(e){t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t)}),p.once(o.default.LOAD,function(e){i.appendChild(e),r(e)})}}},t.prototype.applyPropertiesUnloaded=function(e){var t=this.findRepresentation();this.chosenRepresentation=t},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),this.runtimeData&&this.runtimeData.imageData){var i=this.runtimeData.imageData;t.hasOwnProperty("loop")&&(i.loop=this.getProperty("loop")),t.hasOwnProperty("muted")&&(i.muted=this.getProperty("muted")),t.hasOwnProperty("autoPlay")&&(i.autoplay=this.getProperty("autoPlay"))}},t.prototype.getMaxRepresentationWidth=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.video&&t.video.width>e?t.video.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.video&&t.video.height>e?t.video.height:e},0):0},t.prototype.onUpdate=function(){if(this.runtimeData){var e=this.runtimeData.imageData;e&&!e.paused&&!e.error&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.engine.needsRender=!0)}},t.prototype.pause=function(){this.runtimeData&&this.runtimeData.image.pause()},t.prototype.play=function(e,t){this.runtimeData&&(e&&(this.runtimeData.imageData.currentTime=t),this.runtimeData.imageData.play())},t.prototype.stop=function(){this.runtimeData&&(this.runtimeData.imageData.pause(),this.runtimeData.imageData.currentTime=0)},t.prototype.toggle=function(){this.runtimeData&&(this.runtimeData.imageData.paused?this.play():this.pause())},t.prototype.getOriginalWidth=function(){return(this.getProperty("streams")||[]).reduce(function(e,t){return Math.max(t.width||0,e)},0)},t.prototype.getOriginalHeight=function(){return(this.getProperty("streams")||[]).reduce(function(e,t){return Math.max(t.height||0,e)},0)},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxHeight:1080},e),i=t.map(function(e){return r.maxHeight-(e.video||{}).height||0}),n=i.reduce(function(e,t,r){var n=e>=0?i[e]:Number.MAX_VALUE;return t>=0&&t<n?r:e},-1);return n>=0?t[n]:null},t.events={pause:{parameters:[],action:!0,category:""},play:{parameters:[{name:"seek",type:"b",description:"",default:!1},{name:"seekTime",type:"f",description:"",default:0}],action:!0,category:""},stop:{parameters:[],action:!0,category:""},toggle:{parameters:[],action:!0,category:""}},t}(n.default);s.addSchemas("VideoAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(11),n=r(5);t.makeXhr=function(e){return function(t){return e(t.path,t.params).then(function(e){return t.loaderData.xhr=e,Promise.resolve(t)})}},t.loadXhr=function(e){return new Promise(function(t,r){e.setLoading();var n=function(e){return parseInt(e.getResponseHeader("Content-Length"),10)},a=function(e){return{total:e.lengthComputable&&e.target?n(e.target):0,loaded:e.loaded}},o=function(){e.loaderData.xhr.abort(),t(e),e.off(i.default.CANCEL,o)},s=function(){e.off(i.default.CANCEL,o),t(e)},u=function(t){e.off(i.default.CANCEL,o),r(t)};e.on(i.default.CANCEL,o),e.loaderData.xhr.send(),e.loaderData.xhr.addEventListener("load",s),e.loaderData.xhr.addEventListener("error",u),e.loaderData.xhr.addEventListener("progress",function(t){return e.trigger(i.default.PROGRESS,a(t))})})},t.requireStatus=function(e){return function(t){return e(t.loaderData.xhr.status)?Promise.resolve(t):Promise.reject(new Error("Failed to load: "+t.path+" status: "+t.loaderData.xhr.status))}},t.setResponseType=function(e){return function(t){return t.loaderData.xhr.responseType=t.params.responseType||e,Promise.resolve(t)}},t.setCustomHeaders=function(e){return e.params.headers&&n.forEach(e.params.headers,function(t,r){e.loaderData.xhr.setRequestHeader(r,t)}),Promise.resolve(e)},t.handleError=function(e){return function(t){return e.setError(t),Promise.reject(t)}},t.unlessCancelled=function(e){return function(t){return t.isCancelled()?Promise.resolve(t):e(t)}};var a=function(e,t,r){return function(i){return Math.min(t,e*Math.pow(r,i))}};t.retry=function(e,r,i,n,o){return void 0===i&&(i=a(250,12e4,2)),void 0===n&&(n=16),void 0===o&&(o=0),t.unlessCancelled(function(a){return r.reduce(function(e,t){return e.then(t)},Promise.resolve(a)).then(function(a){return new Promise(function(s,u){e(a)&&o<n?setTimeout(function(){return t.retry(e,r,i,n,o+1)(a).then(s).catch(u)},i(o)):s(a)})})})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(19),n=function(e,t){var r,i=-1,n=e.length,a=t[0],o=t[1],s=t[2];switch(t.length){case 0:for(;++i<n;)(r=e[i]).callback.call(r.ctx);break;case 1:for(;++i<n;)(r=e[i]).callback.call(r.ctx,a);break;case 2:for(;++i<n;)(r=e[i]).callback.call(r.ctx,a,o);break;case 3:for(;++i<n;)(r=e[i]).callback.call(r.ctx,a,o,s);break;default:for(;++i<n;)(r=e[i]).callback.apply(r.ctx,t)}},a=function(e){return function(t,r,n){var a=t._listenId||(t._listenId=i.v4());return this._listeningTo[a]=t,n||"object"!=typeof r||(n=this),t[e](r,n,this),this}},o=function(e){var t=this,r=!1;return function(){for(var i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];r||(r=!0,e.apply(t,i))}},s=a("on"),u=a("once"),p=function(){function e(){this._events={all:[]},this._listeningTo={},this._listenId=i.v4()}return e.prototype.on=function(e,t,r){return(this._events[e]||(this._events[e]=[])).push({callback:t,context:r,ctx:r||this}),this},e.prototype.once=function(e,t,r){var i=this;if("function"==typeof t){var n=o(function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];i.off(e,o),t.apply(r||i,n)});return this.on(e,n,r)}},e.prototype.off=function(e,t,r){var i,n,a,o;if(!e&&!t&&!r)return this;o=e?[e]:Object.keys(this._events);for(var s=o.length,u=0;u<s;u++)if(e=o[u],a=this._events[e]){this._events[e]=i=[];var p=a.length;if(t||r)for(var c=0;c<p;c++)n=a[c],(t&&t!==n.callback&&t!==n.callback._callback||r&&r!==n.context)&&i.push(n);i.length||delete this._events[e]}return this},e.prototype.trigger=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!this._events)return this;var i=this._events[e],a=this._events.all;return i&&n(i,t),t.unshift(e),a&&n(a,t),this},e.prototype.stopListening=function(e,t,r){var i=this._listeningTo;if(!i)return this;var n=!t&&!r;r||"object"!=typeof t||(r=this),e&&((i={})[e._listenId]=e);for(var a in i)i.hasOwnProperty(a)&&(e=i[a],e.off(t,r,this),!n&&e._events||delete this._listeningTo[a])},e.prototype.isEventBound=function(e){return!!this._events[e]},e.prototype.listenTo=function(e,t,r){return s.call(this,e,t,r)},e.prototype.listenToOnce=function(e,t,r){return u.call(this,e,t,r)},e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"baseGeometryAsset",title:"BaseGeometryAssetDef",properties:i.__assign({},n.default.properties,{properties:{$ref:"baseGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"baseGeometryAssetProperties",title:"BaseGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{bounds:{description:"The minimum and maximum extents of this geometry.",$ref:"box3.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"baseTextureAsset",title:"BaseTextureAssetDef",properties:i.__assign({},n.default.properties,{properties:{$ref:"baseTextureAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"representation",title:"RepresentationDef",type:"object",properties:{src:{type:"string"},contentType:{type:"string"},contentLength:{type:"number"},colorspace:{type:"string",enum:["srgb","rgb","gray"]}},additionalProperties:!1};t.default=i},function(e,t){var r=e.exports={version:"2.5.0"};"number"==typeof __e&&(__e=r)},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.engine.setCurrentApp(this.id);var t=this.engine.getEntityById(this.getProperty("startupSceneId"));t&&t.load(),e()},t}(n.default);a.addSchemas("ApplicationAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(6),o=r(218),s=r(224),u=r(223),p=r(221),c=r(220),l=r(5),d=r(4),h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDependentParameters=function(e){if(this.paramDependencyMap[e])return this.paramDependencyMap[e]},t.prototype.getParameterDependencies=function(e){function t(e,t){void 0===t&&(t=[]);var i=t;return l.forEach(e,function(e,t){"or"===t?i=r(e,i):-1===i.indexOf(t)&&(i=i.concat([t]))}),i}function r(e,r){void 0===r&&(r=[]);var i=r;return l.forEach(e,function(e){i=t(e,i)}),i}var i=this.getProperty("parameters");return i[e]&&i[e].enabledWhen?t(i[e].enabledWhen,[]):[]},t.prototype.createRuntimeData=function(e){this.runtimeData={},this.runtimeData.vertexShader=this.getProperty("vertexShader"),this.runtimeData.fragmentShader=this.getProperty("fragmentShader"),this.buildUniformList(),this.buildRenderParamList(),e()},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),this.buildParamDependencies()},t.prototype.buildUniformList=function(){var e,t=this,r=this.getProperty("parameters"),i=this.getProperty("uniforms");this.runtimeData.uniforms=n.UniformsUtils.clone(i),l.forEach(r,function(r,i){if(e={},r&&!r.isRenderParam&&r.isUniform){switch(r.type){case"opt":e.type="i",e.value=r.default;break;case"b":e.type="i",e.value=r.default?1:0;break;case"t":e.type="t",e.value=r.default;break;case"c":e.type=r.type,e.value=new n.Color(r.default),e.value.copyGammaToLinear(e.value);break;case"v2":e.type=r.type,e.value=new n.Vector2,e.value.set(r.default.x,r.default.y);break;case"v3":e.type=r.type,e.value=new n.Vector3,e.value.set(r.default.x,r.default.y,r.default.z);break;case"v4":e.type=r.type,e.value=new n.Vector4,e.value.set(r.default.x,r.default.y,r.default.z,r.default.w);break;default:e.type=r.type,e.value=r.default}var a=r.uniformName||i;t.runtimeData.uniforms[a]=e}})},t.prototype.buildRenderParamList=function(){var e=this,t=this.getProperty("parameters"),r=this.getProperty("renderParams");this.runtimeData.renderParams=r||{},l.forEach(t,function(t,r){if(t&&!t.isUniform&&t.isRenderParam)switch(t.type){case"b":e.runtimeData.renderParams[r]=!!t.default;break;case"c":e.runtimeData.renderParams[r]=new n.Color(t.default.r,t.default.g,t.default.b);break;default:e.runtimeData.renderParams[r]=t.default}})},t.prototype.buildParamDependencies=function(){var e=this,t=this.getProperty("parameters");this.paramDependencyMap={},l.forEach(t,function(t,r){var i=e.getParameterDependencies(r);l.forEach(i,function(t){e.paramDependencyMap[t]||(e.paramDependencyMap[t]=[]),-1===e.paramDependencyMap[t].indexOf(r)&&e.paramDependencyMap[t].push(r)}),e.paramDependencyMap[r]||(e.paramDependencyMap[r]=[])})},t.builtInAssetDescriptors={PBR:o.default,Standard:s.default,Physical:u.default,Phong:p.default,Lambert:c.default},t}(a.default);d.addSchemas("ShaderAsset",h),t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gamepadIndex=-1,t}return i.__extends(t,e),t.prototype.getGamepad=function(){return-1!==this.gamepadIndex&&navigator.getGamepads?navigator.getGamepads()[this.gamepadIndex]:null},t.prototype.whenGamepadFound=function(e){var t=this.getGamepad();if(t)return void e(t);this.listenToOnce(this,"foundGamepad",e)},t.prototype.releaseGamepad=function(){-1!==this.gamepadIndex&&(t.assignedGamepads[this.gamepadIndex]=null,this.gamepadIndex=-1)},t.prototype.onAwake=function(){this.listenTo(this.getEngine(),"onGamepadConnected",this.findGamepad),this.listenTo(this.getEngine(),"onGamepadDisconnected",this.findGamepad),this.findGamepad()},t.prototype.onShutdown=function(){this.releaseGamepad()},t.prototype.onPreUpdate=function(e){if(this.isEnabled()){if(-1===this.gamepadIndex){var r=this.findGamepad();r&&(t.assignedGamepads[r.id]=this,this.trigger("foundGamepad",r))}-1!==this.gamepadIndex&&this.updateState(this.getGamepad())}},t.prototype.findGamepad=function(e){if(navigator.getGamepads){for(var r=navigator.getGamepads(),i=0;i<r.length;i++)if(r[i]){if((!t.assignedGamepads[i]||t.assignedGamepads[i]===this)&&(!e||e(r[i])))return t.assignedGamepads[r[i].index]=this,-1!==this.gamepadIndex&&this.releaseGamepad(),this.gamepadIndex=r[i].index,this.trigger("foundGamepad",r[i]),this.buttonState=r[i].buttons.map(function(){return{pressed:!1,touched:!1,value:0}}),this.axesState=r[i].axes.map(function(){return 0}),r[i]}else t.assignedGamepads[i]=null;this.releaseGamepad()}},t.prototype.updateState=function(e){var t=this;e&&(e.axes.forEach(function(r,i){r!==t.axesState[i]&&(t.axesState[i]=r,t.trigger("gamepadAxisChanged",e,i),t.getEntity().trigger("gamepadAxisChanged",e,i))}),e.buttons.forEach(function(r,i){var n=r;if(n.pressed!==t.buttonState[i].pressed){t.buttonState[i].pressed=n.pressed;var a=t.buttonState[i].pressed?"gamepadButtonDown":"gamepadButtonUp";t.trigger(a,e,i),t.getEntity().trigger(a,e,i)}if(n.value!==t.buttonState[i].value&&(t.buttonState[i].value=n.value,t.trigger("gamepadButtonChanged",e,i),t.getEntity().trigger("gamepadButtonChanged",e,i)),n.touched!==t.buttonState[i].touched){t.buttonState[i].touched=n.touched;var a=t.buttonState[i].touched?"gamepadButtonTouched":"gamepadButtonReleased";t.trigger(a,e,i),t.getEntity().trigger(a,e,i)}}))},t.assignedGamepads=[],t}(n.default);t.default=a},function(e,t,r){"use strict";function i(e,t){return Math.abs(e.x-t.x)<u&&Math.abs(e.y-t.y)<u&&Math.abs(e.z-t.z)<u&&Math.abs(e.w-t.w)<u}Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),a=r(1),o=r(2),s=r(18),u=.001;t.orbitEvents={startOrbit:"startOrbit",orbit:"orbit",pan:"pan",zoom:"zoom"},t.entityOrbitEvents={enable:"enableOrbitCamera",disable:"disableOrbitCamera",toggle:"toggleOrbitCamera",reset:"resetOrbitCamera"};var p=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.orbitDistance=2.5,t.zoomPerspectiveBounds=new a.Vector2(5,90),t.zoomOrthographicBounds=new a.Vector2(.125,2.5),t.panEnabled=!0,t.zoomEnabled=!0,t.inertialDamping=.2,t.panSpeed=2,t.orbitSpeed=2,t.zoomSpeed=8,t.pitchAngleBounds=new a.Vector2,t.pivotPoint=new a.Object3D,t.tempVector=new a.Vector3,t.tempVector4=new a.Vector4,t.tempQuaternion=new a.Quaternion,t.tempMatrix4=new a.Matrix4,t.zoomDelta=0,t.inputDragOrbitStart=new a.Vector2,t.inputDragOrbitPosition=new a.Vector2,t.inputDragOrbitDelta=new a.Vector2,t.inputDragPanDelta=new a.Vector2,t.currentZoomSpeed=0,t.currentPanSpeed=new a.Vector2,t.hasChanged=!1,t.targetEuler=new a.Euler(0,0,0,"YXZ"),t.eulerStart=new a.Euler(0,0,0,"YXZ"),t.pitchAngleBoundsMax=0,t.pitchAngleBoundsMin=0,t.originPoint=new a.Vector3,t.pivotWorldPos=new a.Vector3,t.isPanning=!1,t.isOrbiting=!1,t.isZooming=!1,t}return n.__extends(r,e),r.prototype.onEntityReady=function(){this.reset()},r.prototype.orbitStart=function(e){this.isEnabled()&&(this.updateTargetRotation(),this.inputDragOrbitStart.copy(e),this.inputDragOrbitPosition.copy(e))},r.prototype.orbit=function(e){this.isEnabled()&&(this.inputDragOrbitPosition.copy(e),this.isOrbiting=!0)},r.prototype.zoom=function(e){void 0===e&&(e=0),this.isEnabled()&&(this.zoomDelta=.1*-e,this.isZooming=!0)},r.prototype.pan=function(e){this.isEnabled()&&(this.inputDragPanDelta.copy(e),this.isPanning=!0)},r.prototype.resetOrbitRotation=function(){this.updateTargetRotation(),this.inputDragOrbitPosition.set(0,0),this.inputDragOrbitStart.set(0,0)},r.prototype.reset=function(){this.getEntity().reset(),this.panEnabled&&this.setPivotPosition(this.originPoint),this.inputDragPanDelta.set(0,0),this.currentPanSpeed.set(0,0),this.zoomEnabled&&this.zoomComponent.lerpZoom(.5),this.currentZoomSpeed=0,this.resetOrbitRotation(),this.hasChanged=!0},r.prototype.setPivotPosition=function(e){this.pivotPoint.position.copy(e),this.hasChanged=!0},r.prototype.setOrbitDistance=function(e){this.orbitDistance=e,this.hasChanged=!0},r.prototype.getOrbitDistance=function(){return this.orbitDistance},r.prototype.toggle=function(){this.isEnabled()?this.disable():this.enable()},r.prototype.onPreUpdate=function(e){if(this.hasRuntimeData()&&this.isEnabled()&&(this.isOrbiting&&(this.updateOrbit(),this.hasChanged=!0),this.isPanning&&this.panEnabled&&(this.updatePan(e),this.hasChanged=!0),this.isZooming&&(this.updateZoom(e),this.hasChanged=!0),this.hasChanged)){var t=this.getRuntimeData();t.position.set(0,0,this.orbitDistance),t.position.applyQuaternion(t.quaternion),this.pivotPoint.getWorldPosition(this.pivotWorldPos),t.parent&&(this.tempMatrix4.getInverse(t.parent.matrixWorld),this.pivotWorldPos.applyMatrix4(this.tempMatrix4)),t.position.add(this.pivotWorldPos),t.lookAt(this.pivotWorldPos),this.getEngine().needsRender=!0,this.hasChanged=!1}},r.prototype.onStartup=function(){var e,r=this.getEntity();s.isMobile()?(e=r.getComponentByScriptId("orbit_touch_input"))||(e=r.addComponent("orbit_touch_input")):(e=r.getComponentByScriptId("orbit_desktop_input"))||(e=r.addComponent("orbit_desktop_input")),this.zoomEnabled&&(this.zoomComponent=r.getComponentByScriptId("camera_zoom"),this.zoomComponent||(this.zoomComponent=r.addComponent("camera_zoom")),this.zoomComponent.setAttribute("perspectiveZoomMin",this.zoomPerspectiveBounds.x),this.zoomComponent.setAttribute("perspectiveZoomMax",this.zoomPerspectiveBounds.y),this.zoomComponent.setAttribute("orthoZoomMin",this.zoomOrthographicBounds.x),this.zoomComponent.setAttribute("orthoZoomMax",this.zoomOrthographicBounds.y),this.listenTo(e,t.orbitEvents.zoom,this.zoom),this.on(t.orbitEvents.zoom,this.zoom)),this.panEnabled&&(this.listenTo(e,t.orbitEvents.pan,this.pan),this.on(t.orbitEvents.pan,this.pan)),this.listenTo(e,t.orbitEvents.startOrbit,this.orbitStart),this.on(t.orbitEvents.startOrbit,this.orbitStart),this.listenTo(e,t.orbitEvents.orbit,this.orbit),this.on(t.orbitEvents.orbit,this.orbit),this.listenTo(r,"enableOrbitCamera",this.enable),this.listenTo(r,"disableOrbitCamera",this.disable),this.listenTo(r,"toggleOrbitCamera",this.toggle),this.listenTo(r,"resetOrbitCamera",this.reset)},r.prototype.updateOrbit=function(){this.inputDragOrbitStart.x||this.inputDragOrbitStart.y||this.inputDragOrbitStart.copy(this.inputDragOrbitPosition),this.inputDragOrbitDelta.copy(this.inputDragOrbitPosition),this.inputDragOrbitDelta.sub(this.inputDragOrbitStart),this.inputDragOrbitDelta.multiplyScalar(6*this.orbitSpeed),this.targetEuler.copy(this.eulerStart),this.targetEuler.x-=this.inputDragOrbitDelta.y,this.targetEuler.y-=this.inputDragOrbitDelta.x,this.pitchAngleBoundsMax=Math.PI*this.pitchAngleBounds.x/180,this.pitchAngleBoundsMin=Math.PI*this.pitchAngleBounds.y/180,this.targetEuler.x>this.pitchAngleBoundsMax?this.targetEuler.x=this.pitchAngleBoundsMax:this.targetEuler.x<this.pitchAngleBoundsMin&&(this.targetEuler.x=this.pitchAngleBoundsMin);var e=this.getRuntimeData();this.tempQuaternion.setFromEuler(this.targetEuler),i(e.quaternion,this.tempQuaternion)&&(this.isOrbiting=!1),e.quaternion.slerp(this.tempQuaternion,this.inertialDamping),this.inputDragOrbitDelta.set(0,0)},r.prototype.updatePan=function(e){void 0===e&&(e=0);var t=Math.max(0,Math.min(33.3*e*this.inertialDamping,1)),r=1-t;this.inputDragPanDelta.multiplyScalar(this.panSpeed),this.currentPanSpeed.x=r*this.currentPanSpeed.x+t*this.inputDragPanDelta.x,this.currentPanSpeed.y=r*this.currentPanSpeed.y+t*this.inputDragPanDelta.y;var i=this.getRuntimeData();this.tempVector.set(-this.currentPanSpeed.x,this.currentPanSpeed.y,0),this.tempVector.applyQuaternion(i.quaternion),this.tempMatrix4.getInverse(this.pivotPoint.matrixWorld),this.tempVector4.set(this.tempVector.x,this.tempVector.y,this.tempVector.z,0),this.tempVector4.applyMatrix4(this.tempMatrix4),this.tempVector.set(this.tempVector4.x,this.tempVector4.y,this.tempVector4.z),this.pivotPoint.position.add(this.tempVector),Math.abs(this.currentPanSpeed.y)<u&&Math.abs(this.currentPanSpeed.x)<u&&(this.currentPanSpeed.set(0,0),this.isPanning=!1),this.inputDragPanDelta.set(0,0)},r.prototype.updateZoom=function(e){if(void 0===e&&(e=0),!this.zoomEnabled)return void(this.isZooming=!1);var t=Math.max(0,Math.min(33.3*e*this.inertialDamping,1)),r=1-t;this.currentZoomSpeed=r*this.currentZoomSpeed+t*this.zoomSpeed*this.zoomDelta,Math.abs(this.currentZoomSpeed)<u&&(this.currentZoomSpeed=0,this.isZooming=!1),this.zoomComponent.zoom(this.currentZoomSpeed),this.zoomDelta=0},r.prototype.updateTargetRotation=function(){this.tempQuaternion.copy(this.getRuntimeData().quaternion),this.eulerStart.setFromQuaternion(this.tempQuaternion,"YXZ"),this.targetEuler.copy(this.eulerStart)},r}(o.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enablePreRenderFunctions=!0,t.enableShadows=!0,t.opacity=1,t.overrideCameraAspect=!0,t.overrideScene=null,t.renderEventName="render",t.currentOptions={viewPort:{x:0,y:0,width:100,height:200}},t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"setViewport",this.setViewport),this.listenTo(this.getEntity(),"enableRenderView",this.enable),this.listenTo(this.getEntity(),"disableRenderView",this.disable),this.listenTo(this.getEntity(),"toggleRenderView",this.toggle),this.listenTo(this.getEngine(),"rendererResize",this.onRendererResize),this.onRendererResize()},t.prototype.setEffect=function(e){this.effect=e},t.prototype.onEnable=function(){this.renderTarget&&this.renderTarget.isUnloaded()&&this.renderTarget.load(),this.bindToRender(),this.getEngine().needsRender=!0},t.prototype.onDisable=function(){this.getEngine().needsRender=!0},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("renderGroup")&&this.bindToRender(),-1===e.indexOf("viewportWidth")&&-1===e.indexOf("viewportHeight")&&-1===e.indexOf("viewportBottom")&&-1===e.indexOf("viewportLeft")||(this.updateViewport(),this.updateCameraAspect())},t.prototype.renderView=function(e){if(this.isEnabled()&&this.hasRuntimeData()){var t;this.overrideScene&&this.overrideScene.getRootObject()?(this.overrideScene.getRootObject().isBaseUnloaded()&&this.overrideScene.load(),t=this.overrideScene.getRootObject()):t=this.getRootObject(),t.runtimeData&&(this.currentOptions.viewPort.x=this.x,this.currentOptions.viewPort.y=this.y,this.currentOptions.viewPort.width=this.width,this.currentOptions.viewPort.height=this.height,this.currentOptions.enablePreRenderFunctions=this.enablePreRenderFunctions,this.currentOptions.enableShadows=this.enableShadows,this.currentOptions.clearColor=this.clearColor,this.currentOptions.clearDepth=this.clearDepth,this.currentOptions.opacity=this.opacity,this.currentOptions.renderTarget=this.renderTarget,this.currentOptions.effect=this.effect,this.currentOptions.delta=e,this.getRuntimeData().layers.set(this.renderLayer),this.getRenderer().renderView(t.runtimeData,this.getRuntimeData(),this.currentOptions))}},t.prototype.bindToRender=function(){this.stopListening(this.getEngine(),this.renderEventName),this.renderEventName="render",this.renderGroup&&(this.renderEventName+="Group"+this.renderGroup),this.listenTo(this.getEngine(),this.renderEventName,this.renderView)},t.prototype.setViewport=function(e,t,r,i){this.setAttributes({viewportLeft:e,viewportBottom:t,viewportWidth:r,viewportHeight:i})},t.prototype.updateViewport=function(){var e=this.getEngine().getRenderer();if(e){var t,r=e.getWidth(),i=e.getHeight();"string"==typeof this.viewportBottom&&"%"===this.viewportBottom.slice(-1)?(t=.01*parseFloat(this.viewportBottom.slice(0,-1)),this.y=t*i):this.y=parseInt(this.viewportBottom,10),this.y=Math.min(this.y,i),"string"==typeof this.viewportLeft&&"%"===this.viewportLeft.slice(-1)?(t=.01*parseFloat(this.viewportLeft.slice(0,-1)),this.x=t*r):this.x=parseInt(this.viewportLeft,10),this.x=Math.min(this.x,r),"string"==typeof this.viewportWidth&&"%"===this.viewportWidth.slice(-1)?(t=.01*parseFloat(this.viewportWidth.slice(0,-1)),this.width=t*r):this.width=parseInt(this.viewportWidth,10),this.width=Math.min(this.width,r-this.x),"string"==typeof this.viewportHeight&&"%"===this.viewportHeight.slice(-1)?(t=.01*parseFloat(this.viewportHeight.slice(0,-1)),this.height=t*i):this.height=parseInt(this.viewportHeight,10),this.height=Math.min(this.height,i-this.y),this.x<0&&(this.x=Math.max(this.x+r,0)),this.y<0&&(this.y=Math.max(this.y+i,0))}},t.prototype.updateCameraAspect=function(){if(this.overrideCameraAspect&&this.isEnabled()){var e=this.getEntity(),t=this.width/this.height;e.setProperties({aspect:t,left:e.getProperty("bottom")*t,right:e.getProperty("top")*t})}},t.prototype.onRendererResize=function(){this.updateViewport(),this.updateCameraAspect()},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n={side:{displayName:"Cull Mode",description:"This controls which side of the geometry will be visible.",type:"opt",isRenderParam:!0,options:{frontOnly:i.FrontSide,backOnly:i.BackSide,doubleSided:i.DoubleSide},default:"doubleSided"},wireframe:{displayName:"Wireframe",description:"This controls whether the material displays as a wireframe.",type:"b",isRenderParam:!0,default:!1},fog:{displayName:"Enable Fog",description:"This controls whether this material is affected by fog or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},depthFunc:{displayName:"Depth Function",description:"The function to use when comparing the current depth value with the one that already exists in the buffer.",isRenderParam:!0,type:"opt",options:{never:i.NeverDepth,always:i.AlwaysDepth,lessThan:i.LessDepth,lessThanOrEqual:i.LessEqualDepth,equal:i.EqualDepth,greaterThanOrEqual:i.GreaterEqualDepth,greaterThan:i.GreaterDepth,notEqual:i.NotEqualDepth},default:"lessThanOrEqual"},depthWrite:{displayName:"Enable Depth Write",description:"This controls whether the depth values of a mesh rendered with this material are recorded.",isRenderParam:!0,type:"b",default:!0},depthTest:{displayName:"Enable Depth Test",description:"This controls whether a depth check is done before this material is rendered so that it can be occluded.",isRenderParam:!0,type:"b",default:!0},blending:{displayName:"Blending Mode",description:"This controls how the material will be blended with the color behind it.",isRenderParam:!0,type:"opt",options:{none:i.NoBlending,normal:i.NormalBlending,additive:i.AdditiveBlending,subtractive:i.SubtractiveBlending,multiplicative:i.MultiplyBlending,custom:i.CustomBlending},default:"normal",transparency:"GreaterThanOne"},blendEquation:{displayName:"Blending Equation",description:"The function to use when blending the current color with the one already in the buffer. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"}}},blendSrc:{displayName:"Blend Source",description:"The first parameter to be used in the blend equation. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"}}},blendDst:{displayName:"Blend Destination",description:"The second parameter to be used in the blend equation. Enabled when using custom blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"}}},useSeparateAlphaBlend:{displayName:"Separate Blend for Alpha",description:"Use different blend values for the alpha channel. Enabled when using custom blending.",type:"b",default:!1,displayWhen:{blending:{equals:"custom"}}},blendEquationAlpha:{displayName:"Alpha Blend Equation",description:"The function to use when blending the current alpha with the one already in the buffer. Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},blendSrcAlpha:{displayName:"Alpha Blend Source",description:"The first parameter to be used in the alpha blend equation. Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},blendDstAlpha:{displayName:"Alpha Blend Destination",description:"The second parameter to be used in the alpha blend equation. Enabled when using custom blending and separate alpha blending.",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},polygonOffset:{displayName:"Polygon Offset",description:"Turns on rendering with polygon offsets. This can be used to work around z-fighting.",isRenderParam:!0,type:"b",default:!1},polygonOffsetFactor:{displayName:"Polygon Offset Factor",description:"Scales the maximum Z slope, with respect to X or Y of the polygon.",isRenderParam:!0,type:"f",default:1},polygonOffsetUnits:{displayName:"Polygon Offset Units",description:"Scales the minimum resolvable depth buffer value.",isRenderParam:!0,type:"f",default:1},alphaTest:{displayName:"Alpha Test",description:'Pixels with an alpha value below the given value will not be rendered. This value will only be used when this material\'s Transparency blending mode is set to "Masked"',isRenderParam:!0,forceUpdate:!0,type:"f",default:.2,min:0,max:1,step:.001}};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={diffuse:{displayName:"Diffuse Color",description:"The color of light diffusely reflected by the surface.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"color"},diffuseTexture:{displayName:"Diffuse Map",description:"The color reflected diffusely by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"map",enabledWhen:{diffuseTexture:{notEqualsDefault:!0}},transparency:"HasAlpha"},ambientFactor:{displayName:"Ambient Intensity",description:"A value to multiple the ambient color by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"aoMapIntensity"},ambientTexture:{displayName:"Ambient Texture",description:"The color reflected by the surface from ambient lights.",type:"t",default:null,isRenderParam:!0,uniformName:"aoMap",enabledWhen:{ambientTexture:{notEqualsDefault:!0}}},emissive:{displayName:"Emissive Color",description:"A color emitted by the surface which is not affected by external lights.",type:"c",default:{r:0,g:0,b:0},min:0,max:1,isRenderParam:!0,uniformName:"emissive"},emissiveFactor:{displayName:"Emissive Intensity",description:"A value to multiple the emissive color by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"emissiveIntensity"},emissiveTexture:{displayName:"Emissive Texture",description:"The color emitted by the surface which is not affected by external lights.",type:"t",default:null,isRenderParam:!0,uniformName:"emissiveMap",enabledWhen:{emissiveTexture:{notEqualsDefault:!0}}},bumpTexture:{displayName:"Bump Texture",description:"The height map of the surface, used to fake its shape when shading.",type:"t",default:null,isRenderParam:!0,uniformName:"bumpMap",enabledWhen:{bumpTexture:{notEqualsDefault:!0},normalMapTexture:{equalsDefault:!0}}},bumpFactor:{displayName:"Bump Scale",description:"A value to multiple the bump amount by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"bumpScale"},normalMapTexture:{displayName:"Normal Texture",description:"The tangent-space surface directions, used to fake its shape when shading.",type:"t",default:null,isRenderParam:!0,uniformName:"normalMap",enabledWhen:{normalMapTexture:{notEqualsDefault:!0}}},normalFactor:{displayName:"Normal Scale",description:"A value to divide the normal-z amount by. i.e. lower value results in smoother surface.",type:"v2",default:{x:1,y:1},min:0,max:100,isRenderParam:!0,uniformName:"normalScale"},transparencyFactor:{displayName:"Opacity",description:"The opacity of the surface.",type:"f",default:1,step:.001,min:0,max:1,isRenderParam:!0,uniformName:"opacity",transparency:"LessThanOne"},transparencyFactorTexture:{displayName:"Alpha Map",description:"The opacity of the surface.",type:"t",default:null,isRenderParam:!0,uniformName:"alphaMap",transparency:"NotFalsy",enabledWhen:{transparencyFactorTexture:{notEqualsDefault:!0}}},displacementColorTexture:{displayName:"Displacement Map",description:"A texture that stores the displacement amount at each texel.",type:"t",default:null,isRenderParam:!0,uniformName:"displacementMap",enabledWhen:{displacementColorTexture:{notEqualsDefault:!0}}},displacementFactor:{displayName:"Displacement Scale",description:"A value to multiple the displacement by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"displacementScale"},displacementBias:{displayName:"Displacement Bias",description:"A value to bias the displacement by.",type:"f",default:0,min:-1,max:1,isRenderParam:!0,uniformName:"displacementBias"}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(10),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.on("setColor",this.setColor,this),this.on("setIntensity",this.setIntensity,this)},t.prototype.uninitialize=function(){this.off("setColor",this.setColor,this),this.off("setIntensity",this.setIntensity,this),e.prototype.uninitialize.call(this)},t.prototype.createRuntimeData=function(e){var t=this.getProperty("lightType");"directional"===t?this.runtimeData=new a.DirectionalLight:"ambient"===t?this.runtimeData=new a.AmbientLight:"spot"===t?this.runtimeData=new a.SpotLight:"hemisphere"===t?this.runtimeData=new a.HemisphereLight:"point"===t&&(this.runtimeData=new a.PointLight),this.runtimeData.name=this.getRuntimeName(),e(this)},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("lightType")&&this.getProperty("lightType")!==this.getPreviousProperty("lightType")&&"init"!==r)return void this.reloadBase();t.hasOwnProperty("intensity")&&(this.runtimeData.intensity=this.getProperty("intensity")),t.hasOwnProperty("color")&&this.runtimeData.color.copy(this.getProperty("color"));var i=this.getProperty("lightType");if("directional"===i){if((t.hasOwnProperty("shadowCameraNear")||t.hasOwnProperty("shadowCameraFar")||t.hasOwnProperty("shadowCameraLeft")||t.hasOwnProperty("shadowCameraRight")||t.hasOwnProperty("shadowCameraTop")||t.hasOwnProperty("shadowCameraBottom"))&&(this.runtimeData.shadow?(this.runtimeData.shadow.camera.near=this.getProperty("shadowCameraNear"),this.runtimeData.shadow.camera.far=this.getProperty("shadowCameraFar"),this.runtimeData.shadow.camera.left=this.getProperty("shadowCameraLeft"),this.runtimeData.shadow.camera.right=this.getProperty("shadowCameraRight"),this.runtimeData.shadow.camera.top=this.getProperty("shadowCameraTop"),this.runtimeData.shadow.camera.bottom=this.getProperty("shadowCameraBottom"),this.runtimeData.shadow.camera.updateProjectionMatrix()):this.runtimeData.shadow=new a.LightShadow(new a.OrthographicCamera(this.getProperty("shadowCameraLeft"),this.getProperty("shadowCameraRight"),this.getProperty("shadowCameraTop"),this.getProperty("shadowCameraBottom"),this.getProperty("shadowCameraNear"),this.getProperty("shadowCameraFar")))),t.hasOwnProperty("shadowBias")&&(this.runtimeData.shadow.bias=this.getProperty("shadowBias")),t.hasOwnProperty("shadowMapWidth")||t.hasOwnProperty("shadowMapHeight")){var n=this.engine.getGPUCapability("MAX_TEXTURE_SIZE");this.runtimeData.shadow.mapSize.width=Math.min(n,this.getProperty("shadowMapWidth")),this.runtimeData.shadow.mapSize.height=Math.min(n,this.getProperty("shadowMapHeight")),this.disposeShadowMap()}t.hasOwnProperty("castShadow")&&(this.runtimeData.castShadow=this.getProperty("castShadow"),this.runtimeData.castShadow||this.disposeShadowMap())}else"hemisphere"===i?t.hasOwnProperty("groundColor")&&this.runtimeData.groundColor.copy(this.getProperty("groundColor")):"spot"===i&&(t.hasOwnProperty("angle")&&(this.runtimeData.angle=this.getProperty("angle")),t.hasOwnProperty("penumbra")&&(this.runtimeData.penumbra=this.getProperty("penumbra")));"point"!==i&&"spot"!==i||(t.hasOwnProperty("distance")&&(this.runtimeData.distance=this.getProperty("distance")),t.hasOwnProperty("decay")&&(this.runtimeData.decay=this.getProperty("decay"))),this.engine.needsRender=!0},t.prototype.disposeShadowMap=function(){this.runtimeData.shadow&&this.runtimeData.shadow.map&&(this.runtimeData.shadow.map.dispose(),this.runtimeData.shadow.map=void 0)},t.prototype.unload=function(t){void 0===t&&(t=!1),this.runtimeData&&this.runtimeData.shadow&&this.runtimeData.shadow.map&&(n.default.info(this.engine.getName()+" - Deallocating shadow map texture for light "+this.getName()),this.disposeShadowMap()),e.prototype.unload.call(this,t)},t.prototype.setColor=function(e){this.setProperty("color",e)},t.prototype.setIntensity=function(e){this.setProperty("intensity",e)},t.events={setColor:{scope:"local",action:!0,category:"Materials",parameters:[{name:"value",type:"c",description:"The colour to set.",default:16711680},{name:"animationTime",type:"f",description:"The length of time that the change will take. i.e. this lets you animate the change.",default:0,min:0}]},setIntensity:{scope:"local",action:!0,category:"Materials",parameters:[{name:"value",type:"f",description:"The intensity to set.",default:1},{name:"animationTime",type:"f",description:"The length of time that the change will take. i.e. this lets you animate the change.",default:0,min:0}]}},t}(o.default);s.addSchemas("LightObject",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(10),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.runtimeData=new a.Scene,this.runtimeData.matrixAutoUpdate=!1,this.runtimeData.name=this.getName(),e()},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r),this.getProperty("fogEnabled")?(this.runtimeData.fog||(this.runtimeData.fog=new a.FogExp2(this.getProperty("fogColor"))),t.hasOwnProperty("fogColor")&&this.runtimeData.fog.color.setHex(this.getProperty("fogColor")),t.hasOwnProperty("fogDensity")&&(this.runtimeData.fog.density=this.getProperty("fogDensity"))):this.runtimeData.fog=null,t.hasOwnProperty("fogEnabled")&&(this.engine.trigger("rebuildMaterials"),this.engine.needsRender=!0)},t.prototype.unload=function(t){void 0===t&&(t=!1),this.runtimeData&&(n.default.info("Unloading scene, "+this.getName()),e.prototype.unload.call(this,t))},t}(o.default);s.addSchemas("SceneObject",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"baseEntity",title:"BaseEntityDef",type:"object",description:"Base hierarchical type for assets and objects.",properties:{type:{type:"string",description:"The entity's type."},sid:{type:"string",description:"The entity's scoped ID."},id:{type:"string",description:"The entity's unique ID."},properties:{$ref:"baseEntityProperties.json"},previousProperties:{$ref:"baseEntityProperties.json"},components:{type:"array",items:{$ref:"component.json"},default:[]},previousComponents:{type:"array",items:{$ref:"component.json"},default:[]}},additionalProperties:!1,required:["id"]};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"baseEntityProperties",title:"BaseEntityPropertiesDef",type:"object",description:"Holds type-specific properties.",properties:{name:{type:"string",description:"The entity's name.",default:"unnamed"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=r(48),o=i.__assign({},n.default,a.default,{id:"baseImageAssetProperties",title:"BaseImageAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{premultiplyAlpha:{type:"boolean",description:"Indicates whether the image's channels have been premultiplied by the alpha value.",default:!1},stream:{type:"boolean",description:"True if a low-resolution image should be loaded before the full-size image.",default:!0},filename:{type:"string",description:"The filename of the original image.",default:""},compression:{type:"string",description:"The type of compression used for the original image file.",default:"zip"},depth:{type:"integer",description:"The bit-depth of each channel in the original image file.",default:8},sequenceLength:{type:"integer",description:"The number of images contained in the original image file.",default:1},channels:{type:"array",items:{type:"string",enum:["red","green","blue","alpha","gray","exponent"]},description:"The distinct channels found in the original image file.",default:["red","green","blue"]}})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"baseRenderTextureAsset",title:"BaseRenderTextureAssetDef",properties:i.__assign({},n.default.properties,{properties:{$ref:"baseRenderTextureAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=r(48),o=i.__assign({},n.default,a.default,{id:"baseRenderTextureAssetProperties",title:"BaseRenderTextureAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{stencilBuffer:{type:"boolean",description:"Controls whether the render texture includes a stencil buffer.",default:!1},depthBuffer:{type:"boolean",description:"Controls whether the render texture includes a depth buffer.",default:!1},width:{type:"integer",description:"The width, in pixels, of the texture.",min:1,max:16384,default:256},height:{type:"integer",description:"The height, in pixels, of the texture.",min:1,max:16384,default:256},encoding:{type:"string",description:"The encoding of the image (e.g. 'srgb', 'linear', etc.).",enum:["srgb","linear","gamma","rgbe","logLuv","rgbm7","rgbm16","rgbd","depth","rgbaDepth"],default:"srgb"},imageId:i.__assign({},n.default.properties.imageId,{description:"Can't set source image for render texture. #read-only"})})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"commonImageProperties",title:"CommonImagePropertiesDef",type:"object",properties:{width:{type:"integer",description:"The width, in pixels, of the original image file."},height:{type:"integer",description:"The height, in pixels, of the original image file."},layout:{type:"string",description:"The layout of the image. i.e. normal, stereo2dOverUnder, stereo2dOverUnder",enum:["normal","stereo2dOverUnder","stereo2dUnderOver","stereo2dLeftRight","stereo2dRightLeft"],default:"normal"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";function i(e,t){Object.getOwnPropertyNames(t).forEach(function(r){"constructor"===r||e.hasOwnProperty(r)||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}function n(e,t){var r=function(r){var n=this,a={};r&&i(a,r),e&&i(a,e),t.forEach(function(e){e.call(n,a)})};return t.forEach(function(e){i(r.prototype,e.prototype)}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(27);t.default=new i.default},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(6),s=r(21),u=r(5),p=r(4),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.trackData=[],t}return i.__extends(t,e),t.prototype.getChannel=function(e){return this.getProperty("channels")[e]},t.prototype.getChannelIds=function(){return Object.keys(this.getProperty("channels"))},t.prototype.getChannels=function(){return u.values(this.getProperty("channels"))},t.prototype.getClip=function(e){return this.getProperty("clips")[e]},t.prototype.getClipIds=function(){return Object.keys(this.getProperty("clips"))},t.prototype.getClips=function(){return u.values(this.getProperty("clips"))},t.prototype.getLayer=function(e){return this.getProperty("layers")[e]},t.prototype.getLayerIds=function(){return Object.keys(this.getProperty("layers"))},t.prototype.getLayers=function(){return u.values(this.getProperty("layers"))},t.prototype.createClip=function(e,t){var r=this;void 0===t&&(t=null);var i=this.getClip(e);if(!i)throw new Error('Invalid argument: clip "'+e+'" not found');i.layers.length>1&&n.default.warn('Clip "'+e+'" contains multiple layers, but AnimationAsset.prototype.createAnimation() only supports a single layer.');var o=this.getLayer(i.layers[0]),s=o?o.channels:[],u=s.map(function(e){return r.createKeyframeTrack(e,i.start,i.stop,t)});return new a.AnimationClip(i.name,i.stop-i.start,u)},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){t.isDestroyed()||e()},this)},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("channels")&&this.registerBufferDependency()},t.prototype.registerBufferDependency=function(){var e=this,t=this.getChannels(),r=[];t.forEach(function(e){r.push(e.times),r.push(e.values)}),r.forEach(function(t){var r=t.split("#");if(2!==r.length)throw new Error(e.engine.getName()+" - AnimationAsset: Invalid accessorId, "+t);e.registerDependencyById(r[0])})},t.prototype.createKeyframeTrack=function(e,t,r,i){var n=this,o=this.getChannel(e);if(!o)throw new Error(this.engine.getName()+" - AnimationAsset: Channel not found, "+e);var s=[e,t,r].join("#"),u=this.trackData[s];u||(u=this.createKeyframeTrackData(o,t,r),this.trackData[s]=u);var p=o.targetObject.map(function(e){var t=i?i[e]:e;return n.engine.getRuntimeName(t)}),c=p.join("/")+"."+o.targetProperty;return new("quaternion"===o.targetProperty?a.QuaternionKeyframeTrack:a.VectorKeyframeTrack)(c,u.times,u.values,null)},t.prototype.createKeyframeTrackData=function(e,t,r){var i=e.times.split("#"),n=i[0],a=i[1],o=this.engine.getEntityById(n);if(!o)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+n);var u=o.getAccessor(a),p=o.getArray(a);if(!u||!p)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+a);var c=e.values.split("#"),l=c[0],d=c[1],h=this.engine.getEntityById(l);if(!h)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+l);var f=h.getAccessor(d),m=h.getArray(d);if(!f||!m)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+d);var y,g=-1;for(y=0;y<p.length;++y)if(p[y]>=t){g=y;break}var v=-1;for(y=p.length;y-- >0;)if(p[y]<=r){v=y;break}var b=g>=0?g:0,x=v>=0?v+1:p.length,P=s.default.getTypeSize(f.type),w=p.subarray(b,x),E=m.subarray(b*P,x*P);return{times:0===t?w:w.slice().map(function(e){return e-t}),values:E}},t}(o.default);p.addSchemas("AnimationAsset",c),t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.uninitialize=function(){this.runtimeData&&this.runtimeData.pause(),e.prototype.uninitialize.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),this.runtimeData&&(t.hasOwnProperty("loop")&&(this.runtimeData.loop=this.getProperty("loop")),t.hasOwnProperty("state")))switch(this.getProperty("state")){case"pause":this.runtimeData.pause();break;case"play":this.runtimeData.play()}},t}(n.default);a.addSchemas("AudioAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(20),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.createRTImageData(),this.trigger("loadProgress",this),e()},t.prototype.getLayout=function(){return this.getProperty("layout")},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),(t.hasOwnProperty("format")||t.hasOwnProperty("type")||t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&"init"!==r)return void this.reloadBase();this.runtimeData.texture.encoding=this.getThreeEncoding()},t}(n.default);t.default=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(9),u=r(21),p=r(5),c=r(4),l=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(r,t),r.prototype.getBounds=function(e){var t=this.getProperty("bounds");return(e||new a.Box3).set(t.min,t.max)},r.prototype.getDataSizeInMemorySelf=function(){return 0},r.prototype.applyPropertiesUnloaded=function(e){t.prototype.applyPropertiesUnloaded.call(this,e),e.accessorId&&this.registerBufferDependency()},r.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){if(t.getDependencies().some(function(e){return e.isLoadFailed()}))t.setState(s.StateType.Base,s.State.Failed);else try{t.decode()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},r.prototype.createBufferAttribute=function(e,t,r,i){var n=r.num_points(),o=i.components_count(),s=n*o,u=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,u);for(var p=new Float32Array(s),c=0;c<s;++c)p[c]=u.GetValue(c);return e.destroy(u),new a.BufferAttribute(p,o)},r.prototype.createBufferGeometry=function(e,t,r){var i=this,n={indices:"index",positions:"position",normals:"normal",tangents:"tangent",colors:"color",uvs1:"uv",uvs2:"uv2",skinIndices:"skinIndex",skinWeights:"skinWeight"},s=this.getProperty("attributes"),u={};p.forEach(n,function(n,a){if(s.hasOwnProperty(a)){var o=t.GetAttribute(r,s[a].id);u[n]=i.createBufferAttribute(e,t,r,o)}});for(var c=r.num_faces(),l=new Uint32Array(3*c),d=new e.DracoInt32Array,h=0;h<c;++h)t.GetFaceFromMesh(r,h,d),l[3*h]=d.GetValue(0),l[3*h+1]=d.GetValue(1),l[3*h+2]=d.GetValue(2);e.destroy(d);var f=new a.BufferGeometry;if(f.setIndex(new a.BufferAttribute(l,1)),p.forEach(u,function(e,t){e&&f.addAttribute(t,e)}),s.hasOwnProperty("materialIndices")){var m=t.GetAttribute(r,s.materialIndices.id),y=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,m,y);for(var g=-1,v=0,b=void 0,x=0;x<c;++x){var P=Math.round(y.GetValue(l[3*x]));P!==g&&(b=3*x-v,b>0&&(f.addGroup(v,b,g),v+=b),g=P)}b=3*c-v,b>0&&f.addGroup(v,b,g),e.destroy(y)}else f.addGroup(0,3*c,-1);var w=this.getProperty("bounds"),E=new a.Vector3(w.min.x,w.min.y,w.min.z),S=new a.Vector3(w.max.x,w.max.y,w.max.z);f.boundingBox=new a.Box3(E,S),f.computeBoundingSphere(),this.addMissingAttributes(f),this.setGeometry(o.default.primitiveType.TRIANGLES,f)},r.prototype.decode=function(){var t=e.Module;if(!t)throw new Error("Draco module not found");var r=u.default.getBufferArray(this.engine,this.getProperty("accessorId")),i=new t.DecoderBuffer;i.Init(r,r.byteLength),i.Init(r,r.byteLength);var a=new t.WebIDLWrapper,o=a.GetEncodedGeometryType(i);if(o===t.TRIANGULAR_MESH){var s=a.DecodeMeshFromBuffer(i);this.createBufferGeometry(t,a,s),t.destroy(s)}else n.default.warn(this.engine.getName()+" - DracoGeometryAsset: Unrecognized geometry type '"+o+"'");t.destroy(a),t.destroy(i)},r.prototype.registerBufferDependency=function(){var e=this.getProperty("accessorId"),t=e.split("#");if(2!==t.length)throw new Error(this.engine.getName()+" - DracoGeometryAsset: Invalid accessorId, "+e);this.registerDependencyById(t[0])},r}(o.default);c.addSchemas("DracoGeometryAsset",l),t.default=l}).call(t,r(77))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(9),o=r(12),s=r(11),u=r(15),p=r(4),c=["red","green","blue"],l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadPriority=2,t}return i.__extends(t,e),t.prototype.unload=function(){this.runtimeData&&(this.engine.trigger("imageUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading image, "+this.getName()),e.prototype.unload.call(this))},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.isCompressed=function(){return this.runtimeData?"jpeg"!==this.runtimeData.compression&&"zip"!==this.runtimeData.compression:this.getProperty("useCompression")},t.prototype.getCompressionFormat=function(){if(this.getProperty("useCompression")){var e=this.engine.getThreeRenderer();if(e){var t=e.extensions;if(t.get("WEBGL_compressed_texture_s3tc"))return"dxt";if(t.get("WEBGL_compressed_texture_pvrtc"))return"pvrtc"}}},t.prototype.getFormat=function(){var e=this.getChosenRepresentation();if(e.channels)switch(e.channels.length){case 4:return"alpha"===e.channels[3]?"rgba":"rgb";case 3:return"rgb";case 2:return"luminanceAlpha";case 1:return"luminance";default:return"rgb"}},t.prototype.getOriginalWidth=function(){return this.getProperty("width")||0},t.prototype.getOriginalHeight=function(){return this.getProperty("height")||0},t.prototype.getMaxRepresentationWidth=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.width>e?t.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.height>e?t.height:e},0):0},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.getImageResponseType=function(e){switch(e){case"image/vnd-ms.dds":return"arraybuffer";default:return"blob"}},t.prototype.applyPropertiesUnloaded=function(e){var t={maxSize:Math.max(this.getWidth(),this.getHeight()),compression:this.getCompressionFormat()};this.chosenRepresentation=this.findRepresentation(t)},t.prototype.createRuntimeData=function(e){var t=this;if(!this.chosenRepresentation)throw new Error("No suitable representation found to load");this.loadLowResImage(e).then(function(){return t.loadHighResImage(e)}).catch(this.onImageLoadError.bind(this))},t.prototype.loadLowResImage=function(e){var t=this;if(this.loadPriority=2,!this.getProperty("stream"))return Promise.resolve();var r={maxSize:64},i=this.findRepresentation(r);return i?new Promise(function(r,n){var a=t.loadResource(i.src,u.default.IMAGE,e,{priority:t.loadPriority,responseType:t.getImageResponseType(i.contentType),isExternal:i.isExternal});a.once(s.default.LOAD,function(e){t.onImageLoad(e,i),t.loadPriority=8,r()}),a.once(s.default.CANCEL,function(){n(new Error("Failed to load low res texture"))}),a.once(s.default.ERROR,n)}):Promise.resolve()},t.prototype.loadHighResImage=function(e){var t=this;if(!this.isDestroyed())return new Promise(function(r,i){var n=function(e){t.isDestroyed()||(t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t))};t.setState(a.StateType.Base,a.State.InProgress);var o=t.chosenRepresentation,p=t.loadResource(o.src,u.default.IMAGE,e,{responseType:t.getImageResponseType(o.contentType),isExternal:o.isExternal,priority:t.loadPriority});p.once(s.default.PROGRESS,n),p.once(s.default.LOAD,function(e){t.onImageLoad(e,o)}),p.once(s.default.ERROR,i)})},t.prototype.onImageLoad=function(e,t){if(this.runtimeData||(this.runtimeData={}),this.runtimeData.contentType=t.contentType,this.runtimeData.compression=t.compression,this.runtimeData.colorspace=t.colorspace,this.runtimeData.channels=this.getOwnProperty("channels")||t.channels||c,this.runtimeData.width=t.width,this.runtimeData.height=t.height,!(e instanceof ArrayBuffer||e instanceof Image))throw new Error("Unknown container type for image data!");this.runtimeData.imageData=e,this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this)},t.prototype.onImageLoadError=function(e){this.isDestroyed()||(n.default.error("There was an error loading the image, "+this.getName(),e),this.setState(a.StateType.Base,a.State.Failed),this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this))},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxSize:16384},e),i=t.filter(function(e){if(e.compression===r.compression)return!0;switch(e.compression){case"zip":case"jpeg":return!r.compression;case"dxt":case"dxt1":case"dxt5":return"dxt"===r.compression}return!1});0===i.length&&(i=t.filter(function(e){return"zip"===e.compression||"jpeg"===e.compression}));var n=i.filter(function(e){var t=e.channels||c;return!r.channels||t.toString()===r.channels.toString()});0===n.length&&(n=i);var a=["image/vnd-ms.dds"],o=n.filter(function(e){var t=Math.max(e.width,e.height),i=-1!==a.indexOf(e.contentType);return t<=r.maxSize||i}),s=o.reduce(function(e,t,r){return Math.max(t.width,t.height)>(e>=0?Math.max(o[e].width,o[e].height):0)?r:e},-1);return s>=0?o[s]:null},t}(o.default);p.addSchemas("ImageAsset",l),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(9),u=r(21),p=r(5),c=r(4),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDataSizeInMemorySelf=function(){var e=this,t=this.getProperty("attributes");return Object.keys(t).map(function(r){var i=t[r],n=u.default.getBufferAccessor(e.engine,i.accessorId);return u.default.getComponentTypeSize(n.componentType)*u.default.getTypeSize(n.type)*n.count}).reduce(function(e,t){return t+e},0)},t.prototype.applyPropertiesUnloaded=function(t){e.prototype.applyPropertiesUnloaded.call(this,t),(t.attributes||t.indices)&&this.registerBufferDependency()},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){if(t.getDependencies().some(function(e){return e.isLoadFailed()}))t.setState(s.StateType.Base,s.State.Failed);else try{t.createBufferGeometry()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},t.prototype.createAttributes=function(e){var t=this,r={indices:"index",positions:"position",normals:"normal",tangents:"tangent",colors:"color",uvs1:"uv",uvs2:"uv2",skinIndices:"skinIndex",skinWeights:"skinWeight"},i=Object.assign({indices:{accessorId:this.getProperty("indices")}},this.getProperty("attributes")),n={};return p.forEach(r,function(r,a){if(i.hasOwnProperty(a)){var o=i[a].accessorId;n[r]=t.createBufferAttribute(o,e[r])}}),n},t.prototype.createBufferAttribute=function(e,t){var r=u.default.getBufferAccessor(this.engine,e),i=u.default.getBufferArray(this.engine,e),n=u.default.getTypeSize(r.type);if(void 0===t||n===t)return new a.BufferAttribute(i,n);for(var o=new i.constructor(r.count*t),s=Math.min(n,t),p=0;p<r.count;p+=1){for(var c=0;c<s;c+=1)o[p*t+c]=i[p*n+c];for(;c<t;)o[p*t+c]=0,c+=1}return new a.BufferAttribute(o,t)},t.prototype.createBufferGeometry=function(){var e=this,t=this.createAttributes({index:1,position:3,normal:3,tangent:4,color:4,uv:2,uv2:2,skinIndex:4,skinWeight:4}),r=this.getProperty("bounds"),i=new a.Vector3(r.min.x,r.min.y,r.min.z),n=new a.Vector3(r.max.x,r.max.y,r.max.z),o=this.getProperty("primitives").reduce(function(e,t){return e[t.primitive]=e[t.primitive]||[],e[t.primitive].push(t),e},{});p.forEach(o,function(r,o){var s=new a.BufferGeometry;r.forEach(function(e){s.addGroup(e.start,e.count,e.materialIndex)}),p.forEach(t,function(e,t){"index"===t?s.setIndex(e):s.addAttribute(t,e)}),e.addMissingAttributes(s),s.boundingBox=new a.Box3(i,n),s.computeBoundingSphere(),e.setGeometry(o,s)})},t.prototype.registerBufferDependency=function(){var e=this,t=this.getProperty("attributes"),r=this.getProperty("indices"),i=[r];Object.keys(t).forEach(function(e){i.push(t[e].accessorId)});var n={};i.forEach(function(t){var r=t.split("#");if(2!==r.length)throw new Error(e.engine.getName()+" - MeshGeometryAsset: Invalid accessorId, "+t);n[r[0]]=!0}),Object.keys(n).forEach(function(t){e.registerDependencyById(t)})},t}(o.default);c.addSchemas("MeshGeometryAsset",l),t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(19),o=r(5),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.engine.on("prefabDeleted",this.onPrefabDeleted,this),this.on("load",this.onPrefabLoaded,this)},t.prototype.uninitialize=function(){var t=this;this.engine.off("prefabDeleted",this.onPrefabDeleted,this),this.off("load",this.onPrefabLoaded,this);var r=this.getRootObject();r&&r.getDescendants().forEach(function(e){return t.engine.unregisterEntity(e)}),e.prototype.uninitialize.call(this)},t.prototype.getRootObject=function(){return this.engine.getObjectById(this.getProperty("rootObjectId"))},t.prototype.setRootObjectById=function(e){return this.setProperty("rootObjectId",e)},t.prototype.setRootObject=function(e){return this.setProperty("rootObjectId",e.id)},t.prototype.unload=function(){var t=this.getRootObject();t&&t.unload(!0),e.prototype.unload.call(this)},t.prototype.createInstance=function(e){var t=this,r=this.getRootObject();if(!r)throw new Error("No object hierarchy inside of this prefab so can't create an instance");var i=e||a.v4(),n={id:i,sid:r.get("sid"),prefabObjectId:r.id,prefabAssetId:this.id,prefabInstanceId:i,type:r.type,components:r.getComponentDescriptors()},s=this.engine.createEntity(n),u={};u[r.id]=s;var p=r.getDescendants();p.forEach(function(e){var r={sid:e.get("sid"),prefabObjectId:e.id,prefabAssetId:t.id,prefabInstanceId:i,type:e.type,properties:{},components:e.getComponentDescriptors()},n=t.engine.createEntity(r);u[e.id]=n}),p.forEach(function(e){var r=[],i=e.getChildIds(),n=u[e.id];o.forEach(i,function(e){u[e]&&(r.push(u[e].id),u[e].set("parentId",n.id))}),n.setChildIds(r),t.relinkComponentRefs(n,u)}),this.relinkComponentRefs(s,u);var c=[],l=r.getChildIds();return o.forEach(l,function(e){u[e]&&(c.push(u[e].id),u[e].set("parentId",s.id))}),s.setChildIds(c),s},t.prototype.clone=function(t){var r=e.prototype.clone.call(this,t),i=this.getRootObject();return i&&r.setRootObject(i.clone()),r},t.prototype.applyPropertiesUnloaded=function(t){if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("rootObjectId")){var r=this.getPreviousProperty("rootObjectId");r&&this.unregisterDependencyById(r);var i=this.getProperty("rootObjectId");i&&this.registerDependencyById(i)}},t.prototype.relinkComponentRefs=function(e,t){var r=this;e.getComponents().forEach(function(e){var i=e.getScriptAsset().getAttributes();o.forEach(e.getAttributes(),function(n,a){e.setAttribute(a,r.relinkAttributeRefs(i[a],n,t))})})},t.prototype.relinkAttributeRefs=function(e,t,r){var i,n=this;if("a"===e.type)i=[],t.forEach(function(t){i.push(n.relinkAttributeRefs(e.subType,t,r))});else if("object"===e.type){var a=t;i=a&&r[a]?r[a].id:a}else"custom"===e.type?(i={},o.forEach(e.attributes,function(e,a){i[a]=n.relinkAttributeRefs(e,t[a],r)})):i=t;return i},t.prototype.onPrefabDeleted=function(e){if(this.runtimeData){var t=this.getRootObject();t&&t.traverse(function(t){t.get("prefabObjectId")===e&&t.breakPrefabLink()})}},t.prototype.onPrefabLoaded=function(){this.engine.needsRender=!0},t}(n.default);s.addSchemas("PrefabAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(24),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDataSizeInMemorySelf=function(){return 0},t.prototype.createRuntimeData=function(e){this.createPrimitiveGeometry(),this.trigger("geometryChanged",this),e()},t.prototype.applyPropertiesUnloaded=function(t){e.prototype.applyPropertiesUnloaded.call(this,t),this.updatePrimitiveBounds()},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),"init"!==r)return void this.reloadBase()},t.prototype.createPrimitiveGeometry=function(){var e,t=this.getProperty("type");switch(t){case"box":e=new a.BoxGeometry(this.getProperty("sizeX"),this.getProperty("sizeY"),this.getProperty("sizeZ"),this.getProperty("segmentsX"),this.getProperty("segmentsY"),this.getProperty("segmentsZ"));break;case"cylinder":e=new a.CylinderGeometry(this.getProperty("radiusTop"),this.getProperty("radiusBottom"),this.getProperty("height"),this.getProperty("segmentsV"),this.getProperty("segmentsU"),this.getProperty("open"),this.getProperty("thetaStart"),this.getProperty("thetaLength"));break;case"plane":e=new a.PlaneGeometry(this.getProperty("sizeX"),this.getProperty("sizeY"),this.getProperty("segmentsX"),this.getProperty("segmentsY")),e.applyMatrix((new a.Matrix4).makeRotationX(-Math.PI/2));break;case"sphere":e=new a.SphereGeometry(this.getProperty("radius"),this.getProperty("segmentsU"),this.getProperty("segmentsV"),this.getProperty("phiStart"),this.getProperty("phiLength"),this.getProperty("thetaStart"),this.getProperty("thetaLength"));break;case"torus":e=new a.TorusGeometry(this.getProperty("radius"),2*this.getProperty("tubeRadius"),this.getProperty("segmentsV"),this.getProperty("segmentsU"),this.getProperty("arcAngle"));break;default:n.default.error(this.engine.getName()+' - PrimitiveGeometryAsset: Unrecognized geometry type, "'+t+'"')}e&&(e.groupsNeedUpdate=!0,e.computeBoundingBox(),e.computeBoundingSphere(),this.setGeometry(o.default.primitiveType.TRIANGLES,e))},t.prototype.updatePrimitiveBounds=function(){var e,t,r,n=this.getProperty("type"),o=new a.Box3;switch(n){case"box":e=this.getProperty("sizeX")/2,t=this.getProperty("sizeY")/2,r=this.getProperty("sizeZ")/2;break;case"cylinder":e=Math.max(this.getProperty("radiusTop"),this.getProperty("radiusBottom")),t=this.getProperty("height")/2,r=e;break;case"plane":e=this.getProperty("sizeX")/2,t=this.getProperty("sizeY")/2,r=0;break;case"sphere":e=this.getProperty("radius"),t=e,r=e;break;case"torus":e=this.getProperty("radius")+this.getProperty("tubeRadius"),t=e,r=this.getProperty("tubeRadius")}o.min.set(-e,-t,-r),o.max.set(e,t,r),this.setProperty("bounds",{min:i.__assign({},o.min),max:i.__assign({},o.max)},!0)},t}(o.default);s.addSchemas("PrimitiveGeometryAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(12),o=r(54),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRTImageData=function(){var e=this.getWidth(),t=this.getHeight();this.runtimeData=new n.WebGLRenderTarget(e,t,{wrapS:this.getThreeAddressMode(this.getProperty("wrapModeU")),wrapT:this.getThreeAddressMode(this.getProperty("wrapModeV")),minFilter:n.LinearFilter,magFilter:n.LinearFilter,format:a.default.getThreeImageFormat(this.getProperty("format")),type:a.default.getThreeDataType(this.getDataType()),stencilBuffer:this.getProperty("stencilBuffer")})},t}(o.default);s.addSchemas("RenderTexture2DAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(12),o=r(54),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRTImageData=function(){var e=this.getWidth(),t=this.getHeight();this.runtimeData=new n.WebGLRenderTargetCube(e,t,{wrapS:this.getThreeAddressMode(this.getProperty("wrapModeU")),wrapT:this.getThreeAddressMode(this.getProperty("wrapModeV")),minFilter:this.getThreeFilter(this.getMinFilter()),magFilter:this.getThreeFilter(this.getMagFilter()),format:a.default.getThreeImageFormat(this.getProperty("format")),type:a.default.getThreeDataType(this.getDataType()),stencilBuffer:this.getProperty("stencilBuffer")})},t.prototype.isCubeMap=function(){return!0},t.prototype.getDataSizeInMemorySelf=function(){return 6*e.prototype.getDataSizeInMemorySelf.call(this)},t}(o.default);s.addSchemas("RenderTextureCubeAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(9),a=r(6),o=r(5),s=r(4),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.getProperty("category")||this.setProperty("category","User Defined"),this.setState(n.StateType.Dependencies,n.State.Succeeded)},t.prototype.getAttributes=function(){return this.getProperty("attributes")},t.prototype.getAttributeDefaults=function(){var e=this,t=this.getProperty("attributes");return o.map(t,function(t,r){return e.getAttributeDefault(r)})},t.prototype.getAttributeDefault=function(e){var t=this.getProperty("attributes");if(t[e]){var r=t[e];return r.hasOwnProperty("default")?o.deepClone(r.default):"custom"===r.type?o.map(r.attributes,function(e){return e.default}):"a"===r.type?void 0!==r.subType.default?[r.subType.default]:[]:void 0}},t}(a.default);s.addSchemas("ScriptAsset",u),t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(6),o=r(4),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.bindShapeMatrix=new n.Matrix4,t.inverseBindMatrices=[],t}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){t.getDependencies().some(function(e){return e.isLoadFailed()})||t.createMatrices(),e()}},this)},t.prototype.getBindShapeMatrix=function(){return this.bindShapeMatrix},t.prototype.getInverseBindMatrices=function(){return this.inverseBindMatrices},t.prototype.getInverseBindMatrix=function(e){return this.inverseBindMatrices[e]},t.prototype.getJointCount=function(){return this.getJointNames().length},t.prototype.getJointName=function(e){return this.getJointNames()[e]},t.prototype.getJointNames=function(){return this.getProperty("jointNames")},t.prototype.applyPropertiesUnloaded=function(t){if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.inverseBindMatrices){var r=this.getPreviousProperty("inverseBindMatrices"),i=this.getProperty("inverseBindMatrices");if(r&&r!==i){var n=i.split("#");2===n.length&&this.unregisterDependencyById(n[0])}var a=i.split("#");if(2!==a.length)throw new Error(this.engine.getName()+" - SkinAsset: Invalid accessorId, "+i);this.registerDependencyById(a[0])}},t.prototype.createMatrices=function(){this.bindShapeMatrix.fromArray(this.getProperty("bindShapeMatrix"));var e=this.getProperty("inverseBindMatrices"),t=e.split("#");if(2!==t.length)throw new Error(this.engine.getName()+" - SkinAsset: Invalid accessorId, "+e);var r=t[0],i=this.engine.getAssetById(r);if(!i)throw new Error(this.engine.getName()+" - SkinAsset: Invalid accessorId, "+e);var a=t[1],o=i.getAccessor(a),s=i.getArray(a);if(!o||!s)throw new Error(this.engine.getName()+" - SkinAsset: Invalid accessorId, "+e);var u=this.getJointCount();this.inverseBindMatrices=[];for(var p=0;p<u;++p){var c=s.subarray(16*p,16*(p+1)),l=(new n.Matrix4).fromArray(c);this.inverseBindMatrices.push(l)}},t}(a.default);o.addSchemas("SkinAsset",s),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(239),s=r(238),u=r(20),p=r(12),c=r(25),l=r(4),d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.unpackHdrTextureData=function(e){this.hdrSource&&this.hdrSource.dispose(),this.hdrSource=this.runtimeData,this.runtimeData=new a.WebGLRenderTarget(e.width,e.height,{minFilter:this.getThreeFilter(this.getMinFilter()),magFilter:this.getThreeFilter(this.getMagFilter()),format:a.RGBAFormat,type:p.default.getThreeDataType(this.getDataType()),depthBuffer:!1,stencilBuffer:!1});var t={};switch(this.getHdrPackingType(e.channels)){case"rgbe":default:t.HDR_RGBE=0}var r=this.engine.getThreeRenderer();if(!this.hdrSource)return void n.default.warn("Unable to unpack HDR texture because the source data is missing.");this.hdrSource.minFilter=a.NearestFilter,this.hdrSource.magFilter=a.NearestFilter,this.hdrSource.generateMipmaps=!1;var i=this.getThreeTexture();this.isLinearFilterAvailableForType(this.getDataType())||(i.minFilter=a.NearestFilter,i.magFilter=a.NearestFilter,i.generateMipmaps=!1),this.unpackHdrPass||(this.unpackHdrPass=new s.default(o.default)),this.unpackHdrPass.material.defines=t,this.unpackHdrPass.render(r,this.runtimeData,this.hdrSource)},t.prototype.unload=function(){this.hdrSource&&(this.hdrSource.dispose(),this.hdrSource=void 0),e.prototype.unload.call(this)},t.prototype.createTextureData=function(e){this.runtimeData&&this.runtimeData.dispose();var t=this.getImage();if(t instanceof c.default)this.runtimeData=new a.VideoTexture(e.imageData);else{switch(e.contentType){case"image/vnd-ms.dds":var r=t.getMaxTextureSize();this.runtimeData=this.createDdsTexture(e.imageData,r);break;default:this.runtimeData=new a.Texture(e.imageData)}this.runtimeData.needsUpdate=!0,this.getHdrPackingType(e.channels)&&this.unpackHdrTextureData(e)}this.runtimeData.encoding=p.default.getThreeImageEncoding(this.getEncoding()),this.runtimeData.name=this.getName()},t}(u.default);l.addSchemas("Texture2DAsset",d),t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(20),o=r(4),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createTextureData=function(e){this.runtimeData&&this.runtimeData.dispose();var t=this.getImage();switch(e.contentType){case"image/vnd-ms.dds":var r=t.getMaxTextureSize();this.runtimeData=this.createDdsTexture(e.imageData,r);break;default:this.runtimeData=new n.CubeTexture(e.imageData,n.CubeReflectionMapping)}this.getHdrPackingType(e.channels)&&this.createHdrTextureData(e),this.runtimeData.name=this.getName()},t.prototype.createHdrTextureData=function(e){throw new Error("createHdrTextureData isn't implemented yet.")},t.prototype.isCubeMap=function(){return!0},t.prototype.getDataSizeInMemorySelf=function(){return 6*e.prototype.getDataSizeInMemorySelf.call(this)},t}(a.default);o.addSchemas("TextureCubeAsset",s),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,n=r(0),a=r(1),o=r(36);(function(e){e[e.LeftOrRight=0]="LeftOrRight",e[e.Left=1]="Left",e[e.Right=2]="Right",e[e.Any=3]="Any",e[e.None=4]="None"})(i=t.Handedness||(t.Handedness={}));var s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handPreference=i.LeftOrRight,t.standingMatrix=new a.Matrix4,t.scale=1,t}return n.__extends(t,e),t.prototype.updateState=function(t){if(this.isEnabled()){e.prototype.updateState.call(this,t);var r=this.getEngine(),i=r.getVrDisplay();if(i&&t&&t.pose){var n=t.pose,a=this.getRuntimeData(),o=this.getEntity();n.position&&o.setPosition(n.position[0],n.position[1],n.position[2]),n.orientation&&o.setQuaternion(n.orientation[0],n.orientation[1],n.orientation[2],n.orientation[3]),a.updateMatrix(),i.stageParameters&&(this.standingMatrix.fromArray(i.stageParameters.sittingToStandingTransform),a.applyMatrix(this.standingMatrix)),o.setQuaternion(a.quaternion.x,a.quaternion.y,a.quaternion.z,a.quaternion.w),a.position.multiplyScalar(this.scale),o.setPosition(a.position.x,a.position.y,a.position.z),r.needsRender=!0}}},t.prototype.findGamepad=function(){var t=this;return e.prototype.findGamepad.call(this,function(e){var r=e;switch(t.handPreference){case i.Left:if("left"===r.hand)return e;break;case i.Right:if("right"===r.hand)return e;break;case i.LeftOrRight:if("left"===r.hand||"right"===r.hand)return e;break;case i.None:if(""===r.hand)return e;break;default:return e}})},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,n=r(0),a=r(1),o=r(2),s=r(5),u=r(50),p=r(3),c=r(22),l=r(42);(function(e){e[e.Lit=0]="Lit",e[e.Unlit=1]="Unlit",e[e.Shape=2]="Shape",e[e.Normals=3]="Normals",e[e.Untextured=4]="Untextured",e[e.UVOverlay=5]="UVOverlay",e[e.SkinWeights=6]="SkinWeights"})(i=t.RenderMode||(t.RenderMode={}));var d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.prevMaterials={},t.materialOverrides={},t.wireframeMaterial=null,t.skeletonHelpers={},t.renderModes={},t}return n.__extends(t,e),t.calculateUVGridCellColor=function(e,t,r){var i=[{r:200,g:200,b:0},{r:0,g:200,b:200},{r:0,g:200,b:0},{r:200,g:0,b:200}],n=Math.floor(r.divisions/2),a=Math.floor(e/Math.floor(r.divisions/2))%2+Math.floor(t/Math.floor(r.divisions/2))%2*2,o=1-Math.sqrt(Math.pow(e-n,2)+Math.pow(t-n,2))/Math.sqrt(Math.pow(n+n,2)),s={r:Math.floor(i[a].r*o),g:Math.floor(i[a].g*o),b:Math.floor(i[a].b*o)};return"rgb("+s.r+","+s.g+","+s.b+")"},t.cloneMaterial=function(e){var t=e.clone();if(e instanceof a.ShaderMaterial){var r=e,i=t;s.forEach(i.uniforms,function(e,t){(e.value instanceof a.Texture||e.value instanceof a.WebGLRenderTarget)&&(e.value=r.uniforms[t].value)})}return t.needsUpdate=!0,t},t.createUVGrid=function(e){var r=document.createElement("canvas");r.width=e.size,r.height=e.size;var i=r.getContext("2d");i.fillStyle="rgb(255,255,255)",i.fillRect(0,0,r.width,r.height);for(var n=0;n<e.divisions;n++)for(var a=0;a<e.divisions;a++)t.renderUVGridCell(i,a,n,e);return r},t.renderUVGridCell=function(e,r,i,n){var a=n.size/n.divisions*r,o=n.size/n.divisions*i,s=n.size/n.divisions,u=n.size/n.divisions;if(e.fillStyle=t.calculateUVGridCellColor(r,i,n),e.fillRect(a+n.padding,o+n.padding,s-2*n.padding,u-2*n.padding),e.strokeStyle="rgba(0,0,0,0.2)",e.beginPath(),e.moveTo(a+n.padding,o+u/2),e.lineTo(a+s-n.padding,o+u/2),e.moveTo(a+s/2,o+n.padding),e.lineTo(a+s/2,o+u-n.padding),e.stroke(),(r+i)%2==0){var p="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("");e.fillStyle="white",e.strokeStyle="white",e.font=Math.floor(n.size/(5*n.divisions))+"px sans-serif",e.fillText(p[i]+r,a+u/10,o+u-u/10)}},t.prototype.resetSkeletons=function(){var e=this;if(this.skeletonHelpers={},this.skeletonsVisible){this.getEngine().getObjectsByClass(l.default).forEach(function(t){var r=t.getRuntimeData();e.skeletonHelpers[r.uuid]=r?new a.SkeletonHelper(r):void 0})}this.getEngine().needsRender=!0},t.prototype.setRenderMode=function(e){this.setAttribute("renderMode",e)},t.prototype.setSkeletonsVisible=function(e){this.setAttribute("skeletonsVisible",e)},t.prototype.setWireframesVisible=function(e){this.setAttribute("wireframesVisible",e)},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("shapeTexture")&&this.onShapeTextureChanged(),-1!==e.indexOf("renderMode")&&this.onRenderModeChanged(),-1!==e.indexOf("skeletonsVisible")&&this.resetSkeletons(),-1!==e.indexOf("wireframesVisible")&&(this.getEngine().needsRender=!0)},t.prototype.onPostRender=function(){this.unapplyRenderMode()},t.prototype.onPostRenderView=function(e,t){this.wireframesVisible&&this.renderWireframes(e,t),this.skeletonsVisible&&this.renderSkeletons(e,t)},t.prototype.onPreRender=function(e){this.applyRenderMode()},t.prototype.onShutdown=function(){u.default.off("resetSkeletons",this.resetSkeletons,this),u.default.off("setRenderMode",this.setRenderMode,this),u.default.off("setSkeletonsVisible",this.setSkeletonsVisible,this),u.default.off("setWireframesVisible",this.setWireframesVisible,this),this.clearMaterialCache(),s.forEach(this.renderModes,function(e){e.materialOverrides&&s.forEach(e.materialOverrides,function(e){e.dispose()})}),this.wireframeMaterial.dispose()},t.prototype.onStartup=function(){this.renderModes[i.Lit]={materialOverrides:null},this.renderModes[i.Unlit]={materialOverrides:{static:new a.MeshBasicMaterial},copyParams:["color","opacity","map","alphaMap","emissive","emissiveMap"]},this.renderModes[i.Shape]={materialOverrides:{static:new a.ShaderMaterial(t.shapeMaterial)},copyParams:["bumpMap","normalMap"]},this.renderModes[i.Normals]={materialOverrides:{static:new a.ShaderMaterial(t.normalsMaterial)},copyParams:["bumpMap","normalMap"]},this.renderModes[i.Untextured]={materialOverrides:{static:new a.MeshLambertMaterial({emissive:"#777777",side:a.DoubleSide})}};var e=new a.Texture(t.createUVGrid({size:1024,divisions:10,padding:2}));e.anisotropy=8,e.needsUpdate=!0,this.renderModes[i.UVOverlay]={materialOverrides:{static:new a.MeshBasicMaterial({map:e,side:a.DoubleSide})}},this.renderModes[i.SkinWeights]={materialOverrides:{static:new a.ShaderMaterial(t.skinWeightsMaterial)}},s.forEach(this.renderModes,function(e){if(e.materialOverrides){var t=e.materialOverrides.static;e.materialOverrides.skinned=t.clone(),e.materialOverrides.skinned.skinning=!0}}),this.wireframeMaterial=new a.MeshBasicMaterial({color:"#050505",wireframe:!0}),this.getGlobalEvents().on("resetSkeletons",this.resetSkeletons,this),this.getGlobalEvents().on("setRenderMode",this.setRenderMode,this),this.getGlobalEvents().on("setSkeletonsVisible",this.setSkeletonsVisible,this),this.getGlobalEvents().on("setWireframesVisible",this.setWireframesVisible,this)},t.prototype.applyRenderMode=function(){var e=this,t=this.renderModes[this.renderMode];if(t.materialOverrides){this.getEngine().getObjectsByClass(c.default).forEach(function(r){e.applyRenderModeToMesh(r,t)})}},t.prototype.applyRenderModeToMesh=function(e,t){var r=this;if(e.isBaseLoaded()&&t.materialOverrides){var i=e.isSkinned()?"skinned":"static",n=e.runtimeData.material,a=n.map(function(){return t.materialOverrides[i]});if(t.copyParams){e.getMaterials().forEach(function(e,n){e.isLoaded()&&(a[n]=r.getMaterialOverride(e,t,i))})}this.prevMaterials[e.id]=n,e.runtimeData.material=a}},t.prototype.clearMaterialCache=function(){s.forEach(this.materialOverrides,function(e){s.forEach(e,function(e){e.dispose()})}),this.materialOverrides={}},t.prototype.getMaterialOverride=function(e,r,i){var n=this;if(this.materialOverrides.hasOwnProperty(e.id)||(this.materialOverrides[e.id]={}),!this.materialOverrides[e.id].hasOwnProperty(i)){var o=r.materialOverrides[i],s=t.cloneMaterial(o);if(r.copyParams){var u=e.runtimeData[i];r.copyParams.forEach(function(e){s instanceof a.ShaderMaterial&&s.uniforms[e]?u instanceof a.ShaderMaterial?(s.uniforms[e].value=u.uniforms[e].value,s[e]=u.uniforms[e].value):(s.uniforms[e].value=u[e],s[e]=u[e]):s.hasOwnProperty(e)&&u.hasOwnProperty(e)&&(s[e]=u[e])})}this.materialOverrides[e.id][i]=s,e.once("change:properties",function(){n.invalidateMaterialOverride(e.id)})}return this.materialOverrides[e.id][i]},t.prototype.invalidateMaterialOverride=function(e){this.materialOverrides.hasOwnProperty(e)&&(s.forEach(this.materialOverrides[e],function(e){e.dispose()}),delete this.materialOverrides[e])},t.prototype.onRenderModeChanged=function(){this.renderModes[this.renderMode]||(this.renderMode=i.Lit),this.clearMaterialCache(),this.getEngine().needsRender=!0},t.prototype.onShapeTextureChanged=function(){var e=this;this.shapeTexture&&(this.shapeTexture.when("load",function(t){s.forEach(e.renderModes[i.Shape].materialOverrides,function(e){e instanceof a.ShaderMaterial&&(e.uniforms.matCapTexture.value=t.runtimeData)})}),this.shapeTexture.isBaseUnloaded()&&this.shapeTexture.load())},t.prototype.renderSkeletons=function(e,t){if(!this.skeletonHelpers.hasOwnProperty(e.uuid))return void p.default.warn("Skeleton cache out of date");var r=new a.Scene;r.add(this.skeletonHelpers[e.uuid]),this.getThreeRenderer().render(r,t)},t.prototype.renderWireframes=function(e,t){var r={};e.traverse(function(e){r[e.id]=e.visible,(e instanceof a.SkinnedMesh||e instanceof a.Line||e instanceof a.Points)&&(e.visible=!1)});var i=e.overrideMaterial;e.overrideMaterial=this.wireframeMaterial,this.wireframeMaterial.skinning=!1,this.getThreeRenderer().render(e,t),e.traverse(function(e){e instanceof a.SkinnedMesh?e.visible=r[e.id]:e instanceof a.Mesh&&(e.visible=!1)}),this.wireframeMaterial.skinning=!0,this.getThreeRenderer().render(e,t),e.traverse(function(e){e.visible=r[e.id]}),e.overrideMaterial=i},t.prototype.unapplyMaterialOverride=function(e){this.prevMaterials.hasOwnProperty(e.id)&&(e.runtimeData.material=this.prevMaterials[e.id],delete this.prevMaterials[e.id])},t.prototype.unapplyRenderMode=function(){var e=this;this.getEngine().getObjectsByClass(c.default).forEach(function(t){e.unapplyMaterialOverride(t)})},t.normalsMaterial={side:a.DoubleSide,uniforms:a.UniformsUtils.merge([a.UniformsLib.common,a.UniformsLib.bumpmap,a.UniformsLib.normalmap]),vertexShader:[a.ShaderChunk.common,a.ShaderChunk.uv_pars_vertex,a.ShaderChunk.bsdfs,a.ShaderChunk.skinning_pars_vertex,"#ifndef FLAT_SHADED","varying vec3 vNormal;","#endif","varying vec3 vViewPosition;","void main() {",a.ShaderChunk.uv_vertex,a.ShaderChunk.beginnormal_vertex,a.ShaderChunk.morphnormal_vertex,a.ShaderChunk.skinbase_vertex,a.ShaderChunk.skinnormal_vertex,a.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","vNormal = normalize( transformedNormal );","#endif",a.ShaderChunk.begin_vertex,a.ShaderChunk.displacementmap_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,a.ShaderChunk.clipping_planes_vertex,"vViewPosition = - mvPosition.xyz;",a.ShaderChunk.worldpos_vertex,"}"].join("\n"),fragmentShader:[a.ShaderChunk.common,a.ShaderChunk.uv_pars_fragment,a.ShaderChunk.bsdfs,a.ShaderChunk.lights_phong_pars_fragment,a.ShaderChunk.normalmap_pars_fragment,a.ShaderChunk.bumpmap_pars_fragment,"void main() {",a.ShaderChunk.normal_flip,a.ShaderChunk.normal_fragment,"normal = 0.5 * normal + 0.5;","gl_FragColor = vec4(normal, 1.0);","}"].join("\n")},t.shapeMaterial={side:a.DoubleSide,uniforms:a.UniformsUtils.merge([a.UniformsLib.common,a.UniformsLib.bumpmap,a.UniformsLib.normalmap,{matCapTexture:{value:null}}]),vertexShader:[a.ShaderChunk.common,a.ShaderChunk.uv_pars_vertex,a.ShaderChunk.bsdfs,a.ShaderChunk.skinning_pars_vertex,"#ifndef FLAT_SHADED","varying vec3 vNormal;","#endif","varying vec3 vViewPosition;","void main() {",a.ShaderChunk.uv_vertex,a.ShaderChunk.beginnormal_vertex,a.ShaderChunk.morphnormal_vertex,a.ShaderChunk.skinbase_vertex,a.ShaderChunk.skinnormal_vertex,a.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED","vNormal = normalize(transformedNormal);","#endif",a.ShaderChunk.begin_vertex,a.ShaderChunk.displacementmap_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,a.ShaderChunk.clipping_planes_vertex,"vViewPosition = - mvPosition.xyz;",a.ShaderChunk.worldpos_vertex,"}"].join("\n"),fragmentShader:[a.ShaderChunk.common,a.ShaderChunk.uv_pars_fragment,a.ShaderChunk.bsdfs,a.ShaderChunk.lights_phong_pars_fragment,a.ShaderChunk.normalmap_pars_fragment,a.ShaderChunk.bumpmap_pars_fragment,"uniform sampler2D matCapTexture;","void main() {","vec3 eyeVector_VS = normalize(vViewPosition);",a.ShaderChunk.normal_flip,a.ShaderChunk.normal_fragment,"vec3 reflect_SS = reflect(-eyeVector_VS, normal);","reflect_SS.z += 1.0;","float temp = 2.0 * sqrt(dot(reflect_SS, reflect_SS));","reflect_SS.xy = reflect_SS.xy / vec2(temp) + vec2(0.5);","vec3 colour = texture2D(matCapTexture, reflect_SS.xy).rgb;","gl_FragColor = vec4(colour, 1.0);","}"].join("\n")},t.skinWeightsMaterial={side:a.DoubleSide,vertexShader:[a.ShaderChunk.common,a.ShaderChunk.skinning_pars_vertex,"varying vec3 vColor;","void main() {",a.ShaderChunk.beginnormal_vertex,a.ShaderChunk.morphnormal_vertex,a.ShaderChunk.skinbase_vertex,a.ShaderChunk.skinnormal_vertex,a.ShaderChunk.defaultnormal_vertex,a.ShaderChunk.begin_vertex,a.ShaderChunk.displacementmap_vertex,a.ShaderChunk.morphtarget_vertex,a.ShaderChunk.skinning_vertex,a.ShaderChunk.project_vertex,a.ShaderChunk.logdepthbuf_vertex,a.ShaderChunk.clipping_planes_vertex,a.ShaderChunk.worldpos_vertex,"#ifdef USE_SKINNING","vColor = vec3(skinWeight.x, skinWeight.y, skinWeight.z);","#else","vColor = vec3(0.0, 0.0, 0);","#endif","}"].join("\n"),fragmentShader:["varying vec3 vColor;","void main() {","gl_FragColor = vec4(vColor, 1.0);","}"].join("\n")},t}(o.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={reflectionTexture:{displayName:"Reflection Texture",description:"A texture that represents the environment around the surface.",type:"t",default:null,isRenderParam:!0,uniformName:"envMap",enabledWhen:{reflectionTexture:{notEqualsDefault:!0}}},reflectionFactor:{displayName:"Reflection Intensity",description:"Multiplier for the environment map.",type:"f",min:0,max:100,default:1,isRenderParam:!0,uniformName:"envMapIntensity"},reflectivity:{displayName:"Reflectivity",description:"Reflectivity at normal incidence. i.e. when viewing the surface directly.",type:"f",min:0,max:1,default:.5,isRenderParam:!0}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(10),o=r(4),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.runtimeData=new n.Bone(null),this.runtimeData.name=this.getRuntimeName(),e(this)},t}(a.default);o.addSchemas("BoneObject",s),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(10),o=r(4),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getAspectRatio=function(){return"perspective"===this.getProperty("cameraType")?this.getProperty("aspect"):(this.getProperty("right")-this.getProperty("left"))/(this.getProperty("top")-this.getProperty("bottom"))},t.prototype.createRuntimeData=function(e){var t=this.getProperty("cameraType");this.runtimeData="orthographic"===t?new n.OrthographicCamera(this.getProperty("left")||0,this.getProperty("right")||0,this.getProperty("top")||0,this.getProperty("bottom")||0):new n.PerspectiveCamera,this.runtimeData.name=this.getRuntimeName(),e(this)},t.prototype.reset=function(){if(e.prototype.reset.call(this),this.runtimeData){"orthographic"===this.getProperty("cameraType")?this.resetOrthographicRTData():this.resetPerspectiveRTData()}},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("cameraType")&&this.getProperty("cameraType")!==this.getPreviousProperty("cameraType")&&"init"!==r)return void this.reloadBase();var i=this.getProperty("cameraType");"perspective"===i?(t.hasOwnProperty("fov")||t.hasOwnProperty("aspect")||t.hasOwnProperty("near")||t.hasOwnProperty("far"))&&this.resetPerspectiveRTData():"orthographic"===i&&(t.hasOwnProperty("left")||t.hasOwnProperty("right")||t.hasOwnProperty("top")||t.hasOwnProperty("bottom")||t.hasOwnProperty("near")||t.hasOwnProperty("far"))&&this.resetOrthographicRTData()},t.prototype.resetOrthographicRTData=function(){this.runtimeData.left=this.getProperty("left"),this.runtimeData.right=this.getProperty("right"),this.runtimeData.top=this.getProperty("top"),this.runtimeData.bottom=this.getProperty("bottom"),this.runtimeData.near=this.getProperty("near"),this.runtimeData.far=this.getProperty("far"),this.runtimeData.updateProjectionMatrix()},t.prototype.resetPerspectiveRTData=function(){this.runtimeData.fov=this.getProperty("fov"),this.runtimeData.aspect=this.getProperty("aspect"),this.runtimeData.near=this.getProperty("near"),this.runtimeData.far=this.getProperty("far"),this.runtimeData.updateProjectionMatrix()},t}(a.default);o.addSchemas("CameraObject",s),t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(10),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t}(n.default);a.addSchemas("NodeObject",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i;(function(e){e[e.STARTING=0]="STARTING",e[e.LOADING=1]="LOADING",e[e.PROCESSING=2]="PROCESSING",e[e.COMPLETE=3]="COMPLETE",e[e.CANCELLED=4]="CANCELLED",e[e.ERROR=5]="ERROR"})(i||(i={})),t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"baseImageAsset",title:"BaseImageAssetDef",properties:i.__assign({},n.default.properties,{properties:{$ref:"baseImageAssetProperties.json"}})});t.default=a},function(e,t,r){e.exports=!r(199)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,r){var i=r(33),n=r(32),a=r(76),o=r(272),s=r(198),u=function(e,t,r){var p,c,l,d,h=e&u.F,f=e&u.G,m=e&u.S,y=e&u.P,g=e&u.B,v=f?i:m?i[t]||(i[t]={}):(i[t]||{}).prototype,b=f?n:n[t]||(n[t]={}),x=b.prototype||(b.prototype={});f&&(r=t);for(p in r)c=!h&&v&&void 0!==v[p],l=(c?v:r)[p],d=g&&c?s(l,i):y&&"function"==typeof l?s(Function.call,l):l,v&&o(v,p,l,e&u.U),b[p]!=l&&a(b,p,d),y&&x[p]!=l&&(x[p]=l)};i.core=n,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,r){var i=r(270),n=r(271);e.exports=r(74)?function(e,t,r){return i.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){return e()},t.prototype.getEntityId=function(e){return this.runtimeData?this.runtimeData.entityIds[e]:void 0},t}(n.default);a.addSchemas("DocumentAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(244),a=!1,o={},s=function(){function e(t){this.engine=t,a||(a=!0,e.registerScripts(n.default)),this.initBuiltInScripts()}return e.registerScript=function(e,t){if(!e.id)throw new Error("Component definition is lacking an id attribute!");if(!t)throw new Error("A constructor must be provided!");o[e.id]={def:e,constructor:t}},e.registerScripts=function(t){t.forEach(function(t){var r=t[0],i=t[1];return e.registerScript(r,i)})},e.prototype.initBuiltInScripts=function(){var e=this;Object.keys(o).forEach(function(t){var r=o[t],n=e.engine.createEntity(i.__assign({},r.def,{type:"script"})),a=r.constructor;n.sharedData.classConstructor=a})},e}();t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties.bounds",this.onPropertiesChanged),this.listenTo(this.getEntity(),"change:properties.quaternion",this.onPropertiesChanged),this.listenTo(this.getEntity(),"change:properties.scale",this.onPropertiesChanged),this.isEnabled()&&this.getEntity().alignToPosition(this.referencePosition,this.alignment)},t.prototype.onAttributesChanged=function(e){!this.isEnabled()||-1===e.indexOf("referencePosition")&&-1===e.indexOf("alignment")||this.getEntity().alignToPosition(this.referencePosition,this.alignment)},t.prototype.onDisable=function(){this.getEntity().setPosition(0,0,0)},t.prototype.onEnable=function(){this.getEntity().alignToPosition(this.referencePosition,this.alignment)},t.prototype.onPropertiesChanged=function(e){this.isEnabled()&&this.getEntity().alignToPosition(this.referencePosition,this.alignment)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=r(5),u=r(241),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.dirty=!0,t.paused=!1,t.needsReset=!1,t.ended=!1,t}return i.__extends(t,e),t.prototype.onEntityLoaded=function(){var e=this;this.mixer&&this.mixer._root===this.getRuntimeData()||(this.mixer=new a.AnimationMixer(this.getRuntimeData()),this.mixer.addEventListener("finished",function(t){return e.onMixerEvent(t)}))},t.prototype.getTime=function(){return this.action?this.action.time:0},t.prototype.onStartup=function(){this.asset&&this.listenTo(this.asset,"change:properties",this.onAssetChanged),this.getEntity().on("playAnimation",this.playAnimation,this),this.getEntity().on("pauseAnimation",this.pause,this),this.getEntity().on("stopAnimation",this.stop,this),this.getEntity().on("toggleAnimation",this.toggle,this)},t.prototype.isPlaying=function(){return this.action&&this.action.isScheduled()&&!this.paused},t.prototype.load=function(e){var t=this;return this.mixer?(this.release(),this.asset?(this.asset.when("load",function(){var r=null;if(t.prefab){var i=t.prefab.getRootObject(),n=t.getEntity(),o=u.default(i,n);if(o.length>0){var p=t.getEngine();r={},s.forEach(o[0],function(e,t){var i=p.getObjectById(t),n=p.getObjectById(e);r[i.getSid()]=n.getSid()})}}if(!t.asset.getClip(t.clipId))return void(e&&e(new Error('Invalid clip ID "'+t.clipId+'"')));var c=t.asset.createClip(t.clipId,r);return c?(t.action=t.mixer.clipAction(c),t.action?(t.action.setLoop(t.loop?a.LoopRepeat:a.LoopOnce,1/0),t.action.timeScale=t.speed,t.action.time=t.startTime,t.action.weight=t.weight,t.action.clampWhenFinished=!0,t.action.paused=t.paused,t.dirty=!1,t.getEntity().trigger("animationLoaded"),void(e&&e(null,t))):void(e&&e(new Error("Failed to create THREE.AnimationAction")))):void(e&&e(new Error('Failed to create animation clip "'+t.clipId+'"')))}),void(this.asset.isUnloaded()&&this.asset.load())):void(e&&e(new Error("No asset assigned")))):void(e&&e(new Error("Mixer is not initialized")))},t.prototype.pause=function(){this.paused=!0,this.action&&(this.action.paused=this.paused)},t.prototype.play=function(){var e=this;if(this.paused=!1,this.dirty)return void this.load(function(t){if(t)return void n.default.error("Error playing animation: ",t.toString());e.play()});this.action&&(this.needsReset&&(this.action.reset(),this.action.time=this.startTime,this.needsReset=!1),this.action.play(),this.action.paused=this.paused)},t.prototype.playAnimation=function(e,t,r,i,n){void 0!==e&&this.setAsset(this.getEngine().getEntityById(e)),void 0!==t&&this.setClipId(t),this.loop=void 0!==r?r:this.loop,this.speed=void 0!==i?i:this.speed,this.startTime=void 0!==n?n:this.startTime,this.play()},t.prototype.release=function(){this.stop(),this.action&&(this.action.stop(),this.action=void 0)},t.prototype.setAsset=function(e){this.asset!==e&&(this.asset&&(this.stopListening(this.asset,"change:properties",this.onAssetChanged),this.unregisterDependency(this.asset)),this.asset=e,this.dirty=!0,this.asset&&(this.listenTo(this.asset,"change:properties",this.onAssetChanged),this.registerDependency(this.asset)))},t.prototype.setClipId=function(e){this.clipId!==e&&(this.clipId=e,this.dirty=!0)},t.prototype.setLoop=function(e){this.loop=e,this.action&&this.action.setLoop.apply(this.action,[this.loop?a.LoopRepeat:a.LoopOnce,1/0])},t.prototype.setSpeed=function(e){this.speed=e,this.action&&(this.action.timeScale=e)},t.prototype.setTime=function(e){this.action&&(this.action.time=e)},t.prototype.setWeight=function(e){this.weight=e,this.action&&(this.action.weight=this.weight)},t.prototype.onShutdown=function(){this.asset&&this.stopListening(this.asset,"stopListening",this.onAssetChanged),this.release(),this.getEntity().off("playAnimation",this.playAnimation,this),this.getEntity().off("pauseAnimation",this.pause,this),this.getEntity().off("stopAnimation",this.stop,this),this.getEntity().off("toggleAnimation",this.toggle,this)},t.prototype.stop=function(){this.action&&this.action.stop()},t.prototype.toggle=function(){this.isPlaying()?this.pause():this.play()},t.prototype.onUpdate=function(e){this.mixer&&(this.mixer.update(e),this.getEngine().needsRender=!0,this.ended&&(this.getEntity().trigger("endAnimation"),this.ended=!1))},t.prototype.onAssetChanged=function(){this.dirty=!0},t.prototype.onMixerEvent=function(e){e.action===this.action&&"finished"===e.type&&(this.needsReset=!0,this.ended=!0)},t}(o.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=function(e){function t(){var t=e.call(this)||this;return t.context=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){if(this.context=this.getEntity().engine.getAudioContext(),!this.context)return void n.default.warn("Failed to create Web Audio context.")},t.prototype.onUpdate=function(){if(this.hasRuntimeData()&&this.context){var e=this.getRuntimeData().matrixWorld,t=new a.Vector3(0,0,0).applyMatrix4(e),r=new a.Vector3(0,0,-1).applyMatrix4(e).sub(t).normalize(),i=new a.Vector3(0,1,0).applyMatrix4(e).sub(t).normalize();this.context.listener.setPosition(t.x,t.y,t.z),this.context.listener.setOrientation(r.x,r.y,r.z,i.x,i.y,i.z)}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(25),s=r(2),u=r(15),p=r(11),c=function(e){function t(){var t=e.call(this)||this;return t.gainNode=null,t.sourceNode=null,t.pannerNode=null,t.context=null,t.buffer=null,t.startTime=0,t.playOffset=0,t.state="stopped",t.element=null,t.isVideo=!1,t}return i.__extends(t,e),t.prototype.getGain=function(){return this.gain},t.prototype.getState=function(){return this.state},t.prototype.isLoop=function(){return this.loop},t.prototype.isPaused=function(){return"paused"===this.state},t.prototype.isPlaying=function(){return"playing"===this.state},t.prototype.isStopped=function(){return"stopped"===this.state},t.prototype.pause=function(){"playing"===this.state&&(this.playOffset=this.getCurrentTime(),this.state="paused",this.freeAudioGraph())},t.prototype.play=function(e){var t=this;void 0===e&&(e=0),"paused"!==this.state&&"stopped"!==this.state||(this.playOffset+=e,this.initAudioGraph(function(e){if(e)return void n.default.warn("Error playing audio: "+e);t.setGain(t.gain),t.setLoop(t.loop),t.stream?(t.element.currentTime=t.playOffset,t.element.play()):t.context?(t.startTime=t.context.currentTime,t.sourceNode.start(0,t.playOffset)):n.default.warn("No Web Audio context."),t.state="playing"}))},t.prototype.setGain=function(e){this.gain=e,this.gainNode?this.gainNode.gain.value=this.gain:this.element&&(this.element.volume=this.gain)},t.prototype.setLoop=function(e){this.loop=e,this.element?this.element.loop=this.loop:this.sourceNode&&(this.sourceNode.loop=this.loop)},t.prototype.stop=function(){"playing"!==this.state&&"paused"!==this.state||(this.playOffset=0,this.state="stopped",this.freeAudioGraph())},t.prototype.toggle=function(){"playing"===this.state?this.pause():this.play()},t.prototype.onStartup=function(){this.context=this.getEntity().engine.getAudioContext(),this.context?(this.gainNode=this.context.createGain(),this.pannerNode=this.context.createPanner()):(n.default.warn("No audio context, using fallback."),this.stream=!0,this.positional=!1),this.isVideo=this.asset instanceof o.default,this.isVideo&&(this.stream=!0),this.autoPlay?this.play():this.preload&&this.load(function(e,t){e&&n.default.warn(e)}),this.listenTo(this.getEntity(),"playAudio",this.play),this.listenTo(this.getEntity(),"pauseAudio",this.pause),this.listenTo(this.getEntity(),"stopAudio",this.stop),this.listenTo(this.getEntity(),"toggleAudio",this.toggle)},t.prototype.onUpdate=function(){if(this.hasRuntimeData()&&this.positional){var e=this.getRuntimeData().matrixWorld,t=new a.Vector3(0,0,0).applyMatrix4(e),r=new a.Vector3(0,0,1).applyMatrix4(e).sub(t).normalize();this.pannerNode.setPosition(t.x,t.y,t.z),this.pannerNode.setOrientation(r.x,r.y,r.z)}},t.prototype.initAudioGraph=function(e){var t=this;this.load(function(r,i){if(r)return e(r);if(!t.context)return e(null,null);var n=[];t.stream?t.sourceNode=t.context.createMediaElementSource(i):(t.sourceNode=t.context.createBufferSource(),t.sourceNode.buffer=i),n.push(t.sourceNode),n.push(t.gainNode),t.positional&&n.push(t.pannerNode),n.push(t.context.destination);for(var a=1;a<n.length;++a)n[a-1].connect(n[a]);e(null,t.sourceNode)})},t.prototype.load=function(e){var t=this;if(this.stream&&this.element)return e(null,this.element);if(!this.stream&&this.buffer)return e(null,this.buffer);if(!this.asset)return e(new Error("No audio asset"));if(this.stream)this.asset.load(function(r){if(!r)return e(new Error("Error loading audio/video file"));t.isVideo?t.element=r.runtimeData.image:t.element=r.runtimeData,e(null,t.element)});else{if(!this.context)return e(new Error("No Web Audio context"));var r=this.asset.get("representations"),i=this.getEngine().resourceLoader.load(r[0].src,u.default.BUFFER,{});i.once(p.default.ERROR,function(t){return e(t)}),i.once(p.default.LOAD,function(r){t.context.decodeAudioData(r,function(r){t.buffer=r,e(null,t.buffer)},function(t){return e(t)})})}},t.prototype.freeAudioGraph=function(){this.element&&(this.element.pause(),this.element.currentTime=0),this.sourceNode&&(this.stream||this.sourceNode.stop(0),this.sourceNode.disconnect(),this.sourceNode=null),this.gainNode&&this.gainNode.disconnect(),this.pannerNode&&this.pannerNode.disconnect()},t.prototype.getCurrentTime=function(){if("playing"===this.state){if(this.element)return this.element.currentTime;if(this.context)return this.context.currentTime-this.startTime}return this.playOffset},t}(s.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(22),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.recursive=!0,t.boxGeometry=new n.BoxGeometry(1,1,1),t.topBoxMaterial=new n.MeshBasicMaterial({color:4607,wireframe:!0}),t.subBoxMaterial=new n.MeshBasicMaterial({color:16713728,wireframe:!0}),t.workBounds=new n.Box3,t.helpers=[],t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this,t=this.getEntity();this.recursive&&t.getDescendantsByType("mesh").forEach(function(t){e.createBoundingBox(t,e.subBoxMaterial)}),this.createBoundingBox(t,this.topBoxMaterial,!1)},t.prototype.onShutdown=function(){this.helpers.forEach(function(e){e.boxMesh.parent&&e.boxMesh.parent.remove(e.boxMesh)})},t.prototype.onEnable=function(){this.helpers.forEach(function(e){return e.boxMesh.visible=!0})},t.prototype.onDisable=function(){this.helpers.forEach(function(e){return e.boxMesh.visible=!1})},t.prototype.createBoundingBox=function(e,t,r){var i=this;void 0===r&&(r=!0),e&&e.when("loadBase",function(){var a=e instanceof o.default&&r?e.getLocalBounds(i.workBounds):e.getBounds(i.workBounds),s={boxMesh:new n.Mesh(i.boxGeometry,t),object:e,bounds:a};i.isEnabled()||(s.boxMesh.visible=!1),i.helpers.push(s),s.bounds.getSize(s.boxMesh.scale),s.bounds.getCenter(s.boxMesh.position),e.runtimeData.add(s.boxMesh)})},t}(a.default);t.default=s},function(e,t,r){"use strict";function i(e,t,r){var i=t-e;return Math.min(t,Math.max(e,e+i*r))}Object.defineProperty(t,"__esModule",{value:!0});var n=r(0),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.perspectiveZoomMax=180,t.perspectiveZoomMin=0,t.orthoZoomMax=5,t.orthoZoomMin=0,t.perspectiveStep=4,t.orthographicStep=.2,t}return n.__extends(t,e),t.prototype.zoom=function(e){if(void 0===e&&(e=0),this.hasRuntimeData()&&this.isEnabled()){switch(this.getEntity().getProperty("cameraType")){case"perspective":this.zoomPerspective(e);break;case"orthographic":this.zoomOrthographic(e)}this.updateRenderer()}},t.prototype.lerpZoom=function(e){if(this.hasRuntimeData()&&this.isEnabled()){var t=this.getEntity(),r=Math.max(0,Math.min(1,e));switch(t.getProperty("cameraType")){case"perspective":this.lerpZoomPerspective(r);break;case"orthographic":this.lerpZoomOrtho(r)}this.updateRenderer()}},t.prototype.getZoomLevel=function(){var e,t,r=this.getEntity().getProperty("cameraType"),i=this.getRuntimeData();return"perspective"===r?(e=this.perspectiveZoomMax-this.perspectiveZoomMin,t=i.fov-this.perspectiveZoomMin):(e=this.orthoZoomMax-this.orthoZoomMin,t=i.top+Math.abs(i.bottom)-this.orthoZoomMin),t/e},t.prototype.setPerspectiveBounds=function(e,t){this.perspectiveZoomMin=e,this.perspectiveZoomMax=t,this.zoom()},t.prototype.setOrthographicBounds=function(e,t){this.orthoZoomMin=e,this.orthoZoomMax=t,this.zoom()},t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertyChanges),this.listenTo(this.getEntity(),"lerpZoom",this.lerpZoom),this.listenTo(this.getEntity(),"zoom",this.zoom)},t.prototype.zoomPerspective=function(e){var t=this.getRuntimeData(),r=t.fov,i=r+e*this.perspectiveStep,n=Math.min(this.perspectiveZoomMax,Math.max(this.perspectiveZoomMin,i));this.setFOV(n)},t.prototype.lerpZoomPerspective=function(e){var t=i(this.perspectiveZoomMin,this.perspectiveZoomMax,e);this.setFOV(t)},t.prototype.zoomOrthographic=function(e){var t=this.getRuntimeData(),r=2*t.top+e*this.orthographicStep,i=Math.min(this.orthoZoomMax,Math.max(this.orthoZoomMin,r));this.setOrthoBounds(i)},t.prototype.lerpZoomOrtho=function(e){var t=i(this.orthoZoomMin,this.orthoZoomMax,e);this.setOrthoBounds(t)},t.prototype.onPropertyChanges=function(e){e.cameraType&&this.zoom()},t.prototype.setFOV=function(e){this.getEntity().setProperty("fov",e)},t.prototype.setOrthoBounds=function(e){var t=this.getEntity().getAspectRatio();this.getEntity().setProperties({top:.5*e,bottom:.5*-e,right:t*e*.5,left:t*-e*.5})},t.prototype.updateRenderer=function(){this.getEngine().needsRender=!0},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=e.call(this)||this;return t.framesElapsed=0,t.near=1,t.far=12e3,t.updateFrameInterval=0,t.cubeMaterial=void 0,t.tempRenderTexture=void 0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initCameras()},t.prototype.onShutdown=function(){this.hasRuntimeData()&&this.getRuntimeData().remove(this.cubeCamera)},t.prototype.onEntityLoaded=function(){this.getRuntimeData().add(this.cubeCamera)},t.prototype.onAttributesChanged=function(e){var t=this;-1!==e.indexOf("captureTexture")&&(this.captureTexture?(this.captureTexture.when("load",function(){t.tempRenderTexture&&t.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.tempRenderTexture||this.createTempRenderTexture()),this.hasRuntimeData()&&(-1===e.indexOf("near")&&-1===e.indexOf("far")||(this.cameraPX.near=this.near,this.cameraPX.far=this.far,this.cameraPX.updateProjectionMatrix(),this.cameraNX.near=this.near,this.cameraNX.far=this.far,this.cameraNX.updateProjectionMatrix(),this.cameraPY.near=this.near,this.cameraPY.far=this.far,this.cameraPY.updateProjectionMatrix(),this.cameraNY.near=this.near,this.cameraNY.far=this.far,this.cameraNY.updateProjectionMatrix(),this.cameraPZ.near=this.near,this.cameraPZ.far=this.far,this.cameraPZ.updateProjectionMatrix(),this.cameraNZ.near=this.near,this.cameraNZ.far=this.far,this.cameraNZ.updateProjectionMatrix()),-1!==e.indexOf("debugView")&&this.cubeCamera.traverse(function(e){e instanceof n.PerspectiveCamera&&(e.cameraHelper||(e.cameraHelper=new n.CameraHelper(e),t.getRootThreeObject().add(e.cameraHelper)),e.cameraHelper.visible=!!t.debugView)}))},t.prototype.captureScene=function(){var e=this.getRenderer(),t=this.getRootThreeObject(),r=this.captureTexture?this.captureTexture.runtimeData:this.tempRenderTexture.runtimeData;if(r){var i=r.texture.generateMipmaps,n=[],a=[];r.texture.generateMipmaps=!1,this.renderPosX&&(a.push(0),n.push(this.cameraPX)),this.renderNegX&&(a.push(1),n.push(this.cameraNX)),this.renderPosY&&(a.push(2),n.push(this.cameraPY)),this.renderNegY&&(a.push(3),n.push(this.cameraNY)),this.renderPosZ&&(a.push(4),n.push(this.cameraPZ)),this.renderNegZ&&(a.push(5),n.push(this.cameraNZ)),n.forEach(function(o,s){s===n.length-1&&(r.texture.generateMipmaps=i),r.activeCubeFace=a[s],e.renderView(t,o,{renderTarget:r,clearColor:!0})}),r.needsUpdate=!0}},t.prototype.onPreRender=function(){this.getRootObject().isLoaded()&&++this.framesElapsed>=this.updateFrameInterval&&this.isEnabled()&&(this.framesElapsed=0,this.captureScene())},t.prototype.getCubeCamera=function(){return this.cubeCamera},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTextureCube({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_cube"),this.tempRenderTexture.load()},t.prototype.initCameras=function(){this.cubeCamera=new n.Object3D;this.cameraPX=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPX.up.set(0,-1,0),this.cameraPX.lookAt(new n.Vector3(1,0,0)),this.cubeCamera.add(this.cameraPX),this.cameraNX=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNX.up.set(0,-1,0),this.cameraNX.lookAt(new n.Vector3(-1,0,0)),this.cubeCamera.add(this.cameraNX),this.cameraPY=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPY.up.set(0,0,1),this.cameraPY.lookAt(new n.Vector3(0,1,0)),this.cubeCamera.add(this.cameraPY),this.cameraNY=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNY.up.set(0,0,-1),this.cameraNY.lookAt(new n.Vector3(0,-1,0)),this.cubeCamera.add(this.cameraNY),this.cameraPZ=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraPZ.up.set(0,-1,0),this.cameraPZ.lookAt(new n.Vector3(0,0,1)),this.cubeCamera.add(this.cameraPZ),this.cameraNZ=new n.PerspectiveCamera(90,1,this.near,this.far),this.cameraNZ.up.set(0,-1,0),this.cameraNZ.lookAt(new n.Vector3(0,0,-1)),this.cubeCamera.add(this.cameraNZ)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(5),o=r(1),s=r(2),u=function(e){function t(){var t=e.call(this)||this;return t.controlPoints=void 0,t.prevControlPointsLength=0,t.closed=!1,t.tempVector=new o.Vector3,t.tempVector4=new o.Vector4,t.tempMatrix=new o.Matrix4,t.visualizationCurveColor=2236962,t.visualizationSelectedCurveColor=874150,t.orientationHelpers=[],t.canTryUpdateAgain=!0,t.curveMaterial=void 0,t.curveGeometry=void 0,t.curveMesh=void 0,t.curveTessellation=200,t.selected=!1,t.updateStarted=!1,t}return i.__extends(t,e),t.prototype.onSelected=function(){this.selected=!0,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationSelectedCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!0})})},t.prototype.onUnselected=function(){this.selected=!1,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!1})})},t.prototype.isCurveInit=function(){return this.curve.points.length>0},t.prototype.onStartup=function(){this.initCurve()},t.prototype.onAttributesChanged=function(){this.initCurve()},t.prototype.onShutdown=function(){this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.cleanupCurveMaterial()},t.prototype.initCurve=function(){!this.updateStarted&&this.controlPoints&&this.controlPoints.length&&(this.updateStarted=!0,this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.prevControlPointsLength=this.controlPoints.length,this.createCurve(),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh(),this.updateOrientationHelpers()))},t.prototype.createCurve=function(){var e=this,t=this.controlPoints.map(function(t){return t.off("change:properties",e.updateCurve,e),new o.Vector3});this.curve=new o.CatmullRomCurve3(t),this.closed&&(this.curve.closed=!0);var r=this.getEntity().getRootObject();r.when("loadDependencies",function(t){r.runtimeData.updateMatrixWorld(!0),a.forEach(e.controlPoints,function(t,r){if(t){var i=t.getPosition();e.curve.points[r].set(i.x,i.y,i.z),e.tempMatrix.makeRotationFromQuaternion(t.runtimeData.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,16711680)),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,65280)),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,i,.25,255)),t.on("change:properties",e.updateCurve,e)}else e.tempVector.set(0,0,0),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680))}),e.updateCurve({}),e.updateStarted=!1,e.selected||e.onUnselected(),e.trigger("curveInit")},this)},t.prototype.updateCurve=function(e){var t=this,r=0;e.hasOwnProperty("position")&&(a.forEach(this.controlPoints,function(e){e&&(e.runtimeData.parent?(e.getPosition(t.tempVector),t.tempVector4.set(t.tempVector.x,t.tempVector.y,t.tempVector.z,1),t.tempVector4.applyMatrix4(e.runtimeData.parent.matrixWorld),t.curve.points[r].set(t.tempVector4.x,t.tempVector4.y,t.tempVector4.z),r++):t.canTryUpdateAgain&&(t.canTryUpdateAgain=!1,setTimeout(function(){n.default.info("Trying again"),t.updateCurve({})},10)))}),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh()),this.canTryUpdateAgain=!0),e.hasOwnProperty("quaternion")&&this.updateOrientationHelpers()},t.prototype.cleanupCurveMaterial=function(){this.curveMaterial&&(this.curveMaterial.dispose(),this.curveMaterial=void 0)},t.prototype.cleanupOrientationHelpers=function(){var e=this;this.orientationHelpers.forEach(function(t){e.getRootThreeObject().remove(t)}),this.orientationHelpers=[]},t.prototype.cleanupCurveMesh=function(){this.enableVisualizations&&this.curveMesh&&(this.getRootThreeObject().remove(this.curveMesh),this.curveGeometry.dispose(),this.curveMesh.material=void 0)},t.prototype.createCurveMesh=function(){var e=this;this.curveMaterial||(this.curveMaterial=new o.MeshPhongMaterial({color:this.visualizationCurveColor,transparent:!1,opacity:.75,blending:o.AdditiveBlending})),this.curve.points.length&&(this.curveGeometry=new o.TubeGeometry(this.curve,this.curveTessellation,.1,8,this.closed),this.curveMesh=new o.Mesh(this.curveGeometry,this.curveMaterial),this.getRootObject().when("loadBase",function(){e.getRootThreeObject().add(e.curveMesh),a.forEach(e.orientationHelpers,function(t){e.getRootThreeObject().add(t)})},this),this.updateOrientationHelpers())},t.prototype.updateOrientationHelpers=function(){var e=this;this.controlPoints.forEach(function(t,r){var i=t.runtimeData;e.orientationHelpers[3*r].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+1].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+2].position.copy(e.curve.points[r]),e.tempMatrix.makeRotationFromQuaternion(i.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers[3*r].setDirection(e.tempVector),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers[3*r+1].setDirection(e.tempVector),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers[3*r+2].setDirection(e.tempVector)})},t}(s.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this;this.logTag=document.createElement("div"),this.logTag.id="consoleLogger",this.logTag.style.position="absolute",this.logTag.style.top="0",this.logTag.style.left="0",this.logTag.style.width="100%",this.logTag.style.height="100%",this.logTag.style.margin="0",this.logTag.style.padding="0",this.logTag.style.color="#000",this.logTag.style.background="rgba(0,0,0,0.5)",this.logTag.style.fontWeight="bold",this.logTag.style.textAlign="left",this.logTag.style.overflow="scroll",this.logTag.style["pointer-events"]="none",this.logTag.style["z-index"]="1",window.document.body.appendChild(this.logTag),this.oldLog=window.console.log,this.oldError=window.console.error,this.oldWarn=window.console.warn,window.console.log=window.console.error=window.console.warn=function(t){e.logTag.innerHTML+=t+"<br>"}},t.prototype.onShutdown=function(){this.logTag&&(window.document.body.removeChild(this.logTag),window.console.log=this.oldLog,window.console.error=this.oldError,window.console.warn=this.oldWarn,this.logTag=void 0)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(282),o=function(e){function t(){var t=e.call(this)||this;return t.stats=new a,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.stats.showPanel(0)},t.prototype.onPreUpdate=function(){this.isEnabled()&&this.stats.begin()},t.prototype.onPostRender=function(){this.isEnabled()&&this.stats.end()},t.prototype.onEnable=function(){document.body.appendChild(this.stats.dom),this.initialized=!0},t.prototype.onDisable=function(){this.initialized&&(document.body.removeChild(this.stats.dom),this.initialized=!1)},t}(n.default);t.default=o},function(e,t,r){"use strict";function i(e,t){if(e&&e.style)for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r])}function n(e,t){e.classList?e.classList.add(t):e.className+=" "+t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),o=r(1),s=r(2),u=r(5),p=r(20),c=r(235),l={position:"absolute",left:"0",top:"0",padding:"8px","border-radius":"5px","font-family":"proxima_nova_regular,Helvetica,Arial,sans-serif","max-width":"25%","min-width":"25px",transition:"opacity 0.1s ease-in-out, background 0.1s ease-in-out",cursor:"pointer"},d=function(e){function t(){var t=e.call(this)||this;return t.renderEventName="render",t.textureRegistryById={},t}return a.__extends(t,e),t.prototype.onAwake=function(){this.getEngine().on("assetLoaded",this.registerTexture,this),this.getEngine().on("assetUnloaded",this.unregisterTexture,this)},t.prototype.onStartup=function(){var e=this;this.init2dScene(),this.initCubeScene(),this.renderEventName+="Group"+this.renderGroup,this.getEngine().on(this.renderEventName,this.renderView,this),this.listenTo(this.getEngine(),"rendererResize",this.resize),this.getEngine().getAssetsByClass(p.default).forEach(function(t){return e.registerTexture(t)}),this.resize()},t.prototype.onShutdown=function(){this.getEngine().off("assetLoaded",this.registerTexture,this),this.getEngine().off("assetUnloaded",this.unregisterTexture,this),this.getEngine().off(this.renderEventName,this.renderView,this)},t.prototype.init2dScene=function(){this.camera2D=new o.OrthographicCamera(-1,1,1,-1,0,1),this.scene2D=new o.Scene,this.material2D=new o.ShaderMaterial(c.default),this.material2D.transparent=!0,this.mesh2D=new o.Mesh(new o.PlaneGeometry(2,2),this.material2D),this.scene2D.add(this.mesh2D)},t.prototype.initCubeScene=function(){var e=o.ShaderLib.cube;this.sceneCube=new o.Scene,this.geoCube=new o.BoxGeometry(100,100,100),this.materialCube=new o.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,depthTest:!1,side:o.BackSide}),this.meshCube=new o.Mesh(this.geoCube,this.materialCube),this.cameraPX=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPX.up.set(0,1,0),this.cameraPX.lookAt(new o.Vector3(1,0,0)),this.sceneCube.add(this.cameraPX),this.cameraNX=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNX.up.set(0,1,0),this.cameraNX.lookAt(new o.Vector3(-1,0,0)),this.sceneCube.add(this.cameraNX),this.cameraPY=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPY.up.set(0,0,-1),this.cameraPY.lookAt(new o.Vector3(0,1,0)),this.sceneCube.add(this.cameraPY),this.cameraNY=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNY.up.set(0,0,1),this.cameraNY.lookAt(new o.Vector3(0,-1,0)),this.sceneCube.add(this.cameraNY),this.cameraPZ=new o.PerspectiveCamera(90,1,1,1e3),this.cameraPZ.up.set(0,1,0),this.cameraPZ.lookAt(new o.Vector3(0,0,1)),this.sceneCube.add(this.cameraPZ),this.cameraNZ=new o.PerspectiveCamera(90,1,1,1e3),this.cameraNZ.up.set(0,1,0),this.cameraNZ.lookAt(new o.Vector3(0,0,-1)),this.sceneCube.add(this.cameraNZ),this.sceneCube.add(this.meshCube)},t.prototype.setTexture=function(e){var t=this;this.currentTexture=this.textureRegistryById[e],this.currentTexture?this.currentTexture.load(function(){switch(t.currentTexture.type){case"renderTextureCube":case"textureCube":t.materialCube.uniforms.tCube.value=t.currentTexture.getThreeTexture();break;case"texture2D":case"renderTexture2D":t.material2D.uniforms.tDiffuse.value=t.currentTexture.getThreeTexture()}t.mesh2D.visible=!0,t.meshCube.visible=!0}):(this.mesh2D.visible=!1,this.meshCube.visible=!1)},t.prototype.updateViewport=function(){var e,t=this.getEngine().getRenderer().getWidth(),r=this.getEngine().getRenderer().getHeight();"%"===this.viewportBottom.slice(-1)?(e=.01*parseFloat(this.viewportBottom.slice(0,-1)),this.y=e*r):this.y=parseInt(this.viewportBottom,10),"%"===this.viewportLeft.slice(-1)?(e=.01*parseFloat(this.viewportLeft.slice(0,-1)),this.x=e*t):this.x=parseInt(this.viewportLeft,10),"%"===this.viewportWidth.slice(-1)?(e=.01*parseFloat(this.viewportWidth.slice(0,-1)),this.width=e*t):this.width=parseInt(this.viewportWidth,10),"%"===this.viewportHeight.slice(-1)?(e=.01*parseFloat(this.viewportHeight.slice(0,-1)),this.height=e*r):this.height=parseInt(this.viewportHeight,10),this.x<0&&(this.x+=t),this.y<0&&(this.y+=r)},t.prototype.updateTextureDropdown=function(){var e=this;this.isEnabled()&&setTimeout(function(){var t;if(!e.textureDropDown){if(e.textureDropDown=document.createElement("select"),e.textureDropDown.name="Textures",e.textureDropDown.id="Textures",n(e.textureDropDown,"debugger-dropdown"),i(e.textureDropDown,l),!e.getThreeRenderer())return;var r=e.getThreeRenderer().domElement;r.parentElement?r.parentElement.appendChild(e.textureDropDown):r.appendChild(e.textureDropDown),e.textureDropDown.onchange=function(){e.setTexture(e.textureDropDown.value)}}e.textureDropDown.options.length=0,t=document.createElement("option"),t.value=0,t.text="None",e.textureDropDown.appendChild(t),u.forEach(e.textureRegistryById,function(r,i){t=document.createElement("option"),t.value=i,t.text=""!==r.name?r.getName():i,e.textureDropDown.appendChild(t)}),e.textureDropDown.style.top=e.getEngine().getRenderer().getHeight()-e.y-e.height+"px",e.textureDropDown.style.left=e.x+"px",e.textureDropDown.style.zIndex="200"},0)},t.prototype.resize=function(){this.isEnabled()&&(this.updateTextureDropdown(),this.updateViewport())},t.prototype.renderView=function(){var e=this.getThreeRenderer();if(this.isEnabled()&&this.currentTexture)switch(e.setRenderTarget(null),this.currentTexture.type){case"texture2D":case"renderTexture2D":e.setViewport(this.x,this.y,this.width,this.height),e.render(this.scene2D,this.camera2D);break;case"textureCube":case"renderTextureCube":var t=.25*this.width,r=.3333*this.height;e.setViewport(this.x,this.y+r,t,r),e.render(this.sceneCube,this.cameraPX,null,!1),e.setViewport(this.x+1.999*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNX,null,!1),e.setViewport(this.x+t,this.y+1.99*r,t,r),e.render(this.sceneCube,this.cameraPY,null,!1),e.setViewport(this.x+t,this.y,t,r),e.render(this.sceneCube,this.cameraNY,null,!1),e.setViewport(this.x+t,this.y+r,t,r),e.render(this.sceneCube,this.cameraPZ,null,!1),e.setViewport(this.x+2.99*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNZ,null,!1)}},t.prototype.registerTexture=function(e){if(e)switch(e.type){case"renderTextureCube":case"textureCube":case"texture2D":case"renderTexture2D":this.textureRegistryById[e.id]=e}},t.prototype.unregisterTexture=function(e){e&&this.textureRegistryById[e.id]&&delete this.textureRegistryById[e.id]},t}(s.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(){function e(e,t,r,i){this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i,this.previousValues={},this.lastTimeSavings=0,this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i}return e}();t.QualityChangeLevel=a;var o=function(e){function t(){var t=e.call(this)||this;return t.QualityChangeLevel=a,t.frameTimeThreshold=33.333333333,t.testInterval=2e3,t.qualityChangeLevels=[],t.currentLevel=t.qualityChangeLevels.length,t.elapsedRenderTime=0,t.framesRecorded=0,t.justStarted=!0,t.justAutoSteppedDown=!1,t.autoOptimize=!0,t}return i.__extends(t,e),t.prototype.setQualityChangeLevels=function(e){this.setMaxQuality(),this.qualityChangeLevels=e,this.currentLevel=this.qualityChangeLevels.length,this.isEnabled()&&(this.autoOptimize=!0)},t.prototype.setFrameTimeThreshold=function(e){this.frameTimeThreshold=e},t.prototype.setTestInterval=function(e){this.testInterval=e,this.elapsedRenderTime=0,this.framesRecorded=0},t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&(this.elapsedRenderTime+=1e3*e,this.framesRecorded++,!(this.elapsedRenderTime<this.testInterval))){if(this.lastAvgFrameTime=this.elapsedRenderTime/this.framesRecorded,this.elapsedRenderTime=0,this.framesRecorded=0,this.justAutoSteppedDown&&this.currentLevel<this.qualityChangeLevels.length){var t=this.qualityChangeLevels[this.currentLevel];t.lastTimeSavings=t.frameTimeAtDrop-this.lastAvgFrameTime,this.justAutoSteppedDown=!1}if(this.justStarted||!this.autoOptimize||!this.qualityChangeLevels.length)return void(this.justStarted=!1);this.lastAvgFrameTime>this.frameTimeThreshold?(this.stepRenderingQualityDown(),this.justAutoSteppedDown=!0):this.qualityChangeLevels[this.currentLevel]&&this.lastAvgFrameTime<.9*(this.frameTimeThreshold-this.qualityChangeLevels[this.currentLevel].lastTimeSavings)&&this.stepRenderingQualityUp()}},t.prototype.stepRenderingQualityDown=function(){for(var e=!0;e&&this.currentLevel>0;)this.currentLevel=this.currentLevel>1?this.currentLevel-1:0,e=!this.stepRenderingQuality(!1);e||(this.qualityChangeLevels[this.currentLevel].frameTimeAtDrop=this.lastAvgFrameTime)},t.prototype.stepRenderingQualityUp=function(){for(var e=!0;e&&this.currentLevel<this.qualityChangeLevels.length;)e=!this.stepRenderingQuality(!0),this.currentLevel=Math.min(this.currentLevel+1,this.qualityChangeLevels.length)},t.prototype.onEnable=function(){this.autoOptimize=!0},t.prototype.onDisable=function(){this.autoOptimize=!1,this.setMaxQuality()},t.prototype.setMaxQuality=function(){for(this.autoOptimize=!1;this.currentLevel<this.qualityChangeLevels.length;)this.stepRenderingQualityUp()},t.prototype.stepValue=function(e,t,r,i){return i?e.previousValues[t]:(e.previousValues[t]=r,e.targetValue)},t.prototype.applyLevelToEntity=function(e,t,r){var i=this,n=!1;if(t.targetComponentName){e.getComponentsByScriptName(t.targetComponentName).forEach(function(e){var a=e.getAttribute(t.propertyName),o=i.stepValue(t,e.getId(),a,r);a!==o&&(e.setAttribute(t.propertyName,o),n=!0)})}else{var a=e.getProperty(t.propertyName),o=this.stepValue(t,e.id,a,r);a!==o&&(e.setProperty(t.propertyName,o),n=!0)}return n},t.prototype.stepRenderingQuality=function(e){var t=this,r=this.qualityChangeLevels[this.currentLevel],i=this.getEngine().getEntitiesByType(r.targetEntityType),n=!1;return i.forEach(function(i){t.applyLevelToEntity(i,r,e)&&(n=!0)}),n},t}(n.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(5),o=r(9),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.triggers=[],t}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("listener")&&(this.bindListener(this.getPreviousAttribute("listener"),!1),this.bindListener(this.listener,!0))},t.prototype.bindListener=function(e,t){if(e){var r,i=e.scope,n=i?i.type:"local";if(r="local"===n?this.getEntity():"entity"===n?this.getEngine().getEntityById(e.scope.entityId):this.getGlobalEvents()){var a,o=e.recurrence;a=t?"once"===o?this.listenToOnce.bind(this):this.listenTo.bind(this):this.stopListening.bind(this),a(r,e.name,this.onListenerTriggered)}}},t.prototype.onListenerTriggered=function(){var e=this;if(this.isEnabled()){var t=this.triggers;a.forEach(t,function(t){if(t){var r,i=t.name,n=t.parameters||[],a=t.scope?t.scope.type:"local";"local"===a?e.callEvent(e.getEntity(),i,n):"entity"===a?(r=e.getEngine().getEntityById(t.scope.entityId))&&e.callEvent(r,i,n):e.callEvent(e.getGlobalEvents(),i,n)}})}},t.prototype.callEvent=function(e,t,r){var i;i=e instanceof o.default?e.getAvailableEvents():this.getEngine().registeredGlobalEvents;var n=[t];i[t]&&i[t].parameters.forEach(function(e,t){void 0!==r[t]&&null!==r[t]?n.push(r[t]):n.push(e.default)}),e.trigger.apply(e,n)},t}(n.default);t.default=s},function(e,t,r){"use strict";function i(e,t){return Math.pow(e,2)*((t+1)*e-t)}function n(e){return e<.5?i(2*e,2)/2:(2-i(2*(1-e),2))/2}function a(e,t,r,i){var n=Math.floor(Math.sqrt(e)),a=1/n,o=1/n,s=-a*(n-1)*.5,u=(n-1)/2*o,p=0;return function(e,c){var l=s+e%n*a,d=u-p*o;c.set(l,d,0).applyQuaternion(i),c.copy(t.clone().add(c.multiply(r))),e%n==n-1&&p++}}function o(e,t){return function(r,i,n){n.getRuntimeData().updateMatrixWorld(!0),i.setFromMatrixPosition(n.getRuntimeData().matrixWorld);var a=i.clone().sub(e);i.copy(e).add(a.multiply(t))}}function s(e,t,r,i){return function(n,a){var o=t.x+r.x*Math.cos(2*Math.PI*n/e),s=t.y+r.y*Math.sin(2*Math.PI*n/e);a.set(o,s,t.z).applyQuaternion(i)}}Object.defineProperty(t,"__esModule",{value:!0});var u=r(0),p=r(1),c=r(2),l=new p.Vector3,d=function(e){function t(){var t=e.call(this)||this;return t.currentTime=0,t.objects=[],t.sources=[],t.destinations=[],t.direction=-1,t}return u.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"playExplode",this.explode),this.listenTo(this.getEntity(),"playContract",this.contract.bind(this)),this.listenTo(this.getEntity(),"toggleExplode",this.toggleExplode.bind(this)),this.listenTo(this.getEntity(),"resetExploder",this.reset.bind(this)),this.listenTo(this.getEntity(),"playCircleExplode",this.explode.bind(this,"Circle")),this.listenTo(this.getEntity(),"playGridExplode",this.explode.bind(this,"Grid")),this.listenTo(this.getEntity(),"playScaleExplode",this.explode.bind(this,"Scale"))},t.prototype.onUpdate=function(e){var t=this;if(this.hasRuntimeData()&&this.currentTime<this.time){this.currentTime+=e;var r=this.currentTime>this.time?1:n(Math.max(0,Math.min(1,this.currentTime/this.time)));this.objects.forEach(function(e,i){var n=e.runtimeData.parent.worldToLocal(l.copy(t.destinations[i])).clone(),a=t.direction>0?t.sources[i]:n,o=t.direction>0?n:t.sources[i];l.lerpVectors(a,o,r),e.setPosition(l.x,l.y,l.z)}),this.currentTime>this.time&&this.getEntity().trigger(this.direction>0?"endExplode":"endContract")}},t.prototype.reset=function(){var e=this;this.objects.forEach(function(t,r){t.setPosition(e.sources[r].x,e.sources[r].y,e.sources[r].z)}),this.objects.length=0,this.sources.length=0,this.destinations.length=0,this.currentTime=this.time},t.prototype.contract=function(){this.isEnabled()&&(this.direction=-1,this.currentTime=0,this.getEntity().trigger("beginContract"))},t.prototype.explode=function(e,t){var r=this;if(this.isEnabled()){this.reset();var i=this.getEntity().getDescendantsByType("mesh"),n=this.getEntity().getCenter();n.applyMatrix4(this.getRuntimeData().matrixWorld);var a=new p.Quaternion;a.setFromRotationMatrix(this.getRuntimeData().matrixWorld);var o=this.getFormationFunc(e||this.formation,i.length,n,a,t||this.scale).bind(this);i.forEach(function(e,t){o(t,l,e),r.objects.push(e),r.sources.push(e.getPosition()),r.destinations.push(l.clone())}),this.currentTime=0,this.direction=1,this.getEntity().trigger("beginExplode")}},t.prototype.toggleExplode=function(){this.direction>0?this.contract():this.explode()},t.prototype.getFormationFunc=function(e,t,r,i,n){switch(e){case"Grid":return a(t,r,n,i);case"Scale":return o(r,n);default:case"Circle":return s(t,r,n,i)}},t}(c.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=e.call(this)||this;return t.el=void 0,t.fsEnabled=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.toggle=this.toggle.bind(this),this.getEntity().on("toggleFullscreen",this.toggle,this),this.listenTo(this.getGlobalEvents(),"fullscreen::toggle",this.toggle),this.listenTo(this.getGlobalEvents(),"fullscreen::enable",this.enableFullscreen),this.listenTo(this.getGlobalEvents(),"fullscreen::disable",this.disableFullscreen)},t.prototype.toggle=function(){this.fsEnabled?this.disableFullscreen():this.enableFullscreen()},t.prototype.enableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.el.requestFullscreen(),this.fsEnabled=!0},t.prototype.disableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.fsEnabled&&document.exitFullscreen(),this.fsEnabled=!1},t.prototype.attachFullscreenAPI=function(){this.el=this.getEngine().container,this.el.requestFullscreen=this.el.requestFullscreen||this.el.requestFullScreen||this.el.mozRequestFullscreen||this.el.mozRequestFullScreen||this.el.webkitRequestFullscreen||this.el.webkitRequestFullScreen||this.el.msRequestFullscreen||this.el.msRequestFullScreen,document.exitFullscreen=document.exitFullscreen||document.exitFullScreen||document.mozCancelFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.webkitExitFullScreen||document.msExitFullscreen||document.msExitFullScreen,document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("msfullscreenchange",this.onFullscreenChange.bind(this),!1)},t.prototype.onFullscreenChange=function(e){this.getGlobalEvents().trigger("fullscreen::change",e)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(5),s=r(36),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t.axes=[],t.workVector1=new n.Vector3,t.workVector2=new n.Vector3,t.workQuaternion1=new n.Quaternion,t.workQuaternion2=new n.Quaternion,t.workEuler=new n.Euler,t.meshControlMap={},t.updateAxes=!1,t.updateButtons=[],t.gamepadDevice=null,t}return i.__extends(t,e),t.prototype.onUpdate=function(e){var t=this;this.gamepadDevice||(this.gamepadDevice=this.getGamepadDevice(),this.gamepadDevice&&(this.listenTo(this.gamepadDevice,"gamepadButtonChanged",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonTouched",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonReleased",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadAxisChanged",this.onGamepadAxisEvent))),this.updateButtons.forEach(function(e,r){e&&t.updateButtonTransform(r)}),this.updateAxes&&(this.updateAxes=!1,this.updateAxesTransforms())},t.prototype.getAxisMeshes=function(e){return this.axes[e].map(function(e){return e.mesh})},t.prototype.getButtonMeshes=function(e){return this.buttons[e].map(function(e){return e.mesh})},t.prototype.onAttributesChanged=function(e){var t=this;-1===e.indexOf("axes")&&-1===e.indexOf("buttons")||(this.meshControlMap={},this.axes.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&(t.meshControlMap[n.id]||(t.meshControlMap[n.id]={axes:[],axesMeshIdx:[],buttons:[],buttonMeshIdx:[]}),t.meshControlMap[n.id].axes.push(r),t.meshControlMap[n.id].axesMeshIdx.push(i))})}),this.buttons.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&t.meshControlMap[n.id]&&(t.meshControlMap[n.id].buttons.push(r),t.meshControlMap[n.id].buttonMeshIdx.push(i))})}))},t.prototype.getGamepadDevice=function(){if(this.gamepadDevice)return this.gamepadDevice;var e=[this.getEntity()].concat(this.getEntity().getAncestors()),t=e.find(function(e){return!!e.getComponent(function(e){return e instanceof s.default})});return t?(this.gamepadDevice=t.getComponent(function(e){return e instanceof s.default}),this.gamepadDevice):(this.gamepadDevice=null,null)},t.prototype.onGamepadButtonEvent=function(e,t){this.currentGamepadState=e,this.updateButtons[t]=!0},t.prototype.updateButtonTransform=function(e){var t=this,r=this.currentGamepadState.buttons[e].value;this.buttons[e].forEach(function(i){if(i.mesh){switch(i.movementType){case"translate":t.workVector1.copy(i.offset).multiplyScalar(r),i.mesh.setPosition(t.workVector1.x,t.workVector1.y,t.workVector1.z);break;case"rotate":t.workVector2.copy(i.rotation).multiplyScalar(r),t.workEuler.setFromVector3(t.workVector2),t.workQuaternion1.setFromEuler(t.workEuler),t.workVector1.copy(i.pivot),t.workVector2.copy(t.workVector1).multiplyScalar(-1),t.workVector2.applyQuaternion(t.workQuaternion1),t.workVector2.add(t.workVector1),i.mesh.setQuaternion(t.workQuaternion1.x,t.workQuaternion1.y,t.workQuaternion1.z,t.workQuaternion1.w),i.mesh.setPosition(t.workVector2.x,t.workVector2.y,t.workVector2.z)}i.renderOnTouchOnly&&t.currentGamepadState.buttons[e].hasOwnProperty("touched")&&i.mesh.setProperty("visible",t.currentGamepadState.buttons[e].touched)}})},t.prototype.onGamepadAxisEvent=function(e,t){this.currentGamepadState=e,this.updateAxes=!0},t.prototype.updateAxesTransforms=function(){var e=this;o.forEach(this.meshControlMap,function(t,r){var i=e.getEngine().getObjectById(r);if(i){var n=e.axes[0][t.axesMeshIdx[0]].movementType;if(e.workVector1.set(0,0,0),t.axes.reduce(function(r,i,a){var o=e.axes[i][t.axesMeshIdx[a]];if(o.movementType!==n)return log.error("Can't perform multiple types of axis transformations on same mesh."),r;if("translate"===n){var s=e.currentGamepadState.axes[i];e.workVector2.copy(o.offset).multiplyScalar(s)}else"rotate"===n&&e.workVector2.copy(o.pivot).multiplyScalar(-1);return r.lerp(e.workVector2,0===a?1:.5)},e.workVector1),e.workQuaternion1.set(0,0,0,1),"rotate"===n&&(t.axes.reduce(function(r,i,n){var a=e.axes[i][t.axesMeshIdx[n]],o=e.currentGamepadState.axes[i];return e.workVector2.copy(a.rotation).multiplyScalar(o),e.workEuler.setFromVector3(e.workVector2),e.workQuaternion2.setFromEuler(e.workEuler),r.slerp(e.workQuaternion2,0===n?1:.5)},e.workQuaternion1),e.workVector2.copy(e.workVector1),e.workVector1.applyQuaternion(e.workQuaternion1),e.workVector2.multiplyScalar(-1),e.workVector1.add(e.workVector2)),i.setQuaternion(e.workQuaternion1.x,e.workQuaternion1.y,e.workQuaternion1.z,e.workQuaternion1.w),i.setPosition(e.workVector1.x,e.workVector1.y,e.workVector1.z),t.buttons.length){var a=t.buttons[0],o=e.currentGamepadState.buttons[a].value,s=e.buttons[a][0].offset;e.workVector2.copy(s).multiplyScalar(o),e.workVector2.applyQuaternion(e.workQuaternion1),e.workVector2.add(e.workVector1),i.setPosition(e.workVector2.x,e.workVector2.y,e.workVector2.z)}}})},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gamepadStates=[],t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&navigator.getGamepads)for(var t=navigator.getGamepads(),r=0;r<t.length;r++)t[r]?(this.gamepadStates[r]||(this.gamepadStates[r]={buttonState:null,axesState:null},this.gamepadStates[r].buttonState=t[r].buttons.map(function(){return{pressed:!1,touched:!1,value:0}}),this.gamepadStates[r].axesState=t[r].axes.map(function(){return 0})),this.updateState(t[r],this.gamepadStates[r])):this.gamepadStates[r]=null},t.prototype.updateState=function(e,t){var r=this.getEngine();e.axes.forEach(function(i,n){i!==t.axesState[n]&&(t.axesState[n]=i,r.trigger("gamepadAxisChanged",e))}),e.buttons.forEach(function(i,n){var a=i;if(a.pressed!==t.buttonState[n].pressed){t.buttonState[n].pressed=a.pressed;var o=t.buttonState[n].pressed?"gamepadButtonDown":"gamepadButtonUp";r.trigger(o,e,n)}if(a.value!==t.buttonState[n].value&&(t.buttonState[n].value=a.value,r.trigger("gamepadButtonChanged",e,n)),a.touched!==t.buttonState[n].touched){t.buttonState[n].touched=a.touched;var o=t.buttonState[n].touched?"gamepadButtonTouched":"gamepadButtonReleased";r.trigger(o,e,n)}})},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(2),o=r(217),s=r(18),u=r(1),p={scenePercentX:0,scenePercentY:0},c={sceneX:0,sceneY:0};t.keyCodes={tab:9,shift:16,ctrl:17,alt:18,esc:27,space:32,rightArrow:39,leftArrow:37,upArrow:38,downArrow:40,delete:46,0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,cmd:91,numpad_0:96,numpad_1:97,numpad_2:98,numpad_3:99,numpad_4:100,numpad_5:101,numpad_6:102,numpad_7:103,numpad_8:104,numpad_9:105,">":187,"<":188,_:189,".":190,"/":191,"[":219,"]":221};var l=function(e){function r(){var t=e.call(this)||this;return t.mouseButtons={left:0,middle:1,right:2},t.inputQueue=[],t.inputPool=[],t.mouseButtonState=new Array(3),t.mouseButtonStatePrevious=new Array(3),t.mousePosition=new u.Vector2,t.mousePositionPercent=new u.Vector2,t.mousePreviousPosition=new u.Vector2,t.mouseDragState=new Array(3),t.mouseDragStatePrevious=new Array(3),t.mouseDragDistance=[new u.Vector2,new u.Vector2,new u.Vector2],t.touchPosition=new u.Vector2,t.touchPositionPercent=new u.Vector2,t.touchPreviousPosition=new u.Vector2,t.touchDragState=!1,t.touchDragStatePrevious=!1,t.doubleTapHandle=null,t.doubleTapPosition=new u.Vector2,t.listenForTouchStart=!1,t.listenForTouchEnd=!1,t.touchesStart=[],t.keyState=new Array(256),t.keyStatePrevious=new Array(256),t.canvas=null,t.pointerLockEnabled=!1,t}return i.__extends(r,e),r.prototype.mouseButtonDown=function(e){if("any"===e){for(var t in this.mouseButtons)if(this.mouseButtonState[this.mouseButtons[t]])return!0;return!1}return this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonUp=function(e){return!this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonPressed=function(e){return!(!this.mouseButtonState[this.mouseButtons[e]]||this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.mouseButtonReleased=function(e){return!(this.mouseButtonState[this.mouseButtons[e]]||!this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.keyPressed=function(e){return!(!this.keyState[t.keyCodes[e]]||this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyReleased=function(e){return!(this.keyState[t.keyCodes[e]]||!this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyDown=function(e){return!!this.keyState[t.keyCodes[e]]},r.prototype.keyUp=function(e){return!this.keyState[t.keyCodes[e]]},r.prototype.getMouseDragState=function(e){return this.mouseDragState[this.mouseButtons[e||"left"]]},r.prototype.getPreviousMouseDragState=function(e){return this.mouseDragStatePrevious[this.mouseButtons[e||"left"]]},r.prototype.getTouchDragState=function(){return this.touchDragState},r.prototype.getPreviousTouchDragState=function(){return this.touchDragStatePrevious},r.prototype.enablePointerLock=function(){this.pointerLockEnabled=!0,this.canvas.requestPointerLock()},r.prototype.disablePointerLock=function(){this.pointerLockEnabled=!1,document.exitPointerLock()},r.prototype.togglePointerLock=function(){this.pointerLockEnabled?this.enablePointerLock():this.disablePointerLock()},r.prototype.onStartup=function(){this.canvas=this.getEngine().canvas,this.canvas.requestPointerLock=this.canvas.requestPointerLock||this.canvas.mozRequestPointerLock||this.canvas.webkitRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,this.clearKeyStates=this.clearKeyStates.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchLeave=this.onTouchLeave.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onDoubleTap=this.onDoubleTap.bind(this),window.addEventListener("blur",this.clearKeyStates,!1),this.isEnabled()&&(this.mouseEvents.enable&&this.enableMouseEvents(),this.keyEvents.enable&&this.enableKeyEvents(),this.touchEvents.enable&&this.enableTouchEvents())},r.prototype.onPreUpdate=function(){if(this.isEnabled())for(;this.inputQueue.length>0;)this.getEngine().trigger(this.inputQueue[0].name,this.inputQueue[0].event),this.recycleInputEvent(this.inputQueue.splice(0,1)[0])},r.prototype.onPostUpdate=function(){if(this.isEnabled()){if(this.keyEvents.enable)for(var e=0;e<this.keyState.length;e++)this.keyStatePrevious[e]=this.keyState[e];if(this.mouseEvents.enable){for(var t=0;t<this.mouseButtonState.length;t++)this.mouseButtonStatePrevious[t]=this.mouseButtonState[t],this.mouseDragStatePrevious[t]=this.mouseDragState[t];this.mousePreviousPosition.x=this.mousePosition.x,this.mousePreviousPosition.y=this.mousePosition.y}this.touchEvents.enable&&(this.touchDragStatePrevious=this.touchDragState)}},r.prototype.onShutdown=function(){this.canvas&&(this.canvas.removeEventListener("touchstart",this.onTouchStart),this.canvas.removeEventListener("touchend",this.onTouchEnd),this.canvas.removeEventListener("touchcancel",this.onTouchCancel),this.canvas.removeEventListener("touchleave",this.onTouchLeave),this.canvas.removeEventListener("touchmove",this.onTouchMove),this.canvas.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.onMouseUp),this.canvas.removeEventListener("mousedown",this.onMouseDown),this.canvas.removeEventListener("wheel",this.onMouseWheel),document.removeEventListener("keydown",this.onKeyDown),document.removeEventListener("keyup",this.onKeyUp),document.body.removeEventListener("mouseleave",this.onMouseLeave),this.canvas.removeEventListener("contextmenu",this.onContextMenu),this.canvas.removeEventListener("dblclick",this.onDoubleClick),this.canvas.removeEventListener("touchstart",this.onDoubleTap)),this.mouseButtonState=void 0,this.mouseButtonStatePrevious=void 0,this.mouseDragState=void 0,this.mouseDragStatePrevious=void 0,this.mousePosition=void 0,this.mousePreviousPosition=void 0,this.touchPosition=void 0,this.touchPreviousPosition=void 0,this.keyState=void 0,this.keyStatePrevious=void 0},r.prototype.getScenePercent=function(e,t){var r=t||p;return this.getScenePos(e,e),r.scenePercentX=e.sceneX/this.getEngine().getRenderer().getWidth(),r.scenePercentY=e.sceneY/this.getEngine().getRenderer().getHeight(),r},r.prototype.getScenePos=function(e,t){var r=t||c,i=e.target.getBoundingClientRect(),n=i.top+document.body.scrollTop,a=i.left+document.body.scrollLeft;return r.sceneX=e.clientX-a,r.sceneY=e.clientY-n,r},r.prototype.enableMouseEvents=function(){this.mouseEvents.move&&this.canvas.addEventListener("mousemove",this.onMouseMove),this.mouseEvents.down&&this.canvas.addEventListener("mousedown",this.onMouseDown),this.mouseEvents.scroll&&this.canvas.addEventListener("wheel",this.onMouseWheel),this.mouseEvents.doubleClick&&this.canvas.addEventListener("dblclick",this.onDoubleClick),document.body.addEventListener("mouseleave",this.onMouseLeave),this.canvas.addEventListener("contextmenu",this.onContextMenu)},r.prototype.enableKeyEvents=function(){this.keyEvents.down&&document.addEventListener("keydown",this.onKeyDown),this.keyEvents.up&&document.addEventListener("keyup",this.onKeyUp)},r.prototype.enableTouchEvents=function(){this.touchEvents.start&&this.canvas.addEventListener("touchstart",this.onTouchStart),this.touchEvents.end&&this.canvas.addEventListener("touchend",this.onTouchEnd),this.touchEvents.doubleTap&&this.canvas.addEventListener("touchstart",this.onDoubleTap),this.touchEvents.cancel&&this.canvas.addEventListener("touchcancel",this.onTouchCancel),this.touchEvents.leave&&this.canvas.addEventListener("touchleave",this.onTouchLeave),this.touchEvents.move&&this.canvas.addEventListener("touchmove",this.onTouchMove)},r.prototype.clearKeyStates=function(){if(this.keyState)for(var e=0;e<this.keyState.length;++e)this.keyState[e]=!1},r.prototype.onMouseMove=function(e){this.getScenePercent(e,e),this.mousePosition.x=e.sceneX||e.clientX,this.mousePosition.y=e.sceneY||e.clientY,this.mousePositionPercent.x=e.scenePercentX,this.mousePositionPercent.y=e.scenePercentY,e.mouseDelta={x:e.movementX||e.mozMovementX||e.webkitMovementX||0,y:e.movementY||e.mozMovementY||e.webkitMovementY||0},e.mouseDelta.y||e.mouseDelta.x||(e.mouseDelta.x=this.mousePosition.x-this.mousePreviousPosition.x,e.mouseDelta.y=this.mousePosition.y-this.mousePreviousPosition.y),e.scenePercentDeltaX=e.mouseDelta.x/this.getEngine().getRenderer().getWidth(),e.scenePercentDeltaY=e.mouseDelta.y/this.getEngine().getRenderer().getHeight();for(var t=0;t<this.mouseButtonState.length;t++)if(!0===this.mouseButtonState[t]){this.mouseDragDistance[t].x+=e.mouseDelta.x,this.mouseDragDistance[t].y+=e.mouseDelta.y;var r=this.mouseDragDistance[t];r.x*r.x+r.y*r.y>this.mouseEvents.dragBufferDistance&&(this.mouseDragState[t]=!0)}else this.mouseDragState[t]=!1;this.inputQueue.push(this.getInputEvent(e,"mouseMove"))},r.prototype.onMouseDown=function(e){if(this.getScenePercent(e,e),this.mouseUpBound||(this.mouseUpBound=!0,document.addEventListener("mouseup",this.onMouseUp)),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.mouseEvents.preventDownDefault&&e.preventDefault(),this.mouseButtonState[e.button]=!0,this.inputQueue.push(this.getInputEvent(e,"mouseDown")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_down_"+t)}},r.prototype.onMouseUp=function(e){if(this.getScenePercent(e,e),this.mouseButtonState[e.button]=!1,this.mouseDragState[e.button]=!1,this.mouseDragDistance[e.button].x=0,this.mouseDragDistance[e.button].y=0,this.mouseButtonUp("left")&&this.mouseButtonUp("right")&&this.mouseButtonUp("middle")&&(this.mouseUpBound=!1,document.removeEventListener("mouseup",this.onMouseUp)),this.inputQueue.push(this.getInputEvent(e,"mouseUp")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_up_"+t)}},r.prototype.onDoubleClick=function(e){this.getScenePercent(e,e),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.inputQueue.push(this.getInputEvent(e,"doubleClick"))},r.prototype.onMouseWheel=function(e){this.mouseEvents.preventScrollDefault&&e.preventDefault();var t;t=void 0!==e.wheelDeltaY?.025*e.wheelDeltaY:s.isIE()?-e.deltaY/40:-e.deltaY,this.inputQueue.push(this.getInputEvent(t,"mouseScroll"))},r.prototype.onMouseLeave=function(e){for(var t=0,r=this.mouseButtonState;t<r.length;t++){r[t]&&this.onMouseUp(e)}this.clearKeyStates()},r.prototype.onContextMenu=function(e){this.mouseEvents.preventContextMenuDefault&&e.preventDefault(),this.inputQueue.push(this.getInputEvent(e,"contextMenu"))},r.prototype.onKeyDown=function(e){if((!document.activeElement||"true"!==document.activeElement.getAttribute("contenteditable")&&"DIV"!==document.activeElement.tagName&&"INPUT"!==document.activeElement.tagName&&"SELECT"!==document.activeElement.tagName&&"OPTION"!==document.activeElement.tagName&&"TEXTAREA"!==document.activeElement.tagName)&&(this.keyEvents.preventDefault&&e.preventDefault(),this.keyState[e.keyCode]=!0,this.inputQueue.push(this.getInputEvent(e,"keyDown")),this.keyEvents.eventHandler)){var r=this.getKeyByValue(t.keyCodes,e.keyCode);r&&this.getGlobalEvents().trigger("keypress_"+r)}},r.prototype.onKeyUp=function(e){this.keyState[e.keyCode]=!1,this.inputQueue.push(this.getInputEvent(e,"keyUp"))},r.prototype.onTouchStart=function(e){this.touchEvents.preventStartDefault&&e.preventDefault();var t=this.onTouchEvent(e,"touchStart");this.touchesStart=t.touches,t.touches.length&&(this.touchPosition.x=t.touches[t.touches.length-1].sceneX,this.touchPosition.y=t.touches[t.touches.length-1].sceneY,this.touchPositionPercent.x=t.touches[t.touches.length-1].scenePercentX,this.touchPositionPercent.y=t.touches[t.touches.length-1].scenePercentY),this.touchEvents.eventHandler&&this.getGlobalEvents().trigger("touch_start")},r.prototype.onTouchEnd=function(e){this.touchEvents.preventEndDefault&&e.preventDefault(),this.touchDragState=!1,this.onTouchEvent(e,"touchEnd"),this.touchEvents.eventHandler&&this.getGlobalEvents().trigger("touch_end")},r.prototype.onDoubleTap=function(e){if((this.listenForTouchStart||this.listenForTouchEnd)&&this.doubleTapPosition.distanceTo(this.touchPosition)>this.touchEvents.dragBufferDistance)return void this.clearDoubleTapState();this.listenForTouchStart||this.listenForTouchEnd?!this.listenForTouchStart&&this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0):this.listenForTouchStart&&!this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0,this.listenForTouchEnd=!0,this.canvas.addEventListener("touchend",this.onDoubleTap)):(this.clearDoubleTapState(),this.onTouchEvent(e,"doubleTap")):(this.doubleTapPosition.copy(this.touchPosition),this.clearDoubleTapState(),this.canvas.addEventListener("touchend",this.onDoubleTap),this.listenForTouchEnd=!0),this.doubleTapHandle=setTimeout(this.clearDoubleTapState.bind(this),300)},r.prototype.clearDoubleTapState=function(){clearTimeout(this.doubleTapHandle),this.doubleTapHandle=null,this.listenForTouchStart=!1,this.listenForTouchEnd=!1,this.canvas.removeEventListener("touchend",this.onDoubleTap)},r.prototype.onTouchCancel=function(e){this.touchEvents.preventCancelDefault&&e.preventDefault(),this.touchDragState=!1;var t={};t.originalEvent=e,t.touches=[],this.inputQueue.push(this.getInputEvent(t,"touchCancel"))},r.prototype.onTouchLeave=function(e){this.touchEvents.preventLeaveDefault&&e.preventDefault(),this.touchDragState=!1,this.onTouchEvent(e,"touchLeave")},r.prototype.onTouchMove=function(e){this.touchEvents.preventMoveDefault&&e.preventDefault();var t={};t.originalEvent=e,t.touches=[];for(var r=0;r<e.touches.length;++r){var i={};this.getScenePos(e.touches[r],i),this.getScenePercent(e.touches[r],i),i.originalTouch=e.touches[r],this.touchesStart[r]&&this.distance(e.touches[r],this.touchesStart[r])>this.touchEvents.dragBufferDistance&&(this.touchDragState=!0),t.touches.push(i)}t.touches.length&&(this.touchPosition.x=t.touches[t.touches.length-1].sceneX,this.touchPosition.y=t.touches[t.touches.length-1].sceneY,this.touchPositionPercent.x=t.touches[t.touches.length-1].scenePercentX,this.touchPositionPercent.y=t.touches[t.touches.length-1].scenePercentY),this.inputQueue.push(this.getInputEvent(t,"touchMove"))},r.prototype.onTouchEvent=function(e,t){var r={};r.originalEvent=e,r.touches=[];for(var i=0;i<e.touches.length;++i){var n={};this.getScenePos(e.touches[i],n),this.getScenePercent(e.touches[i],n),n.originalTouch=e.touches[i],r.touches.push(n)}return this.inputQueue.push(this.getInputEvent(r,t)),r},r.prototype.recycleInputEvent=function(e){e.name=null,e.event=null,this.inputPool.push(e)},r.prototype.getInputEvent=function(e,t){0===this.inputPool.length&&this.inputPool.push(new o.default);var r=this.inputPool.pop();return r.event=e,r.name=t,r},r.prototype.distance=function(e,t){var r=e.sceneX-t.sceneX,i=e.sceneY-t.sceneY;return Math.sqrt(r*r+i*i)},r.prototype.getKeyByValue=function(e,t){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===t)return r;return n.default.warn("Value not present in object: ",t),null},r}(a.default);t.Input=l,t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(5),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.objectTypeFilter=[],t.boundingSphereOverrideRadius=-1,t.firstIntersectionOnly=!0,t.debugVisualization=!1,t.currentIntersections={},t.previousIntersections={},t.workMatrix=new n.Matrix4,t.workBoundsSphere=new n.Sphere,t.workBoundingBox=new n.Box3,t.sphereGeometry=new n.SphereGeometry(1),t}return i.__extends(t,e),t.prototype.onAwake=function(){this.sphereMesh=new n.Mesh(this.sphereGeometry,new n.MeshBasicMaterial({wireframe:!0,color:255}))},t.prototype.onStartup=function(){var e=this;this.sourceBoundingSphere=new n.Sphere,this.sceneRoot=this.getEntity().getRootObject(),this.sceneRoot.when("loadBase",function(t){return t.runtimeData.add(e.sphereMesh)})},t.prototype.checkIntersection=function(){var e=this,t=this.generateObjectList();if(this.getRuntimeData()){if(this.getRuntimeData()&&(this.getEntity().getSphericalBounds(this.sourceBoundingSphere),this.sourceBoundingSphere.center.setFromMatrixPosition(this.getRuntimeData().matrixWorld),this.boundingSphereOverrideRadius>=0&&(this.sourceBoundingSphere.radius=this.boundingSphereOverrideRadius)),this.sceneRoot.isBaseLoaded()&&this.sphereMesh&&(this.sphereMesh.position.copy(this.sourceBoundingSphere.center),this.sphereMesh.scale.set(this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius)),this.previousIntersections=this.currentIntersections,this.currentIntersections={},this.firstIntersectionOnly){var r=t.find(this.intersectObject.bind(this));r&&(this.previousIntersections[r.id]||(this.trigger("beginIntersection",r),this.getEntity().trigger("beginIntersection",r)),this.currentIntersections[r.id]=r)}else t.filter(this.intersectObject.bind(this)).forEach(function(t){e.previousIntersections[t.id]||(e.trigger("beginIntersection",t),e.getEntity().trigger("beginIntersection",t)),e.currentIntersections[t.id]=t});return o.forEach(this.previousIntersections,function(t){e.currentIntersections[t.id]||(e.trigger("endIntersection",t),e.getEntity().trigger("endIntersection",t))}),this.currentIntersections}},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("debugVisualization")&&(this.sphereMesh.visible=this.debugVisualization)},t.prototype.onPreUpdate=function(){this.checkIntersectionAlways&&this.checkIntersection()},t.prototype.generateObjectList=function(){var e=this;if(this.objectFilter.length)return this.objectFilter;var t=[];return this.sceneRoot.traverseSome(function(r){return r===e.getEntity()||!(r===e.sceneRoot||e.objectTypeFilter.length&&!e.objectTypeFilter.some(function(e){return r.type===e}))&&void t.push(r)}),t},t.prototype.intersectObject=function(e){var t=e.runtimeData;return!!t&&(this.workMatrix.getInverse(t.matrixWorld),this.workBoundsSphere.copy(this.sourceBoundingSphere),this.workBoundsSphere.applyMatrix4(this.workMatrix),e.getBounds(this.workBoundingBox),this.workBoundingBox.intersectsSphere(this.workBoundsSphere))},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(14),o=function(e){function t(){var t=e.call(this)||this;return t.setupMaterial=t.setupMaterial.bind(t),t}return i.__extends(t,e),t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"entityCreated",function(t){t instanceof a.default&&e.setupMaterial(t)})},t.prototype.onAttributesChanged=function(e){this.setupAllMaterials()},t.prototype.onDisable=function(){this.getEngine().getAssetsByClass(a.default).forEach(function(e){var t=e.getShader().getProperty("parameters");t.envMapIrradiance&&e.setProperty("envMapIrradiance",null),t.envMapRadianceHalfGloss&&e.setProperty("envMapRadianceHalfGloss",null),t.envMapRadiance&&e.setProperty("envMapRadiance",null)})},t.prototype.onEnable=function(){this.setupAllMaterials()},t.prototype.setupAllMaterials=function(){this.getEngine().getAssetsByClass(a.default).forEach(this.setupMaterial)},t.prototype.setupMaterial=function(e){if(e&&this.isEnabled()){var t=e.getShader().getProperty("parameters");t.envMapIrradiance&&e.setProperty("envMapIrradiance",this.getAttribute("irradianceMap")),t.envMapRadiance&&e.setProperty("envMapRadiance",this.getAttribute("radianceMap")),t.envMapRadianceHalfGloss&&e.setProperty("envMapRadianceHalfGloss",this.getAttribute("radianceMapHalfGloss"))}},t}(n.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.playing=!0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.tempVec=new n.Vector3,this.tempMatrix=new n.Matrix4,this.tempQuaternion=new n.Quaternion},t.prototype.onAttributesChanged=function(e){if(!this.playing){var t=this.getEntity();t instanceof o.default&&(this.getRuntimeData().position.copy(t.getPosition()),this.getRuntimeData().quaternion.copy(t.getQuaternion()))}},t.prototype.onEnable=function(){this.playing=!0},t.prototype.onDisable=function(){this.playing=!1;var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()))},t.prototype.onPostUpdate=function(){var e;if(this.hasRuntimeData()&&this.playing&&this.isEnabled()&&(e=this.getRuntimeData(),this.target&&this.target.runtimeData)){this.getEngine().needsRender=!0;var t=this.target.runtimeData;if(this.tempVec.setFromMatrixPosition(t.matrixWorld),e.parent?this.tempMatrix.getInverse(e.parent.matrixWorld):this.tempMatrix.identity(),this.tempVec.applyMatrix4(this.tempMatrix),this.local){e.lookAt(this.tempVec);var r=this.getEntity();r instanceof o.default&&e.quaternion.multiply(r.getQuaternion())}else e.lookAt(this.tempVec)}},t.prototype.onShutdown=function(){},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(41),s=function(e){function t(){var t=e.call(this)||this;return t.createScene(),t}return i.__extends(t,e),t.prototype.setLightingFromThreeScene=function(e){var t=this;this.resetSceneLighting(),e.traverse(function(e){e instanceof n.Light&&t.scene.add(e.clone())}),this.captureScene()},t.prototype.setLightingFromScene=function(e){var t=this;this.resetSceneLighting(),e.getDescendantsByClass(o.default).forEach(function(e){e.isUnloaded()&&e.loadBase(),t.scene.add(e.getRuntimeData().clone())}),this.captureScene()},t.prototype.onAwake=function(){this.listenTo(this.getEntity(),"change:properties",this.onMaterialChanges)},t.prototype.onEnable=function(){this.captureScene()},t.prototype.onEntityLoaded=function(){this.captureScene()},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("captureTexture")&&this.captureScene()},t.prototype.onMaterialChanges=function(e){this.captureScene()},t.prototype.createScene=function(){this.camera=new n.OrthographicCamera(-.5,.5,.5,-.5,1,80),this.scene=new n.Scene,this.createGeometry(),this.scene.add(this.sphereMesh),this.scene.add(this.planeMesh),this.scene.add(this.camera),this.camera.position.z=40,this.camera.position.y=20,this.camera.position.x=20,this.camera.lookAt(new n.Vector3(0,0,0)),this.planeMesh.lookAt(this.camera.position)},t.prototype.createGeometry=function(){this.geometry=new n.SphereBufferGeometry(.5,36,36),this.planeGeometry=new n.PlaneBufferGeometry(1,2);var e=Math.sqrt(.5),t=this.planeGeometry.attributes.normal;t.array=new Float32Array([-1,1,0,1,1,0,-1,-1,0,1,-1,0]);for(var r=0;r<t.array.length;r++)t.array[r]*=e;this.sphereMesh=new n.Mesh(this.geometry),this.planeMesh=new n.Mesh(this.planeGeometry)},t.prototype.resetSceneLighting=function(){var e=[];this.scene.traverse(function(t){t instanceof n.Light&&e.push(t)}),e.forEach(function(e){e.parent.remove(e)})},t.prototype.captureScene=function(){var e=this;if(this.isEnabled()&&this.getEntity().isLoaded()){var t=this.getRuntimeData().static;this.sphereMesh.material=t,this.planeMesh.material=t;var r=this.getThreeRenderer();this.captureTexture&&(this.captureTexture.when("loadBase",function(t){r.render(e.scene,e.camera,t.runtimeData)}),this.captureTexture.isLoaded()||this.captureTexture.load())}},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(247),s=r(246),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.uniforms={bumpTexture:{type:"t",value:null},resolution:{type:"v2",value:new n.Vector2(256,256)},smoothness:{type:"f",value:.25},spread:{type:"f",value:4}},t.normalMaterial=null,t.initialized=!1,t}return i.__extends(t,e),t.prototype.renderNormalMap=function(e){if(this.isEnabled()&&this.sceneRTT){void 0!==e&&(this.uniforms.smoothness.value=e);var t=this.getThreeRenderer();t.render(this.sceneRTT,this.cameraRTT,this.getEntity().runtimeData,!0),t.setRenderTarget(null)}},t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"renderNormalMap",this.renderNormalMap),this.normalMaterial=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:o,fragmentShader:s,blending:n.NoBlending}),this.normalMaterial.depthTest=!1,this.normalMaterial.depthWrite=!1,this.cameraRTT=new n.OrthographicCamera(-.5,.5,.5,-.5,-10,10),this.cameraRTT.position.z=1,this.sceneRTT=new n.Scene,this.sceneRTT.add(this.cameraRTT),this.quadGeo=new n.PlaneGeometry(1,1),this.quadRTT=new n.Mesh(this.quadGeo,this.normalMaterial),this.quadRTT.position.z=-5,this.sceneRTT.add(this.quadRTT),this.initialized=!0},t.prototype.onShutdown=function(){this.sceneRTT&&(this.sceneRTT.remove(this.cameraRTT),this.sceneRTT.remove(this.quadRTT)),this.quadGeo&&this.quadGeo.dispose(),this.normalMaterial&&this.normalMaterial.dispose(),this.quadRTT=void 0,this.sceneRTT=void 0,this.uniforms=void 0},t.prototype.onEntityReady=function(){var e=this;this.updateUniforms(function(){e.autoLoad&&e.renderNormalMap()})},t.prototype.onAttributesChanged=function(){var e=this;this.initialized&&this.updateUniforms(function(){e.renderNormalMap()})},t.prototype.updateUniforms=function(e){var t=this;this.uniforms.smoothness.value=this.smoothness,this.uniforms.spread.value=this.spread,this.bumpTexture&&(this.bumpTexture.runtimeData?(this.uniforms.bumpTexture.value=this.bumpTexture.runtimeData,this.uniforms.resolution.value.set(this.bumpTexture.getWidth(),this.bumpTexture.getHeight()),"function"==typeof e&&e()):(this.bumpTexture.once("load",function(){t.uniforms.bumpTexture.value=t.bumpTexture.runtimeData,t.uniforms.resolution.value.set(t.bumpTexture.getWidth(),t.bumpTexture.getHeight()),"function"==typeof e&&e()},this),this.bumpTexture.load()))},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.playingCurveAnimation=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.getEntity().on("playAnimateAlongCurve",this.animateAlongCurve,this),this.getEntity().on("playAnimateToObject",this.animateToObject,this),this.getEntity().on("playAnimateTranslation",this.animateTranslation,this),this.getEntity().on("playAnimateRotation",this.animateRotation,this),this.getEntity().on("playAnimateScale",this.animateScale,this),this.getEntity().on("pauseCurveAnimation",this.onPauseCurveAnimation,this),this.getEntity().on("unpauseCurveAnimation",this.onUnpauseCurveAnimation,this),this.getEntity().on("stopCurveAnimation",this.stopCurveAnimation,this)},t.prototype.onShutdown=function(){this.getEntity().off("playAnimateAlongCurve",this.animateAlongCurve,this),this.getEntity().off("playAnimateToObject",this.animateToObject,this),this.getEntity().off("playAnimateTranslation",this.animateTranslation,this),this.getEntity().off("playAnimateRotation",this.animateRotation,this),this.getEntity().off("playAnimateScale",this.animateScale,this),this.getEntity().off("pauseCurveAnimation",this.onPauseCurveAnimation,this),this.getEntity().off("unpauseCurveAnimation",this.onUnpauseCurveAnimation,this),this.getEntity().off("stopCurveAnimation",this.stopCurveAnimation,this)},t.prototype.onDisable=function(){this.getRuntimeData().position.copy(this.getEntity().getPosition()),this.getRuntimeData().quaternion.copy(this.getEntity().getQuaternion()),this.getRuntimeData().scale.copy(this.getEntity().getScale())},t.prototype.stopCurveAnimation=function(){this.getEngine().off("update",this.curveAnim,this),this.curveAnim=void 0},t.prototype.animateAlongCurve=function(e,t,r,i,o,s){var u,p,c=this,l=this.getEngine();if(e&&(p=this.getEngine().getEntityById(e),u=p.getComponentByScriptId("curve")),u){var d=this.getRuntimeData(),h=0,f=0,m=new a.Vector3,y=new a.Vector3,g=new a.Vector3,v=new a.Matrix4,b=new a.Quaternion,x=new a.Quaternion,P=1-r-i,w=1/(r/2+i/2+P),E=function(e){if(!c.getEntity()||!c.isEnabled())return l.off("update",c.curveAnim,c),void(c.curveAnim=void 0);if(u&&c.playingCurveAnimation){c.getEngine().needsRender=!0,h+=e;var n=h/t;n>=1&&(n-=1);var a=1-i;if(r&&n<r){var p=n/r;f+=e*w/t*(.5*Math.cos(p*Math.PI+Math.PI)+.5)}else if(i&&n>a){var P=1-(n-a)/i;f+=e*w/t*Math.max(.5*Math.cos(P*Math.PI+Math.PI)+.5,0)}else f+=e*w/t;(f>=1||f<0)&&(f%=1,h=0,s||(f=.99999999,c.playingCurveAnimation=!1,c.getEngine().off("update",c.curveAnim,c),c.curveAnim=void 0),c.getEntity().trigger("endAnimateAlongCurve"));var E=u.curve,S=E.getUtoTmapping(f);if(d.position.copy(E.getPoint(S)),"toCurve"===o){var _=E.getTangent(S);m.set(0,-1,0),y.crossVectors(_,m),g.crossVectors(_,y),m.copy(d.position),m.add(_),v.lookAt(d.position,m,g),d.quaternion.setFromRotationMatrix(v)}else if("toNode"===o){var D=u.closed?E.points.length:E.points.length-1,T=Math.floor(S*D),M=Math.ceil(S*D)%E.points.length,A=void 0;-1!==T&&(A=T>0?u.controlPoints[T]:u.controlPoints[0],A.getQuaternion(b)),-1!==M&&(A=M>0?u.controlPoints[M]:u.controlPoints[0],A.getQuaternion(x));var R=S*D-T;d.quaternion.copy(b),d.quaternion.slerp(x,R)}}};r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5),t>0&&(this.playingCurveAnimation=!0,u.isCurveInit()?(this.curveAnim=E,this.getEngine().on("update",this.curveAnim,this)):u.on("curveInit",function(){c.curveAnim=E,c.getEngine().on("update",c.curveAnim,c)},this))}},t.prototype.onPauseCurveAnimation=function(){this.playingCurveAnimation=!1},t.prototype.onUnpauseCurveAnimation=function(){this.playingCurveAnimation=!0},t.prototype.animateToObject=function(e,t,r,i,o){var s=this,u=this.getEngine(),p=function(e){var p=s.getRuntimeData(),c=new a.Matrix4,l=0,d=0;r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5);var h,f=1-r-i,m=1/(r/2+i/2+f),y=new a.Vector3;y.copy(p.position);var g=e.position,v=e.quaternion;if(v&&o&&(h=new a.Quaternion,h.copy(p.quaternion)),e.updateMatrixWorld(!0),g.setFromMatrixPosition(e.matrixWorld),c.extractRotation(e.matrixWorld),v.setFromRotationMatrix(c),t>0){var b=function(e){if(!s.getEntity()||!s.isEnabled())return void u.off("update",b,s);s.getEngine().needsRender=!0,l+=e;var n=l/t,a=1-i;if(r&&n<r){var c=n/r;d+=e*m/t*(.5*Math.cos(c*Math.PI+Math.PI)+.5)}else if(i&&n>a){var f=1-(n-a)/i;d+=e*m/t*Math.max(.5*Math.cos(f*Math.PI+Math.PI)+.5,0)}else d+=e*m/t;d=Math.min(d,1),(d>=1||d<0)&&(s.getEngine().off("update",b,s),s.getEntity().trigger("endAnimateToObject")),p.position.copy(y),p.position.lerp(g,d),v&&o&&(p.quaternion.copy(h),p.quaternion.slerp(v,d))};s.getEngine().on("update",b,s)}else p.position.copy(g),v&&p.quaternion.copy(v),s.getEntity().trigger("endAnimateToObject")},c=this.getEngine().getEntityById(e);c.runtimeData?p(c.runtimeData):(c.once("loadBase",function(){p(c.runtimeData)},this),c.load())},t.prototype.animateTranslation=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Vector3,h=new a.Vector3;h.copy(i);var f=h.length();if(u.updateMatrixWorld(),h.applyQuaternion(u.quaternion),h.normalize(),o){var m=(1-t-r)*e,y=.5*(t+r)*e;"middle"===o?(d.copy(i),d.multiplyScalar(-.5*(m+y)),u.position.add(d)):"end"===o&&(d.copy(i),d.multiplyScalar(-1*(m+y)),u.position.add(d))}if(e>0){var g=function(i){if(!s.getEntity()||!s.isEnabled())return void c.off("update",g,s);d.copy(h),s.getEngine().needsRender=!0,p+=i;var n=Math.min(p/e,1),a=1-r,o=e*a;if(t&&p<l){var m=n/t;d.multiplyScalar(i*f*(.5*Math.cos(m*Math.PI+Math.PI)+.5))}else if(r&&p>o){var y=1-(n-a)/r;d.multiplyScalar(i*f*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else d.multiplyScalar(i*f);p>=e&&(s.getEngine().off("update",g,s),s.getEntity().trigger("endAnimateTranslation")),u.position.add(d)};this.getEngine().on("update",g,this)}},t.prototype.animateRotation=function(e,t,r,i,o,s){var u=this,p=this.getRuntimeData();p.position.copy(this.getEntity().getPosition()),p.quaternion.copy(this.getEntity().getQuaternion()),p.scale.copy(this.getEntity().getScale());var c=0,l=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var d=e*t,h=new a.Quaternion,f=new a.Quaternion,m=new a.Vector3,y=new a.Euler(i.x,i.y,i.z,s);if(h.setFromEuler(y),f.copy(h),p.updateMatrixWorld(),o){var g=(1-t-r)*e,v=.5*(t+r)*e;"middle"===o?(m.copy(i),m.multiplyScalar(-.5*(g+v)),y.set(m.x,m.y,m.z),h.setFromEuler(y),p.quaternion.multiply(h)):"end"===o&&(m.copy(i),m.multiplyScalar(-1*(g+v)),y.set(m.x,m.y,m.z),h.setFromEuler(y),p.quaternion.multiply(h))}if(e>0){var b=function(i){if(!u.getEntity()||!u.isEnabled())return void l.off("update",b,u);var n=1;u.getEngine().needsRender=!0,c+=i;var a=Math.min(c/e,1),o=1-r,s=e*o;if(t&&c<d){var m=a/t;n*=i*(.5*Math.cos(m*Math.PI+Math.PI)+.5)}else if(r&&c>s){var y=1-(a-o)/r;n*=i*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0)}else n*=i;c>=e&&(u.getEngine().off("update",b,u),u.getEntity().trigger("endAnimateRotation")),h.set(0,0,0,1),h.slerp(f,n),p.quaternion.multiply(h)};this.getEngine().on("update",b,this)}},t.prototype.animateScale=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Vector3;if(u.updateMatrixWorld(),o){var h=(1-t-r)*e,f=.5*(t+r)*e;"middle"===o?(d.copy(i),d.multiplyScalar(-.5*(h+f)),u.scale.add(d)):"end"===o&&(d.copy(i),d.multiplyScalar(-1*(h+f)),u.scale.add(d))}if(e>0){var m=function(n){if(!s.getEntity()||!s.isEnabled())return void c.off("update",m,s);d.copy(i),s.getEngine().needsRender=!0,p+=n;var a=Math.min(p/e,1),o=1-r,h=e*o;if(t&&p<l){var f=a/t;d.multiplyScalar(n*(.5*Math.cos(f*Math.PI+Math.PI)+.5))}else if(r&&p>h){var y=1-(a-o)/r;d.multiplyScalar(n*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else d.multiplyScalar(n);p>=e&&(s.getEngine().off("update",m,s),s.getEntity().trigger("endAnimateScale")),u.scale.add(d)};this.getEngine().on("update",m,this)}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(38),s=r(22),u=r(18),p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.pickTrigger=null,t.enableHover=!1,t.pickingMaterialDef=void 0,t.meshRegistry={},t.meshList=[],t.pickingTexture=void 0,t.currentHoverObject=void 0,t.currentFrame=0,t}return i.__extends(t,e),t.prototype.registerMesh=function(e){var t=this;e instanceof s.default&&e.when("loadBase",function(r){t.getEntity().isDestroyed()||t.registerObject(e,e.runtimeData)},this)},t.prototype.unregisterMesh=function(e){e instanceof s.default&&this.unregisterObject(e,e.runtimeData)},t.prototype.onStartup=function(){this.getEngine().on("rendererResize",this.resize,this),this.initPickingMaterial(),this.initMeshRegistry(),this.getGlobalEvents().on("registerPickingObject",this.registerObject,this),this.getGlobalEvents().on("unregisterPickingObject",this.unregisterObject,this),this.resize()},t.prototype.onShutdown=function(){var e=this;this.getEngine().off("rendererResize",this.resize,this),this.getGlobalEvents().off("registerPickingObject",this.registerObject,this),this.getGlobalEvents().off("unregisterPickingObject",this.unregisterObject,this),this.pickingTexture&&(this.pickingTexture.dispose(),this.pickingTexture=void 0),Object.keys(this.meshRegistry).forEach(function(t){var r=e.meshRegistry[t];r.pickingMaterial&&r.pickingMaterial.dispose()}),this.meshRegistry={},this.meshList=[]},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("pickTrigger")&&(this.bindPickTrigger(this.getPreviousAttribute("pickTrigger"),!1),this.bindPickTrigger(this.pickTrigger))},t.prototype.onPostRender=function(){this.enableHover&&!u.isMobile()&&this.hoverUpdate()},t.prototype.bindPickTrigger=function(e,t){void 0===t&&(t=!0);var r=this.getEngine(),i=t?this.listenTo.bind(this):this.stopListening.bind(this);"Up"===e.substr(-2)?u.isMobile()?i(r,"touchEnd",this.pick):i(r,"mouseUp",this.pick):"Down"===e.substr(-4)?u.isMobile()?i(r,"touchStart",this.pick):i(r,"mouseDown",this.pick):"DoubleClick"===e.substr(-11)?u.isMobile()?i(r,"doubleTap",this.pickNoDrag):i(r,"doubleClick",this.pickNoDrag):"Click"===e.substr(-5)&&(u.isMobile()?i(r,"touchEnd",this.pickNoDrag):i(r,"mouseUp",this.pickNoDrag))},t.prototype.initPickingMaterial=function(){this.pickingMaterialDef={depthTest:!0,depthWrite:!0,transparent:!1,side:n.DoubleSide,uniforms:{color:{type:"c",value:16711680}},vertexShader:[n.ShaderChunk.common,n.ShaderChunk.skinning_pars_vertex,"void main() {",n.ShaderChunk.beginnormal_vertex,n.ShaderChunk.morphnormal_vertex,n.ShaderChunk.skinbase_vertex,n.ShaderChunk.skinnormal_vertex,n.ShaderChunk.defaultnormal_vertex,n.ShaderChunk.begin_vertex,n.ShaderChunk.displacementmap_vertex,n.ShaderChunk.morphtarget_vertex,n.ShaderChunk.skinning_vertex,n.ShaderChunk.project_vertex,n.ShaderChunk.logdepthbuf_vertex,n.ShaderChunk.clipping_planes_vertex,n.ShaderChunk.worldpos_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 color;",n.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",n.ShaderChunk.logdepthbuf_fragment,"gl_FragColor = vec4( color, 1.0 );","}"].join("\n")}},t.prototype.initMeshRegistry=function(){this.listenTo(this.getEngine(),"entityCreated",this.registerMesh),this.listenTo(this.getEngine(),"entityDestroyed",this.unregisterMesh),this.getEngine().getObjectsByClass(s.default).forEach(this.registerMesh.bind(this))},t.prototype.resize=function(){var e=this.pickingTexture,t=this.getRenderer().getWidth(),r=this.getRenderer().getHeight();this.pickingTexture=new n.WebGLRenderTarget(Math.floor(t/4),Math.floor(r/4),{minFilter:n.LinearFilter}),this.pickingTexture.texture.generateMipmaps=!1,e&&e.dispose()},t.prototype.registerObject=function(e,t){if(!this.meshRegistry[t.id]){this.meshRegistry[t.id]={entity:e,runtimeData:t,prevMaterial:null,pickingMaterial:new n.ShaderMaterial(this.pickingMaterialDef),index:this.meshList.length},this.meshList.push(this.meshRegistry[t.id]);var r=this.meshRegistry[t.id].pickingMaterial;r.uniforms=n.UniformsUtils.clone(this.pickingMaterialDef.uniforms),r.uniforms.color.value=new n.Color(t.id),t instanceof n.SkinnedMesh&&(r.skinning=!0)}},t.prototype.unregisterObject=function(e,t){t&&this.meshRegistry[t.id]&&(this.meshRegistry[t.id].entity=null,this.meshRegistry[t.id].pickingMaterial.dispose(),this.meshList.splice(this.meshRegistry[t.id].index,1),delete this.meshRegistry[t.id])},t.prototype.pickNoDrag=function(e,t){this.getInput().getPreviousMouseDragState(this.getInput().mouseButtons[e.button])||this.pick(e,t)},t.prototype.pick=function(e,t){if(this.isEnabled()){if(!u.isMobile())if("left"===this.pickTrigger.substr(0,4)){if(0!==e.button)return}else if("right"===this.pickTrigger.substr(0,5)){if(2!==e.button)return}else if(1!==e.button)return;var r=e.offsetX,i=e.offsetY,n=this.pickMesh(r,i);if(n){var a=[n].concat(n.getAncestors());a.forEach(function(e){return e.trigger("pick")}),this.getEngine().globalEvents.trigger("objectsPicked",a.map(function(e){return e.id})),"function"==typeof t&&a.forEach(function(e){return t(e)})}else this.getEngine().globalEvents.trigger("objectsPicked",[])}},t.prototype.hoverUpdate=function(){var e=this;if(this.isEnabled()){if(this.currentFrame<this.hoverFrameSkip)return void this.currentFrame++;this.currentFrame=0;var t=this.getInput().mousePosition.x,r=this.getInput().mousePosition.y,i=this.pickMesh(t,r);if(i!==this.currentHoverObject){var n=[],a=[];this.currentHoverObject&&(n=[this.currentHoverObject.id].concat(this.currentHoverObject.getAncestors().map(function(e){return e.id}))),i?(a=[i.id].concat(i.getAncestors().map(function(e){return e.id})),this.currentHoverObject=i):this.currentHoverObject=null;var o=new Set(n),s=new Set(a),u=n.filter(function(e){return!s.has(e)}),p=a.filter(function(e){return!o.has(e)});u.length&&(this.getEngine().globalEvents.trigger("objectHoverEnd",u),u.forEach(function(t){return e.getEngine().getObjectById(t).trigger("endHover",t)})),p.length&&(this.getEngine().globalEvents.trigger("objectHoverBegin",p),p.forEach(function(t){return e.getEngine().getObjectById(t).trigger("beginHover",t)}))}}},t.prototype.pickMesh=function(e,t){var r=this,i=null,n=[];return this.getEngine().getObjectsByType("camera").filter(function(e){return e.isBaseLoaded()}).forEach(function(e){n=n.concat(e.getComponents().filter(function(e){return e instanceof o.default&&e.isEnabled()}))}),n.some(function(n){var a=r.getRenderer().getHeight(),o=a-n.height-n.y,s=(e-n.x)/n.width,u=(t-o)/n.height,p=n.getAttribute("overrideScene"),c=n.getEntity(),l=p?r.getEngine().getAssetById(p).getRootObject():c.getRootObject();if(i=r.doGPUPick(l,c,s,u))return!0}),i},t.prototype.doGPUPick=function(e,t,r,i){if(r<0||i<0||r>1||i>1)return null;var n,a=0;for(a=0;a<this.meshList.length;a++)this.meshList[a].runtimeData&&(n=this.meshList[a].runtimeData.material,this.meshList[a].prevMaterial=n,this.meshList[a].runtimeData.material=this.meshList[a].pickingMaterial);var o=this.getThreeRenderer(),s=o.shadowMap.enabled;o.shadowMap.enabled=!1,o.setViewport(0,0,this.pickingTexture.width,this.pickingTexture.height);var u=o.getContext();for(o.render(e.runtimeData,t.runtimeData,this.pickingTexture,!0),a=0;a<this.meshList.length;a++)this.meshList[a].runtimeData&&(this.meshList[a].runtimeData.material=this.meshList[a].prevMaterial);var p=new Uint8Array(4);u.readPixels(r*this.pickingTexture.width,this.pickingTexture.height*(1-i),1,1,u.RGBA,u.UNSIGNED_BYTE,p);var c=p[0]<<16|p[1]<<8|p[2];if(o.shadowMap.enabled=s,o.setRenderTarget(null),this.meshRegistry[c]){var l=this.meshRegistry[c].entity.id;return this.getEngine().getEntityById(l)}return null},t}(a.default);t.default=p},function(e,t,r){"use strict";function i(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1}function n(e,t,r,i){var n=e.x+(t.x-e.x)*r,a=e.y+(t.y-e.y)*r,o=e.z+(t.z-e.z)*r;i.set(n,a,o)}function a(e){return e.object.visible&&"Mesh"===e.object.type}Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),s=r(1),u=r(2),p=r(18),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.speed=.8,t.zoomSteps=5,t.zoomBuffer=.1,t.time=-1,t.isMouseDown=!1,t.targetZoom=0,t.srcZoom=0,t.lastFocusPosition=new s.Vector3(-1,-1,-1),t}return o.__extends(t,e),t.prototype.onDisable=function(){this.interrupt()},t.prototype.onUpdate=function(e){if(this.isEnabled()&&!(this.time<0)){var t=this.getRuntimeData(),r=i(1-1/(this.speed/this.time));n(this.srcLook,this.targetLook,r,this.currentLook),t.lookAt(this.currentLook);var a=this.srcZoom+(this.targetZoom-this.srcZoom)*r;this.zoomComponent.lerpZoom(a),this.time-=e,this.time<=0&&this.onEnd(),this.getEngine().needsRender=!0}},t.prototype.onStartup=function(){if(this.orbitCam=this.getEntity().getComponentByScriptName("Orbit Camera"),!this.orbitCam)throw new Error("Focus component requires OrbitCamera on the entity: "+this.getId());var e=this.getEngine(),t=this.getEntity();p.isMobile()?(this.listenTo(e,"touchStart",this.onMouseDown),this.listenTo(e,"touchMove",this.onMouseMove),this.listenTo(e,"touchEnd",this.onMouseUp),this.listenTo(e,"doubleTap",this.onDoubleClick)):(this.listenTo(e,"mouseScroll",this.interrupt),this.listenTo(e,"keyDown",this.interrupt),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseUp",this.onMouseUp),this.listenTo(e,"doubleClick",this.onDoubleClick)),this.listenTo(t,"resetOrbitCamera",this.onReset),this.zoomComponent=t.getComponentByScriptId("camera_zoom"),this.zoomComponent||(this.zoomComponent=t.addComponent("camera_zoom"))},t.prototype.onReset=function(){this.orbitCam.enable(),this.time=-1},t.prototype.onMouseDown=function(){this.isEnabled()&&(this.isMouseDown=!0)},t.prototype.onMouseUp=function(){this.isMouseDown=!1},t.prototype.onMouseMove=function(){this.isMouseDown&&this.interrupt()},t.prototype.onDoubleClick=function(e){if(this.isEnabled()&&this.hasRuntimeData()){this.raycaster||this.initializeRaycaster();var t=p.isMobile()?this.getInput().touchPositionPercent.x:e.scenePercentX,r=p.isMobile()?this.getInput().touchPositionPercent.y:e.scenePercentY;this.mouseVector.set(2*t-1,2*-r+1);var i=this.getIntersection(this.mouseVector);this.interrupt();var n=this.time>0?this.currentLook:this.orbitCam.pivotPoint.position;this.srcLook.copy(n),i?this.lookAtPoint(i.point):this.resetToOrigin(),this.time=this.speed,this.srcZoom=this.zoomComponent.getZoomLevel()}},t.prototype.lookAtPoint=function(e){this.orbitCam.disable(),this.targetLook.copy(e),-1===this.lastFocusPosition.x&&this.lastFocusPosition.copy(this.targetLook),this.targetLook.distanceTo(this.lastFocusPosition)<this.zoomBuffer&&this.stepZoom(),this.lastFocusPosition.copy(this.targetLook)},t.prototype.resetToOrigin=function(){this.targetLook.set(0,0,0),this.targetZoom=.5,this.lastFocusPosition.set(-1,-1,-1)},t.prototype.stepZoom=function(){var e=this.zoomComponent.getZoomLevel()-1/this.zoomSteps;this.targetZoom=Math.min(1,Math.max(0,e))},t.prototype.initializeRaycaster=function(){this.raycaster=new s.Raycaster,this.raycaster.near=0,this.mouseVector=new s.Vector2,this.targetLook=new s.Vector3,this.srcLook=new s.Vector3,this.currentLook=new s.Vector3},t.prototype.interrupt=function(){this.isEnabled()&&this.time>0&&this.onEnd()},t.prototype.onEnd=function(){this.time=-1,this.orbitCam.enable(),this.orbitCam.setPivotPosition(this.currentLook),this.orbitCam.setOrbitDistance(this.getRuntimeData().position.distanceTo(this.currentLook)),this.orbitCam.resetOrbitRotation()},t.prototype.getIntersection=function(e){this.raycaster.far=this.orbitCam.getOrbitDistance()+1,this.raycaster.setFromCamera(e,this.getRuntimeData());var t=this.raycaster.intersectObjects(this.getRootThreeObject().children,!0).filter(a);return t.length>0?t[0]:void 0},t}(u.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(37),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.position=new n.Vector2,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseScroll",this.onMouseScroll)},t.prototype.onMouseDown=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=e.scenePercentX,this.position.y=e.scenePercentY;var r=t?o.orbitEvents.startOrbit:void 0;r&&this.trigger(r,this.position)}},t.prototype.onMouseMove=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=t?e.scenePercentX:e.scenePercentDeltaX,this.position.y=t?e.scenePercentY:e.scenePercentDeltaY;var r=this.getInput().mouseButtonDown("right"),i=r?o.orbitEvents.pan:t?o.orbitEvents.orbit:void 0;i&&this.trigger(i,this.position)}},t.prototype.onMouseScroll=function(e){this.isEnabled()&&this.trigger(o.orbitEvents.zoom,e)},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(37),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOrbiting=!1,t.isPanning=!1,t.isZooming=!1,t.panMidpoint=new n.Vector2,t.lastPanMidpoint=new n.Vector2,t.panDelta=new n.Vector2,t.lastZoomDistance=0,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"touchStart",this.cancelActions),this.listenTo(e,"touchCancel",this.cancelActions),this.listenTo(e,"touchLeave",this.cancelActions),this.listenTo(e,"touchEnd",this.cancelActions),this.listenTo(e,"touchMove",this.onTouchMove)},t.prototype.cancelActions=function(){this.isOrbiting=!1,this.isPanning=!1,this.isZooming=!1,this.panMidpoint.set(0,0),this.lastPanMidpoint.set(0,0),this.panDelta.set(0,0),this.lastZoomDistance=0},t.prototype.onTouchMove=function(e){this.isEnabled()&&e.touches.length&&(1===e.touches.length?this.onSingleTouchMove(e.touches[0]):this.onMultiTouchMove(e.touches[0],e.touches[1]))},t.prototype.onSingleTouchMove=function(e){var t=new n.Vector2(e.scenePercentX,e.scenePercentY);this.isOrbiting?this.orbit(t):(this.isOrbiting=!0,this.startOrbit(t))},t.prototype.onMultiTouchMove=function(e,t){var r=new n.Vector2(e.scenePercentX,e.scenePercentY),i=new n.Vector2(t.scenePercentX,t.scenePercentY);this.pan(r,i),this.zoom(r,i)},t.prototype.startOrbit=function(e){this.trigger(o.orbitEvents.startOrbit,e)},t.prototype.orbit=function(e){this.trigger(o.orbitEvents.orbit,e)},t.prototype.pan=function(e,t){this.panMidpoint.addVectors(e,t),this.panMidpoint.multiplyScalar(.5),this.isPanning||(this.isPanning=!0,this.lastPanMidpoint.copy(this.panMidpoint)),this.panDelta.subVectors(this.panMidpoint,this.lastPanMidpoint),this.panDelta.length()&&this.trigger(o.orbitEvents.pan,this.panDelta),this.lastPanMidpoint.copy(this.panMidpoint),this.panDelta.set(0,0)},t.prototype.zoom=function(e,t){var r=e.distanceTo(t);if(r){this.isZooming||(this.isZooming=!0,this.lastZoomDistance=r);var i=r-this.lastZoomDistance;i&&this.trigger(o.orbitEvents.zoom,20*i),this.lastZoomDistance=r}},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(237),o=r(236),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("inputTexture")){var t=this.getPreviousAttribute("inputTexture"),r=this.getEngine().getAssetById(t);r&&(this.unregisterDependency(r),this.stopListening(r,"load",this.generateTexture)),this.inputTexture&&(this.registerDependency(this.inputTexture),this.listenTo(this.inputTexture,"load",this.generateTexture))}},t.prototype.onShutdown=function(){this.inputTexture&&this.unregisterDependency(this.inputTexture)},t.prototype.onEntityReady=function(){this.inputTexture&&this.inputTexture.isBaseLoaded()&&this.generateTexture()},t.prototype.generateTexture=function(){var e=this.getThreeRenderer(),t=new a.default(this.inputTexture.getThreeTexture());t.update(e);var r=new o.default(t.cubeLods);r.setDestinationTexture(this.getEntity().getRuntimeData()),r.update(e),t.dispose(),r.dispose()},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxScene=void 0,t.cameras=[null,null,null,null,null,null],t}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("inputTexture")){var t=this.getPreviousAttribute("inputTexture"),r=this.getEngine().getAssetById(t);r&&(this.unregisterDependency(r),this.stopListening(r,"load",this.updateTexture)),this.inputTexture&&(this.registerDependency(this.inputTexture),this.listenTo(this.inputTexture,"load",this.updateTexture))}},t.prototype.onStartup=function(){this.skyboxScene=new n.Scene,this.registerDependency(this.inputTexture),this.initCameras(),this.createSkybox()},t.prototype.onEntityReady=function(){this.inputTexture&&this.inputTexture.isBaseLoaded()&&this.updateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&this.unregisterDependency(this.inputTexture),this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.equirectMaterial&&this.equirectMaterial.dispose()},t.prototype.updateTexture=function(){this.inputTexture.isBaseUnloaded()&&this.inputTexture.load(),this.inputTexture.isBaseLoaded()&&this.getEntity().isBaseLoaded()&&this.renderToCube()},t.prototype.createSkybox=function(){var e=n.ShaderLib.equirect;this.equirectMaterial=new n.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:n.BackSide}),this.skyboxGeometry=new n.BoxGeometry(100,100,100,1,1,1),this.skyboxMesh=new n.Mesh(this.skyboxGeometry,this.equirectMaterial),this.skyboxMesh.frustumCulled=!1,this.skyboxMesh.castShadow=!1,this.skyboxMesh.receiveShadow=!1,this.isEnabled()&&this.skyboxScene.add(this.skyboxMesh)},t.prototype.initCameras=function(){this.cameras[0]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[0].up.set(0,-1,0),this.cameras[0].lookAt(new n.Vector3(1,0,0)),this.skyboxScene.add(this.cameras[0]),this.cameras[1]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[1].up.set(0,-1,0),this.cameras[1].lookAt(new n.Vector3(-1,0,0)),this.skyboxScene.add(this.cameras[1]),this.cameras[2]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[2].up.set(0,0,1),this.cameras[2].lookAt(new n.Vector3(0,1,0)),this.skyboxScene.add(this.cameras[2]),this.cameras[3]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[3].up.set(0,0,-1),this.cameras[3].lookAt(new n.Vector3(0,-1,0)),this.skyboxScene.add(this.cameras[3]),this.cameras[4]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[4].up.set(0,-1,0),this.cameras[4].lookAt(new n.Vector3(0,0,1)),this.skyboxScene.add(this.cameras[4]),this.cameras[5]=new n.PerspectiveCamera(90,1,1,1e3),this.cameras[5].up.set(0,-1,0),this.cameras[5].lookAt(new n.Vector3(0,0,-1)),this.skyboxScene.add(this.cameras[5])},t.prototype.renderToCube=function(){if(this.hasRuntimeData()){this.equirectMaterial.uniforms.tEquirect.value=this.inputTexture.getThreeTexture();var e=this.getRuntimeData(),t=this.getThreeRenderer();e.texture.generateMipmaps=!1,t.setViewport(0,0,e.width,e.height);for(var r=0;r<5;r++)e.activeCubeFace=r,t.render(this.skyboxScene,this.cameras[r],e);e.texture.generateMipmaps=this.getEntity().getProperty("useMipmap"),e.activeCubeFace=5,t.render(this.skyboxScene,this.cameras[5],e)}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s={"+X":new a.Vector3(1,0,0),"-X":new a.Vector3(-1,0,0),"+Y":new a.Vector3(0,1,0),"-Y":new a.Vector3(0,-1,0),"+Z":new a.Vector3(0,0,1),"-Z":new a.Vector3(0,0,-1)},u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.time=0,t.target=new a.Quaternion,t.tempQuat=new a.Quaternion,t}return i.__extends(t,e),t.prototype.getRightVector=function(e){return new a.Vector3(e.elements[0],e.elements[1],e.elements[2])},t.prototype.getUpVector=function(e){return new a.Vector3(e.elements[4],e.elements[5],e.elements[6])},t.prototype.getForwardVector=function(e){return new a.Vector3(e.elements[8],e.elements[9],e.elements[10])},t.prototype.setRightVector=function(e,t){e.elements[0]=t.x,e.elements[1]=t.y,e.elements[2]=t.z},t.prototype.setUpVector=function(e,t){e.elements[4]=t.x,e.elements[5]=t.y,e.elements[6]=t.z},t.prototype.setForwardVector=function(e,t){e.elements[8]=t.x,e.elements[9]=t.y,e.elements[10]=t.z},t.prototype.setAxes=function(e,t,r){var i=s[e],o=s[t];if(!i)return n.default.error("No Up Axis available For ",e);if(!o)return n.default.error("No Forward Axis available For ",t);var u=new a.Vector3,p=new a.Matrix4;this.setUpVector(p,i),this.setForwardVector(p,o),u.crossVectors(i,o),this.setRightVector(p,u),this.target.setFromRotationMatrix(p),r?this.time=this.speed:(this.setRotation(this.target),this.getEntity().trigger("axis_transition_complete"))},t.prototype.eulerFromObject=function(e){var t=isNaN(e.x)?0:.0174532925*e.x,r=isNaN(e.y)?0:.0174532925*e.y,i=isNaN(e.z)?0:.0174532925*e.z,n=new a.Euler(t,r,i);return n.order="YXZ",n},t.prototype.rotateOnWorldAxis=function(e,t,r){if(!(this.time>0)){var i=this.getRuntimeData(),n=new a.Vector3,o=new a.Vector3;n.copy(i.position),o.copy(i.scale),i.position.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix();var s=(new a.Matrix4).makeRotationX(.0174532925*(e.x||0)),u=(new a.Matrix4).makeRotationY(.0174532925*(e.y||0)),p=(new a.Matrix4).makeRotationZ(.0174532925*(e.z||0));p.multiply(u),p.multiply(s),t&&p.multiply(i.matrix),this.target.setFromRotationMatrix(p),r?(this.setRotation(this.target),this.getEngine().needsRender=!0):this.time=this.speed,i.position.copy(n),i.scale.copy(o)}},t.prototype.rotateToEuler=function(e){this.target.setFromEuler(this.eulerFromObject(e)),this.time=this.speed},t.prototype.setLocalRotation=function(e){this.time=0,this.target.setFromEuler(this.eulerFromObject(e)),this.setRotation(this.target)},t.prototype.setRotation=function(e){this.getEntity().setQuaternion(e.x,e.y,e.z,e.w),this.hasRuntimeData()&&!this.getRuntimeData().quaternion.equals(e)&&this.getRuntimeData().quaternion.copy(e),this.getEngine().needsRender=!0},t.prototype.getSign=function(e){return e>0?"+":"-"},t.prototype.getAxes=function(e){var t=this.getRuntimeData().matrix,r=this.getUpVector(t).normalize(),i=this.getForwardVector(t).normalize(),n=Math.abs(r.x),a=Math.abs(r.y),o=Math.abs(r.z),s=n<o?o<a?"y":"z":n<a?"y":"x";n=Math.abs(i.x),a=Math.abs(i.y),o=Math.abs(i.z);var u=n<o?o<a?"y":"z":n<a?"y":"x",p={up:(""+this.getSign(r[s])+s).toUpperCase(),forward:(""+this.getSign(i[u])+u).toUpperCase()};return e&&e(p),p},t.prototype.onStartup=function(){this.listenTo(this.getEngine(),"rotate_to",this.rotateToEuler),this.listenTo(this.getEngine(),"rotate_on_axis",this.rotateOnWorldAxis),this.listenTo(this.getEngine(),"set_local_rotation",this.setLocalRotation),this.listenTo(this.getEngine(),"set_axes",this.setAxes),this.listenTo(this.getEngine(),"get_axes",this.getAxes),this.listenTo(this.getEntity(),"rotate_to",this.rotateToEuler),this.listenTo(this.getEntity(),"rotate_on_axis",this.rotateOnWorldAxis),this.listenTo(this.getEntity(),"set_local_rotation",this.setLocalRotation),this.listenTo(this.getEntity(),"set_axes",this.setAxes),this.listenTo(this.getEntity(),"get_axes",this.getAxes)},t.prototype.onUpdate=function(e){this.time>=0&&this.hasRuntimeData()&&(this.time-=e,this.tempQuat.copy(this.getRuntimeData().quaternion),this.tempQuat.slerp(this.target,Math.min(1,Math.max(0,1-1/(this.speed/this.time)))),this.getEntity().setQuaternion(this.tempQuat.x,this.tempQuat.y,this.tempQuat.z,this.tempQuat.w),this.getEngine().needsRender=!0,this.time<0&&(this.setRotation(this.target),this.getEntity().trigger("axis_transition_complete")))},t}(o.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.framesElapsed=0,t.reflectionNormal=new n.Vector3(0,1,0),t.reflectionPlane=new n.Plane,t.clipPlane=new n.Vector4,t.reflectionPosition=new n.Vector3,t.cameraWorldPosition=new n.Vector3,t.rotationMatrix=new n.Matrix4,t.lookAtPosition=new n.Vector3(0,0,-1),t.up=new n.Vector3(0,1,0),t.perspectiveCamera=null,t.orthoCamera=null,t}return i.__extends(t,e),t.prototype.captureScene=function(e,t){if(!t)throw new Error("Call to ReflectionCapture.captureScene without specifying a camera.");this.updateReflection(t);var r=this.captureTexture?this.captureTexture.runtimeData:null,i=r||this.tempRenderTexture.runtimeData;this.getRenderer().renderView(e,this.reflectionCamera,{renderTarget:i,clearDepth:!0,enableShadows:!1,enablePreRenderFunctions:!1})},t.prototype.onEntityReady=function(){this.initCameras(),this.initTexture()},t.prototype.onAttributesChanged=function(e){-1===e.indexOf("captureTexture")||this.getEntity().isUnloaded()||this.initTexture()},t.prototype.onPreRenderView=function(e,t){this.isEnabled()&&(this.framesElapsed>=this.updateFrameInterval?(this.captureScene(e,t),this.framesElapsed=0):this.framesElapsed++)},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTexture2d({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_reflection"),this.tempRenderTexture.load()},t.prototype.initTexture=function(){var e=this;this.captureTexture?(this.captureTexture.when("load",function(){e.tempRenderTexture&&e.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.createTempRenderTexture()},t.prototype.initCameras=function(){this.captureTexture&&this.captureTexture.load(),this.perspectiveCamera=new n.PerspectiveCamera,this.orthoCamera=new n.OrthographicCamera(-1,1,-1,1)},t.prototype.updateReflection=function(e){if(this.isEnabled()){var t=function(e){return e<0?-1:1};this.getEntity().runtimeData.updateMatrixWorld(),e.updateMatrixWorld(!1),this.reflectionPosition.setFromMatrixPosition(this.getEntity().runtimeData.matrixWorld),this.cameraWorldPosition.setFromMatrixPosition(e.matrixWorld),this.rotationMatrix.extractRotation(this.getEntity().runtimeData.matrixWorld),this.reflectionNormal.set(0,1,0),this.reflectionNormal.applyMatrix4(this.rotationMatrix);var r=this.reflectionPosition.clone().sub(this.cameraWorldPosition),i=r.reflect(this.reflectionNormal).negate();i.add(this.reflectionPosition),this.rotationMatrix.extractRotation(e.matrixWorld),this.lookAtPosition.set(0,0,-1),this.lookAtPosition.applyMatrix4(this.rotationMatrix),this.lookAtPosition.add(this.cameraWorldPosition);var a=this.reflectionPosition.clone().sub(this.lookAtPosition),o=a.reflect(this.reflectionNormal).negate();o.add(this.reflectionPosition),this.up.set(0,-1,0),this.up.applyMatrix4(this.rotationMatrix);var s=this.up.reflect(this.reflectionNormal).negate();if(e instanceof n.PerspectiveCamera&&this.perspectiveCamera)this.perspectiveCamera.aspect=e.aspect,this.perspectiveCamera.fov=e.fov,this.perspectiveCamera.near=e.near,this.perspectiveCamera.far=e.far,this.reflectionCamera=this.perspectiveCamera;else{if(!(e instanceof n.OrthographicCamera&&this.orthoCamera))return;this.orthoCamera.left=e.left,this.orthoCamera.right=e.right,this.orthoCamera.top=e.top,this.orthoCamera.bottom=e.bottom,this.orthoCamera.near=e.near,this.orthoCamera.far=e.far,this.reflectionCamera=this.orthoCamera}this.reflectionCamera.position.copy(i),this.reflectionCamera.up=s,this.reflectionCamera.lookAt(o),this.reflectionCamera.updateProjectionMatrix(),this.reflectionCamera.updateMatrixWorld(!1),this.reflectionCamera.matrixWorldInverse.getInverse(this.reflectionCamera.matrixWorld),this.reflectionPlane.setFromNormalAndCoplanarPoint(this.reflectionNormal,this.reflectionPosition),this.reflectionPlane.applyMatrix4(this.reflectionCamera.matrixWorldInverse),this.clipPlane.set(this.reflectionPlane.normal.x,this.reflectionPlane.normal.y,this.reflectionPlane.normal.z,this.reflectionPlane.constant);var u=new n.Vector4,p=this.reflectionCamera.projectionMatrix;p.copy(e.projectionMatrix),p.elements[8]*=-1,u.x=(t(this.clipPlane.x)+p.elements[8])/p.elements[0],u.y=(t(this.clipPlane.y)+p.elements[9])/p.elements[5],u.z=-1,u.w=(1+p.elements[10])/p.elements[14];var c=this.clipPlane.multiplyScalar(2/this.clipPlane.dot(u));p.elements[2]=c.x,p.elements[6]=c.y,p.elements[10]=c.z+1-this.clipBias,p.elements[14]=c.w}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(15),o=r(11),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.instance=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"createRemoteInstance",this.createRemoteInstance),this.listenTo(this.getGlobalEvents(),"createRemoteInstance",this.createRemoteInstance)},t.prototype.createRemoteInstance=function(e){var t=this;if(this.isEnabled()){var r=this.getEngine();r.fetchRemoteRepresentationsFromBox(e).then(function(i){var n=i.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json");r.resourceLoader.load(n,a.default.ENTITIES,{}).on(o.default.LOAD,function(i){var n=i.filter(function(e){return"prefab"===e.type}),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)});a.length||(r.addEntities(i),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)})),t.recreateInstance(a,e)})})}},t.prototype.recreateInstance=function(e,t){var r=this,i=this.getEngine();if(this.instance&&(this.instance.destroy(),this.instance=null),e.length>1)this.instance=i.createNode(),e.forEach(function(e){var t=i.getAssetById(e.id);r.instance.addChild(t.createInstance())});else{var n=i.getAssetById(e[0].id);this.instance=n.createInstance()}this.instance&&this.getEntity().addChild(this.instance),this.getEntity().trigger("remoteInstanceCreated",t),this.getGlobalEvents().trigger("remoteInstanceCreated",t)},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(2),s=r(18),u=r(5),p=r(195),c=r(14),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.threeRenderer=null,t.caps={},t.antialias=!1,t.preserveDrawingBuffer=!0,t.precision="highp",t.autoClear=!1,t.devicePixelRatio=1,t.shadowsEnabled=!0,t.shadowsEnabledMobile=!1,t.shadowType=n.PCFSoftShadowMap,t.shadowReverseSided=!1,t.maxTextureSize2d=Number.MAX_SAFE_INTEGER,t.maxTextureSizeCube=Number.MAX_SAFE_INTEGER,t.clearColor=new n.Color,t.clearAlpha=0,t.renderOnDemand=!0,t}return i.__extends(t,e),t.prototype.onAwake=function(){this.canvas=this.getEngine().canvas,this.initDefaultRenderer(),this.getEngine().setRenderer(this);var e=this.getThreeRenderer();e.gammaInput=!1,e.gammaOutput=!0},t.prototype.onStartup=function(){this.listenTo(this.getEngine(),"resize",this.onContainerResize),this.getEngine().renderOnDemand=this.renderOnDemand,this.shadowsEnabledMobile||(this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled),this.applyRenderSettings()},t.prototype.onShutdown=function(){this.threeRenderer&&(this.threeRenderer.context=null),this.threeRenderer=null,this.canvas=void 0},t.prototype.onAttributesChanged=function(e){var t=!1;-1!==e.indexOf("shadowsEnabledMobile")&&(t=!0),this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled,this.applyRenderSettings(),this.getEngine().renderOnDemand=this.renderOnDemand,-1!==e.indexOf("clearAlpha")&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),-1!==e.indexOf("clearColor")&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),-1!==e.indexOf("gammaOutput")&&(t=!0),-1!==e.indexOf("gammaInput")&&(t=!0),-1!==e.indexOf("shadowsEnabled")&&(t=!0),-1!==e.indexOf("shadowType")&&(this.shadowType=parseInt(String(this.shadowType),10),t=!0),-1!==e.indexOf("devicePixelRatio")&&this.onContainerResize(),t&&(a.default.info("Rebuilding materials!!!"),this.getEngine().trigger("rebuildMaterials"))},t.prototype.getGPUCapability=function(e){return this.caps[e]},t.prototype.getMaxTextureSize2d=function(){return this.maxTextureSize2d?Math.min(this.maxTextureSize2d,this.getGPUCapability("MAX_TEXTURE_SIZE")):this.getGPUCapability("MAX_TEXTURE_SIZE")},t.prototype.getMaxTextureSizeCube=function(){return this.maxTextureSizeCube?Math.min(this.maxTextureSizeCube,this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")):this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")},t.prototype.onPreRender=function(){this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(!0,!0,!0),this.threeRenderer.setViewport(0,0,this.getWidth(),this.getHeight())},t.prototype.renderView=function(e,t,r){void 0===r&&(r={});var i;if(t){r.enablePreRenderFunctions&&this.getEngine().trigger("preRenderView",e,t,r);var n=this.getCanvas().style;void 0===r.opacity||r.viewPort&&(r.viewPort.width!==this.getWidth()||r.viewPort.height!==this.getHeight())?1!==parseFloat(n.opacity)&&(n.opacity="1.0"):parseFloat(n.opacity)!==r.opacity&&(n.opacity=""+r.opacity),r.renderTarget?this.threeRenderer.setRenderTarget(r.renderTarget):this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(r.clearColor,r.clearDepth,r.clearStencil),r.viewPort&&(i=c.default.sharedUniforms.screenDimensions,i.value.x=r.viewPort.x,i.value.y=r.viewPort.y,i.value.z=r.viewPort.width*this.devicePixelRatio,i.value.w=r.viewPort.height*this.devicePixelRatio,this.threeRenderer.setViewport(r.viewPort.x,r.viewPort.y,r.viewPort.width,r.viewPort.height));var a=r.effect?r.effect:this.threeRenderer;r.renderTarget?a.render(e,t,r.renderTarget,!1):a.render(e,t),this.getEngine().trigger("postRenderView",e,t,r)}},t.prototype.getWidth=function(){return this.canvas.clientWidth?this.canvas.clientWidth:this.canvas.width/this.devicePixelRatio},t.prototype.getHeight=function(){return this.canvas.clientHeight?this.canvas.clientHeight:this.canvas.height/this.devicePixelRatio},t.prototype.getCanvasWidth=function(){return this.canvas.width},t.prototype.getCanvasHeight=function(){return this.canvas.height},t.prototype.getCanvas=function(){return this.threeRenderer.domElement},t.prototype.onContainerResize=function(){if(this.canvas.parentElement){var e=this.canvas.parentElement.clientWidth,t=this.canvas.parentElement.clientHeight;if(this.threeRenderer.setPixelRatio(this.devicePixelRatio),s.isIOS()){var r=this.canvas;this.threeRenderer.setSize(e,t,!1),r.style.width=e+1+"px",r.style.height=t+1+"px",setTimeout(function(){r.style.width=e+"px",r.style.height=t+"px"},100)}else this.threeRenderer.setSize(e,t,!0);this.getEngine().trigger("rendererResize")}else{var i=this.canvas.width/this.devicePixelRatio,n=this.canvas.height/this.devicePixelRatio;this.threeRenderer.setPixelRatio(this.devicePixelRatio),this.threeRenderer.setSize(i,n,!0)}},t.prototype.storeGpuCaps=function(){var e=this.threeRenderer.getContext();a.default.info("WebGL VENDOR is "+e.getParameter(e.VENDOR)),a.default.info("WebGL SHADING_LANGUAGE_VERSION is "+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.default.info("WebGL RENDERER is "+e.getParameter(e.RENDERER));var t=e.FRAGMENT_SHADER,r=e.LOW_FLOAT,i=e.MEDIUM_FLOAT,n=e.HIGH_FLOAT,o=e.getShaderPrecisionFormat(t,r);if(a.default.info("Fragment Shader lowp is "+o.precision),o=e.getShaderPrecisionFormat(t,i),a.default.info("Fragment Shader mediump is "+o.precision),o=e.getShaderPrecisionFormat(t,n),a.default.info("Fragment Shader highp is "+o.precision),!navigator.isCocoonJS){this.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_CUBE_MAP_TEXTURE_SIZE=0,this.caps.MAX_FRAGMENT_UNIFORM_VECTORS=0,this.caps.MAX_RENDERBUFFER_SIZE=0,this.caps.MAX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_TEXTURE_SIZE=0,this.caps.MAX_VARYING_VECTORS=0,this.caps.MAX_VERTEX_ATTRIBS=0,this.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_VERTEX_UNIFORM_VECTORS=0,this.caps.MAX_VIEWPORT_DIMS=0,this.caps.ALIASED_POINT_SIZE_RANGE=0,this.caps.ALIASED_LINE_WIDTH_RANGE=0,this.caps.SAMPLES=0,this.caps.SAMPLE_BUFFERS=0,this.caps.RED_BITS=0,this.caps.GREEN_BITS=0,this.caps.BLUE_BITS=0,this.caps.ALPHA_BITS=0,this.caps.DEPTH_BITS=0,this.caps.STENCIL_BITS=0,this.caps.SUBPIXEL_BITS=0,this.caps.COMPRESSED_TEXTURE_FORMATS=0,this.caps=u.map(this.caps,function(t,r){return e.getParameter(e[r])}),this.caps.EXTENSIONS=e.getSupportedExtensions();var s=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");this.caps.maxAnisotropy=s?e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,a.default.info("GPU Capabilities:",this.caps)}},t.prototype.initDefaultRenderer=function(){if(!p.default.isWebGLEnabled())throw new Error("WebGL is not supported, no fallbacks available.");this.threeRenderer=new n.WebGLRenderer({canvas:this.canvas,antialias:this.antialias,preserveDrawingBuffer:this.preserveDrawingBuffer,alpha:!0,precision:this.precision,logarithmicDepthBuffer:this.logarithmicDepthBuffer}),this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(this.devicePixelRatio>0?this.devicePixelRatio:window.devicePixelRatio),this.storeGpuCaps()},t.prototype.applyRenderSettings=function(){var e=this;this.threeRenderer&&(u.forEach(this,function(t,r){void 0!==e.threeRenderer[r]&&(e.threeRenderer[r]=t)}),this.devicePixelRatio>0||(this.devicePixelRatio=window.devicePixelRatio),this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),this.shadowsEnabled&&(this.threeRenderer.shadowMap.enabled=!0,this.threeRenderer.shadowMap.type=this.shadowType,this.threeRenderer.shadowMap.renderReverseSided=this.shadowReverseSided))},t}(o.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=new n.Vector3,u=new n.Euler,p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.quaternion=new n.Quaternion,t.currentGlobalQuaternion=new n.Quaternion,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.rotate=this.autoRotate,this.getEntity().on("startRotate",this.onStartRotate,this),this.getEntity().on("stopRotate",this.onStopRotate,this),this.getEntity().on("toggleRotate",this.onToggleRotate,this)},t.prototype.onShutdown=function(){this.getEntity().off("startRotate",this.onStartRotate,this),this.getEntity().off("stopRotate",this.onStopRotate,this),this.getEntity().off("toggleRotate",this.onToggleRotate,this)},t.prototype.onEnable=function(){this.rotate=this.autoRotate,this.initRotation()},t.prototype.onDisable=function(){var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()),this.rotate=!1)},t.prototype.onAttributesChanged=function(e){e.indexOf("rotation")&&this.rotation&&this.initRotation()},t.prototype.onEntityReady=function(){this.initialQuaternion=new n.Quaternion,this.initialQuaternion.copy(this.getRuntimeData().quaternion),this.initRotation()},t.prototype.onUpdate=function(e){this.rotate&&this.isEnabled()&&(this.getEngine().needsRender=!0,this.getRuntimeData()&&this.rotation&&(s.copy(this.rotation).multiplyScalar(e),u.set(s.x,s.y,s.z),this.quaternion.setFromEuler(u),this.local?this.getRuntimeData().quaternion.multiply(this.quaternion):(this.currentGlobalQuaternion.multiply(this.quaternion),this.getRuntimeData().quaternion.multiplyQuaternions(this.currentGlobalQuaternion,this.initialQuaternion))))},t.prototype.initRotation=function(){u.set(this.rotation.x,this.rotation.y,this.rotation.z),this.local?this.getRuntimeData().quaternion.copy(this.initialQuaternion):this.currentGlobalQuaternion.set(0,0,0,1)},t.prototype.onStartRotate=function(){this.rotate=!0},t.prototype.onStopRotate=function(){this.rotate=!1},t.prototype.onToggleRotate=function(){this.rotate=!this.rotate},t}(a.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertiesChanged),this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onAttributesChanged=function(e){-1!==e.indexOf("size")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onDisable=function(){this.getEntity().setScale(1,1,1)},t.prototype.onEnable=function(){this.getEntity().scaleToSize(this.size)},t.prototype.onPropertiesChanged=function(e){e.hasOwnProperty("bounds")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(249),s=r(248),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autoLoad=!0,t.uniforms=null,t.noiseMat=null,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"changeNoiseValues",this.changeNoiseValues),this.listenTo(this.getEntity(),"renderNoise",this.changeNoiseValues),this.uniforms={time:{type:"f",value:1},scale:{type:"v2",value:this.scale},offset:{type:"v2",value:this.offset},layerAmplitude:{type:"v4",value:this.layerAmplitude},layerScale:{type:"v4",value:this.layerScale}},this.noiseMat=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:o,fragmentShader:s}),this.cameraRTT=new n.OrthographicCamera(-.5,.5,.5,-.5,-10,10),this.cameraRTT.position.z=1,this.sceneRTT=new n.Scene,this.sceneRTT.add(this.cameraRTT),this.quadGeo=new n.PlaneGeometry(1,1),this.quadRTT=new n.Mesh(this.quadGeo,this.noiseMat),this.quadRTT.position.z=-5,this.sceneRTT.add(this.quadRTT),this.initialized=!0},t.prototype.onShutdown=function(){this.sceneRTT&&(this.sceneRTT.remove(this.cameraRTT),this.sceneRTT.remove(this.quadRTT)),this.sceneRTT=void 0,this.quadRTT=void 0,this.quadGeo&&this.quadGeo.dispose(),this.noiseMat&&this.noiseMat.dispose(),this.uniforms=void 0},t.prototype.onEntityReady=function(){this.autoLoad&&this.renderNoise()},t.prototype.onAttributesChanged=function(e){this.initialized&&(-1!==e.indexOf("scale")&&void 0!==this.scale.x&&(this.uniforms.scale.value.x=this.scale.x,this.uniforms.scale.value.y=this.scale.y),-1!==e.indexOf("offset")&&void 0!==this.offset.x&&(this.uniforms.offset.value.x=this.offset.x,this.uniforms.offset.value.y=this.offset.y),-1!==e.indexOf("layerScale")&&void 0!==this.layerScale.x&&(this.uniforms.layerScale.value.x=this.layerScale.x,this.uniforms.layerScale.value.y=this.layerScale.y,this.uniforms.layerScale.value.z=this.layerScale.z,this.uniforms.layerScale.value.w=this.layerScale.w),-1!==e.indexOf("layerAmplitude")&&void 0!==this.layerAmplitude.x&&(this.uniforms.layerAmplitude.value.x=this.layerAmplitude.x,this.uniforms.layerAmplitude.value.y=this.layerAmplitude.y,this.uniforms.layerAmplitude.value.z=this.layerAmplitude.z,this.uniforms.layerAmplitude.value.w=this.layerAmplitude.w),this.renderNoise())},t.prototype.renderNoise=function(){this.getThreeRenderer().render(this.sceneRTT,this.cameraRTT,this.getRuntimeData(),!0),this.getThreeRenderer().setRenderTarget(null)},t.prototype.changeNoiseValues=function(e,t,r,i){this.layerAmplitude=e,this.layerScale=t,this.scale=r,this.offset=i,this.onAttributesChanged(["layerAmplitude","layerScale","scale","offset"])},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(12),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxTexture=null,t.stereoEnabled=!1,t.size=100,t.skyboxMesh=null,t.skyboxMeshRightEye=null,t.skyboxGeometry=null,t.skyboxGeometryRightEye=null,t.skyboxMaterialCube=null,t.skyboxUniforms=null,t.skyboxVShader=null,t.skyboxPShader=null,t.skyboxMaterial2D=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initMaterials()},t.prototype.onShutdown=function(){this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye&&this.skyboxGeometryRightEye.dispose(),this.skyboxMaterialCube&&this.skyboxMaterialCube.dispose(),this.skyboxMaterial2D&&this.skyboxMaterial2D.dispose(),this.skyboxMesh=null,this.skyboxGeometry=null,this.skyboxGeometryRightEye=null,this.skyboxMaterialCube=null,this.skyboxMaterial2D=null,this.skyboxUniforms=null,this.skyboxTexture=null},t.prototype.getMesh=function(e){return void 0===e&&(e="left"),"left"===e?this.skyboxMesh:this.skyboxMeshRightEye},t.prototype.onAttributesChanged=function(e){if(-1!==e.indexOf("skyboxTexture")){var t=this.getPreviousAttribute("skyboxTexture");if(t){var r=this.getEngine().getEntityById(t);this.stopListening(r)}this.getEntity().unregisterDependencyById(this.getPreviousAttribute("skyboxTexture"));this.getEntity().getOwnDependencyInfo()[this.getAttribute("skyboxTexture")]||this.getEntity().registerDependencyById(this.getAttribute("skyboxTexture"))}this.getEntity().isBaseLoaded()&&(-1===e.indexOf("skyboxTexture")&&-1===e.indexOf("stereoEnabled")||this.initSkybox(),-1!==e.indexOf("size")&&this.skyboxMesh&&(this.skyboxMesh.scale.set(this.size,this.size,this.size),this.skyboxMeshRightEye.scale.set(this.size,this.size,this.size)))},t.prototype.onEnable=function(){this.getRuntimeData()&&(this.getRuntimeData().add(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().add(this.skyboxMeshRightEye),this.skyboxTexture&&this.skyboxTexture.isUnloaded()&&this.skyboxTexture.load())},t.prototype.onDisable=function(){this.getRuntimeData()&&(this.getRuntimeData().remove(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().remove(this.skyboxMeshRightEye))},t.prototype.onEntityReady=function(){this.initSkybox()},t.prototype.isStereo=function(){if(!this.skyboxTexture||!this.stereoEnabled)return!1;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:case o.ImageLayout.Stereo2dUnderOver:case o.ImageLayout.Stereo2dLeftRight:case o.ImageLayout.Stereo2dRightLeft:return this.stereoEnabled;default:return!1}},t.prototype.initGeometry=function(){this.skyboxGeometry&&(this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye.dispose()),this.skyboxGeometry=new n.SphereBufferGeometry(1,64,64),this.skyboxGeometryRightEye=this.skyboxGeometry.clone()},t.prototype.initStereoUvs=function(){if(this.skyboxTexture){var e=new n.Vector2,t=new n.Vector2,r=new n.Vector2,i=new n.Vector2;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:e.set(1,.5),t.set(0,0),r.set(1,.5),i.set(0,.5);break;case o.ImageLayout.Stereo2dUnderOver:e.set(1,.5),t.set(0,.5),r.set(1,.5),i.set(0,0);break;case o.ImageLayout.Stereo2dLeftRight:e.set(.5,1),t.set(0,0),r.set(.5,1),i.set(.5,0);break;case o.ImageLayout.Stereo2dRightLeft:e.set(.5,1),t.set(.5,0),r.set(.5,1),i.set(0,0);break;default:return}for(var a=this.skyboxGeometry.getAttribute("uv").array,s=this.skyboxGeometryRightEye.getAttribute("uv").array,u=0;u<a.length;u+=2)a[u]*=e.x,a[u+1]*=e.y,a[u]+=t.x,a[u+1]+=t.y,s[u]*=r.x,s[u+1]*=r.y,s[u]+=i.x,s[u+1]+=i.y}},t.prototype.initMesh=function(){this.skyboxMesh&&this.getRuntimeData().remove(this.skyboxMesh),this.skyboxMeshRightEye&&this.getRuntimeData().remove(this.skyboxMeshRightEye),this.skyboxMesh=new n.Mesh(this.skyboxGeometry,this.currentMaterial),this.skyboxMesh.frustumCulled=!1,this.skyboxMesh.castShadow=!1,this.skyboxMesh.receiveShadow=!1,this.skyboxMesh.matrixAutoUpdate=!0,this.skyboxMesh.name="Skybox",this.skyboxMesh.rotation.y=Math.PI/2,this.skyboxMesh.rotation.z=-Math.PI,this.skyboxMesh.scale.set(-this.size,-this.size,-this.size),this.skyboxMeshRightEye=this.skyboxMesh.clone(),this.skyboxMeshRightEye.geometry=this.skyboxGeometryRightEye,this.skyboxMeshRightEye.layers.set(2),this.isEnabled()&&(this.getRuntimeData().add(this.skyboxMesh),this.skyboxMesh.updateMatrix())},t.prototype.initSkybox=function(){this.currentMaterial=this.skyboxMaterial2D,this.currentMaterial.needsUpdate=!0,this.skyboxTexture?"textureCube"!==this.skyboxTexture.type&&"renderTextureCube"!==this.skyboxTexture.type||(this.currentMaterial=this.skyboxMaterialCube):(this.currentMaterial.map=null,this.currentMaterial.needsUpdate=!0),this.initGeometry(),this.initMesh(),this.initStereoUvs(),this.isStereo()?(this.skyboxMesh.layers.set(1),this.getRuntimeData().add(this.skyboxMeshRightEye)):(this.skyboxMesh.layers.set(0),this.getRuntimeData().remove(this.skyboxMeshRightEye)),this.skyboxTexture&&(this.listenTo(this.skyboxTexture,"load",this.onSkyboxTextureLoad),this.skyboxTexture.isLoaded()&&this.onSkyboxTextureLoad(),this.isEnabled()&&this.skyboxTexture.isUnloaded()&&this.skyboxTexture.load())},t.prototype.onSkyboxTextureLoad=function(){this.currentMaterial instanceof n.MeshBasicMaterial?(this.currentMaterial.map=this.skyboxTexture.getThreeTexture(),this.currentMaterial.needsUpdate=!0):(this.currentMaterial.uniforms.envMap.value=this.skyboxTexture.getThreeTexture(),this.currentMaterial.needsUpdate=!0)},t.prototype.initMaterials=function(){this.skyboxUniforms=n.UniformsUtils.merge([{envMap:{type:"t",value:null}}]),this.skyboxVShader=["varying vec3 vCameraVector;","void main() {","vCameraVector = (modelMatrix * vec4( position, 1.0 )).xyz;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),this.skyboxPShader=["uniform samplerCube envMap;","varying vec3 vCameraVector;","void main() {","vec3 cameraVecN = normalize( vCameraVector );","vec4 environmentColor = textureCube(envMap, vec3(cameraVecN.x, cameraVecN.yz));","gl_FragColor = vec4( environmentColor.xyz, 1.0 );","}"].join("\n"),this.skyboxMaterialCube=new n.ShaderMaterial({vertexShader:this.skyboxVShader,fragmentShader:this.skyboxPShader,uniforms:this.skyboxUniforms,depthTest:!0,depthWrite:!1}),this.skyboxMaterial2D=new n.MeshBasicMaterial({depthTest:!1,depthWrite:!1})},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=e.call(this)||this;return t.material=null,t.canvas=null,t.mesh=null,t.camera=null,t.scene=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.createLabel()},t.prototype.onEntityReady=function(){this.renderText()},t.prototype.onShutdown=function(){this.material&&this.material.dispose(),this.geometry&&this.geometry.dispose(),this.mesh=null},t.prototype.onAttributesChanged=function(e){this.getEntity().isBaseLoaded()&&(this.createLabel(),this.renderText())},t.prototype.createLabel=function(){var e=this.text,t=this.pointSize,r="#"+this.fontColor.getHexString();this.canvas||(this.canvas=document.createElement("canvas"));var i=t+"pt "+this.fontFamily,a=this.canvas.getContext("2d");a.font=i,this.canvas.width=this.getEntity().getWidth(),this.canvas.height=this.getEntity().getHeight(),a.font=t+"pt "+this.fontFamily,a.textAlign="left",a.textBaseline="hanging",a.fillStyle=r,this.wrapAndRender(a,e,.5*this.pointSize,.5*this.pointSize,this.canvas.width-.5*this.pointSize,1.5*this.pointSize);var o=new n.Texture(this.canvas);o.mapping=null,o.generateMipmaps=!0,o.magFilter=n.LinearFilter,o.minFilter=n.LinearMipMapLinearFilter,o.needsUpdate=!0,this.material&&this.material.dispose(),this.material=new n.MeshBasicMaterial({map:o}),this.material.side=n.DoubleSide,this.geometry&&this.geometry.dispose(),this.geometry=new n.PlaneGeometry(this.canvas.width,this.canvas.height),this.mesh&&(this.scene.remove(this.mesh),this.mesh=null),this.mesh=new n.Mesh(this.geometry,this.material),this.mesh.position.z=0;var s=.5*this.canvas.width,u=.5*this.canvas.height;this.camera||(this.camera=new n.OrthographicCamera(-s,s,-u,u,-10,1e3)),this.camera.position.z=10,this.camera.rotation.z=Math.PI,this.camera.left=s,this.camera.right=-s,this.camera.top=u,this.camera.bottom=-u,this.camera.updateProjectionMatrix(),this.scene||(this.scene=new n.Scene,this.scene.add(this.camera)),this.scene.add(this.mesh)},t.prototype.renderText=function(){this.text||(this.text=" "),this.getThreeRenderer().render(this.scene,this.camera,this.getRuntimeData())},t.prototype.wrapAndRender=function(e,t,r,i,n,a){var o=t.split(" "),s="",u=i;o.forEach(function(t,i){var o=s+t+" ";e.measureText(o).width>n&&i>0?(e.fillText(s,r,u),s=t+" ",u+=a):s=o}),e.fillText(s,r,u)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.standing=!0,t.userHeight=6,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.standingMatrix=new n.Matrix4,t.workVector=new n.Vector3,t.scale=1,t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&this.hasRuntimeData()){var t=this.getEngine(),r=t.getVrDisplay();if(r){t.needsRender=!0,r.getFrameData(this.frameData);var i=this.frameData.pose,n=this.getRuntimeData(),a=this.getEntity();null!==i.orientation&&(a.setQuaternion(i.orientation[0],i.orientation[1],i.orientation[2],i.orientation[3]),r.capabilities.hasPosition&&i.position&&a.setPosition(i.position[0],i.position[1],i.position[2]),this.standing&&r.stageParameters?(n.updateMatrix(),this.standingMatrix.fromArray(r.stageParameters.sittingToStandingTransform),n.applyMatrix(this.standingMatrix),a.setQuaternion(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),n.position.multiplyScalar(this.scale),a.setPosition(n.position.x,n.position.y,n.position.z)):(a.getPosition(this.workVector),this.workVector.multiplyScalar(this.scale),a.setPosition(this.workVector.x,this.workVector.y,this.workVector.z)))}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(18),o=r(3),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scale=1,t.isPresenting=!1,t.wasPresenting=!1,t.vrDisplays=null,t.previousPixelRatio=1,t}return i.__extends(t,e),t.prototype.getScale=function(){return this.scale},t.prototype.setScale=function(e){this.scale=e},t.prototype.getDisplays=function(){return this.vrDisplays},t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"enableVrRendering",this.onEnableVr),this.listenTo(this.getEngine(),"disableVrRendering",this.onDisableVr),this.listenTo(this.getEngine(),"toggleVrRendering",this.onToggleVr),this.onVrDisplayPresentChange=this.onVrDisplayPresentChange.bind(this),window.addEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1),navigator.getVRDisplays?navigator.getVRDisplays().then(function(t){e.vrDisplays=t,e.trigger("displaysInitialized")}):this.vrDisplays=[]},t.prototype.onShutdown=function(){e.prototype.onShutdown.call(this),window.removeEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1)},t.prototype.onDisable=function(){this.isPresenting&&this.onDisableVr()},t.prototype.whenDisplaysAvailable=function(e){var t=this;this.vrDisplays?e.call(this,this.vrDisplays):this.listenToOnce(this,"displaysInitialized",function(){e.call(t,t.vrDisplays)})},t.prototype.onPostRender=function(e){var t=this.getEngine().getVrDisplay();t&&this.isPresenting&&t.submitFrame()},t.prototype.onEnableVr=function(){if(this.isEnabled()){if(!this.vrDisplays)return void this.listenToOnce(this,"displaysInitialized",this.onEnableVr.bind(this));if(this.vrDisplays.length){var e=this.vrDisplays[0];this.getEngine().setVrDisplay(e);var t=this.getRenderer().getCanvas();e.requestPresent([{source:t}]).catch(function(e){o.default.error("Failed to present to VR display",e.message)})}}},t.prototype.onDisableVr=function(){if(this.isPresenting){var e=this.getEngine().getVrDisplay();e&&(e.exitPresent(),this.getEngine().setVrDisplay(null))}},t.prototype.onToggleVr=function(){this.isPresenting?this.onDisableVr():this.onEnableVr()},t.prototype.onVrDisplayPresentChange=function(){this.wasPresenting=this.isPresenting;var e=this.getEngine().getVrDisplay();this.isPresenting=e&&e.isPresenting;var t=this.getThreeRenderer();if(this.isPresenting){var r=e.getEyeParameters("left"),i=r.renderWidth,n=r.renderHeight;if(!this.wasPresenting){if(this.previousPixelRatio=t.getPixelRatio(),a.isMobile()){var o=t.capabilities.maxTextureSize,s=2*i;s*this.previousPixelRatio>o&&(this.previousPixelRatio=Math.floor(o/s)),t.setPixelRatio(this.previousPixelRatio)}else t.setPixelRatio(1);t.setSize(2*i,n,!1),this.getEngine().trigger("vrRenderingEnabled")}}else this.wasPresenting&&(t.setPixelRatio(this.previousPixelRatio),this.getEngine().setVrDisplay(null),this.getEngine().trigger("resize"),this.getEngine().trigger("vrRenderingDisabled"))},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(38),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enablePreRenderFunctions=!0,t.enableShadows=!0,t.eyeTranslationL=new n.Vector3,t.eyeTranslationR=new n.Vector3,t.defaultLeftBounds=[0,0,.5,1],t.defaultRightBounds=[.5,0,.5,1],t.renderRectL={x:0,y:0,width:256,height:256},t.renderRectR={x:128,y:0,width:256,height:256},t.cameraL=new n.PerspectiveCamera,t.cameraR=new n.PerspectiveCamera,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.scale=1,t}return i.__extends(t,e),t.prototype.renderView=function(t){if(this.isEnabled()&&this.hasRuntimeData()){var r=this.getRootObject();if(r.isBaseLoaded()){var i=r.getRuntimeData(),n=this.getEngine().getVrDisplay();if(!n)return e.prototype.renderView.call(this,t);var a=i.autoUpdate;a&&(i.updateMatrixWorld(),i.autoUpdate=!1);var o=n.getEyeParameters("left"),s=n.getEyeParameters("right");this.eyeTranslationL.fromArray(o.offset),this.eyeTranslationR.fromArray(s.offset);var u,p,c=this.getThreeRenderer(),l=c.getSize(),d=n.getLayers();if(d.length){var h=d[0];u=null!==h.leftBounds&&4===h.leftBounds.length?h.leftBounds:this.defaultLeftBounds,p=null!==h.rightBounds&&4===h.rightBounds.length?h.rightBounds:this.defaultRightBounds}else u=this.defaultLeftBounds,p=this.defaultRightBounds;this.renderRectL={x:Math.round(l.width*u[0]),y:Math.round(l.height*u[1]),width:Math.round(l.width*u[2]),height:Math.round(l.height*u[3])},this.renderRectR={x:Math.round(l.width*p[0]),y:Math.round(l.height*p[1]),width:Math.round(l.width*p[2]),height:Math.round(l.height*p[3])};var f=this.getRuntimeData();null===f.parent&&f.updateMatrixWorld(),f.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),f.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale),this.cameraL.translateOnAxis(this.eyeTranslationL,this.scale),this.cameraR.translateOnAxis(this.eyeTranslationR,this.scale),n.depthNear=f.near,n.depthFar=f.far,n.getFrameData(this.frameData),this.cameraL.projectionMatrix.elements=this.frameData.leftProjectionMatrix,this.cameraR.projectionMatrix.elements=this.frameData.rightProjectionMatrix,c.setScissor(this.renderRectL.x,this.renderRectL.y,this.renderRectL.width,this.renderRectL.height),this.getRenderer().renderView(i,this.cameraL,{renderTarget:this.renderTarget,clearDepth:!0,clearColor:!0,viewPort:this.renderRectL,enablePreRenderFunctions:!0}),c.setScissor(this.renderRectR.x,this.renderRectR.y,this.renderRectR.width,this.renderRectR.height),this.getRenderer().renderView(i,this.cameraR,{renderTarget:this.renderTarget,clearDepth:!1,clearColor:!1,viewPort:this.renderRectR,enablePreRenderFunctions:!0}),a&&(i.autoUpdate=!0)}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBoxApiBase="https://api.box.com"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(213),s=r(212),u=r(214),p=r(209),c=r(222),l=r(27),d=r(79),h=r(35),f=r(14),m=r(50),y=r(49),g=r(9),v=r(34),b=r(15),x=r(11),P=r(122),w=function(e){var t;return e&&e.jquery?e.get(0):"string"==typeof e?(t=document.querySelectorAll(e),t.length&&t[0]):e};t.engineMixins=y.default({},[u.default,s.default,l.default]);var E=function(e){function t(t){var r=e.call(this)||this;r.registeredGlobalEvents={},r.renderOnDemand=!1,r.needsRender=!0,r.container=void 0,r.globalEvents=void 0,r.engineName="Unnamed Instance of Box3D Engine",r.apiBase=P.defaultBoxApiBase,r.audioContext=void 0,r.paused=!1,r.runMode="player",r.runtimeNames={},r.nextRuntimeName=1,a.default.info("Engine Initialization"),r.globalScope=t.globalScope||window;return function(){if(r.globalEvents=t&&t.globalEvents||m.default,!r.globalEvents)throw new Error("No global event system supplied or found")}(),function(){r.container=r.container||w(t.container)}(),function(){if(r.canvas=r.canvas||w(t.canvas),r.canvas||(r.canvas=document.createElement("canvas"),r.container&&r.container.appendChild(r.canvas),r.canvasCreatedByEngine=!0),!(r.canvas instanceof HTMLCanvasElement))throw new Error("Failed to create canvas element")}(),function(){if(r.resourceLoader=t.resourceLoader,t.apiBase&&(r.apiBase=t.apiBase),!r.resourceLoader)throw new Error("No resource loader passed to Engine")}(),function(){r.materialUtilities=new c.default(r)}(),function(){r.geometryUtilities=new p.default}(),function(){r.engineName=t.engineName||r.engineName,r.clock=new n.Clock(!0),r.frameDelta=0,r.frameDeltaAggregate=0,r.frameCount=0,r.lastFrameDelta=r.getTimeNow(),r.avgFrameTime=0,r.paused=!1,r.documentVisible=!0,r.state="initializing",r.setRunMode(t.runMode),r.entityDispatcher=t.entityDispatcher||new o.default,r.entityDispatcher.addEngine(r)}(),function(){r.scriptRegistry=new d.default(r),Object.keys(h.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(h.default.builtInAssetDescriptors[e])}),Object.keys(f.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(f.default.builtInAssetDescriptors[e])})}(),function(){r.onResize=function(){r.needsRender=!0},r.onBlur=function(){r.trigger("blur")},r.onFocus=function(){r.trigger("focus")},r.onVisibilityChange=function(){var e=document.hidden||document.mozHidden||document.msHidden||document.webkitHidden;r.documentVisible&&e?r.documentVisible=!1:r.documentVisible||(r.frameDelta=0,r.lastFrameDelta=r.getTimeNow(),r.documentVisible=!0)},window.addEventListener("blur",r.onBlur),window.addEventListener("focus",r.onFocus),r.listenTo(r,"resize",r.onResize),document.addEventListener("visibilitychange",r.onVisibilityChange)}(),function(){r.globalScope[r.engineName]=r,r.update(),r.state="initialized"}(),r}return i.__extends(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),a.default.info(this.engineName+" - Destroying engine."),window[this.engineName]&&delete window[this.engineName],this.baseRenderer=void 0,this.resourceLoader.destroy(),this.materialUtilities.destroy(),this.geometryUtilities.destroy(),window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.stopListening(this,"resize",this.onResize),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onBlur=void 0,this.onFocus=void 0,this.onResize=void 0,this.onVisibilityChange=void 0,this.trigger("shutdown"),this.state="uninitializing",this.cancelAnimationFrame(this.animationRequestID),this.canvas&&this.canvas.parentNode&&this.canvasCreatedByEngine&&this.canvas.parentNode.removeChild(this.canvas),this.entityDispatcher&&this.entityDispatcher.removeEngine(this),this.clock=void 0,this.canvas=void 0,this.container=void 0,this.threeRenderer=void 0,this.baseRenderer=void 0,this.engineName=void 0,this.entityDispatcher=void 0,this.state="uninitialized"},t.prototype.getName=function(){return this.engineName},t.prototype.addEntities=function(e){return this.entityDispatcher?this.entityDispatcher.addEntities(e):[]},t.prototype.addRemoteEntities=function(e,t){var r=this;return void 0===t&&(t={}),new Promise(function(i,n){r.resourceLoader.load(e,b.default.ENTITIES,t).on(x.default.LOAD,function(e){i(r.addEntities(e))}).on(x.default.ERROR,function(e){return n(e)})})},t.prototype.addRemoteEntitiesFromBox=function(e,t,r){var i=this;return void 0===t&&(t={}),this.fetchRemoteRepresentationsFromBox(e,t,r||this.apiBase).then(function(e){return i.addRemoteEntities(e.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json"),t)})},t.prototype.fetchRemoteRepresentationsFromBox=function(e,t,r){var n=this;void 0===t&&(t={});var a=(r||this.apiBase)+"/2.0/files/"+e+"?fields=representations";return new Promise(function(e,r){return n.resourceLoader.load(a,b.default.JSON,i.__assign({headers:{"X-Rep-Hints":"[3d]"}},t)).on(x.default.LOAD,function(t){return e(t)}).on(x.default.ERROR,function(e){return r(e)})})},t.prototype.loadEntities=function(e,t,r){var i=this;void 0===r&&(r="load"),Promise.all(e.map(function(e){var t=e instanceof g.default?e.id:e;return new Promise(function(e,n){var a=i.getEntityById(t);a?(a.when(r,function(){e()}),a.isUnloaded()&&a.load()):n(new Error("Entity can't be found."))})})).then(function(){"function"==typeof t&&t.call(i)}).catch(function(e){"function"==typeof t&&(a.default.error("loadEntities error: "+e),t.call(i,e))})},t.prototype.setVrDisplay=function(e){var t=this;this.cancelAnimationFrame(this.animationRequestID),this.vrDevice=e,this.animationRequestID=this.requestAnimationFrame(function(){t.needsRender=!0,t.update()})},t.prototype.getVrDisplay=function(){return this.vrDevice},t.prototype.getApplication=function(){return this.getAssetsByClass(v.default).find(function(e){return e.isBaseLoaded()})},t.prototype.setRunMode=function(e){this.runMode="editor"===e?e:"player"},t.prototype.getRunMode=function(){return this.runMode},t.prototype.getRenderer=function(){return this.baseRenderer},t.prototype.setRenderer=function(e){this.baseRenderer&&(this.baseRenderer.onShutdown(),this.baseRenderer.stopListening()),this.baseRenderer=e,this.threeRenderer=e.threeRenderer},t.prototype.getThreeRenderer=function(){return this.threeRenderer},t.prototype.getGPUCapability=function(e){return this.baseRenderer.caps[e]},t.prototype.getAudioContext=function(){if(!this.audioContext){var e=this.globalScope.AudioContext||this.globalScope.webkitAudioContext;e&&(this.audioContext=new e,this.audioContext||a.default.warn(this.engineName+" - Failed to create Web Audio API context"))}return this.audioContext},t.prototype.getRuntimeName=function(e){return this.runtimeNames.hasOwnProperty(e)||(this.runtimeNames[e]=this.nextRuntimeName.toString(),this.nextRuntimeName++),this.runtimeNames[e]},t.prototype.pause=function(){this.paused||(this.paused=!0,this.clock.stop(),this.cancelAnimationFrame(this.animationRequestID),a.default.info(this.engineName+" engine has been paused."))},t.prototype.unpause=function(){this.paused&&(this.paused=!1,this.frameDelta=0,this.lastFrameDelta=this.getTimeNow(),this.clock.start(),a.default.info(this.engineName+" engine has been unpaused."),this.update())},t.prototype.setCurrentApp=function(e){var t=this.getAssetById(e);t&&(this.currentApplication&&(a.default.warn("Already an application running in this engine. Stop it before starting the "+t.getName()+" application."),this.currentApplication.unload()),this.currentApplication=t)},t.prototype.getTimeNow=function(){return.001*(window.performance&&window.performance.now?window.performance.now():Date.now())},t.prototype.update=function(){var e=this;this.paused||(this.animationRequestID=this.requestAnimationFrame(function(){e.update()}),this.documentVisible&&(this.frameCount++,this.frameDelta=this.getTimeNow()-this.lastFrameDelta,this.lastFrameDelta=this.getTimeNow(),this.frameDeltaAggregate+=this.frameDelta,this.avgFrameTime=this.frameDeltaAggregate/this.frameCount,this.trigger("preUpdate",this.frameDelta),this.trigger("update",this.frameDelta),this.trigger("postUpdate",this.frameDelta),this.renderOnDemand&&!this.needsRender||(this.needsRender=!1,this.trigger("preRender",this.frameDelta),this.trigger("render",this.frameDelta),this.trigger("renderGroup1",this.frameDelta),this.trigger("renderGroup2",this.frameDelta),this.trigger("renderGroup3",this.frameDelta),this.trigger("renderGroup4",this.frameDelta),this.trigger("renderGroup5",this.frameDelta),this.trigger("renderGroup6",this.frameDelta),this.trigger("renderGroup7",this.frameDelta),this.trigger("renderGroup8",this.frameDelta),this.trigger("renderGroup9",this.frameDelta),this.trigger("renderGroup10",this.frameDelta),this.trigger("postRender",this.frameDelta))))},t.prototype.requestAnimationFrame=function(e){return this.vrDevice?this.vrDevice.requestAnimationFrame(e):requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){return this.vrDevice?this.vrDevice.cancelAnimationFrame(e):cancelAnimationFrame(e)},t}(t.engineMixins);t.default=E},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={roughness:{displayName:"Roughness",description:"How rough the surface appears.",type:"f",min:0,max:1,default:.5,isRenderParam:!0},roughnessMap:{displayName:"Roughness Map",description:"A texture that stores the roughness info of the material.",type:"t",default:null,isRenderParam:!0,enabledWhen:{roughnessMap:{notEqualsDefault:!0}}},metalness:{displayName:"Metalness",description:"How metallic the surface appears (multiplied by the metalness texture).",type:"f",min:0,max:1,default:0,isRenderParam:!0,enabledWhen:{metalness:{notEqualsDefault:!0}}},metalnessMap:{displayName:"Metalness Map",description:"A texture that contains the metalness of the material.",type:"t",default:null,isRenderParam:!0,enabledWhen:{metalnessMap:{notEqualsDefault:!0}}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"accessor",title:"AccessorDef",type:"object",description:"A typed-view into raw binary data.",properties:{componentType:{type:"string",enum:["int8","uint8","int16","int32","uint32","float32","float64"],description:"These correspond to typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array."},type:{type:"string",enum:["scalar","vec2","vec3","vec4","mat2","mat3","mat4"],description:"Specifies if elements are scalars, vectors or matrices."},byteOffset:{type:"integer",description:"Byte offset into the binary data."},byteStride:{type:"integer",description:"The number of bytes between successive elements (0 indicates that the elements are tightly packed)."},count:{type:"integer",description:"The number of elements, not to be confused with the number of components or bytes. For example, the number of positions, not the number of floats."}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"animationAsset",title:"AnimationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["animation"]},properties:{$ref:"animationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"animationAssetProperties",title:"AnimationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{clips:{type:"object",description:"The clips for the animation.",properties:{},additionalProperties:{$ref:"animationClip.json"},default:{}},layers:{type:"object",description:"The layers of the animation.",properties:{},additionalProperties:{$ref:"animationLayer.json"},defualt:{}},channels:{type:"object",description:"The channels for the animation.",properties:{},additionalProperties:{$ref:"animationChannel.json"},default:{}}}),required:["clips","layers","channels"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationChannel",title:"AnimationChannelDef",type:"object",description:"An animation channel.",properties:{name:{type:"string",description:"The channel's name."},targetObject:{type:"array",description:"The path of the object to animate.",items:{type:"string"},default:[]},targetProperty:{type:"string",description:"The path of the property to animate."},values:{type:"string",description:"The ID of the accessor for the channel values."},times:{type:"string",description:"The ID of the accessor for the channel times."},interpolation:{type:"string",enum:["linear"],description:"The interpolation type for the channel."}},required:["name","targetObject","targetProperty","values","times","interpolation"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationClip",title:"AnimationClipDef",type:"object",description:"An animation clip.",properties:{name:{type:"string",description:"The clip's name."},start:{type:"number",description:"The take's start time, in seconds.",default:0},stop:{type:"number",description:"The take's stop time, in seconds.",default:0},layers:{type:"array",items:{type:"string"},default:[]}},required:["name","start","stop","layers"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationLayer",title:"AnimationLayerDef",type:"object",description:"An animation layer.",properties:{name:{type:"string",description:"The layer's name."},blendMode:{enum:["additive"],description:"The layer's blend mode.",default:"additive"},blendWeight:{type:"number",description:"The layer's blend weight.",default:1},channels:{type:"array",items:{type:"string"},default:[]}},required:["name","blendMode","blendWeight","channels"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"applicationAsset",title:"ApplicationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["application"]},properties:{$ref:"applicationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"applicationAssetProperties",title:"ApplicationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{startupSceneId:{type:["string","null"],description:"The prefab that will be loaded when the application loads.#entity-PrefabAsset"}}),required:["startupSceneId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"audioAsset",title:"AudioAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["audio"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"audioRepresentation.json"}}),properties:{$ref:"audioAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"audioAssetProperties",title:"AudioAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"audioRepresentation",title:"AudioRepresentationDef",properties:i.__assign({},n.default.properties,{bitRate:{type:"number"},sampleRate:{type:"number"},stereo:{type:"boolean"},startTime:{type:"number"},duration:{type:"number"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"boneObject",title:"BoneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["bone"]},properties:{$ref:"boneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"boneObjectProperties",title:"BoneObjectPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"box3",title:"Box3Def",type:"object",properties:{min:{$ref:"vector3.json"},max:{$ref:"vector3.json"}},required:["min","max"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"bufferAsset",title:"BufferAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["buffer"]},properties:{$ref:"bufferAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"bufferAssetProperties",title:"BufferAssetPropertiesDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the binary file."},isExternal:{type:"boolean",description:"True is the asset should be loaded from outside of the base data provider/content provider.",default:!1},contentLength:{type:"number",description:"The HTTP Content-Length."},accessors:{type:"object",properties:{},additionalProperties:{$ref:"accessor.json"},description:"Typed-views into the binary file."}}),required:["src","contentLength"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"cameraObject",title:"CameraObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["camera"]},properties:{$ref:"cameraObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"cameraObjectProperties",title:"CameraObjectPropertiesDef",properties:i.__assign({},n.default.properties,{cameraType:{type:"string",description:"The projection type of the camera. e.g. perspective or orthographic",enum:["perspective","orthographic"],default:"perspective"},fov:{type:"number",description:"The field of view of the camera. i.e. angular size of view.",default:50,dependencies:{cameraType:["perspective"]}},aspect:{type:"number",description:"Aspect ratio of view. i.e. Width divided by height.",default:1.7777777777777777},near:{type:"number",description:"The near clipping plane of the camera. i.e. the closest distance rendered.",default:.1},far:{type:"number",description:"The far clipping plane of the camera. i.e. the furthest distance rendered.",default:12e3},right:{type:"number",description:"The right clipping plane of an orthographic camera.",default:10,dependencies:{cameraType:["orthographic"]}},left:{type:"number",description:"The left clipping plane of an orthographic camera.",default:-10,dependencies:{cameraType:["orthographic"]}},top:{type:"number",description:"The top clipping plane of an orthographic camera.",default:10,dependencies:{cameraType:["orthographic"]}},bottom:{type:"number",description:"The bottom clipping plane of an orthographic camera.",default:-10,dependencies:{cameraType:["orthographic"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"colorRgb",title:"ColorRgb",type:"object",properties:{r:{type:"number",minimum:0,maximum:1},g:{type:"number",minimum:0,maximum:1},b:{type:"number",minimum:0,maximum:1}},required:["r","g","b"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"component",title:"ComponentDef",type:"object",properties:{id:{type:"string"},scriptId:{type:"string"},name:{type:"string"},enabled:{type:"boolean"},attributes:{type:"object",properties:{},additionalProperties:{$ref:"componentAttribute.json"}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"componentAttribute",title:"ComponentAttributeDef",type:"object",properties:{type:{type:"string"},subType:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1},attributes:{type:"array",items:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"documentAsset",title:"DocumentAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["document"]},properties:{$ref:"documentAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"documentAssetProperties",title:"DocumentAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"dracoAttribute",title:"DracoAttributeDef",type:"object",description:"Specifies the name and ID of a Draco attribute.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},id:{type:"string",description:"The ID of the Draco attribute."}},required:["name","id"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"dracoGeometryAsset",title:"DracoGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["dracoGeometry"]},properties:{$ref:"dracoGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"dracoGeometryAssetProperties",title:"DracoGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{accessorId:{type:["string","null"],description:"The ID of the accessor containing the draco geometry: <bufferId>#<accessorId>."},attributes:{type:"object",properties:{},additionalProperties:{$ref:"dracoAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements."}}),required:["accessorId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"eventScope",title:"EventScopeDef",type:"object",properties:{scopeName:{type:"string",enum:["global","this","entity","component"],default:"global"},entityId:{description:"The entity's name.",type:["string","null"],default:null},componentId:{description:"The entity's name.",type:["string","null"],default:null}},required:["scopeName"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(73),a=i.__assign({},n.default,{id:"imageAsset",title:"ImageAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["image"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"imageRepresentation.json"}}),properties:{$ref:"imageAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(45),a=i.__assign({},n.default,{id:"imageAssetProperties",title:"ImageAssetPropertiesDef",properties:i.__assign({},n.default.properties,{useCompression:{type:"boolean",description:"True if we will try to use a hardware-compressed version of the image 'instead of a regular one. This depends on the hardware capabilities of the user and the data formats available.",default:!0}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a={id:"imageRepresentation",title:"ImageRepresentationDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the representation."},channels:{type:"array",items:{type:"string",enum:["red","green","blue","alpha","gray","exponent"]}},compression:{type:"string",enum:["dxt","dxt1","dxt5","jpeg","zip"]},isExternal:{type:"boolean"},width:{type:"integer",description:"The width, in pixels, of the representation."},height:{type:"integer",description:"The height, in pixels, of the representation."},colorspace:{type:"string",enum:["srgb","rgb"]}}),required:["src"],additionalProperties:!1};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"lightObject",title:"LightObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["light"]},properties:{$ref:"lightObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"lightObjectProperties",title:"LightObjectPropertiesDef",properties:i.__assign({},n.default.properties,{lightType:{type:"string",description:"The type of light. e.g. directional, point, spot, etc.",enum:["directional","point","spot","hemisphere","ambient"],default:"directional"},color:{$ref:"colorRgb.json",description:"The color of the light in {r, g, b} form. Each channel is defined between 0.0 and 1.0.",default:{r:.7333,g:.7333,b:.7333}},intensity:{type:"number",description:"The brightness of the light.",minimum:0,default:1},distance:{type:"number",description:"A value that controls the falloff rate of the light.",default:0,minimum:0,dependencies:{lightType:["point","spot"]}},decay:{type:"number",description:"The decay exponent of the light falloff.",default:2,minimum:0,maximum:5,dependencies:{lightType:["point","spot"]}},angle:{type:"number",description:"The angle of the bright light at the center of the spotlight.",default:Math.PI/3,minimum:1,maximum:Math.PI,dependencies:{lightType:["spot"]}},penumbra:{type:"number",description:"The outer angle that defines the edge of the spotlight.",default:Math.PI/4,minimum:.001,maximum:Math.PI/2,dependencies:{lightType:["spot"]}},groundColor:{$ref:"colorRgb.json",description:"The color of the lower half of the hemisphere light.",dependencies:{lightType:["hemisphere"]},default:{r:.033,g:.333,b:.7333}},castShadow:{type:"boolean",description:"Whether or not the light casts a shadow.",dependencies:{lightType:["directional","spot","point"]},default:!1},receiveShadow:{description:"Doesn't apply to lights. #unused"},shadowCameraNear:{type:"number",description:"Near clip plane for the shadow rendering. i.e. how far from the light the shadow casting begins.",default:.1},shadowCameraFar:{type:"number",description:"Far clip plane for the shadow rendering. i.e. how far from the light the shadow casting ends.",default:20},shadowCameraLeft:{type:"number",description:"Left clip plane for the shadow rendering. i.e. how far to the left the shadow casting extends.",default:-10,dependencies:{lightType:["directional"]}},shadowCameraRight:{type:"number",description:"Right clip plane for the shadow rendering. i.e. how far to the right the shadow casting extends.",default:10,dependencies:{lightType:["directional"]}},shadowCameraTop:{type:"number",description:"Top clip plane for the shadow rendering. i.e. how far to the top the shadow casting extends.",default:10,dependencies:{lightType:["directional"]}},shadowCameraBottom:{type:"number",description:"Bottom clip plane for the shadow rendering. i.e. how far to the bottom the shadow casting extends.",default:-10,dependencies:{lightType:["directional"]}},shadowBias:{type:"number",description:"Small value for pushing shadow depth toward or away from the light. This can help reduce shadowing artifacts.",default:-.0015,step:1e-4,minimum:-.01,maximum:.01},shadowMapWidth:{type:"integer",default:1024,description:"Resolution of the shadow map texture used for this light. #read-only"},shadowMapHeight:{type:"integer",default:1024,description:"Resolution of the shadow map texture used for this light. #read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"materialAsset",title:"MaterialAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["material"]},properties:{$ref:"materialAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"materialAssetProperties",title:"MaterialAssetPropertiesDef",properties:i.__assign({},n.default.properties,{shaderId:{type:"string",default:"fbx_surface_phong_shader"}}),additionalProperties:!0});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"meshAttribute",title:"MeshAttributeDef",type:"object",description:"Specifies a range of attribute data for the vertices of a mesh.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},accessorId:{type:["string","null"],description:"The ID of the buffer asset and accessor: <bufferId>#<accessorId>."}},required:["name","accessorId"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"meshGeometryAsset",title:"MeshGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["meshGeometry"]},properties:{$ref:"meshGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"meshGeometryAssetProperties",title:"MeshGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",properties:{},additionalProperties:{$ref:"meshAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements.#unused"},indices:{type:["string","null"],description:"The ID of the accessor containing the vertex indices: <bufferId>#<accessorId>.#unused"},primitives:{type:"array",items:{$ref:"meshPrimitive.json"},description:"The primitives (points, lines, triangles) that make up the mesh.#unused"}}),required:["attributes","indices","primitives"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"meshObject",title:"MeshObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["mesh"]},properties:{$ref:"meshObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"meshObjectProperties",title:"MeshObjectPropertiesDef",properties:i.__assign({},n.default.properties,{customDepthMaterial:{type:["string","null"],description:"Material for doing custom depth rendering. This is used when the mesh is rendered in a depth pass, shadow, etc.",default:null},materials:{type:"array",description:"The array of materials used by this mesh. #entity-MaterialAsset",items:{type:["string","null"]},default:["missingMaterial"]},geometryId:{type:["string","null"],description:"The geometry used by this mesh. #entity-BaseGeometryAsset",default:null},skinId:{type:["string","null"],description:"The skin asset used by this mesh (if it uses skinning). #entity-SkinAsset",default:null}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={$schema:"http://json-schema.org/draft-04/schema",id:"meshPrimitve",title:"meshPrimitiveDef",type:"object",description:"A mesh primitive with an optional material assignment.",properties:{primitive:{enum:["points","lines","triangles"],description:"The type of primitive to render.",default:"triangles"},count:{type:"integer",description:"The number of vertices to draw.",default:0},start:{type:"integer",description:"The index of the first vertex to draw.",default:0},offset:{type:"integer",description:"An offset to apply to each index. This can be used to overcome the 16-bit index limit imposed by WebGL. For example, the first component of a vertex attribute with a value size of 3 would be referenced as follows: values[3 * (offset + indices[start + i])].",default:0},materialIndex:{type:"integer",description:"The index of the material to apply to the primitive being rendered.",default:0}},required:["primitve","count"],additionalProperties:!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"nodeObject",title:"NodeObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["node"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"nodeObjectProperties",title:"NodeObjectPropertiesDef",properties:i.__assign({},n.default.properties)});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"prefabAsset",title:"PrefabAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["prefab"]},properties:{$ref:"prefabAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"prefabAssetProperties",title:"PrefabAssetPropertiesDef",properties:i.__assign({},n.default.properties,{rootObjectId:{type:["string","null"],default:null,description:"The ID of the BaseObject that serves as the root node of a hierarchy. #entity-BaseObject"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"primitiveGeometryAsset",title:"PrimitiveGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["primitiveGeometry"]},properties:{$ref:"primitiveGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"primitiveGeometryAssetProperties",title:"PrimitiveGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{type:{type:"string",description:"The basic shape of the geometry.",default:"sphere",enum:["sphere","box","plane","torus","cylinder"]},radius:{type:"number",description:"The radius of the sphere/torus.",default:.5,minimum:0,dependencies:{type:["sphere","torus"]}},segmentsU:{type:"integer",description:"The number of segments along the first axis of the sphere/torus/cylinder.",default:24,minimum:0,dependencies:{type:["torus","sphere","cylinder"]}},segmentsV:{type:"integer",description:"The number of segments along the second axis of the sphere/torus/cylinder.",default:24,minimum:0,dependencies:{type:["torus","sphere","cylinder"]}},sizeX:{type:"number",description:"The size of the geometry along the x-axis.",default:1,dependencies:{type:["box","plane"]}},sizeY:{type:"number",description:"The size of the geometry along the y-axis.",default:1,dependencies:{type:["box","plane"]}},sizeZ:{type:"number",description:"The size of the geometry along the z-axis.",default:1,dependencies:{type:["box"]}},segmentsX:{type:"integer",description:"The number of segments (quads) of the geometry along the x-axis.",default:1,minimum:0,dependencies:{type:["box","plane"]}},segmentsY:{type:"integer",description:"The number of segments (quads) of the geometry along the y-axis.",default:1,minimum:0,dependencies:{type:["box","plane"]}},segmentsZ:{type:"integer",description:"The number of segments (quads) of the geometry along the z-axis.",default:1,minimum:0,dependencies:{type:["box"]}},radiusTop:{type:"number",description:"The radius of the top of the cylinder.",default:.5,minimum:0,dependencies:{type:["cylinder"]}},radiusBottom:{type:"number",description:"The radius at the bottom of the cylinder.",default:.5,minimum:0,dependencies:{type:["cylinder"]}},height:{type:"number",description:"The height of the cylinder.",default:1,minimum:0,dependencies:{type:["cylinder"]}},open:{type:"boolean",description:"Controls whether the cylinder has a top and bottom.",default:!1,dependencies:{type:["cylinder"]}},tubeRadius:{type:"number",description:"The radius of the tube of the torus.",default:.1,minimum:0,dependencies:{type:["torus"]}},arcAngle:{type:"number",description:"Controls the angle, in radians, that the torus is built with. Defaults to full torus (2PI).",default:6.283185307179586,minimum:0,maximum:6.283185307179586,dependencies:{type:["torus"]}},phiStart:{type:"number",description:"Controls the longitude, in radians, that the sphere construction starts at.",default:0,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere"]}},phiLength:{type:"number",description:"Controls the longitude, in radians, that the sphere construction ends at. Defaults to 2PI.",default:6.283185307179586,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere"]}},thetaStart:{type:"number",description:"Controls the angle, in radians, that the construction starts at.",default:0,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere","cylinder"]}},thetaLength:{type:"number",description:"Controls the angle, in radians, that the construction ends at. Defaults to PI.",default:3.141592653589793,minimum:0,maximum:6.283185307179586,dependencies:{type:["sphere","cylinder"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(46),a=i.__assign({},n.default,{id:"renderTexture2DAsset",title:"RenderTexture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTexture2D"]},properties:{$ref:"renderTexture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(47),a=i.__assign({},n.default,{id:"renderTexture2DAssetProperties",title:"RenderTexture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(46),a=i.__assign({},n.default,{id:"renderTextureCubeAsset",title:"RenderTextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTextureCube"]},properties:{$ref:"renderTextureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(47),a=i.__assign({},n.default,{id:"renderTextureCubeAssetProperties",title:"RenderTextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",enum:["null","uv","environment"],description:"This value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"},mapping:{type:"string",default:"cubeReflection",description:"The mapping of the texture when applied to a material.",enum:["cubeReflection","cubeRefraction"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"sceneObject",title:"SceneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["scene"]},properties:{$ref:"sceneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"sceneObjectProperties",title:"SceneObjectPropertiesDef",properties:i.__assign({},n.default.properties,{fogEnabled:{type:"boolean",description:"Enable fog in the scene.",default:!1},fogColor:{$ref:"colorRgb.json",description:"The color of the fog in {r, g, b} form. Each channel is defined between 0.0 and 1.0.",default:{r:.5,g:.5,b:.5}},fogDensity:{type:"number",description:"The density of the fog. A higher number represents denser fog.",default:4e-4,minimum:0,maximum:1}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"scriptAsset",title:"ScriptAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["script"]},properties:{$ref:"scriptAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"scriptAssetProperties",title:"ScriptAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",description:"The attributes of the component instanced from this script.",default:{}},description:{type:"string",description:"A description of the script, including what it would be used for.",default:""},events:{type:"object",description:"The events exposed by this script.",default:{}},externalDependencies:{type:"array",description:"Array of external files that need to be loaded for this script to work.",default:[]},filter:{type:"array",description:"An array of entity types to filter what entities this script can apply to.",items:{type:"string"},default:[]},category:{type:"string",description:"The name of a category that this script belongs to. Used for organizing large numbers of scripts.",default:""},executeIn:{type:"string",description:"Controls whether the script will run only in the editor, only in the player or in both.",enum:["player","editor","all"],default:"player"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"shaderAsset",title:"ShaderAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["shader"]},properties:{$ref:"shaderAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"shaderAssetProperties",title:"ShaderAssetPropertiesDef",properties:i.__assign({},n.default.properties,{parameters:{type:"object",description:"Parameters for the shader.",default:{},additionalProperties:{$ref:"shaderParameter.json"}},uniforms:{description:"List of uniforms for the shader, in THREE.js format of all properties not defined as a parameter.",type:"object",default:{}},vertexShader:{type:"string",description:"The actual text of the vertex shader.",default:""},fragmentShader:{type:"string",description:"The actual text of the fragment/pixel shader.",default:""}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={type:"object",id:"shaderConditions",title:"ShaderConditionsDef",properties:{or:{type:"array",items:{type:"object",properties:{},additionalProperties:!0}},equals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},notEquals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},equalsDefault:{type:"boolean"},notEqualsDefault:{type:"boolean"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={id:"shaderParameter",title:"ShaderParameterDef",properties:{displayName:{type:"string"},description:{type:"string"},isRenderParam:{type:"boolean"},isUniform:{type:"boolean"},uniformName:{type:"string"},type:{type:"string",enum:["b","c","f","t","opt","v2","v3","v4"]},min:{type:"number"},max:{type:"number"},options:{type:"object",properties:{},additionalProperties:!0},displayWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},enabledWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},defines:{properties:{},additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"}]}},derivatives:{type:"boolean"},default:{anyOf:[{type:"null"},{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"},{type:"object",properties:{},additionalProperties:!0}]},transparency:{enum:["LessThanOne","GreaterThanOne","NotFalsy","HasAlpha"]},textureUsage:{enum:["bump","normal"]},forceUpdate:{type:"boolean"},textureType:{enum:["Cube"]},step:{type:"number"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"skinAsset",title:"SkinAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["skin"]},properties:{$ref:"skinAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"skinAssetProperties",title:"SkinAssetPropertiesDef",properties:i.__assign({},n.default.properties,{bindShapeMatrix:{type:"array",description:"Bind shape matrix specifying how the mesh should be transformed into the right coordinate system for use with the joints.",items:{type:"number"},minItems:16,maxItems:16,default:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},inverseBindMatrices:{type:["string","null"],description:"The ID of the accessor containing the inverse bind matrices: <bufferId>#<accessorId>."},jointNames:{type:"array",description:"Names of the joints in this skin.",items:{type:"string"},uniqueItems:!0,default:[]}}),required:["bindShapeMatrix","inverseBindMatrices","jointNames"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"texture2DAsset",title:"Texture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["texture2D"]},properties:{$ref:"texture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=i.__assign({},n.default,{id:"texture2DAssetProperties",title:"Texture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"textureCubeAsset",title:"TextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["textureCube"]},properties:{$ref:"textureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(23),a=i.__assign({},n.default,{id:"textureCubeAssetProperties",title:"TextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",description:"This value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"},mapping:{type:"string",default:"cubeReflection",description:"The mapping of the texture when applied to a material.",enum:["cubeReflection","cubeRefraction"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector2",title:"Vector2Def",type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector3",title:"Vector3Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector4",title:"Vector4Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},required:["x","y","z","w"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"videoAsset",title:"VideoAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["video"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"videoRepresentation.json"}}),properties:{$ref:"videoAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(45),a=r(23),o=i.__assign({},n.default,a.default,{id:"videoAssetProperties",title:"VideoAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{autoPlay:{type:"boolean",description:"Automatically play the video when loaded.",default:!0},muted:{type:"boolean",description:"Mute the audio of the video, if any.",default:!0},loop:{type:"boolean",description:"Controls whether the video restarts automatically when it reaches the end.",default:!0},querySelector:{type:"string",description:"Optional query selector string to load the video data from an HTML5 video tag."}})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"videoRepresentation",title:"VideoRepresentationDef",properties:i.__assign({},n.default.properties,{video:{type:"object",properties:{height:{type:"integer"},width:{type:"integer"}}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e;try{e=window.WebGLRenderingContext?document.createElement("canvas").getContext("experimental-webgl"):void 0}catch(e){}var t=!!e,r=!!t&&!!e.getExtension("OES_texture_float"),i=!!t&&!(0===e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS));return e=void 0,{isWebGLEnabled:function(){return t},isFloatingPointTexturesEnabeled:function(){return r},isVertexTexturesEnabeled:function(){return i}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return"node"===e.type||"camera"===e.type||"scene"===e.type||"light"===e.type||"mesh"===e.type||"bone"===e.type},t.isAsset=function(e){return!t.isObject(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var i=r(258);e.exports=function(e,t,r){if(i(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,n){return e.call(t,r,i,n)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,r){var i=r(273)("wks"),n=r(200),a=r(33).Symbol,o="function"==typeof a;(e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:n)("Symbol."+e))}).store=i},function(e,t){function r(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=r},function(e,t,r){(function(t){var r,i=t.crypto||t.msCrypto;if(i&&i.getRandomValues){var n=new Uint8Array(16);r=function(){return i.getRandomValues(n),n}}if(!r){var a=new Array(16);r=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}e.exports=r}).call(t,r(77))},function(e,t,r){function i(e){return r(n(e))}function n(e){var t=a[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var a={"./accessor":125,"./accessor.ts":125,"./animationAsset":126,"./animationAsset.ts":126,"./animationAssetProperties":127,"./animationAssetProperties.ts":127,"./animationChannel":128,"./animationChannel.ts":128,"./animationClip":129,"./animationClip.ts":129,"./animationLayer":130,"./animationLayer.ts":130,"./applicationAsset":131,"./applicationAsset.ts":131,"./applicationAssetProperties":132,"./applicationAssetProperties.ts":132,"./audioAsset":133,"./audioAsset.ts":133,"./audioAssetProperties":134,"./audioAssetProperties.ts":134,"./audioRepresentation":135,"./audioRepresentation.ts":135,"./baseAsset":7,"./baseAsset.ts":7,"./baseAssetProperties":8,"./baseAssetProperties.ts":8,"./baseEntity":43,"./baseEntity.ts":43,"./baseEntityProperties":44,"./baseEntityProperties.ts":44,"./baseGeometryAsset":28,"./baseGeometryAsset.ts":28,"./baseGeometryAssetProperties":29,"./baseGeometryAssetProperties.ts":29,"./baseImageAsset":73,"./baseImageAsset.ts":73,"./baseImageAssetProperties":45,"./baseImageAssetProperties.ts":45,"./baseObject":16,"./baseObject.ts":16,"./baseObjectProperties":17,"./baseObjectProperties.ts":17,"./baseRenderTextureAsset":46,"./baseRenderTextureAsset.ts":46,"./baseRenderTextureAssetProperties":47,"./baseRenderTextureAssetProperties.ts":47,"./baseTextureAsset":30,"./baseTextureAsset.ts":30,"./baseTextureAssetProperties":23,"./baseTextureAssetProperties.ts":23,"./boneObject":136,"./boneObject.ts":136,"./boneObjectProperties":137,"./boneObjectProperties.ts":137,"./box3":138,"./box3.ts":138,"./bufferAsset":139,"./bufferAsset.ts":139,"./bufferAssetProperties":140,"./bufferAssetProperties.ts":140,"./cameraObject":141,"./cameraObject.ts":141,"./cameraObjectProperties":142,"./cameraObjectProperties.ts":142,"./colorRgb":143,"./colorRgb.ts":143,"./commonImageProperties":48,"./commonImageProperties.ts":48,"./component":144,"./component.ts":144,"./componentAttribute":145,"./componentAttribute.ts":145,"./documentAsset":146,"./documentAsset.ts":146,"./documentAssetProperties":147,"./documentAssetProperties.ts":147,"./dracoAttribute":148,"./dracoAttribute.ts":148,"./dracoGeometryAsset":149,"./dracoGeometryAsset.ts":149,"./dracoGeometryAssetProperties":150,"./dracoGeometryAssetProperties.ts":150,"./eventScope":151,"./eventScope.ts":151,"./imageAsset":152,"./imageAsset.ts":152,"./imageAssetProperties":153,"./imageAssetProperties.ts":153,"./imageRepresentation":154,"./imageRepresentation.ts":154,"./index":4,"./index.ts":4,"./lightObject":155,"./lightObject.ts":155,"./lightObjectProperties":156,"./lightObjectProperties.ts":156,"./materialAsset":157,"./materialAsset.ts":157,"./materialAssetProperties":158,"./materialAssetProperties.ts":158,"./meshAttribute":159,"./meshAttribute.ts":159,"./meshGeometryAsset":160,"./meshGeometryAsset.ts":160,"./meshGeometryAssetProperties":161,"./meshGeometryAssetProperties.ts":161,"./meshObject":162,"./meshObject.ts":162,"./meshObjectProperties":163,"./meshObjectProperties.ts":163,"./meshPrimitive":164,"./meshPrimitive.ts":164,"./nodeObject":165,"./nodeObject.ts":165,"./nodeObjectProperties":166,"./nodeObjectProperties.ts":166,"./prefabAsset":167,"./prefabAsset.ts":167,"./prefabAssetProperties":168,"./prefabAssetProperties.ts":168,"./primitiveGeometryAsset":169,"./primitiveGeometryAsset.ts":169,"./primitiveGeometryAssetProperties":170,"./primitiveGeometryAssetProperties.ts":170,"./renderTexture2DAsset":171,"./renderTexture2DAsset.ts":171,"./renderTexture2DAssetProperties":172,"./renderTexture2DAssetProperties.ts":172,"./renderTextureCubeAsset":173,"./renderTextureCubeAsset.ts":173,"./renderTextureCubeAssetProperties":174,"./renderTextureCubeAssetProperties.ts":174,"./representation":31,"./representation.ts":31,"./sceneObject":175,"./sceneObject.ts":175,"./sceneObjectProperties":176,"./sceneObjectProperties.ts":176,"./scriptAsset":177,"./scriptAsset.ts":177,"./scriptAssetProperties":178,"./scriptAssetProperties.ts":178,"./shaderAsset":179,"./shaderAsset.ts":179,"./shaderAssetProperties":180,"./shaderAssetProperties.ts":180,"./shaderConditions":181,"./shaderConditions.ts":181,"./shaderParameter":182,"./shaderParameter.ts":182,"./skinAsset":183,"./skinAsset.ts":183,"./skinAssetProperties":184,"./skinAssetProperties.ts":184,"./texture2DAsset":185,"./texture2DAsset.ts":185,"./texture2DAssetProperties":186,"./texture2DAssetProperties.ts":186,"./textureCubeAsset":187,"./textureCubeAsset.ts":187,"./textureCubeAssetProperties":188,"./textureCubeAssetProperties.ts":188,"./vector2":189,"./vector2.ts":189,"./vector3":190,"./vector3.ts":190,"./vector4":191,"./vector4.ts":191,"./videoAsset":192,"./videoAsset.ts":192,"./videoAssetProperties":193,"./videoAssetProperties.ts":193,"./videoRepresentation":194,"./videoRepresentation.ts":194};i.keys=function(){return Object.keys(a)},i.resolve=n,e.exports=i,i.id=204},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);t.version="0.0.0-semantic-release";var n=r(1);t.THREE=n;var a=r(243);t.Components=a;var o=r(122);t.Constants=o;var s=r(4);t.Schemas=s.default;var u=r(123);t.Engine=u.default;var p=r(79);t.ScriptRegistry=p.default;var c=r(9);t.BaseEntity=c.default;var l=r(52);t.AnimationAsset=l.default;var d=r(34);t.ApplicationAsset=d.default;var h=r(53);t.AudioAsset=h.default;var f=r(6);t.BaseAsset=f.default;var m=r(24);t.BaseGeometryAsset=m.default;var y=r(12);t.BaseImageAsset=y.default;var g=r(54);t.BaseRenderTextureAsset=g.default;var v=r(20);t.BaseTextureAsset=v.default;var b=r(21);t.BufferAsset=b.default;var x=r(78);t.DocumentAsset=x.default;var P=r(55);t.DracoGeometryAsset=P.default;var w=r(56);t.ImageAsset=w.default;var E=r(14);t.MaterialAsset=E.default;var S=r(57);t.MeshGeometryAsset=S.default;var _=r(58);t.PrefabAsset=_.default;var D=r(59);t.PrimitiveGeometryAsset=D.default;var T=r(60);t.RenderTexture2DAsset=T.default;var M=r(61);t.RenderTextureCubeAsset=M.default;var A=r(62);t.ScriptAsset=A.default;var R=r(35);t.ShaderAsset=R.default;var C=r(63);t.SkinAsset=C.default;var O=r(64);t.Texture2DAsset=O.default;var I=r(65);t.TextureCubeAsset=I.default;var j=r(25);t.VideoAsset=j.default;var k=r(10);t.BaseObject=k.default;var L=r(71);t.NodeObject=L.default;var B=r(69);t.BoneObject=B.default;var N=r(70);t.CameraObject=N.default;var U=r(41);t.LightObject=U.default;var V=r(22);t.MeshObject=V.default;var z=r(42);t.SceneObject=z.default;var F=r(15);t.LoadingType=F.default;var G=r(11);t.LoadingEvent=G.default;var q=r(72);t.LoadingState=q.default;var H=r(2);t.BaseComponent=H.default;var $=r(66);t.Handedness=$.Handedness;var W=r(67);t.RenderMode=W.RenderMode;var X=r(3);t.log=X.default;var Q=r(234);t.XhrResourceLoader=Q.default,i.__exportStar(r(18),t);var Z=r(50);t.globalEvents=Z.default;var Y=r(195);t.browserCaps=Y.default},function(e,t,r){r(278),e.exports=r(32).Array.find},function(e,t,r){r(279),e.exports=r(32).Math.log10},function(e,t,r){r(280),e.exports=r(32).Math.log2},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(){var e=this;this.defaultGeometry=new i.BufferGeometry,this.defaultGeometry.setIndex(new i.BufferAttribute(new Uint16Array(0),1));var t={position:new i.BufferAttribute(new Float32Array(0),3),normal:new i.BufferAttribute(new Float32Array(0),3,!0),skinWeight:new i.BufferAttribute(new Float32Array(0),4,!0),skinIndex:new i.BufferAttribute(new Uint16Array(0),4,!0)};Object.keys(t).forEach(function(r){var i=t[r];e.defaultGeometry.addAttribute(r,i)})}return e.prototype.destroy=function(){this.defaultGeometry&&(this.defaultGeometry.dispose(),this.defaultGeometry=void 0)},e.prototype.getDefaultGeometry=function(){return this.defaultGeometry},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(5),a=function(){function e(){this.components=[]}return e.prototype.initializeComponents=function(){this.listenTo(this.engine,"scriptDeleted",this.onScriptDeleted),this.listenTo(this,"change:component",this.onComponentChanged),this.listenTo(this,"remove:component",this.onComponentRemoved),this.listenTo(this,"add:component",this.onComponentAdded)},e.prototype.getComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.components;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getPreviousComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.previousComponents;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getComponentDescriptors=function(e){var t="function"!=typeof e;return this.sharedData.components.filter(function(r){return t||e(r)}).map(function(e){return n.deepClone(e)})},e.prototype.getComponentDescriptorById=function(e){return this.getComponentDescriptor(function(t){return t.id===e})},e.prototype.getPreviousComponentDescriptorById=function(e){return this.getPreviousComponentDescriptor(function(t){return t.id===e})},e.prototype.addComponent=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r="");var i={scriptId:"string"==typeof e?e:e.id,attributes:t,enabled:!0,name:r};return this.engine.entityDispatcher.dispatchComponentAdded(this.id,i),this.components[this.components.length-1]},e.prototype.removeComponent=function(e){var t=e.getIndex();return t>=0&&(this.engine.entityDispatcher.dispatchComponentRemoved(this.id,t),!0)},e.prototype.getComponentByIndex=function(e){return this.components[e]||null},e.prototype.getComponentByName=function(e){return this.getComponent(function(t){return t.getName()===e})},e.prototype.getComponentsByName=function(e){return this.getComponents(function(t){return t.getName()===e})},e.prototype.getComponentByScriptId=function(e){return this.getComponent(function(t){return t.getScriptId()===e})},e.prototype.getComponentsByScriptId=function(e){return this.getComponents(function(t){return t.getScriptId()===e})},e.prototype.getComponentByScriptName=function(e){return this.getComponent(function(t){return t.getScriptName()===e})},e.prototype.getComponentsByScriptName=function(e){return this.getComponents(function(t){return t.getScriptName()===e})},e.prototype.getComponent=function(e){var t="function"!=typeof e;return this.components.find(function(r){return t||e(r)})},e.prototype.getComponentById=function(e){return this.getComponent(function(t){return t.getId()===e})},e.prototype.getComponents=function(e){var t="function"!=typeof e;return this.components.filter(function(r){return t||e(r)})},e.prototype.setComponents=function(e,t){var r=this;void 0===t&&(t=!1);for(var i=this.engine.entityDispatcher,n=this.sharedData.components.length;n>=0;n--)i.dispatchComponentRemoved(this.id,n);e.forEach(function(e){i.dispatchComponentAdded(r.id,e)})},e.prototype.startComponents=function(){var e=this;this.components.forEach(function(t){return e.startComponent(t)})},e.prototype.stopComponents=function(){var e=this;this.components.forEach(function(t){return e.stopComponent(t)})},e.prototype.onScriptDeleted=function(e){var t=this;this.getComponentsByScriptId(e).forEach(function(e){t.removeComponent(e)})},e.prototype.onComponentChanged=function(e,t){var r=this.getComponentByIndex(e);if(!r)throw new Error("Don't have a component at index "+e);if(t.attributes){this.assignAttributeValues(r,t.attributes);var i=Object.keys(t.attributes);r.trigger("attributesChanged",i)}void 0!==t.name&&(r.name=t.name)},e.prototype.onComponentAdded=function(e){var t=this,r=this.createComponentObject(e);r.trigger("awake"),this.assignAttributeValues(r);var i=r.getScriptAsset(),n=i.getProperty("executeIn"),a=i.getProperty("events");Object.keys(a).forEach(function(e){t.registerEvent(e,a[e],n)});var o=Object.keys(i.getProperty("attributes"));r.trigger("attributesChanged",o),this.isBaseUnloaded()||this.startComponent(r)},e.prototype.onComponentRemoved=function(e){var t=this,r=this.components[e];if(!r)throw new Error("Can't find component at index "+e+" to remove.");var i=r.getScriptAsset(),n=i.getProperty("events");Object.keys(n).forEach(function(e){t.unregisterEvent(e,n[e])}),this.stopComponent(r),this.components.splice(e,1)},e.prototype.translateAttributeValue=function(e,t,r,n){var a=this,o=this.engine;if(!r)throw new Error("Attribute "+t+" does not exist for this component.");switch(r.type){case"asset":e[t]=o.getAssetById(n);break;case"object":e[t]=o.getObjectById(n);break;case"custom":e[t]=e[t]||{},Object.keys(n).forEach(function(i){a.translateAttributeValue(e[t],i,r.attributes[i],n[i])});break;case"c":e[t]=e[t]||new i.Color,e[t].setRGB(n.r,n.g,n.b);break;case"a":e[t]=e[t]||[];var s;switch(r.subType.type){case"asset":n.forEach(function(r,i){e[t][i]=o.getAssetById(r)});break;case"object":n.forEach(function(r,i){e[t][i]=o.getObjectById(r)});break;case"custom":n.forEach(function(i,o){e[t][o]=e[t][o]||{},Object.keys(i).forEach(function(i){a.translateAttributeValue(e[t][o],i,r.subType.attributes[i],n[o][i])})});break;case"a":n.forEach(function(i,o){e[t][o]=e[t][o]||[],i.forEach(function(i,s){a.translateAttributeValue(e[t][o],s.toString(10),r.subType.subType,n[o][s])})});break;case"v2":s=i.Vector2;case"v3":s=s||i.Vector3;case"v4":s=s||i.Vector4;case"q":s=s||i.Quaternion,n.forEach(function(r,i){e[t][i]=e[t][i]||new s,e[t][i].copy(r)});break;default:n.forEach(function(r,i){e[t][i]=r})}break;case"v2":s=i.Vector2;case"v3":s=s||i.Vector3;case"v4":s=s||i.Vector4;case"q":s=s||i.Quaternion,e[t]=e[t]||new s,e[t].copy(n);break;default:e[t]=n}},e.prototype.assignAttributeValues=function(e,t){var r=this,i="object"!=typeof t,n=e.getScriptAsset(),a=n.getProperty("attributes")||{};Object.keys(a).forEach(function(n){if(i||t.hasOwnProperty(n)){var o=a[n],s=e.getAttribute(o.name);r.translateAttributeValue(e,o.name,o,s)}})},e.prototype.createComponentObject=function(e){var t=e.scriptId,r=this.engine.getAssetById(t);if(!r)throw new Error("Unable to find script asset for "+t);r.isUnloaded()&&r.load();var i=new r.sharedData.classConstructor;return this.components.push(i),Object.assign(i,{id:e.id,name:e.name,scriptName:r.getName(),scriptId:t,enabled:!!e.enabled,entity:this}),i.bindSelfEvents(),i},e.prototype.startComponent=function(e){e.trigger("startup")},e.prototype.stopComponent=function(e){e.trigger("shutdown")},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(3),a=function(){function e(){this.ownDependencies={},this.dependencies={}}return e.prototype.getOwnDependencies=function(){var e=this;return Object.keys(this.ownDependencies).map(function(t){return e.engine.getEntityById(t)}).filter(function(e){return e})},e.prototype.getOwnDependencyInfo=function(){return this.ownDependencies},e.prototype.getDependencies=function(e){var t=this,r="function"!=typeof e;return Object.keys(this.dependencies).map(function(e){return t.engine.getEntityById(e)}).filter(function(t){return r||e(t)})},e.prototype.getDependenciesByClass=function(e){return this.getDependencies(function(t){return t instanceof e})},e.prototype.getDependenciesByType=function(e){return this.getDependencies(function(t){return t.type===e})},e.prototype.getDependencyInfo=function(){return this.dependencies},e.prototype.registerDependencyById=function(e){this.registerDependency(this.engine.getEntityById(e))},e.prototype.registerDependency=function(e){var t=this;if(!e)return void n.default.warn("Trying to register invalid entity as a dependency.");var r=this.getOwnDependencyInfo(),a=e.id;r[a]?r[a].count++:(r[a]={count:1},r[a].onSubDependencyChange=function(e,i){if(r[a])for(var n=0;n<r[a].count;n++)e&&t.registerSubDependencyById(e),i&&t.unregisterSubDependencyById(i)},this instanceof i.default&&(!this.isUnloaded()&&e.isUnloaded()&&e.load(),this.listenTo(e,"loadStateChange",this.updateDependencyState),this.updateDependencyState(e)),e.on("change:dependency",r[a].onSubDependencyChange,this));var o=e.getDependencyInfo();Object.keys(o).forEach(function(e){for(var r=o[e],i=0;i<r.count;i++)t.registerSubDependencyById(e)}),this.registerSubDependencyById(a)},e.prototype.unregisterDependencyById=function(e){this.unregisterDependency(this.engine.getEntityById(e))},e.prototype.unregisterDependency=function(e){var t=this;if(e){var r=e.id,n=this.getOwnDependencyInfo(),a=n[r];if(a){a.count--,0===a.count&&(delete n[r],e.off("change:dependency",a.onSubDependencyChange,this),this.stopListening(e,"loadStateChange",this.updateDependencyState),e.isLoaded()?e.isUnloaded()||this.checkIfOwnDependenciesUnloaded()&&this.getOwnDependencies().length&&this.setState(i.StateType.Dependencies,i.State.Pending):this.checkIfOwnDependenciesLoaded()&&this.setState(i.StateType.Dependencies,i.State.Succeeded));var o=e.getDependencyInfo();Object.keys(o).forEach(function(e){for(var r=o[e],i=0;i<r.count;i++)t.unregisterSubDependencyById(e)}),this.unregisterSubDependencyById(r)}}},e.prototype.loadDependencies=function(e){var t=this;if(this instanceof i.default&&("function"==typeof e&&this.once("loadDependencies",e,this),!this.isDependenciesLoaded())){this.setState(i.StateType.Dependencies,i.State.InProgress);var r=this.getDependencyInfo(),n=Object.keys(r);this.engine.loadEntities(n,function(){t.checkIfDependenciesLoaded()&&t instanceof i.default&&t.setState(i.StateType.Dependencies,i.State.Succeeded)})}},e.prototype.unregisterDependencies=function(){var e=this,t=this.getDependencyInfo();Object.keys(t).forEach(function(r){var i=t[r];if(i)for(var n=i.count,a=0;a<n;a++)e.unregisterDependencyById(r)},this)},e.prototype.checkIfOwnDependenciesLoaded=function(){return this.getOwnDependencies().every(function(e){return e&&e.isLoaded()})},e.prototype.checkIfOwnDependenciesUnloaded=function(){return this.getOwnDependencies().every(function(e){return e&&e.isUnloaded()})},e.prototype.checkIfDependenciesLoaded=function(){return this.getDependencies().every(function(e){return e&&e.isLoaded()})},e.prototype.registerSubDependencyById=function(e){this.registerSubDependency(this.engine.getEntityById(e))},e.prototype.registerSubDependency=function(e){if(!e)return void n.default.warn("Trying to register invalid entity as a sub-dependency.");var t=e.id,r=this.dependencies[t];r?r.count++:this.dependencies[t]={count:1},this instanceof i.default&&this.trigger("change:dependency",t,null)},e.prototype.updateDependencyState=function(e){if(e.isLoaded()){if(this.trigger("dependencyLoaded",e),this.checkIfOwnDependenciesLoaded())return void this.setState(i.StateType.Dependencies,i.State.Succeeded)}else if(e.isUnloaded()&&this.checkIfOwnDependenciesUnloaded())return void this.setState(i.StateType.Dependencies,i.State.Pending);this.setState(i.StateType.Dependencies,i.State.InProgress)},e.prototype.unregisterSubDependencyById=function(e){this.unregisterSubDependency(this.engine.getEntityById(e))},e.prototype.unregisterSubDependency=function(e){if(e){var t=e.id,r=this.dependencies[t];r&&(r.count--,0===r.count&&delete this.dependencies[t],this instanceof i.default&&this.trigger("change:dependency",null,t))}},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(5),a=r(6),o=r(10),s=r(52),u=r(34),p=r(53),c=r(69),l=r(21),d=r(70),h=r(55),f=r(123),m=r(56),y=r(41),g=r(14),v=r(22),b=r(57),x=r(71),P=r(58),w=r(59),E=r(60),S=r(61),_=r(42),D=r(62),T=r(35),M=r(63),A=r(64),R=r(65),C=r(25),O=function(){function e(){}return e.prototype.createAnimation=function(e,t){return this.createEntityByClass(s.default,e,t)},e.prototype.createApplication=function(e,t){return this.createEntityByClass(u.default,e,t)},e.prototype.createAudio=function(e,t){return this.createEntityByClass(p.default,e,t)},e.prototype.createBone=function(e,t){return this.createEntityByClass(c.default,e,t)},e.prototype.createBuffer=function(e,t){return this.createEntityByClass(l.default,e,t)},e.prototype.createCamera=function(e,t){return this.createEntityByClass(d.default,e,t)},e.prototype.createDracoGeometry=function(e,t){return this.createEntityByClass(h.default,e,t)},e.prototype.createImage=function(e,t){return this.createEntityByClass(m.default,e,t)},e.prototype.createLight=function(e,t){return this.createEntityByClass(y.default,e,t)},e.prototype.createMaterial=function(e,t){return this.createEntityByClass(g.default,e,t)},e.prototype.createMesh=function(e,t){return this.createEntityByClass(v.default,e,t)},e.prototype.createMeshGeometry=function(e,t){return this.createEntityByClass(b.default,e,t)},e.prototype.createNode=function(e,t){return this.createEntityByClass(x.default,e,t)},e.prototype.createScene=function(e,t){return this.createEntityByClass(_.default,e,t)},e.prototype.createPrefab=function(e,t){return this.createEntityByClass(P.default,e,t)},e.prototype.createPrimitiveGeometry=function(e,t){return this.createEntityByClass(w.default,e,t)},e.prototype.createRenderTexture2d=function(e,t){return this.createEntityByClass(E.default,e,t)},e.prototype.createRenderTextureCube=function(e,t){return this.createEntityByClass(S.default,e,t)},e.prototype.createScript=function(e,t){return this.createEntityByClass(D.default,e,t)},e.prototype.createShader=function(e,t){return this.createEntityByClass(T.default,e,t)},e.prototype.createSkin=function(e,t){return this.createEntityByClass(M.default,e,t)},e.prototype.createTexture2d=function(e,t){return this.createEntityByClass(A.default,e,t)},e.prototype.createTextureCube=function(e,t){return this.createEntityByClass(R.default,e,t)},e.prototype.createVideo=function(e,t){return this.createEntityByClass(C.default,e,t)},e.prototype.createEntityByClass=function(e,t,r){if(!(this instanceof f.default))throw new Error("EntityCreation must be mixed with Engine to be used");return this.createEntity({id:r,type:this.getClassType(e),properties:t})},e.prototype.createEntity=function(e){var t=this;if(!(this instanceof f.default))throw new Error("EntityCreation must be mixed with Engine to work");var r=i.__assign({type:"node",properties:{},components:[]},n.deepClone(e)),o=this.entityDispatcher.dispatchCreatedEntity(e.id,r.type),s=this.getEntityById(o);return s instanceof a.default?this.entityDispatcher.dispatchAttributeChanged(o,"representations",r.representations||[]):(this.entityDispatcher.dispatchChildChanged(o,r.children||[]),this.entityDispatcher.dispatchAttributeChanged(o,"parentId",r.parentId||null),this.entityDispatcher.dispatchAttributeChanged(o,"prefabAssetId",r.prefabAssetId||null),this.entityDispatcher.dispatchAttributeChanged(o,"prefabObjectId",r.prefabObjectId||null),this.entityDispatcher.dispatchAttributeChanged(o,"prefabInstanceId",r.prefabInstanceId||null)),this.entityDispatcher.dispatchInitEntity(o),this.entityDispatcher.dispatchPropertiesChanged(o,r.properties),r.components.forEach(function(e){return t.entityDispatcher.dispatchComponentAdded(o,e)}),r.sid&&this.entityDispatcher.dispatchAttributeChanged(o,"sid",r.sid||""),this.trigger("entityCreated",s),this.getEntityById(o)},e.prototype.destroyAssetById=function(e){if(!(this instanceof f.default))throw new Error("EntityCreation must be mixed with Engine to work");var t=this.getAssetById(e);this.destroyAsset(t)},e.prototype.destroyAsset=function(e){var t=this;if(!(e&&e instanceof a.default))throw new Error("destroyAsset : You must specify a valid asset to destroy.");if(!(this instanceof f.default))throw new Error("EntityCreation must be mixed with Engine to work");if(e.unload(),e instanceof P.default){var r=e.getRootObject();if(r){r.getDescendants().forEach(function(e){t.destroyObject(e)}),r.destroy()}}this.entityDispatcher.dispatchDestroyedEntity(e.id),this.trigger("entityDestroyed",e.id)},e.prototype.destroyObjectById=function(e){if(!(this instanceof f.default))throw new Error("EntityCreation must be mixed with Engine to work");var t=this.getObjectById(e);this.destroyObject(t)},e.prototype.destroyObject=function(e){if(!(e&&e instanceof o.default))throw new Error("destroyObject : You must specify a valid object to destroy.");if(!(this instanceof f.default))throw new Error("EntityCreation must be mixed with Engine to work");var t=e.getParentObject();t&&t.removeChild(e),this.entityDispatcher.dispatchDestroyedEntity(e.id),this.trigger("entityDestroyed",e.id)},e}();t.default=O},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=r(19),a=r(5),o=r(50),s=r(196),u=r(215),p=function(){function e(){this.engines=[],this.entities={}}return e.prototype.addEngine=function(e){if(e)if(-1===this.engines.indexOf(e)){var t=this.getEntityDescriptors();t.forEach(function(t){return e.registerEntity(t)}),t.forEach(function(t){return e.getEntityById(t.id).initialize()}),t.forEach(function(t){return e.getEntityById(t.id).trigger("change:properties",t.properties)}),t.forEach(function(t){return e.trigger("entityCreated",e.getEntityById(t.id))}),t.forEach(function(t){return t.components.forEach(function(r){return e.getEntityById(t.id).trigger("add:component",r)})}),t.forEach(function(t){if(s.isObject(t)){var r=e.getObjectById(t.id),i=r.getChildren();r.trigger("change:children",i,[])}}),this.engines.push(e)}else i.default.warn("The engine, "+e.getName()+", has already been registered.")},e.prototype.removeEngine=function(e){var t;if(e)if(-1!==(t=this.engines.indexOf(e))){var r=this.engines.splice(t,1),n=r[0].getThreeRenderer();0===this.engines.length&&n&&n.extensions.get("WEBGL_lose_context")&&n.forceContextLoss()}else i.default.warn("The engine, "+e.getName()+" isn't currently registered.")},e.prototype.addEntities=function(e){var t=this,r=e.filter(function(e){return!t.entities[e.id]});return r.forEach(function(e){e.id=t.dispatchCreatedEntity(e.id,e.type),e.sid&&t.dispatchAttributeChanged(e.id,"sid",e.sid||""),s.isAsset(e)&&e.representations?t.dispatchAttributeChanged(e.id,"representations",e.representations||[]):s.isObject(e)&&(e.parentId&&t.dispatchAttributeChanged(e.id,"parentId",e.parentId||null),e.prefabAssetId&&t.dispatchAttributeChanged(e.id,"prefabAssetId",e.prefabAssetId),e.prefabObjectId&&t.dispatchAttributeChanged(e.id,"prefabObjectId",e.prefabObjectId),e.prefabInstanceId&&t.dispatchAttributeChanged(e.id,"prefabInstanceId",e.prefabInstanceId))}),r.forEach(function(e){return t.dispatchInitEntity(e.id)}),r.forEach(function(e){return t.dispatchPropertiesChanged(e.id,e.properties||{})}),r.forEach(function(e){s.isObject(e)&&t.dispatchChildChanged(e.id,e.children||[])}),r.forEach(function(e){e.components&&e.components.forEach(function(r){return t.dispatchComponentAdded(e.id,r)})}),r.forEach(function(e){return t.engines.forEach(function(t){return t.trigger("entityCreated",t.getEntityById(e.id))})}),r},e.prototype.getEntityDescriptors=function(){var e=this;return Object.keys(this.entities).map(function(t){return e.entities[t]})},e.prototype.dispatchInitEntity=function(e){this.engines.forEach(function(t){var r=t.getEntityById(e);r&&r.initialize()})},e.prototype.dispatchCreatedEntity=function(e,t){if(this.entities[e])return e;var r=e||n.v4(),i={id:r,sid:r,type:t,properties:{},previousProperties:{},components:[],previousComponents:[]};return this.entities[i.id]=i,this.fireExternalUpdate(r,i,"createEntity"),this.engines.forEach(function(e){return e.registerEntity(i)}),r},e.prototype.dispatchDestroyedEntity=function(e){if(!this.entities[e])return void i.default.error("Can't destroy an entity with ID, "+e+", that doesn't exist.");this.fireExternalUpdate(e,{},"destroyEntity"),this.engines.forEach(function(t){return t.unregisterEntityById(e)}),delete this.entities[e]},e.prototype.dispatchAttributeChanged=function(e,t,r){if(this.entities[e]){var i=this.entities[e];i[t]=r,this.fireExternalUpdate(e,i),this.engines.forEach(function(i){i.getEntityById(e).trigger("change:"+t,r)})}},e.prototype.dispatchPropertyChanged=function(e,t,r,i){var n={};n[t]=r,this.dispatchPropertiesChanged(e,n,i)},e.prototype.dispatchPropertiesChanged=function(e,t,r){if(void 0===t&&(t={}),this.entities[e]){var i=this.entities[e];Object.keys(t).forEach(function(e){if(i.previousProperties[e]=a.deepClone(i.properties[e]),void 0===t[e])return void delete i.properties[e];i.properties[e]=a.deepClone(t[e])}),this.fireExternalUpdate(e,{properties:i.properties}),r||this.engines.forEach(function(r){var i=r.getEntityById(e);i&&(Object.keys(t).forEach(function(e){var r=t[e];i.trigger("change:properties."+e,r)}),i.trigger("change:properties",t))})}},e.prototype.dispatchChildAdded=function(e,t,r){var i=this.entities[e];if(i){var n=i.children=i.children||[];i.previousChildren=i.children.slice(),i.children.push(t),this.fireExternalUpdate(e,{children:n}),r||this.engines.forEach(function(r){var i=r.getEntityById(e),n=[r.getObjectById(t)];i.trigger("change:children",n,[])})}},e.prototype.dispatchChildRemoved=function(e,t,r){var i=this.entities[e];if(i){var n=i.children=i.children||[];i.previousChildren=i.children.slice();var a=i.children.indexOf(t);-1!==a&&i.children.splice(a,1),this.fireExternalUpdate(e,{children:n}),r||this.engines.forEach(function(r){var i=r.getEntityById(e),n=[r.getObjectById(t)];i.trigger("change:children",[],n)})}},e.prototype.dispatchChildChanged=function(e,t,r){var i=this;void 0===t&&(t=[]);var n=this.entities[e];if(n){n.previousChildren=n.children?n.children.slice():[];var a=n.children=t.slice();if(this.fireExternalUpdate(e,{children:a}),!r){var o={},s={};n.previousChildren.forEach(function(e){return o[e]=i.entities[e]}),a.forEach(function(e){return s[e]=i.entities[e]});var u=a.filter(function(e){return i.entities[e]&&!o[e]}),p=n.previousChildren.filter(function(e){return i.entities[e]&&!s[e]});this.engines.forEach(function(t){var r=t.getEntityById(e),i=u.map(function(e){return t.getObjectById(e)}),n=p.map(function(e){return t.getObjectById(e)});r.trigger("change:children",i,n)})}}},e.prototype.dispatchComponentChanged=function(e,t,r,i){void 0===i&&(i=!1);var n=this.entities[e];if(n){var o=Math.min(Math.max(t,0),n.components.length-1);if(!(o<0)){n.previousComponents||(n.previousComponents=[]),n.previousComponents[t]=a.deepClone(n.components[t]);var s=n.components[o],u=a.deepClone(r);if(Object.keys(u).forEach(function(e){"attributes"!==e&&(s[e]=u[e])}),u.attributes){var p=s.attributes||{};Object.keys(p).forEach(function(e){u.attributes.hasOwnProperty(e)&&void 0===u.attributes[e]&&(u.attributes[e]=void 0,delete p[e])}),Object.keys(u.attributes).forEach(function(e){p[e]=u.attributes[e]})}this.fireExternalUpdate(e,{components:n.components}),i||this.engines.forEach(function(t){t.getEntityById(e).trigger("change:component",o,u)})}}},e.prototype.dispatchComponentRemoved=function(e,t){var r=this.entities[e];if(r||!(t>=r.components.length-1)){var i=Math.min(Math.max(t,0),r.components.length-1);i<0||(r.previousComponents=r.components?r.components.slice():[],r.components.splice(i,1),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){t.getEntityById(e).trigger("remove:component",i)}))}},e.prototype.dispatchComponentAdded=function(e,t){var r=this.entities[e];if(r){r.previousComponents=r.components?r.components.slice():[];var i=a.deepClone(t);i.id=i.id||n.v4(),i.name=i.name||"",i.attributes=i.attributes||{},i.enabled=!1!==i.enabled,r.components.push(i),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){t.getEntityById(e).trigger("add:component",i)})}},e.prototype.fireExternalUpdate=function(e,t,r){var i=new u.default;i.type=r||"updateEntity",i.entityId=e,i.entityData=t,o.default.trigger("EntityUpdates",i)},e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(52),n=r(34),a=r(53),o=r(6),s=r(10),u=r(69),p=r(21),c=r(70),l=r(78),d=r(55),h=r(56),f=r(41),m=r(14),y=r(22),g=r(57),v=r(71),b=r(58),x=r(59),P=r(60),w=r(61),E=r(42),S=r(62),_=r(35),D=r(63),T=r(64),M=r(65),A=r(25),R=function(){function e(){this.objects={},this.assets={}}return e.prototype.destroy=function(){var e=this;this.getAssets().forEach(function(t){return e.unregisterEntity(t)}),this.getObjects().forEach(function(t){return e.unregisterEntity(t)})},e.prototype.getAsset=function(e){return this.getEntity(e,this.assets)},e.prototype.getAssets=function(e){return this.getEntities(e,this.assets)},e.prototype.getAssetById=function(e){return this.assets[e]||null},e.prototype.getAssetByName=function(e){return this.getAsset(function(t){return t.getName()===e})},e.prototype.getAssetsByName=function(e){return this.getAssets(function(t){return t.getName()===e})},e.prototype.getAssetByClass=function(e){return this.getAsset(function(t){return t instanceof e})},e.prototype.getAssetByType=function(e){return this.getAsset(function(t){return t.type===e})},e.prototype.getAssetsByClass=function(e){return this.getAssets(function(t){return t instanceof e})},e.prototype.getAssetsByType=function(e){return this.getAssets(function(t){return t.type===e})},e.prototype.getObject=function(e){return this.getEntity(e,this.objects)},e.prototype.getObjects=function(e){return this.getEntities(e,this.objects)},e.prototype.getObjectById=function(e){return this.objects[e]||null},e.prototype.getObjectByName=function(e){return this.getObject(function(t){return t.getName()===e})},e.prototype.getObjectsByName=function(e){return this.getObjects(function(t){return t.getName()===e})},e.prototype.getObjectByClass=function(e){return this.getObject(function(t){return t instanceof e})},e.prototype.getObjectByType=function(e){return this.getObject(function(t){return t.type===e})},e.prototype.getObjectsByType=function(e){return this.getObjects(function(t){return t.type===e})},e.prototype.getObjectsByClass=function(e){return this.getObjects(function(t){return t instanceof e})},e.prototype.getEntity=function(e,t){if(!t)return this.getAsset(e)||this.getObject(e);var r=Object.keys(t).find(function(r){return e(t[r])});return t[r]},e.prototype.getEntities=function(e,t){if(!t)return this.getObjects(e).concat(this.getAssets(e));var r="function"!=typeof e;return Object.keys(t).filter(function(i){return r||e(t[i])}).map(function(e){return t[e]})},e.prototype.getEntityById=function(e){return this.assets[e]||this.objects[e]||null},e.prototype.getEntityByClass=function(e){return this.getEntity(function(t){return t instanceof e})},e.prototype.getEntityByType=function(e){return this.getEntity(function(t){return t.type===e})},e.prototype.getEntitiesByClass=function(e){return this.getEntities(function(t){return t instanceof e})},e.prototype.getEntitiesByType=function(e){return this.getEntities(function(t){return t.type===e})},e.prototype.getEntityByName=function(e){return this.getEntity(function(t){return t.getName()===e})},e.prototype.getEntitiesByName=function(e){return this.getEntities(function(t){return t.getName()===e})},e.prototype.unregisterEntityById=function(e){this.unregisterEntity(this.getEntityById(e))},e.prototype.unregisterEntity=function(e){e&&(e.uninitialize(),this.objects[e.id]?delete this.objects[e.id]:(e.off("load",this.onAssetLoaded,this),e.off("unload",this.onAssetUnloaded,this),delete this.assets[e.id]))},e.prototype.getClassType=function(e){switch(e){case i.default:return"animation";case n.default:return"application";case a.default:return"audio";case u.default:return"bone";case p.default:return"buffer";case c.default:return"camera";case l.default:return"document";case d.default:return"dracoGeometry";case h.default:return"image";case f.default:return"light";case m.default:return"material";case y.default:return"mesh";case g.default:return"meshGeometry";case v.default:return"node";case b.default:return"prefab";case x.default:return"primitiveGeometry";case P.default:return"renderTexture2D";case w.default:return"renderTextureCube";case E.default:return"scene";case S.default:return"script";case _.default:return"shader";case D.default:return"skin";case T.default:return"texture2D";case M.default:return"textureCube";case A.default:return"video";default:return null}},e.prototype.getEntityClass=function(t){return e.entityNameTypeMap[t]?e.entityNameTypeMap[t]:"object"===t?s.default:"asset"===t?o.default:null},e.prototype.registerEntity=function(e){var t=new(this.getEntityClass(e.type))(e);t.engine=this,t instanceof o.default?(this.assets[t.id]=t,t.on("load",this.onAssetLoaded,this),t.on("unload",this.onAssetUnloaded,this)):this.objects[t.id]=t},e.prototype.onAssetLoaded=function(e){this.trigger("assetLoaded",e)},e.prototype.onAssetUnloaded=function(e){this.trigger("assetUnloaded",e)},e.entityNameTypeMap={animation:i.default,application:n.default,audio:a.default,bone:u.default,buffer:p.default,camera:c.default,document:l.default,dracoGeometry:d.default,image:h.default,light:f.default,material:m.default,mesh:y.default,meshGeometry:g.default,node:v.default,prefab:b.default,primitiveGeometry:x.default,renderTexture2D:P.default,renderTextureCube:w.default,scene:E.default,script:S.default,shader:_.default,skin:D.default,texture2D:T.default,textureCube:M.default,video:A.default},e}();t.default=R},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.type="updateEntity",this.entityId="",this.entityData={}}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(9),a=function(){function e(){this.events={}}return e.prototype.registerEvent=function(e,t,r){var i={parameters:t.parameters||[],action:!!t.action,category:t.category,refCount:1,executeIn:r},n=this.getRegisteredEventsFromScope(t);n[e]?(n[e].refCount++,"runtime"!==r&&"all"!==r||(n[e].executeIn=r)):n[e]=i},e.prototype.unregisterEvent=function(e,t){var r=this.getRegisteredEventsFromScope(t);r[e]&&0===--r[e].refCount&&delete r[e]},e.prototype.getAvailableEvents=function(e){void 0===e&&(e="player");for(var t=i.__assign({},this.constructor.events,this.events),r=Object.getPrototypeOf(this);r;){if(r.constructor.hasOwnProperty("events")){var n={};for(var a in r.constructor.events){var o=r.constructor.events[a],s=o.executeIn||"runtime";("editor"===e&&"runtime"!==s||"player"===e&&"editor"!==s)&&(n[a]=o)}t=i.__assign({},t,n)}r=Object.getPrototypeOf(r)}return t},e.prototype.getRegisteredEventsFromScope=function(e){if("other"===e.scope){if(e.filter&&e.filter.length){return this.engine.getEntityClass(e.filter[0]).events}return n.default.events}return"local"===e.scope?this.events:this.engine.registeredGlobalEvents},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(219),a=r(251),o=r(250),s={id:"box3d_pbr_shader",type:"shader",properties:{name:"PBR Shader",vertexShader:a,fragmentShader:o,parameters:n.default,uniforms:i.UniformsUtils.merge([i.UniformsLib.common,i.UniformsLib.emissivemap,i.UniformsLib.bumpmap,i.UniformsLib.normalmap,i.UniformsLib.roughnessmap,i.UniformsLib.metalnessmap,i.UniformsLib.displacementmap,i.UniformsLib.fog,i.UniformsLib.lights,{time:{value:1},emissive:{value:new i.Color(0)},specular:{value:new i.Color(1118481)},roughness:{value:0},metalness:{value:0},clearCoat:{value:0},clearCoatRoughness:{value:0},envMapIntensity:{value:1}}])}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={albedoColor:{displayName:"Base Albedo",description:"A color to tint the material with.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isUniform:!0,uniformName:"diffuse"},albedoMap:{displayName:"Albedo Map",description:"A texture that modifies the diffuse color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,uniformName:"map",enabledWhen:{albedoMap:{notEqualsDefault:!0}}},opacity:{displayName:"Opacity",description:"This option controls the total opacity of the material.",type:"f",default:1,min:0,max:1,isUniform:!0,isRenderParam:!0,transparency:"LessThanOne"},alphaMap:{displayName:"Alpha Map",description:"A texture that stores the transparency info of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,transparency:"NotFalsy",enabledWhen:{alphaMap:{notEqualsDefault:!0}}},specularColor:{displayName:"Specular Color",description:"A color to tint the material with.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isUniform:!0,uniformName:"specular"},specularMap:{displayName:"Specular Map",description:"A texture that contains the specular color of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{specularMap:{notEqualsDefault:!0}}},metalness:{displayName:"Metalness",description:"How metallic the surface appears (multiplied by the metalness texture).",type:"f",min:0,max:1,default:0,isUniform:!0,enabledWhen:{metalness:{notEqualsDefault:!0}}},metalnessMap:{displayName:"Metalness Map",description:"A texture that contains the metalness of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{metalnessMap:{notEqualsDefault:!0}}},glossMap:{displayName:"Gloss Map",description:"A texture that stores the gloss info of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{glossMap:{notEqualsDefault:!0},roughnessMap:{equalsDefault:!0}}},roughness:{displayName:"Roughness",description:"How rough the surface appears.",type:"f",min:0,max:1,default:0,isUniform:!0,isRenderParam:!0},roughnessMap:{displayName:"Roughness Map",description:"A texture that stores the roughness info of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{roughnessMap:{notEqualsDefault:!0}}},reflectivity:{displayName:"Reflectivity",description:"Reflectivity at normal incidence. i.e. when viewing the surface directly.",type:"f",min:0,max:1,default:.02,isUniform:!0,uniformName:"reflectivity"},normalMap:{displayName:"Normal Map",description:"A texture containing tangent-space surface normals.",type:"t",default:null,isUniform:!0,isRenderParam:!0,derivatives:!0,textureUsage:"normal",enabledWhen:{normalMap:{notEqualsDefault:!0}}},normalScale:{displayName:"Normal Scale",description:"Scales the surface normals from the normal map to be more intense. i.e. Higher values result in normals that are closer to parallel to the geometry.",type:"v2",default:{x:1,y:1},isUniform:!0,isRenderParam:!0},bumpMap:{displayName:"Bump Map",description:"A texture containing greyscale height data. Can give the illusion of surface detail when lit.",type:"t",default:null,isUniform:!0,isRenderParam:!0,derivatives:!0,textureUsage:"bump",enabledWhen:{normalMap:{equalsDefault:!0},bumpMap:{notEqualsDefault:!0}}},bumpScale:{displayName:"Bump Scale",description:"A value to multiple the bumpMap amount by.",type:"f",min:0,max:20,default:1,isUniform:!0,isRenderParam:!0,enabledWhen:{normalMap:{equalsDefault:!0},bumpMap:{notEqualsDefault:!0}},displayWhen:{useBump:{equals:!0}}},clearCoat:{displayName:"Clear Coat",description:"Amount (thickness) of clear coat on top of surface. Between 0 and 1.",type:"f",min:0,max:1,isUniform:!0,isRenderParam:!0,default:0,enabledWhen:{clearCoat:{notEquals:0}}},clearCoatRoughness:{displayName:"Clear Coat Roughness",description:"Roughness of the clear coat layer. Between 0 and 1.",type:"f",min:0,max:1,isUniform:!0,isRenderParam:!0,default:0,enabledWhen:{clearCoat:{notEquals:0}}},envMapRadiance:{displayName:"Radiance Light Map",description:"A map that represents the surrounding environment. Used for reflections.",type:"t",default:null,isUniform:!0,forceUpdate:!0,enabledWhen:{envMapRadiance:{notEqualsDefault:!0}}},envMapRadianceHalfGloss:{displayName:"Half Radiance Light Map",description:"A cube-map that represents the surrounding environment. Used for reflections.",type:"t",textureType:"Cube",default:null,isUniform:!0,enabledWhen:{envMapIrradiance:{notEqualsDefault:!0},envMapRadiance:{notEqualsDefault:!0},envMapRadianceHalfGloss:{notEqualsDefault:!0}}},envMapIrradiance:{displayName:"Irradiance Light Map",description:"A cube-map that represents the surrounding environment. Used for reflections.",type:"t",textureType:"Cube",default:null,isUniform:!0,enabledWhen:{envMapIrradiance:{notEqualsDefault:!0}},displayWhen:{envMapIrradiance:{notEqualsDefault:!0}}},envMapGlossVariance:{displayName:"Environment Map Gloss Variance",description:"Turn on multi-sampling of environment map based on varying glossiness of surface.",type:"b",default:!0,forceUpdate:!0,enabledWhen:{envMapGlossVariance:{equals:!0}}},emissiveColor:{displayName:"Emissive Color",description:"A color that represents the light emitted by the material.",type:"c",default:{r:0,g:0,b:0},isUniform:!0,isRenderParam:!0,uniformName:"emissive",enabledWhen:{emissiveColor:{notEqualsDefault:!0}}},emissiveMap:{displayName:"Emissive Map",description:"A texture that modifies the emissive color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{emissiveMap:{notEqualsDefault:!0}}},aoMap:{displayName:"AO Map",description:"The ambient occlusion of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{aoMap:{notEqualsDefault:!0}}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=r(39),o={id:"fbx_surface_lambert_shader",type:"shader",properties:{name:"FBX Surface Lambert Shader",vertexShader:"MeshLambertMaterial",fragmentShader:"MeshLambertMaterial",parameters:i.__assign({},n.default,a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=r(68),o=r(39),s={id:"fbx_surface_phong_shader",type:"shader",properties:{name:"FBX Surface Phong Shader",vertexShader:"MeshPhongMaterial",fragmentShader:"MeshPhongMaterial",parameters:i.__assign({},n.default,{specular:{displayName:"Specular Color",description:"The color reflected specularly by the surface from lights",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"specular"},specularTexture:{displayName:"Specular Map",description:"The color reflected specularly by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"specularMap",enabledWhen:{specularTexture:{notEqualsDefault:!0}}},shininess:{displayName:"Shininess",description:"The shininess exponent of the surface. Higher is glossier.",type:"f",default:30,min:0,max:512,isRenderParam:!0,uniformName:"shininess"}},a.default,o.default)}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),n=r(20),a=function(){function e(e){this.engine=e,this.standInTextures=[],this.engine=e,this.engine.on("rebuildMaterials",this.rebuildAll,this),this.engine.on("rendererResize",this.onResize,this),this.engine.on("update",this.update,this),this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE]={texture:null,color:[255,255,255]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE_CUBE]={texture:null,color:[255,255,255],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK]={texture:null,color:[0,0,0]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK_CUBE]={texture:null,color:[0,0,0],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_NORMAL]={texture:null,color:[127,127,255]}}return e.prototype.destroy=function(){this.engine.off("rebuildMaterials",this.rebuildAll,this),this.engine.off("rendererResize",this.onResize,this),this.engine.off("update",this.update,this),this.standInTextures.forEach(function(e){e.texture&&e.texture.dispose()})},e.prototype.getMissingMaterial=function(){return this.engine.getAssetById("missingMaterial")},e.prototype.getStandInTexture=function(e){if(!this.standInTextures[e])return null;if(!this.standInTextures[e].texture){var t=this.standInTextures[e].color;"Cube"===this.standInTextures[e].type?this.standInTextures[e].texture=n.default.createColorTextureCube(t[0],t[1],t[2]):this.standInTextures[e].texture=n.default.createColorTexture(t[0],t[1],t[2])}return this.standInTextures[e].texture},e.prototype.update=function(e){i.default.timeValueInUse&&(this.engine.needsRender=!0),i.default.sharedUniforms.time.value=e},e.prototype.rebuildAll=function(){this.engine.getAssetsByClass(i.default).forEach(function(e){e.runtimeData&&Object.keys(i.default.materialObjectTypes).forEach(function(t){e.runtimeData[t].needsUpdate=!0})})},e.prototype.onResize=function(){var e=i.default.sharedUniforms.screenDimensions;e.value.x=0,e.value.y=0;var t=this.engine.getRenderer();t?(e.value.z=t.getCanvasWidth(),e.value.w=t.getCanvasHeight()):(e.value.z=128,e.value.w=128)},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(124),o=r(225),s=r(68),u=r(40),p=r(39),c={id:"three_physical_shader",type:"shader",properties:{name:"Three.js Physical Shader",vertexShader:"MeshPhysicalMaterial",fragmentShader:"MeshPhysicalMaterial",parameters:i.__assign({},u.default,a.default,s.default,o.default,p.default),uniforms:n.UniformsUtils.merge([n.UniformsLib.envmap,n.UniformsLib.fog,n.UniformsLib.lights])}};t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(124),o=r(68),s=r(40),u=r(39),p={id:"three_standard_shader",type:"shader",properties:{name:"Three.js Standard Shader",vertexShader:"MeshStandardMaterial",fragmentShader:"MeshStandardMaterial",parameters:i.__assign({},s.default,a.default,o.default,u.default),uniforms:n.UniformsUtils.merge([n.UniformsLib.envmap,n.UniformsLib.fog,n.UniformsLib.lights])}};t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={clearCoat:{displayName:"Clear Coat Amount",description:"The strength/thickness of the clear coat on top of the material.",type:"f",min:0,max:1,default:0,isRenderParam:!0},clearCoatRoughness:{displayName:"Clear Coat Roughness",description:"How rough the clear coat surface appears.",type:"f",min:0,max:1,default:0,isRenderParam:!0}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(27),a=r(72),o=r(11),s=r(233),u=r(49);t.loadableResourceMixins=u.default({},[n.default]);var p=function(e){function t(t,r,i){void 0===i&&(i={});var n=e.call(this)||this;if(n.path=t,n.type=r,n.params=i,n.state=a.default.STARTING,n.error=void 0,n.data=void 0,n.loaderData={},!t)throw new Error("Missing required `path` argument");if(!r)throw new Error("Missing required `type` argument");return n}return i.__extends(t,e),t.prototype.setState=function(e){switch(e){case a.default.STARTING:throw new s.default(this.state,e);case a.default.LOADING:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.PROCESSING:if(this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.COMPLETE:if(this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.CANCELLED:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING&&this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.ERROR:break;default:throw new Error("Unknown state: "+e)}return this.state=e,this.trigger(o.default.STATE_CHANGE,e),e},t.prototype.setLoading=function(){this.setState(a.default.LOADING)},t.prototype.setProcessing=function(){this.setState(a.default.PROCESSING)},t.prototype.setComplete=function(e){this.setState(a.default.COMPLETE),this.data=e,this.trigger(o.default.LOAD,e),this.done()},t.prototype.setError=function(e){this.setState(a.default.ERROR),this.error=e,this.trigger(o.default.ERROR,e),this.done()},t.prototype.setCancelled=function(){this.setState(a.default.CANCELLED),this.trigger(o.default.CANCEL),this.done()},t.prototype.isCancelled=function(){return this.state===a.default.CANCELLED},t.prototype.done=function(){this.trigger(o.default.DONE,this.state),this.off()},t}(t.loadableResourceMixins);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return e.setProcessing(),e.setComplete(e.loaderData.xhr.response),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("arraybuffer")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(253),n=r(196),a=r(26),o=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response,r=e.path.indexOf("?"),a=r>=0?r:e.path.length,o=e.path.slice(0,e.path.lastIndexOf("/",a)+1);if(void 0===t||void 0===t.version||t.version.major>4)return Promise.reject(new Error("Unsupported data version"));var s=new RegExp(/^(?:[a-z]+:)?\/\//i),u=new RegExp(/^\//),p=function(e){return!e.match(s)&&!e.match(u)},c=i.mapEntities(t.entities,t.version);return c.forEach(function(e){if(n.isAsset(e)&&e.representations&&e.representations.forEach(function(e){e.src&&p(e.src)&&(e.src=o+e.src)}),"buffer"===e.type){var t=e.properties;t.src&&p(t.src)&&(t.src=o+t.src)}}),e.setComplete(c),Promise.resolve(e)};t.default=function(e,t){return a.retry(function(e){return 202===e.loaderData.xhr.status},[a.unlessCancelled(a.makeXhr(t)),a.unlessCancelled(a.setResponseType("json")),a.unlessCancelled(a.setCustomHeaders),a.unlessCancelled(a.loadXhr)])(e).then(a.unlessCancelled(a.requireStatus(function(e){return 200===e}))).then(a.unlessCancelled(o)).catch(a.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return new Promise(function(t){if(e.setProcessing(),e.loaderData.xhr.response instanceof Blob){var r=URL.createObjectURL(e.loaderData.xhr.response),i=new Image;i.onload=function(){e.setComplete(i),t(e)},i.src=r}else e.setComplete(e.loaderData.xhr.response),t(e)})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response;return e.setComplete(t),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("json")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return new Promise(function(t,r){e.setProcessing();var i=URL.createObjectURL(e.loaderData.xhr.response),n=document.createElement("video");n.addEventListener("loadeddata",function(){e.setComplete(n),t(e)}),n.addEventListener("error",function(){return r(new Error("Failed to load video"))}),n.src=i,n.load()})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=r(11),a=r(9),o=function(){function e(){this.loadingResources=[]}return e.prototype.loadResource=function(e,t,r,o){var s=this;void 0===o&&(o={});var u=this.engine.resourceLoader.load(e,t,o);return this.loadingResources.push(u),u.on(n.default.ERROR,function(e){i.default.error(s.engine.getName()+" - ResourceLifecycle: Error loading "+s.type+","+s.getName()+", "+e.toString()),s.setState(a.StateType.Base,a.State.Failed)}),u.on(n.default.DONE,function(){s.loadingResources=s.loadingResources.filter(function(e){return e!==u}),"function"==typeof r&&r()}),u},e.prototype.abortRequests=function(){this.loadingResources.forEach(function(e){return e.setCancelled()})},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(72),a=function(e){function t(t,r){var i=e.call(this,'Illegal state transition "'+n.default[t]+'" -> "'+n.default[r]+'"')||this;return i.from=t,i.to=r,i}return i.__extends(t,e),t}(Error);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(226),n=r(242),a=r(227),o=r(229),s=r(230),u=r(231),p=r(228),c=r(11),l=r(15),d=4,h=function(e,t){var r=new XMLHttpRequest;return r.open("GET",e),Promise.resolve(r)},f=[];f[l.default.BUFFER]=a.default,f[l.default.IMAGE]=o.default,f[l.default.VIDEO]=u.default,f[l.default.ENTITIES]=p.default,f[l.default.JSON]=s.default;var m=function(){function e(e,t){if(void 0===e&&(e=h),void 0===t&&(t=f),this.xhrPromise=e,this.strategies=t,this.resources={},!e)throw new Error("Must provide argument `xhrPromise`!");if(!t)throw new Error("Must provide argument `strategies`!");this.queue=n.default(d)}return e.prototype.destroy=function(){this.queue.destroy()},e.prototype.load=function(e,t,r){var n=this;if(!this.strategies[t])throw new Error("Unsupported type: "+t);if(this.resources[e])return this.resources[e];var a=this.resources[e]=new i.default(e,t,r);return this.queue.add(function(){return new Promise(function(r){var i=function(){delete n.resources[e],a.off(c.default.LOAD,i),a.off(c.default.ERROR,i),a.off(c.default.CANCEL,i),r(a)};a.once(c.default.LOAD,i),a.once(c.default.ERROR,i),a.once(c.default.CANCEL,i),n.strategies[t](a,n.xhrPromise)})},r.priority),a},e}();t.default=m},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e){this.cubeLods=e;var t=4*e[0].width;this.camera=new i.OrthographicCamera(.5*-t,.5*t,.5*-t,.5*t,0,1e3),this.scene=new i.Scene,this.scene.add(this.camera),this.objects=[];var r=[];r.push(new i.Vector2(0,0)),r.push(new i.Vector2(1,0)),r.push(new i.Vector2(2,0)),r.push(new i.Vector2(0,1)),r.push(new i.Vector2(1,1)),r.push(new i.Vector2(2,1));var n=t;t=e[0].width;var a=0,o=4;this.numLods=Math.log(e[0].width)/Math.log(2)-2;for(var s=0;s<this.numLods;s++){var u=.5*(n-n/o);t>16&&(o*=2);for(var p=t>16?6:1,c=0,l=0,d=t,h=0;h<p;h++){for(var f=0;f<6;f++){var m=this.getShader();m.uniforms.envMap.value=this.cubeLods[s].texture,m.uniforms.faceIndex.value=f,m.uniforms.mapSize.value=d;var y=new i.Mesh(new i.PlaneGeometry(d,d,0),m);y.position.x=r[f].x*d-u+c,y.position.y=r[f].y*d-u+a+l,y.material.side=i.DoubleSide,this.scene.add(y),this.objects.push(y)}l+=1.75*d,c+=1.25*d,d/=2}a+=2*t,t>16&&(t/=2)}}return e.prototype.setDestinationTexture=function(e){var t=this.cubeLods[0].width;this.CubeUVRenderTarget=e,this.CubeUVRenderTarget.setSize(t,t),this.CubeUVRenderTarget.texture.name="PMREMCubeUVPacker.cubeUv"},e.prototype.dispose=function(){this.cubeLods.forEach(function(e){e.dispose()}),this.cubeLods=[]},e.prototype.update=function(e){var t=e.gammaInput,r=e.gammaOutput,n=e.toneMapping,a=e.toneMappingExposure;e.gammaInput=!1,e.gammaOutput=!1,e.toneMapping=i.LinearToneMapping,e.toneMappingExposure=1,e.render(this.scene,this.camera,this.CubeUVRenderTarget,!1),e.toneMapping=n,e.toneMappingExposure=a,e.gammaInput=t,e.gammaOutput=r},e.prototype.getShader=function(){return new i.ShaderMaterial({uniforms:{faceIndex:{value:0},mapSize:{value:0},envMap:{value:null},testColor:{value:new i.Vector3(1,1,1)}},vertexShader:"precision highp float; varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 ); }",fragmentShader:"precision highp float; varying vec2 vUv; uniform samplerCube envMap; uniform float mapSize; uniform vec3 testColor; uniform int faceIndex; void main() { vec3 sampleDirection; vec2 uv = vUv; uv = uv * 2.0 - 1.0; uv.y *= -1.0; if(faceIndex == 0) { sampleDirection = normalize(vec3(1.0, uv.y, -uv.x)); } else if(faceIndex == 1) { sampleDirection = normalize(vec3(uv.x, 1.0, uv.y)); } else if(faceIndex == 2) { sampleDirection = normalize(vec3(uv.x, uv.y, 1.0)); } else if(faceIndex == 3) { sampleDirection = normalize(vec3(-1.0, uv.y, uv.x)); } else if(faceIndex == 4) { sampleDirection = normalize(vec3(uv.x, -1.0, -uv.y)); } else { sampleDirection = normalize(vec3(-uv.x, uv.y, -1.0)); } vec4 color = envMapTexelToLinear( textureCube( envMap, sampleDirection ) ); gl_FragColor = linearToOutputTexel( color ); }",blending:i.CustomBlending,premultipliedAlpha:!1,blendSrc:i.OneFactor,blendDst:i.ZeroFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.ZeroFactor,blendEquation:i.AddEquation})},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e){this.sourceTexture=e,this.resolution=256,this.samplesPerLevel=32;var t=e.encoding===i.LinearEncoding||e.encoding===i.GammaEncoding||e.encoding===i.sRGBEncoding;this.sourceTexture.minFilter=t?i.LinearFilter:i.NearestFilter,this.sourceTexture.magFilter=t?i.LinearFilter:i.NearestFilter,this.sourceTexture.generateMipmaps=!1,this.cubeLods=[];var r=this.resolution,n={format:this.sourceTexture.format,magFilter:this.sourceTexture.magFilter,minFilter:this.sourceTexture.minFilter,type:this.sourceTexture.type,generateMipmaps:this.sourceTexture.generateMipmaps,anisotropy:this.sourceTexture.anisotropy,encoding:this.sourceTexture.encoding};this.numLods=Math.log(r)/Math.log(2)-2;for(var a=0;a<this.numLods;a++){var o=new i.WebGLRenderTargetCube(r,r,n);o.texture.name="PMREMGenerator.cube"+a,this.cubeLods.push(o),r=Math.max(16,r/2)}this.camera=new i.OrthographicCamera(-1,1,1,-1,0,1e3),this.shader=this.getShader(),this.shader.defines.SAMPLES_PER_LEVEL=this.samplesPerLevel,this.planeMesh=new i.Mesh(new i.PlaneGeometry(2,2,0),this.shader),this.planeMesh.material.side=i.DoubleSide,this.scene=new i.Scene,this.scene.add(this.planeMesh),this.scene.add(this.camera),this.shader.uniforms.envMap.value=this.sourceTexture}return e.prototype.dispose=function(){this.cubeLods.forEach(function(e){e.dispose()}),this.cubeLods=[]},e.prototype.update=function(e){this.shader.uniforms.envMap.value=this.sourceTexture;var t=e.gammaInput,r=e.gammaOutput,n=e.toneMapping,a=e.toneMappingExposure;e.toneMapping=i.LinearToneMapping,e.toneMappingExposure=1,e.gammaInput=!1,e.gammaOutput=!1;for(var o=0;o<this.numLods;o++){var s=o/(this.numLods-1);this.shader.uniforms.roughness.value=.9*s,this.shader.uniforms.queryScale.value.x=0===o?-1:1;var u=this.cubeLods[o].width;this.shader.uniforms.mapSize.value=u,this.renderToCubeMapTarget(e,this.cubeLods[o]),o<5&&(this.shader.uniforms.envMap.value=this.cubeLods[o].texture)}e.toneMapping=n,e.toneMappingExposure=a,e.gammaInput=t,e.gammaOutput=r},e.prototype.renderToCubeMapTarget=function(e,t){for(var r=0;r<6;r++)this.renderToCubeMapTargetFace(e,t,r)},e.prototype.renderToCubeMapTargetFace=function(e,t,r){t.activeCubeFace=r,this.shader.uniforms.faceIndex.value=r,e.render(this.scene,this.camera,t,!0)},e.prototype.getShader=function(){return new i.ShaderMaterial({defines:{SAMPLES_PER_LEVEL:20},uniforms:{faceIndex:{value:0},roughness:{value:.5},mapSize:{value:.5},envMap:{value:null},queryScale:{value:new i.Vector3(1,1,1)},testColor:{value:new i.Vector3(1,1,1)}},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"#include <common>\n varying vec2 vUv;\n uniform int faceIndex;\n uniform float roughness;\n uniform samplerCube envMap;\n uniform float mapSize;\n uniform vec3 testColor;\n uniform vec3 queryScale;\n \n float GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n float a = ggxRoughness + 0.0001;\n a *= a;\n return ( 2.0 / a - 2.0 );\n }\n vec3 ImportanceSamplePhong(vec2 uv, mat3 vecSpace, float specPow) {\n float phi = uv.y * 2.0 * PI;\n float cosTheta = pow(1.0 - uv.x, 1.0 / (specPow + 1.0));\n float sinTheta = sqrt(1.0 - cosTheta * cosTheta);\n vec3 sampleDir = vec3(cos(phi) * sinTheta, sin(phi) * sinTheta, cosTheta);\n return vecSpace * sampleDir;\n }\n vec3 ImportanceSampleGGX( vec2 uv, mat3 vecSpace, float Roughness )\n {\n float a = Roughness * Roughness;\n float Phi = 2.0 * PI * uv.x;\n float CosTheta = sqrt( (1.0 - uv.y) / ( 1.0 + (a*a - 1.0) * uv.y ) );\n float SinTheta = sqrt( 1.0 - CosTheta * CosTheta );\n return vecSpace * vec3(SinTheta * cos( Phi ), SinTheta * sin( Phi ), CosTheta);\n }\n mat3 matrixFromVector(vec3 n) {\n float a = 1.0 / (1.0 + n.z);\n float b = -n.x * n.y * a;\n vec3 b1 = vec3(1.0 - n.x * n.x * a, b, -n.x);\n vec3 b2 = vec3(b, 1.0 - n.y * n.y * a, -n.y);\n return mat3(b1, b2, n);\n }\n \n vec4 testColorMap(float Roughness) {\n vec4 color;\n if(faceIndex == 0)\n color = vec4(1.0,0.0,0.0,1.0);\n else if(faceIndex == 1)\n color = vec4(0.0,1.0,0.0,1.0);\n else if(faceIndex == 2)\n color = vec4(0.0,0.0,1.0,1.0);\n else if(faceIndex == 3)\n color = vec4(1.0,1.0,0.0,1.0);\n else if(faceIndex == 4)\n color = vec4(0.0,1.0,1.0,1.0);\n else\n color = vec4(1.0,0.0,1.0,1.0);\n color *= ( 1.0 - Roughness );\n return color;\n }\n void main() {\n vec3 sampleDirection;\n vec2 uv = vUv*2.0 - 1.0;\n float offset = -1.0/mapSize;\n const float a = -1.0;\n const float b = 1.0;\n float c = -1.0 + offset;\n float d = 1.0 - offset;\n float bminusa = b - a;\n uv.x = (uv.x - a)/bminusa * d - (uv.x - b)/bminusa * c;\n uv.y = (uv.y - a)/bminusa * d - (uv.y - b)/bminusa * c;\n if (faceIndex==0) {\n sampleDirection = vec3(1.0, -uv.y, -uv.x);\n } else if (faceIndex==1) {\n sampleDirection = vec3(-1.0, -uv.y, uv.x);\n } else if (faceIndex==2) {\n sampleDirection = vec3(uv.x, 1.0, uv.y);\n } else if (faceIndex==3) {\n sampleDirection = vec3(uv.x, -1.0, -uv.y);\n } else if (faceIndex==4) {\n sampleDirection = vec3(uv.x, -uv.y, 1.0);\n } else {\n sampleDirection = vec3(-uv.x, -uv.y, -1.0);\n }\n mat3 vecSpace = matrixFromVector(normalize(sampleDirection * queryScale));\n vec3 rgbColor = vec3(0.0);\n const int NumSamples = SAMPLES_PER_LEVEL;\n vec3 vect;\n float weight = 0.0;\n for( int i = 0; i < NumSamples; i ++ ) {\n float sini = sin(float(i));\n float cosi = cos(float(i));\n float r = rand(vec2(sini, cosi));\n vect = ImportanceSampleGGX(vec2(float(i) / float(NumSamples), r), vecSpace, roughness);\n float dotProd = dot(vect, normalize(sampleDirection));\n weight += dotProd;\n vec3 color = envMapTexelToLinear(textureCube(envMap,vect)).rgb;\n rgbColor.rgb += color;\n }\n rgbColor /= float(NumSamples);\n //rgbColor = testColorMap( roughness ).rgb;\n gl_FragColor = linearToOutputTexel( vec4( rgbColor, 1.0 ) );\n }",blending:i.CustomBlending,blendSrc:i.OneFactor,blendDst:i.ZeroFactor,blendSrcAlpha:i.OneFactor,blendDstAlpha:i.ZeroFactor,blendEquation:i.AddEquation})},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t="tDiffuse"),this.enabled=!0,this.needsSwap=!0,this.renderToScreen=!1,this.clear=!1,this.textureId=t,this.uniforms=i.UniformsUtils.clone(e.uniforms),this.material=new i.ShaderMaterial({blending:i.NormalBlending,transparent:!0,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.camera=new i.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new i.Scene,this.quad=new i.Mesh(new i.PlaneGeometry(2,2),null),this.scene.add(this.quad),this.prevViewPort=new i.Vector4}return e.prototype.render=function(e,t,r){this.uniforms[this.textureId]&&(this.uniforms[this.textureId].value=r),this.quad.material=this.material,this.renderToScreen?(this.viewPort&&e.setViewport(this.viewPort.x,this.viewPort.y,this.viewPort.width,this.viewPort.height),(this.clearColor||this.clearDepth)&&e.clear(!!this.clearColor,!!this.clearDepth,!1),e.render(this.scene,this.camera)):e.render(this.scene,this.camera,t,this.clear)},e.prototype.dispose=function(){this.quad.geometry.dispose(),this.quad=void 0,this.camera=void 0,this.scene=void 0,this.material.dispose(),this.material=void 0,this.uniforms=void 0},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{type:"t",value:null},rgbmMultiplier:{type:"f",value:9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","#ifdef FLIP_Y","vUv.y = 1.0 - vUv.y;","#endif","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float rgbmMultiplier;","const mat3 InverseLogLuvMatrix = mat3(","6.0014, -2.7008, -1.7996,","-1.3320, 3.1029, -5.7721,","0.3008, -1.0882, 5.6268);","vec3 HDRDecodeLOGLUV(in vec4 vLogLuv)","{","float Le = vLogLuv.z * 255.0 + vLogLuv.w;","vec3 Xp_Y_XYZp;","Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);","Xp_Y_XYZp.z = Xp_Y_XYZp.y / vLogLuv.y;","Xp_Y_XYZp.x = vLogLuv.x * Xp_Y_XYZp.z;","vec3 vRGB = InverseLogLuvMatrix * Xp_Y_XYZp;","return vRGB;","}","vec3 HDRDecodeRGBM( vec4 rgbm ) {","return rgbmMultiplier * rgbm.rgb * rgbm.a;","}","vec3 HDRDecodeRGBD( vec4 rgbd ) {","return rgbd.rgb / max(rgbd.a, 0.003);","}","vec3 HDRDecodeRGBE( vec4 rgbe ) {","float f = exp2( rgbe.w * 255.0 - (128.0 + 0.0) );","return rgbe.rgb * f;","}","varying vec2 vUv;","void main() {","vec3 hdrColour;","#ifdef HDR_RGBM","hdrColour = HDRDecodeRGBM( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBD)","hdrColour = HDRDecodeRGBD( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBE)","hdrColour = HDRDecodeRGBE( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_LOGLUV)","hdrColour = HDRDecodeLOGLUV( texture2D( tDiffuse, vUv ) );","#else","hdrColour = texture2D( tDiffuse, vUv ).xyz;","#endif","gl_FragColor = vec4( hdrColour, 1.0 );","}"].join("\n")}},function(e,t,r){"use strict";function i(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z])([a-z])/,"$1_$2$3").toUpperCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e?e:"";return t=t.replace(/_([a-z])/gi,function(e,t){return"_"+t.toUpperCase()}),t=t.replace(/\s+/g,"_"),t=t.replace(/([a-z])([0-9])/g,"$1_$2"),t=i(t)}},function(e,t,r){"use strict";function i(e,t){return e.id+"#"+t.id}function n(e){var t={};return t[e.id]=0,e.getChildren().forEach(function(r){var i=n(r);Object.assign(t,i),t[e.id]=Math.max(t[e.id],i[r.id]+1)}),t}function a(e,t,r){var n={};n[e.id]=t.id;var o=e.getChildren(),s=t.getChildren();return r[i(e,t)].children.forEach(function(e,t){var i=a(o[t],s[e],r);Object.assign(n,i)}),n}function o(e,t){var r=n(e),i=n(t),a=e.getDescendants();a.push(e);var o=t.getDescendants();o.push(t);for(var s=p.groupBy(a,function(e){return r[e.id]}),u=p.groupBy(o,function(e){return i[e.id]}),l=r[e.id],d=i[t.id],h=new c,f=0;f<=l;++f)for(var m=s[f],y=f;y<=d;++y)(function(e){var t=u[e];m.forEach(function(e){t.forEach(function(t){h.push({sourceNode:e,targetNode:t})})})})(y);return h}function s(e,t){for(var r={};!e.isEmpty();){var n=e.pop(),a=n.sourceNode,o=n.targetNode,s={included:!1,children:[]};if(r[i(a,o)]=s,t(a,o)){for(var u=a.getChildren(),p=o.getChildren(),c=0,l=0;l<u.length&&c<p.length;++c){var d=r[i(u[l],p[c])];d&&d.included&&(s.children.push(c),l++)}s.included=s.children.length===u.length}}return r}function u(e,t,r){var n=o(e,t),u=s(n,void 0!==r?r:function(){return!0}),p=[],c=t.getDescendants();return c.push(t),c.filter(function(t){var r=u[i(e,t)];return void 0!==r&&r.included}).forEach(function(t){p.push(a(e,t,u))}),p}Object.defineProperty(t,"__esModule",{value:!0});var p=r(5),c=function(){function e(){this.queue=[]}return e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype.pop=function(){return this.queue.shift()},e.prototype.push=function(e){this.queue.push(e)},e}();t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(e,t){void 0===e&&(e=4),void 0===t&&(t=5);var r=[],i=[],n=!0,a=function(){for(;r.length>0&&i.length<e;)(function(){var e=r.pop();i.push(e),e.fn().then(function(){var t=i.indexOf(e);t>=0&&(i.splice(t,1),a())})})()},o=function(e,t){return t.priority-e.priority};return{add:function(e,i){if(void 0===i&&(i=t),i<0)throw new Error("Invalid priority "+i);if(!n)throw new Error("Queue is not running, cannot accept new promises");r.push({fn:e,priority:i}),r.sort(o),setTimeout(a(),0)},destroy:function(){n=!1,i.splice(0,i.length),r.splice(0,r.length)}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(80);t.AlignToPosition=i.default;var n=r(81);t.Animation=n.default;var a=r(82);t.AudioListener=a.default;var o=r(83);t.AudioSource=o.default;var s=r(84);t.BoundingBoxRenderer=s.default;var u=r(85);t.CameraZoom=u.default;var p=r(86);t.CubeMapCapture=p.default;var c=r(87);t.Curve=c.default;var l=r(88);t.DebugConsoleDisplay=l.default;var d=r(89);t.DebugPerformance=d.default;var h=r(90);t.DebugTextureViewer=h.default;var f=r(91);t.DynamicOptimizer=f.default;var m=r(92);t.EventHandler=m.default;var y=r(93);t.Exploder=y.default;var g=r(94);t.Fullscreen=g.default;var v=r(95);t.GamepadAnimator=v.default;var b=r(36);t.GamepadDevice=b.default;var x=r(96);t.GamepadInput=x.default;var P=r(97);t.Input=P.default;var w=r(98);t.IntersectionChecker=w.default;var E=r(99);t.LightEnvironment=E.default;var S=r(100);t.LookAtTarget=S.default;var _=r(101);t.MaterialCapture=_.default;var D=r(66);t.MotionGamepadDevice=D.default;var T=r(102);t.NormalMapGenerator=T.default;var M=r(103);t.ObjectAnimator=M.default;var A=r(104);t.ObjectPicker=A.default;var R=r(37);t.OrbitCamera=R.default;var C=r(105);t.OrbitCameraFocus=C.default;var O=r(106);t.OrbitDesktopInput=O.default;var I=r(107);t.OrbitTouchInput=I.default;var j=r(109);t.PanoramaToCubeMap=j.default;var k=r(108);t.PMREMGenerator=k.default;var L=r(110);t.PreviewAxisRotation=L.default;var B=r(111);t.ReflectionCapturePlanar=B.default;var N=r(112);t.RemoteInstance=N.default;var U=r(113);t.Renderer=U.default;var V=r(67);t.RenderModes=V.default;var z=r(38);t.RenderView=z.default;var F=r(114);t.Rotate=F.default;var G=r(115);t.ScaleToSize=G.default;var q=r(116);t.SimplexNoiseGenerator=q.default;var H=r(117);t.Skybox=H.default;var $=r(118);t.TextRenderer=$.default;var W=r(119);t.VrCameraController=W.default;var X=r(120);t.VrPresenter=X.default;var Q=r(121);t.VrRenderView=Q.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(80),n=r(81),a=r(82),o=r(83),s=r(84),u=r(85),p=r(86),c=r(87),l=r(88),d=r(89),h=r(90),f=r(91),m=r(92),y=r(93),g=r(94),v=r(95),b=r(36),x=r(96),P=r(97),w=r(98),E=r(99),S=r(100),_=r(101),D=r(66),T=r(102),M=r(103),A=r(104),R=r(37),C=r(105),O=r(106),I=r(107),j=r(109),k=r(108),L=r(110),B=r(111),N=r(112),U=r(113),V=r(67),z=r(38),F=r(114),G=r(115),q=r(116),H=r(117),$=r(118),W=r(119),X=r(120),Q=r(121);t.default=[[{id:"align_to_position",sid:"Align to Position",properties:{name:"Align to Position",description:"Aligns an object relative to a position using the object's bounding box.",attributes:{referencePosition:{name:"referencePosition",type:"v3",description:"The position to work relative to.",default:{x:0,y:0,z:0}},alignment:{name:"alignment",type:"v3",description:"An object of the form { x: x, y: y, z: z} where the values for x, y and z are between -1 and +1 and specify how the object is aligned relative to the object's bounds.",default:{x:0,y:0,z:0}}},filter:["object"],category:"Loading",executeIn:"all"}},i.default],[{id:"animation",sid:"Animation",properties:{name:"Animation",description:"Applies an animation to an object.",attributes:{asset:{name:"asset",type:"asset",description:"Animation asset",default:null,filter:{AnimationAsset:!0}},prefab:{name:"prefab",type:"asset",description:"Prefab asset imported with the animation.",default:null,filter:{PrefabAsset:!0}},clipId:{name:"clipId",type:"i",description:"The animation clip ID",default:null},loop:{name:"loop",type:"b",description:"Continuously replay the animation",default:!0},speed:{name:"speed",type:"f",description:"Playback speed",default:1,min:0,max:100},startTime:{name:"startTime",type:"f",description:"Begin playback at this time offset",default:0,min:0},weight:{name:"weight",type:"f",description:"Blending weight",default:1,min:0,max:1}},events:{playAnimation:{scope:"local",name:"playAnimation",action:!0,category:"Animation",parameters:[{name:"asset",type:"asset",description:"The animation asset to play.",default:null,filter:{AnimationAsset:!0}},{name:"clipId",type:"s",description:"The ID of the clip to play.",default:null},{name:"loop",type:"b",description:"Continuously replay the animation.",default:!0},{name:"speed",type:"f",description:"Playback speed.",default:1,min:0,max:100},{name:"startTime",type:"f",description:"Begin playback at this time offset.",default:0,min:0}]},pauseAnimation:{scope:"local",name:"pauseAnimation",action:!0,category:"Animation",parameters:[]},stopAnimation:{scope:"local",name:"stopAnimation",action:!0,category:"Animation",parameters:[]},toggleAnimation:{scope:"local",name:"toggleAnimation",action:!0,category:"Animation",parameters:[]},animationLoaded:{scope:"local",name:"animationLoaded",action:!1,category:"Animation",parameters:[]},endAnimation:{scope:"local",name:"endAnimation",action:!1,category:"Animation",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},n.default],[{id:"audio_listener",sid:"Audio Listener",properties:{name:"Audio Listener",description:"Audio listener for 3D, positional sound effects",category:"Audio",executeIn:"player"}},a.default],[{id:"audio_source",sid:"Audio Source",properties:{name:"Audio Source",description:"Controls playback of audio assets",attributes:{gain:{name:"gain",type:"f",description:"Volume control",default:1,min:0,max:100},autoPlay:{name:"autoPlay",type:"b",description:"Play the audio once loaded",default:!0},loop:{name:"loop",type:"b",description:"Continuously replay the audio",default:!0},preload:{name:"preload",type:"b",description:"Load the audio when the component is initialized",default:!0},positional:{name:"positional",type:"b",description:"Enable/disable 3D, positional audio effects",default:!1},stream:{name:"stream",type:"b",description:"Stream the audio",default:!1},asset:{name:"asset",type:"asset",description:"Audio or video asset",default:null,filter:{AudioAsset:!0,VideoAsset:!0}}},events:{playAudio:{scope:"local",name:"playAudio",action:!0,category:"Audio",parameters:[{name:"offset",type:"f",description:"Defined in seconds",default:0}]},pauseAudio:{scope:"local",name:"pauseAudio",action:!0,category:"Audio",parameters:[]},stopAudio:{scope:"local",name:"stopAudio",action:!0,category:"Audio",parameters:[]},toggleAudio:{scope:"local",name:"toggleAudio",action:!0,category:"Audio",parameters:[]}},category:"Audio",executeIn:"player"}},o.default],[{id:"bounding_box_renderer",sid:"BoundingBox Renderer",properties:{name:"BoundingBox Renderer",description:"Renders bounding boxes for objects in a hierarchy.",attributes:{recursive:{name:"recursive",type:"b",default:!0,description:"Automatically render bounding boxes for all meshes in the hierarchy"}},filter:["object"],category:"Rendering",executeIn:"all"}},s.default],[{id:"camera_zoom",sid:"Camera Zoom",properties:{name:"Camera Zoom",description:"Handles zooming with orthographic and perspective cameras.",attributes:{perspectiveZoomMax:{name:"perspectiveZoomMax",type:"f",description:"The maximum amount a perspective camera can be zoomed (out)",default:180,max:1e5,min:0},perspectiveZoomMin:{name:"perspectiveZoomMin",type:"f",description:"The minimum amount a perspective camera can be zoomed (in)",default:0,max:1e5,min:0},orthoZoomMax:{name:"orthoZoomMax",type:"f",description:"The maximum amount an orthographic camera can be zoomed (out)",default:5,max:1e5,min:0},orthoZoomMin:{name:"orthoZoomMin",type:"f",description:"The minimum amount an orthographic camera can be zoomed (in)",default:0,max:1e5,min:0},perspectiveStep:{name:"perspectiveStep",type:"f",description:"Used to unify zoom between ortho and perspective zoom (this.zoom(+-1))",default:4,max:1e5,min:0},orthographicStep:{name:"orthographicStep",type:"f",description:"Used to unify zoom between ortho and perspective zoom (this.zoom(+-1))",default:.2,max:1e5,min:0}},filter:["camera"],category:"Camera Controllers",executeIn:"all"}},u.default],[{id:"cube_map_capture",sid:"Cube-Map Capture",properties:{name:"Cube-Map Capture",description:"Renders the scene from the position of the object into a cube texture.",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The RenderTextureCube to render the reflection to.",filter:{RenderTextureCubeAsset:!0},default:null},near:{name:"near",type:"f",description:"The closest distance to this object to render. Adjust this to avoid rendering local geometry to the texture.",default:.01},far:{name:"far",type:"f",description:"The furthest distance from this object to render.",default:16},updateFrameInterval:{name:"updateFrameInterval",type:"i",description:"The number of frames to skip in between updates of the reflection. Default is 0.",default:0},renderPosX:{name:"renderPosX",type:"b",description:"Render this side of the cube.",default:!0},renderPosY:{name:"renderPosY",type:"b",description:"Render this side of the cube.",default:!0},renderNegZ:{name:"renderNegZ",type:"b",description:"Render this side of the cube.",default:!0},renderNegX:{name:"renderNegX",type:"b",description:"Render this side of the cube.",default:!0},renderNegY:{name:"renderNegY",type:"b",description:"Render this side of the cube.",default:!0},renderPosZ:{name:"renderPosZ",type:"b",description:"Render this side of the cube.",default:!0},debugView:{name:"debugView",type:"b",description:"Render the camera helpers on the cube capture.",default:!1}},filter:["Object"],category:"Rendering",executeIn:"all"}},p.default],[{id:"curve",sid:"Curve",properties:{name:"Curve",description:"Creates a spline curve that can be used for various things, including making objects follow it. Add controls points to shape the curve.",attributes:{controlPoints:{name:"controlPoints",type:"a",subType:{type:"object"},description:"The list of objects that define the curve shape."},closed:{name:"closed",type:"b",description:"If toggled, the start and end of the curve will be smoothly joined.",default:!1},enableVisualizations:{name:"enableVisualizations",type:"b",description:"If true, visualization of the curve will be enabled.",default:!1}},filter:["object"],category:"General",executeIn:"all"}},c.default],[{id:"debug_console_display",sid:"Debug Console Display",properties:{name:"Debug Console Display",description:"A utility component for displaying a console log over the canvas (useful on mobile)",filter:["Application"],category:"Debug",executeIn:"player"}},l.default],[{id:"debug_performance",sid:"Debug Performance",properties:{name:"Debug Performance",description:"Displays an FPS counter when enabled.",filter:["Application"],category:"Debug",executeIn:"player"}},d.default],[{id:"debug_texture_viewer",sid:"Debug Texture Viewer",properties:{name:"Debug Texture Viewer",description:"Displays a dropdown with all available textures for debugging purposes.",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"25%"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"50%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"50%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:9}},filter:["Application"],category:"Debug",executeIn:"player"}},h.default],[{id:"dynamic_optimizer",sid:"Dynamic Performance Optimizer",properties:{name:"Dynamic Performance Optimizer",description:"Controls the dynamic down-stepping of rendering features in an attempt to achieve target performance.",attributes:{frameTimeThreshold:{name:"frameTimeThreshold",type:"f",description:"The average time that a frame can take to render before the optimizer drops a quality level. Default threshold is 30 FPS = 1000 ms / 30 frames",default:33.333333333333},testInterval:{name:"testInterval",type:"f",description:"The amount of elapsed time (in ms) to average the frame time over. i.e. an optimization decision can be made every time this interval elapses.",default:2e3}},filter:["Application"],category:"Rendering",executeIn:"player"}},f.default],[{id:"event_handler",sid:"Event Handler",properties:{name:"Event Handler",description:'Binds to a "listener" event and maps its firing to a list of trigger events.',attributes:{listener:{name:"listener",type:"event",description:"The event to listen for. When this event is captured, all of the defined trigger events will be fired.",allowActions:!1,default:{scope:{type:"global"},name:null}},triggers:{name:"triggers",type:"a",subType:{type:"event"},description:"Fire each of these events in response to the captured listen event.",allowActions:!0,default:[]}},category:"Interaction",executeIn:"player"}},m.default],[{id:"exploder",sid:"Exploder",properties:{name:"Exploder",description:"Explodes your objects and their hierarchies into different formations. Great for showing off parts in a model!",attributes:{time:{name:"time",type:"f",default:1.5,min:.001,description:"The amount of time to explode and contract the child meshes"},scale:{name:"scale",type:"v3",default:{x:2,y:2,z:2},description:"The scale of the explosion"},formation:{name:"formation",type:"dd",description:"Formation to use when exploding the hierarchy of this object.",default:"Scale",options:{Circle:"Circle","Square Grid":"Grid","Scale Out":"Scale"}}},events:{playExplode:{scope:"local",name:"playExplode",action:!0,category:"Exploder",parameters:[]},playContract:{scope:"local",name:"playContract",action:!0,category:"Exploder",parameters:[]},toggleExplode:{scope:"local",name:"toggleExplode",action:!0,category:"Exploder",parameters:[]},resetExploder:{scope:"local",name:"resetExploder",action:!0,category:"Exploder",parameters:[]},playCircleExplode:{scope:"local",name:"playCircleExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:1,y:1,z:1}}]},playGridExplode:{scope:"local",name:"playGridExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:1,y:1,z:1}}]},playScaleExplode:{scope:"local",name:"playScaleExplode",action:!0,category:"Exploder",parameters:[{name:"Scale",type:"v3",description:"The scale to apply to the explosion",default:{x:2,y:2,z:2}}]},beginExplode:{scope:"other",name:"beginExplode",action:!1,category:"Exploder",parameters:[]},endExplode:{scope:"other",name:"endExplode",action:!1,category:"Exploder",parameters:[]},beginContract:{scope:"other",name:"beginContract",action:!1,category:"Exploder",parameters:[]},endContract:{scope:"other",name:"endContract",action:!1,category:"Exploder",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},y.default],[{id:"fullscreen",sid:"Fullscreen",properties:{name:"Fullscreen",description:"Harnesses the fullscreen API to make your app fullscreen!",events:{toggleFullscreen:{scope:"local",name:"toggleFullscreen",action:!0,category:"Rendering",parameters:[]}},filter:["application"],category:"Rendering",executeIn:"player"}},g.default],[{id:"gamepad_animator",sid:"Gamepad Animator",properties:{name:"Gamepad Animator",description:"A component for animating an object based on gamepad input. e.g. a model of the gamepad or surrogate.",attributes:{buttons:{name:"buttons",type:"a",description:"Array of structures that represent animation information of each button when fully pressed in local space.",subType:{type:"a",subType:{type:"custom",attributes:{mesh:{type:"object"},movementType:{type:"s",default:"translate"},offset:{type:"v3"},pivot:{type:"v3"},rotation:{type:"v3"},renderOnTouchOnly:{type:"b",default:!1}}},default:[]},default:[]},axes:{name:"axes",type:"a",description:"Array of structures that represent animation information of each axes when fully pressed in local space.",subType:{type:"a",subType:{type:"custom",attributes:{mesh:{type:"object"},movementType:{type:"s",default:"translate"},offset:{type:"v3"},pivot:{type:"v3"},rotation:{type:"v3"},renderOnTouchOnly:{type:"b",default:!1}}},default:[]},default:[]}},filter:["object"],category:"Input",executeIn:"player"}},v.default],[{id:"gamepad_device",sid:"Gamepad Device",properties:{name:"Gamepad Device",description:"Represents a single gamepad connected to the system. Component attributes can be used to configure which gamepad gets assigned.",filter:["object"],category:"Input",executeIn:"player"}},b.default],[{id:"gamepad_input",sid:"Gamepad Input",properties:{name:"Gamepad Input",description:"Gets list of connected gamepad controllers and fires events for gamepad actions.",filter:["application"],category:"Input",executeIn:"player"}},x.default],[{id:"input",sid:"Input",properties:{name:"Input",description:"The Box3D input component. Adding this will cause all mouse/touch and keyboard events to fire on the engine.",attributes:{mouseEvents:{name:"mouseEvents",type:"custom",description:"Mouse events to listen to.",attributes:{enable:{type:"b",default:!0,description:"Enable mouse events"},scroll:{type:"b",default:!0,description:"Listen to scroll events?"},preventScrollDefault:{type:"b",default:!1,description:"Prevent default scroll behavior"},move:{type:"b",default:!0,description:"Listen to mouse move events"},down:{type:"b",default:!0,description:"Listen to mouse down event"},preventDownDefault:{type:"b",default:!1,description:"Prevent default mouse down behavior"},up:{type:"b",default:!0,description:"Listen to mouse up event"},doubleClick:{type:"b",default:!0,description:"Listen to double click event"},leave:{type:"b",default:!0,description:"Listen to mouse leave event"},contextMenu:{type:"b",default:!0,description:"Listen for the context menu event (ie, right click)"},preventContextMenuDefault:{type:"b",default:!0,description:"Prevent context menu default behavior (ie, the context menu popping open)"},dragBufferDistance:{type:"f",default:12,name:"Drag Buffer Distance",description:"The distance from initial click that you need to move your mouse before a drag event is fired, in pixels"},eventHandler:{type:"b",default:!0,description:"Events fired from the mouse are picked up by the Event Handler"}}},touchEvents:{name:"touchEvents",type:"custom",description:"Touch events to listen to.",attributes:{enable:{type:"b",default:!0,description:"Enable touch events?"},start:{type:"b",default:!0,description:"Listen for Touch Start"},preventStartDefault:{type:"b",default:!1,description:"Prevent default behavior of touch start event"},end:{type:"b",default:!0,description:"Listen for touch end event"},preventEndDefault:{type:"b",default:!1},doubleTap:{type:"b",default:!0,description:"Listen for a touch double tap event"},cancel:{type:"b",default:!0,description:"Listen for touch cancel event"},preventCancelDefault:{type:"b",default:!1},leave:{type:"b",default:!0,description:"Listen for touch leave event"},preventLeaveDefault:{type:"b",default:!1},move:{type:"b",default:!0,description:"Listen for touch move event"},preventMoveDefault:{type:"b",default:!0,description:"Prevent default move behavior (ie, dragging the window)"},dragBufferDistance:{type:"f",default:12,name:"Drag Buffer Distance",description:"The distance from initial touch down that you need to move your finger before a drag event is fired, in pixels"},eventHandler:{type:"b",default:!0,description:"Events fired from the touches are picked up by the Event Handler"}}},keyEvents:{name:"keyEvents",type:"custom",description:"Keyboard events",attributes:{enable:{type:"b",default:!0,description:"Enable keyboard events"},down:{type:"b",default:!0,description:"Listen to key down events"},up:{type:"b",default:!0,description:"Listen to key up events"},preventDefault:{type:"b",default:!1,description:"Prevent default keypress behavior"},eventHandler:{type:"b",default:!0,description:"Events fired from the keys are picked up by the Event Handler"}}}},events:{mouse_down_left:{scope:"global",name:"mouse_down_left",action:!1,category:"Input - Mouse",parameters:[]},mouse_down_right:{scope:"global",name:"mouse_down_right",action:!1,category:"Input - Mouse",parameters:[]},mouse_down_middle:{scope:"global",name:"mouse_down_middle",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_left:{scope:"global",name:"mouse_up_left",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_right:{scope:"global",name:"mouse_up_right",action:!1,category:"Input - Mouse",parameters:[]},mouse_up_middle:{scope:"global",name:"mouse_up_middle",action:!1,category:"Input - Mouse",parameters:[]},keypress_a:{scope:"global",name:"keypress_a",action:!1,category:"Input - Keys",parameters:[]},keypress_b:{scope:"global",name:"keypress_b",action:!1,category:"Input - Keys",parameters:[]},keypress_c:{scope:"global",name:"keypress_c",action:!1,category:"Input - Keys",parameters:[]},keypress_d:{scope:"global",name:"keypress_d",action:!1,category:"Input - Keys",parameters:[]},keypress_f:{scope:"global",name:"keypress_f",action:!1,category:"Input - Keys",parameters:[]},keypress_g:{scope:"global",name:"keypress_g",action:!1,category:"Input - Keys",parameters:[]},keypress_e:{scope:"global",name:"keypress_e",action:!1,category:"Input - Keys",parameters:[]},keypress_h:{scope:"global",name:"keypress_h",action:!1,category:"Input - Keys",parameters:[]},keypress_i:{scope:"global",name:"keypress_i",action:!1,category:"Input - Keys",parameters:[]},keypress_j:{scope:"global",name:"keypress_j",action:!1,category:"Input - Keys",parameters:[]},keypress_k:{scope:"global",name:"keypress_k",action:!1,category:"Input - Keys",parameters:[]},keypress_l:{scope:"global",name:"keypress_l",action:!1,category:"Input - Keys",parameters:[]},keypress_m:{scope:"global",name:"keypress_m",action:!1,category:"Input - Keys",parameters:[]},keypress_n:{scope:"global",name:"keypress_n",action:!1,category:"Input - Keys",parameters:[]},keypress_o:{scope:"global",name:"keypress_o",action:!1,category:"Input - Keys",parameters:[]},keypress_p:{scope:"global",name:"keypress_p",action:!1,category:"Input - Keys",parameters:[]},keypress_q:{scope:"global",name:"keypress_q",action:!1,category:"Input - Keys",parameters:[]},keypress_r:{scope:"global",name:"keypress_r",action:!1,category:"Input - Keys",parameters:[]},keypress_s:{scope:"global",name:"keypress_s",action:!1,category:"Input - Keys",parameters:[]},keypress_t:{scope:"global",name:"keypress_t",action:!1,category:"Input - Keys",parameters:[]},keypress_u:{scope:"global",name:"keypress_u",action:!1,category:"Input - Keys",parameters:[]},keypress_v:{scope:"global",name:"keypress_v",action:!1,category:"Input - Keys",parameters:[]},keypress_w:{scope:"global",name:"keypress_w",action:!1,category:"Input - Keys",parameters:[]},keypress_x:{scope:"global",name:"keypress_x",action:!1,category:"Input - Keys",parameters:[]},keypress_y:{scope:"global",name:"keypress_y",action:!1,category:"Input - Keys",parameters:[]},keypress_z:{scope:"global",name:"keypress_z",action:!1,category:"Input - Keys",parameters:[]},keypress_up_arrow:{scope:"global",name:"keypress_up_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_down_arrow:{scope:"global",name:"keypress_down_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_left_arrow:{scope:"global",name:"keypress_left_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_right_arrow:{scope:"global",name:"keypress_right_arrow",action:!1,category:"Input - Keys",parameters:[]},keypress_space:{scope:"global",name:"keypress_space",action:!1,category:"Input - Keys",parameters:[]},touch_start:{scope:"global",name:"touch_start",action:!1,category:"Input - Touch",parameters:[]},touch_end:{scope:"global",name:"touch_end",action:!1,category:"Input - Touch",parameters:[]}},filter:["application"],category:"Input",executeIn:"all"}},P.default],[{id:"intersection_checker",sid:"Intersection Checker",properties:{name:"Intersection Checker",description:"This component checks if the entity that it's attached to intersects with any other objects. It can be configured to filter the checked objects, the type of intersection and when the intersection checks occur.",attributes:{objectTypeFilter:{name:"objectTypeFilter",type:"a",subType:{type:"dd"},description:"Array of type names to check for intersection with.",default:[],options:{Cameras:"camera",Lights:"light",Meshes:"mesh",Nodes:"node",Bones:"bone"}},objectFilter:{name:"objectFilter",type:"a",description:"An array of specific objects to check for intersection against.",subType:{type:"object"},default:[]},checkIntersectionAlways:{name:"checkIntersectionAlways",type:"b",description:'Whether this component will always be checking intersections. Otherwise, it will only check and report intersections only when the "checkIntersection" event is fired on this entity.',default:!1},boundingSphereOverrideRadius:{name:"boundingSphereOverrideRadius",type:"i",description:"The radius (in meters) around this object to use for checking object intersection (overrides using this object's regular bounding sphere)",default:-1},firstIntersectionOnly:{name:"firstIntersectionOnly",type:"b",description:"Option to stop checking intersections after the first one. True by default. This means that only one intersection event will be fired for each check.",default:!0},debugVisualization:{name:"debugVisualization",type:"b",description:"Option to turn on visualization of intersection sphere for this object.",default:!1}},filter:["object"],category:"Tools",executeIn:"player"}},w.default],[{id:"light_environment",sid:"Light Environment",properties:{name:"Light Environment",description:"Automatically assigns the given environment maps to every material.",attributes:{irradianceMap:{name:"irradianceMap",type:"asset",description:"The irradiance map texture asset.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0}},radianceMapHalfGloss:{name:"radianceMapHalfGloss",type:"asset",description:"The radiance map half gloss texture asset.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0}},radianceMap:{name:"radianceMap",type:"asset",description:"The radiance map texture asset.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0}}},filter:["scene"],category:"Rendering",executeIn:"all"}},E.default],[{id:"look_at_target",sid:"Look At Target",properties:{name:"Look At Target",description:"A component that automatically points the object at a target. This can be used for billboarding an object to the camera, making a character look at another, etc.",attributes:{target:{name:"target",type:"object",description:"The object that you want this object to point towards. e.g. for billboarding, this would be the camera used to render the scene."},local:{name:"local",type:"b",description:"If toggled, whatever rotation you have already applied to this object will be taken into account.",default:!1}},filter:["Object"],category:"General",executeIn:"player"}},S.default],[{id:"material_capture",sid:"Material Capture",properties:{name:"Material Capture",description:"A component that captures an image of a rendered material as a spherical map, complete with lighting. This image can then be applied (with a sphere map projection) to a mesh to achieve convincing material shading (although the mesh will appear with the same lighting from all directions).",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The renderTexture2D asset which will be used to capture the material.",filter:{RenderTexture2DAsset:!0},default:null}},filter:["material"],category:"Rendering",executeIn:"all"}},_.default],[{id:"motion_gamepad_device",sid:"Motion Gamepad Device",properties:{name:"Motion Gamepad Device",description:"Represents a gamepad device with either 3DOF or 6DOF motion.",attributes:{handPreference:{name:"handPreference",type:"i",default:0,description:"The preference for the handedness of this controller."}},filter:["object"],category:"Input",executeIn:"player"}},D.default],[{id:"normal_map_generator",sid:"Normal Map Generator",properties:{name:"Normal Map Generator",description:"Generates a normal map from a greyscale heightmap.",attributes:{bumpTexture:{name:"bumpTexture",type:"asset",description:"The source height map.",filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0}},smoothness:{name:"smoothness",type:"f",description:"Controls the smoothness of the result.",slider:!0,default:.25,min:1e-4,max:1},spread:{name:"spread",type:"f",description:"The spread value which is used by the shader.",slider:!0,default:4,min:1,max:10},autoLoad:{name:"autoLoad",type:"b",description:"If true, the normal map will be generated automatically on entity availability.",default:!0}},events:{renderNormalMap:{scope:"local",name:"renderNormalMap",action:!0,category:"Rendering",parameters:[]}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},T.default],[{id:"object_animator",sid:"Object Animator",properties:{name:"Object Animator",description:"Provides events for animating objects around the scene.",events:{playAnimateAlongCurve:{scope:"local",name:"playAnimateAlongCurve",action:!0,category:"Animation",parameters:[{name:"curve",type:"object",componentFilter:{Curve:!0}},{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"orientation",description:"Orient the object following the curve to either the direction of the curve or to the objects defining the curve.",type:"opt",default:"toCurve",options:{None:"None","To Curve":"toCurve","To Nodes":"toNode"}},{name:"loop",type:"b",default:!1}]},playAnimateToObject:{scope:"local",name:"playAnimateToObject",action:!0,category:"Animation",parameters:[{name:"object",type:"object",default:null},{name:"animationTime",type:"f",description:"Total time that the animation will take. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"update orientation",type:"b",default:!0}]},playAnimateTranslation:{scope:"local",name:"playAnimateTranslation",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"velocity",type:"v3",default:{x:0,y:0,z:1},min:-1,max:1},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's position represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}}]},playAnimateRotation:{scope:"local",name:"playAnimateRotation",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"angularVelocity",type:"v3",default:{x:0,y:0,z:1},min:-100,max:100},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's rotation represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}},{name:"axisOrder",type:"opt",description:"Specify the axis order that the angular velocity will be applied in.",default:"YXZ",options:{XYZ:"XYZ",YXZ:"YXZ",ZXY:"ZXY",XZY:"XZY",YZX:"YZX",ZYX:"ZYX"}}]},playAnimateScale:{scope:"local",name:"playAnimateScale",action:!0,category:"Animation",parameters:[{name:"animationTime",type:"f",description:"Time to animate to object. Defined in seconds",default:3},{name:"easeIn",type:"f",description:"The percentage of animation time spent speeding up.",default:.25,min:0,max:1},{name:"easeOut",type:"f",description:"The percentage of animation time spent slowing down.",default:.25,min:0,max:1},{name:"velocity",type:"v3",default:{x:0,y:0,z:1},min:-10,max:10},{name:"objectUsage",type:"opt",description:"Specify what part of the animation the current object's scale represents.",default:"beginning",options:{Beginning:"beginning",Middle:"middle",End:"end"}}]},pauseCurveAnimation:{scope:"local",name:"pauseCurveAnimation",action:!0,category:"Animation",parameters:[]},stopCurveAnimation:{scope:"local",name:"stopCurveAnimation",action:!0,category:"Animation",parameters:[]},unpauseCurveAnimation:{scope:"local",name:"unpauseCurveAnimation",action:!0,category:"Animation",parameters:[]},endAnimateAlongCurve:{scope:"local",name:"endAnimateAlongCurve",action:!1,category:"Animation",parameters:[]},endAnimateToObject:{scope:"local",name:"endAnimateToObject",action:!1,category:"Animation",parameters:[]},endAnimateTranslation:{scope:"local",name:"endAnimateTranslation",action:!1,category:"Animation",parameters:[]},endAnimateRotation:{scope:"local",name:"endAnimateRotation",action:!1,category:"Animation",parameters:[]},endAnimateScale:{scope:"local",name:"endAnimateScale",action:!1,category:"Animation",parameters:[]}},filter:["Object"],category:"Animation",executeIn:"player"}},M.default],[{id:"object_picker",sid:"Object Picker",properties:{name:"Object Picker",description:"Provides events for picking objects with mouse/touch",attributes:{pickTrigger:{name:"pickTrigger",type:"dd",description:"What mouse action will trigger the pick?",default:"leftMouseClick",options:{"Left Mouse Click":"leftMouseClick","Middle Mouse Click":"middleMouseClick","Right Mouse Click":"rightMouseClick","Left Mouse Down":"leftMouseDown","Middle Mouse Down":"middleMouseDown","Right Mouse Down":"rightMouseDown","Left Mouse Up":"leftMouseUp","Middle Mouse Up":"middleMouseUp","Right Mouse Up":"rightMouseUp","Left Mouse Double Click":"leftMouseDoubleClick","Middle Mouse Double Click":"middleMouseDoubleClick","Right Mouse Double Click":"rightMouseDoubleClick"}},enableHover:{name:"enableHover",type:"b",default:!1,advanced:!0,description:"Enable hover detection when mouse cursor is over a mesh. Note that this has a potential performance impact."},hoverFrameSkip:{name:"hoverFrameSkip",type:"i",description:"Skip this many frames in between hover checks.",default:1,min:0,max:60}},events:{objectsPicked:{scope:"global",name:"objectsPicked",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that have been picked.",default:null,filter:{BaseObject:!0}}]},objectHoverBegin:{scope:"global",name:"objectHoverBegin",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that has been hovered over.",default:[null],filter:{BaseObject:!0}}]},objectHoverEnd:{scope:"global",name:"objectHoverEnd",action:!1,category:"General",parameters:[{name:"objectArray",type:"array",subType:"string",description:"The objects that are no longer being hovered over.",default:[],filter:{BaseObject:!0}}]},pick:{scope:"other",name:"pick",action:!1,category:"General",filter:["object"],parameters:[]},beginHover:{scope:"other",name:"beginHover",action:!1,category:"General",filter:["object"],parameters:[]},endHover:{scope:"other",name:"endHover",action:!1,category:"General",filter:["object"],parameters:[]}},filter:["Application"],category:"General",executeIn:"player"}},A.default],[{id:"orbit_camera",sid:"Orbit Camera",properties:{name:"Orbit Camera",description:"Allows a camera to easily orbit a point in space.",attributes:{orbitDistance:{name:"orbitDistance",type:"f",description:"How far the camera is positioned from the pivot point.",default:2.5,max:1e5,min:.001},zoomPerspectiveBounds:{name:"zoomPerspectiveBounds",type:"v2",description:"Allows you to set how far the camera can zoom, for perspective cameras. X = min, Y = max",default:{x:5,y:90},max:{x:180,y:180},min:{x:1,y:1}},zoomOrthographicBounds:{name:"zoomOrthographicBounds",type:"v2",description:"Allows you to set how far the camera can zoom, for ortho cameras. X = min, Y = max",default:{x:.125,y:2.5},max:{x:5,y:5},min:{x:.01,y:.01}},panEnabled:{name:"panEnabled",type:"b",default:!0,description:"Allow the user to pan side-to-side and up and down with the camera."},zoomEnabled:{name:"zoomEnabled",type:"b",default:!0,description:"Allow the user to zoom in and out with the camera."},inertialDamping:{name:"inertialDamping",type:"f",default:.2,description:"How quickly the camera stops moving when input stops.",min:0,max:1},panSpeed:{name:"panSpeed",type:"f",description:"The speed that the camera moves when panning.",default:2,max:2e3,min:.1},orbitSpeed:{name:"orbitSpeed",type:"f",description:"The speed that the camera orbits the target.",default:2,max:1e3,min:1e-4},zoomSpeed:{name:"zoomSpeed",type:"f",description:"The speed that the camera moves while zooming in and out.",default:8,max:2e3,min:.1},pitchAngleBounds:{name:"pitchAngleBounds",type:"v2",description:"Allows you to set how far the camera can pitch (tilt) from horizontal.",default:{x:75,y:-75},max:{x:90,y:90},min:{x:-90,y:-90.001}}},filter:["camera"],category:"Camera Controllers",executeIn:"player"}},R.default],[{id:"orbit_camera_focus",sid:"Orbit Camera Focus",properties:{name:"Orbit Camera Focus",description:"A component that allows for easy focus on a point of an object.",attributes:{speed:{name:"speed",type:"f",description:"The speed that we move to focus on the target.",default:.8,max:100,min:.1},zoomSteps:{name:"zoomSteps",type:"i",description:"The number of steps it takes to zoom, from fully zoomed out to fully zoomed in.",default:5,max:100,min:0},zoomBuffer:{name:"zoomBuffer",type:"i",description:"The distance between each focal point move. Used to decide whether or not to zoom in.",default:.1,max:1e3,min:0}},filter:["camera"],category:"Camera Controllers",executeIn:"all"}},C.default],[{id:"orbit_desktop_input",sid:"Orbit Desktop Input",properties:{name:"Orbit Desktop Input",description:"Desktop input for Orbit Camera component",filter:["camera"],category:"Camera Components",executeIn:"all"}},O.default],[{id:"orbit_touch_input",sid:"Orbit Touch Input",properties:{name:"Orbit Touch Input",description:"Touch input for Orbit Camera component",filter:["camera"],category:"Camera Components",executeIn:"player"}},I.default],[{id:"panorama_to_cube_map",sid:"Panorama To Cube Map",properties:{name:"Panorama To Cube Map",description:"Converts a equirectangular map to a cube map.",attributes:{inputTexture:{name:"inputTexture",type:"asset",default:null,filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0},description:"The texture to convert to a cube map."}},filter:["renderTextureCube"],category:"Rendering",executeIn:"all"}},j.default],[{id:"texture_to_pmrem_cubeuv",sid:"GeneratePMREM",properties:{name:"GeneratePMREM",description:"Generates a prefiltered mipmaped radiance environment map from a, preferably HDRI, input environment map. The entire result will be stored in this texture in the CubeUV layout.",attributes:{inputTexture:{name:"inputTexture",type:"asset",default:null,filter:{TextureCubeAsset:!0,RenderTextureCubeAsset:!0},description:"The cube texture to generate the PMREM for."}},filter:["renderTexture2D"],category:"Rendering",executeIn:"player"}},k.default],[{id:"preview_axis_rotation",sid:"Preview Axis Rotation",properties:{name:"Preview Axis Rotation",description:"Set the rotation of any axis.",attributes:{speed:{name:"speed",type:"f",description:"The speed that we rotate the object, if a transition is triggered",default:.4,max:100,min:.1}},filter:["object"],category:"User Defined",executeIn:"player"}},L.default],[{id:"reflection_capture_planar",sid:"Reflection Capture Planar",properties:{name:"Reflection Capture Planar",description:"Renders a reflection along the plane represented by this object.",attributes:{captureTexture:{name:"captureTexture",type:"asset",description:"The RenderTexture2D to render the reflection to.",filter:{RenderTexture2DAsset:!0}},clipBias:{name:"clipBias",type:"f",description:"Pushes the rendered scene forward or backwards to adjust clipping with reflection plane.",default:.01},updateFrameInterval:{name:"updateFrameInterval",type:"i",description:"The number of frames to skip in between updates of the reflection. Default is 0.",default:0}},filter:["Object"],category:"Rendering",executeIn:"all"}},B.default],[{id:"remote_instance",sid:"Remote Instance",properties:{name:"Remote Instance",description:"Handles loading and instancing a 3D model at runtime from a Box file ID.",events:{createRemoteInstance:{scope:"global",name:"createRemoteInstance",action:!0,category:"Loading",parameters:[{name:"fileId",type:"string",description:"The Box file ID of the 3D model to load.",default:null}]},remoteInstanceCreated:{scope:"local",name:"remoteInstanceCreated",action:!1,category:"Loading",parameters:[{name:"fileId",type:"string",description:"The Box file ID of the 3D model that loaded.",default:null}]}},filter:["object"],category:"Loading",executeIn:"all"}},N.default],[{id:"box3d_renderer",sid:"Renderer",properties:{name:"Renderer",attributes:{antialias:{name:"antialias",type:"b",description:"Enable or disable anti aliasing of the rendered scene.",default:!0},preserveDrawingBuffer:{name:"preserveDrawingBuffer",type:"b",description:"Tells the browser to preserve drawing buffers between frames so that they are available to be read by the application.",default:!0},precision:{name:"precision",type:"dd",description:"The default floating point and integer precision to be used by the GPU.",default:"mediump",options:{Low:"lowp",Medium:"mediump",High:"highp"}},autoClear:{name:"autoClear",type:"b",description:"Automatically clear the render target before each render.",default:!1},devicePixelRatio:{name:"devicePixelRatio",type:"dd",default:0,options:{"Device Default":0,One:1,Two:2},description:"Override the default pixel ratio of the system. Higher values will cause rendering at higher resolution while lower values will force rendering at lower resolutions. You can also set this to use the device default (mobile devices usually have values greater than 1)."},shadowsEnabled:{name:"shadowsEnabled",type:"b",description:"Enable or disable rendering of shadows.",default:!0},shadowsEnabledMobile:{name:"shadowsEnabledMobile",type:"b",description:"Enable or disable rendering of shadows on mobile devices.",default:!1},shadowType:{name:"shadowType",type:"dd",description:"The type of shadow map to use. (PCF, Soft PCF or No Filtering)",options:{"Soft PCF":2,PCF:1,"No Filtering":0},default:2},shadowReverseSided:{name:"shadowReverseSided",type:"b",description:"Render shadows with reverse side of mesh.",default:!1},maxTextureSize2d:{name:"maxTextureSize2d",type:"i",description:"Clamp the maximum allowed dimension of a 2d texture. #power-of-two",default:32768,min:1024,max:32768},maxTextureSizeCube:{name:"maxTextureSizeCube",type:"i",description:"Clamp the maximum allowed dimension of a cube texture. #power-of-two",default:32768,min:512,max:32768},clearColor:{name:"clearColor",type:"c",description:"When the render target is cleared, this colour will be used",default:{r:0,g:0,b:0}},clearAlpha:{name:"clearAlpha",type:"f",description:"When the render target is cleared, this value will be used to clear the transparency",default:0,min:0,max:1,step:.001},renderOnDemand:{name:"renderOnDemand",type:"b",description:"When this is enabled, rendering will only happen when requested instead of every frame.",default:!0},logarithmicDepthBuffer:{name:"logarithmicDepthBuffer",type:"b",description:"Use logarithmic z values while rendering.",default:!1}},filter:["application"],category:"Rendering",executeIn:"player"}},U.default],[{id:"render_modes",sid:"Render Modes",properties:{name:"Render Modes",description:'A component for controlling the rendering style, allowing you to switch between "lit", "unlit", "untextured", etc., and enable/disable skeleton and wireframe visualization.',attributes:{renderMode:{name:"renderMode",type:"dd",description:"How to render the scene",default:0,options:{Lit:0,Unlit:1,Shape:2,Normals:3,Untextured:4,UVOverlay:5,SkinWeights:6}},skeletonsVisible:{name:"skeletonsVisible",type:"b",description:"Enable or disable skeleton rendering",default:!1},shapeTexture:{name:"shapeTexture",type:"asset",description:'The texture to use with the "Shape" render mode',filter:{Texture2DAsset:!0,RenderTexture2DAsset:!0},default:null},wireframesVisible:{name:"wireframesVisible",type:"b",description:"Enable or disable wireframe rendering",default:!1}},events:{resetSkeletons:{scope:"global",name:"resetSkeletons",action:!0,category:"Rendering",parameters:[]},setRenderMode:{scope:"global",name:"setRenderMode",action:!0,category:"Rendering",parameters:[{name:"renderMode",type:"n",description:"RenderMode.Lit, RenderMode.Unlit, etc.",default:"Lit"}]},setSkeletonsVisible:{scope:"global",name:"setSkeletonsVisible",action:!0,category:"Rendering",parameters:[{name:"visible",type:"b",description:"Whether or not skeletons are visible.",default:!1}]},setWireframesVisible:{scope:"global",name:"setWireframesVisible",action:!0,category:"Rendering",parameters:[{name:"visible",type:"b",description:"Whether or not wireframes are visible.",default:!1}]}},filter:["Application"],category:"Rendering",executeIn:"player"}},V.default],[{id:"render_view",sid:"Render View",properties:{name:"Render View",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"0px"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"100%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"100%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:0},renderLayer:{name:"renderLayer",type:"i",description:"The layer that this camera will render. Objects that are in a different layer will not be rendered by this camera.",default:0,min:0},clearColor:{name:"clearColor",type:"b",description:"Enable/disable color buffer clearing",default:!1,advanced:!1},clearDepth:{name:"clearDepth",type:"b",description:"Enable/disable depth buffer clearing",default:!0,advanced:!1},renderTarget:{name:"renderTarget",type:"asset",description:"The render texture asset to use as a render target.",filter:{RenderTexture2DAsset:!0},default:null,advanced:!1},enablePreRenderFunctions:{name:"enablePreRenderFunctions",type:"b",description:"Run pre-render functions with this view. These include things like real-time reflections, which need to be rendered for each view separately.",default:!0},enableShadows:{name:"enableShadows",type:"b",description:"Render shadows for this view.",default:!0},opacity:{name:"opacity",type:"f",description:"The opacity value to use while rendering.",min:0,max:1,default:1},overrideCameraAspect:{name:"overrideCameraAspect",type:"f",description:"Override the aspect ratio of the camera using viewport settings.",min:0,default:!0},overrideScene:{name:"overrideScene",type:"asset",description:"Override which scene is rendered by this camera.",filter:{PrefabAsset:!0},default:null}},events:{enableRenderView:{scope:"local",name:"enableRenderView",category:"Rendering"},setViewport:{scope:"local",name:"setViewport",category:"Rendering",parameters:[{name:"viewportLeft",description:"Left position of the viewport to be rendered by this camera.",type:"s",default:"0px"},{name:"viewportBottom",description:"Bottom position of the viewport to be rendered by this camera.",type:"s",default:"0px"},{name:"viewportWidth",description:"Width of the viewport to be rendered by this camera.",type:"s",default:"100%"},{name:"viewportHeight",description:"Height of the viewport to be rendered by this camera.",type:"s",default:"100%"}]},disableRenderView:{scope:"local",name:"disableRenderView",category:"Rendering"},toggleRenderView:{scope:"local",name:"toggleRenderView",category:"Rendering"}},filter:["camera"],category:"Rendering",executeIn:"player"}},z.default],[{id:"rotate",sid:"Rotate",properties:{name:"Rotate",description:"A simple component which rotates the attached object.",attributes:{autoRotate:{name:"autoRotate",type:"b",description:"Automatically start the rotation upon load.",default:!0},rotation:{name:"rotation",type:"v3",description:"Amount of rotation per second about the x, y and z axes.",default:{x:0,y:.5,z:0}},local:{name:"local",type:"b",description:"Rotate relative to the local quaternion of the object. If false, the rotation will be relative to the world.",default:!1}},events:{startRotate:{scope:"local",name:"startRotate",action:!0,category:"Rotate",parameters:[]},stopRotate:{scope:"local",name:"stopRotate",action:!0,category:"Rotate",parameters:[]},toggleRotate:{scope:"local",name:"toggleRotate",action:!0,category:"Rotate",parameters:[]}},filter:["object"],category:"Animation",executeIn:"player"}},F.default],[{id:"scale_to_size",sid:"Scale to Size",properties:{name:"Scale to Size",description:"Handles scaling an entity (and everything under it) at runtime.",attributes:{size:{name:"size",type:"f",description:"The size that the object will be scaled to, in world units. The size is measured as the longest diagonal of the bounding box for the object.",default:1}},filter:["object"],category:"Loading",executeIn:"all"}},G.default],[{id:"simplex_noise_generator",sid:"Simplex Noise Generator",properties:{name:"Simplex Noise Generator",description:"Generates a texture using simplex noise.",attributes:{layerAmplitude:{name:"layerAmplitude",type:"v4",description:"The layer amplitude uniform value for the shader.",default:{x:.5,y:.4,z:.3,w:.125}},layerScale:{name:"layerScale",type:"v4",description:"The layer scale uniform value for the shader.",default:{x:.5,y:2,z:3,w:4}},scale:{name:"scale",type:"v2",description:"The scale uniform value for the shader.",default:{x:1,y:1}},offset:{name:"offset",type:"v2",description:"The offset uniform value for the shader.",default:{x:0,y:0}},autoLoad:{name:"autoLoad",type:"b",description:"Generate the simplex noise map automatically when the entity loads",default:!0}},events:{renderNoise:{scope:"local",name:"renderNoise",action:!0,category:"Rendering",parameters:[]},changeNoiseValues:{scope:"local",name:"changeNoiseValues",action:!0,category:"Rendering",parameters:[{name:"layerAmplitude",type:"v4",description:"",default:{x:.5,y:.4,z:.3,w:.125}},{name:"layerScale",type:"v4",description:"",default:{x:.5,y:2,z:3,w:4}},{name:"scale",type:"v2",description:"",default:{x:1,y:1}},{name:"offset",type:"v2",description:"",default:{x:0,y:0}}]}},filter:["renderTexture2D"],category:"Rendering",executeIn:"all"}},q.default],[{id:"skybox_renderer",sid:"Skybox",properties:{name:"Skybox",description:"Adds a skybox to the scene.",attributes:{skyboxTexture:{name:"skyboxTexture",type:"asset",description:"The texture asset to use for the skybox.",filter:{BaseTextureAsset:!0},default:null},stereoEnabled:{name:"stereoEnabled",type:"b",description:"Determines whether or not to render in stereoscopic mode.",default:!1},size:{name:"size",type:"f",description:"The size (uniform scale) of the skybox.",default:1e3,min:1,max:1e6}},filter:["scene"],category:"Rendering",executeIn:"all"}},H.default],[{id:"text_renderer",sid:"Text Renderer",properties:{name:"Text Renderer",description:"Render the desired text to the texture.",attributes:{text:{name:"text",type:"s",default:"My Text",description:"Text you want to display"},fontColor:{name:"fontColor",type:"c",default:{r:1,g:1,b:1},description:"Color of the text"},fontFamily:{name:"fontFamily",type:"s",default:"Calibri",description:"Font family to render"},pointSize:{name:"pointSize",type:"i",default:48,description:"Font size",min:2,max:100}},filter:["renderTexture2D"],category:"Text",executeIn:"all"}},$.default],[{id:"vr_camera_controller",sid:"VR Camera Controller",properties:{name:"VR Camera Controller",description:"Moves a camera based on the movement of a VR head-mounted display.",filter:["camera"],category:"Camera",executeIn:"player"}},W.default],[{id:"vr_presenter",sid:"VR Presenter",properties:{name:"VR Presenter",description:"Controls the enabling and disabling of WebVR presenting.",filter:["application"],category:"VR",executeIn:"player"}},X.default],[{id:"vr_render_view",sid:"VR Render View",properties:{name:"VR Render View",description:"Render View component that enables a stereoscopic view when a VR display is presenting.",attributes:{viewportLeft:{name:"viewportLeft",type:"s",description:"Left position of the viewport to be rendered by this camera.",default:"0px"},viewportBottom:{name:"viewportBottom",type:"s",description:"Bottom position of the viewport to be rendered by this camera.",default:"0px"},viewportWidth:{name:"viewportWidth",type:"s",description:"Width of the viewport to be rendered by this camera.",default:"100%"},viewportHeight:{name:"viewportHeight",type:"s",description:"Height of the viewport to be rendered by this camera.",default:"100%"},renderGroup:{name:"renderGroup",type:"i",description:"Render passes are done in order, based on the 'render group' value. Lower numbers render first.",default:0},renderLayer:{name:"renderLayer",type:"i",description:"The layer that this camera will render. Objects that are in a different layer will not be rendered by this camera.",default:0,min:0},clearColor:{name:"clearColor",type:"b",description:"Enable/disable color buffer clearing",default:!1,advanced:!1},clearDepth:{name:"clearDepth",type:"b",description:"Enable/disable depth buffer clearing",default:!0,advanced:!1},renderTarget:{name:"renderTarget",type:"asset",description:"The render texture asset to use as a render target.",filter:{RenderTexture2DAsset:!0},default:null,advanced:!1},enablePreRenderFunctions:{name:"enablePreRenderFunctions",type:"b",description:"Run pre-render functions with this view. These include things like real-time reflections, which need to be rendered for each view separately.",default:!0,advanced:!0},enableShadows:{name:"enableShadows",type:"b",description:"Render shadows for this view.",default:!0,advanced:!0}},filter:["camera"],category:"Rendering",executeIn:"player"}},Q.default]]},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0);r(206),r(208),r(207),i.__exportStar(r(205),t)},function(e,t){e.exports="/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from bumpTexture\n */\nprecision lowp float;\nuniform float smoothness;\nuniform float spread;\nuniform vec2 resolution;\nuniform sampler2D bumpTexture;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec2 size = vec2( smoothness, 0.0 );\n vec3 off = vec3(-spread / resolution.x, 0.0, spread / resolution.y);\n\n vec4 wave = texture2D( bumpTexture, vUv);\n float s11 = wave.x;\n float s01 = texture2D( bumpTexture, vUv + off.xy ).x;\n float s21 = texture2D( bumpTexture, vUv + off.zy ).x;\n float s10 = texture2D( bumpTexture, vUv + off.yx ).x;\n float s12 = texture2D( bumpTexture, vUv + off.yz ).x;\n vec3 va = normalize(vec3( size.xy, s21-s01));\n vec3 vb = normalize(vec3( size.yx, s12-s10));\n vec3 norm = cross(va,vb);\n gl_FragColor = vec4( norm * 0.5 + 0.5, s11 );\n}\n"},function(e,t){e.exports="/**\n * @author alteredq / http://alteredqualia.com/\n *\n * Normal map shader\n * - compute normals from bumpTexture\n */\nvarying vec2 vUv;\n\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="//\n// Description : Array and textureless GLSL 3D simplex noise function.\n// Author : Ian McEwan, Ashima Arts.\n// Maintainer : ijm\n// Lastmod : 20110409 (stegu)\n// License : Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n//\n//'precision lowp float;\nuniform float time;\nuniform vec4 layerAmplitude;\nuniform vec4 layerScale;\nvarying vec2 vUv;\n\nprecision highp float;\n\nvec4 permute( vec4 x ) {\n\n return mod( ( ( x * 34.0 ) + 1.0 ) * x, 289.0 );\n\n}\n\nvec4 taylorInvSqrt( vec4 r ) {\n\n return 1.79284291400159 - 0.85373472095314 * r;\n\n}\n\nfloat snoise( vec3 v ) {\n\n vec2 C = vec2( 1.0 / 6.0, 1.0 / 3.0 );\n const vec4 D = vec4( 0.0, 0.5, 1.0, 2.0 );\n\n // First corner\n\n vec3 i = floor( v + dot( v, C.yyy ) );\n vec3 x0 = v - i + dot( i, C.xxx );\n\n // Other corners\n\n vec3 g = step( x0.yzx, x0.xyz );\n vec3 l = 1.0 - g;\n vec3 i1 = min( g.xyz, l.zxy );\n vec3 i2 = max( g.xyz, l.zxy );\n\n vec3 x1 = x0 - i1 + 1.0 * C.xxx;\n vec3 x2 = x0 - i2 + 2.0 * C.xxx;\n vec3 x3 = x0 - 1. + 3.0 * C.xxx;\n\n // Permutations\n\n i = mod( i, 289.0 );\n vec4 p = permute( permute( permute(\n i.z + vec4( 0.0, i1.z, i2.z, 1.0 ) )\n + i.y + vec4( 0.0, i1.y, i2.y, 1.0 ) )\n + i.x + vec4( 0.0, i1.x, i2.x, 1.0 ) );\n\n // Gradients\n // ( N*N points uniformly over a square, mapped onto an octahedron.)\n\n float n_ = 1.0 / 7.0; // N=7\n\n vec3 ns = n_ * D.wyz - D.xzx;\n\n vec4 j = p - 49.0 * floor( p * ns.z *ns.z ); // mod(p,N*N)\n\n vec4 x_ = floor( j * ns.z );\n vec4 y_ = floor( j - 7.0 * x_ ); // mod(j,N)\n\n vec4 x = x_ *ns.x + ns.yyyy;\n vec4 y = y_ *ns.x + ns.yyyy;\n vec4 h = 1.0 - abs( x ) - abs( y );\n\n vec4 b0 = vec4( x.xy, y.xy );\n vec4 b1 = vec4( x.zw, y.zw );\n\n\n vec4 s0 = floor( b0 ) * 2.0 + 1.0;\n vec4 s1 = floor( b1 ) * 2.0 + 1.0;\n vec4 sh = -step( h, vec4( 0.0 ) );\n\n vec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy;\n vec4 a1 = b1.xzyw + s1.xzyw * sh.zzww;\n\n vec3 p0 = vec3( a0.xy, h.x );\n vec3 p1 = vec3( a0.zw, h.y );\n vec3 p2 = vec3( a1.xy, h.z );\n vec3 p3 = vec3( a1.zw, h.w );\n\n // Normalise gradients\n\n vec4 norm = taylorInvSqrt( vec4( dot( p0, p0 ), dot( p1, p1 ),\n dot( p2, p2 ), dot( p3, p3 ) ) );\n p0 *= norm.x;\n p1 *= norm.y;\n p2 *= norm.z;\n p3 *= norm.w;\n\n // Mix final noise value\n\n vec4 m = max( 0.6 - vec4( dot( x0, x0 ), dot( x1, x1 ),\n dot( x2, x2 ), dot( x3, x3 ) ), 0.0 );\n m = m * m;\n return 42.0 * dot( m*m, vec4( dot( p0, x0 ), dot( p1, x1 ),\n dot( p2, x2 ), dot( p3, x3 ) ) );\n\n}\n\nfloat surface3( vec3 coord ) {\n\n float n = 0.0;\n\n n += layerAmplitude.x * abs( snoise( coord * layerScale.x ) );\n n += layerAmplitude.y * abs( snoise( coord * layerScale.y ) );\n n += layerAmplitude.z * abs( snoise( coord * layerScale.z ) );\n n += layerAmplitude.w * abs( snoise( coord * layerScale.w ) );\n\n return n;\n}\n\nvoid main( void ) {\n\n vec3 coord = vec3( vUv, -time );\n float n = surface3( coord );\n\n gl_FragColor = vec4( vec3( n, n, n ), 1.0 );\n\n}\n"},function(e,t){e.exports="varying vec2 vUv;\nuniform vec2 scale;\nuniform vec2 offset;\n\nvoid main() {\n vUv = uv * scale + offset;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"},function(e,t){e.exports="#define PHYSICAL\n\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform vec3 specular;\nuniform vec4 screenDimensions;\n\n#ifndef STANDARD\n\tuniform float clearCoat;\n\tuniform float clearCoatRoughness;\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n#include <packing>\n#include <color_pars_fragment>\n//Removed chunk from physical material <uv_pars_fragment>\n#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) || defined(GLOSS_MAP) || defined(AO_MAP)\n\tvarying vec2 vUv;\n#endif\n//Removed chunk from physical material <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n//Removed chunk from physical material <aomap_pars_fragment>\n#ifdef AO_MAP\n\tuniform sampler2D aoMap;\n#endif\n//Removed chunk from physical material <lightmap_pars_fragment>\n#ifdef EMISSIVE_MAP\n#include <emissivemap_pars_fragment>\n#endif\n\n#if defined(GLOSS_MAP) && !defined(ROUGHNESS_MAP)\n\tuniform sampler2D glossMap;\n#endif\n\n#if defined(ENV_MAP_RADIANCE) || defined(ENV_MAP_IRRADIANCE)\n//Removed chunk from physical material <envmap_pars_fragment>\n\tuniform float reflectivity;\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform float refractionRatio;\n\n\t// This code assumes that all environment maps are of the same type (cube or 2D)\n\t// and use the same sampling transform (e.g. equirectangular projection, etc.\n\t// It is allowed that either irradiance or radiance maps can exist by themselves\n\t// but the radianceHalfGloss can only exist if the other two do.\n\t#if defined(ENV_MAP_RADIANCE_TEX_TYPE_CUBE) || defined(ENV_MAP_IRRADIANCE_TEX_TYPE_CUBE)\n\t\t#define SAMPLER_TYPE samplerCube\n\t#else\n\t\t#define SAMPLER_TYPE sampler2D\n\t#endif\n\n\t#ifdef ENV_MAP_RADIANCE\n\t\tuniform SAMPLER_TYPE envMapRadiance;\n\t#endif\n\t#if defined(ENV_MAP_RADIANCE_HALF_GLOSS) && defined(ENV_MAP_RADIANCE) && defined(ENV_MAP_IRRADIANCE)\n\t\tuniform SAMPLER_TYPE envMapRadianceHalfGloss;\n\t#endif\n\t#ifdef ENV_MAP_IRRADIANCE\n\t\tuniform SAMPLER_TYPE envMapIrradiance;\n\t#endif\n#endif\n\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_physical_pars_fragment>\n\n#undef MAXIMUM_SPECULAR_COEFFICIENT\n#define MAXIMUM_SPECULAR_COEFFICIENT 1.0\n\n\n// Overriding to remove weird reciprocal of PI factor.\nvoid RE_IndirectDiffuse_BoxPBR( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * material.diffuseColor;\n}\n\n// ref: https://www.unrealengine.com/blog/physically-based-shading-on-mobile - environmentBRDF for GGX on mobile\nfloat BRDF_Specular_GGX_Environment_NonMetal( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\n\tconst vec2 c0 = vec2(-1.0, -0.0275);\n\tconst vec2 c1 = vec2(1.0, 0.0425);\n\tvec2 r = roughness * c0 + c1;\n\treturn min( r.x * r.x, exp2( -9.28 * dotNV ) ) * r.x + r.y;\n}\n\nvoid RE_IndirectSpecular_BoxPBR( const in vec3 radiance, const in vec3 clearCoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight, out float fresnel ) {\n\n\t#ifdef CLEAR_COAT\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\tfloat dotNL = dotNV;\n\t\tfloat clearCoatDHR = material.clearCoat * clearCoatDHRApprox( material.clearCoatRoughness, dotNL );\n\t#else\n\t\tfloat clearCoatDHR = 0.0;\n\t#endif\n\n\t#if defined(METALNESS)\n\t\tfresnel = 0.0;\n\t\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n\t#else\n\t\tfresnel = BRDF_Specular_GGX_Environment_NonMetal( geometry, material.specularColor, material.specularRoughness );\n\t\treflectedLight.indirectSpecular += ( 1.0 - clearCoatDHR ) * radiance * fresnel;\n\t#endif\n\n\n\t#ifdef CLEAR_COAT\n\t\tfresnel += BRDF_Specular_GGX_Environment_NonMetal( geometry, vec3( 1.0 ), material.clearCoatRoughness );\n\t\tfresnel = clamp(fresnel, 0.0, 1.0);\n\t\treflectedLight.indirectSpecular += clearCoatRadiance * fresnel;\n\t#endif\n\n}\n\n#undef RE_IndirectDiffuse\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BoxPBR\n#undef RE_IndirectSpecular\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_BoxPBR\n\n#if defined(ENV_MAP_IRRADIANCE)\nvec3 getBox3DLightProbeIndirectIrradiance( /*const in SpecularLightProbe specularLightProbe,*/ const in GeometricContext geometry ) {\n\n\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\n\t#ifdef ENV_MAP_IRRADIANCE_TEX_TYPE_CUBE\n\n\t\tvec3 queryVec = vec3( worldNormal.x, worldNormal.yz );\n\t\tvec4 envMapColor = textureCube( envMapIrradiance, queryVec );\n\n\t#else\n\n\t\tvec4 envMapColor = vec4( 0.0 );\n\n\t#endif\n\t#ifdef ENV_MAP_IRRADIANCE_ENCODING_SRGB\n\t\tenvMapColor.rgb = sRGBToLinear( envMapColor ).rgb;\n\t#endif\n\n\treturn envMapColor.rgb * envMapIntensity;\n\n}\n#endif\n\n#if defined(ENV_MAP_RADIANCE)\n\n\t#if defined(ENV_MAP_IRRADIANCE) && defined(ENV_MAP_RADIANCE_HALF_GLOSS)\n\t\tvec3 getReflectionFromRoughness(in vec3 refRadiance, in vec3 refRadianceHalf, in vec3 refIrradiance, in float roughness) {\n\t\t\tfloat interp = roughness * 2.0;\n\t\t\treturn mix(mix(refRadiance, refRadianceHalf, min(interp, 1.0)), refIrradiance, max(interp - 1.0, 0.0));\n\t\t}\n\t#else\n\t\tvec3 getReflectionFromRoughness(in vec3 refRadiance, in vec3 refIrradiance, in float roughness) {\n\t\t\tfloat interp = min(roughness * 1.5, 1.0);\n\t\t\treturn mix(refRadiance, refIrradiance, interp);\n\t\t}\n\t#endif\n\n\tvec3 getBox3DLightProbeIndirectRadiance( const in GeometricContext geometry, const in float roughness ) {\n\n\t\t#ifdef ENV_MAP_RADIANCE_USE_SPHERICAL_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\n\t\t#endif\n\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\n\t\tvec3 envMapColor = vec3(0.0);\n\t\tfloat radianceBias = roughness * float(ENV_MAP_RADIANCE_NUM_MIPS) * 0.5;\n\t\tvec4 envMapColorRadiance = vec4(0.0);\n\n\t\t#ifdef ENV_MAP_RADIANCE_HALF_GLOSS\n\t\t\tfloat halfGlossBias = max((roughness - 0.5) * float(ENV_MAP_RADIANCE_HALF_GLOSS_NUM_MIPS), 0.0);\n\t\t#endif\n\n\t\t// Sample the environment map(s)\n\t\t#ifdef ENV_MAP_RADIANCE_TEX_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = vec3( reflectVec.x, reflectVec.yz );\n\t\t\t#define ENV_MAP_SAMPLE_FUNCTION textureCube\n\t\t#else // PLANAR REFLECTION\n\t\t\tvec2 queryReflectVec = vec2(-1.0, 1.0) * (gl_FragCoord.xy - screenDimensions.xy) / screenDimensions.zw;\n\t\t\t#define ENV_MAP_SAMPLE_FUNCTION texture2D\n\t\t#endif\n\n\t\t// Sample env maps\n\t\tenvMapColorRadiance.rgb = ENV_MAP_SAMPLE_FUNCTION( envMapRadiance, queryReflectVec, radianceBias ).rgb;\n\n\t\t#ifdef ENV_MAP_GLOSS_VARIANCE\n\t\t\t#ifdef ENV_MAP_RADIANCE_HALF_GLOSS\n\t\t\t\tvec4 envMapColorRadianceHalf = ENV_MAP_SAMPLE_FUNCTION( envMapRadianceHalfGloss, queryReflectVec, halfGlossBias );\n\t\t\t#endif\n\t\t\t#ifdef ENV_MAP_IRRADIANCE\n\t\t\t\tvec4 envMapColorIrradiance = ENV_MAP_SAMPLE_FUNCTION( envMapIrradiance, queryReflectVec );\n\t\t\t#endif\n\t\t#endif\n\n\t\t// Blend depending on which env maps are defined.\n\t\t#ifdef ENV_MAP_RADIANCE_ENCODING_SRGB\n\t\t\tenvMapColorRadiance.rgb = sRGBToLinear( envMapColorRadiance ).rgb;\n\t\t#endif\n\n\t\t#ifdef ENV_MAP_GLOSS_VARIANCE\n\n\t\t\t#if defined(ENV_MAP_IRRADIANCE_ENCODING_SRGB)\n\t\t\t\tenvMapColorIrradiance.rgb = sRGBToLinear(envMapColorIrradiance).rgb;\n\t\t\t#endif\n\n\t\t\t#if defined(ENV_MAP_RADIANCE_HALF_GLOSS) && defined(ENV_MAP_IRRADIANCE)\n\t\t\t\t#if defined(ENV_MAP_RADIANCE_HALF_GLOSS_ENCODING_SRGB)\n\t\t\t\t\tenvMapColorRadianceHalf.rgb = sRGBToLinear( envMapColorRadianceHalf ).rgb;\n\t\t\t\t#endif\n\t\t\t\tenvMapColor = getReflectionFromRoughness(envMapColorRadiance.rgb, envMapColorRadianceHalf.rgb, envMapColorIrradiance.rgb, roughness);\n\t\t\t#elif defined(ENV_MAP_IRRADIANCE)\n\t\t\t\tenvMapColor = getReflectionFromRoughness(envMapColorRadiance.rgb, envMapColorIrradiance.rgb, roughness);\n\t\t\t#else\n\t\t\t\tenvMapColor = envMapColorRadiance.rgb;\n\t\t\t#endif\n\t\t#else\n\t\t\tenvMapColor = envMapColorRadiance.rgb;\n\t\t#endif\n\n\t\treturn envMapColor.rgb * envMapIntensity;\n\n}\n#endif\n\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse * diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\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 <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#ifndef METALNESS\n\t\tmetalnessFactor = 0.0;\n\t#endif\n\n\t#include <normal_fragment>\n\n\t#ifdef EMISSIVE_MAP\n\t\t#include <emissivemap_fragment>\n\t#endif\n\n\t// accumulation\n\t// Removed chunk from physical material <lights_physical_fragment>\n\tPhysicalMaterial material;\n\tmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\n\tmaterial.specularRoughness = clamp( roughnessFactor, 0.00, 1.0 );\n\t#ifdef METALNESS\n\t\tfloat reflectivityF0 = mix(DEFAULT_SPECULAR_COEFFICIENT, MAXIMUM_SPECULAR_COEFFICIENT, metalnessFactor);\n\t\tmaterial.specularColor = mix( vec3(reflectivityF0), diffuseColor.rgb, metalnessFactor );\n\t#else\n\t\tmaterial.specularColor = specular;\n\t#endif\n\tmaterial.clearCoat = saturate( clearCoat ); // Burley clearcoat model\n\tmaterial.clearCoatRoughness = clamp( clearCoatRoughness, 0.04, 1.0 );\n\n\t// Sample gloss map and modify specular roughness\n\t#if defined(GLOSS_MAP) && !defined(ROUGHNESS_MAP)\n\t\tvec4 texelGloss = texture2D( glossMap, vUv );\n\t\tmaterial.specularRoughness = min(material.specularRoughness + 1.0 - texelGloss.r, 1.0);\n\t#endif\n\n\tGeometricContext geometry;\n\n\tgeometry.position = - vViewPosition;\n\tgeometry.normal = normal;\n\tgeometry.viewDir = normalize( vViewPosition );\n\n\tIncidentLight directLight;\n\n\t#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\t\tPointLight pointLight;\n\n\t\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\n\t\t\tpointLight = pointLights[ i ];\n\n\t\t\tgetPointDirectLightIrradiance( pointLight, geometry, directLight );\n\n\t\t\t#ifdef USE_SHADOWMAP\n\t\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t\t#endif\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\n\t#endif\n\n\t#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\n\t\tSpotLight spotLight;\n\n\t\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\n\t\t\tspotLight = spotLights[ i ];\n\n\t\t\tgetSpotDirectLightIrradiance( spotLight, geometry, directLight );\n\n\t\t\t#ifdef USE_SHADOWMAP\n\t\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t\t#endif\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\n\t#endif\n\n\t#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\n\t\tDirectionalLight directionalLight;\n\n\t\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n\t\t\tdirectionalLight = directionalLights[ i ];\n\n\t\t\tgetDirectionalDirectLightIrradiance( directionalLight, geometry, directLight );\n\n\t\t\t#ifdef USE_SHADOWMAP\n\t\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t\t#endif\n\n\t\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\n\t\t}\n\n\t#endif\n\n\t#if defined( RE_IndirectDiffuse )\n\n\t\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\n\t\t#ifdef USE_LIGHTMAP\n\n\t\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\n\t\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\n\t\t\t\tlightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage\n\n\t\t\t#endif\n\n\t\t\tirradiance += lightMapIrradiance;\n\n\t\t#endif\n\n\t\t#if ( NUM_HEMI_LIGHTS > 0 )\n\n\t\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\n\t\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\n\t\t\t}\n\n\t\t#endif\n\n\t\t#if defined(ENV_MAP_IRRADIANCE)\n\n\t\t\tirradiance += getBox3DLightProbeIndirectIrradiance( /*lightProbe,*/ geometry );\n\n\t\t#endif\n\n\t\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n\n\t#endif\n\n\t#if defined(ENV_MAP_RADIANCE) && defined( RE_IndirectSpecular )\n\n\t\tvec3 radiance = getBox3DLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry, material.specularRoughness );\n\t\t#ifdef CLEAR_COAT\n\t\t\tvec3 clearCoatRadiance = getBox3DLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry, material.clearCoatRoughness );\n\t\t#else\n\t\t\tvec3 clearCoatRadiance = vec3( 0.0 );\n\t\t#endif\n\t\tfloat fresnel = 0.0;\n\t\tRE_IndirectSpecular( radiance, clearCoatRadiance, geometry, material, reflectedLight, fresnel );\n\t\tdiffuseColor.a += fresnel; // This is a hack to avoid needing two passes to render transparency with reflections. It's not correct but looks okay.\n\t\tdiffuseColor.a = min(diffuseColor.a, 1.0);\n\n\t#endif\n\n\t#if defined(AO_MAP)\n\t\t//Removed chunk <aomap_fragment> Overriding so that we can use vUv instead of vUv2\n\t\tfloat ambientOcclusion = texture2D( aoMap, vUv ).r;\n\t\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t\t#if defined( USE_ENVMAP ) && defined( PHYSICAL )\n\t\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t\t#endif\n\t#endif\n\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\n}\n"},function(e,t){e.exports="#define PHYSICAL\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n\n#include <common>\n// Removed chunk from physical material <uv_pars_vertex>\n#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) || defined( GLOSS_MAP ) || defined(AO_MAP)\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n// Removed chunk from physical material <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n\n\t// Removed chunk from physical material <uv_vertex>\n\t#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP ) || defined( GLOSS_MAP ) || defined(AO_MAP)\n\t\tvUv = uv;\n\t#endif\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\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\n#ifndef FLAT_SHADED // Normal computed with derivatives when FLAT_SHADED\n\n\tvNormal = normalize( transformedNormal );\n\n#endif\n\n\t#include <begin_vertex>\n\t#include <displacementmap_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\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\n}\n"},function(e,t,r){(function(t){var r,r;(function(t){e.exports=t()})(function(){var e;return function e(t,i,n){function a(s,u){if(!i[s]){if(!t[s]){var p="function"==typeof r&&r;if(!u&&p)return r(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=i[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return a(r||e)},l,l.exports,e,t,i,n)}return i[s].exports}for(var o="function"==typeof r&&r,s=0;s<n.length;s++)a(n[s]);return a}({1:[function(e,t,r){"use strict";function i(e,t){!1!==t&&(t=!0);var r,n=e.async,a=e.transpile;switch(typeof a){case"string":var o=m[a];if(!o)throw new Error("bad transpiler: "+a);return e._transpileFunc=o(e,t);case"undefined":case"boolean":if("string"==typeof n){if(!(r=f[n]))throw new Error("bad async mode: "+n);return e.transpile=r(e,t)}for(var s=0;s<y.length;s++){var u=y[s];if(i(u,!1))return h.copy(u,e),e.transpile}throw new Error("generators, nodent and regenerator are not available");case"function":return e._transpileFunc=e.transpile;default:throw new Error("bad transpiler: "+a)}}function n(e,t){try{return new Function("(function*(){})()")(),!0}catch(e){if(t)throw new Error("generators not supported")}}function a(e,t){try{return new Function("(async function(){})()")(),!0}catch(e){if(t)throw new Error("es7 async functions not supported")}}function o(t,r){try{if(!l){l=e("regenerator"),l.runtime()}return t.async&&!0!==t.async||(t.async="es7"),s}catch(e){if(r)throw new Error("regenerator not available")}}function s(e){return l.compile(e).code}function u(t,r){try{if(!d){d=e("nodent")({log:!1,dontInstallRequireHook:!0})}return"es7"!=t.async&&(t.async&&!0!==t.async&&console.warn("nodent transpiles only es7 async functions"),t.async="es7"),p}catch(e){if(r)throw new Error("nodent not available")}}function p(e){return d.compile(e,"",{promises:!0,sourcemap:!1}).code}function c(e,t){function r(e,t,i){function a(e,r){if(!i)return t(e,r);setTimeout(function(){t(e,r)})}var o;try{o=n.compile(e)}catch(i){return void(i.missingSchema?function(i){function a(i,a){if(i)return t(i);if(!n._refs[o]&&!n._schemas[o])try{n.addSchema(a,o)}catch(e){return void t(e)}r(e,t)}var o=i.missingSchema;if(n._refs[o]||n._schemas[o])return t(new Error("Schema "+o+" is loaded but "+i.missingRef+" cannot be resolved"));var s=n._loadingSchemas[o];s?"function"==typeof s?n._loadingSchemas[o]=[s,a]:s[s.length]=a:(n._loadingSchemas[o]=a,n._opts.loadSchema(o,function(e,t){var r=n._loadingSchemas[o];if(delete n._loadingSchemas[o],"function"==typeof r)r(e,t);else for(var i=0;i<r.length;i++)r[i](e,t)}))}(i):a(i))}a(null,o)}var i,n=this;try{i=this._addSchema(e)}catch(e){return void setTimeout(function(){t(e)})}if(i.validate)setTimeout(function(){t(null,i.validate)});else{if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");r(e,t,!0)}}t.exports={setup:i,compile:c};var l,d,h=e("./compile/util"),f={"*":n,"co*":n,es7:a},m={nodent:u,regenerator:o},y=[{async:"co*"},{async:"es7",transpile:"nodent"},{async:"co*",transpile:"regenerator"}]},{"./compile/util":11}],2:[function(e,t,r){"use strict";var i=t.exports=function(){this._cache={}};i.prototype.put=function(e,t){this._cache[e]=t},i.prototype.get=function(e){return this._cache[e]},i.prototype.del=function(e){delete this._cache[e]},i.prototype.clear=function(){this._cache={}}},{}],3:[function(e,t,r){"use strict";t.exports={$ref:e("../dotjs/ref"),allOf:e("../dotjs/allOf"),anyOf:e("../dotjs/anyOf"),dependencies:e("../dotjs/dependencies"),enum:e("../dotjs/enum"),format:e("../dotjs/format"),items:e("../dotjs/items"),maximum:e("../dotjs/_limit"),minimum:e("../dotjs/_limit"),maxItems:e("../dotjs/_limitItems"),minItems:e("../dotjs/_limitItems"),maxLength:e("../dotjs/_limitLength"),minLength:e("../dotjs/_limitLength"),maxProperties:e("../dotjs/_limitProperties"),minProperties:e("../dotjs/_limitProperties"),multipleOf:e("../dotjs/multipleOf"),not:e("../dotjs/not"),oneOf:e("../dotjs/oneOf"),pattern:e("../dotjs/pattern"),properties:e("../dotjs/properties"),required:e("../dotjs/required"),uniqueItems:e("../dotjs/uniqueItems"),validate:e("../dotjs/validate")}},{"../dotjs/_limit":14,"../dotjs/_limitItems":15,"../dotjs/_limitLength":16,"../dotjs/_limitProperties":17,"../dotjs/allOf":18,"../dotjs/anyOf":19,"../dotjs/dependencies":22,"../dotjs/enum":23,"../dotjs/format":24,"../dotjs/items":25,"../dotjs/multipleOf":26,"../dotjs/not":27,"../dotjs/oneOf":28,"../dotjs/pattern":29,"../dotjs/properties":31,"../dotjs/ref":32,"../dotjs/required":33,"../dotjs/uniqueItems":35,"../dotjs/validate":36}],4:[function(e,t,r){"use strict";t.exports=function e(t,r){if(t===r)return!0;var i,n=Array.isArray(t),a=Array.isArray(r);if(n&&a){if(t.length!=r.length)return!1;for(i=0;i<t.length;i++)if(!e(t[i],r[i]))return!1;return!0}if(n!=a)return!1;if(t&&r&&"object"==typeof t&&"object"==typeof r){var o=Object.keys(t);if(o.length!==Object.keys(r).length)return!1;var s=t instanceof Date,u=r instanceof Date;if(s&&u)return t.getTime()==r.getTime();if(s!=u)return!1;var p=t instanceof RegExp,c=r instanceof RegExp;if(p&&c)return t.toString()==r.toString();if(p!=c)return!1;for(i=0;i<o.length;i++)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=0;i<o.length;i++)if(!e(t[o[i]],r[o[i]]))return!1;return!0}return!1}},{}],5:[function(e,t,r){"use strict";function i(e){e="full"==e?"full":"fast";var t=h.copy(i[e]);for(var r in i.compare)t[r]={validate:t[r],compare:i.compare[r]};return t}function n(e){var t=e.match(f);if(!t)return!1;var r=+t[1],i=+t[2];return r>=1&&r<=12&&i>=1&&i<=m[r]}function a(e,t){var r=e.match(y);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return i<=23&&n<=59&&a<=59&&(!t||o)}function o(e){var t=e.split(w);return 2==t.length&&n(t[0])&&a(t[1],!0)}function s(e){return e.length<=255&&g.test(e)}function u(e){return E.test(e)&&v.test(e)}function p(e){try{return new RegExp(e),!0}catch(e){return!1}}function c(e,t){if(e&&t)return e>t?1:e<t?-1:e===t?0:void 0}function l(e,t){if(e&&t&&(e=e.match(y),t=t.match(y),e&&t))return e=e[1]+e[2]+e[3]+(e[4]||""),t=t[1]+t[2]+t[3]+(t[4]||""),e>t?1:e<t?-1:e===t?0:void 0}function d(e,t){if(e&&t){e=e.split(w),t=t.split(w);var r=c(e[0],t[0]);if(void 0!==r)return r||l(e[1],t[1])}}var h=e("./util"),f=/^\d\d\d\d-(\d\d)-(\d\d)$/,m=[0,31,29,31,30,31,30,31,31,30,31,30,31],y=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i,g=/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i,v=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@\/?]|%[0-9a-f]{2})*)?$/i,b=/^(?:urn\:uuid\:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,x=/^(?:\/(?:[^~\/]|~0|~1)*)*$|^\#(?:\/(?:[a-z0-9_\-\.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,P=/^(?:0|[1-9][0-9]*)(?:\#|(?:\/(?:[^~\/]|~0|~1)*)*)$/;t.exports=i,i.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,uri:/^(?:[a-z][a-z0-9+-.]*)?(?:\:|\/)\/?[^\s]*$/i,email:/^[a-z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:g,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:p,uuid:b,"json-pointer":x,"relative-json-pointer":P},i.full={date:n,time:a,"date-time":o,uri:u,email:/^[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+\/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:p,uuid:b,"json-pointer":x,"relative-json-pointer":P},i.compare={date:c,time:l,"date-time":d};var w=/t|\s/i,E=/\/|\:/},{"./util":11}],6:[function(e,t,r){"use strict";function i(){if(void 0===h){try{h=e("js-beautify").js_beautify}catch(e){h=!1}}}function n(e,t,r,s){function E(){var e=G.validate,t=e.apply(null,arguments);return E.errors=e.errors,t}function S(e,r,a,o){var s=!r||r&&r.schema==e;if(r.schema!=t.schema)return n.call(O,e,r,a,o);var y=!0===e.$async;y&&!I.transpile&&g.setup(I);var E=v({isTop:!0,schema:e,isRoot:s,baseId:o,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',RULES:H,validate:v,util:m,resolve:f,resolveRef:_,usePattern:A,useDefault:R,useCustomRule:C,opts:I,formats:q,self:O});E=d(j,c)+d(L,u)+d(N,p)+d(V,l)+E,I.beautify&&(i(),h?E=h(E,I.beautify):console.error('"npm install js-beautify" to use beautify option'));var S,D,T=I._transpileFunc;try{D=y&&T?T(E):E;S=new Function("self","RULES","formats","root","refVal","defaults","customRules","co","equal","ucs2length","ValidationError",D)(O,H,q,t,j,N,V,b,P,x,w),j[0]=S}catch(e){throw console.error("Error compiling schema, function code:",D),e}return S.schema=e,S.errors=null,S.refs=k,S.refVal=j,S.root=s?S:r,y&&(S.$async=!0),z&&(S.sourceCode=E),!0===I.sourceCode&&(S.source={patterns:L,defaults:N}),S}function _(e,i,a){i=f.url(e,i);var o,s,u=k[i];if(void 0!==u)return o=j[u],s="refVal["+u+"]",M(o,s);if(!a&&t.refs){var p=t.refs[i];if(void 0!==p)return o=t.refVal[p],s=D(i,o),M(o,s)}s=D(i);var c=f.call(O,S,t,i);if(!c){var l=r&&r[i];l&&(c=f.inlineRef(l,I.inlineRefs)?l:n.call(O,l,t,r,e))}return c?(T(i,c),M(c,s)):void 0}function D(e,t){var r=j.length;return j[r]=t,k[e]=r,"refVal"+r}function T(e,t){var r=k[e];j[r]=t}function M(e,t){return"object"==typeof e?{code:t,schema:e,inline:!0}:{code:t,$async:e&&e.$async}}function A(e){var t=B[e];return void 0===t&&(t=B[e]=L.length,L[t]=e),"pattern"+t}function R(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return m.toQuotedString(e);case"object":if(null===e)return"null";var t=y(e),r=U[t];return void 0===r&&(r=U[t]=N.length,N[r]=e),"default"+r}}function C(e,t,r,i){var n=e.definition.validateSchema;if(n&&!1!==O._opts.validateSchema){if(!n(t)){var a="keyword schema is invalid: "+O.errorsText(n.errors);if("log"!=O._opts.validateSchema)throw new Error(a);console.error(a)}}var o,s=e.definition.compile,u=e.definition.inline,p=e.definition.macro;s?o=s.call(O,t,r,i):p?(o=p.call(O,t,r,i),!1!==I.validateSchema&&O.validateSchema(o,!0)):o=u?u.call(O,i,e.keyword,t,r):e.definition.validate;var c=V.length;return V[c]=o,{code:"customRule"+c,validate:o}}var O=this,I=this._opts,j=[void 0],k={},L=[],B={},N=[],U={},V=[],z=!1!==I.sourceCode;t=t||{schema:e,refVal:j,refs:k};var F=a.call(this,e,t,s),G=this._compilations[F.index];if(F.compiling)return G.callValidate=E;var q=this._formats,H=this.RULES;try{var $=S(e,t,r,s);G.validate=$;var W=G.callValidate;return W&&(W.schema=$.schema,W.errors=null,W.refs=$.refs,W.refVal=$.refVal,W.root=$.root,W.$async=$.$async,z&&(W.sourceCode=$.sourceCode)),$}finally{o.call(this,e,t,s)}}function a(e,t,r){var i=s.call(this,e,t,r);return i>=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function o(e,t,r){var i=s.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function s(e,t,r){for(var i=0;i<this._compilations.length;i++){var n=this._compilations[i];if(n.schema==e&&n.root==t&&n.baseId==r)return i}return-1}function u(e,t){return"var pattern"+e+" = new RegExp("+m.toQuotedString(t[e])+");"}function p(e){return"var default"+e+" = defaults["+e+"];"}function c(e,t){return t[e]?"var refVal"+e+" = refVal["+e+"];":""}function l(e){return"var customRule"+e+" = customRules["+e+"];"}function d(e,t){if(!e.length)return"";for(var r="",i=0;i<e.length;i++)r+=t(i,e);return r}var h,f=e("./resolve"),m=e("./util"),y=e("json-stable-stringify"),g=e("../async"),v=e("../dotjs/validate"),b=e("co"),x=m.ucs2length,P=e("./equal"),w=e("./validation_error");t.exports=n},{"../async":1,"../dotjs/validate":36,"./equal":4,"./resolve":7,"./util":11,"./validation_error":12,co:41,"json-stable-stringify":42}],7:[function(e,t,r){"use strict";function i(e,t,r){var a=this._refs[r];if("string"==typeof a){if(!this._refs[a])return i.call(this,e,t,a);a=this._refs[a]}if((a=a||this._schemas[r])instanceof v)return s(a.schema,this._opts.inlineRefs)?a.schema:a.validate||this._compile(a);var o,u,p,c=n.call(this,t,r);return c&&(o=c.schema,t=c.root,p=c.baseId),o instanceof v?u=o.validate||e.call(this,o.schema,t,void 0,p):o&&(u=s(o,this._opts.inlineRefs)?o:e.call(this,o,t,void 0,p)),u}function n(e,t){var r=m.parse(t,!1,!0),i=l(r),n=c(e.schema.id);if(i!==n){var s=d(i),u=this._refs[s];if("string"==typeof u)return a.call(this,e,u,r);if(u instanceof v)u.validate||this._compile(u),e=u;else{if(!((u=this._schemas[s])instanceof v))return;if(u.validate||this._compile(u),s==d(t))return{schema:u,root:e,baseId:n};e=u}if(!e.schema)return;n=c(e.schema.id)}return o.call(this,r,n,e.schema,e)}function a(e,t,r){var i=n.call(this,e,t);if(i){var a=i.schema,s=i.baseId;return e=i.root,a.id&&(s=h(s,a.id)),o.call(this,r,s,a,e)}}function o(e,t,r,i){if(e.hash=e.hash||"","#/"==e.hash.slice(0,2)){for(var a=e.hash.split("/"),o=1;o<a.length;o++){var s=a[o];if(s){if(s=g.unescapeFragment(s),!(r=r[s]))break;if(r.id&&!b[s]&&(t=h(t,r.id)),r.$ref){var u=h(t,r.$ref),p=n.call(this,i,u);p&&(r=p.schema,i=p.root,t=p.baseId)}}}return r&&r!=i.schema?{schema:r,root:i,baseId:t}:void 0}}function s(e,t){return!1!==t&&(void 0===t||!0===t?u(e):t?p(e)<=t:void 0)}function u(e){var t;if(Array.isArray(e)){for(var r=0;r<e.length;r++)if("object"==typeof(t=e[r])&&!u(t))return!1}else for(var i in e){if("$ref"==i)return!1;if("object"==typeof(t=e[i])&&!u(t))return!1}return!0}function p(e){var t,r=0;if(Array.isArray(e)){for(var i=0;i<e.length;i++)if(t=e[i],"object"==typeof t&&(r+=p(t)),r==1/0)return 1/0}else for(var n in e){if("$ref"==n)return 1/0;if(x[n])r++;else if(t=e[n],"object"==typeof t&&(r+=p(t)+1),r==1/0)return 1/0}return r}function c(e,t){return!1!==t&&(e=d(e)),l(m.parse(e,!1,!0))}function l(e){var t=e.protocol||"//"==e.href.slice(0,2)?"//":"";return(e.protocol||"")+t+(e.host||"")+(e.path||"")+"#"}function d(e){return e?e.replace(P,""):""}function h(e,t){return t=d(t),m.resolve(e,t)}function f(e){function t(e,r,n){if(Array.isArray(e))for(var a=0;a<e.length;a++)t.call(this,e[a],r+"/"+a,n);else if(e&&"object"==typeof e){if("string"==typeof e.id){var o=n=n?m.resolve(n,e.id):e.id;o=d(o);var s=this._refs[o];if("string"==typeof s&&(s=this._refs[s]),s&&s.schema){if(!y(e,s.schema))throw new Error('id "'+o+'" resolves to more than one schema')}else if(o!=d(r))if("#"==o[0]){if(i[o]&&!y(e,i[o]))throw new Error('id "'+o+'" resolves to more than one schema');i[o]=e}else this._refs[o]=r}for(var u in e)t.call(this,e[u],r+"/"+g.escapeFragment(u),n)}}var r=d(e.id),i={};return t.call(this,e,c(r,!1),r),i}var m=e("url"),y=e("./equal"),g=e("./util"),v=e("./schema_obj");t.exports=i,i.normalizeId=d,i.fullPath=c,i.url=h,i.ids=f,i.inlineRef=s,i.schema=n;var b=g.toHash(["properties","patternProperties","enum","dependencies","definitions"]),x=g.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]),P=/#\/?$/},{"./equal":4,"./schema_obj":9,"./util":11,url:50}],8:[function(e,t,r){"use strict";var i=e("./_rules"),n=e("./util").toHash;t.exports=function(){var e=[{type:"number",rules:["maximum","minimum","multipleOf"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","uniqueItems","items"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","properties"]},{rules:["$ref","enum","not","anyOf","oneOf","allOf"]}],t=["type","additionalProperties","patternProperties"],r=["additionalItems","$schema","id","title","description","default"],a=["number","integer","string","array","object","boolean","null"];return e.all=n(t),e.forEach(function(r){r.rules=r.rules.map(function(r){return t.push(r),e.all[r]={keyword:r,code:i[r]}})}),e.keywords=n(t.concat(r)),e.types=n(a),e.custom={},e}},{"./_rules":3,"./util":11}],9:[function(e,t,r){"use strict";function i(e){n.copy(e,this)}var n=e("./util");t.exports=i},{"./util":11}],10:[function(e,t,r){"use strict";t.exports=function(e){for(var t,r=0,i=e.length,n=0;n<i;)r++,(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<i&&56320==(64512&(t=e.charCodeAt(n)))&&n++;return r}},{}],11:[function(e,t,r){"use strict";function i(e,t){t=t||{};for(var r in e)t[r]=e[r];return t}function n(e,t,r){var i=r?" !== ":" === ",n=r?" || ":" && ",a=r?"!":"",o=r?"":"!";switch(e){case"null":return t+i+"null";case"array":return a+"Array.isArray("+t+")";case"object":return"("+a+t+n+"typeof "+t+i+'"object"'+n+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+i+'"number"'+n+o+"("+t+" % 1)"+n+t+i+t+")";default:return"typeof "+t+i+'"'+e+'"'}}function a(e,t){switch(e.length){case 1:return n(e[0],t,!0);default:var r="",i=s(e);i.array&&i.object&&(r=i.null?"(":"(!"+t+" || ",r+="typeof "+t+' !== "object")',delete i.null,delete i.array,delete i.object),i.number&&delete i.integer;for(var a in i)r+=(r?" && ":"")+n(a,t,!0);return r}}function o(e,t){if(Array.isArray(t)){for(var r=[],i=0;i<t.length;i++){var n=t[i];_[n]?r[r.length]=n:"array"===e&&"array"===n&&(r[r.length]=n)}if(r.length)return r}else{if(_[t])return[t];if("array"===e&&"array"===t)return["array"]}}function s(e){for(var t={},r=0;r<e.length;r++)t[e[r]]=!0;return t}function u(e){return"number"==typeof e?"["+e+"]":D.test(e)?"."+e:"['"+p(e)+"']"}function p(e){return e.replace(T,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function c(e,t){t+="[^0-9]";var r=e.match(new RegExp(t,"g"));return r?r.length:0}function l(e,t,r){return t+="([^0-9])",r=r.replace(/\$/g,"$$$$"),e.replace(new RegExp(t,"g"),r+"$1")}function d(e){return e.replace(M,"").replace(A,"").replace(R,"if (!($1))")}function h(e,t){var r=e.match(C);return r&&2===r.length?t?e.replace(I,"").replace(L,B):e.replace(O,"").replace(j,k):e}function f(e,t){for(var r in e)if(t[r])return!0}function m(e,t,r){for(var i in e)if(i!=r&&t[i])return!0}function y(e){return"'"+p(e)+"'"}function g(e,t,r,i){return x(e,r?"'/' + "+t+(i?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):i?"'[' + "+t+" + ']'":"'[\\'' + "+t+" + '\\']'")}function v(e,t,r){return x(e,y(r?"/"+E(t):u(t)))}function b(e,t,r){var i,n,a,o;if(""===e)return"rootData";if("/"==e[0]){if(!N.test(e))throw new Error("Invalid JSON-pointer: "+e);n=e,a="rootData"}else{if(!(o=e.match(U)))throw new Error("Invalid JSON-pointer: "+e);if(i=+o[1],"#"==(n=o[2])){if(i>=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!n)return a}for(var s=a,p=n.split("/"),c=0;c<p.length;c++){var l=p[c];l&&(a+=u(S(l)),s+=" && "+a)}return s}function x(e,t){return'""'==e?t:(e+" + "+t).replace(/' \+ '/g,"")}function P(e){return S(decodeURIComponent(e))}function w(e){return encodeURIComponent(E(e))}function E(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function S(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}t.exports={copy:i,checkDataType:n,checkDataTypes:a,coerceToTypes:o,toHash:s,getProperty:u,escapeQuotes:p,ucs2length:e("./ucs2length"),varOccurences:c,varReplace:l,cleanUpCode:d,cleanUpVarErrors:h,schemaHasRules:f,schemaHasRulesExcept:m,stableStringify:e("json-stable-stringify"),toQuotedString:y,getPathExpr:g,getPath:v,getData:b,unescapeFragment:P,escapeFragment:w,escapeJsonPointer:E};var _=s(["string","number","integer","boolean","null"]),D=/^[a-z$_][a-z$_0-9]*$/i,T=/'|\\/g,M=/else\s*{\s*}/g,A=/if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g,R=/if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g,C=/[^v\.]errors/g,O=/var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g,I=/var errors = 0;|var vErrors = null;/g,j="return errors === 0;",k="validate.errors = null; return true;",L=/if \(errors === 0\) return true;\s*else throw new ValidationError\(vErrors\);/,B="return true;",N=/^\/(?:[^~]|~0|~1)*$/,U=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/},{"./ucs2length":10,"json-stable-stringify":42}],12:[function(e,t,r){"use strict";function i(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}t.exports=i,i.prototype=Object.create(Error.prototype),i.prototype.constructor=i},{}],13:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),l="valid"+n;if(i+="var "+l+" = undefined;",!1===e.opts.format)return i+=" "+l+" = true; ";var d=e.schema.format,h=e.opts.v5&&d.$data,f="";if(h){var m=e.util.getData(d.$data,a,e.dataPathArr),y="format"+n,g="compare"+n;i+=" var "+y+" = formats["+m+"] , "+g+" = "+y+" && "+y+".compare;"}else{var y=e.formats[d];if(!y||!y.compare)return i+=" "+l+" = true; ";var g="formats"+e.util.getProperty(d)+".compare"}var v,b="formatMaximum"==t,x="formatExclusive"+(b?"Maximum":"Minimum"),P=e.schema[x],w=e.opts.v5&&P&&P.$data,E=b?"<":">",S="result"+n,_=e.opts.v5&&o&&o.$data;if(_?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",v="schema"+n):v=o,w){var D=e.util.getData(P.$data,a,e.dataPathArr),T="exclusive"+n,M="op"+n,A="' + "+M+" + '";i+=" var schemaExcl"+n+" = "+D+"; ",D="schemaExcl"+n,i+=" if (typeof "+D+" != 'boolean' && "+D+" !== undefined) { "+l+" = false; ";var r=x,R=R||[];R.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(r||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var C=i;i=R.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(f+="}",i+=" else { "),_&&(i+=" if ("+v+" === undefined) "+l+" = true; else if (typeof "+v+" != 'string') "+l+" = false; else { ",f+="}"),h&&(i+=" if (!"+g+") "+l+" = true; else { ",f+="}"),i+=" var "+S+" = "+g+"("+c+", ",i+=_?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+S+" === undefined) "+l+" = false; var "+T+" = "+D+" === true; if ("+l+" === undefined) { "+l+" = "+T+" ? "+S+" "+E+" 0 : "+S+" "+E+"= 0; } if (!"+l+") var op"+n+" = "+T+" ? '"+E+"' : '"+E+"=';"}else{var T=!0===P,A=E;T||(A+="=");var M="'"+A+"'";_&&(i+=" if ("+v+" === undefined) "+l+" = true; else if (typeof "+v+" != 'string') "+l+" = false; else { ",f+="}"),h&&(i+=" if (!"+g+") "+l+" = true; else { ",f+="}"),i+=" var "+S+" = "+g+"("+c+", ",i+=_?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+S+" === undefined) "+l+" = false; if ("+l+" === undefined) "+l+" = "+S+" "+E,T||(i+="="),i+=" 0;"}i+=f+"if (!"+l+") { ";var r=t,R=R||[];R.push(i),i="",!1!==e.createErrors?(i+=" { keyword: '"+(r||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+M+", limit: ",i+=_?""+v:""+e.util.toQuotedString(o),i+=" , exclusive: "+T+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be "+A+' "',i+=_?"' + "+v+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=_?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var C=i;return i=R.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="}"}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maximum"==t,f=h?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],y=e.opts.v5&&m&&m.$data,g=h?"<":">",v=h?">":"<";if(y){var b=e.util.getData(m.$data,o,e.dataPathArr),x="exclusive"+a,P="op"+a,w="' + "+P+" + '";n+=" var schemaExcl"+a+" = "+b+"; ",b="schemaExcl"+a,n+=" var exclusive"+a+"; if (typeof "+b+" != 'boolean' && typeof "+b+" != 'undefined') { ";var r=f,E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(n+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var S=n;n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ((exclusive"+a+" = "+b+" === true) ? "+l+" "+v+"= "+i+" : "+l+" "+v+" "+i+") || "+l+" !== "+l+") { var op"+a+" = exclusive"+a+" ? '"+g+"' : '"+g+"=';"}else{var x=!0===m,w=g;x||(w+="=");var P="'"+w+"'";n+=" if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+l+" "+v,x&&(n+="="),n+=" "+i+" || "+l+" !== "+l+") {"}var r=t,E=E||[];E.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+P+", limit: "+i+", exclusive: "+x+" } ",!1!==e.opts.messages&&(n+=" , message: 'should be "+w+" ",n+=d?"' + "+i:s+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var S=n;return n=E.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+S+"]); ":n+=" validate.errors = ["+S+"]; return false; ":n+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maxItems"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+l+".length "+h+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"less",n+=" than ",n+=d?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),!1===e.opts.unicode?n+=" "+l+".length ":n+=" ucs2length("+l+") ",n+=" "+h+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maxProperties"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+l+").length "+h+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"less",n+=" than ",n+=d?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.schema[t],n=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,s=e.util.copy(e),u="";s.level++;var p="valid"+s.level,c=s.baseId,l=!0,d=i;if(d)for(var h,f=-1,m=d.length-1;f<m;)h=d[f+=1],e.util.schemaHasRules(h,e.RULES.all)&&(l=!1,s.schema=h,s.schemaPath=n+"["+f+"]",s.errSchemaPath=a+"/"+f,r+=" "+e.validate(s)+" ",s.baseId=c,o&&(r+=" if ("+p+") { ",u+="}"));return o&&(r+=l?" if (true) { ":" "+u.slice(0,-1)+" "),r=e.util.cleanUpCode(r)}},{}],19:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l="errs__"+i,d=e.util.copy(e),h="";d.level++;var f="valid"+d.level;if(a.every(function(t){return e.util.schemaHasRules(t,e.RULES.all)})){var m=d.baseId;r+=" var "+l+" = errors; var "+c+" = false; ";var y=e.compositeRule;e.compositeRule=d.compositeRule=!0;var g=a;if(g)for(var v,b=-1,x=g.length-1;b<x;)v=g[b+=1],d.schema=v,d.schemaPath=o+"["+b+"]",d.errSchemaPath=s+"/"+b,r+=" "+e.validate(d)+" ",d.baseId=m,r+=" "+c+" = "+c+" || "+f+"; if (!"+c+") { ",h+="}";e.compositeRule=d.compositeRule=y,r+=" "+h+" if (!"+c+") { var err = ",!1!==e.createErrors?(r+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } "),r=e.util.cleanUpCode(r)}else u&&(r+=" if (true) { ");return r}},{}],20:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l=e.opts.v5&&a&&a.$data;l&&(r+=" var schema"+i+" = "+e.util.getData(a.$data,n,e.dataPathArr)+"; "),l||(r+=" var schema"+i+" = validate.schema"+o+";"),r+="var "+c+" = equal("+p+", schema"+i+"); if (!"+c+") { ";var d=d||[];d.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'constant' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should be equal to constant' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var h=r;return r=d.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+h+"]); ":r+=" validate.errors = ["+h+"]; return false; ":r+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }"}},{}],21:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h="errs__"+a,f=e.opts.v5&&s&&s.$data;f?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var m,y,g,v,b,x=this,P="definition"+a,w=x.definition;if(f&&w.$data){b="keywordValidate"+a;var E=w.validateSchema;n+=" var "+P+" = RULES.custom['"+t+"'].definition; var "+b+" = "+P+".validate;"}else v=e.useCustomRule(x,s,e.schema,e),i="validate.schema"+u,b=v.code,m=w.compile,y=w.inline,g=w.macro;var S=b+".errors",_="i"+a,D="ruleErr"+a,T=w.async;if(T&&!e.async)throw new Error("async keyword in sync schema");if(y||g||(n+=S+" = null;"),n+="var "+h+" = errors;var "+d+";",E&&(n+=" "+d+" = "+P+".validateSchema("+i+"); if ("+d+") {"),y)w.statements?n+=" "+v.validate+" ":n+=" "+d+" = "+v.validate+"; ";else if(g){var M=e.util.copy(e);M.level++;var A="valid"+M.level;M.schema=v.validate,M.schemaPath="";var R=e.compositeRule;e.compositeRule=M.compositeRule=!0;var C=e.validate(M).replace(/validate\.schema/g,b);e.compositeRule=M.compositeRule=R,n+=" "+C}else{var O=O||[];O.push(n),n="",n+=" "+b+".call( ",e.opts.passContext?n+="this":n+="self",m||!1===w.schema?n+=" , "+l+" ":n+=" , "+i+" , "+l+" , validate.schema"+e.schemaPath+" ",n+=" , (dataPath || '')",'""'!=e.errorPath&&(n+=" + "+e.errorPath);var I=o?"data"+(o-1||""):"parentData",j=o?e.dataPathArr[o]:"parentDataProperty";n+=" , "+I+" , "+j+" , rootData ) ";var k=n;n=O.pop(),!1===w.errors?(n+=" "+d+" = ",T&&(n+=""+e.yieldAwait),n+=k+"; "):T?(S="customErrors"+a,n+=" var "+S+" = null; try { "+d+" = "+e.yieldAwait+k+"; } catch (e) { "+d+" = false; if (e instanceof ValidationError) "+S+" = e.errors; else throw e; } "):n+=" "+S+" = null; "+d+" = "+k+"; "}if(w.modifying&&(n+=" "+l+" = "+I+"["+j+"];"),E&&(n+=" }"),w.valid)c&&(n+=" if (true) { ");else{n+=" if ( ",void 0===w.valid?(n+=" !",n+=g?""+A:""+d):n+=" "+!w.valid+" ",n+=") { ",r=x.keyword;var O=O||[];O.push(n),n="";var O=O||[];O.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { keyword: '"+x.keyword+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should pass \""+x.keyword+"\" keyword validation' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var L=n;n=O.pop(),!e.compositeRule&&c?e.async?n+=" throw new ValidationError(["+L+"]); ":n+=" validate.errors = ["+L+"]; return false; ":n+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var B=n;n=O.pop(),y?w.errors?"full"!=w.errors&&(n+=" for (var "+_+"="+h+"; "+_+"<errors; "+_+"++) { var "+D+" = vErrors["+_+"]; if ("+D+".dataPath === undefined) "+D+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+D+".schemaPath === undefined) { "+D+'.schemaPath = "'+p+'"; } ',e.opts.verbose&&(n+=" "+D+".schema = "+i+"; "+D+".data = "+l+"; "),n+=" } "):!1===w.errors?n+=" "+B+" ":(n+=" if ("+h+" == errors) { "+B+" } else { for (var "+_+"="+h+"; "+_+"<errors; "+_+"++) { var "+D+" = vErrors["+_+"]; if ("+D+".dataPath === undefined) "+D+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+D+".schemaPath === undefined) { "+D+'.schemaPath = "'+p+'"; } ',e.opts.verbose&&(n+=" "+D+".schema = "+i+"; "+D+".data = "+l+"; "),n+=" } } "):g?(n+=" var err = ",!1!==e.createErrors?(n+=" { keyword: '"+(r||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { keyword: '"+x.keyword+"' } ",!1!==e.opts.messages&&(n+=" , message: 'should pass \""+x.keyword+"\" keyword validation' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ",n+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(e.async?n+=" throw new ValidationError(vErrors); ":n+=" validate.errors = vErrors; return false; ")):!1===w.errors?n+=" "+B+" ":(n+=" if (Array.isArray("+S+")) { if (vErrors === null) vErrors = "+S+"; else vErrors = vErrors.concat("+S+"); errors = vErrors.length; for (var "+_+"="+h+"; "+_+"<errors; "+_+"++) { var "+D+" = vErrors["+_+"]; if ("+D+".dataPath === undefined) "+D+".dataPath = (dataPath || '') + "+e.errorPath+"; "+D+'.schemaPath = "'+p+'"; ',e.opts.verbose&&(n+=" "+D+".schema = "+i+"; "+D+".data = "+l+"; "),n+=" } } else { "+B+" } "),n+=" } ",c&&(n+=" else { ")}return n}},{}],22:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="errs__"+i,l=e.util.copy(e),d="";l.level++;var h="valid"+l.level,f={},m={};for(b in a){var y=a[b],g=Array.isArray(y)?m:f;g[b]=y}r+="var "+c+" = errors;";var v=e.errorPath;r+="var missing"+i+";";for(var b in m){if(g=m[b],r+=" if ("+p+e.util.getProperty(b)+" !== undefined ",u){r+=" && ( ";var x=g;if(x)for(var P,w=-1,E=x.length-1;w<E;){P=x[w+=1],w&&(r+=" || ");var S=e.util.getProperty(P);r+=" ( "+p+S+" === undefined && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?P:S)+") ) "}r+=")) { ";var _="missing"+i,D="' + "+_+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(v,_,!0):v+" + "+_);var T=T||[];T.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { property: '"+e.util.escapeQuotes(b)+"', missingProperty: '"+D+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have ",1==g.length?r+="property "+e.util.escapeQuotes(g[0]):r+="properties "+e.util.escapeQuotes(g.join(", ")),r+=" when property "+e.util.escapeQuotes(b)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var M=r;r=T.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+M+"]); ":r+=" validate.errors = ["+M+"]; return false; ":r+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{r+=" ) { ";var A=g;if(A)for(var R,C=-1,O=A.length-1;C<O;){R=A[C+=1];var S=e.util.getProperty(R),D=e.util.escapeQuotes(R);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(v,R,e.opts.jsonPointers)),r+=" if ("+p+S+" === undefined) { var err = ",!1!==e.createErrors?(r+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { property: '"+e.util.escapeQuotes(b)+"', missingProperty: '"+D+"', depsCount: "+g.length+", deps: '"+e.util.escapeQuotes(1==g.length?g[0]:g.join(", "))+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have ",1==g.length?r+="property "+e.util.escapeQuotes(g[0]):r+="properties "+e.util.escapeQuotes(g.join(", ")),r+=" when property "+e.util.escapeQuotes(b)+" is present' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}r+=" } ",u&&(d+="}",r+=" else { ")}e.errorPath=v;var I=l.baseId;for(var b in f){var y=f[b];e.util.schemaHasRules(y,e.RULES.all)&&(r+=" "+h+" = true; if ("+p+e.util.getProperty(b)+" !== undefined) { ",l.schema=y,l.schemaPath=o+e.util.getProperty(b),l.errSchemaPath=s+"/"+e.util.escapeFragment(b),r+=" "+e.validate(l)+" ",l.baseId=I,r+=" } ",u&&(r+=" if ("+h+") { ",d+="}"))}return u&&(r+=" "+d+" if ("+c+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],23:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l=e.opts.v5&&a&&a.$data;l&&(r+=" var schema"+i+" = "+e.util.getData(a.$data,n,e.dataPathArr)+"; ");var d="i"+i,h="schema"+i;l||(r+=" var "+h+" = validate.schema"+o+";"),r+="var "+c+";",l&&(r+=" if (schema"+i+" === undefined) "+c+" = true; else if (!Array.isArray(schema"+i+")) "+c+" = false; else {"),r+=c+" = false;for (var "+d+"=0; "+d+"<"+h+".length; "+d+"++) if (equal("+p+", "+h+"["+d+"])) { "+c+" = true; break; }",l&&(r+=" } "),r+=" if (!"+c+") { ";var f=f||[];f.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { allowedValues: schema"+i+" } ",!1!==e.opts.messages&&(r+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var m=r;return r=f.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+m+"]); ":r+=" validate.errors = ["+m+"]; return false; ":r+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" }",u&&(r+=" else { "),r}},{}],24:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||"");if(!1===e.opts.format)return u&&(r+=" if (true) { "),r;var c,l=e.opts.v5&&a&&a.$data;l?(r+=" var schema"+i+" = "+e.util.getData(a.$data,n,e.dataPathArr)+"; ",c="schema"+i):c=a;var d=e.opts.unknownFormats,h=Array.isArray(d);if(l){var f="format"+i;r+=" var "+f+" = formats["+c+"]; var isObject"+i+" = typeof "+f+" == 'object' && !("+f+" instanceof RegExp) && "+f+".validate; if (isObject"+i+") { ",e.async&&(r+=" var async"+i+" = "+f+".async; "),r+=" "+f+" = "+f+".validate; } if ( ",l&&(r+=" ("+c+" !== undefined && typeof "+c+" != 'string') || "),r+=" (",(!0===d||h)&&(r+=" ("+c+" && !"+f+" ",h&&(r+=" && self._opts.unknownFormats.indexOf("+c+") == -1 "),r+=") || "),r+=" ("+f+" && !(typeof "+f+" == 'function' ? ",e.async?r+=" (async"+i+" ? "+e.yieldAwait+" "+f+"("+p+") : "+f+"("+p+")) ":r+=" "+f+"("+p+") ",r+=" : "+f+".test("+p+"))))) {"}else{var f=e.formats[a];if(!f){if(!0===d||h&&-1==d.indexOf(a))throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"');return h||(console.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),"ignore"!==d&&console.warn("In the next major version it will throw exception. See option unknownFormats for more information")),u&&(r+=" if (true) { "),r}var m="object"==typeof f&&!(f instanceof RegExp)&&f.validate;if(m){var y=!0===f.async;f=f.validate}if(y){if(!e.async)throw new Error("async format in sync schema");var g="formats"+e.util.getProperty(a)+".validate";r+=" if (!("+e.yieldAwait+" "+g+"("+p+"))) { "}else{r+=" if (! ";var g="formats"+e.util.getProperty(a);m&&(g+=".validate"),r+="function"==typeof f?" "+g+"("+p+") ":" "+g+".test("+p+") ",r+=") { "}}var v=v||[];v.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { format: ",r+=l?""+c:""+e.util.toQuotedString(a),r+=" } ",!1!==e.opts.messages&&(r+=" , message: 'should match format \"",r+=l?"' + "+c+" + '":""+e.util.escapeQuotes(a),r+="\"' "),e.opts.verbose&&(r+=" , schema: ",r+=l?"validate.schema"+o:""+e.util.toQuotedString(a),r+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var b=r;return r=v.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+b+"]); ":r+=" validate.errors = ["+b+"]; return false; ":r+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",u&&(r+=" else { "),r}},{}],25:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l="errs__"+i,d=e.util.copy(e),h="";d.level++;var f="valid"+d.level,m="i"+i,y=d.dataLevel=e.dataLevel+1,g="data"+y,v=e.baseId;if(r+="var "+l+" = errors;var "+c+";",Array.isArray(a)){var b=e.schema.additionalItems;if(!1===b){r+=" "+c+" = "+p+".length <= "+a.length+"; ";var x=s;s=e.errSchemaPath+"/additionalItems",r+=" if (!"+c+") { ";var P=P||[];P.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { limit: "+a.length+" } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var w=r;r=P.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+w+"]); ":r+=" validate.errors = ["+w+"]; return false; ":r+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",s=x,u&&(h+="}",r+=" else { ")}var E=a;if(E)for(var S,_=-1,D=E.length-1;_<D;)if(S=E[_+=1],e.util.schemaHasRules(S,e.RULES.all)){r+=" "+f+" = true; if ("+p+".length > "+_+") { ";var T=p+"["+_+"]";d.schema=S,d.schemaPath=o+"["+_+"]",d.errSchemaPath=s+"/"+_,d.errorPath=e.util.getPathExpr(e.errorPath,_,e.opts.jsonPointers,!0),d.dataPathArr[y]=_;var M=e.validate(d);d.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,T)+" ":r+=" var "+g+" = "+T+"; "+M+" ",r+=" } ",u&&(r+=" if ("+f+") { ",h+="}")}if("object"==typeof b&&e.util.schemaHasRules(b,e.RULES.all)){d.schema=b,d.schemaPath=e.schemaPath+".additionalItems",d.errSchemaPath=e.errSchemaPath+"/additionalItems",r+=" "+f+" = true; if ("+p+".length > "+a.length+") { for (var "+m+" = "+a.length+"; "+m+" < "+p+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var T=p+"["+m+"]";d.dataPathArr[y]=m;var M=e.validate(d);d.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,T)+" ":r+=" var "+g+" = "+T+"; "+M+" ",u&&(r+=" if (!"+f+") break; "),r+=" } } ",u&&(r+=" if ("+f+") { ",h+="}")}}else if(e.util.schemaHasRules(a,e.RULES.all)){d.schema=a,d.schemaPath=o,d.errSchemaPath=s,r+=" for (var "+m+" = 0; "+m+" < "+p+".length; "+m+"++) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var T=p+"["+m+"]";d.dataPathArr[y]=m;var M=e.validate(d);d.baseId=v,e.util.varOccurences(M,g)<2?r+=" "+e.util.varReplace(M,g,T)+" ":r+=" var "+g+" = "+T+"; "+M+" ",u&&(r+=" if (!"+f+") break; "),r+=" } ",u&&(r+=" if ("+f+") { ",h+="}")}return u&&(r+=" "+h+" if ("+l+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),l=e.opts.v5&&o&&o.$data;l?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",r="schema"+n):r=o,i+="var division"+n+";if (",l&&(i+=" "+r+" !== undefined && ( typeof "+r+" != 'number' || "),i+=" (division"+n+" = "+c+" / "+r+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+n+") - division"+n+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+n+" !== parseInt(division"+n+") ",i+=" ) ",l&&(i+=" ) "),i+=" ) { ";var d=d||[];d.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+r+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be multiple of ",i+=l?"' + "+r:o+"'"),e.opts.verbose&&(i+=" , schema: ",i+=l?"validate.schema"+s:""+o,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var h=i;return i=d.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+h+"]); ":i+=" validate.errors = ["+h+"]; return false; ":i+=" var err = "+h+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",p&&(i+=" else { "),i}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="errs__"+i,l=e.util.copy(e);l.level++;var d="valid"+l.level;if(e.util.schemaHasRules(a,e.RULES.all)){l.schema=a,l.schemaPath=o,l.errSchemaPath=s,r+=" var "+c+" = errors; ";var h=e.compositeRule;e.compositeRule=l.compositeRule=!0,l.createErrors=!1;var f;l.opts.allErrors&&(f=l.opts.allErrors,l.opts.allErrors=!1),r+=" "+e.validate(l)+" ",l.createErrors=!0,f&&(l.opts.allErrors=f),e.compositeRule=l.compositeRule=h,r+=" if ("+d+") { ";var m=m||[];m.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var y=r;r=m.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+y+"]); ":r+=" validate.errors = ["+y+"]; return false; ":r+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { errors = "+c+"; if (vErrors !== null) { if ("+c+") vErrors.length = "+c+"; else vErrors = null; } ",e.opts.allErrors&&(r+=" } ")}else r+=" var err = ",!1!==e.createErrors?(r+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should NOT be valid' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(r+=" if (false) { ");return r}},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l="errs__"+i,d=e.util.copy(e),h="";d.level++;var f="valid"+d.level;r+="var "+l+" = errors;var prevValid"+i+" = false;var "+c+" = false;";var m=d.baseId,y=e.compositeRule;e.compositeRule=d.compositeRule=!0;var g=a;if(g)for(var v,b=-1,x=g.length-1;b<x;)v=g[b+=1],e.util.schemaHasRules(v,e.RULES.all)?(d.schema=v,d.schemaPath=o+"["+b+"]",d.errSchemaPath=s+"/"+b,r+=" "+e.validate(d)+" ",d.baseId=m):r+=" var "+f+" = true; ",b&&(r+=" if ("+f+" && prevValid"+i+") "+c+" = false; else { ",h+="}"),r+=" if ("+f+") "+c+" = prevValid"+i+" = true;";e.compositeRule=d.compositeRule=y,r+=h+"if (!"+c+") { ";var P=P||[];P.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: {} ",!1!==e.opts.messages&&(r+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var w=r;return r=P.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+w+"]); ":r+=" validate.errors = ["+w+"]; return false; ":r+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; }",e.opts.allErrors&&(r+=" } "),r}},{}],29:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),l=e.opts.v5&&o&&o.$data;l?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",r="schema"+n):r=o;var d=l?"(new RegExp("+r+"))":e.usePattern(o);i+="if ( ",l&&(i+=" ("+r+" !== undefined && typeof "+r+" != 'string') || "),i+=" !"+d+".test("+c+") ) { ";var h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",i+=l?""+r:""+e.util.toQuotedString(o),i+=" } ",!1!==e.opts.messages&&(i+=" , message: 'should match pattern \"",i+=l?"' + "+r+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=l?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var f=i;return i=h.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",p&&(i+=" else { "),i}},{}],30:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l="key"+i,d="patternMatched"+i,h="",f=e.opts.ownProperties;r+="var "+c+" = true;";var m=a;if(m)for(var y,g=-1,v=m.length-1;g<v;){y=m[g+=1],r+=" var "+d+" = false; for (var "+l+" in "+p+") { ",f&&(r+=" if (!Object.prototype.hasOwnProperty.call("+p+", "+l+")) continue; "),r+=" "+d+" = "+e.usePattern(y)+".test("+l+"); if ("+d+") break; } ";var b=e.util.escapeQuotes(y);r+=" if (!"+d+") { "+c+" = false; var err = ",!1!==e.createErrors?(r+=" { keyword: 'patternRequired' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingPattern: '"+b+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should have property matching pattern \\'"+b+"\\'' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ",u&&(h+="}",r+=" else { ")}return r+=""+h}},{}],31:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l="errs__"+i,d=e.util.copy(e),h="";d.level++;var f="valid"+d.level,m="key"+i,y=d.dataLevel=e.dataLevel+1,g="data"+y,v=Object.keys(a||{}),b=e.schema.patternProperties||{},x=Object.keys(b),P=e.schema.additionalProperties,w=v.length||x.length,E=!1===P,S="object"==typeof P&&Object.keys(P).length,_=e.opts.removeAdditional,D=E||S||_,T=e.opts.ownProperties,M=e.baseId,A=e.schema.required;if(A&&(!e.opts.v5||!A.$data)&&A.length<e.opts.loopRequired)var R=e.util.toHash(A);if(e.opts.v5)var C=e.schema.patternGroups||{},O=Object.keys(C);if(r+="var "+l+" = errors;var "+f+" = true;",D){if(r+=" for (var "+m+" in "+p+") { ",T&&(r+=" if (!Object.prototype.hasOwnProperty.call("+p+", "+m+")) continue; "),w){if(r+=" var isAdditional"+i+" = !(false ",v.length)if(v.length>5)r+=" || validate.schema"+o+"["+m+"] ";else{var I=v;if(I)for(var j,k=-1,L=I.length-1;k<L;)j=I[k+=1],r+=" || "+m+" == "+e.util.toQuotedString(j)+" "}if(x.length){var B=x;if(B)for(var N,U=-1,V=B.length-1;U<V;)N=B[U+=1],r+=" || "+e.usePattern(N)+".test("+m+") "}if(e.opts.v5&&O&&O.length){var z=O;if(z)for(var F,U=-1,G=z.length-1;U<G;)F=z[U+=1],r+=" || "+e.usePattern(F)+".test("+m+") "}r+=" ); if (isAdditional"+i+") { "}if("all"==_)r+=" delete "+p+"["+m+"]; ";else{var q=e.errorPath,H="' + "+m+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers)),E)if(_)r+=" delete "+p+"["+m+"]; ";else{r+=" "+f+" = false; ";var $=s;s=e.errSchemaPath+"/additionalProperties";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { additionalProperty: '"+H+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have additional properties' "),e.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var X=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+X+"]); ":r+=" validate.errors = ["+X+"]; return false; ":r+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=$,u&&(r+=" break; ")}else if(S)if("failing"==_){r+=" var "+l+" = errors; ";var Q=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.schema=P,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Z=p+"["+m+"]";d.dataPathArr[y]=m;var Y=e.validate(d);d.baseId=M,e.util.varOccurences(Y,g)<2?r+=" "+e.util.varReplace(Y,g,Z)+" ":r+=" var "+g+" = "+Z+"; "+Y+" ",r+=" if (!"+f+") { errors = "+l+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+p+"["+m+"]; } ",e.compositeRule=d.compositeRule=Q}else{d.schema=P,d.schemaPath=e.schemaPath+".additionalProperties",d.errSchemaPath=e.errSchemaPath+"/additionalProperties",d.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Z=p+"["+m+"]";d.dataPathArr[y]=m;var Y=e.validate(d);d.baseId=M,e.util.varOccurences(Y,g)<2?r+=" "+e.util.varReplace(Y,g,Z)+" ":r+=" var "+g+" = "+Z+"; "+Y+" ",u&&(r+=" if (!"+f+") break; ")}e.errorPath=q}w&&(r+=" } "),r+=" } ",u&&(r+=" if ("+f+") { ",h+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(v.length){var J=v;if(J)for(var j,ee=-1,te=J.length-1;ee<te;){j=J[ee+=1];var re=a[j];if(e.util.schemaHasRules(re,e.RULES.all)){var ie=e.util.getProperty(j),Z=p+ie,ne=K&&void 0!==re.default;d.schema=re,d.schemaPath=o+ie,d.errSchemaPath=s+"/"+e.util.escapeFragment(j),d.errorPath=e.util.getPath(e.errorPath,j,e.opts.jsonPointers),d.dataPathArr[y]=e.util.toQuotedString(j);var Y=e.validate(d);if(d.baseId=M,e.util.varOccurences(Y,g)<2){Y=e.util.varReplace(Y,g,Z);var ae=Z}else{var ae=g;r+=" var "+g+" = "+Z+"; "}if(ne)r+=" "+Y+" ";else{if(R&&R[j]){r+=" if ("+ae+" === undefined) { "+f+" = false; ";var q=e.errorPath,$=s,oe=e.util.escapeQuotes(j);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(q,j,e.opts.jsonPointers)),s=e.errSchemaPath+"/required";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+oe+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+oe+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var X=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+X+"]); ":r+=" validate.errors = ["+X+"]; return false; ":r+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",s=$,e.errorPath=q,r+=" } else { "}else r+=u?" if ("+ae+" === undefined) { "+f+" = true; } else { ":" if ("+ae+" !== undefined) { ";r+=" "+Y+" } "}}u&&(r+=" if ("+f+") { ",h+="}")}}var se=x;if(se)for(var N,ue=-1,pe=se.length-1;ue<pe;){N=se[ue+=1];var re=b[N];if(e.util.schemaHasRules(re,e.RULES.all)){d.schema=re,d.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(N),d.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(N),r+=" for (var "+m+" in "+p+") { ",T&&(r+=" if (!Object.prototype.hasOwnProperty.call("+p+", "+m+")) continue; "),r+=" if ("+e.usePattern(N)+".test("+m+")) { ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Z=p+"["+m+"]";d.dataPathArr[y]=m;var Y=e.validate(d);d.baseId=M,e.util.varOccurences(Y,g)<2?r+=" "+e.util.varReplace(Y,g,Z)+" ":r+=" var "+g+" = "+Z+"; "+Y+" ",u&&(r+=" if (!"+f+") break; "),r+=" } ",u&&(r+=" else "+f+" = true; "),r+=" } ",u&&(r+=" if ("+f+") { ",h+="}")}}if(e.opts.v5){var ce=O;if(ce)for(var F,le=-1,de=ce.length-1;le<de;){F=ce[le+=1];var he=C[F],re=he.schema;if(e.util.schemaHasRules(re,e.RULES.all)){d.schema=re,d.schemaPath=e.schemaPath+".patternGroups"+e.util.getProperty(F)+".schema",d.errSchemaPath=e.errSchemaPath+"/patternGroups/"+e.util.escapeFragment(F)+"/schema",r+=" var pgPropCount"+i+" = 0; for (var "+m+" in "+p+") { ",T&&(r+=" if (!Object.prototype.hasOwnProperty.call("+p+", "+m+")) continue; "),r+=" if ("+e.usePattern(F)+".test("+m+")) { pgPropCount"+i+"++; ",d.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers);var Z=p+"["+m+"]";d.dataPathArr[y]=m;var Y=e.validate(d);d.baseId=M,e.util.varOccurences(Y,g)<2?r+=" "+e.util.varReplace(Y,g,Z)+" ":r+=" var "+g+" = "+Z+"; "+Y+" ",u&&(r+=" if (!"+f+") break; "),r+=" } ",u&&(r+=" else "+f+" = true; "),r+=" } ",u&&(r+=" if ("+f+") { ",h+="}");var fe=he.minimum,me=he.maximum;if(void 0!==fe||void 0!==me){r+=" var "+c+" = true; ";var $=s;if(void 0!==fe){var ye=fe,ge="minimum",ve="less";r+=" "+c+" = pgPropCount"+i+" >= "+fe+"; ",s=e.errSchemaPath+"/patternGroups/minimum",r+=" if (!"+c+") { ";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(F)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have "+ve+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(F)+"\"' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var X=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+X+"]); ":r+=" validate.errors = ["+X+"]; return false; ":r+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } ",void 0!==me&&(r+=" else ")}if(void 0!==me){var ye=me,ge="maximum",ve="more";r+=" "+c+" = pgPropCount"+i+" <= "+me+"; ",s=e.errSchemaPath+"/patternGroups/maximum",r+=" if (!"+c+") { ";var W=W||[];W.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'patternGroups' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { reason: '"+ge+"', limit: "+ye+", pattern: '"+e.util.escapeQuotes(F)+"' } ",!1!==e.opts.messages&&(r+=" , message: 'should NOT have "+ve+" than "+ye+' properties matching pattern "'+e.util.escapeQuotes(F)+"\"' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var X=r;r=W.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+X+"]); ":r+=" validate.errors = ["+X+"]; return false; ":r+=" var err = "+X+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } "}s=$,u&&(r+=" if ("+c+") { ",h+="}")}}}}return u&&(r+=" "+h+" if ("+l+" == errors) {"),r=e.util.cleanUpCode(r)}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(o||""),l="valid"+a;if("#"==s||"#/"==s)e.isRoot?(r=e.async,i="validate"):(r=!0===e.root.schema.$async,i="root.refVal[0]");else{var d=e.resolveRef(e.baseId,s,e.isRoot);if(void 0===d){var h="can't resolve reference "+s+" from id "+e.baseId;if("fail"==e.opts.missingRefs){console.log(h);var f=f||[];f.push(n),n="",!1!==e.createErrors?(n+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { ref: '"+e.util.escapeQuotes(s)+"' } ",!1!==e.opts.messages&&(n+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(s)+"' "),e.opts.verbose&&(n+=" , schema: "+e.util.toQuotedString(s)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),n+=" } "):n+=" {} ";var m=n;n=f.pop(),!e.compositeRule&&p?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(n+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs){var y=new Error(h);throw y.missingRef=e.resolve.url(e.baseId,s),y.missingSchema=e.resolve.normalizeId(e.resolve.fullPath(y.missingRef)),y}console.log(h),p&&(n+=" if (true) { ")}}else if(d.inline){var g=e.util.copy(e);g.level++;var v="valid"+g.level;g.schema=d.schema,g.schemaPath="",g.errSchemaPath=s;var b=e.validate(g).replace(/validate\.schema/g,d.code);n+=" "+b+" ",p&&(n+=" if ("+v+") { ")}else r=!0===d.$async,i=d.code}if(i){var f=f||[];f.push(n),n="",e.opts.passContext?n+=" "+i+".call(this, ":n+=" "+i+"( ",n+=" "+c+", (dataPath || '')",'""'!=e.errorPath&&(n+=" + "+e.errorPath);n+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+(o?e.dataPathArr[o]:"parentDataProperty")+", rootData) ";var x=n;if(n=f.pop(),r){if(!e.async)throw new Error("async schema referenced by sync schema");n+=" try { ",p&&(n+="var "+l+" ="),n+=" "+e.yieldAwait+" "+x+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",p&&(n+=" if ("+l+") { ")}else n+=" if (!"+x+") { if (vErrors === null) vErrors = "+i+".errors; else vErrors = vErrors.concat("+i+".errors); errors = vErrors.length; } ",p&&(n+=" else { ")}return n}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l=e.opts.v5&&a&&a.$data;l&&(r+=" var schema"+i+" = "+e.util.getData(a.$data,n,e.dataPathArr)+"; ");var d="schema"+i;if(!l)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var h=[],f=a;if(f)for(var m,y=-1,g=f.length-1;y<g;){m=f[y+=1];var v=e.schema.properties[m];v&&e.util.schemaHasRules(v,e.RULES.all)||(h[h.length]=m)}}else var h=a;if(l||h.length){var b=e.errorPath,x=l||h.length>=e.opts.loopRequired;if(u)if(r+=" var missing"+i+"; ",x){l||(r+=" var "+d+" = validate.schema"+o+"; ");var P="i"+i,w="schema"+i+"["+P+"]",E="' + "+w+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,w,e.opts.jsonPointers)),r+=" var "+c+" = true; ",l&&(r+=" if (schema"+i+" === undefined) "+c+" = true; else if (!Array.isArray(schema"+i+")) "+c+" = false; else {"),r+=" for (var "+P+" = 0; "+P+" < "+d+".length; "+P+"++) { "+c+" = "+p+"["+d+"["+P+"]] !== undefined; if (!"+c+") break; } ",l&&(r+=" } "),r+=" if (!"+c+") { ";var S=S||[];S.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var _=r;r=S.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else{r+=" if ( ";var D=h;if(D)for(var T,P=-1,M=D.length-1;P<M;){T=D[P+=1],P&&(r+=" || ");var A=e.util.getProperty(T);r+=" ( "+p+A+" === undefined && (missing"+i+" = "+e.util.toQuotedString(e.opts.jsonPointers?T:A)+") ) "}r+=") { ";var w="missing"+i,E="' + "+w+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(b,w,!0):b+" + "+w);var S=S||[];S.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var _=r;r=S.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+_+"]); ":r+=" validate.errors = ["+_+"]; return false; ":r+=" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+=" } else { "}else if(x){l||(r+=" var "+d+" = validate.schema"+o+"; ");var P="i"+i,w="schema"+i+"["+P+"]",E="' + "+w+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(b,w,e.opts.jsonPointers)),l&&(r+=" if ("+d+" && !Array.isArray("+d+")) { var err = ",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+d+" !== undefined) { "),r+=" for (var "+P+" = 0; "+P+" < "+d+".length; "+P+"++) { if ("+p+"["+d+"["+P+"]] === undefined) { var err = ",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",l&&(r+=" } ")}else{var R=h;if(R)for(var C,O=-1,I=R.length-1;O<I;){C=R[O+=1];var A=e.util.getProperty(C),E=e.util.escapeQuotes(C);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(b,C,e.opts.jsonPointers)),r+=" if ("+p+A+" === undefined) { var err = ",!1!==e.createErrors?(r+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(r+=" , message: '",e.opts._errorDataPathProperty?r+="is a required property":r+="should have required property \\'"+E+"\\'",r+="' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ",r+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=b}else u&&(r+=" if (true) {");return r}},{}],34:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.level,n=e.dataLevel,a=e.schema[t],o=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,p="data"+(n||""),c="valid"+i,l="errs__"+i,d=e.util.copy(e),h="";d.level++;var f,m="valid"+d.level,y="ifPassed"+e.level,g=d.baseId;r+="var "+y+";";var v=a;if(v)for(var b,x=-1,P=v.length-1;x<P;){if(b=v[x+=1],x&&!f&&(r+=" if (!"+y+") { ",h+="}"),b.if&&e.util.schemaHasRules(b.if,e.RULES.all)){r+=" var "+l+" = errors; ";var w=e.compositeRule;if(e.compositeRule=d.compositeRule=!0,d.createErrors=!1,d.schema=b.if,d.schemaPath=o+"["+x+"].if",d.errSchemaPath=s+"/"+x+"/if",r+=" "+e.validate(d)+" ",d.baseId=g,d.createErrors=!0,e.compositeRule=d.compositeRule=w,r+=" "+y+" = "+m+"; if ("+y+") { ","boolean"==typeof b.then){if(!1===b.then){var E=E||[];E.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'switch' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { caseIndex: "+x+" } ",!1!==e.opts.messages&&(r+=" , message: 'should pass \"switch\" keyword validation' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=E.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" var "+m+" = "+b.then+"; "}else d.schema=b.then,d.schemaPath=o+"["+x+"].then",d.errSchemaPath=s+"/"+x+"/then",r+=" "+e.validate(d)+" ",d.baseId=g;r+=" } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } } "}else if(r+=" "+y+" = true; ","boolean"==typeof b.then){if(!1===b.then){var E=E||[];E.push(r),r="",!1!==e.createErrors?(r+=" { keyword: 'switch' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(s)+" , params: { caseIndex: "+x+" } ",!1!==e.opts.messages&&(r+=" , message: 'should pass \"switch\" keyword validation' "),e.opts.verbose&&(r+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),r+=" } "):r+=" {} ";var S=r;r=E.pop(),!e.compositeRule&&u?e.async?r+=" throw new ValidationError(["+S+"]); ":r+=" validate.errors = ["+S+"]; return false; ":r+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" var "+m+" = "+b.then+"; "}else d.schema=b.then,d.schemaPath=o+"["+x+"].then",d.errSchemaPath=s+"/"+x+"/then",r+=" "+e.validate(d)+" ",d.baseId=g;f=b.continue}return r+=h+"var "+c+" = "+m+"; ",r=e.util.cleanUpCode(r)}},{}],35:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),l="valid"+n,d=e.opts.v5&&o&&o.$data;if(d?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",r="schema"+n):r=o,(o||d)&&!1!==e.opts.uniqueItems){d&&(i+=" var "+l+"; if ("+r+" === false || "+r+" === undefined) "+l+" = true; else if (typeof "+r+" != 'boolean') "+l+" = false; else { "),i+=" var "+l+" = true; if ("+c+".length > 1) { var i = "+c+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+c+"[i], "+c+"[j])) { "+l+" = false; break outer; } } } } ",d&&(i+=" } "),i+=" if (!"+l+") { ";var h=h||[];h.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",i+=d?"validate.schema"+s:""+o,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var f=i;i=h.pop(),!e.compositeRule&&p?e.async?i+=" throw new ValidationError(["+f+"]); ":i+=" validate.errors = ["+f+"]; return false; ":i+=" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(i+=" else { ")}else p&&(i+=" if (true) { ");return i}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t){function r(t){return void 0!==e.schema[t.keyword]||"properties"==t.keyword&&(!1===e.schema.additionalProperties||"object"==typeof e.schema.additionalProperties||e.schema.patternProperties&&Object.keys(e.schema.patternProperties).length||e.opts.v5&&e.schema.patternGroups&&Object.keys(e.schema.patternGroups).length)}var i="",n=!0===e.schema.$async;if(e.isTop){var a=e.isTop,o=e.level=0,s=e.dataLevel=0,u="data";if(e.rootId=e.resolve.fullPath(e.root.schema.id),e.baseId=e.baseId||e.rootId,n){e.async=!0;var p="es7"==e.opts.async;e.yieldAwait=p?"await":"yield"}delete e.isTop,e.dataPathArr=[void 0],i+=" var validate = ",n?p?i+=" (async function ":("co*"==e.opts.async&&(i+="co.wrap"),i+="(function* "):i+=" (function ",i+=" (data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data;"}else{var o=e.level,s=e.dataLevel,u="data"+(s||"");if(e.schema.id&&(e.baseId=e.resolve.url(e.baseId,e.schema.id)),n&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+o+" = errors;"}var c="valid"+o,l=!e.opts.allErrors,d="",h="",f=e.schema.type,m=Array.isArray(f);if(f&&e.opts.coerceTypes){var y=e.util.coerceToTypes(e.opts.coerceTypes,f);if(y){var g=e.schemaPath+".type",v=e.errSchemaPath+"/type",b=m?"checkDataTypes":"checkDataType";i+=" if ("+e.util[b](f,u,!0)+") { ";var x="dataType"+o,P="coerced"+o;i+=" var "+x+" = typeof "+u+"; ","array"==e.opts.coerceTypes&&(i+=" if ("+x+" == 'object' && Array.isArray("+u+")) "+x+" = 'array'; "),i+=" var "+P+" = undefined; ";var w="",E=y;if(E)for(var S,_=-1,D=E.length-1;_<D;)S=E[_+=1],_&&(i+=" if ("+P+" === undefined) { ",w+="}"),"array"==e.opts.coerceTypes&&"array"!=S&&(i+=" if ("+x+" == 'array' && "+u+".length == 1) { "+P+" = "+u+" = "+u+"[0]; "+x+" = typeof "+u+"; } "),"string"==S?i+=" if ("+x+" == 'number' || "+x+" == 'boolean') "+P+" = '' + "+u+"; else if ("+u+" === null) "+P+" = ''; ":"number"==S||"integer"==S?(i+=" if ("+x+" == 'boolean' || "+u+" === null || ("+x+" == 'string' && "+u+" && "+u+" == +"+u+" ","integer"==S&&(i+=" && !("+u+" % 1)"),i+=")) "+P+" = +"+u+"; "):"boolean"==S?i+=" if ("+u+" === 'false' || "+u+" === 0 || "+u+" === null) "+P+" = false; else if ("+u+" === 'true' || "+u+" === 1) "+P+" = true; ":"null"==S?i+=" if ("+u+" === '' || "+u+" === 0 || "+u+" === false) "+P+" = null; ":"array"==e.opts.coerceTypes&&"array"==S&&(i+=" if ("+x+" == 'string' || "+x+" == 'number' || "+x+" == 'boolean' || "+u+" == null) "+P+" = ["+u+"]; ");i+=" "+w+" if ("+P+" === undefined) { ";var T=T||[];T.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { type: '",i+=m?""+f.join(","):""+f,i+="' } ",!1!==e.opts.messages&&(i+=" , message: 'should be ",i+=m?""+f.join(","):""+f,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var M=i;i=T.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ";var A=s?"data"+(s-1||""):"parentData",R=s?e.dataPathArr[s]:"parentDataProperty";i+=" "+u+" = "+P+"; ",s||(i+="if ("+A+" !== undefined)"),i+=" "+A+"["+R+"] = "+P+"; } } "}}var C;if(e.schema.$ref&&(C=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"))){if("fail"==e.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'"');"ignore"==e.opts.extendRefs?(C=!1,console.log('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"')):!0!==e.opts.extendRefs&&console.log('$ref: all keywords used in schema at path "'+e.errSchemaPath+'". It will change in the next major version, see issue #260. Use option { extendRefs: true } to keep current behaviour')}if(e.schema.$ref&&!C)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",l&&(i+=" } if (errors === ",i+=a?"0":"errs_"+o,i+=") { ",h+="}");else{var O=e.RULES;if(O)for(var I,j=-1,k=O.length-1;j<k;)if(I=O[j+=1],function(e){for(var t=0;t<e.rules.length;t++)if(r(e.rules[t]))return!0}(I)){if(I.type&&(i+=" if ("+e.util.checkDataType(I.type,u)+") { "),e.opts.useDefaults&&!e.compositeRule)if("object"==I.type&&e.schema.properties){var L=e.schema.properties,B=Object.keys(L),N=B;if(N)for(var U,V=-1,z=N.length-1;V<z;){U=N[V+=1];var F=L[U];if(void 0!==F.default){var G=u+e.util.getProperty(U);i+=" if ("+G+" === undefined) "+G+" = ","shared"==e.opts.useDefaults?i+=" "+e.useDefault(F.default)+" ":i+=" "+JSON.stringify(F.default)+" ",i+="; "}}}else if("array"==I.type&&Array.isArray(e.schema.items)){var q=e.schema.items;if(q)for(var F,_=-1,H=q.length-1;_<H;)if(F=q[_+=1],void 0!==F.default){var G=u+"["+_+"]";i+=" if ("+G+" === undefined) "+G+" = ","shared"==e.opts.useDefaults?i+=" "+e.useDefault(F.default)+" ":i+=" "+JSON.stringify(F.default)+" ",i+="; "}}var $=I.rules;if($)for(var W,X=-1,Q=$.length-1;X<Q;)W=$[X+=1],r(W)&&(i+=" "+W.code(e,W.keyword)+" ",l&&(d+="}"));if(l&&(i+=" "+d+" ",d=""),I.type&&(i+=" } ",f&&f===I.type&&!y)){var Z=!0;i+=" else { ";var g=e.schemaPath+".type",v=e.errSchemaPath+"/type",T=T||[];T.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { type: '",i+=m?""+f.join(","):""+f,i+="' } ",!1!==e.opts.messages&&(i+=" , message: 'should be ",i+=m?""+f.join(","):""+f,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var M=i;i=T.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}l&&(i+=" if (errors === ",i+=a?"0":"errs_"+o,i+=") { ",h+="}")}}if(f&&!Z&&!y){var g=e.schemaPath+".type",v=e.errSchemaPath+"/type",b=m?"checkDataTypes":"checkDataType";i+=" if ("+e.util[b](f,u,!0)+") { ";var T=T||[];T.push(i),i="",!1!==e.createErrors?(i+=" { keyword: 'type' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(v)+" , params: { type: '",i+=m?""+f.join(","):""+f,i+="' } ",!1!==e.opts.messages&&(i+=" , message: 'should be ",i+=m?""+f.join(","):""+f,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+g+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var M=i;i=T.pop(),!e.compositeRule&&l?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }"}return l&&(i+=" "+h+" "),a?(n?(i+=" if (errors === 0) return true; ",i+=" else throw new ValidationError(vErrors); "):(i+=" validate.errors = vErrors; ",i+=" return errors === 0; "),i+=" }); return validate;"):i+=" var "+c+" = errors === errs_"+o+";",i=e.util.cleanUpCode(i),a&&l&&(i=e.util.cleanUpVarErrors(i,n)),i}},{}],37:[function(e,t,r){"use strict";function i(e,t){function r(e,t,r){for(var i,a=0;a<n.length;a++){var o=n[a];if(o.type==t){i=o;break}}i||(i={type:t,rules:[]},n.push(i));var u={keyword:e,definition:r,custom:!0,code:s};i.rules.push(u),n.custom[e]=u}function i(e){if(!n.types[e])throw new Error("Unknown type "+e)}var n=this.RULES;if(n.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!o.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(t){if(t.macro&&void 0!==t.valid)throw new Error('"valid" option cannot be used with macro keywords');var a=t.type;if(Array.isArray(a)){var u,p=a.length;for(u=0;u<p;u++)i(a[u]);for(u=0;u<p;u++)r(e,a[u],t)}else a&&i(a),r(e,a,t);var c=!0===t.$data&&this._opts.v5;if(c&&!t.validate)throw new Error('$data support: "validate" function is not defined');var l=t.metaSchema;l&&(c&&(l={anyOf:[l,{$ref:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#/definitions/$data"}]}),t.validateSchema=this.compile(l,!0))}n.keywords[e]=n.all[e]=!0}function n(e){var t=this.RULES.custom[e];return t?t.definition:this.RULES.keywords[e]||!1}function a(e){var t=this.RULES;delete t.keywords[e],delete t.all[e],delete t.custom[e];for(var r=0;r<t.length;r++)for(var i=t[r].rules,n=0;n<i.length;n++)if(i[n].keyword==e){i.splice(n,1);break}}var o=/^[a-z_$][a-z0-9_$\-]*$/i,s=e("./dotjs/custom");t.exports={add:i,get:n,remove:a}},{"./dotjs/custom":21}],38:[function(e,t,r){t.exports={id:"http://json-schema.org/draft-04/schema#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{type:"number",minimum:0,exclusiveMinimum:!0},maximum:{type:"number"},exclusiveMaximum:{type:"boolean",default:!1},minimum:{type:"number"},exclusiveMinimum:{type:"boolean",default:!1},maxLength:{$ref:"#/definitions/positiveInteger"},minLength:{$ref:"#/definitions/positiveIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{$ref:"#/definitions/positiveInteger"},minItems:{$ref:"#/definitions/positiveIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxProperties:{$ref:"#/definitions/positiveInteger"},minProperties:{$ref:"#/definitions/positiveIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{type:"array",minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"]},default:{}}},{}],39:[function(e,t,r){t.exports={id:"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json#",$schema:"http://json-schema.org/draft-04/schema#",description:"Core schema meta-schema (v5 proposals)",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},positiveInteger:{type:"integer",minimum:0},positiveIntegerDefault0:{allOf:[{$ref:"#/definitions/positiveInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},minItems:1,uniqueItems:!0},$data:{type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},type:"object",properties:{id:{type:"string",format:"uri"},$schema:{type:"string",format:"uri"},title:{type:"string"},description:{type:"string"},default:{},multipleOf:{anyOf:[{type:"number",minimum:0,exclusiveMinimum:!0},{$ref:"#/definitions/$data"}]},maximum:{anyOf:[{type:"number"},{$ref:"#/definitions/$data"}]},exclusiveMaximum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},minimum:{anyOf:[{type:"number"},{$ref:"#/definitions/$data"}]},exclusiveMinimum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},maxLength:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minLength:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},pattern:{anyOf:[{type:"string",format:"regex"},{$ref:"#/definitions/$data"}]},additionalItems:{anyOf:[{type:"boolean"},{$ref:"#"},{$ref:"#/definitions/$data"}],default:{}},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:{}},maxItems:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minItems:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},uniqueItems:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},maxProperties:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minProperties:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},required:{anyOf:[{$ref:"#/definitions/stringArray"},{$ref:"#/definitions/$data"}]},additionalProperties:{anyOf:[{type:"boolean"},{$ref:"#"},{$ref:"#/definitions/$data"}],default:{}},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},enum:{anyOf:[{type:"array",minItems:1,uniqueItems:!0},{$ref:"#/definitions/$data"}]},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"},format:{anyOf:[{type:"string"},{$ref:"#/definitions/$data"}]},formatMaximum:{anyOf:[{type:"string"},{$ref:"#/definitions/$data"}]},formatMinimum:{anyOf:[{type:"string"},{$ref:"#/definitions/$data"}]},formatExclusiveMaximum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},formatExclusiveMinimum:{anyOf:[{type:"boolean",default:!1},{$ref:"#/definitions/$data"}]},constant:{anyOf:[{},{$ref:"#/definitions/$data"}]},contains:{$ref:"#"},patternGroups:{type:"object",additionalProperties:{type:"object",required:["schema"],properties:{maximum:{anyOf:[{$ref:"#/definitions/positiveInteger"},{$ref:"#/definitions/$data"}]},minimum:{anyOf:[{$ref:"#/definitions/positiveIntegerDefault0"},{$ref:"#/definitions/$data"}]},schema:{$ref:"#"}},additionalProperties:!1},default:{}},switch:{type:"array",items:{required:["then"],properties:{if:{$ref:"#"},then:{anyOf:[{type:"boolean"},{$ref:"#"}]},continue:{type:"boolean"}},additionalProperties:!1,dependencies:{continue:["if"]}}}},dependencies:{exclusiveMaximum:["maximum"],exclusiveMinimum:["minimum"],formatMaximum:["format"],formatMinimum:["format"],formatExclusiveMaximum:["formatMaximum"],formatExclusiveMinimum:["formatMinimum"]},default:{}}},{}],40:[function(e,t,r){"use strict";function i(t){function r(e,r,n){var a={inline:n||i[e],statements:!0,errors:"full"};r&&(a.type=r),t.addKeyword(e,a)}var i={switch:e("./dotjs/switch"),constant:e("./dotjs/constant"),_formatLimit:e("./dotjs/_formatLimit"),patternRequired:e("./dotjs/patternRequired")};if(!1!==t._opts.meta){var o=e("./refs/json-schema-v5.json");t.addMetaSchema(o,a)}r("constant"),t.addKeyword("contains",{type:"array",macro:n}),r("formatMaximum","string",i._formatLimit),r("formatMinimum","string",i._formatLimit),t.addKeyword("formatExclusiveMaximum"),t.addKeyword("formatExclusiveMinimum"),t.addKeyword("patternGroups"),r("patternRequired","object"),r("switch")}function n(e){return{not:{items:{not:e}}}}var a="https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/json-schema-v5.json";t.exports={enable:i,META_SCHEMA_ID:a}},{"./dotjs/_formatLimit":13,"./dotjs/constant":20,"./dotjs/patternRequired":30,"./dotjs/switch":34,"./refs/json-schema-v5.json":39}],41:[function(e,t,r){function i(e){var t=this,r=d.call(arguments,1);return new Promise(function(i,a){function o(t){var r;try{r=e.next(t)}catch(e){return a(e)}p(r)}function s(t){var r;try{r=e.throw(t)}catch(e){return a(e)}p(r)}function p(e){if(e.done)return i(e.value);var r=n.call(t,e.value);return r&&u(r)?r.then(o,s):s(new TypeError('You may only yield a function, promise, generator, array, or object, but the following object was passed: "'+String(e.value)+'"'))}if("function"==typeof e&&(e=e.apply(t,r)),!e||"function"!=typeof e.next)return i(e);o()})}function n(e){return e?u(e)?e:c(e)||p(e)?i.call(this,e):"function"==typeof e?a.call(this,e):Array.isArray(e)?o.call(this,e):l(e)?s.call(this,e):e:e}function a(e){var t=this;return new Promise(function(r,i){e.call(t,function(e,t){if(e)return i(e);arguments.length>2&&(t=d.call(arguments,1)),r(t)})})}function o(e){return Promise.all(e.map(n,this))}function s(e){for(var t=new e.constructor,r=Object.keys(e),i=[],a=0;a<r.length;a++){var o=r[a],s=n.call(this,e[o]);s&&u(s)?function(e,r){t[r]=void 0,i.push(e.then(function(e){t[r]=e}))}(s,o):t[o]=e[o]}return Promise.all(i).then(function(){return t})}function u(e){return"function"==typeof e.then}function p(e){return"function"==typeof e.next&&"function"==typeof e.throw}function c(e){var t=e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName||p(t.prototype))}function l(e){return Object==e.constructor}var d=Array.prototype.slice;t.exports=i.default=i.co=i,i.wrap=function(e){function t(){return i.call(this,e.apply(this,arguments))}return t.__generatorFunction__=e,t}},{}],42:[function(e,t,r){var i="undefined"!=typeof JSON?JSON:e("jsonify");t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var o="boolean"==typeof t.cycles&&t.cycles,s=t.replacer||function(e,t){return t},u=t.cmp&&function(e){return function(t){return function(r,i){var n={key:r,value:t[r]},a={key:i,value:t[i]};return e(n,a)}}}(t.cmp),p=[];return function e(t,c,l,d){var h=r?"\n"+new Array(d+1).join(r):"",f=r?": ":":";if(l&&l.toJSON&&"function"==typeof l.toJSON&&(l=l.toJSON()),void 0!==(l=s.call(t,c,l))){if("object"!=typeof l||null===l)return i.stringify(l);if(n(l)){for(var m=[],y=0;y<l.length;y++){var g=e(l,y,l[y],d+1)||i.stringify(null);m.push(h+r+g)}return"["+m.join(",")+h+"]"}if(-1!==p.indexOf(l)){if(o)return i.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}p.push(l);for(var v=a(l).sort(u&&u(l)),m=[],y=0;y<v.length;y++){var c=v[y],b=e(l,c,l[c],d+1);if(b){var x=i.stringify(c)+f+b;m.push(h+r+x)}}return p.splice(p.indexOf(l),1),"{"+m.join(",")+h+"}"}}({"":e},"",e,0)};var n=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},a=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var i in e)t.call(e,i)&&r.push(i);return r}},{jsonify:43}],43:[function(e,t,r){r.parse=e("./lib/parse"),r.stringify=e("./lib/stringify")},{"./lib/parse":44,"./lib/stringify":45}],44:[function(e,t,r){var i,n,a,o,s={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},u=function(e){throw{name:"SyntaxError",message:e,at:i,text:a}},p=function(e){return e&&e!==n&&u("Expected '"+e+"' instead of '"+n+"'"),n=a.charAt(i),i+=1,n},c=function(){var e,t="";for("-"===n&&(t="-",p("-"));n>="0"&&n<="9";)t+=n,p();if("."===n)for(t+=".";p()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,p(),"-"!==n&&"+"!==n||(t+=n,p());n>="0"&&n<="9";)t+=n,p();if(e=+t,isFinite(e))return e;u("Bad number")},l=function(){var e,t,r,i="";if('"'===n)for(;p();){if('"'===n)return p(),i;if("\\"===n)if(p(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(p(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof s[n])break;i+=s[n]}else i+=n}u("Bad string")},d=function(){for(;n&&n<=" ";)p()},h=function(){switch(n){case"t":return p("t"),p("r"),p("u"),p("e"),!0;case"f":return p("f"),p("a"),p("l"),p("s"),p("e"),!1;case"n":return p("n"),p("u"),p("l"),p("l"),null}u("Unexpected '"+n+"'")},f=function(){var e=[];if("["===n){if(p("["),d(),"]"===n)return p("]"),e;for(;n;){if(e.push(o()),d(),"]"===n)return p("]"),e;p(","),d()}}u("Bad array")},m=function(){var e,t={};if("{"===n){if(p("{"),d(),"}"===n)return p("}"),t;for(;n;){if(e=l(),d(),p(":"),Object.hasOwnProperty.call(t,e)&&u('Duplicate key "'+e+'"'),t[e]=o(),d(),"}"===n)return p("}"),t;p(","),d()}}u("Bad object")};o=function(){switch(d(),n){case"{":return m();case"[":return f();case'"':return l();case"-":return c();default:return n>="0"&&n<="9"?c():h()}},t.exports=function(e,t){var r;return a=e,i=0,n=" ",r=o(),d(),n&&u("Syntax error"),"function"==typeof t?function e(r,i){var n,a,o=r[i];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(a=e(o,n),void 0!==a?o[n]=a:delete o[n]);return t.call(r,i,o)}({"":r},""):r}},{}],45:[function(e,t,r){function i(e){return u.lastIndex=0,u.test(e)?'"'+e.replace(u,function(e){var t=p[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function n(e,t){var r,u,p,c,l,d=a,h=t[e];switch(h&&"object"==typeof h&&"function"==typeof h.toJSON&&(h=h.toJSON(e)),"function"==typeof s&&(h=s.call(t,e,h)),typeof h){case"string":return i(h);case"number":return isFinite(h)?String(h):"null";case"boolean":case"null":return String(h);case"object":if(!h)return"null";if(a+=o,l=[],"[object Array]"===Object.prototype.toString.apply(h)){for(c=h.length,r=0;r<c;r+=1)l[r]=n(r,h)||"null";return p=0===l.length?"[]":a?"[\n"+a+l.join(",\n"+a)+"\n"+d+"]":"["+l.join(",")+"]",a=d,p}if(s&&"object"==typeof s)for(c=s.length,r=0;r<c;r+=1)"string"==typeof(u=s[r])&&(p=n(u,h))&&l.push(i(u)+(a?": ":":")+p);else for(u in h)Object.prototype.hasOwnProperty.call(h,u)&&(p=n(u,h))&&l.push(i(u)+(a?": ":":")+p);return p=0===l.length?"{}":a?"{\n"+a+l.join(",\n"+a)+"\n"+d+"}":"{"+l.join(",")+"}",a=d,p}}var a,o,s,u=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,p={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};t.exports=function(e,t,r){var i;if(a="",o="","number"==typeof r)for(i=0;i<r;i+=1)o+=" ";else"string"==typeof r&&(o=r);if(s=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return n("",{"":e})}},{}],46:[function(r,i,n){(function(t){(function(r){function a(e){throw new RangeError(j[e])}function o(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function s(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),e=e.replace(I,"."),i+o(e.split("."),t).join(".")}function u(e){for(var t,r,i=[],n=0,a=e.length;n<a;)t=e.charCodeAt(n++),t>=55296&&t<=56319&&n<a?(r=e.charCodeAt(n++),56320==(64512&r)?i.push(((1023&t)<<10)+(1023&r)+65536):(i.push(t),n--)):i.push(t);return i}function p(e){return o(e,function(e){var t="";return e>65535&&(e-=65536,t+=B(e>>>10&1023|55296),e=56320|1023&e),t+=B(e)}).join("")}function c(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:E}function l(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,r){var i=0;for(e=r?L(e/T):e>>1,e+=L(e/t);e>k*_>>1;i+=E)e=L(e/k);return L(i+(k+1)*e/(e+D))}function h(e){var t,r,i,n,o,s,u,l,h,f,m=[],y=e.length,g=0,v=A,b=M;for(r=e.lastIndexOf(R),r<0&&(r=0),i=0;i<r;++i)e.charCodeAt(i)>=128&&a("not-basic"),m.push(e.charCodeAt(i));for(n=r>0?r+1:0;n<y;){for(o=g,s=1,u=E;n>=y&&a("invalid-input"),l=c(e.charCodeAt(n++)),(l>=E||l>L((w-g)/s))&&a("overflow"),g+=l*s,h=u<=b?S:u>=b+_?_:u-b,!(l<h);u+=E)f=E-h,s>L(w/f)&&a("overflow"),s*=f;t=m.length+1,b=d(g-o,t,0==o),L(g/t)>w-v&&a("overflow"),v+=L(g/t),g%=t,m.splice(g++,0,v)}return p(m)}function f(e){var t,r,i,n,o,s,p,c,h,f,m,y,g,v,b,x=[];for(e=u(e),y=e.length,t=A,r=0,o=M,s=0;s<y;++s)(m=e[s])<128&&x.push(B(m));for(i=n=x.length,n&&x.push(R);i<y;){for(p=w,s=0;s<y;++s)(m=e[s])>=t&&m<p&&(p=m);for(g=i+1,p-t>L((w-r)/g)&&a("overflow"),r+=(p-t)*g,t=p,s=0;s<y;++s)if(m=e[s],m<t&&++r>w&&a("overflow"),m==t){for(c=r,h=E;f=h<=o?S:h>=o+_?_:h-o,!(c<f);h+=E)b=c-f,v=E-f,x.push(B(l(f+b%v,0))),c=L(b/v);x.push(B(l(c,0))),o=d(r,g,i==n),r=0,++i}++r,++t}return x.join("")}function m(e){return s(e,function(e){return C.test(e)?h(e.slice(4).toLowerCase()):e})}function y(e){return s(e,function(e){return O.test(e)?"xn--"+f(e):e})}var g="object"==typeof n&&n&&!n.nodeType&&n,v="object"==typeof i&&i&&!i.nodeType&&i,b="object"==typeof t&&t;b.global!==b&&b.window!==b&&b.self!==b||(r=b);var x,P,w=2147483647,E=36,S=1,_=26,D=38,T=700,M=72,A=128,R="-",C=/^xn--/,O=/[^\x20-\x7E]/,I=/[\x2E\u3002\uFF0E\uFF61]/g,j={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=E-S,L=Math.floor,B=String.fromCharCode;if(x={version:"1.4.1",ucs2:{decode:u,encode:p},decode:h,encode:f,toASCII:y,toUnicode:m},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return x});else if(g&&v)if(i.exports==g)v.exports=x;else for(P in x)x.hasOwnProperty(P)&&(g[P]=x[P]);else r.punycode=x})(this)}).call(this,void 0!==t?t:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],47:[function(e,t,r){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,a){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var s=/\+/g;e=e.split(t);var u=1e3;a&&"number"==typeof a.maxKeys&&(u=a.maxKeys);var p=e.length;u>0&&p>u&&(p=u);for(var c=0;c<p;++c){var l,d,h,f,m=e[c].replace(s,"%20"),y=m.indexOf(r);y>=0?(l=m.substr(0,y),d=m.substr(y+1)):(l=m,d=""),h=decodeURIComponent(l),f=decodeURIComponent(d),i(o,h)?n(o[h])?o[h].push(f):o[h]=[o[h],f]:o[h]=f}return o};var n=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],48:[function(e,t,r){"use strict";function i(e,t){if(e.map)return e.map(t);for(var r=[],i=0;i<e.length;i++)r.push(t(e[i],i));return r}var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?i(o(e),function(o){var s=encodeURIComponent(n(o))+r;return a(e[o])?i(e[o],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[o]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},{}],49:[function(e,t,r){"use strict";r.decode=r.parse=e("./decode"),r.encode=r.stringify=e("./encode")},{"./decode":47,"./encode":48}],50:[function(e,t,r){"use strict";function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function n(e,t,r){if(e&&p.isObject(e)&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}function a(e){return p.isString(e)&&(e=n(e)),e instanceof i?e.format():i.prototype.format.call(e)}function o(e,t){return n(e,!1,!0).resolve(t)}function s(e,t){return e?n(e,!1,!0).resolveObject(t):t}var u=e("punycode"),p=e("./util");r.parse=n,r.resolve=o,r.resolveObject=s,r.format=a,r.Url=i;var c=/^([a-z0-9.+-]+:)/i,l=/:[0-9]*$/,d=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,h=["<",">",'"',"`"," ","\r","\n","\t"],f=["{","}","|","\\","^","`"].concat(h),m=["'"].concat(f),y=["%","/","?",";","#"].concat(m),g=["/","?","#"],v=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},P={javascript:!0,"javascript:":!0},w={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},E=e("querystring");i.prototype.parse=function(e,t,r){if(!p.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&i<e.indexOf("#")?"?":"#",a=e.split(n),o=/\\/g;a[0]=a[0].replace(o,"/"),e=a.join(n);var s=e;if(s=s.trim(),!r&&1===e.split("#").length){var l=d.exec(s);if(l)return this.path=s,this.href=s,this.pathname=l[1],l[2]?(this.search=l[2],this.query=t?E.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var h=c.exec(s);if(h){h=h[0];var f=h.toLowerCase();this.protocol=f,s=s.substr(h.length)}if(r||h||s.match(/^\/\/[^@\/]+@[^@\/]+/)){var S="//"===s.substr(0,2);!S||h&&P[h]||(s=s.substr(2),this.slashes=!0)}if(!P[h]&&(S||h&&!w[h])){for(var _=-1,D=0;D<g.length;D++){var T=s.indexOf(g[D]);-1!==T&&(-1===_||T<_)&&(_=T)}var M,A;A=-1===_?s.lastIndexOf("@"):s.lastIndexOf("@",_),-1!==A&&(M=s.slice(0,A),s=s.slice(A+1),this.auth=decodeURIComponent(M)),_=-1;for(var D=0;D<y.length;D++){var T=s.indexOf(y[D]);-1!==T&&(-1===_||T<_)&&(_=T)}-1===_&&(_=s.length),this.host=s.slice(0,_),s=s.slice(_),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var C=this.hostname.split(/\./),D=0,O=C.length;D<O;D++){var I=C[D];if(I&&!I.match(v)){for(var j="",k=0,L=I.length;k<L;k++)I.charCodeAt(k)>127?j+="x":j+=I[k];if(!j.match(v)){var B=C.slice(0,D),N=C.slice(D+1),U=I.match(b);U&&(B.push(U[1]),N.unshift(U[2])),N.length&&(s="/"+N.join(".")+s),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=u.toASCII(this.hostname));var V=this.port?":"+this.port:"",z=this.hostname||"";this.host=z+V,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!x[f])for(var D=0,O=m.length;D<O;D++){var F=m[D];if(-1!==s.indexOf(F)){var G=encodeURIComponent(F);G===F&&(G=escape(F)),s=s.split(F).join(G)}}var q=s.indexOf("#");-1!==q&&(this.hash=s.substr(q),s=s.slice(0,q));var H=s.indexOf("?");if(-1!==H?(this.search=s.substr(H),this.query=s.substr(H+1),t&&(this.query=E.parse(this.query)),s=s.slice(0,H)):t&&(this.search="",this.query={}),s&&(this.pathname=s),w[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var V=this.pathname||"",$=this.search||"";this.path=V+$}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,a="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&p.isObject(this.query)&&Object.keys(this.query).length&&(a=E.stringify(this.query));var o=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||w[t])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),o&&"?"!==o.charAt(0)&&(o="?"+o),r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),o=o.replace("#","%23"),t+n+r+o+i},i.prototype.resolve=function(e){return this.resolveObject(n(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(p.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),a=0;a<n.length;a++){var o=n[a];r[o]=this[o]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var s=Object.keys(e),u=0;u<s.length;u++){var c=s[u];"protocol"!==c&&(r[c]=e[c])}return w[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!w[e.protocol]){for(var l=Object.keys(e),d=0;d<l.length;d++){var h=l[d];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||P[e.protocol])r.pathname=e.pathname;else{for(var f=(e.pathname||"").split("/");f.length&&!(e.host=f.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==f[0]&&f.unshift(""),f.length<2&&f.unshift(""),r.pathname=f.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var m=r.pathname||"",y=r.search||"";r.path=m+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var g=r.pathname&&"/"===r.pathname.charAt(0),v=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=v||g||r.host&&e.pathname,x=b,E=r.pathname&&r.pathname.split("/")||[],f=e.pathname&&e.pathname.split("/")||[],S=r.protocol&&!w[r.protocol];if(S&&(r.hostname="",r.port=null,r.host&&(""===E[0]?E[0]=r.host:E.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===f[0]?f[0]=e.host:f.unshift(e.host)),e.host=null),b=b&&(""===f[0]||""===E[0])),v)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,E=f;else if(f.length)E||(E=[]),E.pop(),E=E.concat(f),r.search=e.search,r.query=e.query;else if(!p.isNullOrUndefined(e.search)){if(S){r.hostname=r.host=E.shift();var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return r.search=e.search,r.query=e.query,p.isNull(r.pathname)&&p.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!E.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var D=E.slice(-1)[0],T=(r.host||e.host||E.length>1)&&("."===D||".."===D)||""===D,M=0,A=E.length;A>=0;A--)D=E[A],"."===D?E.splice(A,1):".."===D?(E.splice(A,1),M++):M&&(E.splice(A,1),M--);if(!b&&!x)for(;M--;M)E.unshift("..");!b||""===E[0]||E[0]&&"/"===E[0].charAt(0)||E.unshift(""),T&&"/"!==E.join("/").substr(-1)&&E.push("");var R=""===E[0]||E[0]&&"/"===E[0].charAt(0);if(S){r.hostname=r.host=R?"":E.length?E.shift():"";var _=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");_&&(r.auth=_.shift(),r.host=r.hostname=_.shift())}return b=b||r.host&&E.length,b&&!R&&E.unshift(""),E.length?r.pathname=E.join("/"):(r.pathname=null,r.path=null),p.isNull(r.pathname)&&p.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=l.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":51,punycode:46,querystring:49}],51:[function(e,t,r){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],ajv:[function(e,t,r){"use strict";function i(e){return v.test(e)}function n(t){function r(e,t){var r;if("string"==typeof e){if(!(r=S(e)))throw new Error('no schema with key or ref "'+e+'"')}else{var i=A(e);r=i.validate||R(i)}var n=r(t);return!0===r.$async?"*"==j._opts.async?m(n):n:(j.errors=r.errors,n)}function y(e,t){var r=A(e,void 0,t);return r.validate||R(r)}function x(e,t,r,i){if(Array.isArray(e))for(var n=0;n<e.length;n++)x(e[n],void 0,r,i);else t=o.normalizeId(t||e.id),I(t),j._schemas[t]=A(e,r,i,!0)}function P(e,t,r){x(e,t,r,!0)}function w(e,t){var n=e.$schema||j._opts.defaultMeta||E(),a=j._formats.uri;j._formats.uri="function"==typeof a?i:v;var o;try{o=r(n,e)}finally{j._formats.uri=a}if(!o&&t){var s="schema is invalid: "+C();if("log"!=j._opts.validateSchema)throw new Error(s);console.error(s)}return o}function E(){var e=j._opts.meta;return j._opts.defaultMeta="object"==typeof e?e.id||e:j._opts.v5?d.META_SCHEMA_ID:g,j._opts.defaultMeta}function S(e){var t=D(e);switch(typeof t){case"object":return t.validate||R(t);case"string":return S(t);case"undefined":return _(e)}}function _(e){var t=o.schema.call(j,{schema:{}},e);if(t){var r=t.schema,i=t.root,n=t.baseId,s=a.call(j,r,i,void 0,n);return j._fragments[e]=new u({ref:e,fragment:!0,schema:r,root:i,baseId:n,validate:s}),s}}function D(e){return e=o.normalizeId(e),j._schemas[e]||j._refs[e]||j._fragments[e]}function T(e){if(e instanceof RegExp)return M(j._schemas,e),void M(j._refs,e);switch(typeof e){case"undefined":return M(j._schemas),M(j._refs),void j._cache.clear();case"string":var t=D(e);return t&&j._cache.del(t.jsonStr),delete j._schemas[e],void delete j._refs[e];case"object":var r=p(e);j._cache.del(r);var i=e.id;i&&(i=o.normalizeId(i),delete j._schemas[i],delete j._refs[i])}}function M(e,t){for(var r in e){var i=e[r];i.meta||t&&!t.test(r)||(j._cache.del(i.jsonStr),delete e[r])}}function A(e,t,r,i){if("object"!=typeof e)throw new Error("schema should be object");var n=p(e),a=j._cache.get(n);if(a)return a;i=i||!1!==j._opts.addUsedSchema;var s=o.normalizeId(e.id);s&&i&&I(s);var c,l=!1!==j._opts.validateSchema&&!t;l&&!(c=e.id&&e.id==e.$schema)&&w(e,!0);var d=o.ids.call(j,e),h=new u({id:s,schema:e,localRefs:d,jsonStr:n,meta:r});return"#"!=s[0]&&i&&(j._refs[s]=h),j._cache.put(n,h),l&&c&&w(e,!0),h}function R(e,t){function r(){var t=e.validate,i=t.apply(null,arguments);return r.errors=t.errors,i}if(e.compiling)return e.validate=r,r.schema=e.schema,r.errors=null,r.root=t||r,!0===e.schema.$async&&(r.$async=!0),r;e.compiling=!0;var i;e.meta&&(i=j._opts,j._opts=j._metaOpts);var n;try{n=a.call(j,e.schema,t,e.localRefs)}finally{e.compiling=!1,e.meta&&(j._opts=i)}return e.validate=n,e.refs=n.refs,e.refVal=n.refVal,e.root=n.root,n}function C(e,t){if(!(e=e||j.errors))return"No errors";t=t||{};for(var r=void 0===t.separator?", ":t.separator,i=void 0===t.dataVar?"data":t.dataVar,n="",a=0;a<e.length;a++){var o=e[a];o&&(n+=i+o.dataPath+" "+o.message+r)}return n.slice(0,-r.length)}function O(e,t){"string"==typeof t&&(t=new RegExp(t)),j._formats[e]=t}function I(e){if(j._schemas[e]||j._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}if(!(this instanceof n))return new n(t);var j=this;t=this._opts=h.copy(t)||{},this._schemas={},this._refs={},this._fragments={},this._formats=c(t.format),this._cache=t.cache||new s,this._loadingSchemas={},this._compilations=[],this.RULES=l(),this.validate=r,this.compile=y,this.addSchema=x,this.addMetaSchema=P,this.validateSchema=w,this.getSchema=S,this.removeSchema=T,this.addFormat=O,this.errorsText=C,this._addSchema=A,this._compile=R,t.loopRequired=t.loopRequired||1/0,(t.async||t.transpile)&&f.setup(t),!0===t.beautify&&(t.beautify={indent_size:2}),"property"==t.errorDataPath&&(t._errorDataPathProperty=!0),this._metaOpts=function(){for(var e=h.copy(j._opts),t=0;t<b.length;t++)delete e[b[t]];return e}(),t.formats&&function(){for(var e in j._opts.formats){O(e,j._opts.formats[e])}}(),function(){if(!1!==j._opts.meta){P(e("./refs/json-schema-draft-04.json"),g,!0),j._refs["http://json-schema.org/schema"]=g}}(),t.v5&&d.enable(this),"object"==typeof t.meta&&P(t.meta),function(){var e=j._opts.schemas;if(e)if(Array.isArray(e))x(e);else for(var t in e)x(e[t],t)}()}var a=e("./compile"),o=e("./compile/resolve"),s=e("./cache"),u=e("./compile/schema_obj"),p=e("json-stable-stringify"),c=e("./compile/formats"),l=e("./compile/rules"),d=e("./v5"),h=e("./compile/util"),f=e("./async"),m=e("co");t.exports=n,n.prototype.compileAsync=f.compile;var y=e("./keyword");n.prototype.addKeyword=y.add,n.prototype.getKeyword=y.get,n.prototype.removeKeyword=y.remove,n.ValidationError=e("./compile/validation_error");var g="http://json-schema.org/draft-04/schema",v=/^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i,b=["removeAdditional","useDefaults","coerceTypes"]},{"./async":1,"./cache":2,"./compile":6,"./compile/formats":5,"./compile/resolve":7,"./compile/rules":8,"./compile/schema_obj":9,"./compile/util":11,"./compile/validation_error":12,"./keyword":37,"./refs/json-schema-draft-04.json":38,"./v5":40,co:41,"json-stable-stringify":42}]},{},[])("ajv")})}).call(t,r(77))},function(e,t,r){"use strict";function i(e,t){return e.major>t.major?e:t.major>e.major?t:e.minor>t.minor?e:t}function n(e){var t=[];if(e.major<=1){var r=i(e,{major:1,minor:0});t.push(function(e){return h.mapToV2Entity(e,r)})}if(e.major<=2){var n=i(e,{major:2,minor:0});t.push(function(e){return f.mapToV3Entity(e,n)})}if(e.major<=3){var a=i(e,{major:3,minor:0});t.push(function(e){return m.mapToV4Entity(e,a)})}if(e.major<=4){var o=i(e,{major:4,minor:0});t.push(function(e){return y.mapToV5Entity(e,o)})}return t}function a(e,t){n(t).forEach(function(t){e=b(e,t)});var r=v(e,"id");return b(e,function(e){return({material:o,prefab:l}[e.type]||g)(e,r)})}function o(e,t){var r=e.properties;return r.shadingModel&&("phong"===r.shadingModel?r.shaderId="fbx_surface_phong_shader":r.shaderId="fbx_surface_lambert_shader",delete r.shadingModel),s(r,"diffuse"),u(r,"ambient"),u(r,"emissive"),s(r,"specular"),p(r),c(r.normalMapTexture,"linear",t),c(r.bumpTexture,"linear",t),c(r.displacementTexture,"linear",t),c(r.transparencyFactorTexture,"linear",t),r.normalScale&&void 0===r.normalScale.x&&(r.normalScale={x:r.normalScale,y:r.normalScale}),e}function s(e,t){var r=t+"Factor",i=t+"Texture",n=t+"FactorTexture";e[t]&&(e[i]?e[t]={r:e[r],g:e[r],b:e[r]}:e[n]?e[i]=e[n]:(e[t].r*=e[r],e[t].g*=e[r],e[t].b*=e[r]),delete e[r],delete e[n])}function u(e,t){var r=t+"Texture",i=t+"FactorTexture";e[i]&&(e[r]=e[i],delete e[i])}function p(e){var t=0;(e.transparencyFactor||e.transparencyFactorTexture)&&e.transparentColor&&e.transparentColor.r?e.transparencyFactorTexture||e.transparentColorTexture?e.transparencyFactor=0:(t=(e.transparentColor.r+e.transparentColor.g+e.transparentColor.b)/3,e.transparencyFactor*=t):e.transparencyFactor=0,e.transparencyFactor=Math.max(Math.min(1-e.transparencyFactor,1),0),delete e.transparentColor,delete e.transparentColorTexture}function c(e,t,r){var i=r[e];if(i){var n=r[i.properties.imageId];n&&(n.properties.encoding=t)}}function l(e){var t=d.v4(),r={type:"node",id:t,parentAssetId:e.id,sid:t,children:e.children,properties:{name:(e.properties.name||"Prefab")+"_root"}};return delete e.children,e.properties.rootObjectId=t,[e,r]}var d=r(19),h=r(254),f=r(255),m=r(256),y=r(257),g=r(13).identity,v=r(13).indexBy,b=r(13).flatMap;e.exports={mapEntities:a}},function(e,t,r){"use strict";function i(e){return e.payload&&(e.properties=e.payload,delete e.payload),e}function n(e){return e=i(e),({material:a}[e.type]||o)(e)}function a(e){return e.properties&&e.properties.properties&&(s(e.properties.properties,function(t,r){e.properties[r]=t}),delete e.properties.properties),e}var o=r(13).identity,s=r(13).each;e.exports={mapToV2Entity:n}},function(e,t,r){"use strict";function i(e){var t=e.split(new RegExp(/\\|\//));return 0===t.length?e:t[t.length-1]}function n(e){return e.name&&(e.sid=e.name,e.properties||(e.properties={}),e.properties.name=e.name,delete e.name),e}function a(e){return e=n(e),({texture2D:o}[e.type]||u)(e)}function o(e){var t=i(e.properties.filename),r={type:"document",id:s.v4(),sid:t,properties:{name:t,filename:e.properties.filename}};return e.properties.imageId=r.id+"#"+t,delete e.properties.filename,[e,r]}var s=r(19),u=r(13).identity;e.exports={mapToV3Entity:a}},function(e,t,r){"use strict";function i(e){return({meshGeometry:n}[e.type]||o)(e)}function n(e){var t={type:"buffer",id:a.v4(),sid:e.sid+"-buffer",properties:{name:e.sid+"-buffer",src:"geometry.bin",accessors:{}}};return s(e.properties.attributes,function(e,r){t.properties.accessors[r]={type:e.type,componentType:e.componentType,byteOffset:e.byteOffset,byteStride:0,count:e.count},e.accessorId=t.id+"#"+r,delete e.type,delete e.componentType,delete e.byteOffset,delete e.byteStride,delete e.count}),t.properties.accessors.indices={type:e.properties.indices.type,componentType:e.properties.indices.componentType,byteOffset:e.properties.indices.byteOffset,byteStride:0,count:e.properties.indices.count},e.properties.indices=t.id+"#indices",[e,t]}var a=r(19),o=r(13).identity,s=r(13).each;e.exports={mapToV4Entity:i}},function(e,t,r){"use strict";function i(e,t){return({image:n}[e.type]||a)(e,t)}function n(e,t){return t.minor<3&&e.hasOwnProperty("representations")&&(e.representations=e.representations.filter(function(e){return e.width<=4096&&e.height<=4096})),e}var a=r(13).identity;e.exports={mapToV5Entity:i}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,r){var i=r(201)("unscopables"),n=Array.prototype;void 0==n[i]&&r(76)(n,i,{}),e.exports=function(e){n[i][e]=!0}},function(e,t,r){var i=r(51);e.exports=function(e){if(!i(e))throw TypeError(e+" is not an object!");return e}},function(e,t,r){var i=r(198),n=r(268),a=r(276),o=r(275),s=r(263);e.exports=function(e,t){var r=1==e,u=2==e,p=3==e,c=4==e,l=6==e,d=5==e||l,h=t||s;return function(t,s,f){for(var m,y,g=a(t),v=n(g),b=i(s,f,3),x=o(v.length),P=0,w=r?h(t,x):u?h(t,0):void 0;x>P;P++)if((d||P in v)&&(m=v[P],y=b(m,P,g),e))if(r)w[P]=y;else if(y)switch(e){case 3:return!0;case 5:return m;case 6:return P;case 2:w.push(m)}else if(c)return!1;return l?-1:p||c?c:w}}},function(e,t,r){var i=r(51),n=r(269),a=r(201)("species");e.exports=function(e){var t;return n(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!n(t.prototype)||(t=void 0),i(t)&&null===(t=t[a])&&(t=void 0)),void 0===t?Array:t}},function(e,t,r){var i=r(262);e.exports=function(e,t){return new(i(e))(t)}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,r){var i=r(51),n=r(33).document,a=i(n)&&i(n.createElement);e.exports=function(e){return a?n.createElement(e):{}}},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){e.exports=!r(74)&&!r(199)(function(){return 7!=Object.defineProperty(r(265)("div"),"a",{get:function(){return 7}}).a})},function(e,t,r){var i=r(197);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==i(e)?e.split(""):Object(e)}},function(e,t,r){var i=r(197);e.exports=Array.isArray||function(e){return"Array"==i(e)}},function(e,t,r){var i=r(260),n=r(267),a=r(277),o=Object.defineProperty;t.f=r(74)?Object.defineProperty:function(e,t,r){if(i(e),t=a(t,!0),i(r),n)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var i=r(33),n=r(76),a=r(266),o=r(200)("src"),s=Function.toString,u=(""+s).split("toString");r(32).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,r,s){var p="function"==typeof r;p&&(a(r,"name")||n(r,"name",t)),e[t]!==r&&(p&&(a(r,o)||n(r,o,e[t]?""+e[t]:u.join(String(t)))),e===i?e[t]=r:s?e[t]?e[t]=r:n(e,t,r):(delete e[t],n(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||s.call(this)})},function(e,t,r){var i=r(33),n=i["__core-js_shared__"]||(i["__core-js_shared__"]={});e.exports=function(e){return n[e]||(n[e]={})}},function(e,t){var r=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},function(e,t,r){var i=r(274),n=Math.min;e.exports=function(e){return e>0?n(i(e),9007199254740991):0}},function(e,t,r){var i=r(264);e.exports=function(e){return Object(i(e))}},function(e,t,r){var i=r(51);e.exports=function(e,t){if(!i(e))return e;var r,n;if(t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;if("function"==typeof(r=e.valueOf)&&!i(n=r.call(e)))return n;if(!t&&"function"==typeof(r=e.toString)&&!i(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")}},function(e,t,r){"use strict";var i=r(75),n=r(261)(5),a=!0;"find"in[]&&Array(1).find(function(){a=!1}),i(i.P+i.F*a,"Array",{find:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}}),r(259)("find")},function(e,t,r){var i=r(75);i(i.S,"Math",{log10:function(e){return Math.log(e)*Math.LOG10E}})},function(e,t,r){var i=r(75);i(i.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}})},function(e,t,r){var i,n;(function(a,o){"use strict";i=o,void 0!==(n="function"==typeof i?i.call(t,r,t,e):i)&&(e.exports=n)})(0,function(){"use strict";function e(e){return typeof console!==s&&(void 0!==console[e]?t(console,e):void 0!==console.log?t(console,"log"):o)}function t(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function r(e,t,r){return function(){typeof console!==s&&(i.call(this,t,r),this[e].apply(this,arguments))}}function i(e,t){for(var r=0;r<u.length;r++){var i=u[r];this[i]=r<e?o:this.methodFactory(i,e,t)}}function n(t,i,n){return e(t)||r.apply(this,arguments)}function a(e,t,r){function a(e){var t=(u[e]||"silent").toUpperCase();try{return void(window.localStorage[l]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(l)+"="+t+";"}catch(e){}}function o(){var e;try{e=window.localStorage[l]}catch(e){}if(typeof e===s)try{var t=window.document.cookie,r=t.indexOf(encodeURIComponent(l)+"=");r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}catch(e){}return void 0===c.levels[e]&&(e=void 0),e}var p,c=this,l="loglevel";e&&(l+=":"+e),c.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},c.methodFactory=r||n,c.getLevel=function(){return p},c.setLevel=function(t,r){if("string"==typeof t&&void 0!==c.levels[t.toUpperCase()]&&(t=c.levels[t.toUpperCase()]),!("number"==typeof t&&t>=0&&t<=c.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(p=t,!1!==r&&a(t),i.call(c,t,e),typeof console===s&&t<c.levels.SILENT)return"No console available for logging"},c.setDefaultLevel=function(e){o()||c.setLevel(e,!1)},c.enableAll=function(e){c.setLevel(c.levels.TRACE,e)},c.disableAll=function(e){c.setLevel(c.levels.SILENT,e)};var d=o();null==d&&(d=null==t?"WARN":t),c.setLevel(d,!1)}var o=function(){},s="undefined",u=["trace","debug","info","warn","error"],p=new a,c={};p.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=c[e];return t||(t=c[e]=new a(e,p.getLevel(),p.methodFactory)),t};var l=typeof window!==s?window.log:void 0;return p.noConflict=function(){return typeof window!==s&&window.log===p&&(window.log=l),p},p})},function(e,t,r){(function(t,r){e.exports=r()})(0,function(){var e=function(){function t(e){return n.appendChild(e.dom),e}function r(e){for(var t=0;t<n.children.length;t++)n.children[t].style.display=t===e?"block":"none";i=e}var i=0,n=document.createElement("div");n.style.cssText="position:fixed;top:0;left:0;cursor:pointer;opacity:0.9;z-index:10000",n.addEventListener("click",function(e){e.preventDefault(),r(++i%n.children.length)},!1);var a=(performance||Date).now(),o=a,s=0,u=t(new e.Panel("FPS","#0ff","#002")),p=t(new e.Panel("MS","#0f0","#020"));if(self.performance&&self.performance.memory)var c=t(new e.Panel("MB","#f08","#201"));return r(0),{REVISION:16,dom:n,addPanel:t,showPanel:r,begin:function(){a=(performance||Date).now()},end:function(){s++;var e=(performance||Date).now();if(p.update(e-a,200),e>o+1e3&&(u.update(1e3*s/(e-o),100),o=e,s=0,c)){var t=performance.memory;c.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:n,setMode:r}};return e.Panel=function(e,t,r){var i=1/0,n=0,a=Math.round,o=a(window.devicePixelRatio||1),s=80*o,u=48*o,p=3*o,c=2*o,l=3*o,d=15*o,h=74*o,f=30*o,m=document.createElement("canvas");m.width=s,m.height=u,m.style.cssText="width:80px;height:48px";var y=m.getContext("2d");return y.font="bold "+9*o+"px Helvetica,Arial,sans-serif",y.textBaseline="top",y.fillStyle=r,y.fillRect(0,0,s,u),y.fillStyle=t,y.fillText(e,p,c),y.fillRect(l,d,h,f),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(l,d,h,f),{dom:m,update:function(u,g){i=Math.min(i,u),n=Math.max(n,u),y.fillStyle=r,y.globalAlpha=1,y.fillRect(0,0,s,d),y.fillStyle=t,y.fillText(a(u)+" "+e+" ("+a(i)+"-"+a(n)+")",p,c),y.drawImage(m,l+o,d,h-o,f,l,d,h-o,f),y.fillRect(l+h-o,d,o,f),y.fillStyle=r,y.globalAlpha=.9,y.fillRect(l+h-o,d,o,a((1-u/g)*f))}}},e})},function(e,t,r){function i(e,t,r){var i=t&&r||0,n=t||[];e=e||{};var o=void 0!==e.clockseq?e.clockseq:u,l=void 0!==e.msecs?e.msecs:(new Date).getTime(),d=void 0!==e.nsecs?e.nsecs:c+1,h=l-p+(d-c)/1e4;if(h<0&&void 0===e.clockseq&&(o=o+1&16383),(h<0||l>p)&&void 0===e.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");p=l,c=d,u=o,l+=122192928e5;var f=(1e4*(268435455&l)+d)%4294967296;n[i++]=f>>>24&255,n[i++]=f>>>16&255,n[i++]=f>>>8&255,n[i++]=255&f;var m=l/4294967296*1e4&268435455;n[i++]=m>>>8&255,n[i++]=255&m,n[i++]=m>>>24&15|16,n[i++]=m>>>16&255,n[i++]=o>>>8|128,n[i++]=255&o;for(var y=e.node||s,g=0;g<6;++g)n[i+g]=y[g];return t||a(n)}var n=r(203),a=r(202),o=n(),s=[1|o[0],o[1],o[2],o[3],o[4],o[5]],u=16383&(o[6]<<8|o[7]),p=0,c=0;e.exports=i},function(e,t,r){function i(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"==e?new Array(16):null,e=null),e=e||{};var o=e.random||(e.rng||n)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t)for(var s=0;s<16;++s)t[i+s]=o[s];return t||a(o)}var n=r(203),a=r(202);e.exports=i}])});
2
+ //# sourceMappingURL=box3d-runtime.min.js.map