@roomle/web-sdk 5.1.0-alpha.4 → 5.1.0-alpha.6

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 (137) hide show
  1. package/lib/{BufferGeometry-Bl5whHAB.mjs → BufferGeometry-CxlpBjLq.mjs} +192 -195
  2. package/lib/BufferGeometry-CxlpBjLq.mjs.map +1 -0
  3. package/lib/ConfiguratorKernel.wasm +0 -0
  4. package/lib/{GLTFExporter-yQ7mMauu.mjs → GLTFExporter-DeNw0qAI.mjs} +86 -80
  5. package/lib/GLTFExporter-DeNw0qAI.mjs.map +1 -0
  6. package/lib/GaussianBlurNode-BR1cKBsX.mjs +65 -0
  7. package/lib/GaussianBlurNode-BR1cKBsX.mjs.map +1 -0
  8. package/lib/{Object3D-BHdngbxB.mjs → Object3D-CALIQdg1.mjs} +142 -59
  9. package/lib/Object3D-CALIQdg1.mjs.map +1 -0
  10. package/lib/{Pass-DLiMLT5k.mjs → Pass-DCljS3Z-.mjs} +4 -4
  11. package/lib/{Pass-DLiMLT5k.mjs.map → Pass-DCljS3Z-.mjs.map} +1 -1
  12. package/lib/{PointLightHelper-CuPSBuDU.mjs → PointLightHelper-C_0CYp7R.mjs} +35 -32
  13. package/lib/PointLightHelper-C_0CYp7R.mjs.map +1 -0
  14. package/lib/RoomleCore.wasm +0 -0
  15. package/lib/RoomleToolsCore.wasm +0 -0
  16. package/lib/{SpotLightHelper-m-Rh8vGU.mjs → SpotLightHelper-UUIHn43T.mjs} +22 -19
  17. package/lib/SpotLightHelper-UUIHn43T.mjs.map +1 -0
  18. package/lib/{USDZExporter-MdkuT226.mjs → USDZExporter-BBNw7Hey.mjs} +6 -3
  19. package/lib/USDZExporter-BBNw7Hey.mjs.map +1 -0
  20. package/lib/{Vector4-C7TlIAyy.mjs → Vector4-BOcWTZJI.mjs} +2 -2
  21. package/lib/Vector4-BOcWTZJI.mjs.map +1 -0
  22. package/lib/{api-Bznmr-xZ.mjs → api-ClfVJAUd.mjs} +2 -2
  23. package/lib/{api-Bznmr-xZ.mjs.map → api-ClfVJAUd.mjs.map} +1 -1
  24. package/lib/asset-loader.worker-CzI1oyTY.mjs.map +1 -1
  25. package/lib/{banana-for-scale-DpKXNBt_.mjs → banana-for-scale-Cf41yXTl.mjs} +3 -3
  26. package/lib/{banana-for-scale-DpKXNBt_.mjs.map → banana-for-scale-Cf41yXTl.mjs.map} +1 -1
  27. package/lib/budgeteer.sw-D80jTmYa.mjs.map +1 -1
  28. package/lib/{common-utils-DbL4tku0.mjs → common-utils-OTJQGohe.mjs} +3 -3
  29. package/lib/common-utils-OTJQGohe.mjs.map +1 -0
  30. package/lib/{component-dimensioning-BaUqwqYJ.mjs → component-dimensioning-yPK46Y5o.mjs} +26 -26
  31. package/lib/{component-dimensioning-BaUqwqYJ.mjs.map → component-dimensioning-yPK46Y5o.mjs.map} +1 -1
  32. package/lib/{component-raycast-helper-4i8b4E5B.mjs → component-raycast-helper-CnpnRaFg.mjs} +15 -15
  33. package/lib/{component-raycast-helper-4i8b4E5B.mjs.map → component-raycast-helper-CnpnRaFg.mjs.map} +1 -1
  34. package/lib/{configurator-CDw_c6tB.mjs → configurator-BM31Kt-5.mjs} +4 -4
  35. package/lib/{configurator-CDw_c6tB.mjs.map → configurator-BM31Kt-5.mjs.map} +1 -1
  36. package/lib/configurator-CRQg04Bp.mjs +2 -0
  37. package/lib/{continuous-drawing-helper-DqHIR_qF.mjs → continuous-drawing-helper-CTfGRTfH.mjs} +3 -3
  38. package/lib/{continuous-drawing-helper-DqHIR_qF.mjs.map → continuous-drawing-helper-CTfGRTfH.mjs.map} +1 -1
  39. package/lib/dimensioning-helper-CQlesi-m.mjs +2 -0
  40. package/lib/{dimensioning-helper-CGPjS2hW.mjs → dimensioning-helper-DSlkLDmx.mjs} +42 -36
  41. package/lib/dimensioning-helper-DSlkLDmx.mjs.map +1 -0
  42. package/lib/{glb-viewer-B-Zr743e.mjs → glb-viewer-B2si39v2.mjs} +33 -33
  43. package/lib/{glb-viewer-B-Zr743e.mjs.map → glb-viewer-B2si39v2.mjs.map} +1 -1
  44. package/lib/glb-viewer-DWybhP87.mjs +2 -0
  45. package/lib/{highlight-coordinator-4gkjde82.mjs → highlight-coordinator-DU6oFunq.mjs} +6 -6
  46. package/lib/{highlight-coordinator-4gkjde82.mjs.map → highlight-coordinator-DU6oFunq.mjs.map} +1 -1
  47. package/lib/{homag-intelligence-D7S7r-Gc.mjs → homag-intelligence-CSBo-iks.mjs} +3 -3
  48. package/lib/{homag-intelligence-D7S7r-Gc.mjs.map → homag-intelligence-CSBo-iks.mjs.map} +1 -1
  49. package/lib/{hosek-wilkie-sky-iMar2iw-.mjs → hosek-wilkie-sky-DmTvnxMA.mjs} +33 -33
  50. package/lib/{hosek-wilkie-sky-iMar2iw-.mjs.map → hosek-wilkie-sky-DmTvnxMA.mjs.map} +1 -1
  51. package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs → imos-ix-poc-export-helper-BGN97m8W.mjs} +3 -3
  52. package/lib/{imos-ix-poc-export-helper-CyGqK7nu.mjs.map → imos-ix-poc-export-helper-BGN97m8W.mjs.map} +1 -1
  53. package/lib/kernel-BWfRHWkW.mjs.map +1 -1
  54. package/lib/{kernel-utils-BvatnA7U.mjs → kernel-utils-BYKmP0mf.mjs} +13 -13
  55. package/lib/{kernel-utils-BvatnA7U.mjs.map → kernel-utils-BYKmP0mf.mjs.map} +1 -1
  56. package/lib/{material-viewer-CTsSfTfL.mjs → material-viewer-C2Pj4-II.mjs} +18 -18
  57. package/lib/{material-viewer-CTsSfTfL.mjs.map → material-viewer-C2Pj4-II.mjs.map} +1 -1
  58. package/lib/{packages-BXAZEcKa.mjs → packages-C0xavGqP.mjs} +5 -5
  59. package/lib/{packages-BXAZEcKa.mjs.map → packages-C0xavGqP.mjs.map} +1 -1
  60. package/lib/{planner-jvLAnYww.mjs → planner-C1KkZRGk.mjs} +3 -3
  61. package/lib/{planner-jvLAnYww.mjs.map → planner-C1KkZRGk.mjs.map} +1 -1
  62. package/lib/planner-DJE5aZXG.mjs +2 -0
  63. package/lib/{plugin-system-CRaC04G5.mjs → plugin-system-CPf99Zkf.mjs} +2 -2
  64. package/lib/{plugin-system-CRaC04G5.mjs.map → plugin-system-CPf99Zkf.mjs.map} +1 -1
  65. package/lib/{render-cache-DCPIQbO1.mjs → render-cache-CPppt7Rd.mjs} +5 -5
  66. package/lib/{render-cache-DCPIQbO1.mjs.map → render-cache-CPppt7Rd.mjs.map} +1 -1
  67. package/lib/{render-order-BPF2wDMw.mjs → render-order-a0QAbB7Q.mjs} +2 -2
  68. package/lib/{render-order-BPF2wDMw.mjs.map → render-order-a0QAbB7Q.mjs.map} +1 -1
  69. package/lib/roomle-headless.d.ts +13 -11
  70. package/lib/roomle-headless.js +14 -14
  71. package/lib/{roomle-renderer-Ato6RMrd.mjs → roomle-renderer-UJINLYxS.mjs} +2 -2
  72. package/lib/{roomle-renderer-Ato6RMrd.mjs.map → roomle-renderer-UJINLYxS.mjs.map} +1 -1
  73. package/lib/{roomle-sdk-CBwhwX_e.mjs → roomle-sdk-BhHLCbgP.mjs} +1747 -1729
  74. package/lib/roomle-sdk-BhHLCbgP.mjs.map +1 -0
  75. package/lib/roomle-sdk.d.ts +13 -11
  76. package/lib/roomle-sdk.js +7 -7
  77. package/lib/{roomle-webgpu-renderer-BfZKcXSz.mjs → roomle-webgpu-renderer-BSvxbopA.mjs} +900 -707
  78. package/lib/roomle-webgpu-renderer-BSvxbopA.mjs.map +1 -0
  79. package/lib/{scene-renderer-BHYZac3H.mjs → scene-renderer--DzrpIl_.mjs} +309 -309
  80. package/lib/{scene-renderer-BHYZac3H.mjs.map → scene-renderer--DzrpIl_.mjs.map} +1 -1
  81. package/lib/{script-loader-CvnG6LgL.mjs → script-loader-BHniYj5b.mjs} +2 -2
  82. package/lib/{script-loader-CvnG6LgL.mjs.map → script-loader-BHniYj5b.mjs.map} +1 -1
  83. package/lib/{shading-settings-BBhR7KcS.mjs → shading-settings-6v-7O_Sz.mjs} +49 -49
  84. package/lib/{shading-settings-BBhR7KcS.mjs.map → shading-settings-6v-7O_Sz.mjs.map} +1 -1
  85. package/lib/src-6KtBPZXp.mjs +2 -0
  86. package/lib/{src-HhklrVDg.mjs → src-Dg0wYIom.mjs} +150 -150
  87. package/lib/{src-HhklrVDg.mjs.map → src-Dg0wYIom.mjs.map} +1 -1
  88. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  89. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/configuratorCoreInterface.d.ts +4 -1
  90. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/src/embind/plannerCoreInterface.d.ts +5 -0
  91. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  92. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  93. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  94. package/lib/{stats-helper-PndcZCzL.mjs → stats-helper-DYjPPDnz.mjs} +2 -2
  95. package/lib/{stats-helper-PndcZCzL.mjs.map → stats-helper-DYjPPDnz.mjs.map} +1 -1
  96. package/lib/{three.core-0KaTx8dm.mjs → three.core-BTUCraWz.mjs} +976 -884
  97. package/lib/three.core-BTUCraWz.mjs.map +1 -0
  98. package/lib/{three.module-dym6j3lO.mjs → three.module-DUSFrLM6.mjs} +1789 -1739
  99. package/lib/three.module-DUSFrLM6.mjs.map +1 -0
  100. package/lib/three.tsl-De6A-G56.mjs +158 -0
  101. package/lib/three.tsl-De6A-G56.mjs.map +1 -0
  102. package/lib/three.tsl-DtfvggFX.mjs +2 -0
  103. package/lib/three.webgpu-B1OhMci_.mjs +3 -0
  104. package/lib/{three.webgpu-D3nSEIjD.mjs → three.webgpu-wPiwbpFM.mjs} +5806 -4926
  105. package/lib/three.webgpu-wPiwbpFM.mjs.map +1 -0
  106. package/lib/{threejs-utils-v1uOvccg.mjs → threejs-utils-lVSsgAiQ.mjs} +68 -68
  107. package/lib/{threejs-utils-v1uOvccg.mjs.map → threejs-utils-lVSsgAiQ.mjs.map} +1 -1
  108. package/lib/{tools-core-B29U-88K.mjs → tools-core-QUdVgS4n.mjs} +3 -3
  109. package/lib/{tools-core-B29U-88K.mjs.map → tools-core-QUdVgS4n.mjs.map} +1 -1
  110. package/lib/{webgpu-BHAP6BLI.mjs → webgpu-BxYJfBjz.mjs} +555 -555
  111. package/lib/{webgpu-BHAP6BLI.mjs.map → webgpu-BxYJfBjz.mjs.map} +1 -1
  112. package/package.json +5 -5
  113. package/lib/BufferGeometry-Bl5whHAB.mjs.map +0 -1
  114. package/lib/GLTFExporter-yQ7mMauu.mjs.map +0 -1
  115. package/lib/GaussianBlurNode-DNBEf5-n.mjs +0 -59
  116. package/lib/GaussianBlurNode-DNBEf5-n.mjs.map +0 -1
  117. package/lib/Object3D-BHdngbxB.mjs.map +0 -1
  118. package/lib/PointLightHelper-CuPSBuDU.mjs.map +0 -1
  119. package/lib/SpotLightHelper-m-Rh8vGU.mjs.map +0 -1
  120. package/lib/USDZExporter-MdkuT226.mjs.map +0 -1
  121. package/lib/Vector4-C7TlIAyy.mjs.map +0 -1
  122. package/lib/common-utils-DbL4tku0.mjs.map +0 -1
  123. package/lib/configurator-BYQdWEvf.mjs +0 -2
  124. package/lib/dimensioning-helper-CGPjS2hW.mjs.map +0 -1
  125. package/lib/dimensioning-helper-VndKlIXS.mjs +0 -2
  126. package/lib/glb-viewer-Bd5Xn6Oq.mjs +0 -2
  127. package/lib/planner-DMk3T4ts.mjs +0 -2
  128. package/lib/roomle-sdk-CBwhwX_e.mjs.map +0 -1
  129. package/lib/roomle-webgpu-renderer-BfZKcXSz.mjs.map +0 -1
  130. package/lib/src-Bbq3Hqzn.mjs +0 -2
  131. package/lib/three.core-0KaTx8dm.mjs.map +0 -1
  132. package/lib/three.module-dym6j3lO.mjs.map +0 -1
  133. package/lib/three.tsl-BTc4fg8T.mjs +0 -2
  134. package/lib/three.tsl-Cf0-sCqB.mjs +0 -152
  135. package/lib/three.tsl-Cf0-sCqB.mjs.map +0 -1
  136. package/lib/three.webgpu-ClICiWlK.mjs +0 -3
  137. package/lib/three.webgpu-D3nSEIjD.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"PointLightHelper-CuPSBuDU.mjs","names":[],"sources":["../../../../node_modules/three/src/math/Triangle.js","../../../../node_modules/three/src/materials/MeshBasicMaterial.js","../../../../node_modules/three/src/objects/Mesh.js","../../../../node_modules/three/src/geometries/SphereGeometry.js","../../../../node_modules/three/src/helpers/PointLightHelper.js"],"sourcesContent":["import { Vector3 } from './Vector3.js';\nimport { Vector4 } from './Vector4.js';\n\nconst _v0 = /*@__PURE__*/ new Vector3();\nconst _v1 = /*@__PURE__*/ new Vector3();\nconst _v2 = /*@__PURE__*/ new Vector3();\nconst _v3 = /*@__PURE__*/ new Vector3();\n\nconst _vab = /*@__PURE__*/ new Vector3();\nconst _vac = /*@__PURE__*/ new Vector3();\nconst _vbc = /*@__PURE__*/ new Vector3();\nconst _vap = /*@__PURE__*/ new Vector3();\nconst _vbp = /*@__PURE__*/ new Vector3();\nconst _vcp = /*@__PURE__*/ new Vector3();\n\nconst _v40 = /*@__PURE__*/ new Vector4();\nconst _v41 = /*@__PURE__*/ new Vector4();\nconst _v42 = /*@__PURE__*/ new Vector4();\n\n/**\n * A geometric triangle as defined by three vectors representing its three corners.\n */\nclass Triangle {\n\n\t/**\n\t * Constructs a new triangle.\n\t *\n\t * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle.\n\t * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle.\n\t * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle.\n\t */\n\tconstructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {\n\n\t\t/**\n\t\t * The first corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.a = a;\n\n\t\t/**\n\t\t * The second corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.b = b;\n\n\t\t/**\n\t\t * The third corner of the triangle.\n\t\t *\n\t\t * @type {Vector3}\n\t\t */\n\t\tthis.c = c;\n\n\t}\n\n\t/**\n\t * Computes the normal vector of a triangle.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tstatic getNormal( a, b, c, target ) {\n\n\t\ttarget.subVectors( c, b );\n\t\t_v0.subVectors( a, b );\n\t\ttarget.cross( _v0 );\n\n\t\tconst targetLengthSq = target.lengthSq();\n\t\tif ( targetLengthSq > 0 ) {\n\n\t\t\treturn target.multiplyScalar( 1 / Math.sqrt( targetLengthSq ) );\n\n\t\t}\n\n\t\treturn target.set( 0, 0, 0 );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tstatic getBarycoord( point, a, b, c, target ) {\n\n\t\t// based on: http://www.blackpawn.com/texts/pointinpoly/default.html\n\n\t\t_v0.subVectors( c, a );\n\t\t_v1.subVectors( b, a );\n\t\t_v2.subVectors( point, a );\n\n\t\tconst dot00 = _v0.dot( _v0 );\n\t\tconst dot01 = _v0.dot( _v1 );\n\t\tconst dot02 = _v0.dot( _v2 );\n\t\tconst dot11 = _v1.dot( _v1 );\n\t\tconst dot12 = _v1.dot( _v2 );\n\n\t\tconst denom = ( dot00 * dot11 - dot01 * dot01 );\n\n\t\t// collinear or singular triangle\n\t\tif ( denom === 0 ) {\n\n\t\t\ttarget.set( 0, 0, 0 );\n\t\t\treturn null;\n\n\t\t}\n\n\t\tconst invDenom = 1 / denom;\n\t\tconst u = ( dot11 * dot02 - dot01 * dot12 ) * invDenom;\n\t\tconst v = ( dot00 * dot12 - dot01 * dot02 ) * invDenom;\n\n\t\t// barycentric coordinates must always sum to 1\n\t\treturn target.set( 1 - u - v, v, u );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tstatic containsPoint( point, a, b, c ) {\n\n\t\t// if the triangle is degenerate then we can't contain a point\n\t\tif ( this.getBarycoord( point, a, b, c, _v3 ) === null ) {\n\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn ( _v3.x >= 0 ) && ( _v3.y >= 0 ) && ( ( _v3.x + _v3.y ) <= 1 );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} p1 - The first corner of the triangle.\n\t * @param {Vector3} p2 - The second corner of the triangle.\n\t * @param {Vector3} p3 - The third corner of the triangle.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tstatic getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {\n\n\t\tif ( this.getBarycoord( point, p1, p2, p3, _v3 ) === null ) {\n\n\t\t\ttarget.x = 0;\n\t\t\ttarget.y = 0;\n\t\t\tif ( 'z' in target ) target.z = 0;\n\t\t\tif ( 'w' in target ) target.w = 0;\n\t\t\treturn null;\n\n\t\t}\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( v1, _v3.x );\n\t\ttarget.addScaledVector( v2, _v3.y );\n\t\ttarget.addScaledVector( v3, _v3.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given attribute and indices.\n\t *\n\t * @param {BufferAttribute} attr - The attribute to interpolate.\n\t * @param {number} i1 - Index of first vertex.\n\t * @param {number} i2 - Index of second vertex.\n\t * @param {number} i3 - Index of third vertex.\n\t * @param {Vector3} barycoord - The barycoordinate value to use to interpolate.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The interpolated attribute value.\n\t */\n\tstatic getInterpolatedAttribute( attr, i1, i2, i3, barycoord, target ) {\n\n\t\t_v40.setScalar( 0 );\n\t\t_v41.setScalar( 0 );\n\t\t_v42.setScalar( 0 );\n\n\t\t_v40.fromBufferAttribute( attr, i1 );\n\t\t_v41.fromBufferAttribute( attr, i2 );\n\t\t_v42.fromBufferAttribute( attr, i3 );\n\n\t\ttarget.setScalar( 0 );\n\t\ttarget.addScaledVector( _v40, barycoord.x );\n\t\ttarget.addScaledVector( _v41, barycoord.y );\n\t\ttarget.addScaledVector( _v42, barycoord.z );\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tstatic isFrontFacing( a, b, c, direction ) {\n\n\t\t_v0.subVectors( c, b );\n\t\t_v1.subVectors( a, b );\n\n\t\t// strictly front facing\n\t\treturn _v0.cross( _v1 ).dot( direction ) < 0;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given values.\n\t *\n\t * @param {Vector3} a - The first corner of the triangle.\n\t * @param {Vector3} b - The second corner of the triangle.\n\t * @param {Vector3} c - The third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tset( a, b, c ) {\n\n\t\tthis.a.copy( a );\n\t\tthis.b.copy( b );\n\t\tthis.c.copy( c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given array values.\n\t *\n\t * @param {Array<Vector3>} points - An array with 3D points.\n\t * @param {number} i0 - The array index representing the first corner of the triangle.\n\t * @param {number} i1 - The array index representing the second corner of the triangle.\n\t * @param {number} i2 - The array index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromPointsAndIndices( points, i0, i1, i2 ) {\n\n\t\tthis.a.copy( points[ i0 ] );\n\t\tthis.b.copy( points[ i1 ] );\n\t\tthis.c.copy( points[ i2 ] );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the triangle's vertices by copying the given attribute values.\n\t *\n\t * @param {BufferAttribute} attribute - A buffer attribute with 3D points data.\n\t * @param {number} i0 - The attribute index representing the first corner of the triangle.\n\t * @param {number} i1 - The attribute index representing the second corner of the triangle.\n\t * @param {number} i2 - The attribute index representing the third corner of the triangle.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tsetFromAttributeAndIndices( attribute, i0, i1, i2 ) {\n\n\t\tthis.a.fromBufferAttribute( attribute, i0 );\n\t\tthis.b.fromBufferAttribute( attribute, i1 );\n\t\tthis.c.fromBufferAttribute( attribute, i2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns a new triangle with copied values from this instance.\n\t *\n\t * @return {Triangle} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor().copy( this );\n\n\t}\n\n\t/**\n\t * Copies the values of the given triangle to this instance.\n\t *\n\t * @param {Triangle} triangle - The triangle to copy.\n\t * @return {Triangle} A reference to this triangle.\n\t */\n\tcopy( triangle ) {\n\n\t\tthis.a.copy( triangle.a );\n\t\tthis.b.copy( triangle.b );\n\t\tthis.c.copy( triangle.c );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes the area of the triangle.\n\t *\n\t * @return {number} The triangle's area.\n\t */\n\tgetArea() {\n\n\t\t_v0.subVectors( this.c, this.b );\n\t\t_v1.subVectors( this.a, this.b );\n\n\t\treturn _v0.cross( _v1 ).length() * 0.5;\n\n\t}\n\n\t/**\n\t * Computes the midpoint of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's midpoint.\n\t */\n\tgetMidpoint( target ) {\n\n\t\treturn target.addVectors( this.a, this.b ).add( this.c ).multiplyScalar( 1 / 3 );\n\n\t}\n\n\t/**\n\t * Computes the normal of the triangle.\n\t *\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The triangle's normal.\n\t */\n\tgetNormal( target ) {\n\n\t\treturn Triangle.getNormal( this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes a plane the triangle lies within.\n\t *\n\t * @param {Plane} target - The target vector that is used to store the method's result.\n\t * @return {Plane} The plane the triangle lies within.\n\t */\n\tgetPlane( target ) {\n\n\t\treturn target.setFromCoplanarPoints( this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Computes a barycentric coordinates from the given vector.\n\t * Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - A point in 3D space.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The barycentric coordinates for the given point\n\t */\n\tgetBarycoord( point, target ) {\n\n\t\treturn Triangle.getBarycoord( point, this.a, this.b, this.c, target );\n\n\t}\n\n\t/**\n\t * Computes the value barycentrically interpolated for the given point on the\n\t * triangle. Returns `null` if the triangle is degenerate.\n\t *\n\t * @param {Vector3} point - Position of interpolated point.\n\t * @param {Vector3} v1 - Value to interpolate of first vertex.\n\t * @param {Vector3} v2 - Value to interpolate of second vertex.\n\t * @param {Vector3} v3 - Value to interpolate of third vertex.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {?Vector3} The interpolated value.\n\t */\n\tgetInterpolation( point, v1, v2, v3, target ) {\n\n\t\treturn Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );\n\n\t}\n\n\t/**\n\t * Returns `true` if the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle.\n\t *\n\t * @param {Vector3} point - The point in 3D space to test.\n\t * @return {boolean} Whether the given point, when projected onto the plane of the\n\t * triangle, lies within the triangle or not.\n\t */\n\tcontainsPoint( point ) {\n\n\t\treturn Triangle.containsPoint( point, this.a, this.b, this.c );\n\n\t}\n\n\t/**\n\t * Returns `true` if the triangle is oriented towards the given direction.\n\t *\n\t * @param {Vector3} direction - The (normalized) direction vector.\n\t * @return {boolean} Whether the triangle is oriented towards the given direction or not.\n\t */\n\tisFrontFacing( direction ) {\n\n\t\treturn Triangle.isFrontFacing( this.a, this.b, this.c, direction );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle intersects with the given box.\n\t *\n\t * @param {Box3} box - The box to intersect.\n\t * @return {boolean} Whether this triangle intersects with the given box or not.\n\t */\n\tintersectsBox( box ) {\n\n\t\treturn box.intersectsTriangle( this );\n\n\t}\n\n\t/**\n\t * Returns the closest point on the triangle to the given point.\n\t *\n\t * @param {Vector3} p - The point to compute the closest point for.\n\t * @param {Vector3} target - The target vector that is used to store the method's result.\n\t * @return {Vector3} The closest point on the triangle.\n\t */\n\tclosestPointToPoint( p, target ) {\n\n\t\tconst a = this.a, b = this.b, c = this.c;\n\t\tlet v, w;\n\n\t\t// algorithm thanks to Real-Time Collision Detection by Christer Ericson,\n\t\t// published by Morgan Kaufmann Publishers, (c) 2005 Elsevier Inc.,\n\t\t// under the accompanying license; see chapter 5.1.5 for detailed explanation.\n\t\t// basically, we're distinguishing which of the voronoi regions of the triangle\n\t\t// the point lies in with the minimum amount of redundant computation.\n\n\t\t_vab.subVectors( b, a );\n\t\t_vac.subVectors( c, a );\n\t\t_vap.subVectors( p, a );\n\t\tconst d1 = _vab.dot( _vap );\n\t\tconst d2 = _vac.dot( _vap );\n\t\tif ( d1 <= 0 && d2 <= 0 ) {\n\n\t\t\t// vertex region of A; barycentric coords (1, 0, 0)\n\t\t\treturn target.copy( a );\n\n\t\t}\n\n\t\t_vbp.subVectors( p, b );\n\t\tconst d3 = _vab.dot( _vbp );\n\t\tconst d4 = _vac.dot( _vbp );\n\t\tif ( d3 >= 0 && d4 <= d3 ) {\n\n\t\t\t// vertex region of B; barycentric coords (0, 1, 0)\n\t\t\treturn target.copy( b );\n\n\t\t}\n\n\t\tconst vc = d1 * d4 - d3 * d2;\n\t\tif ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {\n\n\t\t\tv = d1 / ( d1 - d3 );\n\t\t\t// edge region of AB; barycentric coords (1-v, v, 0)\n\t\t\treturn target.copy( a ).addScaledVector( _vab, v );\n\n\t\t}\n\n\t\t_vcp.subVectors( p, c );\n\t\tconst d5 = _vab.dot( _vcp );\n\t\tconst d6 = _vac.dot( _vcp );\n\t\tif ( d6 >= 0 && d5 <= d6 ) {\n\n\t\t\t// vertex region of C; barycentric coords (0, 0, 1)\n\t\t\treturn target.copy( c );\n\n\t\t}\n\n\t\tconst vb = d5 * d2 - d1 * d6;\n\t\tif ( vb <= 0 && d2 >= 0 && d6 <= 0 ) {\n\n\t\t\tw = d2 / ( d2 - d6 );\n\t\t\t// edge region of AC; barycentric coords (1-w, 0, w)\n\t\t\treturn target.copy( a ).addScaledVector( _vac, w );\n\n\t\t}\n\n\t\tconst va = d3 * d6 - d5 * d4;\n\t\tif ( va <= 0 && ( d4 - d3 ) >= 0 && ( d5 - d6 ) >= 0 ) {\n\n\t\t\t_vbc.subVectors( c, b );\n\t\t\tw = ( d4 - d3 ) / ( ( d4 - d3 ) + ( d5 - d6 ) );\n\t\t\t// edge region of BC; barycentric coords (0, 1-w, w)\n\t\t\treturn target.copy( b ).addScaledVector( _vbc, w ); // edge region of BC\n\n\t\t}\n\n\t\t// face region\n\t\tconst denom = 1 / ( va + vb + vc );\n\t\t// u = va * denom\n\t\tv = vb * denom;\n\t\tw = vc * denom;\n\n\t\treturn target.copy( a ).addScaledVector( _vab, v ).addScaledVector( _vac, w );\n\n\t}\n\n\t/**\n\t * Returns `true` if this triangle is equal with the given one.\n\t *\n\t * @param {Triangle} triangle - The triangle to test for equality.\n\t * @return {boolean} Whether this triangle is equal with the given one.\n\t */\n\tequals( triangle ) {\n\n\t\treturn triangle.a.equals( this.a ) && triangle.b.equals( this.b ) && triangle.c.equals( this.c );\n\n\t}\n\n}\n\nexport { Triangle };\n","import { Material } from './Material.js';\nimport { MultiplyOperation } from '../constants.js';\nimport { Color } from '../math/Color.js';\nimport { Euler } from '../math/Euler.js';\n\n/**\n * A material for drawing geometries in a simple shaded (flat or wireframe) way.\n *\n * This material is not affected by lights.\n *\n * @augments Material\n * @demo scenes/material-browser.html#MeshBasicMaterial\n */\nclass MeshBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new mesh basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMeshBasicMaterial = true;\n\n\t\tthis.type = 'MeshBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff ); // diffuse\n\n\t\t/**\n\t\t * The color map. May optionally include an alpha channel, typically combined\n\t\t * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * `map` represents color data, and the texture must be assigned a\n\t\t * {@link Texture#colorSpace}. Most `map` textures set\n\t\t * `texture.colorSpace = SRGBColorSpace`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * The light map. Requires a second set of UVs.\n\t\t *\n\t\t * `lightMap` represents pre-baked illuminance data, and the texture must be assigned\n\t\t * a {@link Texture#colorSpace}. Most `lightMap` textures set\n\t\t * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats\n\t\t * such as `.exr` or `.hdr`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.lightMap = null;\n\n\t\t/**\n\t\t * Intensity of the baked light.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.lightMapIntensity = 1.0;\n\n\t\t/**\n\t\t * The red channel of this texture is used as the ambient occlusion map.\n\t\t * Requires a second set of UVs.\n\t\t *\n\t\t * `aoMap` represents non-color data. Any texture assigned must have\n\t\t * `texture.colorSpace = NoColorSpace` (default).\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.aoMap = null;\n\n\t\t/**\n\t\t * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`\n\t\t * disables ambient occlusion. Where intensity is `1` and the AO map's\n\t\t * red channel is also `1`, ambient light is fully occluded on a surface.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.aoMapIntensity = 1.0;\n\n\t\t/**\n\t\t * Specular map used by the material.\n\t\t *\n\t\t * `specularMap` represents color data, and the texture must be assigned a\n\t\t * {@link Texture#colorSpace}. Most `specularMap` textures set\n\t\t * `texture.colorSpace = SRGBColorSpace`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.specularMap = null;\n\n\t\t/**\n\t\t * The alpha map is a grayscale texture that controls the opacity across the\n\t\t * surface (black: fully transparent; white: fully opaque).\n\t\t *\n\t\t * Only the color of the texture is used, ignoring the alpha channel if one\n\t\t * exists. For RGB and RGBA textures, the renderer will use the green channel\n\t\t * when sampling this texture due to the extra bit of precision provided for\n\t\t * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and\n\t\t * luminance/alpha textures will also still work as expected.\n\t\t *\n\t\t * `alphaMap` represents non-color data. Any texture assigned must have\n\t\t * `texture.colorSpace = NoColorSpace` (default).\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.alphaMap = null;\n\n\t\t/**\n\t\t * The environment map.\n\t\t *\n\t\t * `envMap` represents luminance data, and the texture must be assigned\n\t\t * a {@link Texture#colorSpace}. Most `envMap` textures set\n\t\t * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats\n\t\t * such as `.exr` or `.hdr`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.envMap = null;\n\n\t\t/**\n\t\t * The rotation of the environment map in radians.\n\t\t *\n\t\t * @type {Euler}\n\t\t * @default (0,0,0)\n\t\t */\n\t\tthis.envMapRotation = new Euler();\n\n\t\t/**\n\t\t * How to combine the result of the surface's color with the environment map, if any.\n\t\t *\n\t\t * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to\n\t\t * blend between the two colors.\n\t\t *\n\t\t * @type {(MultiplyOperation|MixOperation|AddOperation)}\n\t\t * @default MultiplyOperation\n\t\t */\n\t\tthis.combine = MultiplyOperation;\n\n\t\t/**\n\t\t * How much the environment map affects the surface.\n\t\t * The valid range is between `0` (no reflections) and `1` (full reflections).\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.reflectivity = 1;\n\n\t\t/**\n\t\t * The index of refraction (IOR) of air (approximately 1) divided by the\n\t\t * index of refraction of the material. It is used with environment mapping\n\t\t * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.\n\t\t * The refraction ratio should not exceed `1`.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 0.98\n\t\t */\n\t\tthis.refractionRatio = 0.98;\n\n\t\t/**\n\t\t * Renders the geometry as a wireframe.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.wireframe = false;\n\n\t\t/**\n\t\t * Controls the thickness of the wireframe.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.wireframeLinewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of wireframe ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of wireframe joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.wireframeLinejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.lightMap = source.lightMap;\n\t\tthis.lightMapIntensity = source.lightMapIntensity;\n\n\t\tthis.aoMap = source.aoMap;\n\t\tthis.aoMapIntensity = source.aoMapIntensity;\n\n\t\tthis.specularMap = source.specularMap;\n\n\t\tthis.alphaMap = source.alphaMap;\n\n\t\tthis.envMap = source.envMap;\n\t\tthis.envMapRotation.copy( source.envMapRotation );\n\t\tthis.combine = source.combine;\n\t\tthis.reflectivity = source.reflectivity;\n\t\tthis.refractionRatio = source.refractionRatio;\n\n\t\tthis.wireframe = source.wireframe;\n\t\tthis.wireframeLinewidth = source.wireframeLinewidth;\n\t\tthis.wireframeLinecap = source.wireframeLinecap;\n\t\tthis.wireframeLinejoin = source.wireframeLinejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nexport { MeshBasicMaterial };\n","import { Vector3 } from '../math/Vector3.js';\nimport { Vector2 } from '../math/Vector2.js';\nimport { Sphere } from '../math/Sphere.js';\nimport { Ray } from '../math/Ray.js';\nimport { Matrix4 } from '../math/Matrix4.js';\nimport { Object3D } from '../core/Object3D.js';\nimport { Triangle } from '../math/Triangle.js';\nimport { BackSide, FrontSide } from '../constants.js';\nimport { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js';\nimport { BufferGeometry } from '../core/BufferGeometry.js';\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\nconst _sphereHitAt = /*@__PURE__*/ new Vector3();\n\nconst _vA = /*@__PURE__*/ new Vector3();\nconst _vB = /*@__PURE__*/ new Vector3();\nconst _vC = /*@__PURE__*/ new Vector3();\n\nconst _tempA = /*@__PURE__*/ new Vector3();\nconst _morphA = /*@__PURE__*/ new Vector3();\n\nconst _intersectionPoint = /*@__PURE__*/ new Vector3();\nconst _intersectionPointWorld = /*@__PURE__*/ new Vector3();\n\n/**\n * Class representing triangular polygon mesh based objects.\n *\n * ```js\n * const geometry = new THREE.BoxGeometry( 1, 1, 1 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const mesh = new THREE.Mesh( geometry, material );\n * scene.add( mesh );\n * ```\n *\n * @augments Object3D\n */\nclass Mesh extends Object3D {\n\n\t/**\n\t * Constructs a new mesh.\n\t *\n\t * @param {BufferGeometry} [geometry] - The mesh geometry.\n\t * @param {Material|Array<Material>} [material] - The mesh material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new MeshBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isMesh = true;\n\n\t\tthis.type = 'Mesh';\n\n\t\t/**\n\t\t * The mesh geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The mesh material.\n\t\t *\n\t\t * @type {Material|Array<Material>}\n\t\t * @default MeshBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object<string,number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array<number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\t/**\n\t\t * The number of instances of this mesh.\n\t\t * Can only be used with {@link WebGPURenderer}.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.count = 1;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tif ( source.morphTargetInfluences !== undefined ) {\n\n\t\t\tthis.morphTargetInfluences = source.morphTargetInfluences.slice();\n\n\t\t}\n\n\t\tif ( source.morphTargetDictionary !== undefined ) {\n\n\t\t\tthis.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );\n\n\t\t}\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns the local-space position of the vertex at the given index, taking into\n\t * account the current animation state of both morph targets and skinning.\n\t *\n\t * @param {number} index - The vertex index.\n\t * @param {Vector3} target - The target object that is used to store the method's result.\n\t * @return {Vector3} The vertex position in local space.\n\t */\n\tgetVertexPosition( index, target ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst position = geometry.attributes.position;\n\t\tconst morphPosition = geometry.morphAttributes.position;\n\t\tconst morphTargetsRelative = geometry.morphTargetsRelative;\n\n\t\ttarget.fromBufferAttribute( position, index );\n\n\t\tconst morphInfluences = this.morphTargetInfluences;\n\n\t\tif ( morphPosition && morphInfluences ) {\n\n\t\t\t_morphA.set( 0, 0, 0 );\n\n\t\t\tfor ( let i = 0, il = morphPosition.length; i < il; i ++ ) {\n\n\t\t\t\tconst influence = morphInfluences[ i ];\n\t\t\t\tconst morphAttribute = morphPosition[ i ];\n\n\t\t\t\tif ( influence === 0 ) continue;\n\n\t\t\t\t_tempA.fromBufferAttribute( morphAttribute, index );\n\n\t\t\t\tif ( morphTargetsRelative ) {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA, influence );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t_morphA.addScaledVector( _tempA.sub( target ), influence );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttarget.add( _morphA );\n\n\t\t}\n\n\t\treturn target;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\t\tconst matrixWorld = this.matrixWorld;\n\n\t\tif ( material === undefined ) return;\n\n\t\t// test with bounding sphere in world space\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\n\t\t// check distance from ray origin to bounding sphere\n\n\t\t_ray.copy( raycaster.ray ).recast( raycaster.near );\n\n\t\tif ( _sphere.containsPoint( _ray.origin ) === false ) {\n\n\t\t\tif ( _ray.intersectSphere( _sphere, _sphereHitAt ) === null ) return;\n\n\t\t\tif ( _ray.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;\n\n\t\t}\n\n\t\t// convert ray to local space of mesh\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\t// test with bounding box in local space\n\n\t\tif ( geometry.boundingBox !== null ) {\n\n\t\t\tif ( _ray.intersectsBox( geometry.boundingBox ) === false ) return;\n\n\t\t}\n\n\t\t// test for intersections with geometry\n\n\t\tthis._computeIntersections( raycaster, intersects, _ray );\n\n\t}\n\n\t_computeIntersections( raycaster, intersects, rayLocalSpace ) {\n\n\t\tlet intersection;\n\n\t\tconst geometry = this.geometry;\n\t\tconst material = this.material;\n\n\t\tconst index = geometry.index;\n\t\tconst position = geometry.attributes.position;\n\t\tconst uv = geometry.attributes.uv;\n\t\tconst uv1 = geometry.attributes.uv1;\n\t\tconst normal = geometry.attributes.normal;\n\t\tconst groups = geometry.groups;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\tif ( index !== null ) {\n\n\t\t\t// indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( index.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = index.getX( j );\n\t\t\t\t\t\tconst b = index.getX( j + 1 );\n\t\t\t\t\t\tconst c = index.getX( j + 2 );\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = index.getX( i );\n\t\t\t\t\tconst b = index.getX( i + 1 );\n\t\t\t\t\tconst c = index.getX( i + 2 );\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( position !== undefined ) {\n\n\t\t\t// non-indexed buffer geometry\n\n\t\t\tif ( Array.isArray( material ) ) {\n\n\t\t\t\tfor ( let i = 0, il = groups.length; i < il; i ++ ) {\n\n\t\t\t\t\tconst group = groups[ i ];\n\t\t\t\t\tconst groupMaterial = material[ group.materialIndex ];\n\n\t\t\t\t\tconst start = Math.max( group.start, drawRange.start );\n\t\t\t\t\tconst end = Math.min( position.count, Math.min( ( group.start + group.count ), ( drawRange.start + drawRange.count ) ) );\n\n\t\t\t\t\tfor ( let j = start, jl = end; j < jl; j += 3 ) {\n\n\t\t\t\t\t\tconst a = j;\n\t\t\t\t\t\tconst b = j + 1;\n\t\t\t\t\t\tconst c = j + 2;\n\n\t\t\t\t\t\tintersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\t\tintersection.faceIndex = Math.floor( j / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\t\tintersection.face.materialIndex = group.materialIndex;\n\t\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\t\tconst end = Math.min( position.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\t\tfor ( let i = start, il = end; i < il; i += 3 ) {\n\n\t\t\t\t\tconst a = i;\n\t\t\t\t\tconst b = i + 1;\n\t\t\t\t\tconst c = i + 2;\n\n\t\t\t\t\tintersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );\n\n\t\t\t\t\tif ( intersection ) {\n\n\t\t\t\t\t\tintersection.faceIndex = Math.floor( i / 3 ); // triangle number in non-indexed buffer semantics\n\t\t\t\t\t\tintersects.push( intersection );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) {\n\n\tlet intersect;\n\n\tif ( material.side === BackSide ) {\n\n\t\tintersect = ray.intersectTriangle( pC, pB, pA, true, point );\n\n\t} else {\n\n\t\tintersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );\n\n\t}\n\n\tif ( intersect === null ) return null;\n\n\t_intersectionPointWorld.copy( point );\n\t_intersectionPointWorld.applyMatrix4( object.matrixWorld );\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectionPointWorld );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return null;\n\n\treturn {\n\t\tdistance: distance,\n\t\tpoint: _intersectionPointWorld.clone(),\n\t\tobject: object\n\t};\n\n}\n\nfunction checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, normal, a, b, c ) {\n\n\tobject.getVertexPosition( a, _vA );\n\tobject.getVertexPosition( b, _vB );\n\tobject.getVertexPosition( c, _vC );\n\n\tconst intersection = checkIntersection( object, material, raycaster, ray, _vA, _vB, _vC, _intersectionPoint );\n\n\tif ( intersection ) {\n\n\t\tconst barycoord = new Vector3();\n\t\tTriangle.getBarycoord( _intersectionPoint, _vA, _vB, _vC, barycoord );\n\n\t\tif ( uv ) {\n\n\t\t\tintersection.uv = Triangle.getInterpolatedAttribute( uv, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( uv1 ) {\n\n\t\t\tintersection.uv1 = Triangle.getInterpolatedAttribute( uv1, a, b, c, barycoord, new Vector2() );\n\n\t\t}\n\n\t\tif ( normal ) {\n\n\t\t\tintersection.normal = Triangle.getInterpolatedAttribute( normal, a, b, c, barycoord, new Vector3() );\n\n\t\t\tif ( intersection.normal.dot( ray.direction ) > 0 ) {\n\n\t\t\t\tintersection.normal.multiplyScalar( - 1 );\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst face = {\n\t\t\ta: a,\n\t\t\tb: b,\n\t\t\tc: c,\n\t\t\tnormal: new Vector3(),\n\t\t\tmaterialIndex: 0\n\t\t};\n\n\t\tTriangle.getNormal( _vA, _vB, _vC, face.normal );\n\n\t\tintersection.face = face;\n\t\tintersection.barycoord = barycoord;\n\n\t}\n\n\treturn intersection;\n\n}\n\nexport { Mesh };\n","import { BufferGeometry } from '../core/BufferGeometry.js';\nimport { Float32BufferAttribute } from '../core/BufferAttribute.js';\nimport { Vector3 } from '../math/Vector3.js';\n\n/**\n * A class for generating a sphere geometry.\n *\n * ```js\n * const geometry = new THREE.SphereGeometry( 15, 32, 16 );\n * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );\n * const sphere = new THREE.Mesh( geometry, material );\n * scene.add( sphere );\n * ```\n *\n * @augments BufferGeometry\n * @demo scenes/geometry-browser.html#SphereGeometry\n */\nclass SphereGeometry extends BufferGeometry {\n\n\t/**\n\t * Constructs a new sphere geometry.\n\t *\n\t * @param {number} [radius=1] - The sphere radius.\n\t * @param {number} [widthSegments=32] - The number of horizontal segments. Minimum value is `3`.\n\t * @param {number} [heightSegments=16] - The number of vertical segments. Minimum value is `2`.\n\t * @param {number} [phiStart=0] - The horizontal starting angle in radians.\n\t * @param {number} [phiLength=Math.PI*2] - The horizontal sweep angle size.\n\t * @param {number} [thetaStart=0] - The vertical starting angle in radians.\n\t * @param {number} [thetaLength=Math.PI] - The vertical sweep angle size.\n\t */\n\tconstructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {\n\n\t\tsuper();\n\n\t\tthis.type = 'SphereGeometry';\n\n\t\t/**\n\t\t * Holds the constructor parameters that have been\n\t\t * used to generate the geometry. Any modification\n\t\t * after instantiation does not change the geometry.\n\t\t *\n\t\t * @type {Object}\n\t\t */\n\t\tthis.parameters = {\n\t\t\tradius: radius,\n\t\t\twidthSegments: widthSegments,\n\t\t\theightSegments: heightSegments,\n\t\t\tphiStart: phiStart,\n\t\t\tphiLength: phiLength,\n\t\t\tthetaStart: thetaStart,\n\t\t\tthetaLength: thetaLength\n\t\t};\n\n\t\twidthSegments = Math.max( 3, Math.floor( widthSegments ) );\n\t\theightSegments = Math.max( 2, Math.floor( heightSegments ) );\n\n\t\tconst thetaEnd = Math.min( thetaStart + thetaLength, Math.PI );\n\n\t\tlet index = 0;\n\t\tconst grid = [];\n\n\t\tconst vertex = new Vector3();\n\t\tconst normal = new Vector3();\n\n\t\t// buffers\n\n\t\tconst indices = [];\n\t\tconst vertices = [];\n\t\tconst normals = [];\n\t\tconst uvs = [];\n\n\t\t// generate vertices, normals and uvs\n\n\t\tfor ( let iy = 0; iy <= heightSegments; iy ++ ) {\n\n\t\t\tconst verticesRow = [];\n\n\t\t\tconst v = iy / heightSegments;\n\t\t\tconst theta = thetaStart + v * thetaLength;\n\n\t\t\tconst y = radius * Math.cos( theta );\n\t\t\tconst ringRadius = Math.sqrt( radius * radius - y * y );\n\n\t\t\t// special case for the poles\n\n\t\t\tlet uOffset = 0;\n\n\t\t\tif ( iy === 0 && thetaStart === 0 ) {\n\n\t\t\t\tuOffset = 0.5 / widthSegments;\n\n\t\t\t} else if ( iy === heightSegments && thetaEnd === Math.PI ) {\n\n\t\t\t\tuOffset = - 0.5 / widthSegments;\n\n\t\t\t}\n\n\t\t\tfor ( let ix = 0; ix <= widthSegments; ix ++ ) {\n\n\t\t\t\tconst u = ix / widthSegments;\n\t\t\t\tconst phi = phiStart + u * phiLength;\n\n\t\t\t\t// vertex\n\n\t\t\t\tvertex.x = - ringRadius * Math.cos( phi );\n\t\t\t\tvertex.y = y;\n\t\t\t\tvertex.z = ringRadius * Math.sin( phi );\n\n\t\t\t\tvertices.push( vertex.x, vertex.y, vertex.z );\n\n\t\t\t\t// normal\n\n\t\t\t\tnormal.copy( vertex ).normalize();\n\t\t\t\tnormals.push( normal.x, normal.y, normal.z );\n\n\t\t\t\t// uv\n\n\t\t\t\tuvs.push( u + uOffset, 1 - v );\n\n\t\t\t\tverticesRow.push( index ++ );\n\n\t\t\t}\n\n\t\t\tgrid.push( verticesRow );\n\n\t\t}\n\n\t\t// indices\n\n\t\tfor ( let iy = 0; iy < heightSegments; iy ++ ) {\n\n\t\t\tfor ( let ix = 0; ix < widthSegments; ix ++ ) {\n\n\t\t\t\tconst a = grid[ iy ][ ix + 1 ];\n\t\t\t\tconst b = grid[ iy ][ ix ];\n\t\t\t\tconst c = grid[ iy + 1 ][ ix ];\n\t\t\t\tconst d = grid[ iy + 1 ][ ix + 1 ];\n\n\t\t\t\tif ( iy !== 0 || thetaStart > 0 ) indices.push( a, b, d );\n\t\t\t\tif ( iy !== heightSegments - 1 || thetaEnd < Math.PI ) indices.push( b, c, d );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// build geometry\n\n\t\tthis.setIndex( indices );\n\t\tthis.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) );\n\t\tthis.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) );\n\t\tthis.setAttribute( 'uv', new Float32BufferAttribute( uvs, 2 ) );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.parameters = Object.assign( {}, source.parameters );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Factory method for creating an instance of this class from the given\n\t * JSON object.\n\t *\n\t * @param {Object} data - A JSON object representing the serialized geometry.\n\t * @return {SphereGeometry} A new instance.\n\t */\n\tstatic fromJSON( data ) {\n\n\t\treturn new SphereGeometry( data.radius, data.widthSegments, data.heightSegments, data.phiStart, data.phiLength, data.thetaStart, data.thetaLength );\n\n\t}\n\n}\n\nexport { SphereGeometry };\n","import { Mesh } from '../objects/Mesh.js';\nimport { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js';\nimport { SphereGeometry } from '../geometries/SphereGeometry.js';\n\n/**\n * This displays a helper object consisting of a spherical mesh for\n * visualizing an instance of {@link PointLight}.\n *\n * ```js\n * const pointLight = new THREE.PointLight( 0xff0000, 1, 100 );\n * pointLight.position.set( 10, 10, 10 );\n * scene.add( pointLight );\n *\n * const sphereSize = 1;\n * const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize );\n * scene.add( pointLightHelper );\n * ```\n *\n * @augments Mesh\n */\nclass PointLightHelper extends Mesh {\n\n\t/**\n\t * Constructs a new point light helper.\n\t *\n\t * @param {PointLight} light - The light to be visualized.\n\t * @param {number} [sphereSize=1] - The size of the sphere helper.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, sphereSize, color ) {\n\n\t\tconst geometry = new SphereGeometry( sphereSize, 4, 2 );\n\t\tconst material = new MeshBasicMaterial( { wireframe: true, fog: false, toneMapped: false } );\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {PointLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'PointLightHelper';\n\n\t\tthis.matrix = this.light.matrixWorld;\n\t\tthis.matrixAutoUpdate = false;\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.geometry.dispose();\n\t\tthis.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.material.color.copy( this.light.color );\n\n\t\t}\n\n\t\t/*\n\t\tconst d = this.light.distance;\n\n\t\tif ( d === 0.0 ) {\n\n\t\t\tthis.lightDistance.visible = false;\n\n\t\t} else {\n\n\t\t\tthis.lightDistance.visible = true;\n\t\t\tthis.lightDistance.scale.set( d, d, d );\n\n\t\t}\n\t\t*/\n\n\t}\n\n}\n\n\nexport { PointLightHelper };\n"],"x_google_ignoreList":[0,1,2,3,4],"mappings":";;;;AAGA,IAAM,oBAAoB,IAAI,GAAS,EACjC,oBAAoB,IAAI,GAAS,EACjC,oBAAoB,IAAI,GAAS,EACjC,oBAAoB,IAAI,GAAS,EAEjC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAElC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAClC,oBAAqB,IAAI,GAAS,EAKlC,IAAN,MAAM,EAAS;CASd,YAAa,IAAI,IAAI,GAAS,EAAE,IAAI,IAAI,GAAS,EAAE,IAAI,IAAI,GAAS,EAAG;AAqBtE,EAdA,KAAK,IAAI,GAOT,KAAK,IAAI,GAOT,KAAK,IAAI;;CAaV,OAAO,UAAW,GAAG,GAAG,GAAG,GAAS;AAInC,EAFA,EAAO,WAAY,GAAG,EAAG,EACzB,EAAI,WAAY,GAAG,EAAG,EACtB,EAAO,MAAO,EAAK;EAEnB,IAAM,IAAiB,EAAO,UAAU;AAOxC,SANK,IAAiB,IAEd,EAAO,eAAgB,IAAI,KAAK,KAAM,EAAgB,CAAE,GAIzD,EAAO,IAAK,GAAG,GAAG,EAAG;;CAe7B,OAAO,aAAc,GAAO,GAAG,GAAG,GAAG,GAAS;AAM7C,EAFA,EAAI,WAA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M,KAAK,MAAM,MAAO,GAJ5C,KAAK,SAAS,MAAM,IAAK,KAAK,MAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SpotLightHelper-m-Rh8vGU.mjs","names":[],"sources":["../../../../node_modules/three/src/materials/LineBasicMaterial.js","../../../../node_modules/three/src/objects/Line.js","../../../../node_modules/three/src/objects/LineSegments.js","../../../../node_modules/three/src/helpers/SpotLightHelper.js"],"sourcesContent":["import { Material } from './Material.js';\nimport { Color } from '../math/Color.js';\n\n/**\n * A material for rendering line primitives.\n *\n * Materials define the appearance of renderable 3D objects.\n *\n * ```js\n * const material = new THREE.LineBasicMaterial( { color: 0xffffff } );\n * ```\n *\n * @augments Material\n */\nclass LineBasicMaterial extends Material {\n\n\t/**\n\t * Constructs a new line basic material.\n\t *\n\t * @param {Object} [parameters] - An object with one or more properties\n\t * defining the material's appearance. Any property of the material\n\t * (including any property from inherited materials) can be passed\n\t * in here. Color values can be passed any type of value accepted\n\t * by {@link Color#set}.\n\t */\n\tconstructor( parameters ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineBasicMaterial = true;\n\n\t\tthis.type = 'LineBasicMaterial';\n\n\t\t/**\n\t\t * Color of the material.\n\t\t *\n\t\t * @type {Color}\n\t\t * @default (1,1,1)\n\t\t */\n\t\tthis.color = new Color( 0xffffff );\n\n\t\t/**\n\t\t * Sets the color of the lines using data from a texture. The texture map\n\t\t * color is modulated by the diffuse `color`.\n\t\t *\n\t\t * `map` represents color data, and the texture must be assigned a\n\t\t * {@link Texture#colorSpace}. Most `map` textures set\n\t\t * `texture.colorSpace = SRGBColorSpace`.\n\t\t *\n\t\t * @type {?Texture}\n\t\t * @default null\n\t\t */\n\t\tthis.map = null;\n\n\t\t/**\n\t\t * Controls line thickness or lines.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}. WebGL and WebGPU\n\t\t * ignore this setting and always render line primitives with a\n\t\t * width of one pixel.\n\t\t *\n\t\t * @type {number}\n\t\t * @default 1\n\t\t */\n\t\tthis.linewidth = 1;\n\n\t\t/**\n\t\t * Defines appearance of line ends.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('butt'|'round'|'square')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.linecap = 'round';\n\n\t\t/**\n\t\t * Defines appearance of line joints.\n\t\t *\n\t\t * Can only be used with {@link SVGRenderer}.\n\t\t *\n\t\t * @type {('round'|'bevel'|'miter')}\n\t\t * @default 'round'\n\t\t */\n\t\tthis.linejoin = 'round';\n\n\t\t/**\n\t\t * Whether the material is affected by fog or not.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default true\n\t\t */\n\t\tthis.fog = true;\n\n\t\tthis.setValues( parameters );\n\n\t}\n\n\tcopy( source ) {\n\n\t\tsuper.copy( source );\n\n\t\tthis.color.copy( source.color );\n\n\t\tthis.map = source.map;\n\n\t\tthis.linewidth = source.linewidth;\n\t\tthis.linecap = source.linecap;\n\t\tthis.linejoin = source.linejoin;\n\n\t\tthis.fog = source.fog;\n\n\t\treturn this;\n\n\t}\n\n}\n\nexport { LineBasicMaterial };\n","import { Sphere } from '../math/Sphere.js';\nimport { Ray } from '../math/Ray.js';\nimport { Matrix4 } from '../math/Matrix4.js';\nimport { Object3D } from '../core/Object3D.js';\nimport { Vector3 } from '../math/Vector3.js';\nimport { LineBasicMaterial } from '../materials/LineBasicMaterial.js';\nimport { BufferGeometry } from '../core/BufferGeometry.js';\nimport { Float32BufferAttribute } from '../core/BufferAttribute.js';\nimport { warn } from '../utils.js';\n\nconst _vStart = /*@__PURE__*/ new Vector3();\nconst _vEnd = /*@__PURE__*/ new Vector3();\n\nconst _inverseMatrix = /*@__PURE__*/ new Matrix4();\nconst _ray = /*@__PURE__*/ new Ray();\nconst _sphere = /*@__PURE__*/ new Sphere();\n\nconst _intersectPointOnRay = /*@__PURE__*/ new Vector3();\nconst _intersectPointOnSegment = /*@__PURE__*/ new Vector3();\n\n/**\n * A continuous line. The line are rendered by connecting consecutive\n * vertices with straight lines.\n *\n * ```js\n * const material = new THREE.LineBasicMaterial( { color: 0x0000ff } );\n *\n * const points = [];\n * points.push( new THREE.Vector3( - 10, 0, 0 ) );\n * points.push( new THREE.Vector3( 0, 10, 0 ) );\n * points.push( new THREE.Vector3( 10, 0, 0 ) );\n *\n * const geometry = new THREE.BufferGeometry().setFromPoints( points );\n *\n * const line = new THREE.Line( geometry, material );\n * scene.add( line );\n * ```\n *\n * @augments Object3D\n */\nclass Line extends Object3D {\n\n\t/**\n\t * Constructs a new line.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array<Material>} [material] - The line material.\n\t */\n\tconstructor( geometry = new BufferGeometry(), material = new LineBasicMaterial() ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLine = true;\n\n\t\tthis.type = 'Line';\n\n\t\t/**\n\t\t * The line geometry.\n\t\t *\n\t\t * @type {BufferGeometry}\n\t\t */\n\t\tthis.geometry = geometry;\n\n\t\t/**\n\t\t * The line material.\n\t\t *\n\t\t * @type {Material|Array<Material>}\n\t\t * @default LineBasicMaterial\n\t\t */\n\t\tthis.material = material;\n\n\t\t/**\n\t\t * A dictionary representing the morph targets in the geometry. The key is the\n\t\t * morph targets name, the value its attribute index. This member is `undefined`\n\t\t * by default and only set when morph targets are detected in the geometry.\n\t\t *\n\t\t * @type {Object<string,number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetDictionary = undefined;\n\n\t\t/**\n\t\t * An array of weights typically in the range `[0,1]` that specify how much of the morph\n\t\t * is applied. This member is `undefined` by default and only set when morph targets are\n\t\t * detected in the geometry.\n\t\t *\n\t\t * @type {Array<number>|undefined}\n\t\t * @default undefined\n\t\t */\n\t\tthis.morphTargetInfluences = undefined;\n\n\t\tthis.updateMorphTargets();\n\n\t}\n\n\tcopy( source, recursive ) {\n\n\t\tsuper.copy( source, recursive );\n\n\t\tthis.material = Array.isArray( source.material ) ? source.material.slice() : source.material;\n\t\tthis.geometry = source.geometry;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes an array of distance values which are necessary for rendering dashed lines.\n\t * For each vertex in the geometry, the method calculates the cumulative length from the\n\t * current point to the very beginning of the line.\n\t *\n\t * @return {Line} A reference to this line.\n\t */\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [ 0 ];\n\n\t\t\tfor ( let i = 1, l = positionAttribute.count; i < l; i ++ ) {\n\n\t\t\t\t_vStart.fromBufferAttribute( positionAttribute, i - 1 );\n\t\t\t\t_vEnd.fromBufferAttribute( positionAttribute, i );\n\n\t\t\t\tlineDistances[ i ] = lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i ] += _vStart.distanceTo( _vEnd );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\twarn( 'Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Computes intersection points between a casted ray and this line.\n\t *\n\t * @param {Raycaster} raycaster - The raycaster.\n\t * @param {Array<Object>} intersects - The target array that holds the intersection points.\n\t */\n\traycast( raycaster, intersects ) {\n\n\t\tconst geometry = this.geometry;\n\t\tconst matrixWorld = this.matrixWorld;\n\t\tconst threshold = raycaster.params.Line.threshold;\n\t\tconst drawRange = geometry.drawRange;\n\n\t\t// Checking boundingSphere distance to ray\n\n\t\tif ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();\n\n\t\t_sphere.copy( geometry.boundingSphere );\n\t\t_sphere.applyMatrix4( matrixWorld );\n\t\t_sphere.radius += threshold;\n\n\t\tif ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;\n\n\t\t//\n\n\t\t_inverseMatrix.copy( matrixWorld ).invert();\n\t\t_ray.copy( raycaster.ray ).applyMatrix4( _inverseMatrix );\n\n\t\tconst localThreshold = threshold / ( ( this.scale.x + this.scale.y + this.scale.z ) / 3 );\n\t\tconst localThresholdSq = localThreshold * localThreshold;\n\n\t\tconst step = this.isLineSegments ? 2 : 1;\n\n\t\tconst index = geometry.index;\n\t\tconst attributes = geometry.attributes;\n\t\tconst positionAttribute = attributes.position;\n\n\t\tif ( index !== null ) {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( index.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst a = index.getX( i );\n\t\t\t\tconst b = index.getX( i + 1 );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, a, b, i );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst a = index.getX( end - 1 );\n\t\t\t\tconst b = index.getX( start );\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, a, b, end - 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tconst start = Math.max( 0, drawRange.start );\n\t\t\tconst end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );\n\n\t\t\tfor ( let i = start, l = end - 1; i < l; i += step ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, i, i + 1, i );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( this.isLineLoop ) {\n\n\t\t\t\tconst intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, end - 1, start, end - 1 );\n\n\t\t\t\tif ( intersect ) {\n\n\t\t\t\t\tintersects.push( intersect );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Sets the values of {@link Line#morphTargetDictionary} and {@link Line#morphTargetInfluences}\n\t * to make sure existing morph targets can influence this 3D object.\n\t */\n\tupdateMorphTargets() {\n\n\t\tconst geometry = this.geometry;\n\n\t\tconst morphAttributes = geometry.morphAttributes;\n\t\tconst keys = Object.keys( morphAttributes );\n\n\t\tif ( keys.length > 0 ) {\n\n\t\t\tconst morphAttribute = morphAttributes[ keys[ 0 ] ];\n\n\t\t\tif ( morphAttribute !== undefined ) {\n\n\t\t\t\tthis.morphTargetInfluences = [];\n\t\t\t\tthis.morphTargetDictionary = {};\n\n\t\t\t\tfor ( let m = 0, ml = morphAttribute.length; m < ml; m ++ ) {\n\n\t\t\t\t\tconst name = morphAttribute[ m ].name || String( m );\n\n\t\t\t\t\tthis.morphTargetInfluences.push( 0 );\n\t\t\t\t\tthis.morphTargetDictionary[ name ] = m;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n}\n\nfunction checkIntersection( object, raycaster, ray, thresholdSq, a, b, i ) {\n\n\tconst positionAttribute = object.geometry.attributes.position;\n\n\t_vStart.fromBufferAttribute( positionAttribute, a );\n\t_vEnd.fromBufferAttribute( positionAttribute, b );\n\n\tconst distSq = ray.distanceSqToSegment( _vStart, _vEnd, _intersectPointOnRay, _intersectPointOnSegment );\n\n\tif ( distSq > thresholdSq ) return;\n\n\t_intersectPointOnRay.applyMatrix4( object.matrixWorld ); // Move back to world space for distance calculation\n\n\tconst distance = raycaster.ray.origin.distanceTo( _intersectPointOnRay );\n\n\tif ( distance < raycaster.near || distance > raycaster.far ) return;\n\n\treturn {\n\n\t\tdistance: distance,\n\t\t// What do we want? intersection point on the ray or on the segment??\n\t\t// point: raycaster.ray.at( distance ),\n\t\tpoint: _intersectPointOnSegment.clone().applyMatrix4( object.matrixWorld ),\n\t\tindex: i,\n\t\tface: null,\n\t\tfaceIndex: null,\n\t\tbarycoord: null,\n\t\tobject: object\n\n\t};\n\n}\n\nexport { Line };\n","import { Line } from './Line.js';\nimport { Vector3 } from '../math/Vector3.js';\nimport { Float32BufferAttribute } from '../core/BufferAttribute.js';\nimport { warn } from '../utils.js';\n\nconst _start = /*@__PURE__*/ new Vector3();\nconst _end = /*@__PURE__*/ new Vector3();\n\n/**\n * A series of lines drawn between pairs of vertices.\n *\n * @augments Line\n */\nclass LineSegments extends Line {\n\n\t/**\n\t * Constructs a new line segments.\n\t *\n\t * @param {BufferGeometry} [geometry] - The line geometry.\n\t * @param {Material|Array<Material>} [material] - The line material.\n\t */\n\tconstructor( geometry, material ) {\n\n\t\tsuper( geometry, material );\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tthis.isLineSegments = true;\n\n\t\tthis.type = 'LineSegments';\n\n\t}\n\n\tcomputeLineDistances() {\n\n\t\tconst geometry = this.geometry;\n\n\t\t// we assume non-indexed geometry\n\n\t\tif ( geometry.index === null ) {\n\n\t\t\tconst positionAttribute = geometry.attributes.position;\n\t\t\tconst lineDistances = [];\n\n\t\t\tfor ( let i = 0, l = positionAttribute.count; i < l; i += 2 ) {\n\n\t\t\t\t_start.fromBufferAttribute( positionAttribute, i );\n\t\t\t\t_end.fromBufferAttribute( positionAttribute, i + 1 );\n\n\t\t\t\tlineDistances[ i ] = ( i === 0 ) ? 0 : lineDistances[ i - 1 ];\n\t\t\t\tlineDistances[ i + 1 ] = lineDistances[ i ] + _start.distanceTo( _end );\n\n\t\t\t}\n\n\t\t\tgeometry.setAttribute( 'lineDistance', new Float32BufferAttribute( lineDistances, 1 ) );\n\n\t\t} else {\n\n\t\t\twarn( 'LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n}\n\nexport { LineSegments };\n","import { Vector3 } from '../math/Vector3.js';\nimport { Object3D } from '../core/Object3D.js';\nimport { LineSegments } from '../objects/LineSegments.js';\nimport { LineBasicMaterial } from '../materials/LineBasicMaterial.js';\nimport { Float32BufferAttribute } from '../core/BufferAttribute.js';\nimport { BufferGeometry } from '../core/BufferGeometry.js';\n\nconst _vector = /*@__PURE__*/ new Vector3();\n\n/**\n * This displays a cone shaped helper object for a {@link SpotLight}.\n *\n * When the spot light or its target are transformed or light properties are\n * changed, it's necessary to call the `update()` method of the respective helper.\n *\n * ```js\n * const spotLight = new THREE.SpotLight( 0xffffff );\n * spotLight.position.set( 10, 10, 10 );\n * scene.add( spotLight );\n *\n * const spotLightHelper = new THREE.SpotLightHelper( spotLight );\n * scene.add( spotLightHelper );\n * ```\n *\n * @augments Object3D\n */\nclass SpotLightHelper extends Object3D {\n\n\t/**\n\t * Constructs a new spot light helper.\n\t *\n\t * @param {HemisphereLight} light - The light to be visualized.\n\t * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take\n\t * the color of the light.\n\t */\n\tconstructor( light, color ) {\n\n\t\tsuper();\n\n\t\t/**\n\t\t * The light being visualized.\n\t\t *\n\t\t * @type {SpotLight}\n\t\t */\n\t\tthis.light = light;\n\n\t\tthis.matrixAutoUpdate = false;\n\n\t\t/**\n\t\t * The color parameter passed in the constructor.\n\t\t * If not set, the helper will take the color of the light.\n\t\t *\n\t\t * @type {number|Color|string}\n\t\t */\n\t\tthis.color = color;\n\n\t\tthis.type = 'SpotLightHelper';\n\n\t\tconst geometry = new BufferGeometry();\n\n\t\tconst positions = [\n\t\t\t0, 0, 0, \t0, 0, 1,\n\t\t\t0, 0, 0, \t1, 0, 1,\n\t\t\t0, 0, 0,\t- 1, 0, 1,\n\t\t\t0, 0, 0, \t0, 1, 1,\n\t\t\t0, 0, 0, \t0, - 1, 1\n\t\t];\n\n\t\tfor ( let i = 0, j = 1, l = 32; i < l; i ++, j ++ ) {\n\n\t\t\tconst p1 = ( i / l ) * Math.PI * 2;\n\t\t\tconst p2 = ( j / l ) * Math.PI * 2;\n\n\t\t\tpositions.push(\n\t\t\t\tMath.cos( p1 ), Math.sin( p1 ), 1,\n\t\t\t\tMath.cos( p2 ), Math.sin( p2 ), 1\n\t\t\t);\n\n\t\t}\n\n\t\tgeometry.setAttribute( 'position', new Float32BufferAttribute( positions, 3 ) );\n\n\t\tconst material = new LineBasicMaterial( { fog: false, toneMapped: false } );\n\n\t\tthis.cone = new LineSegments( geometry, material );\n\t\tthis.add( this.cone );\n\n\t\tthis.update();\n\n\t}\n\n\t/**\n\t * Frees the GPU-related resources allocated by this instance. Call this\n\t * method whenever this instance is no longer used in your app.\n\t */\n\tdispose() {\n\n\t\tthis.cone.geometry.dispose();\n\t\tthis.cone.material.dispose();\n\n\t}\n\n\t/**\n\t * Updates the helper to match the position and direction of the\n\t * light being visualized.\n\t */\n\tupdate() {\n\n\t\tthis.light.updateWorldMatrix( true, false );\n\t\tthis.light.target.updateWorldMatrix( true, false );\n\n\t\t// update the local matrix based on the parent and light target transforms\n\t\tif ( this.parent ) {\n\n\t\t\tthis.parent.updateWorldMatrix( true );\n\n\t\t\tthis.matrix\n\t\t\t\t.copy( this.parent.matrixWorld )\n\t\t\t\t.invert()\n\t\t\t\t.multiply( this.light.matrixWorld );\n\n\t\t} else {\n\n\t\t\tthis.matrix.copy( this.light.matrixWorld );\n\n\t\t}\n\n\t\tthis.matrixWorldNeedsUpdate = true;\n\n\t\tconst coneLength = this.light.distance ? this.light.distance : 1000;\n\t\tconst coneWidth = coneLength * Math.tan( this.light.angle );\n\n\t\tthis.cone.scale.set( coneWidth, coneWidth, coneLength );\n\n\t\t_vector.setFromMatrixPosition( this.light.target.matrixWorld );\n\n\t\tthis.cone.lookAt( _vector );\n\n\t\tif ( this.color !== undefined ) {\n\n\t\t\tthis.cone.material.color.set( this.color );\n\n\t\t} else {\n\n\t\t\tthis.cone.material.color.copy( this.light.color );\n\n\t\t}\n\n\t}\n\n}\n\n\nexport { SpotLightHelper };\n"],"x_google_ignoreList":[0,1,2,3],"mappings":";;;AAcA,IAAM,IAAN,cAAgC,EAAS;CAWxC,YAAa,GAAa;AA4EzB,EA1EA,OAAO,EASP,KAAK,sBAAsB,IAE3B,KAAK,OAAO,qBAQZ,KAAK,QAAQ,IAAI,EAAO,SAAU,EAalC,KAAK,MAAM,MAYX,KAAK,YAAY,GAUjB,KAAK,UAAU,SAUf,KAAK,WAAW,SAQhB,KAAK,MAAM,IAEX,KAAK,UAAW,EAAY;;CAI7B,KAAM,GAAS;AAcd,SAZA,MAAM,KAAM,EAAQ,EAEpB,KAAK,MAAM,KAAM,EAAO,MAAO,EAE/B,KAAK,MAAM,EAAO,KAElB,KAAK,YAAY,EAAO,WACxB,KAAK,UAAU,EAAO,SACtB,KAAK,WAAW,EAAO,UAEvB,KAAK,MAAM,EAAO,KAEX;;GC7GH,oBAAwB,IAAI,GAAS,EACrC,oBAAsB,IAAI,GAAS,EAEnC,oBAA+B,IAAI,GAAS,EAC5C,oBAAqB,IAAI,GAAK,EAC9B,oBAAwB,IAAI,GAAQ,EAEpC,oBAAqC,IAAI,GAAS,EAClD,oBAAyC,IAAI,GAAS,EAsBtD,IAAN,cAAmB,EAAS;CAQ3B,YAAa,IAAW,IAAI,GAAgB,EAAE,IAAW,IAAI,GAAmB,EAAG;AAkDlF,EAhDA,OAAO,EASP,KAAK,SAAS,IAEd,KAAK,OAAO,QAOZ,KAAK,WAAW,GAQhB,KAAK,WAAW,GAUhB,KAAK,wBAAwB,KAAA,GAU7B,KAAK,wBAAwB,KAAA,GAE7B,KAAK,oBAAoB;;CAI1B,KAAM,GAAQ,GAAY;AAOzB,SALA,MAAM,KAAM,GAAQ,EAAW,EAE/B,KA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pC,KAAK,OAAO,KAAM,KAAK,MAAM,YAAa,EAI3C,KAAK,yBAAyB;EAE9B,IAAM,IAAa,KAAK,MAAM,WAAW,KAAK,MAAM,WAAW,KACzD,IAAY,IAAa,KAAK,IAAK,KAAK,MAAM,MAAO;AAQ3D,EANA,KAAK,KAAK,MAAM,IAAK,GAAW,GAAW,EAAY,EAEvD,EAAQ,sBAAuB,KAAK,MAAM,OAAO,YAAa,EAE9D,KAAK,KAAK,OAAQ,EAAS,EAEtB,KAAK,UAAU,KAAA,IAMnB,KAAK,KAAK,SAAS,MAAM,KAAM,KAAK,MAAM,MAAO,GAJjD,KAAK,KAAK,SAAS,MAAM,IAAK,KAAK,MAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"USDZExporter-MdkuT226.mjs","names":[],"sources":["../../../../node_modules/three/examples/jsm/exporters/USDZExporter.js"],"sourcesContent":["import {\n\tNoColorSpace,\n\tDoubleSide,\n\tColor,\n\tPropertyBinding,\n} from 'three';\n\nimport {\n\tstrToU8,\n\tzipSync,\n} from '../libs/fflate.module.js';\n\nclass USDNode {\n\n\tconstructor( name, type = '', metadata = [], properties = [] ) {\n\n\t\tthis.name = name;\n\t\tthis.type = type;\n\t\tthis.metadata = metadata;\n\t\tthis.properties = properties;\n\t\tthis.children = [];\n\n\t}\n\n\taddMetadata( key, value ) {\n\n\t\tthis.metadata.push( { key, value } );\n\n\t}\n\n\taddProperty( property, metadata = [] ) {\n\n\t\tthis.properties.push( { property, metadata } );\n\n\t}\n\n\taddChild( child ) {\n\n\t\tthis.children.push( child );\n\n\t}\n\n\ttoString( indent = 0 ) {\n\n\t\tconst pad = '\\t'.repeat( indent );\n\n\t\tconst formattedMetadata = this.metadata.map( ( item ) => {\n\n\t\t\tconst key = item.key;\n\t\t\tconst value = item.value;\n\n\t\t\tif ( Array.isArray( value ) ) {\n\n\t\t\t\tconst lines = [];\n\t\t\t\tlines.push( `${key} = {` );\n\t\t\t\tvalue.forEach( ( line ) => {\n\n\t\t\t\t\tlines.push( `${pad}\\t\\t${line}` );\n\n\t\t\t\t} );\n\t\t\t\tlines.push( `${pad}\\t}` );\n\t\t\t\treturn lines.join( '\\n' );\n\n\t\t\t} else {\n\n\t\t\t\treturn `${key} = ${value}`;\n\n\t\t\t}\n\n\t\t} );\n\n\t\tconst meta = formattedMetadata.length\n\t\t\t? ` (\\n${formattedMetadata\n\t\t\t\t.map( ( l ) => `${pad}\\t${l}` )\n\t\t\t\t.join( '\\n' )}\\n${pad})`\n\t\t\t: '';\n\n\t\tconst properties = this.properties.map( ( l ) => {\n\n\t\t\tconst property = l.property.replace( /\\n/g, '\\n' + pad + '\\t' );\n\t\t\tconst metadata = l.metadata.length\n\t\t\t\t? ` (\\n${l.metadata.map( ( m ) => `${pad}\\t\\t${m}` ).join( '\\n' )}\\n${pad}\\t)`\n\t\t\t\t: '';\n\t\t\treturn `${pad}\\t${property}${metadata}`;\n\n\t\t} );\n\t\tconst children = this.children.map( ( c ) => c.toString( indent + 1 ) );\n\n\t\tconst bodyLines = [];\n\n\t\tif ( properties.length > 0 ) {\n\n\t\t\tbodyLines.push( ...properties );\n\n\t\t}\n\n\t\tif ( children.length > 0 ) {\n\n\t\t\tif ( properties.length > 0 ) {\n\n\t\t\t\tbodyLines.push( '' );\n\n\t\t\t}\n\n\t\t\tfor ( let i = 0; i < children.length; i ++ ) {\n\n\t\t\t\tbodyLines.push( children[ i ] );\n\t\t\t\tif ( i < children.length - 1 ) {\n\n\t\t\t\t\tbodyLines.push( '' );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst bodyContent = bodyLines.join( '\\n' );\n\n\t\tconst type = this.type ? this.type + ' ' : '';\n\n\t\treturn `${pad}def ${type}\"${this.name}\"${meta}\\n${pad}{\\n${bodyContent}\\n${pad}}`;\n\n\t}\n\n}\n\n/**\n * An exporter for USDZ.\n *\n * ```js\n * const exporter = new USDZExporter();\n * const arraybuffer = await exporter.parseAsync( scene );\n * ```\n *\n * @three_import import { USDZExporter } from 'three/addons/exporters/USDZExporter.js';\n */\nclass USDZExporter {\n\n\t/**\n\t * Constructs a new USDZ exporter.\n\t */\n\tconstructor() {\n\n\t\t/**\n\t\t * A reference to a texture utils module.\n\t\t *\n\t\t * @type {?(WebGLTextureUtils|WebGPUTextureUtils)}\n\t\t * @default null\n\t\t */\n\t\tthis.textureUtils = null;\n\n\t}\n\n\t/**\n\t * Sets the texture utils for this exporter. Only relevant when compressed textures have to be exported.\n\t *\n\t * Depending on whether you use {@link WebGLRenderer} or {@link WebGPURenderer}, you must inject the\n\t * corresponding texture utils {@link WebGLTextureUtils} or {@link WebGPUTextureUtils}.\n\t *\n\t * @param {WebGLTextureUtils|WebGPUTextureUtils} utils - The texture utils.\n\t */\n\tsetTextureUtils( utils ) {\n\n\t\tthis.textureUtils = utils;\n\n\t}\n\n\t/**\n\t * Parse the given 3D object and generates the USDZ output.\n\t *\n\t * @param {Object3D} scene - The 3D object to export.\n\t * @param {USDZExporter~OnDone} onDone - A callback function that is executed when the export has finished.\n\t * @param {USDZExporter~OnError} onError - A callback function that is executed when an error happens.\n\t * @param {USDZExporter~Options} options - The export options.\n\t */\n\tparse( scene, onDone, onError, options ) {\n\n\t\tthis.parseAsync( scene, options ).then( onDone ).catch( onError );\n\n\t}\n\n\t/**\n\t * Async version of {@link USDZExporter#parse}.\n\t *\n\t * @async\n\t * @param {Object3D} scene - The 3D object to export.\n\t * @param {USDZExporter~Options} options - The export options.\n\t * @return {Promise<ArrayBuffer>} A Promise that resolved with the exported USDZ data.\n\t */\n\tasync parseAsync( scene, options = {} ) {\n\n\t\toptions = Object.assign(\n\t\t\t{\n\t\t\t\tar: {\n\t\t\t\t\tanchoring: { type: 'plane' },\n\t\t\t\t\tplaneAnchoring: { alignment: 'horizontal' },\n\t\t\t\t},\n\t\t\t\tincludeAnchoringProperties: true,\n\t\t\t\tonlyVisible: true,\n\t\t\t\tquickLookCompatible: false,\n\t\t\t\tmaxTextureSize: 1024,\n\t\t\t\tanimations: [],\n\t\t\t\tanimationFrameRate: 60,\n\t\t\t},\n\t\t\toptions\n\t\t);\n\n\t\tconst usedNames = new Set();\n\n\t\tconst files = {};\n\t\tconst modelFileName = 'model.usda';\n\n\t\t// model file should be first in USDZ archive so we init it here\n\t\tfiles[ modelFileName ] = null;\n\n\t\tconst animationTracks = buildAnimationTracks( scene, options.animations );\n\t\toptions.animationTracks = animationTracks;\n\n\t\tconst root = new USDNode( 'Root', 'Xform' );\n\t\tconst scenesNode = new USDNode( 'Scenes', 'Scope' );\n\t\tscenesNode.addMetadata( 'kind', '\"sceneLibrary\"' );\n\t\troot.addChild( scenesNode );\n\n\t\tconst sceneName = 'Scene';\n\t\tconst sceneNode = new USDNode( sceneName, 'Xform' );\n\t\tsceneNode.addMetadata( 'customData', [\n\t\t\t'bool preliminary_collidesWithEnvironment = 0',\n\t\t\t`string sceneName = \"${sceneName}\"`,\n\t\t] );\n\t\tsceneNode.addMetadata( 'sceneName', `\"${sceneName}\"` );\n\t\tif ( options.includeAnchoringProperties ) {\n\n\t\t\tsceneNode.addProperty(\n\t\t\t\t`token preliminary:anchoring:type = \"${options.ar.anchoring.type}\"`\n\t\t\t);\n\t\t\tsceneNode.addProperty(\n\t\t\t\t`token preliminary:planeAnchoring:alignment = \"${options.ar.planeAnchoring.alignment}\"`\n\t\t\t);\n\n\t\t}\n\n\t\tscenesNode.addChild( sceneNode );\n\n\t\tlet output;\n\n\t\tconst materials = {};\n\t\tconst textures = {};\n\n\t\tif ( scene.isScene ) {\n\n\t\t\tbuildHierarchy( scene, sceneNode, materials, usedNames, files, options );\n\n\t\t} else {\n\n\t\t\tbuildNode( scene, sceneNode, materials, usedNames, files, options );\n\n\t\t}\n\n\t\tconst materialsNode = buildMaterials(\n\t\t\tmaterials,\n\t\t\ttextures,\n\t\t\toptions.quickLookCompatible\n\t\t);\n\n\t\tconst timeRange = animationTracks.size > 0\n\t\t\t? { fps: options.animationFrameRate, endTimeCode: getMaxClipDuration( options.animations ) * options.animationFrameRate }\n\t\t\t: null;\n\n\t\toutput =\n\t\t\tbuildHeader( timeRange ) +\n\t\t\t'\\n' +\n\t\t\troot.toString() +\n\t\t\t'\\n\\n' +\n\t\t\tmaterialsNode.toString();\n\n\t\tfiles[ modelFileName ] = strToU8( output );\n\t\toutput = null;\n\n\t\tfor ( const id in textures ) {\n\n\t\t\tlet texture = textures[ id ];\n\n\t\t\tif ( texture.isCompressedTexture === true ) {\n\n\t\t\t\tif ( this.textureUtils === null ) {\n\n\t\t\t\t\tthrow new Error(\n\t\t\t\t\t\t'THREE.USDZExporter: setTextureUtils() must be called to process compressed textures.'\n\t\t\t\t\t);\n\n\t\t\t\t} else {\n\n\t\t\t\t\ttexture = await this.textureUtils.decompress( texture );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tconst canvas = imageToCanvas(\n\t\t\t\ttexture.image,\n\t\t\t\ttexture.flipY,\n\t\t\t\toptions.maxTextureSize\n\t\t\t);\n\n\t\t\tconst mimeType = ( texture.userData.mimeType === 'image/jpeg' ) ? 'image/jpeg' : 'image/png';\n\n\t\t\tconst blob = await new Promise( ( resolve ) =>\n\t\t\t\tcanvas.toBlob( resolve, mimeType )\n\t\t\t);\n\n\t\t\tfiles[ `textures/Texture_${id}.${getTextureExtension( texture )}` ] = new Uint8Array(\n\t\t\t\tawait blob.arrayBuffer()\n\t\t\t);\n\n\t\t}\n\n\t\t// 64 byte alignment\n\t\t// https://github.com/101arrowz/fflate/issues/39#issuecomment-777263109\n\n\t\tlet offset = 0;\n\n\t\tfor ( const filename in files ) {\n\n\t\t\tconst file = files[ filename ];\n\t\t\tconst headerSize = 34 + filename.length;\n\n\t\t\toffset += headerSize;\n\n\t\t\tconst offsetMod64 = offset & 63;\n\n\t\t\tif ( offsetMod64 !== 4 ) {\n\n\t\t\t\tconst padLength = 64 - offsetMod64;\n\t\t\t\tconst padding = new Uint8Array( padLength );\n\n\t\t\t\tfiles[ filename ] = [ file, { extra: { 12345: padding } } ];\n\n\t\t\t}\n\n\t\t\toffset = file.length;\n\n\t\t}\n\n\t\treturn zipSync( files, { level: 0 } );\n\n\t}\n\n}\n\nfunction getName( object, namesSet ) {\n\n\tlet name = object.name;\n\tname = name.replace( /[^A-Za-z0-9_]/g, '' );\n\tif ( /^[0-9]/.test( name ) ) {\n\n\t\tname = '_' + name;\n\n\t}\n\n\tif ( name === '' ) {\n\n\t\tif ( object.isCamera ) {\n\n\t\t\tname = 'Camera';\n\n\t\t} else {\n\n\t\t\tname = 'Object';\n\n\t\t}\n\n\t}\n\n\tif ( namesSet.has( name ) ) {\n\n\t\tname = name + '_' + object.id;\n\n\t}\n\n\tnamesSet.add( name );\n\n\treturn name;\n\n}\n\nfunction getTextureExtension( texture ) {\n\n\treturn texture.userData.mimeType === 'image/jpeg' ? 'jpg' : 'png';\n\n}\n\nfunction imageToCanvas( image, flipY, maxTextureSize ) {\n\n\tif (\n\t\t( typeof HTMLImageElement !== 'undefined' &&\n\t\t\timage instanceof HTMLImageElement ) ||\n\t\t( typeof HTMLCanvasElement !== 'undefined' &&\n\t\t\timage instanceof HTMLCanvasElement ) ||\n\t\t( typeof OffscreenCanvas !== 'undefined' &&\n\t\t\timage instanceof OffscreenCanvas ) ||\n\t\t( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap )\n\t) {\n\n\t\tconst scale = maxTextureSize / Math.max( image.width, image.height );\n\n\t\tconst canvas = document.createElement( 'canvas' );\n\t\tcanvas.width = image.width * Math.min( 1, scale );\n\t\tcanvas.height = image.height * Math.min( 1, scale );\n\n\t\tconst context = canvas.getContext( '2d' );\n\n\t\t// TODO: We should be able to do this in the UsdTransform2d?\n\n\t\tif ( flipY === true ) {\n\n\t\t\tcontext.translate( 0, canvas.height );\n\t\t\tcontext.scale( 1, - 1 );\n\n\t\t}\n\n\t\tcontext.drawImage( image, 0, 0, canvas.width, canvas.height );\n\n\t\treturn canvas;\n\n\t} else {\n\n\t\tthrow new Error(\n\t\t\t'THREE.USDZExporter: No valid image data found. Unable to process texture.'\n\t\t);\n\n\t}\n\n}\n\n//\n\nconst PRECISION = 7;\n\nfunction buildHeader( timeRange = null ) {\n\n\tconst timeMetadata = timeRange\n\t\t? `\n\tstartTimeCode = 0\n\tendTimeCode = ${timeRange.endTimeCode}\n\ttimeCodesPerSecond = ${timeRange.fps}\n\tframesPerSecond = ${timeRange.fps}`\n\t\t: '';\n\n\treturn `#usda 1.0\n(\n\tcustomLayerData = {\n\t\tstring creator = \"Three.js USDZExporter\"\n\t}\n\tdefaultPrim = \"Root\"\n\tmetersPerUnit = 1\n\tupAxis = \"Y\"${timeMetadata}\n)\n`;\n\n}\n\nfunction buildAnimationTracks( scene, clips ) {\n\n\t// Map<Object3D, { position?: KeyframeTrack, quaternion?: KeyframeTrack, scale?: KeyframeTrack }>\n\tconst tracksByObject = new Map();\n\n\tfor ( let c = 0; c < clips.length; c ++ ) {\n\n\t\tconst clip = clips[ c ];\n\n\t\tfor ( let t = 0; t < clip.tracks.length; t ++ ) {\n\n\t\t\tconst track = clip.tracks[ t ];\n\t\t\tconst binding = PropertyBinding.parseTrackName( track.name );\n\t\t\tconst target = PropertyBinding.findNode( scene, binding.nodeName );\n\n\t\t\tif ( target === null || target === undefined ) continue;\n\n\t\t\tconst property = binding.propertyName;\n\t\t\tif ( property !== 'position' && property !== 'quaternion' && property !== 'scale' ) continue;\n\n\t\t\tlet entry = tracksByObject.get( target );\n\t\t\tif ( entry === undefined ) {\n\n\t\t\t\tentry = {};\n\t\t\t\ttracksByObject.set( target, entry );\n\n\t\t\t}\n\n\t\t\tentry[ property ] = track;\n\n\t\t}\n\n\t}\n\n\treturn tracksByObject;\n\n}\n\nfunction getMaxClipDuration( clips ) {\n\n\tlet max = 0;\n\tfor ( let i = 0; i < clips.length; i ++ ) {\n\n\t\tif ( clips[ i ].duration > max ) max = clips[ i ].duration;\n\n\t}\n\n\treturn max;\n\n}\n\nfunction buildVector3TimeSamples( opName, opType, track, fps ) {\n\n\tconst times = track.times;\n\tconst values = track.values;\n\tconst samples = [];\n\n\tfor ( let i = 0; i < times.length; i ++ ) {\n\n\t\tconst o = i * 3;\n\t\tsamples.push( `${( times[ i ] * fps ).toPrecision( PRECISION )}: (${values[ o ].toPrecision( PRECISION )}, ${values[ o + 1 ].toPrecision( PRECISION )}, ${values[ o + 2 ].toPrecision( PRECISION )})` );\n\n\t}\n\n\treturn `${opType} ${opName}.timeSamples = {\\n\\t${samples.join( ',\\n\\t' )},\\n}`;\n\n}\n\nfunction buildQuaternionTimeSamples( track, fps ) {\n\n\tconst times = track.times;\n\tconst values = track.values;\n\tconst samples = [];\n\n\t// three.js quaternion order: (x, y, z, w); USD quatf order: (w, x, y, z)\n\tfor ( let i = 0; i < times.length; i ++ ) {\n\n\t\tconst o = i * 4;\n\t\tsamples.push( `${( times[ i ] * fps ).toPrecision( PRECISION )}: (${values[ o + 3 ].toPrecision( PRECISION )}, ${values[ o ].toPrecision( PRECISION )}, ${values[ o + 1 ].toPrecision( PRECISION )}, ${values[ o + 2 ].toPrecision( PRECISION )})` );\n\n\t}\n\n\treturn `quatf xformOp:orient.timeSamples = {\\n\\t${samples.join( ',\\n\\t' )},\\n}`;\n\n}\n\n// Xform\n\nfunction buildHierarchy( object, parentNode, materials, usedNames, files, options ) {\n\n\tfor ( let i = 0, l = object.children.length; i < l; i ++ ) {\n\n\t\tbuildNode( object.children[ i ], parentNode, materials, usedNames, files, options );\n\n\t}\n\n}\n\nfunction buildNode( object, parentNode, materials, usedNames, files, options ) {\n\n\tif ( object.visible === false && options.onlyVisible === true ) return;\n\n\tlet childNode;\n\n\tif ( object.isMesh ) {\n\n\t\tconst geometry = object.geometry;\n\t\tconst isMultiMaterial = Array.isArray( object.material );\n\n\t\tconst meshMaterials = isMultiMaterial ? object.material : [ object.material ];\n\n\t\tfor ( let i = 0; i < meshMaterials.length; i ++ ) {\n\n\t\t\tconst material = meshMaterials[ i ];\n\n\t\t\tif ( ! material.isMeshStandardMaterial ) {\n\n\t\t\t\tconsole.warn( 'THREE.USDZExporter: Use MeshStandardMaterial for best results.' );\n\n\t\t\t}\n\n\t\t\tif ( ! ( material.uuid in materials ) ) {\n\n\t\t\t\tmaterials[ material.uuid ] = material;\n\n\t\t\t}\n\n\t\t}\n\n\t\tconst resolvedMaterials = meshMaterials.map( ( m ) => materials[ m.uuid ] );\n\n\t\tif ( isMultiMaterial === false ) {\n\n\t\t\tconst geometryFileName = `geometries/Geometry_${geometry.id}.usda`;\n\n\t\t\tif ( ! ( geometryFileName in files ) ) {\n\n\t\t\t\tconst meshObject = buildMeshObject( geometry );\n\t\t\t\tfiles[ geometryFileName ] = strToU8(\n\t\t\t\t\tbuildHeader() + '\\n' + meshObject.toString()\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}\n\n\t\tchildNode = buildMesh(\n\t\t\tobject,\n\t\t\tgeometry,\n\t\t\tresolvedMaterials,\n\t\t\tusedNames,\n\t\t\toptions\n\t\t);\n\n\t} else if ( object.isCamera ) {\n\n\t\tchildNode = buildCamera( object, usedNames, options );\n\n\t} else {\n\n\t\tchildNode = buildXform( object, usedNames, options );\n\n\t}\n\n\tparentNode.addChild( childNode );\n\tbuildHierarchy( object, childNode, materials, usedNames, files, options );\n\n}\n\nfunction addTransformProperties( node, object, options ) {\n\n\tconst animTracks = options.animationTracks.get( object );\n\tconst hasPivot = object.pivot !== null;\n\n\tif ( ! hasPivot && animTracks === undefined ) {\n\n\t\tconst transform = buildMatrix( object.matrix );\n\t\tnode.addProperty( `matrix4d xformOp:transform = ${transform}` );\n\t\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:transform\"]' );\n\t\treturn;\n\n\t}\n\n\t// Per-op layout: animated channels use timeSamples, others stay static.\n\t// Pivot ops (when present) are always static.\n\n\tconst fps = options.animationFrameRate;\n\tconst p = object.position;\n\tconst q = object.quaternion;\n\tconst s = object.scale;\n\n\tif ( animTracks !== undefined && animTracks.position !== undefined ) {\n\n\t\tnode.addProperty( buildVector3TimeSamples( 'xformOp:translate', 'float3', animTracks.position, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `float3 xformOp:translate = (${p.x.toPrecision( PRECISION )}, ${p.y.toPrecision( PRECISION )}, ${p.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( hasPivot ) {\n\n\t\tconst piv = object.pivot;\n\t\tnode.addProperty( `float3 xformOp:translate:pivot = (${piv.x.toPrecision( PRECISION )}, ${piv.y.toPrecision( PRECISION )}, ${piv.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( animTracks !== undefined && animTracks.quaternion !== undefined ) {\n\n\t\tnode.addProperty( buildQuaternionTimeSamples( animTracks.quaternion, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `quatf xformOp:orient = (${q.w.toPrecision( PRECISION )}, ${q.x.toPrecision( PRECISION )}, ${q.y.toPrecision( PRECISION )}, ${q.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( animTracks !== undefined && animTracks.scale !== undefined ) {\n\n\t\tnode.addProperty( buildVector3TimeSamples( 'xformOp:scale', 'float3', animTracks.scale, fps ) );\n\n\t} else {\n\n\t\tnode.addProperty( `float3 xformOp:scale = (${s.x.toPrecision( PRECISION )}, ${s.y.toPrecision( PRECISION )}, ${s.z.toPrecision( PRECISION )})` );\n\n\t}\n\n\tif ( hasPivot ) {\n\n\t\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:translate:pivot\", \"xformOp:orient\", \"xformOp:scale\", \"!invert!xformOp:translate:pivot\"]' );\n\n\t} else {\n\n\t\tnode.addProperty( 'uniform token[] xformOpOrder = [\"xformOp:translate\", \"xformOp:orient\", \"xformOp:scale\"]' );\n\n\t}\n\n}\n\nfunction buildXform( object, usedNames, options ) {\n\n\tconst name = getName( object, usedNames );\n\n\tif ( object.matrix.determinant() < 0 ) {\n\n\t\tconsole.warn(\n\t\t\t'THREE.USDZExporter: USDZ does not support negative scales',\n\t\t\tobject\n\t\t);\n\n\t}\n\n\tconst node = new USDNode( name, 'Xform' );\n\taddTransformProperties( node, object, options );\n\n\treturn node;\n\n}\n\nfunction buildMesh( object, geometry, materials, usedNames, options ) {\n\n\tconst node = buildXform( object, usedNames, options );\n\n\tif ( materials.length === 1 ) {\n\n\t\tnode.addMetadata(\n\t\t\t'prepend references',\n\t\t\t`@./geometries/Geometry_${geometry.id}.usda@</Geometry>`\n\t\t);\n\t\tnode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\t\tnode.addProperty(\n\t\t\t`rel material:binding = </Materials/Material_${materials[ 0 ].id}>`\n\t\t);\n\n\t} else {\n\n\t\tnode.addChild( buildMeshNode( geometry, materials ) );\n\n\t}\n\n\treturn node;\n\n}\n\nfunction buildMatrix( matrix ) {\n\n\tconst array = matrix.elements;\n\n\treturn `( ${buildMatrixRow( array, 0 )}, ${buildMatrixRow(\n\t\tarray,\n\t\t4\n\t)}, ${buildMatrixRow( array, 8 )}, ${buildMatrixRow( array, 12 )} )`;\n\n}\n\nfunction buildMatrixRow( array, offset ) {\n\n\treturn `(${array[ offset + 0 ]}, ${array[ offset + 1 ]}, ${array[ offset + 2 ]}, ${\n\t\tarray[ offset + 3 ]\n\t})`;\n\n}\n\n// Mesh\n\nfunction buildMeshObject( geometry ) {\n\n\tconst node = new USDNode( 'Geometry' );\n\n\tconst meshNode = buildMeshNode( geometry );\n\tnode.addChild( meshNode );\n\n\treturn node;\n\n}\n\nfunction buildMeshNode( geometry, materials = null ) {\n\n\tconst name = 'Geometry';\n\tconst attributes = geometry.attributes;\n\tconst count = attributes.position.count;\n\n\tconst node = new USDNode( name, 'Mesh' );\n\n\tnode.addProperty(\n\t\t`int[] faceVertexCounts = [${buildMeshVertexCount( geometry )}]`\n\t);\n\tnode.addProperty(\n\t\t`int[] faceVertexIndices = [${buildMeshVertexIndices( geometry )}]`\n\t);\n\tnode.addProperty(\n\t\t`normal3f[] normals = [${buildVector3Array( attributes.normal, count )}]`,\n\t\t[ 'interpolation = \"vertex\"' ]\n\t);\n\tnode.addProperty(\n\t\t`point3f[] points = [${buildVector3Array( attributes.position, count )}]`\n\t);\n\n\tfor ( let i = 0; i < 4; i ++ ) {\n\n\t\tconst id = i > 0 ? i : '';\n\t\tconst attribute = attributes[ 'uv' + id ];\n\t\tif ( attribute !== undefined ) {\n\n\t\t\tnode.addProperty(\n\t\t\t\t`texCoord2f[] primvars:st${id} = [${buildVector2Array( attribute )}]`,\n\t\t\t\t[ 'interpolation = \"vertex\"' ]\n\t\t\t);\n\n\t\t}\n\n\t}\n\n\tconst colorAttribute = attributes.color;\n\tif ( colorAttribute !== undefined ) {\n\n\t\tnode.addProperty(\n\t\t\t`color3f[] primvars:displayColor = [${buildVector3Array(\n\t\t\t\tcolorAttribute,\n\t\t\t\tcount\n\t\t\t)}]`,\n\t\t\t[ 'interpolation = \"vertex\"' ]\n\t\t);\n\n\t}\n\n\tnode.addProperty( 'uniform token subdivisionScheme = \"none\"' );\n\n\tif ( materials !== null ) {\n\n\t\tconst groups = geometry.groups;\n\n\t\tconst totalFaces = ( geometry.index !== null\n\t\t\t? geometry.index.count\n\t\t\t: attributes.position.count ) / 3;\n\n\t\tfor ( let i = 0; i < groups.length; i ++ ) {\n\n\t\t\tconst group = groups[ i ];\n\t\t\tconst material = materials[ group.materialIndex ];\n\n\t\t\tif ( material === undefined ) continue;\n\n\t\t\tconst startFace = Math.floor( group.start / 3 );\n\t\t\tconst endFace = Math.min( startFace + Math.floor( group.count / 3 ), totalFaces );\n\n\t\t\tconst indices = [];\n\t\t\tfor ( let j = startFace; j < endFace; j ++ ) indices.push( j );\n\n\t\t\tconst subsetNode = new USDNode( `subset_${i}`, 'GeomSubset' );\n\t\t\tsubsetNode.addMetadata( 'prepend apiSchemas', '[\"MaterialBindingAPI\"]' );\n\t\t\tsubsetNode.addProperty( 'uniform token elementType = \"face\"' );\n\t\t\tsubsetNode.addProperty( 'uniform token familyName = \"materialBind\"' );\n\t\t\tsubsetNode.addProperty( `int[] indices = [${indices.join( ', ' )}]` );\n\t\t\tsubsetNode.addProperty(\n\t\t\t\t`rel material:binding = </Materials/Material_${material.id}>`\n\t\t\t);\n\t\t\tnode.addChild( subsetNode );\n\n\t\t}\n\n\t}\n\n\treturn node;\n\n}\n\nfunction buildMeshVertexCount( geometry ) {\n\n\tconst count =\n\t\tgeometry.index !== null\n\t\t\t? geometry.index.count\n\t\t\t: geometry.attributes.position.count;\n\n\treturn Array( count / 3 )\n\t\t.fill( 3 )\n\t\t.join( ', ' );\n\n}\n\nfunction buildMeshVertexIndices( geometry ) {\n\n\tconst index = geometry.index;\n\tconst array = [];\n\n\tif ( index !== null ) {\n\n\t\tfor ( let i = 0; i < index.count; i ++ ) {\n\n\t\t\tarray.push( index.getX( i ) );\n\n\t\t}\n\n\t} else {\n\n\t\tconst length = geometry.attributes.position.count;\n\n\t\tfor ( let i = 0; i < length; i ++ ) {\n\n\t\t\tarray.push( i );\n\n\t\t}\n\n\t}\n\n\treturn array.join( ', ' );\n\n}\n\nfunction buildVector3Array( attribute, count ) {\n\n\tif ( attribute === undefined ) {\n\n\t\tconsole.warn( 'USDZExporter: Normals missing.' );\n\t\treturn Array( count ).fill( '(0, 0, 0)' ).join( ', ' );\n\n\t}\n\n\tconst array = [];\n\n\tfor ( let i = 0; i < attribute.count; i ++ ) {\n\n\t\tconst x = attribute.getX( i );\n\t\tconst y = attribute.getY( i );\n\t\tconst z = attribute.getZ( i );\n\n\t\tarray.push(\n\t\t\t`(${x.toPrecision( PRECISION )}, ${y.toPrecision(\n\t\t\t\tPRECISION\n\t\t\t)}, ${z.toPrecision( PRECISION )})`\n\t\t);\n\n\t}\n\n\treturn array.join( ', ' );\n\n}\n\nfunction buildVector2Array( attribute ) {\n\n\tconst array = [];\n\n\tfor ( let i = 0; i < attribute.count; i ++ ) {\n\n\t\tconst x = attribute.getX( i );\n\t\tconst y = attribute.getY( i );\n\n\t\tarray.push(\n\t\t\t`(${x.toPrecision( PRECISION )}, ${1 - y.toPrecision( PRECISION )})`\n\t\t);\n\n\t}\n\n\treturn array.join( ', ' );\n\n}\n\n// Materials\n\nfunction buildMaterials( materials, textures, quickLookCompatible = false ) {\n\n\tconst materialsNode = new USDNode( 'Materials' );\n\n\tfor ( const uuid in materials ) {\n\n\t\tconst material = materials[ uuid ];\n\n\t\tmaterialsNode.addChild(\n\t\t\tbuildMaterial( material, textures, quickLookCompatible )\n\t\t);\n\n\t}\n\n\treturn materialsNode;\n\n}\n\nfunction buildMaterial( material, textures, quickLookCompatible = false ) {\n\n\t// https://graphics.pixar.com/usd/docs/UsdPreviewSurface-Proposal.html\n\n\tconst materialNode = new USDNode( `Material_${material.id}`, 'Material' );\n\n\tfunction buildTextureNodes( texture, mapType, color ) {\n\n\t\tconst id = texture.source.id + '_' + texture.flipY;\n\n\t\ttextures[ id ] = texture;\n\n\t\tconst uv = texture.channel > 0 ? 'st' + texture.channel : 'st';\n\n\t\tconst WRAPPINGS = {\n\t\t\t1000: 'repeat', // RepeatWrapping\n\t\t\t1001: 'clamp', // ClampToEdgeWrapping\n\t\t\t1002: 'mirror', // MirroredRepeatWrapping\n\t\t};\n\n\t\tconst repeat = texture.repeat.clone();\n\t\tconst offset = texture.offset.clone();\n\t\tconst rotation = texture.rotation;\n\n\t\t// rotation is around the wrong point. after rotation we need to shift offset again so that we're rotating around the right spot\n\t\tconst xRotationOffset = Math.sin( rotation );\n\t\tconst yRotationOffset = Math.cos( rotation );\n\n\t\t// texture coordinates start in the opposite corner, need to correct\n\t\toffset.y = 1 - offset.y - repeat.y;\n\n\t\t// turns out QuickLook is buggy and interprets texture repeat inverted/applies operations in a different order.\n\t\t// Apple Feedback: \tFB10036297 and FB11442287\n\t\tif ( quickLookCompatible ) {\n\n\t\t\t// This is NOT correct yet in QuickLook, but comes close for a range of models.\n\t\t\t// It becomes more incorrect the bigger the offset is\n\n\t\t\toffset.x = offset.x / repeat.x;\n\t\t\toffset.y = offset.y / repeat.y;\n\n\t\t\toffset.x += xRotationOffset / repeat.x;\n\t\t\toffset.y += yRotationOffset - 1;\n\n\t\t} else {\n\n\t\t\t// results match glTF results exactly. verified correct in usdview.\n\t\t\toffset.x += xRotationOffset * repeat.x;\n\t\t\toffset.y += ( 1 - yRotationOffset ) * repeat.y;\n\n\t\t}\n\n\t\tconst primvarReaderNode = new USDNode( `PrimvarReader_${mapType}`, 'Shader' );\n\t\tprimvarReaderNode.addProperty(\n\t\t\t'uniform token info:id = \"UsdPrimvarReader_float2\"'\n\t\t);\n\t\tprimvarReaderNode.addProperty( 'float2 inputs:fallback = (0.0, 0.0)' );\n\t\tprimvarReaderNode.addProperty( `string inputs:varname = \"${uv}\"` );\n\t\tprimvarReaderNode.addProperty( 'float2 outputs:result' );\n\n\t\tconst transform2dNode = new USDNode( `Transform2d_${mapType}`, 'Shader' );\n\t\ttransform2dNode.addProperty( 'uniform token info:id = \"UsdTransform2d\"' );\n\t\ttransform2dNode.addProperty(\n\t\t\t`float2 inputs:in.connect = </Materials/Material_${material.id}/PrimvarReader_${mapType}.outputs:result>`\n\t\t);\n\t\ttransform2dNode.addProperty(\n\t\t\t`float inputs:rotation = ${( rotation * ( 180 / Math.PI ) ).toFixed(\n\t\t\t\tPRECISION\n\t\t\t)}`\n\t\t);\n\t\ttransform2dNode.addProperty(\n\t\t\t`float2 inputs:scale = ${buildVector2( repeat )}`\n\t\t);\n\t\ttransform2dNode.addProperty(\n\t\t\t`float2 inputs:translation = ${buildVector2( offset )}`\n\t\t);\n\t\ttransform2dNode.addProperty( 'float2 outputs:result' );\n\n\t\tconst textureNode = new USDNode(\n\t\t\t`Texture_${texture.id}_${mapType}`,\n\t\t\t'Shader'\n\t\t);\n\t\ttextureNode.addProperty( 'uniform token info:id = \"UsdUVTexture\"' );\n\t\ttextureNode.addProperty( `asset inputs:file = @textures/Texture_${id}.${getTextureExtension( texture )}@` );\n\t\ttextureNode.addProperty(\n\t\t\t`float2 inputs:st.connect = </Materials/Material_${material.id}/Transform2d_${mapType}.outputs:result>`\n\t\t);\n\n\t\tif ( color !== undefined ) {\n\n\t\t\tconst alpha = ( mapType === 'diffuse' ) ? material.opacity : 1;\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = ${buildColor4( color, alpha )}` );\n\n\t\t}\n\n\t\tif ( mapType === 'normal' ) {\n\n\t\t\t// Similar to GLTFExporter, only the x component is used so the y-negation that\n\t\t\t// GLTFLoader applies to tangent-less glTF assets is not baked into the export.\n\n\t\t\tconst scale = material.normalScale.x;\n\n\t\t\ttextureNode.addProperty( `float4 inputs:scale = (${ 2 * scale }, ${ 2 * scale }, 2, 1)` );\n\t\t\ttextureNode.addProperty( `float4 inputs:bias = (${ - scale }, ${ - scale }, -1, 0)` );\n\n\t\t}\n\n\t\ttextureNode.addProperty(\n\t\t\t`token inputs:sourceColorSpace = \"${\n\t\t\t\ttexture.colorSpace === NoColorSpace ? 'raw' : 'sRGB'\n\t\t\t}\"`\n\t\t);\n\t\ttextureNode.addProperty(\n\t\t\t`token inputs:wrapS = \"${WRAPPINGS[ texture.wrapS ]}\"`\n\t\t);\n\t\ttextureNode.addProperty(\n\t\t\t`token inputs:wrapT = \"${WRAPPINGS[ texture.wrapT ]}\"`\n\t\t);\n\t\ttextureNode.addProperty( 'float outputs:r' );\n\t\ttextureNode.addProperty( 'float outputs:g' );\n\t\ttextureNode.addProperty( 'float outputs:b' );\n\t\ttextureNode.addProperty( 'float3 outputs:rgb' );\n\n\t\tif ( material.transparent || material.alphaTest > 0.0 ) {\n\n\t\t\ttextureNode.addProperty( 'float outputs:a' );\n\n\t\t}\n\n\t\treturn [ primvarReaderNode, transform2dNode, textureNode ];\n\n\t}\n\n\tif ( material.side === DoubleSide ) {\n\n\t\tconsole.warn(\n\t\t\t'THREE.USDZExporter: USDZ does not support double sided materials',\n\t\t\tmaterial\n\t\t);\n\n\t}\n\n\tconst previewSurfaceNode = new USDNode( 'PreviewSurface', 'Shader' );\n\tpreviewSurfaceNode.addProperty( 'uniform token info:id = \"UsdPreviewSurface\"' );\n\n\tif ( material.map !== null ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`color3f inputs:diffuseColor.connect = </Materials/Material_${material.id}/Texture_${material.map.id}_diffuse.outputs:rgb>`\n\t\t);\n\n\t\tif ( material.transparent ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:opacity.connect = </Materials/Material_${material.id}/Texture_${material.map.id}_diffuse.outputs:a>`\n\t\t\t);\n\n\t\t} else if ( material.alphaTest > 0.0 ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:opacity.connect = </Materials/Material_${material.id}/Texture_${material.map.id}_diffuse.outputs:a>`\n\t\t\t);\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:opacityThreshold = ${material.alphaTest}`\n\t\t\t);\n\n\t\t}\n\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.map,\n\t\t\t'diffuse',\n\t\t\tmaterial.color\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`color3f inputs:diffuseColor = ${buildColor( material.color )}`\n\t\t);\n\n\t}\n\n\tif ( material.emissive ) {\n\n\t\tconst emissiveIntensity = material.emissiveIntensity ?? 1;\n\n\t\tif ( material.emissiveMap ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`color3f inputs:emissiveColor.connect = </Materials/Material_${material.id}/Texture_${material.emissiveMap.id}_emissive.outputs:rgb>`\n\t\t\t);\n\n\t\t\tconst emissiveColor = new Color(\n\t\t\t\tmaterial.emissive.r * emissiveIntensity,\n\t\t\t\tmaterial.emissive.g * emissiveIntensity,\n\t\t\t\tmaterial.emissive.b * emissiveIntensity\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.emissiveMap,\n\t\t\t\t'emissive',\n\t\t\t\temissiveColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else if ( material.emissive.getHex() > 0 ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`color3f inputs:emissiveColor = ${buildColor( material.emissive )}`\n\t\t\t);\n\n\t\t}\n\n\t}\n\n\tif ( material.normalMap ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`normal3f inputs:normal.connect = </Materials/Material_${material.id}/Texture_${material.normalMap.id}_normal.outputs:rgb>`\n\t\t);\n\n\t\tconst textureNodes = buildTextureNodes( material.normalMap, 'normal' );\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t}\n\n\tif ( material.aoMap ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:occlusion.connect = </Materials/Material_${material.id}/Texture_${material.aoMap.id}_occlusion.outputs:r>`\n\t\t);\n\n\t\tconst aoMapIntensity = material.aoMapIntensity ?? 1;\n\t\tconst aoColor = new Color(\n\t\t\taoMapIntensity,\n\t\t\taoMapIntensity,\n\t\t\taoMapIntensity\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.aoMap,\n\t\t\t'occlusion',\n\t\t\taoColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t}\n\n\tif ( material.roughnessMap ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:roughness.connect = </Materials/Material_${material.id}/Texture_${material.roughnessMap.id}_roughness.outputs:g>`\n\t\t);\n\n\t\tconst roughnessColor = new Color(\n\t\t\tmaterial.roughness,\n\t\t\tmaterial.roughness,\n\t\t\tmaterial.roughness\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.roughnessMap,\n\t\t\t'roughness',\n\t\t\troughnessColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:roughness = ${material.roughness ?? 1}`\n\t\t);\n\n\t}\n\n\tif ( material.metalnessMap ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:metallic.connect = </Materials/Material_${material.id}/Texture_${material.metalnessMap.id}_metallic.outputs:b>`\n\t\t);\n\n\t\tconst metalnessColor = new Color(\n\t\t\tmaterial.metalness,\n\t\t\tmaterial.metalness,\n\t\t\tmaterial.metalness\n\t\t);\n\t\tconst textureNodes = buildTextureNodes(\n\t\t\tmaterial.metalnessMap,\n\t\t\t'metallic',\n\t\t\tmetalnessColor\n\t\t);\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:metallic = ${material.metalness ?? 0}`\n\t\t);\n\n\t}\n\n\tif ( material.alphaMap ) {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:opacity.connect = </Materials/Material_${material.id}/Texture_${material.alphaMap.id}_opacity.outputs:r>`\n\t\t);\n\t\tpreviewSurfaceNode.addProperty( 'float inputs:opacityThreshold = 0.0001' );\n\n\t\tconst textureNodes = buildTextureNodes( material.alphaMap, 'opacity' );\n\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t} else {\n\n\t\tpreviewSurfaceNode.addProperty(\n\t\t\t`float inputs:opacity = ${material.opacity}`\n\t\t);\n\n\t}\n\n\tif ( material.isMeshPhysicalMaterial ) {\n\n\t\tif ( material.clearcoatMap !== null ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoat.connect = </Materials/Material_${material.id}/Texture_${material.clearcoatMap.id}_clearcoat.outputs:r>`\n\t\t\t);\n\n\t\t\tconst clearcoatColor = new Color(\n\t\t\t\tmaterial.clearcoat,\n\t\t\t\tmaterial.clearcoat,\n\t\t\t\tmaterial.clearcoat\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.clearcoatMap,\n\t\t\t\t'clearcoat',\n\t\t\t\tclearcoatColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoat = ${material.clearcoat}`\n\t\t\t);\n\n\t\t}\n\n\t\tif ( material.clearcoatRoughnessMap !== null ) {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoatRoughness.connect = </Materials/Material_${material.id}/Texture_${material.clearcoatRoughnessMap.id}_clearcoatRoughness.outputs:g>`\n\t\t\t);\n\n\t\t\tconst clearcoatRoughnessColor = new Color(\n\t\t\t\tmaterial.clearcoatRoughness,\n\t\t\t\tmaterial.clearcoatRoughness,\n\t\t\t\tmaterial.clearcoatRoughness\n\t\t\t);\n\t\t\tconst textureNodes = buildTextureNodes(\n\t\t\t\tmaterial.clearcoatRoughnessMap,\n\t\t\t\t'clearcoatRoughness',\n\t\t\t\tclearcoatRoughnessColor\n\t\t\t);\n\t\t\ttextureNodes.forEach( ( node ) => materialNode.addChild( node ) );\n\n\t\t} else {\n\n\t\t\tpreviewSurfaceNode.addProperty(\n\t\t\t\t`float inputs:clearcoatRoughness = ${material.clearcoatRoughness}`\n\t\t\t);\n\n\t\t}\n\n\t\tpreviewSurfaceNode.addProperty( `float inputs:ior = ${material.ior}` );\n\n\t}\n\n\tpreviewSurfaceNode.addProperty( 'int inputs:useSpecularWorkflow = 0' );\n\tpreviewSurfaceNode.addProperty( 'token outputs:surface' );\n\n\tmaterialNode.addChild( previewSurfaceNode );\n\n\tmaterialNode.addProperty(\n\t\t`token outputs:surface.connect = </Materials/Material_${material.id}/PreviewSurface.outputs:surface>`\n\t);\n\n\treturn materialNode;\n\n}\n\nfunction buildColor( color ) {\n\n\treturn `(${color.r}, ${color.g}, ${color.b})`;\n\n}\n\nfunction buildColor4( color, alpha = 1 ) {\n\n\treturn `(${color.r}, ${color.g}, ${color.b}, ${alpha})`;\n\n}\n\nfunction buildVector2( vector ) {\n\n\treturn `(${vector.x}, ${vector.y})`;\n\n}\n\nfunction buildCamera( camera, usedNames, options ) {\n\n\tconst name = getName( camera, usedNames );\n\n\tif ( camera.matrix.determinant() < 0 ) {\n\n\t\tconsole.warn(\n\t\t\t'THREE.USDZExporter: USDZ does not support negative scales',\n\t\t\tcamera\n\t\t);\n\n\t}\n\n\tconst node = new USDNode( name, 'Camera' );\n\taddTransformProperties( node, camera, options );\n\n\tconst projection = camera.isOrthographicCamera\n\t\t? 'orthographic'\n\t\t: 'perspective';\n\tnode.addProperty( `token projection = \"${projection}\"` );\n\n\tconst clippingRange = `(${camera.near.toPrecision(\n\t\tPRECISION\n\t)}, ${camera.far.toPrecision( PRECISION )})`;\n\tnode.addProperty( `float2 clippingRange = ${clippingRange}` );\n\n\tlet horizontalAperture;\n\tif ( camera.isOrthographicCamera ) {\n\n\t\thorizontalAperture = (\n\t\t\t( Math.abs( camera.left ) + Math.abs( camera.right ) ) *\n\t\t\t10\n\t\t).toPrecision( PRECISION );\n\n\t} else {\n\n\t\thorizontalAperture = camera.getFilmWidth().toPrecision( PRECISION );\n\n\t}\n\n\tnode.addProperty( `float horizontalAperture = ${horizontalAperture}` );\n\n\tlet verticalAperture;\n\tif ( camera.isOrthographicCamera ) {\n\n\t\tverticalAperture = (\n\t\t\t( Math.abs( camera.top ) + Math.abs( camera.bottom ) ) *\n\t\t\t10\n\t\t).toPrecision( PRECISION );\n\n\t} else {\n\n\t\tverticalAperture = camera.getFilmHeight().toPrecision( PRECISION );\n\n\t}\n\n\tnode.addProperty( `float verticalAperture = ${verticalAperture}` );\n\n\tif ( camera.isPerspectiveCamera ) {\n\n\t\tconst focalLength = camera.getFocalLength().toPrecision( PRECISION );\n\t\tnode.addProperty( `float focalLength = ${focalLength}` );\n\n\t\tconst focusDistance = camera.focus.toPrecision( PRECISION );\n\t\tnode.addProperty( `float focusDistance = ${focusDistance}` );\n\n\t}\n\n\treturn node;\n\n}\n\n/**\n * Export options of `USDZExporter`.\n *\n * @typedef {Object} USDZExporter~Options\n * @property {number} [maxTextureSize=1024] - The maximum texture size that is going to be exported.\n * @property {boolean} [includeAnchoringProperties=true] - Whether to include anchoring properties or not.\n * @property {boolean} [onlyVisible=true] - Export only visible 3D objects.\n * @property {Object} [ar] - If `includeAnchoringProperties` is set to `true`, the anchoring type and alignment\n * can be configured via `ar.anchoring.type` and `ar.planeAnchoring.alignment`.\n * @property {boolean} [quickLookCompatible=false] - Whether to make the exported USDZ compatible to QuickLook\n * which means the asset is modified to accommodate the bugs FB10036297 and FB11442287 (Apple Feedback).\n * @property {Array<AnimationClip>} [animations=[]] - Animation clips to bake into `xformOp` time samples on the\n * targeted objects. Only `position`, `quaternion`, and `scale` tracks are exported.\n * @property {number} [animationFrameRate=60] - Time codes per second used when writing animation samples.\n **/\n\n/**\n * onDone callback of `USDZExporter`.\n *\n * @callback USDZExporter~OnDone\n * @param {ArrayBuffer} result - The generated USDZ.\n */\n\n/**\n * onError callback of `USDZExporter`.\n *\n * @callback USDZExporter~OnError\n * @param {Error} error - The error object.\n */\n\nexport { USDZExporter };\n"],"x_google_ignoreList":[0],"mappings":";;;AAYA,IAAM,IAAN,MAAc;CAEb,YAAa,GAAM,IAAO,IAAI,IAAW,EAAE,EAAE,IAAa,EAAE,EAAG;AAM9D,EAJA,KAAK,OAAO,GACZ,KAAK,OAAO,GACZ,KAAK,WAAW,GAChB,KAAK,aAAa,GAClB,KAAK,WAAW,EAAE;;CAInB,YAAa,GAAK,GAAQ;AAEzB,OAAK,SAAS,KAAM;GAAE;GAAK;GAAO,CAAE;;CAIrC,YAAa,GAAU,IAAW,EAAE,EAAG;AAEtC,OAAK,WAAW,KAAM;GAAE;GAAU;GAAU,CAAE;;CAI/C,SAAU,GAAQ;AAEjB,OAAK,SAAS,KAAM,EAAO;;CAI5B,SAAU,IAAS,GAAI;EAEtB,IAAM,IAAM,IAAK,OAAQ,EAAQ,EAE3B,IAAoB,KAAK,SAAS,KAAO,MAAU;GA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A,AASC,IATI,EAAO,yBAGR,KAAK,IAAK,EAAO,KAAM,GAAG,KAAK,IAAK,EAAO,MAAO,IACpD,IACC,YAAa,EAAW,GAIL,EAAO,cAAc,CAAC,YAAa,EAAW,EAIpE,EAAK,YAAa,8BAA8B,IAAsB;CAEtE,IAAI;AAgBJ,KAfA,AASC,IATI,EAAO,yBAGR,KAAK,IAAK,EAAO,IAAK,GAAG,KAAK,IAAK,EAAO,OAAQ,IACpD,IACC,YAAa,EAAW,GAIP,EAAO,eAAe,CAAC,YAAa,EAAW,EAInE,EAAK,YAAa,4BAA4B,IAAoB,EAE7D,EAAO,qBAAsB;EAEjC,IAAM,IAAc,EAAO,gBAAgB,CAAC,YAAa,EAAW;AACpE,IAAK,YAAa,uBAAuB,IAAe;EAExD,IAAM,IAAgB,EAAO,MAAM,YAAa,EAAW;AAC3D,IAAK,YAAa,yBAAyB,IAAiB;;AAI7D,QAAO"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Vector4-C7TlIAyy.mjs","names":[],"sources":["../../../../node_modules/three/src/math/Vector4.js"],"sourcesContent":["import { clamp } from './MathUtils.js';\n\n/**\n * Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers\n * (labeled x, y, z and w), which can be used to represent a number of things, such as:\n *\n * - A point in 4D space.\n * - A direction and length in 4D space. In three.js the length will\n * always be the Euclidean distance(straight-line distance) from `(0, 0, 0, 0)` to `(x, y, z, w)`\n * and the direction is also measured from `(0, 0, 0, 0)` towards `(x, y, z, w)`.\n * - Any arbitrary ordered quadruplet of numbers.\n *\n * There are other things a 4D vector can be used to represent, however these\n * are the most common uses in *three.js*.\n *\n * Iterating through a vector instance will yield its components `(x, y, z, w)` in\n * the corresponding order.\n * ```js\n * const a = new THREE.Vector4( 0, 1, 0, 0 );\n *\n * //no arguments; will be initialised to (0, 0, 0, 1)\n * const b = new THREE.Vector4( );\n *\n * const d = a.dot( b );\n * ```\n */\nclass Vector4 {\n\n\tstatic {\n\n\t\t/**\n\t\t * This flag can be used for type testing.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @readonly\n\t\t * @default true\n\t\t */\n\t\tVector4.prototype.isVector4 = true;\n\n\t}\n\n\t/**\n\t * Constructs a new 4D vector.\n\t *\n\t * @param {number} [x=0] - The x value of this vector.\n\t * @param {number} [y=0] - The y value of this vector.\n\t * @param {number} [z=0] - The z value of this vector.\n\t * @param {number} [w=1] - The w value of this vector.\n\t */\n\tconstructor( x = 0, y = 0, z = 0, w = 1 ) {\n\n\t\t/**\n\t\t * The x value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.x = x;\n\n\t\t/**\n\t\t * The y value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.y = y;\n\n\t\t/**\n\t\t * The z value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.z = z;\n\n\t\t/**\n\t\t * The w value of this vector.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.w = w;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#z}.\n\t *\n\t * @type {number}\n\t */\n\tget width() {\n\n\t\treturn this.z;\n\n\t}\n\n\tset width( value ) {\n\n\t\tthis.z = value;\n\n\t}\n\n\t/**\n\t * Alias for {@link Vector4#w}.\n\t *\n\t * @type {number}\n\t */\n\tget height() {\n\n\t\treturn this.w;\n\n\t}\n\n\tset height( value ) {\n\n\t\tthis.w = value;\n\n\t}\n\n\t/**\n\t * Sets the vector components.\n\t *\n\t * @param {number} x - The value of the x component.\n\t * @param {number} y - The value of the y component.\n\t * @param {number} z - The value of the z component.\n\t * @param {number} w - The value of the w component.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tset( x, y, z, w ) {\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.z = z;\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the same value.\n\t *\n\t * @param {number} scalar - The value to set for all vector components.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetScalar( scalar ) {\n\n\t\tthis.x = scalar;\n\t\tthis.y = scalar;\n\t\tthis.z = scalar;\n\t\tthis.w = scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's x component to the given value\n\t *\n\t * @param {number} x - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetX( x ) {\n\n\t\tthis.x = x;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's y component to the given value\n\t *\n\t * @param {number} y - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetY( y ) {\n\n\t\tthis.y = y;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's z component to the given value\n\t *\n\t * @param {number} z - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetZ( z ) {\n\n\t\tthis.z = z;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector's w component to the given value\n\t *\n\t * @param {number} w - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetW( w ) {\n\n\t\tthis.w = w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Allows to set a vector component with an index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @param {number} value - The value to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetComponent( index, value ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: this.x = value; break;\n\t\t\tcase 1: this.y = value; break;\n\t\t\tcase 2: this.z = value; break;\n\t\t\tcase 3: this.w = value; break;\n\t\t\tdefault: throw new Error( 'THREE.Vector4: index is out of range: ' + index );\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns the value of the vector component which matches the given index.\n\t *\n\t * @param {number} index - The component index. `0` equals to x, `1` equals to y,\n\t * `2` equals to z, `3` equals to w.\n\t * @return {number} A vector component value.\n\t */\n\tgetComponent( index ) {\n\n\t\tswitch ( index ) {\n\n\t\t\tcase 0: return this.x;\n\t\t\tcase 1: return this.y;\n\t\t\tcase 2: return this.z;\n\t\t\tcase 3: return this.w;\n\t\t\tdefault: throw new Error( 'THREE.Vector4: index is out of range: ' + index );\n\n\t\t}\n\n\t}\n\n\t/**\n\t * Returns a new vector with copied values from this instance.\n\t *\n\t * @return {Vector4} A clone of this instance.\n\t */\n\tclone() {\n\n\t\treturn new this.constructor( this.x, this.y, this.z, this.w );\n\n\t}\n\n\t/**\n\t * Copies the values of the given vector to this instance.\n\t *\n\t * @param {Vector3|Vector4} v - The vector to copy.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tcopy( v ) {\n\n\t\tthis.x = v.x;\n\t\tthis.y = v.y;\n\t\tthis.z = v.z;\n\t\tthis.w = ( v.w !== undefined ) ? v.w : 1;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector to this instance.\n\t *\n\t * @param {Vector4} v - The vector to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tadd( v ) {\n\n\t\tthis.x += v.x;\n\t\tthis.y += v.y;\n\t\tthis.z += v.z;\n\t\tthis.w += v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given scalar value to all components of this instance.\n\t *\n\t * @param {number} s - The scalar to add.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScalar( s ) {\n\n\t\tthis.x += s;\n\t\tthis.y += s;\n\t\tthis.z += s;\n\t\tthis.w += s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddVectors( a, b ) {\n\n\t\tthis.x = a.x + b.x;\n\t\tthis.y = a.y + b.y;\n\t\tthis.z = a.z + b.z;\n\t\tthis.w = a.w + b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Adds the given vector scaled by the given factor to this instance.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @param {number} s - The factor that scales `v`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\taddScaledVector( v, s ) {\n\n\t\tthis.x += v.x * s;\n\t\tthis.y += v.y * s;\n\t\tthis.z += v.z * s;\n\t\tthis.w += v.w * s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vector from this instance.\n\t *\n\t * @param {Vector4} v - The vector to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsub( v ) {\n\n\t\tthis.x -= v.x;\n\t\tthis.y -= v.y;\n\t\tthis.z -= v.z;\n\t\tthis.w -= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given scalar value from all components of this instance.\n\t *\n\t * @param {number} s - The scalar to subtract.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubScalar( s ) {\n\n\t\tthis.x -= s;\n\t\tthis.y -= s;\n\t\tthis.z -= s;\n\t\tthis.w -= s;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Subtracts the given vectors and stores the result in this instance.\n\t *\n\t * @param {Vector4} a - The first vector.\n\t * @param {Vector4} b - The second vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsubVectors( a, b ) {\n\n\t\tthis.x = a.x - b.x;\n\t\tthis.y = a.y - b.y;\n\t\tthis.z = a.z - b.z;\n\t\tthis.w = a.w - b.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiply( v ) {\n\n\t\tthis.x *= v.x;\n\t\tthis.y *= v.y;\n\t\tthis.z *= v.z;\n\t\tthis.w *= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies the given scalar value with all components of this instance.\n\t *\n\t * @param {number} scalar - The scalar to multiply.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmultiplyScalar( scalar ) {\n\n\t\tthis.x *= scalar;\n\t\tthis.y *= scalar;\n\t\tthis.z *= scalar;\n\t\tthis.w *= scalar;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Multiplies this vector with the given 4x4 matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tapplyMatrix4( m ) {\n\n\t\tconst x = this.x, y = this.y, z = this.z, w = this.w;\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 0 ] * x + e[ 4 ] * y + e[ 8 ] * z + e[ 12 ] * w;\n\t\tthis.y = e[ 1 ] * x + e[ 5 ] * y + e[ 9 ] * z + e[ 13 ] * w;\n\t\tthis.z = e[ 2 ] * x + e[ 6 ] * y + e[ 10 ] * z + e[ 14 ] * w;\n\t\tthis.w = e[ 3 ] * x + e[ 7 ] * y + e[ 11 ] * z + e[ 15 ] * w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this instance by the given vector.\n\t *\n\t * @param {Vector4} v - The vector to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivide( v ) {\n\n\t\tthis.x /= v.x;\n\t\tthis.y /= v.y;\n\t\tthis.z /= v.z;\n\t\tthis.w /= v.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Divides this vector by the given scalar.\n\t *\n\t * @param {number} scalar - The scalar to divide.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tdivideScalar( scalar ) {\n\n\t\treturn this.multiplyScalar( 1 / scalar );\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the quaternion's axis and w to the angle.\n\t *\n\t * @param {Quaternion} q - The Quaternion to set.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromQuaternion( q ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToAngle/index.htm\n\n\t\t// q is assumed to be normalized\n\n\t\tthis.w = 2 * Math.acos( q.w );\n\n\t\tconst s = Math.sqrt( 1 - q.w * q.w );\n\n\t\tif ( s < 0.0001 ) {\n\n\t\t\tthis.x = 1;\n\t\t\tthis.y = 0;\n\t\t\tthis.z = 0;\n\n\t\t} else {\n\n\t\t\tthis.x = q.x / s;\n\t\t\tthis.y = q.y / s;\n\t\t\tthis.z = q.z / s;\n\n\t\t}\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the x, y and z components of this\n\t * vector to the axis of rotation and w to the angle.\n\t *\n\t * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetAxisAngleFromRotationMatrix( m ) {\n\n\t\t// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm\n\n\t\t// assumes the upper 3x3 of m is a pure rotation matrix (i.e, unscaled)\n\n\t\tlet angle, x, y, z; // variables for result\n\t\tconst epsilon = 0.01,\t\t// margin to allow for rounding errors\n\t\t\tepsilon2 = 0.1,\t\t// margin to distinguish between 0 and 180 degrees\n\n\t\t\tte = m.elements,\n\n\t\t\tm11 = te[ 0 ], m12 = te[ 4 ], m13 = te[ 8 ],\n\t\t\tm21 = te[ 1 ], m22 = te[ 5 ], m23 = te[ 9 ],\n\t\t\tm31 = te[ 2 ], m32 = te[ 6 ], m33 = te[ 10 ];\n\n\t\tif ( ( Math.abs( m12 - m21 ) < epsilon ) &&\n\t\t ( Math.abs( m13 - m31 ) < epsilon ) &&\n\t\t ( Math.abs( m23 - m32 ) < epsilon ) ) {\n\n\t\t\t// singularity found\n\t\t\t// first check for identity matrix which must have +1 for all terms\n\t\t\t// in leading diagonal and zero in other terms\n\n\t\t\tif ( ( Math.abs( m12 + m21 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m13 + m31 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m23 + m32 ) < epsilon2 ) &&\n\t\t\t ( Math.abs( m11 + m22 + m33 - 3 ) < epsilon2 ) ) {\n\n\t\t\t\t// this singularity is identity matrix so angle = 0\n\n\t\t\t\tthis.set( 1, 0, 0, 0 );\n\n\t\t\t\treturn this; // zero angle, arbitrary axis\n\n\t\t\t}\n\n\t\t\t// otherwise this singularity is angle = 180\n\n\t\t\tangle = Math.PI;\n\n\t\t\tconst xx = ( m11 + 1 ) / 2;\n\t\t\tconst yy = ( m22 + 1 ) / 2;\n\t\t\tconst zz = ( m33 + 1 ) / 2;\n\t\t\tconst xy = ( m12 + m21 ) / 4;\n\t\t\tconst xz = ( m13 + m31 ) / 4;\n\t\t\tconst yz = ( m23 + m32 ) / 4;\n\n\t\t\tif ( ( xx > yy ) && ( xx > zz ) ) {\n\n\t\t\t\t// m11 is the largest diagonal term\n\n\t\t\t\tif ( xx < epsilon ) {\n\n\t\t\t\t\tx = 0;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tx = Math.sqrt( xx );\n\t\t\t\t\ty = xy / x;\n\t\t\t\t\tz = xz / x;\n\n\t\t\t\t}\n\n\t\t\t} else if ( yy > zz ) {\n\n\t\t\t\t// m22 is the largest diagonal term\n\n\t\t\t\tif ( yy < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0;\n\t\t\t\t\tz = 0.707106781;\n\n\t\t\t\t} else {\n\n\t\t\t\t\ty = Math.sqrt( yy );\n\t\t\t\t\tx = xy / y;\n\t\t\t\t\tz = yz / y;\n\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\t// m33 is the largest diagonal term so base result on this\n\n\t\t\t\tif ( zz < epsilon ) {\n\n\t\t\t\t\tx = 0.707106781;\n\t\t\t\t\ty = 0.707106781;\n\t\t\t\t\tz = 0;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tz = Math.sqrt( zz );\n\t\t\t\t\tx = xz / z;\n\t\t\t\t\ty = yz / z;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tthis.set( x, y, z, angle );\n\n\t\t\treturn this; // return 180 deg rotation\n\n\t\t}\n\n\t\t// as we have reached here there are no singularities so we can handle normally\n\n\t\tlet s = Math.sqrt( ( m32 - m23 ) * ( m32 - m23 ) +\n\t\t\t( m13 - m31 ) * ( m13 - m31 ) +\n\t\t\t( m21 - m12 ) * ( m21 - m12 ) ); // used to normalize\n\n\t\tif ( Math.abs( s ) < 0.001 ) s = 1;\n\n\t\t// prevent divide by zero, should not happen if matrix is orthogonal and should be\n\t\t// caught by singularity test above, but I've left it in just in case\n\n\t\tthis.x = ( m32 - m23 ) / s;\n\t\tthis.y = ( m13 - m31 ) / s;\n\t\tthis.z = ( m21 - m12 ) / s;\n\t\tthis.w = Math.acos( ( m11 + m22 + m33 - 1 ) / 2 );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets the vector components to the position elements of the\n\t * given transformation matrix.\n\t *\n\t * @param {Matrix4} m - The 4x4 matrix.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetFromMatrixPosition( m ) {\n\n\t\tconst e = m.elements;\n\n\t\tthis.x = e[ 12 ];\n\t\tthis.y = e[ 13 ];\n\t\tthis.z = e[ 14 ];\n\t\tthis.w = e[ 15 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding min value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmin( v ) {\n\n\t\tthis.x = Math.min( this.x, v.x );\n\t\tthis.y = Math.min( this.y, v.y );\n\t\tthis.z = Math.min( this.z, v.z );\n\t\tthis.w = Math.min( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is less than the given vector's x, y, z or w\n\t * value, replace that value with the corresponding max value.\n\t *\n\t * @param {Vector4} v - The vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tmax( v ) {\n\n\t\tthis.x = Math.max( this.x, v.x );\n\t\tthis.y = Math.max( this.y, v.y );\n\t\tthis.z = Math.max( this.z, v.z );\n\t\tthis.w = Math.max( this.w, v.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w\n\t * value, it is replaced by the corresponding value.\n\t * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value,\n\t * it is replaced by the corresponding value.\n\t *\n\t * @param {Vector4} min - The minimum x, y and z values.\n\t * @param {Vector4} max - The maximum x, y and z values in the desired range.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclamp( min, max ) {\n\n\t\t// assumes min < max, componentwise\n\n\t\tthis.x = clamp( this.x, min.x, max.x );\n\t\tthis.y = clamp( this.y, min.y, max.y );\n\t\tthis.z = clamp( this.z, min.z, max.z );\n\t\tthis.w = clamp( this.w, min.w, max.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's x, y, z or w values are greater than the max value, they are\n\t * replaced by the max value.\n\t * If this vector's x, y, z or w values are less than the min value, they are\n\t * replaced by the min value.\n\t *\n\t * @param {number} minVal - The minimum value the components will be clamped to.\n\t * @param {number} maxVal - The maximum value the components will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampScalar( minVal, maxVal ) {\n\n\t\tthis.x = clamp( this.x, minVal, maxVal );\n\t\tthis.y = clamp( this.y, minVal, maxVal );\n\t\tthis.z = clamp( this.z, minVal, maxVal );\n\t\tthis.w = clamp( this.w, minVal, maxVal );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * If this vector's length is greater than the max value, it is replaced by\n\t * the max value.\n\t * If this vector's length is less than the min value, it is replaced by the\n\t * min value.\n\t *\n\t * @param {number} min - The minimum value the vector length will be clamped to.\n\t * @param {number} max - The maximum value the vector length will be clamped to.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tclampLength( min, max ) {\n\n\t\tconst length = this.length();\n\n\t\treturn this.divideScalar( length || 1 ).multiplyScalar( clamp( length, min, max ) );\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded down to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfloor() {\n\n\t\tthis.x = Math.floor( this.x );\n\t\tthis.y = Math.floor( this.y );\n\t\tthis.z = Math.floor( this.z );\n\t\tthis.w = Math.floor( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded up to the nearest integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tceil() {\n\n\t\tthis.x = Math.ceil( this.x );\n\t\tthis.y = Math.ceil( this.y );\n\t\tthis.z = Math.ceil( this.z );\n\t\tthis.w = Math.ceil( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded to the nearest integer value\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tround() {\n\n\t\tthis.x = Math.round( this.x );\n\t\tthis.y = Math.round( this.y );\n\t\tthis.z = Math.round( this.z );\n\t\tthis.w = Math.round( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * The components of this vector are rounded towards zero (up if negative,\n\t * down if positive) to an integer value.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\troundToZero() {\n\n\t\tthis.x = Math.trunc( this.x );\n\t\tthis.y = Math.trunc( this.y );\n\t\tthis.z = Math.trunc( this.z );\n\t\tthis.w = Math.trunc( this.w );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnegate() {\n\n\t\tthis.x = - this.x;\n\t\tthis.y = - this.y;\n\t\tthis.z = - this.z;\n\t\tthis.w = - this.w;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Calculates the dot product of the given vector with this instance.\n\t *\n\t * @param {Vector4} v - The vector to compute the dot product with.\n\t * @return {number} The result of the dot product.\n\t */\n\tdot( v ) {\n\n\t\treturn this.x * v.x + this.y * v.y + this.z * v.z + this.w * v.w;\n\n\t}\n\n\t/**\n\t * Computes the square of the Euclidean length (straight-line length) from\n\t * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should\n\t * compare the length squared instead as it is slightly more efficient to calculate.\n\t *\n\t * @return {number} The square length of this vector.\n\t */\n\tlengthSq() {\n\n\t\treturn this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w;\n\n\t}\n\n\t/**\n\t * Computes the Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w).\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tlength() {\n\n\t\treturn Math.sqrt( this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w );\n\n\t}\n\n\t/**\n\t * Computes the Manhattan length of this vector.\n\t *\n\t * @return {number} The length of this vector.\n\t */\n\tmanhattanLength() {\n\n\t\treturn Math.abs( this.x ) + Math.abs( this.y ) + Math.abs( this.z ) + Math.abs( this.w );\n\n\t}\n\n\t/**\n\t * Converts this vector to a unit vector - that is, sets it equal to a vector\n\t * with the same direction as this one, but with a vector length of `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tnormalize() {\n\n\t\treturn this.divideScalar( this.length() || 1 );\n\n\t}\n\n\t/**\n\t * Sets this vector to a vector with the same direction as this one, but\n\t * with the specified length.\n\t *\n\t * @param {number} length - The new length of this vector.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tsetLength( length ) {\n\n\t\treturn this.normalize().multiplyScalar( length );\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vector and this instance, where\n\t * alpha is the percent distance along the line - alpha = 0 will be this\n\t * vector, and alpha = 1 will be the given one.\n\t *\n\t * @param {Vector4} v - The vector to interpolate towards.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerp( v, alpha ) {\n\n\t\tthis.x += ( v.x - this.x ) * alpha;\n\t\tthis.y += ( v.y - this.y ) * alpha;\n\t\tthis.z += ( v.z - this.z ) * alpha;\n\t\tthis.w += ( v.w - this.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Linearly interpolates between the given vectors, where alpha is the percent\n\t * distance along the line - alpha = 0 will be first vector, and alpha = 1 will\n\t * be the second one. The result is stored in this instance.\n\t *\n\t * @param {Vector4} v1 - The first vector.\n\t * @param {Vector4} v2 - The second vector.\n\t * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tlerpVectors( v1, v2, alpha ) {\n\n\t\tthis.x = v1.x + ( v2.x - v1.x ) * alpha;\n\t\tthis.y = v1.y + ( v2.y - v1.y ) * alpha;\n\t\tthis.z = v1.z + ( v2.z - v1.z ) * alpha;\n\t\tthis.w = v1.w + ( v2.w - v1.w ) * alpha;\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Returns `true` if this vector is equal with the given one.\n\t *\n\t * @param {Vector4} v - The vector to test for equality.\n\t * @return {boolean} Whether this vector is equal with the given one.\n\t */\n\tequals( v ) {\n\n\t\treturn ( ( v.x === this.x ) && ( v.y === this.y ) && ( v.z === this.z ) && ( v.w === this.w ) );\n\n\t}\n\n\t/**\n\t * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`,\n\t * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`.\n\t *\n\t * @param {Array<number>} array - An array holding the vector component values.\n\t * @param {number} [offset=0] - The offset into the array.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromArray( array, offset = 0 ) {\n\n\t\tthis.x = array[ offset ];\n\t\tthis.y = array[ offset + 1 ];\n\t\tthis.z = array[ offset + 2 ];\n\t\tthis.w = array[ offset + 3 ];\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Writes the components of this vector to the given array. If no array is provided,\n\t * the method returns a new instance.\n\t *\n\t * @param {Array<number>} [array=[]] - The target array holding the vector components.\n\t * @param {number} [offset=0] - Index of the first element in the array.\n\t * @return {Array<number>} The vector components.\n\t */\n\ttoArray( array = [], offset = 0 ) {\n\n\t\tarray[ offset ] = this.x;\n\t\tarray[ offset + 1 ] = this.y;\n\t\tarray[ offset + 2 ] = this.z;\n\t\tarray[ offset + 3 ] = this.w;\n\n\t\treturn array;\n\n\t}\n\n\t/**\n\t * Sets the components of this vector from the given buffer attribute.\n\t *\n\t * @param {BufferAttribute} attribute - The buffer attribute holding vector data.\n\t * @param {number} index - The index into the attribute.\n\t * @return {Vector4} A reference to this vector.\n\t */\n\tfromBufferAttribute( attribute, index ) {\n\n\t\tthis.x = attribute.getX( index );\n\t\tthis.y = attribute.getY( index );\n\t\tthis.z = attribute.getZ( index );\n\t\tthis.w = attribute.getW( index );\n\n\t\treturn this;\n\n\t}\n\n\t/**\n\t * Sets each component of this vector to a pseudo-random value between `0` and\n\t * `1`, excluding `1`.\n\t *\n\t * @return {Vector4} A reference to this vector.\n\t */\n\trandom() {\n\n\t\tthis.x = Math.random();\n\t\tthis.y = Math.random();\n\t\tthis.z = Math.random();\n\t\tthis.w = Math.random();\n\n\t\treturn this;\n\n\t}\n\n\t*[ Symbol.iterator ]() {\n\n\t\tyield this.x;\n\t\tyield this.y;\n\t\tyield this.z;\n\t\tyield this.w;\n\n\t}\n\n}\n\nexport { Vector4 };\n"],"x_google_ignoreList":[0],"mappings":";;AA0BA,IAAM,IAAN,MAAM,EAAQ;CAEb;AASC,IAAQ,UAAU,YAAY;;CAY/B,YAAa,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAI;AA4BzC,EArBA,KAAK,IAAI,GAOT,KAAK,IAAI,GAOT,KAAK,IAAI,GAOT,KAAK,IAAI;;CASV,IAAI,QAAQ;AAEX,SAAO,KAAK;;CAIb,IAAI,MAAO,GAAQ;AAElB,OAAK,IAAI;;CASV,IAAI,SAAS;AAEZ,SAAO,KAAK;;CAIb,IAAI,OAAQ,GAAQ;AAEn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AAqB,GAAW,GAAQ;AAOvC,SALA,KAAK,IAAI,EAAU,KAAM,EAAO,EAChC,KAAK,IAAI,EAAU,KAAM,EAAO,EAChC,KAAK,IAAI,EAAU,KAAM,EAAO,EAChC,KAAK,IAAI,EAAU,KAAM,EAAO,EAEzB;;CAUR,SAAS;AAOR,SALA,KAAK,IAAI,KAAK,QAAQ,EACtB,KAAK,IAAI,KAAK,QAAQ,EACtB,KAAK,IAAI,KAAK,QAAQ,EACtB,KAAK,IAAI,KAAK,QAAQ,EAEf;;CAIR,EAAG,OAAO,YAAa;AAKtB,EAHA,MAAM,KAAK,GACX,MAAM,KAAK,GACX,MAAM,KAAK,GACX,MAAM,KAAK"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"common-utils-DbL4tku0.mjs","names":[],"sources":["../../packages/typings/rapi-types.ts","../../packages/common-core/src/utils/common-utils.ts"],"sourcesContent":["import type { Enumify } from '#/common/src/utils/types';\nimport type { InitDataDefinition } from '../common-core/src/utils/shims';\nimport type { UiPossibleChild } from './kernel';\n\nexport type RapiId = string;\nexport type AssetUrl = string;\nexport type ConfigurationString = string;\nexport type ConfigurationHash = string;\nexport type Base64String = string;\nexport type RapiServerUrlType = 'live' | 'test';\nexport type HexColorString = string; // #ffffff\nexport type HexColorNumber = number; // 0xffffff\nexport type PriceId = string;\nexport type ArticleNumber = string;\n\nexport interface LinksCollection {\n [key: string]: string;\n}\n\nexport interface RoomleSortable {\n sort?: number;\n}\n\nexport interface RapiJsonBox {\n meta?: RapiMeta;\n\n [key: string]: RapiMeta | RapiJson | RapiJson[] | undefined;\n}\n\nexport interface RapiMeta {\n serverTime: string;\n total: number;\n\n [key: string]: string | number;\n}\n\nexport interface RapiJson {\n id?: RapiId | number | null;\n isLocally?: boolean;\n __rapi_path__?: string;\n\n links?: LinksCollection;\n [key: string]: any;\n}\n\nexport interface RapiPackage extends RapiJson {\n components: RapiComponent[];\n materials: RapiMaterial[];\n textures: RapiTexture[];\n}\n\nexport interface RapiBaseColor {\n r: number;\n g: number;\n b: number;\n\n [key: string]: number;\n}\n\nexport interface RapiMesh extends RapiJson {\n catalog: RapiId;\n id: RapiId;\n}\n\nexport interface RapiMeshData {\n format: string;\n quality: number;\n url: string;\n created: string;\n changed: string;\n meshId: RapiId;\n\n [key: string]: number | string | RapiId;\n}\n\nexport interface RapiMaterialShading {\n version?: string;\n alpha: number;\n metallic: number;\n specularity?: number;\n basecolor: RapiBaseColor;\n roughness: number;\n doubleSided: boolean;\n alphaCutoff?: number;\n occlusion?: number;\n transmission?: number;\n reflectivity?: number;\n transmissionIOR?: number;\n emissiveColor?: RapiBaseColor;\n emissiveIntensity?: number;\n clearcoatIntensity?: number;\n clearcoatRoughness?: number;\n clearcoatNormalScale?: number;\n sheenColor?: RapiBaseColor;\n sheenIntensity?: number;\n sheenRoughness?: number;\n specularColor?: RapiBaseColor;\n thicknessFactor?: number;\n attenuationColor?: RapiBaseColor;\n attenuationDistance?: number;\n embeddedTextures?: RapiTexture[];\n\n [key: string]:\n | number\n | boolean\n | string\n | RapiBaseColor\n | RapiTexture[]\n | undefined;\n}\n\nexport interface RapiMaterial extends RapiJson {\n id: RapiId;\n name: string;\n externalIdentifier: string;\n group: string;\n groupLabel: string;\n color: string;\n thumbnail: AssetUrl;\n label: string;\n textures: number[];\n shading: RapiMaterialShading;\n tags: RapiId[];\n active: boolean;\n additionalInfos?: AdditionalInfo[];\n properties?: Record<string, string>;\n sort?: number;\n\n [key: string]:\n | string\n | RapiMaterialShading\n | AssetUrl\n | RapiId\n | number[]\n | AdditionalInfo[]\n | boolean\n | number\n | LinksCollection\n | RapiId[]\n | Record<string, string>\n | undefined;\n}\n\nexport interface RapiMaterialGroup extends RapiJson {\n id: RapiId | null;\n label?: string | null;\n materials: RapiMaterial[];\n legacyId?: RapiId;\n sort?: number;\n\n [key: string]:\n | string\n | RapiMaterial[]\n | RapiId\n | boolean\n | LinksCollection\n | number\n | null\n | undefined;\n}\n\nexport const enum RAPI_TEXTURE_TYPE {\n RGB = 'RGB', // diffuse color texture\n RGBA = 'RGBA', // Diffuse color texture and opacity map\n XYZ = 'XYZ', // normal vectors encoded in the 3 color channels\n ORM = 'ORM', // ambient Occlusion, roughness and metalness stored in the red, green and blue channels of the texture (in this order)\n EMRGB = 'EMRGB', // emissive color texture\n CCRG = 'CCRG', // clear coat intensity and clear coat roughness stored in the red and green channels of the texture (in this order)\n CCXYZ = 'CCXYZ', // separate normal vectors for the clear coat effect\n SHRGBA = 'SHRGBA', // sheen effect color texture and sheen roughness, the color is stored in the RGB channels and the roughness is stored in the alpha channel\n SPRGBA = 'SPRGBA', // specular color texture and specular intensity, the color is stored in the RGB channels and the intensity is stored in the alpha channel\n TTRG = 'TTRG', // transmission degree and thickness stored in the red and green channels of the texture (in this order)\n}\n\nexport interface RapiTexture extends RapiJson {\n mapping: RAPI_TEXTURE_TYPE;\n url: AssetUrl;\n image: AssetUrl;\n height: number;\n width: number;\n mmHeight: number;\n mmWidth: number;\n tileable: boolean;\n material: RapiId;\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | LinksCollection\n | null\n | undefined;\n}\n\nexport interface RapiCatalog extends RapiJson {\n id: RapiId;\n name: string;\n featuredImage: string;\n externalIdentifier: string;\n cover: string;\n brandIcon: string;\n description: string;\n free: boolean;\n public: boolean;\n featured: boolean;\n sort: number;\n created: string;\n updated: string;\n hidden: boolean;\n hiddenByUser: boolean;\n hiddenByTenant: boolean;\n tenantIsOwner: boolean;\n orderable: boolean;\n active: boolean;\n purchased: boolean;\n branded: boolean;\n\n tenant: RapiTenant;\n items: RapiItem[];\n allItems: RapiItem[];\n components: RapiComponent[];\n materials: RapiMaterial[];\n tags: RapiId[];\n allTags: RapiTag[];\n rootTags: RapiTag[];\n retailers: RapiRetailer[];\n\n [key: string]:\n | string\n | number\n | boolean\n | RapiRetailer[]\n | RapiTag[]\n | RapiMaterial[]\n | RapiComponent[]\n | RapiItem[]\n | RapiId[]\n | RapiTenant\n | LinksCollection\n | undefined;\n}\n\nexport interface RapiTenant extends RapiJson {\n name: string;\n label: string;\n defaultLanguage: string;\n active: boolean;\n showLanguageSwitch: boolean;\n branded: boolean;\n authenticationRequired: boolean;\n configuration: string;\n privacyUrl: string;\n\n catalogs: RapiCatalog[];\n users: RapiUser[];\n roles: RapiRole[];\n skin: RapiSkin[];\n plans: RapiPlan[];\n}\n\nexport interface RapiUser extends RapiJson {\n username: string;\n salutationCode: number;\n firstname: string;\n lastname: string;\n email: string;\n street: string;\n zipcode: string;\n city: string;\n countryCode: string;\n birthdate: string;\n phone: string;\n locale: string;\n registerDate: string;\n password: string;\n lastLogin: string;\n active: boolean;\n newsletter: boolean;\n emailValidated: string;\n termsChanged: boolean;\n providedConsentInTenant: boolean;\n priceLists: any;\n\n // Relationships\n tenants: RapiTenant[];\n roles: RapiRole[];\n catalogs: RapiCatalog[];\n plans: RapiPlan[];\n favorites: RapiFavorite[];\n setting: RapiUserSetting;\n}\n\nexport const enum RapiFavoriteType {\n ITEM = 1,\n CONFIG = 2,\n AFFILIATE = 3,\n}\n\nexport interface RapiFavorite extends RapiJson {\n objectId: string;\n type: RapiFavoriteType;\n created: string;\n user: RapiUser;\n}\n\nexport interface RapiUserSetting extends RapiJson {\n metric: boolean;\n measurements: boolean;\n area: boolean;\n furnitureSnap: boolean;\n\n user: RapiUser;\n}\n\nexport interface RapiRole extends RapiJson {\n // Data\n role: number;\n\n allowedModules: any;\n\n // Relationships\n tenantId: RapiTenant;\n userId: RapiUser;\n}\n\nexport interface RapiSkin extends RapiJson {\n accentColor: string;\n appIcon: string;\n backgroundImage: string;\n btnColorDark: string;\n btnColorLight: string;\n ciColor: string;\n dashboardBackground: string;\n loginBackground: string;\n dashboardLogo: string;\n fontColor: string;\n headerBackgroundColor: string;\n headerForegroundColor: string;\n logo: string;\n mailBackgroundColor: string;\n mailHeaderImage: string;\n planBackground: string;\n planLogo: string;\n splashScreenImage: string;\n tenantUrl: string;\n watermarkImage: string;\n brandedCatalogsIcon: string;\n planNote: string;\n inquiryImage: string;\n inquiryLink: string;\n hideMadeByRoomle: boolean;\n hidePressLink: boolean;\n hideShareButton: boolean;\n translationPath: string;\n hideFeedbackButton: boolean;\n referralUrl: string;\n hideCatalogOverview: boolean;\n // Relationships\n tenant: RapiTenant;\n catalogEntryTags: RapiTag;\n}\n\nexport interface RapiPlan extends RapiJson {\n name: string;\n description: string;\n changeDate: string;\n created: string;\n draftId: number | null; // THIS IS NOT USED BY THE BACKEND! USE DRAFT INSTEAD!!!!\n thumbnail: string;\n planObjects: string | null;\n active: boolean;\n right?: number;\n draft?: number;\n open: number;\n planDirectory: number;\n changed: number;\n version: number;\n floorLevel: number;\n //assets: array;\n visibility: number;\n\n // Relationships\n user: RapiUser | RapiId | null;\n tenant: RapiTenant | RapiId | null;\n assets: RapiPlanAsset[];\n parent: RapiPlan | RapiId | null;\n setting: RapiPlanSetting | null;\n}\n\nexport interface RapiPlanAsset extends RapiJson {\n image: string;\n}\n\nexport interface RapiPlanSetting extends RapiJson {\n metric: boolean;\n measurements: boolean;\n area: boolean;\n furnitureSnap: boolean;\n\n plan: RapiPlan;\n}\n\nexport type RapiPlanSnapshotId = `ps_${string}`;\nexport interface RapiPlanSnapshotPostData extends RapiJson {\n parentId: RapiId | null;\n planObjects: Array<{\n combinedId: RapiId;\n position: string;\n }>;\n plan: string;\n}\n\nexport interface RapiPlanSnapshotGetData extends RapiPlanSnapshotPostData {\n combinedIds: RapiId[];\n embedId: RapiId;\n perspectiveImage: string;\n topImage: string;\n}\n\n/* eslint-disable */\nexport interface RapiRetailer extends RapiJson {\n // NO ATTRS --> ask KUEGI how table looks\n}\n\n/* eslint:enable */\n\nexport interface RapiConfiguration extends RapiJson {\n id: RapiId;\n created: string;\n lastAccess: string;\n configuration: ConfigurationString;\n configurationHash: string;\n parts: string;\n perspectiveImage?: AssetUrl | null;\n topImage?: AssetUrl | null;\n rootComponentId: RapiId;\n orderable?: boolean;\n requestable?: boolean;\n width: number;\n height: number;\n depth: number;\n catalog?: RapiId;\n assets?: AssetItem;\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | LinksCollection\n | AssetItem\n | null\n | undefined;\n}\n\nexport interface RapiConfigurationEnhanced extends RapiConfiguration {\n label: string;\n}\n\nexport interface Element {\n id: string;\n label: string;\n perspectiveImage: AssetUrl;\n}\n\nexport interface RapiElement extends RapiJson, RoomleSortable, Element {\n id: RapiId;\n configuration?: ConfigurationString;\n externalIdentifier: string;\n tags: RapiId[];\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | RapiId[]\n | LinksCollection\n | AdditionalInfo[]\n | UiPossibleChild[]\n | AssetItem\n | undefined;\n}\nexport const CATALOG_INFOS_TYPES = {\n PARAMETER: 'parameter',\n PARAMETER_VALUE: 'paramValue',\n MATERIAL: 'material',\n COMPONENT: 'component',\n ITEM: 'item',\n} as const;\nexport interface AdditionalInfo {\n type: Enumify<typeof CATALOG_INFOS_TYPES>;\n key: string;\n parentIdFilter: string;\n catalog: string;\n tooltip: {\n [key: string]: string;\n };\n fullInfo: {\n type: string;\n url: {\n [key: string]: string;\n };\n };\n}\nexport interface RapiComponent extends RapiElement {\n active: boolean;\n additionalInfos: AdditionalInfo[];\n}\n\nexport interface Asset {\n format: string;\n url: string;\n}\n\nexport interface AssetItem {\n [key: string]: Asset;\n}\n\nexport interface RapiItem extends RapiElement {\n width: number;\n height: number;\n depth: number;\n basecolor: number;\n displayedWidth: number;\n displayedHeight: number;\n displayedDepth: number;\n perspectiveImageHD: AssetUrl;\n topImage: AssetUrl;\n threeDimensionalAssetWeb: AssetUrl;\n threeDimensionalAssetIOS: AssetUrl;\n threeDimensionalAsset: AssetUrl;\n flipable: boolean;\n scaleable: boolean;\n meta: string;\n hidden: boolean;\n link?: string;\n colorable: boolean;\n layer: number;\n language: string;\n type: string;\n detailType: string;\n currencySymbol?: string;\n customerPrice?: number;\n sort: number;\n orderable: boolean;\n requestable: boolean;\n catalog: RapiId;\n assets?: AssetItem;\n rootComponentId?: string;\n}\n\nexport const enum RAPI_ADDITIONAL_CONTENTS {\n UNKNOWN,\n LINK,\n TEXT,\n VIDEO,\n DOWNLOAD,\n IMAGE,\n SKETCH,\n}\n\nexport interface RapiAdditionalContent extends RapiJson {\n changed: string;\n content: string;\n created: string;\n itemId: RapiId;\n label: string;\n language: string;\n type: RAPI_ADDITIONAL_CONTENTS;\n}\n\nexport interface RapiTagGeneric extends RapiJson {\n label?: string;\n externalIdentifier: string;\n pngIcon?: AssetUrl;\n svgIcon?: AssetUrl;\n inspirationImage?: AssetUrl;\n global: boolean;\n sort?: number;\n created: string;\n updated: string;\n language: string;\n description?: string;\n\n // Relationships\n catalog: RapiId;\n tags: RapiId[];\n parents: RapiId[];\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | RapiId[]\n | RapiElement[]\n | RapiMaterial[]\n | LinksCollection\n | null\n | undefined;\n}\n\nexport interface RapiTag extends RapiTagGeneric {\n id: RapiId;\n items: RapiId[];\n materials: RapiId[];\n}\n\nexport interface RapiTagForUi extends RapiTagGeneric {\n materials: RapiMaterial[];\n items: RapiItem[];\n}\n\nexport interface RapiShortId {\n shortId: string;\n referencedId: string;\n url: string;\n type: number;\n created: string;\n lastAccess: string;\n\n [key: string]: string | number;\n}\n\nexport interface RapiPrice {\n priceId: PriceId;\n price: number;\n currencySymbol: string;\n}\n\nexport interface RapiConfiguratorSettings {\n id: string;\n tenant: number;\n allowedHosts: string;\n settings: InitDataDefinition;\n}\n\nexport interface UserAction {\n module: number;\n action: number;\n planId: RapiId;\n actionId: RapiId;\n actionValue: number;\n actionLabel: number;\n}\n\nexport const enum MAIL_TYPE {\n STANDARD = 1,\n AUGMENTED_REALITY = 2,\n SAVE_DRAFT = 3,\n PLANNER_SHARE = 13,\n}\n\nexport interface RapiAuth {\n token: string;\n lastActionDate: string;\n loginDate: string;\n userId: RapiId;\n}\n","import '../../../typings/global-definitions';\nimport type {\n RapiId,\n RapiItem,\n RapiJson,\n RapiMaterial,\n RapiTexture,\n} from '../../../typings/rapi-types';\nimport { RAPI_TEXTURE_TYPE } from '../../../typings/rapi-types';\nimport type {\n KernelFloorMaterial,\n KernelWallMaterial,\n} from '../../../typings/planner';\nimport type { BatchPaintMaterial } from '../../../planner-core/src/roomle-planner';\nimport { Color } from 'three';\nimport type { CameraParameter } from '../cameracontrol/camera-control';\n\nexport const enum CURSOR_STYLE {\n HOVER = 'pointer',\n DEFAULT = 'default',\n MOVE = 'move',\n DRAGGING = 'grabbing',\n ROTATE = 'ew-resize',\n NODE_HOVER = 'crosshair',\n LOADING = 'wait',\n // eslint-disable-next-line @typescript-eslint/quotes\n DRAW = \"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 3 20, auto\",\n // eslint-disable-next-line @typescript-eslint/quotes\n DRAW_FALLBACK = \"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 0 15, auto\",\n}\n\n/**\n * Colors can be set as hex value, eg 0x00ff00 or as official HTML color name: https://www.w3schools.com/colors/colors_names.asp\n */\nexport const ROOMLE_COLORS = {\n PRIMARY: 0xdb0000,\n ON_PRIMARY: 0xffffff,\n DEFAULT_BACKGROUND: 0xf7f7f7,\n SELECTION: 0xffffff,\n PREVIEW_DOCKING_COLOR: 0xfdddddd,\n SNAP_DOCKING: 0x80ff80,\n SNAP_COLLISION: 0xff8080,\n} as const;\n\nexport const ROOMLE_HIGHLIGHTNG = {\n SMART: 'smart',\n OFF: 'off',\n ALWAYS: 'always',\n};\n\nexport const setCursor = (style: CURSOR_STYLE) => {\n // refactor into dom helper to be save in SDK\n document.body.style.cursor = style;\n};\n\nexport const handleJsonResponse = (response: Response): Promise<any> => {\n const contentType = response.headers.get('content-type');\n if (contentType && contentType.includes('application/json')) {\n return response.json();\n }\n throw new TypeError('No JSON returned');\n};\n\nexport const uuid = (a: string | null = null): string => {\n return a\n ? (\n parseInt(a, 10) ^\n ((Math.random() * 16) >> (parseInt(a, 10) / 4))\n ).toString(16)\n : ((1e7).toString() + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid);\n};\n\nexport const setEnumerable = (\n target: any,\n property: string,\n isEnumerable: boolean,\n) => {\n setDescriptor(target, property, { enumerable: isEnumerable });\n};\n\nexport const setWriteable = (\n target: any,\n property: string,\n isWritable: boolean,\n) => {\n setDescriptor(target, property, { writable: isWritable });\n};\n\nexport const setDescriptor = (\n target: any,\n property: string,\n options: PropertyDescriptor,\n) => {\n const descriptor = Object.getOwnPropertyDescriptor(target, property);\n if (!descriptor) {\n throw new Error(`Property \"${property}\" not found on target`);\n }\n for (const prop in options) {\n if (options.hasOwnProperty(prop)) {\n (descriptor as any)[prop] = (options as any)[prop]; // as any because there are no signature types defined in std.lib\n }\n }\n Object.defineProperty(target, property, descriptor);\n};\n\nexport const setPropertiesFromOptions = (\n target: any,\n options: any,\n writeable?: true,\n) => {\n if (!options) {\n return;\n }\n Object.keys(options).forEach((key) => {\n Object.defineProperty(target, key, {\n value: options[key],\n writable: writeable,\n });\n });\n};\n\nexport const createBenchmarkMaterial = (materialId: string): RapiMaterial => {\n const color = new Color(0.5, 0.5, 0.5);\n const hexColor = color.getHexString();\n const material: RapiMaterial = {\n id: materialId,\n name: materialId,\n externalIdentifier: 'test-identifier',\n group: 'test-group',\n groupLabel: 'test-group-label',\n color: '#' + hexColor,\n thumbnail: createBenchmarkUrl(materialId, 15),\n label: 'test-label',\n textures: [1, 2, 3],\n shading: {\n alpha: 1,\n metallic: 0.5,\n basecolor: {\n r: 0.5,\n g: 0.5,\n b: 0.5,\n },\n roughness: 0.5,\n doubleSided: false,\n alphaCutoff: 0.5,\n },\n active: true,\n tags: [],\n };\n\n return material;\n};\n\nexport const createBenchmarkTexture = (materialId: string): RapiTexture => {\n const parts = materialId.split('_');\n const size = parseInt(parts[1], 10);\n const texture = {\n mapping: RAPI_TEXTURE_TYPE.RGB,\n id: materialId,\n material: materialId,\n image: createBenchmarkUrl(materialId),\n url: createBenchmarkUrl(materialId),\n height: size,\n width: size,\n mmHeight: 1,\n mmWidth: 1,\n tileable: true,\n };\n\n return texture;\n};\n\nexport const createBenchmarkUrl = (\n materialId: string,\n size?: number,\n): string => {\n const parts = materialId.split('_');\n if (!size) {\n size = parseInt(parts[1], 10);\n }\n const uniqueId = Math.abs(parseFloat(parts[2]));\n const dummyUrl =\n 'https://loremflickr.com/' + size + '/' + size + '?lock=' + uniqueId;\n return dummyUrl;\n};\n\nexport const isString = (value: unknown): boolean => {\n return typeof value === 'string' || value instanceof String;\n};\n\nexport const objectArrayToMap = <K extends V[keyof V], V extends object>(\n arr: V[],\n key: keyof V,\n): Map<K, V> => {\n return arr.reduce((acc, data) => {\n if (typeof data !== 'object') {\n console.warn('objectArrayToMap only works for arrays of objects');\n return acc;\n }\n const mapKey = data[key];\n if (!mapKey) {\n console.warn(\n 'Object has no key \"' +\n key.toString() +\n '\" therefore we do not know where to put it',\n );\n return acc;\n }\n if (!acc.has(mapKey)) {\n acc.set(mapKey, data);\n }\n return acc;\n }, new Map());\n};\n\nexport const throttle = <T extends (...args: any[]) => any>(\n func: T,\n delay: number = 16,\n): ((...funcArgs: Parameters<T>) => void) => {\n let time: number;\n let called = false;\n let skippedCalls = 0;\n let trailingCall: NodeJS.Timeout | null = null;\n return function (this: T, ..._args: Parameters<T>): void {\n if (!time) {\n time = Date.now();\n }\n if (!called || time + delay - Date.now() < 0) {\n func.apply(this, [...arguments]);\n time = Date.now();\n called = true;\n } else {\n skippedCalls++;\n }\n if (!trailingCall) {\n trailingCall = setInterval(() => {\n if (skippedCalls) {\n func.apply(this, [...arguments]);\n }\n skippedCalls = 0;\n if (trailingCall !== null) {\n clearInterval(trailingCall);\n }\n trailingCall = null;\n }, delay);\n }\n };\n};\n\n/**\n * Calls the function only if there has been no call for x (param after) milliseconds\n * @param func\n * @param after\n */\nexport const callAgainAfter = <T extends (...args: any[]) => any>(\n func: T,\n after: number = 16,\n): ((...funcArgs: Parameters<T>) => void) => {\n let lastCall: number;\n let called = false;\n return function (this: T, ..._args: Parameters<T>): void {\n if (!called || lastCall + after - Date.now() < 0) {\n lastCall = Date.now();\n func.apply(this, [...arguments]);\n called = true;\n } else {\n lastCall = Date.now();\n }\n };\n};\n\nexport const debounce = <Params extends any[]>(\n func: (...args: Params) => any,\n timeout: number,\n): ((...args: Params) => void) => {\n let timer: NodeJS.Timeout;\n return (...args: Params) => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n func(...args);\n }, timeout);\n };\n};\n\n/**\n * A generic type for a function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFunction = (...args: any[]) => any;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `delay`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked with the same key. The debounced function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them.\n *\n * T The type of the function to debounce.\n * @param {T} func The function to debounce.\n * @param {number} delay The number of milliseconds to delay.\n * @param {(...args: Parameters<T>) => unknown} [keyResolver]\n * Optional. A function to resolve the key from the arguments.\n * Defaults to using the first argument as the key.\n * @returns {((...args: Parameters<T>) => void)} The new debounced function.\n */\nexport const debounceByKey = <T extends AnyFunction>(\n func: T,\n delay: number,\n keyResolver?: (...args: Parameters<T>) => unknown,\n) => {\n // 1. Use a Map to store timers, keyed by your object or resolved key.\n // The key can be of any type, and the value is the timer ID from setTimeout.\n const timers = new Map<unknown, ReturnType<typeof setTimeout>>();\n\n // 2. The default resolver just uses the first argument as the key.\n const resolver = keyResolver || ((...args: Parameters<T>) => args[0]);\n\n // 3. Return the new debounced function.\n // It accepts the same parameters as the original function.\n return function (this: ThisParameterType<T>, ...args: Parameters<T>): void {\n // 4. Capture the 'this' context from the call.\n const context = this;\n\n // 5. Get the unique key for this specific call (e.g., the object itself).\n const key = resolver.apply(context, args);\n\n // 6. Check for an existing timer *for this specific key*.\n const existingTimer = timers.get(key);\n\n // 7. If a timer already exists for this key, clear it.\n if (existingTimer) {\n clearTimeout(existingTimer);\n }\n\n // 8. Set a new timer.\n const newTimer = setTimeout(() => {\n // 9. When the timer finally fires, call the original function\n // with the saved context and arguments from the *last* call.\n func.apply(context, args);\n\n // 10. Clean up the map to prevent memory leaks for this key.\n timers.delete(key);\n }, delay);\n\n // 11. Store the new timer ID, associated with its key.\n timers.set(key, newTimer);\n };\n};\n\n/**\n * Interface for storing a single promise's resolve and reject handlers.\n */\ninterface PromiseHandlers<T extends AnyFunction> {\n resolve: (value: ReturnType<T> | PromiseLike<ReturnType<T>>) => void;\n reject: (reason?: any) => void;\n}\n\n/**\n * Interface for storing timer details along with promise handlers for a given key.\n */\ninterface TimerDetails<T extends AnyFunction> {\n timer: ReturnType<typeof setTimeout>;\n handlers: Array<PromiseHandlers<T>>;\n context: ThisParameterType<T>;\n args: Parameters<T>;\n}\n\n/**\n * A key-debounced async function that additionally exposes `flush()` to run all\n * currently pending invocations immediately and resolve once they settle.\n */\nexport type DebouncedByKeyAsync<T extends AnyFunction> = ((\n ...args: Parameters<T>\n) => Promise<Awaited<ReturnType<T>>>) & {\n /**\n * Fire every pending (still-debouncing) invocation right now instead of waiting\n * for its timer, and resolve once all of them have settled.\n */\n flush: () => Promise<void>;\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `delay`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked with the same key. All calls made with the same key during the\n * delay period will have their returned promises resolved with the result\n * of the single final invocation.\n *\n * T The type of the function to debounce.\n * @param {T} func The function to debounce. This function can be synchronous or asynchronous.\n * @param {number} delay The number of milliseconds to delay.\n * @param {(...args: Parameters<T>) => unknown} [keyResolver]\n * Optional. A function to resolve the key from the arguments.\n * Defaults to using the first argument as the key.\n * @returns {((...args: Parameters<T>) => Promise<ReturnType<T>>)} The new debounced function.\n */\nexport const debounceByKeyAsync = <T extends AnyFunction>(\n func: T,\n delay: number,\n keyResolver?: (...args: Parameters<T>) => unknown,\n): DebouncedByKeyAsync<T> => {\n // 1. Use a Map to store timers and promise handlers, keyed by the resolved key.\n const timers = new Map<unknown, TimerDetails<T>>();\n\n // 2. The default resolver uses the first argument as the key.\n const resolver = keyResolver || ((...args: Parameters<T>) => args[0]);\n\n // Invoke `func` for a single pending key now, resolve/reject its handlers, and\n // remove it from the map. Shared by the timer callback and `flush()`.\n const fire = (key: unknown, details: TimerDetails<T>): Promise<void> => {\n clearTimeout(details.timer);\n timers.delete(key);\n return Promise.resolve(func.apply(details.context, details.args))\n .then((result) => {\n details.handlers.forEach((handler) => handler.resolve(result));\n })\n .catch((error) => {\n details.handlers.forEach((handler) => handler.reject(error));\n });\n };\n\n // 3. Return the new promise-based debounced function.\n const debounced = function (\n this: ThisParameterType<T>,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const context = this;\n const key = resolver.apply(context, args);\n\n return new Promise((resolve, reject) => {\n // 4. Check for existing timer details for this specific key.\n const existingTimerDetails = timers.get(key);\n\n // 5. If a timer already exists, clear it.\n if (existingTimerDetails) {\n clearTimeout(existingTimerDetails.timer);\n }\n\n // 6. Get the list of promise handlers, or create a new one.\n const handlers = existingTimerDetails?.handlers || [];\n handlers.push({ resolve, reject }); // Add the current promise's handlers.\n\n // 7. Store the timer plus the latest context/args so the invocation can be\n // fired either by the timer or eagerly by flush().\n const details: TimerDetails<T> = {\n timer: undefined as unknown as ReturnType<typeof setTimeout>,\n handlers,\n context,\n args,\n };\n details.timer = setTimeout(() => {\n void fire(key, details);\n }, delay);\n timers.set(key, details);\n });\n };\n\n // Run every pending invocation immediately (skipping the remaining debounce\n // delay) and resolve once all of them have settled.\n debounced.flush = (): Promise<void> => {\n const pending = Array.from(timers.entries()).map(([key, details]) =>\n fire(key, details),\n );\n return Promise.allSettled(pending).then(() => undefined);\n };\n\n return debounced;\n};\n\nexport const wait = async (delay: number): Promise<void> =>\n new Promise((resolve) => setTimeout(resolve, delay));\n\nexport const nextTick = async (): Promise<void> => wait(0);\n\nexport const withTimeout = <T>(\n promise: Promise<T>,\n message: string,\n timeout: number,\n): Promise<T> => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const expired = new Promise<never>((_resolve, reject) => {\n timer = setTimeout(\n () => reject(new Error(`${message} (timed out after ${timeout}ms)`)),\n timeout,\n );\n });\n return Promise.race([promise, expired]).finally(() => clearTimeout(timer));\n};\n\nexport const roundWithPrecision = (float: number, precision: number) => {\n if (precision === -1) {\n return float;\n }\n const factor = Math.pow(10, precision);\n return Math.round(float * factor) / factor;\n};\n\nconst LEGACY_ASSET_URL_REG_EX = new RegExp(/\\/3d\\/[0-9]+\\//);\n\nexport const getGlbUrl = (item: RapiItem): string | null => {\n // use glb asset without ktx textures as default\n // glb2 used ktx textures\n if (item.assets?.glb?.url) {\n return item.assets.glb.url;\n }\n if (item.threeDimensionalAsset) {\n return item.threeDimensionalAsset;\n }\n const assetUrl = item.threeDimensionalAssetWeb;\n if (!assetUrl || typeof assetUrl !== 'string') {\n // Maybe we should introduce Nullable so we can turn on\n // strict null checks for SDK? But that's probably\n // a separate user story\n return null;\n }\n return !assetUrl.match(LEGACY_ASSET_URL_REG_EX)\n ? assetUrl\n : assetUrl\n .replace(LEGACY_ASSET_URL_REG_EX, '/3d/glb/')\n .replace('.flash.u3d', '.glb');\n};\n\n/**\n * Recursively merge properties of two objects.\n * If a property exists in both, property of obj2 is used\n * @param obj1\n * @param obj2\n */\nexport const deepMerge = (obj1: any, obj2: any): any => {\n for (const p in obj2) {\n try {\n // Property in destination object set; update its value.\n if (obj2[p].constructor === Object) {\n obj1[p] = deepMerge(obj1[p], obj2[p]);\n } else {\n obj1[p] = obj2[p];\n }\n } catch (_e) {\n // Property in destination object not set; create it and set its value.\n obj1[p] = obj2[p];\n }\n }\n return obj1;\n};\n\nexport const getValue = (value: any, defaultValue: any): any => {\n if (value === undefined) {\n return defaultValue;\n }\n return value;\n};\n\nexport const removeItem = (arr: any[], element: any) => {\n const index = arr.indexOf(element);\n if (index > -1) {\n arr.splice(index, 1);\n }\n};\n\nexport type ValuesFromObject<T> = T[keyof T];\n\nexport type MaybePromise<T> = (() => T) | (() => Promise<T>);\n\nexport const copy = <T>(object: T): T => {\n if (!object) {\n return object;\n }\n return JSON.parse(JSON.stringify(object));\n};\n\nexport const isWebGl2 = (): boolean => {\n const canvas = document.createElement('canvas');\n if (\n !canvas ||\n !canvas.getContext ||\n typeof canvas.getContext !== 'function'\n ) {\n return false;\n }\n try {\n return canvas ? !!canvas.getContext('webgl2') : false;\n } catch (_e) {\n return false;\n }\n};\n\n/**\n * Creates a proxy around that class that logs all calls to it\n * @param obj the class to trace\n * @param name the tag under which it will be logged\n */\nexport const traceMethodCalls = (obj: object, name: string) => {\n const handler = {\n get(target: any, propKey: any, receiver: any) {\n const targetValue = Reflect.get(target, propKey, receiver);\n if (typeof targetValue === 'function') {\n return function (...args: any) {\n console.trace(name, propKey, args);\n // @ts-ignore -- helper for better debugging, TS does not know what we are doing\n return targetValue.apply(this, args); // (A)\n };\n } else {\n return targetValue;\n }\n },\n };\n return new Proxy(obj, handler);\n};\n\n/**\n * Creates a proxy around that class that can be used to track property access\n * @param obj the class to track\n * @param name the tag under which it will be logged\n */\nexport const trackPropertyAccess = (obj: object, _name: string) => {\n const handler = {\n get(target: any, propKey: any, _receiver: any) {\n return target[propKey];\n },\n set(target: any, propKey: any, value: any, _receiver: any) {\n target[propKey] = value;\n return true;\n },\n };\n return new Proxy(obj, handler);\n};\n\nexport const getColor = (value: string | number | Color): Color => {\n if (isThreeJsColor(value)) {\n return value;\n }\n if (typeof value === 'string' && (isHex(value) || isOnlyNumbers(value))) {\n return new Color(Number(value));\n } else {\n return new Color(value);\n }\n};\n\nexport const isThreeJsColor = (value: any): value is Color => {\n return value instanceof Color;\n};\n\nexport const isHex = (num: string) => {\n return Boolean(num.match(/^0x[0-9a-f]+$/i));\n};\n\nexport const isOnlyNumbers = (num: string) => {\n return Boolean(num.match(/^[0-9]+$/i));\n};\n\nexport const parseColorToHexDecimal = (color: string) =>\n !color ? -1 : Number('0x' + color.substring(1));\n\n/**\n * Copies the properties of an incoming material to a kernel material, used mainly\n * to avoid copying core data when applying a material to a planObject\n * @param materialPtr Kernel material pointer to apply properties to\n * @param material material to copy color properties from\n */\nexport const applyMaterialToKernelMaterial = (\n materialPtr: KernelWallMaterial | KernelFloorMaterial,\n material: BatchPaintMaterial,\n): KernelWallMaterial | KernelFloorMaterial => {\n if (material.materialId) {\n materialPtr.materialId = material.materialId;\n } else if (material.color) {\n // Material is a hex string, so we convert it to a rgb value.\n materialPtr.rgbValue = parseColorToHexDecimal(material.color);\n } else if (material.rgbValue) {\n materialPtr.rgbValue = material.rgbValue;\n } else if (material.catalogItemId !== undefined) {\n materialPtr.catalogItemId = material.catalogItemId;\n } else if (material.id) {\n materialPtr.materialId = material.id;\n } else {\n console.warn(\n 'Can not set material because neither a texture nor a RGB value was found',\n );\n }\n return materialPtr;\n};\n\nexport const download = (filename: string, content: string): void => {\n const element = document.createElement('a');\n element.setAttribute('href', content);\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n};\n\nexport const areCameraParametersEqual = (\n start: CameraParameter,\n end: CameraParameter,\n): boolean => {\n if (!start || !end) {\n return false;\n }\n if (\n start.targetX === undefined ||\n end.targetX === undefined ||\n Math.abs(start.targetX - end.targetX) > 0.01\n ) {\n return false;\n }\n if (\n start.targetY === undefined ||\n end.targetY === undefined ||\n Math.abs(start.targetY - end.targetY) > 0.01\n ) {\n return false;\n }\n if (\n start.targetZ === undefined ||\n end.targetZ === undefined ||\n Math.abs(start.targetZ - end.targetZ) > 0.01\n ) {\n return false;\n }\n if (\n start.yaw === undefined ||\n end.yaw === undefined ||\n Math.abs(start.yaw - end.yaw) > 0.01\n ) {\n return false;\n }\n if (\n start.distance === undefined ||\n end.distance === undefined ||\n Math.abs(start.distance - end.distance) > 0.01\n ) {\n return false;\n }\n return true;\n};\n\n/**\n * transforms a value from one range (oldMin, oldMax) to a new range (newMin, newMax)\n * @param value the value to transform\n * @param oldMin\n * @param oldMax\n * @param newMin\n * @param newMax\n * @returns the transformed value\n */\nexport const transformRange = (\n value: number,\n oldMin: number,\n oldMax: number,\n newMin: number,\n newMax: number,\n): number => {\n return ((value - oldMin) * (newMax - newMin)) / (oldMax - oldMin) + newMin;\n};\n\nexport const hashCode = (value: string): number => {\n let hash = 0;\n if (value.length === 0) {\n return hash;\n }\n for (let i = 0; i < value.length; i++) {\n const chr = value.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n};\n\nexport const rearrangeArrayByIdOrder = <T extends RapiJson>(\n idsInOrder: RapiId[],\n rapiJson: T[],\n idKey: string = 'id',\n): T[] => {\n const indexMap = new Map<RapiId, number>();\n const length = idsInOrder.length;\n for (let i = 0; i < length; i++) {\n indexMap.set(idsInOrder[i], i);\n }\n\n const sortedResult = new Array<T>(length);\n\n // Place each element from the result array at its corresponding index in sortedResult\n const rapiJsonLength = rapiJson.length;\n for (let j = 0; j < rapiJsonLength; j++) {\n const entry = rapiJson[j];\n const id = entry[idKey];\n const index = indexMap.get(id as RapiId);\n if (index !== undefined) {\n sortedResult[index] = entry;\n } else {\n sortedResult.push(entry);\n }\n }\n\n return sortedResult.filter((element) => element !== undefined);\n};\n\nexport interface PromiseWithResolvers<T> {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (reason?: any) => void;\n}\n\nexport const promiseWithResolvers = <T>(): PromiseWithResolvers<T> => {\n let resolve!: (value: T) => void;\n let reject!: (reason?: any) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n};\n\nexport const clamp = (value: number, min: number, max: number): number => {\n return Math.max(min, Math.min(max, value));\n};\n\nexport const randomString = (length: number = 8): string => {\n return [...Array(length)]\n .map(() => Math.random().toString(36).charAt(2))\n .join('');\n};\n\nexport const deepCopy = <T>(obj: T): T => {\n return JSON.parse(JSON.stringify(obj));\n};\n\nexport const isRecord = (value: any): value is Record<string, any> => {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n};\n\nexport const getIdQueryParam = (urlString: string): string | null => {\n try {\n const url = new URL(urlString);\n const params = new URLSearchParams(url.search);\n return params.get('id');\n } catch (_error) {\n return null; // Return null if URL is invalid or 'id' param is not found\n }\n};\n\nexport const isCtrlOrCmd = (event: KeyboardEvent) =>\n event.key === 'Meta' || event.key === 'Control';\n\nexport const ctrlOrCmd = (\n event: KeyboardEvent,\n checkIfItIsTheOnlyKey: boolean = false,\n) => {\n const isMultiSelectKey =\n checkIfItIsTheOnlyKey === false\n ? checkIfItIsTheOnlyKey\n : isCtrlOrCmd(event);\n return event.key && (event.metaKey || event.ctrlKey || isMultiSelectKey);\n};\n\nexport const runIfNotEmpty = <T extends any[]>(\n ids: string[],\n executor: () => Promise<T>,\n): Promise<T> => {\n if (!ids || ids.length === 0) {\n return Promise.resolve([] as unknown as T);\n }\n return executor();\n};\n"],"mappings":";;AAiKA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,MAAA,OACA,EAAA,OAAA,QACA,EAAA,MAAA,OACA,EAAA,MAAA,OACA,EAAA,QAAA,SACA,EAAA,OAAA,QACA,EAAA,QAAA,SACA,EAAA,SAAA,UACA,EAAA,SAAA,UACA,EAAA,OAAA;KACD,EAgYiB,IAAX,yBAAA,GAAA;QACL,EAAA,EAAA,UAAA,KAAA,WACA,EAAA,EAAA,OAAA,KAAA,QACA,EAAA,EAAA,OAAA,KAAA,QACA,EAAA,EAAA,QAAA,KAAA,SACA,EAAA,EAAA,WAAA,KAAA,YACA,EAAA,EAAA,QAAA,KAAA,SACA,EAAA,EAAA,SAAA,KAAA;KACD,ECniBiB,IAAX,yBAAA,GAAA;QACL,EAAA,QAAA,WACA,EAAA,UAAA,WACA,EAAA,OAAA,QACA,EAAA,WAAA,YACA,EAAA,SAAA,aACA,EAAA,aAAA,aACA,EAAA,UAAA,QAEA,EAAA,OAAA,kGAEA,EAAA,gBAAA;KACD,EAKY,IAAg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