@roomle/web-sdk 2.28.0 → 2.29.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 (205) hide show
  1. package/lib/{banana-for-scale-dd4c5739.js → banana-for-scale-656cea8a.js} +2 -2
  2. package/lib/{banana-for-scale-dd4c5739.js.map → banana-for-scale-656cea8a.js.map} +1 -1
  3. package/lib/{banana-for-scale-2239eff7.nomodule.js → banana-for-scale-89f70127.nomodule.js} +2 -2
  4. package/lib/{banana-for-scale-2239eff7.nomodule.js.map → banana-for-scale-89f70127.nomodule.js.map} +1 -1
  5. package/lib/{budgeteer-measure-05dc445d.js → budgeteer-measure-8cfea554.js} +2 -2
  6. package/lib/{budgeteer-measure-05dc445d.js.map → budgeteer-measure-8cfea554.js.map} +1 -1
  7. package/lib/budgeteer-measure.nomodule.js +1 -1
  8. package/lib/{component-dimensioning-07857a7e.js → component-dimensioning-1b5f64dd.js} +2 -2
  9. package/lib/component-dimensioning-1b5f64dd.js.map +1 -0
  10. package/lib/{component-dimensioning-e121b044.nomodule.js → component-dimensioning-7bdd1b3b.nomodule.js} +2 -2
  11. package/lib/component-dimensioning-7bdd1b3b.nomodule.js.map +1 -0
  12. package/lib/configurator-6e7f5ef0.js +2 -0
  13. package/lib/{configurator-366b9a69.js.map → configurator-6e7f5ef0.js.map} +1 -1
  14. package/lib/configurator-eddf59f1.nomodule.js +2 -0
  15. package/lib/{configurator-b498456a.nomodule.js.map → configurator-eddf59f1.nomodule.js.map} +1 -1
  16. package/lib/configurator-main-7acfa92f.js +2 -0
  17. package/lib/configurator-main-7acfa92f.js.map +1 -0
  18. package/lib/configurator-main.nomodule.js +1 -1
  19. package/lib/configurator-mesh-generator-05375458.nomodule.js +2 -0
  20. package/lib/configurator-mesh-generator-05375458.nomodule.js.map +1 -0
  21. package/lib/{configurator-mesh-generator-e827c528.js → configurator-mesh-generator-f210ee04.js} +2 -2
  22. package/lib/configurator-mesh-generator-f210ee04.js.map +1 -0
  23. package/lib/{default-light-setting-7eb7961c.js → default-light-setting-7de63c9a.js} +2 -2
  24. package/lib/default-light-setting-7de63c9a.js.map +1 -0
  25. package/lib/{default-light-setting-f21a820b.nomodule.js → default-light-setting-e4720308.nomodule.js} +2 -2
  26. package/lib/default-light-setting-e4720308.nomodule.js.map +1 -0
  27. package/lib/definitions/common-core/src/services/global-callback.d.ts +1 -0
  28. package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +7 -1
  29. package/lib/definitions/configurator-core/src/webgl/scene-helper.d.ts +1 -1
  30. package/lib/{dimensioning-helper-73700224.nomodule.js → dimensioning-helper-844fc69d.nomodule.js} +2 -2
  31. package/lib/dimensioning-helper-844fc69d.nomodule.js.map +1 -0
  32. package/lib/{dimensioning-helper-2f129aab.js → dimensioning-helper-e77fbedb.js} +2 -2
  33. package/lib/dimensioning-helper-e77fbedb.js.map +1 -0
  34. package/lib/glb-viewer-0331f919.js +2 -0
  35. package/lib/{glb-viewer-10243e50.js.map → glb-viewer-0331f919.js.map} +1 -1
  36. package/lib/glb-viewer-6e5482c7.nomodule.js +2 -0
  37. package/lib/{glb-viewer-d6e080e4.nomodule.js.map → glb-viewer-6e5482c7.nomodule.js.map} +1 -1
  38. package/lib/glb-viewer-main-17601c40.js +2 -0
  39. package/lib/glb-viewer-main-17601c40.js.map +1 -0
  40. package/lib/glb-viewer-main.nomodule.js +1 -1
  41. package/lib/image-renderer-880c414d.nomodule.js +2 -0
  42. package/lib/{image-renderer-9478b17b.nomodule.js.map → image-renderer-880c414d.nomodule.js.map} +1 -1
  43. package/lib/image-renderer-ad267c8b.js +2 -0
  44. package/lib/{image-renderer-9e47bc3a.js.map → image-renderer-ad267c8b.js.map} +1 -1
  45. package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js → banana-for-scale-bd7d6dfd.legacy.js} +2 -2
  46. package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js.map → banana-for-scale-bd7d6dfd.legacy.js.map} +1 -1
  47. package/lib/legacy/budgeteer-measure.legacy.js +1 -1
  48. package/lib/legacy/{component-dimensioning-d657350b.legacy.js → component-dimensioning-59fd1367.legacy.js} +2 -2
  49. package/lib/legacy/component-dimensioning-59fd1367.legacy.js.map +1 -0
  50. package/lib/legacy/configurator-82b7967e.legacy.js +2 -0
  51. package/lib/legacy/{configurator-3250dfc2.legacy.js.map → configurator-82b7967e.legacy.js.map} +1 -1
  52. package/lib/legacy/configurator-main.legacy.js +1 -1
  53. package/lib/legacy/{configurator-mesh-generator-d604f05c.legacy.js → configurator-mesh-generator-6266fa75.legacy.js} +2 -2
  54. package/lib/legacy/configurator-mesh-generator-6266fa75.legacy.js.map +1 -0
  55. package/lib/legacy/{default-light-setting-14b03f67.legacy.js → default-light-setting-97f711dc.legacy.js} +2 -2
  56. package/lib/legacy/default-light-setting-97f711dc.legacy.js.map +1 -0
  57. package/lib/legacy/{dimensioning-helper-bed08d96.legacy.js → dimensioning-helper-99057da2.legacy.js} +2 -2
  58. package/lib/legacy/dimensioning-helper-99057da2.legacy.js.map +1 -0
  59. package/lib/legacy/glb-viewer-be2c067a.legacy.js +2 -0
  60. package/lib/legacy/{glb-viewer-5dcdda0a.legacy.js.map → glb-viewer-be2c067a.legacy.js.map} +1 -1
  61. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  62. package/lib/legacy/image-renderer-6df9eca6.legacy.js +2 -0
  63. package/lib/legacy/{image-renderer-0f532f9c.legacy.js.map → image-renderer-6df9eca6.legacy.js.map} +1 -1
  64. package/lib/legacy/{main-thread-to-worker-880d5b78.legacy.js → main-thread-to-worker-4c02f179.legacy.js} +2 -2
  65. package/lib/legacy/main-thread-to-worker-4c02f179.legacy.js.map +1 -0
  66. package/lib/legacy/{material-viewer-41e5c677.legacy.js → material-viewer-e83460de.legacy.js} +2 -2
  67. package/lib/legacy/material-viewer-e83460de.legacy.js.map +1 -0
  68. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  69. package/lib/legacy/{mesh-generator-4f2f2ec7.legacy.js → mesh-generator-084a73cd.legacy.js} +2 -2
  70. package/lib/legacy/mesh-generator-084a73cd.legacy.js.map +1 -0
  71. package/lib/legacy/{pixotron-cd4cd438.legacy.js → pixotron-6195d494.legacy.js} +2 -2
  72. package/lib/legacy/{pixotron-cd4cd438.legacy.js.map → pixotron-6195d494.legacy.js.map} +1 -1
  73. package/lib/legacy/{planner-03b11101.legacy.js → planner-5b7cc8fa.legacy.js} +2 -2
  74. package/lib/legacy/{planner-03b11101.legacy.js.map → planner-5b7cc8fa.legacy.js.map} +1 -1
  75. package/lib/legacy/planner-main.legacy.js +1 -1
  76. package/lib/legacy/{rapi-access-ef758fca.legacy.js → rapi-access-7d0f02e7.legacy.js} +3 -3
  77. package/lib/legacy/{rapi-access-ef758fca.legacy.js.map → rapi-access-7d0f02e7.legacy.js.map} +1 -1
  78. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  79. package/lib/legacy/{scene-manager-afd27798.legacy.js → scene-manager-65a4c302.legacy.js} +2 -2
  80. package/lib/legacy/scene-manager-65a4c302.legacy.js.map +1 -0
  81. package/lib/legacy/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
  82. package/lib/legacy/static/{ConfiguratorKernel-c416f21e546a33f4.js → ConfiguratorKernel-7379813e2cd03c0d.js} +74 -74
  83. package/lib/legacy/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
  84. package/lib/legacy/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
  85. package/lib/legacy/static/RoomleCore-43a1c9de57277471.wasm +0 -0
  86. package/lib/legacy/static/{RoomleCore-30311f70b9e1675b.js → RoomleCore-4da5951bbc66db16.js} +83 -83
  87. package/lib/legacy/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
  88. package/lib/legacy/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
  89. package/lib/legacy/static/shaders-df453330fdd84fa7.json +1 -0
  90. package/lib/legacy/{stats-helper-0acbc658.legacy.js → stats-helper-e832d5a9.legacy.js} +2 -2
  91. package/lib/legacy/{stats-helper-0acbc658.legacy.js.map → stats-helper-e832d5a9.legacy.js.map} +1 -1
  92. package/lib/{main-thread-to-worker-bb844d54.nomodule.js → main-thread-to-worker-4fc95d50.nomodule.js} +2 -2
  93. package/lib/main-thread-to-worker-4fc95d50.nomodule.js.map +1 -0
  94. package/lib/{main-thread-to-worker-91bf9f5e.js → main-thread-to-worker-5447c1c5.js} +2 -2
  95. package/lib/main-thread-to-worker-5447c1c5.js.map +1 -0
  96. package/lib/{material-viewer-1b0d838c.nomodule.js → material-viewer-8183024b.nomodule.js} +2 -2
  97. package/lib/material-viewer-8183024b.nomodule.js.map +1 -0
  98. package/lib/{material-viewer-90b397b7.js → material-viewer-9ee1ebf0.js} +2 -2
  99. package/lib/material-viewer-9ee1ebf0.js.map +1 -0
  100. package/lib/material-viewer-main-6c084313.js +2 -0
  101. package/lib/material-viewer-main-6c084313.js.map +1 -0
  102. package/lib/material-viewer-main.nomodule.js +1 -1
  103. package/lib/{mesh-generator-948c7db4.nomodule.js → mesh-generator-7dea7a1b.nomodule.js} +2 -2
  104. package/lib/mesh-generator-7dea7a1b.nomodule.js.map +1 -0
  105. package/lib/{mesh-generator-ff0dbfc8.js → mesh-generator-a980f1b0.js} +2 -2
  106. package/lib/mesh-generator-a980f1b0.js.map +1 -0
  107. package/lib/{pixotron-ec9a72e0.nomodule.js → pixotron-4065f090.nomodule.js} +2 -2
  108. package/lib/{pixotron-ec9a72e0.nomodule.js.map → pixotron-4065f090.nomodule.js.map} +1 -1
  109. package/lib/{pixotron-5167229f.js → pixotron-9baf521b.js} +2 -2
  110. package/lib/{pixotron-5167229f.js.map → pixotron-9baf521b.js.map} +1 -1
  111. package/lib/{planner-f1b53f57.nomodule.js → planner-2040e9ab.nomodule.js} +2 -2
  112. package/lib/{planner-f1b53f57.nomodule.js.map → planner-2040e9ab.nomodule.js.map} +1 -1
  113. package/lib/{planner-c3c34e74.js → planner-79b62302.js} +2 -2
  114. package/lib/{planner-c3c34e74.js.map → planner-79b62302.js.map} +1 -1
  115. package/lib/planner-main-74807374.js +2 -0
  116. package/lib/planner-main-74807374.js.map +1 -0
  117. package/lib/planner-main.nomodule.js +1 -1
  118. package/lib/{rapi-access-cf61a750.nomodule.js → rapi-access-65dbda00.nomodule.js} +3 -3
  119. package/lib/{rapi-access-cf61a750.nomodule.js.map → rapi-access-65dbda00.nomodule.js.map} +1 -1
  120. package/lib/{rapi-access-cc4f78e4.js → rapi-access-d209c65c.js} +3 -3
  121. package/lib/{rapi-access-cc4f78e4.js.map → rapi-access-d209c65c.js.map} +1 -1
  122. package/lib/{roomle-sdk-da4e3ccc.js → roomle-sdk-85d54446.js} +2 -2
  123. package/lib/roomle-sdk-85d54446.js.map +1 -0
  124. package/lib/roomle-sdk.nomodule.js +1 -1
  125. package/lib/{scene-manager-aa8b9035.nomodule.js → scene-manager-0ac7eb06.nomodule.js} +2 -2
  126. package/lib/scene-manager-0ac7eb06.nomodule.js.map +1 -0
  127. package/lib/{scene-manager-8c308533.js → scene-manager-424afdbc.js} +2 -2
  128. package/lib/scene-manager-424afdbc.js.map +1 -0
  129. package/lib/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
  130. package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js +1 -0
  131. package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js.map +1 -0
  132. package/lib/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
  133. package/lib/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
  134. package/lib/static/RoomleCore-43a1c9de57277471.wasm +0 -0
  135. package/lib/static/RoomleCore-4da5951bbc66db16.js +1 -0
  136. package/lib/static/RoomleCore-4da5951bbc66db16.js.map +1 -0
  137. package/lib/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
  138. package/lib/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
  139. package/lib/static/shaders-df453330fdd84fa7.json +1 -0
  140. package/lib/{stats-helper-f53f8b2f.js → stats-helper-3ffe1651.js} +2 -2
  141. package/lib/{stats-helper-f53f8b2f.js.map → stats-helper-3ffe1651.js.map} +1 -1
  142. package/lib/{stats-helper-7dc63459.nomodule.js → stats-helper-9b173f93.nomodule.js} +2 -2
  143. package/lib/{stats-helper-7dc63459.nomodule.js.map → stats-helper-9b173f93.nomodule.js.map} +1 -1
  144. package/package.json +2 -2
  145. package/lib/component-dimensioning-07857a7e.js.map +0 -1
  146. package/lib/component-dimensioning-e121b044.nomodule.js.map +0 -1
  147. package/lib/configurator-366b9a69.js +0 -2
  148. package/lib/configurator-b498456a.nomodule.js +0 -2
  149. package/lib/configurator-main-1ba50225.js +0 -2
  150. package/lib/configurator-main-1ba50225.js.map +0 -1
  151. package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js +0 -2
  152. package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js.map +0 -1
  153. package/lib/configurator-mesh-generator-e827c528.js.map +0 -1
  154. package/lib/default-light-setting-7eb7961c.js.map +0 -1
  155. package/lib/default-light-setting-f21a820b.nomodule.js.map +0 -1
  156. package/lib/dimensioning-helper-2f129aab.js.map +0 -1
  157. package/lib/dimensioning-helper-73700224.nomodule.js.map +0 -1
  158. package/lib/glb-viewer-10243e50.js +0 -2
  159. package/lib/glb-viewer-d6e080e4.nomodule.js +0 -2
  160. package/lib/glb-viewer-main-39535b70.js +0 -2
  161. package/lib/glb-viewer-main-39535b70.js.map +0 -1
  162. package/lib/image-renderer-9478b17b.nomodule.js +0 -2
  163. package/lib/image-renderer-9e47bc3a.js +0 -2
  164. package/lib/legacy/component-dimensioning-d657350b.legacy.js.map +0 -1
  165. package/lib/legacy/configurator-3250dfc2.legacy.js +0 -2
  166. package/lib/legacy/configurator-mesh-generator-d604f05c.legacy.js.map +0 -1
  167. package/lib/legacy/default-light-setting-14b03f67.legacy.js.map +0 -1
  168. package/lib/legacy/dimensioning-helper-bed08d96.legacy.js.map +0 -1
  169. package/lib/legacy/glb-viewer-5dcdda0a.legacy.js +0 -2
  170. package/lib/legacy/image-renderer-0f532f9c.legacy.js +0 -2
  171. package/lib/legacy/main-thread-to-worker-880d5b78.legacy.js.map +0 -1
  172. package/lib/legacy/material-viewer-41e5c677.legacy.js.map +0 -1
  173. package/lib/legacy/mesh-generator-4f2f2ec7.legacy.js.map +0 -1
  174. package/lib/legacy/scene-manager-afd27798.legacy.js.map +0 -1
  175. package/lib/legacy/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
  176. package/lib/legacy/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
  177. package/lib/legacy/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
  178. package/lib/legacy/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
  179. package/lib/legacy/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
  180. package/lib/legacy/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
  181. package/lib/legacy/static/shaders-300ca3b7af102119.json +0 -1
  182. package/lib/main-thread-to-worker-91bf9f5e.js.map +0 -1
  183. package/lib/main-thread-to-worker-bb844d54.nomodule.js.map +0 -1
  184. package/lib/material-viewer-1b0d838c.nomodule.js.map +0 -1
  185. package/lib/material-viewer-90b397b7.js.map +0 -1
  186. package/lib/material-viewer-main-39b78443.js +0 -2
  187. package/lib/material-viewer-main-39b78443.js.map +0 -1
  188. package/lib/mesh-generator-948c7db4.nomodule.js.map +0 -1
  189. package/lib/mesh-generator-ff0dbfc8.js.map +0 -1
  190. package/lib/planner-main-f87ff090.js +0 -2
  191. package/lib/planner-main-f87ff090.js.map +0 -1
  192. package/lib/roomle-sdk-da4e3ccc.js.map +0 -1
  193. package/lib/scene-manager-8c308533.js.map +0 -1
  194. package/lib/scene-manager-aa8b9035.nomodule.js.map +0 -1
  195. package/lib/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
  196. package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js +0 -1
  197. package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js.map +0 -1
  198. package/lib/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
  199. package/lib/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
  200. package/lib/static/RoomleCore-30311f70b9e1675b.js +0 -1
  201. package/lib/static/RoomleCore-30311f70b9e1675b.js.map +0 -1
  202. package/lib/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
  203. package/lib/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
  204. package/lib/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
  205. package/lib/static/shaders-300ca3b7af102119.json +0 -1
@@ -1,2 +1,2 @@
1
- import{_ as __decorate,i as inject,O as PREVIEW_MATERIAL_COLOR,S as PREVIEW_MATERIAL_ROUGHNESS,a3 as PREVIEW_MATERIAL_METALNESS,K as createMaterial,N as addTexture}from"./rapi-access-cc4f78e4.js";import{j as createBenchmarkMaterial,k as createBenchmarkTexture}from"./main-thread-to-worker-91bf9f5e.js";class PromiseQueue{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,a)=>{this._finishPromiseExecutor.push({resolve:t,reject:a});const r=e?"allSettled":"all";Promise[r](this._waitingPromises).then(e=>{if("allSettled"===r){const t=[];e.forEach(({value:e,status:a})=>{"fulfilled"===a&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}let MeshGenerator=(()=>{class e{constructor(e){this.materialQueue=new PromiseQueue,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:PREVIEW_MATERIAL_COLOR,roughness:PREVIEW_MATERIAL_ROUGHNESS,metalness:PREVIEW_MATERIAL_METALNESS}),this._environmentLoader.setEnvMap(this._previewMaterial)}_generateGeometry(e,t,a,r,s){let i;if(e&&this._cacheHolder.geometryCache.has(e))i=this._cacheHolder.geometryCache.get(e);else{i=new THREE.Geometry,i.faceVertexUvs=[],i.faceVertexUvs[0]=[];for(let e=0,a=t.length;e<a;e+=3)i.vertices.push(new THREE.Vector3(t[e]/1e3,t[e+2]/1e3,t[e+1]/-1e3));let o=0,h=0,c=0,l=0,n=0,m=0,_=0,d=0,u=0,E=0,g=[];for(let e=0,t=a.length;e<t;e+=3)h=e,c=e+1,l=e+2,n=3*a[h],m=3*a[c],_=3*a[l],g=[new THREE.Vector3(s[n],s[n+2],-1*s[n+1]),new THREE.Vector3(s[m],s[m+2],-1*s[m+1]),new THREE.Vector3(s[_],s[_+2],-1*s[_+1])],i.faces.push(new THREE.Face3(a[h],a[c],a[l],g)),d=2*a[h],u=2*a[c],E=2*a[l],i.faceVertexUvs[0][o]=[],i.faceVertexUvs[0][o][0]=new THREE.Vector2(r[d],r[d+1]),i.faceVertexUvs[0][o][1]=new THREE.Vector2(r[u],r[u+1]),i.faceVertexUvs[0][o][2]=new THREE.Vector2(r[E],r[E+1]),o++;e&&this._cacheHolder.geometryCache.set(e,i)}return i}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,a,r,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let i=createBenchmarkMaterial(e),o=createMaterial(i,this._environmentLoader);this._loadBenchmarkTextures(i,o,r,s).then(t,a)}else this._rapiAccess.getMaterial(e).then(e=>{let i=createMaterial(e,this._environmentLoader);this._loadTextures(e,i,r,s).then(t,a)},a)}_loadBenchmarkTextures(e,t,a=1,r=1){return new Promise((s,i)=>{const o=createBenchmarkTexture(e.id);addTexture(this._dataSyncer.requestAsset(o.image,!0),o,t,this._maxAnisotropy,a/(0===o.mmWidth?1:o.mmWidth),r/(0===o.mmHeight?1:o.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})}_loadTextures(e,t,a=1,r=1){return new Promise((s,i)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(o=>{let h=[];o.forEach(e=>{h.push(addTexture(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,a/(0===e.mmWidth?1:e.mmWidth),r/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(h).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})})}_loadMaterial(e,t,a){return new Promise((r,s)=>{this._singlePromiseFactory.create(6,e,(r,s)=>this._createMaterial(e,r,s,t,a)).then(()=>{setTimeout(()=>r(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((a,r)=>{this._loadMaterial(t).then(r=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,r),a()},r)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(a=>{let r,s="rbg"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?r=this._cacheHolder.materialCache.get(s):(r=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(s,r)),this.changeMaterialOfMesh(e,r),setTimeout(()=>a(),0)})}_assignItem(e,t){return new Promise((a,r)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void a();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,r=>{r.anisotropy=this._maxAnisotropy,r.wrapS=THREE.RepeatWrapping,r.wrapT=THREE.RepeatWrapping;let i=new THREE.Vector2(1,1);s.width>0&&(i.x=1/s.width),s.depth>0&&(i.y=1/s.depth),r.repeat.set(i.x,i.y);const o=new THREE.MeshPhysicalMaterial({map:r,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(o),this._cacheHolder.materialCache.set(t,o),this.changeMaterialOfMesh(e,o),setTimeout(()=>a(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),r(e)}},r)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_environmentLoader",void 0),__decorate([inject],e.prototype,"_dataSyncer",void 0),__decorate([inject],e.prototype,"_singlePromiseFactory",void 0),__decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_plannerMeshGenerator",void 0),e})();export{MeshGenerator as M,PromiseQueue as P};
2
- //# sourceMappingURL=mesh-generator-ff0dbfc8.js.map
1
+ import{_ as __decorate,i as inject,O as PREVIEW_MATERIAL_COLOR,S as PREVIEW_MATERIAL_ROUGHNESS,a3 as PREVIEW_MATERIAL_METALNESS,K as createMaterial,N as addTexture}from"./rapi-access-d209c65c.js";import{j as createBenchmarkMaterial,k as createBenchmarkTexture}from"./main-thread-to-worker-5447c1c5.js";class PromiseQueue{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,a)=>{this._finishPromiseExecutor.push({resolve:t,reject:a});const r=e?"allSettled":"all";Promise[r](this._waitingPromises).then(e=>{if("allSettled"===r){const t=[];e.forEach(({value:e,status:a})=>{"fulfilled"===a&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}let MeshGenerator=(()=>{class e{constructor(e){this.materialQueue=new PromiseQueue,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:PREVIEW_MATERIAL_COLOR,roughness:PREVIEW_MATERIAL_ROUGHNESS,metalness:PREVIEW_MATERIAL_METALNESS}),this._environmentLoader.setEnvMap(this._previewMaterial)}_generateGeometry(e,t,a,r,s){let i;if(e&&this._cacheHolder.geometryCache.has(e))i=this._cacheHolder.geometryCache.get(e);else{i=new THREE.Geometry,i.faceVertexUvs=[],i.faceVertexUvs[0]=[];for(let e=0,a=t.length;e<a;e+=3)i.vertices.push(new THREE.Vector3(t[e]/1e3,t[e+2]/1e3,t[e+1]/-1e3));let o=0,h=0,c=0,l=0,n=0,m=0,_=0,d=0,u=0,E=0,g=[];for(let e=0,t=a.length;e<t;e+=3)h=e,c=e+1,l=e+2,n=3*a[h],m=3*a[c],_=3*a[l],g=[new THREE.Vector3(s[n],s[n+2],-1*s[n+1]),new THREE.Vector3(s[m],s[m+2],-1*s[m+1]),new THREE.Vector3(s[_],s[_+2],-1*s[_+1])],i.faces.push(new THREE.Face3(a[h],a[c],a[l],g)),d=2*a[h],u=2*a[c],E=2*a[l],i.faceVertexUvs[0][o]=[],i.faceVertexUvs[0][o][0]=new THREE.Vector2(r[d],r[d+1]),i.faceVertexUvs[0][o][1]=new THREE.Vector2(r[u],r[u+1]),i.faceVertexUvs[0][o][2]=new THREE.Vector2(r[E],r[E+1]),o++;e&&this._cacheHolder.geometryCache.set(e,i)}return i}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,a,r,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let i=createBenchmarkMaterial(e),o=createMaterial(i,this._environmentLoader);this._loadBenchmarkTextures(i,o,r,s).then(t,a)}else this._rapiAccess.getMaterial(e).then(e=>{let i=createMaterial(e,this._environmentLoader);this._loadTextures(e,i,r,s).then(t,a)},a)}_loadBenchmarkTextures(e,t,a=1,r=1){return new Promise((s,i)=>{const o=createBenchmarkTexture(e.id);addTexture(this._dataSyncer.requestAsset(o.image,!0),o,t,this._maxAnisotropy,a/(0===o.mmWidth?1:o.mmWidth),r/(0===o.mmHeight?1:o.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})}_loadTextures(e,t,a=1,r=1){return new Promise((s,i)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(o=>{let h=[];o.forEach(e=>{h.push(addTexture(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,a/(0===e.mmWidth?1:e.mmWidth),r/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(h).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},i)})})}_loadMaterial(e,t,a){return new Promise((r,s)=>{this._singlePromiseFactory.create(6,e,(r,s)=>this._createMaterial(e,r,s,t,a)).then(()=>{setTimeout(()=>r(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((a,r)=>{this._loadMaterial(t).then(r=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,r),a()},r)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(a=>{let r,s="rbg"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?r=this._cacheHolder.materialCache.get(s):(r=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(s,r)),this.changeMaterialOfMesh(e,r),setTimeout(()=>a(),0)})}_assignItem(e,t){return new Promise((a,r)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void a();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,r=>{r.anisotropy=this._maxAnisotropy,r.wrapS=THREE.RepeatWrapping,r.wrapT=THREE.RepeatWrapping;let i=new THREE.Vector2(1,1);s.width>0&&(i.x=1/s.width),s.depth>0&&(i.y=1/s.depth),r.repeat.set(i.x,i.y);const o=new THREE.MeshPhysicalMaterial({map:r,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(o),this._cacheHolder.materialCache.set(t,o),this.changeMaterialOfMesh(e,o),setTimeout(()=>a(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),r(e)}},r)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_environmentLoader",void 0),__decorate([inject],e.prototype,"_dataSyncer",void 0),__decorate([inject],e.prototype,"_singlePromiseFactory",void 0),__decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_plannerMeshGenerator",void 0),e})();export{MeshGenerator as M,PromiseQueue as P};
2
+ //# sourceMappingURL=mesh-generator-a980f1b0.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mesh-generator-a980f1b0.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-cf61a750.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js"],(function(t){var e,i,s,a,n,o,h,r,_,l,d,c,u,g,m,p,w,E,P,y,v,S,b;return{setters:[function(t){e=t.g},function(t){i=t.s,s=t.B,a=t.I,n=t._,o=t.i,h=t.t,r=t.u,_=t.v,l=t.w,d=t.x,c=t.y,u=t.h,g=t.G,m=t.z,p=t.F,w=t.H,E=t.J,P=t.K,y=t.N},function(t){v=t.d,S=t.g,b=t.h}],execute:function(){t("f","static/dat.gui.min-b5cbb61e5c62f0bf.js"),t("T","static/Tween-d024b02fe34f25ab.js"),t("M",class{constructor(t){this._context=t||i.getContext(this.getContextName()),s.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){i.setup(a);const t=e();this.lookup("global-init-data").setOverrides(t),this.lookup("init-data",this._context).setOverrides(t)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const t in window.THREE)if(window.THREE.hasOwnProperty(t))try{delete window.THREE[t]}catch(t){console.error(t)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(t){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(t),this.setupDependencies(),this.bootFinished()}lookup(t,e){return window.__RML__DI__.lookup(t,e)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(t){t&&this.lookup("dom-helper",this._context).setDomElement(t),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),i.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}});class x{constructor(){this._listeners={}}_addEventListener(t,e,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push({callback:e,scope:i})}addEventListener(t,e,i){this._addEventListener(t,e,i)}dispatchEvent(t,e){if(!this._listeners[t])return;const i=this._listeners[t];let s=i.length;for(let t=0;t<s;t++){const s=i[t];e?s.callback.apply(s.scope,[e]):s.callback.call(s.scope)}}removeEventListener(t,e){const i=this._listeners[t];if(i)for(let t=0,s=i.length;t<s;t++)if(i[t].callback===e)return void i.splice(t,1)}}t("E",x);const T=t("h",10);let f=t("d",(()=>{class t extends x{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=h(T),this._yaw=h(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new THREE.Vector3,this._targetPosition=new THREE.Vector3,i?this._cameraPosition.copy(i):this._cameraPosition=new THREE.Vector3(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=v(this._dispatchCameraIdle.bind(this),16)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||r(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,this._dispatchCameraIdle(),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this._getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_areEqual(t,e){return t.yaw.toFixed(5)===e.yaw.toFixed(5)&&t.pitch.toFixed(5)===e.pitch.toFixed(5)&&t.distance.toFixed(5)===e.distance.toFixed(5)&&t.targetX===e.targetX&&t.targetY===e.targetY&&t.targetZ===e.targetZ}_tweenCameraParameter(t,e,i){return new Promise(i=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._update(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}).onComplete(()=>{this.dispatchEvent(2,3),this._tweenEnd=null,i()}).start(),this.dispatchEvent(0,3)}})}_getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new THREE.Vector3(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof THREE.PerspectiveCamera&&e>i.far&&(i.far=e+1)}}return n([o],t.prototype,"_domHelper",void 0),n([o],t.prototype,"_initData",void 0),t})());class M{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}t("C",class extends f{constructor(t,e,i,s){super(t,e,i),this._bounds=new THREE.Vector3,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=h(0),this.maxPolarAngle=h(85),this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new THREE.Vector3(0,0,0));const{cameraRestriction:a,zoomDistance:n,minVerticalCameraAngle:o,maxVerticalCameraAngle:r,minHorizontalCameraAngle:_,maxHorizontalCameraAngle:l}=this._initData;if(n&&(this._zoomDistance=n/100),void 0!==o&&(this.minPolarAngle=h(o<0?o:-1*o)),void 0!==r&&(this.maxPolarAngle=h(r)),void 0!==_&&(this.minAzimuthAngle=h(_<0?_:-1*_)),void 0!==l&&(this.maxAzimuthAngle=h(l)),void 0!==a){let t=Math.abs(h(a));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,h(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}_initCamera(){this._camera=new THREE.PerspectiveCamera,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),a=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*a,s.y=s.y+e.y/i.clientHeight*a,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),_(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),_(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}setBounds(t){this._boundingBox=t}zoomToFitBounds(t){this.setBounds(t);const e=t.getSize(new THREE.Vector3);if(this._initData.debug||e.x+e.y+e.z===0)return;const i=this._getCurrentCameraParameters(),s=t.getCenter(new THREE.Vector3);this._targetPosition=new THREE.Vector3(s.x,s.y,s.z);const a=this._setDistanceAndRangesBasedOnBounds(e);this._distance=a,this._checkZoomDistance(t,a),this._tweenCameraParameter(i,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const a=t.getCenter(new THREE.Vector3);this._targetPosition=s?s.clone():new THREE.Vector3(a.x,a.y,a.z);const n=this._getCurrentCameraParameters(),o=t.getSize(new THREE.Vector3);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(n,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new THREE.Sphere);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const i=this._domHelper.getClientDimensions(),s=i.x,a=i.y,n=this._camera.offset?s-s*this._camera.offset.left-s*(1-this._camera.offset.right):s,o=this._camera.offset?a-a*this._camera.offset.bottom-a*(1-this._camera.offset.top):a;this._bounds.copy(t);const{cameraSpacing:h}=this._initData;t.addScalar(h/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const r=Math.max(t.x,t.y),{x:_,y:d}=this._getMargin(n,o),c=l(t.x+_,t.y+d,t.z,this._camera.fov,n,o);return this._distance<c&&e&&(this._distance=c),this.maxDistance=c+r,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),c}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,a=!0){const n=t.getSize(new THREE.Vector3);if(n){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new THREE.Vector3);this._targetPosition.copy(e)}const o=this._getCurrentCameraParameters();if(i||(i=-30),s||(s=T),this._pitch=h(s),this._yaw=h(i),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(n),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(n);this._setDistanceAndRangesBasedOnBounds(n);let r=this._targetPosition.clone();a?this._tweenCameraParameter(o,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:r.x,targetY:r.y,targetZ:r.z},!0):this._update(this._targetPosition)}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,a,n=!0){const o=new THREE.Vector3(-t.x/2,0,-t.z/2),r=new THREE.Vector3(t.x/2,t.y,t.z/2);if(this._boundingBox=new THREE.Box3(o,r),a&&t.addScalar(a),e?this._targetPosition.copy(e):this._targetPosition=new THREE.Vector3(0,t.y/2,0),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const _=this._getCurrentCameraParameters();i||(i=-30),s||(s=T),this._pitch=h(s),this._yaw=h(i),this._setDistanceAndRangesBasedOnBounds(t);let l=this._targetPosition.clone();n?this._tweenCameraParameter(_,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:l.x,targetY:l.y,targetZ:l.z},!0):this._update(this._targetPosition)}_update(t){this._initData.debug?this._pitch=Math.max(h(-89),Math.min(h(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const e=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX"),i=(new THREE.Quaternion).setFromEuler(e),s=new THREE.Vector3(0,0,-1);s.applyQuaternion(i),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const a=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(a),this._zoomChanged(!1,!1);else{const t=this._getCameraSphere(a);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(a),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0!==this._currentZoomHash.length&&this._currentZoomHash===i||(this.dispatchEvent(5,new M(t,e)),this._currentZoomHash=i),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t,e,i,s,a,n){return this._tweenCameraParameter(this._getCurrentCameraParameters(),{yaw:s,pitch:a,distance:2.725*l(t.x,t.y,t.z,this._camera.fov,e,i),targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new THREE.Sphere(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}_setCameraNear(){const t=Math.max(.1,this._distance/6);this._camera.near=t}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new THREE.Vector3(0,0,0))}async moveCamera(t){return this._tweenCameraParameter(this._getCurrentCameraParameters(),t,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}});let R={},C={};t("S",(()=>{class t{constructor(t){this._creator_=t}fetch(t,e){return this._singlePromiseFactory.create(5,t,(i,a)=>{!function(t,e,i,a){if(-1===t.indexOf("http")&&(t=S()+t),R[t])return i();if(e.id&&C[e.id])return a(new Error('There is already a script with ID "'+e.id+'"'));const n=s.start("load_"+e.id.replace(/-/g,"_")),o=document.createElement("script");o.async=!1,o.src=t,o.id=e.id,o.onload=()=>{R[t]=!0,C[e.id]=!0,s.end(n),Object.defineProperty(i,"name",{value:"resolve-"+e.id}),i()},o.onerror=t=>{a(t)},document.body.appendChild(o)}(t,e,i,a)})}loadScripts(t){const e=[];return t.forEach(t=>{let i=this.fetch(t.name,{id:t.id});e.push(i)}),Promise.all(e)}cleanUp(){for(let t in C)if(C.hasOwnProperty(t)){const e=document.getElementById(t);e&&e.parentElement.removeChild(e)}R={},C={}}}return n([o],t.prototype,"_singlePromiseFactory",void 0),t})());const A={MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu"};class D{constructor(t,e,i,s,a){this.position=t,this.positionRelative=e,this.type=i,this.rotation=s,this.event=a}}const k=t("i",5*window.devicePixelRatio),H=3*window.devicePixelRatio;t("I",(()=>{class t extends x{constructor(t){super(),this._debug=!1,this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(A).map(t=>A[t]),this._creator_=t,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}enableDragIn(t){this._setState(1),this._dragEnabled=!0,t&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=t.currentTarget||t.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&t instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):t.dataTransfer&&t.dataTransfer.setData&&t.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=t=>{t=t||window.event,this._firefoxDragPosition.x=t.pageX,this._firefoxDragPosition.y=t.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(t){let e=t,i=null,s=null;window.TouchEvent&&t instanceof TouchEvent?(i=this._getTouchPosition(e),s=this._getTouchPositionRelative(e)):(i=this._getMousePosition(e),s=this._getMousePositionRelative(e)),i.x>0&&i.y>0&&this._move(i,s)}_dragE(t){let e=t;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&t instanceof TouchEvent?this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2):this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}addEvents(t){this._events.forEach(e=>t.addEventListener(e,this,!1))}removeEvents(t){this._events.forEach(e=>t.removeEventListener(e,this,!1))}_move2(t){if(this._lastTouchEvent&&t.timeStamp-this._lastTouchEvent.timeStamp<16)return;const e=t.touches[0],i=t.touches[1],s=e.pageX-i.pageX,a=e.pageY-i.pageY,n=Math.abs(s)+Math.abs(a);this._pinchDistance>-1&&(n>this._pinchDistance+H?(this._setState(3),this.dispatchEvent(7,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<this._pinchDistance-H?(this._setState(3),this.dispatchEvent(8,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<=this._pinchDistance+H&&n>=this._pinchDistance-H&&(this._setState(5),this.dispatchEvent(11,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t))))),this._pinchDistance=n,this._lastTouchEvent=t}_setState(t){this._state=t}_move(t,e,i,s){void 0===i&&(i=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(i)&&(this._delta=this._getDelta(t),this._delta>k&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new D(t,e)))),2===this._state&&this.dispatchEvent(1,new D(t,e)),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(6,new D(t,e,i,null,s))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new D(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new D(this._downPosition,this._downPositionRelative))}_onUp(t,e,i){this.dispatchEvent(4,new D(t,e,i)),this._getDelta(t)<=k&&this.dispatchEvent(5,new D(t,e)),2===this._state&&this.dispatchEvent(2,new D(t,e)),4===this._state&&(this.dispatchEvent(10,new D(t,e)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(t){if(t.touches.length){let{clientX:e,clientY:i}=t.touches[0];if(t.touches.length>1){const s=t.touches[1],a=s.clientX,n=s.clientY;e=(e+a)/2,i=(i+n)/2}return{x:e,y:i}}const e=t.changedTouches[0];return{x:e.clientX,y:e.clientY}}_getTouchPositionRelative(t){const e=this._boundingClientRect,{clientWidth:i,clientHeight:s}=this._domHelper.element;if(t.touches.length){const{clientX:a,clientY:n}=t.touches[0];return{x:(a-e.left)/i*2-1,y:-(n-e.top)/s*2+1}}const a=t.changedTouches[0];return{x:(a.clientX-e.left)/i*2-1,y:-(a.clientY-e.top)/s*2+1}}_getMousePosition(t){if(0!==t.clientX&&0!==t.clientY)return{x:t.clientX,y:t.clientY};{let{x:e,y:i}=this._getFireFoxMousePosition(t);return{x:e,y:i}}}_getFireFoxMousePosition(t){let{x:e,y:i}=this._domHelper.getClientDimensions();return{x:e-(e+t.offsetX),y:i-(i+t.offsetY)}}_getMousePositionRelative(t){const e=this._boundingClientRect;return 0!==t.clientX&&0!==t.clientY?{x:(t.clientX-e.left)/this._domHelper.element.clientWidth*2-1,y:-(t.clientY-e.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-e.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-e.top)/this._domHelper.element.clientHeight*2+1}:(console.trace("this should not happen"),{x:0,y:0})}_getDelta(t){return Math.abs(this._downPosition.y-t.y)+Math.abs(this._downPosition.x-t.x)}setDragEnabled(t){this._dragEnabled=t}handleEvent(t){switch(this._debug&&t.type,t.type){case A.MOUSE_MOVE:this._onMouseMove(t);break;case A.MOUSE_DOWN:this._onMouseDown(t);break;case A.MOUSE_UP:this._onMouseUp(t);break;case A.MOUSE_LEAVE:this._onMouseLeave(t);break;case A.MOUSE_ENTER:this._onMouseEnter(t);break;case A.MOUSE_WHEEL:this._onMouseWheel(t);break;case A.TOUCH_MOVE:this._onTouchMove(t);break;case A.TOUCH_START:this._onTouchStart(t);break;case A.TOUCH_END:this._onTouchEnd(t);break;case A.CONTEXT_MENU:this._onContextMenu(t)}}_onMouseDown(t){t.preventDefault();let{x:e,y:i}=this._getMousePosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getMousePositionRelative(t),this.dispatchEvent(3,new D({x:e,y:i},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(t){t.preventDefault(),this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}_onMouseMove(t){t.preventDefault(),this._move(this._getMousePosition(t),this._getMousePositionRelative(t),1,t)}_onMouseLeave(t){this._delta=-1,this._onMouseUp(t)}_onMouseEnter(t){t.preventDefault()}_onMouseWheel(t){if(this._lastMouseWheelEvent&&t.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return t.preventDefault(),void t.stopPropagation();t.deltaY<0?this.dispatchEvent(7,new D(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)):this.dispatchEvent(8,new D(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)),this._lastMouseWheelEvent=t}_onTouchMove(t){if(t.preventDefault(),!this._dragTarget)if(1===t.touches.length)this._move(this._getTouchPosition(t),this._getTouchPositionRelative(t),2);else if(2===t.touches.length)if(this._elementHit||4===this._state){const e=t.touches[0],i=t.touches[1];let s={x:e.pageX,y:e.pageY},a={x:i.pageX,y:i.pageY};const n=d(c(s,a));this._rotationAngle<0&&(this._rotationAngle=n);const o=n-this._rotationAngle;this._rotationAngle=n,this.dispatchEvent(9,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t),2,h(o))),this._setState(4)}else this._move2(t)}_onTouchStart(t){if(t.preventDefault(),1===t.touches.length){let{x:e,y:i}=this._getTouchPosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getTouchPositionRelative(t),this.dispatchEvent(3,new D({x:e,y:i},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===t.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2),this._setState(3))}_onTouchEnd(t){t.preventDefault(),t.touches.length>1&&5===this._state||3===this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2)}_onContextMenu(t){t.preventDefault()}_canDrag(t){return this._dragEnabled}onElementHit(){this._elementHit=!0}updateSize(){this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}}return n([o],t.prototype,"_domHelper",void 0),t})());var L=t("P","static/PhotoStudioRoom-5b94763849f82256.glb");class O{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new THREE.Object3D),this._cameraContainer}}t("L",O),t("D",(()=>{class t extends O{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new THREE.Vector3;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{t.lights||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(b).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new THREE.Vector3;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=u();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof THREE.SpotLight&&this._addSpotLightToGUI(t,e),e instanceof THREE.AmbientLight&&this._addAmbientLightToGUI(t,e),e instanceof THREE.DirectionalLight&&this._addDirectionalLightToGUI(t,e),e instanceof THREE.RectAreaLight&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new THREE.Color(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}}return n([o],t.prototype,"_dynamicLightSettingLoader",void 0),t})());class B{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}let Q=t("G",(()=>{class t extends B{constructor(t,e){super(t,e),this._gltfLoaderPromise=this._scriptLoader.fetch(g,{id:"gltf-loader-js"}).then(()=>{this._gltfLoader=new THREE.GLTFLoader})}needsBounds(){return!0}needsCamera(){return!0}updateBounds(t){if(super.updateBounds(t),this._backgroundMesh){let e=Math.max(t.x,t.z)/6;e=Math.max(e,1),this._backgroundMesh.scale.copy(new THREE.Vector3(e,e,e))}}updateCamera(t){if(this._backgroundMesh){let e=t.getWorldDirection(new THREE.Vector3);e.y=0,e.lengthSq()<.01&&(e=new THREE.Vector3(0,1,0),e.applyQuaternion(t.quaternion),e.y=0),e.multiplyScalar(-1),e.normalize();let i=Math.asin(e.x);e.z<0&&(i=Math.PI-i),this._backgroundMesh.rotation.set(0,i,0)}}addToScene(){this._scene&&this._backgroundMesh&&this._scene.add(this._backgroundMesh)}removeFromScene(){this._scene&&this._backgroundMesh&&this._scene.remove(this._backgroundMesh)}loadBackground(t,e){this._backgroundMaterial=e,this._backgroundMaterial||(this._backgroundMaterial=new THREE.MeshBasicMaterial),this._gltfLoaderPromise.then(()=>{this._gltfLoader.load(t,this._onBackgroundLoaded.bind(this),t=>{},t=>{console.error(t)})})}_onBackgroundLoaded(t){this._scene&&(this._backgroundMaterial.vertexColors=!0,t&&t.scene&&t.scene.children&&t.scene.children.length>0&&(t.scene.children[0].material=this._backgroundMaterial,t.scene.children[0].layers.set(2),t.scene.position.copy(new THREE.Vector3(0,0,0)),this._backgroundMesh=t.scene,this._backgroundMesh.layers.set(2),this._backgroundMesh.receiveShadow=!0,m(this._backgroundMesh,!0,!1),this.removeFromScene(),this.addToScene()))}showGUI(){console.warn("gui not implemented for gltf environment")}}return n([o],t.prototype,"_scriptLoader",void 0),t})());const I={enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightSolidAngle:40,yPosition:0};class z extends B{constructor(t,e){super(t,e),this._pixotronGuard=new p,this._params=Object.assign(I,{lightDirection:new THREE.Vector3(0,1,.5),onComplete:this._addGroundShadows.bind(this),onProgress:this._progressCallback.bind(this)})}_progressCallback(t){}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}setPixotron(t,e,i,s){t&&(this._pixotron=t,this._renderer=e,this._camera=i,this._shadowBaker||(this._shadowBaker=new window.PIXOTRON.PlaneShadowBakePass(Object.assign(this._params,s))),this._shadowBaker.enable?this._shadowBaker.startBake(this._renderer,this._scene,this._camera):this._shadowBaker.enable=!0,this._wasAAEnabled=this._pixotron.enableAA,this._pixotronGuard.resolve())}async _addGroundShadows(){await this._pixotronGuard.wait(),this._pixotron.needsUpdate=!0,this._shadowPlane=this._shadowBaker.getShadowPlane(),this._shadowPlane.name="Shadow plane",this._shadowPlane.receiveShadow=!1,0!==this._params.yPosition&&(this._shadowPlane.position.y=this._params.yPosition),this._shadowPlane.visible=!0,this.addToScene(),this._loadedCallback&&this._loadedCallback()}setLoadedCallback(t){this._loadedCallback=t}update(){const t=this._getNumberOfChildren();this._bake(),this._sceneChildren=t}updateBounds(t,e){const i=this._getNumberOfChildren();return!(w(this._bounds,t,1e-4)&&this._scene&&i===this._sceneChildren&&!e||(super.updateBounds(t),this._bake(),this._sceneChildren=i,0))}_bake(){this._pixotronGuard.wait().then(()=>{this._shadowPlane&&(this._shadowPlane.visible=!1),this._shadowBaker.startBake(this._renderer,this._scene,this._camera)})}_getNumberOfChildren(){let t=0;return this._scene.traverse(e=>{"Shadow plane"!==e.name&&t++}),t}addToScene(){this._scene&&this._shadowPlane&&(this._shadowPlane.material.needsUpdate=!0,E(this._shadowPlane),this._scene.add(this._shadowPlane))}removeFromScene(){this._shadowPlane&&(this._scene.remove(this._shadowPlane),this._pixotron&&(this._pixotron.enableAA=this._wasAAEnabled))}showGUI(){}}t("B",z);class U{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new THREE.Object3D,this._plane.rotation.x=-Math.PI/2;const e=new THREE.MeshStandardMaterial;this._innerPlaneMesh=new THREE.Mesh,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new THREE.Mesh,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new THREE.Shape;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new THREE.Shape;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const a=new THREE.Path;a.moveTo(-t/2,-t/2),a.lineTo(-t/2,t/2),a.lineTo(t/2,t/2),a.lineTo(t/2,-t/2),a.lineTo(-t/2,-t/2),s.holes.push(a);const n=new THREE.ShapeBufferGeometry(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=n;const o=new THREE.ShapeBufferGeometry(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const h=n.attributes.uv.clone();n.setAttribute("uv2",h);const r=n.attributes.uv2.array;for(let t=0;t<r.length;++t)r[t]+=.5}}let V=t("F",(()=>{class t extends z{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new U(100),this._fog=i||!1,this._textureLoader=new THREE.TextureLoader,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new THREE.Vector3(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new THREE.Fog(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new THREE.Color(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=THREE.RepeatWrapping,this._floorTexture.wrapT=THREE.RepeatWrapping,this._floorTexture.repeat.set(100/t,100/e));let i=new THREE.MeshStandardMaterial({map:this._floorTexture,side:THREE.DoubleSide});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&(this._shadowPlane&&(this._bakedShadowPlane.updateSize(this._shadowPlane.scale.x),this._bakedShadowPlane.getRootNode().position.copy(this._shadowPlane.position),this._bakedShadowPlane.getInnerPlane().material.aoMap=this._shadowPlane.material.aoMap),this._scene.add(this._bakedShadowPlane.getRootNode()))}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,s)=>{this._floorMaterial=P(t,this._environmentLoader),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let a=[];t.forEach(t=>{a.push(y(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(a).then(()=>{setTimeout(()=>i(),0)},s)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=u();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}return n([o],t.prototype,"_rapiAccess",void 0),n([o],t.prototype,"_dataSyncer",void 0),n([o],t.prototype,"_environmentLoader",void 0),t})());class N extends z{constructor(t,e,i,s,a){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&a){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+a+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){super.addToScene(),this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"),this._pixotron&&(this._pixotron.enableAA=!1))}removeFromScene(){super.removeFromScene(),this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}}t("a",N),t("c",(()=>{class t{parse(t,e,i,s){let a=JSON.parse(s);return a.environment?this.load(t,e,i,a):null}load(t,e,i,s){let a,n=s.environment;if(!n)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(n.type){case"color":a=new Promise(e=>e(new N(t,i,new THREE.Color(n.details.color))));break;case"image":a=new Promise(s=>s(new N(t,i,null,e,n.details.imageUrl)));break;case"gltf":a=new Promise(e=>{let s=new Q(t,i);s.loadBackground(S()+L),e(s)});break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(n.details.material).then(s=>{let a=void 0===n.details.fog||n.details.fog,o=new V(t,i,a);o.changeFloorMaterial(s).then(()=>{e(o)})})});break;case"baked_shadow":a=new Promise(s=>{n.details&&n.details.color?s(new N(t,i,new THREE.Color(n.details.color))):n.details&&n.details.imageUrl?s(new N(t,i,null,e,n.details.imageUrl)):s(new z(t,i))});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}return n([o],t.prototype,"_rapiAccess",void 0),t})());class F{constructor(){this._settings=new window.PIXOTRON.QualitySettings(5),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class G{constructor(){this._settings=new window.PIXOTRON.QualitySettings(4),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class X{constructor(){this._settings=new window.PIXOTRON.QualitySettings(3),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class j{constructor(){this._settings=new window.PIXOTRON.QualitySettings(2),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class W{constructor(){this._settings=new window.PIXOTRON.QualitySettings(1),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class Y{constructor(){this._settings=new window.PIXOTRON.QualitySettings(0),this._settings.enableAA=!1,this._settings.useAreaLight=!1,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}t("b",class{constructor(t){this._sceneBoundingSphere=new THREE.Sphere,this._pixotron=t,this._initializeQualitySettings(),this._initializeQualityAdapters()}getPixotronInstance(t){const e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,bias:.02,accumulative:!1},shadowparams:{shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:100,side:THREE.FrontSide}};return t=t||e,new window.PIXOTRON.Pixotron(t)}showGUI(){let t=u();if(!t)return;let e=t.addFolder("Renderer");e.add(this._pixotron.getSAOPass(),"enabled"),this._pixotron.getSAOPass().smoothTransition&&e.add(this._pixotron.getSAOPass(),"smoothTransition"),e.add(this._pixotron.getSAOPass(),"occlusionWorldRadius").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoRadius(t)}),e.add(this._pixotron.getSAOPass(),"intensity").min(.1).max(2).step(.05),e.add(this._pixotron.getSAOPass(),"bias").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoBias(t)}),this._pixotron.getSAOPass().numSamples&&e.add(this._pixotron.getSAOPass(),"numSamples").min(10).max(3e3).step(10),void 0!==this._pixotron.getShadowPass().enabled&&e.add(this._pixotron.getShadowPass(),"enabled"),e.add(this._pixotron.getShadowPass(),"smoothTransition"),e.add(this._pixotron.getShadowPass(),"enableAccumulation"),e.add(this._pixotron.getShadowPass(),"shadowRadius").min(0).max(5).step(.1),e.add(this._pixotron.getShadowPass(),"shadowBiasMultiplier").min(0).max(3).step(.01),e.add(this._pixotron.getShadowPass(),"numSamples").min(10).max(3e3).step(10)}updateBounds(t){this._sceneBoundingSphere.copy(t);const e=.25*this._getMaxSaoRadius();this._adjustSaoRadius(e);const i=2*this._getMinSaoBias();this._adjustSaoBias(i)}_getSaoRadius(){return this._sceneBoundingSphere.radius}_adjustSaoRadius(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoRadius(),s=this._getMaxSaoRadius();e.occlusionWorldRadius=Math.min(Math.max(t,i),s)}_adjustSaoBias(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoBias(),s=this._getMaxSaoBias();e.bias=Math.min(Math.max(t,i),s)}_getMinSaoRadius(){return.001*this._getSaoRadius()}_getMaxSaoRadius(){return.6*this._getSaoRadius()}_getMinSaoBias(){return.001*this._getSaoRadius()}_getMaxSaoBias(){return.01*this._getSaoRadius()}updatePixelRatio(t){const e=new THREE.Vector2;t.getDrawingBufferSize(e),this._pixotron.setSize(Math.floor(e.width),Math.floor(e.height))}getHighPixelRatioQualitySetting(){return this._highPixelRatioQualitySetting.getSettings()}getLowestQualitySetting(){return this._lowQualitySetting.getSettings()}_initializeQualitySettings(){this._highestQualitySetting=new G,this._highPixelRatioQualitySetting=new F,this._highQualitySetting=new X,this._midQualitySetting=new j,this._lowQualitySetting=new W,this._lowestQualitySetting=new Y}_initializeQualityAdapters(){this._autoQualityAdapter=new window.PIXOTRON.AutoQualityAdapter(this._pixotron),this._autoQualityAdapter.addQuality(this._highestQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._highQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._midQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowestQualitySetting.getSettings()),this._autoQualityAdapter.setDesiredFps(20),this._manualQualityAdapter=new window.PIXOTRON.ManualQualityAdapter(this._pixotron)}onAutoQualityChange(t){this._autoQualityAdapter.onQualityChange(t)}onManualQualityChange(t){this._manualQualityAdapter.onQualityChange(t)}getAutoAdapter(){return this._autoQualityAdapter}lockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().lock()}unLockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().unLock()}enablePixotronAutoQuality(){this._currentQualityAdapter||(this._currentQualityAdapter=this._autoQualityAdapter,this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStarts(){this._currentQualityAdapter&&(this._currentQualityAdapter=this._autoQualityAdapter,this._currentQualitySetting&&(this._manualQualityAdapter.setQualitySetting(this._currentQualitySetting),this._pixotron.setQualityAdapter(this._manualQualityAdapter)),this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStops(){this._currentQualityAdapter&&(this._currentQualitySetting=this._currentQualityAdapter.getCurrentQualitySetting(),this._currentQualityAdapter=this._manualQualityAdapter,this._pixotron.setQualityAdapter(this._manualQualityAdapter),this._manualQualityAdapter.setQualitySetting(this._highestQualitySetting.getSettings()))}}),t("g","static/pi.min-0272f873b3a4380a.js"),t("e",["static/CopyShader-cde53240fcc3e06e.js","static/EffectComposer-1e936e5d03ff43cc.js","static/RenderPass-bc5df3810a01b2c6.js","static/ShaderPass-31f36160e0ea282d.js","static/LuminosityHighPassShader-dd5826656142421d.js","static/OutlinePass-f4bcd337cdd89b8d.js","static/RectAreaLightUniformsLib-4b74882185efd473.js","static/GammaCorrectionShader-b3b56f244f0d1e0e.js"])}}}));
2
- //# sourceMappingURL=pixotron-ec9a72e0.nomodule.js.map
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-65dbda00.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js"],(function(t){var e,i,s,a,n,o,h,r,_,l,d,c,u,g,m,p,w,E,P,y,v,S,b;return{setters:[function(t){e=t.g},function(t){i=t.s,s=t.B,a=t.I,n=t._,o=t.i,h=t.t,r=t.u,_=t.v,l=t.w,d=t.x,c=t.y,u=t.h,g=t.G,m=t.z,p=t.F,w=t.H,E=t.J,P=t.K,y=t.N},function(t){v=t.d,S=t.g,b=t.h}],execute:function(){t("f","static/dat.gui.min-b5cbb61e5c62f0bf.js"),t("T","static/Tween-d024b02fe34f25ab.js"),t("M",class{constructor(t){this._context=t||i.getContext(this.getContextName()),s.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){i.setup(a);const t=e();this.lookup("global-init-data").setOverrides(t),this.lookup("init-data",this._context).setOverrides(t)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const t in window.THREE)if(window.THREE.hasOwnProperty(t))try{delete window.THREE[t]}catch(t){console.error(t)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(t){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(t),this.setupDependencies(),this.bootFinished()}lookup(t,e){return window.__RML__DI__.lookup(t,e)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(t){t&&this.lookup("dom-helper",this._context).setDomElement(t),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),i.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}});class x{constructor(){this._listeners={}}_addEventListener(t,e,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push({callback:e,scope:i})}addEventListener(t,e,i){this._addEventListener(t,e,i)}dispatchEvent(t,e){if(!this._listeners[t])return;const i=this._listeners[t];let s=i.length;for(let t=0;t<s;t++){const s=i[t];e?s.callback.apply(s.scope,[e]):s.callback.call(s.scope)}}removeEventListener(t,e){const i=this._listeners[t];if(i)for(let t=0,s=i.length;t<s;t++)if(i[t].callback===e)return void i.splice(t,1)}}t("E",x);const T=t("h",10);let f=t("d",(()=>{class t extends x{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=h(T),this._yaw=h(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new THREE.Vector3,this._targetPosition=new THREE.Vector3,i?this._cameraPosition.copy(i):this._cameraPosition=new THREE.Vector3(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=v(this._dispatchCameraIdle.bind(this),16)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||r(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,this._dispatchCameraIdle(),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this._getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_areEqual(t,e){return t.yaw.toFixed(5)===e.yaw.toFixed(5)&&t.pitch.toFixed(5)===e.pitch.toFixed(5)&&t.distance.toFixed(5)===e.distance.toFixed(5)&&t.targetX===e.targetX&&t.targetY===e.targetY&&t.targetZ===e.targetZ}_tweenCameraParameter(t,e,i){return new Promise(i=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._update(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}).onComplete(()=>{this.dispatchEvent(2,3),this._tweenEnd=null,i()}).start(),this.dispatchEvent(0,3)}})}_getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new THREE.Vector3(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof THREE.PerspectiveCamera&&e>i.far&&(i.far=e+1)}}return n([o],t.prototype,"_domHelper",void 0),n([o],t.prototype,"_initData",void 0),t})());class M{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}t("C",class extends f{constructor(t,e,i,s){super(t,e,i),this._bounds=new THREE.Vector3,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=h(0),this.maxPolarAngle=h(85),this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new THREE.Vector3(0,0,0));const{cameraRestriction:a,zoomDistance:n,minVerticalCameraAngle:o,maxVerticalCameraAngle:r,minHorizontalCameraAngle:_,maxHorizontalCameraAngle:l}=this._initData;if(n&&(this._zoomDistance=n/100),void 0!==o&&(this.minPolarAngle=h(o<0?o:-1*o)),void 0!==r&&(this.maxPolarAngle=h(r)),void 0!==_&&(this.minAzimuthAngle=h(_<0?_:-1*_)),void 0!==l&&(this.maxAzimuthAngle=h(l)),void 0!==a){let t=Math.abs(h(a));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,h(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}_initCamera(){this._camera=new THREE.PerspectiveCamera,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),a=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*a,s.y=s.y+e.y/i.clientHeight*a,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),_(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),_(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}setBounds(t){this._boundingBox=t}zoomToFitBounds(t){this.setBounds(t);const e=t.getSize(new THREE.Vector3);if(this._initData.debug||e.x+e.y+e.z===0)return;const i=this._getCurrentCameraParameters(),s=t.getCenter(new THREE.Vector3);this._targetPosition=new THREE.Vector3(s.x,s.y,s.z);const a=this._setDistanceAndRangesBasedOnBounds(e);this._distance=a,this._checkZoomDistance(t,a),this._tweenCameraParameter(i,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const a=t.getCenter(new THREE.Vector3);this._targetPosition=s?s.clone():new THREE.Vector3(a.x,a.y,a.z);const n=this._getCurrentCameraParameters(),o=t.getSize(new THREE.Vector3);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(n,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new THREE.Sphere);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const i=this._domHelper.getClientDimensions(),s=i.x,a=i.y,n=this._camera.offset?s-s*this._camera.offset.left-s*(1-this._camera.offset.right):s,o=this._camera.offset?a-a*this._camera.offset.bottom-a*(1-this._camera.offset.top):a;this._bounds.copy(t);const{cameraSpacing:h}=this._initData;t.addScalar(h/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const r=Math.max(t.x,t.y),{x:_,y:d}=this._getMargin(n,o),c=l(t.x+_,t.y+d,t.z,this._camera.fov,n,o);return this._distance<c&&e&&(this._distance=c),this.maxDistance=c+r,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),c}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,a=!0){const n=t.getSize(new THREE.Vector3);if(n){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new THREE.Vector3);this._targetPosition.copy(e)}const o=this._getCurrentCameraParameters();if(i||(i=-30),s||(s=T),this._pitch=h(s),this._yaw=h(i),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(n),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(n);this._setDistanceAndRangesBasedOnBounds(n);let r=this._targetPosition.clone();a?this._tweenCameraParameter(o,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:r.x,targetY:r.y,targetZ:r.z},!0):this._update(this._targetPosition)}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,a,n=!0){const o=new THREE.Vector3(-t.x/2,0,-t.z/2),r=new THREE.Vector3(t.x/2,t.y,t.z/2);if(this._boundingBox=new THREE.Box3(o,r),a&&t.addScalar(a),e?this._targetPosition.copy(e):this._targetPosition=new THREE.Vector3(0,t.y/2,0),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const _=this._getCurrentCameraParameters();i||(i=-30),s||(s=T),this._pitch=h(s),this._yaw=h(i),this._setDistanceAndRangesBasedOnBounds(t);let l=this._targetPosition.clone();n?this._tweenCameraParameter(_,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:l.x,targetY:l.y,targetZ:l.z},!0):this._update(this._targetPosition)}_update(t){this._initData.debug?this._pitch=Math.max(h(-89),Math.min(h(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const e=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX"),i=(new THREE.Quaternion).setFromEuler(e),s=new THREE.Vector3(0,0,-1);s.applyQuaternion(i),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const a=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(a),this._zoomChanged(!1,!1);else{const t=this._getCameraSphere(a);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(a),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0!==this._currentZoomHash.length&&this._currentZoomHash===i||(this.dispatchEvent(5,new M(t,e)),this._currentZoomHash=i),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t,e,i,s,a,n){return this._tweenCameraParameter(this._getCurrentCameraParameters(),{yaw:s,pitch:a,distance:2.725*l(t.x,t.y,t.z,this._camera.fov,e,i),targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new THREE.Sphere(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}_setCameraNear(){const t=Math.max(.1,this._distance/6);this._camera.near=t}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new THREE.Vector3(0,0,0))}async moveCamera(t){return this._tweenCameraParameter(this._getCurrentCameraParameters(),t,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}});let R={},C={};t("S",(()=>{class t{constructor(t){this._creator_=t}fetch(t,e){return this._singlePromiseFactory.create(5,t,(i,a)=>{!function(t,e,i,a){if(-1===t.indexOf("http")&&(t=S()+t),R[t])return i();if(e.id&&C[e.id])return a(new Error('There is already a script with ID "'+e.id+'"'));const n=s.start("load_"+e.id.replace(/-/g,"_")),o=document.createElement("script");o.async=!1,o.src=t,o.id=e.id,o.onload=()=>{R[t]=!0,C[e.id]=!0,s.end(n),Object.defineProperty(i,"name",{value:"resolve-"+e.id}),i()},o.onerror=t=>{a(t)},document.body.appendChild(o)}(t,e,i,a)})}loadScripts(t){const e=[];return t.forEach(t=>{let i=this.fetch(t.name,{id:t.id});e.push(i)}),Promise.all(e)}cleanUp(){for(let t in C)if(C.hasOwnProperty(t)){const e=document.getElementById(t);e&&e.parentElement.removeChild(e)}R={},C={}}}return n([o],t.prototype,"_singlePromiseFactory",void 0),t})());const A={MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu"};class D{constructor(t,e,i,s,a){this.position=t,this.positionRelative=e,this.type=i,this.rotation=s,this.event=a}}const k=t("i",5*window.devicePixelRatio),H=3*window.devicePixelRatio;t("I",(()=>{class t extends x{constructor(t){super(),this._debug=!1,this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(A).map(t=>A[t]),this._creator_=t,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}enableDragIn(t){this._setState(1),this._dragEnabled=!0,t&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=t.currentTarget||t.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&t instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):t.dataTransfer&&t.dataTransfer.setData&&t.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=t=>{t=t||window.event,this._firefoxDragPosition.x=t.pageX,this._firefoxDragPosition.y=t.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(t){let e=t,i=null,s=null;window.TouchEvent&&t instanceof TouchEvent?(i=this._getTouchPosition(e),s=this._getTouchPositionRelative(e)):(i=this._getMousePosition(e),s=this._getMousePositionRelative(e)),i.x>0&&i.y>0&&this._move(i,s)}_dragE(t){let e=t;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&t instanceof TouchEvent?this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2):this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}addEvents(t){this._events.forEach(e=>t.addEventListener(e,this,!1))}removeEvents(t){this._events.forEach(e=>t.removeEventListener(e,this,!1))}_move2(t){if(this._lastTouchEvent&&t.timeStamp-this._lastTouchEvent.timeStamp<16)return;const e=t.touches[0],i=t.touches[1],s=e.pageX-i.pageX,a=e.pageY-i.pageY,n=Math.abs(s)+Math.abs(a);this._pinchDistance>-1&&(n>this._pinchDistance+H?(this._setState(3),this.dispatchEvent(7,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<this._pinchDistance-H?(this._setState(3),this.dispatchEvent(8,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<=this._pinchDistance+H&&n>=this._pinchDistance-H&&(this._setState(5),this.dispatchEvent(11,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t))))),this._pinchDistance=n,this._lastTouchEvent=t}_setState(t){this._state=t}_move(t,e,i,s){void 0===i&&(i=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(i)&&(this._delta=this._getDelta(t),this._delta>k&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new D(t,e)))),2===this._state&&this.dispatchEvent(1,new D(t,e)),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(6,new D(t,e,i,null,s))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new D(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new D(this._downPosition,this._downPositionRelative))}_onUp(t,e,i){this.dispatchEvent(4,new D(t,e,i)),this._getDelta(t)<=k&&this.dispatchEvent(5,new D(t,e)),2===this._state&&this.dispatchEvent(2,new D(t,e)),4===this._state&&(this.dispatchEvent(10,new D(t,e)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(t){if(t.touches.length){let{clientX:e,clientY:i}=t.touches[0];if(t.touches.length>1){const s=t.touches[1],a=s.clientX,n=s.clientY;e=(e+a)/2,i=(i+n)/2}return{x:e,y:i}}const e=t.changedTouches[0];return{x:e.clientX,y:e.clientY}}_getTouchPositionRelative(t){const e=this._boundingClientRect,{clientWidth:i,clientHeight:s}=this._domHelper.element;if(t.touches.length){const{clientX:a,clientY:n}=t.touches[0];return{x:(a-e.left)/i*2-1,y:-(n-e.top)/s*2+1}}const a=t.changedTouches[0];return{x:(a.clientX-e.left)/i*2-1,y:-(a.clientY-e.top)/s*2+1}}_getMousePosition(t){if(0!==t.clientX&&0!==t.clientY)return{x:t.clientX,y:t.clientY};{let{x:e,y:i}=this._getFireFoxMousePosition(t);return{x:e,y:i}}}_getFireFoxMousePosition(t){let{x:e,y:i}=this._domHelper.getClientDimensions();return{x:e-(e+t.offsetX),y:i-(i+t.offsetY)}}_getMousePositionRelative(t){const e=this._boundingClientRect;return 0!==t.clientX&&0!==t.clientY?{x:(t.clientX-e.left)/this._domHelper.element.clientWidth*2-1,y:-(t.clientY-e.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-e.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-e.top)/this._domHelper.element.clientHeight*2+1}:(console.trace("this should not happen"),{x:0,y:0})}_getDelta(t){return Math.abs(this._downPosition.y-t.y)+Math.abs(this._downPosition.x-t.x)}setDragEnabled(t){this._dragEnabled=t}handleEvent(t){switch(this._debug&&t.type,t.type){case A.MOUSE_MOVE:this._onMouseMove(t);break;case A.MOUSE_DOWN:this._onMouseDown(t);break;case A.MOUSE_UP:this._onMouseUp(t);break;case A.MOUSE_LEAVE:this._onMouseLeave(t);break;case A.MOUSE_ENTER:this._onMouseEnter(t);break;case A.MOUSE_WHEEL:this._onMouseWheel(t);break;case A.TOUCH_MOVE:this._onTouchMove(t);break;case A.TOUCH_START:this._onTouchStart(t);break;case A.TOUCH_END:this._onTouchEnd(t);break;case A.CONTEXT_MENU:this._onContextMenu(t)}}_onMouseDown(t){t.preventDefault();let{x:e,y:i}=this._getMousePosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getMousePositionRelative(t),this.dispatchEvent(3,new D({x:e,y:i},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(t){t.preventDefault(),this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}_onMouseMove(t){t.preventDefault(),this._move(this._getMousePosition(t),this._getMousePositionRelative(t),1,t)}_onMouseLeave(t){this._delta=-1,this._onMouseUp(t)}_onMouseEnter(t){t.preventDefault()}_onMouseWheel(t){if(this._lastMouseWheelEvent&&t.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return t.preventDefault(),void t.stopPropagation();t.deltaY<0?this.dispatchEvent(7,new D(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)):this.dispatchEvent(8,new D(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)),this._lastMouseWheelEvent=t}_onTouchMove(t){if(t.preventDefault(),!this._dragTarget)if(1===t.touches.length)this._move(this._getTouchPosition(t),this._getTouchPositionRelative(t),2);else if(2===t.touches.length)if(this._elementHit||4===this._state){const e=t.touches[0],i=t.touches[1];let s={x:e.pageX,y:e.pageY},a={x:i.pageX,y:i.pageY};const n=d(c(s,a));this._rotationAngle<0&&(this._rotationAngle=n);const o=n-this._rotationAngle;this._rotationAngle=n,this.dispatchEvent(9,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t),2,h(o))),this._setState(4)}else this._move2(t)}_onTouchStart(t){if(t.preventDefault(),1===t.touches.length){let{x:e,y:i}=this._getTouchPosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getTouchPositionRelative(t),this.dispatchEvent(3,new D({x:e,y:i},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===t.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2),this._setState(3))}_onTouchEnd(t){t.preventDefault(),t.touches.length>1&&5===this._state||3===this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2)}_onContextMenu(t){t.preventDefault()}_canDrag(t){return this._dragEnabled}onElementHit(){this._elementHit=!0}updateSize(){this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}}return n([o],t.prototype,"_domHelper",void 0),t})());var L=t("P","static/PhotoStudioRoom-5b94763849f82256.glb");class O{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new THREE.Object3D),this._cameraContainer}}t("L",O),t("D",(()=>{class t extends O{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new THREE.Vector3;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{t.lights||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(b).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new THREE.Vector3;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=u();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof THREE.SpotLight&&this._addSpotLightToGUI(t,e),e instanceof THREE.AmbientLight&&this._addAmbientLightToGUI(t,e),e instanceof THREE.DirectionalLight&&this._addDirectionalLightToGUI(t,e),e instanceof THREE.RectAreaLight&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new THREE.Color(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}}return n([o],t.prototype,"_dynamicLightSettingLoader",void 0),t})());class B{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}let Q=t("G",(()=>{class t extends B{constructor(t,e){super(t,e),this._gltfLoaderPromise=this._scriptLoader.fetch(g,{id:"gltf-loader-js"}).then(()=>{this._gltfLoader=new THREE.GLTFLoader})}needsBounds(){return!0}needsCamera(){return!0}updateBounds(t){if(super.updateBounds(t),this._backgroundMesh){let e=Math.max(t.x,t.z)/6;e=Math.max(e,1),this._backgroundMesh.scale.copy(new THREE.Vector3(e,e,e))}}updateCamera(t){if(this._backgroundMesh){let e=t.getWorldDirection(new THREE.Vector3);e.y=0,e.lengthSq()<.01&&(e=new THREE.Vector3(0,1,0),e.applyQuaternion(t.quaternion),e.y=0),e.multiplyScalar(-1),e.normalize();let i=Math.asin(e.x);e.z<0&&(i=Math.PI-i),this._backgroundMesh.rotation.set(0,i,0)}}addToScene(){this._scene&&this._backgroundMesh&&this._scene.add(this._backgroundMesh)}removeFromScene(){this._scene&&this._backgroundMesh&&this._scene.remove(this._backgroundMesh)}loadBackground(t,e){this._backgroundMaterial=e,this._backgroundMaterial||(this._backgroundMaterial=new THREE.MeshBasicMaterial),this._gltfLoaderPromise.then(()=>{this._gltfLoader.load(t,this._onBackgroundLoaded.bind(this),t=>{},t=>{console.error(t)})})}_onBackgroundLoaded(t){this._scene&&(this._backgroundMaterial.vertexColors=!0,t&&t.scene&&t.scene.children&&t.scene.children.length>0&&(t.scene.children[0].material=this._backgroundMaterial,t.scene.children[0].layers.set(2),t.scene.position.copy(new THREE.Vector3(0,0,0)),this._backgroundMesh=t.scene,this._backgroundMesh.layers.set(2),this._backgroundMesh.receiveShadow=!0,m(this._backgroundMesh,!0,!1),this.removeFromScene(),this.addToScene()))}showGUI(){console.warn("gui not implemented for gltf environment")}}return n([o],t.prototype,"_scriptLoader",void 0),t})());const I={enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightSolidAngle:40,yPosition:0};class z extends B{constructor(t,e){super(t,e),this._pixotronGuard=new p,this._params=Object.assign(I,{lightDirection:new THREE.Vector3(0,1,.5),onComplete:this._addGroundShadows.bind(this),onProgress:this._progressCallback.bind(this)})}_progressCallback(t){}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}setPixotron(t,e,i,s){t&&(this._pixotron=t,this._renderer=e,this._camera=i,this._shadowBaker||(this._shadowBaker=new window.PIXOTRON.PlaneShadowBakePass(Object.assign(this._params,s))),this._shadowBaker.enable?this._shadowBaker.startBake(this._renderer,this._scene,this._camera):this._shadowBaker.enable=!0,this._wasAAEnabled=this._pixotron.enableAA,this._pixotronGuard.resolve())}async _addGroundShadows(){await this._pixotronGuard.wait(),this._pixotron.needsUpdate=!0,this._shadowPlane=this._shadowBaker.getShadowPlane(),this._shadowPlane.name="Shadow plane",this._shadowPlane.receiveShadow=!1,0!==this._params.yPosition&&(this._shadowPlane.position.y=this._params.yPosition),this._shadowPlane.visible=!0,this.addToScene(),this._loadedCallback&&this._loadedCallback()}setLoadedCallback(t){this._loadedCallback=t}update(){const t=this._getNumberOfChildren();this._bake(),this._sceneChildren=t}updateBounds(t,e){const i=this._getNumberOfChildren();return!(w(this._bounds,t,1e-4)&&this._scene&&i===this._sceneChildren&&!e||(super.updateBounds(t),this._bake(),this._sceneChildren=i,0))}_bake(){this._pixotronGuard.wait().then(()=>{this._shadowPlane&&(this._shadowPlane.visible=!1),this._shadowBaker.startBake(this._renderer,this._scene,this._camera)})}_getNumberOfChildren(){let t=0;return this._scene.traverse(e=>{"Shadow plane"!==e.name&&t++}),t}addToScene(){this._scene&&this._shadowPlane&&(this._shadowPlane.material.needsUpdate=!0,E(this._shadowPlane),this._scene.add(this._shadowPlane))}removeFromScene(){this._shadowPlane&&(this._scene.remove(this._shadowPlane),this._pixotron&&(this._pixotron.enableAA=this._wasAAEnabled))}showGUI(){}}t("B",z);class U{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new THREE.Object3D,this._plane.rotation.x=-Math.PI/2;const e=new THREE.MeshStandardMaterial;this._innerPlaneMesh=new THREE.Mesh,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new THREE.Mesh,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new THREE.Shape;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new THREE.Shape;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const a=new THREE.Path;a.moveTo(-t/2,-t/2),a.lineTo(-t/2,t/2),a.lineTo(t/2,t/2),a.lineTo(t/2,-t/2),a.lineTo(-t/2,-t/2),s.holes.push(a);const n=new THREE.ShapeBufferGeometry(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=n;const o=new THREE.ShapeBufferGeometry(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const h=n.attributes.uv.clone();n.setAttribute("uv2",h);const r=n.attributes.uv2.array;for(let t=0;t<r.length;++t)r[t]+=.5}}let V=t("F",(()=>{class t extends z{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new U(100),this._fog=i||!1,this._textureLoader=new THREE.TextureLoader,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new THREE.Vector3(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new THREE.Fog(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new THREE.Color(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=THREE.RepeatWrapping,this._floorTexture.wrapT=THREE.RepeatWrapping,this._floorTexture.repeat.set(100/t,100/e));let i=new THREE.MeshStandardMaterial({map:this._floorTexture,side:THREE.DoubleSide});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&(this._shadowPlane&&(this._bakedShadowPlane.updateSize(this._shadowPlane.scale.x),this._bakedShadowPlane.getRootNode().position.copy(this._shadowPlane.position),this._bakedShadowPlane.getInnerPlane().material.aoMap=this._shadowPlane.material.aoMap),this._scene.add(this._bakedShadowPlane.getRootNode()))}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,s)=>{this._floorMaterial=P(t,this._environmentLoader),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let a=[];t.forEach(t=>{a.push(y(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(a).then(()=>{setTimeout(()=>i(),0)},s)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=u();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}return n([o],t.prototype,"_rapiAccess",void 0),n([o],t.prototype,"_dataSyncer",void 0),n([o],t.prototype,"_environmentLoader",void 0),t})());class N extends z{constructor(t,e,i,s,a){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&a){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+a+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){super.addToScene(),this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"),this._pixotron&&(this._pixotron.enableAA=!1))}removeFromScene(){super.removeFromScene(),this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}}t("a",N),t("c",(()=>{class t{parse(t,e,i,s){let a=JSON.parse(s);return a.environment?this.load(t,e,i,a):null}load(t,e,i,s){let a,n=s.environment;if(!n)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(n.type){case"color":a=new Promise(e=>e(new N(t,i,new THREE.Color(n.details.color))));break;case"image":a=new Promise(s=>s(new N(t,i,null,e,n.details.imageUrl)));break;case"gltf":a=new Promise(e=>{let s=new Q(t,i);s.loadBackground(S()+L),e(s)});break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(n.details.material).then(s=>{let a=void 0===n.details.fog||n.details.fog,o=new V(t,i,a);o.changeFloorMaterial(s).then(()=>{e(o)})})});break;case"baked_shadow":a=new Promise(s=>{n.details&&n.details.color?s(new N(t,i,new THREE.Color(n.details.color))):n.details&&n.details.imageUrl?s(new N(t,i,null,e,n.details.imageUrl)):s(new z(t,i))});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}return n([o],t.prototype,"_rapiAccess",void 0),t})());class F{constructor(){this._settings=new window.PIXOTRON.QualitySettings(5),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class G{constructor(){this._settings=new window.PIXOTRON.QualitySettings(4),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class X{constructor(){this._settings=new window.PIXOTRON.QualitySettings(3),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class j{constructor(){this._settings=new window.PIXOTRON.QualitySettings(2),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class W{constructor(){this._settings=new window.PIXOTRON.QualitySettings(1),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class Y{constructor(){this._settings=new window.PIXOTRON.QualitySettings(0),this._settings.enableAA=!1,this._settings.useAreaLight=!1,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}t("b",class{constructor(t){this._sceneBoundingSphere=new THREE.Sphere,this._pixotron=t,this._initializeQualitySettings(),this._initializeQualityAdapters()}getPixotronInstance(t){const e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,bias:.02,accumulative:!1},shadowparams:{shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:100,side:THREE.FrontSide}};return t=t||e,new window.PIXOTRON.Pixotron(t)}showGUI(){let t=u();if(!t)return;let e=t.addFolder("Renderer");e.add(this._pixotron.getSAOPass(),"enabled"),this._pixotron.getSAOPass().smoothTransition&&e.add(this._pixotron.getSAOPass(),"smoothTransition"),e.add(this._pixotron.getSAOPass(),"occlusionWorldRadius").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoRadius(t)}),e.add(this._pixotron.getSAOPass(),"intensity").min(.1).max(2).step(.05),e.add(this._pixotron.getSAOPass(),"bias").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoBias(t)}),this._pixotron.getSAOPass().numSamples&&e.add(this._pixotron.getSAOPass(),"numSamples").min(10).max(3e3).step(10),void 0!==this._pixotron.getShadowPass().enabled&&e.add(this._pixotron.getShadowPass(),"enabled"),e.add(this._pixotron.getShadowPass(),"smoothTransition"),e.add(this._pixotron.getShadowPass(),"enableAccumulation"),e.add(this._pixotron.getShadowPass(),"shadowRadius").min(0).max(5).step(.1),e.add(this._pixotron.getShadowPass(),"shadowBiasMultiplier").min(0).max(3).step(.01),e.add(this._pixotron.getShadowPass(),"numSamples").min(10).max(3e3).step(10)}updateBounds(t){this._sceneBoundingSphere.copy(t);const e=.25*this._getMaxSaoRadius();this._adjustSaoRadius(e);const i=2*this._getMinSaoBias();this._adjustSaoBias(i)}_getSaoRadius(){return this._sceneBoundingSphere.radius}_adjustSaoRadius(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoRadius(),s=this._getMaxSaoRadius();e.occlusionWorldRadius=Math.min(Math.max(t,i),s)}_adjustSaoBias(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoBias(),s=this._getMaxSaoBias();e.bias=Math.min(Math.max(t,i),s)}_getMinSaoRadius(){return.001*this._getSaoRadius()}_getMaxSaoRadius(){return.6*this._getSaoRadius()}_getMinSaoBias(){return.001*this._getSaoRadius()}_getMaxSaoBias(){return.01*this._getSaoRadius()}updatePixelRatio(t){const e=new THREE.Vector2;t.getDrawingBufferSize(e),this._pixotron.setSize(Math.floor(e.width),Math.floor(e.height))}getHighPixelRatioQualitySetting(){return this._highPixelRatioQualitySetting.getSettings()}getLowestQualitySetting(){return this._lowQualitySetting.getSettings()}_initializeQualitySettings(){this._highestQualitySetting=new G,this._highPixelRatioQualitySetting=new F,this._highQualitySetting=new X,this._midQualitySetting=new j,this._lowQualitySetting=new W,this._lowestQualitySetting=new Y}_initializeQualityAdapters(){this._autoQualityAdapter=new window.PIXOTRON.AutoQualityAdapter(this._pixotron),this._autoQualityAdapter.addQuality(this._highestQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._highQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._midQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowestQualitySetting.getSettings()),this._autoQualityAdapter.setDesiredFps(20),this._manualQualityAdapter=new window.PIXOTRON.ManualQualityAdapter(this._pixotron)}onAutoQualityChange(t){this._autoQualityAdapter.onQualityChange(t)}onManualQualityChange(t){this._manualQualityAdapter.onQualityChange(t)}getAutoAdapter(){return this._autoQualityAdapter}lockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().lock()}unLockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().unLock()}enablePixotronAutoQuality(){this._currentQualityAdapter||(this._currentQualityAdapter=this._autoQualityAdapter,this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStarts(){this._currentQualityAdapter&&(this._currentQualityAdapter=this._autoQualityAdapter,this._currentQualitySetting&&(this._manualQualityAdapter.setQualitySetting(this._currentQualitySetting),this._pixotron.setQualityAdapter(this._manualQualityAdapter)),this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStops(){this._currentQualityAdapter&&(this._currentQualitySetting=this._currentQualityAdapter.getCurrentQualitySetting(),this._currentQualityAdapter=this._manualQualityAdapter,this._pixotron.setQualityAdapter(this._manualQualityAdapter),this._manualQualityAdapter.setQualitySetting(this._highestQualitySetting.getSettings()))}}),t("g","static/pi.min-0272f873b3a4380a.js"),t("e",["static/CopyShader-cde53240fcc3e06e.js","static/EffectComposer-1e936e5d03ff43cc.js","static/RenderPass-bc5df3810a01b2c6.js","static/ShaderPass-31f36160e0ea282d.js","static/LuminosityHighPassShader-dd5826656142421d.js","static/OutlinePass-f4bcd337cdd89b8d.js","static/RectAreaLightUniformsLib-4b74882185efd473.js","static/GammaCorrectionShader-b3b56f244f0d1e0e.js"])}}}));
2
+ //# sourceMappingURL=pixotron-4065f090.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pixotron-ec9a72e0.nomodule.js","sources":["../../packages/three-build/src/dat.gui.min.js","../../packages/three-build/src/Tween.js","../../packages/configurator-core/public/geometry/PhotoStudioRoom.glb","../../node_modules/pi/pi.min.js","../../node_modules/pi/js/shaders/CopyShader.js","../../node_modules/pi/js/postprocessing/EffectComposer.js","../../node_modules/pi/js/postprocessing/RenderPass.js","../../node_modules/pi/js/postprocessing/ShaderPass.js","../../node_modules/pi/js/shaders/LuminosityHighPassShader.js","../../node_modules/pi/js/postprocessing/OutlinePass.js","../../node_modules/pi/js/lights/RectAreaLightUniformsLib.js","../../node_modules/pi/js/shaders/GammaCorrectionShader.js"],"sourcesContent":["export default \"static/dat.gui.min-b5cbb61e5c62f0bf.js\"","export default \"static/Tween-d024b02fe34f25ab.js\"","export default \"static/PhotoStudioRoom-5b94763849f82256.glb\"","export default \"static/pi.min-0272f873b3a4380a.js\"","export default \"static/CopyShader-cde53240fcc3e06e.js\"","export default \"static/EffectComposer-1e936e5d03ff43cc.js\"","export default \"static/RenderPass-bc5df3810a01b2c6.js\"","export default \"static/ShaderPass-31f36160e0ea282d.js\"","export default \"static/LuminosityHighPassShader-dd5826656142421d.js\"","export default \"static/OutlinePass-f4bcd337cdd89b8d.js\"","export default \"static/RectAreaLightUniformsLib-4b74882185efd473.js\"","export default \"static/GammaCorrectionShader-b3b56f244f0d1e0e.js\""],"names":[],"mappings":"6aAAe,gDCAA,s6yBCAA,ghsBCAA,4CCAA,wCCAA,4CCAA,wCCAA,wCCAA,sDCAA,yCCAA,sDCAA"}
1
+ {"version":3,"file":"pixotron-4065f090.nomodule.js","sources":["../../packages/three-build/src/dat.gui.min.js","../../packages/three-build/src/Tween.js","../../packages/configurator-core/public/geometry/PhotoStudioRoom.glb","../../node_modules/pi/pi.min.js","../../node_modules/pi/js/shaders/CopyShader.js","../../node_modules/pi/js/postprocessing/EffectComposer.js","../../node_modules/pi/js/postprocessing/RenderPass.js","../../node_modules/pi/js/postprocessing/ShaderPass.js","../../node_modules/pi/js/shaders/LuminosityHighPassShader.js","../../node_modules/pi/js/postprocessing/OutlinePass.js","../../node_modules/pi/js/lights/RectAreaLightUniformsLib.js","../../node_modules/pi/js/shaders/GammaCorrectionShader.js"],"sourcesContent":["export default \"static/dat.gui.min-b5cbb61e5c62f0bf.js\"","export default \"static/Tween-d024b02fe34f25ab.js\"","export default \"static/PhotoStudioRoom-5b94763849f82256.glb\"","export default \"static/pi.min-0272f873b3a4380a.js\"","export default \"static/CopyShader-cde53240fcc3e06e.js\"","export default \"static/EffectComposer-1e936e5d03ff43cc.js\"","export default \"static/RenderPass-bc5df3810a01b2c6.js\"","export default \"static/ShaderPass-31f36160e0ea282d.js\"","export default \"static/LuminosityHighPassShader-dd5826656142421d.js\"","export default \"static/OutlinePass-f4bcd337cdd89b8d.js\"","export default \"static/RectAreaLightUniformsLib-4b74882185efd473.js\"","export default \"static/GammaCorrectionShader-b3b56f244f0d1e0e.js\""],"names":[],"mappings":"6aAAe,gDCAA,s6yBCAA,ghsBCAA,4CCAA,wCCAA,4CCAA,wCCAA,wCCAA,sDCAA,yCCAA,sDCAA"}
@@ -1,2 +1,2 @@
1
- import{g as getAllParameters}from"./query-params-helper-a271f9dc.js";import{s as RoomleDependencyInjection,B as Benchmark,I as INJECTABLES,_ as __decorate,i as inject,t as toRadiant,u as position3VectorsAreEqual,v as position2VectorsAreEqual,w as getIdealDistance,x as to360Degrees,y as getAngle,h as getGUI,G as GLTF_LOADER_FILE_NAME,z as setShadows,F as AsyncGuard,H as vectorIsEqual,J as fadeIn,K as createMaterial,N as addTexture}from"./rapi-access-cc4f78e4.js";import{d as debounce,g as getAssetPath,h as handleJsonResponse}from"./main-thread-to-worker-91bf9f5e.js";var DAT_GUI_FILE_NAME="static/dat.gui.min-b5cbb61e5c62f0bf.js",TWEEN_FILE_NAME="static/Tween-d024b02fe34f25ab.js";class Main{constructor(t){this._context=t||RoomleDependencyInjection.getContext(this.getContextName()),Benchmark.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){RoomleDependencyInjection.setup(INJECTABLES);const t=getAllParameters();this.lookup("global-init-data").setOverrides(t),this.lookup("init-data",this._context).setOverrides(t)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const t in window.THREE)if(window.THREE.hasOwnProperty(t))try{delete window.THREE[t]}catch(t){console.error(t)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(t){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(t),this.setupDependencies(),this.bootFinished()}lookup(t,e){return window.__RML__DI__.lookup(t,e)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(t){t&&this.lookup("dom-helper",this._context).setDomElement(t),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),RoomleDependencyInjection.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}}class EventDispatcher{constructor(){this._listeners={}}_addEventListener(t,e,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push({callback:e,scope:i})}addEventListener(t,e,i){this._addEventListener(t,e,i)}dispatchEvent(t,e){if(!this._listeners[t])return;const i=this._listeners[t];let s=i.length;for(let t=0;t<s;t++){const s=i[t];e?s.callback.apply(s.scope,[e]):s.callback.call(s.scope)}}removeEventListener(t,e){const i=this._listeners[t];if(i)for(let t=0,s=i.length;t<s;t++)if(i[t].callback===e)return void i.splice(t,1)}}const INITIAL_PITCH=10;let CameraControl=(()=>{class t extends EventDispatcher{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=toRadiant(10),this._yaw=toRadiant(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new THREE.Vector3,this._targetPosition=new THREE.Vector3,i?this._cameraPosition.copy(i):this._cameraPosition=new THREE.Vector3(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=debounce(this._dispatchCameraIdle.bind(this),16)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||position3VectorsAreEqual(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,this._dispatchCameraIdle(),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this._getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_areEqual(t,e){return t.yaw.toFixed(5)===e.yaw.toFixed(5)&&t.pitch.toFixed(5)===e.pitch.toFixed(5)&&t.distance.toFixed(5)===e.distance.toFixed(5)&&t.targetX===e.targetX&&t.targetY===e.targetY&&t.targetZ===e.targetZ}_tweenCameraParameter(t,e,i){return new Promise(i=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._update(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}).onComplete(()=>{this.dispatchEvent(2,3),this._tweenEnd=null,i()}).start(),this.dispatchEvent(0,3)}})}_getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new THREE.Vector3(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof THREE.PerspectiveCamera&&e>i.far&&(i.far=e+1)}}return __decorate([inject],t.prototype,"_domHelper",void 0),__decorate([inject],t.prototype,"_initData",void 0),t})();class ZoomChangeEvent{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}class CameraControl3D extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._bounds=new THREE.Vector3,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=toRadiant(0),this.maxPolarAngle=toRadiant(85),this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new THREE.Vector3(0,0,0));const{cameraRestriction:a,zoomDistance:n,minVerticalCameraAngle:o,maxVerticalCameraAngle:h,minHorizontalCameraAngle:r,maxHorizontalCameraAngle:_}=this._initData;if(n&&(this._zoomDistance=n/100),void 0!==o&&(this.minPolarAngle=toRadiant(o<0?o:-1*o)),void 0!==h&&(this.maxPolarAngle=toRadiant(h)),void 0!==r&&(this.minAzimuthAngle=toRadiant(r<0?r:-1*r)),void 0!==_&&(this.maxAzimuthAngle=toRadiant(_)),void 0!==a){let t=Math.abs(toRadiant(a));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,toRadiant(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}_initCamera(){this._camera=new THREE.PerspectiveCamera,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),a=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*a,s.y=s.y+e.y/i.clientHeight*a,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}setBounds(t){this._boundingBox=t}zoomToFitBounds(t){this.setBounds(t);const e=t.getSize(new THREE.Vector3);if(this._initData.debug||e.x+e.y+e.z===0)return;const i=this._getCurrentCameraParameters(),s=t.getCenter(new THREE.Vector3);this._targetPosition=new THREE.Vector3(s.x,s.y,s.z);const a=this._setDistanceAndRangesBasedOnBounds(e);this._distance=a,this._checkZoomDistance(t,a),this._tweenCameraParameter(i,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const a=t.getCenter(new THREE.Vector3);this._targetPosition=s?s.clone():new THREE.Vector3(a.x,a.y,a.z);const n=this._getCurrentCameraParameters(),o=t.getSize(new THREE.Vector3);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(n,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new THREE.Sphere);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const i=this._domHelper.getClientDimensions(),s=i.x,a=i.y,n=this._camera.offset?s-s*this._camera.offset.left-s*(1-this._camera.offset.right):s,o=this._camera.offset?a-a*this._camera.offset.bottom-a*(1-this._camera.offset.top):a;this._bounds.copy(t);const{cameraSpacing:h}=this._initData;t.addScalar(h/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const r=Math.max(t.x,t.y),{x:_,y:d}=this._getMargin(n,o),l=getIdealDistance(t.x+_,t.y+d,t.z,this._camera.fov,n,o);return this._distance<l&&e&&(this._distance=l),this.maxDistance=l+r,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),l}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,a=!0){const n=t.getSize(new THREE.Vector3);if(n){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new THREE.Vector3);this._targetPosition.copy(e)}const o=this._getCurrentCameraParameters();if(i||(i=-30),s||(s=10),this._pitch=toRadiant(s),this._yaw=toRadiant(i),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(n),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(n);this._setDistanceAndRangesBasedOnBounds(n);let h=this._targetPosition.clone();a?this._tweenCameraParameter(o,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:h.x,targetY:h.y,targetZ:h.z},!0):this._update(this._targetPosition)}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,a,n=!0){const o=new THREE.Vector3(-t.x/2,0,-t.z/2),h=new THREE.Vector3(t.x/2,t.y,t.z/2);if(this._boundingBox=new THREE.Box3(o,h),a&&t.addScalar(a),e?this._targetPosition.copy(e):this._targetPosition=new THREE.Vector3(0,t.y/2,0),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const r=this._getCurrentCameraParameters();i||(i=-30),s||(s=10),this._pitch=toRadiant(s),this._yaw=toRadiant(i),this._setDistanceAndRangesBasedOnBounds(t);let _=this._targetPosition.clone();n?this._tweenCameraParameter(r,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:_.x,targetY:_.y,targetZ:_.z},!0):this._update(this._targetPosition)}_update(t){this._initData.debug?this._pitch=Math.max(toRadiant(-89),Math.min(toRadiant(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const e=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX"),i=(new THREE.Quaternion).setFromEuler(e),s=new THREE.Vector3(0,0,-1);s.applyQuaternion(i),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const a=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(a),this._zoomChanged(!1,!1);else{const t=this._getCameraSphere(a);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(a),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0!==this._currentZoomHash.length&&this._currentZoomHash===i||(this.dispatchEvent(5,new ZoomChangeEvent(t,e)),this._currentZoomHash=i),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t,e,i,s,a,n){return this._tweenCameraParameter(this._getCurrentCameraParameters(),{yaw:s,pitch:a,distance:2.725*getIdealDistance(t.x,t.y,t.z,this._camera.fov,e,i),targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new THREE.Sphere(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}_setCameraNear(){const t=Math.max(.1,this._distance/6);this._camera.near=t}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new THREE.Vector3(0,0,0))}async moveCamera(t){return this._tweenCameraParameter(this._getCurrentCameraParameters(),t,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}}let _scriptCache={},_idCache={},ScriptLoader=(()=>{class t{constructor(t){this._creator_=t}fetch(t,e){return this._singlePromiseFactory.create(5,t,(i,s)=>{!function(t,e,i,s){if(-1===t.indexOf("http")&&(t=getAssetPath()+t),_scriptCache[t])return i();if(e.id&&_idCache[e.id])return s(new Error('There is already a script with ID "'+e.id+'"'));const a=Benchmark.start("load_"+e.id.replace(/-/g,"_")),n=document.createElement("script");n.async=!1,n.src=t,n.id=e.id,n.onload=()=>{_scriptCache[t]=!0,_idCache[e.id]=!0,Benchmark.end(a),Object.defineProperty(i,"name",{value:"resolve-"+e.id}),i()},n.onerror=t=>{s(t)},document.body.appendChild(n)}(t,e,i,s)})}loadScripts(t){const e=[];return t.forEach(t=>{let i=this.fetch(t.name,{id:t.id});e.push(i)}),Promise.all(e)}cleanUp(){for(let t in _idCache)if(_idCache.hasOwnProperty(t)){const e=document.getElementById(t);e&&e.parentElement.removeChild(e)}_scriptCache={},_idCache={}}}return __decorate([inject],t.prototype,"_singlePromiseFactory",void 0),t})();const BROWSER_EVENTS={MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu"};class InputEvent{constructor(t,e,i,s,a){this.position=t,this.positionRelative=e,this.type=i,this.rotation=s,this.event=a}}const MIN_MOVE_DISTANCE=5*window.devicePixelRatio,MIN_DOLLY_DISTANCE=3*window.devicePixelRatio;let InputManager=(()=>{class t extends EventDispatcher{constructor(t){super(),this._debug=!1,this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(BROWSER_EVENTS).map(t=>BROWSER_EVENTS[t]),this._creator_=t,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}enableDragIn(t){this._setState(1),this._dragEnabled=!0,t&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=t.currentTarget||t.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&t instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):t.dataTransfer&&t.dataTransfer.setData&&t.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=t=>{t=t||window.event,this._firefoxDragPosition.x=t.pageX,this._firefoxDragPosition.y=t.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(t){let e=t,i=null,s=null;window.TouchEvent&&t instanceof TouchEvent?(i=this._getTouchPosition(e),s=this._getTouchPositionRelative(e)):(i=this._getMousePosition(e),s=this._getMousePositionRelative(e)),i.x>0&&i.y>0&&this._move(i,s)}_dragE(t){let e=t;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&t instanceof TouchEvent?this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2):this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}addEvents(t){this._events.forEach(e=>t.addEventListener(e,this,!1))}removeEvents(t){this._events.forEach(e=>t.removeEventListener(e,this,!1))}_move2(t){if(this._lastTouchEvent&&t.timeStamp-this._lastTouchEvent.timeStamp<16)return;const e=t.touches[0],i=t.touches[1],s=e.pageX-i.pageX,a=e.pageY-i.pageY,n=Math.abs(s)+Math.abs(a);this._pinchDistance>-1&&(n>this._pinchDistance+MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(7,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<this._pinchDistance-MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(8,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<=this._pinchDistance+MIN_DOLLY_DISTANCE&&n>=this._pinchDistance-MIN_DOLLY_DISTANCE&&(this._setState(5),this.dispatchEvent(11,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t))))),this._pinchDistance=n,this._lastTouchEvent=t}_setState(t){this._state=t}_move(t,e,i,s){void 0===i&&(i=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(i)&&(this._delta=this._getDelta(t),this._delta>MIN_MOVE_DISTANCE&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(t,e)))),2===this._state&&this.dispatchEvent(1,new InputEvent(t,e)),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(6,new InputEvent(t,e,i,null,s))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new InputEvent(this._downPosition,this._downPositionRelative))}_onUp(t,e,i){this.dispatchEvent(4,new InputEvent(t,e,i)),this._getDelta(t)<=MIN_MOVE_DISTANCE&&this.dispatchEvent(5,new InputEvent(t,e)),2===this._state&&this.dispatchEvent(2,new InputEvent(t,e)),4===this._state&&(this.dispatchEvent(10,new InputEvent(t,e)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(t){if(t.touches.length){let{clientX:e,clientY:i}=t.touches[0];if(t.touches.length>1){const s=t.touches[1],a=s.clientX,n=s.clientY;e=(e+a)/2,i=(i+n)/2}return{x:e,y:i}}const e=t.changedTouches[0];return{x:e.clientX,y:e.clientY}}_getTouchPositionRelative(t){const e=this._boundingClientRect,{clientWidth:i,clientHeight:s}=this._domHelper.element;if(t.touches.length){const{clientX:a,clientY:n}=t.touches[0];return{x:(a-e.left)/i*2-1,y:-(n-e.top)/s*2+1}}const a=t.changedTouches[0];return{x:(a.clientX-e.left)/i*2-1,y:-(a.clientY-e.top)/s*2+1}}_getMousePosition(t){if(0!==t.clientX&&0!==t.clientY)return{x:t.clientX,y:t.clientY};{let{x:e,y:i}=this._getFireFoxMousePosition(t);return{x:e,y:i}}}_getFireFoxMousePosition(t){let{x:e,y:i}=this._domHelper.getClientDimensions();return{x:e-(e+t.offsetX),y:i-(i+t.offsetY)}}_getMousePositionRelative(t){const e=this._boundingClientRect;return 0!==t.clientX&&0!==t.clientY?{x:(t.clientX-e.left)/this._domHelper.element.clientWidth*2-1,y:-(t.clientY-e.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-e.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-e.top)/this._domHelper.element.clientHeight*2+1}:(console.trace("this should not happen"),{x:0,y:0})}_getDelta(t){return Math.abs(this._downPosition.y-t.y)+Math.abs(this._downPosition.x-t.x)}setDragEnabled(t){this._dragEnabled=t}handleEvent(t){switch(this._debug&&t.type,t.type){case BROWSER_EVENTS.MOUSE_MOVE:this._onMouseMove(t);break;case BROWSER_EVENTS.MOUSE_DOWN:this._onMouseDown(t);break;case BROWSER_EVENTS.MOUSE_UP:this._onMouseUp(t);break;case BROWSER_EVENTS.MOUSE_LEAVE:this._onMouseLeave(t);break;case BROWSER_EVENTS.MOUSE_ENTER:this._onMouseEnter(t);break;case BROWSER_EVENTS.MOUSE_WHEEL:this._onMouseWheel(t);break;case BROWSER_EVENTS.TOUCH_MOVE:this._onTouchMove(t);break;case BROWSER_EVENTS.TOUCH_START:this._onTouchStart(t);break;case BROWSER_EVENTS.TOUCH_END:this._onTouchEnd(t);break;case BROWSER_EVENTS.CONTEXT_MENU:this._onContextMenu(t)}}_onMouseDown(t){t.preventDefault();let{x:e,y:i}=this._getMousePosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getMousePositionRelative(t),this.dispatchEvent(3,new InputEvent({x:e,y:i},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(t){t.preventDefault(),this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}_onMouseMove(t){t.preventDefault(),this._move(this._getMousePosition(t),this._getMousePositionRelative(t),1,t)}_onMouseLeave(t){this._delta=-1,this._onMouseUp(t)}_onMouseEnter(t){t.preventDefault()}_onMouseWheel(t){if(this._lastMouseWheelEvent&&t.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return t.preventDefault(),void t.stopPropagation();t.deltaY<0?this.dispatchEvent(7,new InputEvent(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)):this.dispatchEvent(8,new InputEvent(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)),this._lastMouseWheelEvent=t}_onTouchMove(t){if(t.preventDefault(),!this._dragTarget)if(1===t.touches.length)this._move(this._getTouchPosition(t),this._getTouchPositionRelative(t),2);else if(2===t.touches.length)if(this._elementHit||4===this._state){const e=t.touches[0],i=t.touches[1];let s={x:e.pageX,y:e.pageY},a={x:i.pageX,y:i.pageY};const n=to360Degrees(getAngle(s,a));this._rotationAngle<0&&(this._rotationAngle=n);const o=n-this._rotationAngle;this._rotationAngle=n,this.dispatchEvent(9,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t),2,toRadiant(o))),this._setState(4)}else this._move2(t)}_onTouchStart(t){if(t.preventDefault(),1===t.touches.length){let{x:e,y:i}=this._getTouchPosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getTouchPositionRelative(t),this.dispatchEvent(3,new InputEvent({x:e,y:i},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===t.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2),this._setState(3))}_onTouchEnd(t){t.preventDefault(),t.touches.length>1&&5===this._state||3===this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2)}_onContextMenu(t){t.preventDefault()}_canDrag(t){return this._dragEnabled}onElementHit(){this._elementHit=!0}updateSize(){this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}}return __decorate([inject],t.prototype,"_domHelper",void 0),t})();var PHOTO_STUDIO_ROOM_FILE_NAME="static/PhotoStudioRoom-5b94763849f82256.glb";class LightSetting{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new THREE.Object3D),this._cameraContainer}}let DynamicLightSetting=(()=>{class t extends LightSetting{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new THREE.Vector3;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{t.lights||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(handleJsonResponse).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new THREE.Vector3;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=getGUI();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof THREE.SpotLight&&this._addSpotLightToGUI(t,e),e instanceof THREE.AmbientLight&&this._addAmbientLightToGUI(t,e),e instanceof THREE.DirectionalLight&&this._addDirectionalLightToGUI(t,e),e instanceof THREE.RectAreaLight&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new THREE.Color(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}}return __decorate([inject],t.prototype,"_dynamicLightSettingLoader",void 0),t})();class Environment{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}let GltfEnvironment=(()=>{class t extends Environment{constructor(t,e){super(t,e),this._gltfLoaderPromise=this._scriptLoader.fetch(GLTF_LOADER_FILE_NAME,{id:"gltf-loader-js"}).then(()=>{this._gltfLoader=new THREE.GLTFLoader})}needsBounds(){return!0}needsCamera(){return!0}updateBounds(t){if(super.updateBounds(t),this._backgroundMesh){let e=Math.max(t.x,t.z)/6;e=Math.max(e,1),this._backgroundMesh.scale.copy(new THREE.Vector3(e,e,e))}}updateCamera(t){if(this._backgroundMesh){let e=t.getWorldDirection(new THREE.Vector3);e.y=0,e.lengthSq()<.01&&(e=new THREE.Vector3(0,1,0),e.applyQuaternion(t.quaternion),e.y=0),e.multiplyScalar(-1),e.normalize();let i=Math.asin(e.x);e.z<0&&(i=Math.PI-i),this._backgroundMesh.rotation.set(0,i,0)}}addToScene(){this._scene&&this._backgroundMesh&&this._scene.add(this._backgroundMesh)}removeFromScene(){this._scene&&this._backgroundMesh&&this._scene.remove(this._backgroundMesh)}loadBackground(t,e){this._backgroundMaterial=e,this._backgroundMaterial||(this._backgroundMaterial=new THREE.MeshBasicMaterial),this._gltfLoaderPromise.then(()=>{this._gltfLoader.load(t,this._onBackgroundLoaded.bind(this),t=>{},t=>{console.error(t)})})}_onBackgroundLoaded(t){this._scene&&(this._backgroundMaterial.vertexColors=!0,t&&t.scene&&t.scene.children&&t.scene.children.length>0&&(t.scene.children[0].material=this._backgroundMaterial,t.scene.children[0].layers.set(2),t.scene.position.copy(new THREE.Vector3(0,0,0)),this._backgroundMesh=t.scene,this._backgroundMesh.layers.set(2),this._backgroundMesh.receiveShadow=!0,setShadows(this._backgroundMesh,!0,!1),this.removeFromScene(),this.addToScene()))}showGUI(){console.warn("gui not implemented for gltf environment")}}return __decorate([inject],t.prototype,"_scriptLoader",void 0),t})();const DEFAULT_BAKED_SHADOW_PARAMS={enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightSolidAngle:40,yPosition:0};class BakedShadowEnvironment extends Environment{constructor(t,e){super(t,e),this._pixotronGuard=new AsyncGuard,this._params=Object.assign(DEFAULT_BAKED_SHADOW_PARAMS,{lightDirection:new THREE.Vector3(0,1,.5),onComplete:this._addGroundShadows.bind(this),onProgress:this._progressCallback.bind(this)})}_progressCallback(t){}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}setPixotron(t,e,i,s){t&&(this._pixotron=t,this._renderer=e,this._camera=i,this._shadowBaker||(this._shadowBaker=new window.PIXOTRON.PlaneShadowBakePass(Object.assign(this._params,s))),this._shadowBaker.enable?this._shadowBaker.startBake(this._renderer,this._scene,this._camera):this._shadowBaker.enable=!0,this._wasAAEnabled=this._pixotron.enableAA,this._pixotronGuard.resolve())}async _addGroundShadows(){await this._pixotronGuard.wait(),this._pixotron.needsUpdate=!0,this._shadowPlane=this._shadowBaker.getShadowPlane(),this._shadowPlane.name="Shadow plane",this._shadowPlane.receiveShadow=!1,0!==this._params.yPosition&&(this._shadowPlane.position.y=this._params.yPosition),this._shadowPlane.visible=!0,this.addToScene(),this._loadedCallback&&this._loadedCallback()}setLoadedCallback(t){this._loadedCallback=t}update(){const t=this._getNumberOfChildren();this._bake(),this._sceneChildren=t}updateBounds(t,e){const i=this._getNumberOfChildren();return!(vectorIsEqual(this._bounds,t,1e-4)&&this._scene&&i===this._sceneChildren&&!e||(super.updateBounds(t),this._bake(),this._sceneChildren=i,0))}_bake(){this._pixotronGuard.wait().then(()=>{this._shadowPlane&&(this._shadowPlane.visible=!1),this._shadowBaker.startBake(this._renderer,this._scene,this._camera)})}_getNumberOfChildren(){let t=0;return this._scene.traverse(e=>{"Shadow plane"!==e.name&&t++}),t}addToScene(){this._scene&&this._shadowPlane&&(this._shadowPlane.material.needsUpdate=!0,fadeIn(this._shadowPlane),this._scene.add(this._shadowPlane))}removeFromScene(){this._shadowPlane&&(this._scene.remove(this._shadowPlane),this._pixotron&&(this._pixotron.enableAA=this._wasAAEnabled))}showGUI(){}}class BakedShadowPlane{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new THREE.Object3D,this._plane.rotation.x=-Math.PI/2;const e=new THREE.MeshStandardMaterial;this._innerPlaneMesh=new THREE.Mesh,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new THREE.Mesh,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new THREE.Shape;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new THREE.Shape;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const a=new THREE.Path;a.moveTo(-t/2,-t/2),a.lineTo(-t/2,t/2),a.lineTo(t/2,t/2),a.lineTo(t/2,-t/2),a.lineTo(-t/2,-t/2),s.holes.push(a);const n=new THREE.ShapeBufferGeometry(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=n;const o=new THREE.ShapeBufferGeometry(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const h=n.attributes.uv.clone();n.setAttribute("uv2",h);const r=n.attributes.uv2.array;for(let t=0;t<r.length;++t)r[t]+=.5}}let FloorEnvironment=(()=>{class t extends BakedShadowEnvironment{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new BakedShadowPlane(100),this._fog=i||!1,this._textureLoader=new THREE.TextureLoader,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new THREE.Vector3(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new THREE.Fog(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new THREE.Color(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=THREE.RepeatWrapping,this._floorTexture.wrapT=THREE.RepeatWrapping,this._floorTexture.repeat.set(100/t,100/e));let i=new THREE.MeshStandardMaterial({map:this._floorTexture,side:THREE.DoubleSide});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&(this._shadowPlane&&(this._bakedShadowPlane.updateSize(this._shadowPlane.scale.x),this._bakedShadowPlane.getRootNode().position.copy(this._shadowPlane.position),this._bakedShadowPlane.getInnerPlane().material.aoMap=this._shadowPlane.material.aoMap),this._scene.add(this._bakedShadowPlane.getRootNode()))}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,s)=>{this._floorMaterial=createMaterial(t,this._environmentLoader),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let a=[];t.forEach(t=>{a.push(addTexture(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(a).then(()=>{setTimeout(()=>i(),0)},s)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=getGUI();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}return __decorate([inject],t.prototype,"_rapiAccess",void 0),__decorate([inject],t.prototype,"_dataSyncer",void 0),__decorate([inject],t.prototype,"_environmentLoader",void 0),t})();class BackgroundEnvironment extends BakedShadowEnvironment{constructor(t,e,i,s,a){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&a){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+a+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){super.addToScene(),this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"),this._pixotron&&(this._pixotron.enableAA=!1))}removeFromScene(){super.removeFromScene(),this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}}let DynamicEnvironmentSettingLoader=(()=>{class t{parse(t,e,i,s){let a=JSON.parse(s);return a.environment?this.load(t,e,i,a):null}load(t,e,i,s){let a,n=s.environment;if(!n)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(n.type){case"color":a=new Promise(e=>e(new BackgroundEnvironment(t,i,new THREE.Color(n.details.color))));break;case"image":a=new Promise(s=>s(new BackgroundEnvironment(t,i,null,e,n.details.imageUrl)));break;case"gltf":a=new Promise(e=>{let s=new GltfEnvironment(t,i);s.loadBackground(getAssetPath()+"static/PhotoStudioRoom-5b94763849f82256.glb"),e(s)});break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(n.details.material).then(s=>{let a=void 0===n.details.fog||n.details.fog,o=new FloorEnvironment(t,i,a);o.changeFloorMaterial(s).then(()=>{e(o)})})});break;case"baked_shadow":a=new Promise(s=>{n.details&&n.details.color?s(new BackgroundEnvironment(t,i,new THREE.Color(n.details.color))):n.details&&n.details.imageUrl?s(new BackgroundEnvironment(t,i,null,e,n.details.imageUrl)):s(new BakedShadowEnvironment(t,i))});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}return __decorate([inject],t.prototype,"_rapiAccess",void 0),t})();class HighPixelRatioQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(5),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class HighestQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(4),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class HighQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(3),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class MidQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(2),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class LowQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(1),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class LowestQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(0),this._settings.enableAA=!1,this._settings.useAreaLight=!1,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class PixotronUtil{constructor(t){this._sceneBoundingSphere=new THREE.Sphere,this._pixotron=t,this._initializeQualitySettings(),this._initializeQualityAdapters()}getPixotronInstance(t){const e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,bias:.02,accumulative:!1},shadowparams:{shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:100,side:THREE.FrontSide}};return t=t||e,new window.PIXOTRON.Pixotron(t)}showGUI(){let t=getGUI();if(!t)return;let e=t.addFolder("Renderer");e.add(this._pixotron.getSAOPass(),"enabled"),this._pixotron.getSAOPass().smoothTransition&&e.add(this._pixotron.getSAOPass(),"smoothTransition"),e.add(this._pixotron.getSAOPass(),"occlusionWorldRadius").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoRadius(t)}),e.add(this._pixotron.getSAOPass(),"intensity").min(.1).max(2).step(.05),e.add(this._pixotron.getSAOPass(),"bias").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoBias(t)}),this._pixotron.getSAOPass().numSamples&&e.add(this._pixotron.getSAOPass(),"numSamples").min(10).max(3e3).step(10),void 0!==this._pixotron.getShadowPass().enabled&&e.add(this._pixotron.getShadowPass(),"enabled"),e.add(this._pixotron.getShadowPass(),"smoothTransition"),e.add(this._pixotron.getShadowPass(),"enableAccumulation"),e.add(this._pixotron.getShadowPass(),"shadowRadius").min(0).max(5).step(.1),e.add(this._pixotron.getShadowPass(),"shadowBiasMultiplier").min(0).max(3).step(.01),e.add(this._pixotron.getShadowPass(),"numSamples").min(10).max(3e3).step(10)}updateBounds(t){this._sceneBoundingSphere.copy(t);const e=.25*this._getMaxSaoRadius();this._adjustSaoRadius(e);const i=2*this._getMinSaoBias();this._adjustSaoBias(i)}_getSaoRadius(){return this._sceneBoundingSphere.radius}_adjustSaoRadius(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoRadius(),s=this._getMaxSaoRadius();e.occlusionWorldRadius=Math.min(Math.max(t,i),s)}_adjustSaoBias(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoBias(),s=this._getMaxSaoBias();e.bias=Math.min(Math.max(t,i),s)}_getMinSaoRadius(){return.001*this._getSaoRadius()}_getMaxSaoRadius(){return.6*this._getSaoRadius()}_getMinSaoBias(){return.001*this._getSaoRadius()}_getMaxSaoBias(){return.01*this._getSaoRadius()}updatePixelRatio(t){const e=new THREE.Vector2;t.getDrawingBufferSize(e),this._pixotron.setSize(Math.floor(e.width),Math.floor(e.height))}getHighPixelRatioQualitySetting(){return this._highPixelRatioQualitySetting.getSettings()}getLowestQualitySetting(){return this._lowQualitySetting.getSettings()}_initializeQualitySettings(){this._highestQualitySetting=new HighestQualitySettings,this._highPixelRatioQualitySetting=new HighPixelRatioQualitySettings,this._highQualitySetting=new HighQualitySettings,this._midQualitySetting=new MidQualitySettings,this._lowQualitySetting=new LowQualitySettings,this._lowestQualitySetting=new LowestQualitySettings}_initializeQualityAdapters(){this._autoQualityAdapter=new window.PIXOTRON.AutoQualityAdapter(this._pixotron),this._autoQualityAdapter.addQuality(this._highestQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._highQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._midQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowestQualitySetting.getSettings()),this._autoQualityAdapter.setDesiredFps(20),this._manualQualityAdapter=new window.PIXOTRON.ManualQualityAdapter(this._pixotron)}onAutoQualityChange(t){this._autoQualityAdapter.onQualityChange(t)}onManualQualityChange(t){this._manualQualityAdapter.onQualityChange(t)}getAutoAdapter(){return this._autoQualityAdapter}lockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().lock()}unLockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().unLock()}enablePixotronAutoQuality(){this._currentQualityAdapter||(this._currentQualityAdapter=this._autoQualityAdapter,this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStarts(){this._currentQualityAdapter&&(this._currentQualityAdapter=this._autoQualityAdapter,this._currentQualitySetting&&(this._manualQualityAdapter.setQualitySetting(this._currentQualitySetting),this._pixotron.setQualityAdapter(this._manualQualityAdapter)),this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStops(){this._currentQualityAdapter&&(this._currentQualitySetting=this._currentQualityAdapter.getCurrentQualitySetting(),this._currentQualityAdapter=this._manualQualityAdapter,this._pixotron.setQualityAdapter(this._manualQualityAdapter),this._manualQualityAdapter.setQualitySetting(this._highestQualitySetting.getSettings()))}}var PIXOTRON_FILE_NAME="static/pi.min-0272f873b3a4380a.js";const PIXOTRON_EFFETCS=["static/CopyShader-cde53240fcc3e06e.js","static/EffectComposer-1e936e5d03ff43cc.js","static/RenderPass-bc5df3810a01b2c6.js","static/ShaderPass-31f36160e0ea282d.js","static/LuminosityHighPassShader-dd5826656142421d.js","static/OutlinePass-f4bcd337cdd89b8d.js","static/RectAreaLightUniformsLib-4b74882185efd473.js","static/GammaCorrectionShader-b3b56f244f0d1e0e.js"];export{BakedShadowEnvironment as B,CameraControl3D as C,DynamicLightSetting as D,EventDispatcher as E,FloorEnvironment as F,GltfEnvironment as G,InputManager as I,LightSetting as L,Main as M,PHOTO_STUDIO_ROOM_FILE_NAME as P,ScriptLoader as S,TWEEN_FILE_NAME as T,BackgroundEnvironment as a,PixotronUtil as b,DynamicEnvironmentSettingLoader as c,CameraControl as d,PIXOTRON_EFFETCS as e,DAT_GUI_FILE_NAME as f,PIXOTRON_FILE_NAME as g,INITIAL_PITCH as h,MIN_MOVE_DISTANCE as i};
2
- //# sourceMappingURL=pixotron-5167229f.js.map
1
+ import{g as getAllParameters}from"./query-params-helper-a271f9dc.js";import{s as RoomleDependencyInjection,B as Benchmark,I as INJECTABLES,_ as __decorate,i as inject,t as toRadiant,u as position3VectorsAreEqual,v as position2VectorsAreEqual,w as getIdealDistance,x as to360Degrees,y as getAngle,h as getGUI,G as GLTF_LOADER_FILE_NAME,z as setShadows,F as AsyncGuard,H as vectorIsEqual,J as fadeIn,K as createMaterial,N as addTexture}from"./rapi-access-d209c65c.js";import{d as debounce,g as getAssetPath,h as handleJsonResponse}from"./main-thread-to-worker-5447c1c5.js";var DAT_GUI_FILE_NAME="static/dat.gui.min-b5cbb61e5c62f0bf.js",TWEEN_FILE_NAME="static/Tween-d024b02fe34f25ab.js";class Main{constructor(t){this._context=t||RoomleDependencyInjection.getContext(this.getContextName()),Benchmark.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){RoomleDependencyInjection.setup(INJECTABLES);const t=getAllParameters();this.lookup("global-init-data").setOverrides(t),this.lookup("init-data",this._context).setOverrides(t)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const t in window.THREE)if(window.THREE.hasOwnProperty(t))try{delete window.THREE[t]}catch(t){console.error(t)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(t){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(t),this.setupDependencies(),this.bootFinished()}lookup(t,e){return window.__RML__DI__.lookup(t,e)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(t){t&&this.lookup("dom-helper",this._context).setDomElement(t),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),RoomleDependencyInjection.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}}class EventDispatcher{constructor(){this._listeners={}}_addEventListener(t,e,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push({callback:e,scope:i})}addEventListener(t,e,i){this._addEventListener(t,e,i)}dispatchEvent(t,e){if(!this._listeners[t])return;const i=this._listeners[t];let s=i.length;for(let t=0;t<s;t++){const s=i[t];e?s.callback.apply(s.scope,[e]):s.callback.call(s.scope)}}removeEventListener(t,e){const i=this._listeners[t];if(i)for(let t=0,s=i.length;t<s;t++)if(i[t].callback===e)return void i.splice(t,1)}}const INITIAL_PITCH=10;let CameraControl=(()=>{class t extends EventDispatcher{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=toRadiant(10),this._yaw=toRadiant(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new THREE.Vector3,this._targetPosition=new THREE.Vector3,i?this._cameraPosition.copy(i):this._cameraPosition=new THREE.Vector3(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=debounce(this._dispatchCameraIdle.bind(this),16)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||position3VectorsAreEqual(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,this._dispatchCameraIdle(),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this._getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_areEqual(t,e){return t.yaw.toFixed(5)===e.yaw.toFixed(5)&&t.pitch.toFixed(5)===e.pitch.toFixed(5)&&t.distance.toFixed(5)===e.distance.toFixed(5)&&t.targetX===e.targetX&&t.targetY===e.targetY&&t.targetZ===e.targetZ}_tweenCameraParameter(t,e,i){return new Promise(i=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._update(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}).onComplete(()=>{this.dispatchEvent(2,3),this._tweenEnd=null,i()}).start(),this.dispatchEvent(0,3)}})}_getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new THREE.Vector3(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof THREE.PerspectiveCamera&&e>i.far&&(i.far=e+1)}}return __decorate([inject],t.prototype,"_domHelper",void 0),__decorate([inject],t.prototype,"_initData",void 0),t})();class ZoomChangeEvent{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}class CameraControl3D extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._bounds=new THREE.Vector3,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=toRadiant(0),this.maxPolarAngle=toRadiant(85),this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new THREE.Vector3(0,0,0));const{cameraRestriction:a,zoomDistance:n,minVerticalCameraAngle:o,maxVerticalCameraAngle:h,minHorizontalCameraAngle:r,maxHorizontalCameraAngle:_}=this._initData;if(n&&(this._zoomDistance=n/100),void 0!==o&&(this.minPolarAngle=toRadiant(o<0?o:-1*o)),void 0!==h&&(this.maxPolarAngle=toRadiant(h)),void 0!==r&&(this.minAzimuthAngle=toRadiant(r<0?r:-1*r)),void 0!==_&&(this.maxAzimuthAngle=toRadiant(_)),void 0!==a){let t=Math.abs(toRadiant(a));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,toRadiant(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}_initCamera(){this._camera=new THREE.PerspectiveCamera,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),a=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*a,s.y=s.y+e.y/i.clientHeight*a,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),position2VectorsAreEqual(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}setBounds(t){this._boundingBox=t}zoomToFitBounds(t){this.setBounds(t);const e=t.getSize(new THREE.Vector3);if(this._initData.debug||e.x+e.y+e.z===0)return;const i=this._getCurrentCameraParameters(),s=t.getCenter(new THREE.Vector3);this._targetPosition=new THREE.Vector3(s.x,s.y,s.z);const a=this._setDistanceAndRangesBasedOnBounds(e);this._distance=a,this._checkZoomDistance(t,a),this._tweenCameraParameter(i,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const a=t.getCenter(new THREE.Vector3);this._targetPosition=s?s.clone():new THREE.Vector3(a.x,a.y,a.z);const n=this._getCurrentCameraParameters(),o=t.getSize(new THREE.Vector3);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(n,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new THREE.Sphere);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const i=this._domHelper.getClientDimensions(),s=i.x,a=i.y,n=this._camera.offset?s-s*this._camera.offset.left-s*(1-this._camera.offset.right):s,o=this._camera.offset?a-a*this._camera.offset.bottom-a*(1-this._camera.offset.top):a;this._bounds.copy(t);const{cameraSpacing:h}=this._initData;t.addScalar(h/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const r=Math.max(t.x,t.y),{x:_,y:d}=this._getMargin(n,o),l=getIdealDistance(t.x+_,t.y+d,t.z,this._camera.fov,n,o);return this._distance<l&&e&&(this._distance=l),this.maxDistance=l+r,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),l}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,a=!0){const n=t.getSize(new THREE.Vector3);if(n){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new THREE.Vector3);this._targetPosition.copy(e)}const o=this._getCurrentCameraParameters();if(i||(i=-30),s||(s=10),this._pitch=toRadiant(s),this._yaw=toRadiant(i),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(n),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(n);this._setDistanceAndRangesBasedOnBounds(n);let h=this._targetPosition.clone();a?this._tweenCameraParameter(o,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:h.x,targetY:h.y,targetZ:h.z},!0):this._update(this._targetPosition)}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,a,n=!0){const o=new THREE.Vector3(-t.x/2,0,-t.z/2),h=new THREE.Vector3(t.x/2,t.y,t.z/2);if(this._boundingBox=new THREE.Box3(o,h),a&&t.addScalar(a),e?this._targetPosition.copy(e):this._targetPosition=new THREE.Vector3(0,t.y/2,0),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const r=this._getCurrentCameraParameters();i||(i=-30),s||(s=10),this._pitch=toRadiant(s),this._yaw=toRadiant(i),this._setDistanceAndRangesBasedOnBounds(t);let _=this._targetPosition.clone();n?this._tweenCameraParameter(r,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:_.x,targetY:_.y,targetZ:_.z},!0):this._update(this._targetPosition)}_update(t){this._initData.debug?this._pitch=Math.max(toRadiant(-89),Math.min(toRadiant(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const e=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX"),i=(new THREE.Quaternion).setFromEuler(e),s=new THREE.Vector3(0,0,-1);s.applyQuaternion(i),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const a=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(a),this._zoomChanged(!1,!1);else{const t=this._getCameraSphere(a);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(a),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0!==this._currentZoomHash.length&&this._currentZoomHash===i||(this.dispatchEvent(5,new ZoomChangeEvent(t,e)),this._currentZoomHash=i),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t,e,i,s,a,n){return this._tweenCameraParameter(this._getCurrentCameraParameters(),{yaw:s,pitch:a,distance:2.725*getIdealDistance(t.x,t.y,t.z,this._camera.fov,e,i),targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new THREE.Sphere(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}_setCameraNear(){const t=Math.max(.1,this._distance/6);this._camera.near=t}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new THREE.Vector3(0,0,0))}async moveCamera(t){return this._tweenCameraParameter(this._getCurrentCameraParameters(),t,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}}let _scriptCache={},_idCache={},ScriptLoader=(()=>{class t{constructor(t){this._creator_=t}fetch(t,e){return this._singlePromiseFactory.create(5,t,(i,s)=>{!function(t,e,i,s){if(-1===t.indexOf("http")&&(t=getAssetPath()+t),_scriptCache[t])return i();if(e.id&&_idCache[e.id])return s(new Error('There is already a script with ID "'+e.id+'"'));const a=Benchmark.start("load_"+e.id.replace(/-/g,"_")),n=document.createElement("script");n.async=!1,n.src=t,n.id=e.id,n.onload=()=>{_scriptCache[t]=!0,_idCache[e.id]=!0,Benchmark.end(a),Object.defineProperty(i,"name",{value:"resolve-"+e.id}),i()},n.onerror=t=>{s(t)},document.body.appendChild(n)}(t,e,i,s)})}loadScripts(t){const e=[];return t.forEach(t=>{let i=this.fetch(t.name,{id:t.id});e.push(i)}),Promise.all(e)}cleanUp(){for(let t in _idCache)if(_idCache.hasOwnProperty(t)){const e=document.getElementById(t);e&&e.parentElement.removeChild(e)}_scriptCache={},_idCache={}}}return __decorate([inject],t.prototype,"_singlePromiseFactory",void 0),t})();const BROWSER_EVENTS={MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu"};class InputEvent{constructor(t,e,i,s,a){this.position=t,this.positionRelative=e,this.type=i,this.rotation=s,this.event=a}}const MIN_MOVE_DISTANCE=5*window.devicePixelRatio,MIN_DOLLY_DISTANCE=3*window.devicePixelRatio;let InputManager=(()=>{class t extends EventDispatcher{constructor(t){super(),this._debug=!1,this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(BROWSER_EVENTS).map(t=>BROWSER_EVENTS[t]),this._creator_=t,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}enableDragIn(t){this._setState(1),this._dragEnabled=!0,t&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=t.currentTarget||t.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&t instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):t.dataTransfer&&t.dataTransfer.setData&&t.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=t=>{t=t||window.event,this._firefoxDragPosition.x=t.pageX,this._firefoxDragPosition.y=t.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(t){let e=t,i=null,s=null;window.TouchEvent&&t instanceof TouchEvent?(i=this._getTouchPosition(e),s=this._getTouchPositionRelative(e)):(i=this._getMousePosition(e),s=this._getMousePositionRelative(e)),i.x>0&&i.y>0&&this._move(i,s)}_dragE(t){let e=t;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&t instanceof TouchEvent?this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2):this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}addEvents(t){this._events.forEach(e=>t.addEventListener(e,this,!1))}removeEvents(t){this._events.forEach(e=>t.removeEventListener(e,this,!1))}_move2(t){if(this._lastTouchEvent&&t.timeStamp-this._lastTouchEvent.timeStamp<16)return;const e=t.touches[0],i=t.touches[1],s=e.pageX-i.pageX,a=e.pageY-i.pageY,n=Math.abs(s)+Math.abs(a);this._pinchDistance>-1&&(n>this._pinchDistance+MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(7,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<this._pinchDistance-MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(8,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<=this._pinchDistance+MIN_DOLLY_DISTANCE&&n>=this._pinchDistance-MIN_DOLLY_DISTANCE&&(this._setState(5),this.dispatchEvent(11,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t))))),this._pinchDistance=n,this._lastTouchEvent=t}_setState(t){this._state=t}_move(t,e,i,s){void 0===i&&(i=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(i)&&(this._delta=this._getDelta(t),this._delta>MIN_MOVE_DISTANCE&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(t,e)))),2===this._state&&this.dispatchEvent(1,new InputEvent(t,e)),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(6,new InputEvent(t,e,i,null,s))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new InputEvent(this._downPosition,this._downPositionRelative))}_onUp(t,e,i){this.dispatchEvent(4,new InputEvent(t,e,i)),this._getDelta(t)<=MIN_MOVE_DISTANCE&&this.dispatchEvent(5,new InputEvent(t,e)),2===this._state&&this.dispatchEvent(2,new InputEvent(t,e)),4===this._state&&(this.dispatchEvent(10,new InputEvent(t,e)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(t){if(t.touches.length){let{clientX:e,clientY:i}=t.touches[0];if(t.touches.length>1){const s=t.touches[1],a=s.clientX,n=s.clientY;e=(e+a)/2,i=(i+n)/2}return{x:e,y:i}}const e=t.changedTouches[0];return{x:e.clientX,y:e.clientY}}_getTouchPositionRelative(t){const e=this._boundingClientRect,{clientWidth:i,clientHeight:s}=this._domHelper.element;if(t.touches.length){const{clientX:a,clientY:n}=t.touches[0];return{x:(a-e.left)/i*2-1,y:-(n-e.top)/s*2+1}}const a=t.changedTouches[0];return{x:(a.clientX-e.left)/i*2-1,y:-(a.clientY-e.top)/s*2+1}}_getMousePosition(t){if(0!==t.clientX&&0!==t.clientY)return{x:t.clientX,y:t.clientY};{let{x:e,y:i}=this._getFireFoxMousePosition(t);return{x:e,y:i}}}_getFireFoxMousePosition(t){let{x:e,y:i}=this._domHelper.getClientDimensions();return{x:e-(e+t.offsetX),y:i-(i+t.offsetY)}}_getMousePositionRelative(t){const e=this._boundingClientRect;return 0!==t.clientX&&0!==t.clientY?{x:(t.clientX-e.left)/this._domHelper.element.clientWidth*2-1,y:-(t.clientY-e.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-e.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-e.top)/this._domHelper.element.clientHeight*2+1}:(console.trace("this should not happen"),{x:0,y:0})}_getDelta(t){return Math.abs(this._downPosition.y-t.y)+Math.abs(this._downPosition.x-t.x)}setDragEnabled(t){this._dragEnabled=t}handleEvent(t){switch(this._debug&&t.type,t.type){case BROWSER_EVENTS.MOUSE_MOVE:this._onMouseMove(t);break;case BROWSER_EVENTS.MOUSE_DOWN:this._onMouseDown(t);break;case BROWSER_EVENTS.MOUSE_UP:this._onMouseUp(t);break;case BROWSER_EVENTS.MOUSE_LEAVE:this._onMouseLeave(t);break;case BROWSER_EVENTS.MOUSE_ENTER:this._onMouseEnter(t);break;case BROWSER_EVENTS.MOUSE_WHEEL:this._onMouseWheel(t);break;case BROWSER_EVENTS.TOUCH_MOVE:this._onTouchMove(t);break;case BROWSER_EVENTS.TOUCH_START:this._onTouchStart(t);break;case BROWSER_EVENTS.TOUCH_END:this._onTouchEnd(t);break;case BROWSER_EVENTS.CONTEXT_MENU:this._onContextMenu(t)}}_onMouseDown(t){t.preventDefault();let{x:e,y:i}=this._getMousePosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getMousePositionRelative(t),this.dispatchEvent(3,new InputEvent({x:e,y:i},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(t){t.preventDefault(),this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}_onMouseMove(t){t.preventDefault(),this._move(this._getMousePosition(t),this._getMousePositionRelative(t),1,t)}_onMouseLeave(t){this._delta=-1,this._onMouseUp(t)}_onMouseEnter(t){t.preventDefault()}_onMouseWheel(t){if(this._lastMouseWheelEvent&&t.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return t.preventDefault(),void t.stopPropagation();t.deltaY<0?this.dispatchEvent(7,new InputEvent(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)):this.dispatchEvent(8,new InputEvent(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)),this._lastMouseWheelEvent=t}_onTouchMove(t){if(t.preventDefault(),!this._dragTarget)if(1===t.touches.length)this._move(this._getTouchPosition(t),this._getTouchPositionRelative(t),2);else if(2===t.touches.length)if(this._elementHit||4===this._state){const e=t.touches[0],i=t.touches[1];let s={x:e.pageX,y:e.pageY},a={x:i.pageX,y:i.pageY};const n=to360Degrees(getAngle(s,a));this._rotationAngle<0&&(this._rotationAngle=n);const o=n-this._rotationAngle;this._rotationAngle=n,this.dispatchEvent(9,new InputEvent(this._getTouchPosition(t),this._getTouchPositionRelative(t),2,toRadiant(o))),this._setState(4)}else this._move2(t)}_onTouchStart(t){if(t.preventDefault(),1===t.touches.length){let{x:e,y:i}=this._getTouchPosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getTouchPositionRelative(t),this.dispatchEvent(3,new InputEvent({x:e,y:i},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===t.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2),this._setState(3))}_onTouchEnd(t){t.preventDefault(),t.touches.length>1&&5===this._state||3===this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2)}_onContextMenu(t){t.preventDefault()}_canDrag(t){return this._dragEnabled}onElementHit(){this._elementHit=!0}updateSize(){this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}}return __decorate([inject],t.prototype,"_domHelper",void 0),t})();var PHOTO_STUDIO_ROOM_FILE_NAME="static/PhotoStudioRoom-5b94763849f82256.glb";class LightSetting{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new THREE.Object3D),this._cameraContainer}}let DynamicLightSetting=(()=>{class t extends LightSetting{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new THREE.Vector3;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{t.lights||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(handleJsonResponse).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new THREE.Vector3;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=getGUI();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof THREE.SpotLight&&this._addSpotLightToGUI(t,e),e instanceof THREE.AmbientLight&&this._addAmbientLightToGUI(t,e),e instanceof THREE.DirectionalLight&&this._addDirectionalLightToGUI(t,e),e instanceof THREE.RectAreaLight&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new THREE.Color(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}}return __decorate([inject],t.prototype,"_dynamicLightSettingLoader",void 0),t})();class Environment{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}let GltfEnvironment=(()=>{class t extends Environment{constructor(t,e){super(t,e),this._gltfLoaderPromise=this._scriptLoader.fetch(GLTF_LOADER_FILE_NAME,{id:"gltf-loader-js"}).then(()=>{this._gltfLoader=new THREE.GLTFLoader})}needsBounds(){return!0}needsCamera(){return!0}updateBounds(t){if(super.updateBounds(t),this._backgroundMesh){let e=Math.max(t.x,t.z)/6;e=Math.max(e,1),this._backgroundMesh.scale.copy(new THREE.Vector3(e,e,e))}}updateCamera(t){if(this._backgroundMesh){let e=t.getWorldDirection(new THREE.Vector3);e.y=0,e.lengthSq()<.01&&(e=new THREE.Vector3(0,1,0),e.applyQuaternion(t.quaternion),e.y=0),e.multiplyScalar(-1),e.normalize();let i=Math.asin(e.x);e.z<0&&(i=Math.PI-i),this._backgroundMesh.rotation.set(0,i,0)}}addToScene(){this._scene&&this._backgroundMesh&&this._scene.add(this._backgroundMesh)}removeFromScene(){this._scene&&this._backgroundMesh&&this._scene.remove(this._backgroundMesh)}loadBackground(t,e){this._backgroundMaterial=e,this._backgroundMaterial||(this._backgroundMaterial=new THREE.MeshBasicMaterial),this._gltfLoaderPromise.then(()=>{this._gltfLoader.load(t,this._onBackgroundLoaded.bind(this),t=>{},t=>{console.error(t)})})}_onBackgroundLoaded(t){this._scene&&(this._backgroundMaterial.vertexColors=!0,t&&t.scene&&t.scene.children&&t.scene.children.length>0&&(t.scene.children[0].material=this._backgroundMaterial,t.scene.children[0].layers.set(2),t.scene.position.copy(new THREE.Vector3(0,0,0)),this._backgroundMesh=t.scene,this._backgroundMesh.layers.set(2),this._backgroundMesh.receiveShadow=!0,setShadows(this._backgroundMesh,!0,!1),this.removeFromScene(),this.addToScene()))}showGUI(){console.warn("gui not implemented for gltf environment")}}return __decorate([inject],t.prototype,"_scriptLoader",void 0),t})();const DEFAULT_BAKED_SHADOW_PARAMS={enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightSolidAngle:40,yPosition:0};class BakedShadowEnvironment extends Environment{constructor(t,e){super(t,e),this._pixotronGuard=new AsyncGuard,this._params=Object.assign(DEFAULT_BAKED_SHADOW_PARAMS,{lightDirection:new THREE.Vector3(0,1,.5),onComplete:this._addGroundShadows.bind(this),onProgress:this._progressCallback.bind(this)})}_progressCallback(t){}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}setPixotron(t,e,i,s){t&&(this._pixotron=t,this._renderer=e,this._camera=i,this._shadowBaker||(this._shadowBaker=new window.PIXOTRON.PlaneShadowBakePass(Object.assign(this._params,s))),this._shadowBaker.enable?this._shadowBaker.startBake(this._renderer,this._scene,this._camera):this._shadowBaker.enable=!0,this._wasAAEnabled=this._pixotron.enableAA,this._pixotronGuard.resolve())}async _addGroundShadows(){await this._pixotronGuard.wait(),this._pixotron.needsUpdate=!0,this._shadowPlane=this._shadowBaker.getShadowPlane(),this._shadowPlane.name="Shadow plane",this._shadowPlane.receiveShadow=!1,0!==this._params.yPosition&&(this._shadowPlane.position.y=this._params.yPosition),this._shadowPlane.visible=!0,this.addToScene(),this._loadedCallback&&this._loadedCallback()}setLoadedCallback(t){this._loadedCallback=t}update(){const t=this._getNumberOfChildren();this._bake(),this._sceneChildren=t}updateBounds(t,e){const i=this._getNumberOfChildren();return!(vectorIsEqual(this._bounds,t,1e-4)&&this._scene&&i===this._sceneChildren&&!e||(super.updateBounds(t),this._bake(),this._sceneChildren=i,0))}_bake(){this._pixotronGuard.wait().then(()=>{this._shadowPlane&&(this._shadowPlane.visible=!1),this._shadowBaker.startBake(this._renderer,this._scene,this._camera)})}_getNumberOfChildren(){let t=0;return this._scene.traverse(e=>{"Shadow plane"!==e.name&&t++}),t}addToScene(){this._scene&&this._shadowPlane&&(this._shadowPlane.material.needsUpdate=!0,fadeIn(this._shadowPlane),this._scene.add(this._shadowPlane))}removeFromScene(){this._shadowPlane&&(this._scene.remove(this._shadowPlane),this._pixotron&&(this._pixotron.enableAA=this._wasAAEnabled))}showGUI(){}}class BakedShadowPlane{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new THREE.Object3D,this._plane.rotation.x=-Math.PI/2;const e=new THREE.MeshStandardMaterial;this._innerPlaneMesh=new THREE.Mesh,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new THREE.Mesh,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new THREE.Shape;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new THREE.Shape;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const a=new THREE.Path;a.moveTo(-t/2,-t/2),a.lineTo(-t/2,t/2),a.lineTo(t/2,t/2),a.lineTo(t/2,-t/2),a.lineTo(-t/2,-t/2),s.holes.push(a);const n=new THREE.ShapeBufferGeometry(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=n;const o=new THREE.ShapeBufferGeometry(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const h=n.attributes.uv.clone();n.setAttribute("uv2",h);const r=n.attributes.uv2.array;for(let t=0;t<r.length;++t)r[t]+=.5}}let FloorEnvironment=(()=>{class t extends BakedShadowEnvironment{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new BakedShadowPlane(100),this._fog=i||!1,this._textureLoader=new THREE.TextureLoader,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new THREE.Vector3(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new THREE.Fog(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new THREE.Color(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=THREE.RepeatWrapping,this._floorTexture.wrapT=THREE.RepeatWrapping,this._floorTexture.repeat.set(100/t,100/e));let i=new THREE.MeshStandardMaterial({map:this._floorTexture,side:THREE.DoubleSide});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&(this._shadowPlane&&(this._bakedShadowPlane.updateSize(this._shadowPlane.scale.x),this._bakedShadowPlane.getRootNode().position.copy(this._shadowPlane.position),this._bakedShadowPlane.getInnerPlane().material.aoMap=this._shadowPlane.material.aoMap),this._scene.add(this._bakedShadowPlane.getRootNode()))}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,s)=>{this._floorMaterial=createMaterial(t,this._environmentLoader),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let a=[];t.forEach(t=>{a.push(addTexture(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(a).then(()=>{setTimeout(()=>i(),0)},s)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=getGUI();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}return __decorate([inject],t.prototype,"_rapiAccess",void 0),__decorate([inject],t.prototype,"_dataSyncer",void 0),__decorate([inject],t.prototype,"_environmentLoader",void 0),t})();class BackgroundEnvironment extends BakedShadowEnvironment{constructor(t,e,i,s,a){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&a){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+a+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){super.addToScene(),this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"),this._pixotron&&(this._pixotron.enableAA=!1))}removeFromScene(){super.removeFromScene(),this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}}let DynamicEnvironmentSettingLoader=(()=>{class t{parse(t,e,i,s){let a=JSON.parse(s);return a.environment?this.load(t,e,i,a):null}load(t,e,i,s){let a,n=s.environment;if(!n)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(n.type){case"color":a=new Promise(e=>e(new BackgroundEnvironment(t,i,new THREE.Color(n.details.color))));break;case"image":a=new Promise(s=>s(new BackgroundEnvironment(t,i,null,e,n.details.imageUrl)));break;case"gltf":a=new Promise(e=>{let s=new GltfEnvironment(t,i);s.loadBackground(getAssetPath()+"static/PhotoStudioRoom-5b94763849f82256.glb"),e(s)});break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(n.details.material).then(s=>{let a=void 0===n.details.fog||n.details.fog,o=new FloorEnvironment(t,i,a);o.changeFloorMaterial(s).then(()=>{e(o)})})});break;case"baked_shadow":a=new Promise(s=>{n.details&&n.details.color?s(new BackgroundEnvironment(t,i,new THREE.Color(n.details.color))):n.details&&n.details.imageUrl?s(new BackgroundEnvironment(t,i,null,e,n.details.imageUrl)):s(new BakedShadowEnvironment(t,i))});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}return __decorate([inject],t.prototype,"_rapiAccess",void 0),t})();class HighPixelRatioQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(5),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class HighestQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(4),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class HighQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(3),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class MidQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(2),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class LowQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(1),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class LowestQualitySettings{constructor(){this._settings=new window.PIXOTRON.QualitySettings(0),this._settings.enableAA=!1,this._settings.useAreaLight=!1,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class PixotronUtil{constructor(t){this._sceneBoundingSphere=new THREE.Sphere,this._pixotron=t,this._initializeQualitySettings(),this._initializeQualityAdapters()}getPixotronInstance(t){const e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,bias:.02,accumulative:!1},shadowparams:{shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:100,side:THREE.FrontSide}};return t=t||e,new window.PIXOTRON.Pixotron(t)}showGUI(){let t=getGUI();if(!t)return;let e=t.addFolder("Renderer");e.add(this._pixotron.getSAOPass(),"enabled"),this._pixotron.getSAOPass().smoothTransition&&e.add(this._pixotron.getSAOPass(),"smoothTransition"),e.add(this._pixotron.getSAOPass(),"occlusionWorldRadius").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoRadius(t)}),e.add(this._pixotron.getSAOPass(),"intensity").min(.1).max(2).step(.05),e.add(this._pixotron.getSAOPass(),"bias").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoBias(t)}),this._pixotron.getSAOPass().numSamples&&e.add(this._pixotron.getSAOPass(),"numSamples").min(10).max(3e3).step(10),void 0!==this._pixotron.getShadowPass().enabled&&e.add(this._pixotron.getShadowPass(),"enabled"),e.add(this._pixotron.getShadowPass(),"smoothTransition"),e.add(this._pixotron.getShadowPass(),"enableAccumulation"),e.add(this._pixotron.getShadowPass(),"shadowRadius").min(0).max(5).step(.1),e.add(this._pixotron.getShadowPass(),"shadowBiasMultiplier").min(0).max(3).step(.01),e.add(this._pixotron.getShadowPass(),"numSamples").min(10).max(3e3).step(10)}updateBounds(t){this._sceneBoundingSphere.copy(t);const e=.25*this._getMaxSaoRadius();this._adjustSaoRadius(e);const i=2*this._getMinSaoBias();this._adjustSaoBias(i)}_getSaoRadius(){return this._sceneBoundingSphere.radius}_adjustSaoRadius(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoRadius(),s=this._getMaxSaoRadius();e.occlusionWorldRadius=Math.min(Math.max(t,i),s)}_adjustSaoBias(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoBias(),s=this._getMaxSaoBias();e.bias=Math.min(Math.max(t,i),s)}_getMinSaoRadius(){return.001*this._getSaoRadius()}_getMaxSaoRadius(){return.6*this._getSaoRadius()}_getMinSaoBias(){return.001*this._getSaoRadius()}_getMaxSaoBias(){return.01*this._getSaoRadius()}updatePixelRatio(t){const e=new THREE.Vector2;t.getDrawingBufferSize(e),this._pixotron.setSize(Math.floor(e.width),Math.floor(e.height))}getHighPixelRatioQualitySetting(){return this._highPixelRatioQualitySetting.getSettings()}getLowestQualitySetting(){return this._lowQualitySetting.getSettings()}_initializeQualitySettings(){this._highestQualitySetting=new HighestQualitySettings,this._highPixelRatioQualitySetting=new HighPixelRatioQualitySettings,this._highQualitySetting=new HighQualitySettings,this._midQualitySetting=new MidQualitySettings,this._lowQualitySetting=new LowQualitySettings,this._lowestQualitySetting=new LowestQualitySettings}_initializeQualityAdapters(){this._autoQualityAdapter=new window.PIXOTRON.AutoQualityAdapter(this._pixotron),this._autoQualityAdapter.addQuality(this._highestQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._highQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._midQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowestQualitySetting.getSettings()),this._autoQualityAdapter.setDesiredFps(20),this._manualQualityAdapter=new window.PIXOTRON.ManualQualityAdapter(this._pixotron)}onAutoQualityChange(t){this._autoQualityAdapter.onQualityChange(t)}onManualQualityChange(t){this._manualQualityAdapter.onQualityChange(t)}getAutoAdapter(){return this._autoQualityAdapter}lockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().lock()}unLockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().unLock()}enablePixotronAutoQuality(){this._currentQualityAdapter||(this._currentQualityAdapter=this._autoQualityAdapter,this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStarts(){this._currentQualityAdapter&&(this._currentQualityAdapter=this._autoQualityAdapter,this._currentQualitySetting&&(this._manualQualityAdapter.setQualitySetting(this._currentQualitySetting),this._pixotron.setQualityAdapter(this._manualQualityAdapter)),this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStops(){this._currentQualityAdapter&&(this._currentQualitySetting=this._currentQualityAdapter.getCurrentQualitySetting(),this._currentQualityAdapter=this._manualQualityAdapter,this._pixotron.setQualityAdapter(this._manualQualityAdapter),this._manualQualityAdapter.setQualitySetting(this._highestQualitySetting.getSettings()))}}var PIXOTRON_FILE_NAME="static/pi.min-0272f873b3a4380a.js";const PIXOTRON_EFFETCS=["static/CopyShader-cde53240fcc3e06e.js","static/EffectComposer-1e936e5d03ff43cc.js","static/RenderPass-bc5df3810a01b2c6.js","static/ShaderPass-31f36160e0ea282d.js","static/LuminosityHighPassShader-dd5826656142421d.js","static/OutlinePass-f4bcd337cdd89b8d.js","static/RectAreaLightUniformsLib-4b74882185efd473.js","static/GammaCorrectionShader-b3b56f244f0d1e0e.js"];export{BakedShadowEnvironment as B,CameraControl3D as C,DynamicLightSetting as D,EventDispatcher as E,FloorEnvironment as F,GltfEnvironment as G,InputManager as I,LightSetting as L,Main as M,PHOTO_STUDIO_ROOM_FILE_NAME as P,ScriptLoader as S,TWEEN_FILE_NAME as T,BackgroundEnvironment as a,PixotronUtil as b,DynamicEnvironmentSettingLoader as c,CameraControl as d,PIXOTRON_EFFETCS as e,DAT_GUI_FILE_NAME as f,PIXOTRON_FILE_NAME as g,INITIAL_PITCH as h,MIN_MOVE_DISTANCE as i};
2
+ //# sourceMappingURL=pixotron-9baf521b.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pixotron-5167229f.js","sources":["../../packages/three-build/src/dat.gui.min.js","../../packages/three-build/src/Tween.js","../../packages/configurator-core/public/geometry/PhotoStudioRoom.glb","../../node_modules/pi/pi.min.js","../../node_modules/pi/js/shaders/CopyShader.js","../../node_modules/pi/js/postprocessing/EffectComposer.js","../../node_modules/pi/js/postprocessing/RenderPass.js","../../node_modules/pi/js/postprocessing/ShaderPass.js","../../node_modules/pi/js/shaders/LuminosityHighPassShader.js","../../node_modules/pi/js/postprocessing/OutlinePass.js","../../node_modules/pi/js/lights/RectAreaLightUniformsLib.js","../../node_modules/pi/js/shaders/GammaCorrectionShader.js"],"sourcesContent":["export default \"static/dat.gui.min-b5cbb61e5c62f0bf.js\"","export default \"static/Tween-d024b02fe34f25ab.js\"","export default \"static/PhotoStudioRoom-5b94763849f82256.glb\"","export default \"static/pi.min-0272f873b3a4380a.js\"","export default \"static/CopyShader-cde53240fcc3e06e.js\"","export default \"static/EffectComposer-1e936e5d03ff43cc.js\"","export default \"static/RenderPass-bc5df3810a01b2c6.js\"","export default \"static/ShaderPass-31f36160e0ea282d.js\"","export default \"static/LuminosityHighPassShader-dd5826656142421d.js\"","export default \"static/OutlinePass-f4bcd337cdd89b8d.js\"","export default \"static/RectAreaLightUniformsLib-4b74882185efd473.js\"","export default \"static/GammaCorrectionShader-b3b56f244f0d1e0e.js\""],"names":[],"mappings":"2jBAAA,sBAAe,yDCAA,m+0BCAf,gCAAe,qhdAAA,g2QCAf,uBAAe,4DCAA,wCCAA,4CCAA,wCCAA,wCCAA,sDCAA,yCCAA,sDCAA"}
1
+ {"version":3,"file":"pixotron-9baf521b.js","sources":["../../packages/three-build/src/dat.gui.min.js","../../packages/three-build/src/Tween.js","../../packages/configurator-core/public/geometry/PhotoStudioRoom.glb","../../node_modules/pi/pi.min.js","../../node_modules/pi/js/shaders/CopyShader.js","../../node_modules/pi/js/postprocessing/EffectComposer.js","../../node_modules/pi/js/postprocessing/RenderPass.js","../../node_modules/pi/js/postprocessing/ShaderPass.js","../../node_modules/pi/js/shaders/LuminosityHighPassShader.js","../../node_modules/pi/js/postprocessing/OutlinePass.js","../../node_modules/pi/js/lights/RectAreaLightUniformsLib.js","../../node_modules/pi/js/shaders/GammaCorrectionShader.js"],"sourcesContent":["export default \"static/dat.gui.min-b5cbb61e5c62f0bf.js\"","export default \"static/Tween-d024b02fe34f25ab.js\"","export default \"static/PhotoStudioRoom-5b94763849f82256.glb\"","export default \"static/pi.min-0272f873b3a4380a.js\"","export default \"static/CopyShader-cde53240fcc3e06e.js\"","export default \"static/EffectComposer-1e936e5d03ff43cc.js\"","export default \"static/RenderPass-bc5df3810a01b2c6.js\"","export default \"static/ShaderPass-31f36160e0ea282d.js\"","export default \"static/LuminosityHighPassShader-dd5826656142421d.js\"","export default \"static/OutlinePass-f4bcd337cdd89b8d.js\"","export default \"static/RectAreaLightUniformsLib-4b74882185efd473.js\"","export default \"static/GammaCorrectionShader-b3b56f244f0d1e0e.js\""],"names":[],"mappings":"2jBAAA,sBAAe,yDCAA,m+0BCAf,gCAAe,qhdAAA,g2QCAf,uBAAe,4DCAA,wCCAA,4CCAA,wCCAA,wCCAA,sDCAA,yCCAA,sDCAA"}