@roomle/web-sdk 2.63.0 → 2.64.0-alpha.1

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 (194) hide show
  1. package/lib/{TextGeometry-d25f1fa4.js → TextGeometry-d7dcb1a8.js} +2 -2
  2. package/lib/{TextGeometry-d25f1fa4.js.map → TextGeometry-d7dcb1a8.js.map} +1 -1
  3. package/lib/{TextGeometry-f2fc57a2.nomodule.js → TextGeometry-df6eed60.nomodule.js} +2 -2
  4. package/lib/{TextGeometry-f2fc57a2.nomodule.js.map → TextGeometry-df6eed60.nomodule.js.map} +1 -1
  5. package/lib/{banana-for-scale-e7fb6c04.nomodule.js → banana-for-scale-29b25ea9.nomodule.js} +2 -2
  6. package/lib/{banana-for-scale-e7fb6c04.nomodule.js.map → banana-for-scale-29b25ea9.nomodule.js.map} +1 -1
  7. package/lib/{banana-for-scale-d5ee3dda.js → banana-for-scale-55632ac0.js} +2 -2
  8. package/lib/{banana-for-scale-d5ee3dda.js.map → banana-for-scale-55632ac0.js.map} +1 -1
  9. package/lib/{budgeteer-measure-f229f761.js → budgeteer-measure-41916468.js} +2 -2
  10. package/lib/{budgeteer-measure-f229f761.js.map → budgeteer-measure-41916468.js.map} +1 -1
  11. package/lib/budgeteer-measure.nomodule.js +1 -1
  12. package/lib/{component-dimensioning-63c673fb.nomodule.js → component-dimensioning-2c3f8e73.nomodule.js} +2 -2
  13. package/lib/component-dimensioning-2c3f8e73.nomodule.js.map +1 -0
  14. package/lib/{component-dimensioning-75e9fdfd.js → component-dimensioning-2cadd6d1.js} +2 -2
  15. package/lib/component-dimensioning-2cadd6d1.js.map +1 -0
  16. package/lib/{component-raycast-helper-6961b8e3.nomodule.js → component-raycast-helper-ee5ee90e.nomodule.js} +2 -2
  17. package/lib/component-raycast-helper-ee5ee90e.nomodule.js.map +1 -0
  18. package/lib/{component-raycast-helper-b637a254.js → component-raycast-helper-f43e9296.js} +2 -2
  19. package/lib/component-raycast-helper-f43e9296.js.map +1 -0
  20. package/lib/{configurator-640c722b.nomodule.js → configurator-41306664.nomodule.js} +2 -2
  21. package/lib/configurator-41306664.nomodule.js.map +1 -0
  22. package/lib/{configurator-74093f32.js → configurator-a643d14a.js} +2 -2
  23. package/lib/configurator-a643d14a.js.map +1 -0
  24. package/lib/configurator-main-2696b142.js +2 -0
  25. package/lib/configurator-main-2696b142.js.map +1 -0
  26. package/lib/configurator-main.nomodule.js +1 -1
  27. package/lib/{continuous-drawing-helper-bdad4f4e.nomodule.js → continuous-drawing-helper-5d3a8a98.nomodule.js} +2 -2
  28. package/lib/continuous-drawing-helper-5d3a8a98.nomodule.js.map +1 -0
  29. package/lib/{continuous-drawing-helper-38e8cce0.js → continuous-drawing-helper-c6d36132.js} +2 -2
  30. package/lib/continuous-drawing-helper-c6d36132.js.map +1 -0
  31. package/lib/{default-light-setting-8951625e.nomodule.js → default-light-setting-6ef7ed3d.nomodule.js} +2 -2
  32. package/lib/default-light-setting-6ef7ed3d.nomodule.js.map +1 -0
  33. package/lib/{default-light-setting-74881f94.js → default-light-setting-a5166832.js} +2 -2
  34. package/lib/default-light-setting-a5166832.js.map +1 -0
  35. package/lib/definitions/common-core/__tests__/image-renderer.d.ts +2 -0
  36. package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +3 -1
  37. package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +1 -1
  38. package/lib/definitions/common-core/src/webgl/renderer/environment-definition.d.ts +16 -2
  39. package/lib/definitions/common-core/src/webgl/renderer/light-source-detection.d.ts +2 -1
  40. package/lib/definitions/common-core/src/webgl/roomle-webgl-renderer.d.ts +1 -0
  41. package/lib/definitions/configurator-core/src/utils/test-helpers/utils.d.ts +2 -0
  42. package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +2 -2
  43. package/lib/definitions/planner-core/src/roomle-planner.d.ts +7 -0
  44. package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +6 -1
  45. package/lib/{dimensioning-helper-2614e50c.js → dimensioning-helper-57d93bbb.js} +2 -2
  46. package/lib/{dimensioning-helper-2614e50c.js.map → dimensioning-helper-57d93bbb.js.map} +1 -1
  47. package/lib/{dimensioning-helper-771563fa.nomodule.js → dimensioning-helper-f65c90f1.nomodule.js} +2 -2
  48. package/lib/{dimensioning-helper-771563fa.nomodule.js.map → dimensioning-helper-f65c90f1.nomodule.js.map} +1 -1
  49. package/lib/{glb-viewer-f11f3cb7.js → glb-viewer-5e349648.js} +2 -2
  50. package/lib/{glb-viewer-f11f3cb7.js.map → glb-viewer-5e349648.js.map} +1 -1
  51. package/lib/{glb-viewer-75d2e09c.nomodule.js → glb-viewer-b8dfe219.nomodule.js} +2 -2
  52. package/lib/{glb-viewer-75d2e09c.nomodule.js.map → glb-viewer-b8dfe219.nomodule.js.map} +1 -1
  53. package/lib/glb-viewer-main-9dcb6ebb.js +2 -0
  54. package/lib/glb-viewer-main-9dcb6ebb.js.map +1 -0
  55. package/lib/glb-viewer-main.nomodule.js +1 -1
  56. package/lib/legacy/{TextGeometry-6ea1a7a3.legacy.js → TextGeometry-f37411bb.legacy.js} +2 -2
  57. package/lib/legacy/{TextGeometry-6ea1a7a3.legacy.js.map → TextGeometry-f37411bb.legacy.js.map} +1 -1
  58. package/lib/legacy/{banana-for-scale-d3481724.legacy.js → banana-for-scale-eb176575.legacy.js} +2 -2
  59. package/lib/legacy/{banana-for-scale-d3481724.legacy.js.map → banana-for-scale-eb176575.legacy.js.map} +1 -1
  60. package/lib/legacy/budgeteer-measure.legacy.js +1 -1
  61. package/lib/legacy/{component-dimensioning-24a4c3cd.legacy.js → component-dimensioning-c0100b50.legacy.js} +2 -2
  62. package/lib/legacy/component-dimensioning-c0100b50.legacy.js.map +1 -0
  63. package/lib/legacy/{component-raycast-helper-401e69ee.legacy.js → component-raycast-helper-aa680c21.legacy.js} +2 -2
  64. package/lib/legacy/component-raycast-helper-aa680c21.legacy.js.map +1 -0
  65. package/lib/legacy/{configurator-72334374.legacy.js → configurator-7a114290.legacy.js} +2 -2
  66. package/lib/legacy/configurator-7a114290.legacy.js.map +1 -0
  67. package/lib/legacy/configurator-main.legacy.js +1 -1
  68. package/lib/legacy/{continuous-drawing-helper-959c9230.legacy.js → continuous-drawing-helper-25ae9853.legacy.js} +2 -2
  69. package/lib/legacy/continuous-drawing-helper-25ae9853.legacy.js.map +1 -0
  70. package/lib/legacy/{default-light-setting-5155e3b7.legacy.js → default-light-setting-7d35c4b0.legacy.js} +2 -2
  71. package/lib/legacy/default-light-setting-7d35c4b0.legacy.js.map +1 -0
  72. package/lib/legacy/{dimensioning-helper-39d0ac36.legacy.js → dimensioning-helper-9d505a2f.legacy.js} +2 -2
  73. package/lib/legacy/{dimensioning-helper-39d0ac36.legacy.js.map → dimensioning-helper-9d505a2f.legacy.js.map} +1 -1
  74. package/lib/legacy/{glb-viewer-21343679.legacy.js → glb-viewer-fcfde056.legacy.js} +2 -2
  75. package/lib/legacy/{glb-viewer-21343679.legacy.js.map → glb-viewer-fcfde056.legacy.js.map} +1 -1
  76. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  77. package/lib/legacy/{main-thread-to-worker-334452db.legacy.js → main-thread-to-worker-88746ef2.legacy.js} +2 -2
  78. package/lib/legacy/{main-thread-to-worker-334452db.legacy.js.map → main-thread-to-worker-88746ef2.legacy.js.map} +1 -1
  79. package/lib/legacy/{material-viewer-76e17b0e.legacy.js → material-viewer-6ecbbede.legacy.js} +2 -2
  80. package/lib/legacy/material-viewer-6ecbbede.legacy.js.map +1 -0
  81. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  82. package/lib/legacy/planner-5417772c.legacy.js +2 -0
  83. package/lib/legacy/{planner-118a3c2a.legacy.js.map → planner-5417772c.legacy.js.map} +1 -1
  84. package/lib/legacy/planner-main.legacy.js +1 -1
  85. package/lib/legacy/roomle-configurator-b17ee31c.legacy.js +2 -0
  86. package/lib/legacy/roomle-configurator-b17ee31c.legacy.js.map +1 -0
  87. package/lib/legacy/{roomle-dependency-injection-39c6c926.legacy.js → roomle-dependency-injection-ef0888c0.legacy.js} +3 -3
  88. package/lib/legacy/{roomle-dependency-injection-39c6c926.legacy.js.map → roomle-dependency-injection-ef0888c0.legacy.js.map} +1 -1
  89. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  90. package/lib/legacy/scene-manager-0f7a3505.legacy.js +2 -0
  91. package/lib/legacy/{scene-manager-4c49ffd2.legacy.js.map → scene-manager-0f7a3505.legacy.js.map} +1 -1
  92. package/lib/legacy/{script-loader-ac6bc6eb.legacy.js → script-loader-87105926.legacy.js} +2 -2
  93. package/lib/legacy/script-loader-87105926.legacy.js.map +1 -0
  94. package/lib/legacy/{stats-helper-c027c078.legacy.js → stats-helper-8c73c389.legacy.js} +2 -2
  95. package/lib/legacy/stats-helper-8c73c389.legacy.js.map +1 -0
  96. package/lib/legacy/{tools-core-5f513877.legacy.js → tools-core-1eb152d6.legacy.js} +2 -2
  97. package/lib/legacy/tools-core-1eb152d6.legacy.js.map +1 -0
  98. package/lib/{main-thread-to-worker-d5d5841d.js → main-thread-to-worker-a765ee2b.js} +2 -2
  99. package/lib/{main-thread-to-worker-d5d5841d.js.map → main-thread-to-worker-a765ee2b.js.map} +1 -1
  100. package/lib/{main-thread-to-worker-cce716d1.nomodule.js → main-thread-to-worker-e5396037.nomodule.js} +2 -2
  101. package/lib/{main-thread-to-worker-cce716d1.nomodule.js.map → main-thread-to-worker-e5396037.nomodule.js.map} +1 -1
  102. package/lib/{material-viewer-54c1dd62.js → material-viewer-1f1beabd.js} +2 -2
  103. package/lib/material-viewer-1f1beabd.js.map +1 -0
  104. package/lib/{material-viewer-d25178c4.nomodule.js → material-viewer-753a33c9.nomodule.js} +2 -2
  105. package/lib/material-viewer-753a33c9.nomodule.js.map +1 -0
  106. package/lib/material-viewer-main-42a973a6.js +2 -0
  107. package/lib/material-viewer-main-42a973a6.js.map +1 -0
  108. package/lib/material-viewer-main.nomodule.js +1 -1
  109. package/lib/planner-4b991932.nomodule.js +2 -0
  110. package/lib/{planner-3f3c77fa.nomodule.js.map → planner-4b991932.nomodule.js.map} +1 -1
  111. package/lib/planner-dummy-app.js +1 -1
  112. package/lib/planner-dummy-app.js.map +1 -1
  113. package/lib/planner-dummy.html +3 -0
  114. package/lib/planner-f2c9e2a7.js +2 -0
  115. package/lib/{planner-27f02e36.js.map → planner-f2c9e2a7.js.map} +1 -1
  116. package/lib/planner-main-5bf48972.js +2 -0
  117. package/lib/planner-main-5bf48972.js.map +1 -0
  118. package/lib/planner-main.nomodule.js +1 -1
  119. package/lib/roomle-configurator-1f74db84.js +2 -0
  120. package/lib/roomle-configurator-1f74db84.js.map +1 -0
  121. package/lib/roomle-configurator-73e36fea.nomodule.js +2 -0
  122. package/lib/roomle-configurator-73e36fea.nomodule.js.map +1 -0
  123. package/lib/{roomle-dependency-injection-9b7e9b99.nomodule.js → roomle-dependency-injection-a3d0213f.nomodule.js} +3 -3
  124. package/lib/{roomle-dependency-injection-9b7e9b99.nomodule.js.map → roomle-dependency-injection-a3d0213f.nomodule.js.map} +1 -1
  125. package/lib/{roomle-dependency-injection-597b90a7.js → roomle-dependency-injection-feeade2a.js} +3 -3
  126. package/lib/{roomle-dependency-injection-597b90a7.js.map → roomle-dependency-injection-feeade2a.js.map} +1 -1
  127. package/lib/{roomle-sdk-e89b8e36.js → roomle-sdk-6a954004.js} +2 -2
  128. package/lib/roomle-sdk-6a954004.js.map +1 -0
  129. package/lib/roomle-sdk.nomodule.js +1 -1
  130. package/lib/scene-manager-0c37a0a4.nomodule.js +2 -0
  131. package/lib/{scene-manager-61f9a10a.nomodule.js.map → scene-manager-0c37a0a4.nomodule.js.map} +1 -1
  132. package/lib/scene-manager-3569dc7c.js +2 -0
  133. package/lib/{scene-manager-805fb8e3.js.map → scene-manager-3569dc7c.js.map} +1 -1
  134. package/lib/{script-loader-94abc8b8.nomodule.js → script-loader-39fb0119.nomodule.js} +2 -2
  135. package/lib/script-loader-39fb0119.nomodule.js.map +1 -0
  136. package/lib/{script-loader-0175c371.js → script-loader-f6d3bde6.js} +2 -2
  137. package/lib/script-loader-f6d3bde6.js.map +1 -0
  138. package/lib/{stats-helper-208e0d5c.nomodule.js → stats-helper-c7e0d6e7.nomodule.js} +2 -2
  139. package/lib/stats-helper-c7e0d6e7.nomodule.js.map +1 -0
  140. package/lib/{stats-helper-b87f9b7a.js → stats-helper-dca14fc4.js} +2 -2
  141. package/lib/stats-helper-dca14fc4.js.map +1 -0
  142. package/lib/{tools-core-20199721.nomodule.js → tools-core-39a8e28d.nomodule.js} +2 -2
  143. package/lib/tools-core-39a8e28d.nomodule.js.map +1 -0
  144. package/lib/{tools-core-ef85325b.js → tools-core-cf5f452a.js} +2 -2
  145. package/lib/tools-core-cf5f452a.js.map +1 -0
  146. package/package.json +2 -2
  147. package/lib/component-dimensioning-63c673fb.nomodule.js.map +0 -1
  148. package/lib/component-dimensioning-75e9fdfd.js.map +0 -1
  149. package/lib/component-raycast-helper-6961b8e3.nomodule.js.map +0 -1
  150. package/lib/component-raycast-helper-b637a254.js.map +0 -1
  151. package/lib/configurator-640c722b.nomodule.js.map +0 -1
  152. package/lib/configurator-74093f32.js.map +0 -1
  153. package/lib/configurator-main-55c8e327.js +0 -2
  154. package/lib/configurator-main-55c8e327.js.map +0 -1
  155. package/lib/continuous-drawing-helper-38e8cce0.js.map +0 -1
  156. package/lib/continuous-drawing-helper-bdad4f4e.nomodule.js.map +0 -1
  157. package/lib/default-light-setting-74881f94.js.map +0 -1
  158. package/lib/default-light-setting-8951625e.nomodule.js.map +0 -1
  159. package/lib/glb-viewer-main-2dbf8c41.js +0 -2
  160. package/lib/glb-viewer-main-2dbf8c41.js.map +0 -1
  161. package/lib/legacy/component-dimensioning-24a4c3cd.legacy.js.map +0 -1
  162. package/lib/legacy/component-raycast-helper-401e69ee.legacy.js.map +0 -1
  163. package/lib/legacy/configurator-72334374.legacy.js.map +0 -1
  164. package/lib/legacy/continuous-drawing-helper-959c9230.legacy.js.map +0 -1
  165. package/lib/legacy/default-light-setting-5155e3b7.legacy.js.map +0 -1
  166. package/lib/legacy/material-viewer-76e17b0e.legacy.js.map +0 -1
  167. package/lib/legacy/planner-118a3c2a.legacy.js +0 -2
  168. package/lib/legacy/roomle-configurator-7291a081.legacy.js +0 -2
  169. package/lib/legacy/roomle-configurator-7291a081.legacy.js.map +0 -1
  170. package/lib/legacy/scene-manager-4c49ffd2.legacy.js +0 -2
  171. package/lib/legacy/script-loader-ac6bc6eb.legacy.js.map +0 -1
  172. package/lib/legacy/stats-helper-c027c078.legacy.js.map +0 -1
  173. package/lib/legacy/tools-core-5f513877.legacy.js.map +0 -1
  174. package/lib/material-viewer-54c1dd62.js.map +0 -1
  175. package/lib/material-viewer-d25178c4.nomodule.js.map +0 -1
  176. package/lib/material-viewer-main-65a30660.js +0 -2
  177. package/lib/material-viewer-main-65a30660.js.map +0 -1
  178. package/lib/planner-27f02e36.js +0 -2
  179. package/lib/planner-3f3c77fa.nomodule.js +0 -2
  180. package/lib/planner-main-fc563f29.js +0 -2
  181. package/lib/planner-main-fc563f29.js.map +0 -1
  182. package/lib/roomle-configurator-4d92e806.js +0 -2
  183. package/lib/roomle-configurator-4d92e806.js.map +0 -1
  184. package/lib/roomle-configurator-b3473d62.nomodule.js +0 -2
  185. package/lib/roomle-configurator-b3473d62.nomodule.js.map +0 -1
  186. package/lib/roomle-sdk-e89b8e36.js.map +0 -1
  187. package/lib/scene-manager-61f9a10a.nomodule.js +0 -2
  188. package/lib/scene-manager-805fb8e3.js +0 -2
  189. package/lib/script-loader-0175c371.js.map +0 -1
  190. package/lib/script-loader-94abc8b8.nomodule.js.map +0 -1
  191. package/lib/stats-helper-208e0d5c.nomodule.js.map +0 -1
  192. package/lib/stats-helper-b87f9b7a.js.map +0 -1
  193. package/lib/tools-core-20199721.nomodule.js.map +0 -1
  194. package/lib/tools-core-ef85325b.js.map +0 -1
@@ -1,9 +1,9 @@
1
- System.register(["./main-thread-to-worker-334452db.legacy.js"],(function(e,t){var n,r,a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De=e.av,Oe=e.aw,Le=e.ax,Ue=e.ay,Fe=e.az,Ne=e.aA,Be=e.aB,ze=e.aC,He=e.aD,je=e.aE,Ve=e.aF,Ge=e.aG,Ke=e.aH,We=e.aI,Xe=e.aJ,qe=e.aK,Qe=e.aL,Ye=e.aM,Ze=e.aN,Je=e.aO,$e=e.aP,et=e.aQ,tt=e.aR,nt=e.aS,rt=e.aT,at=e.aU,it=e.aV,st=e.aW,ot=e.aX,lt=e.aY,ht=e.aZ,dt=e.a_,ct=e.a$,ut=e.b0,pt=e.b1,mt=e.b2,ft=e.b3,gt=e.b4,vt=e.b5,_t=e.b6,wt=e.b7,bt=e.b8,yt=e.b9,xt=e.ba,St=e.bb,Ct=e.bc,Mt=e.bd,Tt=e.be,At=e.bf,Pt=e.bg,Rt=e.bh,Et=e.bi,It=e.bj,kt=e.bk,Dt=e.bl,Ot=e.bm,Lt=e.bn,Ut=e.bo,Ft=e.bp,Nt=e.bq,Bt=e.br,zt=e.bs,Ht=e.bt,jt=e.bu,Vt=e.bv,Gt=e.bw,Kt=e.bx,Wt=e.by,Xt=e.bz,qt=e.bA,Qt=e.bB,Yt=e.bC,Zt=e.bD,Jt=e.bE,$t=e.bF,en=e.bG}],execute:function(){e({_:pn,i:fn,x:Es});class tn{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let r=t&&1===n.type?t:"global";if(r+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(r))return this._singletons.get(r);const a=new n.classDefinition(t);return this._singletons.set(r,a),a}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,r)=>{r.startsWith(e)&&t.push(r)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class nn{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}e("D",nn);const rn={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class an{_base64toBlob(e,t){t=t||"";const n=atob(e),r=n.length,a=Math.ceil(r/1024),i=new Array(a);for(let e=0;e<a;++e){let t=1024*e,a=Math.min(t+1024,r);const s=new Array(a-t);for(let e=t,r=0;e<a;++r,++e)s[r]=n[e].charCodeAt(0);i[e]=new Uint8Array(s)}return new Blob(i,{type:t})}_createFormData(e,t,n,r){const a=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const i=-1===Object.keys(rn).map(e=>rn[e]).indexOf(n)?"application":"image",s=this._base64toBlob(e,i+"/"+n.substr(1));return a.append(r,s,t+n),a}create(e,t,n,r){return this._createFormData(e,t,n,r)}}const sn=e("q",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class on{static createDynamicLightSettingSource(e,t){let r={};if(e)r.url=e;else if(t)switch(t){case sn.SHELF:r.url=n()+"static/shelf-2975dd3f2fa9c763.json";break;case sn.SHELF_FRONT:r.url=n()+"static/shelf_front-8c9566a4512f0de8.json";break;case sn.SOFA:r.url=n()+"static/sofa-997b116bc5f2e92e.json";break;case sn.BAKED:r.url=n()+"static/baked-6485a2b1daeb69e8.json";break;case sn.CAMERA:r.url=n()+"static/camera-05824b47cdb951e4.json";break;case sn.EQUAL:r.url=n()+"static/equal-319f6b83c827913f.json";break;default:r.url=n()+"static/camera-05824b47cdb951e4.json"}else r=null;return r}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new r;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let{intensity:t,castShadow:n,target:r,width:l,height:h}=e,d=null;if(n&&on.rectAreaLightReplacement){const n=new a;this._parseCommon(n,e),d=n,n.castShadow=!0,n.shadow.camera.near=.1,n.shadow.camera.far=100,n.shadow.mapSize=new i(1024,1024),n.shadow.bias=-5e-5,n.shadow.normalBias=.01,n.intensity=t?t/100:1,n.lookAt(r?new s(r.x,r.y,r.z):new s(0,0,0))}else{const n=new o;this._parseCommon(n,e),d=n,n.width=l||.8,n.height=h||.8,n.castShadow=!1,n.matrixAutoUpdate=!0,n.intensity=(t||240)/((l||.8)*(h||.8)),n.lookAt(r?new s(r.x,r.y,r.z):new s(0,0,0)),on.rectAreaLightLoadingListener&&on.rectAreaLightLoadingListener(n)}return d}_parseSpotLight(e){let t=new l;this._parseCommon(t,e);let{angle:n,penumbra:r,target:a,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=r||.5,t.lookAt(a?new s(a.x,a.y,a.z):new s(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new i(1024,1024),t.castShadow=o||!1,t}_parseDirectionalLight(e){let t=new a;this._parseCommon(t,e);let{target:n,castShadow:r}=e;return t.castShadow=r||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new i(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new s(n.x,n.y,n.z):new s(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:r,color:a,position:i,movesWithCamera:o}=t;e.name=n||"",e.intensity=r||1,e.color=new h(a||"#ffffff"),e.position.copy(i?new s(i.x,i.y,i.z):new s(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=o}}e("p",on),on.rectAreaLightReplacement=!0;const ln=["127.0.0.1","localhost","0.0.0.0"],hn=(e("H",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("G",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),dn=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,cn=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class un{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={},n={}){return this._pendingRequests+=1,new Promise((r,a)=>{self.fetch(e,t).then(async function(e){this._nextSlot();const t=!n.checkResponse||!1!==await n.checkResponse(e);if(cn(e.ok,e.status)&&t)r(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";a(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),a(e)})})}fetch(e,t={},n={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t,n)}}function pn(e,t,n,r){var a,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,n,s):a(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}"function"==typeof SuppressedError&&SuppressedError;const mn=function(e){return e.startsWith("_")&&(e=e.substr(1)),e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(function(e,t){return(t>0?"-":"")+e.toLowerCase()}))};function fn(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(mn(t),this._creator_);e?this[n]=e:console.error("Dependency "+mn(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}class gn{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",gn);class vn extends gn{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}pn([fn],vn.prototype,"_globalCallback",void 0);const _n=new Map,wn=new Map,bn=new Map,yn=new Map;class xn{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{yn.set(e,!0),this._configuratorUiCallbacks.onSyncDone()})})}syncCatalog(e){return this._startWorker().then(()=>this._handleCatalog(e))}syncFloorTag(e){return this._startWorker().then(()=>this._syncFloorTag(e))}syncTypeChangeTag(e){return this._startWorker().then(()=>this._syncTypeChangeTag(e))}_syncFloorTag(e){const t=[];return e&&!bn.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{t.push(this._handleMaterialsAndTextures(e))}),this._singlePromiseFactory.create(1,e,n=>{Promise.all(t).then(()=>{bn.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!yn.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{this._rapiAccess.getItems(e.items).then(e=>{e.forEach(e=>{this.getIsCatalogSynced(e.catalog)&&t.push(this._handleCatalog(e.catalog))})})}),this._singlePromiseFactory.create(2,e,n=>{Promise.all(t).then(()=>{bn.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!wn.get(e)}_startWorker(){return new Promise((e,t)=>{if(this._isStarted)return e();this._bootCallbacks.push({resolve:e,reject:t}),this._isStarting||(this._worker=new Worker(n()+"static/asset-loader.worker-1735a5fb1e401244.js"),this._mainThreadToWorker=new d(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{wn.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let r=0,a=e.length;r<a;r++){const a=e[r];t.forEach(e=>{const t=a[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(_n.get(e))return t();this._assetUrlToBase64(e).then(n=>{_n.set(e,n),t()},e=>this._softReject(t,'_preCacheAsset error: "'+e+'"'))})}_assetUrlToBase64(e){return new Promise(t=>{this._mainThreadToWorker.sendToWorker(5,e,t,e=>this._softReject(t,'_assetUrlToBase64 error: "'+e+'"'))})}_softReject(e,t){this._errorHandler.softReject(e,t,2)}requestAsset(e,t=!1){return navigator.onLine&&!this._alwaysUseCache?e:_n.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){_n.set(e,t)}}e("a",xn),pn([fn],xn.prototype,"_rapiAccess",void 0),pn([fn],xn.prototype,"_singlePromiseFactory",void 0),pn([fn],xn.prototype,"_errorHandler",void 0),pn([fn],xn.prototype,"_configuratorUiCallbacks",void 0),pn([fn],xn.prototype,"_initData",void 0);class Sn{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}function Cn(e){for(var t,n,r,a=-1,i=0,s=0;s<e.length;++s){var o=e[s];if(o.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===a&&(a=o.gpuType),a!==o.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;i+=o.array.length}for(var l=new t(i),h=0,d=0;d<e.length;++d)l.set(e[d].array,h),h+=e[d].array.length;var c=new u(l,n,r);return void 0!==a&&(c.gpuType=a),c}function Mn(e,t){if(t===p)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===m||t===f){var n=e.getIndex();if(null===n){var r=[],a=e.getAttribute("position");if(void 0===a)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var i=0;i<a.count;i++)r.push(i);e.setIndex(r),n=e.getIndex()}var s=n.count-2,o=[];if(t===m)for(var l=1;l<=s;l++)o.push(n.getX(0)),o.push(n.getX(l)),o.push(n.getX(l+1));else for(var h=0;h<s;h++)h%2==0?(o.push(n.getX(h)),o.push(n.getX(h+1)),o.push(n.getX(h+2))):(o.push(n.getX(h+2)),o.push(n.getX(h+1)),o.push(n.getX(h)));o.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var d=e.clone();return d.setIndex(o),d.clearGroups(),d}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}e("ad",Sn);var Tn=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).dracoLoader=null,r.ktx2Loader=null,r.meshoptDecoder=null,r.pluginCallbacks=[],r.register((function(e){return new kn(e)})),r.register((function(e){return new zn(e)})),r.register((function(e){return new Hn(e)})),r.register((function(e){return new jn(e)})),r.register((function(e){return new On(e)})),r.register((function(e){return new Ln(e)})),r.register((function(e){return new Un(e)})),r.register((function(e){return new Fn(e)})),r.register((function(e){return new In(e)})),r.register((function(e){return new Nn(e)})),r.register((function(e){return new Dn(e)})),r.register((function(e){return new Bn(e)})),r.register((function(e){return new Rn(e)})),r.register((function(e){return new Vn(e)})),r.register((function(e){return new Gn(e)})),r}return w(n,[{key:"load",value:function(e,t,n,r){var a,i=this;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:b.extractUrlBase(e),this.manager.itemStart(e);var s=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},o=new y(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{i.parse(n,a,(function(n){t(n),i.manager.itemEnd(e)}),s)}catch(e){s(e)}}),n,s)}},{key:"setDRACOLoader",value:function(e){return this.dracoLoader=e,this}},{key:"setDDSLoader",value:function(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}},{key:"setKTX2Loader",value:function(e){return this.ktx2Loader=e,this}},{key:"setMeshoptDecoder",value:function(e){return this.meshoptDecoder=e,this}},{key:"register",value:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}},{key:"unregister",value:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}},{key:"parse",value:function(e,t,n,r){var a,i={},s={},o=new TextDecoder;if("string"==typeof e)a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(o.decode(new Uint8Array(e,0,4))===Kn){try{i[Pn.KHR_BINARY_GLTF]=new Wn(e)}catch(e){return void(r&&r(e))}a=JSON.parse(i[Pn.KHR_BINARY_GLTF].content)}else a=JSON.parse(o.decode(e));else a=e;if(void 0===a.asset||a.asset.version[0]<2)r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var l=new mr(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(var h=0;h<this.pluginCallbacks.length;h++){var d=this.pluginCallbacks[h](l);s[d.name]=d,i[d.name]=!0}if(a.extensionsUsed)for(var c=0;c<a.extensionsUsed.length;++c){var u=a.extensionsUsed[c],p=a.extensionsRequired||[];switch(u){case Pn.KHR_MATERIALS_UNLIT:i[u]=new En;break;case Pn.KHR_DRACO_MESH_COMPRESSION:i[u]=new Xn(a,this.dracoLoader);break;case Pn.KHR_TEXTURE_TRANSFORM:i[u]=new qn;break;case Pn.KHR_MESH_QUANTIZATION:i[u]=new Qn;break;default:p.indexOf(u)>=0&&void 0===s[u]&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(i),l.setPlugins(s),l.parse(n,r)}}},{key:"parseAsync",value:function(e,t){var n=this;return new Promise((function(r,a){n.parse(e,t,r,a)}))}}]),n}(x);function An(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Pn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},Rn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}return w(e,[{key:"_markDefs",value:function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,r=t.length;n<r;n++){var a=t[n];a.extensions&&a.extensions[this.name]&&void 0!==a.extensions[this.name].light&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}},{key:"_loadLight",value:function(e){var t=this.parser,n="light:"+e,r=t.cache.get(n);if(r)return r;var i,s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e],d=new h(16777215);void 0!==o.color&&d.fromArray(o.color);var c=void 0!==o.range?o.range:0;switch(o.type){case"directional":(i=new a(d)).target.position.set(0,0,-1),i.add(i.target);break;case"point":(i=new S(d)).distance=c;break;case"spot":(i=new l(d)).distance=c,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,i.angle=o.spot.outerConeAngle,i.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,i.target.position.set(0,0,-1),i.add(i.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return i.position.set(0,0,0),i.decay=2,lr(i,o),void 0!==o.intensity&&(i.intensity=o.intensity),i.name=t.createUniqueName(o.name||"light_"+e),r=Promise.resolve(i),t.cache.add(n,r),r}},{key:"getDependency",value:function(e,t){if("light"===e)return this._loadLight(t)}},{key:"createNodeAttachment",value:function(e){var t=this,n=this.parser,r=n.json.nodes[e],a=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===a?null:this._loadLight(a).then((function(e){return n._getNodeRef(t.cache,a,e)}))}}]),e}(),En=function(){function e(){_(this,e),this.name=Pn.KHR_MATERIALS_UNLIT}return w(e,[{key:"getMaterialType",value:function(){return C}},{key:"extendParams",value:function(e,t,n){var r=[];e.color=new h(1,1,1),e.opacity=1;var a=t.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){var i=a.baseColorFactor;e.color.fromArray(i),e.opacity=i[3]}void 0!==a.baseColorTexture&&r.push(n.assignTexture(e,"map",a.baseColorTexture,M))}return Promise.all(r)}}]),e}(),In=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_EMISSIVE_STRENGTH}return w(e,[{key:"extendMaterialParams",value:function(e,t){var n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();var r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}]),e}(),kn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_CLEARCOAT}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&a.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&a.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(a.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){var o=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new i(o,o)}return Promise.all(a)}}]),e}(),Dn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_IRIDESCENCE}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];return void 0!==i.iridescenceFactor&&(t.iridescence=i.iridescenceFactor),void 0!==i.iridescenceTexture&&a.push(n.assignTexture(t,"iridescenceMap",i.iridescenceTexture)),void 0!==i.iridescenceIor&&(t.iridescenceIOR=i.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==i.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),void 0!==i.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),void 0!==i.iridescenceThicknessTexture&&a.push(n.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(a)}}]),e}(),On=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_SHEEN}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[];t.sheenColor=new h(0,0,0),t.sheenRoughness=0,t.sheen=1;var i=r.extensions[this.name];return void 0!==i.sheenColorFactor&&t.sheenColor.fromArray(i.sheenColorFactor),void 0!==i.sheenRoughnessFactor&&(t.sheenRoughness=i.sheenRoughnessFactor),void 0!==i.sheenColorTexture&&a.push(n.assignTexture(t,"sheenColorMap",i.sheenColorTexture,M)),void 0!==i.sheenRoughnessTexture&&a.push(n.assignTexture(t,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(a)}}]),e}(),Ln=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_TRANSMISSION}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];return void 0!==i.transmissionFactor&&(t.transmission=i.transmissionFactor),void 0!==i.transmissionTexture&&a.push(n.assignTexture(t,"transmissionMap",i.transmissionTexture)),Promise.all(a)}}]),e}(),Un=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_VOLUME}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];t.thickness=void 0!==i.thicknessFactor?i.thicknessFactor:0,void 0!==i.thicknessTexture&&a.push(n.assignTexture(t,"thicknessMap",i.thicknessTexture)),t.attenuationDistance=i.attenuationDistance||1/0;var s=i.attenuationColor||[1,1,1];return t.attenuationColor=new h(s[0],s[1],s[2]),Promise.all(a)}}]),e}(),Fn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_IOR}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();var r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}]),e}(),Nn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_SPECULAR}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];t.specularIntensity=void 0!==i.specularFactor?i.specularFactor:1,void 0!==i.specularTexture&&a.push(n.assignTexture(t,"specularIntensityMap",i.specularTexture));var s=i.specularColorFactor||[1,1,1];return t.specularColor=new h(s[0],s[1],s[2]),void 0!==i.specularColorTexture&&a.push(n.assignTexture(t,"specularColorMap",i.specularColorTexture,M)),Promise.all(a)}}]),e}(),Bn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_ANISOTROPY}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];return void 0!==i.anisotropyStrength&&(t.anisotropy=i.anisotropyStrength),void 0!==i.anisotropyRotation&&(t.anisotropyRotation=i.anisotropyRotation),void 0!==i.anisotropyTexture&&a.push(n.assignTexture(t,"anisotropyMap",i.anisotropyTexture)),Promise.all(a)}}]),e}(),zn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_TEXTURE_BASISU}return w(e,[{key:"loadTexture",value:function(e){var t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;var a=r.extensions[this.name],i=t.options.ktx2Loader;if(!i){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,i)}}]),e}(),Hn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.EXT_TEXTURE_WEBP,this.isSupported=null}return w(e,[{key:"loadTexture",value:function(e){var t=this.name,n=this.parser,r=n.json,a=r.textures[e];if(!a.extensions||!a.extensions[t])return null;var i=a.extensions[t],s=r.images[i.source],o=n.textureLoader;if(s.uri){var l=n.options.manager.getHandler(s.uri);null!==l&&(o=l)}return this.detectSupport().then((function(a){if(a)return n.loadTextureImage(e,i.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}},{key:"detectSupport",value:function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}]),e}(),jn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.EXT_TEXTURE_AVIF,this.isSupported=null}return w(e,[{key:"loadTexture",value:function(e){var t=this.name,n=this.parser,r=n.json,a=r.textures[e];if(!a.extensions||!a.extensions[t])return null;var i=a.extensions[t],s=r.images[i.source],o=n.textureLoader;if(s.uri){var l=n.options.manager.getHandler(s.uri);null!==l&&(o=l)}return this.detectSupport().then((function(a){if(a)return n.loadTextureImage(e,i.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)}))}},{key:"detectSupport",value:function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}]),e}(),Vn=function(){function e(t){_(this,e),this.name=Pn.EXT_MESHOPT_COMPRESSION,this.parser=t}return w(e,[{key:"loadBufferView",value:function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],a=this.parser.getDependency("buffer",r.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then((function(e){var t=r.byteOffset||0,n=r.byteLength||0,a=r.count,s=r.byteStride,o=new Uint8Array(e,t,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,s,o,r.mode,r.filter).then((function(e){return e.buffer})):i.ready.then((function(){var e=new ArrayBuffer(a*s);return i.decodeGltfBuffer(new Uint8Array(e),a,s,o,r.mode,r.filter),e}))}))}return null}}]),e}(),Gn=function(){function e(t){_(this,e),this.name=Pn.EXT_MESH_GPU_INSTANCING,this.parser=t}return w(e,[{key:"createNodeMesh",value:function(e){var t=this,n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;var a,i=n.meshes[r.mesh],o=A(i.primitives);try{for(o.s();!(a=o.n()).done;){var l=a.value;if(l.mode!==$n.TRIANGLES&&l.mode!==$n.TRIANGLE_STRIP&&l.mode!==$n.TRIANGLE_FAN&&void 0!==l.mode)return null}}catch(e){o.e(e)}finally{o.f()}var h=r.extensions[this.name].attributes,d=[],c={},u=function(e){d.push(t.parser.getDependency("accessor",h[e]).then((function(t){return c[e]=t,c[e]})))};for(var p in h)u(p);return d.length<1?null:(d.push(this.parser.createNodeMesh(e)),Promise.all(d).then((function(e){var n,r=e.pop(),a=r.isGroup?r.children:[r],i=e[0].count,o=[],l=A(a);try{for(l.s();!(n=l.n()).done;){for(var h=n.value,d=new P,u=new s,p=new R,m=new s(1,1,1),f=new E(h.geometry,h.material,i),g=0;g<i;g++)c.TRANSLATION&&u.fromBufferAttribute(c.TRANSLATION,g),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,g),c.SCALE&&m.fromBufferAttribute(c.SCALE,g),f.setMatrixAt(g,d.compose(u,p,m));for(var v in c)"TRANSLATION"!==v&&"ROTATION"!==v&&"SCALE"!==v&&h.geometry.setAttribute(v,c[v]);I.prototype.copy.call(f,h),t.parser.assignFinalMaterial(f),o.push(f)}}catch(e){l.e(e)}finally{l.f()}return r.isGroup?(r.clear(),r.add.apply(r,o),r):o[0]})))}}]),e}(),Kn="glTF",Wn=w((function e(t){_(this,e),this.name=Pn.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,12),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==Kn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=this.header.length-12,i=new DataView(t,12),s=0;s<a;){var o=i.getUint32(s,!0);s+=4;var l=i.getUint32(s,!0);if(s+=4,1313821514===l){var h=new Uint8Array(t,12+s,o);this.content=r.decode(h)}else if(5130562===l){var d=12+s;this.body=t.slice(d,d+o)}s+=o}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")})),Xn=function(){function e(t,n){if(_(this,e),!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Pn.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}return w(e,[{key:"decodePrimitive",value:function(e,t){var n=this.json,r=this.dracoLoader,a=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,s={},o={},l={};for(var h in i){var d=ar[h]||h.toLowerCase();s[d]=i[h]}for(var c in e.attributes){var u=ar[c]||c.toLowerCase();if(void 0!==i[c]){var p=n.accessors[e.attributes[c]],m=er[p.componentType];l[u]=m.name,o[u]=!0===p.normalized}}return t.getDependency("bufferView",a).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(var n in e.attributes){var r=e.attributes[n],a=o[n];void 0!==a&&(r.normalized=a)}t(e)}),s,l)}))}))}}]),e}(),qn=function(){function e(){_(this,e),this.name=Pn.KHR_TEXTURE_TRANSFORM}return w(e,[{key:"extendTexture",value:function(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}]),e}(),Qn=w((function e(){_(this,e),this.name=Pn.KHR_MESH_QUANTIZATION})),Yn=function(e){g(n,e);var t=v(n);function n(e,r,a,i){return _(this,n),t.call(this,e,r,a,i)}return w(n,[{key:"copySampleValue_",value:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,a=e*r*3+r,i=0;i!==r;i++)t[i]=n[a+i];return t}},{key:"interpolate_",value:function(e,t,n,r){for(var a=this.resultBuffer,i=this.sampleValues,s=this.valueSize,o=2*s,l=3*s,h=r-t,d=(n-t)/h,c=d*d,u=c*d,p=e*l,m=p-l,f=-2*u+3*c,g=u-c,v=1-f,_=g-c+d,w=0;w!==s;w++){var b=i[m+w+s],y=i[m+w+o]*h,x=i[p+w+s],S=i[p+w]*h;a[w]=v*b+_*y+f*x+g*S}return a}}]),n}(ye),Zn=new R,Jn=function(e){g(n,e);var t=v(n);function n(){return _(this,n),t.apply(this,arguments)}return w(n,[{key:"interpolate_",value:function(e,t,r,a){var i=xe(Se(n.prototype),"interpolate_",this).call(this,e,t,r,a);return Zn.fromArray(i).normalize().toArray(i),i}}]),n}(Yn),$n={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},er={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},tr={9728:ae,9729:L,9984:ie,9985:se,9986:oe,9987:U},nr={33071:le,33648:he,10497:F},rr={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ar={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ir={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},sr={CUBICSPLINE:void 0,LINEAR:re,STEP:de};function or(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function lr(e,t){void 0!==t.extras&&("object"===k(t.extras)?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function hr(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var a=t.extras.targetNames;if(e.morphTargetInfluences.length===a.length){e.morphTargetDictionary={};for(var i=0,s=a.length;i<s;i++)e.morphTargetDictionary[a[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function dr(e){var t,n=e.extensions&&e.extensions[Pn.KHR_DRACO_MESH_COMPRESSION];if(t=n?"draco:"+n.bufferView+":"+n.indices+":"+cr(n.attributes):e.indices+":"+cr(e.attributes)+":"+e.mode,void 0!==e.targets)for(var r=0,a=e.targets.length;r<a;r++)t+=":"+cr(e.targets[r]);return t}function cr(e){for(var t="",n=Object.keys(e).sort(),r=0,a=n.length;r<a;r++)t+=n[r]+":"+e[n[r]]+";";return t}function ur(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}var pr=new P,mr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_(this,e),this.json=t,this.extensions={},this.plugins={},this.options=n,this.cache=new An,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};var r=!1,a=!1,i=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=(a=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||a&&i<98?this.textureLoader=new ue(this.options.manager):this.textureLoader=new pe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new y(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}return w(e,[{key:"setExtensions",value:function(e){this.extensions=e}},{key:"setPlugins",value:function(e){this.plugins=e}},{key:"parse",value:function(e,t){var n=this,r=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){var i={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};or(a,i,r),lr(i,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(i)}))).then((function(){e(i)}))})).catch(t)}},{key:"_markDefs",value:function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r=0,a=t.length;r<a;r++)for(var i=t[r].joints,s=0,o=i.length;s<o;s++)e[i[s]].isBone=!0;for(var l=0,h=e.length;l<h;l++){var d=e[l];void 0!==d.mesh&&(this._addNodeRef(this.meshCache,d.mesh),void 0!==d.skin&&(n[d.mesh].isSkinnedMesh=!0)),void 0!==d.camera&&this._addNodeRef(this.cameraCache,d.camera)}}},{key:"_addNodeRef",value:function(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}},{key:"_getNodeRef",value:function(e,t,n){var r=this;if(e.refs[t]<=1)return n;var a=n.clone();return function e(t,n){var a=r.associations.get(t);null!=a&&r.associations.set(n,a);var i,s=A(t.children.entries());try{for(s.s();!(i=s.n()).done;){var o=me(i.value,2),l=o[0];e(o[1],n.children[l])}}catch(e){s.e(e)}finally{s.f()}}(n,a),a.name+="_instance_"+e.uses[t]++,a}},{key:"_invokeOne",value:function(e){var t=Object.values(this.plugins);t.push(this);for(var n=0;n<t.length;n++){var r=e(t[n]);if(r)return r}return null}},{key:"_invokeAll",value:function(e){var t=Object.values(this.plugins);t.unshift(this);for(var n=[],r=0;r<t.length;r++){var a=e(t[r]);a&&n.push(a)}return n}},{key:"getDependency",value:function(e,t){var n=e+":"+t,r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:if(!(r=this._invokeOne((function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}))))throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}},{key:"getDependencies",value:function(e){var t=this.cache.get(e);if(!t){var n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}},{key:"loadBuffer",value:function(e){var t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[Pn.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(e,a){n.load(b.resolveURL(t.uri,r.path),e,void 0,(function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}},{key:"loadBufferView",value:function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}},{key:"loadAccessor",value:function(e){var t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){var a=rr[r.type],i=er[r.componentType],s=!0===r.normalized,o=new i(r.count*a);return Promise.resolve(new u(o,a,s))}var l=[];return void 0!==r.bufferView?l.push(this.getDependency("bufferView",r.bufferView)):l.push(null),void 0!==r.sparse&&(l.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),l.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(l).then((function(e){var a,i,s=e[0],o=rr[r.type],l=er[r.componentType],h=l.BYTES_PER_ELEMENT,d=h*o,c=r.byteOffset||0,p=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,m=!0===r.normalized;if(p&&p!==d){var f=Math.floor(c/p),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+f+":"+r.count,v=t.cache.get(g);v||(a=new l(s,f*p,r.count*p/h),v=new D(a,p/h),t.cache.add(g,v)),i=new O(v,o,c%p/h,m)}else a=null===s?new l(r.count*o):new l(s,c,r.count*o),i=new u(a,o,m);if(void 0!==r.sparse){var _=rr.SCALAR,w=er[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,y=r.sparse.values.byteOffset||0,x=new w(e[1],b,r.sparse.count*_),S=new l(e[2],y,r.sparse.count*o);null!==s&&(i=new u(i.array.slice(),i.itemSize,i.normalized));for(var C=0,M=x.length;C<M;C++){var T=x[C];if(i.setX(T,S[C*o]),o>=2&&i.setY(T,S[C*o+1]),o>=3&&i.setZ(T,S[C*o+2]),o>=4&&i.setW(T,S[C*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i}))}},{key:"loadTexture",value:function(e){var t=this.json,n=this.options,r=t.textures[e].source,a=t.images[r],i=this.textureLoader;if(a.uri){var s=n.manager.getHandler(a.uri);null!==s&&(i=s)}return this.loadTextureImage(e,r,i)}},{key:"loadTextureImage",value:function(e,t,n){var r=this,a=this.json,i=a.textures[e],s=a.images[t],o=(s.uri||s.bufferView)+":"+i.sampler;if(this.textureCache[o])return this.textureCache[o];var l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=i.name||s.name||"",""===t.name&&"string"==typeof s.uri&&!1===s.uri.startsWith("data:image/")&&(t.name=s.uri);var n=(a.samplers||{})[i.sampler]||{};return t.magFilter=tr[n.magFilter]||L,t.minFilter=tr[n.minFilter]||U,t.wrapS=nr[n.wrapS]||F,t.wrapT=nr[n.wrapT]||F,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[o]=l,l}},{key:"loadImageSource",value:function(e,t){var n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((function(e){return e.clone()}));var a=n.images[e],i=self.URL||self.webkitURL,s=a.uri||"",o=!1;if(void 0!==a.bufferView)s=this.getDependency("bufferView",a.bufferView).then((function(e){o=!0;var t=new Blob([e],{type:a.mimeType});return s=i.createObjectURL(t)}));else if(void 0===a.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");var l=Promise.resolve(s).then((function(e){return new Promise((function(n,a){var i=n;!0===t.isImageBitmapLoader&&(i=function(e){var t=new fe(e);t.needsUpdate=!0,n(t)}),t.load(b.resolveURL(e,r.path),i,void 0,a)}))})).then((function(e){var t;return!0===o&&i.revokeObjectURL(s),e.userData.mimeType=a.mimeType||((t=a.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e}));return this.sourceCache[e]=l,l}},{key:"assignTexture",value:function(e,t,n,r){var a=this;return this.getDependency("texture",n.index).then((function(i){if(!i)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((i=i.clone()).channel=n.texCoord),a.extensions[Pn.KHR_TEXTURE_TRANSFORM]){var s=void 0!==n.extensions?n.extensions[Pn.KHR_TEXTURE_TRANSFORM]:void 0;if(s){var o=a.associations.get(i);i=a.extensions[Pn.KHR_TEXTURE_TRANSFORM].extendTexture(i,s),a.associations.set(i,o)}}return void 0!==r&&(i.colorSpace=r),e[t]=i,i}))}},{key:"assignFinalMaterial",value:function(e){var t=e.geometry,n=e.material,r=void 0===t.attributes.tangent,a=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){var s="PointsMaterial:"+n.uuid,o=this.cache.get(s);o||(o=new N,B.prototype.copy.call(o,n),o.color.copy(n.color),o.map=n.map,o.sizeAttenuation=!1,this.cache.add(s,o)),n=o}else if(e.isLine){var l="LineBasicMaterial:"+n.uuid,h=this.cache.get(l);h||(h=new z,B.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(l,h)),n=h}if(r||a||i){var d="ClonedMaterial:"+n.uuid+":";r&&(d+="derivative-tangents:"),a&&(d+="vertex-colors:"),i&&(d+="flat-shading:");var c=this.cache.get(d);c||(c=n.clone(),a&&(c.vertexColors=!0),i&&(c.flatShading=!0),r&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(d,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}},{key:"getMaterialType",value:function(){return H}},{key:"loadMaterial",value:function(e){var t,n=this,r=this.json,a=this.extensions,s=r.materials[e],o={},l=[];if((s.extensions||{})[Pn.KHR_MATERIALS_UNLIT]){var d=a[Pn.KHR_MATERIALS_UNLIT];t=d.getMaterialType(),l.push(d.extendParams(o,s,n))}else{var c=s.pbrMetallicRoughness||{};if(o.color=new h(1,1,1),o.opacity=1,Array.isArray(c.baseColorFactor)){var u=c.baseColorFactor;o.color.fromArray(u),o.opacity=u[3]}void 0!==c.baseColorTexture&&l.push(n.assignTexture(o,"map",c.baseColorTexture,M)),o.metalness=void 0!==c.metallicFactor?c.metallicFactor:1,o.roughness=void 0!==c.roughnessFactor?c.roughnessFactor:1,void 0!==c.metallicRoughnessTexture&&(l.push(n.assignTexture(o,"metalnessMap",c.metallicRoughnessTexture)),l.push(n.assignTexture(o,"roughnessMap",c.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===s.doubleSided&&(o.side=j);var p=s.alphaMode||"OPAQUE";if("BLEND"===p?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===p&&(o.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&t!==C&&(l.push(n.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new i(1,1),void 0!==s.normalTexture.scale)){var m=s.normalTexture.scale;o.normalScale.set(m,m)}return void 0!==s.occlusionTexture&&t!==C&&(l.push(n.assignTexture(o,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(o.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&t!==C&&(o.emissive=(new h).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&t!==C&&l.push(n.assignTexture(o,"emissiveMap",s.emissiveTexture,M)),Promise.all(l).then((function(){var r=new t(o);return s.name&&(r.name=s.name),lr(r,s),n.associations.set(r,{materials:e}),s.extensions&&or(a,r,s),r}))}},{key:"createUniqueName",value:function(e){var t=V.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}},{key:"loadGeometries",value:function(e){var t=this,n=this.extensions,r=this.primitiveCache;function a(e){return n[Pn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return fr(n,e,t)}))}for(var i=[],s=0,o=e.length;s<o;s++){var l,h=e[s],d=dr(h),u=r[d];u?i.push(u.promise):(l=h.extensions&&h.extensions[Pn.KHR_DRACO_MESH_COMPRESSION]?a(h):fr(new c,h,t),r[d]={primitive:h,promise:l},i.push(l))}return Promise.all(i)}},{key:"loadMesh",value:function(e){for(var t,n=this,r=this.json,a=this.extensions,i=r.meshes[e],s=i.primitives,o=[],l=0,h=s.length;l<h;l++){var d=void 0===s[l].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new H({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ce})),t.DefaultMaterial):this.getDependency("material",s[l].material);o.push(d)}return o.push(n.loadGeometries(s)),Promise.all(o).then((function(t){for(var r=t.slice(0,t.length-1),o=t[t.length-1],l=[],h=0,d=o.length;h<d;h++){var c=o[h],u=s[h],p=void 0,g=r[h];if(u.mode===$n.TRIANGLES||u.mode===$n.TRIANGLE_STRIP||u.mode===$n.TRIANGLE_FAN||void 0===u.mode)!0===(p=!0===i.isSkinnedMesh?new G(c,g):new K(c,g)).isSkinnedMesh&&p.normalizeSkinWeights(),u.mode===$n.TRIANGLE_STRIP?p.geometry=Mn(p.geometry,f):u.mode===$n.TRIANGLE_FAN&&(p.geometry=Mn(p.geometry,m));else if(u.mode===$n.LINES)p=new W(c,g);else if(u.mode===$n.LINE_STRIP)p=new X(c,g);else if(u.mode===$n.LINE_LOOP)p=new q(c,g);else{if(u.mode!==$n.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);p=new Q(c,g)}Object.keys(p.geometry.morphAttributes).length>0&&hr(p,i),p.name=n.createUniqueName(i.name||"mesh_"+e),lr(p,i),u.extensions&&or(a,p,u),n.assignFinalMaterial(p),l.push(p)}for(var v=0,_=l.length;v<_;v++)n.associations.set(l[v],{meshes:e,primitives:v});if(1===l.length)return i.extensions&&or(a,l[0],i),l[0];var w=new Y;i.extensions&&or(a,w,i),n.associations.set(w,{meshes:e});for(var b=0,y=l.length;b<y;b++)w.add(l[b]);return w}))}},{key:"loadCamera",value:function(e){var t,n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new Z(J.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new $(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),lr(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}},{key:"loadSkin",value:function(e){for(var t=this.json.skins[e],n=[],r=0,a=t.joints.length;r<a;r++)n.push(this._loadNodeShallow(t.joints[r]));return void 0!==t.inverseBindMatrices?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then((function(e){for(var n=e.pop(),r=e,a=[],i=[],s=0,o=r.length;s<o;s++){var l=r[s];if(l){a.push(l);var h=new P;null!==n&&h.fromArray(n.array,16*s),i.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}return new ee(a,i)}))}},{key:"loadAnimation",value:function(e){for(var t=this.json,n=this,r=t.animations[e],a=r.name?r.name:"animation_"+e,i=[],s=[],o=[],l=[],h=[],d=0,c=r.channels.length;d<c;d++){var u=r.channels[d],p=r.samplers[u.sampler],m=u.target,f=m.node,g=void 0!==r.parameters?r.parameters[p.input]:p.input,v=void 0!==r.parameters?r.parameters[p.output]:p.output;void 0!==m.node&&(i.push(this.getDependency("node",f)),s.push(this.getDependency("accessor",g)),o.push(this.getDependency("accessor",v)),l.push(p),h.push(m))}return Promise.all([Promise.all(i),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(h)]).then((function(e){for(var t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],l=[],h=0,d=t.length;h<d;h++){var c=t[h],u=r[h],p=i[h],m=s[h],f=o[h];if(void 0!==c){c.updateMatrix&&c.updateMatrix();var g=n._createAnimationTracks(c,u,p,m,f);if(g)for(var v=0;v<g.length;v++)l.push(g[v])}}return new te(a,void 0,l)}))}},{key:"createNodeMesh",value:function(e){var t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){var t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}},{key:"loadNode",value:function(e){for(var t=this.json.nodes[e],n=this._loadNodeShallow(e),r=[],a=t.children||[],i=0,s=a.length;i<s;i++)r.push(this.getDependency("node",a[i]));var o=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([n,Promise.all(r),o]).then((function(e){var t=e[0],n=e[1],r=e[2];null!==r&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(r,pr)}));for(var a=0,i=n.length;a<i;a++)t.add(n[a]);return t}))}},{key:"_loadNodeShallow",value:function(e){var t=this.json,n=this.extensions,r=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];var a=t.nodes[e],i=a.name?r.createUniqueName(a.name):"",s=[],o=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return o&&s.push(o),void 0!==a.camera&&s.push(r.getDependency("camera",a.camera).then((function(e){return r._getNodeRef(r.cameraCache,a.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){s.push(e)})),this.nodeCache[e]=Promise.all(s).then((function(t){var s;if((s=!0===a.isBone?new ne:t.length>1?new Y:1===t.length?t[0]:new I)!==t[0])for(var o=0,l=t.length;o<l;o++)s.add(t[o]);if(a.name&&(s.userData.name=a.name,s.name=i),lr(s,a),a.extensions&&or(n,s,a),void 0!==a.matrix){var h=new P;h.fromArray(a.matrix),s.applyMatrix4(h)}else void 0!==a.translation&&s.position.fromArray(a.translation),void 0!==a.rotation&&s.quaternion.fromArray(a.rotation),void 0!==a.scale&&s.scale.fromArray(a.scale);return r.associations.has(s)||r.associations.set(s,{}),r.associations.get(s).nodes=e,s})),this.nodeCache[e]}},{key:"loadScene",value:function(e){var t=this.extensions,n=this.json.scenes[e],r=this,a=new Y;n.name&&(a.name=r.createUniqueName(n.name)),lr(a,n),n.extensions&&or(t,a,n);for(var i=n.nodes||[],s=[],o=0,l=i.length;o<l;o++)s.push(r.getDependency("node",i[o]));return Promise.all(s).then((function(e){for(var t=0,n=e.length;t<n;t++)a.add(e[t]);return r.associations=function(e){var t,n=new Map,a=A(r.associations);try{for(a.s();!(t=a.n()).done;){var i=me(t.value,2),s=i[0],o=i[1];(s instanceof B||s instanceof fe)&&n.set(s,o)}}catch(e){a.e(e)}finally{a.f()}return e.traverse((function(e){var t=r.associations.get(e);null!=t&&n.set(e,t)})),n}(a),a}))}},{key:"_createAnimationTracks",value:function(e,t,n,r,a){var i,s=[],o=e.name?e.name:e.uuid,l=[];switch(ir[a.path]===ir.weights?e.traverse((function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)})):l.push(o),ir[a.path]){case ir.weights:i=ve;break;case ir.rotation:i=_e;break;case ir.position:case ir.scale:i=ge;break;default:switch(n.itemSize){case 1:i=ve;break;case 2:case 3:default:i=ge}}for(var h=void 0!==r.interpolation?sr[r.interpolation]:re,d=this._getArrayFromAccessor(n),c=0,u=l.length;c<u;c++){var p=new i(l[c]+"."+ir[a.path],t.array,d,h);"CUBICSPLINE"===r.interpolation&&this._createCubicSplineTrackInterpolant(p),s.push(p)}return s}},{key:"_getArrayFromAccessor",value:function(e){var t=e.array;if(e.normalized){for(var n=ur(t.constructor),r=new Float32Array(t.length),a=0,i=t.length;a<i;a++)r[a]=t[a]*n;t=r}return t}},{key:"_createCubicSplineTrackInterpolant",value:function(e){e.createInterpolant=function(e){return new(this instanceof _e?Jn:Yn)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}]),e}();function fr(e,t,n){var r=t.attributes,a=[];function i(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(var o in r){var l=ar[o]||o.toLowerCase();l in e.attributes||a.push(i(r[o],l))}if(void 0!==t.indices&&!e.index){var h=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));a.push(h)}return lr(e,t),function(e,t,n){var r=t.attributes,a=new we;if(void 0!==r.POSITION){var i=n.json.accessors[r.POSITION],o=i.min,l=i.max;if(void 0!==o&&void 0!==l){if(a.set(new s(o[0],o[1],o[2]),new s(l[0],l[1],l[2])),i.normalized){var h=ur(er[i.componentType]);a.min.multiplyScalar(h),a.max.multiplyScalar(h)}var d=t.targets;if(void 0!==d){for(var c=new s,u=new s,p=0,m=d.length;p<m;p++){var f=d[p];if(void 0!==f.POSITION){var g=n.json.accessors[f.POSITION],v=g.min,_=g.max;if(void 0!==v&&void 0!==_){if(u.setX(Math.max(Math.abs(v[0]),Math.abs(_[0]))),u.setY(Math.max(Math.abs(v[1]),Math.abs(_[1]))),u.setZ(Math.max(Math.abs(v[2]),Math.abs(_[2]))),g.normalized){var w=ur(er[g.componentType]);u.multiplyScalar(w)}c.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(c)}e.boundingBox=a;var b=new be;a.getCenter(b.center),b.radius=a.min.distanceTo(a.max)/2,e.boundingSphere=b}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,n),Promise.all(a).then((function(){return void 0!==t.targets?function(e,t,n){for(var r=!1,a=!1,i=!1,s=0,o=t.length;s<o;s++){var l=t[s];if(void 0!==l.POSITION&&(r=!0),void 0!==l.NORMAL&&(a=!0),void 0!==l.COLOR_0&&(i=!0),r&&a&&i)break}if(!r&&!a&&!i)return Promise.resolve(e);for(var h=[],d=[],c=[],u=0,p=t.length;u<p;u++){var m=t[u];if(r){var f=void 0!==m.POSITION?n.getDependency("accessor",m.POSITION):e.attributes.position;h.push(f)}if(a){var g=void 0!==m.NORMAL?n.getDependency("accessor",m.NORMAL):e.attributes.normal;d.push(g)}if(i){var v=void 0!==m.COLOR_0?n.getDependency("accessor",m.COLOR_0):e.attributes.color;c.push(v)}}return Promise.all([Promise.all(h),Promise.all(d),Promise.all(c)]).then((function(t){var n=t[0],s=t[1],o=t[2];return r&&(e.morphAttributes.position=n),a&&(e.morphAttributes.normal=s),i&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}var gr=new WeakMap,vr=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).decoderPath="",r.decoderConfig={},r.decoderBinary=null,r.decoderPending=null,r.workerLimit=4,r.workerPool=[],r.workerNextTaskID=1,r.workerSourceURL="",r.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},r.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},r}return w(n,[{key:"setDecoderPath",value:function(e){return this.decoderPath=e,this}},{key:"setDecoderConfig",value:function(e){return this.decoderConfig=e,this}},{key:"setWorkerLimit",value:function(e){return this.workerLimit=e,this}},{key:"load",value:function(e,t,n,r){var a=this,i=new y(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(function(e){a.parse(e,t,r)}),n,r)}},{key:"parse",value:function(e,t,n){this.decodeDracoFile(e,t,null,null,M).catch(n)}},{key:"decodeDracoFile",value:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ce,i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:a};return this.decodeGeometry(e,i).then(t)}},{key:"decodeGeometry",value:function(e,t){var n,r=this,a=JSON.stringify(t);if(gr.has(e)){var i=gr.get(e);if(i.key===a)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var s=this.workerNextTaskID++,o=e.byteLength,l=this._getWorker(s,o).then((function(r){return n=r,new Promise((function(r,a){n._callbacks[s]={resolve:r,reject:a},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))})).then((function(e){return r._createGeometry(e.geometry)}));return l.catch((function(){return!0})).then((function(){n&&s&&r._releaseTask(n,s)})),gr.set(e,{key:a,promise:l}),l}},{key:"_createGeometry",value:function(e){var t=new c;e.index&&t.setIndex(new u(e.index.array,1));for(var n=0;n<e.attributes.length;n++){var r=e.attributes[n],a=r.name,i=r.array,s=r.itemSize,o=new u(i,s);"color"===a&&(this._assignVertexColorSpace(o,r.vertexColorSpace),o.normalized=i instanceof Float32Array==0),t.setAttribute(a,o)}return t}},{key:"_assignVertexColorSpace",value:function(e,t){if(t===M)for(var n=new h,r=0,a=e.count;r<a;r++)n.fromBufferAttribute(e,r).convertSRGBToLinear(),e.setXYZ(r,n.r,n.g,n.b)}},{key:"_loadLibrary",value:function(e,t){var n=new y(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((function(t,r){n.load(e,t,void 0,r)}))}},{key:"preload",value:function(){return this._initDecoder(),this}},{key:"_initDecoder",value:function(){var e=this;if(this.decoderPending)return this.decoderPending;var t="object"!==("undefined"==typeof WebAssembly?"undefined":k(WebAssembly))||"js"===this.decoderConfig.type,n=[];return t?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then((function(n){var r=n[0];t||(e.decoderConfig.wasmBinary=n[1]);var a=_r.toString(),i=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}},{key:"_getWorker",value:function(e,t){var n=this;return this._initDecoder().then((function(){if(n.workerPool.length<n.workerLimit){var r=new Worker(n.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:n.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},n.workerPool.push(r)}else n.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var a=n.workerPool[n.workerPool.length-1];return a._taskCosts[e]=t,a._taskLoad+=t,a}))}},{key:"_releaseTask",value:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}},{key:"debug",value:function(){this.workerPool.map((function(e){return e._taskLoad}))}},{key:"dispose",value:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}]),n}(x);function _r(){var e,t;function n(e,t,n,r,a,i){var s=i.num_components(),o=n.num_points()*s,l=o*a.BYTES_PER_ELEMENT,h=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,a),d=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,i,h,l,d);var c=new a(e.HEAPF32.buffer,d,o).slice();return e._free(d),{name:r,array:c,itemSize:s}}onmessage=function(r){var a=r.data;switch(a.type){case"init":e=a.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var i=a.buffer,s=a.taskConfig;t.then((function(e){var t=e.draco,r=new t.Decoder;try{var o=function(e,t,r,a){var i,s,o=a.attributeIDs,l=a.attributeTypes,h=t.GetEncodedGeometryType(r);if(h===e.TRIANGULAR_MESH)i=new e.Mesh,s=t.DecodeArrayToMesh(r,r.byteLength,i);else{if(h!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");i=new e.PointCloud,s=t.DecodeArrayToPointCloud(r,r.byteLength,i)}if(!s.ok()||0===i.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var d={index:null,attributes:[]};for(var c in o){var u=self[l[c]],p=void 0,m=void 0;if(a.useUniqueIDs)m=o[c],p=t.GetAttributeByUniqueId(i,m);else{if(-1===(m=t.GetAttributeId(i,e[o[c]])))continue;p=t.GetAttribute(i,m)}var f=n(e,t,i,c,u,p);"color"===c&&(f.vertexColorSpace=a.vertexColorSpace),d.attributes.push(f)}return h===e.TRIANGULAR_MESH&&(d.index=function(e,t,n){var r=3*n.num_faces(),a=4*r,i=e._malloc(a);t.GetTrianglesUInt32Array(n,a,i);var s=new Uint32Array(e.HEAPF32.buffer,i,r).slice();return e._free(i),{array:s,itemSize:1}}(e,t,i)),e.destroy(i),d}(t,r,new Int8Array(i),s),l=o.attributes.map((function(e){return e.array.buffer}));o.index&&l.push(o.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:o},l)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}finally{t.destroy(r)}}))}}}const wr={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-6263f3a4b71cdf3b.js","draco_decoder.wasm":"static/draco_decoder-b048235474cbf09e.wasm","draco_decoder.js":"static/draco_decoder-dc7f397e2a2ebac4.js"};class br{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",r=5){const a=this.getStore(n),i=a.entries.find(t=>t.id===e);if(i?(i.payload=t,i.date=Date.now()):a.entries.push({id:e,date:Date.now(),payload:t}),a.entries.length>r)for(a.entries.sort((e,t)=>t.date-e.date);a.entries.length>r;)a.entries.pop();this.saveStore(n,a)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}pn([fn],br.prototype,"_localStorage",void 0);const yr=e("t",(function(e){return e*(Math.PI/180)})),xr=e("y",(function(e){return e*(180/Math.PI)})),Sr=(e("w",(function(e,t,n,r,a,i){e=Math.sqrt(e*e+n*n);const s=a/i,o=2*Math.atan(Math.tan(r*Math.PI/180/2)*s)*180/Math.PI,l=yr(r),h=t/2/Math.tan(l/2),d=e/(2*Math.atan(Math.PI*o/360));return Math.max(h,d)})),function(e){return Math.round(1e3*e)/1e3}),Cr=(e("a0",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("aa",e=>new s(e.x/1e3,e.z/1e3,e.y/-1e3))),Mr=e=>new s(e.x/1e3,e.z/1e3,e.y/1e3),Tr=e("h",e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)})),Ar=e=>decodeURIComponent(encodeURIComponent(e)),Pr=e("O",e=>{if(!e){const t=typeof e;return"number"===t||"boolean"===t?e:null}if(!e.hasOwnProperty("size")&&e.size&&"function"==typeof e.size){let t=Rr(e);for(let e=0;e<t.length;e++)t[e]=Pr(t[e]);return"string"==typeof t?Ar(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=Pr(e[t]));return"string"==typeof e?Ar(e):e}),Rr=e=>{let t=[];if(e){let n=e.size();for(let r=0;r<n;r++)t.push(e.get(r))}return t},Er=e=>{let t=new P,n=Pr(e);return t.fromArray(n),t.transpose(),(e=>{let t=new P;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new s(.001,.001,.001));let n=new P;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new s(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};function Ir(e,t){var n=e.__state.conversionName.toString(),r=Math.round(e.r),a=Math.round(e.g),i=Math.round(e.b),s=e.a,o=Math.round(e.h),l=e.s.toFixed(1),h=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+r+","+a+","+i+")":"CSS_RGBA"===n?"rgba("+r+","+a+","+i+","+s+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+r+","+a+","+i+"]":"RGBA_ARRAY"===n?"["+r+","+a+","+i+","+s+"]":"RGB_OBJ"===n?"{r:"+r+",g:"+a+",b:"+i+"}":"RGBA_OBJ"===n?"{r:"+r+",g:"+a+",b:"+i+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+o+",s:"+l+",v:"+h+"}":"HSVA_OBJ"===n?"{h:"+o+",s:"+l+",v:"+h+",a:"+s+"}":"unknown format"}var kr=Array.prototype.forEach,Dr=Array.prototype.slice,Or={BREAK:{},extend:function(e){return this.each(Dr.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))}),this),e},defaults:function(e){return this.each(Dr.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))}),this),e},compose:function(){var e=Dr.call(arguments);return function(){for(var t=Dr.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(kr&&e.forEach&&e.forEach===kr)e.forEach(t,n);else if(e.length===e.length+0){var r,a=void 0;for(a=0,r=e.length;a<r;a++)if(a in e&&t.call(n,e[a],a)===this.BREAK)return}else for(var i in e)if(t.call(n,e[i],i)===this.BREAK)return},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r=void 0;return function(){var a=this,i=arguments;function s(){r=null,n||e.apply(a,i)}var o=n||!r;clearTimeout(r),r=setTimeout(s,t),o&&e.apply(a,i)}},toArray:function(e){return e.toArray?e.toArray():Dr.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return isNaN(e)})),isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return!1===e||!0===e},isFunction:function(e){return e instanceof Function}},Lr=[{litmus:Or.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:Ir},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:Ir},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:Ir},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:Ir}}},{litmus:Or.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:Or.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:Or.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(Or.isNumber(e.r)&&Or.isNumber(e.g)&&Or.isNumber(e.b)&&Or.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(Or.isNumber(e.r)&&Or.isNumber(e.g)&&Or.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(Or.isNumber(e.h)&&Or.isNumber(e.s)&&Or.isNumber(e.v)&&Or.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(Or.isNumber(e.h)&&Or.isNumber(e.s)&&Or.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],Ur=void 0,Fr=void 0,Nr=function(){Fr=!1;var e=arguments.length>1?Or.toArray(arguments):arguments[0];return Or.each(Lr,(function(t){if(t.litmus(e))return Or.each(t.conversions,(function(t,n){if(Ur=t.read(e),!1===Fr&&!1!==Ur)return Fr=Ur,Ur.conversionName=n,Ur.conversion=t,Or.BREAK})),Or.BREAK})),Fr},Br=void 0,zr={hsv_to_rgb:function(e,t,n){var r=Math.floor(e/60)%6,a=e/60-Math.floor(e/60),i=n*(1-t),s=n*(1-a*t),o=n*(1-(1-a)*t),l=[[n,o,i],[s,n,i],[i,n,o],[i,s,n],[o,i,n],[n,i,s]][r];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var r=Math.min(e,t,n),a=Math.max(e,t,n),i=a-r,s=void 0;return 0===a?{h:NaN,s:0,v:0}:(s=e===a?(t-n)/i:t===a?2+(n-e)/i:4+(e-t)/i,(s/=6)<0&&(s+=1),{h:360*s,s:i/a,v:a/255})},rgb_to_hex:function(e,t,n){var r=this.hex_with_component(0,2,e);return r=this.hex_with_component(r,1,t),this.hex_with_component(r,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(Br=8*t)|e&~(255<<Br)}},Hr="function"==typeof Symbol&&"symbol"===k(Symbol.iterator)?function(e){return k(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":k(e)},jr=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Vr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Gr=function e(t,n,r){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,n);if(void 0===a){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in a)return a.value;var s=a.get;return void 0!==s?s.call(r):void 0},Kr=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+k(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Wr=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==k(t)&&"function"!=typeof t?e:t},Xr=function(){function e(){if(jr(this,e),this.__state=Nr.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return Vr(e,[{key:"toString",value:function(){return Ir(this)}},{key:"toHexString",value:function(){return Ir(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),e}();function qr(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space||Xr.recalculateRGB(this,t,n),this.__state[t]},set:function(e){"RGB"!==this.__state.space&&(Xr.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function Qr(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space||Xr.recalculateHSV(this),this.__state[t]},set:function(e){"HSV"!==this.__state.space&&(Xr.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}Xr.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=zr.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");Or.extend(e.__state,zr.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},Xr.recalculateHSV=function(e){var t=zr.rgb_to_hsv(e.r,e.g,e.b);Or.extend(e.__state,{s:t.s,v:t.v}),Or.isNaN(t.h)?Or.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},Xr.COMPONENTS=["r","g","b","h","s","v","hex","a"],qr(Xr.prototype,"r",2),qr(Xr.prototype,"g",1),qr(Xr.prototype,"b",0),Qr(Xr.prototype,"h"),Qr(Xr.prototype,"s"),Qr(Xr.prototype,"v"),Object.defineProperty(Xr.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(Xr.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=zr.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}});var Yr=function(){function e(t,n){jr(this,e),this.initialValue=t[n],this.domElement=document.createElement("div"),this.object=t,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return Vr(e,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),e}(),Zr={};Or.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(e,t){Or.each(e,(function(e){Zr[e]=t}))}));var Jr=/(\d+(\.\d+)?)px/;function $r(e){if("0"===e||Or.isUndefined(e))return 0;var t=e.match(Jr);return Or.isNull(t)?0:parseFloat(t[1])}var ea={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){var r=n,a=t;Or.isUndefined(a)&&(a=!0),Or.isUndefined(r)&&(r=!0),e.style.position="absolute",a&&(e.style.left=0,e.style.right=0),r&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,r){var a=n||{},i=Zr[t];if(!i)throw new Error("Event type "+t+" not supported.");var s=document.createEvent(i);switch(i){case"MouseEvents":var o=a.x||a.clientX||0,l=a.y||a.clientY||0;s.initMouseEvent(t,a.bubbles||!1,a.cancelable||!0,window,a.clickCount||1,0,0,o,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var h=s.initKeyboardEvent||s.initKeyEvent;Or.defaults(a,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),h(t,a.bubbles||!1,a.cancelable,window,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.keyCode,a.charCode);break;default:s.initEvent(t,a.bubbles||!1,a.cancelable||!0)}Or.defaults(s,r),e.dispatchEvent(s)},bind:function(e,t,n,r){var a=r||!1;return e.addEventListener?e.addEventListener(t,n,a):e.attachEvent&&e.attachEvent("on"+t,n),ea},unbind:function(e,t,n,r){var a=r||!1;return e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent&&e.detachEvent("on"+t,n),ea},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);-1===n.indexOf(t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return ea},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),r=n.indexOf(t);-1!==r&&(n.splice(r,1),e.className=n.join(" "))}else e.className=void 0;return ea},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return $r(t["border-left-width"])+$r(t["border-right-width"])+$r(t["padding-left"])+$r(t["padding-right"])+$r(t.width)},getHeight:function(e){var t=getComputedStyle(e);return $r(t["border-top-width"])+$r(t["border-bottom-width"])+$r(t["padding-top"])+$r(t["padding-bottom"])+$r(t.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)do{n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent}while(t);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},ta=function(e){function t(e,n){jr(this,t);var r=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),a=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),ea.bind(r.__checkbox,"change",(function(){a.setValue(!a.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return Kr(t,e),Vr(t,[{key:"setValue",value:function(e){var n=Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Yr),na=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=r,s=a;if(a.__select=document.createElement("select"),Or.isArray(i)){var o={};Or.each(i,(function(e){o[e]=e})),i=o}return Or.each(i,(function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),s.__select.appendChild(n)})),a.updateDisplay(),ea.bind(a.__select,"change",(function(){var e=this.options[this.selectedIndex].value;s.setValue(e)})),a.domElement.appendChild(a.__select),a}return Kr(t,e),Vr(t,[{key:"setValue",value:function(e){var n=Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return ea.isActive(this.__select)?this:(this.__select.value=this.getValue(),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this))}}]),t}(Yr),ra=function(e){function t(e,n){jr(this,t);var r=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),a=r;function i(){a.setValue(a.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),ea.bind(r.__input,"keyup",i),ea.bind(r.__input,"change",i),ea.bind(r.__input,"blur",(function(){a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())})),ea.bind(r.__input,"keydown",(function(e){13===e.keyCode&&this.blur()})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){return ea.isActive(this.__input)||(this.__input.value=this.getValue()),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Yr);function aa(e){var t=e.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}var ia=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=r||{};return a.__min=i.min,a.__max=i.max,a.__step=i.step,Or.isUndefined(a.__step)?0===a.initialValue?a.__impliedStep=1:a.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(a.initialValue))/Math.LN10))/10:a.__impliedStep=a.__step,a.__precision=aa(a.__impliedStep),a}return Kr(t,e),Vr(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=aa(e),this}}]),t}(Yr),sa=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));a.__truncationSuspended=!1;var i=a,s=void 0;function o(){i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())}function l(e){var t=s-e.clientY;i.setValue(i.getValue()+t*i.__impliedStep),s=e.clientY}function h(){ea.unbind(window,"mousemove",l),ea.unbind(window,"mouseup",h),o()}return a.__input=document.createElement("input"),a.__input.setAttribute("type","text"),ea.bind(a.__input,"change",(function(){var e=parseFloat(i.__input.value);Or.isNaN(e)||i.setValue(e)})),ea.bind(a.__input,"blur",(function(){o()})),ea.bind(a.__input,"mousedown",(function(e){ea.bind(window,"mousemove",l),ea.bind(window,"mouseup",h),s=e.clientY})),ea.bind(a.__input,"keydown",(function(e){13===e.keyCode&&(i.__truncationSuspended=!0,this.blur(),i.__truncationSuspended=!1,o())})),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){var e,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(e*r)/r),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ia);function oa(e,t,n,r,a){return r+(e-t)/(n-t)*(a-r)}var la=function(e){function t(e,n,r,a,i){jr(this,t);var s=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:r,max:a,step:i})),o=s;function l(e){e.preventDefault();var t=o.__background.getBoundingClientRect();return o.setValue(oa(e.clientX,t.left,t.right,o.__min,o.__max)),!1}function h(){ea.unbind(window,"mousemove",l),ea.unbind(window,"mouseup",h),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function d(e){var t=e.touches[0].clientX,n=o.__background.getBoundingClientRect();o.setValue(oa(t,n.left,n.right,o.__min,o.__max))}function c(){ea.unbind(window,"touchmove",d),ea.unbind(window,"touchend",c),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}return s.__background=document.createElement("div"),s.__foreground=document.createElement("div"),ea.bind(s.__background,"mousedown",(function(e){document.activeElement.blur(),ea.bind(window,"mousemove",l),ea.bind(window,"mouseup",h),l(e)})),ea.bind(s.__background,"touchstart",(function(e){1===e.touches.length&&(ea.bind(window,"touchmove",d),ea.bind(window,"touchend",c),d(e))})),ea.addClass(s.__background,"slider"),ea.addClass(s.__foreground,"slider-fg"),s.updateDisplay(),s.__background.appendChild(s.__foreground),s.domElement.appendChild(s.__background),s}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ia),ha=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=a;return a.__button=document.createElement("div"),a.__button.innerHTML=void 0===r?"Fire":r,ea.bind(a.__button,"click",(function(e){return e.preventDefault(),i.fire(),!1})),ea.addClass(a.__button,"button"),a.domElement.appendChild(a.__button),a}return Kr(t,e),Vr(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Yr),da=function(e){function t(e,n){jr(this,t);var r=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.__color=new Xr(r.getValue()),r.__temp=new Xr(0);var a=r;r.domElement=document.createElement("div"),ea.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",ea.bind(r.__input,"keydown",(function(e){13===e.keyCode&&c.call(this)})),ea.bind(r.__input,"blur",c),ea.bind(r.__selector,"mousedown",(function(){ea.addClass(this,"drag").bind(window,"mouseup",(function(){ea.removeClass(a.__selector,"drag")}))})),ea.bind(r.__selector,"touchstart",(function(){ea.addClass(this,"drag").bind(window,"touchend",(function(){ea.removeClass(a.__selector,"drag")}))}));var i,s=document.createElement("div");function o(e){p(e),ea.bind(window,"mousemove",p),ea.bind(window,"touchmove",p),ea.bind(window,"mouseup",h),ea.bind(window,"touchend",h)}function l(e){m(e),ea.bind(window,"mousemove",m),ea.bind(window,"touchmove",m),ea.bind(window,"mouseup",d),ea.bind(window,"touchend",d)}function h(){ea.unbind(window,"mousemove",p),ea.unbind(window,"touchmove",p),ea.unbind(window,"mouseup",h),ea.unbind(window,"touchend",h),u()}function d(){ea.unbind(window,"mousemove",m),ea.unbind(window,"touchmove",m),ea.unbind(window,"mouseup",d),ea.unbind(window,"touchend",d),u()}function c(){var e=Nr(this.value);!1!==e?(a.__color.__state=e,a.setValue(a.__color.toOriginal())):this.value=a.__color.toString()}function u(){a.__onFinishChange&&a.__onFinishChange.call(a,a.__color.toOriginal())}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=a.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,r=n.clientX,i=n.clientY,s=(r-t.left)/(t.right-t.left),o=1-(i-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),s>1?s=1:s<0&&(s=0),a.__color.v=o,a.__color.s=s,a.setValue(a.__color.toOriginal()),!1}function m(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=a.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),a.__color.h=360*n,a.setValue(a.__color.toOriginal()),!1}return Or.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Or.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Or.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Or.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Or.extend(s.style,{width:"100%",height:"100%",background:"none"}),ua(s,"top","rgba(0,0,0,0)","#000"),Or.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(i=r.__hue_field).style.background="",i.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",i.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",Or.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),ea.bind(r.__saturation_field,"mousedown",o),ea.bind(r.__saturation_field,"touchstart",o),ea.bind(r.__field_knob,"mousedown",o),ea.bind(r.__field_knob,"touchstart",o),ea.bind(r.__hue_field,"mousedown",l),ea.bind(r.__hue_field,"touchstart",l),r.__saturation_field.appendChild(s),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){var e=Nr(this.getValue());if(!1!==e){var t=!1;Or.each(Xr.COMPONENTS,(function(n){if(!Or.isUndefined(e[n])&&!Or.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&Or.extend(this.__color.__state,e)}Or.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;Or.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,ua(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Or.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(Yr),ca=["-moz-","-o-","-webkit-","-ms-",""];function ua(e,t,n,r){e.style.background="",Or.each(ca,(function(a){e.style.cssText+="background: "+a+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var pa='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',ma=function(e,t){var n=e[t];return Or.isArray(arguments[2])||Or.isObject(arguments[2])?new na(e,t,arguments[2]):Or.isNumber(n)?Or.isNumber(arguments[2])&&Or.isNumber(arguments[3])?Or.isNumber(arguments[4])?new la(e,t,arguments[2],arguments[3],arguments[4]):new la(e,t,arguments[2],arguments[3]):Or.isNumber(arguments[4])?new sa(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new sa(e,t,{min:arguments[2],max:arguments[3]}):Or.isString(n)?new ra(e,t):Or.isFunction(n)?new ha(e,t,""):Or.isBoolean(n)?new ta(e,t):null},fa=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},ga=function(){function e(){jr(this,e),this.backgroundElement=document.createElement("div"),Or.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),ea.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Or.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;ea.bind(this.backgroundElement,"click",(function(){t.hide()}))}return Vr(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),Or.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",ea.unbind(e.domElement,"webkitTransitionEnd",t),ea.unbind(e.domElement,"transitionend",t),ea.unbind(e.domElement,"oTransitionEnd",t)};ea.bind(this.domElement,"webkitTransitionEnd",t),ea.bind(this.domElement,"transitionend",t),ea.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-ea.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-ea.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var n=document,r=document.createElement("style");r.type="text/css",r.innerHTML=e;var a=n.getElementsByTagName("head")[0];try{a.appendChild(r)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var va=function(){try{return!!window.localStorage}catch(e){return!1}}(),_a=void 0,wa=!0,ba=void 0,ya=!1,xa=[],Sa=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),ea.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=Or.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=Or.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),Or.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),Or.isUndefined(r.parent)&&r.hideable&&xa.push(this),r.resizable=Or.isUndefined(r.parent)&&r.resizable,r.autoPlace&&Or.isUndefined(r.scrollable)&&(r.scrollable=!0);var a,i=va&&"true"===localStorage.getItem(Ra(0,"isLocal")),s=void 0,o=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(e){n.parent?n.getRoot().preset=e:r.load.preset=e,function(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value===e.preset&&(e.__preset_select.selectedIndex=t)}(this),n.revert()}},width:{get:function(){return r.width},set:function(e){r.width=e,Oa(n,e)}},name:{get:function(){return r.name},set:function(e){r.name=e,o&&(o.innerHTML=r.name)}},closed:{get:function(){return r.closed},set:function(t){r.closed=t,r.closed?ea.addClass(n.__ul,e.CLASS_CLOSED):ea.removeClass(n.__ul,e.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return r.load}},useLocalStorage:{get:function(){return i},set:function(e){va&&(i=e,e?ea.bind(window,"unload",s):ea.unbind(window,"unload",s),localStorage.setItem(Ra(0,"isLocal"),e))}}}),Or.isUndefined(r.parent)){if(this.closed=r.closed||!1,ea.addClass(this.domElement,e.CLASS_MAIN),ea.makeSelectable(this.domElement,!1),va&&i){n.useLocalStorage=!0;var l=localStorage.getItem(Ra(0,"gui"));l&&(r.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,ea.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),r.closeOnTop?(ea.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(ea.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),ea.bind(this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===r.closed&&(r.closed=!0);var h=document.createTextNode(r.name);ea.addClass(h,"controller-name"),o=Ca(n,h),ea.addClass(this.__ul,e.CLASS_CLOSED),ea.addClass(o,"title"),ea.bind(o,"click",(function(e){return e.preventDefault(),n.closed=!n.closed,!1})),r.closed||(this.closed=!1)}r.autoPlace&&(Or.isUndefined(r.parent)&&(wa&&(ba=document.createElement("div"),ea.addClass(ba,"dg"),ea.addClass(ba,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(ba),wa=!1),ba.appendChild(this.domElement),ea.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||Oa(n,r.width)),this.__resizeHandler=function(){n.onResizeDebounced()},ea.bind(window,"resize",this.__resizeHandler),ea.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),ea.bind(this.__ul,"transitionend",this.__resizeHandler),ea.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),r.resizable&&Da(this),s=function(){va&&"true"===localStorage.getItem(Ra(0,"isLocal"))&&localStorage.setItem(Ra(0,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=s,r.parent||((a=n.getRoot()).width+=1,Or.defer((function(){a.width-=1})))};function Ca(e,t,n){var r=document.createElement("li");return t&&r.appendChild(t),n?e.__ul.insertBefore(r,n):e.__ul.appendChild(r),e.onResize(),r}function Ma(e){ea.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&ea.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function Ta(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];n.innerHTML=t?n.value+"*":n.value}function Aa(e,t){var n=e.getRoot(),r=n.__rememberedObjects.indexOf(t.object);if(-1!==r){var a=n.__rememberedObjectIndecesToControllers[r];if(void 0===a&&(a={},n.__rememberedObjectIndecesToControllers[r]=a),a[t.property]=t,n.load&&n.load.remembered){var i=n.load.remembered,s=void 0;if(i[e.preset])s=i[e.preset];else{if(!i.Default)return;s=i.Default}if(s[r]&&void 0!==s[r][t.property]){var o=s[r][t.property];t.initialValue=o,t.setValue(o)}}}}function Pa(e,t,n,r){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var a=void 0;if(r.color)a=new da(t,n);else{var i=[t,n].concat(r.factoryArgs);a=ma.apply(e,i)}r.before instanceof Yr&&(r.before=r.before.__li),Aa(e,a),ea.addClass(a.domElement,"c");var s=document.createElement("span");ea.addClass(s,"property-name"),s.innerHTML=a.property;var o=document.createElement("div");o.appendChild(s),o.appendChild(a.domElement);var l=Ca(e,o,r.before);return ea.addClass(l,Sa.CLASS_CONTROLLER_ROW),a instanceof da?ea.addClass(l,"color"):ea.addClass(l,Hr(a.getValue())),function(e,t,n){if(n.__li=t,n.__gui=e,Or.extend(n,{options:function(t){if(arguments.length>1){var r=n.__li.nextElementSibling;return n.remove(),Pa(e,n.object,n.property,{before:r,factoryArgs:[Or.toArray(arguments)]})}if(Or.isArray(t)||Or.isObject(t)){var a=n.__li.nextElementSibling;return n.remove(),Pa(e,n.object,n.property,{before:a,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof la){var r=new sa(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});Or.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],a=r[e];n[e]=r[e]=function(){var e=Array.prototype.slice.call(arguments);return a.apply(r,e),t.apply(n,e)}})),ea.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof sa){var a=function(t){if(Or.isNumber(n.__min)&&Or.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,a=n.__gui.__listening.indexOf(n)>-1;n.remove();var i=Pa(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return i.name(r),a&&i.listen(),i}return t};n.min=Or.compose(a,n.min),n.max=Or.compose(a,n.max)}else n instanceof ta?(ea.bind(t,"click",(function(){ea.fakeEvent(n.__checkbox,"click")})),ea.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof ha?(ea.bind(t,"click",(function(){ea.fakeEvent(n.__button,"click")})),ea.bind(t,"mouseover",(function(){ea.addClass(n.__button,"hover")})),ea.bind(t,"mouseout",(function(){ea.removeClass(n.__button,"hover")}))):n instanceof da&&(ea.addClass(t,"color"),n.updateDisplay=Or.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=Or.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&Ta(e.getRoot(),!0),t}),n.setValue)}(e,l,a),e.__controllers.push(a),a}function Ra(e,t){return document.location.href+"."+t}function Ea(e,t,n){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function Ia(e,t){t.style.display=e.useLocalStorage?"block":"none"}function ka(e){var t=e.__save_row=document.createElement("li");ea.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),ea.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",ea.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",ea.addClass(r,"button"),ea.addClass(r,"save");var a=document.createElement("span");a.innerHTML="New",ea.addClass(a,"button"),ea.addClass(a,"save-as");var i=document.createElement("span");i.innerHTML="Revert",ea.addClass(i,"button"),ea.addClass(i,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?Or.each(e.load.remembered,(function(t,n){Ea(e,n,n===e.preset)})):Ea(e,"Default",!1),ea.bind(s,"change",(function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value})),t.appendChild(s),t.appendChild(n),t.appendChild(r),t.appendChild(a),t.appendChild(i),va){var o=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(Ra(0,"isLocal"))&&l.setAttribute("checked","checked"),Ia(e,o),ea.bind(l,"change",(function(){e.useLocalStorage=!e.useLocalStorage,Ia(e,o)}))}var h=document.getElementById("dg-new-constructor");ea.bind(h,"keydown",(function(e){!e.metaKey||67!==e.which&&67!==e.keyCode||_a.hide()})),ea.bind(n,"click",(function(){h.innerHTML=JSON.stringify(e.getSaveObject(),void 0,2),_a.show(),h.focus(),h.select()})),ea.bind(r,"click",(function(){e.save()})),ea.bind(a,"click",(function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)})),ea.bind(i,"click",(function(){e.revert()}))}function Da(e){var t=void 0;function n(n){return n.preventDefault(),e.width+=t-n.clientX,e.onResize(),t=n.clientX,!1}function r(){ea.removeClass(e.__closeButton,Sa.CLASS_DRAG),ea.unbind(window,"mousemove",n),ea.unbind(window,"mouseup",r)}function a(a){return a.preventDefault(),t=a.clientX,ea.addClass(e.__closeButton,Sa.CLASS_DRAG),ea.bind(window,"mousemove",n),ea.bind(window,"mouseup",r),!1}e.__resize_handle=document.createElement("div"),Or.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),ea.bind(e.__resize_handle,"mousedown",a),ea.bind(e.__closeButton,"mousedown",a),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}function Oa(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function La(e,t){var n={};return Or.each(e.__rememberedObjects,(function(r,a){var i={},s=e.__rememberedObjectIndecesToControllers[a];Or.each(s,(function(e,n){i[n]=t?e.initialValue:e.getValue()})),n[a]=i})),n}Sa.toggleHide=function(){ya=!ya,Or.each(xa,(function(e){e.domElement.style.display=ya?"none":""}))},Sa.CLASS_AUTO_PLACE="a",Sa.CLASS_AUTO_PLACE_CONTAINER="ac",Sa.CLASS_MAIN="main",Sa.CLASS_CONTROLLER_ROW="cr",Sa.CLASS_TOO_TALL="taller-than-window",Sa.CLASS_CLOSED="closed",Sa.CLASS_CLOSE_BUTTON="close-button",Sa.CLASS_CLOSE_TOP="close-top",Sa.CLASS_CLOSE_BOTTOM="close-bottom",Sa.CLASS_DRAG="drag",Sa.DEFAULT_WIDTH=245,Sa.TEXT_CLOSED="Close Controls",Sa.TEXT_OPEN="Open Controls",Sa._keydownHandler=function(e){"text"===document.activeElement.type||72!==e.which&&72!==e.keyCode||Sa.toggleHide()},ea.bind(window,"keydown",Sa._keydownHandler,!1),Or.extend(Sa.prototype,{add:function(e,t){return Pa(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return Pa(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;Or.defer((function(){t.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&ba.removeChild(this.domElement);var e=this;Or.each(this.__folders,(function(t){e.removeFolder(t)})),ea.unbind(window,"keydown",Sa._keydownHandler,!1),Ma(this)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new Sa(t);this.__folders[e]=n;var r=Ca(this,n.domElement);return ea.addClass(r,"folder"),n},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],Ma(e);var t=this;Or.each(e.__folders,(function(t){e.removeFolder(t)})),Or.defer((function(){t.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=ea.getOffset(e.__ul).top,n=0;Or.each(e.__ul.childNodes,(function(t){e.autoPlace&&t===e.__save_row||(n+=ea.getHeight(t))})),window.innerHeight-t-20<n?(ea.addClass(e.domElement,Sa.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-20+"px"):(ea.removeClass(e.domElement,Sa.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&Or.defer((function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"})),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:Or.debounce((function(){this.onResize()}),50),remember:function(){if(Or.isUndefined(_a)&&((_a=new ga).domElement.innerHTML=pa),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;Or.each(Array.prototype.slice.call(arguments),(function(t){0===e.__rememberedObjects.length&&ka(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)})),this.autoPlace&&Oa(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=La(this)),e.folders={},Or.each(this.__folders,(function(t,n){e.folders[n]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=La(this),Ta(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=La(this,!0)),this.load.remembered[e]=La(this),this.preset=e,Ea(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){Or.each(this.__controllers,(function(t){this.getRoot().load.remembered?Aa(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),Or.each(this.__folders,(function(e){e.revert(e)})),e||Ta(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&fa.call(window,(function(){e(t)})),Or.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){Or.each(this.__controllers,(function(e){e.updateDisplay()})),Or.each(this.__folders,(function(e){e.updateDisplay()}))}});var Ua=Sa;class Fa{static createMeshPhysicalMaterial(e){return new T(e)}static createMeshStandardMaterial(e){return new H(e)}}e("V",Fa),e("j",(e,t,n,r)=>{if(!e||!t||0===n||0===r)return new s;let a=e.clone(),i=n/2,o=r/2;return a.project(t),a.x=Math.floor(a.x*i+i),a.y=Math.floor(-a.y*o+o),a.z=e.distanceTo(t.position),a});const Na=e("k",(e,t)=>{t||(t=new s(0,0,0));let n=new s(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),r=new s(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),a=new s(0,0,-n.z).add(r).sub(t),i=new s(n.x,n.y,0).add(r).add(t);return new we(a,i)});e("Q",(e,t)=>{let n=Sr(e.x),r=Sr(e.y),a=Sr(e.z),i=Sr(t.x),s=Sr(t.y),o=Sr(t.z);return n===i&&r===s&&a===o}),e("$",(e,t)=>{let n=Sr(e.w),r=Sr(e.x),a=Sr(e.y),i=Sr(e.z),s=Sr(t.w),o=Sr(t.x),l=Sr(t.y),h=Sr(t.z);return n===s&&r===o&&a===l&&i===h}),e("T",(e,t)=>{let n=Sr(e.x),r=Sr(e.y),a=Sr(t.x),i=Sr(t.y);return n===a&&r===i});let Ba=null;const za=()=>{if(Ba)return Ba;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new Pe(e,1,1,Ae);return t.needsUpdate=!0,t},Ha=(e,t,n,r)=>{const a=new Uint8Array(4),i=Math.floor(255*e),s=Math.floor(255*t),o=Math.floor(255*n),l=Math.floor(255*r);for(let e=0;e<4;e++){const t=4*e;a[t]=i,a[t+1]=s,a[t+2]=o,a[t+3]=l}const h=new Pe(a,1,1,Ae);return h.needsUpdate=!0,h},ja=e("X",e=>Va(null,e)),Va=e("ap",(e,t)=>{e||(e=Ga()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=Re(t.shading.metallic,.5));let n=!1;if(t.shading.transmission&&t.shading.transmission>0?(e.opacity=1-t.shading.transmission,e.transparent=!0,e.depthWrite=!1,e.metalness=0,n=!0):void 0!==t.shading.alpha&&t.shading.alpha<1&&(e.transparent=t.shading.alpha<1,e.opacity=t.shading.alpha,e.depthWrite=t.shading.alpha>=1,e.metalness=.5*Math.max(0,t.shading.alpha),n=!0),e.aoMapIntensity=Re(t.shading.occlusion,1),e.roughness=Re(t.shading.roughness,.5),e.alphaTest=Re(t.shading.alphaCutoff,0),void 0!==t.shading.basecolor){const n=new h(t.shading.basecolor.r,t.shading.basecolor.g,t.shading.basecolor.b);e.color.copy(n.convertSRGBToLinear())}return n||t.shading.doubleSided?e.side=j:e.side=ce,e.map||(Ba||(Ba=za()),e.map=Ba),e}),Ga=()=>Fa.createMeshPhysicalMaterial({});e("aq",e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===j,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n});let Ka=null;const Wa=e("Y",(e,t,n,r,a,i,s=16)=>(Ka||(Ka=new ue,Ka.crossOrigin=""),new Promise((o,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void o();Ka.load(e,e=>{Xa(e,t,n,r,a,i,s),o()},l)}))),Xa=e("ar",(e,t,n,r,a,i,s=16)=>{e.anisotropy=r,e.wrapS=F,e.wrapT=F,"ORM"===t.mapping&&s<=8?console.warn("ORM maps are not supported on devices with only "+s+" texture units"):(e.repeat.set(a,i),"XYZ"===t.mapping?(n.normalMap=e,n.map===za()&&(n.map=null)):"ORM"===t.mapping?(n.aoMap=e,n.roughnessMap=e,n.metalnessMap=e):(e.colorSpace=M,n.map=e),"RGBA"===t.mapping&&(n.transparent=!0,n.name.includes("glow")&&(n.emissiveIntensity=.5,n.emissive=new h(16777215),n.emissiveMap=n.map)),n.needsUpdate=!0)}),qa=e("Z",(e=!0)=>(window.__RML_GUI__||(window.__RML_GUI__=new Ua({autoPlace:e})),window.__RML_GUI__)),Qa=(e("ag",(e,t)=>{let n=!1;for(const r of t){const t=r.getKernelObject();let a;if(2===t.wallType.value&&(a=Cr(t.rightNormal)),1===t.wallType.value&&(a=Cr(t.leftNormal)),!a)continue;let i=Cr(r.getPlanElement().getCenter());i=i.applyMatrix4(e.matrixWorldInverse),a=a.transformDirection(e.matrixWorldInverse);const s=i.dot(a)>=0;s!==r.getContainer().visible&&(n=!0),s?r.show():r.isSelected||r.hide()}return n}),e("aj",(e,t,n=!0)=>{if(!e.userData.tween)if(t)if(e.transparent=!0,n){let t={opacity:1};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:.2},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.userData.tween=!1}).start()}else e.opacity=.2;else if(n){let t={opacity:.2};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:1},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.transparent=!1,e.userData.tween=!1}).start()}else e.opacity=1,e.transparent=!1}),e("a8",(e,t)=>{e.traverse(e=>{if(e instanceof K&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const r={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(r).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=r.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("ah",e=>{e.traverse(e=>{if(e instanceof K&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},r={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(r,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=r.transparent}).start()}})})),Ya=e("s",e=>{"Mesh"===e.type?Ja(e):Za(e)}),Za=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{Ja(e)})},Ja=e("g",e=>{e&&(e.material&&ei(e.material),e.geometry&&$a(e.geometry),e.children&&e.children.length>0&&Za(e))}),$a=e=>{e&&e.dispose()},ei=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let ti;e("v",e=>0===e.x&&0===e.y&&0===e.z);const ni=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rgb"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null},ri=(e("u",e=>{let t=e.getWorldDirection(new s).clone();t.y=0,t.lengthSq()<.01&&(t=new s(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n}),e("U",(e,t)=>{if(!e||!t)return 0;const n=e.clone().expandByScalar(.001).containsBox(t),r=t.clone().expandByScalar(.001).containsBox(e);return r&&n||!r&&!n?0:!0===n?1:-1}),e("ak",(e,t,n,r=1)=>{const a=t>n,i=a?15:0,o=a?0:10,l=e.getSize(new s),h=e.getCenter(new s);let d=l.x>2*i?l.x/2:i,c=l.z>2*o?l.z/2:o;return d*=r,c*=r,new we(new s(h.x-d,h.y,h.z-c),new s(h.x+d,h.y,h.z+c))}),e("ac",e=>{const{x:t,y:n}=e;return{x:t,y:n}})),ai=e=>{const{x:t,y:n,z:r}=e;return{x:t,y:n,z:r}};e("ai",(e,t,n)=>(new s).setFromSphericalCoords(e,Math.PI*(1-n),2*Math.PI*(1-t)));const ii=e("e",{CAMERA_2D:"2D",CAMERA_3D:"3D",CAMERA_FP:"FP"});e("a4",e=>{if(!e)return ii.CAMERA_3D;let t=e.toUpperCase();return-1===Object.values(ii).indexOf(t)&&(t=ii.CAMERA_3D),t});var si=e("a7","static/default_256-f1c66a2764f88cc0.exr");class oi{constructor(e){this.autoQuality=!1,this.colors=Ee,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.envMapUrl=si,this.envMapIntensity=1.5,this.envMapRotation=0,this.maxLightSources=-1,this.legacyLight=!1,this.restrictionLevel=0,this.e2e=!1,this.highlighting=Ie.SMART,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.featureFlags={pulsePreview:!1,reDock:!1},this.mode=ii.CAMERA_3D,this.edit=!1,this.moc=!1,this.callbacksOnlyIfGeometryIsReady=!0,this._creator_=e}setOverrides(e){ke(this,e)}}e("aw",oi);const li=["language","browserLanguage","userLanguage","systemLanguage"];e("a9",/^((?!chrome|android).)*safari/i.test(navigator.userAgent));class hi{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=li.length;e<n;e++){const n=t[li[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){ke(this,e)}}e("av",hi);class di{_setMute(e){De(this,"_isMute",!0),this._isMute=e,De(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}constructor(e){return this._isMute=!1,this.cameraStartsMoving=()=>{},this._creator_=e,Oe(this,"_isMute",{enumerable:!1,writable:!1}),Oe(di.prototype,"_setMute",{enumerable:!1,writable:!1}),Oe(di.prototype,"mute",{enumerable:!1,writable:!1}),Oe(di.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("as",di);class ci extends di{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null),this.onValidateNetworkResponse=(e,t)=>Promise.resolve(!0)}}e("au",ci),e("l",{HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});class ui{get element(){return this._container}constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100; opacity:1;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new i(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}pn([fn],ui.prototype,"_lifeCycleManager",void 0),e("ay",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});class pi{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,r){this._scene=e,this._uiScene=n,this._cameraPosition=r;const{bananaForScale:a}=this._initData;a&&await t.import("./banana-for-scale-d3481724.legacy.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}pn([fn],pi.prototype,"_initData",void 0);class mi{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,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const r=e?"allSettled":"all";Promise[r](this._waitingPromises).then(e=>{if("allSettled"===r){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&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}}class fi{constructor(e){this.materialQueue=new mi,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new ue,this._configuratorPreviewMaterial=Fa.createMeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null,polygonOffset:!0,polygonOffsetFactor:-1}),this._creator_=e,this._previewMaterial=Fa.createMeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0})}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,r,a){let i;return e&&this._cacheHolder.geometryCache.has(e)?i=this._cacheHolder.geometryCache.get(e):(i=new c,i.setIndex(new Le(n,1)),i.setAttribute("position",new Ue(t,3)),i.setAttribute("normal",new Ue(a,3)),i.setAttribute("uv",new Ue(r,2)),i.scale(.001,.001,.001),i.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,i)),i}changeMaterialOfMesh(e,t,n){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),this._updateMaterialProperties(e,n)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_updateMaterialProperties(e,t){var n;if(t&&Object.keys(t).length>0&&e.material instanceof H){const r=e.material.clone();r.userData.materialAttributes=t,t.color&&(r.color=new h(t.color)),t.alpha&&(r.opacity=parseFloat(t.alpha)),t.roughness&&(r.roughness=parseFloat(t.roughness)),t.metallic&&(r.metalness=parseFloat(t.metallic)),r instanceof T&&t.transmission&&(r.transmission=parseFloat(t.transmission)),r.transparent=r.opacity<1;const a=e.material;e.material=r,(null===(n=a.userData)||void 0===n?void 0:n.materialAttributes)&&a.dispose()}}_createMaterial(e,t,n,r,a){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let i=Fe(e),s=ja(i);this._loadBenchmarkTextures(i,s,r,a).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let i=ja(e);this._loadTextures(e,i,r,a).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,r=1){return new Promise((a,i)=>{const s=Ne(e.id);Wa(this._dataSyncer.requestAsset(s.image,!0),s,t,this._maxAnisotropy,n/(0===s.mmWidth?1:s.mmWidth),r/(0===s.mmHeight?1:s.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),a()},i)})}_loadTextures(e,t,n=1,r=1){return new Promise((a,i)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),a();this._rapiAccess.getTexturesOf(e).then(s=>{let o=[];s.forEach(e=>{o.push(Wa(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),r/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(o).then(()=>{this._cacheHolder.materialCache.set(e.id,t),a()},i)})})}_loadMaterial(e,t,n){return new Promise((r,a)=>{this._singlePromiseFactory.create(6,e,(r,a)=>this._createMaterial(e,r,a,t,n)).then(()=>{setTimeout(()=>r(this._cacheHolder.materialCache.get(e)),0)},a)})}_assignMaterial(e,t,n){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t),n),Promise.resolve()):new Promise((r,a)=>{this._loadMaterial(t).then(a=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,a,n),r()},a)})}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(n=>{let r,a="rgb"+JSON.stringify(t);this._cacheHolder.materialCache.has(a)?r=this._cacheHolder.materialCache.get(a):(r=Fa.createMeshPhysicalMaterial({color:t}),this._cacheHolder.materialCache.set(a,r)),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,r)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(a=>{if(a.topImage)this._textureLoader.load(a.topImage,r=>{r.anisotropy=this._maxAnisotropy,r.wrapS=F,r.wrapT=F;let s=new i(1,1);a.width>0&&(s.x=1/a.width),a.depth>0&&(s.y=1/a.depth),r.repeat.set(s.x,s.y);const o=Fa.createMeshPhysicalMaterial({map:r,roughness:.5,metalness:.1});this._cacheHolder.materialCache.set(t,o),this.changeMaterialOfMesh(e,o),setTimeout(()=>n(),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}_createMesh(e,t,n){if(e&&t){const r=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(r)){const e=this._geometryComponentMaterialCache.get(r);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new K(n,t)}}}return new K(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}pn([fn],fi.prototype,"_initData",void 0),pn([fn],fi.prototype,"_rapiAccess",void 0),pn([fn],fi.prototype,"_dataSyncer",void 0),pn([fn],fi.prototype,"_singlePromiseFactory",void 0),pn([fn],fi.prototype,"_cacheHolder",void 0),pn([fn],fi.prototype,"_plannerMeshGenerator",void 0);class gi extends fi{constructor(e){super(e)}generateMesh(e=0,t=null,n,r,a,i,s,o=!1,l){let h;h=o?this._generateGeometry(t,r,a,i,s).clone():this._generateGeometry(t,r,a,i,s);const d=this._createMesh(e,t,h);return d.userData.materialId=n,d.layers.set(4),n&&this.materialQueue.push(this._assignMaterial(d,n,l).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),d}setMaterial(e,t,n,r){return this._assignMaterial(e,t,r)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,r){return super._loadTextures(e,t,n,r)}}e("at",gi);class vi{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let r=n.length;for(let e=0;e<r;e++){const r=n[e];t?r.callback.apply(r.scope,[t]):r.callback.call(r.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}e("E",vi);const _i={SCROLL:"scroll",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",DOUBLE_CLICK:"dblclick"};e("ab",{DRAG:50});class wi{constructor(e,t,n,r,a){this.position=e,this.positionRelative=t,this.type=n,this.rotation=r,this.event=a}}const bi=e("a1",5*window.devicePixelRatio),yi=3*window.devicePixelRatio;class xi extends vi{constructor(e){super(),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(_i).map(e=>_i[e]),this._boundingClientRectInvalid=!0,this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}isMouseUp(){return 0===this._state}_dragM(e){let t=e,n=null,r=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),r=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),r=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,r)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1)),null===window||void 0===window||window.addEventListener("scroll",this,!1)}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this)),null===window||void 0===window||window.removeEventListener("scroll",this)}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],r=t.pageX-n.pageX,a=t.pageY-n.pageY,i=Math.abs(r)+Math.abs(a);this._pinchDistance>-1&&(i>this._pinchDistance+yi?(this._setState(3),this.dispatchEvent(7,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):i<this._pinchDistance-yi?(this._setState(3),this.dispatchEvent(8,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):i<=this._pinchDistance+yi&&i>=this._pinchDistance-yi&&(this._setState(5),this.dispatchEvent(11,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=i,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,r){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),(this._delta>bi||this._elementHit)&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new wi(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new wi(e,t)),this.dispatchEvent(6,new wi(e,t,n,null,r))}_longClick(e){2!==e&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new wi(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new wi(this._downPosition,this._downPositionRelative))),this.dispatchEvent(14,new wi(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new wi(e,t,n)),this._getDelta(e)<=bi&&this.dispatchEvent(5,new wi(e,t)),2===this._state&&this.dispatchEvent(2,new wi(e,t)),4===this._state&&(this.dispatchEvent(10,new wi(e,t)),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(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const r=e.touches[1],a=r.clientX,i=r.clientY;t=(t+a)/2,n=(n+i)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._getBoundingClientRect(),{clientWidth:n,clientHeight:r}=this._domHelper.element;if(e.touches.length){const{clientX:a,clientY:i}=e.touches[0];return{x:(a-t.left)/n*2-1,y:-(i-t.top)/r*2+1}}const a=e.changedTouches[0];return{x:(a.clientX-t.left)/n*2-1,y:-(a.clientY-t.top)/r*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._getBoundingClientRect();return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(e.type){case _i.SCROLL:this._boundingClientRectInvalid=!0;break;case _i.MOUSE_MOVE:this._onMouseMove(e);break;case _i.DOUBLE_CLICK:this._onDoubleClick(e);break;case _i.MOUSE_DOWN:this._onMouseDown(e);break;case _i.MOUSE_UP:this._onMouseUp(e);break;case _i.MOUSE_LEAVE:this._onMouseLeave(e);break;case _i.MOUSE_ENTER:this._onMouseEnter(e);break;case _i.MOUSE_WHEEL:this._onMouseWheel(e);break;case _i.TOUCH_MOVE:this._onTouchMove(e);break;case _i.TOUCH_START:this._onTouchStart(e);break;case _i.TOUCH_END:this._onTouchEnd(e);break;case _i.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){if(e.preventDefault(),2===e.detail)return;let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new wi({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),2!==e.detail&&this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onDoubleClick(e){e.preventDefault(),this.dispatchEvent(12,new wi(this._getMousePosition(e),this._getMousePositionRelative(e),1))}_onMouseLeave(e){var t;this._delta=-1,(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[data-rml-sdk="ignore-mouse-leave"]'))||this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new wi(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new wi(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const r=e.touches[0],a=e.touches[1],i=function(e){let t=xr(e);return t<0&&(t=180+(180+t)),t}((t={x:r.pageX,y:r.pageY},n={x:a.pageX,y:a.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=i);const s=i-this._rotationAngle;this._rotationAngle=i,this.dispatchEvent(9,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,yr(s))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new wi({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this,2),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||(this.dispatchEvent(13,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)),this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2))}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}_getBoundingClientRect(){return this._boundingClientRectInvalid&&(this._boundingClientRect=this._domHelper.element.getBoundingClientRect(),this._boundingClientRectInvalid=!1),this._boundingClientRect}updateSize(){this._boundingClientRectInvalid=!0}}e("an",xi),pn([fn],xi.prototype,"_domHelper",void 0);class Si{constructor(e){const{component:t,resetCamera:n,consecutive:r}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===r||r}}var Ci=function(e){g(n,e);var t=v(n);function n(e){return _(this,n),t.call(this,e)}return w(n,[{key:"load",value:function(e,t,n,r){var a=this,i=new y(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(function(e){var n=a.parse(JSON.parse(e));t&&t(n)}),n,r)}},{key:"parse",value:function(e){return new Mi(e)}}]),n}(x),Mi=function(){function e(t){_(this,e),this.isFont=!0,this.type="Font",this.data=t}return w(e,[{key:"generateShapes",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=[],r=Ti(e,t,this.data),a=0,i=r.length;a<i;a++)n.push.apply(n,Be(r[a].toShapes()));return n}}]),e}();function Ti(e,t,n){for(var r=Array.from(e),a=t/n.resolution,i=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*a,s=[],o=0,l=0,h=0;h<r.length;h++){var d=r[h];if("\n"===d)o=0,l-=i;else{var c=Ai(d,a,o,l,n);o+=c.offsetX,s.push(c.path)}}return s}function Ai(e,t,n,r,a){var i=a.glyphs[e]||a.glyphs["?"];if(i){var s,o,l,h,d,c,u,p,m=new ze;if(i.o)for(var f=i._cachedOutline||(i._cachedOutline=i.o.split(" ")),g=0,v=f.length;g<v;)switch(f[g++]){case"m":s=f[g++]*t+n,o=f[g++]*t+r,m.moveTo(s,o);break;case"l":s=f[g++]*t+n,o=f[g++]*t+r,m.lineTo(s,o);break;case"q":l=f[g++]*t+n,h=f[g++]*t+r,d=f[g++]*t+n,c=f[g++]*t+r,m.quadraticCurveTo(d,c,l,h);break;case"b":l=f[g++]*t+n,h=f[g++]*t+r,d=f[g++]*t+n,c=f[g++]*t+r,u=f[g++]*t+n,p=f[g++]*t+r,m.bezierCurveTo(d,c,u,p,l,h)}return{offsetX:i.ha*t,path:m}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+a.familyName+".")}const Pi=new Map,Ri=new Map;class Ei{static loadFont(e){if(Ri.has(e))return new Promise(t=>{t(Ri.get(e))});if(Pi.has(e))return new Promise((t,n)=>{Pi.get(e).push({resolve:t,reject:n})});let t=new Ci;return new Promise((r,a)=>{Pi.set(e,[{resolve:r,reject:a}]),t.load(n()+e,t=>{Ri.set(e,t),Ei._resolveAll(e,t)})})}static _resolveAll(e,t){Pi.has(e)&&Pi.get(e).forEach(e=>e.resolve(t)),Pi.delete(e)}}e("ax",Ei);class Ii{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const n=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),r=n.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,r.length>0),!r||0===r.length||this._camera.position.z<0)return!1;const a=Na(n.boxForMeasurement),i={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-24a4c3cd.legacy.js").then(t=>{Ei.loadFont("static/rubik_regular-bc008a7de2daee79.json").then(n=>{r.forEach(r=>{var s;e.add(new t.default(((s=r).from=s.from/1e3,s.to=s.to/1e3,1===s.type.value?(s.type={value:2},s.from*=-1,s.to*=-1):2===s.type.value&&(s.type={value:1}),s),a,n,i))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(r=>{t.import("./component-dimensioning-24a4c3cd.legacy.js").then(t=>{let a=[];e.children.forEach(e=>{e instanceof t.default&&a.push(e)}),a.forEach(t=>{e.remove(t),Ya(t)}),n&&He(this._activeComponents,e),r()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}pn([fn],Ii.prototype,"_plannerKernelAccess",void 0);class ki{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class Di extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new ki,this._topView=!1;const t=Cr(e.getCenter());this._container=new I,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),Qa(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new I,this._container.add(this._object))}getSize(){return this._object?(new we).setFromObject(this._object).getSize(new s):new s}update(){this._container.position.copy(Cr(this.getPlanElement().getMeshCenter())),this._boundingBox&&this._updateBoundingBox()}_updateBoundingBox(){const e=this.getSize();this._boundingBox.geometry=new je(e.x,e.y,e.z),this._boundingBox.position.y=e.y/2}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=Na(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new we,e.setFromObject(this._container)),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=ni(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){Ya(this._container),this._selectionMesh&&Ya(this._selectionMesh)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=(ti||(ti=new C,ti.visible=!1),ti))}_generateBoundingBox(){const e=this.getSize(),t=new je(e.x,e.y,e.z);let n=new h("#DDDDDD");const r=this.getPlanElement().customColor;r>0&&(n=(e=>{let t=new h;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(r));let a=Fa.createMeshStandardMaterial({color:n,opacity:1,transparent:!0}),i=new K(t,a);return i.name="bounding box",i.position.y=e.y/2,i.castShadow=!1,i.receiveShadow=!1,i.layers.set(6),i}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setTopView(e){this._topView=e}}class Oi extends Di{constructor(e){super(e),this._initDone=!1,this._initFailed=null,this._initWaiter=new ki,this._container.rotation.y=e.rotation}finishInit(){return this._initDone=!0,this._initFailed=null,this._initWaiter.resolve()}failInit(e){return this._initFailed=e,this._initDone=!1,this._initWaiter.reject(this._initFailed)}isInitDone(){return this._initDone?Promise.resolve():this._initFailed?Promise.reject(this._initFailed):this._initWaiter.create()}getPlanObject(){return this.getPlanElement()}getSize(){return Mr(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class Li extends Oi{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}finishConstruction(){return this.finishInit()}failConstruction(){return this.failInit(new Error("Construction of configuration failed"))}}e("c",Li);let Ui=JSON.parse(JSON.stringify({isProduction:!0,isUnitTesting:!1,environment:"production",detailEnvironment:"development",features:{},APP:{RAPI:{server:"/api/v2",localReverseProxy:"https://www.roomle.com/api/v2",liveServer:"https://www.roomle.com/api/v2",testServer:"https://www.test.roomle.com/api/v2",headers:{apiKey:"roomle_portal_v2",currentTenant:9,locale:"en",language:"en",device:1,token:"anonymous",platform:"web"},itemHeaders:{assetRevision:"glb",assetFileFormat:"glb"}},SHORTENER_URL:"http://rml.co/"},environments:{PRODUCTION:"production",DEVELOPMENT:"development",TEST:"test",TEST_SERVER:"test_server",ALPHA:"alpha"}}));Ui.isUnitTesting=!1,void 0!==t&&t.exports||(window.IS_DEBUG=!0);const Fi={ENV_DEBUG:function(e=!1){if(e){let e=JSON.parse(JSON.stringify(Ui));const t={...e.APP,SHORTENER_URL:"http://localhost:4747/?isItem=false&id="},n={...e.features};return{...e,isProduction:!1,APP:t,features:n}}}(),ENV_PRODUCTION:JSON.parse(JSON.stringify(Ui))};var Ni=e("m",Fi.ENV_PRODUCTION);class Bi extends Oi{constructor(e){super(e),this._originalSize=new s,this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}async _addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=Ve(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?Mr(t.size):void 0,r=new s(1,1,1);t.flipX&&(r.x*=-1),t.flipY&&(r.z*=-1);try{const a=await this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,r,t.customColor,e.colorable);this._originalSize.copy(a.boundingBox.getSize(new s)),a.scene.name=e.label,this.setObject(a.scene),((e,t)=>{let n=(new we).setFromObject(e),r=n.getSize(new s),a=Math.min(r.x,r.y,r.z),i=!0;a>5&&(console.warn("GLB seems to be too big ("+a+")",t),i=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),i=!1)})(a.scene,this._glbUrl),Qa(a.scene),this._container.add(this.getObject()),this.hidePreviewBox(),await this.finishInit()}catch(e){await this.failInit(e)}}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}update(){const e=Mr(this.getPlanElement().size),t=this.getObject();if(!t)return;if(e){const{x:n,y:r,z:a}=this._originalSize;let i=new s(e.x/n,e.y/r,e.z/a);t.scale.copy(i)}this.getPlanElement().flipX&&(t.scale.x*=-1),this.getPlanElement().flipY&&(t.scale.z*=-1);const n=this.getPlanElement().customColor;t.traverse(e=>{if(e instanceof K&&e.material instanceof H){const t=e.material;if(this._rapiItem.colorable&&n&&n>0){let e=new h(n);t.color=e.copySRGBToLinear(e)}t.needsUpdate=!0}}),super.update()}}let zi;e("S",Bi),pn([fn],Bi.prototype,"_staticItemLoader",void 0),e("al",e=>{const{id:t,textRotation:n,length:r,lengthFormatted:a}=e;return{id:t,fromWithoutPadding:ai(e.fromWithoutPadding),toWithoutPadding:ai(e.toWithoutPadding),fromPosition3d:ai(e.fromPosition3d),toPosition3d:ai(e.toPosition3d),textPosition3d:ai(e.textPosition3d),fromPosition2d:ri(e.fromPosition2d),toPosition2d:ri(e.toPosition2d),textPosition2d:ri(e.textPosition2d),textDirection:ai(e.textDirection),textRotation:n,length:r,lengthFormatted:a}});const Hi=()=>(zi||(zi=Fa.createMeshPhysicalMaterial({color:0})),zi);class ji extends Di{constructor(e){super(e),this._container.name="Wall Plan Element"}get isSelected(){return this._isSelected}getWallDimension(e){const t=this.getPlanElement(),n=Cr(t.getCenter()),r=t.getPreferredSide();let a,i;0===r.value?(a=Cr(t.getCornerFromLeft()),i=Cr(t.getCornerToLeft())):1===r.value&&(a=Cr(t.getCornerFromRight()),i=Cr(t.getCornerToRight()));const o=a.clone().add(i).divideScalar(2),l=a.clone().sub(i),h=l.clone().cross(new s(0,1,0)).normalize();h.clone().dot(o.clone().sub(n))<0&&h.multiplyScalar(-1);const d={maxZoomedIn:Math.max(.7,e),maxZoomedOut:.01,minPadding:.05,maxPadding:.25},c=Ge(e,d.maxZoomedIn,d.maxZoomedOut,d.minPadding,d.maxPadding),u=h.clone().multiplyScalar(c/2),p=a.clone().add(u),m=i.clone().add(u),f=h.multiplyScalar(c),g=a.add(f),v=i.add(f),_=l.clone();l.dot(new s(1,0,0))<0&&_.multiplyScalar(-1);const w=Math.atan2(_.z,_.x),b=g.clone().add(v).divideScalar(2);return{id:t.getId(),fromPosition3d:g,toPosition3d:v,textPosition3d:b,textDirection:_,textRotation:w,length:t.getLength(r.value),fromWithoutPadding:p,toWithoutPadding:m}}addMesh(e){e.traverse(e=>{this._setMaterial(e)}),e.layers.set(9),super.addMesh(e);const t=(new we).setFromObject(this.getObject()).getSize(new s);this._boundingBox.geometry=new je(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}show(){var e,t;this.getContainer().visible=!0,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.set(9)}),null===(t=this.getBoundingBox())||void 0===t||t.layers.set(6)}hide(){var e,t;this.getContainer().visible=!1,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.disableAll()}),null===(t=this.getBoundingBox())||void 0===t||t.layers.disableAll()}_enableTopView(){this._container.traverse(e=>{this._setTopMaterial(e)})}_setTopMaterial(e){e instanceof K&&!e.userData.originalMaterial&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial=e.material,e.material=Hi())}_disableTopView(){this._container.traverse(e=>{e instanceof K&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof K&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new C({color:10526880,side:j}):this._topView&&!this._isSelected?e.material=Hi():(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial))}select(){super.select(),this._container.traverse(e=>{this._setMaterial(e)})}deselect(){super.deselect(),this._container.traverse(e=>{this._setMaterial(e)})}}e("W",ji);class Vi extends Di{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){this.getObject().clear(),super.addMesh(e),e.layers.set(9),e.castShadow=!1,e.position.y=-.001}}e("F",Vi);class Gi extends Di{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new we).setFromObject(this.getObject()).getSize(new s);this._boundingBox.geometry=new je(t.x,.01,t.z)}}e("f",Gi);const Ki=new Map;class Wi{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const r=t>0?e+"_"+n+t:e,a=r+"_start";return window.performance.mark(a),r}static addMeta(e,t){const n=Wi.getMeta(e);Ki.set(e,Object.assign(n,t))}static getMeta(e){return Ki.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let r=0,a=t.length;r<a;r++){const a=t[r];e&&-1===a.name.indexOf(e)||n.push({Start:parseFloat(a.startTime.toFixed(2)),Name:a.name,Duration:parseFloat(a.duration.toFixed(2))})}console.table(n)}}e("B",Wi);class Xi{static init(e={}){const{kernelInstance:t,kernelContainer:n,planObjectId:r}=e;Xi.kernelInstance=t,Xi.kernelContainer=n,Xi.planObjectId=r}static cleanUp(){Xi.useHDGeometry=!1,Xi.kernelInstance=null,Xi.kernelContainer=null,Xi.planObjectId=null}}e("A",Xi),Xi.useHDGeometry=!1,Xi.kernelInstance=null,Xi.kernelContainer=null,Xi.planObjectId=null;const qi=new Map,Qi=function(e,t,n){let r=qi.get(e);if(r){const a=n?[n]:void 0;r.forEach(({resolve:e,reject:n})=>t?e.apply(e,a):n.apply(n,a)),qi.delete(e)}};class Yi{static finishOperation(e,t){Qi(e,!0,t)}static failOperation(e,t){Qi(e,!1,t)}static waitFor(e,t){return new Promise((n,r)=>{let a=qi.get(e);a||(qi.set(e,[]),a=qi.get(e)),a.push({resolve:n,reject:r}),"function"==typeof t&&t.apply(t)})}}e("J",Yi);const Zi=e("K",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),Ji=function(e){return e.validValues&&e.validValues.length>0},$i=e("M",(function(e){return"Material"===e.type}));let es,ts,ns,rs,as;const is={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-1c0cd611bc49189a.wasm",LOADER:"static/ConfiguratorKernel-4cae014a679bd075.js"},PLANNER:{URL:"static/RoomleCore-26026cbacf1a880f.wasm",LOADER:"static/RoomleCore-c8f6b8cd39eb2b33.js"}},WASM_MODERN:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-363414f9aa4b38d0.wasm",LOADER:"static/ConfiguratorKernel-5c4fcff0d630e61b.js"},PLANNER:{URL:"static/RoomleCore-d182af273b61509c.wasm",LOADER:"static/RoomleCore-c9e8fbc848d32a0e.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-26999094ff0b84a2.mem",LOADER:"static/ConfiguratorKernelJs-4e89d1179ab69d19.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-b0b9ed4819b6ab9d.mem",LOADER:"static/RoomleCoreJs-e9d8d9c117b8fdb6.js"}}},ss=!!window.WebAssembly;class os{_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}constructor(e){this._requestedItemIds=[],this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=ss,this._kernelPath=ss?ns:rs}_initKernel(){const{restrictionLevel:e}=this._initData,t=!1!==this._initData.callbacksOnlyIfGeometryIsReady;this._kernelInstance.setUpdateCallbacksOnlyIfGeometryIsReady(t),this._kernelInstance.setLevel(e),this._unitFormatter.init(this._kernelContainer),this._kernelInstance.setEnvironmentVariable("unit",this._unitFormatter._actualUnitString||"cm"),this._kernelInstance.setEnvironmentVariable("unitString","short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:r}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",r)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}get configurationExporter(){return this._configurationExporter||(this._configurationExporter=this._kernelContainer.newConfigurationExporter()),this._configurationExporter}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";es=is.ASM[t].MEM_URL,rs=is.ASM[t].LOADER,WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11]))?(ts=is.WASM_MODERN[t].URL,ns=is.WASM_MODERN[t].LOADER):(ts=is.WASM[t].URL,ns=is.WASM[t].LOADER),as=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const r=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(r)?n()+es:t},wasmBinaryFile:n()+ts,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){0!==e&&t._kernelIo.throw(e&&e.toString?e.toString():"Unknown error while C/C++ main executes")}},as&&ss&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,r)=>{const a="function"==typeof WebAssembly.instantiateStreaming;Wi.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let i=null;a?(Wi.start("kernel_stream_compile"),i=WebAssembly.instantiateStreaming(fetch(n()+e),t)):(Wi.start("kernel_legacy_compile"),i=fetch(n()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Wi.addMeta("kernel_is_ready",{instantiateStreaming:a}),i.then(e=>{r(e.instance)},e=>console.error(e))})(ts,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,r=t.get(n);if(r)for(let t=0,a=r.length;t<a;t++){const{parentId:a,partId:i}=r[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(a,i,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,r=t.length;n<r;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:Pr}),Ni.isProduction||Ni.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback)}addDebugInfo(){const e=function(t,n=[]){const r=Object.getPrototypeOf(t),a=r?Object.getOwnPropertyNames(r):[],i=t?Object.getOwnPropertyNames(t):[];return r?e(r,[...n,...i,...a]):[...i,...a,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const r=this.kernelInstance.getPlanObject(e),a=(new Date).toISOString(),i=this.kernelInstance.getComponentId(e),s=hn(i),o=(null===(n=r.boxForMeasurement)||void 0===n?void 0:n.size)||r.bounds;t({created:a,lastAccess:a,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:i,width:o.x,height:o.z,depth:o.y,catalog:s,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(r=>{var a;let i=r.configuration;i||(i="error",null===(a=this._configuratorUiCallbacks)||void 0===a||a.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,i,t,n),this._flushSubComponentsWaiters()},r=>{var a;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(r,t.componentId),null===(a=this._configuratorUiCallbacks)||void 0===a||a.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${r}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let r=this._subComponentsWaiters.get(n);r||this._subComponentsWaiters.set(n,[]),r=this._subComponentsWaiters.get(n),r.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,r)}else this._rapiAccess.getComponent(n).then(r=>{var a;let i=r.configuration;i||(i="error",null===(a=this._configuratorUiCallbacks)||void 0===a||a.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,i)})}async loadItemConfigurations(e,t){let n=Array.isArray(t)?t:[t];if(this._requestedItemIds.push(...n),await Ke(0),!this._requestedItemIds.length)return;const r=[...this._requestedItemIds];this._requestedItemIds=[],(await this._rapiAccess.getItems(r)).forEach(t=>{this._kernelInstance.loadedItemConfiguration(e,t.id,t.configuration)})}requestDeleteComponent(e){var t,n;e&&((null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)?this._kernelInstance.deletePlanComponent(e):this._kernelInstance.deleteComponent(e))}dockComponentWithPosition(e,t,n,r,a){var i;this._kernelInstance.dockComponentWithPosition(n,r,e,t,a);const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);null===(i=this._configuratorUiCallbacks)||void 0===i||i.onUserInitiatedDockDone(s,r,o,t,a)}Editor3dAddBakedMesh(e,t,n,r,a,i,s,o){this._configuratorKernelCallbackListener.forEach(l=>l.Editor3dAddBakedMesh(e,t,n,r,a,i,s,o))}Editor3dAddNamedMesh(e,t,n,r,a,i,s,o,l,h,d,c){this._configuratorKernelCallbackListener.forEach(u=>u.Editor3dAddNamedMesh(e,t,n,r,a,i,s,o,l,h,d,c))}Editor3ChangedNamedMesh(e,t,n,r,a,i,s){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3ChangedNamedMesh(e,t,n,r,a,i,s))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentCreated(e,t,n,r,!1))}Editor3dComponentDocked(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentDocked(e,t,n,r))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e),this._configuratorUiCallbacks.onGeometryReady(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e)),this._configuratorUiCallbacks.onGeometryNotReady(e)}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,Yi.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const r=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:r,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(t),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e,t=!0){t?this._kernelInstance.requestDeltaPlanComponentConstruction(e):this._kernelInstance.requestPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await Ke(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const r=await this._rapiAccess.getMaterials(n);let a=[];r.forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&a.push({id:e.id,properties:t})}),a.length&&this._kernelInstance.setMaterialProperties(a)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var r;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(r=this._configuratorUiCallbacks)||void 0===r||r.onMemoryCorruption()}}_handleInvalidMesh(e){try{this._kernelInstance.setExternalMeshInvalid(e)}catch(e){console.error(e)}}calcPartsPriceSum(e){return this._calcPrice(e)}_calcPrice(e){const t=new Map;e||(e=this._kernelInstance.getFullPartList());const n=!!e&&!!e.fullList&&!!e.fullList.length;if(this._initData.useRoomlePrice&&n){const n=e.fullList[0].currencySymbol,r=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0),a=Xe(r,2);return this._configuratorUiCallbacks.onUpdatePrice(n,a),Promise.resolve({totalSum:a,partMap:t})}if(this._initData.usePriceService&&n){const n=e.fullList.reduce((e,n)=>{const r=dn(n);return r&&(t.set(r,n),e.push(r)),e},[]);return new Promise((r,a)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return a(new Error("prices are empty"));let i=0;const s=We(n,"priceId");for(const t of e.fullList){const e=dn(t);if(!s.has(e)){console.warn("PriceId: "+e+" has no corresponding kernel-part");continue}const{price:n,currencySymbol:r}=s.get(e);t.price=n,t.currencySymbol=r,i+=n*t.count}return i=Xe(i,2),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,i),r({totalSum:i,partMap:t})},e=>{console.error(e),a(e)})})}return Promise.resolve({totalSum:0,partMap:t})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:r}=e,a=e.perMainComponent;let i;this.addUiDataToPartList(n,t);try{const t=await this._calcPrice(e);i=t.partMap}catch(e){console.error(e),i=new Map}const s=this._initData.usePriceService||this._initData.useRoomlePrice,o=e=>{s||(e.price=null,e.currencySymbol=null);const t=dn(e);if(!t)return;if(!i.has(t))return;const{price:n,currencySymbol:r}=i.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=r)};return n.forEach(o),a.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(o)}),{fullList:n,perMainComponent:a,originPart:r}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),$i(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const r=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(r,btoa(e))}}pn([fn],os.prototype,"_rapiAccess",void 0),pn([fn],os.prototype,"_scriptLoader",void 0),pn([fn],os.prototype,"_kernelIo",void 0),pn([fn],os.prototype,"_dataSyncer",void 0),pn([fn],os.prototype,"_lifeCycleManager",void 0),pn([fn],os.prototype,"_configuratorUiCallbacks",void 0),pn([fn],os.prototype,"_globalCallback",void 0),pn([fn],os.prototype,"_initData",void 0),pn([fn],os.prototype,"_unitFormatter",void 0),pn([fn],os.prototype,"_configuratorContext",void 0),pn([fn],os.prototype,"_globalInitData",void 0);const{APP:ls}=Ni,{RAPI:hs}=ls,ds=hs.headers,cs=hs.itemHeaders,us=ds.token,ps=e("am",e=>e.startsWith("ps_")),ms=qe();let fs=new Map,gs=new Map,vs=new Map,_s=new Map,ws=new Map,bs=new Map,ys=new Map,xs=new Map,Ss=new Map;const Cs=e=>fs.get(e)||fs.get(ms+e),Ms=e=>e&&e.tags&&e.tags.length,Ts=e=>!Ms(e)&&e.group;class As{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,r)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(hn(e)))return n();if(ys.get(e))return n();const a=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+a+e,"preloads/components").then(t=>{if(ys.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),ys.set(e,!0),n()},r)})}changeUseOfHDGeometry(){const e=_s.get("components");ys.clear(),bs.clear(),e&&_s.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(bs.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(bs.get(e))return t(n);n.components.forEach(e=>{this._prepareData(e,"components")}),n.materials.forEach(e=>{this._prepareData(e,"materials"),this._prepareGroups(e)}),n.textures.forEach(e=>{this._prepareData(e,"textures")}),bs.set(e,!0),t(n)},n)})}getComponent(e){return this._getById(e,"components")}getConfiguration(e){return this._getById(e,"configurations")}getConfigurations(e){return this._getByIds(e,"configurations")}getItem(e){return this._getById(e,"items",{additionalHeaders:cs})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:cs})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const r=ws.get(e);r?t(r):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{ws.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const r=gs.get(e.id.toString());r?n.push(...r):t.push(e.id.toString())}),new Promise((e,r)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=gs.get(e.itemId);t||(t=[]);for(let n=0,r=t.length;n<r;n++)if(t[n].id===e.id)return;t.push(e),gs.set(e.itemId,t)}),e([...t,...n])},r):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}getPlanSnapshot(e){return this._getById(e,"planSnapshots")}static clearCaches(){fs=new Map,vs=new Map,_s=new Map,bs=new Map,ys=new Map,xs=new Map,gs=new Map}cleanUp(){As.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let r=t.length;for(let e=0;e<r;e++){const a=Cs(t[e]);if(a){const i=a.length;for(let e=0;e<i;e++){const t=this._getCache("materials").get(a[e]);n.push(t)}t.splice(e,1),r--,e--}}return new Promise((e,r)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},r):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),r=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];r.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(r=>{const a=[];t.perspectiveImage&&!r.perspectiveImage&&a.push(this.savePerspectiveImage(r,t.perspectiveImage)),t.topImage&&!r.topImage&&a.push(this.savePerspectiveImage(r,t.topImage)),Promise.all(a).then(e,n)},n)}))}Promise.all(r).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:r,topImage:a}=t;let i=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},s=i[n]||{};s.data=e,s.perspectiveImage=r,s.topImage=a,i[n]=s,this._localStorage.setItem("hsc_configurations_offline_queue_v1",i)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}savePlanSnapshotTopImage(e,t){return this._savePlanSnapshotImage(e,t,"topImage")}savePlanSnapshotPerspectiveImage(e,t){return this._savePlanSnapshotImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,r)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:r,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=_s.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const r={};return r[n]=t,this._setQueuedConfiguration(e,r),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const r=this._formDataUtil.create(t.image,e.configurationHash,rn.PNG,n);return this._save("/configurations/"+e.id+"/"+n,r,"configurations",{accept:"application/json"})}_savePlanSnapshotImage(e,t,n){const r=this._formDataUtil.create(t.image,e.id,rn.PNG,"file");return r.append("type",n),this._save("/planSnapshots/"+e.id,r,"planSnapshots",{accept:"application/json",method:"PUT"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,r={}){const a=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,i)=>{const s={method:r.method||"POST",data:a,resolve:t,reject:i};r.contentType&&(s.contentType=r.contentType),r.accept&&(s.accept=r.accept),this._fetchJson(e,n,s)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const r=new Map,a={id:null,label:null,materials:[]},i=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&s.push({isTag:!1,id:ms+n.group,legacyId:n.group}),s.length||s.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===i.indexOf(e)?i.push(e):null),s.forEach(({isTag:e,id:t,legacyId:i})=>{const s=n.id;let o=t?Cs(t):[];o||(fs.set(t,[]),o=Cs(t)),-1===o.indexOf(s.toString())&&o.push(s.toString());const l=Ms(n),h=l&&e,d=Ts(n);if(h||d&&!e||!l&&!d&&!t){let e=t?r.get(t):a;e||(r.set(t,{id:t,label:n.groupLabel,legacyId:i,materials:[]}),e=r.get(t)),e.materials.push(n)}})}const s=a.materials.length?[a]:[];this.getTags(i).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return r.forEach((e,t)=>{s.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(s)},n)})}_getByIds(e,t,n={}){const r=this._getCache(t),a=this._getErrorCache(t),i=[],s=[...new Set(e)];let o=s.length;if(r&&r.size){const e=(new Date).getTime();for(let t=0;t<o;t++){const n=s[t],l=r.get(n),h=a.get(n);let d=!1;null!=l?(i.push(l),d=!0):d=void 0!==h&&(e-h.timestamp<6e4||!1===navigator.onLine),d&&(s.splice(t,1),o--,t--)}}return new Promise((e,r)=>{0!==s.length&&navigator.onLine?this._getByIdsPackets(s,t,n).then(t=>{e([...t,...i])},r):e(i)})}_getByIdsPackets(e,t,n={}){const r=n.filterKey||"ids";let a,i="/"+t+"/",s="?",o=[];const l=e.length;if(!l)return new Promise(e=>e([]));let h=!0,d=[];for(a=0;a<l;a++){h=!1;const n=e[a],l=s+r+"[]="+n,c=l.length+i.length;d.push(n),s="&",c<=1500?i+=l:(c>1500&&(d.pop(),a--),o.push({url:i,ids:d}),h=!0,i="/"+t+"/",s="?",d=[])}h||o.push({url:i,ids:d});const c=[];return o.forEach(e=>c.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(c).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,r={}){return new Promise((a,i)=>{this._get(t,n,r).then(t=>{for(let n=0,a=t.length;n<a;n++){const a=r&&r.cacheKey?t[n][r.cacheKey]:t[n].id,i=e.indexOf(a.toString());-1!==i&&e.splice(i,1)}const i=e.length;if(i){const t=this._getCache(n),r=this._getErrorCache(n),a=(new Date).getTime();for(let n=0;n<i;n++)r.set(e[n],{code:0,timestamp:a}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}a(t)},i)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const r=this._getCache(t).get(e);if(r)return new Promise(e=>e(r));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const a={...n,id:e},i=n.pathSuffix||"";return this._get("/"+t+"/"+e+i,t,a)}_get(e,t,n={}){const r=Xi.useHDGeometry?"includeGeometryHD=true":"";let a=-1===e.indexOf("?")?"?":"&";return""!==r&&(e+=a+r),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=a+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",a="&"}),new Promise((r,a)=>{const i=xs.get(e);Array.isArray(i)&&i.length>0?i.push({resolve:r,reject:a}):(xs.set(e,[{resolve:r,reject:a}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(Qe.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let r=hs.server;const a=this._globalInitData.overrideRapi;a&&(r="live"===a?hs.liveServer:hs.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(r=this._globalInitData.customApiUrl);const i=new Request(r+e,n);this._globalCallback.onNetworkRequest(e,n,t);const s=await this._globalCallback.onCheckExternalCache(e,n);return s?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(s)}:this._networkLayer.fetch(i,{},{checkResponse:e=>this._globalCallback.onValidateNetworkResponse("rapi-access",e)})}_createHeaders(e={}){const t={...ds};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:r,accept:a,additionalHeaders:i,data:s}=e;if(r&&(t["content-type"]=e.contentType),a&&(t.accept=e.accept),i)for(let e in i)i.hasOwnProperty(e)&&(t[e]=i[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const o=this._currentToken||us;t.token="03-"+window.btoa((new Date).toISOString()+";"+o+";"+ds.apiKey);const l=new Headers(t);return s instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return r=>{let a=null,i=null;"number"==typeof r&&(a=r);for(let e in r)"meta"!==e&&r.hasOwnProperty(e)&&(a=r[e],i=e);if("error"===i)return this._handleError(e,n)(new Error(JSON.stringify(a)));if(!a)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(a))for(let e=0,r=a.length;e<r;e++)this._prepareData(a[e],t,n),this._prepareEmbeddedData(a[e],t,n);else this._prepareData(a,t,n),this._prepareEmbeddedData(a,t,n);n.resolve?n.resolve(a):this._notifyWaiters(e,null,a)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(r=>{const a=e[r.slice(0,-1)+"Objects"];if(Array.isArray(a)){for(let e=0,t=a.length;e<t;e++)this._prepareData(a[e],r,n);this._prepareRelationalData(t,r,e.id,a)}else a&&(this._prepareData(a,r,n),this._prepareRelationalData(t,r,e.id,[a]))})}_getCache(e){return this._getCacheFrom(e,_s)}_getErrorCache(e){return this._getCacheFrom(e,Ss)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let r=this._getCache(t);const a=n&&n.cacheKey?e[n.cacheKey]:e.id;if(a||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=a||n.id;this._setCache(t,e,r)}e.__rapi_path__=t}else this._setCache("0",e,r);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let r=vs.get(t);if(!r){const a=new Map,i=new Map;i.set(n,void 0),a.set(e,i),vs.set(t,a),r=vs.get(t)}let a=r.get(e);if(!a){const t=new Map;t.set(n,void 0),r.set(e,t),a=r.get(e)}return a.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let r=Cs(t);r||(fs.set(t,[]),r=Cs(t)),-1===r.indexOf(n.toString())&&r.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const r=e.id;if(!r)return Promise.resolve([]);const a=e.__rapi_path__,i=t.rapiPath;let s=this._getCache(i),o=this._getRelationsCacheFor(r.toString(),a,i),l=[];return o?(o.forEach(e=>l.push(s.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+a+"/"+r+"/"+i,i,n).then(t=>{this._prepareRelationalData(a,i,r,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,r){vs.has(e)||vs.set(e,new Map);let a=vs.get(e);const i=n.toString();a.has(i)||a.set(i,new Map);let s=a.get(i),o=this._getCache(t),l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=t.id.toString();l.push(n),o.set(n,t)}s.set(t,l)}_notifyWaiters(e,t,n){const r=xs.get(e);if(r&&r.length){for(let e=0,a=r.length;e<a;e++)t?r[e].reject(t):r[e].resolve(n);xs.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),r=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(r)return e(r);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}_share(e,t,n,r){const a="/"+r+"/"+e+"/shares",i=new FormData;return i.append("email",t),i.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:i,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(a,n).then(n.resolve,n.reject)})}shareConfiguration(e,t,n){return this._share(e,t,n,"configurations")}sharePlanSnapshot(e,t,n){return this._share(e,t,n,"planSnapshots")}export3D(e,t,n,r={}){const a="/"+(ps(e)?"planSnapshots":"configurations")+"/"+e+"/3d-exports",i={formats:[{file_format:n,pack_external_data:!0,...r}]},s=JSON.stringify(i),o=new FormData;return o.append("email",t),o.append("settings",s),new Promise((e,t)=>{const n={method:"POST",data:o,resolve:e,reject:t};this._fetch(a,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:r}=new URL(n);return r})())&&(ln.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,r={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(r),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,r)=>{const a={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:r};this._fetchJson("/auth/signin","auth",a)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}async savePlanSnapshot(e){return this._save("/planSnapshots",{planSnapshot:e},"planSnapshots",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}e("R",As),pn([fn],As.prototype,"_formDataUtil",void 0),pn([fn],As.prototype,"_errorHandler",void 0),pn([fn],As.prototype,"_dataSyncer",void 0),pn([fn],As.prototype,"_networkLayer",void 0),pn([fn],As.prototype,"_localStorage",void 0),pn([fn],As.prototype,"_globalInitData",void 0),pn([fn],As.prototype,"_globalCallback",void 0);const Ps=e("o",1500),Rs=e("n",5);function Es(){class e extends I{static _generateOutline(e,t){let n=new W(new Ze(e),new Je({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new W(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new s),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,r){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),r&&(this.parentObjectId=r)}constructor(e,t,n,r){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,r)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new K(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(Er(t)),this.add(e),this.meshes.push(e)}getMeshById(e){return this.meshes.find(t=>t.userData.meshId===e)}removeMeshById(e){const t=this.getMeshById(e);t?this.removeMesh(t):console.warn("Could not remove mesh with id "+e,this.runtimeId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),Ja(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&Ja(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),Ja(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.runtimeId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new s);let r=new je(e,t,n);this._loadingMesh=new K(r,Fa.createMeshStandardMaterial({transparent:!0,opacity:1,color:new h("#DDDDDD")})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new s),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),Ja(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){Ye("pointer")}hoverOff(){Ye("default")}removeFromParent(){return this.parent&&(this.parent.remove(this),this.removeAllMeshes()),this}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let r;if(!t||n){this._boundingBox=new we;let e=new s;this.meshes.forEach(t=>{if(t.geometry instanceof c){let n=t.geometry.attributes.position;if(void 0!==n)for(let r=0,a=n.count;r<a;r++)e.fromBufferAttribute(n,r).applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,a=this._boundingBox.max.z-this._boundingBox.min.z;r=new je(t,n,a)}else{this._kernelBoundingBox=Na(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:a}=this._boundingBox.getSize(new s);r=new je(e,n,a)}this._boundingBoxMesh=new K(r,Fa.createMeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let a=this._boundingBox.getCenter(new s);this._boundingBoxMesh.position.add(a),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(r,a),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(r=>{r instanceof e&&!n&&(n=r.runtimeId===t||r.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return Tr(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,r,a){super(t,n,r,a),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1,this._creator_=e}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof H&&(e.material.opacity=.8,e.material.roughness=1,e.material.metalness=0,e.material.color=new h(this._initData.colors.PREVIEW_DOCKING_COLOR)),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}startPulsating(){var e,t;if(null===(t=null===(e=this._initData)||void 0===e?void 0:e.featureFlags)||void 0===t?void 0:t.pulsePreview)for(const e of this.meshes){const t={opacity:.8},n={opacity:.3};new TWEEN.Tween(t).to(n,Ps).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.material.opacity=t.opacity}).yoyo(!0).repeat(Rs).start()}}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new h(this._initData.colors.PREVIEW_DOCKING_COLOR)}),Ye("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.8,e.roughness=1,e.metalness=0,e.color=new h(this._initData.colors.PREVIEW_DOCKING_COLOR)}),Ye("default")}clonePreview(t){const r=new n(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return r._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof K&&0===e.userData.meshType&&r.meshes.push(e.clone(!0))}),r.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),r.add(e)}),this._dockline&&(r._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(r._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(r._boundingBox=this._boundingBox.clone()),r}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}pn([fn],n.prototype,"_initData",void 0);class r extends n{constructor(e,t,n,r,a,i){super(e,t,n,r,a),i&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=Cr(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=Cr(e);t.equals(this.lineFrom)&&(console.warn("lineFrom and lineTo are equal!"),t.add(new s(0,.01,0))),this.lineTo=t}get roomleLineTo(){return this._roomleLineTo}set roomlePositionFrom(e){this._roomlePositionFrom=e,this.positionFrom=Cr(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=Cr(e);t.equals(this.positionFrom)&&(console.warn("positionFrom and positionTo are equal!"),t.add(new s(0,.01,0))),this.positionTo=t}get roomlePositionTo(){return this._roomlePositionTo}addMesh(e,t){super.addMesh(e,t),e.visible=!1,e.renderOrder=3}hoverOn(){this._dockline.visible=!0,Ye("pointer")}hoverOff(){this._dockline.visible=!1,Ye("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new s).subVectors(e,t);let r=n.length(),a=n.normalize(),i=new $e(a,t),o=new et(.01,.01,r,16,1);this.lineMesh=new K(o,Fa.createMeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const l=(new R).setFromEuler(i.rotation);this.lineMesh.quaternion.multiply(l),this.lineMesh.renderOrder=1;let h=(new s).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new s).subVectors(h,this.position.clone())),this.add(this.lineMesh);let d=this._boundingBox.getCenter(new s).applyEuler(this.docklineRotation),c=null,u=0,p=Math.abs(a.x),m=Math.abs(a.y),f=Math.abs(a.z);p>=m&&p>=f?(c=new s(d.x,0,0),u=Math.sqrt(d.y*d.y+d.z*d.z)):m>=p&&m>=f?(c=new s(0,d.y,0),u=Math.sqrt(d.x*d.x+d.z*d.z)):f>=m&&f>=p&&(c=new s(0,0,d.z),u=Math.sqrt(d.y*d.y+d.x*d.x)),u=u>0?u:.01;let g=(new s).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+c.length(),v=new et(1.1*u,1.1*u,g,32,1);this.boundingLineMesh=new K(v,Fa.createMeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0,this.boundingLineMesh.layers.set(5);let _=this.positionTo.clone(),w=this.positionFrom.clone(),b=(new s).subVectors(_,w).normalize(),y=new $e(b,w);const x=(new R).setFromEuler(y.rotation);this.boundingLineMesh.quaternion.multiply(x),this.boundingLineMesh.renderOrder=3;let S=(new s).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(d);this.boundingLineMesh.position.copy((new s).subVectors(S,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new r(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof K&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new s).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),r=this.positionFrom.clone().add(t),a=new tt(r,n).closestPointToPoint(e,!0,new s);return(isNaN(a.x)||isNaN(a.y)||isNaN(a.z))&&a.copy(e),a.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let r=this._boundingBox.getCenter(new s).applyEuler(this.docklineRotation);this._dockline.position.copy((new s).addVectors(this._newPosition,r)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return Tr(e.worldToLocal(t))}return super.getKernelPosition(e)}}class a extends ${constructor(e,t,n,r,a,i,s){super(e,t,n,r,a,i),s||(s={left:0,top:1,right:1,bottom:0}),this.offset=s}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}resetOffset(){this._offset={left:0,top:1,right:1,bottom:0}}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}_calculateProjectionMatrix(){const e=this._calculate2DPlanes();if(this._offset.left>=this._offset.right||this._offset.bottom>this._offset.top)return(new P).makeOrthographic(e.left,e.right,e.top,e.bottom,this.near,this.far);const t=this._scaleRange(e.left,e.right,this._offset.left,this._offset.right);let n=t.from,r=t.to;const a=this._scaleRange(e.bottom,e.top,this._offset.bottom,this._offset.top);let i=a.from,s=a.to;const o=(e.right-e.left)/(e.top-e.bottom),l=(r-n)/(s-i);if(l>o){const e=(i+s)/2,t=(s-i)*l/o;i=e-t/2,s=e+t/2}else{const e=(n+r)/2,t=(r-n)*o/l;n=e-t/2,r=e+t/2}return(new P).makeOrthographic(n,r,s,i,this.near,this.far)}_scaleRange(e,t,n,r){const a=(t-e)/(r-n);return{from:e-a*n,to:t+a*(1-r)}}_calculate2DPlanes(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=n-e,i=n+e,s=r+t,o=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=e*this.view.offsetX,i=a+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}return{left:a,right:i,top:s,bottom:o}}}class o extends Z{constructor(e,t,n,r,a){super(e,t,n,r),a||(a={left:0,top:1,right:1,bottom:0}),this.offset=a}copy(e,t){return super.copy(e,t),this._offset=e._offset,this}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}resetOffset(){this._offset={left:0,top:1,right:1,bottom:0}}_calculateProjectionMatrix(){let e,t,n,r,a=this.fov*(2*Math.PI/360)/2;n=Math.tan(a),r=-n;let s=Math.atan(this.aspect*Math.tan(a));t=Math.tan(s),e=-t;let o=this._offset.left,l=this._offset.right,h=this._offset.top,d=this._offset.bottom,c=new i(l-o,h-d),u=new i(o+c.x/2,d+c.y/2);if(c.x<c.y){let a=(1-u.x)/(c.x/2),i=u.x/(c.x/2);t*=a,e*=i;let s=(a+i)/2;n*=s,r*=s}else{let a=(1-u.y)/(c.y/2),i=u.y/(c.y/2);n*=a,r*=i;let s=(i+a)/2;e*=s,t*=s}e*=this.near,t*=this.near,n*=this.near,r*=this.near;let p=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,m=this.aspect*p;return this.view&&this.view.enabled&&(e+=this.view.offsetX*m/this.view.fullWidth,n-=this.view.offsetY*p/this.view.fullHeight,t+=this.view.offsetX*m/this.view.fullWidth,r-=this.view.offsetY*p/this.view.fullHeight),(new P).makePerspective(e,t,n,r,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,r,a){return new e(t,n,r,a)},createPreview:function(e,t,r){return new n(r,e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e,t){let n=new r(t,e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let t=e.clone();t.material=e.material.clone(),t.geometry=e.geometry.clone(),n.addMesh(t)}),n.computeBoundingBox(),n},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof r},createPerspectiveCamera:function(e,t,n,r,a){return new o(e,t,n,r,a)},createOrthographicCamera:function(e,t,n,r,i,s,o){return new a(e,t,n,r,i,s,o)}}}const Is=e("z",9);class ks{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Ds,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=Es()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return xh.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,r,a){if(n){const r=e.userData.transform=Er(n);t&&(e.userData.transform=r),e.applyMatrix4(r)}this._applyMeshUVTransform(e,t,r,a)}_applyMeshUVTransform(e,t,n,r){if(6!==(null==n?void 0:n.length)||(e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5])(n))t&&(t.uvTransform=void 0),r&&(e.geometry=r);else{const a=(e=>{const t=new P;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(n);t&&(t.uvTransform=a);const i=null!=r?r:e.geometry;if(i&&i.attributes.uv){const t=i.clone();t.attributes.uv.applyMatrix4(a),e.geometry=t}}}_addMeshToSubPart(e,t,n,r,a,i,s,o,l,h){const d=this._generateMesh(e,t,n,i,s,o,l,void 0,void 0,h);this._applyMeshTransform(d,null,r,a),this._subPartObject.add(d)}_addMeshToComponent(e,t,n,r,a,i,s,o,l,h,d,c){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,r,null,null,s,o,l,h,c);const u=this.getComponent(e);if(!u)return;const p=this._componentFactory.isPreview(u),m=this._generateMesh(e,n,p?null:r,s,o,l,h,void 0,void 0,c);m.userData.meshId=t,m.userData.geometryId=n,m.userData.materialId=r,this._applyMeshTransform(m,m.userData,a,i),p&&m.layers.set(5),u&&u.addMesh(m),u.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,u.meshes.length)}_changeMeshOfComponent(e,t,n,r,a,i,s){const o=this.getComponent(e);if(!o)return;const l=o.getMeshById(t);if(l){l.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),l.userData.materialId=r,l.userData.materialAttributes=s;const e=l.material.clone();this._configuratorMeshGenerator.setMaterial(l,r,void 0,s).then(()=>{this._requestRenderSceneUpdateCallback&&this._requestRenderSceneUpdateCallback()}),e.opacity!==l.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),a&&(l.position.set(0,0,0),l.scale.set(1,1,1),l.rotation.set(0,0,0));const t=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(l,l.userData,a,i,t)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],r=[];t.meshes.forEach(t=>{const a=t.userData.materialId;if(!a)return void console.warn("mesh has no material id set");if(!e.has(a)){const r=new K(new c,t.material);r.userData.materialId=a,r.receiveShadow=!0,r.castShadow=!0,r.layers.set(3),this._setMaterial(r,a),n.push(r),e.set(a,r)}const i=e.get(a),s=i.geometry;t.userData.transform&&t.geometry.applyMatrix4(t.userData.transform),i.geometry=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),a=new Set(Object.keys(e[0].morphAttributes)),i={},s={},o=e[0].morphTargetsRelative,l=new c,h=0,d=0;d<e.length;++d){var u=e[d],p=0;if(n!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var m in u.attributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;void 0===i[m]&&(i[m]=[]),i[m].push(u.attributes[m]),p++}if(p!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var f in u.morphAttributes){if(!a.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;void 0===s[f]&&(s[f]=[]),s[f].push(u.morphAttributes[f])}if(t){var g=void 0;if(n)g=u.index.count;else{if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;g=u.attributes.position.count}l.addGroup(h,g,d),h+=g}}if(n){for(var v=0,_=[],w=0;w<e.length;++w){for(var b=e[w].index,y=0;y<b.count;++y)_.push(b.getX(y)+v);v+=e[w].attributes.position.count}l.setIndex(_)}for(var x in i){var S=Cn(i[x]);if(!S)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+x+" attribute."),null;l.setAttribute(x,S)}for(var C in s){var M=s[C][0].length;if(0===M)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[C]=[];for(var T=0;T<M;++T){for(var A=[],P=0;P<s[C].length;++P)A.push(s[C][P][T]);var R=Cn(A);if(!R)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+C+" morphAttribute."),null;l.morphAttributes[C].push(R)}}return l}([s,t.geometry]),r.push(t)}),n.forEach(e=>t.addMesh(e)),r.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,r){let a=this._components.get(t),i=this._components.get(e);i&&(i.roomlePosition=n,i.roomleRotation=r,a&&a.add(i))}dockComponentWithPosition(e,t){let n,r=this._components.get(e.parentId);n=t?t.getKernelPosition(r):e.getKernelPosition(r),Wi.start("dock_component_with_position_"+e.childId),this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,r,a,i,s,o){this._addMeshToComponent(e,null,null,t,null,null,n,r,a,i,s,o)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e,this._creator_);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,r,a,i,s,o,l,h,d,c){this._addMeshToComponent(e,t,n,r,a,d,i,s,o,l,h,c)}Editor3ChangedNamedMesh(e,t,n,r,a,i,s){this._changeMeshOfComponent(e,t,n,r,a,i,s)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new I)}Editor3dComponentCreated(e,t,n,r,a){a&&(this._configuratorContext.rootComponentId=e);let i=null;this._components.has(e)?(i=this._components.get(e),i.removeAllMeshes()):(i=this._componentFactory.create(e,t,n,r),i.layers.set(3)),this._components.set(e,i),a&&this._addRootComponent(i)}Editor3dComponentDocked(e,t,n,r){this.dockComponent(e,t,n,r)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let r=this._previews.get(e.toString());r&&r.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];Yi.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let r=this._componentFactory.createPreviewLine(n,this._creator_),a=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?r:r.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(i=e[t].rotation,new Me(i.x,i.z,-i.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),a.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var i}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let r=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let a;0===t?a=n:(a=n.clonePreview(t),this._previews.set(a.stringId,a)),a.name="Preview Point",a.parentDockId=e[t].parentDockId,a.parentId=e[t].parentId,a.childDockId=e[t].childDockId,a.childId=e[t].childId,a.preparePreview(),a.receivedPointAssociation=!0,a.userData.ignoreComponentRaycast=!0,r.add(a),a.roomlePosition=e[t].position,a.roomleRotation=e[t].rotation,a.startPulsating()}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,r,a){10===e&&(this._configuratorContext.dockingRootComponentId=n);let i=0===t;i?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let s=this._getKernelAccess().kernelInstance.getComponent(n),o=this._components.get(n);o&&(o.computeBoundingBox(s.boxForMeasurement),o.hash=s.hash),this._listener&&this._listener.configurationLoaded(o,i&&void 0!==o.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let r=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(r)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._componentNumberOfPossibleChildren.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return Na(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new we).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new we).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}hasPreviewLines(){for(const e of this._previews.values())if(this._componentFactory.isPreviewLine(e))return!0;return!1}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,r,a,i,s,o,l,h){return this._configuratorMeshGenerator.generateMesh(e,t,n,r,a,i,s,!1,h)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new Sn(e),this._getKernelAccess().requestPlanComponentConstruction(e,!1),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}setRequestRenderSceneUpdateCallback(e){this._requestRenderSceneUpdateCallback=e}}e("C",ks),pn([fn],ks.prototype,"_configuratorMeshGenerator",void 0),pn([fn],ks.prototype,"_configuratorContext",void 0),pn([fn],ks.prototype,"_cacheHolder",void 0),pn([fn],ks.prototype,"_initData",void 0);class Ds extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,r)=>{n>t&&(e=r,t=n)}),e}}const Os=["material"];class Ls extends os{constructor(e){super(e),this.externalMeshQueue=new mi,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),Wi.addMeta("kernel_is_ready",{isWasm:this._useWASM}),Xi.kernelInstance?(this._kernelContainer=Xi.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){Wi.start("kernel_is_ready"),window.ConfiguratorKernel&&(Xi.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null))}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);Yi.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,r=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),r.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,r)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,r=!1,a=[];e&&e.forEach(e=>{let i=this._kernelInstance.getComponent(e);i.componentId=this._kernelInstance.getComponentId(e),i&&i.childIds&&i.childIds.length>0&&(n=!0),i.id===t&&(r=!0),a.push(i)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",r,n,a)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let r=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(r),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(r)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,r){const a=this._kernelInstance.getComponentId(n),i=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,r,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(a,r,i,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,r=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),a=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),Yi.finishOperation(3,[a,r])}webGlPreviewDockings(e,t){Yi.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(Is,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,r,a,i){"string"==typeof r?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,a,i),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,r,a,i){"string"==typeof r?this._kernelInstance.setComponentParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,a,i),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,r,a,i){"string"==typeof r?this._kernelInstance.setPlanObjectParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,a,i)}_finishParameterChange(e,t,n){-1===Os.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}requestDeletePlanComponent(e){var t,n;e&&(null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)&&this._kernelInstance.deletePlanComponent(e)}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const r=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(r,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let r=this._kernelInstance.getPlanObjectParameters,a=e;t&&(r=this._kernelInstance.getComponentParameters,a=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(r.apply(this._kernelInstance,[a]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),this._setupKernel(),Ni.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:Pr}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Xi.planObjectId&&this.planObjectCreated(-1,Xi.planObjectId)}_setupKernel(){1===this._kernelType&&(Wi.start("kernel_create_instance"),Xi.kernelInstance?this._kernelInstance=Xi.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,r,a,i){Yi.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:r,errors:Pr(a)}),this._configuratorKernelCallbackListener.forEach(i=>i.configurationLoaded(e,t,n,r,a))}componentDefinitionLoaded(e,t){Yi.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),Yi.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=Pr(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}Yi.failOperation(4,new Error(n)),Yi.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._kernelInstance.setActiveGroupInViewForPlanObject(e,t||this._configuratorContext.planObjectId)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n,r,a){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(r=>r.planObjectConfigurationUpdated(e,t,n));const s=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(s),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const r=new Promise((e,t)=>{n=e});let a;this.externalMeshQueue.push(r),this._configuratorUiCallbacks.onRequestExternalMesh(e,t);try{a=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){return this._handleInvalidMesh(e),this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),void console.error(t)}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(a.url,!0))),i=await r.arrayBuffer();this._handleCortoMesh(i,e,t),n()}catch(t){return this._handleInvalidMesh(e),this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),void console.error(t)}}Editor3dComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentCreated(e,t,n,r,!1)),r&&r>0&&this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentDocked(e,r,t,n))}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),this._initData.moc||this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}createNewSerializedConfiguration(e){return this._kernelInstance.createNewSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}pn([fn],Ls.prototype,"_memoryManager",void 0),pn([fn],Ls.prototype,"_configuratorKernelAccessCallback",void 0),pn([fn],Ls.prototype,"_initData",void 0),pn([fn],Ls.prototype,"_configuratorHistory",void 0);class Us extends Di{constructor(e){super(e);const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new nt(.05,32),t=new C({color:16777215});this._sphere=new K(e,t);const n=new rt(.05,.07,32),r=new C({color:0,side:j});this._innerRingMesh=new K(n,r),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const a=new rt(.07,.08,32),i=new C({color:16777215,side:j});this._outerRingMesh=new K(a,i),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new K,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){super.setTopView(e),e||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new we).setFromObject(this._nodeUiMesh).getSize(new s)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new C({color:10526880,side:j}),super.select()}deselect(){this._innerRingMesh.material=new C({color:0,side:j}),super.deselect()}hoverOn(){this._sphere.geometry=new nt(.07,32),this._innerRingMesh.geometry=new rt(.07,.07+.02,32),this._outerRingMesh.geometry=new rt(.07+.02,.1,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new nt(.05,32),this._innerRingMesh.geometry=new rt(.05,.07,32),this._outerRingMesh.geometry=new rt(.07,.08,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}addMesh(e){super.addMesh(e)}}e("N",Us);class Fs extends Bi{constructor(e){super(e),this._container.name="Construction "+this._container.name}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView(),this._updateBoundingBox()}_enableTopView(){if(!this._topViewContainer){this._topViewContainer=new Y;const e=this.getPlanElement(),{x:t,z:n}=Mr(e.size),r=new je(t,.01,n);if(this._topGreyMesh=new K(r,Fa.createMeshStandardMaterial({transparent:!0,opacity:1,color:11645361})),this._topViewContainer.add(this._topGreyMesh),"window"===e.getObjectType()){const e=new je(t,.02,.05);this._topBlackMesh=new K(e,Fa.createMeshStandardMaterial({transparent:!0,opacity:1,color:0})),this._topViewContainer.add(this._topBlackMesh)}this._topViewContainer.position.y=5,this._container.add(this._topViewContainer)}this._topViewContainer.visible=!0}_disableTopView(){this._topViewContainer&&(this._topViewContainer.visible=!1)}getPlanElement(){return super.getPlanElement()}_generateBoundingBox(){const e=super._generateBoundingBox(),t=this.getSize();return e.geometry=new je(t.x,this._topView?5:t.y,t.z),e}_updateBoundingBox(){super._updateBoundingBox();const e=this.getSize();this._boundingBox.geometry=new je(e.x,this._topView?5:e.y,e.z)}getTopViewContainer(){return this._topViewContainer}update(){if(super.update(),!this._topGreyMesh)return;const{x:e,z:t}=Mr(this.getPlanElement().size);this._topGreyMesh.geometry=new je(e,.01,t),this._topBlackMesh&&(this._topBlackMesh.geometry=new je(e,.02,.05))}}e("d",Fs);class Ns extends Ls{get kernelContainer(){return this._kernelContainer}constructor(e){super(e),this._plannerKernelCallbackListener=new Set}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){this._planInteractionHandler=new this._kernelContainer.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,50,!!this._initData.snappingEnabled,!0,this._kernelContainer.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Ni.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),Xi.kernelInstance?this._kernelInstance=Xi.kernelInstance:this._kernelInstance=this._planInteractionHandler.getConfiguratorKernel()),super._setupKernel()}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){this.planInteractionHandler.startInteraction();let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))});const n=this.planInteractionHandler.getPlan().extRef.jsObject,r=n.getPlanObjectViewModelsFromRapiId().reduce((e,t)=>(e[t.getId()]=!0,e),{});this.planInteractionHandler.addPlanObjects(t,!0),await Promise.allSettled([Promise.allSettled(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}})),Promise.allSettled(n.getConfigurablePlanObjectViewModels().map(e=>e.isInitDone()))]);const a=n.getPlanObjectViewModelsFromRapiId().map(e=>e.getId()).filter(e=>!r[e]);return this.planInteractionHandler.endInteraction(),a}duplicateItems(e){const t=new this.kernelContainer.PlanObjectPtrList;return e.forEach(e=>{t.push_back(e)}),this.planInteractionHandler.duplicatePlanObjects(t,1,!0)}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){this._plannerKernelCallbackListener.forEach(e=>e.planCleared())}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}async _onStaticItemAdded(e,t){let n;n=this.isConstructionPlanElement(t)?new Fs(t):new Bi(t),this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n);const r=t.getCatalogItemId();if(r){const e=await this._rapiAccess.getItem(r);n.setRapiItem(e),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}}_onConfigurableItemAdded(e,t){const n=new Li(t);this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}async planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT)t.hasConfiguration()?this._onConfigurableItemAdded(e,t):await this._onStaticItemAdded(e,t);else{const n=t;let r;if(t.getType()===this._kernelContainer.PlanElementType.WALL?r=new ji(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?r=new Vi(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?r=new Gi(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(r=new Us(n)),!r)return;this.coupleReferences(r,n),e.extRef.jsObject.addPlanElementViewModel(r),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.startedDrawing())}stoppedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.stoppedDrawing())}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,a,i){this._plannerKernelCallbackListener.forEach(s=>s.addMesh(e,t,n,r,a,i))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,a,i,s){this._plannerKernelCallbackListener.forEach(o=>o.addPlanMesh(e,t,n,r,a,i,s))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}async addPlanObjectFromItem(e,t,n){if(!t&&!n){const t=await this.insertItems([e]);if(1!==t.length)throw new Error("It was expected that 1 element is added but"+t.length+"were added");return t[0]}n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._planInteractionHandler.addPlanObjectFromItem(this._rapiItemToKernelItem(e),t,n,!1),a=this._planInteractionHandler.getPlan().extRef.jsObject;let i;return r.hasConfiguration()?(i=a.getConfigurablePlanObjectForId(r.getId()),i||console.warn("Could not find configuration")):(i=a.getStaticPlanObjectViewModelForId(r.getId()),i?await i.setRapiItem(e):console.warn("Could not find static item")),await i.isInitDone(),i.getId()}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}isConstructionPlanElement(e){return e instanceof this.kernelContainer.ConstructionObject}}e("P",Ns),pn([fn],Ns.prototype,"_kernelAccessCallback",void 0),pn([fn],Ns.prototype,"_roomlePlannerUiCallback",void 0);class Bs extends fi{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=Fa.createMeshPhysicalMaterial({color:"#ffffff",side:j})}generateGeometry(e=null,t,n,r,a,i=!1){let s;return s=i?this._generateGeometry(e,t,n,r,a).clone():this._generateGeometry(e,t,n,r,a),s}generateMesh(e=0,t=null,n,r,a,i,s,o,l=!1,h){let d;d=l?this._generateGeometry(t,r,a,i,s).clone():this._generateGeometry(t,r,a,i,s);const c=this._createMesh(e,t,d);return c.userData.materialId=n,c.layers.set(4),n&&this.setMaterial(c,n,o,h).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const r=o&&3===o.value,a=o&&1===o.value;c.castShadow=!r&&!a,c.userData.isFloor=r}),this._checkWallMaterial(c,o),c}async setMaterial(e,t,n,r){if(e.userData.materialId=ni(t,n),at(t))t?await this._assignMaterial(e,t,r):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId,r):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{Ja(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}e("ao",Bs);let zs={InchFeet:null,Feet:null,MM:null,CM:null,Inch:null},Hs={NoUnitString:null,LongUnitString:null,ShortUnitString:null};const js=["mm","cm","feet"],Vs=["inch","inchfeet"];class Gs{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;zs=e.Unit,Hs=e.UnitStringType,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:r}=this._initData;this._actualUnit===zs.InchFeet?this._precision=void 0!==r?parseInt(r,10):2:this._actualUnit===zs.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision,!0),this._formatter=t}_initMeasurementSystemType(){let{measurementSystem:e,unit:t}=this._initData;if(this._actualMeasurementString=e,e||!t){if("metric"===e){t||(t="cm");const e=js.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not a metric unit, using CM"),this._actualUnit=zs.CM,this._actualUnitString="cm")}if("imperial"===e){t||(t="inch");const e=Vs.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not an imperial unit, using Inches"),this._actualUnit=zs.Inch,this._actualUnitString="inch")}}else{this._actualUnitString=t;const e=js.find(e=>e===t);this._actualMeasurementString=e?"metric":"imperial"}}_initActualUnit(){const{unit:e}=this._initData;this._actualUnit=this._getKernelUnitEnum(e)}_getKernelUnitEnum(e){switch(e){case"cm":return zs.CM;case"mm":return zs.MM;case"inchfeet":return zs.InchFeet;case"feet":return zs.Feet;case"inch":return zs.Inch;default:return zs.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;e&&"short"!==e&&console.warn("Only short unit strings is supported at the moment"),this._actualUnitStringType=Hs.ShortUnitString}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),$i(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(Zi(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else Ji(e)?(e.uiType="Options",function(e){return!!Ji(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===zs.InchFeet}getActualUnitString(){return this._actualUnitString}getActualMeasurementString(){return this._actualMeasurementString}getUnitStringType(){return this._initData.unitStringType}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e,t=""){this._initData.unit=e,this._initData.measurementSystem=t,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType(),this._plannerKernelAccess.kernelInstance.setEnvironmentVariable("unit",this._actualUnitString)}}pn([fn],Gs.prototype,"_initData",void 0),pn([fn],Gs.prototype,"_plannerKernelAccess",void 0);class Ks{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}pn([fn],Ks.prototype,"_configuratorUiCallbacks",void 0),e("af",{ADDED:"added",CHANGED:"changed",REMOVED:"removed"});class Ws{constructor(e){this._kernelCallbacks={isReady:()=>{},throw:e=>console.error("Kernel exception",e),log:e=>{},error:(e,t,n,r)=>{},message:e=>{this._analyzeComponentCallback&&this._analyzeComponentCallback(e)}},this._creator_=e}async init(){if(this._toolsCoreInstance)return Promise.resolve();const e=this,t={locateFile:e=>"RoomleToolsCore.wasm"===e?n()+"static/RoomleToolsCore-9d852dba2ee4e323.wasm":e,wasmBinaryFile:n()+"static/RoomleToolsCore-9d852dba2ee4e323.wasm",preRun:[],postRun:[],setStatus:null,print(t){e._kernelIo.log(t)},printErr(t){e._kernelIo.error(t)},quit(t){0!==t&&e._kernelIo.throw(t&&t.toString?t.toString():"Unknown error while C/C++ main executes")}};await this._scriptLoader.fetch("static/RoomleToolsCore-68f11fca64f9af7b.js",{id:"core-tool"});const r=await window.RoomleToolsCore(t);r.setContext(this._kernelCallbacks),this._toolsCoreInstance=new r.ToolsCore}analyzeComponent(e,t){const n=[];return this._analyzeComponentCallback=e=>{n.push(e)},this._toolsCoreInstance.analyzeComponent(e,t),this._analyzeComponentCallback=null,Promise.resolve(n)}}pn([fn],Ws.prototype,"_scriptLoader",void 0),pn([fn],Ws.prototype,"_kernelIo",void 0);
1
+ System.register(["./main-thread-to-worker-88746ef2.legacy.js"],(function(e,t){var n,r,a,i,s,o,l,h,d,c,u,p,m,f,g,v,_,w,b,y,x,S,C,M,T,A,P,R,E,I,k,D,O,L,U,F,N,B,z,H,j,V,G,K,W,X,q,Q,Y,Z,J,$,ee,te,ne,re,ae,ie,se,oe,le,he,de,ce,ue,pe,me,fe,ge,ve,_e,we,be,ye,xe,Se,Ce,Me,Te,Ae,Pe,Re,Ee,Ie,ke,De,Oe,Le,Ue,Fe,Ne,Be,ze,He,je,Ve,Ge,Ke,We,Xe,qe,Qe,Ye,Ze,Je,$e,et,tt,nt,rt,at,it,st,ot,lt,ht,dt,ct,ut,pt,mt,ft,gt,vt,_t,wt,bt,yt,xt,St,Ct,Mt,Tt,At,Pt,Rt,Et,It,kt,Dt,Ot,Lt,Ut,Ft,Nt,Bt,zt,Ht,jt,Vt,Gt,Kt,Wt,Xt,qt,Qt,Yt,Zt,Jt,$t,en;return{setters:[function(e){n=e.g,r=e.A,a=e.D,i=e.V,s=e.a,o=e.R,l=e.S,h=e.C,d=e.M,c=e.B,u=e.b,p=e.T,m=e.c,f=e.d,g=e._,v=e.e,_=e.f,w=e.h,b=e.L,y=e.F,x=e.i,S=e.P,C=e.j,M=e.k,T=e.l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jt=e.bE,$t=e.bF,en=e.bG}],execute:function(){e({_:pn,i:fn,y:Es});class tn{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let r=t&&1===n.type?t:"global";if(r+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(r))return this._singletons.get(r);const a=new n.classDefinition(t);return this._singletons.set(r,a),a}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,r)=>{r.startsWith(e)&&t.push(r)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class nn{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}e("D",nn);const rn={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class an{_base64toBlob(e,t){t=t||"";const n=atob(e),r=n.length,a=Math.ceil(r/1024),i=new Array(a);for(let e=0;e<a;++e){let t=1024*e,a=Math.min(t+1024,r);const s=new Array(a-t);for(let e=t,r=0;e<a;++r,++e)s[r]=n[e].charCodeAt(0);i[e]=new Uint8Array(s)}return new Blob(i,{type:t})}_createFormData(e,t,n,r){const a=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const i=-1===Object.keys(rn).map(e=>rn[e]).indexOf(n)?"application":"image",s=this._base64toBlob(e,i+"/"+n.substr(1));return a.append(r,s,t+n),a}create(e,t,n,r){return this._createFormData(e,t,n,r)}}const sn=e("q",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class on{static createDynamicLightSettingSource(e,t){let r={};if(e)r.url=e;else if(t)switch(t){case sn.SHELF:r.url=n()+"static/shelf-2975dd3f2fa9c763.json";break;case sn.SHELF_FRONT:r.url=n()+"static/shelf_front-8c9566a4512f0de8.json";break;case sn.SOFA:r.url=n()+"static/sofa-997b116bc5f2e92e.json";break;case sn.BAKED:r.url=n()+"static/baked-6485a2b1daeb69e8.json";break;case sn.CAMERA:r.url=n()+"static/camera-05824b47cdb951e4.json";break;case sn.EQUAL:r.url=n()+"static/equal-319f6b83c827913f.json";break;default:r.url=n()+"static/camera-05824b47cdb951e4.json"}else r=null;return r}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new r;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let{intensity:t,castShadow:n,target:r,width:l,height:h}=e,d=null;if(n&&on.rectAreaLightReplacement){const n=new a;this._parseCommon(n,e),d=n,n.castShadow=!0,n.shadow.camera.near=.1,n.shadow.camera.far=100,n.shadow.mapSize=new i(1024,1024),n.shadow.bias=-5e-5,n.shadow.normalBias=.01,n.intensity=t?t/100:1,n.lookAt(r?new s(r.x,r.y,r.z):new s(0,0,0))}else{const n=new o;this._parseCommon(n,e),d=n,n.width=l||.8,n.height=h||.8,n.castShadow=!1,n.matrixAutoUpdate=!0,n.intensity=(t||240)/((l||.8)*(h||.8)),n.lookAt(r?new s(r.x,r.y,r.z):new s(0,0,0)),on.rectAreaLightLoadingListener&&on.rectAreaLightLoadingListener(n)}return d}_parseSpotLight(e){let t=new l;this._parseCommon(t,e);let{angle:n,penumbra:r,target:a,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=r||.5,t.lookAt(a?new s(a.x,a.y,a.z):new s(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new i(1024,1024),t.castShadow=o||!1,t}_parseDirectionalLight(e){let t=new a;this._parseCommon(t,e);let{target:n,castShadow:r}=e;return t.castShadow=r||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new i(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new s(n.x,n.y,n.z):new s(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:r,color:a,position:i,movesWithCamera:o}=t;e.name=n||"",e.intensity=r||1,e.color=new h(a||"#ffffff"),e.position.copy(i?new s(i.x,i.y,i.z):new s(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=o}}e("p",on),on.rectAreaLightReplacement=!0;const ln=["127.0.0.1","localhost","0.0.0.0"],hn=(e("J",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("H",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),dn=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,cn=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class un{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={},n={}){return this._pendingRequests+=1,new Promise((r,a)=>{self.fetch(e,t).then(async function(e){this._nextSlot();const t=!n.checkResponse||!1!==await n.checkResponse(e);if(cn(e.ok,e.status)&&t)r(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";a(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),a(e)})})}fetch(e,t={},n={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t,n)}}function pn(e,t,n,r){var a,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var o=e.length-1;o>=0;o--)(a=e[o])&&(s=(i<3?a(s):i>3?a(t,n,s):a(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s}"function"==typeof SuppressedError&&SuppressedError;const mn=function(e){return e.startsWith("_")&&(e=e.substr(1)),e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(function(e,t){return(t>0?"-":"")+e.toLowerCase()}))};function fn(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(mn(t),this._creator_);e?this[n]=e:console.error("Dependency "+mn(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}class gn{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",gn);class vn extends gn{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}pn([fn],vn.prototype,"_globalCallback",void 0);const _n=new Map,wn=new Map,bn=new Map,yn=new Map;class xn{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{yn.set(e,!0),this._configuratorUiCallbacks.onSyncDone()})})}syncCatalog(e){return this._startWorker().then(()=>this._handleCatalog(e))}syncFloorTag(e){return this._startWorker().then(()=>this._syncFloorTag(e))}syncTypeChangeTag(e){return this._startWorker().then(()=>this._syncTypeChangeTag(e))}_syncFloorTag(e){const t=[];return e&&!bn.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{t.push(this._handleMaterialsAndTextures(e))}),this._singlePromiseFactory.create(1,e,n=>{Promise.all(t).then(()=>{bn.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!yn.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{this._rapiAccess.getItems(e.items).then(e=>{e.forEach(e=>{this.getIsCatalogSynced(e.catalog)&&t.push(this._handleCatalog(e.catalog))})})}),this._singlePromiseFactory.create(2,e,n=>{Promise.all(t).then(()=>{bn.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!wn.get(e)}_startWorker(){return new Promise((e,t)=>{if(this._isStarted)return e();this._bootCallbacks.push({resolve:e,reject:t}),this._isStarting||(this._worker=new Worker(n()+"static/asset-loader.worker-1735a5fb1e401244.js"),this._mainThreadToWorker=new d(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{wn.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let r=0,a=e.length;r<a;r++){const a=e[r];t.forEach(e=>{const t=a[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(_n.get(e))return t();this._assetUrlToBase64(e).then(n=>{_n.set(e,n),t()},e=>this._softReject(t,'_preCacheAsset error: "'+e+'"'))})}_assetUrlToBase64(e){return new Promise(t=>{this._mainThreadToWorker.sendToWorker(5,e,t,e=>this._softReject(t,'_assetUrlToBase64 error: "'+e+'"'))})}_softReject(e,t){this._errorHandler.softReject(e,t,2)}requestAsset(e,t=!1){return navigator.onLine&&!this._alwaysUseCache?e:_n.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){_n.set(e,t)}}e("a",xn),pn([fn],xn.prototype,"_rapiAccess",void 0),pn([fn],xn.prototype,"_singlePromiseFactory",void 0),pn([fn],xn.prototype,"_errorHandler",void 0),pn([fn],xn.prototype,"_configuratorUiCallbacks",void 0),pn([fn],xn.prototype,"_initData",void 0);class Sn{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}function Cn(e){for(var t,n,r,a=-1,i=0,s=0;s<e.length;++s){var o=e[s];if(o.isInterleavedBufferAttribute)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. InterleavedBufferAttributes are not supported."),null;if(void 0===t&&(t=o.array.constructor),t!==o.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(void 0===n&&(n=o.itemSize),n!==o.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(void 0===r&&(r=o.normalized),r!==o.normalized)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;if(-1===a&&(a=o.gpuType),a!==o.gpuType)return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."),null;i+=o.array.length}for(var l=new t(i),h=0,d=0;d<e.length;++d)l.set(e[d].array,h),h+=e[d].array.length;var c=new u(l,n,r);return void 0!==a&&(c.gpuType=a),c}function Mn(e,t){if(t===p)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t===m||t===f){var n=e.getIndex();if(null===n){var r=[],a=e.getAttribute("position");if(void 0===a)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(var i=0;i<a.count;i++)r.push(i);e.setIndex(r),n=e.getIndex()}var s=n.count-2,o=[];if(t===m)for(var l=1;l<=s;l++)o.push(n.getX(0)),o.push(n.getX(l)),o.push(n.getX(l+1));else for(var h=0;h<s;h++)h%2==0?(o.push(n.getX(h)),o.push(n.getX(h+1)),o.push(n.getX(h+2))):(o.push(n.getX(h+2)),o.push(n.getX(h+1)),o.push(n.getX(h)));o.length/3!==s&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");var d=e.clone();return d.setIndex(o),d.clearGroups(),d}return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e}e("ae",Sn);var Tn=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).dracoLoader=null,r.ktx2Loader=null,r.meshoptDecoder=null,r.pluginCallbacks=[],r.register((function(e){return new kn(e)})),r.register((function(e){return new zn(e)})),r.register((function(e){return new Hn(e)})),r.register((function(e){return new jn(e)})),r.register((function(e){return new On(e)})),r.register((function(e){return new Ln(e)})),r.register((function(e){return new Un(e)})),r.register((function(e){return new Fn(e)})),r.register((function(e){return new In(e)})),r.register((function(e){return new Nn(e)})),r.register((function(e){return new Dn(e)})),r.register((function(e){return new Bn(e)})),r.register((function(e){return new Rn(e)})),r.register((function(e){return new Vn(e)})),r.register((function(e){return new Gn(e)})),r}return w(n,[{key:"load",value:function(e,t,n,r){var a,i=this;a=""!==this.resourcePath?this.resourcePath:""!==this.path?this.path:b.extractUrlBase(e),this.manager.itemStart(e);var s=function(t){r?r(t):console.error(t),i.manager.itemError(e),i.manager.itemEnd(e)},o=new y(this.manager);o.setPath(this.path),o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,(function(n){try{i.parse(n,a,(function(n){t(n),i.manager.itemEnd(e)}),s)}catch(e){s(e)}}),n,s)}},{key:"setDRACOLoader",value:function(e){return this.dracoLoader=e,this}},{key:"setDDSLoader",value:function(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}},{key:"setKTX2Loader",value:function(e){return this.ktx2Loader=e,this}},{key:"setMeshoptDecoder",value:function(e){return this.meshoptDecoder=e,this}},{key:"register",value:function(e){return-1===this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.push(e),this}},{key:"unregister",value:function(e){return-1!==this.pluginCallbacks.indexOf(e)&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}},{key:"parse",value:function(e,t,n,r){var a,i={},s={},o=new TextDecoder;if("string"==typeof e)a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(o.decode(new Uint8Array(e,0,4))===Kn){try{i[Pn.KHR_BINARY_GLTF]=new Wn(e)}catch(e){return void(r&&r(e))}a=JSON.parse(i[Pn.KHR_BINARY_GLTF].content)}else a=JSON.parse(o.decode(e));else a=e;if(void 0===a.asset||a.asset.version[0]<2)r&&r(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));else{var l=new mr(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});l.fileLoader.setRequestHeader(this.requestHeader);for(var h=0;h<this.pluginCallbacks.length;h++){var d=this.pluginCallbacks[h](l);s[d.name]=d,i[d.name]=!0}if(a.extensionsUsed)for(var c=0;c<a.extensionsUsed.length;++c){var u=a.extensionsUsed[c],p=a.extensionsRequired||[];switch(u){case Pn.KHR_MATERIALS_UNLIT:i[u]=new En;break;case Pn.KHR_DRACO_MESH_COMPRESSION:i[u]=new Xn(a,this.dracoLoader);break;case Pn.KHR_TEXTURE_TRANSFORM:i[u]=new qn;break;case Pn.KHR_MESH_QUANTIZATION:i[u]=new Qn;break;default:p.indexOf(u)>=0&&void 0===s[u]&&console.warn('THREE.GLTFLoader: Unknown extension "'+u+'".')}}l.setExtensions(i),l.setPlugins(s),l.parse(n,r)}}},{key:"parseAsync",value:function(e,t){var n=this;return new Promise((function(r,a){n.parse(e,t,r,a)}))}}]),n}(x);function An(){var e={};return{get:function(t){return e[t]},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},removeAll:function(){e={}}}}var Pn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"},Rn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}return w(e,[{key:"_markDefs",value:function(){for(var e=this.parser,t=this.parser.json.nodes||[],n=0,r=t.length;n<r;n++){var a=t[n];a.extensions&&a.extensions[this.name]&&void 0!==a.extensions[this.name].light&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}},{key:"_loadLight",value:function(e){var t=this.parser,n="light:"+e,r=t.cache.get(n);if(r)return r;var i,s=t.json,o=((s.extensions&&s.extensions[this.name]||{}).lights||[])[e],d=new h(16777215);void 0!==o.color&&d.fromArray(o.color);var c=void 0!==o.range?o.range:0;switch(o.type){case"directional":(i=new a(d)).target.position.set(0,0,-1),i.add(i.target);break;case"point":(i=new S(d)).distance=c;break;case"spot":(i=new l(d)).distance=c,o.spot=o.spot||{},o.spot.innerConeAngle=void 0!==o.spot.innerConeAngle?o.spot.innerConeAngle:0,o.spot.outerConeAngle=void 0!==o.spot.outerConeAngle?o.spot.outerConeAngle:Math.PI/4,i.angle=o.spot.outerConeAngle,i.penumbra=1-o.spot.innerConeAngle/o.spot.outerConeAngle,i.target.position.set(0,0,-1),i.add(i.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+o.type)}return i.position.set(0,0,0),i.decay=2,lr(i,o),void 0!==o.intensity&&(i.intensity=o.intensity),i.name=t.createUniqueName(o.name||"light_"+e),r=Promise.resolve(i),t.cache.add(n,r),r}},{key:"getDependency",value:function(e,t){if("light"===e)return this._loadLight(t)}},{key:"createNodeAttachment",value:function(e){var t=this,n=this.parser,r=n.json.nodes[e],a=(r.extensions&&r.extensions[this.name]||{}).light;return void 0===a?null:this._loadLight(a).then((function(e){return n._getNodeRef(t.cache,a,e)}))}}]),e}(),En=function(){function e(){_(this,e),this.name=Pn.KHR_MATERIALS_UNLIT}return w(e,[{key:"getMaterialType",value:function(){return C}},{key:"extendParams",value:function(e,t,n){var r=[];e.color=new h(1,1,1),e.opacity=1;var a=t.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){var i=a.baseColorFactor;e.color.fromArray(i),e.opacity=i[3]}void 0!==a.baseColorTexture&&r.push(n.assignTexture(e,"map",a.baseColorTexture,M))}return Promise.all(r)}}]),e}(),In=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_EMISSIVE_STRENGTH}return w(e,[{key:"extendMaterialParams",value:function(e,t){var n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();var r=n.extensions[this.name].emissiveStrength;return void 0!==r&&(t.emissiveIntensity=r),Promise.resolve()}}]),e}(),kn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_CLEARCOAT}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],s=r.extensions[this.name];if(void 0!==s.clearcoatFactor&&(t.clearcoat=s.clearcoatFactor),void 0!==s.clearcoatTexture&&a.push(n.assignTexture(t,"clearcoatMap",s.clearcoatTexture)),void 0!==s.clearcoatRoughnessFactor&&(t.clearcoatRoughness=s.clearcoatRoughnessFactor),void 0!==s.clearcoatRoughnessTexture&&a.push(n.assignTexture(t,"clearcoatRoughnessMap",s.clearcoatRoughnessTexture)),void 0!==s.clearcoatNormalTexture&&(a.push(n.assignTexture(t,"clearcoatNormalMap",s.clearcoatNormalTexture)),void 0!==s.clearcoatNormalTexture.scale)){var o=s.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new i(o,o)}return Promise.all(a)}}]),e}(),Dn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_IRIDESCENCE}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];return void 0!==i.iridescenceFactor&&(t.iridescence=i.iridescenceFactor),void 0!==i.iridescenceTexture&&a.push(n.assignTexture(t,"iridescenceMap",i.iridescenceTexture)),void 0!==i.iridescenceIor&&(t.iridescenceIOR=i.iridescenceIor),void 0===t.iridescenceThicknessRange&&(t.iridescenceThicknessRange=[100,400]),void 0!==i.iridescenceThicknessMinimum&&(t.iridescenceThicknessRange[0]=i.iridescenceThicknessMinimum),void 0!==i.iridescenceThicknessMaximum&&(t.iridescenceThicknessRange[1]=i.iridescenceThicknessMaximum),void 0!==i.iridescenceThicknessTexture&&a.push(n.assignTexture(t,"iridescenceThicknessMap",i.iridescenceThicknessTexture)),Promise.all(a)}}]),e}(),On=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_SHEEN}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[];t.sheenColor=new h(0,0,0),t.sheenRoughness=0,t.sheen=1;var i=r.extensions[this.name];return void 0!==i.sheenColorFactor&&t.sheenColor.fromArray(i.sheenColorFactor),void 0!==i.sheenRoughnessFactor&&(t.sheenRoughness=i.sheenRoughnessFactor),void 0!==i.sheenColorTexture&&a.push(n.assignTexture(t,"sheenColorMap",i.sheenColorTexture,M)),void 0!==i.sheenRoughnessTexture&&a.push(n.assignTexture(t,"sheenRoughnessMap",i.sheenRoughnessTexture)),Promise.all(a)}}]),e}(),Ln=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_TRANSMISSION}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];return void 0!==i.transmissionFactor&&(t.transmission=i.transmissionFactor),void 0!==i.transmissionTexture&&a.push(n.assignTexture(t,"transmissionMap",i.transmissionTexture)),Promise.all(a)}}]),e}(),Un=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_VOLUME}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];t.thickness=void 0!==i.thicknessFactor?i.thicknessFactor:0,void 0!==i.thicknessTexture&&a.push(n.assignTexture(t,"thicknessMap",i.thicknessTexture)),t.attenuationDistance=i.attenuationDistance||1/0;var s=i.attenuationColor||[1,1,1];return t.attenuationColor=new h(s[0],s[1],s[2]),Promise.all(a)}}]),e}(),Fn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_IOR}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser.json.materials[e];if(!n.extensions||!n.extensions[this.name])return Promise.resolve();var r=n.extensions[this.name];return t.ior=void 0!==r.ior?r.ior:1.5,Promise.resolve()}}]),e}(),Nn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_SPECULAR}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];t.specularIntensity=void 0!==i.specularFactor?i.specularFactor:1,void 0!==i.specularTexture&&a.push(n.assignTexture(t,"specularIntensityMap",i.specularTexture));var s=i.specularColorFactor||[1,1,1];return t.specularColor=new h(s[0],s[1],s[2]),void 0!==i.specularColorTexture&&a.push(n.assignTexture(t,"specularColorMap",i.specularColorTexture,M)),Promise.all(a)}}]),e}(),Bn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_MATERIALS_ANISOTROPY}return w(e,[{key:"getMaterialType",value:function(e){var t=this.parser.json.materials[e];return t.extensions&&t.extensions[this.name]?T:null}},{key:"extendMaterialParams",value:function(e,t){var n=this.parser,r=n.json.materials[e];if(!r.extensions||!r.extensions[this.name])return Promise.resolve();var a=[],i=r.extensions[this.name];return void 0!==i.anisotropyStrength&&(t.anisotropy=i.anisotropyStrength),void 0!==i.anisotropyRotation&&(t.anisotropyRotation=i.anisotropyRotation),void 0!==i.anisotropyTexture&&a.push(n.assignTexture(t,"anisotropyMap",i.anisotropyTexture)),Promise.all(a)}}]),e}(),zn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.KHR_TEXTURE_BASISU}return w(e,[{key:"loadTexture",value:function(e){var t=this.parser,n=t.json,r=n.textures[e];if(!r.extensions||!r.extensions[this.name])return null;var a=r.extensions[this.name],i=t.options.ktx2Loader;if(!i){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,i)}}]),e}(),Hn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.EXT_TEXTURE_WEBP,this.isSupported=null}return w(e,[{key:"loadTexture",value:function(e){var t=this.name,n=this.parser,r=n.json,a=r.textures[e];if(!a.extensions||!a.extensions[t])return null;var i=a.extensions[t],s=r.images[i.source],o=n.textureLoader;if(s.uri){var l=n.options.manager.getHandler(s.uri);null!==l&&(o=l)}return this.detectSupport().then((function(a){if(a)return n.loadTextureImage(e,i.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)}))}},{key:"detectSupport",value:function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}]),e}(),jn=function(){function e(t){_(this,e),this.parser=t,this.name=Pn.EXT_TEXTURE_AVIF,this.isSupported=null}return w(e,[{key:"loadTexture",value:function(e){var t=this.name,n=this.parser,r=n.json,a=r.textures[e];if(!a.extensions||!a.extensions[t])return null;var i=a.extensions[t],s=r.images[i.source],o=n.textureLoader;if(s.uri){var l=n.options.manager.getHandler(s.uri);null!==l&&(o=l)}return this.detectSupport().then((function(a){if(a)return n.loadTextureImage(e,i.source,o);if(r.extensionsRequired&&r.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)}))}},{key:"detectSupport",value:function(){return this.isSupported||(this.isSupported=new Promise((function(e){var t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}}))),this.isSupported}}]),e}(),Vn=function(){function e(t){_(this,e),this.name=Pn.EXT_MESHOPT_COMPRESSION,this.parser=t}return w(e,[{key:"loadBufferView",value:function(e){var t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){var r=n.extensions[this.name],a=this.parser.getDependency("buffer",r.buffer),i=this.parser.options.meshoptDecoder;if(!i||!i.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then((function(e){var t=r.byteOffset||0,n=r.byteLength||0,a=r.count,s=r.byteStride,o=new Uint8Array(e,t,n);return i.decodeGltfBufferAsync?i.decodeGltfBufferAsync(a,s,o,r.mode,r.filter).then((function(e){return e.buffer})):i.ready.then((function(){var e=new ArrayBuffer(a*s);return i.decodeGltfBuffer(new Uint8Array(e),a,s,o,r.mode,r.filter),e}))}))}return null}}]),e}(),Gn=function(){function e(t){_(this,e),this.name=Pn.EXT_MESH_GPU_INSTANCING,this.parser=t}return w(e,[{key:"createNodeMesh",value:function(e){var t=this,n=this.parser.json,r=n.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;var a,i=n.meshes[r.mesh],o=A(i.primitives);try{for(o.s();!(a=o.n()).done;){var l=a.value;if(l.mode!==$n.TRIANGLES&&l.mode!==$n.TRIANGLE_STRIP&&l.mode!==$n.TRIANGLE_FAN&&void 0!==l.mode)return null}}catch(e){o.e(e)}finally{o.f()}var h=r.extensions[this.name].attributes,d=[],c={},u=function(e){d.push(t.parser.getDependency("accessor",h[e]).then((function(t){return c[e]=t,c[e]})))};for(var p in h)u(p);return d.length<1?null:(d.push(this.parser.createNodeMesh(e)),Promise.all(d).then((function(e){var n,r=e.pop(),a=r.isGroup?r.children:[r],i=e[0].count,o=[],l=A(a);try{for(l.s();!(n=l.n()).done;){for(var h=n.value,d=new P,u=new s,p=new R,m=new s(1,1,1),f=new E(h.geometry,h.material,i),g=0;g<i;g++)c.TRANSLATION&&u.fromBufferAttribute(c.TRANSLATION,g),c.ROTATION&&p.fromBufferAttribute(c.ROTATION,g),c.SCALE&&m.fromBufferAttribute(c.SCALE,g),f.setMatrixAt(g,d.compose(u,p,m));for(var v in c)"TRANSLATION"!==v&&"ROTATION"!==v&&"SCALE"!==v&&h.geometry.setAttribute(v,c[v]);I.prototype.copy.call(f,h),t.parser.assignFinalMaterial(f),o.push(f)}}catch(e){l.e(e)}finally{l.f()}return r.isGroup?(r.clear(),r.add.apply(r,o),r):o[0]})))}}]),e}(),Kn="glTF",Wn=w((function e(t){_(this,e),this.name=Pn.KHR_BINARY_GLTF,this.content=null,this.body=null;var n=new DataView(t,0,12),r=new TextDecoder;if(this.header={magic:r.decode(new Uint8Array(t.slice(0,4))),version:n.getUint32(4,!0),length:n.getUint32(8,!0)},this.header.magic!==Kn)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");for(var a=this.header.length-12,i=new DataView(t,12),s=0;s<a;){var o=i.getUint32(s,!0);s+=4;var l=i.getUint32(s,!0);if(s+=4,1313821514===l){var h=new Uint8Array(t,12+s,o);this.content=r.decode(h)}else if(5130562===l){var d=12+s;this.body=t.slice(d,d+o)}s+=o}if(null===this.content)throw new Error("THREE.GLTFLoader: JSON content not found.")})),Xn=function(){function e(t,n){if(_(this,e),!n)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Pn.KHR_DRACO_MESH_COMPRESSION,this.json=t,this.dracoLoader=n,this.dracoLoader.preload()}return w(e,[{key:"decodePrimitive",value:function(e,t){var n=this.json,r=this.dracoLoader,a=e.extensions[this.name].bufferView,i=e.extensions[this.name].attributes,s={},o={},l={};for(var h in i){var d=ar[h]||h.toLowerCase();s[d]=i[h]}for(var c in e.attributes){var u=ar[c]||c.toLowerCase();if(void 0!==i[c]){var p=n.accessors[e.attributes[c]],m=er[p.componentType];l[u]=m.name,o[u]=!0===p.normalized}}return t.getDependency("bufferView",a).then((function(e){return new Promise((function(t){r.decodeDracoFile(e,(function(e){for(var n in e.attributes){var r=e.attributes[n],a=o[n];void 0!==a&&(r.normalized=a)}t(e)}),s,l)}))}))}}]),e}(),qn=function(){function e(){_(this,e),this.name=Pn.KHR_TEXTURE_TRANSFORM}return w(e,[{key:"extendTexture",value:function(e,t){return void 0!==t.texCoord&&t.texCoord!==e.channel||void 0!==t.offset||void 0!==t.rotation||void 0!==t.scale?(e=e.clone(),void 0!==t.texCoord&&(e.channel=t.texCoord),void 0!==t.offset&&e.offset.fromArray(t.offset),void 0!==t.rotation&&(e.rotation=t.rotation),void 0!==t.scale&&e.repeat.fromArray(t.scale),e.needsUpdate=!0,e):e}}]),e}(),Qn=w((function e(){_(this,e),this.name=Pn.KHR_MESH_QUANTIZATION})),Yn=function(e){g(n,e);var t=v(n);function n(e,r,a,i){return _(this,n),t.call(this,e,r,a,i)}return w(n,[{key:"copySampleValue_",value:function(e){for(var t=this.resultBuffer,n=this.sampleValues,r=this.valueSize,a=e*r*3+r,i=0;i!==r;i++)t[i]=n[a+i];return t}},{key:"interpolate_",value:function(e,t,n,r){for(var a=this.resultBuffer,i=this.sampleValues,s=this.valueSize,o=2*s,l=3*s,h=r-t,d=(n-t)/h,c=d*d,u=c*d,p=e*l,m=p-l,f=-2*u+3*c,g=u-c,v=1-f,_=g-c+d,w=0;w!==s;w++){var b=i[m+w+s],y=i[m+w+o]*h,x=i[p+w+s],S=i[p+w]*h;a[w]=v*b+_*y+f*x+g*S}return a}}]),n}(ye),Zn=new R,Jn=function(e){g(n,e);var t=v(n);function n(){return _(this,n),t.apply(this,arguments)}return w(n,[{key:"interpolate_",value:function(e,t,r,a){var i=xe(Se(n.prototype),"interpolate_",this).call(this,e,t,r,a);return Zn.fromArray(i).normalize().toArray(i),i}}]),n}(Yn),$n={FLOAT:5126,FLOAT_MAT3:35675,FLOAT_MAT4:35676,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,LINEAR:9729,REPEAT:10497,SAMPLER_2D:35678,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123},er={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},tr={9728:ae,9729:L,9984:ie,9985:se,9986:oe,9987:U},nr={33071:le,33648:he,10497:F},rr={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ar={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3",COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ir={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},sr={CUBICSPLINE:void 0,LINEAR:re,STEP:de};function or(e,t,n){for(var r in n.extensions)void 0===e[r]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[r]=n.extensions[r])}function lr(e,t){void 0!==t.extras&&("object"===k(t.extras)?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function hr(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(var n=0,r=t.weights.length;n<r;n++)e.morphTargetInfluences[n]=t.weights[n];if(t.extras&&Array.isArray(t.extras.targetNames)){var a=t.extras.targetNames;if(e.morphTargetInfluences.length===a.length){e.morphTargetDictionary={};for(var i=0,s=a.length;i<s;i++)e.morphTargetDictionary[a[i]]=i}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function dr(e){var t,n=e.extensions&&e.extensions[Pn.KHR_DRACO_MESH_COMPRESSION];if(t=n?"draco:"+n.bufferView+":"+n.indices+":"+cr(n.attributes):e.indices+":"+cr(e.attributes)+":"+e.mode,void 0!==e.targets)for(var r=0,a=e.targets.length;r<a;r++)t+=":"+cr(e.targets[r]);return t}function cr(e){for(var t="",n=Object.keys(e).sort(),r=0,a=n.length;r<a;r++)t+=n[r]+":"+e[n[r]]+";";return t}function ur(e){switch(e){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}var pr=new P,mr=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_(this,e),this.json=t,this.extensions={},this.plugins={},this.options=n,this.cache=new An,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};var r=!1,a=!1,i=-1;"undefined"!=typeof navigator&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),i=(a=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"undefined"==typeof createImageBitmap||r||a&&i<98?this.textureLoader=new ue(this.options.manager):this.textureLoader=new pe(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new y(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),"use-credentials"===this.options.crossOrigin&&this.fileLoader.setWithCredentials(!0)}return w(e,[{key:"setExtensions",value:function(e){this.extensions=e}},{key:"setPlugins",value:function(e){this.plugins=e}},{key:"parse",value:function(e,t){var n=this,r=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll((function(e){return e._markDefs&&e._markDefs()})),Promise.all(this._invokeAll((function(e){return e.beforeRoot&&e.beforeRoot()}))).then((function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])})).then((function(t){var i={scene:t[0][r.scene||0],scenes:t[0],animations:t[1],cameras:t[2],asset:r.asset,parser:n,userData:{}};or(a,i,r),lr(i,r),Promise.all(n._invokeAll((function(e){return e.afterRoot&&e.afterRoot(i)}))).then((function(){e(i)}))})).catch(t)}},{key:"_markDefs",value:function(){for(var e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[],r=0,a=t.length;r<a;r++)for(var i=t[r].joints,s=0,o=i.length;s<o;s++)e[i[s]].isBone=!0;for(var l=0,h=e.length;l<h;l++){var d=e[l];void 0!==d.mesh&&(this._addNodeRef(this.meshCache,d.mesh),void 0!==d.skin&&(n[d.mesh].isSkinnedMesh=!0)),void 0!==d.camera&&this._addNodeRef(this.cameraCache,d.camera)}}},{key:"_addNodeRef",value:function(e,t){void 0!==t&&(void 0===e.refs[t]&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}},{key:"_getNodeRef",value:function(e,t,n){var r=this;if(e.refs[t]<=1)return n;var a=n.clone();return function e(t,n){var a=r.associations.get(t);null!=a&&r.associations.set(n,a);var i,s=A(t.children.entries());try{for(s.s();!(i=s.n()).done;){var o=me(i.value,2),l=o[0];e(o[1],n.children[l])}}catch(e){s.e(e)}finally{s.f()}}(n,a),a.name+="_instance_"+e.uses[t]++,a}},{key:"_invokeOne",value:function(e){var t=Object.values(this.plugins);t.push(this);for(var n=0;n<t.length;n++){var r=e(t[n]);if(r)return r}return null}},{key:"_invokeAll",value:function(e){var t=Object.values(this.plugins);t.unshift(this);for(var n=[],r=0;r<t.length;r++){var a=e(t[r]);a&&n.push(a)}return n}},{key:"getDependency",value:function(e,t){var n=e+":"+t,r=this.cache.get(n);if(!r){switch(e){case"scene":r=this.loadScene(t);break;case"node":r=this._invokeOne((function(e){return e.loadNode&&e.loadNode(t)}));break;case"mesh":r=this._invokeOne((function(e){return e.loadMesh&&e.loadMesh(t)}));break;case"accessor":r=this.loadAccessor(t);break;case"bufferView":r=this._invokeOne((function(e){return e.loadBufferView&&e.loadBufferView(t)}));break;case"buffer":r=this.loadBuffer(t);break;case"material":r=this._invokeOne((function(e){return e.loadMaterial&&e.loadMaterial(t)}));break;case"texture":r=this._invokeOne((function(e){return e.loadTexture&&e.loadTexture(t)}));break;case"skin":r=this.loadSkin(t);break;case"animation":r=this._invokeOne((function(e){return e.loadAnimation&&e.loadAnimation(t)}));break;case"camera":r=this.loadCamera(t);break;default:if(!(r=this._invokeOne((function(n){return n!=this&&n.getDependency&&n.getDependency(e,t)}))))throw new Error("Unknown type: "+e)}this.cache.add(n,r)}return r}},{key:"getDependencies",value:function(e){var t=this.cache.get(e);if(!t){var n=this,r=this.json[e+("mesh"===e?"es":"s")]||[];t=Promise.all(r.map((function(t,r){return n.getDependency(e,r)}))),this.cache.add(e,t)}return t}},{key:"loadBuffer",value:function(e){var t=this.json.buffers[e],n=this.fileLoader;if(t.type&&"arraybuffer"!==t.type)throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(void 0===t.uri&&0===e)return Promise.resolve(this.extensions[Pn.KHR_BINARY_GLTF].body);var r=this.options;return new Promise((function(e,a){n.load(b.resolveURL(t.uri,r.path),e,void 0,(function(){a(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))}))}))}},{key:"loadBufferView",value:function(e){var t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then((function(e){var n=t.byteLength||0,r=t.byteOffset||0;return e.slice(r,r+n)}))}},{key:"loadAccessor",value:function(e){var t=this,n=this.json,r=this.json.accessors[e];if(void 0===r.bufferView&&void 0===r.sparse){var a=rr[r.type],i=er[r.componentType],s=!0===r.normalized,o=new i(r.count*a);return Promise.resolve(new u(o,a,s))}var l=[];return void 0!==r.bufferView?l.push(this.getDependency("bufferView",r.bufferView)):l.push(null),void 0!==r.sparse&&(l.push(this.getDependency("bufferView",r.sparse.indices.bufferView)),l.push(this.getDependency("bufferView",r.sparse.values.bufferView))),Promise.all(l).then((function(e){var a,i,s=e[0],o=rr[r.type],l=er[r.componentType],h=l.BYTES_PER_ELEMENT,d=h*o,c=r.byteOffset||0,p=void 0!==r.bufferView?n.bufferViews[r.bufferView].byteStride:void 0,m=!0===r.normalized;if(p&&p!==d){var f=Math.floor(c/p),g="InterleavedBuffer:"+r.bufferView+":"+r.componentType+":"+f+":"+r.count,v=t.cache.get(g);v||(a=new l(s,f*p,r.count*p/h),v=new D(a,p/h),t.cache.add(g,v)),i=new O(v,o,c%p/h,m)}else a=null===s?new l(r.count*o):new l(s,c,r.count*o),i=new u(a,o,m);if(void 0!==r.sparse){var _=rr.SCALAR,w=er[r.sparse.indices.componentType],b=r.sparse.indices.byteOffset||0,y=r.sparse.values.byteOffset||0,x=new w(e[1],b,r.sparse.count*_),S=new l(e[2],y,r.sparse.count*o);null!==s&&(i=new u(i.array.slice(),i.itemSize,i.normalized));for(var C=0,M=x.length;C<M;C++){var T=x[C];if(i.setX(T,S[C*o]),o>=2&&i.setY(T,S[C*o+1]),o>=3&&i.setZ(T,S[C*o+2]),o>=4&&i.setW(T,S[C*o+3]),o>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i}))}},{key:"loadTexture",value:function(e){var t=this.json,n=this.options,r=t.textures[e].source,a=t.images[r],i=this.textureLoader;if(a.uri){var s=n.manager.getHandler(a.uri);null!==s&&(i=s)}return this.loadTextureImage(e,r,i)}},{key:"loadTextureImage",value:function(e,t,n){var r=this,a=this.json,i=a.textures[e],s=a.images[t],o=(s.uri||s.bufferView)+":"+i.sampler;if(this.textureCache[o])return this.textureCache[o];var l=this.loadImageSource(t,n).then((function(t){t.flipY=!1,t.name=i.name||s.name||"",""===t.name&&"string"==typeof s.uri&&!1===s.uri.startsWith("data:image/")&&(t.name=s.uri);var n=(a.samplers||{})[i.sampler]||{};return t.magFilter=tr[n.magFilter]||L,t.minFilter=tr[n.minFilter]||U,t.wrapS=nr[n.wrapS]||F,t.wrapT=nr[n.wrapT]||F,r.associations.set(t,{textures:e}),t})).catch((function(){return null}));return this.textureCache[o]=l,l}},{key:"loadImageSource",value:function(e,t){var n=this.json,r=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then((function(e){return e.clone()}));var a=n.images[e],i=self.URL||self.webkitURL,s=a.uri||"",o=!1;if(void 0!==a.bufferView)s=this.getDependency("bufferView",a.bufferView).then((function(e){o=!0;var t=new Blob([e],{type:a.mimeType});return s=i.createObjectURL(t)}));else if(void 0===a.uri)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");var l=Promise.resolve(s).then((function(e){return new Promise((function(n,a){var i=n;!0===t.isImageBitmapLoader&&(i=function(e){var t=new fe(e);t.needsUpdate=!0,n(t)}),t.load(b.resolveURL(e,r.path),i,void 0,a)}))})).then((function(e){var t;return!0===o&&i.revokeObjectURL(s),e.userData.mimeType=a.mimeType||((t=a.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e})).catch((function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",s),e}));return this.sourceCache[e]=l,l}},{key:"assignTexture",value:function(e,t,n,r){var a=this;return this.getDependency("texture",n.index).then((function(i){if(!i)return null;if(void 0!==n.texCoord&&n.texCoord>0&&((i=i.clone()).channel=n.texCoord),a.extensions[Pn.KHR_TEXTURE_TRANSFORM]){var s=void 0!==n.extensions?n.extensions[Pn.KHR_TEXTURE_TRANSFORM]:void 0;if(s){var o=a.associations.get(i);i=a.extensions[Pn.KHR_TEXTURE_TRANSFORM].extendTexture(i,s),a.associations.set(i,o)}}return void 0!==r&&(i.colorSpace=r),e[t]=i,i}))}},{key:"assignFinalMaterial",value:function(e){var t=e.geometry,n=e.material,r=void 0===t.attributes.tangent,a=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){var s="PointsMaterial:"+n.uuid,o=this.cache.get(s);o||(o=new N,B.prototype.copy.call(o,n),o.color.copy(n.color),o.map=n.map,o.sizeAttenuation=!1,this.cache.add(s,o)),n=o}else if(e.isLine){var l="LineBasicMaterial:"+n.uuid,h=this.cache.get(l);h||(h=new z,B.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(l,h)),n=h}if(r||a||i){var d="ClonedMaterial:"+n.uuid+":";r&&(d+="derivative-tangents:"),a&&(d+="vertex-colors:"),i&&(d+="flat-shading:");var c=this.cache.get(d);c||(c=n.clone(),a&&(c.vertexColors=!0),i&&(c.flatShading=!0),r&&(c.normalScale&&(c.normalScale.y*=-1),c.clearcoatNormalScale&&(c.clearcoatNormalScale.y*=-1)),this.cache.add(d,c),this.associations.set(c,this.associations.get(n))),n=c}e.material=n}},{key:"getMaterialType",value:function(){return H}},{key:"loadMaterial",value:function(e){var t,n=this,r=this.json,a=this.extensions,s=r.materials[e],o={},l=[];if((s.extensions||{})[Pn.KHR_MATERIALS_UNLIT]){var d=a[Pn.KHR_MATERIALS_UNLIT];t=d.getMaterialType(),l.push(d.extendParams(o,s,n))}else{var c=s.pbrMetallicRoughness||{};if(o.color=new h(1,1,1),o.opacity=1,Array.isArray(c.baseColorFactor)){var u=c.baseColorFactor;o.color.fromArray(u),o.opacity=u[3]}void 0!==c.baseColorTexture&&l.push(n.assignTexture(o,"map",c.baseColorTexture,M)),o.metalness=void 0!==c.metallicFactor?c.metallicFactor:1,o.roughness=void 0!==c.roughnessFactor?c.roughnessFactor:1,void 0!==c.metallicRoughnessTexture&&(l.push(n.assignTexture(o,"metalnessMap",c.metallicRoughnessTexture)),l.push(n.assignTexture(o,"roughnessMap",c.metallicRoughnessTexture))),t=this._invokeOne((function(t){return t.getMaterialType&&t.getMaterialType(e)})),l.push(Promise.all(this._invokeAll((function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,o)}))))}!0===s.doubleSided&&(o.side=j);var p=s.alphaMode||"OPAQUE";if("BLEND"===p?(o.transparent=!0,o.depthWrite=!1):(o.transparent=!1,"MASK"===p&&(o.alphaTest=void 0!==s.alphaCutoff?s.alphaCutoff:.5)),void 0!==s.normalTexture&&t!==C&&(l.push(n.assignTexture(o,"normalMap",s.normalTexture)),o.normalScale=new i(1,1),void 0!==s.normalTexture.scale)){var m=s.normalTexture.scale;o.normalScale.set(m,m)}return void 0!==s.occlusionTexture&&t!==C&&(l.push(n.assignTexture(o,"aoMap",s.occlusionTexture)),void 0!==s.occlusionTexture.strength&&(o.aoMapIntensity=s.occlusionTexture.strength)),void 0!==s.emissiveFactor&&t!==C&&(o.emissive=(new h).fromArray(s.emissiveFactor)),void 0!==s.emissiveTexture&&t!==C&&l.push(n.assignTexture(o,"emissiveMap",s.emissiveTexture,M)),Promise.all(l).then((function(){var r=new t(o);return s.name&&(r.name=s.name),lr(r,s),n.associations.set(r,{materials:e}),s.extensions&&or(a,r,s),r}))}},{key:"createUniqueName",value:function(e){var t=V.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}},{key:"loadGeometries",value:function(e){var t=this,n=this.extensions,r=this.primitiveCache;function a(e){return n[Pn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(e,t).then((function(n){return fr(n,e,t)}))}for(var i=[],s=0,o=e.length;s<o;s++){var l,h=e[s],d=dr(h),u=r[d];u?i.push(u.promise):(l=h.extensions&&h.extensions[Pn.KHR_DRACO_MESH_COMPRESSION]?a(h):fr(new c,h,t),r[d]={primitive:h,promise:l},i.push(l))}return Promise.all(i)}},{key:"loadMesh",value:function(e){for(var t,n=this,r=this.json,a=this.extensions,i=r.meshes[e],s=i.primitives,o=[],l=0,h=s.length;l<h;l++){var d=void 0===s[l].material?(void 0===(t=this.cache).DefaultMaterial&&(t.DefaultMaterial=new H({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:ce})),t.DefaultMaterial):this.getDependency("material",s[l].material);o.push(d)}return o.push(n.loadGeometries(s)),Promise.all(o).then((function(t){for(var r=t.slice(0,t.length-1),o=t[t.length-1],l=[],h=0,d=o.length;h<d;h++){var c=o[h],u=s[h],p=void 0,g=r[h];if(u.mode===$n.TRIANGLES||u.mode===$n.TRIANGLE_STRIP||u.mode===$n.TRIANGLE_FAN||void 0===u.mode)!0===(p=!0===i.isSkinnedMesh?new G(c,g):new K(c,g)).isSkinnedMesh&&p.normalizeSkinWeights(),u.mode===$n.TRIANGLE_STRIP?p.geometry=Mn(p.geometry,f):u.mode===$n.TRIANGLE_FAN&&(p.geometry=Mn(p.geometry,m));else if(u.mode===$n.LINES)p=new W(c,g);else if(u.mode===$n.LINE_STRIP)p=new X(c,g);else if(u.mode===$n.LINE_LOOP)p=new q(c,g);else{if(u.mode!==$n.POINTS)throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+u.mode);p=new Q(c,g)}Object.keys(p.geometry.morphAttributes).length>0&&hr(p,i),p.name=n.createUniqueName(i.name||"mesh_"+e),lr(p,i),u.extensions&&or(a,p,u),n.assignFinalMaterial(p),l.push(p)}for(var v=0,_=l.length;v<_;v++)n.associations.set(l[v],{meshes:e,primitives:v});if(1===l.length)return i.extensions&&or(a,l[0],i),l[0];var w=new Y;i.extensions&&or(a,w,i),n.associations.set(w,{meshes:e});for(var b=0,y=l.length;b<y;b++)w.add(l[b]);return w}))}},{key:"loadCamera",value:function(e){var t,n=this.json.cameras[e],r=n[n.type];if(r)return"perspective"===n.type?t=new Z(J.radToDeg(r.yfov),r.aspectRatio||1,r.znear||1,r.zfar||2e6):"orthographic"===n.type&&(t=new $(-r.xmag,r.xmag,r.ymag,-r.ymag,r.znear,r.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),lr(t,n),Promise.resolve(t);console.warn("THREE.GLTFLoader: Missing camera parameters.")}},{key:"loadSkin",value:function(e){for(var t=this.json.skins[e],n=[],r=0,a=t.joints.length;r<a;r++)n.push(this._loadNodeShallow(t.joints[r]));return void 0!==t.inverseBindMatrices?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then((function(e){for(var n=e.pop(),r=e,a=[],i=[],s=0,o=r.length;s<o;s++){var l=r[s];if(l){a.push(l);var h=new P;null!==n&&h.fromArray(n.array,16*s),i.push(h)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[s])}return new ee(a,i)}))}},{key:"loadAnimation",value:function(e){for(var t=this.json,n=this,r=t.animations[e],a=r.name?r.name:"animation_"+e,i=[],s=[],o=[],l=[],h=[],d=0,c=r.channels.length;d<c;d++){var u=r.channels[d],p=r.samplers[u.sampler],m=u.target,f=m.node,g=void 0!==r.parameters?r.parameters[p.input]:p.input,v=void 0!==r.parameters?r.parameters[p.output]:p.output;void 0!==m.node&&(i.push(this.getDependency("node",f)),s.push(this.getDependency("accessor",g)),o.push(this.getDependency("accessor",v)),l.push(p),h.push(m))}return Promise.all([Promise.all(i),Promise.all(s),Promise.all(o),Promise.all(l),Promise.all(h)]).then((function(e){for(var t=e[0],r=e[1],i=e[2],s=e[3],o=e[4],l=[],h=0,d=t.length;h<d;h++){var c=t[h],u=r[h],p=i[h],m=s[h],f=o[h];if(void 0!==c){c.updateMatrix&&c.updateMatrix();var g=n._createAnimationTracks(c,u,p,m,f);if(g)for(var v=0;v<g.length;v++)l.push(g[v])}}return new te(a,void 0,l)}))}},{key:"createNodeMesh",value:function(e){var t=this.json,n=this,r=t.nodes[e];return void 0===r.mesh?null:n.getDependency("mesh",r.mesh).then((function(e){var t=n._getNodeRef(n.meshCache,r.mesh,e);return void 0!==r.weights&&t.traverse((function(e){if(e.isMesh)for(var t=0,n=r.weights.length;t<n;t++)e.morphTargetInfluences[t]=r.weights[t]})),t}))}},{key:"loadNode",value:function(e){for(var t=this.json.nodes[e],n=this._loadNodeShallow(e),r=[],a=t.children||[],i=0,s=a.length;i<s;i++)r.push(this.getDependency("node",a[i]));var o=void 0===t.skin?Promise.resolve(null):this.getDependency("skin",t.skin);return Promise.all([n,Promise.all(r),o]).then((function(e){var t=e[0],n=e[1],r=e[2];null!==r&&t.traverse((function(e){e.isSkinnedMesh&&e.bind(r,pr)}));for(var a=0,i=n.length;a<i;a++)t.add(n[a]);return t}))}},{key:"_loadNodeShallow",value:function(e){var t=this.json,n=this.extensions,r=this;if(void 0!==this.nodeCache[e])return this.nodeCache[e];var a=t.nodes[e],i=a.name?r.createUniqueName(a.name):"",s=[],o=r._invokeOne((function(t){return t.createNodeMesh&&t.createNodeMesh(e)}));return o&&s.push(o),void 0!==a.camera&&s.push(r.getDependency("camera",a.camera).then((function(e){return r._getNodeRef(r.cameraCache,a.camera,e)}))),r._invokeAll((function(t){return t.createNodeAttachment&&t.createNodeAttachment(e)})).forEach((function(e){s.push(e)})),this.nodeCache[e]=Promise.all(s).then((function(t){var s;if((s=!0===a.isBone?new ne:t.length>1?new Y:1===t.length?t[0]:new I)!==t[0])for(var o=0,l=t.length;o<l;o++)s.add(t[o]);if(a.name&&(s.userData.name=a.name,s.name=i),lr(s,a),a.extensions&&or(n,s,a),void 0!==a.matrix){var h=new P;h.fromArray(a.matrix),s.applyMatrix4(h)}else void 0!==a.translation&&s.position.fromArray(a.translation),void 0!==a.rotation&&s.quaternion.fromArray(a.rotation),void 0!==a.scale&&s.scale.fromArray(a.scale);return r.associations.has(s)||r.associations.set(s,{}),r.associations.get(s).nodes=e,s})),this.nodeCache[e]}},{key:"loadScene",value:function(e){var t=this.extensions,n=this.json.scenes[e],r=this,a=new Y;n.name&&(a.name=r.createUniqueName(n.name)),lr(a,n),n.extensions&&or(t,a,n);for(var i=n.nodes||[],s=[],o=0,l=i.length;o<l;o++)s.push(r.getDependency("node",i[o]));return Promise.all(s).then((function(e){for(var t=0,n=e.length;t<n;t++)a.add(e[t]);return r.associations=function(e){var t,n=new Map,a=A(r.associations);try{for(a.s();!(t=a.n()).done;){var i=me(t.value,2),s=i[0],o=i[1];(s instanceof B||s instanceof fe)&&n.set(s,o)}}catch(e){a.e(e)}finally{a.f()}return e.traverse((function(e){var t=r.associations.get(e);null!=t&&n.set(e,t)})),n}(a),a}))}},{key:"_createAnimationTracks",value:function(e,t,n,r,a){var i,s=[],o=e.name?e.name:e.uuid,l=[];switch(ir[a.path]===ir.weights?e.traverse((function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)})):l.push(o),ir[a.path]){case ir.weights:i=ve;break;case ir.rotation:i=_e;break;case ir.position:case ir.scale:i=ge;break;default:switch(n.itemSize){case 1:i=ve;break;case 2:case 3:default:i=ge}}for(var h=void 0!==r.interpolation?sr[r.interpolation]:re,d=this._getArrayFromAccessor(n),c=0,u=l.length;c<u;c++){var p=new i(l[c]+"."+ir[a.path],t.array,d,h);"CUBICSPLINE"===r.interpolation&&this._createCubicSplineTrackInterpolant(p),s.push(p)}return s}},{key:"_getArrayFromAccessor",value:function(e){var t=e.array;if(e.normalized){for(var n=ur(t.constructor),r=new Float32Array(t.length),a=0,i=t.length;a<i;a++)r[a]=t[a]*n;t=r}return t}},{key:"_createCubicSplineTrackInterpolant",value:function(e){e.createInterpolant=function(e){return new(this instanceof _e?Jn:Yn)(this.times,this.values,this.getValueSize()/3,e)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}]),e}();function fr(e,t,n){var r=t.attributes,a=[];function i(t,r){return n.getDependency("accessor",t).then((function(t){e.setAttribute(r,t)}))}for(var o in r){var l=ar[o]||o.toLowerCase();l in e.attributes||a.push(i(r[o],l))}if(void 0!==t.indices&&!e.index){var h=n.getDependency("accessor",t.indices).then((function(t){e.setIndex(t)}));a.push(h)}return lr(e,t),function(e,t,n){var r=t.attributes,a=new we;if(void 0!==r.POSITION){var i=n.json.accessors[r.POSITION],o=i.min,l=i.max;if(void 0!==o&&void 0!==l){if(a.set(new s(o[0],o[1],o[2]),new s(l[0],l[1],l[2])),i.normalized){var h=ur(er[i.componentType]);a.min.multiplyScalar(h),a.max.multiplyScalar(h)}var d=t.targets;if(void 0!==d){for(var c=new s,u=new s,p=0,m=d.length;p<m;p++){var f=d[p];if(void 0!==f.POSITION){var g=n.json.accessors[f.POSITION],v=g.min,_=g.max;if(void 0!==v&&void 0!==_){if(u.setX(Math.max(Math.abs(v[0]),Math.abs(_[0]))),u.setY(Math.max(Math.abs(v[1]),Math.abs(_[1]))),u.setZ(Math.max(Math.abs(v[2]),Math.abs(_[2]))),g.normalized){var w=ur(er[g.componentType]);u.multiplyScalar(w)}c.max(u)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}a.expandByVector(c)}e.boundingBox=a;var b=new be;a.getCenter(b.center),b.radius=a.min.distanceTo(a.max)/2,e.boundingSphere=b}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}(e,t,n),Promise.all(a).then((function(){return void 0!==t.targets?function(e,t,n){for(var r=!1,a=!1,i=!1,s=0,o=t.length;s<o;s++){var l=t[s];if(void 0!==l.POSITION&&(r=!0),void 0!==l.NORMAL&&(a=!0),void 0!==l.COLOR_0&&(i=!0),r&&a&&i)break}if(!r&&!a&&!i)return Promise.resolve(e);for(var h=[],d=[],c=[],u=0,p=t.length;u<p;u++){var m=t[u];if(r){var f=void 0!==m.POSITION?n.getDependency("accessor",m.POSITION):e.attributes.position;h.push(f)}if(a){var g=void 0!==m.NORMAL?n.getDependency("accessor",m.NORMAL):e.attributes.normal;d.push(g)}if(i){var v=void 0!==m.COLOR_0?n.getDependency("accessor",m.COLOR_0):e.attributes.color;c.push(v)}}return Promise.all([Promise.all(h),Promise.all(d),Promise.all(c)]).then((function(t){var n=t[0],s=t[1],o=t[2];return r&&(e.morphAttributes.position=n),a&&(e.morphAttributes.normal=s),i&&(e.morphAttributes.color=o),e.morphTargetsRelative=!0,e}))}(e,t.targets,n):e}))}var gr=new WeakMap,vr=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).decoderPath="",r.decoderConfig={},r.decoderBinary=null,r.decoderPending=null,r.workerLimit=4,r.workerPool=[],r.workerNextTaskID=1,r.workerSourceURL="",r.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},r.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"},r}return w(n,[{key:"setDecoderPath",value:function(e){return this.decoderPath=e,this}},{key:"setDecoderConfig",value:function(e){return this.decoderConfig=e,this}},{key:"setWorkerLimit",value:function(e){return this.workerLimit=e,this}},{key:"load",value:function(e,t,n,r){var a=this,i=new y(this.manager);i.setPath(this.path),i.setResponseType("arraybuffer"),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(function(e){a.parse(e,t,r)}),n,r)}},{key:"parse",value:function(e,t,n){this.decodeDracoFile(e,t,null,null,M).catch(n)}},{key:"decodeDracoFile",value:function(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Ce,i={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:r||this.defaultAttributeTypes,useUniqueIDs:!!n,vertexColorSpace:a};return this.decodeGeometry(e,i).then(t)}},{key:"decodeGeometry",value:function(e,t){var n,r=this,a=JSON.stringify(t);if(gr.has(e)){var i=gr.get(e);if(i.key===a)return i.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var s=this.workerNextTaskID++,o=e.byteLength,l=this._getWorker(s,o).then((function(r){return n=r,new Promise((function(r,a){n._callbacks[s]={resolve:r,reject:a},n.postMessage({type:"decode",id:s,taskConfig:t,buffer:e},[e])}))})).then((function(e){return r._createGeometry(e.geometry)}));return l.catch((function(){return!0})).then((function(){n&&s&&r._releaseTask(n,s)})),gr.set(e,{key:a,promise:l}),l}},{key:"_createGeometry",value:function(e){var t=new c;e.index&&t.setIndex(new u(e.index.array,1));for(var n=0;n<e.attributes.length;n++){var r=e.attributes[n],a=r.name,i=r.array,s=r.itemSize,o=new u(i,s);"color"===a&&(this._assignVertexColorSpace(o,r.vertexColorSpace),o.normalized=i instanceof Float32Array==0),t.setAttribute(a,o)}return t}},{key:"_assignVertexColorSpace",value:function(e,t){if(t===M)for(var n=new h,r=0,a=e.count;r<a;r++)n.fromBufferAttribute(e,r).convertSRGBToLinear(),e.setXYZ(r,n.r,n.g,n.b)}},{key:"_loadLibrary",value:function(e,t){var n=new y(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((function(t,r){n.load(e,t,void 0,r)}))}},{key:"preload",value:function(){return this._initDecoder(),this}},{key:"_initDecoder",value:function(){var e=this;if(this.decoderPending)return this.decoderPending;var t="object"!==("undefined"==typeof WebAssembly?"undefined":k(WebAssembly))||"js"===this.decoderConfig.type,n=[];return t?n.push(this._loadLibrary("draco_decoder.js","text")):(n.push(this._loadLibrary("draco_wasm_wrapper.js","text")),n.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(n).then((function(n){var r=n[0];t||(e.decoderConfig.wasmBinary=n[1]);var a=_r.toString(),i=["/* draco decoder */",r,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join("\n");e.workerSourceURL=URL.createObjectURL(new Blob([i]))})),this.decoderPending}},{key:"_getWorker",value:function(e,t){var n=this;return this._initDecoder().then((function(){if(n.workerPool.length<n.workerLimit){var r=new Worker(n.workerSourceURL);r._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:n.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},n.workerPool.push(r)}else n.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1}));var a=n.workerPool[n.workerPool.length-1];return a._taskCosts[e]=t,a._taskLoad+=t,a}))}},{key:"_releaseTask",value:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}},{key:"debug",value:function(){this.workerPool.map((function(e){return e._taskLoad}))}},{key:"dispose",value:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,""!==this.workerSourceURL&&URL.revokeObjectURL(this.workerSourceURL),this}}]),n}(x);function _r(){var e,t;function n(e,t,n,r,a,i){var s=i.num_components(),o=n.num_points()*s,l=o*a.BYTES_PER_ELEMENT,h=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,a),d=e._malloc(l);t.GetAttributeDataArrayForAllPoints(n,i,h,l,d);var c=new a(e.HEAPF32.buffer,d,o).slice();return e._free(d),{name:r,array:c,itemSize:s}}onmessage=function(r){var a=r.data;switch(a.type){case"init":e=a.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var i=a.buffer,s=a.taskConfig;t.then((function(e){var t=e.draco,r=new t.Decoder;try{var o=function(e,t,r,a){var i,s,o=a.attributeIDs,l=a.attributeTypes,h=t.GetEncodedGeometryType(r);if(h===e.TRIANGULAR_MESH)i=new e.Mesh,s=t.DecodeArrayToMesh(r,r.byteLength,i);else{if(h!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");i=new e.PointCloud,s=t.DecodeArrayToPointCloud(r,r.byteLength,i)}if(!s.ok()||0===i.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var d={index:null,attributes:[]};for(var c in o){var u=self[l[c]],p=void 0,m=void 0;if(a.useUniqueIDs)m=o[c],p=t.GetAttributeByUniqueId(i,m);else{if(-1===(m=t.GetAttributeId(i,e[o[c]])))continue;p=t.GetAttribute(i,m)}var f=n(e,t,i,c,u,p);"color"===c&&(f.vertexColorSpace=a.vertexColorSpace),d.attributes.push(f)}return h===e.TRIANGULAR_MESH&&(d.index=function(e,t,n){var r=3*n.num_faces(),a=4*r,i=e._malloc(a);t.GetTrianglesUInt32Array(n,a,i);var s=new Uint32Array(e.HEAPF32.buffer,i,r).slice();return e._free(i),{array:s,itemSize:1}}(e,t,i)),e.destroy(i),d}(t,r,new Int8Array(i),s),l=o.attributes.map((function(e){return e.array.buffer}));o.index&&l.push(o.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:o},l)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}finally{t.destroy(r)}}))}}}const wr={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-6263f3a4b71cdf3b.js","draco_decoder.wasm":"static/draco_decoder-b048235474cbf09e.wasm","draco_decoder.js":"static/draco_decoder-dc7f397e2a2ebac4.js"};class br{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",r=5){const a=this.getStore(n),i=a.entries.find(t=>t.id===e);if(i?(i.payload=t,i.date=Date.now()):a.entries.push({id:e,date:Date.now(),payload:t}),a.entries.length>r)for(a.entries.sort((e,t)=>t.date-e.date);a.entries.length>r;)a.entries.pop();this.saveStore(n,a)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}pn([fn],br.prototype,"_localStorage",void 0);const yr=e("t",(function(e){return e*(Math.PI/180)})),xr=e("z",(function(e){return e*(180/Math.PI)})),Sr=(e("x",(function(e,t,n,r,a,i){e=Math.sqrt(e*e+n*n);const s=a/i,o=2*Math.atan(Math.tan(r*Math.PI/180/2)*s)*180/Math.PI,l=yr(r),h=t/2/Math.tan(l/2),d=e/(2*Math.atan(Math.PI*o/360));return Math.max(h,d)})),function(e){return Math.round(1e3*e)/1e3}),Cr=(e("a1",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("ab",e=>new s(e.x/1e3,e.z/1e3,e.y/-1e3))),Mr=e=>new s(e.x/1e3,e.z/1e3,e.y/1e3),Tr=e("h",e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)})),Ar=e=>decodeURIComponent(encodeURIComponent(e)),Pr=e("Q",e=>{if(!e){const t=typeof e;return"number"===t||"boolean"===t?e:null}if(!e.hasOwnProperty("size")&&e.size&&"function"==typeof e.size){let t=Rr(e);for(let e=0;e<t.length;e++)t[e]=Pr(t[e]);return"string"==typeof t?Ar(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=Pr(e[t]));return"string"==typeof e?Ar(e):e}),Rr=e=>{let t=[];if(e){let n=e.size();for(let r=0;r<n;r++)t.push(e.get(r))}return t},Er=e=>{let t=new P,n=Pr(e);return t.fromArray(n),t.transpose(),(e=>{let t=new P;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new s(.001,.001,.001));let n=new P;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new s(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};function Ir(e,t){var n=e.__state.conversionName.toString(),r=Math.round(e.r),a=Math.round(e.g),i=Math.round(e.b),s=e.a,o=Math.round(e.h),l=e.s.toFixed(1),h=e.v.toFixed(1);if(t||"THREE_CHAR_HEX"===n||"SIX_CHAR_HEX"===n){for(var d=e.hex.toString(16);d.length<6;)d="0"+d;return"#"+d}return"CSS_RGB"===n?"rgb("+r+","+a+","+i+")":"CSS_RGBA"===n?"rgba("+r+","+a+","+i+","+s+")":"HEX"===n?"0x"+e.hex.toString(16):"RGB_ARRAY"===n?"["+r+","+a+","+i+"]":"RGBA_ARRAY"===n?"["+r+","+a+","+i+","+s+"]":"RGB_OBJ"===n?"{r:"+r+",g:"+a+",b:"+i+"}":"RGBA_OBJ"===n?"{r:"+r+",g:"+a+",b:"+i+",a:"+s+"}":"HSV_OBJ"===n?"{h:"+o+",s:"+l+",v:"+h+"}":"HSVA_OBJ"===n?"{h:"+o+",s:"+l+",v:"+h+",a:"+s+"}":"unknown format"}var kr=Array.prototype.forEach,Dr=Array.prototype.slice,Or={BREAK:{},extend:function(e){return this.each(Dr.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(t[n])||(e[n]=t[n])}.bind(this))}),this),e},defaults:function(e){return this.each(Dr.call(arguments,1),(function(t){(this.isObject(t)?Object.keys(t):[]).forEach(function(n){this.isUndefined(e[n])&&(e[n]=t[n])}.bind(this))}),this),e},compose:function(){var e=Dr.call(arguments);return function(){for(var t=Dr.call(arguments),n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}},each:function(e,t,n){if(e)if(kr&&e.forEach&&e.forEach===kr)e.forEach(t,n);else if(e.length===e.length+0){var r,a=void 0;for(a=0,r=e.length;a<r;a++)if(a in e&&t.call(n,e[a],a)===this.BREAK)return}else for(var i in e)if(t.call(n,e[i],i)===this.BREAK)return},defer:function(e){setTimeout(e,0)},debounce:function(e,t,n){var r=void 0;return function(){var a=this,i=arguments;function s(){r=null,n||e.apply(a,i)}var o=n||!r;clearTimeout(r),r=setTimeout(s,t),o&&e.apply(a,i)}},toArray:function(e){return e.toArray?e.toArray():Dr.call(e)},isUndefined:function(e){return void 0===e},isNull:function(e){return null===e},isNaN:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){return isNaN(e)})),isArray:Array.isArray||function(e){return e.constructor===Array},isObject:function(e){return e===Object(e)},isNumber:function(e){return e===e+0},isString:function(e){return e===e+""},isBoolean:function(e){return!1===e||!0===e},isFunction:function(e){return e instanceof Function}},Lr=[{litmus:Or.isString,conversions:{THREE_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString()+t[1].toString()+t[2].toString()+t[2].toString()+t[3].toString()+t[3].toString(),0)}},write:Ir},SIX_CHAR_HEX:{read:function(e){var t=e.match(/^#([A-F0-9]{6})$/i);return null!==t&&{space:"HEX",hex:parseInt("0x"+t[1].toString(),0)}},write:Ir},CSS_RGB:{read:function(e){var t=e.match(/^rgb\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3])}},write:Ir},CSS_RGBA:{read:function(e){var t=e.match(/^rgba\(\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*,\s*(\S+)\s*\)/);return null!==t&&{space:"RGB",r:parseFloat(t[1]),g:parseFloat(t[2]),b:parseFloat(t[3]),a:parseFloat(t[4])}},write:Ir}}},{litmus:Or.isNumber,conversions:{HEX:{read:function(e){return{space:"HEX",hex:e,conversionName:"HEX"}},write:function(e){return e.hex}}}},{litmus:Or.isArray,conversions:{RGB_ARRAY:{read:function(e){return 3===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2]}},write:function(e){return[e.r,e.g,e.b]}},RGBA_ARRAY:{read:function(e){return 4===e.length&&{space:"RGB",r:e[0],g:e[1],b:e[2],a:e[3]}},write:function(e){return[e.r,e.g,e.b,e.a]}}}},{litmus:Or.isObject,conversions:{RGBA_OBJ:{read:function(e){return!!(Or.isNumber(e.r)&&Or.isNumber(e.g)&&Or.isNumber(e.b)&&Or.isNumber(e.a))&&{space:"RGB",r:e.r,g:e.g,b:e.b,a:e.a}},write:function(e){return{r:e.r,g:e.g,b:e.b,a:e.a}}},RGB_OBJ:{read:function(e){return!!(Or.isNumber(e.r)&&Or.isNumber(e.g)&&Or.isNumber(e.b))&&{space:"RGB",r:e.r,g:e.g,b:e.b}},write:function(e){return{r:e.r,g:e.g,b:e.b}}},HSVA_OBJ:{read:function(e){return!!(Or.isNumber(e.h)&&Or.isNumber(e.s)&&Or.isNumber(e.v)&&Or.isNumber(e.a))&&{space:"HSV",h:e.h,s:e.s,v:e.v,a:e.a}},write:function(e){return{h:e.h,s:e.s,v:e.v,a:e.a}}},HSV_OBJ:{read:function(e){return!!(Or.isNumber(e.h)&&Or.isNumber(e.s)&&Or.isNumber(e.v))&&{space:"HSV",h:e.h,s:e.s,v:e.v}},write:function(e){return{h:e.h,s:e.s,v:e.v}}}}}],Ur=void 0,Fr=void 0,Nr=function(){Fr=!1;var e=arguments.length>1?Or.toArray(arguments):arguments[0];return Or.each(Lr,(function(t){if(t.litmus(e))return Or.each(t.conversions,(function(t,n){if(Ur=t.read(e),!1===Fr&&!1!==Ur)return Fr=Ur,Ur.conversionName=n,Ur.conversion=t,Or.BREAK})),Or.BREAK})),Fr},Br=void 0,zr={hsv_to_rgb:function(e,t,n){var r=Math.floor(e/60)%6,a=e/60-Math.floor(e/60),i=n*(1-t),s=n*(1-a*t),o=n*(1-(1-a)*t),l=[[n,o,i],[s,n,i],[i,n,o],[i,s,n],[o,i,n],[n,i,s]][r];return{r:255*l[0],g:255*l[1],b:255*l[2]}},rgb_to_hsv:function(e,t,n){var r=Math.min(e,t,n),a=Math.max(e,t,n),i=a-r,s=void 0;return 0===a?{h:NaN,s:0,v:0}:(s=e===a?(t-n)/i:t===a?2+(n-e)/i:4+(e-t)/i,(s/=6)<0&&(s+=1),{h:360*s,s:i/a,v:a/255})},rgb_to_hex:function(e,t,n){var r=this.hex_with_component(0,2,e);return r=this.hex_with_component(r,1,t),this.hex_with_component(r,0,n)},component_from_hex:function(e,t){return e>>8*t&255},hex_with_component:function(e,t,n){return n<<(Br=8*t)|e&~(255<<Br)}},Hr="function"==typeof Symbol&&"symbol"===k(Symbol.iterator)?function(e){return k(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":k(e)},jr=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Vr=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),Gr=function e(t,n,r){null===t&&(t=Function.prototype);var a=Object.getOwnPropertyDescriptor(t,n);if(void 0===a){var i=Object.getPrototypeOf(t);return null===i?void 0:e(i,n,r)}if("value"in a)return a.value;var s=a.get;return void 0!==s?s.call(r):void 0},Kr=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+k(t));e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},Wr=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==k(t)&&"function"!=typeof t?e:t},Xr=function(){function e(){if(jr(this,e),this.__state=Nr.apply(this,arguments),!1===this.__state)throw new Error("Failed to interpret color arguments");this.__state.a=this.__state.a||1}return Vr(e,[{key:"toString",value:function(){return Ir(this)}},{key:"toHexString",value:function(){return Ir(this,!0)}},{key:"toOriginal",value:function(){return this.__state.conversion.write(this)}}]),e}();function qr(e,t,n){Object.defineProperty(e,t,{get:function(){return"RGB"===this.__state.space||Xr.recalculateRGB(this,t,n),this.__state[t]},set:function(e){"RGB"!==this.__state.space&&(Xr.recalculateRGB(this,t,n),this.__state.space="RGB"),this.__state[t]=e}})}function Qr(e,t){Object.defineProperty(e,t,{get:function(){return"HSV"===this.__state.space||Xr.recalculateHSV(this),this.__state[t]},set:function(e){"HSV"!==this.__state.space&&(Xr.recalculateHSV(this),this.__state.space="HSV"),this.__state[t]=e}})}Xr.recalculateRGB=function(e,t,n){if("HEX"===e.__state.space)e.__state[t]=zr.component_from_hex(e.__state.hex,n);else{if("HSV"!==e.__state.space)throw new Error("Corrupted color state");Or.extend(e.__state,zr.hsv_to_rgb(e.__state.h,e.__state.s,e.__state.v))}},Xr.recalculateHSV=function(e){var t=zr.rgb_to_hsv(e.r,e.g,e.b);Or.extend(e.__state,{s:t.s,v:t.v}),Or.isNaN(t.h)?Or.isUndefined(e.__state.h)&&(e.__state.h=0):e.__state.h=t.h},Xr.COMPONENTS=["r","g","b","h","s","v","hex","a"],qr(Xr.prototype,"r",2),qr(Xr.prototype,"g",1),qr(Xr.prototype,"b",0),Qr(Xr.prototype,"h"),Qr(Xr.prototype,"s"),Qr(Xr.prototype,"v"),Object.defineProperty(Xr.prototype,"a",{get:function(){return this.__state.a},set:function(e){this.__state.a=e}}),Object.defineProperty(Xr.prototype,"hex",{get:function(){return"HEX"!==this.__state.space&&(this.__state.hex=zr.rgb_to_hex(this.r,this.g,this.b),this.__state.space="HEX"),this.__state.hex},set:function(e){this.__state.space="HEX",this.__state.hex=e}});var Yr=function(){function e(t,n){jr(this,e),this.initialValue=t[n],this.domElement=document.createElement("div"),this.object=t,this.property=n,this.__onChange=void 0,this.__onFinishChange=void 0}return Vr(e,[{key:"onChange",value:function(e){return this.__onChange=e,this}},{key:"onFinishChange",value:function(e){return this.__onFinishChange=e,this}},{key:"setValue",value:function(e){return this.object[this.property]=e,this.__onChange&&this.__onChange.call(this,e),this.updateDisplay(),this}},{key:"getValue",value:function(){return this.object[this.property]}},{key:"updateDisplay",value:function(){return this}},{key:"isModified",value:function(){return this.initialValue!==this.getValue()}}]),e}(),Zr={};Or.each({HTMLEvents:["change"],MouseEvents:["click","mousemove","mousedown","mouseup","mouseover"],KeyboardEvents:["keydown"]},(function(e,t){Or.each(e,(function(e){Zr[e]=t}))}));var Jr=/(\d+(\.\d+)?)px/;function $r(e){if("0"===e||Or.isUndefined(e))return 0;var t=e.match(Jr);return Or.isNull(t)?0:parseFloat(t[1])}var ea={makeSelectable:function(e,t){void 0!==e&&void 0!==e.style&&(e.onselectstart=t?function(){return!1}:function(){},e.style.MozUserSelect=t?"auto":"none",e.style.KhtmlUserSelect=t?"auto":"none",e.unselectable=t?"on":"off")},makeFullscreen:function(e,t,n){var r=n,a=t;Or.isUndefined(a)&&(a=!0),Or.isUndefined(r)&&(r=!0),e.style.position="absolute",a&&(e.style.left=0,e.style.right=0),r&&(e.style.top=0,e.style.bottom=0)},fakeEvent:function(e,t,n,r){var a=n||{},i=Zr[t];if(!i)throw new Error("Event type "+t+" not supported.");var s=document.createEvent(i);switch(i){case"MouseEvents":var o=a.x||a.clientX||0,l=a.y||a.clientY||0;s.initMouseEvent(t,a.bubbles||!1,a.cancelable||!0,window,a.clickCount||1,0,0,o,l,!1,!1,!1,!1,0,null);break;case"KeyboardEvents":var h=s.initKeyboardEvent||s.initKeyEvent;Or.defaults(a,{cancelable:!0,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,keyCode:void 0,charCode:void 0}),h(t,a.bubbles||!1,a.cancelable,window,a.ctrlKey,a.altKey,a.shiftKey,a.metaKey,a.keyCode,a.charCode);break;default:s.initEvent(t,a.bubbles||!1,a.cancelable||!0)}Or.defaults(s,r),e.dispatchEvent(s)},bind:function(e,t,n,r){var a=r||!1;return e.addEventListener?e.addEventListener(t,n,a):e.attachEvent&&e.attachEvent("on"+t,n),ea},unbind:function(e,t,n,r){var a=r||!1;return e.removeEventListener?e.removeEventListener(t,n,a):e.detachEvent&&e.detachEvent("on"+t,n),ea},addClass:function(e,t){if(void 0===e.className)e.className=t;else if(e.className!==t){var n=e.className.split(/ +/);-1===n.indexOf(t)&&(n.push(t),e.className=n.join(" ").replace(/^\s+/,"").replace(/\s+$/,""))}return ea},removeClass:function(e,t){if(t)if(e.className===t)e.removeAttribute("class");else{var n=e.className.split(/ +/),r=n.indexOf(t);-1!==r&&(n.splice(r,1),e.className=n.join(" "))}else e.className=void 0;return ea},hasClass:function(e,t){return new RegExp("(?:^|\\s+)"+t+"(?:\\s+|$)").test(e.className)||!1},getWidth:function(e){var t=getComputedStyle(e);return $r(t["border-left-width"])+$r(t["border-right-width"])+$r(t["padding-left"])+$r(t["padding-right"])+$r(t.width)},getHeight:function(e){var t=getComputedStyle(e);return $r(t["border-top-width"])+$r(t["border-bottom-width"])+$r(t["padding-top"])+$r(t["padding-bottom"])+$r(t.height)},getOffset:function(e){var t=e,n={left:0,top:0};if(t.offsetParent)do{n.left+=t.offsetLeft,n.top+=t.offsetTop,t=t.offsetParent}while(t);return n},isActive:function(e){return e===document.activeElement&&(e.type||e.href)}},ta=function(e){function t(e,n){jr(this,t);var r=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),a=r;return r.__prev=r.getValue(),r.__checkbox=document.createElement("input"),r.__checkbox.setAttribute("type","checkbox"),ea.bind(r.__checkbox,"change",(function(){a.setValue(!a.__prev)}),!1),r.domElement.appendChild(r.__checkbox),r.updateDisplay(),r}return Kr(t,e),Vr(t,[{key:"setValue",value:function(e){var n=Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),this.__prev=this.getValue(),n}},{key:"updateDisplay",value:function(){return!0===this.getValue()?(this.__checkbox.setAttribute("checked","checked"),this.__checkbox.checked=!0,this.__prev=!0):(this.__checkbox.checked=!1,this.__prev=!1),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Yr),na=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=r,s=a;if(a.__select=document.createElement("select"),Or.isArray(i)){var o={};Or.each(i,(function(e){o[e]=e})),i=o}return Or.each(i,(function(e,t){var n=document.createElement("option");n.innerHTML=t,n.setAttribute("value",e),s.__select.appendChild(n)})),a.updateDisplay(),ea.bind(a.__select,"change",(function(){var e=this.options[this.selectedIndex].value;s.setValue(e)})),a.domElement.appendChild(a.__select),a}return Kr(t,e),Vr(t,[{key:"setValue",value:function(e){var n=Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,e);return this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue()),n}},{key:"updateDisplay",value:function(){return ea.isActive(this.__select)?this:(this.__select.value=this.getValue(),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this))}}]),t}(Yr),ra=function(e){function t(e,n){jr(this,t);var r=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),a=r;function i(){a.setValue(a.__input.value)}return r.__input=document.createElement("input"),r.__input.setAttribute("type","text"),ea.bind(r.__input,"keyup",i),ea.bind(r.__input,"change",i),ea.bind(r.__input,"blur",(function(){a.__onFinishChange&&a.__onFinishChange.call(a,a.getValue())})),ea.bind(r.__input,"keydown",(function(e){13===e.keyCode&&this.blur()})),r.updateDisplay(),r.domElement.appendChild(r.__input),r}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){return ea.isActive(this.__input)||(this.__input.value=this.getValue()),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(Yr);function aa(e){var t=e.toString();return t.indexOf(".")>-1?t.length-t.indexOf(".")-1:0}var ia=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=r||{};return a.__min=i.min,a.__max=i.max,a.__step=i.step,Or.isUndefined(a.__step)?0===a.initialValue?a.__impliedStep=1:a.__impliedStep=Math.pow(10,Math.floor(Math.log(Math.abs(a.initialValue))/Math.LN10))/10:a.__impliedStep=a.__step,a.__precision=aa(a.__impliedStep),a}return Kr(t,e),Vr(t,[{key:"setValue",value:function(e){var n=e;return void 0!==this.__min&&n<this.__min?n=this.__min:void 0!==this.__max&&n>this.__max&&(n=this.__max),void 0!==this.__step&&n%this.__step!=0&&(n=Math.round(n/this.__step)*this.__step),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"setValue",this).call(this,n)}},{key:"min",value:function(e){return this.__min=e,this}},{key:"max",value:function(e){return this.__max=e,this}},{key:"step",value:function(e){return this.__step=e,this.__impliedStep=e,this.__precision=aa(e),this}}]),t}(Yr),sa=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,r));a.__truncationSuspended=!1;var i=a,s=void 0;function o(){i.__onFinishChange&&i.__onFinishChange.call(i,i.getValue())}function l(e){var t=s-e.clientY;i.setValue(i.getValue()+t*i.__impliedStep),s=e.clientY}function h(){ea.unbind(window,"mousemove",l),ea.unbind(window,"mouseup",h),o()}return a.__input=document.createElement("input"),a.__input.setAttribute("type","text"),ea.bind(a.__input,"change",(function(){var e=parseFloat(i.__input.value);Or.isNaN(e)||i.setValue(e)})),ea.bind(a.__input,"blur",(function(){o()})),ea.bind(a.__input,"mousedown",(function(e){ea.bind(window,"mousemove",l),ea.bind(window,"mouseup",h),s=e.clientY})),ea.bind(a.__input,"keydown",(function(e){13===e.keyCode&&(i.__truncationSuspended=!0,this.blur(),i.__truncationSuspended=!1,o())})),a.updateDisplay(),a.domElement.appendChild(a.__input),a}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){var e,n,r;return this.__input.value=this.__truncationSuspended?this.getValue():(e=this.getValue(),n=this.__precision,r=Math.pow(10,n),Math.round(e*r)/r),Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ia);function oa(e,t,n,r,a){return r+(e-t)/(n-t)*(a-r)}var la=function(e){function t(e,n,r,a,i){jr(this,t);var s=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n,{min:r,max:a,step:i})),o=s;function l(e){e.preventDefault();var t=o.__background.getBoundingClientRect();return o.setValue(oa(e.clientX,t.left,t.right,o.__min,o.__max)),!1}function h(){ea.unbind(window,"mousemove",l),ea.unbind(window,"mouseup",h),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}function d(e){var t=e.touches[0].clientX,n=o.__background.getBoundingClientRect();o.setValue(oa(t,n.left,n.right,o.__min,o.__max))}function c(){ea.unbind(window,"touchmove",d),ea.unbind(window,"touchend",c),o.__onFinishChange&&o.__onFinishChange.call(o,o.getValue())}return s.__background=document.createElement("div"),s.__foreground=document.createElement("div"),ea.bind(s.__background,"mousedown",(function(e){document.activeElement.blur(),ea.bind(window,"mousemove",l),ea.bind(window,"mouseup",h),l(e)})),ea.bind(s.__background,"touchstart",(function(e){1===e.touches.length&&(ea.bind(window,"touchmove",d),ea.bind(window,"touchend",c),d(e))})),ea.addClass(s.__background,"slider"),ea.addClass(s.__foreground,"slider-fg"),s.updateDisplay(),s.__background.appendChild(s.__foreground),s.domElement.appendChild(s.__background),s}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){var e=(this.getValue()-this.__min)/(this.__max-this.__min);return this.__foreground.style.width=100*e+"%",Gr(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"updateDisplay",this).call(this)}}]),t}(ia),ha=function(e){function t(e,n,r){jr(this,t);var a=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n)),i=a;return a.__button=document.createElement("div"),a.__button.innerHTML=void 0===r?"Fire":r,ea.bind(a.__button,"click",(function(e){return e.preventDefault(),i.fire(),!1})),ea.addClass(a.__button,"button"),a.domElement.appendChild(a.__button),a}return Kr(t,e),Vr(t,[{key:"fire",value:function(){this.__onChange&&this.__onChange.call(this),this.getValue().call(this.object),this.__onFinishChange&&this.__onFinishChange.call(this,this.getValue())}}]),t}(Yr),da=function(e){function t(e,n){jr(this,t);var r=Wr(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e,n));r.__color=new Xr(r.getValue()),r.__temp=new Xr(0);var a=r;r.domElement=document.createElement("div"),ea.makeSelectable(r.domElement,!1),r.__selector=document.createElement("div"),r.__selector.className="selector",r.__saturation_field=document.createElement("div"),r.__saturation_field.className="saturation-field",r.__field_knob=document.createElement("div"),r.__field_knob.className="field-knob",r.__field_knob_border="2px solid ",r.__hue_knob=document.createElement("div"),r.__hue_knob.className="hue-knob",r.__hue_field=document.createElement("div"),r.__hue_field.className="hue-field",r.__input=document.createElement("input"),r.__input.type="text",r.__input_textShadow="0 1px 1px ",ea.bind(r.__input,"keydown",(function(e){13===e.keyCode&&c.call(this)})),ea.bind(r.__input,"blur",c),ea.bind(r.__selector,"mousedown",(function(){ea.addClass(this,"drag").bind(window,"mouseup",(function(){ea.removeClass(a.__selector,"drag")}))})),ea.bind(r.__selector,"touchstart",(function(){ea.addClass(this,"drag").bind(window,"touchend",(function(){ea.removeClass(a.__selector,"drag")}))}));var i,s=document.createElement("div");function o(e){p(e),ea.bind(window,"mousemove",p),ea.bind(window,"touchmove",p),ea.bind(window,"mouseup",h),ea.bind(window,"touchend",h)}function l(e){m(e),ea.bind(window,"mousemove",m),ea.bind(window,"touchmove",m),ea.bind(window,"mouseup",d),ea.bind(window,"touchend",d)}function h(){ea.unbind(window,"mousemove",p),ea.unbind(window,"touchmove",p),ea.unbind(window,"mouseup",h),ea.unbind(window,"touchend",h),u()}function d(){ea.unbind(window,"mousemove",m),ea.unbind(window,"touchmove",m),ea.unbind(window,"mouseup",d),ea.unbind(window,"touchend",d),u()}function c(){var e=Nr(this.value);!1!==e?(a.__color.__state=e,a.setValue(a.__color.toOriginal())):this.value=a.__color.toString()}function u(){a.__onFinishChange&&a.__onFinishChange.call(a,a.__color.toOriginal())}function p(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=a.__saturation_field.getBoundingClientRect(),n=e.touches&&e.touches[0]||e,r=n.clientX,i=n.clientY,s=(r-t.left)/(t.right-t.left),o=1-(i-t.top)/(t.bottom-t.top);return o>1?o=1:o<0&&(o=0),s>1?s=1:s<0&&(s=0),a.__color.v=o,a.__color.s=s,a.setValue(a.__color.toOriginal()),!1}function m(e){-1===e.type.indexOf("touch")&&e.preventDefault();var t=a.__hue_field.getBoundingClientRect(),n=1-((e.touches&&e.touches[0]||e).clientY-t.top)/(t.bottom-t.top);return n>1?n=1:n<0&&(n=0),a.__color.h=360*n,a.setValue(a.__color.toOriginal()),!1}return Or.extend(r.__selector.style,{width:"122px",height:"102px",padding:"3px",backgroundColor:"#222",boxShadow:"0px 1px 3px rgba(0,0,0,0.3)"}),Or.extend(r.__field_knob.style,{position:"absolute",width:"12px",height:"12px",border:r.__field_knob_border+(r.__color.v<.5?"#fff":"#000"),boxShadow:"0px 1px 3px rgba(0,0,0,0.5)",borderRadius:"12px",zIndex:1}),Or.extend(r.__hue_knob.style,{position:"absolute",width:"15px",height:"2px",borderRight:"4px solid #fff",zIndex:1}),Or.extend(r.__saturation_field.style,{width:"100px",height:"100px",border:"1px solid #555",marginRight:"3px",display:"inline-block",cursor:"pointer"}),Or.extend(s.style,{width:"100%",height:"100%",background:"none"}),ua(s,"top","rgba(0,0,0,0)","#000"),Or.extend(r.__hue_field.style,{width:"15px",height:"100px",border:"1px solid #555",cursor:"ns-resize",position:"absolute",top:"3px",right:"3px"}),(i=r.__hue_field).style.background="",i.style.cssText+="background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",i.style.cssText+="background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",i.style.cssText+="background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",Or.extend(r.__input.style,{outline:"none",textAlign:"center",color:"#fff",border:0,fontWeight:"bold",textShadow:r.__input_textShadow+"rgba(0,0,0,0.7)"}),ea.bind(r.__saturation_field,"mousedown",o),ea.bind(r.__saturation_field,"touchstart",o),ea.bind(r.__field_knob,"mousedown",o),ea.bind(r.__field_knob,"touchstart",o),ea.bind(r.__hue_field,"mousedown",l),ea.bind(r.__hue_field,"touchstart",l),r.__saturation_field.appendChild(s),r.__selector.appendChild(r.__field_knob),r.__selector.appendChild(r.__saturation_field),r.__selector.appendChild(r.__hue_field),r.__hue_field.appendChild(r.__hue_knob),r.domElement.appendChild(r.__input),r.domElement.appendChild(r.__selector),r.updateDisplay(),r}return Kr(t,e),Vr(t,[{key:"updateDisplay",value:function(){var e=Nr(this.getValue());if(!1!==e){var t=!1;Or.each(Xr.COMPONENTS,(function(n){if(!Or.isUndefined(e[n])&&!Or.isUndefined(this.__color.__state[n])&&e[n]!==this.__color.__state[n])return t=!0,{}}),this),t&&Or.extend(this.__color.__state,e)}Or.extend(this.__temp.__state,this.__color.__state),this.__temp.a=1;var n=this.__color.v<.5||this.__color.s>.5?255:0,r=255-n;Or.extend(this.__field_knob.style,{marginLeft:100*this.__color.s-7+"px",marginTop:100*(1-this.__color.v)-7+"px",backgroundColor:this.__temp.toHexString(),border:this.__field_knob_border+"rgb("+n+","+n+","+n+")"}),this.__hue_knob.style.marginTop=100*(1-this.__color.h/360)+"px",this.__temp.s=1,this.__temp.v=1,ua(this.__saturation_field,"left","#fff",this.__temp.toHexString()),this.__input.value=this.__color.toString(),Or.extend(this.__input.style,{backgroundColor:this.__color.toHexString(),color:"rgb("+n+","+n+","+n+")",textShadow:this.__input_textShadow+"rgba("+r+","+r+","+r+",.7)"})}}]),t}(Yr),ca=["-moz-","-o-","-webkit-","-ms-",""];function ua(e,t,n,r){e.style.background="",Or.each(ca,(function(a){e.style.cssText+="background: "+a+"linear-gradient("+t+", "+n+" 0%, "+r+" 100%); "}))}var pa='<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n\n </div>\n\n </div>\n\n</div>',ma=function(e,t){var n=e[t];return Or.isArray(arguments[2])||Or.isObject(arguments[2])?new na(e,t,arguments[2]):Or.isNumber(n)?Or.isNumber(arguments[2])&&Or.isNumber(arguments[3])?Or.isNumber(arguments[4])?new la(e,t,arguments[2],arguments[3],arguments[4]):new la(e,t,arguments[2],arguments[3]):Or.isNumber(arguments[4])?new sa(e,t,{min:arguments[2],max:arguments[3],step:arguments[4]}):new sa(e,t,{min:arguments[2],max:arguments[3]}):Or.isString(n)?new ra(e,t):Or.isFunction(n)?new ha(e,t,""):Or.isBoolean(n)?new ta(e,t):null},fa=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},ga=function(){function e(){jr(this,e),this.backgroundElement=document.createElement("div"),Or.extend(this.backgroundElement.style,{backgroundColor:"rgba(0,0,0,0.8)",top:0,left:0,display:"none",zIndex:"1000",opacity:0,WebkitTransition:"opacity 0.2s linear",transition:"opacity 0.2s linear"}),ea.makeFullscreen(this.backgroundElement),this.backgroundElement.style.position="fixed",this.domElement=document.createElement("div"),Or.extend(this.domElement.style,{position:"fixed",display:"none",zIndex:"1001",opacity:0,WebkitTransition:"-webkit-transform 0.2s ease-out, opacity 0.2s linear",transition:"transform 0.2s ease-out, opacity 0.2s linear"}),document.body.appendChild(this.backgroundElement),document.body.appendChild(this.domElement);var t=this;ea.bind(this.backgroundElement,"click",(function(){t.hide()}))}return Vr(e,[{key:"show",value:function(){var e=this;this.backgroundElement.style.display="block",this.domElement.style.display="block",this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)",this.layout(),Or.defer((function(){e.backgroundElement.style.opacity=1,e.domElement.style.opacity=1,e.domElement.style.webkitTransform="scale(1)"}))}},{key:"hide",value:function(){var e=this,t=function t(){e.domElement.style.display="none",e.backgroundElement.style.display="none",ea.unbind(e.domElement,"webkitTransitionEnd",t),ea.unbind(e.domElement,"transitionend",t),ea.unbind(e.domElement,"oTransitionEnd",t)};ea.bind(this.domElement,"webkitTransitionEnd",t),ea.bind(this.domElement,"transitionend",t),ea.bind(this.domElement,"oTransitionEnd",t),this.backgroundElement.style.opacity=0,this.domElement.style.opacity=0,this.domElement.style.webkitTransform="scale(1.1)"}},{key:"layout",value:function(){this.domElement.style.left=window.innerWidth/2-ea.getWidth(this.domElement)/2+"px",this.domElement.style.top=window.innerHeight/2-ea.getHeight(this.domElement)/2+"px"}}]),e}();!function(e,t){var n=document,r=document.createElement("style");r.type="text/css",r.innerHTML=e;var a=n.getElementsByTagName("head")[0];try{a.appendChild(r)}catch(e){}}(function(e){if("undefined"!=typeof window){var t=document.createElement("style");return t.setAttribute("type","text/css"),t.innerHTML=e,document.head.appendChild(t),e}}(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .cr.function .property-name{width:100%}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"));var va=function(){try{return!!window.localStorage}catch(e){return!1}}(),_a=void 0,wa=!0,ba=void 0,ya=!1,xa=[],Sa=function e(t){var n=this,r=t||{};this.domElement=document.createElement("div"),this.__ul=document.createElement("ul"),this.domElement.appendChild(this.__ul),ea.addClass(this.domElement,"dg"),this.__folders={},this.__controllers=[],this.__rememberedObjects=[],this.__rememberedObjectIndecesToControllers=[],this.__listening=[],r=Or.defaults(r,{closeOnTop:!1,autoPlace:!0,width:e.DEFAULT_WIDTH}),r=Or.defaults(r,{resizable:r.autoPlace,hideable:r.autoPlace}),Or.isUndefined(r.load)?r.load={preset:"Default"}:r.preset&&(r.load.preset=r.preset),Or.isUndefined(r.parent)&&r.hideable&&xa.push(this),r.resizable=Or.isUndefined(r.parent)&&r.resizable,r.autoPlace&&Or.isUndefined(r.scrollable)&&(r.scrollable=!0);var a,i=va&&"true"===localStorage.getItem(Ra(0,"isLocal")),s=void 0,o=void 0;if(Object.defineProperties(this,{parent:{get:function(){return r.parent}},scrollable:{get:function(){return r.scrollable}},autoPlace:{get:function(){return r.autoPlace}},closeOnTop:{get:function(){return r.closeOnTop}},preset:{get:function(){return n.parent?n.getRoot().preset:r.load.preset},set:function(e){n.parent?n.getRoot().preset=e:r.load.preset=e,function(e){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].value===e.preset&&(e.__preset_select.selectedIndex=t)}(this),n.revert()}},width:{get:function(){return r.width},set:function(e){r.width=e,Oa(n,e)}},name:{get:function(){return r.name},set:function(e){r.name=e,o&&(o.innerHTML=r.name)}},closed:{get:function(){return r.closed},set:function(t){r.closed=t,r.closed?ea.addClass(n.__ul,e.CLASS_CLOSED):ea.removeClass(n.__ul,e.CLASS_CLOSED),this.onResize(),n.__closeButton&&(n.__closeButton.innerHTML=t?e.TEXT_OPEN:e.TEXT_CLOSED)}},load:{get:function(){return r.load}},useLocalStorage:{get:function(){return i},set:function(e){va&&(i=e,e?ea.bind(window,"unload",s):ea.unbind(window,"unload",s),localStorage.setItem(Ra(0,"isLocal"),e))}}}),Or.isUndefined(r.parent)){if(this.closed=r.closed||!1,ea.addClass(this.domElement,e.CLASS_MAIN),ea.makeSelectable(this.domElement,!1),va&&i){n.useLocalStorage=!0;var l=localStorage.getItem(Ra(0,"gui"));l&&(r.load=JSON.parse(l))}this.__closeButton=document.createElement("div"),this.__closeButton.innerHTML=e.TEXT_CLOSED,ea.addClass(this.__closeButton,e.CLASS_CLOSE_BUTTON),r.closeOnTop?(ea.addClass(this.__closeButton,e.CLASS_CLOSE_TOP),this.domElement.insertBefore(this.__closeButton,this.domElement.childNodes[0])):(ea.addClass(this.__closeButton,e.CLASS_CLOSE_BOTTOM),this.domElement.appendChild(this.__closeButton)),ea.bind(this.__closeButton,"click",(function(){n.closed=!n.closed}))}else{void 0===r.closed&&(r.closed=!0);var h=document.createTextNode(r.name);ea.addClass(h,"controller-name"),o=Ca(n,h),ea.addClass(this.__ul,e.CLASS_CLOSED),ea.addClass(o,"title"),ea.bind(o,"click",(function(e){return e.preventDefault(),n.closed=!n.closed,!1})),r.closed||(this.closed=!1)}r.autoPlace&&(Or.isUndefined(r.parent)&&(wa&&(ba=document.createElement("div"),ea.addClass(ba,"dg"),ea.addClass(ba,e.CLASS_AUTO_PLACE_CONTAINER),document.body.appendChild(ba),wa=!1),ba.appendChild(this.domElement),ea.addClass(this.domElement,e.CLASS_AUTO_PLACE)),this.parent||Oa(n,r.width)),this.__resizeHandler=function(){n.onResizeDebounced()},ea.bind(window,"resize",this.__resizeHandler),ea.bind(this.__ul,"webkitTransitionEnd",this.__resizeHandler),ea.bind(this.__ul,"transitionend",this.__resizeHandler),ea.bind(this.__ul,"oTransitionEnd",this.__resizeHandler),this.onResize(),r.resizable&&Da(this),s=function(){va&&"true"===localStorage.getItem(Ra(0,"isLocal"))&&localStorage.setItem(Ra(0,"gui"),JSON.stringify(n.getSaveObject()))},this.saveToLocalStorageIfPossible=s,r.parent||((a=n.getRoot()).width+=1,Or.defer((function(){a.width-=1})))};function Ca(e,t,n){var r=document.createElement("li");return t&&r.appendChild(t),n?e.__ul.insertBefore(r,n):e.__ul.appendChild(r),e.onResize(),r}function Ma(e){ea.unbind(window,"resize",e.__resizeHandler),e.saveToLocalStorageIfPossible&&ea.unbind(window,"unload",e.saveToLocalStorageIfPossible)}function Ta(e,t){var n=e.__preset_select[e.__preset_select.selectedIndex];n.innerHTML=t?n.value+"*":n.value}function Aa(e,t){var n=e.getRoot(),r=n.__rememberedObjects.indexOf(t.object);if(-1!==r){var a=n.__rememberedObjectIndecesToControllers[r];if(void 0===a&&(a={},n.__rememberedObjectIndecesToControllers[r]=a),a[t.property]=t,n.load&&n.load.remembered){var i=n.load.remembered,s=void 0;if(i[e.preset])s=i[e.preset];else{if(!i.Default)return;s=i.Default}if(s[r]&&void 0!==s[r][t.property]){var o=s[r][t.property];t.initialValue=o,t.setValue(o)}}}}function Pa(e,t,n,r){if(void 0===t[n])throw new Error('Object "'+t+'" has no property "'+n+'"');var a=void 0;if(r.color)a=new da(t,n);else{var i=[t,n].concat(r.factoryArgs);a=ma.apply(e,i)}r.before instanceof Yr&&(r.before=r.before.__li),Aa(e,a),ea.addClass(a.domElement,"c");var s=document.createElement("span");ea.addClass(s,"property-name"),s.innerHTML=a.property;var o=document.createElement("div");o.appendChild(s),o.appendChild(a.domElement);var l=Ca(e,o,r.before);return ea.addClass(l,Sa.CLASS_CONTROLLER_ROW),a instanceof da?ea.addClass(l,"color"):ea.addClass(l,Hr(a.getValue())),function(e,t,n){if(n.__li=t,n.__gui=e,Or.extend(n,{options:function(t){if(arguments.length>1){var r=n.__li.nextElementSibling;return n.remove(),Pa(e,n.object,n.property,{before:r,factoryArgs:[Or.toArray(arguments)]})}if(Or.isArray(t)||Or.isObject(t)){var a=n.__li.nextElementSibling;return n.remove(),Pa(e,n.object,n.property,{before:a,factoryArgs:[t]})}},name:function(e){return n.__li.firstElementChild.firstElementChild.innerHTML=e,n},listen:function(){return n.__gui.listen(n),n},remove:function(){return n.__gui.remove(n),n}}),n instanceof la){var r=new sa(n.object,n.property,{min:n.__min,max:n.__max,step:n.__step});Or.each(["updateDisplay","onChange","onFinishChange","step","min","max"],(function(e){var t=n[e],a=r[e];n[e]=r[e]=function(){var e=Array.prototype.slice.call(arguments);return a.apply(r,e),t.apply(n,e)}})),ea.addClass(t,"has-slider"),n.domElement.insertBefore(r.domElement,n.domElement.firstElementChild)}else if(n instanceof sa){var a=function(t){if(Or.isNumber(n.__min)&&Or.isNumber(n.__max)){var r=n.__li.firstElementChild.firstElementChild.innerHTML,a=n.__gui.__listening.indexOf(n)>-1;n.remove();var i=Pa(e,n.object,n.property,{before:n.__li.nextElementSibling,factoryArgs:[n.__min,n.__max,n.__step]});return i.name(r),a&&i.listen(),i}return t};n.min=Or.compose(a,n.min),n.max=Or.compose(a,n.max)}else n instanceof ta?(ea.bind(t,"click",(function(){ea.fakeEvent(n.__checkbox,"click")})),ea.bind(n.__checkbox,"click",(function(e){e.stopPropagation()}))):n instanceof ha?(ea.bind(t,"click",(function(){ea.fakeEvent(n.__button,"click")})),ea.bind(t,"mouseover",(function(){ea.addClass(n.__button,"hover")})),ea.bind(t,"mouseout",(function(){ea.removeClass(n.__button,"hover")}))):n instanceof da&&(ea.addClass(t,"color"),n.updateDisplay=Or.compose((function(e){return t.style.borderLeftColor=n.__color.toString(),e}),n.updateDisplay),n.updateDisplay());n.setValue=Or.compose((function(t){return e.getRoot().__preset_select&&n.isModified()&&Ta(e.getRoot(),!0),t}),n.setValue)}(e,l,a),e.__controllers.push(a),a}function Ra(e,t){return document.location.href+"."+t}function Ea(e,t,n){var r=document.createElement("option");r.innerHTML=t,r.value=t,e.__preset_select.appendChild(r),n&&(e.__preset_select.selectedIndex=e.__preset_select.length-1)}function Ia(e,t){t.style.display=e.useLocalStorage?"block":"none"}function ka(e){var t=e.__save_row=document.createElement("li");ea.addClass(e.domElement,"has-save"),e.__ul.insertBefore(t,e.__ul.firstChild),ea.addClass(t,"save-row");var n=document.createElement("span");n.innerHTML="&nbsp;",ea.addClass(n,"button gears");var r=document.createElement("span");r.innerHTML="Save",ea.addClass(r,"button"),ea.addClass(r,"save");var a=document.createElement("span");a.innerHTML="New",ea.addClass(a,"button"),ea.addClass(a,"save-as");var i=document.createElement("span");i.innerHTML="Revert",ea.addClass(i,"button"),ea.addClass(i,"revert");var s=e.__preset_select=document.createElement("select");if(e.load&&e.load.remembered?Or.each(e.load.remembered,(function(t,n){Ea(e,n,n===e.preset)})):Ea(e,"Default",!1),ea.bind(s,"change",(function(){for(var t=0;t<e.__preset_select.length;t++)e.__preset_select[t].innerHTML=e.__preset_select[t].value;e.preset=this.value})),t.appendChild(s),t.appendChild(n),t.appendChild(r),t.appendChild(a),t.appendChild(i),va){var o=document.getElementById("dg-local-explain"),l=document.getElementById("dg-local-storage");document.getElementById("dg-save-locally").style.display="block","true"===localStorage.getItem(Ra(0,"isLocal"))&&l.setAttribute("checked","checked"),Ia(e,o),ea.bind(l,"change",(function(){e.useLocalStorage=!e.useLocalStorage,Ia(e,o)}))}var h=document.getElementById("dg-new-constructor");ea.bind(h,"keydown",(function(e){!e.metaKey||67!==e.which&&67!==e.keyCode||_a.hide()})),ea.bind(n,"click",(function(){h.innerHTML=JSON.stringify(e.getSaveObject(),void 0,2),_a.show(),h.focus(),h.select()})),ea.bind(r,"click",(function(){e.save()})),ea.bind(a,"click",(function(){var t=prompt("Enter a new preset name.");t&&e.saveAs(t)})),ea.bind(i,"click",(function(){e.revert()}))}function Da(e){var t=void 0;function n(n){return n.preventDefault(),e.width+=t-n.clientX,e.onResize(),t=n.clientX,!1}function r(){ea.removeClass(e.__closeButton,Sa.CLASS_DRAG),ea.unbind(window,"mousemove",n),ea.unbind(window,"mouseup",r)}function a(a){return a.preventDefault(),t=a.clientX,ea.addClass(e.__closeButton,Sa.CLASS_DRAG),ea.bind(window,"mousemove",n),ea.bind(window,"mouseup",r),!1}e.__resize_handle=document.createElement("div"),Or.extend(e.__resize_handle.style,{width:"6px",marginLeft:"-3px",height:"200px",cursor:"ew-resize",position:"absolute"}),ea.bind(e.__resize_handle,"mousedown",a),ea.bind(e.__closeButton,"mousedown",a),e.domElement.insertBefore(e.__resize_handle,e.domElement.firstElementChild)}function Oa(e,t){e.domElement.style.width=t+"px",e.__save_row&&e.autoPlace&&(e.__save_row.style.width=t+"px"),e.__closeButton&&(e.__closeButton.style.width=t+"px")}function La(e,t){var n={};return Or.each(e.__rememberedObjects,(function(r,a){var i={},s=e.__rememberedObjectIndecesToControllers[a];Or.each(s,(function(e,n){i[n]=t?e.initialValue:e.getValue()})),n[a]=i})),n}Sa.toggleHide=function(){ya=!ya,Or.each(xa,(function(e){e.domElement.style.display=ya?"none":""}))},Sa.CLASS_AUTO_PLACE="a",Sa.CLASS_AUTO_PLACE_CONTAINER="ac",Sa.CLASS_MAIN="main",Sa.CLASS_CONTROLLER_ROW="cr",Sa.CLASS_TOO_TALL="taller-than-window",Sa.CLASS_CLOSED="closed",Sa.CLASS_CLOSE_BUTTON="close-button",Sa.CLASS_CLOSE_TOP="close-top",Sa.CLASS_CLOSE_BOTTOM="close-bottom",Sa.CLASS_DRAG="drag",Sa.DEFAULT_WIDTH=245,Sa.TEXT_CLOSED="Close Controls",Sa.TEXT_OPEN="Open Controls",Sa._keydownHandler=function(e){"text"===document.activeElement.type||72!==e.which&&72!==e.keyCode||Sa.toggleHide()},ea.bind(window,"keydown",Sa._keydownHandler,!1),Or.extend(Sa.prototype,{add:function(e,t){return Pa(this,e,t,{factoryArgs:Array.prototype.slice.call(arguments,2)})},addColor:function(e,t){return Pa(this,e,t,{color:!0})},remove:function(e){this.__ul.removeChild(e.__li),this.__controllers.splice(this.__controllers.indexOf(e),1);var t=this;Or.defer((function(){t.onResize()}))},destroy:function(){if(this.parent)throw new Error("Only the root GUI should be removed with .destroy(). For subfolders, use gui.removeFolder(folder) instead.");this.autoPlace&&ba.removeChild(this.domElement);var e=this;Or.each(this.__folders,(function(t){e.removeFolder(t)})),ea.unbind(window,"keydown",Sa._keydownHandler,!1),Ma(this)},addFolder:function(e){if(void 0!==this.__folders[e])throw new Error('You already have a folder in this GUI by the name "'+e+'"');var t={name:e,parent:this};t.autoPlace=this.autoPlace,this.load&&this.load.folders&&this.load.folders[e]&&(t.closed=this.load.folders[e].closed,t.load=this.load.folders[e]);var n=new Sa(t);this.__folders[e]=n;var r=Ca(this,n.domElement);return ea.addClass(r,"folder"),n},removeFolder:function(e){this.__ul.removeChild(e.domElement.parentElement),delete this.__folders[e.name],this.load&&this.load.folders&&this.load.folders[e.name]&&delete this.load.folders[e.name],Ma(e);var t=this;Or.each(e.__folders,(function(t){e.removeFolder(t)})),Or.defer((function(){t.onResize()}))},open:function(){this.closed=!1},close:function(){this.closed=!0},hide:function(){this.domElement.style.display="none"},show:function(){this.domElement.style.display=""},onResize:function(){var e=this.getRoot();if(e.scrollable){var t=ea.getOffset(e.__ul).top,n=0;Or.each(e.__ul.childNodes,(function(t){e.autoPlace&&t===e.__save_row||(n+=ea.getHeight(t))})),window.innerHeight-t-20<n?(ea.addClass(e.domElement,Sa.CLASS_TOO_TALL),e.__ul.style.height=window.innerHeight-t-20+"px"):(ea.removeClass(e.domElement,Sa.CLASS_TOO_TALL),e.__ul.style.height="auto")}e.__resize_handle&&Or.defer((function(){e.__resize_handle.style.height=e.__ul.offsetHeight+"px"})),e.__closeButton&&(e.__closeButton.style.width=e.width+"px")},onResizeDebounced:Or.debounce((function(){this.onResize()}),50),remember:function(){if(Or.isUndefined(_a)&&((_a=new ga).domElement.innerHTML=pa),this.parent)throw new Error("You can only call remember on a top level GUI.");var e=this;Or.each(Array.prototype.slice.call(arguments),(function(t){0===e.__rememberedObjects.length&&ka(e),-1===e.__rememberedObjects.indexOf(t)&&e.__rememberedObjects.push(t)})),this.autoPlace&&Oa(this,this.width)},getRoot:function(){for(var e=this;e.parent;)e=e.parent;return e},getSaveObject:function(){var e=this.load;return e.closed=this.closed,this.__rememberedObjects.length>0&&(e.preset=this.preset,e.remembered||(e.remembered={}),e.remembered[this.preset]=La(this)),e.folders={},Or.each(this.__folders,(function(t,n){e.folders[n]=t.getSaveObject()})),e},save:function(){this.load.remembered||(this.load.remembered={}),this.load.remembered[this.preset]=La(this),Ta(this,!1),this.saveToLocalStorageIfPossible()},saveAs:function(e){this.load.remembered||(this.load.remembered={},this.load.remembered.Default=La(this,!0)),this.load.remembered[e]=La(this),this.preset=e,Ea(this,e,!0),this.saveToLocalStorageIfPossible()},revert:function(e){Or.each(this.__controllers,(function(t){this.getRoot().load.remembered?Aa(e||this.getRoot(),t):t.setValue(t.initialValue),t.__onFinishChange&&t.__onFinishChange.call(t,t.getValue())}),this),Or.each(this.__folders,(function(e){e.revert(e)})),e||Ta(this.getRoot(),!1)},listen:function(e){var t=0===this.__listening.length;this.__listening.push(e),t&&function e(t){0!==t.length&&fa.call(window,(function(){e(t)})),Or.each(t,(function(e){e.updateDisplay()}))}(this.__listening)},updateDisplay:function(){Or.each(this.__controllers,(function(e){e.updateDisplay()})),Or.each(this.__folders,(function(e){e.updateDisplay()}))}});var Ua=Sa;class Fa{static createMeshPhysicalMaterial(e){return new T(e)}static createMeshStandardMaterial(e){return new H(e)}}e("X",Fa),e("j",(e,t,n,r)=>{if(!e||!t||0===n||0===r)return new s;let a=e.clone(),i=n/2,o=r/2;return a.project(t),a.x=Math.floor(a.x*i+i),a.y=Math.floor(-a.y*o+o),a.z=e.distanceTo(t.position),a});const Na=e("k",(e,t)=>{t||(t=new s(0,0,0));let n=new s(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),r=new s(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),a=new s(0,0,-n.z).add(r).sub(t),i=new s(n.x,n.y,0).add(r).add(t);return new we(a,i)});e("T",(e,t)=>{let n=Sr(e.x),r=Sr(e.y),a=Sr(e.z),i=Sr(t.x),s=Sr(t.y),o=Sr(t.z);return n===i&&r===s&&a===o}),e("a0",(e,t)=>{let n=Sr(e.w),r=Sr(e.x),a=Sr(e.y),i=Sr(e.z),s=Sr(t.w),o=Sr(t.x),l=Sr(t.y),h=Sr(t.z);return n===s&&r===o&&a===l&&i===h}),e("U",(e,t)=>{let n=Sr(e.x),r=Sr(e.y),a=Sr(t.x),i=Sr(t.y);return n===a&&r===i});let Ba=null;const za=()=>{if(Ba)return Ba;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new Pe(e,1,1,Ae);return t.needsUpdate=!0,t},Ha=(e,t,n,r)=>{const a=new Uint8Array(4),i=Math.floor(255*e),s=Math.floor(255*t),o=Math.floor(255*n),l=Math.floor(255*r);for(let e=0;e<4;e++){const t=4*e;a[t]=i,a[t+1]=s,a[t+2]=o,a[t+3]=l}const h=new Pe(a,1,1,Ae);return h.needsUpdate=!0,h},ja=e("Y",e=>Va(null,e)),Va=e("aq",(e,t)=>{e||(e=Ga()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=Re(t.shading.metallic,.5));let n=!1;if(t.shading.transmission&&t.shading.transmission>0?(e.opacity=1-t.shading.transmission,e.transparent=!0,e.depthWrite=!1,e.metalness=0,n=!0):void 0!==t.shading.alpha&&t.shading.alpha<1&&(e.transparent=t.shading.alpha<1,e.opacity=t.shading.alpha,e.depthWrite=t.shading.alpha>=1,e.metalness=.5*Math.max(0,t.shading.alpha),n=!0),e.aoMapIntensity=Re(t.shading.occlusion,1),e.roughness=Re(t.shading.roughness,.5),e.alphaTest=Re(t.shading.alphaCutoff,0),void 0!==t.shading.basecolor){const n=new h(t.shading.basecolor.r,t.shading.basecolor.g,t.shading.basecolor.b);e.color.copy(n.convertSRGBToLinear())}return n||t.shading.doubleSided?e.side=j:e.side=ce,e.map||(Ba||(Ba=za()),e.map=Ba),e}),Ga=()=>Fa.createMeshPhysicalMaterial({});e("ar",e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===j,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n});let Ka=null;const Wa=e("Z",(e,t,n,r,a,i,s=16)=>(Ka||(Ka=new ue,Ka.crossOrigin=""),new Promise((o,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void o();Ka.load(e,e=>{Xa(e,t,n,r,a,i,s),o()},l)}))),Xa=e("as",(e,t,n,r,a,i,s=16)=>{e.anisotropy=r,e.wrapS=F,e.wrapT=F,"ORM"===t.mapping&&s<=8?console.warn("ORM maps are not supported on devices with only "+s+" texture units"):(e.repeat.set(a,i),"XYZ"===t.mapping?(n.normalMap=e,n.map===za()&&(n.map=null)):"ORM"===t.mapping?(n.aoMap=e,n.roughnessMap=e,n.metalnessMap=e):(e.colorSpace=M,n.map=e),"RGBA"===t.mapping&&(n.transparent=!0,n.name.includes("glow")&&(n.emissiveIntensity=.5,n.emissive=new h(16777215),n.emissiveMap=n.map)),n.needsUpdate=!0)}),qa=e("$",(e=!0)=>(window.__RML_GUI__||(window.__RML_GUI__=new Ua({autoPlace:e})),window.__RML_GUI__)),Qa=(e("ah",(e,t)=>{let n=!1;for(const r of t){const t=r.getKernelObject();let a;if(2===t.wallType.value&&(a=Cr(t.rightNormal)),1===t.wallType.value&&(a=Cr(t.leftNormal)),!a)continue;let i=Cr(r.getPlanElement().getCenter());i=i.applyMatrix4(e.matrixWorldInverse),a=a.transformDirection(e.matrixWorldInverse);const s=i.dot(a)>=0;s!==r.getContainer().visible&&(n=!0),s?r.show():r.isSelected||r.hide()}return n}),e("ak",(e,t,n=!0)=>{if(!e.userData.tween)if(t)if(e.transparent=!0,n){let t={opacity:1};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:.2},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.userData.tween=!1}).start()}else e.opacity=.2;else if(n){let t={opacity:.2};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:1},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.transparent=!1,e.userData.tween=!1}).start()}else e.opacity=1,e.transparent=!1}),e("a9",(e,t)=>{e.traverse(e=>{if(e instanceof K&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const r={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(r).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=r.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("ai",e=>{e.traverse(e=>{if(e instanceof K&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},r={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(r,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=r.transparent}).start()}})})),Ya=e("u",e=>{"Mesh"===e.type?Ja(e):Za(e)}),Za=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{Ja(e)})},Ja=e("g",e=>{e&&(e.material&&ei(e.material),e.geometry&&$a(e.geometry),e.children&&e.children.length>0&&Za(e))}),$a=e=>{e&&e.dispose()},ei=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let ti;e("v",e=>0===e.x&&0===e.y&&0===e.z);const ni=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rgb"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null},ri=(e("w",e=>{let t=e.getWorldDirection(new s).clone();t.y=0,t.lengthSq()<.01&&(t=new s(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n}),e("V",(e,t)=>{if(!e||!t)return 0;const n=e.clone().expandByScalar(.001).containsBox(t),r=t.clone().expandByScalar(.001).containsBox(e);return r&&n||!r&&!n?0:!0===n?1:-1}),e("al",(e,t,n,r=1)=>{const a=t>n,i=a?15:0,o=a?0:10,l=e.getSize(new s),h=e.getCenter(new s);let d=l.x>2*i?l.x/2:i,c=l.z>2*o?l.z/2:o;return d*=r,c*=r,new we(new s(h.x-d,h.y,h.z-c),new s(h.x+d,h.y,h.z+c))}),e("ad",e=>{const{x:t,y:n}=e;return{x:t,y:n}})),ai=e=>{const{x:t,y:n,z:r}=e;return{x:t,y:n,z:r}};e("aj",(e,t,n)=>(new s).setFromSphericalCoords(e,Math.PI*(1-n),2*Math.PI*(1-t))),e("s",e=>{const t=new Ee;return t.environment=e.environment.clone(),t.userData.environmentDefinition=e.userData.environmentDefinition.clone(),t.userData.shadowFromEnvironment=e.userData.shadowFromEnvironment,t});const ii=e("e",{CAMERA_2D:"2D",CAMERA_3D:"3D",CAMERA_FP:"FP"});e("a5",e=>{if(!e)return ii.CAMERA_3D;let t=e.toUpperCase();return-1===Object.values(ii).indexOf(t)&&(t=ii.CAMERA_3D),t});var si=e("a8","static/default_256-f1c66a2764f88cc0.exr");class oi{constructor(e){this.autoQuality=!1,this.colors=Ie,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.envMapUrl=si,this.envMapIntensity=1.5,this.envMapRotation=0,this.maxLightSources=-1,this.legacyLight=!1,this.restrictionLevel=0,this.e2e=!1,this.highlighting=ke.SMART,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.featureFlags={pulsePreview:!1,reDock:!1},this.mode=ii.CAMERA_3D,this.edit=!1,this.moc=!1,this.callbacksOnlyIfGeometryIsReady=!0,this._creator_=e}setOverrides(e){De(this,e)}}e("ax",oi);const li=["language","browserLanguage","userLanguage","systemLanguage"];e("aa",/^((?!chrome|android).)*safari/i.test(navigator.userAgent));class hi{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=li.length;e<n;e++){const n=t[li[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){De(this,e)}}e("aw",hi);class di{_setMute(e){Oe(this,"_isMute",!0),this._isMute=e,Oe(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}constructor(e){return this._isMute=!1,this.cameraStartsMoving=()=>{},this._creator_=e,Le(this,"_isMute",{enumerable:!1,writable:!1}),Le(di.prototype,"_setMute",{enumerable:!1,writable:!1}),Le(di.prototype,"mute",{enumerable:!1,writable:!1}),Le(di.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("at",di);class ci extends di{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null),this.onValidateNetworkResponse=(e,t)=>Promise.resolve(!0)}}e("av",ci),e("l",{HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});class ui{get element(){return this._container}constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100; opacity:1;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new i(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}pn([fn],ui.prototype,"_lifeCycleManager",void 0),e("az",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});class pi{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,r){this._scene=e,this._uiScene=n,this._cameraPosition=r;const{bananaForScale:a}=this._initData;a&&await t.import("./banana-for-scale-eb176575.legacy.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}pn([fn],pi.prototype,"_initData",void 0);class mi{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,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const r=e?"allSettled":"all";Promise[r](this._waitingPromises).then(e=>{if("allSettled"===r){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&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}}class fi{constructor(e){this.materialQueue=new mi,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new ue,this._configuratorPreviewMaterial=Fa.createMeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null,polygonOffset:!0,polygonOffsetFactor:-1}),this._creator_=e,this._previewMaterial=Fa.createMeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0})}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,r,a){let i;return e&&this._cacheHolder.geometryCache.has(e)?i=this._cacheHolder.geometryCache.get(e):(i=new c,i.setIndex(new Ue(n,1)),i.setAttribute("position",new Fe(t,3)),i.setAttribute("normal",new Fe(a,3)),i.setAttribute("uv",new Fe(r,2)),i.scale(.001,.001,.001),i.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,i)),i}changeMaterialOfMesh(e,t,n){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),this._updateMaterialProperties(e,n)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_updateMaterialProperties(e,t){var n;if(t&&Object.keys(t).length>0&&e.material instanceof H){const r=e.material.clone();r.userData.materialAttributes=t,t.color&&(r.color=new h(t.color)),t.alpha&&(r.opacity=parseFloat(t.alpha)),t.roughness&&(r.roughness=parseFloat(t.roughness)),t.metallic&&(r.metalness=parseFloat(t.metallic)),r instanceof T&&t.transmission&&(r.transmission=parseFloat(t.transmission)),r.transparent=r.opacity<1;const a=e.material;e.material=r,(null===(n=a.userData)||void 0===n?void 0:n.materialAttributes)&&a.dispose()}}_createMaterial(e,t,n,r,a){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let i=Ne(e),s=ja(i);this._loadBenchmarkTextures(i,s,r,a).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let i=ja(e);this._loadTextures(e,i,r,a).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,r=1){return new Promise((a,i)=>{const s=Be(e.id);Wa(this._dataSyncer.requestAsset(s.image,!0),s,t,this._maxAnisotropy,n/(0===s.mmWidth?1:s.mmWidth),r/(0===s.mmHeight?1:s.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),a()},i)})}_loadTextures(e,t,n=1,r=1){return new Promise((a,i)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),a();this._rapiAccess.getTexturesOf(e).then(s=>{let o=[];s.forEach(e=>{o.push(Wa(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),r/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(o).then(()=>{this._cacheHolder.materialCache.set(e.id,t),a()},i)})})}_loadMaterial(e,t,n){return new Promise((r,a)=>{this._singlePromiseFactory.create(6,e,(r,a)=>this._createMaterial(e,r,a,t,n)).then(()=>{setTimeout(()=>r(this._cacheHolder.materialCache.get(e)),0)},a)})}_assignMaterial(e,t,n){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t),n),Promise.resolve()):new Promise((r,a)=>{this._loadMaterial(t).then(a=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,a,n),r()},a)})}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(n=>{let r,a="rgb"+JSON.stringify(t);this._cacheHolder.materialCache.has(a)?r=this._cacheHolder.materialCache.get(a):(r=Fa.createMeshPhysicalMaterial({color:t}),this._cacheHolder.materialCache.set(a,r)),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,r)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(a=>{if(a.topImage)this._textureLoader.load(a.topImage,r=>{r.anisotropy=this._maxAnisotropy,r.wrapS=F,r.wrapT=F;let s=new i(1,1);a.width>0&&(s.x=1/a.width),a.depth>0&&(s.y=1/a.depth),r.repeat.set(s.x,s.y);const o=Fa.createMeshPhysicalMaterial({map:r,roughness:.5,metalness:.1});this._cacheHolder.materialCache.set(t,o),this.changeMaterialOfMesh(e,o),setTimeout(()=>n(),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}_createMesh(e,t,n){if(e&&t){const r=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(r)){const e=this._geometryComponentMaterialCache.get(r);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new K(n,t)}}}return new K(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}pn([fn],fi.prototype,"_initData",void 0),pn([fn],fi.prototype,"_rapiAccess",void 0),pn([fn],fi.prototype,"_dataSyncer",void 0),pn([fn],fi.prototype,"_singlePromiseFactory",void 0),pn([fn],fi.prototype,"_cacheHolder",void 0),pn([fn],fi.prototype,"_plannerMeshGenerator",void 0);class gi extends fi{constructor(e){super(e)}generateMesh(e=0,t=null,n,r,a,i,s,o=!1,l){let h;h=o?this._generateGeometry(t,r,a,i,s).clone():this._generateGeometry(t,r,a,i,s);const d=this._createMesh(e,t,h);return d.userData.materialId=n,d.layers.set(4),n&&this.materialQueue.push(this._assignMaterial(d,n,l).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),d}setMaterial(e,t,n,r){return this._assignMaterial(e,t,r)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,r){return super._loadTextures(e,t,n,r)}}e("au",gi);class vi{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let r=n.length;for(let e=0;e<r;e++){const r=n[e];t?r.callback.apply(r.scope,[t]):r.callback.call(r.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,r=n.length;e<r;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}e("E",vi);const _i={SCROLL:"scroll",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",DOUBLE_CLICK:"dblclick"};e("ac",{DRAG:50});class wi{constructor(e,t,n,r,a){this.position=e,this.positionRelative=t,this.type=n,this.rotation=r,this.event=a}}const bi=e("a2",5*window.devicePixelRatio),yi=3*window.devicePixelRatio;class xi extends vi{constructor(e){super(),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(_i).map(e=>_i[e]),this._boundingClientRectInvalid=!0,this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}isMouseUp(){return 0===this._state}_dragM(e){let t=e,n=null,r=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),r=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),r=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,r)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1)),null===window||void 0===window||window.addEventListener("scroll",this,!1)}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this)),null===window||void 0===window||window.removeEventListener("scroll",this)}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],r=t.pageX-n.pageX,a=t.pageY-n.pageY,i=Math.abs(r)+Math.abs(a);this._pinchDistance>-1&&(i>this._pinchDistance+yi?(this._setState(3),this.dispatchEvent(7,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):i<this._pinchDistance-yi?(this._setState(3),this.dispatchEvent(8,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):i<=this._pinchDistance+yi&&i>=this._pinchDistance-yi&&(this._setState(5),this.dispatchEvent(11,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=i,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,r){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),(this._delta>bi||this._elementHit)&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new wi(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new wi(e,t)),this.dispatchEvent(6,new wi(e,t,n,null,r))}_longClick(e){2!==e&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new wi(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new wi(this._downPosition,this._downPositionRelative))),this.dispatchEvent(14,new wi(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new wi(e,t,n)),this._getDelta(e)<=bi&&this.dispatchEvent(5,new wi(e,t)),2===this._state&&this.dispatchEvent(2,new wi(e,t)),4===this._state&&(this.dispatchEvent(10,new wi(e,t)),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(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const r=e.touches[1],a=r.clientX,i=r.clientY;t=(t+a)/2,n=(n+i)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._getBoundingClientRect(),{clientWidth:n,clientHeight:r}=this._domHelper.element;if(e.touches.length){const{clientX:a,clientY:i}=e.touches[0];return{x:(a-t.left)/n*2-1,y:-(i-t.top)/r*2+1}}const a=e.changedTouches[0];return{x:(a.clientX-t.left)/n*2-1,y:-(a.clientY-t.top)/r*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._getBoundingClientRect();return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(e.type){case _i.SCROLL:this._boundingClientRectInvalid=!0;break;case _i.MOUSE_MOVE:this._onMouseMove(e);break;case _i.DOUBLE_CLICK:this._onDoubleClick(e);break;case _i.MOUSE_DOWN:this._onMouseDown(e);break;case _i.MOUSE_UP:this._onMouseUp(e);break;case _i.MOUSE_LEAVE:this._onMouseLeave(e);break;case _i.MOUSE_ENTER:this._onMouseEnter(e);break;case _i.MOUSE_WHEEL:this._onMouseWheel(e);break;case _i.TOUCH_MOVE:this._onTouchMove(e);break;case _i.TOUCH_START:this._onTouchStart(e);break;case _i.TOUCH_END:this._onTouchEnd(e);break;case _i.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){if(e.preventDefault(),2===e.detail)return;let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new wi({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),2!==e.detail&&this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onDoubleClick(e){e.preventDefault(),this.dispatchEvent(12,new wi(this._getMousePosition(e),this._getMousePositionRelative(e),1))}_onMouseLeave(e){var t;this._delta=-1,(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[data-rml-sdk="ignore-mouse-leave"]'))||this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new wi(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new wi(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const r=e.touches[0],a=e.touches[1],i=function(e){let t=xr(e);return t<0&&(t=180+(180+t)),t}((t={x:r.pageX,y:r.pageY},n={x:a.pageX,y:a.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=i);const s=i-this._rotationAngle;this._rotationAngle=i,this.dispatchEvent(9,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,yr(s))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new wi({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this,2),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||(this.dispatchEvent(13,new wi(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)),this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2))}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}_getBoundingClientRect(){return this._boundingClientRectInvalid&&(this._boundingClientRect=this._domHelper.element.getBoundingClientRect(),this._boundingClientRectInvalid=!1),this._boundingClientRect}updateSize(){this._boundingClientRectInvalid=!0}}e("ao",xi),pn([fn],xi.prototype,"_domHelper",void 0);class Si{constructor(e){const{component:t,resetCamera:n,consecutive:r}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===r||r}}var Ci=function(e){g(n,e);var t=v(n);function n(e){return _(this,n),t.call(this,e)}return w(n,[{key:"load",value:function(e,t,n,r){var a=this,i=new y(this.manager);i.setPath(this.path),i.setRequestHeader(this.requestHeader),i.setWithCredentials(this.withCredentials),i.load(e,(function(e){var n=a.parse(JSON.parse(e));t&&t(n)}),n,r)}},{key:"parse",value:function(e){return new Mi(e)}}]),n}(x),Mi=function(){function e(t){_(this,e),this.isFont=!0,this.type="Font",this.data=t}return w(e,[{key:"generateShapes",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=[],r=Ti(e,t,this.data),a=0,i=r.length;a<i;a++)n.push.apply(n,ze(r[a].toShapes()));return n}}]),e}();function Ti(e,t,n){for(var r=Array.from(e),a=t/n.resolution,i=(n.boundingBox.yMax-n.boundingBox.yMin+n.underlineThickness)*a,s=[],o=0,l=0,h=0;h<r.length;h++){var d=r[h];if("\n"===d)o=0,l-=i;else{var c=Ai(d,a,o,l,n);o+=c.offsetX,s.push(c.path)}}return s}function Ai(e,t,n,r,a){var i=a.glyphs[e]||a.glyphs["?"];if(i){var s,o,l,h,d,c,u,p,m=new He;if(i.o)for(var f=i._cachedOutline||(i._cachedOutline=i.o.split(" ")),g=0,v=f.length;g<v;)switch(f[g++]){case"m":s=f[g++]*t+n,o=f[g++]*t+r,m.moveTo(s,o);break;case"l":s=f[g++]*t+n,o=f[g++]*t+r,m.lineTo(s,o);break;case"q":l=f[g++]*t+n,h=f[g++]*t+r,d=f[g++]*t+n,c=f[g++]*t+r,m.quadraticCurveTo(d,c,l,h);break;case"b":l=f[g++]*t+n,h=f[g++]*t+r,d=f[g++]*t+n,c=f[g++]*t+r,u=f[g++]*t+n,p=f[g++]*t+r,m.bezierCurveTo(d,c,u,p,l,h)}return{offsetX:i.ha*t,path:m}}console.error('THREE.Font: character "'+e+'" does not exists in font family '+a.familyName+".")}const Pi=new Map,Ri=new Map;class Ei{static loadFont(e){if(Ri.has(e))return new Promise(t=>{t(Ri.get(e))});if(Pi.has(e))return new Promise((t,n)=>{Pi.get(e).push({resolve:t,reject:n})});let t=new Ci;return new Promise((r,a)=>{Pi.set(e,[{resolve:r,reject:a}]),t.load(n()+e,t=>{Ri.set(e,t),Ei._resolveAll(e,t)})})}static _resolveAll(e,t){Pi.has(e)&&Pi.get(e).forEach(e=>e.resolve(t)),Pi.delete(e)}}e("ay",Ei);class Ii{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const n=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),r=n.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,r.length>0),!r||0===r.length||this._camera.position.z<0)return!1;const a=Na(n.boxForMeasurement),i={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-c0100b50.legacy.js").then(t=>{Ei.loadFont("static/rubik_regular-bc008a7de2daee79.json").then(n=>{r.forEach(r=>{var s;e.add(new t.default(((s=r).from=s.from/1e3,s.to=s.to/1e3,1===s.type.value?(s.type={value:2},s.from*=-1,s.to*=-1):2===s.type.value&&(s.type={value:1}),s),a,n,i))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(r=>{t.import("./component-dimensioning-c0100b50.legacy.js").then(t=>{let a=[];e.children.forEach(e=>{e instanceof t.default&&a.push(e)}),a.forEach(t=>{e.remove(t),Ya(t)}),n&&je(this._activeComponents,e),r()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}pn([fn],Ii.prototype,"_plannerKernelAccess",void 0);class ki{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class Di extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new ki,this._topView=!1;const t=Cr(e.getCenter());this._container=new I,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),Qa(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new I,this._container.add(this._object))}getSize(){return this._object?(new we).setFromObject(this._object).getSize(new s):new s}update(){this._container.position.copy(Cr(this.getPlanElement().getMeshCenter())),this._boundingBox&&this._updateBoundingBox()}_updateBoundingBox(){const e=this.getSize();this._boundingBox.geometry=new Ve(e.x,e.y,e.z),this._boundingBox.position.y=e.y/2}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=Na(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new we,e.setFromObject(this._container)),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=ni(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){Ya(this._container),this._selectionMesh&&Ya(this._selectionMesh)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=(ti||(ti=new C,ti.visible=!1),ti))}_generateBoundingBox(){const e=this.getSize(),t=new Ve(e.x,e.y,e.z);let n=new h("#DDDDDD");const r=this.getPlanElement().customColor;r>0&&(n=(e=>{let t=new h;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(r));let a=Fa.createMeshStandardMaterial({color:n,opacity:1,transparent:!0}),i=new K(t,a);return i.name="bounding box",i.position.y=e.y/2,i.castShadow=!1,i.receiveShadow=!1,i.layers.set(6),i}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setTopView(e){this._topView=e}}class Oi extends Di{constructor(e){super(e),this._initDone=!1,this._initFailed=null,this._initWaiter=new ki,this._container.rotation.y=e.rotation}finishInit(){return this._initDone=!0,this._initFailed=null,this._initWaiter.resolve()}failInit(e){return this._initFailed=e,this._initDone=!1,this._initWaiter.reject(this._initFailed)}isInitDone(){return this._initDone?Promise.resolve():this._initFailed?Promise.reject(this._initFailed):this._initWaiter.create()}getPlanObject(){return this.getPlanElement()}getSize(){return Mr(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class Li extends Oi{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}finishConstruction(){return this.finishInit()}failConstruction(){return this.failInit(new Error("Construction of configuration failed"))}}e("c",Li);let Ui=JSON.parse(JSON.stringify({isProduction:!0,isUnitTesting:!1,environment:"production",detailEnvironment:"development",features:{},APP:{RAPI:{server:"/api/v2",localReverseProxy:"https://www.roomle.com/api/v2",liveServer:"https://www.roomle.com/api/v2",testServer:"https://www.test.roomle.com/api/v2",headers:{apiKey:"roomle_portal_v2",currentTenant:9,locale:"en",language:"en",device:1,token:"anonymous",platform:"web"},itemHeaders:{assetRevision:"glb",assetFileFormat:"glb"}},SHORTENER_URL:"http://rml.co/"},environments:{PRODUCTION:"production",DEVELOPMENT:"development",TEST:"test",TEST_SERVER:"test_server",ALPHA:"alpha"}}));Ui.isUnitTesting=!1,void 0!==t&&t.exports||(window.IS_DEBUG=!0);const Fi={ENV_DEBUG:function(e=!1){if(e){let e=JSON.parse(JSON.stringify(Ui));const t={...e.APP,SHORTENER_URL:"http://localhost:4747/?isItem=false&id="},n={...e.features};return{...e,isProduction:!1,APP:t,features:n}}}(),ENV_PRODUCTION:JSON.parse(JSON.stringify(Ui))};var Ni=e("m",Fi.ENV_PRODUCTION);class Bi extends Oi{constructor(e){super(e),this._originalSize=new s,this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}async _addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=Ge(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?Mr(t.size):void 0,r=new s(1,1,1);t.flipX&&(r.x*=-1),t.flipY&&(r.z*=-1);try{const a=await this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,r,t.customColor,e.colorable);this._originalSize.copy(a.boundingBox.getSize(new s)),a.scene.name=e.label,this.setObject(a.scene),((e,t)=>{let n=(new we).setFromObject(e),r=n.getSize(new s),a=Math.min(r.x,r.y,r.z),i=!0;a>5&&(console.warn("GLB seems to be too big ("+a+")",t),i=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),i=!1)})(a.scene,this._glbUrl),Qa(a.scene),this._container.add(this.getObject()),this.hidePreviewBox(),await this.finishInit()}catch(e){await this.failInit(e)}}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}update(){const e=Mr(this.getPlanElement().size),t=this.getObject();if(!t)return;if(e){const{x:n,y:r,z:a}=this._originalSize;let i=new s(e.x/n,e.y/r,e.z/a);t.scale.copy(i)}this.getPlanElement().flipX&&(t.scale.x*=-1),this.getPlanElement().flipY&&(t.scale.z*=-1);const n=this.getPlanElement().customColor;t.traverse(e=>{if(e instanceof K&&e.material instanceof H){const t=e.material;if(this._rapiItem.colorable&&n&&n>0){let e=new h(n);t.color=e.copySRGBToLinear(e)}t.needsUpdate=!0}}),super.update()}}let zi;e("S",Bi),pn([fn],Bi.prototype,"_staticItemLoader",void 0),e("am",e=>{const{id:t,textRotation:n,length:r,lengthFormatted:a}=e;return{id:t,fromWithoutPadding:ai(e.fromWithoutPadding),toWithoutPadding:ai(e.toWithoutPadding),fromPosition3d:ai(e.fromPosition3d),toPosition3d:ai(e.toPosition3d),textPosition3d:ai(e.textPosition3d),fromPosition2d:ri(e.fromPosition2d),toPosition2d:ri(e.toPosition2d),textPosition2d:ri(e.textPosition2d),textDirection:ai(e.textDirection),textRotation:n,length:r,lengthFormatted:a}});const Hi=()=>(zi||(zi=Fa.createMeshPhysicalMaterial({color:0})),zi);class ji extends Di{constructor(e){super(e),this._container.name="Wall Plan Element"}get isSelected(){return this._isSelected}getWallDimension(e){const t=this.getPlanElement(),n=Cr(t.getCenter()),r=t.getPreferredSide();let a,i;0===r.value?(a=Cr(t.getCornerFromLeft()),i=Cr(t.getCornerToLeft())):1===r.value&&(a=Cr(t.getCornerFromRight()),i=Cr(t.getCornerToRight()));const o=a.clone().add(i).divideScalar(2),l=a.clone().sub(i),h=l.clone().cross(new s(0,1,0)).normalize();h.clone().dot(o.clone().sub(n))<0&&h.multiplyScalar(-1);const d={maxZoomedIn:Math.max(.7,e),maxZoomedOut:.01,minPadding:.05,maxPadding:.25},c=Ke(e,d.maxZoomedIn,d.maxZoomedOut,d.minPadding,d.maxPadding),u=h.clone().multiplyScalar(c/2),p=a.clone().add(u),m=i.clone().add(u),f=h.multiplyScalar(c),g=a.add(f),v=i.add(f),_=l.clone();l.dot(new s(1,0,0))<0&&_.multiplyScalar(-1);const w=Math.atan2(_.z,_.x),b=g.clone().add(v).divideScalar(2);return{id:t.getId(),fromPosition3d:g,toPosition3d:v,textPosition3d:b,textDirection:_,textRotation:w,length:t.getLength(r.value),fromWithoutPadding:p,toWithoutPadding:m}}addMesh(e){e.traverse(e=>{this._setMaterial(e)}),e.layers.set(9),super.addMesh(e);const t=(new we).setFromObject(this.getObject()).getSize(new s);this._boundingBox.geometry=new Ve(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}show(){var e,t;this.getContainer().visible=!0,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.set(9)}),null===(t=this.getBoundingBox())||void 0===t||t.layers.set(6)}hide(){var e,t;this.getContainer().visible=!1,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.disableAll()}),null===(t=this.getBoundingBox())||void 0===t||t.layers.disableAll()}_enableTopView(){this._container.traverse(e=>{this._setTopMaterial(e)})}_setTopMaterial(e){e instanceof K&&!e.userData.originalMaterial&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial=e.material,e.material=Hi())}_disableTopView(){this._container.traverse(e=>{e instanceof K&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof K&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new C({color:10526880,side:j}):this._topView&&!this._isSelected?e.material=Hi():(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial))}select(){super.select(),this._container.traverse(e=>{this._setMaterial(e)})}deselect(){super.deselect(),this._container.traverse(e=>{this._setMaterial(e)})}}e("W",ji);class Vi extends Di{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){this.getObject().clear(),super.addMesh(e),e.layers.set(9),e.castShadow=!1,e.position.y=-.001}}e("F",Vi);class Gi extends Di{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new we).setFromObject(this.getObject()).getSize(new s);this._boundingBox.geometry=new Ve(t.x,.01,t.z)}}e("f",Gi);const Ki=new Map;class Wi{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const r=t>0?e+"_"+n+t:e,a=r+"_start";return window.performance.mark(a),r}static addMeta(e,t){const n=Wi.getMeta(e);Ki.set(e,Object.assign(n,t))}static getMeta(e){return Ki.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let r=0,a=t.length;r<a;r++){const a=t[r];e&&-1===a.name.indexOf(e)||n.push({Start:parseFloat(a.startTime.toFixed(2)),Name:a.name,Duration:parseFloat(a.duration.toFixed(2))})}console.table(n)}}e("B",Wi);class Xi{static init(e={}){const{kernelInstance:t,kernelContainer:n,planObjectId:r}=e;Xi.kernelInstance=t,Xi.kernelContainer=n,Xi.planObjectId=r}static cleanUp(){Xi.useHDGeometry=!1,Xi.kernelInstance=null,Xi.kernelContainer=null,Xi.planObjectId=null}}e("A",Xi),Xi.useHDGeometry=!1,Xi.kernelInstance=null,Xi.kernelContainer=null,Xi.planObjectId=null;const qi=new Map,Qi=function(e,t,n){let r=qi.get(e);if(r){const a=n?[n]:void 0;r.forEach(({resolve:e,reject:n})=>t?e.apply(e,a):n.apply(n,a)),qi.delete(e)}};class Yi{static finishOperation(e,t){Qi(e,!0,t)}static failOperation(e,t){Qi(e,!1,t)}static waitFor(e,t){return new Promise((n,r)=>{let a=qi.get(e);a||(qi.set(e,[]),a=qi.get(e)),a.push({resolve:n,reject:r}),"function"==typeof t&&t.apply(t)})}}e("K",Yi);const Zi=e("M",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),Ji=function(e){return e.validValues&&e.validValues.length>0},$i=e("O",(function(e){return"Material"===e.type}));let es,ts,ns,rs,as;const is={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-1c0cd611bc49189a.wasm",LOADER:"static/ConfiguratorKernel-4cae014a679bd075.js"},PLANNER:{URL:"static/RoomleCore-26026cbacf1a880f.wasm",LOADER:"static/RoomleCore-c8f6b8cd39eb2b33.js"}},WASM_MODERN:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-363414f9aa4b38d0.wasm",LOADER:"static/ConfiguratorKernel-5c4fcff0d630e61b.js"},PLANNER:{URL:"static/RoomleCore-d182af273b61509c.wasm",LOADER:"static/RoomleCore-c9e8fbc848d32a0e.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-26999094ff0b84a2.mem",LOADER:"static/ConfiguratorKernelJs-4e89d1179ab69d19.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-b0b9ed4819b6ab9d.mem",LOADER:"static/RoomleCoreJs-e9d8d9c117b8fdb6.js"}}},ss=!!window.WebAssembly;class os{_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}constructor(e){this._requestedItemIds=[],this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=ss,this._kernelPath=ss?ns:rs}_initKernel(){const{restrictionLevel:e}=this._initData,t=!1!==this._initData.callbacksOnlyIfGeometryIsReady;this._kernelInstance.setUpdateCallbacksOnlyIfGeometryIsReady(t),this._kernelInstance.setLevel(e),this._unitFormatter.init(this._kernelContainer),this._kernelInstance.setEnvironmentVariable("unit",this._unitFormatter._actualUnitString||"cm"),this._kernelInstance.setEnvironmentVariable("unitString","short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:r}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",r)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}get configurationExporter(){return this._configurationExporter||(this._configurationExporter=this._kernelContainer.newConfigurationExporter()),this._configurationExporter}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";es=is.ASM[t].MEM_URL,rs=is.ASM[t].LOADER,WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11]))?(ts=is.WASM_MODERN[t].URL,ns=is.WASM_MODERN[t].LOADER):(ts=is.WASM[t].URL,ns=is.WASM[t].LOADER),as=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const r=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(r)?n()+es:t},wasmBinaryFile:n()+ts,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){0!==e&&t._kernelIo.throw(e&&e.toString?e.toString():"Unknown error while C/C++ main executes")}},as&&ss&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,r)=>{const a="function"==typeof WebAssembly.instantiateStreaming;Wi.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let i=null;a?(Wi.start("kernel_stream_compile"),i=WebAssembly.instantiateStreaming(fetch(n()+e),t)):(Wi.start("kernel_legacy_compile"),i=fetch(n()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Wi.addMeta("kernel_is_ready",{instantiateStreaming:a}),i.then(e=>{r(e.instance)},e=>console.error(e))})(ts,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,r=t.get(n);if(r)for(let t=0,a=r.length;t<a;t++){const{parentId:a,partId:i}=r[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(a,i,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,r=t.length;n<r;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:Pr}),Ni.isProduction||Ni.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback)}addDebugInfo(){const e=function(t,n=[]){const r=Object.getPrototypeOf(t),a=r?Object.getOwnPropertyNames(r):[],i=t?Object.getOwnPropertyNames(t):[];return r?e(r,[...n,...i,...a]):[...i,...a,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const r=this.kernelInstance.getPlanObject(e),a=(new Date).toISOString(),i=this.kernelInstance.getComponentId(e),s=hn(i),o=(null===(n=r.boxForMeasurement)||void 0===n?void 0:n.size)||r.bounds;t({created:a,lastAccess:a,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:i,width:o.x,height:o.z,depth:o.y,catalog:s,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(r=>{var a;let i=r.configuration;i||(i="error",null===(a=this._configuratorUiCallbacks)||void 0===a||a.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,i,t,n),this._flushSubComponentsWaiters()},r=>{var a;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(r,t.componentId),null===(a=this._configuratorUiCallbacks)||void 0===a||a.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${r}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let r=this._subComponentsWaiters.get(n);r||this._subComponentsWaiters.set(n,[]),r=this._subComponentsWaiters.get(n),r.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,r)}else this._rapiAccess.getComponent(n).then(r=>{var a;let i=r.configuration;i||(i="error",null===(a=this._configuratorUiCallbacks)||void 0===a||a.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,i)})}async loadItemConfigurations(e,t){let n=Array.isArray(t)?t:[t];if(this._requestedItemIds.push(...n),await We(0),!this._requestedItemIds.length)return;const r=[...this._requestedItemIds];this._requestedItemIds=[],(await this._rapiAccess.getItems(r)).forEach(t=>{this._kernelInstance.loadedItemConfiguration(e,t.id,t.configuration)})}requestDeleteComponent(e){var t,n;e&&((null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)?this._kernelInstance.deletePlanComponent(e):this._kernelInstance.deleteComponent(e))}dockComponentWithPosition(e,t,n,r,a){var i;this._kernelInstance.dockComponentWithPosition(n,r,e,t,a);const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);null===(i=this._configuratorUiCallbacks)||void 0===i||i.onUserInitiatedDockDone(s,r,o,t,a)}Editor3dAddBakedMesh(e,t,n,r,a,i,s,o){this._configuratorKernelCallbackListener.forEach(l=>l.Editor3dAddBakedMesh(e,t,n,r,a,i,s,o))}Editor3dAddNamedMesh(e,t,n,r,a,i,s,o,l,h,d,c){this._configuratorKernelCallbackListener.forEach(u=>u.Editor3dAddNamedMesh(e,t,n,r,a,i,s,o,l,h,d,c))}Editor3ChangedNamedMesh(e,t,n,r,a,i,s){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3ChangedNamedMesh(e,t,n,r,a,i,s))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentCreated(e,t,n,r,!1))}Editor3dComponentDocked(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentDocked(e,t,n,r))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e),this._configuratorUiCallbacks.onGeometryReady(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e)),this._configuratorUiCallbacks.onGeometryNotReady(e)}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,Yi.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const r=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:r,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(t),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e,t=!0){t?this._kernelInstance.requestDeltaPlanComponentConstruction(e):this._kernelInstance.requestPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await We(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const r=await this._rapiAccess.getMaterials(n);let a=[];r.forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&a.push({id:e.id,properties:t})}),a.length&&this._kernelInstance.setMaterialProperties(a)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var r;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(r=this._configuratorUiCallbacks)||void 0===r||r.onMemoryCorruption()}}_handleInvalidMesh(e){try{this._kernelInstance.setExternalMeshInvalid(e)}catch(e){console.error(e)}}calcPartsPriceSum(e){return this._calcPrice(e)}_calcPrice(e){const t=new Map;e||(e=this._kernelInstance.getFullPartList());const n=!!e&&!!e.fullList&&!!e.fullList.length;if(this._initData.useRoomlePrice&&n){const n=e.fullList[0].currencySymbol,r=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0),a=qe(r,2);return this._configuratorUiCallbacks.onUpdatePrice(n,a),Promise.resolve({totalSum:a,partMap:t})}if(this._initData.usePriceService&&n){const n=e.fullList.reduce((e,n)=>{const r=dn(n);return r&&(t.set(r,n),e.push(r)),e},[]);return new Promise((r,a)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return a(new Error("prices are empty"));let i=0;const s=Xe(n,"priceId");for(const t of e.fullList){const e=dn(t);if(!s.has(e)){console.warn("PriceId: "+e+" has no corresponding kernel-part");continue}const{price:n,currencySymbol:r}=s.get(e);t.price=n,t.currencySymbol=r,i+=n*t.count}return i=qe(i,2),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,i),r({totalSum:i,partMap:t})},e=>{console.error(e),a(e)})})}return Promise.resolve({totalSum:0,partMap:t})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:r}=e,a=e.perMainComponent;let i;this.addUiDataToPartList(n,t);try{const t=await this._calcPrice(e);i=t.partMap}catch(e){console.error(e),i=new Map}const s=this._initData.usePriceService||this._initData.useRoomlePrice,o=e=>{s||(e.price=null,e.currencySymbol=null);const t=dn(e);if(!t)return;if(!i.has(t))return;const{price:n,currencySymbol:r}=i.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=r)};return n.forEach(o),a.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(o)}),{fullList:n,perMainComponent:a,originPart:r}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),$i(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const r=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(r,btoa(e))}}pn([fn],os.prototype,"_rapiAccess",void 0),pn([fn],os.prototype,"_scriptLoader",void 0),pn([fn],os.prototype,"_kernelIo",void 0),pn([fn],os.prototype,"_dataSyncer",void 0),pn([fn],os.prototype,"_lifeCycleManager",void 0),pn([fn],os.prototype,"_configuratorUiCallbacks",void 0),pn([fn],os.prototype,"_globalCallback",void 0),pn([fn],os.prototype,"_initData",void 0),pn([fn],os.prototype,"_unitFormatter",void 0),pn([fn],os.prototype,"_configuratorContext",void 0),pn([fn],os.prototype,"_globalInitData",void 0);const{APP:ls}=Ni,{RAPI:hs}=ls,ds=hs.headers,cs=hs.itemHeaders,us=ds.token,ps=e("an",e=>e.startsWith("ps_")),ms=Qe();let fs=new Map,gs=new Map,vs=new Map,_s=new Map,ws=new Map,bs=new Map,ys=new Map,xs=new Map,Ss=new Map;const Cs=e=>fs.get(e)||fs.get(ms+e),Ms=e=>e&&e.tags&&e.tags.length,Ts=e=>!Ms(e)&&e.group;class As{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,r)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(hn(e)))return n();if(ys.get(e))return n();const a=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+a+e,"preloads/components").then(t=>{if(ys.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),ys.set(e,!0),n()},r)})}changeUseOfHDGeometry(){const e=_s.get("components");ys.clear(),bs.clear(),e&&_s.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(bs.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(bs.get(e))return t(n);n.components.forEach(e=>{this._prepareData(e,"components")}),n.materials.forEach(e=>{this._prepareData(e,"materials"),this._prepareGroups(e)}),n.textures.forEach(e=>{this._prepareData(e,"textures")}),bs.set(e,!0),t(n)},n)})}getComponent(e){return this._getById(e,"components")}getConfiguration(e){return this._getById(e,"configurations")}getConfigurations(e){return this._getByIds(e,"configurations")}getItem(e){return this._getById(e,"items",{additionalHeaders:cs})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:cs})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const r=ws.get(e);r?t(r):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{ws.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const r=gs.get(e.id.toString());r?n.push(...r):t.push(e.id.toString())}),new Promise((e,r)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=gs.get(e.itemId);t||(t=[]);for(let n=0,r=t.length;n<r;n++)if(t[n].id===e.id)return;t.push(e),gs.set(e.itemId,t)}),e([...t,...n])},r):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}getPlanSnapshot(e){return this._getById(e,"planSnapshots")}static clearCaches(){fs=new Map,vs=new Map,_s=new Map,bs=new Map,ys=new Map,xs=new Map,gs=new Map}cleanUp(){As.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let r=t.length;for(let e=0;e<r;e++){const a=Cs(t[e]);if(a){const i=a.length;for(let e=0;e<i;e++){const t=this._getCache("materials").get(a[e]);n.push(t)}t.splice(e,1),r--,e--}}return new Promise((e,r)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},r):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),r=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];r.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(r=>{const a=[];t.perspectiveImage&&!r.perspectiveImage&&a.push(this.savePerspectiveImage(r,t.perspectiveImage)),t.topImage&&!r.topImage&&a.push(this.savePerspectiveImage(r,t.topImage)),Promise.all(a).then(e,n)},n)}))}Promise.all(r).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:r,topImage:a}=t;let i=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},s=i[n]||{};s.data=e,s.perspectiveImage=r,s.topImage=a,i[n]=s,this._localStorage.setItem("hsc_configurations_offline_queue_v1",i)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}savePlanSnapshotTopImage(e,t){return this._savePlanSnapshotImage(e,t,"topImage")}savePlanSnapshotPerspectiveImage(e,t){return this._savePlanSnapshotImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,r)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:r,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=_s.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const r={};return r[n]=t,this._setQueuedConfiguration(e,r),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const r=this._formDataUtil.create(t.image,e.configurationHash,rn.PNG,n);return this._save("/configurations/"+e.id+"/"+n,r,"configurations",{accept:"application/json"})}_savePlanSnapshotImage(e,t,n){const r=this._formDataUtil.create(t.image,e.id,rn.PNG,"file");return r.append("type",n),this._save("/planSnapshots/"+e.id,r,"planSnapshots",{accept:"application/json",method:"PUT"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,r={}){const a=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,i)=>{const s={method:r.method||"POST",data:a,resolve:t,reject:i};r.contentType&&(s.contentType=r.contentType),r.accept&&(s.accept=r.accept),this._fetchJson(e,n,s)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const r=new Map,a={id:null,label:null,materials:[]},i=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],s=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&s.push({isTag:!1,id:ms+n.group,legacyId:n.group}),s.length||s.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===i.indexOf(e)?i.push(e):null),s.forEach(({isTag:e,id:t,legacyId:i})=>{const s=n.id;let o=t?Cs(t):[];o||(fs.set(t,[]),o=Cs(t)),-1===o.indexOf(s.toString())&&o.push(s.toString());const l=Ms(n),h=l&&e,d=Ts(n);if(h||d&&!e||!l&&!d&&!t){let e=t?r.get(t):a;e||(r.set(t,{id:t,label:n.groupLabel,legacyId:i,materials:[]}),e=r.get(t)),e.materials.push(n)}})}const s=a.materials.length?[a]:[];this.getTags(i).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return r.forEach((e,t)=>{s.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(s)},n)})}_getByIds(e,t,n={}){const r=this._getCache(t),a=this._getErrorCache(t),i=[],s=[...new Set(e)];let o=s.length;if(r&&r.size){const e=(new Date).getTime();for(let t=0;t<o;t++){const n=s[t],l=r.get(n),h=a.get(n);let d=!1;null!=l?(i.push(l),d=!0):d=void 0!==h&&(e-h.timestamp<6e4||!1===navigator.onLine),d&&(s.splice(t,1),o--,t--)}}return new Promise((e,r)=>{0!==s.length&&navigator.onLine?this._getByIdsPackets(s,t,n).then(t=>{e([...t,...i])},r):e(i)})}_getByIdsPackets(e,t,n={}){const r=n.filterKey||"ids";let a,i="/"+t+"/",s="?",o=[];const l=e.length;if(!l)return new Promise(e=>e([]));let h=!0,d=[];for(a=0;a<l;a++){h=!1;const n=e[a],l=s+r+"[]="+n,c=l.length+i.length;d.push(n),s="&",c<=1500?i+=l:(c>1500&&(d.pop(),a--),o.push({url:i,ids:d}),h=!0,i="/"+t+"/",s="?",d=[])}h||o.push({url:i,ids:d});const c=[];return o.forEach(e=>c.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(c).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,r={}){return new Promise((a,i)=>{this._get(t,n,r).then(t=>{for(let n=0,a=t.length;n<a;n++){const a=r&&r.cacheKey?t[n][r.cacheKey]:t[n].id,i=e.indexOf(a.toString());-1!==i&&e.splice(i,1)}const i=e.length;if(i){const t=this._getCache(n),r=this._getErrorCache(n),a=(new Date).getTime();for(let n=0;n<i;n++)r.set(e[n],{code:0,timestamp:a}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}a(t)},i)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const r=this._getCache(t).get(e);if(r)return new Promise(e=>e(r));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const a={...n,id:e},i=n.pathSuffix||"";return this._get("/"+t+"/"+e+i,t,a)}_get(e,t,n={}){const r=Xi.useHDGeometry?"includeGeometryHD=true":"";let a=-1===e.indexOf("?")?"?":"&";return""!==r&&(e+=a+r),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=a+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",a="&"}),new Promise((r,a)=>{const i=xs.get(e);Array.isArray(i)&&i.length>0?i.push({resolve:r,reject:a}):(xs.set(e,[{resolve:r,reject:a}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(Ye.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let r=hs.server;const a=this._globalInitData.overrideRapi;a&&(r="live"===a?hs.liveServer:hs.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(r=this._globalInitData.customApiUrl);const i=new Request(r+e,n);this._globalCallback.onNetworkRequest(e,n,t);const s=await this._globalCallback.onCheckExternalCache(e,n);return s?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(s)}:this._networkLayer.fetch(i,{},{checkResponse:e=>this._globalCallback.onValidateNetworkResponse("rapi-access",e)})}_createHeaders(e={}){const t={...ds};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:r,accept:a,additionalHeaders:i,data:s}=e;if(r&&(t["content-type"]=e.contentType),a&&(t.accept=e.accept),i)for(let e in i)i.hasOwnProperty(e)&&(t[e]=i[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const o=this._currentToken||us;t.token="03-"+window.btoa((new Date).toISOString()+";"+o+";"+ds.apiKey);const l=new Headers(t);return s instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return r=>{let a=null,i=null;"number"==typeof r&&(a=r);for(let e in r)"meta"!==e&&r.hasOwnProperty(e)&&(a=r[e],i=e);if("error"===i)return this._handleError(e,n)(new Error(JSON.stringify(a)));if(!a)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(a))for(let e=0,r=a.length;e<r;e++)this._prepareData(a[e],t,n),this._prepareEmbeddedData(a[e],t,n);else this._prepareData(a,t,n),this._prepareEmbeddedData(a,t,n);n.resolve?n.resolve(a):this._notifyWaiters(e,null,a)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(r=>{const a=e[r.slice(0,-1)+"Objects"];if(Array.isArray(a)){for(let e=0,t=a.length;e<t;e++)this._prepareData(a[e],r,n);this._prepareRelationalData(t,r,e.id,a)}else a&&(this._prepareData(a,r,n),this._prepareRelationalData(t,r,e.id,[a]))})}_getCache(e){return this._getCacheFrom(e,_s)}_getErrorCache(e){return this._getCacheFrom(e,Ss)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let r=this._getCache(t);const a=n&&n.cacheKey?e[n.cacheKey]:e.id;if(a||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=a||n.id;this._setCache(t,e,r)}e.__rapi_path__=t}else this._setCache("0",e,r);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let r=vs.get(t);if(!r){const a=new Map,i=new Map;i.set(n,void 0),a.set(e,i),vs.set(t,a),r=vs.get(t)}let a=r.get(e);if(!a){const t=new Map;t.set(n,void 0),r.set(e,t),a=r.get(e)}return a.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let r=Cs(t);r||(fs.set(t,[]),r=Cs(t)),-1===r.indexOf(n.toString())&&r.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const r=e.id;if(!r)return Promise.resolve([]);const a=e.__rapi_path__,i=t.rapiPath;let s=this._getCache(i),o=this._getRelationsCacheFor(r.toString(),a,i),l=[];return o?(o.forEach(e=>l.push(s.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+a+"/"+r+"/"+i,i,n).then(t=>{this._prepareRelationalData(a,i,r,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,r){vs.has(e)||vs.set(e,new Map);let a=vs.get(e);const i=n.toString();a.has(i)||a.set(i,new Map);let s=a.get(i),o=this._getCache(t),l=[];for(let e=0,t=r.length;e<t;e++){const t=r[e],n=t.id.toString();l.push(n),o.set(n,t)}s.set(t,l)}_notifyWaiters(e,t,n){const r=xs.get(e);if(r&&r.length){for(let e=0,a=r.length;e<a;e++)t?r[e].reject(t):r[e].resolve(n);xs.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),r=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(r)return e(r);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}_share(e,t,n,r){const a="/"+r+"/"+e+"/shares",i=new FormData;return i.append("email",t),i.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:i,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(a,n).then(n.resolve,n.reject)})}shareConfiguration(e,t,n){return this._share(e,t,n,"configurations")}sharePlanSnapshot(e,t,n){return this._share(e,t,n,"planSnapshots")}export3D(e,t,n,r={}){const a="/"+(ps(e)?"planSnapshots":"configurations")+"/"+e+"/3d-exports",i={formats:[{file_format:n,pack_external_data:!0,...r}]},s=JSON.stringify(i),o=new FormData;return o.append("email",t),o.append("settings",s),new Promise((e,t)=>{const n={method:"POST",data:o,resolve:e,reject:t};this._fetch(a,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:r}=new URL(n);return r})())&&(ln.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,r={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(r),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,r)=>{const a={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:r};this._fetchJson("/auth/signin","auth",a)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}async savePlanSnapshot(e){return this._save("/planSnapshots",{planSnapshot:e},"planSnapshots",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}e("R",As),pn([fn],As.prototype,"_formDataUtil",void 0),pn([fn],As.prototype,"_errorHandler",void 0),pn([fn],As.prototype,"_dataSyncer",void 0),pn([fn],As.prototype,"_networkLayer",void 0),pn([fn],As.prototype,"_localStorage",void 0),pn([fn],As.prototype,"_globalInitData",void 0),pn([fn],As.prototype,"_globalCallback",void 0);const Ps=e("o",1500),Rs=e("n",5);function Es(){class e extends I{static _generateOutline(e,t){let n=new W(new Je(e),new $e({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new W(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new s),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,r){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),r&&(this.parentObjectId=r)}constructor(e,t,n,r){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,r)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new K(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(Er(t)),this.add(e),this.meshes.push(e)}getMeshById(e){return this.meshes.find(t=>t.userData.meshId===e)}removeMeshById(e){const t=this.getMeshById(e);t?this.removeMesh(t):console.warn("Could not remove mesh with id "+e,this.runtimeId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),Ja(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&Ja(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),Ja(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.runtimeId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new s);let r=new Ve(e,t,n);this._loadingMesh=new K(r,Fa.createMeshStandardMaterial({transparent:!0,opacity:1,color:new h("#DDDDDD")})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new s),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),Ja(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){Ze("pointer")}hoverOff(){Ze("default")}removeFromParent(){return this.parent&&(this.parent.remove(this),this.removeAllMeshes()),this}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let r;if(!t||n){this._boundingBox=new we;let e=new s;this.meshes.forEach(t=>{if(t.geometry instanceof c){let n=t.geometry.attributes.position;if(void 0!==n)for(let r=0,a=n.count;r<a;r++)e.fromBufferAttribute(n,r).applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,a=this._boundingBox.max.z-this._boundingBox.min.z;r=new Ve(t,n,a)}else{this._kernelBoundingBox=Na(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:a}=this._boundingBox.getSize(new s);r=new Ve(e,n,a)}this._boundingBoxMesh=new K(r,Fa.createMeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let a=this._boundingBox.getCenter(new s);this._boundingBoxMesh.position.add(a),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(r,a),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(r=>{r instanceof e&&!n&&(n=r.runtimeId===t||r.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return Tr(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,r,a){super(t,n,r,a),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1,this._creator_=e}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof H&&(e.material.opacity=.8,e.material.roughness=1,e.material.metalness=0,e.material.color=new h(this._initData.colors.PREVIEW_DOCKING_COLOR)),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}startPulsating(){var e,t;if(null===(t=null===(e=this._initData)||void 0===e?void 0:e.featureFlags)||void 0===t?void 0:t.pulsePreview)for(const e of this.meshes){const t={opacity:.8},n={opacity:.3};new TWEEN.Tween(t).to(n,Ps).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.material.opacity=t.opacity}).yoyo(!0).repeat(Rs).start()}}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new h(this._initData.colors.PREVIEW_DOCKING_COLOR)}),Ze("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.8,e.roughness=1,e.metalness=0,e.color=new h(this._initData.colors.PREVIEW_DOCKING_COLOR)}),Ze("default")}clonePreview(t){const r=new n(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return r._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof K&&0===e.userData.meshType&&r.meshes.push(e.clone(!0))}),r.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),r.add(e)}),this._dockline&&(r._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(r._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(r._boundingBox=this._boundingBox.clone()),r}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}pn([fn],n.prototype,"_initData",void 0);class r extends n{constructor(e,t,n,r,a,i){super(e,t,n,r,a),i&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=Cr(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=Cr(e);t.equals(this.lineFrom)&&(console.warn("lineFrom and lineTo are equal!"),t.add(new s(0,.01,0))),this.lineTo=t}get roomleLineTo(){return this._roomleLineTo}set roomlePositionFrom(e){this._roomlePositionFrom=e,this.positionFrom=Cr(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=Cr(e);t.equals(this.positionFrom)&&(console.warn("positionFrom and positionTo are equal!"),t.add(new s(0,.01,0))),this.positionTo=t}get roomlePositionTo(){return this._roomlePositionTo}addMesh(e,t){super.addMesh(e,t),e.visible=!1,e.renderOrder=3}hoverOn(){this._dockline.visible=!0,Ze("pointer")}hoverOff(){this._dockline.visible=!1,Ze("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new s).subVectors(e,t);let r=n.length(),a=n.normalize(),i=new et(a,t),o=new tt(.01,.01,r,16,1);this.lineMesh=new K(o,Fa.createMeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const l=(new R).setFromEuler(i.rotation);this.lineMesh.quaternion.multiply(l),this.lineMesh.renderOrder=1;let h=(new s).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new s).subVectors(h,this.position.clone())),this.add(this.lineMesh);let d=this._boundingBox.getCenter(new s).applyEuler(this.docklineRotation),c=null,u=0,p=Math.abs(a.x),m=Math.abs(a.y),f=Math.abs(a.z);p>=m&&p>=f?(c=new s(d.x,0,0),u=Math.sqrt(d.y*d.y+d.z*d.z)):m>=p&&m>=f?(c=new s(0,d.y,0),u=Math.sqrt(d.x*d.x+d.z*d.z)):f>=m&&f>=p&&(c=new s(0,0,d.z),u=Math.sqrt(d.y*d.y+d.x*d.x)),u=u>0?u:.01;let g=(new s).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+c.length(),v=new tt(1.1*u,1.1*u,g,32,1);this.boundingLineMesh=new K(v,Fa.createMeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0,this.boundingLineMesh.layers.set(5);let _=this.positionTo.clone(),w=this.positionFrom.clone(),b=(new s).subVectors(_,w).normalize(),y=new et(b,w);const x=(new R).setFromEuler(y.rotation);this.boundingLineMesh.quaternion.multiply(x),this.boundingLineMesh.renderOrder=3;let S=(new s).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(d);this.boundingLineMesh.position.copy((new s).subVectors(S,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new r(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof K&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new s).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),r=this.positionFrom.clone().add(t),a=new nt(r,n).closestPointToPoint(e,!0,new s);return(isNaN(a.x)||isNaN(a.y)||isNaN(a.z))&&a.copy(e),a.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let r=this._boundingBox.getCenter(new s).applyEuler(this.docklineRotation);this._dockline.position.copy((new s).addVectors(this._newPosition,r)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return Tr(e.worldToLocal(t))}return super.getKernelPosition(e)}}class a extends ${constructor(e,t,n,r,a,i,s){super(e,t,n,r,a,i),s||(s={left:0,top:1,right:1,bottom:0}),this.offset=s}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}resetOffset(){this._offset={left:0,top:1,right:1,bottom:0}}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}_calculateProjectionMatrix(){const e=this._calculate2DPlanes();if(this._offset.left>=this._offset.right||this._offset.bottom>this._offset.top)return(new P).makeOrthographic(e.left,e.right,e.top,e.bottom,this.near,this.far);const t=this._scaleRange(e.left,e.right,this._offset.left,this._offset.right);let n=t.from,r=t.to;const a=this._scaleRange(e.bottom,e.top,this._offset.bottom,this._offset.top);let i=a.from,s=a.to;const o=(e.right-e.left)/(e.top-e.bottom),l=(r-n)/(s-i);if(l>o){const e=(i+s)/2,t=(s-i)*l/o;i=e-t/2,s=e+t/2}else{const e=(n+r)/2,t=(r-n)*o/l;n=e-t/2,r=e+t/2}return(new P).makeOrthographic(n,r,s,i,this.near,this.far)}_scaleRange(e,t,n,r){const a=(t-e)/(r-n);return{from:e-a*n,to:t+a*(1-r)}}_calculate2DPlanes(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,r=(this.top+this.bottom)/2;let a=n-e,i=n+e,s=r+t,o=r-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=e*this.view.offsetX,i=a+e*this.view.width,s-=t*this.view.offsetY,o=s-t*this.view.height}return{left:a,right:i,top:s,bottom:o}}}class o extends Z{constructor(e,t,n,r,a){super(e,t,n,r),a||(a={left:0,top:1,right:1,bottom:0}),this.offset=a}copy(e,t){return super.copy(e,t),this._offset=e._offset,this}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}resetOffset(){this._offset={left:0,top:1,right:1,bottom:0}}_calculateProjectionMatrix(){let e,t,n,r,a=this.fov*(2*Math.PI/360)/2;n=Math.tan(a),r=-n;let s=Math.atan(this.aspect*Math.tan(a));t=Math.tan(s),e=-t;let o=this._offset.left,l=this._offset.right,h=this._offset.top,d=this._offset.bottom,c=new i(l-o,h-d),u=new i(o+c.x/2,d+c.y/2);if(c.x<c.y){let a=(1-u.x)/(c.x/2),i=u.x/(c.x/2);t*=a,e*=i;let s=(a+i)/2;n*=s,r*=s}else{let a=(1-u.y)/(c.y/2),i=u.y/(c.y/2);n*=a,r*=i;let s=(i+a)/2;e*=s,t*=s}e*=this.near,t*=this.near,n*=this.near,r*=this.near;let p=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,m=this.aspect*p;return this.view&&this.view.enabled&&(e+=this.view.offsetX*m/this.view.fullWidth,n-=this.view.offsetY*p/this.view.fullHeight,t+=this.view.offsetX*m/this.view.fullWidth,r-=this.view.offsetY*p/this.view.fullHeight),(new P).makePerspective(e,t,n,r,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,r,a){return new e(t,n,r,a)},createPreview:function(e,t,r){return new n(r,e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e,t){let n=new r(t,e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let t=e.clone();t.material=e.material.clone(),t.geometry=e.geometry.clone(),n.addMesh(t)}),n.computeBoundingBox(),n},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof r},createPerspectiveCamera:function(e,t,n,r,a){return new o(e,t,n,r,a)},createOrthographicCamera:function(e,t,n,r,i,s,o){return new a(e,t,n,r,i,s,o)}}}const Is=e("G",9);class ks{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Ds,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=Es()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return xh.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,r,a){if(n){const r=e.userData.transform=Er(n);t&&(e.userData.transform=r),e.applyMatrix4(r)}this._applyMeshUVTransform(e,t,r,a)}_applyMeshUVTransform(e,t,n,r){if(6!==(null==n?void 0:n.length)||(e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5])(n))t&&(t.uvTransform=void 0),r&&(e.geometry=r);else{const a=(e=>{const t=new P;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(n);t&&(t.uvTransform=a);const i=null!=r?r:e.geometry;if(i&&i.attributes.uv){const t=i.clone();t.attributes.uv.applyMatrix4(a),e.geometry=t}}}_addMeshToSubPart(e,t,n,r,a,i,s,o,l,h){const d=this._generateMesh(e,t,n,i,s,o,l,void 0,void 0,h);this._applyMeshTransform(d,null,r,a),this._subPartObject.add(d)}_addMeshToComponent(e,t,n,r,a,i,s,o,l,h,d,c){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,r,null,null,s,o,l,h,c);const u=this.getComponent(e);if(!u)return;const p=this._componentFactory.isPreview(u),m=this._generateMesh(e,n,p?null:r,s,o,l,h,void 0,void 0,c);m.userData.meshId=t,m.userData.geometryId=n,m.userData.materialId=r,this._applyMeshTransform(m,m.userData,a,i),p&&m.layers.set(5),u&&u.addMesh(m),u.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,u.meshes.length)}_changeMeshOfComponent(e,t,n,r,a,i,s){const o=this.getComponent(e);if(!o)return;const l=o.getMeshById(t);if(l){l.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),l.userData.materialId=r,l.userData.materialAttributes=s;const e=l.material.clone();this._configuratorMeshGenerator.setMaterial(l,r,void 0,s).then(()=>{this._requestRenderSceneUpdateCallback&&this._requestRenderSceneUpdateCallback()}),e.opacity!==l.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),a&&(l.position.set(0,0,0),l.scale.set(1,1,1),l.rotation.set(0,0,0));const t=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(l,l.userData,a,i,t)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],r=[];t.meshes.forEach(t=>{const a=t.userData.materialId;if(!a)return void console.warn("mesh has no material id set");if(!e.has(a)){const r=new K(new c,t.material);r.userData.materialId=a,r.receiveShadow=!0,r.castShadow=!0,r.layers.set(3),this._setMaterial(r,a),n.push(r),e.set(a,r)}const i=e.get(a),s=i.geometry;t.userData.transform&&t.geometry.applyMatrix4(t.userData.transform),i.geometry=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=null!==e[0].index,r=new Set(Object.keys(e[0].attributes)),a=new Set(Object.keys(e[0].morphAttributes)),i={},s={},o=e[0].morphTargetsRelative,l=new c,h=0,d=0;d<e.length;++d){var u=e[d],p=0;if(n!==(null!==u.index))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(var m in u.attributes){if(!r.has(m))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;void 0===i[m]&&(i[m]=[]),i[m].push(u.attributes[m]),p++}if(p!==r.size)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". Make sure all geometries have the same number of attributes."),null;if(o!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(var f in u.morphAttributes){if(!a.has(f))return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". .morphAttributes must be consistent throughout all geometries."),null;void 0===s[f]&&(s[f]=[]),s[f].push(u.morphAttributes[f])}if(t){var g=void 0;if(n)g=u.index.count;else{if(void 0===u.attributes.position)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index "+d+". The geometry must have either an index or a position attribute"),null;g=u.attributes.position.count}l.addGroup(h,g,d),h+=g}}if(n){for(var v=0,_=[],w=0;w<e.length;++w){for(var b=e[w].index,y=0;y<b.count;++y)_.push(b.getX(y)+v);v+=e[w].attributes.position.count}l.setIndex(_)}for(var x in i){var S=Cn(i[x]);if(!S)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+x+" attribute."),null;l.setAttribute(x,S)}for(var C in s){var M=s[C][0].length;if(0===M)break;l.morphAttributes=l.morphAttributes||{},l.morphAttributes[C]=[];for(var T=0;T<M;++T){for(var A=[],P=0;P<s[C].length;++P)A.push(s[C][P][T]);var R=Cn(A);if(!R)return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the "+C+" morphAttribute."),null;l.morphAttributes[C].push(R)}}return l}([s,t.geometry]),r.push(t)}),n.forEach(e=>t.addMesh(e)),r.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,r){let a=this._components.get(t),i=this._components.get(e);i&&(i.roomlePosition=n,i.roomleRotation=r,a&&a.add(i))}dockComponentWithPosition(e,t){let n,r=this._components.get(e.parentId);n=t?t.getKernelPosition(r):e.getKernelPosition(r),Wi.start("dock_component_with_position_"+e.childId),this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,r,a,i,s,o){this._addMeshToComponent(e,null,null,t,null,null,n,r,a,i,s,o)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e,this._creator_);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,r,a,i,s,o,l,h,d,c){this._addMeshToComponent(e,t,n,r,a,d,i,s,o,l,h,c)}Editor3ChangedNamedMesh(e,t,n,r,a,i,s){this._changeMeshOfComponent(e,t,n,r,a,i,s)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new I)}Editor3dComponentCreated(e,t,n,r,a){a&&(this._configuratorContext.rootComponentId=e);let i=null;this._components.has(e)?(i=this._components.get(e),i.removeAllMeshes()):(i=this._componentFactory.create(e,t,n,r),i.layers.set(3)),this._components.set(e,i),a&&this._addRootComponent(i)}Editor3dComponentDocked(e,t,n,r){this.dockComponent(e,t,n,r)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let r=this._previews.get(e.toString());r&&r.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];Yi.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let r=this._componentFactory.createPreviewLine(n,this._creator_),a=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?r:r.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(i=e[t].rotation,new Me(i.x,i.z,-i.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),a.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var i}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let r=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let a;0===t?a=n:(a=n.clonePreview(t),this._previews.set(a.stringId,a)),a.name="Preview Point",a.parentDockId=e[t].parentDockId,a.parentId=e[t].parentId,a.childDockId=e[t].childDockId,a.childId=e[t].childId,a.preparePreview(),a.receivedPointAssociation=!0,a.userData.ignoreComponentRaycast=!0,r.add(a),a.roomlePosition=e[t].position,a.roomleRotation=e[t].rotation,a.startPulsating()}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,r,a){10===e&&(this._configuratorContext.dockingRootComponentId=n);let i=0===t;i?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let s=this._getKernelAccess().kernelInstance.getComponent(n),o=this._components.get(n);o&&(o.computeBoundingBox(s.boxForMeasurement),o.hash=s.hash),this._listener&&this._listener.configurationLoaded(o,i&&void 0!==o.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let r=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(r)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._componentNumberOfPossibleChildren.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return Na(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new we).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new we).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}hasPreviewLines(){for(const e of this._previews.values())if(this._componentFactory.isPreviewLine(e))return!0;return!1}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,r,a,i,s,o,l,h){return this._configuratorMeshGenerator.generateMesh(e,t,n,r,a,i,s,!1,h)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new Sn(e),this._getKernelAccess().requestPlanComponentConstruction(e,!1),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}setRequestRenderSceneUpdateCallback(e){this._requestRenderSceneUpdateCallback=e}}e("C",ks),pn([fn],ks.prototype,"_configuratorMeshGenerator",void 0),pn([fn],ks.prototype,"_configuratorContext",void 0),pn([fn],ks.prototype,"_cacheHolder",void 0),pn([fn],ks.prototype,"_initData",void 0);class Ds extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,r)=>{n>t&&(e=r,t=n)}),e}}const Os=["material"];class Ls extends os{constructor(e){super(e),this.externalMeshQueue=new mi,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),Wi.addMeta("kernel_is_ready",{isWasm:this._useWASM}),Xi.kernelInstance?(this._kernelContainer=Xi.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){Wi.start("kernel_is_ready"),window.ConfiguratorKernel&&(Xi.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null))}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);Yi.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,r=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),r.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,r)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,r=!1,a=[];e&&e.forEach(e=>{let i=this._kernelInstance.getComponent(e);i.componentId=this._kernelInstance.getComponentId(e),i&&i.childIds&&i.childIds.length>0&&(n=!0),i.id===t&&(r=!0),a.push(i)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",r,n,a)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let r=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(r),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(r)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,r){const a=this._kernelInstance.getComponentId(n),i=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,r,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(a,r,i,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,r=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),a=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),Yi.finishOperation(3,[a,r])}webGlPreviewDockings(e,t){Yi.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(Is,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,r,a,i){"string"==typeof r?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,a,i),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,r,a,i){"string"==typeof r?this._kernelInstance.setComponentParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,a,i),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,r,a,i){"string"==typeof r?this._kernelInstance.setPlanObjectParameter(e,t,r):console.warn("tried to set a parameter to a none string value!",r,t,n),this._finishParameterChange(n,a,i)}_finishParameterChange(e,t,n){-1===Os.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}requestDeletePlanComponent(e){var t,n;e&&(null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)&&this._kernelInstance.deletePlanComponent(e)}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const r=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(r,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let r=this._kernelInstance.getPlanObjectParameters,a=e;t&&(r=this._kernelInstance.getComponentParameters,a=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(r.apply(this._kernelInstance,[a]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),this._setupKernel(),Ni.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:Pr}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Xi.planObjectId&&this.planObjectCreated(-1,Xi.planObjectId)}_setupKernel(){1===this._kernelType&&(Wi.start("kernel_create_instance"),Xi.kernelInstance?this._kernelInstance=Xi.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,r,a,i){Yi.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:r,errors:Pr(a)}),this._configuratorKernelCallbackListener.forEach(i=>i.configurationLoaded(e,t,n,r,a))}componentDefinitionLoaded(e,t){Yi.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),Yi.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=Pr(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}Yi.failOperation(4,new Error(n)),Yi.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._kernelInstance.setActiveGroupInViewForPlanObject(e,t||this._configuratorContext.planObjectId)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n,r,a){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(r=>r.planObjectConfigurationUpdated(e,t,n));const s=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(s),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const r=new Promise((e,t)=>{n=e});let a;this.externalMeshQueue.push(r),this._configuratorUiCallbacks.onRequestExternalMesh(e,t);try{a=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){return this._handleInvalidMesh(e),this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),void console.error(t)}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(a.url,!0))),i=await r.arrayBuffer();this._handleCortoMesh(i,e,t),n()}catch(t){return this._handleInvalidMesh(e),this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),void console.error(t)}}Editor3dComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentCreated(e,t,n,r,!1)),r&&r>0&&this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentDocked(e,r,t,n))}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),this._initData.moc||this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}createNewSerializedConfiguration(e){return this._kernelInstance.createNewSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}pn([fn],Ls.prototype,"_memoryManager",void 0),pn([fn],Ls.prototype,"_configuratorKernelAccessCallback",void 0),pn([fn],Ls.prototype,"_initData",void 0),pn([fn],Ls.prototype,"_configuratorHistory",void 0);class Us extends Di{constructor(e){super(e);const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new rt(.05,32),t=new C({color:16777215});this._sphere=new K(e,t);const n=new at(.05,.07,32),r=new C({color:0,side:j});this._innerRingMesh=new K(n,r),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const a=new at(.07,.08,32),i=new C({color:16777215,side:j});this._outerRingMesh=new K(a,i),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new K,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){super.setTopView(e),e||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new we).setFromObject(this._nodeUiMesh).getSize(new s)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new C({color:10526880,side:j}),super.select()}deselect(){this._innerRingMesh.material=new C({color:0,side:j}),super.deselect()}hoverOn(){this._sphere.geometry=new rt(.07,32),this._innerRingMesh.geometry=new at(.07,.07+.02,32),this._outerRingMesh.geometry=new at(.07+.02,.1,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new rt(.05,32),this._innerRingMesh.geometry=new at(.05,.07,32),this._outerRingMesh.geometry=new at(.07,.08,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}addMesh(e){super.addMesh(e)}}e("N",Us);class Fs extends Bi{constructor(e){super(e),this._container.name="Construction "+this._container.name}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView(),this._updateBoundingBox()}_enableTopView(){if(!this._topViewContainer){this._topViewContainer=new Y;const e=this.getPlanElement(),{x:t,z:n}=Mr(e.size),r=new Ve(t,.01,n);if(this._topGreyMesh=new K(r,Fa.createMeshStandardMaterial({transparent:!0,opacity:1,color:11645361})),this._topViewContainer.add(this._topGreyMesh),"window"===e.getObjectType()){const e=new Ve(t,.02,.05);this._topBlackMesh=new K(e,Fa.createMeshStandardMaterial({transparent:!0,opacity:1,color:0})),this._topViewContainer.add(this._topBlackMesh)}this._topViewContainer.position.y=5,this._container.add(this._topViewContainer)}this._topViewContainer.visible=!0}_disableTopView(){this._topViewContainer&&(this._topViewContainer.visible=!1)}getPlanElement(){return super.getPlanElement()}_generateBoundingBox(){const e=super._generateBoundingBox(),t=this.getSize();return e.geometry=new Ve(t.x,this._topView?5:t.y,t.z),e}_updateBoundingBox(){super._updateBoundingBox();const e=this.getSize();this._boundingBox.geometry=new Ve(e.x,this._topView?5:e.y,e.z)}getTopViewContainer(){return this._topViewContainer}update(){if(super.update(),!this._topGreyMesh)return;const{x:e,z:t}=Mr(this.getPlanElement().size);this._topGreyMesh.geometry=new Ve(e,.01,t),this._topBlackMesh&&(this._topBlackMesh.geometry=new Ve(e,.02,.05))}}e("d",Fs);class Ns extends Ls{get kernelContainer(){return this._kernelContainer}constructor(e){super(e),this._plannerKernelCallbackListener=new Set}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){this._planInteractionHandler=new this._kernelContainer.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,50,!!this._initData.snappingEnabled,!0,this._kernelContainer.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Ni.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),Xi.kernelInstance?this._kernelInstance=Xi.kernelInstance:this._kernelInstance=this._planInteractionHandler.getConfiguratorKernel()),super._setupKernel()}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){this.planInteractionHandler.startInteraction();let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))});const n=this.planInteractionHandler.getPlan().extRef.jsObject,r=n.getPlanObjectViewModelsFromRapiId().reduce((e,t)=>(e[t.getId()]=!0,e),{});this.planInteractionHandler.addPlanObjects(t,!0),await Promise.allSettled([Promise.allSettled(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}})),Promise.allSettled(n.getConfigurablePlanObjectViewModels().map(e=>e.isInitDone()))]);const a=n.getPlanObjectViewModelsFromRapiId().map(e=>e.getId()).filter(e=>!r[e]);return this.planInteractionHandler.endInteraction(),a}duplicateItems(e){const t=new this.kernelContainer.PlanObjectPtrList;return e.forEach(e=>{t.push_back(e)}),this.planInteractionHandler.duplicatePlanObjects(t,1,!0)}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){this._plannerKernelCallbackListener.forEach(e=>e.planCleared())}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}async _onStaticItemAdded(e,t){let n;n=this.isConstructionPlanElement(t)?new Fs(t):new Bi(t),this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n);const r=t.getCatalogItemId();if(r){const e=await this._rapiAccess.getItem(r);n.setRapiItem(e),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}}_onConfigurableItemAdded(e,t){const n=new Li(t);this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}async planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT)t.hasConfiguration()?this._onConfigurableItemAdded(e,t):await this._onStaticItemAdded(e,t);else{const n=t;let r;if(t.getType()===this._kernelContainer.PlanElementType.WALL?r=new ji(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?r=new Vi(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?r=new Gi(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(r=new Us(n)),!r)return;this.coupleReferences(r,n),e.extRef.jsObject.addPlanElementViewModel(r),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.startedDrawing())}stoppedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.stoppedDrawing())}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,a,i){this._plannerKernelCallbackListener.forEach(s=>s.addMesh(e,t,n,r,a,i))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,a,i,s){this._plannerKernelCallbackListener.forEach(o=>o.addPlanMesh(e,t,n,r,a,i,s))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}async addPlanObjectFromItem(e,t,n){if(!t&&!n){const t=await this.insertItems([e]);if(1!==t.length)throw new Error("It was expected that 1 element is added but"+t.length+"were added");return t[0]}n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._planInteractionHandler.addPlanObjectFromItem(this._rapiItemToKernelItem(e),t,n,!1),a=this._planInteractionHandler.getPlan().extRef.jsObject;let i;return r.hasConfiguration()?(i=a.getConfigurablePlanObjectForId(r.getId()),i||console.warn("Could not find configuration")):(i=a.getStaticPlanObjectViewModelForId(r.getId()),i?await i.setRapiItem(e):console.warn("Could not find static item")),await i.isInitDone(),i.getId()}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}isConstructionPlanElement(e){return e instanceof this.kernelContainer.ConstructionObject}}e("P",Ns),pn([fn],Ns.prototype,"_kernelAccessCallback",void 0),pn([fn],Ns.prototype,"_roomlePlannerUiCallback",void 0);class Bs extends fi{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=Fa.createMeshPhysicalMaterial({color:"#ffffff",side:j})}generateGeometry(e=null,t,n,r,a,i=!1){let s;return s=i?this._generateGeometry(e,t,n,r,a).clone():this._generateGeometry(e,t,n,r,a),s}generateMesh(e=0,t=null,n,r,a,i,s,o,l=!1,h){let d;d=l?this._generateGeometry(t,r,a,i,s).clone():this._generateGeometry(t,r,a,i,s);const c=this._createMesh(e,t,d);return c.userData.materialId=n,c.layers.set(4),n&&this.setMaterial(c,n,o,h).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const r=o&&3===o.value,a=o&&1===o.value;c.castShadow=!r&&!a,c.userData.isFloor=r}),this._checkWallMaterial(c,o),c}async setMaterial(e,t,n,r){if(e.userData.materialId=ni(t,n),it(t))t?await this._assignMaterial(e,t,r):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId,r):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{Ja(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}e("ap",Bs);let zs={InchFeet:null,Feet:null,MM:null,CM:null,Inch:null},Hs={NoUnitString:null,LongUnitString:null,ShortUnitString:null};const js=["mm","cm","feet"],Vs=["inch","inchfeet"];class Gs{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;zs=e.Unit,Hs=e.UnitStringType,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:r}=this._initData;this._actualUnit===zs.InchFeet?this._precision=void 0!==r?parseInt(r,10):2:this._actualUnit===zs.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision,!0),this._formatter=t}_initMeasurementSystemType(){let{measurementSystem:e,unit:t}=this._initData;if(this._actualMeasurementString=e,e||!t){if("metric"===e){t||(t="cm");const e=js.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not a metric unit, using CM"),this._actualUnit=zs.CM,this._actualUnitString="cm")}if("imperial"===e){t||(t="inch");const e=Vs.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not an imperial unit, using Inches"),this._actualUnit=zs.Inch,this._actualUnitString="inch")}}else{this._actualUnitString=t;const e=js.find(e=>e===t);this._actualMeasurementString=e?"metric":"imperial"}}_initActualUnit(){const{unit:e}=this._initData;this._actualUnit=this._getKernelUnitEnum(e)}_getKernelUnitEnum(e){switch(e){case"cm":return zs.CM;case"mm":return zs.MM;case"inchfeet":return zs.InchFeet;case"feet":return zs.Feet;case"inch":return zs.Inch;default:return zs.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;e&&"short"!==e&&console.warn("Only short unit strings is supported at the moment"),this._actualUnitStringType=Hs.ShortUnitString}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),$i(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(Zi(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else Ji(e)?(e.uiType="Options",function(e){return!!Ji(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===zs.InchFeet}getActualUnitString(){return this._actualUnitString}getActualMeasurementString(){return this._actualMeasurementString}getUnitStringType(){return this._initData.unitStringType}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e,t=""){this._initData.unit=e,this._initData.measurementSystem=t,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType(),this._plannerKernelAccess.kernelInstance.setEnvironmentVariable("unit",this._actualUnitString)}}pn([fn],Gs.prototype,"_initData",void 0),pn([fn],Gs.prototype,"_plannerKernelAccess",void 0);class Ks{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}pn([fn],Ks.prototype,"_configuratorUiCallbacks",void 0),e("ag",{ADDED:"added",CHANGED:"changed",REMOVED:"removed"});class Ws{constructor(e){this._kernelCallbacks={isReady:()=>{},throw:e=>console.error("Kernel exception",e),log:e=>{},error:(e,t,n,r)=>{},message:e=>{this._analyzeComponentCallback&&this._analyzeComponentCallback(e)}},this._creator_=e}async init(){if(this._toolsCoreInstance)return Promise.resolve();const e=this,t={locateFile:e=>"RoomleToolsCore.wasm"===e?n()+"static/RoomleToolsCore-9d852dba2ee4e323.wasm":e,wasmBinaryFile:n()+"static/RoomleToolsCore-9d852dba2ee4e323.wasm",preRun:[],postRun:[],setStatus:null,print(t){e._kernelIo.log(t)},printErr(t){e._kernelIo.error(t)},quit(t){0!==t&&e._kernelIo.throw(t&&t.toString?t.toString():"Unknown error while C/C++ main executes")}};await this._scriptLoader.fetch("static/RoomleToolsCore-68f11fca64f9af7b.js",{id:"core-tool"});const r=await window.RoomleToolsCore(t);r.setContext(this._kernelCallbacks),this._toolsCoreInstance=new r.ToolsCore}analyzeComponent(e,t){const n=[];return this._analyzeComponentCallback=e=>{n.push(e)},this._toolsCoreInstance.analyzeComponent(e,t),this._analyzeComponentCallback=null,Promise.resolve(n)}}pn([fn],Ws.prototype,"_scriptLoader",void 0),pn([fn],Ws.prototype,"_kernelIo",void 0);
2
2
  /*!
3
3
  fflate - fast JavaScript compression/decompression
4
4
  <https://101arrowz.github.io/fflate>
5
5
  Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE
6
6
  version 0.6.9
7
7
  */
8
- var Xs=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};try{URL.revokeObjectURL(Xs(""))}catch(e){Xs=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)}}var qs=Uint8Array,Qs=Uint16Array,Ys=Uint32Array,Zs=new qs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Js=new qs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$s=new qs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),eo=function(e,t){for(var n=new Qs(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new Ys(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)a[i]=i-n[r]<<5|r;return[n,a]},to=eo(Zs,2),no=to[0],ro=to[1];no[28]=258,ro[258]=28;for(var ao=eo(Js,0)[0],io=new Qs(32768),so=0;so<32768;++so){var oo=(43690&so)>>>1|(21845&so)<<1;oo=(61680&(oo=(52428&oo)>>>2|(13107&oo)<<2))>>>4|(3855&oo)<<4,io[so]=((65280&oo)>>>8|(255&oo)<<8)>>>1}var lo=function(e,t,n){for(var r=e.length,a=0,i=new Qs(t);a<r;++a)++i[e[a]-1];var s,o=new Qs(t);for(a=0;a<t;++a)o[a]=o[a-1]+i[a-1]<<1;if(n){s=new Qs(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var h=a<<4|e[a],d=t-e[a],c=o[e[a]-1]++<<d,u=c|(1<<d)-1;c<=u;++c)s[io[c]>>>l]=h}else for(s=new Qs(r),a=0;a<r;++a)e[a]&&(s[a]=io[o[e[a]-1]++]>>>15-e[a]);return s},ho=new qs(288);for(so=0;so<144;++so)ho[so]=8;for(so=144;so<256;++so)ho[so]=9;for(so=256;so<280;++so)ho[so]=7;for(so=280;so<288;++so)ho[so]=8;var co=new qs(32);for(so=0;so<32;++so)co[so]=5;var uo=lo(ho,9,1),po=lo(co,5,1),mo=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},fo=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},go=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},vo=new qs(0);function _o(e,t){return function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new qs(0);var a=!t||n,i=!n||n.i;n||(n={}),t||(t=new qs(3*r));var s,o=function(e){var n=t.length;if(e>n){var r=new qs(Math.max(2*n,e));r.set(t),t=r}},l=n.f||0,h=n.p||0,d=n.b||0,c=n.l,u=n.d,p=n.m,m=n.n,f=8*r;do{if(!c){n.f=l=fo(e,h,1);var g=fo(e,h+1,3);if(h+=3,!g){var v=e[(P=((s=h)/8|0)+(7&s&&1)+4)-4]|e[P-3]<<8,_=P+v;if(_>r){if(i)throw"unexpected EOF";break}a&&o(d+v),t.set(e.subarray(P,_),d),n.b=d+=v,n.p=h=8*_;continue}if(1==g)c=uo,u=po,p=9,m=5;else{if(2!=g)throw"invalid block type";var w=fo(e,h,31)+257,b=fo(e,h+10,15)+4,y=w+fo(e,h+5,31)+1;h+=14;for(var x=new qs(y),S=new qs(19),C=0;C<b;++C)S[$s[C]]=fo(e,h+3*C,7);h+=3*b;var M=mo(S),T=(1<<M)-1,A=lo(S,M,1);for(C=0;C<y;){var P,R=A[fo(e,h,T)];if(h+=15&R,(P=R>>>4)<16)x[C++]=P;else{var E=0,I=0;for(16==P?(I=3+fo(e,h,3),h+=2,E=x[C-1]):17==P?(I=3+fo(e,h,7),h+=3):18==P&&(I=11+fo(e,h,127),h+=7);I--;)x[C++]=E}}var k=x.subarray(0,w),D=x.subarray(w);p=mo(k),m=mo(D),c=lo(k,p,1),u=lo(D,m,1)}if(h>f){if(i)throw"unexpected EOF";break}}a&&o(d+131072);for(var O=(1<<p)-1,L=(1<<m)-1,U=h;;U=h){var F=(E=c[go(e,h)&O])>>>4;if((h+=15&E)>f){if(i)throw"unexpected EOF";break}if(!E)throw"invalid length/literal";if(F<256)t[d++]=F;else{if(256==F){U=h,c=null;break}var N=F-254;if(F>264){var B=Zs[C=F-257];N=fo(e,h,(1<<B)-1)+no[C],h+=B}var z=u[go(e,h)&L],H=z>>>4;if(!z)throw"invalid distance";if(h+=15&z,D=ao[H],H>3&&(B=Js[H],D+=go(e,h)&(1<<B)-1,h+=B),h>f){if(i)throw"unexpected EOF";break}a&&o(d+131072);for(var j=d+N;d<j;d+=4)t[d]=t[d-D],t[d+1]=t[d+1-D],t[d+2]=t[d+2-D],t[d+3]=t[d+3-D];d=j}}n.l=c,n.p=U,n.b=d,c&&(l=1,n.m=p,n.d=u,n.n=m)}while(!l);return d==t.length?t:function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Qs?Qs:e instanceof Ys?Ys:qs)(n-t);return r.set(e.subarray(t,n)),r}(t,0,d)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}var wo="undefined"!=typeof TextDecoder&&new TextDecoder;try{wo.decode(vo,{stream:!0})}catch(e){}var bo=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).type=it,r}return w(n,[{key:"parse",value:function(e){var t=Math.pow(2.7182818,2.2),n={l:0,c:0,lc:0};function r(e,t,r,a,i){for(;r<e;)t=t<<8|L(a,i),r+=8;r-=e,n.l=t>>r&(1<<e)-1,n.c=t,n.lc=r}var a=new Array(59);function i(e){return 63&e}function s(e){return e>>6}var o={c:0,lc:0};function l(e,t,n,r){e=e<<8|L(n,r),t+=8,o.c=e,o.lc=t}var h={c:0,lc:0};function d(e,t,n,r,a,i,s,d,c){if(e==t){r<8&&(l(n,r,a,i),n=o.c,r=o.lc);var u=n>>(r-=8);if(u=new Uint8Array([u])[0],d.value+u>c)return!1;for(var p=s[d.value-1];u-- >0;)s[d.value++]=p}else{if(!(d.value<c))return!1;s[d.value++]=e}h.c=n,h.lc=r}function c(e){return 65535&e}function u(e){var t=c(e);return t>32767?t-65536:t}var p={a:0,b:0};function m(e,t){var n=u(e),r=u(t),a=n+(1&r)+(r>>1),i=a,s=a-r;p.a=i,p.b=s}function f(e,t){var n=c(e),r=c(t),a=n-(r>>1)&65535,i=r+a-32768&65535;p.a=i,p.b=a}function g(e,t,n,r,a,i,s){for(var o,l,h=s<16384,d=n>a?a:n,c=1;c<=d;)c<<=1;for(o=c>>=1,c>>=1;c>=1;){for(var u=(l=0)+i*(a-o),g=i*c,v=i*o,_=r*c,w=r*o,b=void 0,y=void 0,x=void 0,S=void 0;l<=u;l+=v){for(var C=l,M=l+r*(n-o);C<=M;C+=w){var T=C+_,A=C+g,P=A+_;h?(m(e[C+t],e[A+t]),b=p.a,x=p.b,m(e[T+t],e[P+t]),y=p.a,S=p.b,m(b,y),e[C+t]=p.a,e[T+t]=p.b,m(x,S),e[A+t]=p.a,e[P+t]=p.b):(f(e[C+t],e[A+t]),b=p.a,x=p.b,f(e[T+t],e[P+t]),y=p.a,S=p.b,f(b,y),e[C+t]=p.a,e[T+t]=p.b,f(x,S),e[A+t]=p.a,e[P+t]=p.b)}if(n&c){var R=C+g;h?m(e[C+t],e[R+t]):f(e[C+t],e[R+t]),b=p.a,e[R+t]=p.b,e[C+t]=b}}if(a&c)for(var E=l,I=l+r*(n-o);E<=I;E+=w){var k=E+_;h?m(e[E+t],e[k+t]):f(e[E+t],e[k+t]),b=p.a,e[k+t]=p.b,e[E+t]=b}o=c,c>>=1}return l}function v(e,t,c,u,p,m){var f=c.value,g=O(t,c),v=O(t,c);c.value+=4;var _=O(t,c);if(c.value+=4,g<0||g>=65537||v<0||v>=65537)throw new Error("Something wrong with HUF_ENCSIZE");var w=new Array(65537),b=new Array(16384);if(function(e){for(var t=0;t<16384;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(b),function(e,t,i,s,o,l){for(var h=t,d=0,c=0;s<=o;s++){if(h.value-t.value>i)return!1;r(6,d,c,e,h);var u=n.l;if(d=n.c,c=n.lc,l[s]=u,63==u){if(h.value-t.value>i)throw new Error("Something wrong with hufUnpackEncTable");r(8,d,c,e,h);var p=n.l+6;if(d=n.c,c=n.lc,s+p>o+1)throw new Error("Something wrong with hufUnpackEncTable");for(;p--;)l[s++]=0;s--}else if(u>=59){var m=u-59+2;if(s+m>o+1)throw new Error("Something wrong with hufUnpackEncTable");for(;m--;)l[s++]=0;s--}}!function(e){for(var t=0;t<=58;++t)a[t]=0;for(var n=0;n<65537;++n)a[e[n]]+=1;for(var r=0,i=58;i>0;--i){var s=r+a[i]>>1;a[i]=r,r=s}for(var o=0;o<65537;++o){var l=e[o];l>0&&(e[o]=l|a[l]++<<6)}}(l)}(e,c,u-(c.value-f),g,v,w),_>8*(u-(c.value-f)))throw new Error("Something wrong with hufUncompress");!function(e,t,n,r){for(;t<=n;t++){var a=s(e[t]),o=i(e[t]);if(a>>o)throw new Error("Invalid table entry");if(o>14){var l=r[a>>o-14];if(l.len)throw new Error("Invalid table entry");if(l.lit++,l.p){var h=l.p;l.p=new Array(l.lit);for(var d=0;d<l.lit-1;++d)l.p[d]=h[d]}else l.p=new Array(1);l.p[l.lit-1]=t}else if(o)for(var c=0,u=1<<14-o;u>0;u--){var p=r[(a<<14-o)+c];if(p.len||p.p)throw new Error("Invalid table entry");p.len=o,p.lit=t,c++}}}(w,g,v,b),function(e,t,n,r,a,c,u,p,m){for(var f=0,g=0,v=u,_=Math.trunc(r.value+(a+7)/8);r.value<_;)for(l(f,g,n,r),f=o.c,g=o.lc;g>=14;){var w=t[f>>g-14&16383];if(w.len)g-=w.len,d(w.lit,c,f,g,n,r,p,m,v),f=h.c,g=h.lc;else{if(!w.p)throw new Error("hufDecode issues");var b=void 0;for(b=0;b<w.lit;b++){for(var y=i(e[w.p[b]]);g<y&&r.value<_;)l(f,g,n,r),f=o.c,g=o.lc;if(g>=y&&s(e[w.p[b]])==(f>>g-y&(1<<y)-1)){g-=y,d(w.p[b],c,f,g,n,r,p,m,v),f=h.c,g=h.lc;break}}if(b==w.lit)throw new Error("hufDecode issues")}}var x=8-a&7;for(f>>=x,g-=x;g>0;){var S=t[f<<14-g&16383];if(!S.len)throw new Error("hufDecode issues");g-=S.len,d(S.lit,c,f,g,n,r,p,m,v),f=h.c,g=h.lc}}(w,b,e,c,_,v,m,p,{value:0})}function _(e){for(var t=1;t<e.length;t++){var n=e[t-1]+e[t]-128;e[t]=n}}function w(e,t){for(var n=0,r=Math.floor((e.length+1)/2),a=0,i=e.length-1;!(a>i||(t[a++]=e[n++],a>i));)t[a++]=e[r++]}function b(e){for(var t=e.byteLength,n=new Array,r=0,a=new DataView(e);t>0;){var i=a.getInt8(r++);if(i<0){var s=-i;t-=s+1;for(var o=0;o<s;o++)n.push(a.getUint8(r++))}else{var l=i;t-=2;for(var h=a.getUint8(r++),d=0;d<l+1;d++)n.push(h)}}return n}function y(e,t,n){for(var r,a=1;a<64;)65280==(r=t[e.value])?a=64:r>>8==255?a+=255&r:(n[a]=r,a++),e.value++}function x(e,t){t[0]=z(e[0]),t[1]=z(e[1]),t[2]=z(e[5]),t[3]=z(e[6]),t[4]=z(e[14]),t[5]=z(e[15]),t[6]=z(e[27]),t[7]=z(e[28]),t[8]=z(e[2]),t[9]=z(e[4]),t[10]=z(e[7]),t[11]=z(e[13]),t[12]=z(e[16]),t[13]=z(e[26]),t[14]=z(e[29]),t[15]=z(e[42]),t[16]=z(e[3]),t[17]=z(e[8]),t[18]=z(e[12]),t[19]=z(e[17]),t[20]=z(e[25]),t[21]=z(e[30]),t[22]=z(e[41]),t[23]=z(e[43]),t[24]=z(e[9]),t[25]=z(e[11]),t[26]=z(e[18]),t[27]=z(e[24]),t[28]=z(e[31]),t[29]=z(e[40]),t[30]=z(e[44]),t[31]=z(e[53]),t[32]=z(e[10]),t[33]=z(e[19]),t[34]=z(e[23]),t[35]=z(e[32]),t[36]=z(e[39]),t[37]=z(e[45]),t[38]=z(e[52]),t[39]=z(e[54]),t[40]=z(e[20]),t[41]=z(e[22]),t[42]=z(e[33]),t[43]=z(e[38]),t[44]=z(e[46]),t[45]=z(e[51]),t[46]=z(e[55]),t[47]=z(e[60]),t[48]=z(e[21]),t[49]=z(e[34]),t[50]=z(e[37]),t[51]=z(e[47]),t[52]=z(e[50]),t[53]=z(e[56]),t[54]=z(e[59]),t[55]=z(e[61]),t[56]=z(e[35]),t[57]=z(e[36]),t[58]=z(e[48]),t[59]=z(e[49]),t[60]=z(e[57]),t[61]=z(e[58]),t[62]=z(e[62]),t[63]=z(e[63])}function S(e){for(var t=.5*Math.cos(.7853975),n=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),a=.5*Math.cos(3*3.14159/16),i=.5*Math.cos(.981746875),s=.5*Math.cos(3*3.14159/8),o=.5*Math.cos(1.374445625),l=new Array(4),h=new Array(4),d=new Array(4),c=new Array(4),u=0;u<8;++u){var p=8*u;l[0]=r*e[p+2],l[1]=s*e[p+2],l[2]=r*e[p+6],l[3]=s*e[p+6],h[0]=n*e[p+1]+a*e[p+3]+i*e[p+5]+o*e[p+7],h[1]=a*e[p+1]-o*e[p+3]-n*e[p+5]-i*e[p+7],h[2]=i*e[p+1]-n*e[p+3]+o*e[p+5]+a*e[p+7],h[3]=o*e[p+1]-i*e[p+3]+a*e[p+5]-n*e[p+7],d[0]=t*(e[p+0]+e[p+4]),d[3]=t*(e[p+0]-e[p+4]),d[1]=l[0]+l[3],d[2]=l[1]-l[2],c[0]=d[0]+d[1],c[1]=d[3]+d[2],c[2]=d[3]-d[2],c[3]=d[0]-d[1],e[p+0]=c[0]+h[0],e[p+1]=c[1]+h[1],e[p+2]=c[2]+h[2],e[p+3]=c[3]+h[3],e[p+4]=c[3]-h[3],e[p+5]=c[2]-h[2],e[p+6]=c[1]-h[1],e[p+7]=c[0]-h[0]}for(var m=0;m<8;++m)l[0]=r*e[16+m],l[1]=s*e[16+m],l[2]=r*e[48+m],l[3]=s*e[48+m],h[0]=n*e[8+m]+a*e[24+m]+i*e[40+m]+o*e[56+m],h[1]=a*e[8+m]-o*e[24+m]-n*e[40+m]-i*e[56+m],h[2]=i*e[8+m]-n*e[24+m]+o*e[40+m]+a*e[56+m],h[3]=o*e[8+m]-i*e[24+m]+a*e[40+m]-n*e[56+m],d[0]=t*(e[m]+e[32+m]),d[3]=t*(e[m]-e[32+m]),d[1]=l[0]+l[3],d[2]=l[1]-l[2],c[0]=d[0]+d[1],c[1]=d[3]+d[2],c[2]=d[3]-d[2],c[3]=d[0]-d[1],e[0+m]=c[0]+h[0],e[8+m]=c[1]+h[1],e[16+m]=c[2]+h[2],e[24+m]=c[3]+h[3],e[32+m]=c[3]-h[3],e[40+m]=c[2]-h[2],e[48+m]=c[1]-h[1],e[56+m]=c[0]-h[0]}function C(e){for(var t=0;t<64;++t){var n=e[0][t],r=e[1][t],a=e[2][t];e[0][t]=n+1.5747*a,e[1][t]=n-.1873*r-.4682*a,e[2][t]=n+1.8556*r}}function M(e,n,r){for(var a=0;a<64;++a)n[r+a]=dt.toHalfFloat((i=e[a])<=1?Math.sign(i)*Math.pow(Math.abs(i),2.2):Math.sign(i)*Math.pow(t,Math.abs(i)-1));var i}function T(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function A(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(b(t)),r=new Uint8Array(n.length);return _(n),w(n,r),new DataView(r.buffer)}function P(e){var t=_o(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return _(t),w(t,n),new DataView(n.buffer)}function R(e){for(var t=e.viewer,n={value:e.offset.value},r=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(8192),i=0,s=new Array(e.channels),o=0;o<e.channels;o++)s[o]={},s[o].start=i,s[o].end=s[o].start,s[o].nx=e.width,s[o].ny=e.lines,s[o].size=e.type,i+=s[o].nx*s[o].ny*s[o].size;var l=H(t,n),h=H(t,n);if(h>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(l<=h)for(var d=0;d<h-l+1;d++)a[d+l]=U(t,n);var c=new Uint16Array(65536),u=function(e,t){for(var n=0,r=0;r<65536;++r)(0==r||e[r>>3]&1<<(7&r))&&(t[n++]=r);for(var a=n-1;n<65536;)t[n++]=0;return a}(a,c),p=O(t,n);v(e.array,t,n,p,r,i);for(var m=0;m<e.channels;++m)for(var f=s[m],_=0;_<s[m].size;++_)g(r,f.start+_,f.nx,f.size,f.ny,f.nx*f.size,u);!function(e,t,n){for(var r=0;r<n;++r)t[r]=e[t[r]]}(c,r,i);for(var w=0,b=new Uint8Array(r.buffer.byteLength),y=0;y<e.lines;y++)for(var x=0;x<e.channels;x++){var S=s[x],C=S.nx*S.size,M=new Uint8Array(r.buffer,2*S.end,2*C);b.set(M,w),w+=2*C,S.end+=C}return new DataView(b.buffer)}function E(e){for(var t=_o(e.array.slice(e.offset.value,e.offset.value+e.size)),n=e.lines*e.channels*e.width,r=1==e.type?new Uint16Array(n):new Uint32Array(n),a=0,i=0,s=new Array(4),o=0;o<e.lines;o++)for(var l=0;l<e.channels;l++){var h=0;switch(e.type){case 1:s[0]=a,s[1]=s[0]+e.width,a=s[1]+e.width;for(var d=0;d<e.width;++d)h+=t[s[0]++]<<8|t[s[1]++],r[i]=h,i++;break;case 2:s[0]=a,s[1]=s[0]+e.width,s[2]=s[1]+e.width,a=s[2]+e.width;for(var c=0;c<e.width;++c)h+=t[s[0]++]<<24|t[s[1]++]<<16|t[s[2]++]<<8,r[i]=h,i++}}return new DataView(r.buffer)}function I(e){var t=e.viewer,n={value:e.offset.value},r=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),a={version:F(t,n),unknownUncompressedSize:F(t,n),unknownCompressedSize:F(t,n),acCompressedSize:F(t,n),dcCompressedSize:F(t,n),rleCompressedSize:F(t,n),rleUncompressedSize:F(t,n),rleRawSize:F(t,n),totalAcUncompressedCount:F(t,n),totalDcUncompressedCount:F(t,n),acCompression:F(t,n)};if(a.version<2)throw new Error("EXRLoader.parse: "+X.compression+" version "+a.version+" is unsupported");for(var i=new Array,s=H(t,n)-2;s>0;){var o=k(t.buffer,n),l=U(t,n),h=l>>2&3,d=new Int8Array([(l>>4)-1])[0],c=U(t,n);i.push({name:o,index:d,type:c,compression:h}),s-=o.length+3}for(var u=X.channels,p=new Array(e.channels),m=0;m<e.channels;++m){var f=p[m]={},g=u[m];f.name=g.name,f.compression=0,f.decoded=!1,f.type=g.pixelType,f.pLinear=g.pLinear,f.width=e.width,f.height=e.lines}for(var _,w,T,A={idx:new Array(3)},R=0;R<e.channels;++R)for(var E=p[R],I=0;I<i.length;++I){var D=i[I];E.name==D.name&&(E.compression=D.compression,D.index>=0&&(A.idx[D.index]=R),E.offset=R)}if(a.acCompressedSize>0)switch(a.acCompression){case 0:_=new Uint16Array(a.totalAcUncompressedCount),v(e.array,t,n,a.acCompressedSize,_,a.totalAcUncompressedCount);break;case 1:var O=_o(e.array.slice(n.value,n.value+a.totalAcUncompressedCount));_=new Uint16Array(O.buffer),n.value+=a.totalAcUncompressedCount}if(a.dcCompressedSize>0){var L={array:e.array,offset:n,size:a.dcCompressedSize};w=new Uint16Array(P(L).buffer),n.value+=a.dcCompressedSize}a.rleRawSize>0&&(T=b(_o(e.array.slice(n.value,n.value+a.rleCompressedSize)).buffer),n.value+=a.rleCompressedSize);for(var N=0,B=new Array(p.length),j=0;j<B.length;++j)B[j]=new Array;for(var V=0;V<e.lines;++V)for(var G=0;G<p.length;++G)B[G].push(N),N+=p[G].width*e.type*2;!function(e,t,n,r,a,i){for(var s=new DataView(i.buffer),o=n[e.idx[0]].width,l=n[e.idx[0]].height,h=Math.floor(o/8),d=Math.ceil(o/8),c=Math.ceil(l/8),u=o-8*(d-1),p=l-8*(c-1),m={value:0},f=new Array(3),g=new Array(3),v=new Array(3),_=new Array(3),w=new Array(3),b=0;b<3;++b)w[b]=t[e.idx[b]],f[b]=b<1?0:f[b-1]+d*c,g[b]=new Float32Array(64),v[b]=new Uint16Array(64),_[b]=new Uint16Array(64*d);for(var T=0;T<c;++T){var A=8;T==c-1&&(A=p);for(var P=8,R=0;R<d;++R){R==d-1&&(P=u);for(var E=0;E<3;++E)v[E].fill(0),v[E][0]=a[f[E]++],y(m,r,v[E]),x(v[E],g[E]),S(g[E]);C(g);for(var I=0;I<3;++I)M(g[I],_[I],64*R)}for(var k=0,D=0;D<3;++D){for(var O=n[e.idx[D]].type,L=8*T;L<8*T+A;++L){k=w[D][L];for(var U=0;U<h;++U){var F=64*U+8*(7&L);s.setUint16(k+0*O,_[D][F+0],!0),s.setUint16(k+2*O,_[D][F+1],!0),s.setUint16(k+4*O,_[D][F+2],!0),s.setUint16(k+6*O,_[D][F+3],!0),s.setUint16(k+8*O,_[D][F+4],!0),s.setUint16(k+10*O,_[D][F+5],!0),s.setUint16(k+12*O,_[D][F+6],!0),s.setUint16(k+14*O,_[D][F+7],!0),k+=16*O}}if(h!=d)for(var N=8*T;N<8*T+A;++N)for(var B=w[D][N]+8*h*2*O,H=64*h+8*(7&N),j=0;j<P;++j)s.setUint16(B+2*j*O,_[D][H+j],!0)}}var V=new Uint16Array(o);s=new DataView(i.buffer);for(var G=0;G<3;++G){n[e.idx[G]].decoded=!0;var K=n[e.idx[G]].type;if(2==n[G].type)for(var W=0;W<l;++W){for(var X=w[G][W],q=0;q<o;++q)V[q]=s.getUint16(X+2*q*K,!0);for(var Q=0;Q<o;++Q)s.setFloat32(X+2*Q*K,z(V[Q]),!0)}}}(A,B,p,_,w,r);for(var K=0;K<p.length;++K){var W=p[K];if(!W.decoded)switch(W.compression){case 2:for(var q=0,Q=0,Y=0;Y<e.lines;++Y){for(var Z=B[K][q],J=0;J<W.width;++J){for(var $=0;$<2*W.type;++$)r[Z++]=T[Q+$*W.width*W.height];Q++}q++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(r.buffer)}function k(e,t){for(var n=new Uint8Array(e),r=0;0!=n[t.value+r];)r+=1;var a=(new TextDecoder).decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,a}function D(e,t){var n=e.getInt32(t.value,!0);return t.value=t.value+4,n}function O(e,t){var n=e.getUint32(t.value,!0);return t.value=t.value+4,n}function L(e,t){var n=e[t.value];return t.value=t.value+1,n}function U(e,t){var n=e.getUint8(t.value);return t.value=t.value+1,n}var F=function(e,t){var n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function N(e,t){var n=e.getFloat32(t.value,!0);return t.value+=4,n}function B(e,t){return dt.toHalfFloat(N(e,t))}function z(e){var t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}function H(e,t){var n=e.getUint16(t.value,!0);return t.value+=2,n}function j(e,t){return z(H(e,t))}function V(e,t,n,r,a){return"string"===r||"stringvector"===r||"iccProfile"===r?function(e,t,n){var r=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(t,n,a):"chlist"===r?function(e,t,n,r){for(var a=n.value,i=[];n.value<a+r-1;){var s=k(t,n),o=D(e,n),l=U(e,n);n.value+=3;var h=D(e,n),d=D(e,n);i.push({name:s,pixelType:o,pLinear:l,xSampling:h,ySampling:d})}return n.value+=1,i}(e,t,n,a):"chromaticities"===r?function(e,t){return{redX:N(e,t),redY:N(e,t),greenX:N(e,t),greenY:N(e,t),blueX:N(e,t),blueY:N(e,t),whiteX:N(e,t),whiteY:N(e,t)}}(e,n):"compression"===r?function(e,t){return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][U(e,t)]}(e,n):"box2i"===r?function(e,t){return{xMin:O(e,t),yMin:O(e,t),xMax:O(e,t),yMax:O(e,t)}}(e,n):"lineOrder"===r?function(e,t){return["INCREASING_Y"][U(e,t)]}(e,n):"float"===r?N(e,n):"v2f"===r?function(e,t){return[N(e,t),N(e,t)]}(e,n):"v3f"===r?function(e,t){return[N(e,t),N(e,t),N(e,t)]}(e,n):"int"===r?D(e,n):"rational"===r?function(e,t){return[D(e,t),O(e,t)]}(e,n):"timecode"===r?function(e,t){return[O(e,t),O(e,t)]}(e,n):"preview"===r?(n.value+=a,"skipped"):void(n.value+=a)}for(var G=new DataView(e),K=new Uint8Array(e),W={value:0},X=function(e,t,n){var r={};if(20000630!=e.getUint32(0,!0))throw new Error("THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.");r.version=e.getUint8(4);var a=e.getUint8(5);r.spec={singleTile:!!(2&a),longName:!!(4&a),deepFormat:!!(8&a),multiPart:!!(16&a)},n.value=8;for(var i=!0;i;){var s=k(t,n);if(0==s)i=!1;else{var o=k(t,n),l=V(e,t,n,o,O(e,n));void 0===l?console.warn("EXRLoader.parse: skipped unknown header attribute type '".concat(o,"'.")):r[s]=l}}if(0!=(-5&a))throw console.error("EXRHeader:",r),new Error("THREE.EXRLoader: provided file is currently unsupported.");return r}(G,e,W),q=function(e,t,n,r,a){var i={size:0,viewer:t,array:n,offset:r,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,colorSpace:Ce};switch(e.compression){case"NO_COMPRESSION":i.lines=1,i.uncompress=T;break;case"RLE_COMPRESSION":i.lines=1,i.uncompress=A;break;case"ZIPS_COMPRESSION":i.lines=1,i.uncompress=P;break;case"ZIP_COMPRESSION":i.lines=16,i.uncompress=P;break;case"PIZ_COMPRESSION":i.lines=32,i.uncompress=R;break;case"PXR24_COMPRESSION":i.lines=16,i.uncompress=E;break;case"DWAA_COMPRESSION":i.lines=32,i.uncompress=I;break;case"DWAB_COMPRESSION":i.lines=256,i.uncompress=I;break;default:throw new Error("EXRLoader.parse: "+e.compression+" is unsupported")}if(i.scanlineBlockSize=i.lines,1==i.type)switch(a){case ot:i.getter=j,i.inputSize=2;break;case it:i.getter=H,i.inputSize=2}else{if(2!=i.type)throw new Error("EXRLoader.parse: unsupported pixelType "+i.type+" for "+e.compression+".");switch(a){case ot:i.getter=N,i.inputSize=4;break;case it:i.getter=B,i.inputSize=4}}i.blockCount=(e.dataWindow.yMax+1)/i.scanlineBlockSize;for(var s=0;s<i.blockCount;s++)F(t,r);i.outputChannels=3==i.channels?4:i.channels;var o=i.width*i.height*i.outputChannels;switch(a){case ot:i.byteArray=new Float32Array(o),i.channels<i.outputChannels&&i.byteArray.fill(1,0,o);break;case it:i.byteArray=new Uint16Array(o),i.channels<i.outputChannels&&i.byteArray.fill(15360,0,o);break;default:console.error("THREE.EXRLoader: unsupported type: ",a)}return i.bytesPerLine=i.width*i.inputSize*i.channels,4==i.outputChannels?(i.format=Ae,i.colorSpace=Ce):(i.format=lt,i.colorSpace=ht),i}(X,G,K,W,this.type),Q={value:0},Y={R:0,G:1,B:2,A:3,Y:0},Z=0;Z<q.height/q.scanlineBlockSize;Z++){var J=O(G,W);q.size=O(G,W),q.lines=J+q.scanlineBlockSize>q.height?q.height-J:q.scanlineBlockSize;var $=q.size<q.lines*q.bytesPerLine?q.uncompress(q):T(q);W.value+=q.size;for(var ee=0;ee<q.scanlineBlockSize;ee++){var te=ee+Z*q.scanlineBlockSize;if(te>=q.height)break;for(var ne=0;ne<q.channels;ne++)for(var re=Y[X.channels[ne].name],ae=0;ae<q.width;ae++){Q.value=(ee*(q.channels*q.width)+ne*q.width+ae)*q.inputSize;var ie=(q.height-1-te)*(q.width*q.outputChannels)+ae*q.outputChannels+re;q.byteArray[ie]=q.getter($,Q)}}}return{header:X,width:q.width,height:q.height,data:q.byteArray,format:q.format,colorSpace:q.colorSpace,type:this.type}}},{key:"setDataType",value:function(e){return this.type=e,this}},{key:"load",value:function(e,t,r,a){return xe(Se(n.prototype),"load",this).call(this,e,(function(e,n){e.colorSpace=n.colorSpace,e.minFilter=L,e.magFilter=L,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)}),r,a)}}]),n}(st),yo=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).type=it,r}return w(n,[{key:"parse",value:function(e){var t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:case 4:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},n=function(e,t,n){t=t||1024;for(var r=e.pos,a=-1,i=0,s="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));0>(a=o.indexOf("\n"))&&i<t&&r<e.byteLength;)s+=o,i+=o.length,r+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<a&&(!1!==n&&(e.pos+=i+a+1),s+o.slice(0,a))},r=function(e,t,n,r){var a=e[t+3],i=Math.pow(2,a-128)/255;n[r+0]=dt.toHalfFloat(Math.min(e[t+0]*i,65504)),n[r+1]=dt.toHalfFloat(Math.min(e[t+1]*i,65504)),n[r+2]=dt.toHalfFloat(Math.min(e[t+2]*i,65504)),n[r+3]=dt.toHalfFloat(1)},a=new Uint8Array(e);a.pos=0;var i,s,o,l,h,d,c=function(e){var r,a,i=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,l=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,h={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};if(e.pos>=e.byteLength||!(r=n(e)))return t(1,"no header found");if(!(a=r.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(h.valid|=1,h.programtype=a[1],h.string+=r+"\n";!1!==(r=n(e));)if(h.string+=r+"\n","#"!==r.charAt(0)){if((a=r.match(i))&&(h.gamma=parseFloat(a[1])),(a=r.match(s))&&(h.exposure=parseFloat(a[1])),(a=r.match(o))&&(h.valid|=2,h.format=a[1]),(a=r.match(l))&&(h.valid|=4,h.height=parseInt(a[1],10),h.width=parseInt(a[2],10)),2&h.valid&&4&h.valid)break}else h.comments+=r+"\n";return 2&h.valid?4&h.valid?h:t(3,"missing image size specifier"):t(3,"missing format specifier")}(a);if(-1!==c){var u=c.width,p=c.height,m=function(e,n,r){var a=n;if(a<8||a>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(a!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");var i=new Uint8Array(4*n*r);if(!i.length)return t(4,"unable to allocate buffer space");for(var s=0,o=0,l=4*a,h=new Uint8Array(4),d=new Uint8Array(l),c=r;c>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(h[0]=e[o++],h[1]=e[o++],h[2]=e[o++],h[3]=e[o++],2!=h[0]||2!=h[1]||(h[2]<<8|h[3])!=a)return t(3,"bad rgbe scanline format");for(var u=0,p=void 0;u<l&&o<e.byteLength;){var m=(p=e[o++])>128;if(m&&(p-=128),0===p||u+p>l)return t(3,"bad scanline data");if(m)for(var f=e[o++],g=0;g<p;g++)d[u++]=f;else d.set(e.subarray(o,o+p),u),u+=p,o+=p}for(var v=a,_=0;_<v;_++){var w=0;i[s]=d[_+w],w+=a,i[s+1]=d[_+w],w+=a,i[s+2]=d[_+w],w+=a,i[s+3]=d[_+w],s+=4}c--}return i}(a.subarray(a.pos),u,p);if(-1!==m){var f,g,v;switch(this.type){case ot:v=m.length/4;for(var _=new Float32Array(4*v),w=0;w<v;w++)o=_,l=4*w,h=(i=m)[3+(s=4*w)],d=Math.pow(2,h-128)/255,o[l+0]=i[s+0]*d,o[l+1]=i[s+1]*d,o[l+2]=i[s+2]*d,o[l+3]=1;f=_,g=ot;break;case it:v=m.length/4;for(var b=new Uint16Array(4*v),y=0;y<v;y++)r(m,4*y,b,4*y);f=b,g=it;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:u,height:p,data:f,header:c.string,gamma:c.gamma,exposure:c.exposure,type:g}}}return null}},{key:"setDataType",value:function(e){return this.type=e,this}},{key:"load",value:function(e,t,r,a){return xe(Se(n.prototype),"load",this).call(this,e,(function(e,n){switch(e.type){case ot:case it:e.colorSpace=Ce,e.minFilter=L,e.magFilter=L,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),r,a)}}]),n}(st);const xo={uniforms:{tDiffuse:{value:null},colorTransform:{value:new P},colorBase:{value:new ut(0,0,0,0)},multiplyChannels:{value:0},uvTransform:{value:new pt}},vertexShader:"\n varying vec2 vUv;\n uniform mat3 uvTransform;\n \n void main() {\n vUv = (uvTransform * vec3(uv, 1.0)).xy;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform mat4 colorTransform;\n uniform vec4 colorBase;\n uniform float multiplyChannels;\n varying vec2 vUv;\n \n void main() {\n vec4 color = colorTransform * texture2D(tDiffuse, vUv) + colorBase;\n color.rgb = mix(color.rgb, vec3(color.r * color.g * color.b), multiplyChannels);\n gl_FragColor = color;\n }"},So=new P,Co=(new P).set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0),Mo=(new P).set(0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0),To=(new P).set(1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1),Ao=(new P).set(1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1),Po=new ut(0,0,0,0),Ro=new ut(0,0,0,1),Eo=new pt,Io=(new pt).set(1,0,0,0,-1,1,0,0,1),ko=(e,t,n,r)=>(new P).set(e,0,0,1-e,0,t,0,1-t,0,0,n,1-n,0,0,0,r);var Do;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ADDITIVE=1]="ADDITIVE"}(Do||(Do={}));class Oo extends mt{constructor(e,t=Do.ADDITIVE){const n=t===Do.ADDITIVE?{blendSrc:vt,blendDst:_t,blendEquation:wt,blendSrcAlpha:bt,blendDstAlpha:_t,blendEquationAlpha:wt}:{};super({uniforms:ft.clone(xo.uniforms),vertexShader:xo.vertexShader,fragmentShader:xo.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,...n}),this.update(e)}update(e){return void 0!==(null==e?void 0:e.texture)&&(this.uniforms.tDiffuse.value=null==e?void 0:e.texture),void 0!==(null==e?void 0:e.colorTransform)&&(this.uniforms.colorTransform.value=null==e?void 0:e.colorTransform),void 0!==(null==e?void 0:e.colorBase)&&(this.uniforms.colorBase.value=null==e?void 0:e.colorBase),void 0!==(null==e?void 0:e.multiplyChannels)&&(this.uniforms.multiplyChannels.value=null==e?void 0:e.multiplyChannels),void 0!==(null==e?void 0:e.uvTransform)&&(this.uniforms.uvTransform.value=null==e?void 0:e.uvTransform),void 0!==(null==e?void 0:e.blending)&&(this.blending=null==e?void 0:e.blending),void 0!==(null==e?void 0:e.blendSrc)&&(this.blendSrc=null==e?void 0:e.blendSrc),void 0!==(null==e?void 0:e.blendDst)&&(this.blendDst=null==e?void 0:e.blendDst),void 0!==(null==e?void 0:e.blendEquation)&&(this.blendEquation=null==e?void 0:e.blendEquation),void 0!==(null==e?void 0:e.blendSrcAlpha)&&(this.blendSrcAlpha=null==e?void 0:e.blendSrcAlpha),void 0!==(null==e?void 0:e.blendDstAlpha)&&(this.blendDstAlpha=null==e?void 0:e.blendDstAlpha),void 0!==(null==e?void 0:e.blendEquationAlpha)&&(this.blendEquationAlpha=null==e?void 0:e.blendEquationAlpha),this}}const Lo={uniforms:{tDiffuse:{value:null},rangeMin:{value:new i(1/512,1/512)},rangeMax:{value:new i(1/512,1/512)}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform vec2 rangeMin;\n uniform vec2 rangeMax;\n varying vec2 vUv;\n \n void main() {\n vec4 baseColor = texture2D(tDiffuse, vUv);\n vec2 blur = mix(rangeMax, rangeMin, baseColor.a);\n vec4 sum = vec4( 0.0 );\n sum += texture2D(tDiffuse, vUv - 1.0 * blur) * 0.051;\n sum += texture2D(tDiffuse, vUv - 0.75 * blur) * 0.0918;\n sum += texture2D(tDiffuse, vUv - 0.5 * blur) * 0.12245;\n sum += texture2D(tDiffuse, vUv - 0.25 * blur) * 0.1531;\n sum += baseColor * 0.1633;\n sum += texture2D(tDiffuse, vUv + 0.25 * blur) * 0.1531;\n sum += texture2D(tDiffuse, vUv + 0.5 * blur) * 0.12245;\n sum += texture2D(tDiffuse, vUv + 0.75 * blur) * 0.0918;\n sum += texture2D(tDiffuse, vUv + 1.0 * blur) * 0.051;\n gl_FragColor = sum;\n }"};new i(.1,.9),new i(.1,.9);class Uo extends mt{constructor(e){super({defines:Object.assign({},Uo._linearDepthShader.defines),uniforms:ft.clone(Uo._linearDepthShader.uniforms),vertexShader:Uo._linearDepthShader.vertexShader,fragmentShader:Uo._linearDepthShader.fragmentShader,blending:gt}),this.update(e)}update(e){if(void 0!==(null==e?void 0:e.depthTexture)&&(this.uniforms.tDepth.value=null==e?void 0:e.depthTexture),void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far}return void 0!==(null==e?void 0:e.depthFilter)&&(this.uniforms.depthFilter.value=null==e?void 0:e.depthFilter),this}}Uo._linearDepthShader={uniforms:{tDepth:{value:null},depthFilter:{value:new ut(1,0,0,0)},cameraNear:{value:.1},cameraFar:{value:1}},defines:{PERSPECTIVE_CAMERA:1,ALPHA_DEPTH:0},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"uniform sampler2D tDepth;\n uniform vec4 depthFilter;\n uniform float cameraNear;\n uniform float cameraFar;\n varying vec2 vUv;\n \n #include <packing>\n \n float getLinearDepth(const in vec2 screenPosition) {\n float fragCoordZ = dot(texture2D(tDepth, screenPosition), depthFilter);\n #if PERSPECTIVE_CAMERA == 1\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return fragCoordZ;\n #endif\n }\n \n void main() {\n float depth = getLinearDepth(vUv);\n gl_FragColor = vec4(vec3(1.0 - depth), 1.0);\n }"};class Fo extends mt{constructor(e){var t;super({defines:Object.assign({...Fo._normalAndDepthShader.defines,FLOAT_BUFFER:(null==e?void 0:e.floatBufferType)?1:0,LINEAR_DEPTH:(null==e?void 0:e.linearDepth)?1:0}),uniforms:ft.clone(Fo._normalAndDepthShader.uniforms),vertexShader:Fo._normalAndDepthShader.vertexShader,fragmentShader:Fo._normalAndDepthShader.fragmentShader,blending:null!==(t=null==e?void 0:e.blending)&&void 0!==t?t:gt}),this.update(e)}update(e){if(void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far}return this}}Fo._normalAndDepthShader={uniforms:{cameraNear:{value:.1},cameraFar:{value:1}},defines:{FLOAT_BUFFER:0,LINEAR_DEPTH:0},vertexShader:"varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n#endif\n\n void main() {\n vNormal = normalMatrix * normal;\n vec4 viewPosition = modelViewMatrix * vec4(position, 1.0);\n #if LINEAR_DEPTH == 1\n vZ = viewPosition.z; \n #endif\n gl_Position = projectionMatrix * viewPosition;\n }",fragmentShader:"varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n uniform float cameraNear;\n uniform float cameraFar;\n#endif\n\n void main() {\n #if FLOAT_BUFFER == 1\n vec3 normal = normalize(vNormal);\n #else\n vec3 normal = normalize(vNormal) * 0.5 + 0.5;\n #endif\n #if LINEAR_DEPTH == 1\n float depth = (-vZ - cameraNear) / (cameraFar - cameraNear);\n #else\n float depth = gl_FragCoord.z;\n #endif\n gl_FragColor = vec4(normal, depth);\n }"};var No=function(){function e(){_(this,e),this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}return w(e,[{key:"setSize",value:function(){}},{key:"render",value:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}},{key:"dispose",value:function(){}}]),e}(),Bo=new $(-1,1,1,-1,0,1),zo=new c;zo.setAttribute("position",new Ue([-1,3,0,-1,-1,0,3,-1,0],3)),zo.setAttribute("uv",new Ue([0,2,0,0,2,0],2));var Ho=function(){function e(t){_(this,e),this._mesh=new K(zo,t)}return w(e,[{key:"dispose",value:function(){this._mesh.geometry.dispose()}},{key:"render",value:function(e){e.render(this._mesh,Bo)}},{key:"material",get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}]),e}();new ue;class jo{constructor(){this.bounds=new we(new s(-1,-1,-1),new s(1,1,1)),this.size=new s(2,2,2),this.center=new s(0,0,0),this.maxSceneDistanceFromCenter=Math.sqrt(3),this.maxSceneDistanceFrom0=Math.sqrt(3)}copyFrom(e){this.bounds.copy(e.bounds),this.size.copy(e.size),this.center.copy(e.center),this.maxSceneDistanceFromCenter=e.maxSceneDistanceFromCenter,this.maxSceneDistanceFrom0=e.maxSceneDistanceFrom0}updateFromObject(e){e.updateMatrixWorld(),this.bounds.setFromObject(e),this.updateFromBox(this.bounds)}updateFromBox(e){this.bounds!==e&&this.bounds.copy(e),this.bounds.getSize(this.size),this.bounds.getCenter(this.center),this.maxSceneDistanceFromCenter=this.size.length()/2,this.maxSceneDistanceFrom0=new s(Math.max(Math.abs(this.bounds.min.x),Math.abs(this.bounds.max.x)),Math.max(Math.abs(this.bounds.min.y),Math.abs(this.bounds.max.y)),Math.max(Math.abs(this.bounds.min.z),Math.abs(this.bounds.max.z))).length()}updateCameraViewVolumeFromBounds(e){e.updateMatrixWorld();const t=this.bounds.clone().applyMatrix4(e.matrixWorldInverse);e instanceof $?((e,t)=>{e.left=t.min.x,e.right=t.max.x,e.bottom=t.min.y,e.top=t.max.y,e.near=Math.min(-t.min.z,-t.max.z),e.far=Math.max(-t.min.z,-t.max.z),e.updateProjectionMatrix()})(e,t):e instanceof Z&&((e,t)=>{const n=Math.min(-t.min.z,-t.max.z),r=Math.max(-t.min.z,-t.max.z);if(n<.001)return;const a=Math.max(Math.abs(t.min.x),Math.abs(t.max.x)),i=Math.max(Math.abs(t.min.y),Math.abs(t.max.y));e.aspect=a/i,e.fov=J.radToDeg(2*Math.atan2(i,n)),e.near=n,e.far=r,e.updateProjectionMatrix()})(e,t)}getNearAndFarForPerspectiveCamera(e,t=1){const n=e.clone().sub(this.center).length();return[Math.max(.01,n-this.maxSceneDistanceFromCenter-.01),n+this.maxSceneDistanceFromCenter*t+.01]}}class Vo{changed(e){var t,n;const r=!(null===(t=this._lastCameraProjection)||void 0===t?void 0:t.equals(e.projectionMatrix))||!(null===(n=this._lastCameraWorld)||void 0===n?void 0:n.equals(e.matrixWorld));return this._lastCameraProjection=e.projectionMatrix.clone(),this._lastCameraWorld=e.matrixWorld.clone(),r}}class Go{constructor(){this._originalClearColor=new h,this._originalClearAlpha=0,this._originalAutoClear=!1,this._originalRenderTarget=null,this._screenSpaceQuad=new Ho(void 0),this._emptyScene=new yt,this._defaultCamera=new Z}renderWithOverrideMaterial(e,t,n,r,a,i,s){this._backup(e),this._prepareRenderer(e,a,i,s);const o=t.overrideMaterial;t.overrideMaterial=r,e.render(t,n),t.overrideMaterial=o,this._restore(e)}clear(e,t,n,r){this._backup(e),this._prepareRenderer(e,t,n,r),e.render(this._emptyScene,this._defaultCamera),this._restore(e)}render(e,t,n,r,a,i){this._backup(e),this._prepareRenderer(e,r,a,i),e.render(t,n),this._restore(e)}renderScreenSpace(e,t,n,r,a){this._backup(e),this._prepareRenderer(e,n,r,a),this._screenSpaceQuad.material=t,this._screenSpaceQuad.render(e),this._restore(e)}_prepareRenderer(e,t,n,r){e.setRenderTarget(t),e.autoClear=!1,null!=n&&(e.setClearColor(n),e.setClearAlpha(r||0),e.clear())}_backup(e){e.getClearColor(this._originalClearColor),this._originalClearAlpha=e.getClearAlpha(),this._originalAutoClear=e.autoClear,this._originalRenderTarget=e.getRenderTarget()}_restore(e){e.setClearColor(this._originalClearColor),e.setClearAlpha(this._originalClearAlpha),e.setRenderTarget(this._originalRenderTarget),e.autoClear=this._originalAutoClear}}class Ko{constructor(e,t){var n;this._renderPass=null!==(n=null==t?void 0:t._renderPass)&&void 0!==n?n:new Go,this._blurMaterial=new mt(null!=e?e:Lo),this._blurMaterial.depthTest=!1}dispose(){this._blurMaterial.dispose()}render(e,t,n,r){this._blurMaterial.uniforms.tDiffuse.value=t[0].texture,this._blurMaterial.uniforms.rangeMin.value.x=n[0],this._blurMaterial.uniforms.rangeMin.value.y=0,this._blurMaterial.uniforms.rangeMax.value.x=r[0],this._blurMaterial.uniforms.rangeMax.value.y=0,this._renderPass.renderScreenSpace(e,this._blurMaterial,t[1]),this._blurMaterial.uniforms.tDiffuse.value=t[1].texture,this._blurMaterial.uniforms.rangeMin.value.x=0,this._blurMaterial.uniforms.rangeMin.value.y=n[1],this._blurMaterial.uniforms.rangeMax.value.x=0,this._blurMaterial.uniforms.rangeMax.value.y=r[1],this._renderPass.renderScreenSpace(e,this._blurMaterial,t[2])}}class Wo{constructor(e){this.needsUpdate=!0,this._cache=null,this._cache=e}dispose(){var e;null===(e=this._cache)||void 0===e||e.dispose()}clear(){var e;null===(e=this._cache)||void 0===e||e.clear(),this.needsUpdate=!0}update(e){this.needsUpdate&&this._cache&&(e.traverse(e=>{var t,n,r;e.isLine||e.isPoints?null===(t=this._cache)||void 0===t||t.addLineOrPoint(e):e.isMesh?null===(n=this._cache)||void 0===n||n.addMesh(e):null===(r=this._cache)||void 0===r||r.addObject(e)}),this.needsUpdate=!1)}onBeforeRender(){var e;null===(e=this._cache)||void 0===e||e.onBeforeRender()}onAfterRender(){var e;null===(e=this._cache)||void 0===e||e.onAfterRender()}}class Xo{constructor(){this._cacheMap=new Map}dispose(){this._cacheMap.forEach(e=>{e.dispose()})}registerCache(e,t){this._cacheMap.set(e,new Wo(t))}clearCache(){this._cacheMap.forEach(e=>{e.clear()})}clearObjectCache(e){const t=this._cacheMap.get(e);t&&t.clear()}onBeforeRender(e,t){const n=this._cacheMap.get(e);n&&(n.update(t),n.onBeforeRender())}onAfterRender(e){const t=this._cacheMap.get(e);t&&t.onAfterRender()}render(e,t,n){const r=this._cacheMap.get(e);r&&(r.update(t),r.onBeforeRender()),n(),r&&r.onAfterRender()}}class qo{constructor(e){this._visibilityCache=new Map,this._isObjectInvisible=e}dispose(){this._visibilityCache.clear()}clear(){this._visibilityCache.clear()}addLineOrPoint(e){this._visibilityCache.set(e,e.visible)}addMesh(e){this._isObjectInvisible&&this._isObjectInvisible(e)&&this._visibilityCache.set(e,e.visible)}addObject(e){this._isObjectInvisible&&this._isObjectInvisible(e)&&this._visibilityCache.set(e,e.visible)}onBeforeRender(){this._visibilityCache.forEach((e,t)=>{t.visible=!1})}onAfterRender(){this._visibilityCache.forEach((e,t)=>{t.visible=e})}}class Qo{constructor(e){this._depthWriteCache=new Set,this._doNotWriteDepth=e}dispose(){this._depthWriteCache.clear()}clear(){this._depthWriteCache.clear()}addLineOrPoint(e){}addObject(e){}addMesh(e){this._doNotWriteDepth&&this._doNotWriteDepth(e)&&e.material instanceof H&&e.material.depthWrite&&this._depthWriteCache.add(e.material)}onBeforeRender(){this._depthWriteCache.forEach(e=>{e.depthWrite=!1})}onAfterRender(){this._depthWriteCache.forEach(e=>{e.depthWrite=!0})}}class Yo{get isFloatGBufferWithRgbNormalAlphaDepth(){return this.floatGBufferRgbNormalAlphaDepth}get gBufferTexture(){return this.depthNormalRenderTarget.texture}get depthBufferTexture(){return this.copyToSeparateDepthBuffer&&this.floatGBufferRgbNormalAlphaDepth?this.separateDeptRenderTarget.texture:this.depthNormalRenderTarget.depthTexture}get textureWithDepthValue(){return this.floatGBufferRgbNormalAlphaDepth?this.depthNormalRenderTarget.texture:this.depthNormalRenderTarget.depthTexture}get normalRenderMaterial(){var e;return this._normalRenderMaterial=null!==(e=this._normalRenderMaterial)&&void 0!==e?e:this.floatGBufferRgbNormalAlphaDepth?new Fo({blending:gt,floatBufferType:!0,linearDepth:!1}):new xt({blending:gt}),this._normalRenderMaterial}get depthNormalRenderTarget(){if(!this._depthNormalRenderTarget)if(this.floatGBufferRgbNormalAlphaDepth)this._depthNormalRenderTarget=new St(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale,{minFilter:this._targetMinificationTextureFilter,magFilter:this._targetMagnificationTextureFilter,type:ot,samples:this._samples});else{const e=new Ct(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale);e.format=Mt,e.type=Tt,this._depthNormalRenderTarget=new St(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale,{minFilter:this._targetMinificationTextureFilter,magFilter:this._targetMagnificationTextureFilter,depthTexture:e})}return this._depthNormalRenderTarget}get separateDeptRenderTarget(){return this._separateDeptRenderTarget||(this._separateDeptRenderTarget=new St(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale,{minFilter:this._targetMinificationTextureFilter,magFilter:this._targetMagnificationTextureFilter,type:ot,samples:0})),this._separateDeptRenderTarget}constructor(e,t){var n,r,a,i,s,o,l,h,d,c;this.floatGBufferRgbNormalAlphaDepth=!1,this.copyToSeparateDepthBuffer=!1,this.needsUpdate=!0,this.floatGBufferRgbNormalAlphaDepth=null!==(r=null===(n=null==t?void 0:t.capabilities)||void 0===n?void 0:n.isWebGL2)&&void 0!==r&&r,this._renderCacheManager=e,this._renderCacheManager&&this._renderCacheManager.registerCache(this,new qo(e=>{if(e.isMesh&&e.material){if(e.material.transparent&&e.material.opacity<.7||e.material.alphaTest>0)return!0;if(e.material instanceof T)return e.material.transmission>0}return!1})),this.parameters={depthNormalScale:null!==(a=null==t?void 0:t.depthNormalScale)&&void 0!==a?a:1},this._targetMinificationTextureFilter=null!==(i=null==t?void 0:t.textureMinificationFilter)&&void 0!==i?i:ae,this._targetMagnificationTextureFilter=null!==(s=null==t?void 0:t.textureMagnificationFilter)&&void 0!==s?s:ae,this._width=null!==(o=null==t?void 0:t.width)&&void 0!==o?o:1024,this._height=null!==(l=null==t?void 0:t.height)&&void 0!==l?l:1024,this._samples=null!==(h=null==t?void 0:t.samples)&&void 0!==h?h:0,this._shared=null!==(d=null==t?void 0:t.shared)&&void 0!==d&&d,this._renderPass=null!==(c=null==t?void 0:t.renderPass)&&void 0!==c?c:new Go}dispose(){var e,t;null===(e=this._normalRenderMaterial)||void 0===e||e.dispose(),null===(t=this._depthNormalRenderTarget)||void 0===t||t.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this._depthNormalRenderTarget)||void 0===n||n.setSize(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale)}render(e,t,n){if(this._shared&&!this.needsUpdate)return;this.needsUpdate=!1;const r=this.normalRenderMaterial;r instanceof Fo&&r.update({camera:n}),this._renderCacheManager?this._renderCacheManager.render(this,t,()=>{this._renderGBuffer(e,t,n)}):this._renderGBuffer(e,t,n),this.floatGBufferRgbNormalAlphaDepth&&this.copyToSeparateDepthBuffer&&this._copyDepthToSeparateDepthTexture(e,this.depthNormalRenderTarget)}_renderGBuffer(e,t,n){this._renderPass.renderWithOverrideMaterial(e,t,n,this.normalRenderMaterial,this.depthNormalRenderTarget,7829503,1)}getCopyMaterial(e){var t;return null!==(t=this._copyMaterial)&&void 0!==t||(this._copyMaterial=new Oo),this._copyMaterial.update(e)}_copyDepthToSeparateDepthTexture(e,t){this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:t.texture,blending:gt,colorTransform:Mo,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),this.separateDeptRenderTarget)}}class Zo{constructor(e,t,n){var r;this.needsUpdate=!0,this.noNeedOfUpdateCount=0,this._blurScale=1,this._shadowScale=1,this._groundGroup=t,this.shadowMapSize=null!==(r=n.shadowMapSize)&&void 0!==r?r:2048,this.parameters=this._getDefaultParameters(n),this._groundShadowFar=this.parameters.cameraFar,this._renderer=e,this._renderCacheManager=null==n?void 0:n._renderCacheManager,this._renderCacheManager&&this._renderCacheManager.registerCache(this,new qo(e=>e.isMesh&&!(e=>{var t;if(!e.isMesh)return!1;if(!e.castShadow&&!(null===(t=e.userData)||void 0===t?void 0:t.meshId))return!1;const n=e.material;return!n.transparent||n.opacity>.5})(e)||void 0!==e.name&&["Ground","Floor"].includes(e.name))),this.renderTarget=new St(this.shadowMapSize,this.shadowMapSize),this.renderTarget.texture.generateMipmaps=!1,this._renderTargetBlur=new St(this.shadowMapSize,this.shadowMapSize),this._renderTargetBlur.texture.generateMipmaps=!1,this.shadowGroundPlane=new Jo(this.renderTarget.texture,this.parameters),this._groundGroup.add(this.shadowGroundPlane),this._groundContactCamera=new $o,this._groundGroup.add(this._groundContactCamera),this._depthMaterial=new Pt,this._depthMaterial.userData.fadeoutBias={value:this.parameters.fadeoutBias},this._depthMaterial.userData.fadeoutFalloff={value:this.parameters.fadeoutFalloff},this._depthMaterial.onBeforeCompile=e=>{e.uniforms.fadeoutBias=this._depthMaterial.userData.fadeoutBias,e.uniforms.fadeoutFalloff=this._depthMaterial.userData.fadeoutFalloff,e.fragmentShader=`\n uniform float fadeoutBias;\n uniform float fadeoutFalloff;\n ${e.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );",Jo.alphaMap?"gl_FragColor = vec4(clamp(pow(1.0 + fadeoutBias - fragCoordZ, 1.0/(1.0-fadeoutFalloff)), 0.0, 1.0));":"gl_FragColor = vec4(vec3(0.0), clamp(pow(1.0 + fadeoutBias - fragCoordZ, 1.0/(1.0-fadeoutFalloff)), 0.0, 1.0));")}\n `},this._depthMaterial.side=j,this._depthMaterial.depthTest=!0,this._depthMaterial.depthWrite=!0,this._blurPass=new Ko(Lo,n),this.updatePlaneAndShadowCamera()}_getDefaultParameters(e){return{enabled:!0,cameraHelper:!1,alwaysUpdate:!1,fadeIn:!1,blurMin:.001,blurMax:.1,fadeoutFalloff:.9,fadeoutBias:.03,opacity:.5,maximumPlaneSize:20,planeSize:10,cameraFar:3,hardLayers:null,softLayers:null,polygonOffset:2,excludeGroundObjects:!0,...e}}dispose(){this.renderTarget.dispose(),this._renderTargetBlur.dispose(),this._blurPass.dispose(),this._depthMaterial.dispose()}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t]);void 0!==e.cameraFar&&(this._groundShadowFar=this.parameters.cameraFar)}applyParameters(){this.shadowGroundPlane.updateMaterial(this.parameters),this._groundContactCamera.updateCameraHelper(this.parameters.cameraHelper),this._groundContactCamera.far!==this.parameters.cameraFar&&this.updatePlaneAndShadowCamera();const e=this.parameters.fadeoutFalloff;this._depthMaterial.userData.fadeoutFalloff.value!==e&&(this._depthMaterial.userData.fadeoutFalloff.value=this.parameters.fadeoutFalloff);const t=this.parameters.fadeoutBias/this._groundContactCamera.far;this._depthMaterial.userData.fadeoutBias.value!==t&&(this._depthMaterial.userData.fadeoutBias.value=t),this.needsUpdate=!0}setScale(e,t){this._blurScale=e,this._shadowScale=null!=t?t:e,this.needsUpdate=!0}updateBounds(e,t){var n;this._groundShadowFar=this.parameters.cameraFar,this._groundShadowFar<e.size.z&&(this._groundShadowFar=1.01*e.size.z);const r=Math.max(e.size.x,e.size.z);this.parameters.planeSize=r+2*Math.max(this._blurScale,null!==(n=this._shadowScale)&&void 0!==n?n:1,1),this.parameters.planeSize>this.parameters.maximumPlaneSize?(this.parameters.planeSize=this.parameters.maximumPlaneSize,this._groundGroup.position.set(0,null!=t?t:0,0)):this._groundGroup.position.set(e.center.x,null!=t?t:0,e.center.z),this._groundGroup.updateMatrixWorld(),this.updatePlaneAndShadowCamera()}updatePlaneAndShadowCamera(){const e=this.parameters.planeSize;this.shadowGroundPlane.scale.x=e,this.shadowGroundPlane.scale.y=e,this._groundContactCamera.updateCameraFormPlaneSize(e,this._groundShadowFar),this.needsUpdate=!0}setGroundVisibility(e,t){this.shadowGroundPlane.updateVisibility(e)}render(e){if(this._groundContactCamera.updateCameraHelper(this.parameters.cameraHelper,e),this.shadowGroundPlane.visible=this.parameters.enabled,this.parameters.alwaysUpdate||this.needsUpdate)this.noNeedOfUpdateCount=0;else if(this.noNeedOfUpdateCount++,this.noNeedOfUpdateCount>=10)return;this.needsUpdate=!1,this.shadowGroundPlane.material.opacity=this.parameters.alwaysUpdate||!this.parameters.fadeIn?this.parameters.opacity:this.parameters.opacity*(this.noNeedOfUpdateCount+2)/12;const t=this._renderer.getClearAlpha();this._renderer.setClearAlpha(0),this._groundGroup.visible=!1,this.shadowGroundPlane.visible=!1,this._groundContactCamera.setCameraHelperVisibility(!1),0===this.noNeedOfUpdateCount?(this._renderGroundContact(e),this._renderBlur()):1===this.noNeedOfUpdateCount&&this._renderBlur(),this._renderReduceBandingBlur(),this._renderer.setRenderTarget(null),this._renderer.setClearAlpha(t),this._groundGroup.visible=!0,this.shadowGroundPlane.visible=this.parameters.enabled,this._groundContactCamera.setCameraHelperVisibility(this.parameters.cameraHelper)}_renderGroundContact(e){const t=e.background;e.background=null,e.overrideMaterial=this._depthMaterial,this._renderer.setRenderTarget(this.renderTarget),this._renderer.clear();const n=this._renderer.autoClear;this._renderer.autoClear=!1,this.parameters.hardLayers&&(this._groundContactCamera.layers.mask=this.parameters.hardLayers.mask,this._groundContactCamera.updateCameraFarPlane(10),this._depthMaterial.userData.fadeoutBias.value=.99,this._renderer.render(e,this._groundContactCamera),this._groundContactCamera.updateCameraFarPlane(this._groundShadowFar),this._depthMaterial.userData.fadeoutBias.value=this.parameters.fadeoutBias/this._groundShadowFar),this._groundContactCamera.layers.enableAll(),this.parameters.softLayers&&(this._groundContactCamera.layers.mask=this.parameters.softLayers.mask),this._renderCacheManager?this._renderCacheManager.render(this,e,()=>{this._renderer.render(e,this._groundContactCamera)}):this._renderer.render(e,this._groundContactCamera),this._renderer.autoClear=n,e.overrideMaterial=null,e.background=t}_renderBlur(){this._renderBlurPass(this._blurScale*this.parameters.blurMin/this.parameters.planeSize,this._blurScale*this.parameters.blurMax/this.parameters.planeSize)}_renderReduceBandingBlur(){const e=.01*this._blurScale/this.parameters.planeSize;this._renderBlurPass(e,e)}_renderBlurPass(e,t){this._blurPass.render(this._renderer,[this.renderTarget,this._renderTargetBlur,this.renderTarget],[e,e],[t,t])}}Zo.addTestMesh=!1;class Jo extends K{constructor(e,t){const n=new C({transparent:!0,depthWrite:!1});Jo.alphaMap&&n.color.set(0),n.polygonOffset=!0,super(new At(1,1,10,10),n),this.name="GroundContactShadowPlane",this.userData.isFloor=!0,this.renderOrder=1,this.receiveShadow=!1,this.layers.disableAll(),t&&this.updateMaterial(t),this.setShadowMap(e)}setVisibility(e){this.visible=e,this.visible?this.layers.enableAll():this.layers.disableAll()}setDepthWrite(e){const t=this.material;t.depthWrite=e,t.transparent=!e,t.needsUpdate=!0,this.setVisibility(e)}setReceiveShadow(e){this.receiveShadow=e,this.setVisibility(e)}setShadowMap(e){const t=this.material;t.map=e,Jo.alphaMap&&(t.alphaMap=e),t.needsUpdate=!0}updateMaterial(e){const t=this.material;t.opacity!==e.opacity&&(t.opacity=e.opacity),t.polygonOffsetFactor!==e.polygonOffset&&(t.polygonOffset=!0,t.polygonOffsetFactor=e.polygonOffset,t.polygonOffsetUnits=e.polygonOffset)}updateVisibility(e){e?this.layers.enableAll():this.layers.disableAll()}}Jo.alphaMap=!1;class $o extends ${constructor(){super(-1,1,-1,1,-1,1),this.rotation.x=Math.PI}updateCameraFormPlaneSize(e,t){var n;this.left=-e/2,this.right=e/2,this.top=-e/2,this.bottom=e/2,this.near=0,this.far=t,this.updateProjectionMatrix(),null===(n=this.cameraHelper)||void 0===n||n.update()}updateCameraFarPlane(e){var t;this.far=e,this.updateProjectionMatrix(),null===(t=this.cameraHelper)||void 0===t||t.update()}updateCameraHelper(e,t){var n,r,a;e?(this.cameraHelper=null!==(n=this.cameraHelper)&&void 0!==n?n:new Rt(this),this.cameraHelper.visible=!0,null==t||t.add(this.cameraHelper)):(null===(r=this.cameraHelper)||void 0===r?void 0:r.parent)&&(null===(a=this.cameraHelper)||void 0===a||a.removeFromParent())}setCameraHelperVisibility(e){this.cameraHelper&&(this.cameraHelper.visible=e)}}var el={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"},tl={uniforms:{tDiffuse:{value:null},resolution:{value:new i(1/1024,1/512)}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\tprecision highp float;\n\n\tuniform sampler2D tDiffuse;\n\n\tuniform vec2 resolution;\n\n\tvarying vec2 vUv;\n\n\t// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)\n\n\t//----------------------------------------------------------------------------------\n\t// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag\n\t// SDK Version: v3.00\n\t// Email: gameworks@nvidia.com\n\t// Site: http://developer.nvidia.com/\n\t//\n\t// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n\t//\n\t// Redistribution and use in source and binary forms, with or without\n\t// modification, are permitted provided that the following conditions\n\t// are met:\n\t// * Redistributions of source code must retain the above copyright\n\t// notice, this list of conditions and the following disclaimer.\n\t// * Redistributions in binary form must reproduce the above copyright\n\t// notice, this list of conditions and the following disclaimer in the\n\t// documentation and/or other materials provided with the distribution.\n\t// * Neither the name of NVIDIA CORPORATION nor the names of its\n\t// contributors may be used to endorse or promote products derived\n\t// from this software without specific prior written permission.\n\t//\n\t// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\n\t// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\t// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\t// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n\t// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\t// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n\t// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n\t// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n\t// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t//\n\t//----------------------------------------------------------------------------------\n\n\t#ifndef FXAA_DISCARD\n\t\t\t//\n\t\t\t// Only valid for PC OpenGL currently.\n\t\t\t// Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n\t\t\t//\n\t\t\t// 1 = Use discard on pixels which don't need AA.\n\t\t\t// For APIs which enable concurrent TEX+ROP from same surface.\n\t\t\t// 0 = Return unchanged color on pixels which don't need AA.\n\t\t\t//\n\t\t\t#define FXAA_DISCARD 0\n\t#endif\n\n\t/*--------------------------------------------------------------------------*/\n\t#define FxaaTexTop(t, p) texture2D(t, p, -100.0)\n\t#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), -100.0)\n\t/*--------------------------------------------------------------------------*/\n\n\t#define NUM_SAMPLES 5\n\n\t// assumes colors have premultipliedAlpha, so that the calculated color contrast is scaled by alpha\n\tfloat contrast( vec4 a, vec4 b ) {\n\t\t\tvec4 diff = abs( a - b );\n\t\t\treturn max( max( max( diff.r, diff.g ), diff.b ), diff.a );\n\t}\n\n\t/*============================================================================\n\n\t\t\t\t\t\t\t\t\tFXAA3 QUALITY - PC\n\n\t============================================================================*/\n\n\t/*--------------------------------------------------------------------------*/\n\tvec4 FxaaPixelShader(\n\t\t\tvec2 posM,\n\t\t\tsampler2D tex,\n\t\t\tvec2 fxaaQualityRcpFrame,\n\t\t\tfloat fxaaQualityEdgeThreshold,\n\t\t\tfloat fxaaQualityinvEdgeThreshold\n\t) {\n\t\t\tvec4 rgbaM = FxaaTexTop(tex, posM);\n\t\t\tvec4 rgbaS = FxaaTexOff(tex, posM, vec2( 0.0, 1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaE = FxaaTexOff(tex, posM, vec2( 1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaN = FxaaTexOff(tex, posM, vec2( 0.0,-1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaW = FxaaTexOff(tex, posM, vec2(-1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\t// . S .\n\t\t\t// W M E\n\t\t\t// . N .\n\n\t\t\tbool earlyExit = max( max( max(\n\t\t\t\t\tcontrast( rgbaM, rgbaN ),\n\t\t\t\t\tcontrast( rgbaM, rgbaS ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaE ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaW ) )\n\t\t\t\t\t< fxaaQualityEdgeThreshold;\n\t\t\t// . 0 .\n\t\t\t// 0 0 0\n\t\t\t// . 0 .\n\n\t\t\t#if (FXAA_DISCARD == 1)\n\t\t\t\t\tif(earlyExit) FxaaDiscard;\n\t\t\t#else\n\t\t\t\t\tif(earlyExit) return rgbaM;\n\t\t\t#endif\n\n\t\t\tfloat contrastN = contrast( rgbaM, rgbaN );\n\t\t\tfloat contrastS = contrast( rgbaM, rgbaS );\n\t\t\tfloat contrastE = contrast( rgbaM, rgbaE );\n\t\t\tfloat contrastW = contrast( rgbaM, rgbaW );\n\n\t\t\tfloat relativeVContrast = ( contrastN + contrastS ) - ( contrastE + contrastW );\n\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\tbool horzSpan = relativeVContrast > 0.;\n\t\t\t// . 1 .\n\t\t\t// 0 0 0\n\t\t\t// . 1 .\n\n\t\t\t// 45 deg edge detection and corners of objects, aka V/H contrast is too similar\n\t\t\tif( abs( relativeVContrast ) < .3 ) {\n\t\t\t\t\t// locate the edge\n\t\t\t\t\tvec2 dirToEdge;\n\t\t\t\t\tdirToEdge.x = contrastE > contrastW ? 1. : -1.;\n\t\t\t\t\tdirToEdge.y = contrastS > contrastN ? 1. : -1.;\n\t\t\t\t\t// . 2 . . 1 .\n\t\t\t\t\t// 1 0 2 ~= 0 0 1\n\t\t\t\t\t// . 1 . . 0 .\n\n\t\t\t\t\t// tap 2 pixels and see which ones are \"outside\" the edge, to\n\t\t\t\t\t// determine if the edge is vertical or horizontal\n\n\t\t\t\t\tvec4 rgbaAlongH = FxaaTexOff(tex, posM, vec2( dirToEdge.x, -dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongH = contrast( rgbaM, rgbaAlongH );\n\t\t\t\t\t// . 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 H\n\n\t\t\t\t\tvec4 rgbaAlongV = FxaaTexOff(tex, posM, vec2( -dirToEdge.x, dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongV = contrast( rgbaM, rgbaAlongV );\n\t\t\t\t\t// V 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 .\n\n\t\t\t\t\trelativeVContrast = matchAlongV - matchAlongH;\n\t\t\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\t\t\tif( abs( relativeVContrast ) < .3 ) { // 45 deg edge\n\t\t\t\t\t\t\t// 1 1 .\n\t\t\t\t\t\t\t// 0 0 1\n\t\t\t\t\t\t\t// . 0 1\n\n\t\t\t\t\t\t\t// do a simple blur\n\t\t\t\t\t\t\treturn mix(\n\t\t\t\t\t\t\t\t\trgbaM,\n\t\t\t\t\t\t\t\t\t(rgbaN + rgbaS + rgbaE + rgbaW) * .25,\n\t\t\t\t\t\t\t\t\t.4\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\thorzSpan = relativeVContrast > 0.;\n\t\t\t}\n\n\t\t\tif(!horzSpan) rgbaN = rgbaW;\n\t\t\tif(!horzSpan) rgbaS = rgbaE;\n\t\t\t// . 0 . 1\n\t\t\t// 1 0 1 -> 0\n\t\t\t// . 0 . 1\n\n\t\t\tbool pairN = contrast( rgbaM, rgbaN ) > contrast( rgbaM, rgbaS );\n\t\t\tif(!pairN) rgbaN = rgbaS;\n\n\t\t\tvec2 offNP;\n\t\t\toffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n\t\t\toffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n\n\t\t\tbool doneN = false;\n\t\t\tbool doneP = false;\n\n\t\t\tfloat nDist = 0.;\n\t\t\tfloat pDist = 0.;\n\n\t\t\tvec2 posN = posM;\n\t\t\tvec2 posP = posM;\n\n\t\t\tint iterationsUsed = 0;\n\t\t\tint iterationsUsedN = 0;\n\t\t\tint iterationsUsedP = 0;\n\t\t\tfor( int i = 0; i < NUM_SAMPLES; i++ ) {\n\t\t\t\t\titerationsUsed = i;\n\n\t\t\t\t\tfloat increment = float(i + 1);\n\n\t\t\t\t\tif(!doneN) {\n\t\t\t\t\t\t\tnDist += increment;\n\t\t\t\t\t\t\tposN = posM + offNP * nDist;\n\t\t\t\t\t\t\tvec4 rgbaEndN = FxaaTexTop(tex, posN.xy);\n\t\t\t\t\t\t\tdoneN = contrast( rgbaEndN, rgbaM ) > contrast( rgbaEndN, rgbaN );\n\t\t\t\t\t\t\titerationsUsedN = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!doneP) {\n\t\t\t\t\t\t\tpDist += increment;\n\t\t\t\t\t\t\tposP = posM - offNP * pDist;\n\t\t\t\t\t\t\tvec4 rgbaEndP = FxaaTexTop(tex, posP.xy);\n\t\t\t\t\t\t\tdoneP = contrast( rgbaEndP, rgbaM ) > contrast( rgbaEndP, rgbaN );\n\t\t\t\t\t\t\titerationsUsedP = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(doneN || doneP) break;\n\t\t\t}\n\n\n\t\t\tif ( !doneP && !doneN ) return rgbaM; // failed to find end of edge\n\n\t\t\tfloat dist = min(\n\t\t\t\t\tdoneN ? float( iterationsUsedN ) / float( NUM_SAMPLES - 1 ) : 1.,\n\t\t\t\t\tdoneP ? float( iterationsUsedP ) / float( NUM_SAMPLES - 1 ) : 1.\n\t\t\t);\n\n\t\t\t// hacky way of reduces blurriness of mostly diagonal edges\n\t\t\t// but reduces AA quality\n\t\t\tdist = pow(dist, .5);\n\n\t\t\tdist = 1. - dist;\n\n\t\t\treturn mix(\n\t\t\t\t\trgbaM,\n\t\t\t\t\trgbaN,\n\t\t\t\t\tdist * .5\n\t\t\t);\n\t}\n\n\tvoid main() {\n\t\t\tconst float edgeDetectionQuality = .2;\n\t\t\tconst float invEdgeDetectionQuality = 1. / edgeDetectionQuality;\n\n\t\t\tgl_FragColor = FxaaPixelShader(\n\t\t\t\t\tvUv,\n\t\t\t\t\ttDiffuse,\n\t\t\t\t\tresolution,\n\t\t\t\t\tedgeDetectionQuality, // [0,1] contrast needed, otherwise early discard\n\t\t\t\t\tinvEdgeDetectionQuality\n\t\t\t);\n\n\t}\n\t"};class nl extends No{constructor(e,t,n,r,a){var s;super(),this.patternTexture=null,this._gBufferRenderTarget=null==a?void 0:a._gBufferRenderTarget,this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new h(1,1,1),this.hiddenEdgeColor=new h(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=(null==a?void 0:a.downSampleRatio)||2,this.pulsePeriod=0,this.edgeDetectionFxaa=(null==a?void 0:a.edgeDetectionFxaa)||!1,this._visibilityCache=new Map,this.resolution=void 0!==e?new i(e.x,e.y):new i(256,256);const o=Math.round(this.resolution.x/this.downSampleRatio),l=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new St(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this._gBufferRenderTarget||(this.depthMaterial=new Pt,this.depthMaterial.side=j,this.depthMaterial.depthPacking=Et,this.depthMaterial.blending=gt),this.prepareMaskMaterial=this._getPrepareMaskMaterial(null===(s=this._gBufferRenderTarget)||void 0===s?void 0:s.isFloatGBufferWithRgbNormalAlphaDepth),this.prepareMaskMaterial.side=j,this.prepareMaskMaterial.fragmentShader=function(e,t){const n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this._gBufferRenderTarget||(this.renderTargetDepthBuffer=new St(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1),this.edgeDetectionFxaa&&(this.fxaaRenderMaterial=new mt(tl),this.fxaaRenderMaterial.uniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,this.fxaaRenderMaterial.uniforms.resolution.value.set(1/this.resolution.x,1/this.resolution.y),this.renderTargetFxaaBuffer=new St(this.resolution.x,this.resolution.y),this.renderTargetFxaaBuffer.texture.name="OutlinePass.fxaa",this.renderTargetFxaaBuffer.texture.generateMipmaps=!1),this.renderTargetMaskDownSampleBuffer=new St(o,l),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new St(o,l),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new St(Math.round(o/2),Math.round(l/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this._getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new St(o,l),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new St(Math.round(o/2),Math.round(l/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1,this.separableBlurMaterial1=this._getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(o,l),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this._getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(o/2),Math.round(l/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this._getOverlayMaterial();const d=el;this.copyUniforms=ft.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new mt({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:gt,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new h,this.oldClearAlpha=1,this.fsQuad=new Ho(void 0),this.tempPulseColor1=new h,this.tempPulseColor2=new h,this.textureMatrix=new P}dispose(){var e,t,n,r;this.renderTargetMaskBuffer.dispose(),null===(e=this.renderTargetFxaaBuffer)||void 0===e||e.dispose(),null===(t=this.renderTargetDepthBuffer)||void 0===t||t.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose(),null===(n=this.depthMaterial)||void 0===n||n.dispose(),this.prepareMaskMaterial.dispose(),null===(r=this.fxaaRenderMaterial)||void 0===r||r.dispose(),this.edgeDetectionMaterial.dispose(),this.separableBlurMaterial1.dispose(),this.separableBlurMaterial2.dispose(),this.overlayMaterial.dispose(),this.materialCopy.dispose(),this.fsQuad.dispose()}setSize(e,t){var n,r,a;this.renderTargetMaskBuffer.setSize(e,t),null===(n=this.renderTargetDepthBuffer)||void 0===n||n.setSize(e,t);let i=Math.round(e/this.downSampleRatio),s=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(i,s),this.renderTargetBlurBuffer1.setSize(i,s),this.renderTargetEdgeBuffer1.setSize(i,s),this.separableBlurMaterial1.uniforms.texSize.value.set(i,s),i=Math.round(i/2),s=Math.round(s/2),this.renderTargetBlurBuffer2.setSize(i,s),this.renderTargetEdgeBuffer2.setSize(i,s),this.separableBlurMaterial2.uniforms.texSize.value.set(i,s),null===(r=this.fxaaRenderMaterial)||void 0===r||r.uniforms.resolution.value.set(1/this.resolution.x,1/this.resolution.y),null===(a=this.renderTargetFxaaBuffer)||void 0===a||a.setSize(e,t)}_changeVisibilityOfSelectedObjects(e){const t=this._visibilityCache;function n(n){n.isMesh&&(!0===e?n.visible=t.get(n):(t.set(n,n.visible),n.visible=e))}this.selectedObjects.forEach(e=>e.traverse(n))}_changeVisibilityOfNonSelectedObjects(e){const t=this._visibilityCache,n=[];function r(e){e.isMesh&&n.push(e)}this.selectedObjects.forEach(e=>e.traverse(r)),this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite){if(!1===n.some(e=>e.id===r.id)){const n=r.visible;!1!==e&&!0!==t.get(r)||(r.visible=e),t.set(r,n)}}else(r.isPoints||r.isLine)&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}))}_updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,n,r,a){var i,s;if(this.selectedObjects.length>0){null===(i=this._gBufferRenderTarget)||void 0===i||i.render(e,this.renderScene,this.renderCamera),e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,a&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this._changeVisibilityOfSelectedObjects(!1);const r=this.renderScene.background;this.renderScene.background=null,this.renderTargetDepthBuffer&&this.depthMaterial&&(this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera)),this._changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this._updateTextureMatrix(),this._changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this._gBufferRenderTarget?this.prepareMaskMaterial.uniforms.depthTexture.value=this._gBufferRenderTarget.textureWithDepthValue:this.prepareMaskMaterial.uniforms.depthTexture.value=null===(s=this.renderTargetDepthBuffer)||void 0===s?void 0:s.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this._changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r;let o=this.renderTargetMaskBuffer;if(this.edgeDetectionFxaa&&this.fxaaRenderMaterial&&this.renderTargetFxaaBuffer&&(this.fxaaRenderMaterial.uniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,this.fsQuad.material=this.fxaaRenderMaterial,e.setRenderTarget(this.renderTargetFxaaBuffer),e.clear(),this.fsQuad.render(e),o=this.renderTargetFxaaBuffer),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=o.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=nl.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=nl.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=nl.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=nl.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=o.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,a&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&n&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e))}_getPrepareMaskMaterial(e){return new mt({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new i(.5,.5)},textureMatrix:{value:null}},defines:{FLOAT_ALPHA_DEPTH:e?1:0},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t\tvPosition = mvPosition;\n\n\t\t\t\t\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t\t\t\t\t#ifdef USE_INSTANCING\n\n\t\t\t\t\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t\t\t\t\t#endif\n\t\t\t\t\t\n\t\t\t\t\tworldPosition = modelMatrix * worldPosition;\n\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\n\t\t\t\tvoid main() {\n\n #if FLOAT_ALPHA_DEPTH == 1\n\t\t\t\t\t float depth = texture2DProj( depthTexture, projTexCoord ).w;\n #else\n float depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n #endif\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\n\t\t\t\t}"})}_getEdgeDetectionMaterial(){return new mt({uniforms:{maskTexture:{value:null},texSize:{value:new i(.5,.5)},visibleEdgeColor:{value:new s(1,1,1)},hiddenEdgeColor:{value:new s(1,1,1)}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}_getSeperableBlurMaterial(e){return new mt({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new i(.5,.5)},direction:{value:new i(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat sigma = kernelRadius/2.0;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, sigma);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = kernelRadius * float(i) / float(MAX_RADIUS);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, sigma);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}_getOverlayMaterial(){return new mt({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n }",blending:It,depthTest:!1,depthWrite:!1,transparent:!0})}}nl.BlurDirectionX=new i(1,0),nl.BlurDirectionY=new i(0,1);class rl{get isOutlinePassActivated(){return this.outlinePassActivated}constructor(e,t,n,r){this._width=0,this._height=0,this._effectComposer=null,this.outlinePass=null,this.outlinePassActivated=!1,this._effectComposer=e,this._gBufferRenderTarget=null==r?void 0:r._gBufferRenderTarget,this._width=t,this._height=n,this.parameters={enabled:!0,edgeStrength:2,edgeGlow:1,edgeThickness:2,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16777215,hiddenEdgeColor:16777215,...r}}dispose(){var e;null===(e=this.outlinePass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.outlinePass)||void 0===n||n.setSize(e,t)}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t])}applyParameters(){this.outlinePass&&(this.outlinePass.edgeStrength=this.parameters.edgeStrength,this.outlinePass.edgeGlow=this.parameters.edgeGlow,this.outlinePass.edgeThickness=this.parameters.edgeThickness,this.outlinePass.pulsePeriod=this.parameters.pulsePeriod,this.outlinePass.usePatternTexture=this.parameters.usePatternTexture,this.outlinePass.visibleEdgeColor.set(this.parameters.visibleEdgeColor),this.outlinePass.hiddenEdgeColor.set(this.parameters.hiddenEdgeColor))}activateOutline(e,t){var n;if(!this.parameters.enabled)return void this.deactivateOutline();const r=(null===(n=this.outlinePass)||void 0===n?void 0:n.renderCamera)&&t.isPerspectiveCamera!==this.outlinePass.renderCamera.isPerspectiveCamera;this.outlinePass&&(this.outlinePass.renderScene=e,this.outlinePass.renderCamera=t),!r&&this.outlinePassActivated||(!r&&this.outlinePass||(this.outlinePass=new nl(new i(this._width,this._height),e,t,[],{downSampleRatio:2,edgeDetectionFxaa:!0,_gBufferRenderTarget:this._gBufferRenderTarget})),this.applyParameters(),this._effectComposer&&this._effectComposer.addPass(this.outlinePass),this.outlinePassActivated=!0)}deactivateOutline(){this.outlinePassActivated&&(this.outlinePass&&this._effectComposer&&this._effectComposer.removePass(this.outlinePass),this.outlinePassActivated=!1)}updateOutline(e,t,n){n.length>0?(this.activateOutline(e,t),this.outlinePass&&(this.outlinePass.selectedObjects=n)):this.deactivateOutline()}}var al,il=function(e){g(n,e);var t=v(n);function n(e,r){var a;_(this,n);var i=new c;i.setAttribute("position",new Ue([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere();var s=new z({fog:!1});(a=t.call(this,i,s)).light=e,a.color=r,a.type="RectAreaLightHelper";var o=new c;return o.setAttribute("position",new Ue([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),o.computeBoundingSphere(),a.add(new K(o,new C({side:kt,fog:!1}))),a}return w(n,[{key:"updateMatrixWorld",value:function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}]),n}(X);!function(e){e[e.DirectionalLightShadow=0]="DirectionalLightShadow",e[e.SpotLightShadow=1]="SpotLightShadow"}(al||(al={}));const sl={alwaysUpdate:!1,enableShadowMap:!0,layers:null,shadowLightSourceType:al.DirectionalLightShadow,maximumNumberOfLightSources:-1,directionalDependency:1,directionalExponent:1,groundContainment:1,fadeOutDistance:.1,fadeOutBlur:20};class ol{get shadowTexture(){return this._shadowRenderTarget.texture}constructor(e,t,n){var r,a;this.needsUpdate=!1,this.shadowTypeNeedsUpdate=!0,this.shadowConfiguration=new dl,this._shadowLightSources=[],this._shadowScale=1,this._renderPass=new Go,this._cameraUpdate=new Vo,this._renderCacheManager=e,this._viewportSize=new i(t.x,t.y),this._samples=null!==(r=null==n?void 0:n.samples)&&void 0!==r?r:0,this._shadowMapSize=null!==(a=null==n?void 0:n.shadowMapSize)&&void 0!==a?a:1024,this.parameters=this._getScreenSpaceShadowMapParameters(n),this.castShadow=this.parameters.enableShadowMap,this._shadowMapPassOverrideMaterialCache=new hl(this.parameters),this._renderCacheManager.registerCache(this,this._shadowMapPassOverrideMaterialCache);const s=this._samples;this._shadowRenderTarget=new St(this._viewportSize.x,this._viewportSize.y,{samples:s,format:lt})}_getScreenSpaceShadowMapParameters(e){return{...sl,...e}}dispose(){this._shadowLightSources.forEach(e=>e.dispose()),this._shadowRenderTarget.dispose(),this._shadowMapPassOverrideMaterialCache.dispose()}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t])}updateBounds(e,t){const n=this._shadowScale;this._shadowScale=t,Math.abs(n-this._shadowScale)>1e-5&&(this.shadowTypeNeedsUpdate=!0),this._shadowLightSources.forEach(t=>t.updateBounds(e)),this._shadowMapPassOverrideMaterialCache.setBoundingBox(e.bounds)}forceShadowUpdate(){this._shadowLightSources.forEach(e=>e.forceShadowUpdate()),this.needsUpdate=!0}getShadowLightSources(){return this._shadowLightSources.map(e=>e.getShadowLight())}findShadowLightSource(e){var t;return null===(t=this._shadowLightSources.find(t=>t.getOriginalLight()===e))||void 0===t?void 0:t.getShadowLight()}addRectAreaLight(e,t){const n=new ul(e,{shadowMapSize:this._shadowMapSize,shadowLightSourceType:this.parameters.shadowLightSourceType});this._shadowLightSources.push(n),n.addTo(t),n.updatePositionAndTarget(),this.needsUpdate=!0}updateRectAreaLights(e,t){this._shadowLightSources=this._shadowLightSources.filter(n=>{if(n instanceof ul){const t=n.getRectAreaLight();if(e.includes(t))return n.updatePositionAndTarget(),!0}return n.removeFrom(t),n.dispose(),!1}),e.forEach(e=>{this._shadowLightSources.find(t=>t instanceof ul&&t.getRectAreaLight()===e)||this.addRectAreaLight(e,t)}),this.needsUpdate=!0,this.shadowTypeNeedsUpdate=!0}createShadowFromLightSources(e,t){this._shadowLightSources=this._shadowLightSources.filter(t=>{t.removeFrom(e),t.dispose()});const n=1/(t.length>0?Math.max(...t.map(e=>e.maxIntensity)):1);this._addShadowFromLightSources(t,n),this._shadowLightSources.forEach(t=>{t.addTo(e),t.updatePositionAndTarget()}),this.needsUpdate=!0,this.shadowTypeNeedsUpdate=!0}_addShadowFromLightSources(e,t){e.forEach(e=>{const n=e.maxIntensity*t;if(n>=.1&&e.position.z>=0){const t=new s(e.position.x,e.position.z,e.position.y).multiplyScalar(7),r=new pl(t,n,{shadowMapSize:this._shadowMapSize,shadowLightSourceType:this.parameters.shadowLightSourceType});this._shadowLightSources.push(r)}})}setSize(e,t){this._viewportSize=new i(e,t),this._shadowRenderTarget.setSize(this._viewportSize.x,this._viewportSize.y)}updatePositionAndTarget(){this._shadowLightSources.forEach(e=>e.updatePositionAndTarget())}renderShadowMap(e,t,n){if(!(this.needsUpdate||this.parameters.alwaysUpdate||this._cameraUpdate.changed(n)))return;this.needsUpdate=!1,this.shadowTypeNeedsUpdate&&(this.shadowTypeNeedsUpdate=!1,this.needsUpdate=!0,this._updateShadowType(e));const r=t.background,a=t.environment,i=n.layers.mask;t.environment=null,t.background=null,this.parameters.layers&&(n.layers.mask=this.parameters.layers.mask),this._renderSimpleShadowMapFromShadowLightSources(e,t,n),n.layers.mask=i,t.environment=a,t.background=r}_renderSimpleShadowMapFromShadowLightSources(e,t,n){this._shadowMapPassOverrideMaterialCache.setShadowParameters(this.parameters.directionalDependency,this.parameters.directionalExponent,this.parameters.groundContainment,this.parameters.fadeOutDistance*this._shadowScale,this.parameters.fadeOutBlur);const r=this._getSortedShadowLightSources();0===r.length?this._renderPass.clear(e,this._shadowRenderTarget,16777215,1):(this._setShadowLightSourcesIntensity(r),this._renderCacheManager.render(this,t,()=>{this._renderPass.render(e,t,n,this._shadowRenderTarget,16777215,1)}),this._shadowLightSources.forEach(e=>e.finishRenderShadow()))}_getSortedShadowLightSources(){let e=[];return this._shadowLightSources.forEach(t=>e.push(...t.prepareRenderShadow())),e.sort((e,t)=>e.light.castShadow&&!t.light.castShadow?-1:!e.light.castShadow&&t.light.castShadow?1:t.intensity-e.intensity),e}_setShadowLightSourcesIntensity(e){var t;let n=0;for(let t=0;t<e.length;t++){const r=e[t];(this.parameters.maximumNumberOfLightSources<0||t<this.parameters.maximumNumberOfLightSources)&&(n+=r.intensity)}for(let r=0;r<e.length;r++){const a=e[r];this.parameters.maximumNumberOfLightSources<0||r<this.parameters.maximumNumberOfLightSources?(a.light.visible=!0,a.light.intensity=a.intensity/n,(t=a.light).castShadow&&(t.castShadow=this.castShadow)):(a.light.visible=!1,a.light.intensity=0,a.light.castShadow=!1)}}_updateShadowType(e){e.shadowMap.type=this.shadowConfiguration.currentConfiguration.type;const t=this.parameters.enableShadowMap&&this.shadowConfiguration.currentConfiguration.castShadow;e.shadowMap.enabled=t,e.shadowMap.needsUpdate=!0,this.castShadow=t&&this.shadowConfiguration.currentConfiguration.castShadow,this._shadowLightSources.forEach(e=>e._updateShadowType(this.shadowConfiguration.currentConfiguration,this._shadowScale))}switchType(e){return!!this.shadowConfiguration.switchType(e)&&(this.needsUpdate=!0,this.shadowTypeNeedsUpdate=!0,!0)}}var ll;!function(e){e[e.Default=0]="Default",e[e.Unlit=1]="Unlit",e[e.Emissive=2]="Emissive",e[e.Shadow=3]="Shadow"}(ll||(ll={}));class hl{constructor(e){var t,n;this._sceneBoxMin=new s(-1,-1,-1),this._sceneBoxMax=new s(1,1,1),this._distributionProperties=new ut(1,1,1,0),this._objectCache=new Map,this._shadowFadeOut=new i(null!==(t=null==e?void 0:e.fadeOutTo)&&void 0!==t?t:.5,null!==(n=null==e?void 0:e.fadeOutBlur)&&void 0!==n?n:60),this._shadowObjectMaterial=this._createShadowMaterial(ll.Default),this._unlitMaterial=this._createShadowMaterial(ll.Unlit),this._emissiveMaterial=this._createShadowMaterial(ll.Emissive),this._receiveShadowMaterial=this._createShadowMaterial(ll.Shadow)}dispose(){this._shadowObjectMaterial.dispose(),this._unlitMaterial.dispose(),this._emissiveMaterial.dispose(),this._receiveShadowMaterial.dispose()}setShadowParameters(e,t,n,r,a){this._distributionProperties.set(e,t,n,0),this._shadowFadeOut.set(r,a)}setBoundingBox(e){this._sceneBoxMin.copy(e.min),this._sceneBoxMax.copy(e.max)}_createShadowMaterial(e){let t;return t=e===ll.Emissive||e===ll.Unlit?new C({color:16777215,side:j}):e===ll.Shadow?new Dt({side:j}):hl.useModifiedMaterial?this._createCustomerShadowMaterial():new Ot({color:16777215,shininess:0,polygonOffsetFactor:0,polygonOffsetUnits:0,side:j}),t}_createCustomerShadowMaterial(){const e=new Lt({side:j});return e.onBeforeCompile=e=>{e.vertexShader="\n#define LAMBERT\n\nvarying vec3 vViewPosition;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n #include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\n vWorldPosition = worldPosition.xyz;\n}\n",e.fragmentShader="\n#define LAMBERT\n\nuniform vec3 diffuse;\nuniform float opacity;\n\nvarying vec3 vViewPosition;\nvarying vec3 vWorldPosition;\n\n#ifdef DYNAMIC_SHADOW_RADIUS\n uniform vec2 shadowFadeOut;\n uniform vec3 sceneBoxMin;\n uniform vec3 sceneBoxMax;\n#endif\nuniform vec4 distributionProperties;\n\n#include <common>\n#include <packing>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec2 getShadowDynamicScale() {\n\n vec2 dynamicScale = vec2(0.0, 1.0);\n\n#ifdef DYNAMIC_SHADOW_RADIUS\n if (shadowFadeOut.x > 0.0) {\n vec3 boxDistanceVec = max(vec3(0.0), max(sceneBoxMin - vWorldPosition, vWorldPosition - sceneBoxMax));\n float boxDistance = length(boxDistanceVec);\n \n // linear interpolation gives better result than smooth Hermite interpolation\n // float shadowBase = smoothstep(0.0, shadowFadeOut.x, boxDistance);\n float shadowBase = boxDistance / shadowFadeOut.x;\n\n shadowBase = clamp(shadowBase, 0.0, 1.0);\n dynamicScale = vec2(shadowBase, 1.0 - shadowBase);\n }\n#endif\n\n return dynamicScale;\n}\n\nfloat getShadowDynamicRadius(sampler2D shadowMap, float shadowBias, float shadowRadius, vec4 shadowCoord, vec2 shadowScale) {\n\n float dynamicRadius = shadowRadius;\n\n#ifdef DYNAMIC_SHADOW_RADIUS\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if (frustumTest && shadowFadeOut.x > 0.0) {\n float shadowDepth = unpackRGBAToDepth(texture2D(shadowMap, shadowCoord.xy));\n float delta = shadowDepth - shadowCoord.z;\n float fadeOutScale = max(shadowScale.x, smoothstep(max(shadowDepth, 0.5), shadowFadeOut.x * 0.5 + 0.5, shadowCoord.z));\n dynamicRadius = shadowRadius + shadowFadeOut.y * max(0.0, fadeOutScale);\n }\n#endif\n\n return dynamicRadius;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\n\t#include <logdepthbuf_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\t// accumulation\n\n\tvec3 geometryPosition = - vViewPosition;\n \n // add in three.js 157\n //vec3 geometryNormal = normal;\n\n vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n // remeove in three.js 157\n GeometricContext geometry;\n geometry.position = - vViewPosition;\n geometry.normal = normal;\n geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n IncidentLight directLight;\n\n vec3 accumulatedShadowLight = vec3(0.0);\n vec3 directionDependentShadowLight = vec3(1.0);\n float groundDistance = clamp((vWorldPosition.y - sceneBoxMin.y) * 100.0, 0.0, 1.0);\n float groundContainment = mix(1.0, groundDistance, distributionProperties.z);\n vec2 dynamicScale = getShadowDynamicScale();\n #if ( NUM_DIR_LIGHTS > 0 )\n\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n\n float dynamicRadius;\n vec3 incidentLightSum = vec3(0.0);\n vec3 incidentShadowLight = vec3(0.0);\n float shadowFactor;\n float dotNL;\n float incidentLightFactor;\n\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n directionalLight = directionalLights[ i ];\n\n // change for three.js 157\n //getDirectionalLightInfo( directionalLight, directLight );\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n\n dotNL = dot(dot(geometryNormal, geometryPosition) >= 0.0 ? -geometryNormal : geometryNormal, directLight.direction);\n incidentLightFactor = clamp(dotNL, 0.0, 1.0);\n\n dynamicRadius = 0.0;\n shadowFactor = 1.0;\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n dynamicRadius = getShadowDynamicRadius(directionalShadowMap[i], directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[i], dynamicScale);\n shadowFactor = ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, dynamicRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n\n accumulatedShadowLight += directLight.color * shadowFactor * saturate(min(dotNL * 10.0 + 0.9, 1.0));\n incidentLightFactor = mix(\n mix(pow(incidentLightFactor, 4.0), 1.0, step(0.99, shadowFactor)),\n pow(incidentLightFactor, distributionProperties.y),\n groundContainment);\n incidentLightSum += directLight.color * mix(incidentLightFactor, 1.0, groundContainment);\n incidentShadowLight += directLight.color * mix(\n shadowFactor * incidentLightFactor, \n mix(1.0, shadowFactor, incidentLightFactor), \n groundContainment);\n }\n #pragma unroll_loop_end\n\n if (dot(incidentLightSum, vec3(1.0)) > 0.01) {\n directionDependentShadowLight = incidentShadowLight / incidentLightSum;\n }\n #else\n accumulatedShadowLight = vec3(1.0);\n #endif \n\n\t// modulation\n\n\tvec3 outgoingLight = mix(accumulatedShadowLight, directionDependentShadowLight, max(distributionProperties.x, 1.0 - groundDistance));\n outgoingLight = dynamicScale.x + directionDependentShadowLight.y * outgoingLight;\n\n\t#include <opaque_fragment>\n\t#include <premultiplied_alpha_fragment>\n}\n",e.defines=Object.assign({...e.defines,DYNAMIC_SHADOW_RADIUS:""});const t=e.uniforms;t&&(t.distributionProperties={value:this._distributionProperties},t.shadowFadeOut={value:this._shadowFadeOut},t.sceneBoxMin={value:this._sceneBoxMin},t.sceneBoxMax={value:this._sceneBoxMax})},e}clear(){this._objectCache.clear()}addLineOrPoint(e){this._addCacheEntry(e,!1,!1)}addMesh(e){e.visible&&this._setMeshMaterialAndVisibility(e)}addObject(e){e.isLight&&!e.userData.shadowLightSource&&this._addCacheEntry(e,!1,!1)}_addCacheEntry(e,t,n,r){this._objectCache.set(e,{originalObject:{visible:e.visible,castShadow:e.castShadow,material:e.material},shadowObject:{visible:t,castShadow:n,material:r}})}onBeforeRender(){this._objectCache.forEach((e,t)=>{t.visible=e.shadowObject.visible,t.castShadow=e.shadowObject.castShadow,t instanceof K&&e.shadowObject.material&&(t.material=e.shadowObject.material)})}onAfterRender(){this._objectCache.forEach((e,t)=>{t.visible=e.originalObject.visible,t.castShadow=e.originalObject.castShadow,e.originalObject.material&&(t.material=e.originalObject.material)})}_setMeshMaterialAndVisibility(e){!e.material||!e.receiveShadow||Array.isArray(e.material)||!0===e.material.transparent&&e.material.opacity<.9?e.userData.isFloor?this._addCacheEntry(e,e.visible,e.castShadow,this._shadowObjectMaterial):e.material&&e.material.transparent&&e.material.opacity<.9?this._addCacheEntry(e,!1,e.castShadow,this._shadowObjectMaterial):e.receiveShadow?this._addCacheEntry(e,e.visible,!1,this._receiveShadowMaterial):this._addCacheEntry(e,!1,e.castShadow,e.material):this._setShadowMaterialForOpaqueObject(e)}_setShadowMaterialForOpaqueObject(e){const t=e.material;t instanceof z||t instanceof C?this._addCacheEntry(e,e.visible,e.castShadow,this._unlitMaterial):t instanceof H?this._setMeshShadowStandardMaterial(e,t):this._addCacheEntry(e,e.visible,e.castShadow,e.receiveShadow?this._shadowObjectMaterial:this._unlitMaterial)}_setMeshShadowStandardMaterial(e,t){const n=t.emissiveIntensity>0&&(t.emissive.r>0||t.emissive.g>0||t.emissive.b>0);this._addCacheEntry(e,e.visible,!n&&e.castShadow,n?this._emissiveMaterial:e.receiveShadow?this._shadowObjectMaterial:this._unlitMaterial)}}hl.useModifiedMaterial=!0;class dl{constructor(){var e;this.types=new Map([["off",dl._noShadow],["BasicShadowMap",dl._basicShadow],["PCFShadowMap",dl._pcfShadow],["PCFSoftShadowMap",dl._pcfSoftShadow],["VSMShadowMap",dl._vcmShadow]]),this.shadowType="PCFShadowMap",this.currentConfiguration=null!==(e=this.types.get(this.shadowType))&&void 0!==e?e:dl._defaultType}switchType(e){var t;return!!this.types.has(e)&&(this.currentConfiguration=null!==(t=this.types.get(e))&&void 0!==t?t:dl._defaultType,!0)}}dl._noShadow={castShadow:!1,type:Ut,bias:0,normalBias:0,radius:0},dl._basicShadow={castShadow:!0,type:Ft,bias:-5e-5,normalBias:.005,radius:0},dl._pcfShadow={castShadow:!0,type:Ut,bias:-5e-5,normalBias:.01,radius:4},dl._pcfSoftShadow={castShadow:!0,type:Nt,bias:-5e-5,normalBias:.01,radius:1},dl._vcmShadow={castShadow:!0,type:Bt,bias:1e-4,normalBias:0,radius:15},dl._defaultType=dl._pcfShadow;class cl{constructor(e,t){var n,r;this._isVisibleBackup=!0,this._castShadowBackup=!0,this._shadowMapSize=null!==(n=null==t?void 0:t.shadowMapSize)&&void 0!==n?n:1024,this._blurSamples=null!==(r=null==t?void 0:t._blurSamples)&&void 0!==r?r:8,this._shadowLightSource=e,this._shadowLightSource.visible=!1,this._shadowLightSource.castShadow=!0,this._shadowLightSource.shadow&&(this._shadowLightSource.shadow.mapSize=new i(this._shadowMapSize,this._shadowMapSize),this._shadowLightSource.shadow.blurSamples=this._blurSamples,this._shadowLightSource.shadow.autoUpdate=!1),this._shadowLightSource.userData.shadowLightSource=this}getPosition(){return this._shadowLightSource.position}getShadowLight(){return this._shadowLightSource}getOriginalLight(){return null}dispose(){this._shadowLightSource.dispose()}addTo(e){e.add(this._shadowLightSource)}removeFrom(e){e.remove(this._shadowLightSource)}updatePositionAndTarget(){this._updateShadowPositionAndTarget(this.getPosition(),new s(0,0,0))}updateBounds(e){if(this._shadowLightSource instanceof l){const t=this._shadowLightSource.shadow.camera,n=e.bounds.clone().applyMatrix4(t.matrixWorldInverse),r=Math.max(.001,Math.min(-n.min.z,-n.max.z)),a=Math.max(-n.min.z,-n.max.z),i=Math.max(Math.abs(n.min.x),Math.abs(n.max.x)),s=Math.max(Math.abs(n.min.y),Math.abs(n.max.y)),o=Math.atan2(1.05*Math.hypot(s,i),r);t.aspect=1,t.near=r,t.far=a,this._shadowLightSource.angle=o}else if(this._shadowLightSource.shadow){const t=this._shadowLightSource.shadow.camera;e.updateCameraViewVolumeFromBounds(t);const n=t;n.far+=n.far-n.near,n.updateProjectionMatrix()}this._shadowLightSource.shadow&&(this._shadowLightSource.shadow.needsUpdate=!0)}forceShadowUpdate(){this._shadowLightSource.shadow&&(this._shadowLightSource.shadow.needsUpdate=!0)}_updateShadowPositionAndTarget(e,t){var n,r,a;if(this._shadowLightSource instanceof l){const n=t.clone().sub(e),r=n.length();n.normalize();const a=t.clone().sub(n.clone().multiplyScalar(4*r));this._shadowLightSource.shadow.camera.position.copy(a),this._shadowLightSource.shadow.camera.position.copy(a),this._shadowLightSource.shadow.camera.lookAt(t),this._shadowLightSource.position.copy(a),this._shadowLightSource.lookAt(t)}else this._shadowLightSource.position.copy(e),this._shadowLightSource.lookAt(t),null===(n=this._shadowLightSource.shadow)||void 0===n||n.camera.position.copy(e),null===(r=this._shadowLightSource.shadow)||void 0===r||r.camera.lookAt(t);null===(a=this._shadowLightSource.shadow)||void 0===a||a.camera.updateMatrixWorld(),this._shadowLightSource.updateMatrixWorld()}_updateShadowType(e,t){const n=this._shadowLightSource.shadow;n&&(n.bias=e.bias,n.normalBias=e.normalBias*t,n.radius=e.radius,n.needsUpdate=!0)}prepareRenderShadow(){return[]}finishRenderShadow(){}}class ul extends cl{constructor(e,t){let n;switch(null==t?void 0:t.shadowLightSourceType){default:case al.DirectionalLightShadow:n=new a(16777215,1);break;case al.SpotLightShadow:n=new l(16777215,1,0,Math.PI/4,0)}n.position.copy(e.position),n.lookAt(0,0,0),super(n,t),this._rectAreaLight=e,this._rectAreaLight.userData.shadowLightSource=this,(null==t?void 0:t.addHelper)&&(this._rectLightHelper=new il(this._rectAreaLight),this._rectLightHelper.material.depthWrite=!1,this._rectAreaLight.add(this._rectLightHelper))}getPosition(){return this._rectAreaLight.position}getRectAreaLight(){return this._rectAreaLight}getOriginalLight(){return this._rectAreaLight}prepareRenderShadow(){return this._isVisibleBackup=this._rectAreaLight.visible,this._castShadowBackup=this._shadowLightSource.castShadow,this._shadowLightSource.visible=this._rectAreaLight.visible,this._rectAreaLight.visible=!1,this._shadowLightSource.visible?[{light:this._shadowLightSource,intensity:this._rectAreaLight.intensity}]:[]}finishRenderShadow(){this._shadowLightSource.visible=!1,this._shadowLightSource.castShadow=this._castShadowBackup,this._rectAreaLight.visible=this._isVisibleBackup}}class pl extends cl{constructor(e,t,n){const r=new a(16777215,t);r.position.copy(e),r.lookAt(0,0,0),r.updateMatrix(),r.castShadow=!0,super(r,n),this._position=e.clone(),this._intensity=t}getPosition(){return this._position}prepareRenderShadow(){return this._castShadowBackup=this._shadowLightSource.castShadow,this._shadowLightSource.visible=!0,[{light:this._shadowLightSource,intensity:this._intensity}]}finishRenderShadow(){this._shadowLightSource.castShadow=this._castShadowBackup,this._shadowLightSource.visible=!1}}var ml,fl,gl=new zt,vl=null,_l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Pass",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new yt,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gl;_(this,e),this.name=t,this.renderer=null,this.scene=n,this.camera=r,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}return w(e,[{key:"renderToScreen",get:function(){return!this.rtt},set:function(e){if(this.rtt===e){var t=this.fullscreenMaterial;null!==t&&(t.needsUpdate=!0),this.rtt=!e}}},{key:"mainScene",set:function(e){}},{key:"mainCamera",set:function(e){}},{key:"setRenderer",value:function(e){this.renderer=e}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(e){this.enabled=e}},{key:"fullscreenMaterial",get:function(){return null!==this.screen?this.screen.material:null},set:function(e){var t=this.screen;null!==t?t.material=e:((t=new K(function(){if(null===vl){var e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(vl=new c).setAttribute?(vl.setAttribute("position",new u(e,3)),vl.setAttribute("uv",new u(t,2))):(vl.addAttribute("position",new u(e,3)),vl.addAttribute("uv",new u(t,2)))}return vl}(),e)).frustumCulled=!1,null===this.scene&&(this.scene=new yt),this.scene.add(t),this.screen=t)}},{key:"getFullscreenMaterial",value:function(){return this.fullscreenMaterial}},{key:"setFullscreenMaterial",value:function(e){this.fullscreenMaterial=e}},{key:"getDepthTexture",value:function(){return null}},{key:"setDepthTexture",value:function(e){}},{key:"render",value:function(e,t,n,r,a){throw new Error("Render method not implemented!")}},{key:"setSize",value:function(e,t){}},{key:"initialize",value:function(e,t,n){}},{key:"dispose",value:function(){for(var t=0,n=Object.keys(this);t<n.length;t++){var r=n[t],a=this[r];(a instanceof St||a instanceof B||a instanceof fe||a instanceof e)&&this[r].dispose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LHW9tfD+2k4zGev23ExJb4YTRKWrj82N5LjJ26lj1BkGZ0CsXLGGELoPaYQomjTqPxYqhfwOwDliNGVqux9ffuybqOKgsbB51B1GbZfG8vHDBE2JQGib0C8YdyPG2epwAAAABJRU5ErkJggg==",bl="#define GLSLIFY 1\nvarying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",yl="#define GLSLIFY 1\nconst float g=1.6180339887498948482;const float a1=1.0/g;float r1(float n){return fract(1.1127756842787055+a1*n);}const vec4 hn=vec4(0.618033988749895,0.3247179572447458,0.2207440846057596,0.1673039782614187);vec4 sampleBlueNoise(sampler2D texture,int seed,vec2 repeat,vec2 texSize){vec2 size=vUv*texSize;vec2 blueNoiseSize=texSize/repeat;float blueNoiseIndex=floor(floor(size.y/blueNoiseSize.y)*repeat.x)+floor(size.x/blueNoiseSize.x);vec2 blueNoiseUv=vUv*repeat;vec4 blueNoise=textureLod(texture,blueNoiseUv,0.);if(seed!=0){blueNoise=fract(blueNoise+hn*float(seed));blueNoise.r=(blueNoise.r>0.5 ? 1.0-blueNoise.r : blueNoise.r)*2.0;blueNoise.g=(blueNoise.g>0.5 ? 1.0-blueNoise.g : blueNoise.g)*2.0;blueNoise.b=(blueNoise.b>0.5 ? 1.0-blueNoise.b : blueNoise.b)*2.0;blueNoise.a=(blueNoise.a>0.5 ? 1.0-blueNoise.a : blueNoise.a)*2.0;}return blueNoise;}",xl=function(e){g(n,e);var t=v(n);function n(e,r,a){var s;_(this,n),(s=t.call(this))._camera=e,s._scene=r,s.renderTarget=new St(1,1,{type:it,depthBuffer:!1});var o=a.replace("#include <sampleBlueNoise>",yl);return s.fullscreenMaterial=new mt({fragmentShader:o,vertexShader:bl,uniforms:{depthTexture:{value:null},normalTexture:{value:null},cameraNear:{value:0},cameraFar:{value:0},viewMatrix:{value:s._camera.matrixWorldInverse},projectionViewMatrix:{value:new P},projectionMatrixInverse:{value:s._camera.projectionMatrixInverse},cameraMatrixWorld:{value:s._camera.matrixWorld},texSize:{value:new i},blueNoiseTexture:{value:null},blueNoiseRepeat:{value:new i},aoDistance:{value:0},distancePower:{value:0},bias:{value:0},thickness:{value:0},power:{value:0},frame:{value:0}},blending:gt,depthWrite:!1,depthTest:!1,toneMapped:!1}),(new ue).load(wl,(function(e){e.minFilter=ae,e.magFilter=ae,e.wrapS=F,e.wrapT=F,e.colorSpace=ht,s.fullscreenMaterial.uniforms.blueNoiseTexture.value=e})),s}return w(n,[{key:"texture",get:function(){return this.renderTarget.texture}},{key:"setSize",value:function(e,t){this.renderTarget.setSize(e,t),this.fullscreenMaterial.uniforms.texSize.value.set(this.renderTarget.width,this.renderTarget.height)}},{key:"render",value:function(e){var t=+this.fullscreenMaterial.defines.spp;this.fullscreenMaterial.uniforms.frame.value=(this.fullscreenMaterial.uniforms.frame.value+t)%65536,this.fullscreenMaterial.uniforms.cameraNear.value=this._camera.near,this.fullscreenMaterial.uniforms.cameraFar.value=this._camera.far,this.fullscreenMaterial.uniforms.projectionViewMatrix.value.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);var n=this.fullscreenMaterial.uniforms.blueNoiseTexture.value;if(n){var r=n.source.data,a=r.width,i=r.height;this.fullscreenMaterial.uniforms.blueNoiseRepeat.value.set(this.renderTarget.width/a,this.renderTarget.height/i)}e.setRenderTarget(this.renderTarget),e.render(this.scene,this.camera)}}]),n}(_l),Sl=function(e){g(n,e);var t=v(n);function n(e,r){return _(this,n),t.call(this,e,r,"#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D depthTexture;uniform sampler2D normalTexture;uniform mat4 projectionViewMatrix;uniform mat4 cameraMatrixWorld;uniform sampler2D blueNoiseTexture;uniform vec2 blueNoiseRepeat;uniform vec2 texSize;uniform mat4 projectionMatrixInverse;uniform float aoDistance;uniform float distancePower;uniform float cameraNear;uniform float cameraFar;uniform int frame;uniform vec3[spp]samples;uniform float[spp]samplesR;\n#include <common>\n#include <packing>\n#include <sampleBlueNoise>\nvec3 getWorldPos(const float depth,const vec2 coord){float z=depth*2.0-1.0;vec4 clipSpacePosition=vec4(coord*2.0-1.0,z,1.0);vec4 viewSpacePosition=projectionMatrixInverse*clipSpacePosition;vec4 worldSpacePosition=cameraMatrixWorld*viewSpacePosition;worldSpacePosition.xyz/=worldSpacePosition.w;return worldSpacePosition.xyz;}vec3 computeNormal(vec3 worldPos,vec2 vUv){vec2 size=vec2(textureSize(depthTexture,0));ivec2 p=ivec2(vUv*size);float c0=texelFetch(depthTexture,p,0).x;float l2=texelFetch(depthTexture,p-ivec2(2,0),0).x;float l1=texelFetch(depthTexture,p-ivec2(1,0),0).x;float r1=texelFetch(depthTexture,p+ivec2(1,0),0).x;float r2=texelFetch(depthTexture,p+ivec2(2,0),0).x;float b2=texelFetch(depthTexture,p-ivec2(0,2),0).x;float b1=texelFetch(depthTexture,p-ivec2(0,1),0).x;float t1=texelFetch(depthTexture,p+ivec2(0,1),0).x;float t2=texelFetch(depthTexture,p+ivec2(0,2),0).x;float dl=abs((2.0*l1-l2)-c0);float dr=abs((2.0*r1-r2)-c0);float db=abs((2.0*b1-b2)-c0);float dt=abs((2.0*t1-t2)-c0);vec3 ce=getWorldPos(c0,vUv).xyz;vec3 dpdx=(dl<dr)? ce-getWorldPos(l1,(vUv-vec2(1.0/size.x,0.0))).xyz:-ce+getWorldPos(r1,(vUv+vec2(1.0/size.x,0.0))).xyz;vec3 dpdy=(db<dt)? ce-getWorldPos(b1,(vUv-vec2(0.0,1.0/size.y))).xyz:-ce+getWorldPos(t1,(vUv+vec2(0.0,1.0/size.y))).xyz;return normalize(cross(dpdx,dpdy));}highp float linearize_depth(highp float d,highp float zNear,highp float zFar){highp float z_n=2.0*d-1.0;return 2.0*zNear*zFar/(zFar+zNear-z_n*(zFar-zNear));}void main(){\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat depth=textureLod(depthTexture,vUv,0.).a;\n#else\nfloat depth=textureLod(depthTexture,vUv,0.).x;\n#endif\nif(depth==1.0){discard;return;}vec3 worldPos=getWorldPos(depth,vUv);\n#if NormalVectorSourceType == FLOAT_BUFFER_NORMAL\nvec3 normal=normalize(textureLod(normalTexture,vUv,0.).rgb);\n#else\nvec3 normal=computeNormal(worldPos,vUv);\n#endif\n#ifdef animatedNoise\nint seed=frame;\n#else\nint seed=0;\n#endif\nvec4 noise=sampleBlueNoise(blueNoiseTexture,seed,blueNoiseRepeat,texSize);vec3 randomVec=normalize(noise.rgb*2.0-1.0);vec3 tangent=normalize(randomVec-normal*dot(randomVec,normal));vec3 bitangent=cross(normal,tangent);mat3 tbn=mat3(tangent,bitangent,normal);float occluded=0.0;float totalWeight=0.0;vec3 samplePos;float sppF=float(spp);for(float i=0.0;i<sppF;i++){vec3 sampleDirection=tbn*samples[int(i)];if(dot(sampleDirection,normal)<0.0)sampleDirection*=-1.0;float moveAmt=samplesR[int(mod(i+noise.a*sppF,sppF))];samplePos=worldPos+aoDistance*moveAmt*sampleDirection;vec4 offset=projectionViewMatrix*vec4(samplePos,1.0);offset.xyz/=offset.w;offset.xyz=offset.xyz*0.5+0.5;\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat sampleDepth=textureLod(depthTexture,offset.xy,0.0).a;\n#else\nfloat sampleDepth=textureLod(depthTexture,offset.xy,0.0).x;\n#endif\nfloat distSample=linearize_depth(sampleDepth,cameraNear,cameraFar);float distWorld=linearize_depth(offset.z,cameraNear,cameraFar);float rangeCheck=smoothstep(0.0,1.0,aoDistance/(aoDistance*abs(distSample-distWorld)));rangeCheck=pow(rangeCheck,distancePower);float weight=dot(sampleDirection,normal);occluded+=rangeCheck*weight*(distSample<distWorld ? 1.0 : 0.0);totalWeight+=weight;}float occ=clamp(1.0-occluded/totalWeight,0.0,1.0);\n#ifdef MODULATE_RED_CHANNEL\ngl_FragColor=vec4(occ,1.0,1.0,1.0);\n#else\ngl_FragColor=vec4(normal,occ);\n#endif\n}")}return w(n)}(xl),Cl="#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D depthTexture;uniform mat4 projectionViewMatrix;uniform int frame;uniform sampler2D blueNoiseTexture;uniform vec2 blueNoiseRepeat;uniform vec2 texSize;uniform float aoDistance;uniform float distancePower;uniform float bias;uniform float thickness;\n#include <packing>\n#include <hbao_utils>\nfloat getOcclusion(const vec3 cameraPosition,const vec3 worldPos,const vec3 worldNormal,const float depth,const int seed,inout float totalWeight){vec4 blueNoise=sampleBlueNoise(blueNoiseTexture,seed,blueNoiseRepeat,texSize);vec3 sampleWorldDir=cosineSampleHemisphere(worldNormal,blueNoise.rg);vec3 sampleWorldPos=worldPos+aoDistance*pow(blueNoise.b,distancePower+1.0)*sampleWorldDir;vec4 sampleUv=projectionViewMatrix*vec4(sampleWorldPos,1.);sampleUv.xy/=sampleUv.w;sampleUv.xy=sampleUv.xy*0.5+0.5;\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat sampleDepth=textureLod(depthTexture,sampleUv.xy,0.0).a;\n#else\nfloat sampleDepth=textureLod(depthTexture,sampleUv.xy,0.0).r;\n#endif\nfloat deltaDepth=depth-sampleDepth;float d=distance(sampleWorldPos,cameraPosition);deltaDepth*=0.001*d*d;float th=thickness*0.01;float theta=dot(worldNormal,sampleWorldDir);totalWeight+=theta;if(deltaDepth<th){float horizon=sampleDepth+deltaDepth*bias*1000.;float occlusion=max(0.0,horizon-depth)*theta;float m=max(0.,1.-deltaDepth/th);occlusion=10.*occlusion*m/d;occlusion=sqrt(occlusion);return occlusion;}return 0.;}void main(){\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat depth=textureLod(depthTexture,vUv,0.0).a;\n#else\nfloat depth=textureLod(depthTexture,vUv,0.0).r;\n#endif\nif(depth==1.0){discard;return;}vec4 cameraPosition=cameraMatrixWorld*vec4(0.0,0.0,0.0,1.0);vec3 worldPos=getWorldPos(depth,vUv);vec3 worldNormal=getWorldNormal(vUv);float ao=0.0,totalWeight=0.0;for(int i=0;i<spp;i++){int seed=i;\n#ifdef animatedNoise\nseed+=frame;\n#endif\nfloat occlusion=getOcclusion(cameraPosition.xyz,worldPos,worldNormal,depth,seed,totalWeight);ao+=occlusion;}if(totalWeight>0.)ao/=totalWeight;ao=clamp(1.-ao,0.,1.);\n#ifdef MODULATE_RED_CHANNEL\ngl_FragColor=vec4(ao,1.0,1.0,1.0);\n#else\ngl_FragColor=vec4(worldNormal,ao);\n#endif\n}".replace("#include <hbao_utils>","#define GLSLIFY 1\n#include <sampleBlueNoise>\nuniform sampler2D normalTexture;uniform float cameraNear;uniform float cameraFar;uniform mat4 projectionMatrixInverse;uniform mat4 cameraMatrixWorld;float getViewZ(const float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 getWorldPos(const float depth,const vec2 coord){float z=depth*2.0-1.0;vec4 clipSpacePosition=vec4(coord*2.0-1.0,z,1.0);vec4 viewSpacePosition=projectionMatrixInverse*clipSpacePosition;vec4 worldSpacePosition=cameraMatrixWorld*viewSpacePosition;worldSpacePosition.xyz/=worldSpacePosition.w;return worldSpacePosition.xyz;}vec3 slerp(const vec3 a,const vec3 b,const float t){float cosAngle=dot(a,b);float angle=acos(cosAngle);if(abs(angle)<0.001){return mix(a,b,t);}float sinAngle=sin(angle);float t1=sin((1.0-t)*angle)/sinAngle;float t2=sin(t*angle)/sinAngle;return(a*t1)+(b*t2);}vec3 computeWorldNormal(){vec2 size=vec2(textureSize(depthTexture,0));ivec2 p=ivec2(vUv*size);float c0=texelFetch(depthTexture,p,0).x;float l2=texelFetch(depthTexture,p-ivec2(2,0),0).x;float l1=texelFetch(depthTexture,p-ivec2(1,0),0).x;float r1=texelFetch(depthTexture,p+ivec2(1,0),0).x;float r2=texelFetch(depthTexture,p+ivec2(2,0),0).x;float b2=texelFetch(depthTexture,p-ivec2(0,2),0).x;float b1=texelFetch(depthTexture,p-ivec2(0,1),0).x;float t1=texelFetch(depthTexture,p+ivec2(0,1),0).x;float t2=texelFetch(depthTexture,p+ivec2(0,2),0).x;float dl=abs((2.0*l1-l2)-c0);float dr=abs((2.0*r1-r2)-c0);float db=abs((2.0*b1-b2)-c0);float dt=abs((2.0*t1-t2)-c0);vec3 ce=getWorldPos(c0,vUv).xyz;vec3 dpdx=(dl<dr)? ce-getWorldPos(l1,(vUv-vec2(1.0/size.x,0.0))).xyz:-ce+getWorldPos(r1,(vUv+vec2(1.0/size.x,0.0))).xyz;vec3 dpdy=(db<dt)? ce-getWorldPos(b1,(vUv-vec2(0.0,1.0/size.y))).xyz:-ce+getWorldPos(t1,(vUv+vec2(0.0,1.0/size.y))).xyz;return normalize(cross(dpdx,dpdy));}vec3 getWorldNormal(const vec2 uv){\n#ifdef useNormalTexture\n#if NormalVectorSourceType == FLOAT_BUFFER_NORMAL\nvec3 worldNormal=normalize(textureLod(normalTexture,uv,0.).rgb);\n#else\nvec3 worldNormal=unpackRGBToNormal(textureLod(normalTexture,uv,0.).rgb);\n#endif\nworldNormal=(vec4(worldNormal,1.)*viewMatrix).xyz;return normalize(worldNormal);\n#else\nreturn computeWorldNormal();\n#endif\n}\n#define PI 3.14159265358979323846264338327950288\nvec3 cosineSampleHemisphere(const vec3 n,const vec2 u){float r=sqrt(u.x);float theta=2.0*PI*u.y;vec3 b=normalize(cross(n,vec3(0.0,1.0,1.0)));vec3 t=cross(b,n);return normalize(r*sin(theta)*b+sqrt(1.0-u.x)*n+r*cos(theta)*t);}"),Ml=function(e){g(n,e);var t=v(n);function n(e,r){return _(this,n),t.call(this,e,r,Cl)}return w(n)}(xl),Tl="#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D inputTexture;uniform sampler2D depthTexture;uniform sampler2D normalTexture;uniform mat4 projectionMatrixInverse;uniform mat4 cameraMatrixWorld;uniform float lumaPhi;uniform float depthPhi;uniform float normalPhi;uniform sampler2D blueNoiseTexture;uniform vec2 blueNoiseRepeat;uniform int index;uniform vec2 resolution;\n#include <common>\n#include <sampleBlueNoise>\nvec3 getWorldPos(float depth,vec2 coord){float z=depth*2.0-1.0;vec4 clipSpacePosition=vec4(coord*2.0-1.0,z,1.0);vec4 viewSpacePosition=projectionMatrixInverse*clipSpacePosition;vec4 worldSpacePosition=cameraMatrixWorld*viewSpacePosition;worldSpacePosition.xyz/=worldSpacePosition.w;return worldSpacePosition.xyz;}\n#ifdef RG_INPUT_TEXTURE\n#define luminance(a) (a.r * a.g)\n#else\n#define luminance(a) dot(vec3(0.2125, 0.7154, 0.0721), a)\n#endif\nvec3 getNormal(vec2 uv,vec4 texel){\n#ifdef NORMAL_IN_RGB\nreturn texel.rgb;\n#elif NormalVectorSourceType == FLOAT_BUFFER_NORMAL\nreturn normalize(textureLod(normalTexture,uv,0.).xyz);\n#elif NormalVectorSourceType == CONSTANT_Z\nreturn vec3(0.0,0.0,1.0);\n#else\nreturn normalize(textureLod(normalTexture,uv,0.).xyz*2.0-1.0);\n#endif\n}float distToPlane(const vec3 worldPos,const vec3 neighborWorldPos,const vec3 worldNormal){vec3 toCurrent=worldPos-neighborWorldPos;float distToPlane=abs(dot(toCurrent,worldNormal));return distToPlane;}void main(){\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nvec4 depthTexel=textureLod(normalTexture,vUv,0.).argb;\n#else\nvec4 depthTexel=textureLod(depthTexture,vUv,0.);\n#endif\nif(depthTexel.r==1.0||dot(depthTexel.rgb,depthTexel.rgb)==0.){discard;return;}vec4 texel=textureLod(inputTexture,vUv,0.0);vec3 normal=getNormal(vUv,texel);\n#ifdef NORMAL_IN_RGB\nfloat denoised=texel.a;float center=texel.a;\n#else\nvec3 denoised=texel.rgb;vec3 center=texel.rgb;\n#endif\nfloat depth=depthTexel.x;vec3 worldPos=getWorldPos(depth,vUv);float totalWeight=1.0;vec4 blueNoise=sampleBlueNoise(blueNoiseTexture,0,blueNoiseRepeat,resolution);float angle=blueNoise[index];float s=sin(angle),c=cos(angle);mat2 rotationMatrix=mat2(c,-s,s,c);for(int i=0;i<samples;i++){vec2 offset=rotationMatrix*poissonDisk[i];vec2 neighborUv=vUv+offset;vec4 neighborTexel=textureLod(inputTexture,neighborUv,0.0);vec3 neighborNormal=getNormal(neighborUv,neighborTexel);\n#ifdef NORMAL_IN_RGB\nfloat neighborColor=neighborTexel.a;\n#else\nvec3 neighborColor=neighborTexel.rgb;\n#endif\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat sampleDepth=textureLod(depthTexture,neighborUv,0.0).a;\n#else\nfloat sampleDepth=textureLod(depthTexture,neighborUv,0.0).x;\n#endif\nvec3 worldPosSample=getWorldPos(sampleDepth,neighborUv);float tangentPlaneDist=abs(dot(worldPos-worldPosSample,normal));float normalDiff=dot(normal,neighborNormal);float normalSimilarity=pow(max(normalDiff,0.),normalPhi);\n#ifdef NORMAL_IN_RGB\nfloat lumaDiff=abs(neighborColor-center);\n#else\nfloat lumaDiff=abs(luminance(neighborColor)-luminance(center));\n#endif\nfloat lumaSimilarity=max(1.0-lumaDiff/lumaPhi,0.0);float depthDiff=1.-distToPlane(worldPos,worldPosSample,normal);float depthSimilarity=max(depthDiff/depthPhi,0.);float w=lumaSimilarity*depthSimilarity*normalSimilarity;denoised+=w*neighborColor;totalWeight+=w;}if(totalWeight>0.)denoised/=totalWeight;\n#ifdef NORMAL_IN_RGB\ngl_FragColor=vec4(normal,denoised);\n#else\ngl_FragColor=vec4(denoised,1.);\n#endif\n}".replace("#include <sampleBlueNoise>",yl),Al={iterations:1,radius:8,rings:5.625,lumaPhi:10,depthPhi:2,normalPhi:3.25,samples:16,normalTexture:null},Pl=function(e){g(n,e);var t=v(n);function n(e,r,a){var s,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Al;_(this,n),s=t.call(this,"PoissionBlurPass"),Ht(jt(s),"iterations",Al.iterations),Ht(jt(s),"index",0),o=Vt(Vt({},Al),o),s.inputTexture=r,s.fullscreenMaterial=new mt({fragmentShader:Tl,vertexShader:bl,uniforms:{depthTexture:{value:null},inputTexture:{value:null},projectionMatrixInverse:{value:new P},cameraMatrixWorld:{value:new P},lumaPhi:{value:5},depthPhi:{value:5},normalPhi:{value:5},resolution:{value:new i},blueNoiseTexture:{value:null},index:{value:0},blueNoiseRepeat:{value:new i}}});var l={type:it,depthBuffer:!1};s.renderTargetA=new St(1,1,l),s.renderTargetB=new St(1,1,l);var h=s.fullscreenMaterial.uniforms;h.inputTexture.value=s.inputTexture,h.depthTexture.value=a,h.projectionMatrixInverse.value=e.projectionMatrixInverse,h.cameraMatrixWorld.value=e.matrixWorld,h.depthPhi.value=o.depthPhi,h.normalPhi.value=o.normalPhi,o.normalTexture?h.normalTexture={value:o.normalTexture}:s.fullscreenMaterial.defines.NORMAL_IN_RGB="";for(var d=function(){var e=u[c];Object.defineProperty(jt(s),e,{get:function(){return o[e]},set:function(t){o[e]=t,s.setSize(s.renderTargetA.width,s.renderTargetA.height)}})},c=0,u=["radius","rings","samples"];c<u.length;c++)d();return(new ue).load(wl,(function(e){e.minFilter=ae,e.magFilter=ae,e.wrapS=F,e.wrapT=F,e.colorSpace=ht,s.fullscreenMaterial.uniforms.blueNoiseTexture.value=e})),s}return w(n,[{key:"setSize",value:function(e,t){this.renderTargetA.setSize(e,t),this.renderTargetB.setSize(e,t),this.fullscreenMaterial.uniforms.resolution.value.set(e,t);var n=function(e,t,n,r){for(var a=2*Math.PI*t/e,s=1/e,o=s,l=[],h=s,d=0,c=0;c<e;c++){var u=new i(Math.cos(d),Math.sin(d)).multiplyScalar(Math.pow(h,.75)).multiply(r).multiplyScalar(n);l.push(u),h+=o,d+=a}return l}(this.samples,this.rings,this.radius,new i(1/e,1/t)),r="const int samples = ".concat(this.samples,";\n"),a=function(e){for(var t=e.length,n="const vec2 poissonDisk[samples] = vec2[samples](\n",r=0;r<t;r++){var a=e[r];n+=" vec2(".concat(a.x,", ").concat(a.y,")"),r<t-1&&(n+=","),n+="\n"}return n+");"}(n);this.fullscreenMaterial.fragmentShader=r+a+"\n"+Tl,this.fullscreenMaterial.needsUpdate=!0}},{key:"texture",get:function(){return this.renderTargetB.texture}},{key:"render",value:function(e){this.fullscreenMaterial.uniforms.index.value=0;var t=this.fullscreenMaterial.uniforms.blueNoiseTexture.value;if(t){var n=t.source.data,r=n.width,a=n.height;this.fullscreenMaterial.uniforms.blueNoiseRepeat.value.set(this.renderTargetA.width/r,this.renderTargetA.height/a)}for(var i=0;i<2*this.iterations;i++){var s=i%2==0,o=s?this.renderTargetB:this.renderTargetA;this.fullscreenMaterial.uniforms.inputTexture.value=0===i?this.inputTexture:o.texture;var l=s?this.renderTargetA:this.renderTargetB;e.setRenderTarget(l),e.render(this.scene,this.camera),this.fullscreenMaterial.uniforms.index.value=(this.fullscreenMaterial.uniforms.index.value+1)%4}}}]),n}(_l);Pl.DefaultOptions=Al,function(e){e[e.INPUT_RGB_NORMAL=0]="INPUT_RGB_NORMAL",e[e.FLOAT_BUFFER_NORMAL=1]="FLOAT_BUFFER_NORMAL",e[e.CONSTANT_Z=2]="CONSTANT_Z"}(ml||(ml={})),function(e){e[e.SEPARATE_BUFFER=0]="SEPARATE_BUFFER",e[e.NORMAL_VECTOR_ALPHA=1]="NORMAL_VECTOR_ALPHA"}(fl||(fl={}));const Rl={resolutionScale:1,spp:16,distance:.25,distancePower:.25,power:2,bias:40,thickness:.075},El={resolutionScale:1,spp:16,distance:.25,distancePower:1,power:2,bias:20,thickness:.05},Il={iterations:1,radius:10,rings:5.625,lumaPhi:10,depthPhi:12,normalPhi:3.25,samples:16};class kl{get texture(){return this.ssaoPass?this.ssaoPass.texture:null}constructor(e,t,n){this.needsUpdate=!0,this.parameters={...Rl},this._width=0,this._height=0,this._loaded=!1,this._normalVectorSourceType=ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=!1,this.depthTexture=null,this.normalTexture=null,this._width=e,this._height=t,this._normalVectorSourceType=(null==n?void 0:n.normalVectorSourceType)||ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=(null==n?void 0:n.depthValueSourceType)||fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=(null==n?void 0:n.modulateRedChannel)||!1,(null==n?void 0:n.ssaoParameters)&&(this.parameters=n.ssaoParameters),n&&this.updateParameters(n)}_getPass(e,t){if(!this.ssaoPass){this.ssaoPass=new Sl(e,t);const n=this.ssaoPass.fullscreenMaterial;n.defines.useNormalTexture="",this._modulateRedChannel&&(n.blending=Gt,n.blendEquation=Kt,n.blendEquationAlpha=null,n.blendSrc=Wt,n.blendSrcAlpha=null,n.blendDst=Wt,n.blendDstAlpha=null),n.onBeforeCompile=e=>{e.defines={...e.defines,FLOAT_BUFFER_NORMAL:ml.FLOAT_BUFFER_NORMAL,NormalVectorSourceType:this._normalVectorSourceType,NORMAL_VECTOR_ALPHA:fl.NORMAL_VECTOR_ALPHA,DepthValueSourceType:this._depthValueSourceType,MODULATE_RED_CHANNEL:this._modulateRedChannel?"MODULATE_RED_CHANNEL":void 0}},this.needsUpdate=!0}return this.ssaoPass}dispose(){var e;null===(e=this.ssaoPass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.ssaoPass)||void 0===n||n.setSize(e,t),this.needsUpdate=!0}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t],this.needsUpdate=!0);e.depthTexture&&(this.depthTexture=e.depthTexture,this.needsUpdate=!0),e.normalTexture&&(this.normalTexture=e.normalTexture,this.needsUpdate=!0)}render(e,t,n,r){var a;this._loaded||null===(null===(a=this.ssaoPass)||void 0===a?void 0:a.fullscreenMaterial.uniforms.blueNoiseTexture.value)||(this._loaded=!0,this.needsUpdate=!0);const i=!this.ssaoPass,o=this._getPass(t,n);if(this.needsUpdate||i){if(this.needsUpdate=!1,o.fullscreenMaterial.uniforms.aoDistance.value=this.parameters.distance,o.fullscreenMaterial.uniforms.distancePower.value=this.parameters.distancePower,o.fullscreenMaterial.uniforms.bias.value=this.parameters.bias,o.fullscreenMaterial.uniforms.thickness.value=this.parameters.thickness,o.fullscreenMaterial.uniforms.power.value=this.parameters.power,o.fullscreenMaterial.uniforms.depthTexture.value=this._depthValueSourceType===fl.NORMAL_VECTOR_ALPHA?this.normalTexture:this.depthTexture,o.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,o.fullscreenMaterial.needsUpdate=!0,i){const e=Math.round(this.parameters.spp);o.fullscreenMaterial.defines.spp=e;const t=function(e){for(var t=[],n=Math.PI*(3-Math.sqrt(5)),r=2/e,a=0;a<e;a++){var i=a*r-1+r/2,o=Math.sqrt(1-i*i),l=a*n;t.push(new s(Math.cos(l)*o,i,Math.sin(l)*o))}return t}(e),n=[];for(let t=0;t<e;t++)n.push((t+1)/e);o.fullscreenMaterial.uniforms.samples={value:t},o.fullscreenMaterial.uniforms.samplesR={value:n}}o.setSize(this._width,this._height),o.renderToScreen=!1}o._camera=t,o.fullscreenMaterial.uniforms.viewMatrix.value=t.matrixWorldInverse,o.fullscreenMaterial.uniforms.projectionMatrixInverse.value=t.projectionMatrixInverse,o.fullscreenMaterial.uniforms.cameraMatrixWorld.value=t.matrixWorld;const l=e.getRenderTarget();r&&(o.renderTarget=r),o.render(e),e.setRenderTarget(l)}}class Dl{get texture(){return this.hbaoPass.texture}constructor(e,t,n){this.needsUpdate=!0,this.parameters={...El},this._width=0,this._height=0,this._loaded=!1,this._normalVectorSourceType=ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=!1,this.depthTexture=null,this.normalTexture=null,this._width=e,this._height=t,this._normalVectorSourceType=(null==n?void 0:n.normalVectorSourceType)||ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=(null==n?void 0:n.depthValueSourceType)||fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=(null==n?void 0:n.modulateRedChannel)||!1,(null==n?void 0:n.hbaoParameters)&&(this.parameters=n.hbaoParameters),n&&this.updateParameters(n)}_getPass(e,t){if(!this.hbaoPass){this.hbaoPass=new Ml(e,t);const n=this.hbaoPass.fullscreenMaterial;n.defines.useNormalTexture="",this._modulateRedChannel&&(n.blending=Gt,n.blendEquation=Kt,n.blendEquationAlpha=null,n.blendSrc=Wt,n.blendSrcAlpha=null,n.blendDst=Wt,n.blendDstAlpha=null),n.onBeforeCompile=e=>{e.defines={...e.defines,FLOAT_BUFFER_NORMAL:ml.FLOAT_BUFFER_NORMAL,NormalVectorSourceType:this._normalVectorSourceType,NORMAL_VECTOR_ALPHA:fl.NORMAL_VECTOR_ALPHA,DepthValueSourceType:this._depthValueSourceType,MODULATE_RED_CHANNEL:this._modulateRedChannel?"MODULATE_RED_CHANNEL":void 0}},this.needsUpdate=!0}return this.hbaoPass}dispose(){var e;null===(e=this.hbaoPass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.hbaoPass)||void 0===n||n.setSize(e,t),this.needsUpdate=!0}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t],this.needsUpdate=!0);e.depthTexture&&(this.depthTexture=e.depthTexture,this.needsUpdate=!0),e.normalTexture&&(this.normalTexture=e.normalTexture,this.needsUpdate=!0)}render(e,t,n,r){var a;this._loaded||null===(null===(a=this.hbaoPass)||void 0===a?void 0:a.fullscreenMaterial.uniforms.blueNoiseTexture.value)||(this._loaded=!0,this.needsUpdate=!0);const i=this._getPass(t,n);if(this.needsUpdate){this.needsUpdate=!1;const e=Math.round(this.parameters.spp);i.fullscreenMaterial.defines.spp=e,i.fullscreenMaterial.uniforms.aoDistance.value=this.parameters.distance,i.fullscreenMaterial.uniforms.distancePower.value=this.parameters.distancePower,i.fullscreenMaterial.uniforms.bias.value=this.parameters.bias,i.fullscreenMaterial.uniforms.thickness.value=this.parameters.thickness,i.fullscreenMaterial.uniforms.power.value=this.parameters.power,i.fullscreenMaterial.uniforms.depthTexture.value=this._depthValueSourceType===fl.NORMAL_VECTOR_ALPHA?this.normalTexture:this.depthTexture,i.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,i.fullscreenMaterial.needsUpdate=!0,i.setSize(this._width,this._height),i.renderToScreen=!1}i._camera=t,i.fullscreenMaterial.uniforms.viewMatrix.value=t.matrixWorldInverse,i.fullscreenMaterial.uniforms.projectionMatrixInverse.value=t.projectionMatrixInverse,i.fullscreenMaterial.uniforms.cameraMatrixWorld.value=t.matrixWorld;const s=e.getRenderTarget();r&&(i.renderTarget=r),i.render(e),e.setRenderTarget(s)}}class Ol{get texture(){return this.denoisePass?this.denoisePass.texture:null}set inputTexture(e){this._inputTexture=e}constructor(e,t,n){this.needsUpdate=!0,this.parameters={...Il},this._width=0,this._height=0,this._normalVectorSourceType=ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=fl.NORMAL_VECTOR_ALPHA,this._rgInputTexture=!0,this._inputTexture=null,this.depthTexture=null,this.normalTexture=null,this._width=e,this._height=t,this._normalVectorSourceType=(null==n?void 0:n.normalVectorSourceType)||ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=(null==n?void 0:n.depthValueSourceType)||fl.NORMAL_VECTOR_ALPHA,this._rgInputTexture=(null==n?void 0:n.rgInputTexture)||!0,this._inputTexture=(null==n?void 0:n.inputTexture)||null,this.depthTexture=(null==n?void 0:n.depthTexture)||null,this.normalTexture=(null==n?void 0:n.normalTexture)||null,n.poisonDenoiseParameters?this.parameters=n.poisonDenoiseParameters:n&&this.updateParameters(n)}_getPass(e){return this.denoisePass||(this.normalTexture?(this.denoisePass=new Pl(e,this._inputTexture,this.depthTexture,{normalTexture:this.normalTexture}),this.denoisePass.fullscreenMaterial.onBeforeCompile=e=>{e.defines={...e.defines,FLOAT_BUFFER_NORMAL:ml.FLOAT_BUFFER_NORMAL,CONSTANT_Z:ml.CONSTANT_Z,NormalVectorSourceType:this._normalVectorSourceType,NORMAL_VECTOR_ALPHA:fl.NORMAL_VECTOR_ALPHA,DepthValueSourceType:this._depthValueSourceType,RG_INPUT_TEXTURE:this._rgInputTexture?"RG_INPUT_TEXTURE":void 0}}):this.denoisePass=new Pl(e,this._inputTexture,this.depthTexture),this.needsUpdate=!0),this.denoisePass}dispose(){var e;null===(e=this.denoisePass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.denoisePass)||void 0===n||n.setSize(e,t),this.needsUpdate=!0}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t],this.needsUpdate=!0);e.inputTexture&&(this._inputTexture=e.inputTexture,this.needsUpdate=!0),e.depthTexture&&(this.depthTexture=e.depthTexture,this.needsUpdate=!0),e.normalTexture&&(this.normalTexture=e.normalTexture,this.needsUpdate=!0)}render(e,t){const n=this._getPass(t);this.needsUpdate&&(this.needsUpdate=!1,n.iterations=this.parameters.iterations,n.samples=this.parameters.samples,n.rings=this.parameters.rings,n.radius=this.parameters.radius,n.fullscreenMaterial.uniforms.lumaPhi.value=this.parameters.lumaPhi,n.fullscreenMaterial.uniforms.depthPhi.value=this.parameters.depthPhi,n.fullscreenMaterial.uniforms.normalPhi.value=this.parameters.normalPhi,n.fullscreenMaterial.needsUpdate=!0,n.setSize(this._width,this._height),n.renderToScreen=!1,this.normalTexture?(n.fullscreenMaterial.uniforms.depthTexture.value=this._depthValueSourceType===fl.NORMAL_VECTOR_ALPHA?this.normalTexture:this.depthTexture,n.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture):n.fullscreenMaterial.uniforms.depthTexture.value=this.depthTexture),n.inputTexture=this._inputTexture,n.fullscreenMaterial.uniforms.projectionMatrixInverse.value=t.projectionMatrixInverse,n.fullscreenMaterial.uniforms.cameraMatrixWorld.value=t.matrixWorld;const r=new h;e.getClearColor(r);const a=e.getClearAlpha(),i=e.autoClear,s=e.getRenderTarget();e.autoClear=!0,e.setClearColor(16777215,1),e.setRenderTarget(this.denoisePass.renderTargetA),e.setRenderTarget(this.denoisePass.renderTargetB),e.clear(!0,!1,!1),n.render(e),e.setClearColor(r),e.setClearAlpha(a),e.setRenderTarget(s),e.autoClear=i}}var Ll,Ul;!function(e){e[e.OFF=0]="OFF",e[e.HARD=1]="HARD",e[e.POISSON=2]="POISSON",e[e.FULL=3]="FULL"}(Ll||(Ll={})),function(e){e[e.NONE=0]="NONE",e[e.SSAO=1]="SSAO",e[e.EffectsSSAO=2]="EffectsSSAO",e[e.EffectsHBAO=3]="EffectsHBAO"}(Ul||(Ul={}));const Fl={aoKernelRadius:.25,aoDepthBias:1e-4,aoMaxDistance:.5,aoMaxDepth:.99,aoFadeout:.5,shadowRadius:.05},Nl={enabled:!0,aoType:Ul.SSAO,aoIntensity:.5,shadowIntensity:.35,aoOnGround:!0,shadowOnGround:!1,alwaysUpdate:!1};class Bl{get gBufferRenderTarget(){var e;return this._sharedGBufferRenderTarget?this._sharedGBufferRenderTarget:(this._gBufferRenderTarget=null!==(e=this._gBufferRenderTarget)&&void 0!==e?e:new Yo(void 0,{_width:this._width,_height:this._height,_samples:this._samples,_renderPass:this._renderPass,textureFilter:ae}),this._gBufferRenderTarget)}get SSAOEffect(){return this._ssaoEffect||(this._ssaoEffect=new kl(this._width,this._height,{normalVectorSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?ml.FLOAT_BUFFER_NORMAL:ml.INPUT_RGB_NORMAL,depthValueSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?fl.NORMAL_VECTOR_ALPHA:fl.SEPARATE_BUFFER,modulateRedChannel:!0,ssaoParameters:this.parameters.ssao})),this._ssaoEffect}get HBAOEffect(){return this._hbaoEffect||(this._hbaoEffect=new Dl(this._width,this._height,{normalVectorSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?ml.FLOAT_BUFFER_NORMAL:ml.INPUT_RGB_NORMAL,depthValueSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?fl.NORMAL_VECTOR_ALPHA:fl.SEPARATE_BUFFER,modulateRedChannel:!0,hbaoParameters:this.parameters.hbao})),this._hbaoEffect}get fadeRenderTarget(){var e;return this._fadeRenderTarget=null!==(e=this._fadeRenderTarget)&&void 0!==e?e:new St(this._width,this._height,{format:Xt,magFilter:L,minFilter:L}),this._fadeRenderTarget}get denoisePass(){return this.poissonDenoiseEffect||(this.poissonDenoiseEffect=new Ol(this._width,this._height,{inputTexture:this.shadowAndAoRenderTargets.passRenderTarget.texture,depthTexture:this.gBufferRenderTarget.depthBufferTexture,normalTexture:this.gBufferRenderTarget.gBufferTexture,normalVectorSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?ml.FLOAT_BUFFER_NORMAL:ml.INPUT_RGB_NORMAL,depthValueSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?fl.NORMAL_VECTOR_ALPHA:fl.SEPARATE_BUFFER,rgInputTexture:!0,poisonDenoiseParameters:this.parameters.poissonDenoise})),this.poissonDenoiseEffect}get denoiseRenderTargetTexture(){return this.denoisePass?this.denoisePass.texture:null}constructor(e,t,n,r){var a,i,s,o,l,h,d;this.needsUpdate=!0,this._renderPass=new Go,this._cameraUpdate=new Vo,(null==r?void 0:r.gBufferRenderTarget)&&(this._sharedGBufferRenderTarget=null==r?void 0:r.gBufferRenderTarget),this._width=e,this._height=t,this._samples=n,this.shadowAndAoRenderTargets=new zl(this.gBufferRenderTarget,{...r,width:e,height:t,samples:n,_renderPass:this._renderPass}),this.parameters={enabled:null!==(a=null==r?void 0:r.enabled)&&void 0!==a?a:Nl.enabled,aoType:null!==(i=null==r?void 0:r.aoType)&&void 0!==i?i:Nl.aoType,aoIntensity:null!==(s=null==r?void 0:r.aoIntensity)&&void 0!==s?s:Nl.aoIntensity,shadowIntensity:null!==(o=null==r?void 0:r.shadowIntensity)&&void 0!==o?o:Nl.shadowIntensity,aoOnGround:null!==(l=null==r?void 0:r.aoOnGround)&&void 0!==l?l:Nl.aoOnGround,shadowOnGround:null!==(h=null==r?void 0:r.shadowOnGround)&&void 0!==h?h:Nl.shadowOnGround,alwaysUpdate:null!==(d=null==r?void 0:r.alwaysUpdate)&&void 0!==d?d:Nl.alwaysUpdate,shAndAo:this.shadowAndAoRenderTargets.shadowAndAoParameters,ssao:{...Rl},hbao:{...El},poissonDenoise:{...Il}},this._copyMaterial=new Oo,this._blendMaterial=new Oo({},Do.DEFAULT)}dispose(){var e,t,n,r,a,i,s;null===(e=this.gBufferRenderTarget)||void 0===e||e.dispose(),this.shadowAndAoRenderTargets.dispose(),null===(t=this._ssaoEffect)||void 0===t||t.dispose(),null===(n=this._hbaoEffect)||void 0===n||n.dispose(),null===(r=this._fadeRenderTarget)||void 0===r||r.dispose(),null===(a=this.poissonDenoiseEffect)||void 0===a||a.dispose(),null===(i=this._copyMaterial)||void 0===i||i.dispose(),null===(s=this._blendMaterial)||void 0===s||s.dispose()}setSize(e,t){var n,r,a,i,s;this._width=e,this._height=t,null===(n=this._gBufferRenderTarget)||void 0===n||n.setSize(e,t),this.shadowAndAoRenderTargets.setSize(e,t),null===(r=this._ssaoEffect)||void 0===r||r.setSize(e,t),null===(a=this._hbaoEffect)||void 0===a||a.setSize(e,t),null===(i=this._fadeRenderTarget)||void 0===i||i.setSize(e,t),null===(s=this.poissonDenoiseEffect)||void 0===s||s.setSize(this._width,this._height),this.needsUpdate=!0}updateParameters(e){void 0!==e.enabled&&(this.parameters.enabled=e.enabled),void 0!==e.aoType&&(this.parameters.aoType=e.aoType),void 0!==e.aoIntensity&&(this.parameters.aoIntensity=e.aoIntensity),void 0!==e.shadowIntensity&&(this.parameters.shadowIntensity=e.shadowIntensity),void 0!==e.aoOnGround&&(this.parameters.aoOnGround=e.aoOnGround),void 0!==e.shadowOnGround&&(this.parameters.shadowOnGround=e.shadowOnGround),void 0!==e.alwaysUpdate&&(this.parameters.alwaysUpdate=e.alwaysUpdate),this._updatePassParameters(e)}_updatePassParameters(e){var t,n,r;if(null==e?void 0:e.shAndAo)for(let t in e.shAndAo)this.parameters.shAndAo.hasOwnProperty(t)&&(this.parameters.shAndAo[t]=e.shAndAo[t],this.shadowAndAoRenderTargets.parametersNeedsUpdate=!0);(null==e?void 0:e.ssao)&&(null===(t=this._hbaoEffect)||void 0===t||t.updateParameters(null==e?void 0:e.hbao)),(null==e?void 0:e.hbao)&&(null===(n=this._ssaoEffect)||void 0===n||n.updateParameters(null==e?void 0:e.hbao)),(null==e?void 0:e.poissonDenoise)&&(null===(r=this.poissonDenoiseEffect)||void 0===r||r.updateParameters(null==e?void 0:e.poissonDenoise))}updateBounds(e,t){this.shadowAndAoRenderTargets.updateBounds(e,t)}render(e,t,n,r,a=Ll.FULL,i=Ll.FULL,s=0){if(!this._setRenderState())return;let o=!1;const l=i===Ll.POISSON&&s>.001,h=i===Ll.HARD&&s>.001&&s<.999,d=i===Ll.HARD&&!h;!d&&a===Ll.FULL&&this._evaluateIfUpdateIsNeeded(n)&&(this._renderShadowAndAo(e,t,n,r),o=!0);let c=d?r:this.denoiseRenderTargetTexture;l&&(c=this._renderDynamicShadow(e,this.shadowAndAoRenderTargets.passRenderTarget.texture,r,s),o=!0),o&&(c=this._renderDenoise(e,n,l)),h&&(c=this._renderDynamicShadow(e,this.denoiseRenderTargetTexture,r,s)),this._renderToTarget(e,c,d)}_setRenderState(){return this.shadowAndAoRenderTargets.aoEnabled=this.parameters.aoType===Ul.SSAO,this.shadowAndAoRenderTargets.shadowEnabled=this.parameters.shadowIntensity>.01,!(!this.parameters.enabled||this.parameters.aoType===Ul.NONE&&!this.shadowAndAoRenderTargets.shadowEnabled||(this.needsUpdate&&(this._ssaoEffect&&(this._ssaoEffect.needsUpdate=!0),this._hbaoEffect&&(this._hbaoEffect.needsUpdate=!0),this.poissonDenoiseEffect&&(this.poissonDenoiseEffect.needsUpdate=!0)),0))}_evaluateIfUpdateIsNeeded(e){e.updateProjectionMatrix();const t=this.parameters.alwaysUpdate||this.needsUpdate||null!=e&&this._cameraUpdate.changed(e);return this.needsUpdate=!1,t}_renderShadowAndAo(e,t,n,r){this.gBufferRenderTarget.render(e,t,n),this.shadowAndAoRenderTargets.render(e,n,r),this._renderAoEffect(e,t,n)}_renderAoEffect(e,t,n){if(this.parameters.aoType!==Ul.EffectsSSAO&&this.parameters.aoType!==Ul.EffectsHBAO)return;const r=this.gBufferRenderTarget.depthBufferTexture,a=this.gBufferRenderTarget.gBufferTexture,i=this.shadowAndAoRenderTargets.passRenderTarget,s=e.autoClear;switch(e.autoClear=!1,this.parameters.aoType){default:break;case Ul.EffectsSSAO:{const s=this.SSAOEffect;s.depthTexture=r,s.normalTexture=a,s.render(e,n,t,i)}break;case Ul.EffectsHBAO:{const s=this.HBAOEffect;s.depthTexture=r,s.normalTexture=a,s.render(e,n,t,i)}}e.autoClear=s}_renderDynamicShadow(e,t,n,r=1){const a=r<.999;return a&&(this._copyMaterial.update({texture:t,blending:gt,colorTransform:So,multiplyChannels:0}),this._renderPass.renderScreenSpace(e,this._copyMaterial,this.fadeRenderTarget)),r>.001&&(this._blendMaterial.update({texture:n,blending:a?Gt:gt,colorTransform:(new P).set(0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,a?r:1),multiplyChannels:0}),this._renderPass.renderScreenSpace(e,this._blendMaterial,this.fadeRenderTarget)),this.fadeRenderTarget.texture}_renderDenoise(e,t,n){return this.denoisePass.inputTexture=n?this.fadeRenderTarget.texture:this.shadowAndAoRenderTargets.passRenderTarget.texture,this.denoisePass.render(e,t),this.denoisePass.texture}_renderToTarget(e,t,n){const r=n?this.parameters.shadowIntensity:this.parameters.aoIntensity,a=n?0:this.parameters.shadowIntensity;this._renderPass.renderScreenSpace(e,this._copyMaterial.update({texture:t,blending:Gt,colorTransform:ko(r,a,0,1),multiplyChannels:1}),e.getRenderTarget())}}Bl.shadowTransform=(new P).set(0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1);class zl{get passRenderTarget(){var e;return this._passRenderTarget=null!==(e=this._passRenderTarget)&&void 0!==e?e:new St(this._width,this._height,{samples:this._aoTargetSamples,format:Xt,magFilter:L,minFilter:L}),this._passRenderTarget}get passRenderMaterial(){var e;return this._passRenderMaterial=null!==(e=this._passRenderMaterial)&&void 0!==e?e:new Hl({normalTexture:this._depthAndNormalTextures.gBufferTexture,depthTexture:this._depthAndNormalTextures.depthBufferTexture,noiseTexture:this.noiseTexture,sampleKernel:this.sampleKernel,floatGBufferRgbNormalAlphaDepth:this._depthAndNormalTextures.isFloatGBufferWithRgbNormalAlphaDepth}),this._passRenderMaterial}get noiseTexture(){var e;return this._noiseTexture=null!==(e=this._noiseTexture)&&void 0!==e?e:(()=>{const e=new Uint8Array(64);for(let t=0;t<16;++t){const n=Math.floor(t/2)+t%2*8,r=2*Math.PI*n/16,a=new s(Math.cos(r),Math.sin(r),0).normalize();e[4*t]=255*(.5*a.x+.5),e[4*t+1]=255*(.5*a.y+.5),e[4*t+2]=127,e[4*t+3]=0}const t=new Pe(e,4,4);return t.wrapS=F,t.wrapT=F,t.needsUpdate=!0,t})(),this._noiseTexture}get sampleKernel(){return this._sampleKernel.length||(this._sampleKernel=(e=>{const t=[];for(let n=0;n<e;n++){const r=n*Math.PI*(3-Math.sqrt(5)),a=.99-n/(e-1)*.8,i=Math.sqrt(1-a*a),o=Math.cos(r)*i,l=Math.sin(r)*i,h=8,d=Math.floor(e/h);let c=1-(Math.floor(n/h)+n%h*d)/e;c=J.lerp(.1,1,c*c),t.push(new s(o*c,l*c,a*c))}return t})(Hl.kernelSize)),this._sampleKernel}constructor(e,t){var n,r,a,i;this.parametersNeedsUpdate=!0,this.aoEnabled=!0,this.shadowEnabled=!0,this._sceneBoxMin=new s(-1,-1,-1),this._sceneBoxMax=new s(1,1,1),this._shadowAndAoScale=1,this._aoTargetSamples=0,this._sampleKernel=[],this.shadowAndAoParameters=this._getShadowAndAoParameters(t),this._width=null!==(n=null==t?void 0:t._width)&&void 0!==n?n:1024,this._height=null!==(r=null==t?void 0:t._height)&&void 0!==r?r:1024,this._samples=null!==(a=null==t?void 0:t._samples)&&void 0!==a?a:0,this._depthAndNormalTextures=e,this._renderPass=null!==(i=null==t?void 0:t._renderPass)&&void 0!==i?i:new Go}_getShadowAndAoParameters(e){return{...Fl,...e}}dispose(){var e,t,n;null===(e=this._noiseTexture)||void 0===e||e.dispose(),null===(t=this._passRenderMaterial)||void 0===t||t.dispose(),null===(n=this._passRenderTarget)||void 0===n||n.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this._passRenderMaterial)||void 0===n||n.update({_width:this._width,_height:this._height})}updateBounds(e,t){this._sceneBoxMin.copy(e.bounds.min),this._sceneBoxMax.copy(e.bounds.max),this._shadowAndAoScale=t,this.parametersNeedsUpdate=!0}render(e,t,n){this._renderPass.renderScreenSpace(e,this.updateSSAOMaterial(t,n),this.passRenderTarget),this.parametersNeedsUpdate=!1}updateSSAOMaterial(e,t){const n=this.passRenderMaterial;return n.updateDependencies({_width:this._width,_height:this._height,camera:e,shadowTexture:t,sceneBoxMin:this._sceneBoxMin,sceneBoxMax:this._sceneBoxMax}),this.parametersNeedsUpdate&&n.updateSettings({...this.shadowAndAoParameters,aoKernelRadius:this.shadowAndAoParameters.aoKernelRadius*this._shadowAndAoScale,aoMaxDistance:this.shadowAndAoParameters.aoMaxDistance*this._shadowAndAoScale,shadowRadius:this.shadowAndAoParameters.shadowRadius*this._shadowAndAoScale,aoIntensity:this.aoEnabled?1:0,shadowIntensity:this.shadowEnabled?1:0}),n}}class Hl extends mt{constructor(e){var t,n;super({defines:Object.assign({...Hl._shader.defines,KERNEL_SIZE:null!==(n=null===(t=null==e?void 0:e.sampleKernel)||void 0===t?void 0:t.length)&&void 0!==n?n:Hl.kernelSize,FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH:(null==e?void 0:e.floatGBufferRgbNormalAlphaDepth)?1:0}),uniforms:ft.clone(Hl._shader.uniforms),vertexShader:Hl._shader.vertexShader,fragmentShader:Hl._shader.fragmentShader,blending:gt}),this.update(e)}update(e){return this.updateDependencies(e),this.updateSettings(e),this}updateDependencies(e){var t,n;if(void 0!==(null==e?void 0:e.shadowTexture)&&(this.uniforms.tShadow.value=null==e?void 0:e.shadowTexture),void 0!==(null==e?void 0:e.normalTexture)&&(this.uniforms.tNormal.value=null==e?void 0:e.normalTexture),void 0!==(null==e?void 0:e.depthTexture)&&(this.uniforms.tDepth.value=null==e?void 0:e.depthTexture),void 0!==(null==e?void 0:e.noiseTexture)&&(this.uniforms.tNoise.value=null==e?void 0:e.noiseTexture),(null==e?void 0:e._width)||(null==e?void 0:e._height)){const r=null!==(t=null==e?void 0:e._width)&&void 0!==t?t:this.uniforms.resolution.value.x,a=null!==(n=null==e?void 0:e._height)&&void 0!==n?n:this.uniforms.resolution.value.y;this.uniforms.resolution.value.set(r,a)}void 0!==(null==e?void 0:e.sampleKernel)&&(this.uniforms.sampleKernel.value=null==e?void 0:e.sampleKernel),void 0!==(null==e?void 0:e.sceneBoxMin)&&(this.uniforms.sceneBoxMin.value=null==e?void 0:e.sceneBoxMin),void 0!==(null==e?void 0:e.sceneBoxMax)&&(this.uniforms.sceneBoxMax.value=null==e?void 0:e.sceneBoxMax),this._updateCameraDependentUniforms(e)}_updateCameraDependentUniforms(e){if(void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,this.uniforms.cameraProjectionMatrix.value.copy(t.projectionMatrix),this.uniforms.cameraInverseProjectionMatrix.value.copy(t.projectionMatrixInverse),this.uniforms.cameraWorldMatrix.value.copy(t.matrixWorld)}}updateSettings(e){void 0!==(null==e?void 0:e.aoKernelRadius)&&(this.uniforms.aoKernelRadius.value=null==e?void 0:e.aoKernelRadius),void 0!==(null==e?void 0:e.aoDepthBias)&&(this.uniforms.aoDepthBias.value=null==e?void 0:e.aoDepthBias),void 0!==(null==e?void 0:e.aoMaxDistance)&&(this.uniforms.aoMaxDistance.value=null==e?void 0:e.aoMaxDistance),void 0!==(null==e?void 0:e.aoMaxDepth)&&(this.uniforms.aoMaxDepth.value=null==e?void 0:e.aoMaxDepth),void 0!==(null==e?void 0:e.aoIntensity)&&(this.uniforms.aoIntensity.value=null==e?void 0:e.aoIntensity),void 0!==(null==e?void 0:e.aoFadeout)&&(this.uniforms.aoFadeout.value=null==e?void 0:e.aoFadeout),void 0!==(null==e?void 0:e.shadowRadius)&&(this.uniforms.shKernelRadius.value=null==e?void 0:e.shadowRadius),void 0!==(null==e?void 0:e.shadowIntensity)&&(this.uniforms.shIntensity.value=null==e?void 0:e.shadowIntensity)}}Hl.kernelSize=32,Hl._shader={uniforms:{tShadow:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},sampleKernel:{value:null},cameraNear:{value:.1},cameraFar:{value:1},resolution:{value:new i},cameraProjectionMatrix:{value:new P},cameraInverseProjectionMatrix:{value:new P},cameraWorldMatrix:{value:new P},aoKernelRadius:{value:.1},aoDepthBias:{value:.001},aoMaxDistance:{value:.05},aoMaxDepth:{value:.99},aoIntensity:{value:1},aoFadeout:{value:0},shKernelRadius:{value:.15},shIntensity:{value:1},sceneBoxMin:{value:new s(-1,-1,-1)},sceneBoxMax:{value:new s(1,1,1)}},defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:Hl.kernelSize,FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH:0,NORMAL_VECTOR_ANTIALIAS:2},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"uniform sampler2D tShadow;\n uniform sampler2D tNormal;\n#if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH != 1 \n uniform sampler2D tDepth;\n#endif \n uniform sampler2D tNoise;\n uniform vec3 sampleKernel[KERNEL_SIZE];\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraInverseProjectionMatrix;\n uniform mat4 cameraWorldMatrix;\n uniform float aoKernelRadius;\n uniform float aoDepthBias; // avoid artifacts caused by neighbour fragments with minimal depth difference\n uniform float aoMaxDistance; // avoid the influence of fragments which are too far away\n uniform float aoMaxDepth;\n uniform float aoIntensity;\n uniform float aoFadeout;\n uniform float shKernelRadius;\n uniform float shIntensity;\n uniform vec3 sceneBoxMin;\n uniform vec3 sceneBoxMax;\n \n varying vec2 vUv;\n \n #include <packing>\n \n float getDepth(const in vec2 screenPosition) {\n #if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH == 1\n return texture2D(tNormal, screenPosition).w;\n #else \n return texture2D(tDepth, screenPosition).x;\n #endif\n }\n \n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n \n vec3 getViewPosition(const in vec2 screenPosition, const in float depth) {\n vec4 clipSpacePosition = vec4(vec3(screenPosition, depth) * 2.0 - 1.0, 1.0);\n vec4 viewSpacePosition = cameraInverseProjectionMatrix * clipSpacePosition;\n return viewSpacePosition.xyz / viewSpacePosition.w;\n }\n\n vec3 getAntiAliasedViewNormal(const in vec2 screenPosition) {\n #if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH == 1\n #if NORMAL_VECTOR_ANTIALIAS == 1\n vec2 uv = screenPosition;\n vec2 size = vec2(textureSize(tNormal, 0));\n ivec2 p = ivec2(screenPosition * size);\n float c0 = texelFetch(tNormal, p, 0).a;\n float l2 = texelFetch(tNormal, p - ivec2(2, 0), 0).a;\n float l1 = texelFetch(tNormal, p - ivec2(1, 0), 0).a;\n float r1 = texelFetch(tNormal, p + ivec2(1, 0), 0).a;\n float r2 = texelFetch(tNormal, p + ivec2(2, 0), 0).a;\n float b2 = texelFetch(tNormal, p - ivec2(0, 2), 0).a;\n float b1 = texelFetch(tNormal, p - ivec2(0, 1), 0).a;\n float t1 = texelFetch(tNormal, p + ivec2(0, 1), 0).a;\n float t2 = texelFetch(tNormal, p + ivec2(0, 2), 0).a;\n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n vec3 ce = getViewPosition(uv, c0).xyz;\n vec3 dpdx = (dl < dr) ? ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz\n : -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;\n vec3 dpdy = (db < dt) ? ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz\n : -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;\n return normalize(cross(dpdx, dpdy));\n #elif NORMAL_VECTOR_ANTIALIAS == 2\n vec2 size = vec2(textureSize(tNormal, 0));\n ivec2 p = ivec2(screenPosition * size);\n vec3 normalVector = texelFetch(tNormal, p, 0).xyz;\n normalVector += texelFetch(tNormal, p + ivec2(1, 0), 0).xyz;\n normalVector += texelFetch(tNormal, p - ivec2(1, 0), 0).xyz;\n normalVector += texelFetch(tNormal, p + ivec2(0, 1), 0).xyz;\n normalVector += texelFetch(tNormal, p - ivec2(0, 1), 0).xyz;\n return normalize(normalVector);\n #else\n return texture2D(tNormal, screenPosition).xyz;\n #endif\n #else\n return unpackRGBToNormal(texture2D(tNormal, screenPosition).xyz);\n #endif\n }\n\n vec3 getViewNormal(const in vec2 screenPosition) {\n #if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH == 1\n return texture2D(tNormal, screenPosition).xyz;\n #else\n return unpackRGBToNormal(texture2D(tNormal, screenPosition).xyz);\n #endif\n }\n \n void main() {\n \n float depth = getDepth(vUv);\n float viewZ = getViewZ(depth);\n \n vec3 viewPosition = getViewPosition(vUv, depth);\n vec3 viewNormal = getAntiAliasedViewNormal(vUv);\n vec3 worldPosition = (cameraWorldMatrix * vec4(viewPosition, 1.0)).xyz;\n float boxDistance = length(max(vec3(0.0), max(sceneBoxMin - worldPosition, worldPosition - sceneBoxMax)));\n \n vec2 noiseScale = resolution.xy / 4.0;\n vec3 random = texture2D(tNoise, vUv * noiseScale).xyz * 2.0 - 1.0;\n \n // compute matrix used to reorient a kernel vector\n vec3 tangent = normalize(random - viewNormal * dot(random, viewNormal));\n vec3 bitangent = cross(viewNormal, tangent);\n mat3 kernelMatrix = mat3(tangent, bitangent, viewNormal);\n \n float aoOcclusion = 0.0;\n float shOcclusion = texture2D(tShadow, vUv).r;\n float shSamples = 0.0;\n if (aoIntensity >= 0.01 && boxDistance < aoMaxDistance && length(viewNormal) > 0.01) {\n for (int i = 0; i < KERNEL_SIZE; i ++) {\n vec3 aoSampleVector = kernelMatrix * sampleKernel[i]; \n vec3 aoSamplePoint = viewPosition + aoSampleVector * aoKernelRadius; \n vec4 aoSamplePointNDC = cameraProjectionMatrix * vec4(aoSamplePoint, 1.0); \n aoSamplePointNDC /= aoSamplePointNDC.w;\n vec2 aoSamplePointUv = aoSamplePointNDC.xy * 0.5 + 0.5;\n float aoRealSampleDepth = getDepth(aoSamplePointUv);\n float aoSampleDeltaZ = getViewZ(aoRealSampleDepth) - aoSamplePoint.z;\n float aoRealDeltaZ = viewZ - aoSamplePoint.z;\n float w_long = clamp((aoMaxDistance - max(aoRealDeltaZ, aoSampleDeltaZ)) / aoMaxDistance, 0.0, 1.0);\n float w_lat = clamp(1.0 - length(aoSampleVector.xy), 0.0, 1.0);\n aoOcclusion +=\n step(aoRealSampleDepth, aoMaxDepth) * \n step(aoDepthBias, aoSampleDeltaZ / (cameraFar - cameraNear)) * \n step(aoSampleDeltaZ, aoMaxDistance) * mix(1.0, w_long * w_lat, aoFadeout);\n }\n }\n if (shIntensity >= 0.01 && length(viewNormal) > 0.01) {\n for (int i = 0; i < KERNEL_SIZE; i ++) {\n vec3 shSampleVector = kernelMatrix * sampleKernel[i]; // reorient sample vector in view space\n vec3 shSamplePoint = viewPosition + shSampleVector * shKernelRadius; // calculate sample point\n vec4 shSamplePointNDC = cameraProjectionMatrix * vec4(shSamplePoint, 1.0); // project point and calculate NDC\n shSamplePointNDC /= shSamplePointNDC.w;\n vec2 shSamplePointUv = shSamplePointNDC.xy * 0.5 + 0.5; // compute uv coordinates\n vec3 shSampleNormal = getViewNormal(shSamplePointUv);\n float shDeltaZ = getViewZ(getDepth(shSamplePointUv)) - shSamplePoint.z;\n float w = step(abs(shDeltaZ), shKernelRadius) * max(0.0, dot(shSampleNormal, viewNormal));\n shSamples += w;\n shOcclusion += texture2D(tShadow, shSamplePointUv).r * w;\n }\n }\n \n aoOcclusion = clamp(aoOcclusion / float(KERNEL_SIZE) * (1.0 + aoFadeout), 0.0, 1.0);\n aoOcclusion = 1.0 - aoOcclusion * clamp(1.0 - boxDistance / aoMaxDistance, 0.0, 1.0);\n shOcclusion = clamp(shOcclusion / (shSamples + 1.0), 0.0, 1.0);\n gl_FragColor = vec4(aoOcclusion, shOcclusion, 0.0, 1.0);\n }"};class jl{get reflectionRenderTarget(){var e;return this._reflectionRenderTarget=null!==(e=this._reflectionRenderTarget)&&void 0!==e?e:this._newRenderTarget(!0),this._reflectionRenderTarget}get intensityRenderTarget(){var e;return this._intensityRenderTarget=null!==(e=this._intensityRenderTarget)&&void 0!==e?e:this._newRenderTarget(!1),this._intensityRenderTarget}get blurRenderTarget(){var e;return this._blurRenderTarget=null!==(e=this._blurRenderTarget)&&void 0!==e?e:this._newRenderTarget(!1),this._blurRenderTarget}constructor(e,t,n){var r;this._width=e,this._height=t,this.parameters={enabled:!1,intensity:.25,fadeOutDistance:1,fadeOutExponent:4,brightness:1,blurHorizontal:3,blurVertical:6,blurAscent:0,groundLevel:0,groundReflectionScale:1,renderTargetDownScale:4,...n},this._copyMaterial=new Oo({}),this._updateCopyMaterial(null),this._reflectionIntensityMaterial=new Vl({_width:this._width/this.parameters.renderTargetDownScale,_height:this._height/this.parameters.renderTargetDownScale}),this._blurPass=new Ko(Lo,n),this._renderPass=null!==(r=null==n?void 0:n._renderPass)&&void 0!==r?r:new Go}_newRenderTarget(e){const t=this._width/this.parameters.renderTargetDownScale,n=this._height/this.parameters.renderTargetDownScale;let r={};if(e){const e=new Ct(t,n);e.format=Mt,e.type=Tt,r.minFilter=ae,r.magFilter=ae,r.depthTexture=e}else r.samples=1;return new St(t,n,{format:Ae,...r})}dispose(){var e,t,n;null===(e=this._reflectionRenderTarget)||void 0===e||e.dispose(),null===(t=this._intensityRenderTarget)||void 0===t||t.dispose(),null===(n=this._blurRenderTarget)||void 0===n||n.dispose(),this._copyMaterial.dispose()}setSize(e,t){var n,r,a,i;this._width=e,this._height=t,null===(n=this._reflectionRenderTarget)||void 0===n||n.setSize(this._width/this.parameters.renderTargetDownScale,this._height/this.parameters.renderTargetDownScale),null===(r=this._intensityRenderTarget)||void 0===r||r.setSize(this._width/this.parameters.renderTargetDownScale,this._height/this.parameters.renderTargetDownScale),null===(a=this._blurRenderTarget)||void 0===a||a.setSize(this._width/this.parameters.renderTargetDownScale,this._height/this.parameters.renderTargetDownScale),null===(i=this._reflectionIntensityMaterial)||void 0===i||i.update({_width:this._width/this.parameters.renderTargetDownScale,_height:this._height/this.parameters.renderTargetDownScale})}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t])}updateBounds(e,t){this.parameters.groundLevel=e,this.parameters.groundReflectionScale=t}_updateCopyMaterial(e,t=1){var n;const r=this.parameters.intensity*t,a=this.parameters.brightness;this._copyMaterial.update({texture:null!==(n=null==e?void 0:e.texture)&&void 0!==n?n:void 0,colorTransform:(new P).set(a,0,0,0,0,a,0,0,0,0,a,0,0,0,0,r),multiplyChannels:0,uvTransform:Io}),this._copyMaterial.depthTest=!0,this._copyMaterial.depthWrite=!1}render(e,t,n,r=1){if(!(this.parameters.enabled&&n instanceof Z))return;const a=this._createGroundReflectionCamera(n);this._renderGroundReflection(e,t,a,this.reflectionRenderTarget),this._renderGroundReflectionIntensity(e,a,this.intensityRenderTarget),(this.parameters.blurHorizontal>0||this.parameters.blurVertical>0)&&this.blurReflection(e,n,[this.intensityRenderTarget,this.blurRenderTarget,this.intensityRenderTarget]),this._updateCopyMaterial(this.intensityRenderTarget,r),this._renderPass.renderScreenSpace(e,this._copyMaterial,e.getRenderTarget())}_renderGroundReflection(e,t,n,r){const a=e.getRenderTarget();r&&e.setRenderTarget(r),e.render(t,n),r&&e.setRenderTarget(a)}_renderGroundReflectionIntensity(e,t,n){const r=e.getRenderTarget();e.setRenderTarget(n),this._renderPass.renderScreenSpace(e,this._reflectionIntensityMaterial.update({texture:this.reflectionRenderTarget.texture,depthTexture:this.reflectionRenderTarget.depthTexture,camera:t,groundLevel:this.parameters.groundLevel,fadeOutDistance:this.parameters.fadeOutDistance*this.parameters.groundReflectionScale,fadeOutExponent:this.parameters.fadeOutExponent}),e.getRenderTarget()),e.setRenderTarget(r)}blurReflection(e,t,n){const r=new s(t.matrixWorld.elements[4],t.matrixWorld.elements[5],t.matrixWorld.elements[6]),a=this.parameters.blurHorizontal/this._width,i=this.parameters.blurVertical/this._height*Math.abs(r.dot(new s(0,0,1)));this._blurPass.render(e,n,[4*a,4*i],[4*a*(1+this.parameters.blurAscent),4*i*(1+this.parameters.blurAscent)])}_createGroundReflectionCamera(e){const t=e.clone(),n=t;return n._offset&&(n._offset={left:n._offset.left,top:1-n._offset.bottom,right:n._offset.right,bottom:1-n._offset.top}),t.position.set(e.position.x,-e.position.y+2*this.parameters.groundLevel,e.position.z),t.rotation.set(-e.rotation.x,e.rotation.y,-e.rotation.z),t.updateMatrixWorld(),t.updateProjectionMatrix(),t}}class Vl extends mt{constructor(e){super({defines:Object.assign({},Vl.shader.defines),uniforms:ft.clone(Vl.shader.uniforms),vertexShader:Vl.shader.vertexShader,fragmentShader:Vl.shader.fragmentShader,blending:gt}),this.update(e)}update(e){var t,n;if(void 0!==(null==e?void 0:e.texture)&&(this.uniforms.tDiffuse.value=null==e?void 0:e.texture),void 0!==(null==e?void 0:e.depthTexture)&&(this.uniforms.tDepth.value=null==e?void 0:e.depthTexture),(null==e?void 0:e._width)||(null==e?void 0:e._height)){const r=null!==(t=null==e?void 0:e._width)&&void 0!==t?t:this.uniforms.resolution.value.x,a=null!==(n=null==e?void 0:e._height)&&void 0!==n?n:this.uniforms.resolution.value.y;this.uniforms.resolution.value.set(r,a)}if(void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,this.uniforms.cameraProjectionMatrix.value.copy(t.projectionMatrix),this.uniforms.cameraInverseProjectionMatrix.value.copy(t.projectionMatrixInverse),this.uniforms.inverseViewMatrix.value.copy(t.matrixWorld)}return void 0!==(null==e?void 0:e.groundLevel)&&(this.uniforms.groundLevel.value=null==e?void 0:e.groundLevel),void 0!==(null==e?void 0:e.fadeOutDistance)&&(this.uniforms.fadeOutDistance.value=null==e?void 0:e.fadeOutDistance),void 0!==(null==e?void 0:e.fadeOutExponent)&&(this.uniforms.fadeOutExponent.value=null==e?void 0:e.fadeOutExponent),this}}Vl.shader={uniforms:{tDiffuse:{value:null},tDepth:{value:null},resolution:{value:new i},cameraNear:{value:.1},cameraFar:{value:1},cameraProjectionMatrix:{value:new P},cameraInverseProjectionMatrix:{value:new P},inverseViewMatrix:{value:new P},groundLevel:{value:0},fadeOutDistance:{value:1},fadeOutExponent:{value:1}},defines:{PERSPECTIVE_CAMERA:1,LINEAR_TO_SRGB:1},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform sampler2D tDepth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraInverseProjectionMatrix;\n uniform mat4 inverseViewMatrix;\n uniform float groundLevel;\n uniform float fadeOutDistance;\n uniform float fadeOutExponent;\n varying vec2 vUv;\n\n #include <packing>\n\n float getDepth(const in vec2 screenPosition) {\n return texture2D(tDepth, screenPosition).x;\n }\n\n float getLinearDepth(const in vec2 screenPosition) {\n #if PERSPECTIVE_CAMERA == 1\n float fragCoordZ = texture2D(tDepth, screenPosition).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return texture2D(tDepth, screenPosition).x;\n #endif\n }\n\n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return 0.0;//orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n\n vec3 getViewPosition(const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n vec4 clipPosition = vec4((vec3(screenPosition, depth) - 0.5) * 2.0, 1.0);\n clipPosition *= clipW;\n return (cameraInverseProjectionMatrix * clipPosition).xyz;\n }\n\n void main() {\n float verticalBias = 1.5 / resolution.y;\n vec2 uv = vUv.xy + vec2(0.0, verticalBias);\n float depth = getDepth(uv);\n float viewZ = getViewZ(depth);\n vec4 worldPosition = inverseViewMatrix * vec4(getViewPosition(uv, depth, viewZ), 1.0);\n float distance = worldPosition.y - groundLevel;\n vec4 fragColor = texture2D(tDiffuse, uv).rgba;\n #if LINEAR_TO_SRGB == 1\n fragColor.rgb = mix(fragColor.rgb * 12.92, 1.055 * pow(fragColor.rgb, vec3(0.41666)) - 0.055, step(0.0031308, fragColor.rgb));\n #endif\n float fadeOutAlpha = pow(clamp(1.0 - distance / fadeOutDistance, 0.0, 1.0), fadeOutExponent);\n fragColor.a *= fadeOutAlpha;\n gl_FragColor = fragColor * step(depth, 0.9999);\n }"};const Gl=e=>{const t=Math.atan2(e.y,e.x)/(2*Math.PI)+.5,n=Math.asin(e.z)/Math.PI+.5;return new i(t,n)};class Kl{get colorRenderTarget(){var e;return this._colorRenderTarget=null!==(e=this._colorRenderTarget)&&void 0!==e?e:new St,this._colorRenderTarget}get environmentMapDecodeTarget(){var e;return this._environmentMapDecodeTarget=null!==(e=this._environmentMapDecodeTarget)&&void 0!==e?e:new St,this._environmentMapDecodeTarget}environmentMapDecodeMaterial(e){var t,n;return e?(this._equirectangularDecodeMaterial=null!==(t=this._equirectangularDecodeMaterial)&&void 0!==t?t:new Xl(!0,!1),this._equirectangularDecodeMaterial):(this._pmremDecodeMaterial=null!==(n=this._pmremDecodeMaterial)&&void 0!==n?n:new Xl(!1,!1),this._pmremDecodeMaterial)}get camera(){var e;return this._camera=null!==(e=this._camera)&&void 0!==e?e:new $(-1,1,1,-1,-1,1),this._camera}scaleTexture(e,t,n,r){var a;this.colorRenderTarget.setSize(n,r),this._planeMesh=null!==(a=this._planeMesh)&&void 0!==a?a:new K(new At(2,2),new C({map:t}));const i=e.getRenderTarget();e.setRenderTarget(this.colorRenderTarget),e.render(this._planeMesh,this.camera),e.setRenderTarget(i);const s=this.environmentMapDecodeTarget.texture,o=new Uint8Array(n*r*4);return e.readRenderTargetPixels(this.colorRenderTarget,0,0,n,r,o),{texture:s,pixels:o}}newGrayscaleTexture(e,t,n,r){var a;const i=this.environmentMapDecodeMaterial("PMREM.cubeUv"===t.name);this.environmentMapDecodeTarget.setSize(n,r),i.setSourceTexture(t),this._planeMesh=null!==(a=this._planeMesh)&&void 0!==a?a:new K(new At(2,2),i);const s=e.getRenderTarget();e.setRenderTarget(this.environmentMapDecodeTarget),e.render(this._planeMesh,this.camera),e.setRenderTarget(s);const o=this.environmentMapDecodeTarget.texture,l=new Uint8Array(n*r*4);return e.readRenderTargetPixels(this.environmentMapDecodeTarget,0,0,n,r,l),{texture:o,pixels:l}}}const Wl={tDiffuse:{value:null}};class Xl extends mt{constructor(e,t){super({uniforms:ft.clone(Wl),vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n \n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n }\n return 0.5 * ( uv + 1.0 );\n }\n\n void main() {\n #if PMREM_DECODE == 1\n float altitude = (vUv.y - 0.5) * 3.141593;\n float azimuth = vUv.x * 2.0 * 3.141593;\n vec3 direction = vec3(\n cos(altitude) * cos(azimuth) * -1.0, \n sin(altitude), \n cos(altitude) * sin(azimuth) * -1.0\n );\n float face = getFace(direction);\n vec2 uv = getUV(direction, face) / vec2(3.0, 4.0);\n if (face > 2.5) {\n uv.y += 0.25;\n face -= 3.0;\n }\n uv.x += face / 3.0;\n vec4 color = texture2D(tDiffuse, uv);\n #else\n vec4 color = texture2D(tDiffuse, vUv);\n #endif \n #if GRAYSCALE_CONVERT == 1\n float grayscale = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722));\n //float grayscale = dot(color.rgb, vec3(1.0/3.0));\n gl_FragColor = vec4(vec3(grayscale), 1.0);\n #else\n gl_FragColor = vec4(color.rgb, 1.0);\n #endif\n }",defines:{PMREM_DECODE:e?1:0,GRAYSCALE_CONVERT:t?1:0}})}setSourceTexture(e){this.uniforms.tDiffuse.value=e}}e("a3",Xl),e("a2",class{constructor(e){var t,n,r,a;this.samplePoints=[],this.sampleUVs=[],this.grayscaleTexture={texture:new fe,pixels:new Uint8Array(0)},this.detectorTexture=new fe,this.detectorArray=new Float32Array(0),this.lightSamples=[],this.lightGraph=new Ql(0),this.lightSources=[],this._createEquirectangularSamplePoints=e=>{const t=[];for(let n=0;n<e;n++){const r=n*Math.PI*(3-Math.sqrt(5)),a=1-n/(e-1)*2,i=Math.sqrt(1-a*a),o=Math.cos(r)*i,l=Math.sin(r)*i;t.push(new s(o,l,a))}return t},this._numberOfSamples=null!==(t=null==e?void 0:e._numberOfSamples)&&void 0!==t?t:1e3,this._width=null!==(n=null==e?void 0:e._width)&&void 0!==n?n:1024,this._height=null!==(r=null==e?void 0:e._height)&&void 0!==r?r:512,this._sampleThreshold=null!==(a=null==e?void 0:e._sampleThreshold)&&void 0!==a?a:.707,this.pointDistance=Math.sqrt(4*Math.PI)/Math.sqrt(this._numberOfSamples),this.pixelDistance=Math.sqrt(2)*Math.PI*2/this._width,this.samplePoints=this._createEquirectangularSamplePoints(this._numberOfSamples),this.sampleUVs=this.samplePoints.map(e=>Gl(e))}detectLightSources(e,t,n){var r;this.textureData=n,this._textureConverter=null!==(r=this._textureConverter)&&void 0!==r?r:new Kl,this.grayscaleTexture=this._textureConverter.newGrayscaleTexture(e,t,this._width,this._height),this.detectorArray=this._redFromRgbaToNormalizedFloatArray(this.grayscaleTexture.pixels),this.detectorTexture=this._grayscaleTextureFromFloatArray(this.detectorArray,this._width,this._height),this.lightSamples=this._filterLightSamples(this._sampleThreshold),this.lightGraph=this._findClusterSegments(this.lightSamples,this._sampleThreshold),this.lightGraph.findConnectedComponents(),this.lightSources=this.createLightSourcesFromLightGraph(this.lightSamples,this.lightGraph),this.lightSources.sort((e,t)=>t.maxIntensity-e.maxIntensity)}_redFromRgbaToNormalizedFloatArray(e,t){const n=new Float32Array(e.length/4);let r=1,a=0;for(let t=0;t<e.length/4;++t){const i=e[4*t]/255;r=Math.min(r,i),a=Math.max(a,i),n[t]=i}if(t)for(let e=0;e<n.length;++e){const i=(n[e]-r)/(a-r);n[e]=Math.pow(i,t)}else for(let e=0;e<n.length;++e)n[e]=(n[e]-r)/(a-r);return n}_grayscaleTextureFromFloatArray(e,t,n){const r=t*n,a=new Uint8Array(4*r);for(let t=0;t<r;t++){const n=255*e[t];a[4*t+0]=n,a[4*t+1]=n,a[4*t+2]=n,a[4*t+3]=255}const i=new Pe(a,t,n);return i.needsUpdate=!0,i}_filterLightSamples(e){const t=[];for(let n=0;n<this.sampleUVs.length;n++){const r=this.sampleUVs[n];this._detectorTextureLuminanceValueFromUV(r)>e&&t.push(new ql(this.samplePoints[n],r))}return t}_detectorTextureLuminanceValueFromUV(e){const t=Math.floor(e.x*this._width),n=Math.floor(e.y*this._height)*this._width+t;return this.detectorArray[n]}_originalLuminanceValueFromUV(e){if(!(this.textureData&&this.textureData.data&&this.textureData._width&&this.textureData._height))return 256*this._detectorTextureLuminanceValueFromUV(e);const t=Math.floor(e.x*this.textureData._width),n=Math.floor(e.y*this.textureData._height);let r=0;for(let e=Math.max(0,t-2);e<Math.max(0,t+2);++e)for(let t=Math.max(0,n-2);t<Math.max(0,n+2);++t){const n=t*this.textureData._width+e,a=(this.textureData.data[4*n]+this.textureData.data[4*n+1]+this.textureData.data[4*n+2])/3;r=Math.max(r,a)}return r}_findClusterSegments(e,t){const n=2*this.pixelDistance,r=1.5*this.pointDistance,a=new Ql(e.length);for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].position.angleTo(e[s].position)<r){const r=e[s].position.clone().sub(e[i].position),o=Math.floor(r.length()/n);let l=!0,h=0;for(let n=1;n<o;n++){const a=r.clone().multiplyScalar(n/o),s=Gl(e[i].position.clone().add(a).normalize());if(this._detectorTextureLuminanceValueFromUV(s)<t){if(h++,h>1){l=!1;break}}else h=0}l&&(a.adjacent[i].push(s),a.adjacent[s].push(i),a.edges.push([i,s]))}return a}createLightSourcesFromLightGraph(e,t){const n=t.components.filter(e=>e.length>1).map(t=>new Yl(t.map(t=>e[t])));return n.forEach(e=>e.calculateLightSourceProperties(e=>this._originalLuminanceValueFromUV(e))),n}});class ql{constructor(e,t){this.position=e,this.uv=t}}class Ql{constructor(e){this.edges=[],this.adjacent=[],this.components=[],this.noOfNodes=e;for(let t=0;t<e;t++)this.adjacent.push([])}findConnectedComponents(){const e=new Array(this.noOfNodes).fill(!1);this.components=[];for(let t=0;t<this.noOfNodes;t++)if(!e[t]){const n=[];this._dfs(t,e,n),this.components.push(n)}this.components.sort((e,t)=>t.length-e.length)}_dfs(e,t,n){t[e]=!0,n.push(e);for(const r of this.adjacent[e])t[r]||this._dfs(r,t,n)}}class Yl{constructor(e){this.position=new s,this.uv=new i,this.averageIntensity=0,this.maxIntensity=0,this.size=0,this.lightSamples=e}calculateLightSourceProperties(e){this.position=new s,this.averageIntensity=0,this.maxIntensity=0;for(const t of this.lightSamples){this.position.add(t.position);const n=e(t.uv);this.averageIntensity+=n,this.maxIntensity=Math.max(this.maxIntensity,n)}this.averageIntensity/=this.lightSamples.length,this.position.normalize(),this.uv=Gl(this.position);let t=0;for(const e of this.lightSamples)t+=e.position.distanceTo(this.position);t/=this.lightSamples.length,this.size=t/Math.PI}}class Zl{constructor(e){this.grayMaterial=Fa.createMeshStandardMaterial({color:12632256,side:j,envMapIntensity:.4}),this._renderPass=new Go,this._sceneRenderer=e,this._environmentMapDecodeMaterial=new Xl(!0,!1),this._environmentMapDecodeMaterial.blending=gt,this._environmentMapDecodeMaterial.depthTest=!1}get _gBufferRenderTarget(){return this._sceneRenderer.gBufferRenderTarget}get _screenSpaceShadow(){return this._sceneRenderer.screenSpaceShadow}get _shadowAndAoPass(){return this._sceneRenderer.shadowAndAoPass}get _groundReflectionPass(){return this._sceneRenderer.groundReflectionPass}get _bakedGroundContactShadow(){return this._sceneRenderer.bakedGroundContactShadow}dispose(){var e,t;null===(e=this._depthRenderMaterial)||void 0===e||e.dispose(),null===(t=this._copyMaterial)||void 0===t||t.dispose(),this.grayMaterial.dispose()}getCopyMaterial(e){var t;return this._copyMaterial=null!==(t=this._copyMaterial)&&void 0!==t?t:new Oo,this._copyMaterial.update(e)}_getDepthRenderMaterial(e){var t;return this._depthRenderMaterial=null!==(t=this._depthRenderMaterial)&&void 0!==t?t:new Uo({depthTexture:this._gBufferRenderTarget.textureWithDepthValue,depthFilter:this._gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?new ut(0,0,0,1):new ut(1,0,0,0)}),this._depthRenderMaterial.update({camera:e})}render(e,t,n,r,a,i,s){e(r,a,i),"color"!==s?("grayscale"===s?this._sceneRenderer.renderCacheManager.render("debug",a,()=>{this._renderPass.renderWithOverrideMaterial(r,a,i,this.grayMaterial,null,0,1)}):t(r,a,i),n(r,a,i),this._renderDebugPass(r,a,i,s)):r.render(a,i)}_renderDebugPass(e,t,n,r){var a,i,s,o,l,d;switch(r){default:break;case"lineardepth":this._renderPass.renderScreenSpace(e,this._getDepthRenderMaterial(n),null);break;case"g-normal":this._gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(a=this._gBufferRenderTarget)||void 0===a?void 0:a.gBufferTexture,blending:gt,colorTransform:(new P).set(.5,0,0,0,0,.5,0,0,0,0,.5,0,0,0,0,0),colorBase:new ut(.5,.5,.5,1),multiplyChannels:0,uvTransform:Eo}),null):this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(i=this._gBufferRenderTarget)||void 0===i?void 0:i.gBufferTexture,blending:gt,colorTransform:Co,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),null);break;case"g-depth":this._gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(s=this._gBufferRenderTarget)||void 0===s?void 0:s.gBufferTexture,blending:gt,colorTransform:Mo,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),null):this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(o=this._gBufferRenderTarget)||void 0===o?void 0:o.depthBufferTexture,blending:gt,colorTransform:To,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),null);break;case"ssao":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.shadowAndAoRenderTargets.passRenderTarget.texture,blending:gt,colorTransform:Ao,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"ssaodenoise":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.denoiseRenderTargetTexture,blending:gt,colorTransform:Ao,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowmap":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._screenSpaceShadow.shadowTexture,blending:gt,colorTransform:Ao,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadow":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.shadowAndAoRenderTargets.passRenderTarget.texture,blending:gt,colorTransform:Bl.shadowTransform,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowblur":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.denoiseRenderTargetTexture,blending:gt,colorTransform:Bl.shadowTransform,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowfadein":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.fadeRenderTarget.texture,blending:gt,colorTransform:Bl.shadowTransform,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowandao":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.denoiseRenderTargetTexture,blending:gt,colorTransform:ko(this._shadowAndAoPass.parameters.aoIntensity,this._shadowAndAoPass.parameters.shadowIntensity,0,1),colorBase:Po,multiplyChannels:1,uvTransform:Eo}),null);break;case"groundreflection":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._groundReflectionPass.reflectionRenderTarget.texture,blending:gt,colorTransform:So,colorBase:Po,multiplyChannels:0,uvTransform:Io}),null);break;case"bakedgroundshadow":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._bakedGroundContactShadow.renderTarget.texture,blending:gt,colorTransform:So,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"environmentmap":this._environmentMapDecodeMaterial.setSourceTexture(t.environment),this._renderPass.renderScreenSpace(e,this._environmentMapDecodeMaterial,null);break;case"lightsourcedetection":if(null===(l=t.userData)||void 0===l?void 0:l.environmentDefinition){const n=this._sceneRenderer.width/this._sceneRenderer.height,r=new $(-1,1,1/n,-1/n,-1,1),a=null===(d=t.userData)||void 0===d?void 0:d.environmentDefinition.createDebugScene(e,t);a.background=new h(16777215),e.render(a,r)}}}}var Jl;!function(e){e[e.HIGHEST=0]="HIGHEST",e[e.HIGH=1]="HIGH",e[e.MEDIUM=2]="MEDIUM",e[e.LOW=3]="LOW"}(Jl||(Jl={}));class $l{constructor(e,t,n){this.debugOutput="off",this._prevDebugOutput="off",this.outputColorSpace="",this.toneMapping="",this.environmentLights=!1,this.movingCamera=!1,this.groundLevel=0,this.uiInteractionMode=!1,this._noUpdateNeededCount=0,this._cameraUpdate=new Vo,this.width=0,this.height=0,this._maxSamples=1,this._cameraChanged=!0,this.boundingVolume=new jo,this._boundingVolumeSet=!1,this.renderCacheManager=new Xo,this._renderPass=new Go,this.selectedObjects=[],this.groundGroup=new Y,this._qualityLevel=Jl.HIGHEST,this._qualityMap=new Map,this.width=t,this.height=n,this._maxSamples=e.capabilities.maxSamples,this.renderer=e,this.renderCacheManager.registerCache("inivisibleGround",new qo(e=>e===this.groundGroup)),this.renderCacheManager.registerCache("debug",new qo),this.renderCacheManager.registerCache("floorDepthWrite",new Qo(e=>{var t;return null===(t=e.userData)||void 0===t?void 0:t.isFloor})),this.gBufferRenderTarget=new Yo(this.renderCacheManager,{shared:!0,capabilities:e.capabilities,width:this.width,height:this.height,samples:1,_renderPass:this._renderPass,textureFilter:ae}),this.shadowAndAoPass=new Bl(this.width,this.height,1,{gBufferRenderTarget:this.gBufferRenderTarget}),this.screenSpaceShadow=new ol(this.renderCacheManager,new i(this.width,this.height),{samples:this._maxSamples,alwaysUpdate:!1}),this.groundReflectionPass=new jl(this.width,this.height,{_renderPass:this._renderPass}),this.bakedGroundContactShadow=new Zo(this.renderer,this.groundGroup,{_renderPass:this._renderPass,renderCacheManager:this.renderCacheManager}),this.groundGroup.rotateX(-Math.PI/2),this.outlineRenderer=new rl(null,this.width,this.height,{gBufferRenderTarget:this.gBufferRenderTarget}),this.parameters={gBufferRenderTargetParameters:this.gBufferRenderTarget.parameters,bakedGroundContactShadowParameters:this.bakedGroundContactShadow.parameters,screenSpaceShadowMapParameters:this.screenSpaceShadow.parameters,shAndAoPassParameters:this.shadowAndAoPass.parameters,groundReflectionParameters:this.groundReflectionPass.parameters,outlineParameters:this.outlineRenderer.parameters,effectSuspendFrames:0,effectFadeInFrames:0,suspendGroundReflection:!1,shadowOnCameraChange:Ll.OFF},this._addEventListeners(this.renderer)}_addEventListeners(e){e.domElement.addEventListener("webglcontextlost",()=>{}),e.domElement.addEventListener("webglcontextrestored",()=>{this._forceEnvironmentMapUpdate(this.renderer)})}dispose(){var e,t;null===(e=this._debugPass)||void 0===e||e.dispose(),null===(t=this._copyMaterial)||void 0===t||t.dispose(),this.gBufferRenderTarget.dispose(),this.screenSpaceShadow.dispose(),this.shadowAndAoPass.dispose(),this.outlineRenderer.dispose(),this.renderer.dispose()}setSize(e,t){this.width=e,this.height=t,this.gBufferRenderTarget.setSize(e,t),this.screenSpaceShadow.setSize(e,t),this.shadowAndAoPass.setSize(e,t),this.outlineRenderer.setSize(e,t),this.groundReflectionPass.setSize(e,t),this.renderer.setSize(e,t)}getQualityLevel(){return this._qualityLevel}setQualityLevel(e){this._qualityLevel!==e&&(this._qualityMap.has(this._qualityLevel)&&(this._qualityLevel=e),this.applyCurrentParameters())}setQualityMap(e){this._qualityMap=e,this.applyCurrentParameters()}applyCurrentParameters(){this._qualityMap.has(this._qualityLevel)&&(this.updateParameters(this._qualityMap.get(this._qualityLevel)),this.bakedGroundContactShadow.applyParameters()),this.uiInteractionMode&&this.updateParameters({groundReflectionParameters:{enabled:!1}})}clearCache(){this.renderCacheManager.clearCache()}forceShadowUpdates(e){this.clearCache(),this.gBufferRenderTarget.needsUpdate=!0,this.screenSpaceShadow.forceShadowUpdate(),this.shadowAndAoPass.needsUpdate=!0,e&&(this.bakedGroundContactShadow.needsUpdate=!0)}updateParameters(e){void 0!==e.shAndAoPassParameters&&this.shadowAndAoPass.updateParameters(e.shAndAoPassParameters),void 0!==e.effectParameters&&this.shadowAndAoPass.updateParameters({effectParameters:e.effectParameters}),void 0!==e.bakedGroundContactShadowParameters&&this.bakedGroundContactShadow.updateParameters(e.bakedGroundContactShadowParameters),void 0!==e.screenSpaceShadowMapParameters&&this.screenSpaceShadow.updateParameters(e.screenSpaceShadowMapParameters),void 0!==e.groundReflectionParameters&&this.groundReflectionPass.updateParameters(e.groundReflectionParameters),void 0!==e.outlineParameters&&this.outlineRenderer.updateParameters(e.outlineParameters),void 0!==e.effectSuspendFrames&&(this.parameters.effectSuspendFrames=e.effectSuspendFrames),void 0!==e.effectFadeInFrames&&(this.parameters.effectFadeInFrames=e.effectFadeInFrames),void 0!==e.suspendGroundReflection&&(this.parameters.suspendGroundReflection=e.suspendGroundReflection),void 0!==e.shadowOnCameraChange&&(this.parameters.shadowOnCameraChange=e.shadowOnCameraChange)}addRectAreaLight(e,t){this.environmentLights=!1,this.screenSpaceShadow.addRectAreaLight(e,t),this.shadowAndAoPass.needsUpdate=!0}updateRectAreaLights(e,t){e.length>0&&(this.environmentLights=!1),this.screenSpaceShadow.updateRectAreaLights(e,t),this.shadowAndAoPass.needsUpdate=!0}createShadowFromLightSources(e,t){this.environmentLights=!0,this.screenSpaceShadow.createShadowFromLightSources(e,t),this.shadowAndAoPass.needsUpdate=!0}selectObjects(e){this.selectedObjects=e}updateBounds(e,t){this.renderCacheManager.clearCache(),this._boundingVolumeSet=!0,this.boundingVolume.updateFromBox(e);const n=this.boundingVolume.size,r=(n.x+n.y+n.z)/3,a=Math.min(n.x,n.y,n.z),i=Math.max(n.x,n.y,n.z),s=a<.5?a/.5:n.z>5?n.z/5:1;this.bakedGroundContactShadow.setScale(t?r:s,r),this.groundReflectionPass.updateBounds(this.groundLevel,Math.min(1,i)),this.screenSpaceShadow.updateBounds(this.boundingVolume,r),this.shadowAndAoPass.updateBounds(this.boundingVolume,t?r:Math.min(1,2*i))}updateNearAndFarPlaneOfPerspectiveCamera(e,t){const n=this.boundingVolume.getNearAndFarForPerspectiveCamera(e.position,3);e.near=Math.max(1e-5,.9*n[0]),e.far=Math.max(null!=t?t:e.near,n[1]),e.updateProjectionMatrix()}_setRenderState(e,t){var n;const r=this.debugOutput!==this._prevDebugOutput;this._prevDebugOutput=this.debugOutput,this.screenSpaceShadow.parameters.alwaysUpdate=this.shadowAndAoPass.parameters.alwaysUpdate,this._cameraChanged=this._cameraUpdate.changed(t),(n=this.gBufferRenderTarget).needsUpdate||(n.needsUpdate=this._cameraChanged||r)}_forceEnvironmentMapUpdate(e){const t=e.userData;if(null==t?void 0:t.environmentTexture){const e=t.environmentTexture;t.environmentTexture=void 0,e.dispose()}}_updateEnvironment(e,t){var n,r;if(!(null===(n=t.userData)||void 0===n?void 0:n.environmentDefinition))return;e.userData||(e.userData={});const a=e.userData;if(a&&((null===(r=t.userData)||void 0===r?void 0:r.environmentDefinition.needsUpdate)||!a.environmentTexture||a.environmentDefinition!==t.userData.environmentDefinition)){const n=t.userData.environmentDefinition;a.environmentDefinition=n,a.environmentTexture=n.createNewEnvironment(e),t.userData.shadowFromEnvironment&&this.createShadowFromLightSources(t,n.lightSources)}t.environment=null==a?void 0:a.environmentTexture,t.userData.showEnvironmentBackground?t.background=t.environment:t.background===t.environment&&(t.background=null)}render(e,t){e.add(this.groundGroup),this._setRenderState(e,t),this._updateEnvironment(this.renderer,e),this.outlineRenderer.updateOutline(e,t,this.movingCamera?[]:this.selectedObjects),this.renderer.setRenderTarget(null),this.debugOutput&&""!==this.debugOutput&&"off"!==this.debugOutput?this._renderDebug(this.renderer,e,t):(this.renderPreRenderPasses(this.renderer,e,t),this._renderScene(this.renderer,e,t),this.renderPostProcessingEffects(this.renderer,e,t)),e.remove(this.groundGroup)}_renderDebug(e,t,n){var r;this._debugPass=null!==(r=this._debugPass)&&void 0!==r?r:new Zl(this),this._debugPass.render((e,t,n)=>this.renderPreRenderPasses(e,t,n),(e,t,n)=>this._renderScene(e,t,n),(e,t,n)=>this.renderPostProcessingEffects(e,t,n),e,t,n,this.debugOutput)}renderPreRenderPasses(e,t,n){this._renderGroundContactShadow(t)}_renderScene(e,t,n){this.renderCacheManager.onBeforeRender("floorDepthWrite",t),this.bakedGroundContactShadow.setGroundVisibility(!0,n),e.render(t,n),this.bakedGroundContactShadow.setGroundVisibility(!1,n),this.renderCacheManager.onAfterRender("floorDepthWrite")}renderPostProcessingEffects(e,t,n){this.renderShadowAndAo(e,t,n),this._renderOutline()}_renderGroundContactShadow(e){this.bakedGroundContactShadow.needsUpdate&&this.bakedGroundContactShadow.updateBounds(this.boundingVolume,this.groundLevel),this.bakedGroundContactShadow.render(e)}renderShadowAndAo(e,t,n){const r=this._evaluateIfShadowAndAoUpdateIsNeeded(n);if(r.needsUpdate||r.shadowOnCameraChange!==Ll.OFF){if(!this.parameters.suspendGroundReflection||r.needsUpdate){const a=this.parameters.suspendGroundReflection?r.intensityScale:1;this._renderGroundReflection(e,t,n,a)}this.gBufferRenderTarget.needsUpdate=r.needsUpdate||r.shadowOnCameraChange===Ll.POISSON,this._renderEffectsWithGround(e,t,n),this._renderEffectsWithoutGround(e,t,n),this.shadowAndAoPass.render(e,t,n,this.screenSpaceShadow.shadowTexture,r.needsUpdate?Ll.FULL:r.shadowOnCameraChange,r.shadowOnCameraChange,1-r.intensityScale)}}_evaluateIfShadowAndAoUpdateIsNeeded(e){const t=this.shadowAndAoPass.parameters.alwaysUpdate||this.screenSpaceShadow.needsUpdate||this.screenSpaceShadow.shadowTypeNeedsUpdate;let n=(this.shadowAndAoPass.parameters.enabled||this.groundReflectionPass.parameters.enabled)&&(0===this.parameters.effectSuspendFrames||this._cameraChanged);n&&(this._noUpdateNeededCount=0);let r=1;return!t&&this.parameters.effectSuspendFrames>0&&(this._noUpdateNeededCount++,n=this._noUpdateNeededCount>=this.parameters.effectSuspendFrames,r=Math.max(0,Math.min(1,(this._noUpdateNeededCount-this.parameters.effectSuspendFrames)/this.parameters.effectFadeInFrames))),n=t||n,{needsUpdate:n,shadowOnCameraChange:!n||r<.99?this.parameters.shadowOnCameraChange:Ll.OFF,intensityScale:r}}_renderGroundReflection(e,t,n,r=1){this.groundReflectionPass.parameters.enabled&&this.renderCacheManager.render("inivisibleGround",t,()=>{this.groundReflectionPass.render(e,t,n,r)})}_renderEffectsWithGround(e,t,n){const r=this._boundingVolumeSet&&this.shadowAndAoPass.parameters.aoOnGround,a=this.shadowAndAoPass.parameters.shadowIntensity>0&&this._boundingVolumeSet&&this.shadowAndAoPass.parameters.shadowOnGround,i=this.bakedGroundContactShadow.shadowGroundPlane;if(r){const r=null===this.bakedGroundContactShadow.parameters.hardLayers;r&&i.setDepthWrite(!0),this.gBufferRenderTarget.render(e,t,n),r&&i.setDepthWrite(!1)}a&&(i.setReceiveShadow(!0),this.screenSpaceShadow.renderShadowMap(e,t,n),i.setReceiveShadow(!1))}_renderEffectsWithoutGround(e,t,n){const r=!this._boundingVolumeSet||!this.shadowAndAoPass.parameters.aoOnGround,a=this.shadowAndAoPass.parameters.shadowIntensity>0&&(!this._boundingVolumeSet||!this.shadowAndAoPass.parameters.shadowOnGround);(r||a)&&this.renderCacheManager.render("inivisibleGround",t,()=>{r&&this.gBufferRenderTarget.render(e,t,n),a&&this.screenSpaceShadow.renderShadowMap(e,t,n)})}_renderOutline(){if(this.outlineRenderer.outlinePassActivated&&this.outlineRenderer.outlinePass){const e=this.renderer.getClearColor(new h),t=this.renderer.getClearAlpha();"outline"===this.debugOutput&&(this.renderer.setClearColor(0,255),this.renderer.clear(!0,!1,!1)),this.outlineRenderer.outlinePass.renderToScreen=!1,this.outlineRenderer.outlinePass.render(this.renderer,null,null,0,!1),"outline"===this.debugOutput&&this.renderer.setClearColor(e,t)}}}class eh{constructor(e){this._qualityLevel="",this._ambientOcclusionType="",this._sceneRenderer=e}addGUI(e,t){this._addRepresentationalGUI(e,t),this._addDebugGUI(e,t);const n=e.addFolder("Shadow type");this._addShadowTypeGUI(n,t);const r=e.addFolder("Shadow and Ambient Occlusion");this._addShadowAndAoGUI(r,t);const a=e.addFolder("Ground Reflection");this._addGroundReflectionGUI(a,t);const i=e.addFolder("Baked Ground Contact Shadow");this._addBakedGroundContactShadowGUI(i,t);const s=e.addFolder("Outline");this._addOutlineGUI(s,t)}_addRepresentationalGUI(e,t){const n=new Map([["LinearSRGBColorSpace",Ce],["SRGBColorSpace",M]]),r=[];n.forEach((e,t)=>{r.push(t),this._sceneRenderer.renderer.outputColorSpace===e&&(this._sceneRenderer.outputColorSpace=t)}),e.add(this._sceneRenderer,"outputColorSpace",r).onChange(e=>{var r;n.has(e)&&(this._sceneRenderer.renderer.outputColorSpace=null!==(r=n.get(e))&&void 0!==r?r:M,t())});const a=new Map([["NoToneMapping",qt],["LinearToneMapping",Qt],["ReinhardToneMapping",Yt],["CineonToneMapping",Zt],["ACESFilmicToneMapping",Jt]]),i=[];a.forEach((e,t)=>{i.push(t),this._sceneRenderer.renderer.toneMapping===e&&(this._sceneRenderer.toneMapping=t)}),e.add(this._sceneRenderer,"toneMapping",i).onChange(e=>{var n;a.has(e)&&(this._sceneRenderer.renderer.toneMapping=null!==(n=a.get(e))&&void 0!==n?n:qt,t())})}_addDebugGUI(e,t){const n=new Map([["HIGHEST",Jl.HIGHEST],["HIGH",Jl.HIGH],["MEDIUM",Jl.MEDIUM],["LOW",Jl.LOW]]),r=[];n.forEach((e,t)=>r.push(t)),e.add(this,"_qualityLevel",r).onChange(e=>{var t;n.has(e)&&this._sceneRenderer.setQualityLevel(null!==(t=n.get(e))&&void 0!==t?t:Jl.HIGHEST)}),e.add(this._sceneRenderer,"debugOutput",{"off ":"off","grayscale (no textures)":"grayscale","color buffer":"color","linear depth":"lineardepth","g-buffer normal vector":"g-normal","g-buffer depth":"g-depth","AO pure":"ssao","AO denoised":"ssaodenoise","shadow map":"shadowmap","shadow Monte Carlo":"shadow","shadow blur":"shadowblur","shadow fade in":"shadowfadein","shadow and AO":"shadowandao","ground reflection":"groundreflection","baked ground shadow":"bakedgroundshadow","selection outline":"outline","environment map":"environmentmap","light source detection":"lightsourcedetection"}).onChange(()=>t())}_addShadowTypeGUI(e,t){const n=this._sceneRenderer.screenSpaceShadow.shadowConfiguration,r=[];n.types.forEach((e,t)=>{r.push(t)});const a=()=>{this._sceneRenderer.screenSpaceShadow.needsUpdate=!0,this._sceneRenderer.screenSpaceShadow.shadowTypeNeedsUpdate=!0,this._sceneRenderer.shadowAndAoPass.needsUpdate=!0,t()};e.add(n,"shadowType",r).onChange(e=>{this._sceneRenderer.screenSpaceShadow.switchType(e)&&(i.object=n.currentConfiguration,s.object=n.currentConfiguration,o.object=n.currentConfiguration,i.updateDisplay(),s.updateDisplay(),o.updateDisplay(),a())});const i=e.add(n.currentConfiguration,"bias",-.001,.001,1e-5).onChange(()=>a()),s=e.add(n.currentConfiguration,"normalBias",-.05,.05).onChange(()=>a()),o=e.add(n.currentConfiguration,"radius",0,100).onChange(()=>a())}_addShadowAndAoGUI(e,t){const n=()=>{this._sceneRenderer.gBufferRenderTarget.needsUpdate=!0,this._sceneRenderer.screenSpaceShadow.needsUpdate=!0,this._sceneRenderer.shadowAndAoPass.needsUpdate=!0,this._sceneRenderer.shadowAndAoPass.shadowAndAoRenderTargets.parametersNeedsUpdate=!0,t()},r=this._sceneRenderer.shadowAndAoPass.parameters,a=r.shAndAo,i=this._sceneRenderer.screenSpaceShadow.parameters,s=r.ssao,o=r.hbao,l=r.poissonDenoise;e.add(r,"enabled").onChange(()=>n());const h=new Map([["none",Ul.NONE],["SSAO",Ul.SSAO],["effects SSAO",Ul.EffectsSSAO],["effects HBAO",Ul.EffectsHBAO]]),d=Array.from(h.keys());h.forEach((e,t)=>{e===r.aoType&&(this._ambientOcclusionType=t)}),e.add(this,"_ambientOcclusionType",d).onChange(e=>{var t;h.has(e)&&(r.aoType=null!==(t=h.get(e))&&void 0!==t?t:Ul.SSAO,n())}),e.add(r,"aoIntensity",0,1).onChange(()=>{n()}),e.add(r,"aoOnGround").onChange(()=>{n()}),e.add(r,"shadowOnGround").onChange(()=>{n()}),e.add(r,"shadowIntensity",0,1).onChange(()=>n()),e.add(r,"alwaysUpdate").onChange(()=>n());const c=e.addFolder("Shadow and Monte Carlo integration");c.add(i,"maximumNumberOfLightSources").onChange(()=>n()),c.add(i,"directionalDependency",0,1,.01).onChange(()=>n()),c.add(i,"directionalExponent",0,2,.01).onChange(()=>n()),c.add(i,"groundContainment",0,1,.01).onChange(()=>n()),c.add(i,"fadeOutDistance",0,5,.01).onChange(()=>n()),c.add(i,"fadeOutBlur",0,100).onChange(()=>n()),c.add(a,"shadowRadius",.001,.5).onChange(()=>n());const u=e.addFolder("Roomle SSAO");u.add(a,"aoFadeout",0,1).onChange(()=>n()),u.add(a,"aoKernelRadius",.001,1).onChange(()=>n()),u.add(a,"aoDepthBias",1e-4,.01).onChange(()=>n()),u.add(a,"aoMaxDistance",.01,1).onChange(()=>n()),u.add(a,"aoMaxDepth",.9,1).onChange(()=>n());const p=e.addFolder("effects SSAO");p.add(s,"resolutionScale",.25,1,.25).onChange(()=>n()),p.add(s,"spp",1,64,1).onChange(()=>n()),p.add(s,"distance",.1,10,.1).onChange(()=>n()),p.add(s,"distancePower",0,2,.125).onChange(()=>n()),p.add(s,"bias",0,500,1).onChange(()=>n()),p.add(s,"power",.5,32,.5).onChange(()=>n()),p.add(s,"thickness",0,.1,.001).onChange(()=>n());const m=e.addFolder("effects HBAO");m.add(o,"resolutionScale",.25,1,.2).onChange(()=>n()),m.add(o,"spp",1,64,1).onChange(()=>n()),m.add(o,"distance",.1,10,.01).onChange(()=>n()),m.add(o,"distancePower",.1,10,.1).onChange(()=>n()),m.add(o,"bias",0,100,1).onChange(()=>n()),m.add(o,"power",.5,8,.5).onChange(()=>n()),m.add(o,"thickness",0,.1,.001).onChange(()=>n());const f=e.addFolder("Possion Denoise");f.add(l,"iterations",0,3,1).onChange(()=>n()),f.add(l,"radius",0,32,1).onChange(()=>n()),f.add(l,"rings",0,16,.125).onChange(()=>n()),f.add(l,"samples",0,32,1).onChange(()=>n()),f.add(l,"lumaPhi",0,20,.001).onChange(()=>n()),f.add(l,"depthPhi",0,20,.001).onChange(()=>n()),f.add(l,"normalPhi",0,20,.001).onChange(()=>n())}_addGroundReflectionGUI(e,t){const n=this._sceneRenderer.parameters.groundReflectionParameters;e.add(n,"enabled"),e.add(n,"intensity",0,1).onChange(()=>t()),e.add(n,"fadeOutDistance",0,4).onChange(()=>t()),e.add(n,"fadeOutExponent",.1,10).onChange(()=>t()),e.add(n,"brightness",0,2).onChange(()=>t()),e.add(n,"blurHorizontal",0,10).onChange(()=>t()),e.add(n,"blurVertical",0,10).onChange(()=>t())}_addBakedGroundContactShadowGUI(e,t){const n=()=>{this._sceneRenderer.bakedGroundContactShadow.applyParameters(),t()},r=this._sceneRenderer.parameters.bakedGroundContactShadowParameters;e.add(r,"enabled"),e.add(r,"cameraHelper").onChange(()=>n()),e.add(r,"alwaysUpdate"),e.add(r,"fadeIn"),e.add(r,"blurMin",0,.2,.001).onChange(()=>n()),e.add(r,"blurMax",0,.5,.01).onChange(()=>n()),e.add(r,"fadeoutFalloff",0,1,.01).onChange(()=>n()),e.add(r,"fadeoutBias",0,.5).onChange(()=>n()),e.add(r,"opacity",0,1,.01).onChange(()=>n()),e.add(r,"maximumPlaneSize",0,50,1).onChange(()=>n()),e.add(r,"cameraFar",.1,10,.1).onChange(()=>n())}_addOutlineGUI(e,t){const n=()=>{this._sceneRenderer.outlineRenderer.applyParameters(),t()},r=this._sceneRenderer.outlineRenderer.parameters;e.add(r,"enabled"),e.add(r,"edgeStrength",.5,20).onChange(()=>n()),e.add(r,"edgeGlow",0,20).onChange(()=>n()),e.add(r,"edgeThickness",.5,20).onChange(()=>n()),e.add(r,"pulsePeriod",0,5).onChange(()=>n()),e.addColor(r,"visibleEdgeColor").onChange(()=>n()),e.addColor(r,"hiddenEdgeColor").onChange(()=>n())}}const th={effectSuspendFrames:0,effectFadeInFrames:0,suspendGroundReflection:!1,shadowOnCameraChange:Ll.FULL},nh={effectSuspendFrames:5,effectFadeInFrames:5,suspendGroundReflection:!1,shadowOnCameraChange:Ll.POISSON},rh={effectSuspendFrames:5,effectFadeInFrames:5,suspendGroundReflection:!0,shadowOnCameraChange:Ll.HARD},ah={iterations:1,radius:10,rings:5.625,lumaPhi:10,depthPhi:12,normalPhi:3.25,samples:16},ih=e("a6",new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:{enabled:!0,aoOnGround:!0,shadowOnGround:!0,poissonDenoise:ah},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:{enabled:!1}}],[Jl.HIGH,{...nh,shAndAoPassParameters:{enabled:!0,aoOnGround:!0,shadowOnGround:!0,poissonDenoise:ah},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:{enabled:!1}}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:{enabled:!0,aoOnGround:!0,shadowOnGround:!0,poissonDenoise:ah},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:{enabled:!1}}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:{enabled:!0}}]])),sh=new $t;sh.enable(3);const oh=new $t;oh.disableAll(),oh.enable(9);const lh={enabled:!0,aoType:Ul.SSAO,aoIntensity:.5,shadowIntensity:0,aoOnGround:!0,shadowOnGround:!1,poissonDenoise:ah},hh={enabled:!0,aoType:Ul.EffectsHBAO,aoIntensity:.5,shadowIntensity:0,aoOnGround:!0,shadowOnGround:!1,poissonDenoise:{iterations:1,radius:10,rings:5.625,lumaPhi:10,depthPhi:2,normalPhi:3.25,samples:16}},dh=hh,ch={enabled:!0,fadeoutFalloff:.9,blurMax:.1,opacity:.5,hardLayers:null,softLayers:null,polygonOffset:2},uh={enabled:!0,fadeoutFalloff:.8,blurMax:.15,opacity:.5,hardLayers:oh,softLayers:null,polygonOffset:-1},ph={enabled:!1},mh=new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:lh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:ch}],[Jl.HIGH,{...nh,shAndAoPassParameters:lh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:ch}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:lh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:ch}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ch}]]),fh=new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:hh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}],[Jl.HIGH,{...nh,shAndAoPassParameters:hh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:hh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}]]),gh=new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:dh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}],[Jl.HIGH,{...nh,shAndAoPassParameters:dh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:dh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}]]);class vh{constructor(){this._index=0,this._prevTime=0,this._frames=0,this._fps=-1,this._fpsList=Array(2).fill(0),this._prevTime=(performance||Date).now(),this.reset()}update(){this._frames++;const e=(performance||Date).now();e>=this._prevTime+1e3&&(this._fpsList[this._index%2]=1e3*this._frames/(e-this._prevTime),this._index>=2&&(this._fps=this._fpsList.reduce((e,t)=>e+t)/this._fpsList.length),this._prevTime=e,this._frames=0,this._index++)}start(){this._prevTime=(performance||Date).now(),this._frames=0}reset(){this._fps=-1,this._fpsList=Array(2).fill(0),this._index=0}getFps(){return this._fps}}var _h;e("ae",_h),function(e){e[e.Mode3D=0]="Mode3D",e[e.Mode2D=1]="Mode2D"}(_h||e("ae",_h={}));class wh{get renderer(){return this._renderer}get screenSpaceShadowParameters(){return this.sceneRenderer.screenSpaceShadow.parameters}get shadowAndAoPassParameters(){return this.sceneRenderer.shadowAndAoPass.parameters}get bakedGroundContactShadowParameters(){return this.sceneRenderer.bakedGroundContactShadow.parameters}get groundReflectionParameters(){return this.sceneRenderer.groundReflectionPass.parameters}get outlineParameters(){return this.sceneRenderer.outlineRenderer.parameters}constructor(e,t,n){this.configuratorMode=!0,this.uiInteractionMode=!0,this._renderer=e,this.sceneRenderer=new $l(this._renderer,t,n),this.outlineParameters.enabled=!0,this.outlineParameters.edgeStrength=2,this.outlineParameters.edgeGlow=1,this.outlineParameters.edgeThickness=2,this.outlineParameters.pulsePeriod=0,this.outlineParameters.usePatternTexture=!1,this.outlineParameters.visibleEdgeColor=16777215,this.outlineParameters.hiddenEdgeColor=16777215,wh.enableRectAreaLightShadow&&(on.rectAreaLightReplacement=!1,on.rectAreaLightLoadingListener=this.loadRectAreLight),this.sceneRenderer.setQualityLevel(Jl.HIGHEST),this.SceneRendererGUI=new eh(this.sceneRenderer)}dispose(){this.sceneRenderer.dispose()}setSize(e,t){this.sceneRenderer.setSize(e,t)}setAutoQuality(e){!this._fpsCounter&&e?this._fpsCounter=new vh:this._fpsCounter&&!e&&(this._fpsCounter=null)}setQualityLevel(e){this.sceneRenderer.setQualityLevel(e)}setQualityMap(e){this.sceneRenderer.setQualityMap(e)}enableUiInteractionMode(){this.sceneRenderer.uiInteractionMode=!0,this.sceneRenderer.applyCurrentParameters()}disableUiInteractionMode(){this.sceneRenderer.uiInteractionMode=!1,this.sceneRenderer.applyCurrentParameters()}loadRectAreLight(e){wh.rectAreaLightsNeedsUpdate=!0}updateRectAreaLight(e){let t=[];e.traverse(e=>{e instanceof o&&t.push(e)}),this.sceneRenderer.updateRectAreaLights(t,e),wh.rectAreaLightsNeedsUpdate=!1}clearCache(){this.sceneRenderer.clearCache()}forceShadowUpdates(e){this.sceneRenderer.forceShadowUpdates(e)}switchToConfigurator(){this.configuratorMode=!0,this.sceneRenderer.setQualityMap(mh)}switchToPlanner(e){_h.Mode3D,this.configuratorMode=!1,e===_h.Mode3D?this.sceneRenderer.setQualityMap(fh):this.sceneRenderer.setQualityMap(gh)}updateBounds(e){this.sceneRenderer.updateBounds(e,!1)}updateEnvironment(e,t=!1){e&&this.updateBounds(e)}movingCameraStarts(){var e;this.sceneRenderer.movingCamera=!0,null===(e=this._fpsCounter)||void 0===e||e.start()}movingCameraStops(){this.sceneRenderer.movingCamera=!1}highlightObjects(e){this.sceneRenderer.selectObjects(e)}render(e,t){var n;wh.rectAreaLightsNeedsUpdate&&this.updateRectAreaLight(e),t.updateMatrixWorld(),(t instanceof Z||t instanceof $)&&t.updateProjectionMatrix();const r=wh.updateNearAndFarPlaneOfPerspectiveCamera?this.createRenderCamera(t):t;if(this.sceneRenderer.render(e,r),this.sceneRenderer.movingCamera&&this._fpsCounter){null===(n=this._fpsCounter)||void 0===n||n.update();const e=this.sceneRenderer.getQualityLevel(),t=this._fpsCounter.getFps();t>0&&t<30&&e<3&&(this.sceneRenderer.setQualityLevel(e+1),this._fpsCounter.reset())}}createRenderCamera(e){const t=e.clone();return this.configuratorMode&&t instanceof Z&&(this.sceneRenderer.updateNearAndFarPlaneOfPerspectiveCamera(t,120),t.updateProjectionMatrix()),t}showGUI(e){const t=qa();this.SceneRendererGUI.addGUI(t,e)}}e("a5",wh),wh.enableRectAreaLightShadow=!0,wh.rectAreaLightsNeedsUpdate=!1,wh.updateNearAndFarPlaneOfPerspectiveCamera=!1;class bh{_getRoomleRenderer(e=!1){if(!this._roomleRenderer){const t=new en({antialias:!e,alpha:!0});t.outputColorSpace=M,t.autoClear=!0,t.setSize(1024,1024),t.outputColorSpace=M,t.autoClear=!1,t.shadowMap.enabled=!0,t.shadowMap.type=Nt,this._roomleRenderer=new wh(t,1024,1024),this._roomleRenderer.setQualityMap(ih),this._roomleRenderer.setSize(1024,1024)}return this._roomleRenderer}switchToPlannerSettings(){this._getRoomleRenderer().switchToPlanner(_h.Mode3D)}switchToConfiguratorSettings(){this._getRoomleRenderer().switchToConfigurator()}static getCameraTargetForBBox(e,t=0){if(!e){const e=new s;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new s);return n.addScalar(t),{center:e.getCenter(new s),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}preparePerspectiveImage(e,t,n,r,a={},i=0,s=!1){return new Promise(o=>{const{size:l=1024,showDimensions:h}=a,d=this._getRoomleRenderer(s);d.setSize(l,l);const c=e.fog?e.fog.clone():null,u=e.background?e.background.clone():null;e.background=null,e.fog=null,n.layers.disable(2),n.layers.disable(6),n.layers.disable(5),h?n.layers.enable(8):n.layers.disable(8);const p=-30+xr(i);bh.placeCameraForPerspectiveImage(n,r,-20,p);const m=this._render(d,e,t,n,s);n.layers.enable(2),n.layers.enable(6),n.layers.enable(5),e.background=u,e.fog=c,o({image:m,width:l,height:l,blob:null})})}renderPerspectiveImage(e,t,n,r){return new Promise(a=>{r||(r=1024);const i=this._getRoomleRenderer();i.setSize(r,r);const s=e.fog?e.fog.clone():null,o=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(6),t.layers.disable(5),n?bh.placeCameraForPerspectiveImage(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix());const l=this._render(i,e,null,t);t.layers.enable(2),t.layers.enable(6),t.layers.enable(5),e.background=o,e.fog=s,a({image:l,width:r,height:r,blob:null})})}static placeCameraForPerspectiveImage(e,t,n,r){e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(yr(r)),e.rotateX(yr(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}prepareTopImage(e,t,n,r={}){const{showDimensions:a=!1}=r;return new Promise(r=>{const i=this._getRoomleRenderer();let s=new $(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);s.position.copy(n.center),s.rotateX(yr(-90)),s.translateZ(n.bounds.y+1),s.far=s.position.y+.5,s.layers.mask=65535;let o=200*n.bounds.x,l=200*n.bounds.z;if(o>4096||l>4096){let e=0;o>4096?e=o/4096:l>4096&&(e=l/4096),o/=e,l/=e}i.setSize(o,l);let h=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null,s.layers.disable(2),s.layers.disable(6),s.layers.disable(5),a?s.layers.enable(8):s.layers.disable(8);const c=this._render(i,e,t,s);s.layers.enable(2),s.layers.enable(6),s.layers.enable(5),e.background=d,e.fog=h,r({image:c,width:o,height:l,blob:null})})}_render(e,t,n,r,a=!1){return a?e.renderer.render(t,r):(e.forceShadowUpdates(!0),e.render(t,r),e.render(t,r)),n&&(e.renderer.autoClear=!1,e.renderer.clearDepth(),e.renderer.render(n,r),e.renderer.autoClear=!0),e.renderer.domElement.toDataURL()}}e("r",bh);const yh=e("I",[new nn("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let r=n.length;for(let e=0;e<r;e++){const r=n[e];r.apply(r,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let r=n.length;for(let e=0;e<r;e++)if(n[e]===t)return n.splice(e,1),r--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new nn("form-data-util",an),new nn("hdr-environment-loader",class{constructor(e){this._creator_=e;const t=new h("#DDDDDD");this._environmentMap=((e,t,n,r)=>{const a=new Te;a.format=Ae,a.generateMipmaps=!1;for(let r=0;r<6;++r){const i=Ha(e,t,n,1);i.format=a.format,i.type=a.type,i.minFilter=a.minFilter,i.magFilter=a.magFilter,i.generateMipmaps=a.generateMipmaps,i.needsUpdate=!0,a.images[r]=i}return a.needsUpdate=!0,a})(t.r,t.g,t.b)}async loadUrl(e,t){const n=t.toLowerCase();this._environmentMap=n.endsWith(".exr")?await this._loadExr(t):await this._loadRgbe(t),this._environmentMap.mapping=ct;const r={url:t,environmentMap:this._environmentMap};return this._envChangedCallback(r),r}_loadExr(e){var t;return this._exrLoader=null!==(t=this._exrLoader)&&void 0!==t?t:new bo,this._exrLoader.setPath(e.startsWith("http")?"":n()),this._exrLoader.loadAsync(e)}_loadRgbe(e){var t;return this._rgbeLoader=null!==(t=this._rgbeLoader)&&void 0!==t?t:new yo,this._rgbeLoader.setPath(e.startsWith("http")?"":n()),this._rgbeLoader.loadAsync(e)}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}}),new nn("static-item-loader",class{constructor(e){this._gltfLoaderGuard=new Sn,this._creator_=e,this._initLoaders()}_initLoaders(){this._gltfLoader=new Tn;const e=new vr,t=e._loadLibrary.bind(e._loadLibrary);e._loadLibrary=(e,r)=>{const a=wr[e];if(!a)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(wr));return t(n()+a,r)},e.setDecoderConfig({type:"wasm"}),this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,r,a,i,s,o){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,r,a,i,s))},e=>{o&&o(e.loaded/e.total)},e=>{h(e)})})}async loadGLTF(e,t,n,r,a,i,s,o){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,r,a,i,s))},e=>{o&&o(e.loaded/e.total)},e=>{h(e)})})}_handleGLTFScene(e,t,n,r,a,i,o,l){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;n&&t.scene.position.copy(n),r&&(t.scene.rotation.y=r);const d=new we;if(d.setFromObject(t.scene),a){const{x:e,y:n,z:r}=d.getSize(new s);let i=new s(a.x/e,a.y/n,a.z/r);t.scene.scale.copy(i)}return i&&t.scene.scale.multiply(i),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof K){if(e.layers.set(3),e.material instanceof H){const t=e.material;if(l&&o&&o>0){let e=new h(o);t.color=e.copySRGBToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),{boundingBox:d,scene:t.scene}}},0),new nn("form-data-util",an),new nn("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((r,a)=>{let i=this._promises.get(e),s=!0;if(!i){const t=new Map;this._promises.set(e,t),i=this._promises.get(e),s=!1}i.get(t)||(i.set(t,[]),s=!1);const o=i.get(t);o.push({resolve:r,reject:a}),i.set(t,o);const l=()=>{i.delete(t),0===i.size&&this._promises.delete(e)};s||new Promise(n).then(e=>{i.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{i.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new nn("dynamic-light-setting-loader",on),new nn("network-layer",un),new nn("local-storage",class{constructor(e){this._context_=e}get _localStorage(){let e=null;try{e=window.localStorage}catch(e){console.error(e)}return e}getItem(e){if(!this._localStorage)return null;const t=this._localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}setItem(e,t){if(this._localStorage)try{const n=JSON.stringify(t);this._localStorage.setItem(e,n)}catch(e){console.error(e)}}}),new nn("network-layer",un),new nn("kernel-io",vn,0),new nn("data-syncer",xn),new nn("memory-manager",class{constructor(){this._configurationStringSet=new Set,this._singleLoadCounter=0}loadingConfigurationString(){this._singleLoadCounter+=1}loadingConfiguration(e){this._configurationStringSet.add(e),this._singleLoadCounter+=1}shouldHardReset(){return this._configurationStringSet.size>=15||this._singleLoadCounter>=30}executedHardReset(){this._configurationStringSet.clear(),this._singleLoadCounter=0}}),new nn("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let r=0;r<n;r++)t[r]===e&&(t.splice(r,1),r--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new nn("local-storage-helper",br),new nn("cache-holder",class{constructor(){this._componentCache=new Map,this._geometryCache=new Map,this._materialCache=new Map}get componentCache(){return this._componentCache}get geometryCache(){return this._geometryCache}get materialCache(){return this._materialCache}clear(){for(const e of this._componentCache.values())Za(e);for(const e of this._materialCache.values())ei(e);for(const e of this._geometryCache.values())$a(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new nn("kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new nn("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(r=>r.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,r){this._callbackListener.forEach(a=>a.updateParameters(e,t,n,r))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new nn("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new nn("init-data",oi,1),new nn("global-init-data",hi,0),new nn("global-callback",ci,0),new nn("dom-helper",ui,1),new nn("unit-formatter",Gs,0),new nn("plugin-system",pi,1),new nn("configurator-mesh-generator",gi),new nn("configurator-input-manager",class extends xi{},1),new nn("selection-handler",class extends vi{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new Si({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new Si({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new Si({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Si({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new Si({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Si({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new nn("component-dimensioning-helper",Ii,1),new nn("component-dimensioning-helper",Ii,1),new nn("planner-kernel-access",Ns),new nn("planner-mesh-generator",Bs,1),new nn("unit-formatter",Gs),new nn("configurator-history",Ks,1),new nn("roomle-planner-ui-callback",class extends di{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onCameraIdle=()=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,r,a)=>{},this.onSelectionCancel=e=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=(e,t)=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.onUpdateWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.onUpdatePlanObjectPositions=e=>{},this.onDrawCancel=()=>{},this.onHandlerSwitchedPlans=()=>{},this.onDragElementStart=()=>{},this.onDragElementEnd=()=>{},this.onClickElement=e=>{},this.onMultiSelectionChange=e=>{}}}),new nn("configurator-ui-callbacks",class extends di{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onZoomToComponent=()=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,a)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{},this.onClickComponent=e=>{},this.onRequestExternalMesh=(e,t)=>{},this.onGeometryReady=e=>{},this.onGeometryNotReady=e=>{}}},1),new nn("roomle-tools-core",Ws,0),new nn("image-renderer",bh,0)]);class xh{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new tn,window.__RML__DI__.addDependencyInjectionAssignments(yh))}static setup(e){xh.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return xh._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){xh._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("b",xh)}}}));
9
- //# sourceMappingURL=roomle-dependency-injection-39c6c926.legacy.js.map
8
+ var Xs=function(e){return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))};try{URL.revokeObjectURL(Xs(""))}catch(e){Xs=function(e){return"data:application/javascript;charset=UTF-8,"+encodeURI(e)}}var qs=Uint8Array,Qs=Uint16Array,Ys=Uint32Array,Zs=new qs([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Js=new qs([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),$s=new qs([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),eo=function(e,t){for(var n=new Qs(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var a=new Ys(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)a[i]=i-n[r]<<5|r;return[n,a]},to=eo(Zs,2),no=to[0],ro=to[1];no[28]=258,ro[258]=28;for(var ao=eo(Js,0)[0],io=new Qs(32768),so=0;so<32768;++so){var oo=(43690&so)>>>1|(21845&so)<<1;oo=(61680&(oo=(52428&oo)>>>2|(13107&oo)<<2))>>>4|(3855&oo)<<4,io[so]=((65280&oo)>>>8|(255&oo)<<8)>>>1}var lo=function(e,t,n){for(var r=e.length,a=0,i=new Qs(t);a<r;++a)++i[e[a]-1];var s,o=new Qs(t);for(a=0;a<t;++a)o[a]=o[a-1]+i[a-1]<<1;if(n){s=new Qs(1<<t);var l=15-t;for(a=0;a<r;++a)if(e[a])for(var h=a<<4|e[a],d=t-e[a],c=o[e[a]-1]++<<d,u=c|(1<<d)-1;c<=u;++c)s[io[c]>>>l]=h}else for(s=new Qs(r),a=0;a<r;++a)e[a]&&(s[a]=io[o[e[a]-1]++]>>>15-e[a]);return s},ho=new qs(288);for(so=0;so<144;++so)ho[so]=8;for(so=144;so<256;++so)ho[so]=9;for(so=256;so<280;++so)ho[so]=7;for(so=280;so<288;++so)ho[so]=8;var co=new qs(32);for(so=0;so<32;++so)co[so]=5;var uo=lo(ho,9,1),po=lo(co,5,1),mo=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},fo=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},go=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},vo=new qs(0);function _o(e,t){return function(e,t,n){var r=e.length;if(!r||n&&!n.l&&r<5)return t||new qs(0);var a=!t||n,i=!n||n.i;n||(n={}),t||(t=new qs(3*r));var s,o=function(e){var n=t.length;if(e>n){var r=new qs(Math.max(2*n,e));r.set(t),t=r}},l=n.f||0,h=n.p||0,d=n.b||0,c=n.l,u=n.d,p=n.m,m=n.n,f=8*r;do{if(!c){n.f=l=fo(e,h,1);var g=fo(e,h+1,3);if(h+=3,!g){var v=e[(P=((s=h)/8|0)+(7&s&&1)+4)-4]|e[P-3]<<8,_=P+v;if(_>r){if(i)throw"unexpected EOF";break}a&&o(d+v),t.set(e.subarray(P,_),d),n.b=d+=v,n.p=h=8*_;continue}if(1==g)c=uo,u=po,p=9,m=5;else{if(2!=g)throw"invalid block type";var w=fo(e,h,31)+257,b=fo(e,h+10,15)+4,y=w+fo(e,h+5,31)+1;h+=14;for(var x=new qs(y),S=new qs(19),C=0;C<b;++C)S[$s[C]]=fo(e,h+3*C,7);h+=3*b;var M=mo(S),T=(1<<M)-1,A=lo(S,M,1);for(C=0;C<y;){var P,R=A[fo(e,h,T)];if(h+=15&R,(P=R>>>4)<16)x[C++]=P;else{var E=0,I=0;for(16==P?(I=3+fo(e,h,3),h+=2,E=x[C-1]):17==P?(I=3+fo(e,h,7),h+=3):18==P&&(I=11+fo(e,h,127),h+=7);I--;)x[C++]=E}}var k=x.subarray(0,w),D=x.subarray(w);p=mo(k),m=mo(D),c=lo(k,p,1),u=lo(D,m,1)}if(h>f){if(i)throw"unexpected EOF";break}}a&&o(d+131072);for(var O=(1<<p)-1,L=(1<<m)-1,U=h;;U=h){var F=(E=c[go(e,h)&O])>>>4;if((h+=15&E)>f){if(i)throw"unexpected EOF";break}if(!E)throw"invalid length/literal";if(F<256)t[d++]=F;else{if(256==F){U=h,c=null;break}var N=F-254;if(F>264){var B=Zs[C=F-257];N=fo(e,h,(1<<B)-1)+no[C],h+=B}var z=u[go(e,h)&L],H=z>>>4;if(!z)throw"invalid distance";if(h+=15&z,D=ao[H],H>3&&(B=Js[H],D+=go(e,h)&(1<<B)-1,h+=B),h>f){if(i)throw"unexpected EOF";break}a&&o(d+131072);for(var j=d+N;d<j;d+=4)t[d]=t[d-D],t[d+1]=t[d+1-D],t[d+2]=t[d+2-D],t[d+3]=t[d+3-D];d=j}}n.l=c,n.p=U,n.b=d,c&&(l=1,n.m=p,n.d=u,n.n=m)}while(!l);return d==t.length?t:function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof Qs?Qs:e instanceof Ys?Ys:qs)(n-t);return r.set(e.subarray(t,n)),r}(t,0,d)}((function(e){if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"}(e),e.subarray(2,-4)),t)}var wo="undefined"!=typeof TextDecoder&&new TextDecoder;try{wo.decode(vo,{stream:!0})}catch(e){}var bo=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).type=st,r}return w(n,[{key:"parse",value:function(e){var t=Math.pow(2.7182818,2.2),n={l:0,c:0,lc:0};function r(e,t,r,a,i){for(;r<e;)t=t<<8|L(a,i),r+=8;r-=e,n.l=t>>r&(1<<e)-1,n.c=t,n.lc=r}var a=new Array(59);function i(e){return 63&e}function s(e){return e>>6}var o={c:0,lc:0};function l(e,t,n,r){e=e<<8|L(n,r),t+=8,o.c=e,o.lc=t}var h={c:0,lc:0};function d(e,t,n,r,a,i,s,d,c){if(e==t){r<8&&(l(n,r,a,i),n=o.c,r=o.lc);var u=n>>(r-=8);if(u=new Uint8Array([u])[0],d.value+u>c)return!1;for(var p=s[d.value-1];u-- >0;)s[d.value++]=p}else{if(!(d.value<c))return!1;s[d.value++]=e}h.c=n,h.lc=r}function c(e){return 65535&e}function u(e){var t=c(e);return t>32767?t-65536:t}var p={a:0,b:0};function m(e,t){var n=u(e),r=u(t),a=n+(1&r)+(r>>1),i=a,s=a-r;p.a=i,p.b=s}function f(e,t){var n=c(e),r=c(t),a=n-(r>>1)&65535,i=r+a-32768&65535;p.a=i,p.b=a}function g(e,t,n,r,a,i,s){for(var o,l,h=s<16384,d=n>a?a:n,c=1;c<=d;)c<<=1;for(o=c>>=1,c>>=1;c>=1;){for(var u=(l=0)+i*(a-o),g=i*c,v=i*o,_=r*c,w=r*o,b=void 0,y=void 0,x=void 0,S=void 0;l<=u;l+=v){for(var C=l,M=l+r*(n-o);C<=M;C+=w){var T=C+_,A=C+g,P=A+_;h?(m(e[C+t],e[A+t]),b=p.a,x=p.b,m(e[T+t],e[P+t]),y=p.a,S=p.b,m(b,y),e[C+t]=p.a,e[T+t]=p.b,m(x,S),e[A+t]=p.a,e[P+t]=p.b):(f(e[C+t],e[A+t]),b=p.a,x=p.b,f(e[T+t],e[P+t]),y=p.a,S=p.b,f(b,y),e[C+t]=p.a,e[T+t]=p.b,f(x,S),e[A+t]=p.a,e[P+t]=p.b)}if(n&c){var R=C+g;h?m(e[C+t],e[R+t]):f(e[C+t],e[R+t]),b=p.a,e[R+t]=p.b,e[C+t]=b}}if(a&c)for(var E=l,I=l+r*(n-o);E<=I;E+=w){var k=E+_;h?m(e[E+t],e[k+t]):f(e[E+t],e[k+t]),b=p.a,e[k+t]=p.b,e[E+t]=b}o=c,c>>=1}return l}function v(e,t,c,u,p,m){var f=c.value,g=O(t,c),v=O(t,c);c.value+=4;var _=O(t,c);if(c.value+=4,g<0||g>=65537||v<0||v>=65537)throw new Error("Something wrong with HUF_ENCSIZE");var w=new Array(65537),b=new Array(16384);if(function(e){for(var t=0;t<16384;t++)e[t]={},e[t].len=0,e[t].lit=0,e[t].p=null}(b),function(e,t,i,s,o,l){for(var h=t,d=0,c=0;s<=o;s++){if(h.value-t.value>i)return!1;r(6,d,c,e,h);var u=n.l;if(d=n.c,c=n.lc,l[s]=u,63==u){if(h.value-t.value>i)throw new Error("Something wrong with hufUnpackEncTable");r(8,d,c,e,h);var p=n.l+6;if(d=n.c,c=n.lc,s+p>o+1)throw new Error("Something wrong with hufUnpackEncTable");for(;p--;)l[s++]=0;s--}else if(u>=59){var m=u-59+2;if(s+m>o+1)throw new Error("Something wrong with hufUnpackEncTable");for(;m--;)l[s++]=0;s--}}!function(e){for(var t=0;t<=58;++t)a[t]=0;for(var n=0;n<65537;++n)a[e[n]]+=1;for(var r=0,i=58;i>0;--i){var s=r+a[i]>>1;a[i]=r,r=s}for(var o=0;o<65537;++o){var l=e[o];l>0&&(e[o]=l|a[l]++<<6)}}(l)}(e,c,u-(c.value-f),g,v,w),_>8*(u-(c.value-f)))throw new Error("Something wrong with hufUncompress");!function(e,t,n,r){for(;t<=n;t++){var a=s(e[t]),o=i(e[t]);if(a>>o)throw new Error("Invalid table entry");if(o>14){var l=r[a>>o-14];if(l.len)throw new Error("Invalid table entry");if(l.lit++,l.p){var h=l.p;l.p=new Array(l.lit);for(var d=0;d<l.lit-1;++d)l.p[d]=h[d]}else l.p=new Array(1);l.p[l.lit-1]=t}else if(o)for(var c=0,u=1<<14-o;u>0;u--){var p=r[(a<<14-o)+c];if(p.len||p.p)throw new Error("Invalid table entry");p.len=o,p.lit=t,c++}}}(w,g,v,b),function(e,t,n,r,a,c,u,p,m){for(var f=0,g=0,v=u,_=Math.trunc(r.value+(a+7)/8);r.value<_;)for(l(f,g,n,r),f=o.c,g=o.lc;g>=14;){var w=t[f>>g-14&16383];if(w.len)g-=w.len,d(w.lit,c,f,g,n,r,p,m,v),f=h.c,g=h.lc;else{if(!w.p)throw new Error("hufDecode issues");var b=void 0;for(b=0;b<w.lit;b++){for(var y=i(e[w.p[b]]);g<y&&r.value<_;)l(f,g,n,r),f=o.c,g=o.lc;if(g>=y&&s(e[w.p[b]])==(f>>g-y&(1<<y)-1)){g-=y,d(w.p[b],c,f,g,n,r,p,m,v),f=h.c,g=h.lc;break}}if(b==w.lit)throw new Error("hufDecode issues")}}var x=8-a&7;for(f>>=x,g-=x;g>0;){var S=t[f<<14-g&16383];if(!S.len)throw new Error("hufDecode issues");g-=S.len,d(S.lit,c,f,g,n,r,p,m,v),f=h.c,g=h.lc}}(w,b,e,c,_,v,m,p,{value:0})}function _(e){for(var t=1;t<e.length;t++){var n=e[t-1]+e[t]-128;e[t]=n}}function w(e,t){for(var n=0,r=Math.floor((e.length+1)/2),a=0,i=e.length-1;!(a>i||(t[a++]=e[n++],a>i));)t[a++]=e[r++]}function b(e){for(var t=e.byteLength,n=new Array,r=0,a=new DataView(e);t>0;){var i=a.getInt8(r++);if(i<0){var s=-i;t-=s+1;for(var o=0;o<s;o++)n.push(a.getUint8(r++))}else{var l=i;t-=2;for(var h=a.getUint8(r++),d=0;d<l+1;d++)n.push(h)}}return n}function y(e,t,n){for(var r,a=1;a<64;)65280==(r=t[e.value])?a=64:r>>8==255?a+=255&r:(n[a]=r,a++),e.value++}function x(e,t){t[0]=z(e[0]),t[1]=z(e[1]),t[2]=z(e[5]),t[3]=z(e[6]),t[4]=z(e[14]),t[5]=z(e[15]),t[6]=z(e[27]),t[7]=z(e[28]),t[8]=z(e[2]),t[9]=z(e[4]),t[10]=z(e[7]),t[11]=z(e[13]),t[12]=z(e[16]),t[13]=z(e[26]),t[14]=z(e[29]),t[15]=z(e[42]),t[16]=z(e[3]),t[17]=z(e[8]),t[18]=z(e[12]),t[19]=z(e[17]),t[20]=z(e[25]),t[21]=z(e[30]),t[22]=z(e[41]),t[23]=z(e[43]),t[24]=z(e[9]),t[25]=z(e[11]),t[26]=z(e[18]),t[27]=z(e[24]),t[28]=z(e[31]),t[29]=z(e[40]),t[30]=z(e[44]),t[31]=z(e[53]),t[32]=z(e[10]),t[33]=z(e[19]),t[34]=z(e[23]),t[35]=z(e[32]),t[36]=z(e[39]),t[37]=z(e[45]),t[38]=z(e[52]),t[39]=z(e[54]),t[40]=z(e[20]),t[41]=z(e[22]),t[42]=z(e[33]),t[43]=z(e[38]),t[44]=z(e[46]),t[45]=z(e[51]),t[46]=z(e[55]),t[47]=z(e[60]),t[48]=z(e[21]),t[49]=z(e[34]),t[50]=z(e[37]),t[51]=z(e[47]),t[52]=z(e[50]),t[53]=z(e[56]),t[54]=z(e[59]),t[55]=z(e[61]),t[56]=z(e[35]),t[57]=z(e[36]),t[58]=z(e[48]),t[59]=z(e[49]),t[60]=z(e[57]),t[61]=z(e[58]),t[62]=z(e[62]),t[63]=z(e[63])}function S(e){for(var t=.5*Math.cos(.7853975),n=.5*Math.cos(3.14159/16),r=.5*Math.cos(3.14159/8),a=.5*Math.cos(3*3.14159/16),i=.5*Math.cos(.981746875),s=.5*Math.cos(3*3.14159/8),o=.5*Math.cos(1.374445625),l=new Array(4),h=new Array(4),d=new Array(4),c=new Array(4),u=0;u<8;++u){var p=8*u;l[0]=r*e[p+2],l[1]=s*e[p+2],l[2]=r*e[p+6],l[3]=s*e[p+6],h[0]=n*e[p+1]+a*e[p+3]+i*e[p+5]+o*e[p+7],h[1]=a*e[p+1]-o*e[p+3]-n*e[p+5]-i*e[p+7],h[2]=i*e[p+1]-n*e[p+3]+o*e[p+5]+a*e[p+7],h[3]=o*e[p+1]-i*e[p+3]+a*e[p+5]-n*e[p+7],d[0]=t*(e[p+0]+e[p+4]),d[3]=t*(e[p+0]-e[p+4]),d[1]=l[0]+l[3],d[2]=l[1]-l[2],c[0]=d[0]+d[1],c[1]=d[3]+d[2],c[2]=d[3]-d[2],c[3]=d[0]-d[1],e[p+0]=c[0]+h[0],e[p+1]=c[1]+h[1],e[p+2]=c[2]+h[2],e[p+3]=c[3]+h[3],e[p+4]=c[3]-h[3],e[p+5]=c[2]-h[2],e[p+6]=c[1]-h[1],e[p+7]=c[0]-h[0]}for(var m=0;m<8;++m)l[0]=r*e[16+m],l[1]=s*e[16+m],l[2]=r*e[48+m],l[3]=s*e[48+m],h[0]=n*e[8+m]+a*e[24+m]+i*e[40+m]+o*e[56+m],h[1]=a*e[8+m]-o*e[24+m]-n*e[40+m]-i*e[56+m],h[2]=i*e[8+m]-n*e[24+m]+o*e[40+m]+a*e[56+m],h[3]=o*e[8+m]-i*e[24+m]+a*e[40+m]-n*e[56+m],d[0]=t*(e[m]+e[32+m]),d[3]=t*(e[m]-e[32+m]),d[1]=l[0]+l[3],d[2]=l[1]-l[2],c[0]=d[0]+d[1],c[1]=d[3]+d[2],c[2]=d[3]-d[2],c[3]=d[0]-d[1],e[0+m]=c[0]+h[0],e[8+m]=c[1]+h[1],e[16+m]=c[2]+h[2],e[24+m]=c[3]+h[3],e[32+m]=c[3]-h[3],e[40+m]=c[2]-h[2],e[48+m]=c[1]-h[1],e[56+m]=c[0]-h[0]}function C(e){for(var t=0;t<64;++t){var n=e[0][t],r=e[1][t],a=e[2][t];e[0][t]=n+1.5747*a,e[1][t]=n-.1873*r-.4682*a,e[2][t]=n+1.8556*r}}function M(e,n,r){for(var a=0;a<64;++a)n[r+a]=ct.toHalfFloat((i=e[a])<=1?Math.sign(i)*Math.pow(Math.abs(i),2.2):Math.sign(i)*Math.pow(t,Math.abs(i)-1));var i}function T(e){return new DataView(e.array.buffer,e.offset.value,e.size)}function A(e){var t=e.viewer.buffer.slice(e.offset.value,e.offset.value+e.size),n=new Uint8Array(b(t)),r=new Uint8Array(n.length);return _(n),w(n,r),new DataView(r.buffer)}function P(e){var t=_o(e.array.slice(e.offset.value,e.offset.value+e.size)),n=new Uint8Array(t.length);return _(t),w(t,n),new DataView(n.buffer)}function R(e){for(var t=e.viewer,n={value:e.offset.value},r=new Uint16Array(e.width*e.scanlineBlockSize*(e.channels*e.type)),a=new Uint8Array(8192),i=0,s=new Array(e.channels),o=0;o<e.channels;o++)s[o]={},s[o].start=i,s[o].end=s[o].start,s[o].nx=e.width,s[o].ny=e.lines,s[o].size=e.type,i+=s[o].nx*s[o].ny*s[o].size;var l=H(t,n),h=H(t,n);if(h>=8192)throw new Error("Something is wrong with PIZ_COMPRESSION BITMAP_SIZE");if(l<=h)for(var d=0;d<h-l+1;d++)a[d+l]=U(t,n);var c=new Uint16Array(65536),u=function(e,t){for(var n=0,r=0;r<65536;++r)(0==r||e[r>>3]&1<<(7&r))&&(t[n++]=r);for(var a=n-1;n<65536;)t[n++]=0;return a}(a,c),p=O(t,n);v(e.array,t,n,p,r,i);for(var m=0;m<e.channels;++m)for(var f=s[m],_=0;_<s[m].size;++_)g(r,f.start+_,f.nx,f.size,f.ny,f.nx*f.size,u);!function(e,t,n){for(var r=0;r<n;++r)t[r]=e[t[r]]}(c,r,i);for(var w=0,b=new Uint8Array(r.buffer.byteLength),y=0;y<e.lines;y++)for(var x=0;x<e.channels;x++){var S=s[x],C=S.nx*S.size,M=new Uint8Array(r.buffer,2*S.end,2*C);b.set(M,w),w+=2*C,S.end+=C}return new DataView(b.buffer)}function E(e){for(var t=_o(e.array.slice(e.offset.value,e.offset.value+e.size)),n=e.lines*e.channels*e.width,r=1==e.type?new Uint16Array(n):new Uint32Array(n),a=0,i=0,s=new Array(4),o=0;o<e.lines;o++)for(var l=0;l<e.channels;l++){var h=0;switch(e.type){case 1:s[0]=a,s[1]=s[0]+e.width,a=s[1]+e.width;for(var d=0;d<e.width;++d)h+=t[s[0]++]<<8|t[s[1]++],r[i]=h,i++;break;case 2:s[0]=a,s[1]=s[0]+e.width,s[2]=s[1]+e.width,a=s[2]+e.width;for(var c=0;c<e.width;++c)h+=t[s[0]++]<<24|t[s[1]++]<<16|t[s[2]++]<<8,r[i]=h,i++}}return new DataView(r.buffer)}function I(e){var t=e.viewer,n={value:e.offset.value},r=new Uint8Array(e.width*e.lines*(e.channels*e.type*2)),a={version:F(t,n),unknownUncompressedSize:F(t,n),unknownCompressedSize:F(t,n),acCompressedSize:F(t,n),dcCompressedSize:F(t,n),rleCompressedSize:F(t,n),rleUncompressedSize:F(t,n),rleRawSize:F(t,n),totalAcUncompressedCount:F(t,n),totalDcUncompressedCount:F(t,n),acCompression:F(t,n)};if(a.version<2)throw new Error("EXRLoader.parse: "+X.compression+" version "+a.version+" is unsupported");for(var i=new Array,s=H(t,n)-2;s>0;){var o=k(t.buffer,n),l=U(t,n),h=l>>2&3,d=new Int8Array([(l>>4)-1])[0],c=U(t,n);i.push({name:o,index:d,type:c,compression:h}),s-=o.length+3}for(var u=X.channels,p=new Array(e.channels),m=0;m<e.channels;++m){var f=p[m]={},g=u[m];f.name=g.name,f.compression=0,f.decoded=!1,f.type=g.pixelType,f.pLinear=g.pLinear,f.width=e.width,f.height=e.lines}for(var _,w,T,A={idx:new Array(3)},R=0;R<e.channels;++R)for(var E=p[R],I=0;I<i.length;++I){var D=i[I];E.name==D.name&&(E.compression=D.compression,D.index>=0&&(A.idx[D.index]=R),E.offset=R)}if(a.acCompressedSize>0)switch(a.acCompression){case 0:_=new Uint16Array(a.totalAcUncompressedCount),v(e.array,t,n,a.acCompressedSize,_,a.totalAcUncompressedCount);break;case 1:var O=_o(e.array.slice(n.value,n.value+a.totalAcUncompressedCount));_=new Uint16Array(O.buffer),n.value+=a.totalAcUncompressedCount}if(a.dcCompressedSize>0){var L={array:e.array,offset:n,size:a.dcCompressedSize};w=new Uint16Array(P(L).buffer),n.value+=a.dcCompressedSize}a.rleRawSize>0&&(T=b(_o(e.array.slice(n.value,n.value+a.rleCompressedSize)).buffer),n.value+=a.rleCompressedSize);for(var N=0,B=new Array(p.length),j=0;j<B.length;++j)B[j]=new Array;for(var V=0;V<e.lines;++V)for(var G=0;G<p.length;++G)B[G].push(N),N+=p[G].width*e.type*2;!function(e,t,n,r,a,i){for(var s=new DataView(i.buffer),o=n[e.idx[0]].width,l=n[e.idx[0]].height,h=Math.floor(o/8),d=Math.ceil(o/8),c=Math.ceil(l/8),u=o-8*(d-1),p=l-8*(c-1),m={value:0},f=new Array(3),g=new Array(3),v=new Array(3),_=new Array(3),w=new Array(3),b=0;b<3;++b)w[b]=t[e.idx[b]],f[b]=b<1?0:f[b-1]+d*c,g[b]=new Float32Array(64),v[b]=new Uint16Array(64),_[b]=new Uint16Array(64*d);for(var T=0;T<c;++T){var A=8;T==c-1&&(A=p);for(var P=8,R=0;R<d;++R){R==d-1&&(P=u);for(var E=0;E<3;++E)v[E].fill(0),v[E][0]=a[f[E]++],y(m,r,v[E]),x(v[E],g[E]),S(g[E]);C(g);for(var I=0;I<3;++I)M(g[I],_[I],64*R)}for(var k=0,D=0;D<3;++D){for(var O=n[e.idx[D]].type,L=8*T;L<8*T+A;++L){k=w[D][L];for(var U=0;U<h;++U){var F=64*U+8*(7&L);s.setUint16(k+0*O,_[D][F+0],!0),s.setUint16(k+2*O,_[D][F+1],!0),s.setUint16(k+4*O,_[D][F+2],!0),s.setUint16(k+6*O,_[D][F+3],!0),s.setUint16(k+8*O,_[D][F+4],!0),s.setUint16(k+10*O,_[D][F+5],!0),s.setUint16(k+12*O,_[D][F+6],!0),s.setUint16(k+14*O,_[D][F+7],!0),k+=16*O}}if(h!=d)for(var N=8*T;N<8*T+A;++N)for(var B=w[D][N]+8*h*2*O,H=64*h+8*(7&N),j=0;j<P;++j)s.setUint16(B+2*j*O,_[D][H+j],!0)}}var V=new Uint16Array(o);s=new DataView(i.buffer);for(var G=0;G<3;++G){n[e.idx[G]].decoded=!0;var K=n[e.idx[G]].type;if(2==n[G].type)for(var W=0;W<l;++W){for(var X=w[G][W],q=0;q<o;++q)V[q]=s.getUint16(X+2*q*K,!0);for(var Q=0;Q<o;++Q)s.setFloat32(X+2*Q*K,z(V[Q]),!0)}}}(A,B,p,_,w,r);for(var K=0;K<p.length;++K){var W=p[K];if(!W.decoded)switch(W.compression){case 2:for(var q=0,Q=0,Y=0;Y<e.lines;++Y){for(var Z=B[K][q],J=0;J<W.width;++J){for(var $=0;$<2*W.type;++$)r[Z++]=T[Q+$*W.width*W.height];Q++}q++}break;case 1:default:throw new Error("EXRLoader.parse: unsupported channel compression")}}return new DataView(r.buffer)}function k(e,t){for(var n=new Uint8Array(e),r=0;0!=n[t.value+r];)r+=1;var a=(new TextDecoder).decode(n.slice(t.value,t.value+r));return t.value=t.value+r+1,a}function D(e,t){var n=e.getInt32(t.value,!0);return t.value=t.value+4,n}function O(e,t){var n=e.getUint32(t.value,!0);return t.value=t.value+4,n}function L(e,t){var n=e[t.value];return t.value=t.value+1,n}function U(e,t){var n=e.getUint8(t.value);return t.value=t.value+1,n}var F=function(e,t){var n;return n="getBigInt64"in DataView.prototype?Number(e.getBigInt64(t.value,!0)):e.getUint32(t.value+4,!0)+Number(e.getUint32(t.value,!0)<<32),t.value+=8,n};function N(e,t){var n=e.getFloat32(t.value,!0);return t.value+=4,n}function B(e,t){return ct.toHalfFloat(N(e,t))}function z(e){var t=(31744&e)>>10,n=1023&e;return(e>>15?-1:1)*(t?31===t?n?NaN:1/0:Math.pow(2,t-15)*(1+n/1024):n/1024*6103515625e-14)}function H(e,t){var n=e.getUint16(t.value,!0);return t.value+=2,n}function j(e,t){return z(H(e,t))}function V(e,t,n,r,a){return"string"===r||"stringvector"===r||"iccProfile"===r?function(e,t,n){var r=(new TextDecoder).decode(new Uint8Array(e).slice(t.value,t.value+n));return t.value=t.value+n,r}(t,n,a):"chlist"===r?function(e,t,n,r){for(var a=n.value,i=[];n.value<a+r-1;){var s=k(t,n),o=D(e,n),l=U(e,n);n.value+=3;var h=D(e,n),d=D(e,n);i.push({name:s,pixelType:o,pLinear:l,xSampling:h,ySampling:d})}return n.value+=1,i}(e,t,n,a):"chromaticities"===r?function(e,t){return{redX:N(e,t),redY:N(e,t),greenX:N(e,t),greenY:N(e,t),blueX:N(e,t),blueY:N(e,t),whiteX:N(e,t),whiteY:N(e,t)}}(e,n):"compression"===r?function(e,t){return["NO_COMPRESSION","RLE_COMPRESSION","ZIPS_COMPRESSION","ZIP_COMPRESSION","PIZ_COMPRESSION","PXR24_COMPRESSION","B44_COMPRESSION","B44A_COMPRESSION","DWAA_COMPRESSION","DWAB_COMPRESSION"][U(e,t)]}(e,n):"box2i"===r?function(e,t){return{xMin:O(e,t),yMin:O(e,t),xMax:O(e,t),yMax:O(e,t)}}(e,n):"lineOrder"===r?function(e,t){return["INCREASING_Y"][U(e,t)]}(e,n):"float"===r?N(e,n):"v2f"===r?function(e,t){return[N(e,t),N(e,t)]}(e,n):"v3f"===r?function(e,t){return[N(e,t),N(e,t),N(e,t)]}(e,n):"int"===r?D(e,n):"rational"===r?function(e,t){return[D(e,t),O(e,t)]}(e,n):"timecode"===r?function(e,t){return[O(e,t),O(e,t)]}(e,n):"preview"===r?(n.value+=a,"skipped"):void(n.value+=a)}for(var G=new DataView(e),K=new Uint8Array(e),W={value:0},X=function(e,t,n){var r={};if(20000630!=e.getUint32(0,!0))throw new Error("THREE.EXRLoader: provided file doesn't appear to be in OpenEXR format.");r.version=e.getUint8(4);var a=e.getUint8(5);r.spec={singleTile:!!(2&a),longName:!!(4&a),deepFormat:!!(8&a),multiPart:!!(16&a)},n.value=8;for(var i=!0;i;){var s=k(t,n);if(0==s)i=!1;else{var o=k(t,n),l=V(e,t,n,o,O(e,n));void 0===l?console.warn("EXRLoader.parse: skipped unknown header attribute type '".concat(o,"'.")):r[s]=l}}if(0!=(-5&a))throw console.error("EXRHeader:",r),new Error("THREE.EXRLoader: provided file is currently unsupported.");return r}(G,e,W),q=function(e,t,n,r,a){var i={size:0,viewer:t,array:n,offset:r,width:e.dataWindow.xMax-e.dataWindow.xMin+1,height:e.dataWindow.yMax-e.dataWindow.yMin+1,channels:e.channels.length,bytesPerLine:null,lines:null,inputSize:null,type:e.channels[0].pixelType,uncompress:null,getter:null,format:null,colorSpace:Ce};switch(e.compression){case"NO_COMPRESSION":i.lines=1,i.uncompress=T;break;case"RLE_COMPRESSION":i.lines=1,i.uncompress=A;break;case"ZIPS_COMPRESSION":i.lines=1,i.uncompress=P;break;case"ZIP_COMPRESSION":i.lines=16,i.uncompress=P;break;case"PIZ_COMPRESSION":i.lines=32,i.uncompress=R;break;case"PXR24_COMPRESSION":i.lines=16,i.uncompress=E;break;case"DWAA_COMPRESSION":i.lines=32,i.uncompress=I;break;case"DWAB_COMPRESSION":i.lines=256,i.uncompress=I;break;default:throw new Error("EXRLoader.parse: "+e.compression+" is unsupported")}if(i.scanlineBlockSize=i.lines,1==i.type)switch(a){case lt:i.getter=j,i.inputSize=2;break;case st:i.getter=H,i.inputSize=2}else{if(2!=i.type)throw new Error("EXRLoader.parse: unsupported pixelType "+i.type+" for "+e.compression+".");switch(a){case lt:i.getter=N,i.inputSize=4;break;case st:i.getter=B,i.inputSize=4}}i.blockCount=(e.dataWindow.yMax+1)/i.scanlineBlockSize;for(var s=0;s<i.blockCount;s++)F(t,r);i.outputChannels=3==i.channels?4:i.channels;var o=i.width*i.height*i.outputChannels;switch(a){case lt:i.byteArray=new Float32Array(o),i.channels<i.outputChannels&&i.byteArray.fill(1,0,o);break;case st:i.byteArray=new Uint16Array(o),i.channels<i.outputChannels&&i.byteArray.fill(15360,0,o);break;default:console.error("THREE.EXRLoader: unsupported type: ",a)}return i.bytesPerLine=i.width*i.inputSize*i.channels,4==i.outputChannels?(i.format=Ae,i.colorSpace=Ce):(i.format=ht,i.colorSpace=dt),i}(X,G,K,W,this.type),Q={value:0},Y={R:0,G:1,B:2,A:3,Y:0},Z=0;Z<q.height/q.scanlineBlockSize;Z++){var J=O(G,W);q.size=O(G,W),q.lines=J+q.scanlineBlockSize>q.height?q.height-J:q.scanlineBlockSize;var $=q.size<q.lines*q.bytesPerLine?q.uncompress(q):T(q);W.value+=q.size;for(var ee=0;ee<q.scanlineBlockSize;ee++){var te=ee+Z*q.scanlineBlockSize;if(te>=q.height)break;for(var ne=0;ne<q.channels;ne++)for(var re=Y[X.channels[ne].name],ae=0;ae<q.width;ae++){Q.value=(ee*(q.channels*q.width)+ne*q.width+ae)*q.inputSize;var ie=(q.height-1-te)*(q.width*q.outputChannels)+ae*q.outputChannels+re;q.byteArray[ie]=q.getter($,Q)}}}return{header:X,width:q.width,height:q.height,data:q.byteArray,format:q.format,colorSpace:q.colorSpace,type:this.type}}},{key:"setDataType",value:function(e){return this.type=e,this}},{key:"load",value:function(e,t,r,a){return xe(Se(n.prototype),"load",this).call(this,e,(function(e,n){e.colorSpace=n.colorSpace,e.minFilter=L,e.magFilter=L,e.generateMipmaps=!1,e.flipY=!1,t&&t(e,n)}),r,a)}}]),n}(ot),yo=function(e){g(n,e);var t=v(n);function n(e){var r;return _(this,n),(r=t.call(this,e)).type=st,r}return w(n,[{key:"parse",value:function(e){var t=function(e,t){switch(e){case 1:console.error("THREE.RGBELoader Read Error: "+(t||""));break;case 2:console.error("THREE.RGBELoader Write Error: "+(t||""));break;case 3:console.error("THREE.RGBELoader Bad File Format: "+(t||""));break;default:case 4:console.error("THREE.RGBELoader: Error: "+(t||""))}return-1},n=function(e,t,n){t=t||1024;for(var r=e.pos,a=-1,i=0,s="",o=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));0>(a=o.indexOf("\n"))&&i<t&&r<e.byteLength;)s+=o,i+=o.length,r+=128,o+=String.fromCharCode.apply(null,new Uint16Array(e.subarray(r,r+128)));return-1<a&&(!1!==n&&(e.pos+=i+a+1),s+o.slice(0,a))},r=function(e,t,n,r){var a=e[t+3],i=Math.pow(2,a-128)/255;n[r+0]=ct.toHalfFloat(Math.min(e[t+0]*i,65504)),n[r+1]=ct.toHalfFloat(Math.min(e[t+1]*i,65504)),n[r+2]=ct.toHalfFloat(Math.min(e[t+2]*i,65504)),n[r+3]=ct.toHalfFloat(1)},a=new Uint8Array(e);a.pos=0;var i,s,o,l,h,d,c=function(e){var r,a,i=/^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,s=/^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,o=/^\s*FORMAT=(\S+)\s*$/,l=/^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,h={valid:0,string:"",comments:"",programtype:"RGBE",format:"",gamma:1,exposure:1,width:0,height:0};if(e.pos>=e.byteLength||!(r=n(e)))return t(1,"no header found");if(!(a=r.match(/^#\?(\S+)/)))return t(3,"bad initial token");for(h.valid|=1,h.programtype=a[1],h.string+=r+"\n";!1!==(r=n(e));)if(h.string+=r+"\n","#"!==r.charAt(0)){if((a=r.match(i))&&(h.gamma=parseFloat(a[1])),(a=r.match(s))&&(h.exposure=parseFloat(a[1])),(a=r.match(o))&&(h.valid|=2,h.format=a[1]),(a=r.match(l))&&(h.valid|=4,h.height=parseInt(a[1],10),h.width=parseInt(a[2],10)),2&h.valid&&4&h.valid)break}else h.comments+=r+"\n";return 2&h.valid?4&h.valid?h:t(3,"missing image size specifier"):t(3,"missing format specifier")}(a);if(-1!==c){var u=c.width,p=c.height,m=function(e,n,r){var a=n;if(a<8||a>32767||2!==e[0]||2!==e[1]||128&e[2])return new Uint8Array(e);if(a!==(e[2]<<8|e[3]))return t(3,"wrong scanline width");var i=new Uint8Array(4*n*r);if(!i.length)return t(4,"unable to allocate buffer space");for(var s=0,o=0,l=4*a,h=new Uint8Array(4),d=new Uint8Array(l),c=r;c>0&&o<e.byteLength;){if(o+4>e.byteLength)return t(1);if(h[0]=e[o++],h[1]=e[o++],h[2]=e[o++],h[3]=e[o++],2!=h[0]||2!=h[1]||(h[2]<<8|h[3])!=a)return t(3,"bad rgbe scanline format");for(var u=0,p=void 0;u<l&&o<e.byteLength;){var m=(p=e[o++])>128;if(m&&(p-=128),0===p||u+p>l)return t(3,"bad scanline data");if(m)for(var f=e[o++],g=0;g<p;g++)d[u++]=f;else d.set(e.subarray(o,o+p),u),u+=p,o+=p}for(var v=a,_=0;_<v;_++){var w=0;i[s]=d[_+w],w+=a,i[s+1]=d[_+w],w+=a,i[s+2]=d[_+w],w+=a,i[s+3]=d[_+w],s+=4}c--}return i}(a.subarray(a.pos),u,p);if(-1!==m){var f,g,v;switch(this.type){case lt:v=m.length/4;for(var _=new Float32Array(4*v),w=0;w<v;w++)o=_,l=4*w,h=(i=m)[3+(s=4*w)],d=Math.pow(2,h-128)/255,o[l+0]=i[s+0]*d,o[l+1]=i[s+1]*d,o[l+2]=i[s+2]*d,o[l+3]=1;f=_,g=lt;break;case st:v=m.length/4;for(var b=new Uint16Array(4*v),y=0;y<v;y++)r(m,4*y,b,4*y);f=b,g=st;break;default:console.error("THREE.RGBELoader: unsupported type: ",this.type)}return{width:u,height:p,data:f,header:c.string,gamma:c.gamma,exposure:c.exposure,type:g}}}return null}},{key:"setDataType",value:function(e){return this.type=e,this}},{key:"load",value:function(e,t,r,a){return xe(Se(n.prototype),"load",this).call(this,e,(function(e,n){switch(e.type){case lt:case st:e.colorSpace=Ce,e.minFilter=L,e.magFilter=L,e.generateMipmaps=!1,e.flipY=!0}t&&t(e,n)}),r,a)}}]),n}(ot);const xo={uniforms:{tDiffuse:{value:null},colorTransform:{value:new P},colorBase:{value:new pt(0,0,0,0)},multiplyChannels:{value:0},uvTransform:{value:new mt}},vertexShader:"\n varying vec2 vUv;\n uniform mat3 uvTransform;\n \n void main() {\n vUv = (uvTransform * vec3(uv, 1.0)).xy;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform mat4 colorTransform;\n uniform vec4 colorBase;\n uniform float multiplyChannels;\n varying vec2 vUv;\n \n void main() {\n vec4 color = colorTransform * texture2D(tDiffuse, vUv) + colorBase;\n color.rgb = mix(color.rgb, vec3(color.r * color.g * color.b), multiplyChannels);\n gl_FragColor = color;\n }"},So=new P,Co=(new P).set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0),Mo=(new P).set(0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0),To=(new P).set(1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1),Ao=(new P).set(1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1),Po=new pt(0,0,0,0),Ro=new pt(0,0,0,1),Eo=new mt,Io=(new mt).set(1,0,0,0,-1,1,0,0,1),ko=(e,t,n,r)=>(new P).set(e,0,0,1-e,0,t,0,1-t,0,0,n,1-n,0,0,0,r);var Do;!function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ADDITIVE=1]="ADDITIVE"}(Do||(Do={}));class Oo extends ft{constructor(e,t=Do.ADDITIVE){const n=t===Do.ADDITIVE?{blendSrc:_t,blendDst:wt,blendEquation:bt,blendSrcAlpha:yt,blendDstAlpha:wt,blendEquationAlpha:bt}:{};super({uniforms:gt.clone(xo.uniforms),vertexShader:xo.vertexShader,fragmentShader:xo.fragmentShader,transparent:!0,depthTest:!1,depthWrite:!1,...n}),this.update(e)}update(e){return void 0!==(null==e?void 0:e.texture)&&(this.uniforms.tDiffuse.value=null==e?void 0:e.texture),void 0!==(null==e?void 0:e.colorTransform)&&(this.uniforms.colorTransform.value=null==e?void 0:e.colorTransform),void 0!==(null==e?void 0:e.colorBase)&&(this.uniforms.colorBase.value=null==e?void 0:e.colorBase),void 0!==(null==e?void 0:e.multiplyChannels)&&(this.uniforms.multiplyChannels.value=null==e?void 0:e.multiplyChannels),void 0!==(null==e?void 0:e.uvTransform)&&(this.uniforms.uvTransform.value=null==e?void 0:e.uvTransform),void 0!==(null==e?void 0:e.blending)&&(this.blending=null==e?void 0:e.blending),void 0!==(null==e?void 0:e.blendSrc)&&(this.blendSrc=null==e?void 0:e.blendSrc),void 0!==(null==e?void 0:e.blendDst)&&(this.blendDst=null==e?void 0:e.blendDst),void 0!==(null==e?void 0:e.blendEquation)&&(this.blendEquation=null==e?void 0:e.blendEquation),void 0!==(null==e?void 0:e.blendSrcAlpha)&&(this.blendSrcAlpha=null==e?void 0:e.blendSrcAlpha),void 0!==(null==e?void 0:e.blendDstAlpha)&&(this.blendDstAlpha=null==e?void 0:e.blendDstAlpha),void 0!==(null==e?void 0:e.blendEquationAlpha)&&(this.blendEquationAlpha=null==e?void 0:e.blendEquationAlpha),this}}const Lo={uniforms:{tDiffuse:{value:null},rangeMin:{value:new i(1/512,1/512)},rangeMax:{value:new i(1/512,1/512)}},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform vec2 rangeMin;\n uniform vec2 rangeMax;\n varying vec2 vUv;\n \n void main() {\n vec4 baseColor = texture2D(tDiffuse, vUv);\n vec2 blur = mix(rangeMax, rangeMin, baseColor.a);\n vec4 sum = vec4( 0.0 );\n sum += texture2D(tDiffuse, vUv - 1.0 * blur) * 0.051;\n sum += texture2D(tDiffuse, vUv - 0.75 * blur) * 0.0918;\n sum += texture2D(tDiffuse, vUv - 0.5 * blur) * 0.12245;\n sum += texture2D(tDiffuse, vUv - 0.25 * blur) * 0.1531;\n sum += baseColor * 0.1633;\n sum += texture2D(tDiffuse, vUv + 0.25 * blur) * 0.1531;\n sum += texture2D(tDiffuse, vUv + 0.5 * blur) * 0.12245;\n sum += texture2D(tDiffuse, vUv + 0.75 * blur) * 0.0918;\n sum += texture2D(tDiffuse, vUv + 1.0 * blur) * 0.051;\n gl_FragColor = sum;\n }"};new i(.1,.9),new i(.1,.9);class Uo extends ft{constructor(e){super({defines:Object.assign({},Uo._linearDepthShader.defines),uniforms:gt.clone(Uo._linearDepthShader.uniforms),vertexShader:Uo._linearDepthShader.vertexShader,fragmentShader:Uo._linearDepthShader.fragmentShader,blending:vt}),this.update(e)}update(e){if(void 0!==(null==e?void 0:e.depthTexture)&&(this.uniforms.tDepth.value=null==e?void 0:e.depthTexture),void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far}return void 0!==(null==e?void 0:e.depthFilter)&&(this.uniforms.depthFilter.value=null==e?void 0:e.depthFilter),this}}Uo._linearDepthShader={uniforms:{tDepth:{value:null},depthFilter:{value:new pt(1,0,0,0)},cameraNear:{value:.1},cameraFar:{value:1}},defines:{PERSPECTIVE_CAMERA:1,ALPHA_DEPTH:0},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"uniform sampler2D tDepth;\n uniform vec4 depthFilter;\n uniform float cameraNear;\n uniform float cameraFar;\n varying vec2 vUv;\n \n #include <packing>\n \n float getLinearDepth(const in vec2 screenPosition) {\n float fragCoordZ = dot(texture2D(tDepth, screenPosition), depthFilter);\n #if PERSPECTIVE_CAMERA == 1\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return fragCoordZ;\n #endif\n }\n \n void main() {\n float depth = getLinearDepth(vUv);\n gl_FragColor = vec4(vec3(1.0 - depth), 1.0);\n }"};class Fo extends ft{constructor(e){var t;super({defines:Object.assign({...Fo._normalAndDepthShader.defines,FLOAT_BUFFER:(null==e?void 0:e.floatBufferType)?1:0,LINEAR_DEPTH:(null==e?void 0:e.linearDepth)?1:0}),uniforms:gt.clone(Fo._normalAndDepthShader.uniforms),vertexShader:Fo._normalAndDepthShader.vertexShader,fragmentShader:Fo._normalAndDepthShader.fragmentShader,blending:null!==(t=null==e?void 0:e.blending)&&void 0!==t?t:vt}),this.update(e)}update(e){if(void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far}return this}}Fo._normalAndDepthShader={uniforms:{cameraNear:{value:.1},cameraFar:{value:1}},defines:{FLOAT_BUFFER:0,LINEAR_DEPTH:0},vertexShader:"varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n#endif\n\n void main() {\n vNormal = normalMatrix * normal;\n vec4 viewPosition = modelViewMatrix * vec4(position, 1.0);\n #if LINEAR_DEPTH == 1\n vZ = viewPosition.z; \n #endif\n gl_Position = projectionMatrix * viewPosition;\n }",fragmentShader:"varying vec3 vNormal;\n#if LINEAR_DEPTH == 1\n varying float vZ; \n uniform float cameraNear;\n uniform float cameraFar;\n#endif\n\n void main() {\n #if FLOAT_BUFFER == 1\n vec3 normal = normalize(vNormal);\n #else\n vec3 normal = normalize(vNormal) * 0.5 + 0.5;\n #endif\n #if LINEAR_DEPTH == 1\n float depth = (-vZ - cameraNear) / (cameraFar - cameraNear);\n #else\n float depth = gl_FragCoord.z;\n #endif\n gl_FragColor = vec4(normal, depth);\n }"};var No=function(){function e(){_(this,e),this.isPass=!0,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.renderToScreen=!1}return w(e,[{key:"setSize",value:function(){}},{key:"render",value:function(){console.error("THREE.Pass: .render() must be implemented in derived pass.")}},{key:"dispose",value:function(){}}]),e}(),Bo=new $(-1,1,1,-1,0,1),zo=new c;zo.setAttribute("position",new Fe([-1,3,0,-1,-1,0,3,-1,0],3)),zo.setAttribute("uv",new Fe([0,2,0,0,2,0],2));var Ho=function(){function e(t){_(this,e),this._mesh=new K(zo,t)}return w(e,[{key:"dispose",value:function(){this._mesh.geometry.dispose()}},{key:"render",value:function(e){e.render(this._mesh,Bo)}},{key:"material",get:function(){return this._mesh.material},set:function(e){this._mesh.material=e}}]),e}();new ue;class jo{constructor(){this.bounds=new we(new s(-1,-1,-1),new s(1,1,1)),this.size=new s(2,2,2),this.center=new s(0,0,0),this.maxSceneDistanceFromCenter=Math.sqrt(3),this.maxSceneDistanceFrom0=Math.sqrt(3)}copyFrom(e){this.bounds.copy(e.bounds),this.size.copy(e.size),this.center.copy(e.center),this.maxSceneDistanceFromCenter=e.maxSceneDistanceFromCenter,this.maxSceneDistanceFrom0=e.maxSceneDistanceFrom0}updateFromObject(e){e.updateMatrixWorld(),this.bounds.setFromObject(e),this.updateFromBox(this.bounds)}updateFromBox(e){this.bounds!==e&&this.bounds.copy(e),this.bounds.getSize(this.size),this.bounds.getCenter(this.center),this.maxSceneDistanceFromCenter=this.size.length()/2,this.maxSceneDistanceFrom0=new s(Math.max(Math.abs(this.bounds.min.x),Math.abs(this.bounds.max.x)),Math.max(Math.abs(this.bounds.min.y),Math.abs(this.bounds.max.y)),Math.max(Math.abs(this.bounds.min.z),Math.abs(this.bounds.max.z))).length()}updateCameraViewVolumeFromBounds(e){e.updateMatrixWorld();const t=this.bounds.clone().applyMatrix4(e.matrixWorldInverse);e instanceof $?((e,t)=>{e.left=t.min.x,e.right=t.max.x,e.bottom=t.min.y,e.top=t.max.y,e.near=Math.min(-t.min.z,-t.max.z),e.far=Math.max(-t.min.z,-t.max.z),e.updateProjectionMatrix()})(e,t):e instanceof Z&&((e,t)=>{const n=Math.min(-t.min.z,-t.max.z),r=Math.max(-t.min.z,-t.max.z);if(n<.001)return;const a=Math.max(Math.abs(t.min.x),Math.abs(t.max.x)),i=Math.max(Math.abs(t.min.y),Math.abs(t.max.y));e.aspect=a/i,e.fov=J.radToDeg(2*Math.atan2(i,n)),e.near=n,e.far=r,e.updateProjectionMatrix()})(e,t)}getNearAndFarForPerspectiveCamera(e,t=1){const n=e.clone().sub(this.center).length();return[Math.max(.01,n-this.maxSceneDistanceFromCenter-.01),n+this.maxSceneDistanceFromCenter*t+.01]}}class Vo{changed(e){var t,n;const r=!(null===(t=this._lastCameraProjection)||void 0===t?void 0:t.equals(e.projectionMatrix))||!(null===(n=this._lastCameraWorld)||void 0===n?void 0:n.equals(e.matrixWorld));return this._lastCameraProjection=e.projectionMatrix.clone(),this._lastCameraWorld=e.matrixWorld.clone(),r}}class Go{constructor(){this._originalClearColor=new h,this._originalClearAlpha=0,this._originalAutoClear=!1,this._originalRenderTarget=null,this._screenSpaceQuad=new Ho(void 0),this._emptyScene=new Ee,this._defaultCamera=new Z}renderWithOverrideMaterial(e,t,n,r,a,i,s){this._backup(e),this._prepareRenderer(e,a,i,s);const o=t.overrideMaterial;t.overrideMaterial=r,e.render(t,n),t.overrideMaterial=o,this._restore(e)}clear(e,t,n,r){this._backup(e),this._prepareRenderer(e,t,n,r),e.render(this._emptyScene,this._defaultCamera),this._restore(e)}render(e,t,n,r,a,i){this._backup(e),this._prepareRenderer(e,r,a,i),e.render(t,n),this._restore(e)}renderScreenSpace(e,t,n,r,a){this._backup(e),this._prepareRenderer(e,n,r,a),this._screenSpaceQuad.material=t,this._screenSpaceQuad.render(e),this._restore(e)}_prepareRenderer(e,t,n,r){e.setRenderTarget(t),e.autoClear=!1,null!=n&&(e.setClearColor(n),e.setClearAlpha(r||0),e.clear())}_backup(e){e.getClearColor(this._originalClearColor),this._originalClearAlpha=e.getClearAlpha(),this._originalAutoClear=e.autoClear,this._originalRenderTarget=e.getRenderTarget()}_restore(e){e.setClearColor(this._originalClearColor),e.setClearAlpha(this._originalClearAlpha),e.setRenderTarget(this._originalRenderTarget),e.autoClear=this._originalAutoClear}}class Ko{constructor(e,t){var n;this._renderPass=null!==(n=null==t?void 0:t._renderPass)&&void 0!==n?n:new Go,this._blurMaterial=new ft(null!=e?e:Lo),this._blurMaterial.depthTest=!1}dispose(){this._blurMaterial.dispose()}render(e,t,n,r){this._blurMaterial.uniforms.tDiffuse.value=t[0].texture,this._blurMaterial.uniforms.rangeMin.value.x=n[0],this._blurMaterial.uniforms.rangeMin.value.y=0,this._blurMaterial.uniforms.rangeMax.value.x=r[0],this._blurMaterial.uniforms.rangeMax.value.y=0,this._renderPass.renderScreenSpace(e,this._blurMaterial,t[1]),this._blurMaterial.uniforms.tDiffuse.value=t[1].texture,this._blurMaterial.uniforms.rangeMin.value.x=0,this._blurMaterial.uniforms.rangeMin.value.y=n[1],this._blurMaterial.uniforms.rangeMax.value.x=0,this._blurMaterial.uniforms.rangeMax.value.y=r[1],this._renderPass.renderScreenSpace(e,this._blurMaterial,t[2])}}class Wo{constructor(e){this.needsUpdate=!0,this._cache=null,this._cache=e}dispose(){var e;null===(e=this._cache)||void 0===e||e.dispose()}clear(){var e;null===(e=this._cache)||void 0===e||e.clear(),this.needsUpdate=!0}update(e){this.needsUpdate&&this._cache&&(e.traverse(e=>{var t,n,r;e.isLine||e.isPoints?null===(t=this._cache)||void 0===t||t.addLineOrPoint(e):e.isMesh?null===(n=this._cache)||void 0===n||n.addMesh(e):null===(r=this._cache)||void 0===r||r.addObject(e)}),this.needsUpdate=!1)}onBeforeRender(){var e;null===(e=this._cache)||void 0===e||e.onBeforeRender()}onAfterRender(){var e;null===(e=this._cache)||void 0===e||e.onAfterRender()}}class Xo{constructor(){this._cacheMap=new Map}dispose(){this._cacheMap.forEach(e=>{e.dispose()})}registerCache(e,t){this._cacheMap.set(e,new Wo(t))}clearCache(){this._cacheMap.forEach(e=>{e.clear()})}clearObjectCache(e){const t=this._cacheMap.get(e);t&&t.clear()}onBeforeRender(e,t){const n=this._cacheMap.get(e);n&&(n.update(t),n.onBeforeRender())}onAfterRender(e){const t=this._cacheMap.get(e);t&&t.onAfterRender()}render(e,t,n){const r=this._cacheMap.get(e);r&&(r.update(t),r.onBeforeRender()),n(),r&&r.onAfterRender()}}class qo{constructor(e){this._visibilityCache=new Map,this._isObjectInvisible=e}dispose(){this._visibilityCache.clear()}clear(){this._visibilityCache.clear()}addLineOrPoint(e){this._visibilityCache.set(e,e.visible)}addMesh(e){this._isObjectInvisible&&this._isObjectInvisible(e)&&this._visibilityCache.set(e,e.visible)}addObject(e){this._isObjectInvisible&&this._isObjectInvisible(e)&&this._visibilityCache.set(e,e.visible)}onBeforeRender(){this._visibilityCache.forEach((e,t)=>{t.visible=!1})}onAfterRender(){this._visibilityCache.forEach((e,t)=>{t.visible=e})}}class Qo{constructor(e){this._depthWriteCache=new Set,this._doNotWriteDepth=e}dispose(){this._depthWriteCache.clear()}clear(){this._depthWriteCache.clear()}addLineOrPoint(e){}addObject(e){}addMesh(e){this._doNotWriteDepth&&this._doNotWriteDepth(e)&&e.material instanceof H&&e.material.depthWrite&&this._depthWriteCache.add(e.material)}onBeforeRender(){this._depthWriteCache.forEach(e=>{e.depthWrite=!1})}onAfterRender(){this._depthWriteCache.forEach(e=>{e.depthWrite=!0})}}class Yo{get isFloatGBufferWithRgbNormalAlphaDepth(){return this.floatGBufferRgbNormalAlphaDepth}get gBufferTexture(){return this.depthNormalRenderTarget.texture}get depthBufferTexture(){return this.copyToSeparateDepthBuffer&&this.floatGBufferRgbNormalAlphaDepth?this.separateDeptRenderTarget.texture:this.depthNormalRenderTarget.depthTexture}get textureWithDepthValue(){return this.floatGBufferRgbNormalAlphaDepth?this.depthNormalRenderTarget.texture:this.depthNormalRenderTarget.depthTexture}get normalRenderMaterial(){var e;return this._normalRenderMaterial=null!==(e=this._normalRenderMaterial)&&void 0!==e?e:this.floatGBufferRgbNormalAlphaDepth?new Fo({blending:vt,floatBufferType:!0,linearDepth:!1}):new xt({blending:vt}),this._normalRenderMaterial}get depthNormalRenderTarget(){if(!this._depthNormalRenderTarget)if(this.floatGBufferRgbNormalAlphaDepth)this._depthNormalRenderTarget=new St(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale,{minFilter:this._targetMinificationTextureFilter,magFilter:this._targetMagnificationTextureFilter,type:lt,samples:this._samples});else{const e=new Ct(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale);e.format=Mt,e.type=Tt,this._depthNormalRenderTarget=new St(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale,{minFilter:this._targetMinificationTextureFilter,magFilter:this._targetMagnificationTextureFilter,depthTexture:e})}return this._depthNormalRenderTarget}get separateDeptRenderTarget(){return this._separateDeptRenderTarget||(this._separateDeptRenderTarget=new St(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale,{minFilter:this._targetMinificationTextureFilter,magFilter:this._targetMagnificationTextureFilter,type:lt,samples:0})),this._separateDeptRenderTarget}constructor(e,t){var n,r,a,i,s,o,l,h,d,c;this.floatGBufferRgbNormalAlphaDepth=!1,this.copyToSeparateDepthBuffer=!1,this.needsUpdate=!0,this.floatGBufferRgbNormalAlphaDepth=null!==(r=null===(n=null==t?void 0:t.capabilities)||void 0===n?void 0:n.isWebGL2)&&void 0!==r&&r,this._renderCacheManager=e,this._renderCacheManager&&this._renderCacheManager.registerCache(this,new qo(e=>{if(e.isMesh&&e.material){if(e.material.transparent&&e.material.opacity<.7||e.material.alphaTest>0)return!0;if(e.material instanceof T)return e.material.transmission>0}return!1})),this.parameters={depthNormalScale:null!==(a=null==t?void 0:t.depthNormalScale)&&void 0!==a?a:1},this._targetMinificationTextureFilter=null!==(i=null==t?void 0:t.textureMinificationFilter)&&void 0!==i?i:ae,this._targetMagnificationTextureFilter=null!==(s=null==t?void 0:t.textureMagnificationFilter)&&void 0!==s?s:ae,this._width=null!==(o=null==t?void 0:t.width)&&void 0!==o?o:1024,this._height=null!==(l=null==t?void 0:t.height)&&void 0!==l?l:1024,this._samples=null!==(h=null==t?void 0:t.samples)&&void 0!==h?h:0,this._shared=null!==(d=null==t?void 0:t.shared)&&void 0!==d&&d,this._renderPass=null!==(c=null==t?void 0:t.renderPass)&&void 0!==c?c:new Go}dispose(){var e,t;null===(e=this._normalRenderMaterial)||void 0===e||e.dispose(),null===(t=this._depthNormalRenderTarget)||void 0===t||t.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this._depthNormalRenderTarget)||void 0===n||n.setSize(this._width*this.parameters.depthNormalScale,this._height*this.parameters.depthNormalScale)}render(e,t,n){if(this._shared&&!this.needsUpdate)return;this.needsUpdate=!1;const r=this.normalRenderMaterial;r instanceof Fo&&r.update({camera:n}),this._renderCacheManager?this._renderCacheManager.render(this,t,()=>{this._renderGBuffer(e,t,n)}):this._renderGBuffer(e,t,n),this.floatGBufferRgbNormalAlphaDepth&&this.copyToSeparateDepthBuffer&&this._copyDepthToSeparateDepthTexture(e,this.depthNormalRenderTarget)}_renderGBuffer(e,t,n){this._renderPass.renderWithOverrideMaterial(e,t,n,this.normalRenderMaterial,this.depthNormalRenderTarget,7829503,1)}getCopyMaterial(e){var t;return null!==(t=this._copyMaterial)&&void 0!==t||(this._copyMaterial=new Oo),this._copyMaterial.update(e)}_copyDepthToSeparateDepthTexture(e,t){this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:t.texture,blending:vt,colorTransform:Mo,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),this.separateDeptRenderTarget)}}class Zo{constructor(e,t,n){var r;this.needsUpdate=!0,this.noNeedOfUpdateCount=0,this._blurScale=1,this._shadowScale=1,this._groundGroup=t,this.shadowMapSize=null!==(r=n.shadowMapSize)&&void 0!==r?r:2048,this.parameters=this._getDefaultParameters(n),this._groundShadowFar=this.parameters.cameraFar,this._renderer=e,this._renderCacheManager=null==n?void 0:n._renderCacheManager,this._renderCacheManager&&this._renderCacheManager.registerCache(this,new qo(e=>e.isMesh&&!(e=>{var t;if(!e.isMesh)return!1;if(!e.castShadow&&!(null===(t=e.userData)||void 0===t?void 0:t.meshId))return!1;const n=e.material;return!n.transparent||n.opacity>.5})(e)||void 0!==e.name&&["Ground","Floor"].includes(e.name))),this.renderTarget=new St(this.shadowMapSize,this.shadowMapSize),this.renderTarget.texture.generateMipmaps=!1,this._renderTargetBlur=new St(this.shadowMapSize,this.shadowMapSize),this._renderTargetBlur.texture.generateMipmaps=!1,this.shadowGroundPlane=new Jo(this.renderTarget.texture,this.parameters),this._groundGroup.add(this.shadowGroundPlane),this._groundContactCamera=new $o,this._groundGroup.add(this._groundContactCamera),this._depthMaterial=new Pt,this._depthMaterial.userData.fadeoutBias={value:this.parameters.fadeoutBias},this._depthMaterial.userData.fadeoutFalloff={value:this.parameters.fadeoutFalloff},this._depthMaterial.onBeforeCompile=e=>{e.uniforms.fadeoutBias=this._depthMaterial.userData.fadeoutBias,e.uniforms.fadeoutFalloff=this._depthMaterial.userData.fadeoutFalloff,e.fragmentShader=`\n uniform float fadeoutBias;\n uniform float fadeoutFalloff;\n ${e.fragmentShader.replace("gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );",Jo.alphaMap?"gl_FragColor = vec4(clamp(pow(1.0 + fadeoutBias - fragCoordZ, 1.0/(1.0-fadeoutFalloff)), 0.0, 1.0));":"gl_FragColor = vec4(vec3(0.0), clamp(pow(1.0 + fadeoutBias - fragCoordZ, 1.0/(1.0-fadeoutFalloff)), 0.0, 1.0));")}\n `},this._depthMaterial.side=j,this._depthMaterial.depthTest=!0,this._depthMaterial.depthWrite=!0,this._blurPass=new Ko(Lo,n),this.updatePlaneAndShadowCamera()}_getDefaultParameters(e){return{enabled:!0,cameraHelper:!1,alwaysUpdate:!1,fadeIn:!1,blurMin:.001,blurMax:.1,fadeoutFalloff:.9,fadeoutBias:.03,opacity:.5,maximumPlaneSize:20,planeSize:10,cameraFar:3,hardLayers:null,softLayers:null,polygonOffset:2,excludeGroundObjects:!0,...e}}dispose(){this.renderTarget.dispose(),this._renderTargetBlur.dispose(),this._blurPass.dispose(),this._depthMaterial.dispose()}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t]);void 0!==e.cameraFar&&(this._groundShadowFar=this.parameters.cameraFar)}applyParameters(){this.shadowGroundPlane.updateMaterial(this.parameters),this._groundContactCamera.updateCameraHelper(this.parameters.cameraHelper),this._groundContactCamera.far!==this.parameters.cameraFar&&this.updatePlaneAndShadowCamera();const e=this.parameters.fadeoutFalloff;this._depthMaterial.userData.fadeoutFalloff.value!==e&&(this._depthMaterial.userData.fadeoutFalloff.value=this.parameters.fadeoutFalloff);const t=this.parameters.fadeoutBias/this._groundContactCamera.far;this._depthMaterial.userData.fadeoutBias.value!==t&&(this._depthMaterial.userData.fadeoutBias.value=t),this.needsUpdate=!0}setScale(e,t){this._blurScale=e,this._shadowScale=null!=t?t:e,this.needsUpdate=!0}updateBounds(e,t){var n;this._groundShadowFar=this.parameters.cameraFar,this._groundShadowFar<e.size.z&&(this._groundShadowFar=1.01*e.size.z);const r=Math.max(e.size.x,e.size.z);this.parameters.planeSize=r+2*Math.max(this._blurScale,null!==(n=this._shadowScale)&&void 0!==n?n:1,1),this.parameters.planeSize>this.parameters.maximumPlaneSize?(this.parameters.planeSize=this.parameters.maximumPlaneSize,this._groundGroup.position.set(0,null!=t?t:0,0)):this._groundGroup.position.set(e.center.x,null!=t?t:0,e.center.z),this._groundGroup.updateMatrixWorld(),this.updatePlaneAndShadowCamera()}updatePlaneAndShadowCamera(){const e=this.parameters.planeSize;this.shadowGroundPlane.scale.x=e,this.shadowGroundPlane.scale.y=e,this._groundContactCamera.updateCameraFormPlaneSize(e,this._groundShadowFar),this.needsUpdate=!0}setGroundVisibility(e,t){this.shadowGroundPlane.updateVisibility(e)}render(e){if(this._groundContactCamera.updateCameraHelper(this.parameters.cameraHelper,e),this.shadowGroundPlane.visible=this.parameters.enabled,this.parameters.alwaysUpdate||this.needsUpdate)this.noNeedOfUpdateCount=0;else if(this.noNeedOfUpdateCount++,this.noNeedOfUpdateCount>=10)return;this.needsUpdate=!1,this.shadowGroundPlane.material.opacity=this.parameters.alwaysUpdate||!this.parameters.fadeIn?this.parameters.opacity:this.parameters.opacity*(this.noNeedOfUpdateCount+2)/12;const t=this._renderer.getClearAlpha();this._renderer.setClearAlpha(0),this._groundGroup.visible=!1,this.shadowGroundPlane.visible=!1,this._groundContactCamera.setCameraHelperVisibility(!1),0===this.noNeedOfUpdateCount?(this._renderGroundContact(e),this._renderBlur()):1===this.noNeedOfUpdateCount&&this._renderBlur(),this._renderReduceBandingBlur(),this._renderer.setRenderTarget(null),this._renderer.setClearAlpha(t),this._groundGroup.visible=!0,this.shadowGroundPlane.visible=this.parameters.enabled,this._groundContactCamera.setCameraHelperVisibility(this.parameters.cameraHelper)}_renderGroundContact(e){const t=e.background;e.background=null,e.overrideMaterial=this._depthMaterial,this._renderer.setRenderTarget(this.renderTarget),this._renderer.clear();const n=this._renderer.autoClear;this._renderer.autoClear=!1,this.parameters.hardLayers&&(this._groundContactCamera.layers.mask=this.parameters.hardLayers.mask,this._groundContactCamera.updateCameraFarPlane(10),this._depthMaterial.userData.fadeoutBias.value=.99,this._renderer.render(e,this._groundContactCamera),this._groundContactCamera.updateCameraFarPlane(this._groundShadowFar),this._depthMaterial.userData.fadeoutBias.value=this.parameters.fadeoutBias/this._groundShadowFar),this._groundContactCamera.layers.enableAll(),this.parameters.softLayers&&(this._groundContactCamera.layers.mask=this.parameters.softLayers.mask),this._renderCacheManager?this._renderCacheManager.render(this,e,()=>{this._renderer.render(e,this._groundContactCamera)}):this._renderer.render(e,this._groundContactCamera),this._renderer.autoClear=n,e.overrideMaterial=null,e.background=t}_renderBlur(){this._renderBlurPass(this._blurScale*this.parameters.blurMin/this.parameters.planeSize,this._blurScale*this.parameters.blurMax/this.parameters.planeSize)}_renderReduceBandingBlur(){const e=.01*this._blurScale/this.parameters.planeSize;this._renderBlurPass(e,e)}_renderBlurPass(e,t){this._blurPass.render(this._renderer,[this.renderTarget,this._renderTargetBlur,this.renderTarget],[e,e],[t,t])}}Zo.addTestMesh=!1;class Jo extends K{constructor(e,t){const n=new C({transparent:!0,depthWrite:!1});Jo.alphaMap&&n.color.set(0),n.polygonOffset=!0,super(new At(1,1,10,10),n),this.name="GroundContactShadowPlane",this.userData.isFloor=!0,this.renderOrder=1,this.receiveShadow=!1,this.layers.disableAll(),t&&this.updateMaterial(t),this.setShadowMap(e)}setVisibility(e){this.visible=e,this.visible?this.layers.enableAll():this.layers.disableAll()}setDepthWrite(e){const t=this.material;t.depthWrite=e,t.transparent=!e,t.needsUpdate=!0,this.setVisibility(e)}setReceiveShadow(e){this.receiveShadow=e,this.setVisibility(e)}setShadowMap(e){const t=this.material;t.map=e,Jo.alphaMap&&(t.alphaMap=e),t.needsUpdate=!0}updateMaterial(e){const t=this.material;t.opacity!==e.opacity&&(t.opacity=e.opacity),t.polygonOffsetFactor!==e.polygonOffset&&(t.polygonOffset=!0,t.polygonOffsetFactor=e.polygonOffset,t.polygonOffsetUnits=e.polygonOffset)}updateVisibility(e){e?this.layers.enableAll():this.layers.disableAll()}}Jo.alphaMap=!1;class $o extends ${constructor(){super(-1,1,-1,1,-1,1),this.rotation.x=Math.PI}updateCameraFormPlaneSize(e,t){var n;this.left=-e/2,this.right=e/2,this.top=-e/2,this.bottom=e/2,this.near=0,this.far=t,this.updateProjectionMatrix(),null===(n=this.cameraHelper)||void 0===n||n.update()}updateCameraFarPlane(e){var t;this.far=e,this.updateProjectionMatrix(),null===(t=this.cameraHelper)||void 0===t||t.update()}updateCameraHelper(e,t){var n,r,a;e?(this.cameraHelper=null!==(n=this.cameraHelper)&&void 0!==n?n:new Rt(this),this.cameraHelper.visible=!0,null==t||t.add(this.cameraHelper)):(null===(r=this.cameraHelper)||void 0===r?void 0:r.parent)&&(null===(a=this.cameraHelper)||void 0===a||a.removeFromParent())}setCameraHelperVisibility(e){this.cameraHelper&&(this.cameraHelper.visible=e)}}var el={name:"CopyShader",uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\n\t\tuniform float opacity;\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\t\t\tgl_FragColor = opacity * texel;\n\n\n\t\t}"},tl={uniforms:{tDiffuse:{value:null},resolution:{value:new i(1/1024,1/512)}},vertexShader:"\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}",fragmentShader:"\n\tprecision highp float;\n\n\tuniform sampler2D tDiffuse;\n\n\tuniform vec2 resolution;\n\n\tvarying vec2 vUv;\n\n\t// FXAA 3.11 implementation by NVIDIA, ported to WebGL by Agost Biro (biro@archilogic.com)\n\n\t//----------------------------------------------------------------------------------\n\t// File: es3-keplerFXAAassetsshaders/FXAA_DefaultES.frag\n\t// SDK Version: v3.00\n\t// Email: gameworks@nvidia.com\n\t// Site: http://developer.nvidia.com/\n\t//\n\t// Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.\n\t//\n\t// Redistribution and use in source and binary forms, with or without\n\t// modification, are permitted provided that the following conditions\n\t// are met:\n\t// * Redistributions of source code must retain the above copyright\n\t// notice, this list of conditions and the following disclaimer.\n\t// * Redistributions in binary form must reproduce the above copyright\n\t// notice, this list of conditions and the following disclaimer in the\n\t// documentation and/or other materials provided with the distribution.\n\t// * Neither the name of NVIDIA CORPORATION nor the names of its\n\t// contributors may be used to endorse or promote products derived\n\t// from this software without specific prior written permission.\n\t//\n\t// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY\n\t// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n\t// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n\t// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n\t// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n\t// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n\t// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n\t// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n\t// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n\t// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n\t// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\t//\n\t//----------------------------------------------------------------------------------\n\n\t#ifndef FXAA_DISCARD\n\t\t\t//\n\t\t\t// Only valid for PC OpenGL currently.\n\t\t\t// Probably will not work when FXAA_GREEN_AS_LUMA = 1.\n\t\t\t//\n\t\t\t// 1 = Use discard on pixels which don't need AA.\n\t\t\t// For APIs which enable concurrent TEX+ROP from same surface.\n\t\t\t// 0 = Return unchanged color on pixels which don't need AA.\n\t\t\t//\n\t\t\t#define FXAA_DISCARD 0\n\t#endif\n\n\t/*--------------------------------------------------------------------------*/\n\t#define FxaaTexTop(t, p) texture2D(t, p, -100.0)\n\t#define FxaaTexOff(t, p, o, r) texture2D(t, p + (o * r), -100.0)\n\t/*--------------------------------------------------------------------------*/\n\n\t#define NUM_SAMPLES 5\n\n\t// assumes colors have premultipliedAlpha, so that the calculated color contrast is scaled by alpha\n\tfloat contrast( vec4 a, vec4 b ) {\n\t\t\tvec4 diff = abs( a - b );\n\t\t\treturn max( max( max( diff.r, diff.g ), diff.b ), diff.a );\n\t}\n\n\t/*============================================================================\n\n\t\t\t\t\t\t\t\t\tFXAA3 QUALITY - PC\n\n\t============================================================================*/\n\n\t/*--------------------------------------------------------------------------*/\n\tvec4 FxaaPixelShader(\n\t\t\tvec2 posM,\n\t\t\tsampler2D tex,\n\t\t\tvec2 fxaaQualityRcpFrame,\n\t\t\tfloat fxaaQualityEdgeThreshold,\n\t\t\tfloat fxaaQualityinvEdgeThreshold\n\t) {\n\t\t\tvec4 rgbaM = FxaaTexTop(tex, posM);\n\t\t\tvec4 rgbaS = FxaaTexOff(tex, posM, vec2( 0.0, 1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaE = FxaaTexOff(tex, posM, vec2( 1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaN = FxaaTexOff(tex, posM, vec2( 0.0,-1.0), fxaaQualityRcpFrame.xy);\n\t\t\tvec4 rgbaW = FxaaTexOff(tex, posM, vec2(-1.0, 0.0), fxaaQualityRcpFrame.xy);\n\t\t\t// . S .\n\t\t\t// W M E\n\t\t\t// . N .\n\n\t\t\tbool earlyExit = max( max( max(\n\t\t\t\t\tcontrast( rgbaM, rgbaN ),\n\t\t\t\t\tcontrast( rgbaM, rgbaS ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaE ) ),\n\t\t\t\t\tcontrast( rgbaM, rgbaW ) )\n\t\t\t\t\t< fxaaQualityEdgeThreshold;\n\t\t\t// . 0 .\n\t\t\t// 0 0 0\n\t\t\t// . 0 .\n\n\t\t\t#if (FXAA_DISCARD == 1)\n\t\t\t\t\tif(earlyExit) FxaaDiscard;\n\t\t\t#else\n\t\t\t\t\tif(earlyExit) return rgbaM;\n\t\t\t#endif\n\n\t\t\tfloat contrastN = contrast( rgbaM, rgbaN );\n\t\t\tfloat contrastS = contrast( rgbaM, rgbaS );\n\t\t\tfloat contrastE = contrast( rgbaM, rgbaE );\n\t\t\tfloat contrastW = contrast( rgbaM, rgbaW );\n\n\t\t\tfloat relativeVContrast = ( contrastN + contrastS ) - ( contrastE + contrastW );\n\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\tbool horzSpan = relativeVContrast > 0.;\n\t\t\t// . 1 .\n\t\t\t// 0 0 0\n\t\t\t// . 1 .\n\n\t\t\t// 45 deg edge detection and corners of objects, aka V/H contrast is too similar\n\t\t\tif( abs( relativeVContrast ) < .3 ) {\n\t\t\t\t\t// locate the edge\n\t\t\t\t\tvec2 dirToEdge;\n\t\t\t\t\tdirToEdge.x = contrastE > contrastW ? 1. : -1.;\n\t\t\t\t\tdirToEdge.y = contrastS > contrastN ? 1. : -1.;\n\t\t\t\t\t// . 2 . . 1 .\n\t\t\t\t\t// 1 0 2 ~= 0 0 1\n\t\t\t\t\t// . 1 . . 0 .\n\n\t\t\t\t\t// tap 2 pixels and see which ones are \"outside\" the edge, to\n\t\t\t\t\t// determine if the edge is vertical or horizontal\n\n\t\t\t\t\tvec4 rgbaAlongH = FxaaTexOff(tex, posM, vec2( dirToEdge.x, -dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongH = contrast( rgbaM, rgbaAlongH );\n\t\t\t\t\t// . 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 H\n\n\t\t\t\t\tvec4 rgbaAlongV = FxaaTexOff(tex, posM, vec2( -dirToEdge.x, dirToEdge.y ), fxaaQualityRcpFrame.xy);\n\t\t\t\t\tfloat matchAlongV = contrast( rgbaM, rgbaAlongV );\n\t\t\t\t\t// V 1 .\n\t\t\t\t\t// 0 0 1\n\t\t\t\t\t// . 0 .\n\n\t\t\t\t\trelativeVContrast = matchAlongV - matchAlongH;\n\t\t\t\t\trelativeVContrast *= fxaaQualityinvEdgeThreshold;\n\n\t\t\t\t\tif( abs( relativeVContrast ) < .3 ) { // 45 deg edge\n\t\t\t\t\t\t\t// 1 1 .\n\t\t\t\t\t\t\t// 0 0 1\n\t\t\t\t\t\t\t// . 0 1\n\n\t\t\t\t\t\t\t// do a simple blur\n\t\t\t\t\t\t\treturn mix(\n\t\t\t\t\t\t\t\t\trgbaM,\n\t\t\t\t\t\t\t\t\t(rgbaN + rgbaS + rgbaE + rgbaW) * .25,\n\t\t\t\t\t\t\t\t\t.4\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\thorzSpan = relativeVContrast > 0.;\n\t\t\t}\n\n\t\t\tif(!horzSpan) rgbaN = rgbaW;\n\t\t\tif(!horzSpan) rgbaS = rgbaE;\n\t\t\t// . 0 . 1\n\t\t\t// 1 0 1 -> 0\n\t\t\t// . 0 . 1\n\n\t\t\tbool pairN = contrast( rgbaM, rgbaN ) > contrast( rgbaM, rgbaS );\n\t\t\tif(!pairN) rgbaN = rgbaS;\n\n\t\t\tvec2 offNP;\n\t\t\toffNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;\n\t\t\toffNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;\n\n\t\t\tbool doneN = false;\n\t\t\tbool doneP = false;\n\n\t\t\tfloat nDist = 0.;\n\t\t\tfloat pDist = 0.;\n\n\t\t\tvec2 posN = posM;\n\t\t\tvec2 posP = posM;\n\n\t\t\tint iterationsUsed = 0;\n\t\t\tint iterationsUsedN = 0;\n\t\t\tint iterationsUsedP = 0;\n\t\t\tfor( int i = 0; i < NUM_SAMPLES; i++ ) {\n\t\t\t\t\titerationsUsed = i;\n\n\t\t\t\t\tfloat increment = float(i + 1);\n\n\t\t\t\t\tif(!doneN) {\n\t\t\t\t\t\t\tnDist += increment;\n\t\t\t\t\t\t\tposN = posM + offNP * nDist;\n\t\t\t\t\t\t\tvec4 rgbaEndN = FxaaTexTop(tex, posN.xy);\n\t\t\t\t\t\t\tdoneN = contrast( rgbaEndN, rgbaM ) > contrast( rgbaEndN, rgbaN );\n\t\t\t\t\t\t\titerationsUsedN = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!doneP) {\n\t\t\t\t\t\t\tpDist += increment;\n\t\t\t\t\t\t\tposP = posM - offNP * pDist;\n\t\t\t\t\t\t\tvec4 rgbaEndP = FxaaTexTop(tex, posP.xy);\n\t\t\t\t\t\t\tdoneP = contrast( rgbaEndP, rgbaM ) > contrast( rgbaEndP, rgbaN );\n\t\t\t\t\t\t\titerationsUsedP = i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(doneN || doneP) break;\n\t\t\t}\n\n\n\t\t\tif ( !doneP && !doneN ) return rgbaM; // failed to find end of edge\n\n\t\t\tfloat dist = min(\n\t\t\t\t\tdoneN ? float( iterationsUsedN ) / float( NUM_SAMPLES - 1 ) : 1.,\n\t\t\t\t\tdoneP ? float( iterationsUsedP ) / float( NUM_SAMPLES - 1 ) : 1.\n\t\t\t);\n\n\t\t\t// hacky way of reduces blurriness of mostly diagonal edges\n\t\t\t// but reduces AA quality\n\t\t\tdist = pow(dist, .5);\n\n\t\t\tdist = 1. - dist;\n\n\t\t\treturn mix(\n\t\t\t\t\trgbaM,\n\t\t\t\t\trgbaN,\n\t\t\t\t\tdist * .5\n\t\t\t);\n\t}\n\n\tvoid main() {\n\t\t\tconst float edgeDetectionQuality = .2;\n\t\t\tconst float invEdgeDetectionQuality = 1. / edgeDetectionQuality;\n\n\t\t\tgl_FragColor = FxaaPixelShader(\n\t\t\t\t\tvUv,\n\t\t\t\t\ttDiffuse,\n\t\t\t\t\tresolution,\n\t\t\t\t\tedgeDetectionQuality, // [0,1] contrast needed, otherwise early discard\n\t\t\t\t\tinvEdgeDetectionQuality\n\t\t\t);\n\n\t}\n\t"};class nl extends No{constructor(e,t,n,r,a){var s;super(),this.patternTexture=null,this._gBufferRenderTarget=null==a?void 0:a._gBufferRenderTarget,this.renderScene=t,this.renderCamera=n,this.selectedObjects=void 0!==r?r:[],this.visibleEdgeColor=new h(1,1,1),this.hiddenEdgeColor=new h(.1,.04,.02),this.edgeGlow=0,this.usePatternTexture=!1,this.edgeThickness=1,this.edgeStrength=3,this.downSampleRatio=(null==a?void 0:a.downSampleRatio)||2,this.pulsePeriod=0,this.edgeDetectionFxaa=(null==a?void 0:a.edgeDetectionFxaa)||!1,this._visibilityCache=new Map,this.resolution=void 0!==e?new i(e.x,e.y):new i(256,256);const o=Math.round(this.resolution.x/this.downSampleRatio),l=Math.round(this.resolution.y/this.downSampleRatio);this.renderTargetMaskBuffer=new St(this.resolution.x,this.resolution.y),this.renderTargetMaskBuffer.texture.name="OutlinePass.mask",this.renderTargetMaskBuffer.texture.generateMipmaps=!1,this._gBufferRenderTarget||(this.depthMaterial=new Pt,this.depthMaterial.side=j,this.depthMaterial.depthPacking=Et,this.depthMaterial.blending=vt),this.prepareMaskMaterial=this._getPrepareMaskMaterial(null===(s=this._gBufferRenderTarget)||void 0===s?void 0:s.isFloatGBufferWithRgbNormalAlphaDepth),this.prepareMaskMaterial.side=j,this.prepareMaskMaterial.fragmentShader=function(e,t){const n=t.isPerspectiveCamera?"perspective":"orthographic";return e.replace(/DEPTH_TO_VIEW_Z/g,n+"DepthToViewZ")}(this.prepareMaskMaterial.fragmentShader,this.renderCamera),this._gBufferRenderTarget||(this.renderTargetDepthBuffer=new St(this.resolution.x,this.resolution.y),this.renderTargetDepthBuffer.texture.name="OutlinePass.depth",this.renderTargetDepthBuffer.texture.generateMipmaps=!1),this.edgeDetectionFxaa&&(this.fxaaRenderMaterial=new ft(tl),this.fxaaRenderMaterial.uniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,this.fxaaRenderMaterial.uniforms.resolution.value.set(1/this.resolution.x,1/this.resolution.y),this.renderTargetFxaaBuffer=new St(this.resolution.x,this.resolution.y),this.renderTargetFxaaBuffer.texture.name="OutlinePass.fxaa",this.renderTargetFxaaBuffer.texture.generateMipmaps=!1),this.renderTargetMaskDownSampleBuffer=new St(o,l),this.renderTargetMaskDownSampleBuffer.texture.name="OutlinePass.depthDownSample",this.renderTargetMaskDownSampleBuffer.texture.generateMipmaps=!1,this.renderTargetBlurBuffer1=new St(o,l),this.renderTargetBlurBuffer1.texture.name="OutlinePass.blur1",this.renderTargetBlurBuffer1.texture.generateMipmaps=!1,this.renderTargetBlurBuffer2=new St(Math.round(o/2),Math.round(l/2)),this.renderTargetBlurBuffer2.texture.name="OutlinePass.blur2",this.renderTargetBlurBuffer2.texture.generateMipmaps=!1,this.edgeDetectionMaterial=this._getEdgeDetectionMaterial(),this.renderTargetEdgeBuffer1=new St(o,l),this.renderTargetEdgeBuffer1.texture.name="OutlinePass.edge1",this.renderTargetEdgeBuffer1.texture.generateMipmaps=!1,this.renderTargetEdgeBuffer2=new St(Math.round(o/2),Math.round(l/2)),this.renderTargetEdgeBuffer2.texture.name="OutlinePass.edge2",this.renderTargetEdgeBuffer2.texture.generateMipmaps=!1,this.separableBlurMaterial1=this._getSeperableBlurMaterial(4),this.separableBlurMaterial1.uniforms.texSize.value.set(o,l),this.separableBlurMaterial1.uniforms.kernelRadius.value=1,this.separableBlurMaterial2=this._getSeperableBlurMaterial(4),this.separableBlurMaterial2.uniforms.texSize.value.set(Math.round(o/2),Math.round(l/2)),this.separableBlurMaterial2.uniforms.kernelRadius.value=4,this.overlayMaterial=this._getOverlayMaterial();const d=el;this.copyUniforms=gt.clone(d.uniforms),this.copyUniforms.opacity.value=1,this.materialCopy=new ft({uniforms:this.copyUniforms,vertexShader:d.vertexShader,fragmentShader:d.fragmentShader,blending:vt,depthTest:!1,depthWrite:!1,transparent:!0}),this.enabled=!0,this.needsSwap=!1,this._oldClearColor=new h,this.oldClearAlpha=1,this.fsQuad=new Ho(void 0),this.tempPulseColor1=new h,this.tempPulseColor2=new h,this.textureMatrix=new P}dispose(){var e,t,n,r;this.renderTargetMaskBuffer.dispose(),null===(e=this.renderTargetFxaaBuffer)||void 0===e||e.dispose(),null===(t=this.renderTargetDepthBuffer)||void 0===t||t.dispose(),this.renderTargetMaskDownSampleBuffer.dispose(),this.renderTargetBlurBuffer1.dispose(),this.renderTargetBlurBuffer2.dispose(),this.renderTargetEdgeBuffer1.dispose(),this.renderTargetEdgeBuffer2.dispose(),null===(n=this.depthMaterial)||void 0===n||n.dispose(),this.prepareMaskMaterial.dispose(),null===(r=this.fxaaRenderMaterial)||void 0===r||r.dispose(),this.edgeDetectionMaterial.dispose(),this.separableBlurMaterial1.dispose(),this.separableBlurMaterial2.dispose(),this.overlayMaterial.dispose(),this.materialCopy.dispose(),this.fsQuad.dispose()}setSize(e,t){var n,r,a;this.renderTargetMaskBuffer.setSize(e,t),null===(n=this.renderTargetDepthBuffer)||void 0===n||n.setSize(e,t);let i=Math.round(e/this.downSampleRatio),s=Math.round(t/this.downSampleRatio);this.renderTargetMaskDownSampleBuffer.setSize(i,s),this.renderTargetBlurBuffer1.setSize(i,s),this.renderTargetEdgeBuffer1.setSize(i,s),this.separableBlurMaterial1.uniforms.texSize.value.set(i,s),i=Math.round(i/2),s=Math.round(s/2),this.renderTargetBlurBuffer2.setSize(i,s),this.renderTargetEdgeBuffer2.setSize(i,s),this.separableBlurMaterial2.uniforms.texSize.value.set(i,s),null===(r=this.fxaaRenderMaterial)||void 0===r||r.uniforms.resolution.value.set(1/this.resolution.x,1/this.resolution.y),null===(a=this.renderTargetFxaaBuffer)||void 0===a||a.setSize(e,t)}_changeVisibilityOfSelectedObjects(e){const t=this._visibilityCache;function n(n){n.isMesh&&(!0===e?n.visible=t.get(n):(t.set(n,n.visible),n.visible=e))}this.selectedObjects.forEach(e=>e.traverse(n))}_changeVisibilityOfNonSelectedObjects(e){const t=this._visibilityCache,n=[];function r(e){e.isMesh&&n.push(e)}this.selectedObjects.forEach(e=>e.traverse(r)),this.renderScene.traverse((function(r){if(r.isMesh||r.isSprite){if(!1===n.some(e=>e.id===r.id)){const n=r.visible;!1!==e&&!0!==t.get(r)||(r.visible=e),t.set(r,n)}}else(r.isPoints||r.isLine)&&(!0===e?r.visible=t.get(r):(t.set(r,r.visible),r.visible=e))}))}_updateTextureMatrix(){this.textureMatrix.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),this.textureMatrix.multiply(this.renderCamera.projectionMatrix),this.textureMatrix.multiply(this.renderCamera.matrixWorldInverse)}render(e,t,n,r,a){var i,s;if(this.selectedObjects.length>0){null===(i=this._gBufferRenderTarget)||void 0===i||i.render(e,this.renderScene,this.renderCamera),e.getClearColor(this._oldClearColor),this.oldClearAlpha=e.getClearAlpha();const t=e.autoClear;e.autoClear=!1,a&&e.state.buffers.stencil.setTest(!1),e.setClearColor(16777215,1),this._changeVisibilityOfSelectedObjects(!1);const r=this.renderScene.background;this.renderScene.background=null,this.renderTargetDepthBuffer&&this.depthMaterial&&(this.renderScene.overrideMaterial=this.depthMaterial,e.setRenderTarget(this.renderTargetDepthBuffer),e.clear(),e.render(this.renderScene,this.renderCamera)),this._changeVisibilityOfSelectedObjects(!0),this._visibilityCache.clear(),this._updateTextureMatrix(),this._changeVisibilityOfNonSelectedObjects(!1),this.renderScene.overrideMaterial=this.prepareMaskMaterial,this.prepareMaskMaterial.uniforms.cameraNearFar.value.set(this.renderCamera.near,this.renderCamera.far),this._gBufferRenderTarget?this.prepareMaskMaterial.uniforms.depthTexture.value=this._gBufferRenderTarget.textureWithDepthValue:this.prepareMaskMaterial.uniforms.depthTexture.value=null===(s=this.renderTargetDepthBuffer)||void 0===s?void 0:s.texture,this.prepareMaskMaterial.uniforms.textureMatrix.value=this.textureMatrix,e.setRenderTarget(this.renderTargetMaskBuffer),e.clear(),e.render(this.renderScene,this.renderCamera),this.renderScene.overrideMaterial=null,this._changeVisibilityOfNonSelectedObjects(!0),this._visibilityCache.clear(),this.renderScene.background=r;let o=this.renderTargetMaskBuffer;if(this.edgeDetectionFxaa&&this.fxaaRenderMaterial&&this.renderTargetFxaaBuffer&&(this.fxaaRenderMaterial.uniforms.tDiffuse.value=this.renderTargetMaskBuffer.texture,this.fsQuad.material=this.fxaaRenderMaterial,e.setRenderTarget(this.renderTargetFxaaBuffer),e.clear(),this.fsQuad.render(e),o=this.renderTargetFxaaBuffer),this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=o.texture,e.setRenderTarget(this.renderTargetMaskDownSampleBuffer),e.clear(),this.fsQuad.render(e),this.tempPulseColor1.copy(this.visibleEdgeColor),this.tempPulseColor2.copy(this.hiddenEdgeColor),this.pulsePeriod>0){const e=.625+.75*Math.cos(.01*performance.now()/this.pulsePeriod)/2;this.tempPulseColor1.multiplyScalar(e),this.tempPulseColor2.multiplyScalar(e)}this.fsQuad.material=this.edgeDetectionMaterial,this.edgeDetectionMaterial.uniforms.maskTexture.value=this.renderTargetMaskDownSampleBuffer.texture,this.edgeDetectionMaterial.uniforms.texSize.value.set(this.renderTargetMaskDownSampleBuffer.width,this.renderTargetMaskDownSampleBuffer.height),this.edgeDetectionMaterial.uniforms.visibleEdgeColor.value=this.tempPulseColor1,this.edgeDetectionMaterial.uniforms.hiddenEdgeColor.value=this.tempPulseColor2,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial1,this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=nl.BlurDirectionX,this.separableBlurMaterial1.uniforms.kernelRadius.value=this.edgeThickness,e.setRenderTarget(this.renderTargetBlurBuffer1),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial1.uniforms.colorTexture.value=this.renderTargetBlurBuffer1.texture,this.separableBlurMaterial1.uniforms.direction.value=nl.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer1),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.separableBlurMaterial2,this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetEdgeBuffer1.texture,this.separableBlurMaterial2.uniforms.direction.value=nl.BlurDirectionX,e.setRenderTarget(this.renderTargetBlurBuffer2),e.clear(),this.fsQuad.render(e),this.separableBlurMaterial2.uniforms.colorTexture.value=this.renderTargetBlurBuffer2.texture,this.separableBlurMaterial2.uniforms.direction.value=nl.BlurDirectionY,e.setRenderTarget(this.renderTargetEdgeBuffer2),e.clear(),this.fsQuad.render(e),this.fsQuad.material=this.overlayMaterial,this.overlayMaterial.uniforms.maskTexture.value=o.texture,this.overlayMaterial.uniforms.edgeTexture1.value=this.renderTargetEdgeBuffer1.texture,this.overlayMaterial.uniforms.edgeTexture2.value=this.renderTargetEdgeBuffer2.texture,this.overlayMaterial.uniforms.patternTexture.value=this.patternTexture,this.overlayMaterial.uniforms.edgeStrength.value=this.edgeStrength,this.overlayMaterial.uniforms.edgeGlow.value=this.edgeGlow,this.overlayMaterial.uniforms.usePatternTexture.value=this.usePatternTexture,a&&e.state.buffers.stencil.setTest(!0),e.setRenderTarget(n),this.fsQuad.render(e),e.setClearColor(this._oldClearColor,this.oldClearAlpha),e.autoClear=t}this.renderToScreen&&n&&(this.fsQuad.material=this.materialCopy,this.copyUniforms.tDiffuse.value=n.texture,e.setRenderTarget(null),this.fsQuad.render(e))}_getPrepareMaskMaterial(e){return new ft({uniforms:{depthTexture:{value:null},cameraNearFar:{value:new i(.5,.5)},textureMatrix:{value:null}},defines:{FLOAT_ALPHA_DEPTH:e?1:0},vertexShader:"#include <morphtarget_pars_vertex>\n\t\t\t\t#include <skinning_pars_vertex>\n\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tuniform mat4 textureMatrix;\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\t#include <skinbase_vertex>\n\t\t\t\t\t#include <begin_vertex>\n\t\t\t\t\t#include <morphtarget_vertex>\n\t\t\t\t\t#include <skinning_vertex>\n\t\t\t\t\t#include <project_vertex>\n\n\t\t\t\t\tvPosition = mvPosition;\n\n\t\t\t\t\tvec4 worldPosition = vec4( transformed, 1.0 );\n\n\t\t\t\t\t#ifdef USE_INSTANCING\n\n\t\t\t\t\t\tworldPosition = instanceMatrix * worldPosition;\n\n\t\t\t\t\t#endif\n\t\t\t\t\t\n\t\t\t\t\tworldPosition = modelMatrix * worldPosition;\n\n\t\t\t\t\tprojTexCoord = textureMatrix * worldPosition;\n\n\t\t\t\t}",fragmentShader:"#include <packing>\n\t\t\t\tvarying vec4 vPosition;\n\t\t\t\tvarying vec4 projTexCoord;\n\t\t\t\tuniform sampler2D depthTexture;\n\t\t\t\tuniform vec2 cameraNearFar;\n\n\t\t\t\tvoid main() {\n\n #if FLOAT_ALPHA_DEPTH == 1\n\t\t\t\t\t float depth = texture2DProj( depthTexture, projTexCoord ).w;\n #else\n float depth = unpackRGBAToDepth(texture2DProj( depthTexture, projTexCoord ));\n #endif\n\t\t\t\t\tfloat viewZ = - DEPTH_TO_VIEW_Z( depth, cameraNearFar.x, cameraNearFar.y );\n\t\t\t\t\tfloat depthTest = (-vPosition.z > viewZ) ? 1.0 : 0.0;\n\t\t\t\t\tgl_FragColor = vec4(0.0, depthTest, 1.0, 1.0);\n\n\t\t\t\t}"})}_getEdgeDetectionMaterial(){return new ft({uniforms:{maskTexture:{value:null},texSize:{value:new i(.5,.5)},visibleEdgeColor:{value:new s(1,1,1)},hiddenEdgeColor:{value:new s(1,1,1)}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec3 visibleEdgeColor;\n\t\t\t\tuniform vec3 hiddenEdgeColor;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tvec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize);\n\t\t\t\t\tvec4 c1 = texture2D( maskTexture, vUv + uvOffset.xy);\n\t\t\t\t\tvec4 c2 = texture2D( maskTexture, vUv - uvOffset.xy);\n\t\t\t\t\tvec4 c3 = texture2D( maskTexture, vUv + uvOffset.yw);\n\t\t\t\t\tvec4 c4 = texture2D( maskTexture, vUv - uvOffset.yw);\n\t\t\t\t\tfloat diff1 = (c1.r - c2.r)*0.5;\n\t\t\t\t\tfloat diff2 = (c3.r - c4.r)*0.5;\n\t\t\t\t\tfloat d = length( vec2(diff1, diff2) );\n\t\t\t\t\tfloat a1 = min(c1.g, c2.g);\n\t\t\t\t\tfloat a2 = min(c3.g, c4.g);\n\t\t\t\t\tfloat visibilityFactor = min(a1, a2);\n\t\t\t\t\tvec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor;\n\t\t\t\t\tgl_FragColor = vec4(edgeColor, 1.0) * vec4(d);\n\t\t\t\t}"})}_getSeperableBlurMaterial(e){return new ft({defines:{MAX_RADIUS:e},uniforms:{colorTexture:{value:null},texSize:{value:new i(.5,.5)},direction:{value:new i(.5,.5)},kernelRadius:{value:1}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\t\t\t\tuniform float kernelRadius;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat sigma = kernelRadius/2.0;\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, sigma);\n\t\t\t\t\tvec4 diffuseSum = texture2D( colorTexture, vUv) * weightSum;\n\t\t\t\t\tvec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS);\n\t\t\t\t\tvec2 uvOffset = delta;\n\t\t\t\t\tfor( int i = 1; i <= MAX_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = kernelRadius * float(i) / float(MAX_RADIUS);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, sigma);\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += ((sample1 + sample2) * w);\n\t\t\t\t\t\tweightSum += (2.0 * w);\n\t\t\t\t\t\tuvOffset += delta;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = diffuseSum/weightSum;\n\t\t\t\t}"})}_getOverlayMaterial(){return new ft({uniforms:{maskTexture:{value:null},edgeTexture1:{value:null},edgeTexture2:{value:null},patternTexture:{value:null},edgeStrength:{value:1},edgeGlow:{value:1},usePatternTexture:{value:0}},vertexShader:"varying vec2 vUv;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}",fragmentShader:"varying vec2 vUv;\n\n\t\t\t\tuniform sampler2D maskTexture;\n\t\t\t\tuniform sampler2D edgeTexture1;\n\t\t\t\tuniform sampler2D edgeTexture2;\n\t\t\t\tuniform sampler2D patternTexture;\n\t\t\t\tuniform float edgeStrength;\n\t\t\t\tuniform float edgeGlow;\n\t\t\t\tuniform bool usePatternTexture;\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec4 edgeValue1 = texture2D(edgeTexture1, vUv);\n\t\t\t\t\tvec4 edgeValue2 = texture2D(edgeTexture2, vUv);\n\t\t\t\t\tvec4 maskColor = texture2D(maskTexture, vUv);\n\t\t\t\t\tvec4 patternColor = texture2D(patternTexture, 6.0 * vUv);\n\t\t\t\t\tfloat visibilityFactor = 1.0 - maskColor.g > 0.0 ? 1.0 : 0.5;\n\t\t\t\t\tvec4 edgeValue = edgeValue1 + edgeValue2 * edgeGlow;\n\t\t\t\t\tvec4 finalColor = edgeStrength * maskColor.r * edgeValue;\n\t\t\t\t\tif(usePatternTexture)\n\t\t\t\t\t\tfinalColor += + visibilityFactor * (1.0 - maskColor.r) * (1.0 - patternColor.r);\n\t\t\t\t\tgl_FragColor = finalColor;\n }",blending:It,depthTest:!1,depthWrite:!1,transparent:!0})}}nl.BlurDirectionX=new i(1,0),nl.BlurDirectionY=new i(0,1);class rl{get isOutlinePassActivated(){return this.outlinePassActivated}constructor(e,t,n,r){this._width=0,this._height=0,this._effectComposer=null,this.outlinePass=null,this.outlinePassActivated=!1,this._effectComposer=e,this._gBufferRenderTarget=null==r?void 0:r._gBufferRenderTarget,this._width=t,this._height=n,this.parameters={enabled:!0,edgeStrength:2,edgeGlow:1,edgeThickness:2,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16777215,hiddenEdgeColor:16777215,...r}}dispose(){var e;null===(e=this.outlinePass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.outlinePass)||void 0===n||n.setSize(e,t)}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t])}applyParameters(){this.outlinePass&&(this.outlinePass.edgeStrength=this.parameters.edgeStrength,this.outlinePass.edgeGlow=this.parameters.edgeGlow,this.outlinePass.edgeThickness=this.parameters.edgeThickness,this.outlinePass.pulsePeriod=this.parameters.pulsePeriod,this.outlinePass.usePatternTexture=this.parameters.usePatternTexture,this.outlinePass.visibleEdgeColor.set(this.parameters.visibleEdgeColor),this.outlinePass.hiddenEdgeColor.set(this.parameters.hiddenEdgeColor))}activateOutline(e,t){var n;if(!this.parameters.enabled)return void this.deactivateOutline();const r=(null===(n=this.outlinePass)||void 0===n?void 0:n.renderCamera)&&t.isPerspectiveCamera!==this.outlinePass.renderCamera.isPerspectiveCamera;this.outlinePass&&(this.outlinePass.renderScene=e,this.outlinePass.renderCamera=t),!r&&this.outlinePassActivated||(!r&&this.outlinePass||(this.outlinePass=new nl(new i(this._width,this._height),e,t,[],{downSampleRatio:2,edgeDetectionFxaa:!0,_gBufferRenderTarget:this._gBufferRenderTarget})),this.applyParameters(),this._effectComposer&&this._effectComposer.addPass(this.outlinePass),this.outlinePassActivated=!0)}deactivateOutline(){this.outlinePassActivated&&(this.outlinePass&&this._effectComposer&&this._effectComposer.removePass(this.outlinePass),this.outlinePassActivated=!1)}updateOutline(e,t,n){n.length>0?(this.activateOutline(e,t),this.outlinePass&&(this.outlinePass.selectedObjects=n)):this.deactivateOutline()}}var al,il=function(e){g(n,e);var t=v(n);function n(e,r){var a;_(this,n);var i=new c;i.setAttribute("position",new Fe([1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],3)),i.computeBoundingSphere();var s=new z({fog:!1});(a=t.call(this,i,s)).light=e,a.color=r,a.type="RectAreaLightHelper";var o=new c;return o.setAttribute("position",new Fe([1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],3)),o.computeBoundingSphere(),a.add(new K(o,new C({side:kt,fog:!1}))),a}return w(n,[{key:"updateMatrixWorld",value:function(){if(this.scale.set(.5*this.light.width,.5*this.light.height,1),void 0!==this.color)this.material.color.set(this.color),this.children[0].material.color.set(this.color);else{this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity);var e=this.material.color,t=Math.max(e.r,e.g,e.b);t>1&&e.multiplyScalar(1/t),this.children[0].material.color.copy(this.material.color)}this.matrixWorld.extractRotation(this.light.matrixWorld).scale(this.scale).copyPosition(this.light.matrixWorld),this.children[0].matrixWorld.copy(this.matrixWorld)}},{key:"dispose",value:function(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}]),n}(X);!function(e){e[e.DirectionalLightShadow=0]="DirectionalLightShadow",e[e.SpotLightShadow=1]="SpotLightShadow"}(al||(al={}));const sl={alwaysUpdate:!1,enableShadowMap:!0,layers:null,shadowLightSourceType:al.DirectionalLightShadow,maximumNumberOfLightSources:-1,directionalDependency:1,directionalExponent:1,groundContainment:1,fadeOutDistance:.1,fadeOutBlur:20};class ol{get shadowTexture(){return this._shadowRenderTarget.texture}constructor(e,t,n){var r,a;this.needsUpdate=!1,this.shadowTypeNeedsUpdate=!0,this.shadowConfiguration=new dl,this._shadowLightSources=[],this._shadowScale=1,this._renderPass=new Go,this._cameraUpdate=new Vo,this._renderCacheManager=e,this._viewportSize=new i(t.x,t.y),this._samples=null!==(r=null==n?void 0:n.samples)&&void 0!==r?r:0,this._shadowMapSize=null!==(a=null==n?void 0:n.shadowMapSize)&&void 0!==a?a:1024,this.parameters=this._getScreenSpaceShadowMapParameters(n),this.castShadow=this.parameters.enableShadowMap,this._shadowMapPassOverrideMaterialCache=new hl(this.parameters),this._renderCacheManager.registerCache(this,this._shadowMapPassOverrideMaterialCache);const s=this._samples;this._shadowRenderTarget=new St(this._viewportSize.x,this._viewportSize.y,{samples:s,format:ht})}_getScreenSpaceShadowMapParameters(e){return{...sl,...e}}dispose(){this._shadowLightSources.forEach(e=>e.dispose()),this._shadowRenderTarget.dispose(),this._shadowMapPassOverrideMaterialCache.dispose()}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t])}updateBounds(e,t){const n=this._shadowScale;this._shadowScale=t,Math.abs(n-this._shadowScale)>1e-5&&(this.shadowTypeNeedsUpdate=!0),this._shadowLightSources.forEach(t=>t.updateBounds(e)),this._shadowMapPassOverrideMaterialCache.setBoundingBox(e.bounds)}forceShadowUpdate(){this._shadowLightSources.forEach(e=>e.forceShadowUpdate()),this.needsUpdate=!0}getShadowLightSources(){return this._shadowLightSources.map(e=>e.getShadowLight())}findShadowLightSource(e){var t;return null===(t=this._shadowLightSources.find(t=>t.getOriginalLight()===e))||void 0===t?void 0:t.getShadowLight()}addRectAreaLight(e,t){const n=new ul(e,{shadowMapSize:this._shadowMapSize,shadowLightSourceType:this.parameters.shadowLightSourceType});this._shadowLightSources.push(n),n.addTo(t),n.updatePositionAndTarget(),this.needsUpdate=!0}updateRectAreaLights(e,t){this._shadowLightSources=this._shadowLightSources.filter(n=>{if(n instanceof ul){const t=n.getRectAreaLight();if(e.includes(t))return n.updatePositionAndTarget(),!0}return n.removeFrom(t),n.dispose(),!1}),e.forEach(e=>{this._shadowLightSources.find(t=>t instanceof ul&&t.getRectAreaLight()===e)||this.addRectAreaLight(e,t)}),this.needsUpdate=!0,this.shadowTypeNeedsUpdate=!0}createShadowFromLightSources(e,t){this._shadowLightSources=this._shadowLightSources.filter(t=>{t.removeFrom(e),t.dispose()});const n=1/(t.length>0?Math.max(...t.map(e=>e.maxIntensity)):1);this._addShadowFromLightSources(t,n),this._shadowLightSources.forEach(t=>{t.addTo(e),t.updatePositionAndTarget()}),this.needsUpdate=!0,this.shadowTypeNeedsUpdate=!0}_addShadowFromLightSources(e,t){e.forEach(e=>{const n=e.maxIntensity*t;if(n>=.1&&e.position.z>=0){const t=new s(e.position.x,e.position.z,e.position.y).multiplyScalar(7),r=new pl(t,n,{shadowMapSize:this._shadowMapSize,shadowLightSourceType:this.parameters.shadowLightSourceType});this._shadowLightSources.push(r)}})}setSize(e,t){this._viewportSize=new i(e,t),this._shadowRenderTarget.setSize(this._viewportSize.x,this._viewportSize.y)}updatePositionAndTarget(){this._shadowLightSources.forEach(e=>e.updatePositionAndTarget())}renderShadowMap(e,t,n){if(!(this.needsUpdate||this.parameters.alwaysUpdate||this._cameraUpdate.changed(n)))return;this.needsUpdate=!1,this.shadowTypeNeedsUpdate&&(this.shadowTypeNeedsUpdate=!1,this.needsUpdate=!0,this._updateShadowType(e));const r=t.background,a=t.environment,i=n.layers.mask;t.environment=null,t.background=null,this.parameters.layers&&(n.layers.mask=this.parameters.layers.mask),this._renderSimpleShadowMapFromShadowLightSources(e,t,n),n.layers.mask=i,t.environment=a,t.background=r}_renderSimpleShadowMapFromShadowLightSources(e,t,n){this._shadowMapPassOverrideMaterialCache.setShadowParameters(this.parameters.directionalDependency,this.parameters.directionalExponent,this.parameters.groundContainment,this.parameters.fadeOutDistance*this._shadowScale,this.parameters.fadeOutBlur);const r=this._getSortedShadowLightSources();0===r.length?this._renderPass.clear(e,this._shadowRenderTarget,16777215,1):(this._setShadowLightSourcesIntensity(r),this._renderCacheManager.render(this,t,()=>{this._renderPass.render(e,t,n,this._shadowRenderTarget,16777215,1)}),this._shadowLightSources.forEach(e=>e.finishRenderShadow()))}_getSortedShadowLightSources(){let e=[];return this._shadowLightSources.forEach(t=>e.push(...t.prepareRenderShadow())),e.sort((e,t)=>e.light.castShadow&&!t.light.castShadow?-1:!e.light.castShadow&&t.light.castShadow?1:t.intensity-e.intensity),e}_setShadowLightSourcesIntensity(e){var t;let n=0;for(let t=0;t<e.length;t++){const r=e[t];(this.parameters.maximumNumberOfLightSources<0||t<this.parameters.maximumNumberOfLightSources)&&(n+=r.intensity)}for(let r=0;r<e.length;r++){const a=e[r];this.parameters.maximumNumberOfLightSources<0||r<this.parameters.maximumNumberOfLightSources?(a.light.visible=!0,a.light.intensity=a.intensity/n,(t=a.light).castShadow&&(t.castShadow=this.castShadow)):(a.light.visible=!1,a.light.intensity=0,a.light.castShadow=!1)}}_updateShadowType(e){e.shadowMap.type=this.shadowConfiguration.currentConfiguration.type;const t=this.parameters.enableShadowMap&&this.shadowConfiguration.currentConfiguration.castShadow;e.shadowMap.enabled=t,e.shadowMap.needsUpdate=!0,this.castShadow=t&&this.shadowConfiguration.currentConfiguration.castShadow,this._shadowLightSources.forEach(e=>e._updateShadowType(this.shadowConfiguration.currentConfiguration,this._shadowScale))}switchType(e){return!!this.shadowConfiguration.switchType(e)&&(this.needsUpdate=!0,this.shadowTypeNeedsUpdate=!0,!0)}}var ll;!function(e){e[e.Default=0]="Default",e[e.Unlit=1]="Unlit",e[e.Emissive=2]="Emissive",e[e.Shadow=3]="Shadow"}(ll||(ll={}));class hl{constructor(e){var t,n;this._sceneBoxMin=new s(-1,-1,-1),this._sceneBoxMax=new s(1,1,1),this._distributionProperties=new pt(1,1,1,0),this._objectCache=new Map,this._shadowFadeOut=new i(null!==(t=null==e?void 0:e.fadeOutTo)&&void 0!==t?t:.5,null!==(n=null==e?void 0:e.fadeOutBlur)&&void 0!==n?n:60),this._shadowObjectMaterial=this._createShadowMaterial(ll.Default),this._unlitMaterial=this._createShadowMaterial(ll.Unlit),this._emissiveMaterial=this._createShadowMaterial(ll.Emissive),this._receiveShadowMaterial=this._createShadowMaterial(ll.Shadow)}dispose(){this._shadowObjectMaterial.dispose(),this._unlitMaterial.dispose(),this._emissiveMaterial.dispose(),this._receiveShadowMaterial.dispose()}setShadowParameters(e,t,n,r,a){this._distributionProperties.set(e,t,n,0),this._shadowFadeOut.set(r,a)}setBoundingBox(e){this._sceneBoxMin.copy(e.min),this._sceneBoxMax.copy(e.max)}_createShadowMaterial(e){let t;return t=e===ll.Emissive||e===ll.Unlit?new C({color:16777215,side:j}):e===ll.Shadow?new Dt({side:j}):hl.useModifiedMaterial?this._createCustomerShadowMaterial():new Ot({color:16777215,shininess:0,polygonOffsetFactor:0,polygonOffsetUnits:0,side:j}),t}_createCustomerShadowMaterial(){const e=new Lt({side:j});return e.onBeforeCompile=e=>{e.vertexShader="\n#define LAMBERT\n\nvarying vec3 vViewPosition;\nvarying vec3 vWorldPosition;\n\n#include <common>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n\nvoid main() {\n #include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\n\tvViewPosition = - mvPosition.xyz;\n\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\n vWorldPosition = worldPosition.xyz;\n}\n",e.fragmentShader="\n#define LAMBERT\n\nuniform vec3 diffuse;\nuniform float opacity;\n\nvarying vec3 vViewPosition;\nvarying vec3 vWorldPosition;\n\n#ifdef DYNAMIC_SHADOW_RADIUS\n uniform vec2 shadowFadeOut;\n uniform vec3 sceneBoxMin;\n uniform vec3 sceneBoxMax;\n#endif\nuniform vec4 distributionProperties;\n\n#include <common>\n#include <packing>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\n\nvec2 getShadowDynamicScale() {\n\n vec2 dynamicScale = vec2(0.0, 1.0);\n\n#ifdef DYNAMIC_SHADOW_RADIUS\n if (shadowFadeOut.x > 0.0) {\n vec3 boxDistanceVec = max(vec3(0.0), max(sceneBoxMin - vWorldPosition, vWorldPosition - sceneBoxMax));\n float boxDistance = length(boxDistanceVec);\n \n // linear interpolation gives better result than smooth Hermite interpolation\n // float shadowBase = smoothstep(0.0, shadowFadeOut.x, boxDistance);\n float shadowBase = boxDistance / shadowFadeOut.x;\n\n shadowBase = clamp(shadowBase, 0.0, 1.0);\n dynamicScale = vec2(shadowBase, 1.0 - shadowBase);\n }\n#endif\n\n return dynamicScale;\n}\n\nfloat getShadowDynamicRadius(sampler2D shadowMap, float shadowBias, float shadowRadius, vec4 shadowCoord, vec2 shadowScale) {\n\n float dynamicRadius = shadowRadius;\n\n#ifdef DYNAMIC_SHADOW_RADIUS\n shadowCoord.xyz /= shadowCoord.w;\n shadowCoord.z += shadowBias;\n\n bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n bool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n if (frustumTest && shadowFadeOut.x > 0.0) {\n float shadowDepth = unpackRGBAToDepth(texture2D(shadowMap, shadowCoord.xy));\n float delta = shadowDepth - shadowCoord.z;\n float fadeOutScale = max(shadowScale.x, smoothstep(max(shadowDepth, 0.5), shadowFadeOut.x * 0.5 + 0.5, shadowCoord.z));\n dynamicRadius = shadowRadius + shadowFadeOut.y * max(0.0, fadeOutScale);\n }\n#endif\n\n return dynamicRadius;\n}\n\nvoid main() {\n\n\t#include <clipping_planes_fragment>\n\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t\n\t#include <logdepthbuf_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\n\t// accumulation\n\n\tvec3 geometryPosition = - vViewPosition;\n \n // add in three.js 157\n //vec3 geometryNormal = normal;\n\n vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n // remeove in three.js 157\n GeometricContext geometry;\n geometry.position = - vViewPosition;\n geometry.normal = normal;\n geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n\n IncidentLight directLight;\n\n vec3 accumulatedShadowLight = vec3(0.0);\n vec3 directionDependentShadowLight = vec3(1.0);\n float groundDistance = clamp((vWorldPosition.y - sceneBoxMin.y) * 100.0, 0.0, 1.0);\n float groundContainment = mix(1.0, groundDistance, distributionProperties.z);\n vec2 dynamicScale = getShadowDynamicScale();\n #if ( NUM_DIR_LIGHTS > 0 )\n\n DirectionalLight directionalLight;\n #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n DirectionalLightShadow directionalLightShadow;\n #endif\n\n float dynamicRadius;\n vec3 incidentLightSum = vec3(0.0);\n vec3 incidentShadowLight = vec3(0.0);\n float shadowFactor;\n float dotNL;\n float incidentLightFactor;\n\n #pragma unroll_loop_start\n for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\n directionalLight = directionalLights[ i ];\n\n // change for three.js 157\n //getDirectionalLightInfo( directionalLight, directLight );\n getDirectionalLightInfo( directionalLight, geometry, directLight );\n\n dotNL = dot(dot(geometryNormal, geometryPosition) >= 0.0 ? -geometryNormal : geometryNormal, directLight.direction);\n incidentLightFactor = clamp(dotNL, 0.0, 1.0);\n\n dynamicRadius = 0.0;\n shadowFactor = 1.0;\n #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n directionalLightShadow = directionalLightShadows[ i ];\n dynamicRadius = getShadowDynamicRadius(directionalShadowMap[i], directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[i], dynamicScale);\n shadowFactor = ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, dynamicRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n #endif\n\n accumulatedShadowLight += directLight.color * shadowFactor * saturate(min(dotNL * 10.0 + 0.9, 1.0));\n incidentLightFactor = mix(\n mix(pow(incidentLightFactor, 4.0), 1.0, step(0.99, shadowFactor)),\n pow(incidentLightFactor, distributionProperties.y),\n groundContainment);\n incidentLightSum += directLight.color * mix(incidentLightFactor, 1.0, groundContainment);\n incidentShadowLight += directLight.color * mix(\n shadowFactor * incidentLightFactor, \n mix(1.0, shadowFactor, incidentLightFactor), \n groundContainment);\n }\n #pragma unroll_loop_end\n\n if (dot(incidentLightSum, vec3(1.0)) > 0.01) {\n directionDependentShadowLight = incidentShadowLight / incidentLightSum;\n }\n #else\n accumulatedShadowLight = vec3(1.0);\n #endif \n\n\t// modulation\n\n\tvec3 outgoingLight = mix(accumulatedShadowLight, directionDependentShadowLight, max(distributionProperties.x, 1.0 - groundDistance));\n outgoingLight = dynamicScale.x + directionDependentShadowLight.y * outgoingLight;\n\n\t#include <opaque_fragment>\n\t#include <premultiplied_alpha_fragment>\n}\n",e.defines=Object.assign({...e.defines,DYNAMIC_SHADOW_RADIUS:""});const t=e.uniforms;t&&(t.distributionProperties={value:this._distributionProperties},t.shadowFadeOut={value:this._shadowFadeOut},t.sceneBoxMin={value:this._sceneBoxMin},t.sceneBoxMax={value:this._sceneBoxMax})},e}clear(){this._objectCache.clear()}addLineOrPoint(e){this._addCacheEntry(e,!1,!1)}addMesh(e){e.visible&&this._setMeshMaterialAndVisibility(e)}addObject(e){e.isLight&&!e.userData.shadowLightSource&&this._addCacheEntry(e,!1,!1)}_addCacheEntry(e,t,n,r){this._objectCache.set(e,{originalObject:{visible:e.visible,castShadow:e.castShadow,material:e.material},shadowObject:{visible:t,castShadow:n,material:r}})}onBeforeRender(){this._objectCache.forEach((e,t)=>{t.visible=e.shadowObject.visible,t.castShadow=e.shadowObject.castShadow,t instanceof K&&e.shadowObject.material&&(t.material=e.shadowObject.material)})}onAfterRender(){this._objectCache.forEach((e,t)=>{t.visible=e.originalObject.visible,t.castShadow=e.originalObject.castShadow,e.originalObject.material&&(t.material=e.originalObject.material)})}_setMeshMaterialAndVisibility(e){!e.material||!e.receiveShadow||Array.isArray(e.material)||!0===e.material.transparent&&e.material.opacity<.9?e.userData.isFloor?this._addCacheEntry(e,e.visible,e.castShadow,this._shadowObjectMaterial):e.material&&e.material.transparent&&e.material.opacity<.9?this._addCacheEntry(e,!1,e.castShadow,this._shadowObjectMaterial):e.receiveShadow?this._addCacheEntry(e,e.visible,!1,this._receiveShadowMaterial):this._addCacheEntry(e,!1,e.castShadow,e.material):this._setShadowMaterialForOpaqueObject(e)}_setShadowMaterialForOpaqueObject(e){const t=e.material;t instanceof z||t instanceof C?this._addCacheEntry(e,e.visible,e.castShadow,this._unlitMaterial):t instanceof H?this._setMeshShadowStandardMaterial(e,t):this._addCacheEntry(e,e.visible,e.castShadow,e.receiveShadow?this._shadowObjectMaterial:this._unlitMaterial)}_setMeshShadowStandardMaterial(e,t){const n=t.emissiveIntensity>0&&(t.emissive.r>0||t.emissive.g>0||t.emissive.b>0);this._addCacheEntry(e,e.visible,!n&&e.castShadow,n?this._emissiveMaterial:e.receiveShadow?this._shadowObjectMaterial:this._unlitMaterial)}}hl.useModifiedMaterial=!0;class dl{constructor(){var e;this.types=new Map([["off",dl._noShadow],["BasicShadowMap",dl._basicShadow],["PCFShadowMap",dl._pcfShadow],["PCFSoftShadowMap",dl._pcfSoftShadow],["VSMShadowMap",dl._vcmShadow]]),this.shadowType="PCFShadowMap",this.currentConfiguration=null!==(e=this.types.get(this.shadowType))&&void 0!==e?e:dl._defaultType}switchType(e){var t;return!!this.types.has(e)&&(this.currentConfiguration=null!==(t=this.types.get(e))&&void 0!==t?t:dl._defaultType,!0)}}dl._noShadow={castShadow:!1,type:Ut,bias:0,normalBias:0,radius:0},dl._basicShadow={castShadow:!0,type:Ft,bias:-5e-5,normalBias:.005,radius:0},dl._pcfShadow={castShadow:!0,type:Ut,bias:-5e-5,normalBias:.01,radius:4},dl._pcfSoftShadow={castShadow:!0,type:Nt,bias:-5e-5,normalBias:.01,radius:1},dl._vcmShadow={castShadow:!0,type:Bt,bias:1e-4,normalBias:0,radius:15},dl._defaultType=dl._pcfShadow;class cl{constructor(e,t){var n,r;this._isVisibleBackup=!0,this._castShadowBackup=!0,this._shadowMapSize=null!==(n=null==t?void 0:t.shadowMapSize)&&void 0!==n?n:1024,this._blurSamples=null!==(r=null==t?void 0:t._blurSamples)&&void 0!==r?r:8,this._shadowLightSource=e,this._shadowLightSource.visible=!1,this._shadowLightSource.castShadow=!0,this._shadowLightSource.shadow&&(this._shadowLightSource.shadow.mapSize=new i(this._shadowMapSize,this._shadowMapSize),this._shadowLightSource.shadow.blurSamples=this._blurSamples,this._shadowLightSource.shadow.autoUpdate=!1),this._shadowLightSource.userData.shadowLightSource=this}getPosition(){return this._shadowLightSource.position}getShadowLight(){return this._shadowLightSource}getOriginalLight(){return null}dispose(){this._shadowLightSource.dispose()}addTo(e){e.add(this._shadowLightSource)}removeFrom(e){e.remove(this._shadowLightSource)}updatePositionAndTarget(){this._updateShadowPositionAndTarget(this.getPosition(),new s(0,0,0))}updateBounds(e){if(this._shadowLightSource instanceof l){const t=this._shadowLightSource.shadow.camera,n=e.bounds.clone().applyMatrix4(t.matrixWorldInverse),r=Math.max(.001,Math.min(-n.min.z,-n.max.z)),a=Math.max(-n.min.z,-n.max.z),i=Math.max(Math.abs(n.min.x),Math.abs(n.max.x)),s=Math.max(Math.abs(n.min.y),Math.abs(n.max.y)),o=Math.atan2(1.05*Math.hypot(s,i),r);t.aspect=1,t.near=r,t.far=a,this._shadowLightSource.angle=o}else if(this._shadowLightSource.shadow){const t=this._shadowLightSource.shadow.camera;e.updateCameraViewVolumeFromBounds(t);const n=t;n.far+=n.far-n.near,n.updateProjectionMatrix()}this._shadowLightSource.shadow&&(this._shadowLightSource.shadow.needsUpdate=!0)}forceShadowUpdate(){this._shadowLightSource.shadow&&(this._shadowLightSource.shadow.needsUpdate=!0)}_updateShadowPositionAndTarget(e,t){var n,r,a;if(this._shadowLightSource instanceof l){const n=t.clone().sub(e),r=n.length();n.normalize();const a=t.clone().sub(n.clone().multiplyScalar(4*r));this._shadowLightSource.shadow.camera.position.copy(a),this._shadowLightSource.shadow.camera.position.copy(a),this._shadowLightSource.shadow.camera.lookAt(t),this._shadowLightSource.position.copy(a),this._shadowLightSource.lookAt(t)}else this._shadowLightSource.position.copy(e),this._shadowLightSource.lookAt(t),null===(n=this._shadowLightSource.shadow)||void 0===n||n.camera.position.copy(e),null===(r=this._shadowLightSource.shadow)||void 0===r||r.camera.lookAt(t);null===(a=this._shadowLightSource.shadow)||void 0===a||a.camera.updateMatrixWorld(),this._shadowLightSource.updateMatrixWorld()}_updateShadowType(e,t){const n=this._shadowLightSource.shadow;n&&(n.bias=e.bias,n.normalBias=e.normalBias*t,n.radius=e.radius,n.needsUpdate=!0)}prepareRenderShadow(){return[]}finishRenderShadow(){}}class ul extends cl{constructor(e,t){let n;switch(null==t?void 0:t.shadowLightSourceType){default:case al.DirectionalLightShadow:n=new a(16777215,1);break;case al.SpotLightShadow:n=new l(16777215,1,0,Math.PI/4,0)}n.position.copy(e.position),n.lookAt(0,0,0),super(n,t),this._rectAreaLight=e,this._rectAreaLight.userData.shadowLightSource=this,(null==t?void 0:t.addHelper)&&(this._rectLightHelper=new il(this._rectAreaLight),this._rectLightHelper.material.depthWrite=!1,this._rectAreaLight.add(this._rectLightHelper))}getPosition(){return this._rectAreaLight.position}getRectAreaLight(){return this._rectAreaLight}getOriginalLight(){return this._rectAreaLight}prepareRenderShadow(){return this._isVisibleBackup=this._rectAreaLight.visible,this._castShadowBackup=this._shadowLightSource.castShadow,this._shadowLightSource.visible=this._rectAreaLight.visible,this._rectAreaLight.visible=!1,this._shadowLightSource.visible?[{light:this._shadowLightSource,intensity:this._rectAreaLight.intensity}]:[]}finishRenderShadow(){this._shadowLightSource.visible=!1,this._shadowLightSource.castShadow=this._castShadowBackup,this._rectAreaLight.visible=this._isVisibleBackup}}class pl extends cl{constructor(e,t,n){const r=new a(16777215,t);r.position.copy(e),r.lookAt(0,0,0),r.updateMatrix(),r.castShadow=!0,super(r,n),this._position=e.clone(),this._intensity=t}getPosition(){return this._position}prepareRenderShadow(){return this._castShadowBackup=this._shadowLightSource.castShadow,this._shadowLightSource.visible=!0,[{light:this._shadowLightSource,intensity:this._intensity}]}finishRenderShadow(){this._shadowLightSource.castShadow=this._castShadowBackup,this._shadowLightSource.visible=!1}}var ml,fl,gl=new zt,vl=null,_l=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Pass",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Ee,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:gl;_(this,e),this.name=t,this.renderer=null,this.scene=n,this.camera=r,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}return w(e,[{key:"renderToScreen",get:function(){return!this.rtt},set:function(e){if(this.rtt===e){var t=this.fullscreenMaterial;null!==t&&(t.needsUpdate=!0),this.rtt=!e}}},{key:"mainScene",set:function(e){}},{key:"mainCamera",set:function(e){}},{key:"setRenderer",value:function(e){this.renderer=e}},{key:"isEnabled",value:function(){return this.enabled}},{key:"setEnabled",value:function(e){this.enabled=e}},{key:"fullscreenMaterial",get:function(){return null!==this.screen?this.screen.material:null},set:function(e){var t=this.screen;null!==t?t.material=e:((t=new K(function(){if(null===vl){var e=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),t=new Float32Array([0,0,2,0,0,2]);void 0!==(vl=new c).setAttribute?(vl.setAttribute("position",new u(e,3)),vl.setAttribute("uv",new u(t,2))):(vl.addAttribute("position",new u(e,3)),vl.addAttribute("uv",new u(t,2)))}return vl}(),e)).frustumCulled=!1,null===this.scene&&(this.scene=new Ee),this.scene.add(t),this.screen=t)}},{key:"getFullscreenMaterial",value:function(){return this.fullscreenMaterial}},{key:"setFullscreenMaterial",value:function(e){this.fullscreenMaterial=e}},{key:"getDepthTexture",value:function(){return null}},{key:"setDepthTexture",value:function(e){}},{key:"render",value:function(e,t,n,r,a){throw new Error("Render method not implemented!")}},{key:"setSize",value:function(e,t){}},{key:"initialize",value:function(e,t,n){}},{key:"dispose",value:function(){for(var t=0,n=Object.keys(this);t<n.length;t++){var r=n[t],a=this[r];(a instanceof St||a instanceof B||a instanceof fe||a instanceof e)&&this[r].dispose()}}}]),e}(),wl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAEAn0lEQVR4nAABQP6/AK9PaFLUkBn0Tqy6MW0pOIntvEjqjhwGENpf5p1dEROGFH4zADhOoPuuBr+j2Jjt3pNVF7XgJLZLeJJCwPRHoCmeEb/ZZrQDQBjY21ZOOZpt0pT4qAhEM/1FBhWNeIXWoL7HI1UbTcj2+mYSlj8b/MLics4qBcBn+5OKQcj0B9uSF+B+Cj1qtZuLHl4ftZSj1FDKAPPAKdVKNtdzsyKES59WPpYZsr3renDxWNjdFLwgfVzLbJlshwos7kKABRxcl8Xb4xycMsq1fHJlp/tI8Doomr7MXY0fJ+h5M7AeEao1ycdWvWFPvelyjJfJ+8JgGcbUGn9pH23yGgjsJczdRk6KxYYDVIdnaN/uT0aVGeneYX9zUBX4mO9SydmuzJsQ5AmD92f/14mTLKRAeNsXnrOBw9foN0wbTdYpQyVjP645n7kNnL0T0xk5n0YygsV2sg89BAuO/4aUIymjIc9eTMg4OMcAgPY+udpGmpZUeHSueJ4Mgsqr4Sat3lGeOAT2kNRdZOYdoq6qpiVyATPjNuLjp1tasAAUGOxCrWssciI8kRzAUsI5jgk2VdFdAmoJQpeTZ3VFIEbMM/ocNKmjzrcGFVEUUXq4imNBXuPl5sV7dSSQ7/5ygijYFMByAGo61DXfiz1rhAm+h+6oFgwY4EyxZn6yf/YA7EPHpJ8CcMUbAHLqTK7yPHuPEGXZGbvVh8iq6J+zCoRhScOmdCmd7ZXla77yaPPbIlMAcj2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fvobVqnrTQuDXsApbvGhUUsK6oiRBnvqrU4OAmAh2hdcCSNLMv2QUACNKgDMgb1Y1mZb9qXZAmq6PXlgyyuSOJm2/BOHe4Wa/XQyYkyZugZm+Uvthe8mpfyT3Xi1H8Ku45lS2kH4b+LVjCQLe1eLBvS7gL9qDyYEo9Z55Qbz4m3xzNk65Vh8BgixsVvAXIAjf/5Jm2TotaDL+pHDM5pn1r0UuTZ24N8S5k68bLHW9tfD+2k4zGev23ExJb4YTRKWrj82N5LjJ26lj1BkGZ0CsXLGGELoPaYQomjTqPxYqhfwOwDliNGVqux9ffuybqOKgsbB51B1GbZfG8vHDBE2JQGib0C8YdyPG2epwAAAABJRU5ErkJggg==",bl="#define GLSLIFY 1\nvarying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",yl="#define GLSLIFY 1\nconst float g=1.6180339887498948482;const float a1=1.0/g;float r1(float n){return fract(1.1127756842787055+a1*n);}const vec4 hn=vec4(0.618033988749895,0.3247179572447458,0.2207440846057596,0.1673039782614187);vec4 sampleBlueNoise(sampler2D texture,int seed,vec2 repeat,vec2 texSize){vec2 size=vUv*texSize;vec2 blueNoiseSize=texSize/repeat;float blueNoiseIndex=floor(floor(size.y/blueNoiseSize.y)*repeat.x)+floor(size.x/blueNoiseSize.x);vec2 blueNoiseUv=vUv*repeat;vec4 blueNoise=textureLod(texture,blueNoiseUv,0.);if(seed!=0){blueNoise=fract(blueNoise+hn*float(seed));blueNoise.r=(blueNoise.r>0.5 ? 1.0-blueNoise.r : blueNoise.r)*2.0;blueNoise.g=(blueNoise.g>0.5 ? 1.0-blueNoise.g : blueNoise.g)*2.0;blueNoise.b=(blueNoise.b>0.5 ? 1.0-blueNoise.b : blueNoise.b)*2.0;blueNoise.a=(blueNoise.a>0.5 ? 1.0-blueNoise.a : blueNoise.a)*2.0;}return blueNoise;}",xl=function(e){g(n,e);var t=v(n);function n(e,r,a){var s;_(this,n),(s=t.call(this))._camera=e,s._scene=r,s.renderTarget=new St(1,1,{type:st,depthBuffer:!1});var o=a.replace("#include <sampleBlueNoise>",yl);return s.fullscreenMaterial=new ft({fragmentShader:o,vertexShader:bl,uniforms:{depthTexture:{value:null},normalTexture:{value:null},cameraNear:{value:0},cameraFar:{value:0},viewMatrix:{value:s._camera.matrixWorldInverse},projectionViewMatrix:{value:new P},projectionMatrixInverse:{value:s._camera.projectionMatrixInverse},cameraMatrixWorld:{value:s._camera.matrixWorld},texSize:{value:new i},blueNoiseTexture:{value:null},blueNoiseRepeat:{value:new i},aoDistance:{value:0},distancePower:{value:0},bias:{value:0},thickness:{value:0},power:{value:0},frame:{value:0}},blending:vt,depthWrite:!1,depthTest:!1,toneMapped:!1}),(new ue).load(wl,(function(e){e.minFilter=ae,e.magFilter=ae,e.wrapS=F,e.wrapT=F,e.colorSpace=dt,s.fullscreenMaterial.uniforms.blueNoiseTexture.value=e})),s}return w(n,[{key:"texture",get:function(){return this.renderTarget.texture}},{key:"setSize",value:function(e,t){this.renderTarget.setSize(e,t),this.fullscreenMaterial.uniforms.texSize.value.set(this.renderTarget.width,this.renderTarget.height)}},{key:"render",value:function(e){var t=+this.fullscreenMaterial.defines.spp;this.fullscreenMaterial.uniforms.frame.value=(this.fullscreenMaterial.uniforms.frame.value+t)%65536,this.fullscreenMaterial.uniforms.cameraNear.value=this._camera.near,this.fullscreenMaterial.uniforms.cameraFar.value=this._camera.far,this.fullscreenMaterial.uniforms.projectionViewMatrix.value.multiplyMatrices(this._camera.projectionMatrix,this._camera.matrixWorldInverse);var n=this.fullscreenMaterial.uniforms.blueNoiseTexture.value;if(n){var r=n.source.data,a=r.width,i=r.height;this.fullscreenMaterial.uniforms.blueNoiseRepeat.value.set(this.renderTarget.width/a,this.renderTarget.height/i)}e.setRenderTarget(this.renderTarget),e.render(this.scene,this.camera)}}]),n}(_l),Sl=function(e){g(n,e);var t=v(n);function n(e,r){return _(this,n),t.call(this,e,r,"#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D depthTexture;uniform sampler2D normalTexture;uniform mat4 projectionViewMatrix;uniform mat4 cameraMatrixWorld;uniform sampler2D blueNoiseTexture;uniform vec2 blueNoiseRepeat;uniform vec2 texSize;uniform mat4 projectionMatrixInverse;uniform float aoDistance;uniform float distancePower;uniform float cameraNear;uniform float cameraFar;uniform int frame;uniform vec3[spp]samples;uniform float[spp]samplesR;\n#include <common>\n#include <packing>\n#include <sampleBlueNoise>\nvec3 getWorldPos(const float depth,const vec2 coord){float z=depth*2.0-1.0;vec4 clipSpacePosition=vec4(coord*2.0-1.0,z,1.0);vec4 viewSpacePosition=projectionMatrixInverse*clipSpacePosition;vec4 worldSpacePosition=cameraMatrixWorld*viewSpacePosition;worldSpacePosition.xyz/=worldSpacePosition.w;return worldSpacePosition.xyz;}vec3 computeNormal(vec3 worldPos,vec2 vUv){vec2 size=vec2(textureSize(depthTexture,0));ivec2 p=ivec2(vUv*size);float c0=texelFetch(depthTexture,p,0).x;float l2=texelFetch(depthTexture,p-ivec2(2,0),0).x;float l1=texelFetch(depthTexture,p-ivec2(1,0),0).x;float r1=texelFetch(depthTexture,p+ivec2(1,0),0).x;float r2=texelFetch(depthTexture,p+ivec2(2,0),0).x;float b2=texelFetch(depthTexture,p-ivec2(0,2),0).x;float b1=texelFetch(depthTexture,p-ivec2(0,1),0).x;float t1=texelFetch(depthTexture,p+ivec2(0,1),0).x;float t2=texelFetch(depthTexture,p+ivec2(0,2),0).x;float dl=abs((2.0*l1-l2)-c0);float dr=abs((2.0*r1-r2)-c0);float db=abs((2.0*b1-b2)-c0);float dt=abs((2.0*t1-t2)-c0);vec3 ce=getWorldPos(c0,vUv).xyz;vec3 dpdx=(dl<dr)? ce-getWorldPos(l1,(vUv-vec2(1.0/size.x,0.0))).xyz:-ce+getWorldPos(r1,(vUv+vec2(1.0/size.x,0.0))).xyz;vec3 dpdy=(db<dt)? ce-getWorldPos(b1,(vUv-vec2(0.0,1.0/size.y))).xyz:-ce+getWorldPos(t1,(vUv+vec2(0.0,1.0/size.y))).xyz;return normalize(cross(dpdx,dpdy));}highp float linearize_depth(highp float d,highp float zNear,highp float zFar){highp float z_n=2.0*d-1.0;return 2.0*zNear*zFar/(zFar+zNear-z_n*(zFar-zNear));}void main(){\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat depth=textureLod(depthTexture,vUv,0.).a;\n#else\nfloat depth=textureLod(depthTexture,vUv,0.).x;\n#endif\nif(depth==1.0){discard;return;}vec3 worldPos=getWorldPos(depth,vUv);\n#if NormalVectorSourceType == FLOAT_BUFFER_NORMAL\nvec3 normal=normalize(textureLod(normalTexture,vUv,0.).rgb);\n#else\nvec3 normal=computeNormal(worldPos,vUv);\n#endif\n#ifdef animatedNoise\nint seed=frame;\n#else\nint seed=0;\n#endif\nvec4 noise=sampleBlueNoise(blueNoiseTexture,seed,blueNoiseRepeat,texSize);vec3 randomVec=normalize(noise.rgb*2.0-1.0);vec3 tangent=normalize(randomVec-normal*dot(randomVec,normal));vec3 bitangent=cross(normal,tangent);mat3 tbn=mat3(tangent,bitangent,normal);float occluded=0.0;float totalWeight=0.0;vec3 samplePos;float sppF=float(spp);for(float i=0.0;i<sppF;i++){vec3 sampleDirection=tbn*samples[int(i)];if(dot(sampleDirection,normal)<0.0)sampleDirection*=-1.0;float moveAmt=samplesR[int(mod(i+noise.a*sppF,sppF))];samplePos=worldPos+aoDistance*moveAmt*sampleDirection;vec4 offset=projectionViewMatrix*vec4(samplePos,1.0);offset.xyz/=offset.w;offset.xyz=offset.xyz*0.5+0.5;\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat sampleDepth=textureLod(depthTexture,offset.xy,0.0).a;\n#else\nfloat sampleDepth=textureLod(depthTexture,offset.xy,0.0).x;\n#endif\nfloat distSample=linearize_depth(sampleDepth,cameraNear,cameraFar);float distWorld=linearize_depth(offset.z,cameraNear,cameraFar);float rangeCheck=smoothstep(0.0,1.0,aoDistance/(aoDistance*abs(distSample-distWorld)));rangeCheck=pow(rangeCheck,distancePower);float weight=dot(sampleDirection,normal);occluded+=rangeCheck*weight*(distSample<distWorld ? 1.0 : 0.0);totalWeight+=weight;}float occ=clamp(1.0-occluded/totalWeight,0.0,1.0);\n#ifdef MODULATE_RED_CHANNEL\ngl_FragColor=vec4(occ,1.0,1.0,1.0);\n#else\ngl_FragColor=vec4(normal,occ);\n#endif\n}")}return w(n)}(xl),Cl="#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D depthTexture;uniform mat4 projectionViewMatrix;uniform int frame;uniform sampler2D blueNoiseTexture;uniform vec2 blueNoiseRepeat;uniform vec2 texSize;uniform float aoDistance;uniform float distancePower;uniform float bias;uniform float thickness;\n#include <packing>\n#include <hbao_utils>\nfloat getOcclusion(const vec3 cameraPosition,const vec3 worldPos,const vec3 worldNormal,const float depth,const int seed,inout float totalWeight){vec4 blueNoise=sampleBlueNoise(blueNoiseTexture,seed,blueNoiseRepeat,texSize);vec3 sampleWorldDir=cosineSampleHemisphere(worldNormal,blueNoise.rg);vec3 sampleWorldPos=worldPos+aoDistance*pow(blueNoise.b,distancePower+1.0)*sampleWorldDir;vec4 sampleUv=projectionViewMatrix*vec4(sampleWorldPos,1.);sampleUv.xy/=sampleUv.w;sampleUv.xy=sampleUv.xy*0.5+0.5;\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat sampleDepth=textureLod(depthTexture,sampleUv.xy,0.0).a;\n#else\nfloat sampleDepth=textureLod(depthTexture,sampleUv.xy,0.0).r;\n#endif\nfloat deltaDepth=depth-sampleDepth;float d=distance(sampleWorldPos,cameraPosition);deltaDepth*=0.001*d*d;float th=thickness*0.01;float theta=dot(worldNormal,sampleWorldDir);totalWeight+=theta;if(deltaDepth<th){float horizon=sampleDepth+deltaDepth*bias*1000.;float occlusion=max(0.0,horizon-depth)*theta;float m=max(0.,1.-deltaDepth/th);occlusion=10.*occlusion*m/d;occlusion=sqrt(occlusion);return occlusion;}return 0.;}void main(){\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat depth=textureLod(depthTexture,vUv,0.0).a;\n#else\nfloat depth=textureLod(depthTexture,vUv,0.0).r;\n#endif\nif(depth==1.0){discard;return;}vec4 cameraPosition=cameraMatrixWorld*vec4(0.0,0.0,0.0,1.0);vec3 worldPos=getWorldPos(depth,vUv);vec3 worldNormal=getWorldNormal(vUv);float ao=0.0,totalWeight=0.0;for(int i=0;i<spp;i++){int seed=i;\n#ifdef animatedNoise\nseed+=frame;\n#endif\nfloat occlusion=getOcclusion(cameraPosition.xyz,worldPos,worldNormal,depth,seed,totalWeight);ao+=occlusion;}if(totalWeight>0.)ao/=totalWeight;ao=clamp(1.-ao,0.,1.);\n#ifdef MODULATE_RED_CHANNEL\ngl_FragColor=vec4(ao,1.0,1.0,1.0);\n#else\ngl_FragColor=vec4(worldNormal,ao);\n#endif\n}".replace("#include <hbao_utils>","#define GLSLIFY 1\n#include <sampleBlueNoise>\nuniform sampler2D normalTexture;uniform float cameraNear;uniform float cameraFar;uniform mat4 projectionMatrixInverse;uniform mat4 cameraMatrixWorld;float getViewZ(const float depth){\n#ifdef PERSPECTIVE_CAMERA\nreturn perspectiveDepthToViewZ(depth,cameraNear,cameraFar);\n#else\nreturn orthographicDepthToViewZ(depth,cameraNear,cameraFar);\n#endif\n}vec3 getWorldPos(const float depth,const vec2 coord){float z=depth*2.0-1.0;vec4 clipSpacePosition=vec4(coord*2.0-1.0,z,1.0);vec4 viewSpacePosition=projectionMatrixInverse*clipSpacePosition;vec4 worldSpacePosition=cameraMatrixWorld*viewSpacePosition;worldSpacePosition.xyz/=worldSpacePosition.w;return worldSpacePosition.xyz;}vec3 slerp(const vec3 a,const vec3 b,const float t){float cosAngle=dot(a,b);float angle=acos(cosAngle);if(abs(angle)<0.001){return mix(a,b,t);}float sinAngle=sin(angle);float t1=sin((1.0-t)*angle)/sinAngle;float t2=sin(t*angle)/sinAngle;return(a*t1)+(b*t2);}vec3 computeWorldNormal(){vec2 size=vec2(textureSize(depthTexture,0));ivec2 p=ivec2(vUv*size);float c0=texelFetch(depthTexture,p,0).x;float l2=texelFetch(depthTexture,p-ivec2(2,0),0).x;float l1=texelFetch(depthTexture,p-ivec2(1,0),0).x;float r1=texelFetch(depthTexture,p+ivec2(1,0),0).x;float r2=texelFetch(depthTexture,p+ivec2(2,0),0).x;float b2=texelFetch(depthTexture,p-ivec2(0,2),0).x;float b1=texelFetch(depthTexture,p-ivec2(0,1),0).x;float t1=texelFetch(depthTexture,p+ivec2(0,1),0).x;float t2=texelFetch(depthTexture,p+ivec2(0,2),0).x;float dl=abs((2.0*l1-l2)-c0);float dr=abs((2.0*r1-r2)-c0);float db=abs((2.0*b1-b2)-c0);float dt=abs((2.0*t1-t2)-c0);vec3 ce=getWorldPos(c0,vUv).xyz;vec3 dpdx=(dl<dr)? ce-getWorldPos(l1,(vUv-vec2(1.0/size.x,0.0))).xyz:-ce+getWorldPos(r1,(vUv+vec2(1.0/size.x,0.0))).xyz;vec3 dpdy=(db<dt)? ce-getWorldPos(b1,(vUv-vec2(0.0,1.0/size.y))).xyz:-ce+getWorldPos(t1,(vUv+vec2(0.0,1.0/size.y))).xyz;return normalize(cross(dpdx,dpdy));}vec3 getWorldNormal(const vec2 uv){\n#ifdef useNormalTexture\n#if NormalVectorSourceType == FLOAT_BUFFER_NORMAL\nvec3 worldNormal=normalize(textureLod(normalTexture,uv,0.).rgb);\n#else\nvec3 worldNormal=unpackRGBToNormal(textureLod(normalTexture,uv,0.).rgb);\n#endif\nworldNormal=(vec4(worldNormal,1.)*viewMatrix).xyz;return normalize(worldNormal);\n#else\nreturn computeWorldNormal();\n#endif\n}\n#define PI 3.14159265358979323846264338327950288\nvec3 cosineSampleHemisphere(const vec3 n,const vec2 u){float r=sqrt(u.x);float theta=2.0*PI*u.y;vec3 b=normalize(cross(n,vec3(0.0,1.0,1.0)));vec3 t=cross(b,n);return normalize(r*sin(theta)*b+sqrt(1.0-u.x)*n+r*cos(theta)*t);}"),Ml=function(e){g(n,e);var t=v(n);function n(e,r){return _(this,n),t.call(this,e,r,Cl)}return w(n)}(xl),Tl="#define GLSLIFY 1\nvarying vec2 vUv;uniform sampler2D inputTexture;uniform sampler2D depthTexture;uniform sampler2D normalTexture;uniform mat4 projectionMatrixInverse;uniform mat4 cameraMatrixWorld;uniform float lumaPhi;uniform float depthPhi;uniform float normalPhi;uniform sampler2D blueNoiseTexture;uniform vec2 blueNoiseRepeat;uniform int index;uniform vec2 resolution;\n#include <common>\n#include <sampleBlueNoise>\nvec3 getWorldPos(float depth,vec2 coord){float z=depth*2.0-1.0;vec4 clipSpacePosition=vec4(coord*2.0-1.0,z,1.0);vec4 viewSpacePosition=projectionMatrixInverse*clipSpacePosition;vec4 worldSpacePosition=cameraMatrixWorld*viewSpacePosition;worldSpacePosition.xyz/=worldSpacePosition.w;return worldSpacePosition.xyz;}\n#ifdef RG_INPUT_TEXTURE\n#define luminance(a) (a.r * a.g)\n#else\n#define luminance(a) dot(vec3(0.2125, 0.7154, 0.0721), a)\n#endif\nvec3 getNormal(vec2 uv,vec4 texel){\n#ifdef NORMAL_IN_RGB\nreturn texel.rgb;\n#elif NormalVectorSourceType == FLOAT_BUFFER_NORMAL\nreturn normalize(textureLod(normalTexture,uv,0.).xyz);\n#elif NormalVectorSourceType == CONSTANT_Z\nreturn vec3(0.0,0.0,1.0);\n#else\nreturn normalize(textureLod(normalTexture,uv,0.).xyz*2.0-1.0);\n#endif\n}float distToPlane(const vec3 worldPos,const vec3 neighborWorldPos,const vec3 worldNormal){vec3 toCurrent=worldPos-neighborWorldPos;float distToPlane=abs(dot(toCurrent,worldNormal));return distToPlane;}void main(){\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nvec4 depthTexel=textureLod(normalTexture,vUv,0.).argb;\n#else\nvec4 depthTexel=textureLod(depthTexture,vUv,0.);\n#endif\nif(depthTexel.r==1.0||dot(depthTexel.rgb,depthTexel.rgb)==0.){discard;return;}vec4 texel=textureLod(inputTexture,vUv,0.0);vec3 normal=getNormal(vUv,texel);\n#ifdef NORMAL_IN_RGB\nfloat denoised=texel.a;float center=texel.a;\n#else\nvec3 denoised=texel.rgb;vec3 center=texel.rgb;\n#endif\nfloat depth=depthTexel.x;vec3 worldPos=getWorldPos(depth,vUv);float totalWeight=1.0;vec4 blueNoise=sampleBlueNoise(blueNoiseTexture,0,blueNoiseRepeat,resolution);float angle=blueNoise[index];float s=sin(angle),c=cos(angle);mat2 rotationMatrix=mat2(c,-s,s,c);for(int i=0;i<samples;i++){vec2 offset=rotationMatrix*poissonDisk[i];vec2 neighborUv=vUv+offset;vec4 neighborTexel=textureLod(inputTexture,neighborUv,0.0);vec3 neighborNormal=getNormal(neighborUv,neighborTexel);\n#ifdef NORMAL_IN_RGB\nfloat neighborColor=neighborTexel.a;\n#else\nvec3 neighborColor=neighborTexel.rgb;\n#endif\n#if DepthValueSourceType == NORMAL_VECTOR_ALPHA\nfloat sampleDepth=textureLod(depthTexture,neighborUv,0.0).a;\n#else\nfloat sampleDepth=textureLod(depthTexture,neighborUv,0.0).x;\n#endif\nvec3 worldPosSample=getWorldPos(sampleDepth,neighborUv);float tangentPlaneDist=abs(dot(worldPos-worldPosSample,normal));float normalDiff=dot(normal,neighborNormal);float normalSimilarity=pow(max(normalDiff,0.),normalPhi);\n#ifdef NORMAL_IN_RGB\nfloat lumaDiff=abs(neighborColor-center);\n#else\nfloat lumaDiff=abs(luminance(neighborColor)-luminance(center));\n#endif\nfloat lumaSimilarity=max(1.0-lumaDiff/lumaPhi,0.0);float depthDiff=1.-distToPlane(worldPos,worldPosSample,normal);float depthSimilarity=max(depthDiff/depthPhi,0.);float w=lumaSimilarity*depthSimilarity*normalSimilarity;denoised+=w*neighborColor;totalWeight+=w;}if(totalWeight>0.)denoised/=totalWeight;\n#ifdef NORMAL_IN_RGB\ngl_FragColor=vec4(normal,denoised);\n#else\ngl_FragColor=vec4(denoised,1.);\n#endif\n}".replace("#include <sampleBlueNoise>",yl),Al={iterations:1,radius:8,rings:5.625,lumaPhi:10,depthPhi:2,normalPhi:3.25,samples:16,normalTexture:null},Pl=function(e){g(n,e);var t=v(n);function n(e,r,a){var s,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Al;_(this,n),s=t.call(this,"PoissionBlurPass"),Ht(jt(s),"iterations",Al.iterations),Ht(jt(s),"index",0),o=Vt(Vt({},Al),o),s.inputTexture=r,s.fullscreenMaterial=new ft({fragmentShader:Tl,vertexShader:bl,uniforms:{depthTexture:{value:null},inputTexture:{value:null},projectionMatrixInverse:{value:new P},cameraMatrixWorld:{value:new P},lumaPhi:{value:5},depthPhi:{value:5},normalPhi:{value:5},resolution:{value:new i},blueNoiseTexture:{value:null},index:{value:0},blueNoiseRepeat:{value:new i}}});var l={type:st,depthBuffer:!1};s.renderTargetA=new St(1,1,l),s.renderTargetB=new St(1,1,l);var h=s.fullscreenMaterial.uniforms;h.inputTexture.value=s.inputTexture,h.depthTexture.value=a,h.projectionMatrixInverse.value=e.projectionMatrixInverse,h.cameraMatrixWorld.value=e.matrixWorld,h.depthPhi.value=o.depthPhi,h.normalPhi.value=o.normalPhi,o.normalTexture?h.normalTexture={value:o.normalTexture}:s.fullscreenMaterial.defines.NORMAL_IN_RGB="";for(var d=function(){var e=u[c];Object.defineProperty(jt(s),e,{get:function(){return o[e]},set:function(t){o[e]=t,s.setSize(s.renderTargetA.width,s.renderTargetA.height)}})},c=0,u=["radius","rings","samples"];c<u.length;c++)d();return(new ue).load(wl,(function(e){e.minFilter=ae,e.magFilter=ae,e.wrapS=F,e.wrapT=F,e.colorSpace=dt,s.fullscreenMaterial.uniforms.blueNoiseTexture.value=e})),s}return w(n,[{key:"setSize",value:function(e,t){this.renderTargetA.setSize(e,t),this.renderTargetB.setSize(e,t),this.fullscreenMaterial.uniforms.resolution.value.set(e,t);var n=function(e,t,n,r){for(var a=2*Math.PI*t/e,s=1/e,o=s,l=[],h=s,d=0,c=0;c<e;c++){var u=new i(Math.cos(d),Math.sin(d)).multiplyScalar(Math.pow(h,.75)).multiply(r).multiplyScalar(n);l.push(u),h+=o,d+=a}return l}(this.samples,this.rings,this.radius,new i(1/e,1/t)),r="const int samples = ".concat(this.samples,";\n"),a=function(e){for(var t=e.length,n="const vec2 poissonDisk[samples] = vec2[samples](\n",r=0;r<t;r++){var a=e[r];n+=" vec2(".concat(a.x,", ").concat(a.y,")"),r<t-1&&(n+=","),n+="\n"}return n+");"}(n);this.fullscreenMaterial.fragmentShader=r+a+"\n"+Tl,this.fullscreenMaterial.needsUpdate=!0}},{key:"texture",get:function(){return this.renderTargetB.texture}},{key:"render",value:function(e){this.fullscreenMaterial.uniforms.index.value=0;var t=this.fullscreenMaterial.uniforms.blueNoiseTexture.value;if(t){var n=t.source.data,r=n.width,a=n.height;this.fullscreenMaterial.uniforms.blueNoiseRepeat.value.set(this.renderTargetA.width/r,this.renderTargetA.height/a)}for(var i=0;i<2*this.iterations;i++){var s=i%2==0,o=s?this.renderTargetB:this.renderTargetA;this.fullscreenMaterial.uniforms.inputTexture.value=0===i?this.inputTexture:o.texture;var l=s?this.renderTargetA:this.renderTargetB;e.setRenderTarget(l),e.render(this.scene,this.camera),this.fullscreenMaterial.uniforms.index.value=(this.fullscreenMaterial.uniforms.index.value+1)%4}}}]),n}(_l);Pl.DefaultOptions=Al,function(e){e[e.INPUT_RGB_NORMAL=0]="INPUT_RGB_NORMAL",e[e.FLOAT_BUFFER_NORMAL=1]="FLOAT_BUFFER_NORMAL",e[e.CONSTANT_Z=2]="CONSTANT_Z"}(ml||(ml={})),function(e){e[e.SEPARATE_BUFFER=0]="SEPARATE_BUFFER",e[e.NORMAL_VECTOR_ALPHA=1]="NORMAL_VECTOR_ALPHA"}(fl||(fl={}));const Rl={resolutionScale:1,spp:16,distance:.25,distancePower:.25,power:2,bias:40,thickness:.075},El={resolutionScale:1,spp:16,distance:.25,distancePower:1,power:2,bias:20,thickness:.05},Il={iterations:1,radius:10,rings:5.625,lumaPhi:10,depthPhi:12,normalPhi:3.25,samples:16};class kl{get texture(){return this.ssaoPass?this.ssaoPass.texture:null}constructor(e,t,n){this.needsUpdate=!0,this.parameters={...Rl},this._width=0,this._height=0,this._loaded=!1,this._normalVectorSourceType=ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=!1,this.depthTexture=null,this.normalTexture=null,this._width=e,this._height=t,this._normalVectorSourceType=(null==n?void 0:n.normalVectorSourceType)||ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=(null==n?void 0:n.depthValueSourceType)||fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=(null==n?void 0:n.modulateRedChannel)||!1,(null==n?void 0:n.ssaoParameters)&&(this.parameters=n.ssaoParameters),n&&this.updateParameters(n)}_getPass(e,t){if(!this.ssaoPass){this.ssaoPass=new Sl(e,t);const n=this.ssaoPass.fullscreenMaterial;n.defines.useNormalTexture="",this._modulateRedChannel&&(n.blending=Gt,n.blendEquation=Kt,n.blendEquationAlpha=null,n.blendSrc=Wt,n.blendSrcAlpha=null,n.blendDst=Wt,n.blendDstAlpha=null),n.onBeforeCompile=e=>{e.defines={...e.defines,FLOAT_BUFFER_NORMAL:ml.FLOAT_BUFFER_NORMAL,NormalVectorSourceType:this._normalVectorSourceType,NORMAL_VECTOR_ALPHA:fl.NORMAL_VECTOR_ALPHA,DepthValueSourceType:this._depthValueSourceType,MODULATE_RED_CHANNEL:this._modulateRedChannel?"MODULATE_RED_CHANNEL":void 0}},this.needsUpdate=!0}return this.ssaoPass}dispose(){var e;null===(e=this.ssaoPass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.ssaoPass)||void 0===n||n.setSize(e,t),this.needsUpdate=!0}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t],this.needsUpdate=!0);e.depthTexture&&(this.depthTexture=e.depthTexture,this.needsUpdate=!0),e.normalTexture&&(this.normalTexture=e.normalTexture,this.needsUpdate=!0)}render(e,t,n,r){var a;this._loaded||null===(null===(a=this.ssaoPass)||void 0===a?void 0:a.fullscreenMaterial.uniforms.blueNoiseTexture.value)||(this._loaded=!0,this.needsUpdate=!0);const i=!this.ssaoPass,o=this._getPass(t,n);if(this.needsUpdate||i){if(this.needsUpdate=!1,o.fullscreenMaterial.uniforms.aoDistance.value=this.parameters.distance,o.fullscreenMaterial.uniforms.distancePower.value=this.parameters.distancePower,o.fullscreenMaterial.uniforms.bias.value=this.parameters.bias,o.fullscreenMaterial.uniforms.thickness.value=this.parameters.thickness,o.fullscreenMaterial.uniforms.power.value=this.parameters.power,o.fullscreenMaterial.uniforms.depthTexture.value=this._depthValueSourceType===fl.NORMAL_VECTOR_ALPHA?this.normalTexture:this.depthTexture,o.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,o.fullscreenMaterial.needsUpdate=!0,i){const e=Math.round(this.parameters.spp);o.fullscreenMaterial.defines.spp=e;const t=function(e){for(var t=[],n=Math.PI*(3-Math.sqrt(5)),r=2/e,a=0;a<e;a++){var i=a*r-1+r/2,o=Math.sqrt(1-i*i),l=a*n;t.push(new s(Math.cos(l)*o,i,Math.sin(l)*o))}return t}(e),n=[];for(let t=0;t<e;t++)n.push((t+1)/e);o.fullscreenMaterial.uniforms.samples={value:t},o.fullscreenMaterial.uniforms.samplesR={value:n}}o.setSize(this._width,this._height),o.renderToScreen=!1}o._camera=t,o.fullscreenMaterial.uniforms.viewMatrix.value=t.matrixWorldInverse,o.fullscreenMaterial.uniforms.projectionMatrixInverse.value=t.projectionMatrixInverse,o.fullscreenMaterial.uniforms.cameraMatrixWorld.value=t.matrixWorld;const l=e.getRenderTarget();r&&(o.renderTarget=r),o.render(e),e.setRenderTarget(l)}}class Dl{get texture(){return this.hbaoPass.texture}constructor(e,t,n){this.needsUpdate=!0,this.parameters={...El},this._width=0,this._height=0,this._loaded=!1,this._normalVectorSourceType=ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=!1,this.depthTexture=null,this.normalTexture=null,this._width=e,this._height=t,this._normalVectorSourceType=(null==n?void 0:n.normalVectorSourceType)||ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=(null==n?void 0:n.depthValueSourceType)||fl.NORMAL_VECTOR_ALPHA,this._modulateRedChannel=(null==n?void 0:n.modulateRedChannel)||!1,(null==n?void 0:n.hbaoParameters)&&(this.parameters=n.hbaoParameters),n&&this.updateParameters(n)}_getPass(e,t){if(!this.hbaoPass){this.hbaoPass=new Ml(e,t);const n=this.hbaoPass.fullscreenMaterial;n.defines.useNormalTexture="",this._modulateRedChannel&&(n.blending=Gt,n.blendEquation=Kt,n.blendEquationAlpha=null,n.blendSrc=Wt,n.blendSrcAlpha=null,n.blendDst=Wt,n.blendDstAlpha=null),n.onBeforeCompile=e=>{e.defines={...e.defines,FLOAT_BUFFER_NORMAL:ml.FLOAT_BUFFER_NORMAL,NormalVectorSourceType:this._normalVectorSourceType,NORMAL_VECTOR_ALPHA:fl.NORMAL_VECTOR_ALPHA,DepthValueSourceType:this._depthValueSourceType,MODULATE_RED_CHANNEL:this._modulateRedChannel?"MODULATE_RED_CHANNEL":void 0}},this.needsUpdate=!0}return this.hbaoPass}dispose(){var e;null===(e=this.hbaoPass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.hbaoPass)||void 0===n||n.setSize(e,t),this.needsUpdate=!0}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t],this.needsUpdate=!0);e.depthTexture&&(this.depthTexture=e.depthTexture,this.needsUpdate=!0),e.normalTexture&&(this.normalTexture=e.normalTexture,this.needsUpdate=!0)}render(e,t,n,r){var a;this._loaded||null===(null===(a=this.hbaoPass)||void 0===a?void 0:a.fullscreenMaterial.uniforms.blueNoiseTexture.value)||(this._loaded=!0,this.needsUpdate=!0);const i=this._getPass(t,n);if(this.needsUpdate){this.needsUpdate=!1;const e=Math.round(this.parameters.spp);i.fullscreenMaterial.defines.spp=e,i.fullscreenMaterial.uniforms.aoDistance.value=this.parameters.distance,i.fullscreenMaterial.uniforms.distancePower.value=this.parameters.distancePower,i.fullscreenMaterial.uniforms.bias.value=this.parameters.bias,i.fullscreenMaterial.uniforms.thickness.value=this.parameters.thickness,i.fullscreenMaterial.uniforms.power.value=this.parameters.power,i.fullscreenMaterial.uniforms.depthTexture.value=this._depthValueSourceType===fl.NORMAL_VECTOR_ALPHA?this.normalTexture:this.depthTexture,i.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture,i.fullscreenMaterial.needsUpdate=!0,i.setSize(this._width,this._height),i.renderToScreen=!1}i._camera=t,i.fullscreenMaterial.uniforms.viewMatrix.value=t.matrixWorldInverse,i.fullscreenMaterial.uniforms.projectionMatrixInverse.value=t.projectionMatrixInverse,i.fullscreenMaterial.uniforms.cameraMatrixWorld.value=t.matrixWorld;const s=e.getRenderTarget();r&&(i.renderTarget=r),i.render(e),e.setRenderTarget(s)}}class Ol{get texture(){return this.denoisePass?this.denoisePass.texture:null}set inputTexture(e){this._inputTexture=e}constructor(e,t,n){this.needsUpdate=!0,this.parameters={...Il},this._width=0,this._height=0,this._normalVectorSourceType=ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=fl.NORMAL_VECTOR_ALPHA,this._rgInputTexture=!0,this._inputTexture=null,this.depthTexture=null,this.normalTexture=null,this._width=e,this._height=t,this._normalVectorSourceType=(null==n?void 0:n.normalVectorSourceType)||ml.FLOAT_BUFFER_NORMAL,this._depthValueSourceType=(null==n?void 0:n.depthValueSourceType)||fl.NORMAL_VECTOR_ALPHA,this._rgInputTexture=(null==n?void 0:n.rgInputTexture)||!0,this._inputTexture=(null==n?void 0:n.inputTexture)||null,this.depthTexture=(null==n?void 0:n.depthTexture)||null,this.normalTexture=(null==n?void 0:n.normalTexture)||null,n.poisonDenoiseParameters?this.parameters=n.poisonDenoiseParameters:n&&this.updateParameters(n)}_getPass(e){return this.denoisePass||(this.normalTexture?(this.denoisePass=new Pl(e,this._inputTexture,this.depthTexture,{normalTexture:this.normalTexture}),this.denoisePass.fullscreenMaterial.onBeforeCompile=e=>{e.defines={...e.defines,FLOAT_BUFFER_NORMAL:ml.FLOAT_BUFFER_NORMAL,CONSTANT_Z:ml.CONSTANT_Z,NormalVectorSourceType:this._normalVectorSourceType,NORMAL_VECTOR_ALPHA:fl.NORMAL_VECTOR_ALPHA,DepthValueSourceType:this._depthValueSourceType,RG_INPUT_TEXTURE:this._rgInputTexture?"RG_INPUT_TEXTURE":void 0}}):this.denoisePass=new Pl(e,this._inputTexture,this.depthTexture),this.needsUpdate=!0),this.denoisePass}dispose(){var e;null===(e=this.denoisePass)||void 0===e||e.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this.denoisePass)||void 0===n||n.setSize(e,t),this.needsUpdate=!0}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t],this.needsUpdate=!0);e.inputTexture&&(this._inputTexture=e.inputTexture,this.needsUpdate=!0),e.depthTexture&&(this.depthTexture=e.depthTexture,this.needsUpdate=!0),e.normalTexture&&(this.normalTexture=e.normalTexture,this.needsUpdate=!0)}render(e,t){const n=this._getPass(t);this.needsUpdate&&(this.needsUpdate=!1,n.iterations=this.parameters.iterations,n.samples=this.parameters.samples,n.rings=this.parameters.rings,n.radius=this.parameters.radius,n.fullscreenMaterial.uniforms.lumaPhi.value=this.parameters.lumaPhi,n.fullscreenMaterial.uniforms.depthPhi.value=this.parameters.depthPhi,n.fullscreenMaterial.uniforms.normalPhi.value=this.parameters.normalPhi,n.fullscreenMaterial.needsUpdate=!0,n.setSize(this._width,this._height),n.renderToScreen=!1,this.normalTexture?(n.fullscreenMaterial.uniforms.depthTexture.value=this._depthValueSourceType===fl.NORMAL_VECTOR_ALPHA?this.normalTexture:this.depthTexture,n.fullscreenMaterial.uniforms.normalTexture.value=this.normalTexture):n.fullscreenMaterial.uniforms.depthTexture.value=this.depthTexture),n.inputTexture=this._inputTexture,n.fullscreenMaterial.uniforms.projectionMatrixInverse.value=t.projectionMatrixInverse,n.fullscreenMaterial.uniforms.cameraMatrixWorld.value=t.matrixWorld;const r=new h;e.getClearColor(r);const a=e.getClearAlpha(),i=e.autoClear,s=e.getRenderTarget();e.autoClear=!0,e.setClearColor(16777215,1),e.setRenderTarget(this.denoisePass.renderTargetA),e.setRenderTarget(this.denoisePass.renderTargetB),e.clear(!0,!1,!1),n.render(e),e.setClearColor(r),e.setClearAlpha(a),e.setRenderTarget(s),e.autoClear=i}}var Ll,Ul;!function(e){e[e.OFF=0]="OFF",e[e.HARD=1]="HARD",e[e.POISSON=2]="POISSON",e[e.FULL=3]="FULL"}(Ll||(Ll={})),function(e){e[e.NONE=0]="NONE",e[e.SSAO=1]="SSAO",e[e.EffectsSSAO=2]="EffectsSSAO",e[e.EffectsHBAO=3]="EffectsHBAO"}(Ul||(Ul={}));const Fl={aoKernelRadius:.25,aoDepthBias:1e-4,aoMaxDistance:.5,aoMaxDepth:.99,aoFadeout:.5,shadowRadius:.05},Nl={enabled:!0,aoType:Ul.SSAO,aoIntensity:.5,shadowIntensity:.35,aoOnGround:!0,shadowOnGround:!1,alwaysUpdate:!1};class Bl{get gBufferRenderTarget(){var e;return this._sharedGBufferRenderTarget?this._sharedGBufferRenderTarget:(this._gBufferRenderTarget=null!==(e=this._gBufferRenderTarget)&&void 0!==e?e:new Yo(void 0,{_width:this._width,_height:this._height,_samples:this._samples,_renderPass:this._renderPass,textureFilter:ae}),this._gBufferRenderTarget)}get SSAOEffect(){return this._ssaoEffect||(this._ssaoEffect=new kl(this._width,this._height,{normalVectorSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?ml.FLOAT_BUFFER_NORMAL:ml.INPUT_RGB_NORMAL,depthValueSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?fl.NORMAL_VECTOR_ALPHA:fl.SEPARATE_BUFFER,modulateRedChannel:!0,ssaoParameters:this.parameters.ssao})),this._ssaoEffect}get HBAOEffect(){return this._hbaoEffect||(this._hbaoEffect=new Dl(this._width,this._height,{normalVectorSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?ml.FLOAT_BUFFER_NORMAL:ml.INPUT_RGB_NORMAL,depthValueSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?fl.NORMAL_VECTOR_ALPHA:fl.SEPARATE_BUFFER,modulateRedChannel:!0,hbaoParameters:this.parameters.hbao})),this._hbaoEffect}get fadeRenderTarget(){var e;return this._fadeRenderTarget=null!==(e=this._fadeRenderTarget)&&void 0!==e?e:new St(this._width,this._height,{format:Xt,magFilter:L,minFilter:L}),this._fadeRenderTarget}get denoisePass(){return this.poissonDenoiseEffect||(this.poissonDenoiseEffect=new Ol(this._width,this._height,{inputTexture:this.shadowAndAoRenderTargets.passRenderTarget.texture,depthTexture:this.gBufferRenderTarget.depthBufferTexture,normalTexture:this.gBufferRenderTarget.gBufferTexture,normalVectorSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?ml.FLOAT_BUFFER_NORMAL:ml.INPUT_RGB_NORMAL,depthValueSourceType:this.gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?fl.NORMAL_VECTOR_ALPHA:fl.SEPARATE_BUFFER,rgInputTexture:!0,poisonDenoiseParameters:this.parameters.poissonDenoise})),this.poissonDenoiseEffect}get denoiseRenderTargetTexture(){return this.denoisePass?this.denoisePass.texture:null}constructor(e,t,n,r){var a,i,s,o,l,h,d;this.needsUpdate=!0,this._renderPass=new Go,this._cameraUpdate=new Vo,(null==r?void 0:r.gBufferRenderTarget)&&(this._sharedGBufferRenderTarget=null==r?void 0:r.gBufferRenderTarget),this._width=e,this._height=t,this._samples=n,this.shadowAndAoRenderTargets=new zl(this.gBufferRenderTarget,{...r,width:e,height:t,samples:n,_renderPass:this._renderPass}),this.parameters={enabled:null!==(a=null==r?void 0:r.enabled)&&void 0!==a?a:Nl.enabled,aoType:null!==(i=null==r?void 0:r.aoType)&&void 0!==i?i:Nl.aoType,aoIntensity:null!==(s=null==r?void 0:r.aoIntensity)&&void 0!==s?s:Nl.aoIntensity,shadowIntensity:null!==(o=null==r?void 0:r.shadowIntensity)&&void 0!==o?o:Nl.shadowIntensity,aoOnGround:null!==(l=null==r?void 0:r.aoOnGround)&&void 0!==l?l:Nl.aoOnGround,shadowOnGround:null!==(h=null==r?void 0:r.shadowOnGround)&&void 0!==h?h:Nl.shadowOnGround,alwaysUpdate:null!==(d=null==r?void 0:r.alwaysUpdate)&&void 0!==d?d:Nl.alwaysUpdate,shAndAo:this.shadowAndAoRenderTargets.shadowAndAoParameters,ssao:{...Rl},hbao:{...El},poissonDenoise:{...Il}},this._copyMaterial=new Oo,this._blendMaterial=new Oo({},Do.DEFAULT)}dispose(){var e,t,n,r,a,i,s;null===(e=this.gBufferRenderTarget)||void 0===e||e.dispose(),this.shadowAndAoRenderTargets.dispose(),null===(t=this._ssaoEffect)||void 0===t||t.dispose(),null===(n=this._hbaoEffect)||void 0===n||n.dispose(),null===(r=this._fadeRenderTarget)||void 0===r||r.dispose(),null===(a=this.poissonDenoiseEffect)||void 0===a||a.dispose(),null===(i=this._copyMaterial)||void 0===i||i.dispose(),null===(s=this._blendMaterial)||void 0===s||s.dispose()}setSize(e,t){var n,r,a,i,s;this._width=e,this._height=t,null===(n=this._gBufferRenderTarget)||void 0===n||n.setSize(e,t),this.shadowAndAoRenderTargets.setSize(e,t),null===(r=this._ssaoEffect)||void 0===r||r.setSize(e,t),null===(a=this._hbaoEffect)||void 0===a||a.setSize(e,t),null===(i=this._fadeRenderTarget)||void 0===i||i.setSize(e,t),null===(s=this.poissonDenoiseEffect)||void 0===s||s.setSize(this._width,this._height),this.needsUpdate=!0}updateParameters(e){void 0!==e.enabled&&(this.parameters.enabled=e.enabled),void 0!==e.aoType&&(this.parameters.aoType=e.aoType),void 0!==e.aoIntensity&&(this.parameters.aoIntensity=e.aoIntensity),void 0!==e.shadowIntensity&&(this.parameters.shadowIntensity=e.shadowIntensity),void 0!==e.aoOnGround&&(this.parameters.aoOnGround=e.aoOnGround),void 0!==e.shadowOnGround&&(this.parameters.shadowOnGround=e.shadowOnGround),void 0!==e.alwaysUpdate&&(this.parameters.alwaysUpdate=e.alwaysUpdate),this._updatePassParameters(e)}_updatePassParameters(e){var t,n,r;if(null==e?void 0:e.shAndAo)for(let t in e.shAndAo)this.parameters.shAndAo.hasOwnProperty(t)&&(this.parameters.shAndAo[t]=e.shAndAo[t],this.shadowAndAoRenderTargets.parametersNeedsUpdate=!0);(null==e?void 0:e.ssao)&&(null===(t=this._hbaoEffect)||void 0===t||t.updateParameters(null==e?void 0:e.hbao)),(null==e?void 0:e.hbao)&&(null===(n=this._ssaoEffect)||void 0===n||n.updateParameters(null==e?void 0:e.hbao)),(null==e?void 0:e.poissonDenoise)&&(null===(r=this.poissonDenoiseEffect)||void 0===r||r.updateParameters(null==e?void 0:e.poissonDenoise))}updateBounds(e,t){this.shadowAndAoRenderTargets.updateBounds(e,t)}render(e,t,n,r,a=Ll.FULL,i=Ll.FULL,s=0){if(!this._setRenderState())return;let o=!1;const l=i===Ll.POISSON&&s>.001,h=i===Ll.HARD&&s>.001&&s<.999,d=i===Ll.HARD&&!h;!d&&a===Ll.FULL&&this._evaluateIfUpdateIsNeeded(n)&&(this._renderShadowAndAo(e,t,n,r),o=!0);let c=d?r:this.denoiseRenderTargetTexture;l&&(c=this._renderDynamicShadow(e,this.shadowAndAoRenderTargets.passRenderTarget.texture,r,s),o=!0),o&&(c=this._renderDenoise(e,n,l)),h&&(c=this._renderDynamicShadow(e,this.denoiseRenderTargetTexture,r,s)),this._renderToTarget(e,c,d)}_setRenderState(){return this.shadowAndAoRenderTargets.aoEnabled=this.parameters.aoType===Ul.SSAO,this.shadowAndAoRenderTargets.shadowEnabled=this.parameters.shadowIntensity>.01,!(!this.parameters.enabled||this.parameters.aoType===Ul.NONE&&!this.shadowAndAoRenderTargets.shadowEnabled||(this.needsUpdate&&(this._ssaoEffect&&(this._ssaoEffect.needsUpdate=!0),this._hbaoEffect&&(this._hbaoEffect.needsUpdate=!0),this.poissonDenoiseEffect&&(this.poissonDenoiseEffect.needsUpdate=!0)),0))}_evaluateIfUpdateIsNeeded(e){e.updateProjectionMatrix();const t=this.parameters.alwaysUpdate||this.needsUpdate||null!=e&&this._cameraUpdate.changed(e);return this.needsUpdate=!1,t}_renderShadowAndAo(e,t,n,r){this.gBufferRenderTarget.render(e,t,n),this.shadowAndAoRenderTargets.render(e,n,r),this._renderAoEffect(e,t,n)}_renderAoEffect(e,t,n){if(this.parameters.aoType!==Ul.EffectsSSAO&&this.parameters.aoType!==Ul.EffectsHBAO)return;const r=this.gBufferRenderTarget.depthBufferTexture,a=this.gBufferRenderTarget.gBufferTexture,i=this.shadowAndAoRenderTargets.passRenderTarget,s=e.autoClear;switch(e.autoClear=!1,this.parameters.aoType){default:break;case Ul.EffectsSSAO:{const s=this.SSAOEffect;s.depthTexture=r,s.normalTexture=a,s.render(e,n,t,i)}break;case Ul.EffectsHBAO:{const s=this.HBAOEffect;s.depthTexture=r,s.normalTexture=a,s.render(e,n,t,i)}}e.autoClear=s}_renderDynamicShadow(e,t,n,r=1){const a=r<.999;return a&&(this._copyMaterial.update({texture:t,blending:vt,colorTransform:So,multiplyChannels:0}),this._renderPass.renderScreenSpace(e,this._copyMaterial,this.fadeRenderTarget)),r>.001&&(this._blendMaterial.update({texture:n,blending:a?Gt:vt,colorTransform:(new P).set(0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,a?r:1),multiplyChannels:0}),this._renderPass.renderScreenSpace(e,this._blendMaterial,this.fadeRenderTarget)),this.fadeRenderTarget.texture}_renderDenoise(e,t,n){return this.denoisePass.inputTexture=n?this.fadeRenderTarget.texture:this.shadowAndAoRenderTargets.passRenderTarget.texture,this.denoisePass.render(e,t),this.denoisePass.texture}_renderToTarget(e,t,n){const r=n?this.parameters.shadowIntensity:this.parameters.aoIntensity,a=n?0:this.parameters.shadowIntensity;this._renderPass.renderScreenSpace(e,this._copyMaterial.update({texture:t,blending:Gt,colorTransform:ko(r,a,0,1),multiplyChannels:1}),e.getRenderTarget())}}Bl.shadowTransform=(new P).set(0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,1);class zl{get passRenderTarget(){var e;return this._passRenderTarget=null!==(e=this._passRenderTarget)&&void 0!==e?e:new St(this._width,this._height,{samples:this._aoTargetSamples,format:Xt,magFilter:L,minFilter:L}),this._passRenderTarget}get passRenderMaterial(){var e;return this._passRenderMaterial=null!==(e=this._passRenderMaterial)&&void 0!==e?e:new Hl({normalTexture:this._depthAndNormalTextures.gBufferTexture,depthTexture:this._depthAndNormalTextures.depthBufferTexture,noiseTexture:this.noiseTexture,sampleKernel:this.sampleKernel,floatGBufferRgbNormalAlphaDepth:this._depthAndNormalTextures.isFloatGBufferWithRgbNormalAlphaDepth}),this._passRenderMaterial}get noiseTexture(){var e;return this._noiseTexture=null!==(e=this._noiseTexture)&&void 0!==e?e:(()=>{const e=new Uint8Array(64);for(let t=0;t<16;++t){const n=Math.floor(t/2)+t%2*8,r=2*Math.PI*n/16,a=new s(Math.cos(r),Math.sin(r),0).normalize();e[4*t]=255*(.5*a.x+.5),e[4*t+1]=255*(.5*a.y+.5),e[4*t+2]=127,e[4*t+3]=0}const t=new Pe(e,4,4);return t.wrapS=F,t.wrapT=F,t.needsUpdate=!0,t})(),this._noiseTexture}get sampleKernel(){return this._sampleKernel.length||(this._sampleKernel=(e=>{const t=[];for(let n=0;n<e;n++){const r=n*Math.PI*(3-Math.sqrt(5)),a=.99-n/(e-1)*.8,i=Math.sqrt(1-a*a),o=Math.cos(r)*i,l=Math.sin(r)*i,h=8,d=Math.floor(e/h);let c=1-(Math.floor(n/h)+n%h*d)/e;c=J.lerp(.1,1,c*c),t.push(new s(o*c,l*c,a*c))}return t})(Hl.kernelSize)),this._sampleKernel}constructor(e,t){var n,r,a,i;this.parametersNeedsUpdate=!0,this.aoEnabled=!0,this.shadowEnabled=!0,this._sceneBoxMin=new s(-1,-1,-1),this._sceneBoxMax=new s(1,1,1),this._shadowAndAoScale=1,this._aoTargetSamples=0,this._sampleKernel=[],this.shadowAndAoParameters=this._getShadowAndAoParameters(t),this._width=null!==(n=null==t?void 0:t._width)&&void 0!==n?n:1024,this._height=null!==(r=null==t?void 0:t._height)&&void 0!==r?r:1024,this._samples=null!==(a=null==t?void 0:t._samples)&&void 0!==a?a:0,this._depthAndNormalTextures=e,this._renderPass=null!==(i=null==t?void 0:t._renderPass)&&void 0!==i?i:new Go}_getShadowAndAoParameters(e){return{...Fl,...e}}dispose(){var e,t,n;null===(e=this._noiseTexture)||void 0===e||e.dispose(),null===(t=this._passRenderMaterial)||void 0===t||t.dispose(),null===(n=this._passRenderTarget)||void 0===n||n.dispose()}setSize(e,t){var n;this._width=e,this._height=t,null===(n=this._passRenderMaterial)||void 0===n||n.update({_width:this._width,_height:this._height})}updateBounds(e,t){this._sceneBoxMin.copy(e.bounds.min),this._sceneBoxMax.copy(e.bounds.max),this._shadowAndAoScale=t,this.parametersNeedsUpdate=!0}render(e,t,n){this._renderPass.renderScreenSpace(e,this.updateSSAOMaterial(t,n),this.passRenderTarget),this.parametersNeedsUpdate=!1}updateSSAOMaterial(e,t){const n=this.passRenderMaterial;return n.updateDependencies({_width:this._width,_height:this._height,camera:e,shadowTexture:t,sceneBoxMin:this._sceneBoxMin,sceneBoxMax:this._sceneBoxMax}),this.parametersNeedsUpdate&&n.updateSettings({...this.shadowAndAoParameters,aoKernelRadius:this.shadowAndAoParameters.aoKernelRadius*this._shadowAndAoScale,aoMaxDistance:this.shadowAndAoParameters.aoMaxDistance*this._shadowAndAoScale,shadowRadius:this.shadowAndAoParameters.shadowRadius*this._shadowAndAoScale,aoIntensity:this.aoEnabled?1:0,shadowIntensity:this.shadowEnabled?1:0}),n}}class Hl extends ft{constructor(e){var t,n;super({defines:Object.assign({...Hl._shader.defines,KERNEL_SIZE:null!==(n=null===(t=null==e?void 0:e.sampleKernel)||void 0===t?void 0:t.length)&&void 0!==n?n:Hl.kernelSize,FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH:(null==e?void 0:e.floatGBufferRgbNormalAlphaDepth)?1:0}),uniforms:gt.clone(Hl._shader.uniforms),vertexShader:Hl._shader.vertexShader,fragmentShader:Hl._shader.fragmentShader,blending:vt}),this.update(e)}update(e){return this.updateDependencies(e),this.updateSettings(e),this}updateDependencies(e){var t,n;if(void 0!==(null==e?void 0:e.shadowTexture)&&(this.uniforms.tShadow.value=null==e?void 0:e.shadowTexture),void 0!==(null==e?void 0:e.normalTexture)&&(this.uniforms.tNormal.value=null==e?void 0:e.normalTexture),void 0!==(null==e?void 0:e.depthTexture)&&(this.uniforms.tDepth.value=null==e?void 0:e.depthTexture),void 0!==(null==e?void 0:e.noiseTexture)&&(this.uniforms.tNoise.value=null==e?void 0:e.noiseTexture),(null==e?void 0:e._width)||(null==e?void 0:e._height)){const r=null!==(t=null==e?void 0:e._width)&&void 0!==t?t:this.uniforms.resolution.value.x,a=null!==(n=null==e?void 0:e._height)&&void 0!==n?n:this.uniforms.resolution.value.y;this.uniforms.resolution.value.set(r,a)}void 0!==(null==e?void 0:e.sampleKernel)&&(this.uniforms.sampleKernel.value=null==e?void 0:e.sampleKernel),void 0!==(null==e?void 0:e.sceneBoxMin)&&(this.uniforms.sceneBoxMin.value=null==e?void 0:e.sceneBoxMin),void 0!==(null==e?void 0:e.sceneBoxMax)&&(this.uniforms.sceneBoxMax.value=null==e?void 0:e.sceneBoxMax),this._updateCameraDependentUniforms(e)}_updateCameraDependentUniforms(e){if(void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,this.uniforms.cameraProjectionMatrix.value.copy(t.projectionMatrix),this.uniforms.cameraInverseProjectionMatrix.value.copy(t.projectionMatrixInverse),this.uniforms.cameraWorldMatrix.value.copy(t.matrixWorld)}}updateSettings(e){void 0!==(null==e?void 0:e.aoKernelRadius)&&(this.uniforms.aoKernelRadius.value=null==e?void 0:e.aoKernelRadius),void 0!==(null==e?void 0:e.aoDepthBias)&&(this.uniforms.aoDepthBias.value=null==e?void 0:e.aoDepthBias),void 0!==(null==e?void 0:e.aoMaxDistance)&&(this.uniforms.aoMaxDistance.value=null==e?void 0:e.aoMaxDistance),void 0!==(null==e?void 0:e.aoMaxDepth)&&(this.uniforms.aoMaxDepth.value=null==e?void 0:e.aoMaxDepth),void 0!==(null==e?void 0:e.aoIntensity)&&(this.uniforms.aoIntensity.value=null==e?void 0:e.aoIntensity),void 0!==(null==e?void 0:e.aoFadeout)&&(this.uniforms.aoFadeout.value=null==e?void 0:e.aoFadeout),void 0!==(null==e?void 0:e.shadowRadius)&&(this.uniforms.shKernelRadius.value=null==e?void 0:e.shadowRadius),void 0!==(null==e?void 0:e.shadowIntensity)&&(this.uniforms.shIntensity.value=null==e?void 0:e.shadowIntensity)}}Hl.kernelSize=32,Hl._shader={uniforms:{tShadow:{value:null},tNormal:{value:null},tDepth:{value:null},tNoise:{value:null},sampleKernel:{value:null},cameraNear:{value:.1},cameraFar:{value:1},resolution:{value:new i},cameraProjectionMatrix:{value:new P},cameraInverseProjectionMatrix:{value:new P},cameraWorldMatrix:{value:new P},aoKernelRadius:{value:.1},aoDepthBias:{value:.001},aoMaxDistance:{value:.05},aoMaxDepth:{value:.99},aoIntensity:{value:1},aoFadeout:{value:0},shKernelRadius:{value:.15},shIntensity:{value:1},sceneBoxMin:{value:new s(-1,-1,-1)},sceneBoxMax:{value:new s(1,1,1)}},defines:{PERSPECTIVE_CAMERA:1,KERNEL_SIZE:Hl.kernelSize,FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH:0,NORMAL_VECTOR_ANTIALIAS:2},vertexShader:"varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n }",fragmentShader:"uniform sampler2D tShadow;\n uniform sampler2D tNormal;\n#if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH != 1 \n uniform sampler2D tDepth;\n#endif \n uniform sampler2D tNoise;\n uniform vec3 sampleKernel[KERNEL_SIZE];\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraInverseProjectionMatrix;\n uniform mat4 cameraWorldMatrix;\n uniform float aoKernelRadius;\n uniform float aoDepthBias; // avoid artifacts caused by neighbour fragments with minimal depth difference\n uniform float aoMaxDistance; // avoid the influence of fragments which are too far away\n uniform float aoMaxDepth;\n uniform float aoIntensity;\n uniform float aoFadeout;\n uniform float shKernelRadius;\n uniform float shIntensity;\n uniform vec3 sceneBoxMin;\n uniform vec3 sceneBoxMax;\n \n varying vec2 vUv;\n \n #include <packing>\n \n float getDepth(const in vec2 screenPosition) {\n #if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH == 1\n return texture2D(tNormal, screenPosition).w;\n #else \n return texture2D(tDepth, screenPosition).x;\n #endif\n }\n \n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n \n vec3 getViewPosition(const in vec2 screenPosition, const in float depth) {\n vec4 clipSpacePosition = vec4(vec3(screenPosition, depth) * 2.0 - 1.0, 1.0);\n vec4 viewSpacePosition = cameraInverseProjectionMatrix * clipSpacePosition;\n return viewSpacePosition.xyz / viewSpacePosition.w;\n }\n\n vec3 getAntiAliasedViewNormal(const in vec2 screenPosition) {\n #if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH == 1\n #if NORMAL_VECTOR_ANTIALIAS == 1\n vec2 uv = screenPosition;\n vec2 size = vec2(textureSize(tNormal, 0));\n ivec2 p = ivec2(screenPosition * size);\n float c0 = texelFetch(tNormal, p, 0).a;\n float l2 = texelFetch(tNormal, p - ivec2(2, 0), 0).a;\n float l1 = texelFetch(tNormal, p - ivec2(1, 0), 0).a;\n float r1 = texelFetch(tNormal, p + ivec2(1, 0), 0).a;\n float r2 = texelFetch(tNormal, p + ivec2(2, 0), 0).a;\n float b2 = texelFetch(tNormal, p - ivec2(0, 2), 0).a;\n float b1 = texelFetch(tNormal, p - ivec2(0, 1), 0).a;\n float t1 = texelFetch(tNormal, p + ivec2(0, 1), 0).a;\n float t2 = texelFetch(tNormal, p + ivec2(0, 2), 0).a;\n float dl = abs((2.0 * l1 - l2) - c0);\n float dr = abs((2.0 * r1 - r2) - c0);\n float db = abs((2.0 * b1 - b2) - c0);\n float dt = abs((2.0 * t1 - t2) - c0);\n vec3 ce = getViewPosition(uv, c0).xyz;\n vec3 dpdx = (dl < dr) ? ce - getViewPosition((uv - vec2(1.0 / size.x, 0.0)), l1).xyz\n : -ce + getViewPosition((uv + vec2(1.0 / size.x, 0.0)), r1).xyz;\n vec3 dpdy = (db < dt) ? ce - getViewPosition((uv - vec2(0.0, 1.0 / size.y)), b1).xyz\n : -ce + getViewPosition((uv + vec2(0.0, 1.0 / size.y)), t1).xyz;\n return normalize(cross(dpdx, dpdy));\n #elif NORMAL_VECTOR_ANTIALIAS == 2\n vec2 size = vec2(textureSize(tNormal, 0));\n ivec2 p = ivec2(screenPosition * size);\n vec3 normalVector = texelFetch(tNormal, p, 0).xyz;\n normalVector += texelFetch(tNormal, p + ivec2(1, 0), 0).xyz;\n normalVector += texelFetch(tNormal, p - ivec2(1, 0), 0).xyz;\n normalVector += texelFetch(tNormal, p + ivec2(0, 1), 0).xyz;\n normalVector += texelFetch(tNormal, p - ivec2(0, 1), 0).xyz;\n return normalize(normalVector);\n #else\n return texture2D(tNormal, screenPosition).xyz;\n #endif\n #else\n return unpackRGBToNormal(texture2D(tNormal, screenPosition).xyz);\n #endif\n }\n\n vec3 getViewNormal(const in vec2 screenPosition) {\n #if FLOAT_GBUFFER_RGB_NORMAL_ALPHA_DEPTH == 1\n return texture2D(tNormal, screenPosition).xyz;\n #else\n return unpackRGBToNormal(texture2D(tNormal, screenPosition).xyz);\n #endif\n }\n \n void main() {\n \n float depth = getDepth(vUv);\n float viewZ = getViewZ(depth);\n \n vec3 viewPosition = getViewPosition(vUv, depth);\n vec3 viewNormal = getAntiAliasedViewNormal(vUv);\n vec3 worldPosition = (cameraWorldMatrix * vec4(viewPosition, 1.0)).xyz;\n float boxDistance = length(max(vec3(0.0), max(sceneBoxMin - worldPosition, worldPosition - sceneBoxMax)));\n \n vec2 noiseScale = resolution.xy / 4.0;\n vec3 random = texture2D(tNoise, vUv * noiseScale).xyz * 2.0 - 1.0;\n \n // compute matrix used to reorient a kernel vector\n vec3 tangent = normalize(random - viewNormal * dot(random, viewNormal));\n vec3 bitangent = cross(viewNormal, tangent);\n mat3 kernelMatrix = mat3(tangent, bitangent, viewNormal);\n \n float aoOcclusion = 0.0;\n float shOcclusion = texture2D(tShadow, vUv).r;\n float shSamples = 0.0;\n if (aoIntensity >= 0.01 && boxDistance < aoMaxDistance && length(viewNormal) > 0.01) {\n for (int i = 0; i < KERNEL_SIZE; i ++) {\n vec3 aoSampleVector = kernelMatrix * sampleKernel[i]; \n vec3 aoSamplePoint = viewPosition + aoSampleVector * aoKernelRadius; \n vec4 aoSamplePointNDC = cameraProjectionMatrix * vec4(aoSamplePoint, 1.0); \n aoSamplePointNDC /= aoSamplePointNDC.w;\n vec2 aoSamplePointUv = aoSamplePointNDC.xy * 0.5 + 0.5;\n float aoRealSampleDepth = getDepth(aoSamplePointUv);\n float aoSampleDeltaZ = getViewZ(aoRealSampleDepth) - aoSamplePoint.z;\n float aoRealDeltaZ = viewZ - aoSamplePoint.z;\n float w_long = clamp((aoMaxDistance - max(aoRealDeltaZ, aoSampleDeltaZ)) / aoMaxDistance, 0.0, 1.0);\n float w_lat = clamp(1.0 - length(aoSampleVector.xy), 0.0, 1.0);\n aoOcclusion +=\n step(aoRealSampleDepth, aoMaxDepth) * \n step(aoDepthBias, aoSampleDeltaZ / (cameraFar - cameraNear)) * \n step(aoSampleDeltaZ, aoMaxDistance) * mix(1.0, w_long * w_lat, aoFadeout);\n }\n }\n if (shIntensity >= 0.01 && length(viewNormal) > 0.01) {\n for (int i = 0; i < KERNEL_SIZE; i ++) {\n vec3 shSampleVector = kernelMatrix * sampleKernel[i]; // reorient sample vector in view space\n vec3 shSamplePoint = viewPosition + shSampleVector * shKernelRadius; // calculate sample point\n vec4 shSamplePointNDC = cameraProjectionMatrix * vec4(shSamplePoint, 1.0); // project point and calculate NDC\n shSamplePointNDC /= shSamplePointNDC.w;\n vec2 shSamplePointUv = shSamplePointNDC.xy * 0.5 + 0.5; // compute uv coordinates\n vec3 shSampleNormal = getViewNormal(shSamplePointUv);\n float shDeltaZ = getViewZ(getDepth(shSamplePointUv)) - shSamplePoint.z;\n float w = step(abs(shDeltaZ), shKernelRadius) * max(0.0, dot(shSampleNormal, viewNormal));\n shSamples += w;\n shOcclusion += texture2D(tShadow, shSamplePointUv).r * w;\n }\n }\n \n aoOcclusion = clamp(aoOcclusion / float(KERNEL_SIZE) * (1.0 + aoFadeout), 0.0, 1.0);\n aoOcclusion = 1.0 - aoOcclusion * clamp(1.0 - boxDistance / aoMaxDistance, 0.0, 1.0);\n shOcclusion = clamp(shOcclusion / (shSamples + 1.0), 0.0, 1.0);\n gl_FragColor = vec4(aoOcclusion, shOcclusion, 0.0, 1.0);\n }"};class jl{get reflectionRenderTarget(){var e;return this._reflectionRenderTarget=null!==(e=this._reflectionRenderTarget)&&void 0!==e?e:this._newRenderTarget(!0),this._reflectionRenderTarget}get intensityRenderTarget(){var e;return this._intensityRenderTarget=null!==(e=this._intensityRenderTarget)&&void 0!==e?e:this._newRenderTarget(!1),this._intensityRenderTarget}get blurRenderTarget(){var e;return this._blurRenderTarget=null!==(e=this._blurRenderTarget)&&void 0!==e?e:this._newRenderTarget(!1),this._blurRenderTarget}constructor(e,t,n){var r;this._width=e,this._height=t,this.parameters={enabled:!1,intensity:.25,fadeOutDistance:1,fadeOutExponent:4,brightness:1,blurHorizontal:3,blurVertical:6,blurAscent:0,groundLevel:0,groundReflectionScale:1,renderTargetDownScale:4,...n},this._copyMaterial=new Oo({}),this._updateCopyMaterial(null),this._reflectionIntensityMaterial=new Vl({_width:this._width/this.parameters.renderTargetDownScale,_height:this._height/this.parameters.renderTargetDownScale}),this._blurPass=new Ko(Lo,n),this._renderPass=null!==(r=null==n?void 0:n._renderPass)&&void 0!==r?r:new Go}_newRenderTarget(e){const t=this._width/this.parameters.renderTargetDownScale,n=this._height/this.parameters.renderTargetDownScale;let r={};if(e){const e=new Ct(t,n);e.format=Mt,e.type=Tt,r.minFilter=ae,r.magFilter=ae,r.depthTexture=e}else r.samples=1;return new St(t,n,{format:Ae,...r})}dispose(){var e,t,n;null===(e=this._reflectionRenderTarget)||void 0===e||e.dispose(),null===(t=this._intensityRenderTarget)||void 0===t||t.dispose(),null===(n=this._blurRenderTarget)||void 0===n||n.dispose(),this._copyMaterial.dispose()}setSize(e,t){var n,r,a,i;this._width=e,this._height=t,null===(n=this._reflectionRenderTarget)||void 0===n||n.setSize(this._width/this.parameters.renderTargetDownScale,this._height/this.parameters.renderTargetDownScale),null===(r=this._intensityRenderTarget)||void 0===r||r.setSize(this._width/this.parameters.renderTargetDownScale,this._height/this.parameters.renderTargetDownScale),null===(a=this._blurRenderTarget)||void 0===a||a.setSize(this._width/this.parameters.renderTargetDownScale,this._height/this.parameters.renderTargetDownScale),null===(i=this._reflectionIntensityMaterial)||void 0===i||i.update({_width:this._width/this.parameters.renderTargetDownScale,_height:this._height/this.parameters.renderTargetDownScale})}updateParameters(e){for(let t in e)this.parameters.hasOwnProperty(t)&&(this.parameters[t]=e[t])}updateBounds(e,t){this.parameters.groundLevel=e,this.parameters.groundReflectionScale=t}_updateCopyMaterial(e,t=1){var n;const r=this.parameters.intensity*t,a=this.parameters.brightness;this._copyMaterial.update({texture:null!==(n=null==e?void 0:e.texture)&&void 0!==n?n:void 0,colorTransform:(new P).set(a,0,0,0,0,a,0,0,0,0,a,0,0,0,0,r),multiplyChannels:0,uvTransform:Io}),this._copyMaterial.depthTest=!0,this._copyMaterial.depthWrite=!1}render(e,t,n,r=1){if(!(this.parameters.enabled&&n instanceof Z))return;const a=this._createGroundReflectionCamera(n);this._renderGroundReflection(e,t,a,this.reflectionRenderTarget),this._renderGroundReflectionIntensity(e,a,this.intensityRenderTarget),(this.parameters.blurHorizontal>0||this.parameters.blurVertical>0)&&this.blurReflection(e,n,[this.intensityRenderTarget,this.blurRenderTarget,this.intensityRenderTarget]),this._updateCopyMaterial(this.intensityRenderTarget,r),this._renderPass.renderScreenSpace(e,this._copyMaterial,e.getRenderTarget())}_renderGroundReflection(e,t,n,r){const a=e.getRenderTarget();r&&e.setRenderTarget(r),e.render(t,n),r&&e.setRenderTarget(a)}_renderGroundReflectionIntensity(e,t,n){const r=e.getRenderTarget();e.setRenderTarget(n),this._renderPass.renderScreenSpace(e,this._reflectionIntensityMaterial.update({texture:this.reflectionRenderTarget.texture,depthTexture:this.reflectionRenderTarget.depthTexture,camera:t,groundLevel:this.parameters.groundLevel,fadeOutDistance:this.parameters.fadeOutDistance*this.parameters.groundReflectionScale,fadeOutExponent:this.parameters.fadeOutExponent}),e.getRenderTarget()),e.setRenderTarget(r)}blurReflection(e,t,n){const r=new s(t.matrixWorld.elements[4],t.matrixWorld.elements[5],t.matrixWorld.elements[6]),a=this.parameters.blurHorizontal/this._width,i=this.parameters.blurVertical/this._height*Math.abs(r.dot(new s(0,0,1)));this._blurPass.render(e,n,[4*a,4*i],[4*a*(1+this.parameters.blurAscent),4*i*(1+this.parameters.blurAscent)])}_createGroundReflectionCamera(e){const t=e.clone(),n=t;return n._offset&&(n._offset={left:n._offset.left,top:1-n._offset.bottom,right:n._offset.right,bottom:1-n._offset.top}),t.position.set(e.position.x,-e.position.y+2*this.parameters.groundLevel,e.position.z),t.rotation.set(-e.rotation.x,e.rotation.y,-e.rotation.z),t.updateMatrixWorld(),t.updateProjectionMatrix(),t}}class Vl extends ft{constructor(e){super({defines:Object.assign({},Vl.shader.defines),uniforms:gt.clone(Vl.shader.uniforms),vertexShader:Vl.shader.vertexShader,fragmentShader:Vl.shader.fragmentShader,blending:vt}),this.update(e)}update(e){var t,n;if(void 0!==(null==e?void 0:e.texture)&&(this.uniforms.tDiffuse.value=null==e?void 0:e.texture),void 0!==(null==e?void 0:e.depthTexture)&&(this.uniforms.tDepth.value=null==e?void 0:e.depthTexture),(null==e?void 0:e._width)||(null==e?void 0:e._height)){const r=null!==(t=null==e?void 0:e._width)&&void 0!==t?t:this.uniforms.resolution.value.x,a=null!==(n=null==e?void 0:e._height)&&void 0!==n?n:this.uniforms.resolution.value.y;this.uniforms.resolution.value.set(r,a)}if(void 0!==(null==e?void 0:e.camera)){const t=(null==e?void 0:e.camera)||(null==e?void 0:e.camera);this.uniforms.cameraNear.value=t.near,this.uniforms.cameraFar.value=t.far,this.uniforms.cameraProjectionMatrix.value.copy(t.projectionMatrix),this.uniforms.cameraInverseProjectionMatrix.value.copy(t.projectionMatrixInverse),this.uniforms.inverseViewMatrix.value.copy(t.matrixWorld)}return void 0!==(null==e?void 0:e.groundLevel)&&(this.uniforms.groundLevel.value=null==e?void 0:e.groundLevel),void 0!==(null==e?void 0:e.fadeOutDistance)&&(this.uniforms.fadeOutDistance.value=null==e?void 0:e.fadeOutDistance),void 0!==(null==e?void 0:e.fadeOutExponent)&&(this.uniforms.fadeOutExponent.value=null==e?void 0:e.fadeOutExponent),this}}Vl.shader={uniforms:{tDiffuse:{value:null},tDepth:{value:null},resolution:{value:new i},cameraNear:{value:.1},cameraFar:{value:1},cameraProjectionMatrix:{value:new P},cameraInverseProjectionMatrix:{value:new P},inverseViewMatrix:{value:new P},groundLevel:{value:0},fadeOutDistance:{value:1},fadeOutExponent:{value:1}},defines:{PERSPECTIVE_CAMERA:1,LINEAR_TO_SRGB:1},vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n uniform sampler2D tDepth;\n uniform vec2 resolution;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform mat4 cameraProjectionMatrix;\n uniform mat4 cameraInverseProjectionMatrix;\n uniform mat4 inverseViewMatrix;\n uniform float groundLevel;\n uniform float fadeOutDistance;\n uniform float fadeOutExponent;\n varying vec2 vUv;\n\n #include <packing>\n\n float getDepth(const in vec2 screenPosition) {\n return texture2D(tDepth, screenPosition).x;\n }\n\n float getLinearDepth(const in vec2 screenPosition) {\n #if PERSPECTIVE_CAMERA == 1\n float fragCoordZ = texture2D(tDepth, screenPosition).x;\n float viewZ = perspectiveDepthToViewZ(fragCoordZ, cameraNear, cameraFar);\n return viewZToOrthographicDepth(viewZ, cameraNear, cameraFar);\n #else\n return texture2D(tDepth, screenPosition).x;\n #endif\n }\n\n float getViewZ(const in float depth) {\n #if PERSPECTIVE_CAMERA == 1\n return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);\n #else\n return 0.0;//orthographicDepthToViewZ(depth, cameraNear, cameraFar);\n #endif\n }\n\n vec3 getViewPosition(const in vec2 screenPosition, const in float depth, const in float viewZ ) {\n float clipW = cameraProjectionMatrix[2][3] * viewZ + cameraProjectionMatrix[3][3];\n vec4 clipPosition = vec4((vec3(screenPosition, depth) - 0.5) * 2.0, 1.0);\n clipPosition *= clipW;\n return (cameraInverseProjectionMatrix * clipPosition).xyz;\n }\n\n void main() {\n float verticalBias = 1.5 / resolution.y;\n vec2 uv = vUv.xy + vec2(0.0, verticalBias);\n float depth = getDepth(uv);\n float viewZ = getViewZ(depth);\n vec4 worldPosition = inverseViewMatrix * vec4(getViewPosition(uv, depth, viewZ), 1.0);\n float distance = worldPosition.y - groundLevel;\n vec4 fragColor = texture2D(tDiffuse, uv).rgba;\n #if LINEAR_TO_SRGB == 1\n fragColor.rgb = mix(fragColor.rgb * 12.92, 1.055 * pow(fragColor.rgb, vec3(0.41666)) - 0.055, step(0.0031308, fragColor.rgb));\n #endif\n float fadeOutAlpha = pow(clamp(1.0 - distance / fadeOutDistance, 0.0, 1.0), fadeOutExponent);\n fragColor.a *= fadeOutAlpha;\n gl_FragColor = fragColor * step(depth, 0.9999);\n }"};const Gl=e=>{const t=Math.atan2(e.y,e.x)/(2*Math.PI)+.5,n=Math.asin(e.z)/Math.PI+.5;return new i(t,n)};class Kl{get colorRenderTarget(){var e;return this._colorRenderTarget=null!==(e=this._colorRenderTarget)&&void 0!==e?e:new St,this._colorRenderTarget}get environmentMapDecodeTarget(){var e;return this._environmentMapDecodeTarget=null!==(e=this._environmentMapDecodeTarget)&&void 0!==e?e:new St,this._environmentMapDecodeTarget}environmentMapDecodeMaterial(e){var t,n;return e?(this._equirectangularDecodeMaterial=null!==(t=this._equirectangularDecodeMaterial)&&void 0!==t?t:new Xl(!0,!1),this._equirectangularDecodeMaterial):(this._pmremDecodeMaterial=null!==(n=this._pmremDecodeMaterial)&&void 0!==n?n:new Xl(!1,!1),this._pmremDecodeMaterial)}get camera(){var e;return this._camera=null!==(e=this._camera)&&void 0!==e?e:new $(-1,1,1,-1,-1,1),this._camera}scaleTexture(e,t,n,r){var a;this.colorRenderTarget.setSize(n,r),this._planeMesh=null!==(a=this._planeMesh)&&void 0!==a?a:new K(new At(2,2),new C({map:t}));const i=e.getRenderTarget();e.setRenderTarget(this.colorRenderTarget),e.render(this._planeMesh,this.camera),e.setRenderTarget(i);const s=this.environmentMapDecodeTarget.texture,o=new Uint8Array(n*r*4);return e.readRenderTargetPixels(this.colorRenderTarget,0,0,n,r,o),{texture:s,pixels:o}}newGrayscaleTexture(e,t,n,r){var a;const i=this.environmentMapDecodeMaterial("PMREM.cubeUv"===t.name);this.environmentMapDecodeTarget.setSize(n,r),i.setSourceTexture(t),this._planeMesh=null!==(a=this._planeMesh)&&void 0!==a?a:new K(new At(2,2),i);const s=e.getRenderTarget();e.setRenderTarget(this.environmentMapDecodeTarget),e.render(this._planeMesh,this.camera),e.setRenderTarget(s);const o=this.environmentMapDecodeTarget.texture,l=new Uint8Array(n*r*4);return e.readRenderTargetPixels(this.environmentMapDecodeTarget,0,0,n,r,l),{texture:o,pixels:l}}}const Wl={tDiffuse:{value:null}};class Xl extends ft{constructor(e,t){super({uniforms:gt.clone(Wl),vertexShader:"\n varying vec2 vUv;\n void main() {\n vUv = uv;\n gl_Position = (projectionMatrix * modelViewMatrix * vec4(position, 1.0)).xyww;\n }",fragmentShader:"\n uniform sampler2D tDiffuse;\n varying vec2 vUv;\n \n float getFace( vec3 direction ) {\n vec3 absDirection = abs( direction );\n float face = - 1.0;\n if ( absDirection.x > absDirection.z ) {\n if ( absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0.0 : 3.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n } else {\n if ( absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2.0 : 5.0;\n else\n face = direction.y > 0.0 ? 1.0 : 4.0;\n }\n return face;\n }\n\n vec2 getUV( vec3 direction, float face ) {\n vec2 uv;\n if ( face == 0.0 ) {\n uv = vec2( direction.z, direction.y ) / abs( direction.x ); // pos x\n } else if ( face == 1.0 ) {\n uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); // pos y\n } else if ( face == 2.0 ) {\n uv = vec2( - direction.x, direction.y ) / abs( direction.z ); // pos z\n } else if ( face == 3.0 ) {\n uv = vec2( - direction.z, direction.y ) / abs( direction.x ); // neg x\n } else if ( face == 4.0 ) {\n uv = vec2( - direction.x, direction.z ) / abs( direction.y ); // neg y\n } else {\n uv = vec2( direction.x, direction.y ) / abs( direction.z ); // neg z\n }\n return 0.5 * ( uv + 1.0 );\n }\n\n void main() {\n #if PMREM_DECODE == 1\n float altitude = (vUv.y - 0.5) * 3.141593;\n float azimuth = vUv.x * 2.0 * 3.141593;\n vec3 direction = vec3(\n cos(altitude) * cos(azimuth) * -1.0, \n sin(altitude), \n cos(altitude) * sin(azimuth) * -1.0\n );\n float face = getFace(direction);\n vec2 uv = getUV(direction, face) / vec2(3.0, 4.0);\n if (face > 2.5) {\n uv.y += 0.25;\n face -= 3.0;\n }\n uv.x += face / 3.0;\n vec4 color = texture2D(tDiffuse, uv);\n #else\n vec4 color = texture2D(tDiffuse, vUv);\n #endif \n #if GRAYSCALE_CONVERT == 1\n float grayscale = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722));\n //float grayscale = dot(color.rgb, vec3(1.0/3.0));\n gl_FragColor = vec4(vec3(grayscale), 1.0);\n #else\n gl_FragColor = vec4(color.rgb, 1.0);\n #endif\n }",defines:{PMREM_DECODE:e?1:0,GRAYSCALE_CONVERT:t?1:0}})}setSourceTexture(e){this.uniforms.tDiffuse.value=e}}e("a4",Xl),e("a3",class{constructor(e){var t,n,r,a;this.samplePoints=[],this.sampleUVs=[],this.grayscaleTexture={texture:new fe,pixels:new Uint8Array(0)},this.detectorTexture=new fe,this.detectorArray=new Float32Array(0),this.lightSamples=[],this.lightGraph=new Ql(0),this.lightSources=[],this._createEquirectangularSamplePoints=e=>{const t=[];for(let n=0;n<e;n++){const r=n*Math.PI*(3-Math.sqrt(5)),a=1-n/(e-1)*2,i=Math.sqrt(1-a*a),o=Math.cos(r)*i,l=Math.sin(r)*i;t.push(new s(o,l,a))}return t},this._numberOfSamples=null!==(t=null==e?void 0:e._numberOfSamples)&&void 0!==t?t:1e3,this._width=null!==(n=null==e?void 0:e._width)&&void 0!==n?n:1024,this._height=null!==(r=null==e?void 0:e._height)&&void 0!==r?r:512,this._sampleThreshold=null!==(a=null==e?void 0:e._sampleThreshold)&&void 0!==a?a:.707,this.pointDistance=Math.sqrt(4*Math.PI)/Math.sqrt(this._numberOfSamples),this.pixelDistance=Math.sqrt(2)*Math.PI*2/this._width,this.samplePoints=this._createEquirectangularSamplePoints(this._numberOfSamples),this.sampleUVs=this.samplePoints.map(e=>Gl(e))}detectLightSources(e,t,n){var r;this.textureData=n,this._textureConverter=null!==(r=this._textureConverter)&&void 0!==r?r:new Kl,this.grayscaleTexture=this._textureConverter.newGrayscaleTexture(e,t,this._width,this._height),this.detectorArray=this._redFromRgbaToNormalizedFloatArray(this.grayscaleTexture.pixels),this.detectorTexture=this._grayscaleTextureFromFloatArray(this.detectorArray,this._width,this._height),this.lightSamples=this._filterLightSamples(this._sampleThreshold),this.lightGraph=this._findClusterSegments(this.lightSamples,this._sampleThreshold),this.lightGraph.findConnectedComponents(),this.lightSources=this.createLightSourcesFromLightGraph(this.lightSamples,this.lightGraph),this.lightSources.sort((e,t)=>t.maxIntensity-e.maxIntensity)}_redFromRgbaToNormalizedFloatArray(e,t){const n=new Float32Array(e.length/4);let r=1,a=0;for(let t=0;t<e.length/4;++t){const i=e[4*t]/255;r=Math.min(r,i),a=Math.max(a,i),n[t]=i}if(t)for(let e=0;e<n.length;++e){const i=(n[e]-r)/(a-r);n[e]=Math.pow(i,t)}else for(let e=0;e<n.length;++e)n[e]=(n[e]-r)/(a-r);return n}_grayscaleTextureFromFloatArray(e,t,n){const r=t*n,a=new Uint8Array(4*r);for(let t=0;t<r;t++){const n=255*e[t];a[4*t+0]=n,a[4*t+1]=n,a[4*t+2]=n,a[4*t+3]=255}const i=new Pe(a,t,n);return i.needsUpdate=!0,i}_filterLightSamples(e){const t=[];for(let n=0;n<this.sampleUVs.length;n++){const r=this.sampleUVs[n];this._detectorTextureLuminanceValueFromUV(r)>e&&t.push(new ql(this.samplePoints[n],r))}return t}_detectorTextureLuminanceValueFromUV(e){const t=Math.floor(e.x*this._width),n=Math.floor(e.y*this._height)*this._width+t;return this.detectorArray[n]}_originalLuminanceValueFromUV(e){if(!(this.textureData&&this.textureData.data&&this.textureData._width&&this.textureData._height))return 256*this._detectorTextureLuminanceValueFromUV(e);const t=Math.floor(e.x*this.textureData._width),n=Math.floor(e.y*this.textureData._height);let r=0;for(let e=Math.max(0,t-2);e<Math.max(0,t+2);++e)for(let t=Math.max(0,n-2);t<Math.max(0,n+2);++t){const n=t*this.textureData._width+e,a=(this.textureData.data[4*n]+this.textureData.data[4*n+1]+this.textureData.data[4*n+2])/3;r=Math.max(r,a)}return r}_findClusterSegments(e,t){const n=2*this.pixelDistance,r=1.5*this.pointDistance,a=new Ql(e.length);for(let i=0;i<e.length;i++)for(let s=i+1;s<e.length;s++)if(e[i].position.angleTo(e[s].position)<r){const r=e[s].position.clone().sub(e[i].position),o=Math.floor(r.length()/n);let l=!0,h=0;for(let n=1;n<o;n++){const a=r.clone().multiplyScalar(n/o),s=Gl(e[i].position.clone().add(a).normalize());if(this._detectorTextureLuminanceValueFromUV(s)<t){if(h++,h>1){l=!1;break}}else h=0}l&&(a.adjacent[i].push(s),a.adjacent[s].push(i),a.edges.push([i,s]))}return a}createLightSourcesFromLightGraph(e,t){const n=t.components.filter(e=>e.length>1).map(t=>new Yl(t.map(t=>e[t])));return n.forEach(e=>e.calculateLightSourceProperties(e=>this._originalLuminanceValueFromUV(e))),n}});class ql{constructor(e,t){this.position=e,this.uv=t}}class Ql{constructor(e){this.edges=[],this.adjacent=[],this.components=[],this.noOfNodes=e;for(let t=0;t<e;t++)this.adjacent.push([])}findConnectedComponents(){const e=new Array(this.noOfNodes).fill(!1);this.components=[];for(let t=0;t<this.noOfNodes;t++)if(!e[t]){const n=[];this._dfs(t,e,n),this.components.push(n)}this.components.sort((e,t)=>t.length-e.length)}_dfs(e,t,n){t[e]=!0,n.push(e);for(const r of this.adjacent[e])t[r]||this._dfs(r,t,n)}}class Yl{constructor(e){this.position=new s,this.uv=new i,this.averageIntensity=0,this.maxIntensity=0,this.size=0,this.lightSamples=e}calculateLightSourceProperties(e){this.position=new s,this.averageIntensity=0,this.maxIntensity=0;for(const t of this.lightSamples){this.position.add(t.position);const n=e(t.uv);this.averageIntensity+=n,this.maxIntensity=Math.max(this.maxIntensity,n)}this.averageIntensity/=this.lightSamples.length,this.position.normalize(),this.uv=Gl(this.position);let t=0;for(const e of this.lightSamples)t+=e.position.distanceTo(this.position);t/=this.lightSamples.length,this.size=t/Math.PI}}class Zl{constructor(e){this.grayMaterial=Fa.createMeshStandardMaterial({color:12632256,side:j,envMapIntensity:.4}),this._renderPass=new Go,this._sceneRenderer=e,this._environmentMapDecodeMaterial=new Xl(!0,!1),this._environmentMapDecodeMaterial.blending=vt,this._environmentMapDecodeMaterial.depthTest=!1}get _gBufferRenderTarget(){return this._sceneRenderer.gBufferRenderTarget}get _screenSpaceShadow(){return this._sceneRenderer.screenSpaceShadow}get _shadowAndAoPass(){return this._sceneRenderer.shadowAndAoPass}get _groundReflectionPass(){return this._sceneRenderer.groundReflectionPass}get _bakedGroundContactShadow(){return this._sceneRenderer.bakedGroundContactShadow}dispose(){var e,t;null===(e=this._depthRenderMaterial)||void 0===e||e.dispose(),null===(t=this._copyMaterial)||void 0===t||t.dispose(),this.grayMaterial.dispose()}getCopyMaterial(e){var t;return this._copyMaterial=null!==(t=this._copyMaterial)&&void 0!==t?t:new Oo,this._copyMaterial.update(e)}_getDepthRenderMaterial(e){var t;return this._depthRenderMaterial=null!==(t=this._depthRenderMaterial)&&void 0!==t?t:new Uo({depthTexture:this._gBufferRenderTarget.textureWithDepthValue,depthFilter:this._gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?new pt(0,0,0,1):new pt(1,0,0,0)}),this._depthRenderMaterial.update({camera:e})}render(e,t,n,r,a,i,s){e(r,a,i),"color"!==s?("grayscale"===s?this._sceneRenderer.renderCacheManager.render("debug",a,()=>{this._renderPass.renderWithOverrideMaterial(r,a,i,this.grayMaterial,null,0,1)}):t(r,a,i),n(r,a,i),this._renderDebugPass(r,a,i,s)):r.render(a,i)}_renderDebugPass(e,t,n,r){var a,i,s,o,l,d;switch(r){default:break;case"lineardepth":this._renderPass.renderScreenSpace(e,this._getDepthRenderMaterial(n),null);break;case"g-normal":this._gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(a=this._gBufferRenderTarget)||void 0===a?void 0:a.gBufferTexture,blending:vt,colorTransform:(new P).set(.5,0,0,0,0,.5,0,0,0,0,.5,0,0,0,0,0),colorBase:new pt(.5,.5,.5,1),multiplyChannels:0,uvTransform:Eo}),null):this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(i=this._gBufferRenderTarget)||void 0===i?void 0:i.gBufferTexture,blending:vt,colorTransform:Co,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),null);break;case"g-depth":this._gBufferRenderTarget.isFloatGBufferWithRgbNormalAlphaDepth?this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(s=this._gBufferRenderTarget)||void 0===s?void 0:s.gBufferTexture,blending:vt,colorTransform:Mo,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),null):this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:null===(o=this._gBufferRenderTarget)||void 0===o?void 0:o.depthBufferTexture,blending:vt,colorTransform:To,colorBase:Ro,multiplyChannels:0,uvTransform:Eo}),null);break;case"ssao":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.shadowAndAoRenderTargets.passRenderTarget.texture,blending:vt,colorTransform:Ao,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"ssaodenoise":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.denoiseRenderTargetTexture,blending:vt,colorTransform:Ao,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowmap":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._screenSpaceShadow.shadowTexture,blending:vt,colorTransform:Ao,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadow":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.shadowAndAoRenderTargets.passRenderTarget.texture,blending:vt,colorTransform:Bl.shadowTransform,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowblur":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.denoiseRenderTargetTexture,blending:vt,colorTransform:Bl.shadowTransform,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowfadein":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.fadeRenderTarget.texture,blending:vt,colorTransform:Bl.shadowTransform,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"shadowandao":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._shadowAndAoPass.denoiseRenderTargetTexture,blending:vt,colorTransform:ko(this._shadowAndAoPass.parameters.aoIntensity,this._shadowAndAoPass.parameters.shadowIntensity,0,1),colorBase:Po,multiplyChannels:1,uvTransform:Eo}),null);break;case"groundreflection":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._groundReflectionPass.reflectionRenderTarget.texture,blending:vt,colorTransform:So,colorBase:Po,multiplyChannels:0,uvTransform:Io}),null);break;case"bakedgroundshadow":this._renderPass.renderScreenSpace(e,this.getCopyMaterial({texture:this._bakedGroundContactShadow.renderTarget.texture,blending:vt,colorTransform:So,colorBase:Po,multiplyChannels:0,uvTransform:Eo}),null);break;case"environmentmap":this._environmentMapDecodeMaterial.setSourceTexture(t.environment),this._renderPass.renderScreenSpace(e,this._environmentMapDecodeMaterial,null);break;case"lightsourcedetection":if(null===(l=t.userData)||void 0===l?void 0:l.environmentDefinition){const n=this._sceneRenderer.width/this._sceneRenderer.height,r=new $(-1,1,1/n,-1/n,-1,1),a=null===(d=t.userData)||void 0===d?void 0:d.environmentDefinition.createDebugScene(e,t);a.background=new h(16777215),e.render(a,r)}}}}var Jl;!function(e){e[e.HIGHEST=0]="HIGHEST",e[e.HIGH=1]="HIGH",e[e.MEDIUM=2]="MEDIUM",e[e.LOW=3]="LOW"}(Jl||(Jl={}));class $l{constructor(e,t,n){this.debugOutput="off",this._prevDebugOutput="off",this.outputColorSpace="",this.toneMapping="",this.environmentLights=!1,this.movingCamera=!1,this.groundLevel=0,this.uiInteractionMode=!1,this._noUpdateNeededCount=0,this._cameraUpdate=new Vo,this.width=0,this.height=0,this._maxSamples=1,this._cameraChanged=!0,this.boundingVolume=new jo,this._boundingVolumeSet=!1,this.renderCacheManager=new Xo,this._renderPass=new Go,this.selectedObjects=[],this.groundGroup=new Y,this._qualityLevel=Jl.HIGHEST,this._qualityMap=new Map,this.width=t,this.height=n,this._maxSamples=e.capabilities.maxSamples,this.renderer=e,this.renderCacheManager.registerCache("inivisibleGround",new qo(e=>e===this.groundGroup)),this.renderCacheManager.registerCache("debug",new qo),this.renderCacheManager.registerCache("floorDepthWrite",new Qo(e=>{var t;return null===(t=e.userData)||void 0===t?void 0:t.isFloor})),this.gBufferRenderTarget=new Yo(this.renderCacheManager,{shared:!0,capabilities:e.capabilities,width:this.width,height:this.height,samples:1,_renderPass:this._renderPass,textureFilter:ae}),this.shadowAndAoPass=new Bl(this.width,this.height,1,{gBufferRenderTarget:this.gBufferRenderTarget}),this.screenSpaceShadow=new ol(this.renderCacheManager,new i(this.width,this.height),{samples:this._maxSamples,alwaysUpdate:!1}),this.groundReflectionPass=new jl(this.width,this.height,{_renderPass:this._renderPass}),this.bakedGroundContactShadow=new Zo(this.renderer,this.groundGroup,{_renderPass:this._renderPass,renderCacheManager:this.renderCacheManager}),this.groundGroup.rotateX(-Math.PI/2),this.outlineRenderer=new rl(null,this.width,this.height,{gBufferRenderTarget:this.gBufferRenderTarget}),this.parameters={gBufferRenderTargetParameters:this.gBufferRenderTarget.parameters,bakedGroundContactShadowParameters:this.bakedGroundContactShadow.parameters,screenSpaceShadowMapParameters:this.screenSpaceShadow.parameters,shAndAoPassParameters:this.shadowAndAoPass.parameters,groundReflectionParameters:this.groundReflectionPass.parameters,outlineParameters:this.outlineRenderer.parameters,effectSuspendFrames:0,effectFadeInFrames:0,suspendGroundReflection:!1,shadowOnCameraChange:Ll.OFF},this._addEventListeners(this.renderer)}_addEventListeners(e){e.domElement.addEventListener("webglcontextlost",()=>{}),e.domElement.addEventListener("webglcontextrestored",()=>{this._forceEnvironmentMapUpdate(this.renderer)})}dispose(){var e,t;null===(e=this._debugPass)||void 0===e||e.dispose(),null===(t=this._copyMaterial)||void 0===t||t.dispose(),this.gBufferRenderTarget.dispose(),this.screenSpaceShadow.dispose(),this.shadowAndAoPass.dispose(),this.outlineRenderer.dispose(),this.renderer.dispose()}setSize(e,t){this.width=e,this.height=t,this.gBufferRenderTarget.setSize(e,t),this.screenSpaceShadow.setSize(e,t),this.shadowAndAoPass.setSize(e,t),this.outlineRenderer.setSize(e,t),this.groundReflectionPass.setSize(e,t),this.renderer.setSize(e,t)}getQualityLevel(){return this._qualityLevel}setQualityLevel(e){this._qualityLevel!==e&&(this._qualityMap.has(this._qualityLevel)&&(this._qualityLevel=e),this.applyCurrentParameters())}setQualityMap(e){this._qualityMap=e,this.applyCurrentParameters()}applyCurrentParameters(){this._qualityMap.has(this._qualityLevel)&&(this.updateParameters(this._qualityMap.get(this._qualityLevel)),this.bakedGroundContactShadow.applyParameters()),this.uiInteractionMode&&this.updateParameters({groundReflectionParameters:{enabled:!1}})}clearCache(){this.renderCacheManager.clearCache()}forceShadowUpdates(e){this.clearCache(),this.gBufferRenderTarget.needsUpdate=!0,this.screenSpaceShadow.forceShadowUpdate(),this.shadowAndAoPass.needsUpdate=!0,e&&(this.bakedGroundContactShadow.needsUpdate=!0)}updateParameters(e){void 0!==e.shAndAoPassParameters&&this.shadowAndAoPass.updateParameters(e.shAndAoPassParameters),void 0!==e.effectParameters&&this.shadowAndAoPass.updateParameters({effectParameters:e.effectParameters}),void 0!==e.bakedGroundContactShadowParameters&&this.bakedGroundContactShadow.updateParameters(e.bakedGroundContactShadowParameters),void 0!==e.screenSpaceShadowMapParameters&&this.screenSpaceShadow.updateParameters(e.screenSpaceShadowMapParameters),void 0!==e.groundReflectionParameters&&this.groundReflectionPass.updateParameters(e.groundReflectionParameters),void 0!==e.outlineParameters&&this.outlineRenderer.updateParameters(e.outlineParameters),void 0!==e.effectSuspendFrames&&(this.parameters.effectSuspendFrames=e.effectSuspendFrames),void 0!==e.effectFadeInFrames&&(this.parameters.effectFadeInFrames=e.effectFadeInFrames),void 0!==e.suspendGroundReflection&&(this.parameters.suspendGroundReflection=e.suspendGroundReflection),void 0!==e.shadowOnCameraChange&&(this.parameters.shadowOnCameraChange=e.shadowOnCameraChange)}addRectAreaLight(e,t){this.environmentLights=!1,this.screenSpaceShadow.addRectAreaLight(e,t),this.shadowAndAoPass.needsUpdate=!0}updateRectAreaLights(e,t){e.length>0&&(this.environmentLights=!1),this.screenSpaceShadow.updateRectAreaLights(e,t),this.shadowAndAoPass.needsUpdate=!0}createShadowFromLightSources(e,t){this.environmentLights=!0,this.screenSpaceShadow.createShadowFromLightSources(e,t),this.shadowAndAoPass.needsUpdate=!0}selectObjects(e){this.selectedObjects=e}updateBounds(e,t){this.renderCacheManager.clearCache(),this._boundingVolumeSet=!0,this.boundingVolume.updateFromBox(e);const n=this.boundingVolume.size,r=(n.x+n.y+n.z)/3,a=Math.min(n.x,n.y,n.z),i=Math.max(n.x,n.y,n.z),s=a<.5?a/.5:n.z>5?n.z/5:1;this.bakedGroundContactShadow.setScale(t?r:s,r),this.groundReflectionPass.updateBounds(this.groundLevel,Math.min(1,i)),this.screenSpaceShadow.updateBounds(this.boundingVolume,r),this.shadowAndAoPass.updateBounds(this.boundingVolume,t?r:Math.min(1,2*i))}updateNearAndFarPlaneOfPerspectiveCamera(e,t){const n=this.boundingVolume.getNearAndFarForPerspectiveCamera(e.position,3);e.near=Math.max(1e-5,.9*n[0]),e.far=Math.max(null!=t?t:e.near,n[1]),e.updateProjectionMatrix()}_setRenderState(e,t){var n;const r=this.debugOutput!==this._prevDebugOutput;this._prevDebugOutput=this.debugOutput,this.screenSpaceShadow.parameters.alwaysUpdate=this.shadowAndAoPass.parameters.alwaysUpdate,this._cameraChanged=this._cameraUpdate.changed(t),(n=this.gBufferRenderTarget).needsUpdate||(n.needsUpdate=this._cameraChanged||r)}_forceEnvironmentMapUpdate(e){const t=e.userData;if(null==t?void 0:t.environmentTexture){const e=t.environmentTexture;t.environmentTexture=void 0,e.dispose()}}_updateEnvironment(e,t){var n,r;if(!(null===(n=t.userData)||void 0===n?void 0:n.environmentDefinition))return;e.userData||(e.userData={});const a=e.userData;if(a&&((null===(r=t.userData)||void 0===r?void 0:r.environmentDefinition.needsUpdate)||!a.environmentTexture||a.environmentDefinition!==t.userData.environmentDefinition)){const n=t.userData.environmentDefinition;a.environmentDefinition=n,a.environmentTexture=n.createNewEnvironment(e),t.userData.shadowFromEnvironment&&this.createShadowFromLightSources(t,n.lightSources)}t.environment=null==a?void 0:a.environmentTexture,t.userData.showEnvironmentBackground?t.background=t.environment:t.background===t.environment&&(t.background=null)}render(e,t){e.add(this.groundGroup),this._setRenderState(e,t),this._updateEnvironment(this.renderer,e),this.outlineRenderer.updateOutline(e,t,this.movingCamera?[]:this.selectedObjects),this.renderer.setRenderTarget(null),this.debugOutput&&""!==this.debugOutput&&"off"!==this.debugOutput?this._renderDebug(this.renderer,e,t):(this.renderPreRenderPasses(this.renderer,e,t),this._renderScene(this.renderer,e,t),this.renderPostProcessingEffects(this.renderer,e,t)),e.remove(this.groundGroup)}_renderDebug(e,t,n){var r;this._debugPass=null!==(r=this._debugPass)&&void 0!==r?r:new Zl(this),this._debugPass.render((e,t,n)=>this.renderPreRenderPasses(e,t,n),(e,t,n)=>this._renderScene(e,t,n),(e,t,n)=>this.renderPostProcessingEffects(e,t,n),e,t,n,this.debugOutput)}renderPreRenderPasses(e,t,n){this._renderGroundContactShadow(t)}_renderScene(e,t,n){this.renderCacheManager.onBeforeRender("floorDepthWrite",t),this.bakedGroundContactShadow.setGroundVisibility(!0,n),e.render(t,n),this.bakedGroundContactShadow.setGroundVisibility(!1,n),this.renderCacheManager.onAfterRender("floorDepthWrite")}renderPostProcessingEffects(e,t,n){this.renderShadowAndAo(e,t,n),this._renderOutline()}_renderGroundContactShadow(e){this.bakedGroundContactShadow.needsUpdate&&this.bakedGroundContactShadow.updateBounds(this.boundingVolume,this.groundLevel),this.bakedGroundContactShadow.render(e)}renderShadowAndAo(e,t,n){const r=this._evaluateIfShadowAndAoUpdateIsNeeded(n);if(r.needsUpdate||r.shadowOnCameraChange!==Ll.OFF){if(!this.parameters.suspendGroundReflection||r.needsUpdate){const a=this.parameters.suspendGroundReflection?r.intensityScale:1;this._renderGroundReflection(e,t,n,a)}this.gBufferRenderTarget.needsUpdate=r.needsUpdate||r.shadowOnCameraChange===Ll.POISSON,this._renderEffectsWithGround(e,t,n),this._renderEffectsWithoutGround(e,t,n),this.shadowAndAoPass.render(e,t,n,this.screenSpaceShadow.shadowTexture,r.needsUpdate?Ll.FULL:r.shadowOnCameraChange,r.shadowOnCameraChange,1-r.intensityScale)}}_evaluateIfShadowAndAoUpdateIsNeeded(e){const t=this.shadowAndAoPass.parameters.alwaysUpdate||this.screenSpaceShadow.needsUpdate||this.screenSpaceShadow.shadowTypeNeedsUpdate;let n=(this.shadowAndAoPass.parameters.enabled||this.groundReflectionPass.parameters.enabled)&&(0===this.parameters.effectSuspendFrames||this._cameraChanged);n&&(this._noUpdateNeededCount=0);let r=1;return!t&&this.parameters.effectSuspendFrames>0&&(this._noUpdateNeededCount++,n=this._noUpdateNeededCount>=this.parameters.effectSuspendFrames,r=Math.max(0,Math.min(1,(this._noUpdateNeededCount-this.parameters.effectSuspendFrames)/this.parameters.effectFadeInFrames))),n=t||n,{needsUpdate:n,shadowOnCameraChange:!n||r<.99?this.parameters.shadowOnCameraChange:Ll.OFF,intensityScale:r}}_renderGroundReflection(e,t,n,r=1){this.groundReflectionPass.parameters.enabled&&this.renderCacheManager.render("inivisibleGround",t,()=>{this.groundReflectionPass.render(e,t,n,r)})}_renderEffectsWithGround(e,t,n){const r=this._boundingVolumeSet&&this.shadowAndAoPass.parameters.aoOnGround,a=this.shadowAndAoPass.parameters.shadowIntensity>0&&this._boundingVolumeSet&&this.shadowAndAoPass.parameters.shadowOnGround,i=this.bakedGroundContactShadow.shadowGroundPlane;if(r){const r=null===this.bakedGroundContactShadow.parameters.hardLayers;r&&i.setDepthWrite(!0),this.gBufferRenderTarget.render(e,t,n),r&&i.setDepthWrite(!1)}a&&(i.setReceiveShadow(!0),this.screenSpaceShadow.renderShadowMap(e,t,n),i.setReceiveShadow(!1))}_renderEffectsWithoutGround(e,t,n){const r=!this._boundingVolumeSet||!this.shadowAndAoPass.parameters.aoOnGround,a=this.shadowAndAoPass.parameters.shadowIntensity>0&&(!this._boundingVolumeSet||!this.shadowAndAoPass.parameters.shadowOnGround);(r||a)&&this.renderCacheManager.render("inivisibleGround",t,()=>{r&&this.gBufferRenderTarget.render(e,t,n),a&&this.screenSpaceShadow.renderShadowMap(e,t,n)})}_renderOutline(){if(this.outlineRenderer.outlinePassActivated&&this.outlineRenderer.outlinePass){const e=this.renderer.getClearColor(new h),t=this.renderer.getClearAlpha();"outline"===this.debugOutput&&(this.renderer.setClearColor(0,255),this.renderer.clear(!0,!1,!1)),this.outlineRenderer.outlinePass.renderToScreen=!1,this.outlineRenderer.outlinePass.render(this.renderer,null,null,0,!1),"outline"===this.debugOutput&&this.renderer.setClearColor(e,t)}}}class eh{constructor(e){this._qualityLevel="",this._ambientOcclusionType="",this._sceneRenderer=e}addGUI(e,t){this._addRepresentationalGUI(e,t),this._addDebugGUI(e,t);const n=e.addFolder("Shadow type");this._addShadowTypeGUI(n,t);const r=e.addFolder("Shadow and Ambient Occlusion");this._addShadowAndAoGUI(r,t);const a=e.addFolder("Ground Reflection");this._addGroundReflectionGUI(a,t);const i=e.addFolder("Baked Ground Contact Shadow");this._addBakedGroundContactShadowGUI(i,t);const s=e.addFolder("Outline");this._addOutlineGUI(s,t)}_addRepresentationalGUI(e,t){const n=new Map([["LinearSRGBColorSpace",Ce],["SRGBColorSpace",M]]),r=[];n.forEach((e,t)=>{r.push(t),this._sceneRenderer.renderer.outputColorSpace===e&&(this._sceneRenderer.outputColorSpace=t)}),e.add(this._sceneRenderer,"outputColorSpace",r).onChange(e=>{var r;n.has(e)&&(this._sceneRenderer.renderer.outputColorSpace=null!==(r=n.get(e))&&void 0!==r?r:M,t())});const a=new Map([["NoToneMapping",qt],["LinearToneMapping",Qt],["ReinhardToneMapping",Yt],["CineonToneMapping",Zt],["ACESFilmicToneMapping",Jt]]),i=[];a.forEach((e,t)=>{i.push(t),this._sceneRenderer.renderer.toneMapping===e&&(this._sceneRenderer.toneMapping=t)}),e.add(this._sceneRenderer,"toneMapping",i).onChange(e=>{var n;a.has(e)&&(this._sceneRenderer.renderer.toneMapping=null!==(n=a.get(e))&&void 0!==n?n:qt,t())})}_addDebugGUI(e,t){const n=new Map([["HIGHEST",Jl.HIGHEST],["HIGH",Jl.HIGH],["MEDIUM",Jl.MEDIUM],["LOW",Jl.LOW]]),r=[];n.forEach((e,t)=>r.push(t)),e.add(this,"_qualityLevel",r).onChange(e=>{var t;n.has(e)&&this._sceneRenderer.setQualityLevel(null!==(t=n.get(e))&&void 0!==t?t:Jl.HIGHEST)}),e.add(this._sceneRenderer,"debugOutput",{"off ":"off","grayscale (no textures)":"grayscale","color buffer":"color","linear depth":"lineardepth","g-buffer normal vector":"g-normal","g-buffer depth":"g-depth","AO pure":"ssao","AO denoised":"ssaodenoise","shadow map":"shadowmap","shadow Monte Carlo":"shadow","shadow blur":"shadowblur","shadow fade in":"shadowfadein","shadow and AO":"shadowandao","ground reflection":"groundreflection","baked ground shadow":"bakedgroundshadow","selection outline":"outline","environment map":"environmentmap","light source detection":"lightsourcedetection"}).onChange(()=>t())}_addShadowTypeGUI(e,t){const n=this._sceneRenderer.screenSpaceShadow.shadowConfiguration,r=[];n.types.forEach((e,t)=>{r.push(t)});const a=()=>{this._sceneRenderer.screenSpaceShadow.needsUpdate=!0,this._sceneRenderer.screenSpaceShadow.shadowTypeNeedsUpdate=!0,this._sceneRenderer.shadowAndAoPass.needsUpdate=!0,t()};e.add(n,"shadowType",r).onChange(e=>{this._sceneRenderer.screenSpaceShadow.switchType(e)&&(i.object=n.currentConfiguration,s.object=n.currentConfiguration,o.object=n.currentConfiguration,i.updateDisplay(),s.updateDisplay(),o.updateDisplay(),a())});const i=e.add(n.currentConfiguration,"bias",-.001,.001,1e-5).onChange(()=>a()),s=e.add(n.currentConfiguration,"normalBias",-.05,.05).onChange(()=>a()),o=e.add(n.currentConfiguration,"radius",0,100).onChange(()=>a())}_addShadowAndAoGUI(e,t){const n=()=>{this._sceneRenderer.gBufferRenderTarget.needsUpdate=!0,this._sceneRenderer.screenSpaceShadow.needsUpdate=!0,this._sceneRenderer.shadowAndAoPass.needsUpdate=!0,this._sceneRenderer.shadowAndAoPass.shadowAndAoRenderTargets.parametersNeedsUpdate=!0,t()},r=this._sceneRenderer.shadowAndAoPass.parameters,a=r.shAndAo,i=this._sceneRenderer.screenSpaceShadow.parameters,s=r.ssao,o=r.hbao,l=r.poissonDenoise;e.add(r,"enabled").onChange(()=>n());const h=new Map([["none",Ul.NONE],["SSAO",Ul.SSAO],["effects SSAO",Ul.EffectsSSAO],["effects HBAO",Ul.EffectsHBAO]]),d=Array.from(h.keys());h.forEach((e,t)=>{e===r.aoType&&(this._ambientOcclusionType=t)}),e.add(this,"_ambientOcclusionType",d).onChange(e=>{var t;h.has(e)&&(r.aoType=null!==(t=h.get(e))&&void 0!==t?t:Ul.SSAO,n())}),e.add(r,"aoIntensity",0,1).onChange(()=>{n()}),e.add(r,"aoOnGround").onChange(()=>{n()}),e.add(r,"shadowOnGround").onChange(()=>{n()}),e.add(r,"shadowIntensity",0,1).onChange(()=>n()),e.add(r,"alwaysUpdate").onChange(()=>n());const c=e.addFolder("Shadow and Monte Carlo integration");c.add(i,"maximumNumberOfLightSources").onChange(()=>n()),c.add(i,"directionalDependency",0,1,.01).onChange(()=>n()),c.add(i,"directionalExponent",0,2,.01).onChange(()=>n()),c.add(i,"groundContainment",0,1,.01).onChange(()=>n()),c.add(i,"fadeOutDistance",0,5,.01).onChange(()=>n()),c.add(i,"fadeOutBlur",0,100).onChange(()=>n()),c.add(a,"shadowRadius",.001,.5).onChange(()=>n());const u=e.addFolder("Roomle SSAO");u.add(a,"aoFadeout",0,1).onChange(()=>n()),u.add(a,"aoKernelRadius",.001,1).onChange(()=>n()),u.add(a,"aoDepthBias",1e-4,.01).onChange(()=>n()),u.add(a,"aoMaxDistance",.01,1).onChange(()=>n()),u.add(a,"aoMaxDepth",.9,1).onChange(()=>n());const p=e.addFolder("effects SSAO");p.add(s,"resolutionScale",.25,1,.25).onChange(()=>n()),p.add(s,"spp",1,64,1).onChange(()=>n()),p.add(s,"distance",.1,10,.1).onChange(()=>n()),p.add(s,"distancePower",0,2,.125).onChange(()=>n()),p.add(s,"bias",0,500,1).onChange(()=>n()),p.add(s,"power",.5,32,.5).onChange(()=>n()),p.add(s,"thickness",0,.1,.001).onChange(()=>n());const m=e.addFolder("effects HBAO");m.add(o,"resolutionScale",.25,1,.2).onChange(()=>n()),m.add(o,"spp",1,64,1).onChange(()=>n()),m.add(o,"distance",.1,10,.01).onChange(()=>n()),m.add(o,"distancePower",.1,10,.1).onChange(()=>n()),m.add(o,"bias",0,100,1).onChange(()=>n()),m.add(o,"power",.5,8,.5).onChange(()=>n()),m.add(o,"thickness",0,.1,.001).onChange(()=>n());const f=e.addFolder("Possion Denoise");f.add(l,"iterations",0,3,1).onChange(()=>n()),f.add(l,"radius",0,32,1).onChange(()=>n()),f.add(l,"rings",0,16,.125).onChange(()=>n()),f.add(l,"samples",0,32,1).onChange(()=>n()),f.add(l,"lumaPhi",0,20,.001).onChange(()=>n()),f.add(l,"depthPhi",0,20,.001).onChange(()=>n()),f.add(l,"normalPhi",0,20,.001).onChange(()=>n())}_addGroundReflectionGUI(e,t){const n=this._sceneRenderer.parameters.groundReflectionParameters;e.add(n,"enabled"),e.add(n,"intensity",0,1).onChange(()=>t()),e.add(n,"fadeOutDistance",0,4).onChange(()=>t()),e.add(n,"fadeOutExponent",.1,10).onChange(()=>t()),e.add(n,"brightness",0,2).onChange(()=>t()),e.add(n,"blurHorizontal",0,10).onChange(()=>t()),e.add(n,"blurVertical",0,10).onChange(()=>t())}_addBakedGroundContactShadowGUI(e,t){const n=()=>{this._sceneRenderer.bakedGroundContactShadow.applyParameters(),t()},r=this._sceneRenderer.parameters.bakedGroundContactShadowParameters;e.add(r,"enabled"),e.add(r,"cameraHelper").onChange(()=>n()),e.add(r,"alwaysUpdate"),e.add(r,"fadeIn"),e.add(r,"blurMin",0,.2,.001).onChange(()=>n()),e.add(r,"blurMax",0,.5,.01).onChange(()=>n()),e.add(r,"fadeoutFalloff",0,1,.01).onChange(()=>n()),e.add(r,"fadeoutBias",0,.5).onChange(()=>n()),e.add(r,"opacity",0,1,.01).onChange(()=>n()),e.add(r,"maximumPlaneSize",0,50,1).onChange(()=>n()),e.add(r,"cameraFar",.1,10,.1).onChange(()=>n())}_addOutlineGUI(e,t){const n=()=>{this._sceneRenderer.outlineRenderer.applyParameters(),t()},r=this._sceneRenderer.outlineRenderer.parameters;e.add(r,"enabled"),e.add(r,"edgeStrength",.5,20).onChange(()=>n()),e.add(r,"edgeGlow",0,20).onChange(()=>n()),e.add(r,"edgeThickness",.5,20).onChange(()=>n()),e.add(r,"pulsePeriod",0,5).onChange(()=>n()),e.addColor(r,"visibleEdgeColor").onChange(()=>n()),e.addColor(r,"hiddenEdgeColor").onChange(()=>n())}}const th={effectSuspendFrames:0,effectFadeInFrames:0,suspendGroundReflection:!1,shadowOnCameraChange:Ll.FULL},nh={effectSuspendFrames:5,effectFadeInFrames:5,suspendGroundReflection:!1,shadowOnCameraChange:Ll.POISSON},rh={effectSuspendFrames:5,effectFadeInFrames:5,suspendGroundReflection:!0,shadowOnCameraChange:Ll.HARD},ah={iterations:1,radius:10,rings:5.625,lumaPhi:10,depthPhi:12,normalPhi:3.25,samples:16},ih=e("a7",new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:{enabled:!0,aoOnGround:!0,shadowOnGround:!0,poissonDenoise:ah},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:{enabled:!1}}],[Jl.HIGH,{...nh,shAndAoPassParameters:{enabled:!0,aoOnGround:!0,shadowOnGround:!0,poissonDenoise:ah},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:{enabled:!1}}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:{enabled:!0,aoOnGround:!0,shadowOnGround:!0,poissonDenoise:ah},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:{enabled:!1}}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:{enabled:!0}}]])),sh=new $t;sh.enable(3);const oh=new $t;oh.disableAll(),oh.enable(9);const lh={enabled:!0,aoType:Ul.SSAO,aoIntensity:.5,shadowIntensity:0,aoOnGround:!0,shadowOnGround:!1,poissonDenoise:ah},hh={enabled:!0,aoType:Ul.EffectsHBAO,aoIntensity:.5,shadowIntensity:0,aoOnGround:!0,shadowOnGround:!1,poissonDenoise:{iterations:1,radius:10,rings:5.625,lumaPhi:10,depthPhi:2,normalPhi:3.25,samples:16}},dh=hh,ch={enabled:!0,fadeoutFalloff:.9,blurMax:.1,opacity:.5,hardLayers:null,softLayers:null,polygonOffset:2},uh={enabled:!0,fadeoutFalloff:.8,blurMax:.15,opacity:.5,hardLayers:oh,softLayers:null,polygonOffset:-1},ph={enabled:!1},mh=new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:lh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:ch}],[Jl.HIGH,{...nh,shAndAoPassParameters:lh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:ch}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:lh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!0},bakedGroundContactShadowParameters:ch}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ch}]]),fh=new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:hh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}],[Jl.HIGH,{...nh,shAndAoPassParameters:hh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:hh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:uh}]]),gh=new Map([[Jl.HIGHEST,{...th,shAndAoPassParameters:dh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}],[Jl.HIGH,{...nh,shAndAoPassParameters:dh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}],[Jl.MEDIUM,{...rh,shAndAoPassParameters:dh,screenSpaceShadowMapParameters:{layers:sh},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}],[Jl.LOW,{shAndAoPassParameters:{enabled:!1,aoOnGround:!1,shadowOnGround:!1},groundReflectionParameters:{enabled:!1},bakedGroundContactShadowParameters:ph}]]);class vh{constructor(){this._index=0,this._prevTime=0,this._frames=0,this._fps=-1,this._fpsList=Array(2).fill(0),this._prevTime=(performance||Date).now(),this.reset()}update(){this._frames++;const e=(performance||Date).now();e>=this._prevTime+1e3&&(this._fpsList[this._index%2]=1e3*this._frames/(e-this._prevTime),this._index>=2&&(this._fps=this._fpsList.reduce((e,t)=>e+t)/this._fpsList.length),this._prevTime=e,this._frames=0,this._index++)}start(){this._prevTime=(performance||Date).now(),this._frames=0}reset(){this._fps=-1,this._fpsList=Array(2).fill(0),this._index=0}getFps(){return this._fps}}var _h;e("af",_h),function(e){e[e.Mode3D=0]="Mode3D",e[e.Mode2D=1]="Mode2D"}(_h||e("af",_h={}));class wh{get renderer(){return this._renderer}get screenSpaceShadowParameters(){return this.sceneRenderer.screenSpaceShadow.parameters}get shadowAndAoPassParameters(){return this.sceneRenderer.shadowAndAoPass.parameters}get bakedGroundContactShadowParameters(){return this.sceneRenderer.bakedGroundContactShadow.parameters}get groundReflectionParameters(){return this.sceneRenderer.groundReflectionPass.parameters}get outlineParameters(){return this.sceneRenderer.outlineRenderer.parameters}constructor(e,t,n){this.configuratorMode=!0,this.uiInteractionMode=!0,this._renderer=e,this.sceneRenderer=new $l(this._renderer,t,n),this.outlineParameters.enabled=!0,this.outlineParameters.edgeStrength=2,this.outlineParameters.edgeGlow=1,this.outlineParameters.edgeThickness=2,this.outlineParameters.pulsePeriod=0,this.outlineParameters.usePatternTexture=!1,this.outlineParameters.visibleEdgeColor=16777215,this.outlineParameters.hiddenEdgeColor=16777215,wh.enableRectAreaLightShadow&&(on.rectAreaLightReplacement=!1,on.rectAreaLightLoadingListener=this.loadRectAreLight),this.sceneRenderer.setQualityLevel(Jl.HIGHEST),this.SceneRendererGUI=new eh(this.sceneRenderer)}dispose(){this.sceneRenderer.dispose()}setSize(e,t){this.sceneRenderer.setSize(e,t)}setAutoQuality(e){!this._fpsCounter&&e?this._fpsCounter=new vh:this._fpsCounter&&!e&&(this._fpsCounter=null)}setQualityLevel(e){this.sceneRenderer.setQualityLevel(e)}setQualityMap(e){this.sceneRenderer.setQualityMap(e)}enableUiInteractionMode(){this.sceneRenderer.uiInteractionMode=!0,this.sceneRenderer.applyCurrentParameters()}disableUiInteractionMode(){this.sceneRenderer.uiInteractionMode=!1,this.sceneRenderer.applyCurrentParameters()}loadRectAreLight(e){wh.rectAreaLightsNeedsUpdate=!0}updateRectAreaLight(e){let t=[];e.traverse(e=>{e instanceof o&&t.push(e)}),this.sceneRenderer.updateRectAreaLights(t,e),wh.rectAreaLightsNeedsUpdate=!1}clearCache(){this.sceneRenderer.clearCache()}forceShadowUpdates(e){this.sceneRenderer.forceShadowUpdates(e)}switchToConfigurator(){this.configuratorMode=!0,this.sceneRenderer.setQualityMap(mh)}switchToPlanner(e){_h.Mode3D,this.configuratorMode=!1,e===_h.Mode3D?this.sceneRenderer.setQualityMap(fh):this.sceneRenderer.setQualityMap(gh)}updateBounds(e){this.sceneRenderer.updateBounds(e,!1)}updateEnvironment(e,t=!1){e&&this.updateBounds(e)}movingCameraStarts(){var e;this.sceneRenderer.movingCamera=!0,null===(e=this._fpsCounter)||void 0===e||e.start()}movingCameraStops(){this.sceneRenderer.movingCamera=!1}highlightObjects(e){this.sceneRenderer.selectObjects(e)}render(e,t){var n;wh.rectAreaLightsNeedsUpdate&&this.updateRectAreaLight(e),t.updateMatrixWorld(),(t instanceof Z||t instanceof $)&&t.updateProjectionMatrix();const r=wh.updateNearAndFarPlaneOfPerspectiveCamera?this.createRenderCamera(t):t;if(this.sceneRenderer.render(e,r),this.sceneRenderer.movingCamera&&this._fpsCounter){null===(n=this._fpsCounter)||void 0===n||n.update();const e=this.sceneRenderer.getQualityLevel(),t=this._fpsCounter.getFps();t>0&&t<30&&e<3&&(this.sceneRenderer.setQualityLevel(e+1),this._fpsCounter.reset())}}createRenderCamera(e){const t=e.clone();return this.configuratorMode&&t instanceof Z&&(this.sceneRenderer.updateNearAndFarPlaneOfPerspectiveCamera(t,120),t.updateProjectionMatrix()),t}showGUI(e){const t=qa();this.SceneRendererGUI.addGUI(t,e)}clear(){this.renderer.clear()}}e("a6",wh),wh.enableRectAreaLightShadow=!0,wh.rectAreaLightsNeedsUpdate=!1,wh.updateNearAndFarPlaneOfPerspectiveCamera=!1;class bh{_getRoomleRenderer(e=!1){if(!this._roomleRenderer){const t=new en({antialias:!e,alpha:!0});t.outputColorSpace=M,t.autoClear=!0,t.setSize(1024,1024),t.outputColorSpace=M,t.autoClear=!1,t.shadowMap.enabled=!0,t.shadowMap.type=Nt,this._roomleRenderer=new wh(t,1024,1024),this._roomleRenderer.setQualityMap(ih),this._roomleRenderer.setSize(1024,1024)}return this._roomleRenderer}switchToPlannerSettings(){this._getRoomleRenderer().switchToPlanner(_h.Mode3D)}switchToConfiguratorSettings(){this._getRoomleRenderer().switchToConfigurator()}static getCameraTargetForBBox(e,t=0){if(!e){const e=new s;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new s);return n.addScalar(t),{center:e.getCenter(new s),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}preparePerspectiveImage(e,t,n,r,a={},i=0,s=!1){return new Promise(o=>{const{size:l=1024,showDimensions:h}=a,d=this._getRoomleRenderer(s);d.setSize(l,l);const c=e.fog?e.fog.clone():null,u=e.background?e.background.clone():null;e.background=null,e.fog=null,n.layers.disable(2),n.layers.disable(6),n.layers.disable(5),h?n.layers.enable(8):n.layers.disable(8);const p=-30+xr(i);bh.placeCameraForPerspectiveImage(n,r,-20,p);const m=this._render(d,e,t,n,s);n.layers.enable(2),n.layers.enable(6),n.layers.enable(5),e.background=u,e.fog=c,o({image:m,width:l,height:l,blob:null})})}renderPerspectiveImage(e,t,n,r){return new Promise(a=>{r||(r=1024);const i=this._getRoomleRenderer();i.setSize(r,r);const s=e.fog?e.fog.clone():null,o=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(6),t.layers.disable(5),n?bh.placeCameraForPerspectiveImage(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix());const l=this._render(i,e,null,t);t.layers.enable(2),t.layers.enable(6),t.layers.enable(5),e.background=o,e.fog=s,a({image:l,width:r,height:r,blob:null})})}static placeCameraForPerspectiveImage(e,t,n,r){e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(yr(r)),e.rotateX(yr(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}prepareTopImage(e,t,n,r={}){const{showDimensions:a=!1}=r;return new Promise(r=>{const i=this._getRoomleRenderer();let s=new $(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);s.position.copy(n.center),s.rotateX(yr(-90)),s.translateZ(n.bounds.y+1),s.far=s.position.y+.5,s.layers.mask=65535;let o=200*n.bounds.x,l=200*n.bounds.z;if(o>4096||l>4096){let e=0;o>4096?e=o/4096:l>4096&&(e=l/4096),o/=e,l/=e}i.setSize(o,l);let h=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null,s.layers.disable(2),s.layers.disable(6),s.layers.disable(5),a?s.layers.enable(8):s.layers.disable(8);const c=this._render(i,e,t,s);s.layers.enable(2),s.layers.enable(6),s.layers.enable(5),e.background=d,e.fog=h,r({image:c,width:o,height:l,blob:null})})}_render(e,t,n,r,a=!1){a?e.renderer.render(t,r):(e.forceShadowUpdates(!0),e.render(t,r),e.render(t,r)),n&&(e.renderer.autoClear=!1,e.renderer.clearDepth(),e.renderer.render(n,r),e.renderer.autoClear=!0);const i=e.renderer.domElement.toDataURL();return e.clear(),i}}e("r",bh);const yh=e("I",[new nn("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let r=n.length;for(let e=0;e<r;e++){const r=n[e];r.apply(r,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let r=n.length;for(let e=0;e<r;e++)if(n[e]===t)return n.splice(e,1),r--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new nn("form-data-util",an),new nn("hdr-environment-loader",class{constructor(e){this._creator_=e;const t=new h("#DDDDDD");this._environmentMap=((e,t,n,r)=>{const a=new Te;a.format=Ae,a.generateMipmaps=!1;for(let r=0;r<6;++r){const i=Ha(e,t,n,1);i.format=a.format,i.type=a.type,i.minFilter=a.minFilter,i.magFilter=a.magFilter,i.generateMipmaps=a.generateMipmaps,i.needsUpdate=!0,a.images[r]=i}return a.needsUpdate=!0,a})(t.r,t.g,t.b)}async loadUrl(e,t){const n=t.toLowerCase();this._environmentMap=n.endsWith(".exr")?await this._loadExr(t):await this._loadRgbe(t),this._environmentMap.mapping=ut;const r={url:t,environmentMap:this._environmentMap};return this._envChangedCallback(r),r}_loadExr(e){var t;return this._exrLoader=null!==(t=this._exrLoader)&&void 0!==t?t:new bo,this._exrLoader.setPath(e.startsWith("http")?"":n()),this._exrLoader.loadAsync(e)}_loadRgbe(e){var t;return this._rgbeLoader=null!==(t=this._rgbeLoader)&&void 0!==t?t:new yo,this._rgbeLoader.setPath(e.startsWith("http")?"":n()),this._rgbeLoader.loadAsync(e)}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}}),new nn("static-item-loader",class{constructor(e){this._gltfLoaderGuard=new Sn,this._creator_=e,this._initLoaders()}_initLoaders(){this._gltfLoader=new Tn;const e=new vr,t=e._loadLibrary.bind(e._loadLibrary);e._loadLibrary=(e,r)=>{const a=wr[e];if(!a)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(wr));return t(n()+a,r)},e.setDecoderConfig({type:"wasm"}),this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,r,a,i,s,o){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,r,a,i,s))},e=>{o&&o(e.loaded/e.total)},e=>{h(e)})})}async loadGLTF(e,t,n,r,a,i,s,o){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,r,a,i,s))},e=>{o&&o(e.loaded/e.total)},e=>{h(e)})})}_handleGLTFScene(e,t,n,r,a,i,o,l){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;n&&t.scene.position.copy(n),r&&(t.scene.rotation.y=r);const d=new we;if(d.setFromObject(t.scene),a){const{x:e,y:n,z:r}=d.getSize(new s);let i=new s(a.x/e,a.y/n,a.z/r);t.scene.scale.copy(i)}return i&&t.scene.scale.multiply(i),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof K){if(e.layers.set(3),e.material instanceof H){const t=e.material;if(l&&o&&o>0){let e=new h(o);t.color=e.copySRGBToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),{boundingBox:d,scene:t.scene}}},0),new nn("form-data-util",an),new nn("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((r,a)=>{let i=this._promises.get(e),s=!0;if(!i){const t=new Map;this._promises.set(e,t),i=this._promises.get(e),s=!1}i.get(t)||(i.set(t,[]),s=!1);const o=i.get(t);o.push({resolve:r,reject:a}),i.set(t,o);const l=()=>{i.delete(t),0===i.size&&this._promises.delete(e)};s||new Promise(n).then(e=>{i.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{i.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new nn("dynamic-light-setting-loader",on),new nn("network-layer",un),new nn("local-storage",class{constructor(e){this._context_=e}get _localStorage(){let e=null;try{e=window.localStorage}catch(e){console.error(e)}return e}getItem(e){if(!this._localStorage)return null;const t=this._localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}setItem(e,t){if(this._localStorage)try{const n=JSON.stringify(t);this._localStorage.setItem(e,n)}catch(e){console.error(e)}}}),new nn("network-layer",un),new nn("kernel-io",vn,0),new nn("data-syncer",xn),new nn("memory-manager",class{constructor(){this._configurationStringSet=new Set,this._singleLoadCounter=0}loadingConfigurationString(){this._singleLoadCounter+=1}loadingConfiguration(e){this._configurationStringSet.add(e),this._singleLoadCounter+=1}shouldHardReset(){return this._configurationStringSet.size>=15||this._singleLoadCounter>=30}executedHardReset(){this._configurationStringSet.clear(),this._singleLoadCounter=0}}),new nn("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let r=0;r<n;r++)t[r]===e&&(t.splice(r,1),r--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new nn("local-storage-helper",br),new nn("cache-holder",class{constructor(){this._componentCache=new Map,this._geometryCache=new Map,this._materialCache=new Map}get componentCache(){return this._componentCache}get geometryCache(){return this._geometryCache}get materialCache(){return this._materialCache}clear(){for(const e of this._componentCache.values())Za(e);for(const e of this._materialCache.values())ei(e);for(const e of this._geometryCache.values())$a(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new nn("kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new nn("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(r=>r.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,r){this._callbackListener.forEach(a=>a.updateParameters(e,t,n,r))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new nn("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new nn("init-data",oi,1),new nn("global-init-data",hi,0),new nn("global-callback",ci,0),new nn("dom-helper",ui,1),new nn("unit-formatter",Gs,0),new nn("plugin-system",pi,1),new nn("configurator-mesh-generator",gi),new nn("configurator-input-manager",class extends xi{},1),new nn("selection-handler",class extends vi{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new Si({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new Si({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new Si({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Si({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new Si({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Si({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new nn("component-dimensioning-helper",Ii,1),new nn("component-dimensioning-helper",Ii,1),new nn("planner-kernel-access",Ns),new nn("planner-mesh-generator",Bs,1),new nn("unit-formatter",Gs),new nn("configurator-history",Ks,1),new nn("roomle-planner-ui-callback",class extends di{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onCameraIdle=()=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,r,a)=>{},this.onSelectionCancel=e=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=(e,t)=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.onUpdateWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.onUpdatePlanObjectPositions=e=>{},this.onDrawCancel=()=>{},this.onHandlerSwitchedPlans=()=>{},this.onDragElementStart=()=>{},this.onDragElementEnd=()=>{},this.onClickElement=e=>{},this.onMultiSelectionChange=e=>{}}}),new nn("configurator-ui-callbacks",class extends di{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onZoomToComponent=()=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,a)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{},this.onClickComponent=e=>{},this.onRequestExternalMesh=(e,t)=>{},this.onGeometryReady=e=>{},this.onGeometryNotReady=e=>{}}},1),new nn("roomle-tools-core",Ws,0),new nn("image-renderer",bh,0)]);class xh{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new tn,window.__RML__DI__.addDependencyInjectionAssignments(yh))}static setup(e){xh.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return xh._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){xh._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("b",xh)}}}));
9
+ //# sourceMappingURL=roomle-dependency-injection-ef0888c0.legacy.js.map