@roomle/web-sdk 4.3.0-alpha.4 → 5.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/lib/ConfiguratorKernel.wasm +0 -0
  2. package/lib/{GaussianBlurNode-Bjszve7N.mjs → GaussianBlurNode-BMH03PYf.mjs} +11 -11
  3. package/lib/{GaussianBlurNode-Bjszve7N.mjs.map → GaussianBlurNode-BMH03PYf.mjs.map} +1 -1
  4. package/lib/RoomleCore.wasm +0 -0
  5. package/lib/RoomleToolsCore.wasm +0 -0
  6. package/lib/{api-C-enDIJZ.mjs → api-hQ0uOklW.mjs} +2 -2
  7. package/lib/{api-C-enDIJZ.mjs.map → api-hQ0uOklW.mjs.map} +1 -1
  8. package/lib/asset-loader.worker-eqHzNAwa.mjs.map +1 -1
  9. package/lib/budgeteer.sw-BUMElkO1.mjs.map +1 -1
  10. package/lib/configurator-BM0nny5l.mjs +2 -0
  11. package/lib/{configurator-D8Bfu2_w.mjs → configurator-CVg8_f9w.mjs} +3 -3
  12. package/lib/{configurator-D8Bfu2_w.mjs.map → configurator-CVg8_f9w.mjs.map} +1 -1
  13. package/lib/{glb-viewer-DMg1tKfk.mjs → glb-viewer-Csx9GwVi.mjs} +3 -3
  14. package/lib/{glb-viewer-DMg1tKfk.mjs.map → glb-viewer-Csx9GwVi.mjs.map} +1 -1
  15. package/lib/glb-viewer-gEdln_PJ.mjs +2 -0
  16. package/lib/{highlight-coordinator-JwAVkMeS.mjs → highlight-coordinator-C-PxNb40.mjs} +12 -12
  17. package/lib/highlight-coordinator-C-PxNb40.mjs.map +1 -0
  18. package/lib/{homag-intelligence-CbzWp4pY.mjs → homag-intelligence-Dh4VWYH6.mjs} +3 -3
  19. package/lib/{homag-intelligence-CbzWp4pY.mjs.map → homag-intelligence-Dh4VWYH6.mjs.map} +1 -1
  20. package/lib/{material-viewer-C4oV4F7e.mjs → material-viewer-DqUJzRXN.mjs} +3 -3
  21. package/lib/{material-viewer-C4oV4F7e.mjs.map → material-viewer-DqUJzRXN.mjs.map} +1 -1
  22. package/lib/{packages-Pc3dsyed.mjs → packages-Bz8iWtUY.mjs} +5 -5
  23. package/lib/{packages-Pc3dsyed.mjs.map → packages-Bz8iWtUY.mjs.map} +1 -1
  24. package/lib/{planner-B3IWgziF.mjs → planner-CpcR6z07.mjs} +3 -3
  25. package/lib/{planner-B3IWgziF.mjs.map → planner-CpcR6z07.mjs.map} +1 -1
  26. package/lib/planner-g06Phdjc.mjs +2 -0
  27. package/lib/roomle-headless.d.ts +4 -0
  28. package/lib/roomle-headless.js +9 -9
  29. package/lib/{roomle-sdk-Be4K-H8u.mjs → roomle-sdk-BCmaueGp.mjs} +1218 -1162
  30. package/lib/roomle-sdk-BCmaueGp.mjs.map +1 -0
  31. package/lib/roomle-sdk.d.ts +4 -0
  32. package/lib/roomle-sdk.js +6 -6
  33. package/lib/{roomle-webgpu-renderer-Lt55gNj5.mjs → roomle-webgpu-renderer-CS0lYZJ4.mjs} +351 -348
  34. package/lib/{roomle-webgpu-renderer-Lt55gNj5.mjs.map → roomle-webgpu-renderer-CS0lYZJ4.mjs.map} +1 -1
  35. package/lib/{scene-renderer-C8Lh-lff.mjs → scene-renderer--WNt8myk.mjs} +27 -23
  36. package/lib/scene-renderer--WNt8myk.mjs.map +1 -0
  37. package/lib/{script-loader-CzikXnNg.mjs → script-loader-Dmcvx-Qu.mjs} +2 -2
  38. package/lib/{script-loader-CzikXnNg.mjs.map → script-loader-Dmcvx-Qu.mjs.map} +1 -1
  39. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  40. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  41. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  42. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  43. package/lib/{stats-helper-Ddg1O4fO.mjs → stats-helper-B1_lK1E8.mjs} +2 -2
  44. package/lib/{stats-helper-Ddg1O4fO.mjs.map → stats-helper-B1_lK1E8.mjs.map} +1 -1
  45. package/lib/three.tsl-BZfU6fFt.mjs +2 -0
  46. package/lib/{three.tsl-Dew9p5yF.mjs → three.tsl-DO_HZZuJ.mjs} +58 -56
  47. package/lib/{three.tsl-Dew9p5yF.mjs.map → three.tsl-DO_HZZuJ.mjs.map} +1 -1
  48. package/lib/{tools-core-CVdBXX3L.mjs → tools-core-CRWZtE-S.mjs} +3 -3
  49. package/lib/{tools-core-CVdBXX3L.mjs.map → tools-core-CRWZtE-S.mjs.map} +1 -1
  50. package/lib/{webgpu-B0rxiqW-.mjs → webgpu-C14yfIYy.mjs} +86 -86
  51. package/lib/{webgpu-B0rxiqW-.mjs.map → webgpu-C14yfIYy.mjs.map} +1 -1
  52. package/package.json +2 -2
  53. package/lib/configurator-BfdyDYqe.mjs +0 -2
  54. package/lib/glb-viewer-BFYG-bD2.mjs +0 -2
  55. package/lib/highlight-coordinator-JwAVkMeS.mjs.map +0 -1
  56. package/lib/planner-BhnBEaPV.mjs +0 -2
  57. package/lib/roomle-sdk-Be4K-H8u.mjs.map +0 -1
  58. package/lib/scene-renderer-C8Lh-lff.mjs.map +0 -1
  59. package/lib/three.tsl-BnL9nfJa.mjs +0 -2
Binary file
@@ -1,6 +1,6 @@
1
1
  import { Si as e, jr as t } from "./three.core-0KaTx8dm.mjs";
2
2
  import { It as n, Kn as r, Vt as i, bn as a, ln as o } from "./three.webgpu-ylONY593.mjs";
3
- import { At as s, Et as c, Mt as l, Pt as u, Z as d, g as f, kt as p, n as m, nt as h, w as g } from "./three.tsl-Dew9p5yF.mjs";
3
+ import { At as s, Dt as c, Ft as l, Nt as u, Q as d, T as f, g as p, jt as m, n as h, rt as g } from "./three.tsl-DO_HZZuJ.mjs";
4
4
  //#region ../../node_modules/three/examples/jsm/tsl/display/GaussianBlurNode.js
5
5
  var _ = /* @__PURE__ */ new o(), v, y = class extends r {
6
6
  static get type() {
@@ -24,19 +24,19 @@ var _ = /* @__PURE__ */ new o(), v, y = class extends r {
24
24
  return this._textureNode;
25
25
  }
26
26
  setup(e) {
27
- let t = this.textureNode, r = s(), i = l(this.directionNode || 1), a, o;
28
- this.premultipliedAlpha ? (a = (e) => h(t.sample(e)), o = (e) => p(e)) : (a = (e) => t.sample(e), o = (e) => e);
29
- let c = m(() => {
30
- let e = 3 + 2 * this.sigma, t = this._getCoefficients(e), n = this._invSize, s = i.mul(this._passDirection), c = u(a(r).mul(t[0])).toVar();
27
+ let t = this.textureNode, r = m(), i = u(this.directionNode || 1), a, o;
28
+ this.premultipliedAlpha ? (a = (e) => g(t.sample(e)), o = (e) => s(e)) : (a = (e) => t.sample(e), o = (e) => e);
29
+ let c = h(() => {
30
+ let e = 3 + 2 * this.sigma, t = this._getCoefficients(e), n = this._invSize, s = i.mul(this._passDirection), c = l(a(r).mul(t[0])).toVar();
31
31
  for (let i = 1; i < e; i++) {
32
- let e = g(i), o = g(t[i]), u = l(s.mul(n.mul(e))).toVar(), d = a(r.add(u)), f = a(r.sub(u));
33
- c.addAssign(d.add(f).mul(o));
32
+ let e = f(i), o = f(t[i]), l = u(s.mul(n.mul(e))).toVar(), d = a(r.add(l)), p = a(r.sub(l));
33
+ c.addAssign(d.add(p).mul(o));
34
34
  }
35
35
  return o(c);
36
36
  }), d = this._material ||= new n();
37
37
  d.fragmentNode = c().context(e.getSharedContext()), d.name = "Gaussian_blur", d.needsUpdate = !0;
38
- let f = e.getNodeProperties(this);
39
- return f.textureNode = t, this._textureNode;
38
+ let p = e.getNodeProperties(this);
39
+ return p.textureNode = t, this._textureNode;
40
40
  }
41
41
  dispose() {
42
42
  this._horizontalRT.dispose(), this._verticalRT.dispose(), this._material !== null && this._material.dispose();
@@ -52,8 +52,8 @@ var _ = /* @__PURE__ */ new o(), v, y = class extends r {
52
52
  set resolution(e) {
53
53
  console.warn("THREE.GaussianBlurNode: The \"resolution\" property has been renamed to \"resolutionScale\" and is now of type `number`."), this.resolutionScale = e.x;
54
54
  }
55
- }, b = (e, t, n, r = {}) => new y(f(e), t, n, r);
55
+ }, b = (e, t, n, r = {}) => new y(p(e), t, n, r);
56
56
  //#endregion
57
57
  export { b as gaussianBlur };
58
58
 
59
- //# sourceMappingURL=GaussianBlurNode-Bjszve7N.mjs.map
59
+ //# sourceMappingURL=GaussianBlurNode-BMH03PYf.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"GaussianBlurNode-Bjszve7N.mjs","names":[],"sources":["../../../../node_modules/three/examples/jsm/tsl/display/GaussianBlurNode.js"],"sourcesContent":["import { RenderTarget, Vector2, NodeMaterial, RendererUtils, QuadMesh, TempNode, NodeUpdateType } from 'three/webgpu';\nimport { Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, premultiplyAlpha, unpremultiplyAlpha } from 'three/tsl';\n\nconst _quadMesh = /*@__PURE__*/ new QuadMesh();\n\nlet _rendererState;\n\n/**\n * Post processing node for creating a gaussian blur effect.\n *\n * @augments TempNode\n * @three_import import { gaussianBlur, premultipliedGaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\n */\nclass GaussianBlurNode extends TempNode {\n\n\tstatic get type() {\n\n\t\treturn 'GaussianBlurNode';\n\n\t}\n\n\t/**\n\t * Constructs a new gaussian blur node.\n\t *\n\t * @param {TextureNode} textureNode - The texture node that represents the input of the effect.\n\t * @param {Node<vec2|float>} directionNode - Defines the direction and radius of the blur.\n\t * @param {number} sigma - Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n\t * @param {Object} [options={}] - Additional options for the gaussian blur effect.\n\t * @param {boolean} [options.premultipliedAlpha=false] - Whether to use premultiplied alpha for the blur effect.\n\t * @param {number} [options.resolutionScale=1] - The resolution of the effect. 0.5 means half the resolution of the texture node.\n\t */\n\tconstructor( textureNode, directionNode = null, sigma = 4, options = {} ) {\n\n\t\tsuper( 'vec4' );\n\n\t\t/**\n\t\t * The texture node that represents the input of the effect.\n\t\t *\n\t\t * @type {TextureNode}\n\t\t */\n\t\tthis.textureNode = textureNode;\n\n\t\t/**\n\t\t * Defines the direction and radius of the blur.\n\t\t *\n\t\t * @type {Node<vec2|float>}\n\t\t */\n\t\tthis.directionNode = directionNode;\n\n\t\t/**\n\t\t * Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.sigma = sigma;\n\n\t\t/**\n\t\t * A uniform node holding the inverse resolution value.\n\t\t *\n\t\t * @private\n\t\t * @type {UniformNode<vec2>}\n\t\t */\n\t\tthis._invSize = uniform( new Vector2() );\n\n\t\t/**\n\t\t * Gaussian blur is applied in two passes (horizontal, vertical).\n\t\t * This node controls the direction of each pass.\n\t\t *\n\t\t * @private\n\t\t * @type {UniformNode<vec2>}\n\t\t */\n\t\tthis._passDirection = uniform( new Vector2() );\n\n\t\t/**\n\t\t * The render target used for the horizontal pass.\n\t\t *\n\t\t * @private\n\t\t * @type {RenderTarget}\n\t\t */\n\t\tthis._horizontalRT = new RenderTarget( 1, 1, { depthBuffer: false } );\n\t\tthis._horizontalRT.texture.name = 'GaussianBlurNode.horizontal';\n\n\t\t/**\n\t\t * The render target used for the vertical pass.\n\t\t *\n\t\t * @private\n\t\t * @type {RenderTarget}\n\t\t */\n\t\tthis._verticalRT = new RenderTarget( 1, 1, { depthBuffer: false } );\n\t\tthis._verticalRT.texture.name = 'GaussianBlurNode.vertical';\n\n\t\t/**\n\t\t * The result of the effect is represented as a separate texture node.\n\t\t *\n\t\t * @private\n\t\t * @type {PassTextureNode}\n\t\t */\n\t\tthis._textureNode = passTexture( this, this._verticalRT.texture );\n\t\tthis._textureNode.uvNode = textureNode.uvNode;\n\n\t\t/**\n\t\t * The material for the blur pass.\n\t\t *\n\t\t * @private\n\t\t * @type {?NodeMaterial}\n\t\t */\n\t\tthis._material = null;\n\n\t\t/**\n\t\t * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders\n\t\t * its effect once per frame in `updateBefore()`.\n\t\t *\n\t\t * @type {string}\n\t\t * @default 'frame'\n\t\t */\n\t\tthis.updateBeforeType = NodeUpdateType.FRAME;\n\n\t\t/**\n\t\t * The resolution scale.\n\t\t *\n\t\t * @type {number}\n\t\t * @default (1)\n\t\t */\n\t\tthis.resolutionScale = options.resolutionScale || 1;\n\n\t\t/**\n\t\t * Whether the effect should use premultiplied alpha or not. Set this to `true`\n\t\t * if you are going to blur texture input with transparency.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.premultipliedAlpha = options.premultipliedAlpha || false;\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 * @default true\n\t\t * @readonly\n\t\t */\n\t\tthis.isGaussianBlurNode = true;\n\n\t}\n\n\t/**\n\t * Sets the size of the effect.\n\t *\n\t * @param {number} width - The width of the effect.\n\t * @param {number} height - The height of the effect.\n\t */\n\tsetSize( width, height ) {\n\n\t\twidth = Math.max( Math.round( width * this.resolutionScale ), 1 );\n\t\theight = Math.max( Math.round( height * this.resolutionScale ), 1 );\n\n\t\tthis._invSize.value.set( 1 / width, 1 / height );\n\t\tthis._horizontalRT.setSize( width, height );\n\t\tthis._verticalRT.setSize( width, height );\n\n\t}\n\n\t/**\n\t * This method is used to render the effect once per frame.\n\t *\n\t * @param {NodeFrame} frame - The current node frame.\n\t */\n\tupdateBefore( frame ) {\n\n\t\tconst { renderer } = frame;\n\n\t\t_rendererState = RendererUtils.resetRendererState( renderer, _rendererState );\n\n\t\t//\n\n\t\tconst textureNode = this.textureNode;\n\t\tconst map = textureNode.value;\n\n\t\tconst currentTexture = textureNode.value;\n\n\t\t_quadMesh.material = this._material;\n\n\t\tthis.setSize( map.image.width, map.image.height );\n\n\t\tconst textureType = map.type;\n\n\t\tthis._horizontalRT.texture.type = textureType;\n\t\tthis._verticalRT.texture.type = textureType;\n\n\t\t// horizontal\n\n\t\trenderer.setRenderTarget( this._horizontalRT );\n\n\t\tthis._passDirection.value.set( 1, 0 );\n\n\t\t_quadMesh.name = 'Gaussian Blur [ Horizontal Pass ]';\n\t\t_quadMesh.render( renderer );\n\n\t\t// vertical\n\n\t\ttextureNode.value = this._horizontalRT.texture;\n\t\trenderer.setRenderTarget( this._verticalRT );\n\n\t\tthis._passDirection.value.set( 0, 1 );\n\n\t\t_quadMesh.name = 'Gaussian Blur [ Vertical Pass ]';\n\t\t_quadMesh.render( renderer );\n\n\t\t// restore\n\n\t\ttextureNode.value = currentTexture;\n\n\t\tRendererUtils.restoreRendererState( renderer, _rendererState );\n\n\t}\n\n\t/**\n\t * Returns the result of the effect as a texture node.\n\t *\n\t * @return {PassTextureNode} A texture node that represents the result of the effect.\n\t */\n\tgetTextureNode() {\n\n\t\treturn this._textureNode;\n\n\t}\n\n\t/**\n\t * This method is used to setup the effect's TSL code.\n\t *\n\t * @param {NodeBuilder} builder - The current node builder.\n\t * @return {PassTextureNode}\n\t */\n\tsetup( builder ) {\n\n\t\tconst textureNode = this.textureNode;\n\n\t\t//\n\n\t\tconst uvNode = uv();\n\t\tconst directionNode = vec2( this.directionNode || 1 );\n\n\t\tlet sampleTexture, output;\n\n\t\tif ( this.premultipliedAlpha ) {\n\n\t\t\t// https://lisyarus.github.io/blog/posts/blur-coefficients-generator.html\n\n\t\t\tsampleTexture = ( uv ) => premultiplyAlpha( textureNode.sample( uv ) );\n\t\t\toutput = ( color ) => unpremultiplyAlpha( color );\n\n\t\t} else {\n\n\t\t\tsampleTexture = ( uv ) => textureNode.sample( uv );\n\t\t\toutput = ( color ) => color;\n\n\t\t}\n\n\t\tconst blur = Fn( () => {\n\n\t\t\tconst kernelSize = 3 + ( 2 * this.sigma );\n\t\t\tconst gaussianCoefficients = this._getCoefficients( kernelSize );\n\n\t\t\tconst invSize = this._invSize;\n\t\t\tconst direction = directionNode.mul( this._passDirection );\n\n\t\t\tconst diffuseSum = vec4( sampleTexture( uvNode ).mul( gaussianCoefficients[ 0 ] ) ).toVar();\n\n\t\t\tfor ( let i = 1; i < kernelSize; i ++ ) {\n\n\t\t\t\tconst x = float( i );\n\t\t\t\tconst w = float( gaussianCoefficients[ i ] );\n\n\t\t\t\tconst uvOffset = vec2( direction.mul( invSize.mul( x ) ) ).toVar();\n\n\t\t\t\tconst sample1 = sampleTexture( uvNode.add( uvOffset ) );\n\t\t\t\tconst sample2 = sampleTexture( uvNode.sub( uvOffset ) );\n\n\t\t\t\tdiffuseSum.addAssign( sample1.add( sample2 ).mul( w ) );\n\n\t\t\t}\n\n\t\t\treturn output( diffuseSum );\n\n\t\t} );\n\n\t\t//\n\n\t\tconst material = this._material || ( this._material = new NodeMaterial() );\n\t\tmaterial.fragmentNode = blur().context( builder.getSharedContext() );\n\t\tmaterial.name = 'Gaussian_blur';\n\t\tmaterial.needsUpdate = true;\n\n\t\t//\n\n\t\tconst properties = builder.getNodeProperties( this );\n\t\tproperties.textureNode = textureNode;\n\n\t\t//\n\n\t\treturn this._textureNode;\n\n\t}\n\n\t/**\n\t * Frees internal resources. This method should be called\n\t * when the effect is no longer required.\n\t */\n\tdispose() {\n\n\t\tthis._horizontalRT.dispose();\n\t\tthis._verticalRT.dispose();\n\n\t\tif ( this._material !== null ) this._material.dispose();\n\n\t}\n\n\t/**\n\t * Computes gaussian coefficients depending on the given kernel radius.\n\t *\n\t * @private\n\t * @param {number} kernelRadius - The kernel radius.\n\t * @return {Array<number>}\n\t */\n\t_getCoefficients( kernelRadius ) {\n\n\t\tconst coefficients = [];\n\t\tconst sigma = kernelRadius / 3;\n\n\t\tfor ( let i = 0; i < kernelRadius; i ++ ) {\n\n\t\t\tcoefficients.push( 0.39894 * Math.exp( - 0.5 * i * i / ( sigma * sigma ) ) / sigma );\n\n\t\t}\n\n\t\treturn coefficients;\n\n\t}\n\n\t/**\n\t * The resolution scale.\n\t *\n\t * @deprecated\n\t * @type {Vector2}\n\t * @default {(1,1)}\n\t */\n\tget resolution() {\n\n\t\tconsole.warn( 'THREE.GaussianBlurNode: The \"resolution\" property has been renamed to \"resolutionScale\" and is now of type `number`.' ); // @deprecated r180\n\n\t\treturn new Vector2( this.resolutionScale, this.resolutionScale );\n\n\t}\n\n\tset resolution( value ) {\n\n\t\tconsole.warn( 'THREE.GaussianBlurNode: The \"resolution\" property has been renamed to \"resolutionScale\" and is now of type `number`.' ); // @deprecated r180\n\n\t\tthis.resolutionScale = value.x;\n\n\t}\n\n}\n\nexport default GaussianBlurNode;\n\n/**\n * TSL function for creating a gaussian blur node for post processing.\n *\n * @tsl\n * @function\n * @param {Node<vec4>} node - The node that represents the input of the effect.\n * @param {Node<vec2|float>} directionNode - Defines the direction and radius of the blur.\n * @param {number} sigma - Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n * @param {Object} [options={}] - Additional options for the gaussian blur effect.\n * @param {boolean} [options.premultipliedAlpha=false] - Whether to use premultiplied alpha for the blur effect.\n * @param {number} [options.resolutionScale=1] - The resolution of the effect. 0.5 means half the resolution of the texture node.\n * @returns {GaussianBlurNode}\n */\nexport const gaussianBlur = ( node, directionNode, sigma, options = {} ) => new GaussianBlurNode( convertToTexture( node ), directionNode, sigma, options );\n\n/**\n * TSL function for creating a gaussian blur node for post processing with enabled premultiplied alpha.\n *\n * @tsl\n * @function\n * @deprecated since r180. Use `gaussianBlur()` with `premultipliedAlpha: true` option instead.\n * @param {Node<vec4>} node - The node that represents the input of the effect.\n * @param {Node<vec2|float>} directionNode - Defines the direction and radius of the blur.\n * @param {number} sigma - Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n * @returns {GaussianBlurNode}\n */\nexport function premultipliedGaussianBlur( node, directionNode, sigma ) {\n\n\tconsole.warn( 'THREE.TSL: \"premultipliedGaussianBlur()\" is deprecated. Use \"gaussianBlur()\" with \"premultipliedAlpha: true\" option instead.' ); // deprecated, r180\n\n\treturn gaussianBlur( node, directionNode, sigma, { premultipliedAlpha: true } );\n\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;A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AU,EAAe,EAAO,IAAK,EAAU,CAAE,EACjD,IAAU,EAAe,EAAO,IAAK,EAAU,CAAE;AAEvD,MAAW,UAAW,EAAQ,IAAK,EAAS,CAAC,IAAK,EAAG,CAAE;;AAIxD,UAAO,EAAQ,EAAY;IAEzB,EAIG,IAAW,AAAoB,KAAK,cAAY,IAAI,GAAc;AAGxE,EAFA,EAAS,eAAe,GAAM,CAAC,QAAS,EAAQ,kBAAkB,CAAE,EACpE,EAAS,OAAO,iBAChB,EAAS,cAAc;EAIvB,IAAM,IAAa,EAAQ,kBAAmB,KAAM;AAKpD,SAJA,EAAW,cAAc,GAIlB,KAAK;;CAQb,UAAU;AAKT,EAHA,KAAK,cAAc,SAAS,EAC5B,KAAK,YAAY,SAAS,EAErB,KAAK,cAAc,QAAO,KAAK,UAAU,SAAS;;CAWxD,iBAAkB,GAAe;EAEhC,IAAM,IAAe,EAAE,EACjB,IAAQ,IAAe;AAE7B,OAAM,IAAI,IAAI,GAAG,IAAI,GAAc,IAElC,GAAa,KAAM,SAAU,KAAK,IAAK,MAAQ,IAAI,KAAM,IAAQ,GAAS,GAAG,EAAO;AAIrF,SAAO;;CAWR,IAAI,aAAa;AAIhB,SAFA,QAAQ,KAAM,2HAAwH,EAE/H,IAAI,EAAS,KAAK,iBAAiB,KAAK,gBAAiB;;CAIjE,IAAI,WAAY,GAAQ;AAIvB,EAFA,QAAQ,KAAM,2HAAwH,EAEtI,KAAK,kBAAkB,EAAM;;GAqBlB,KAAiB,GAAM,GAAe,GAAO,IAAU,EAAE,KAAM,IAAI,EAAkB,EAAkB,EAAM,EAAE,GAAe,GAAO,EAAS"}
1
+ {"version":3,"file":"GaussianBlurNode-BMH03PYf.mjs","names":[],"sources":["../../../../node_modules/three/examples/jsm/tsl/display/GaussianBlurNode.js"],"sourcesContent":["import { RenderTarget, Vector2, NodeMaterial, RendererUtils, QuadMesh, TempNode, NodeUpdateType } from 'three/webgpu';\nimport { Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, premultiplyAlpha, unpremultiplyAlpha } from 'three/tsl';\n\nconst _quadMesh = /*@__PURE__*/ new QuadMesh();\n\nlet _rendererState;\n\n/**\n * Post processing node for creating a gaussian blur effect.\n *\n * @augments TempNode\n * @three_import import { gaussianBlur, premultipliedGaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';\n */\nclass GaussianBlurNode extends TempNode {\n\n\tstatic get type() {\n\n\t\treturn 'GaussianBlurNode';\n\n\t}\n\n\t/**\n\t * Constructs a new gaussian blur node.\n\t *\n\t * @param {TextureNode} textureNode - The texture node that represents the input of the effect.\n\t * @param {Node<vec2|float>} directionNode - Defines the direction and radius of the blur.\n\t * @param {number} sigma - Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n\t * @param {Object} [options={}] - Additional options for the gaussian blur effect.\n\t * @param {boolean} [options.premultipliedAlpha=false] - Whether to use premultiplied alpha for the blur effect.\n\t * @param {number} [options.resolutionScale=1] - The resolution of the effect. 0.5 means half the resolution of the texture node.\n\t */\n\tconstructor( textureNode, directionNode = null, sigma = 4, options = {} ) {\n\n\t\tsuper( 'vec4' );\n\n\t\t/**\n\t\t * The texture node that represents the input of the effect.\n\t\t *\n\t\t * @type {TextureNode}\n\t\t */\n\t\tthis.textureNode = textureNode;\n\n\t\t/**\n\t\t * Defines the direction and radius of the blur.\n\t\t *\n\t\t * @type {Node<vec2|float>}\n\t\t */\n\t\tthis.directionNode = directionNode;\n\n\t\t/**\n\t\t * Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n\t\t *\n\t\t * @type {number}\n\t\t */\n\t\tthis.sigma = sigma;\n\n\t\t/**\n\t\t * A uniform node holding the inverse resolution value.\n\t\t *\n\t\t * @private\n\t\t * @type {UniformNode<vec2>}\n\t\t */\n\t\tthis._invSize = uniform( new Vector2() );\n\n\t\t/**\n\t\t * Gaussian blur is applied in two passes (horizontal, vertical).\n\t\t * This node controls the direction of each pass.\n\t\t *\n\t\t * @private\n\t\t * @type {UniformNode<vec2>}\n\t\t */\n\t\tthis._passDirection = uniform( new Vector2() );\n\n\t\t/**\n\t\t * The render target used for the horizontal pass.\n\t\t *\n\t\t * @private\n\t\t * @type {RenderTarget}\n\t\t */\n\t\tthis._horizontalRT = new RenderTarget( 1, 1, { depthBuffer: false } );\n\t\tthis._horizontalRT.texture.name = 'GaussianBlurNode.horizontal';\n\n\t\t/**\n\t\t * The render target used for the vertical pass.\n\t\t *\n\t\t * @private\n\t\t * @type {RenderTarget}\n\t\t */\n\t\tthis._verticalRT = new RenderTarget( 1, 1, { depthBuffer: false } );\n\t\tthis._verticalRT.texture.name = 'GaussianBlurNode.vertical';\n\n\t\t/**\n\t\t * The result of the effect is represented as a separate texture node.\n\t\t *\n\t\t * @private\n\t\t * @type {PassTextureNode}\n\t\t */\n\t\tthis._textureNode = passTexture( this, this._verticalRT.texture );\n\t\tthis._textureNode.uvNode = textureNode.uvNode;\n\n\t\t/**\n\t\t * The material for the blur pass.\n\t\t *\n\t\t * @private\n\t\t * @type {?NodeMaterial}\n\t\t */\n\t\tthis._material = null;\n\n\t\t/**\n\t\t * The `updateBeforeType` is set to `NodeUpdateType.FRAME` since the node renders\n\t\t * its effect once per frame in `updateBefore()`.\n\t\t *\n\t\t * @type {string}\n\t\t * @default 'frame'\n\t\t */\n\t\tthis.updateBeforeType = NodeUpdateType.FRAME;\n\n\t\t/**\n\t\t * The resolution scale.\n\t\t *\n\t\t * @type {number}\n\t\t * @default (1)\n\t\t */\n\t\tthis.resolutionScale = options.resolutionScale || 1;\n\n\t\t/**\n\t\t * Whether the effect should use premultiplied alpha or not. Set this to `true`\n\t\t * if you are going to blur texture input with transparency.\n\t\t *\n\t\t * @type {boolean}\n\t\t * @default false\n\t\t */\n\t\tthis.premultipliedAlpha = options.premultipliedAlpha || false;\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 * @default true\n\t\t * @readonly\n\t\t */\n\t\tthis.isGaussianBlurNode = true;\n\n\t}\n\n\t/**\n\t * Sets the size of the effect.\n\t *\n\t * @param {number} width - The width of the effect.\n\t * @param {number} height - The height of the effect.\n\t */\n\tsetSize( width, height ) {\n\n\t\twidth = Math.max( Math.round( width * this.resolutionScale ), 1 );\n\t\theight = Math.max( Math.round( height * this.resolutionScale ), 1 );\n\n\t\tthis._invSize.value.set( 1 / width, 1 / height );\n\t\tthis._horizontalRT.setSize( width, height );\n\t\tthis._verticalRT.setSize( width, height );\n\n\t}\n\n\t/**\n\t * This method is used to render the effect once per frame.\n\t *\n\t * @param {NodeFrame} frame - The current node frame.\n\t */\n\tupdateBefore( frame ) {\n\n\t\tconst { renderer } = frame;\n\n\t\t_rendererState = RendererUtils.resetRendererState( renderer, _rendererState );\n\n\t\t//\n\n\t\tconst textureNode = this.textureNode;\n\t\tconst map = textureNode.value;\n\n\t\tconst currentTexture = textureNode.value;\n\n\t\t_quadMesh.material = this._material;\n\n\t\tthis.setSize( map.image.width, map.image.height );\n\n\t\tconst textureType = map.type;\n\n\t\tthis._horizontalRT.texture.type = textureType;\n\t\tthis._verticalRT.texture.type = textureType;\n\n\t\t// horizontal\n\n\t\trenderer.setRenderTarget( this._horizontalRT );\n\n\t\tthis._passDirection.value.set( 1, 0 );\n\n\t\t_quadMesh.name = 'Gaussian Blur [ Horizontal Pass ]';\n\t\t_quadMesh.render( renderer );\n\n\t\t// vertical\n\n\t\ttextureNode.value = this._horizontalRT.texture;\n\t\trenderer.setRenderTarget( this._verticalRT );\n\n\t\tthis._passDirection.value.set( 0, 1 );\n\n\t\t_quadMesh.name = 'Gaussian Blur [ Vertical Pass ]';\n\t\t_quadMesh.render( renderer );\n\n\t\t// restore\n\n\t\ttextureNode.value = currentTexture;\n\n\t\tRendererUtils.restoreRendererState( renderer, _rendererState );\n\n\t}\n\n\t/**\n\t * Returns the result of the effect as a texture node.\n\t *\n\t * @return {PassTextureNode} A texture node that represents the result of the effect.\n\t */\n\tgetTextureNode() {\n\n\t\treturn this._textureNode;\n\n\t}\n\n\t/**\n\t * This method is used to setup the effect's TSL code.\n\t *\n\t * @param {NodeBuilder} builder - The current node builder.\n\t * @return {PassTextureNode}\n\t */\n\tsetup( builder ) {\n\n\t\tconst textureNode = this.textureNode;\n\n\t\t//\n\n\t\tconst uvNode = uv();\n\t\tconst directionNode = vec2( this.directionNode || 1 );\n\n\t\tlet sampleTexture, output;\n\n\t\tif ( this.premultipliedAlpha ) {\n\n\t\t\t// https://lisyarus.github.io/blog/posts/blur-coefficients-generator.html\n\n\t\t\tsampleTexture = ( uv ) => premultiplyAlpha( textureNode.sample( uv ) );\n\t\t\toutput = ( color ) => unpremultiplyAlpha( color );\n\n\t\t} else {\n\n\t\t\tsampleTexture = ( uv ) => textureNode.sample( uv );\n\t\t\toutput = ( color ) => color;\n\n\t\t}\n\n\t\tconst blur = Fn( () => {\n\n\t\t\tconst kernelSize = 3 + ( 2 * this.sigma );\n\t\t\tconst gaussianCoefficients = this._getCoefficients( kernelSize );\n\n\t\t\tconst invSize = this._invSize;\n\t\t\tconst direction = directionNode.mul( this._passDirection );\n\n\t\t\tconst diffuseSum = vec4( sampleTexture( uvNode ).mul( gaussianCoefficients[ 0 ] ) ).toVar();\n\n\t\t\tfor ( let i = 1; i < kernelSize; i ++ ) {\n\n\t\t\t\tconst x = float( i );\n\t\t\t\tconst w = float( gaussianCoefficients[ i ] );\n\n\t\t\t\tconst uvOffset = vec2( direction.mul( invSize.mul( x ) ) ).toVar();\n\n\t\t\t\tconst sample1 = sampleTexture( uvNode.add( uvOffset ) );\n\t\t\t\tconst sample2 = sampleTexture( uvNode.sub( uvOffset ) );\n\n\t\t\t\tdiffuseSum.addAssign( sample1.add( sample2 ).mul( w ) );\n\n\t\t\t}\n\n\t\t\treturn output( diffuseSum );\n\n\t\t} );\n\n\t\t//\n\n\t\tconst material = this._material || ( this._material = new NodeMaterial() );\n\t\tmaterial.fragmentNode = blur().context( builder.getSharedContext() );\n\t\tmaterial.name = 'Gaussian_blur';\n\t\tmaterial.needsUpdate = true;\n\n\t\t//\n\n\t\tconst properties = builder.getNodeProperties( this );\n\t\tproperties.textureNode = textureNode;\n\n\t\t//\n\n\t\treturn this._textureNode;\n\n\t}\n\n\t/**\n\t * Frees internal resources. This method should be called\n\t * when the effect is no longer required.\n\t */\n\tdispose() {\n\n\t\tthis._horizontalRT.dispose();\n\t\tthis._verticalRT.dispose();\n\n\t\tif ( this._material !== null ) this._material.dispose();\n\n\t}\n\n\t/**\n\t * Computes gaussian coefficients depending on the given kernel radius.\n\t *\n\t * @private\n\t * @param {number} kernelRadius - The kernel radius.\n\t * @return {Array<number>}\n\t */\n\t_getCoefficients( kernelRadius ) {\n\n\t\tconst coefficients = [];\n\t\tconst sigma = kernelRadius / 3;\n\n\t\tfor ( let i = 0; i < kernelRadius; i ++ ) {\n\n\t\t\tcoefficients.push( 0.39894 * Math.exp( - 0.5 * i * i / ( sigma * sigma ) ) / sigma );\n\n\t\t}\n\n\t\treturn coefficients;\n\n\t}\n\n\t/**\n\t * The resolution scale.\n\t *\n\t * @deprecated\n\t * @type {Vector2}\n\t * @default {(1,1)}\n\t */\n\tget resolution() {\n\n\t\tconsole.warn( 'THREE.GaussianBlurNode: The \"resolution\" property has been renamed to \"resolutionScale\" and is now of type `number`.' ); // @deprecated r180\n\n\t\treturn new Vector2( this.resolutionScale, this.resolutionScale );\n\n\t}\n\n\tset resolution( value ) {\n\n\t\tconsole.warn( 'THREE.GaussianBlurNode: The \"resolution\" property has been renamed to \"resolutionScale\" and is now of type `number`.' ); // @deprecated r180\n\n\t\tthis.resolutionScale = value.x;\n\n\t}\n\n}\n\nexport default GaussianBlurNode;\n\n/**\n * TSL function for creating a gaussian blur node for post processing.\n *\n * @tsl\n * @function\n * @param {Node<vec4>} node - The node that represents the input of the effect.\n * @param {Node<vec2|float>} directionNode - Defines the direction and radius of the blur.\n * @param {number} sigma - Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n * @param {Object} [options={}] - Additional options for the gaussian blur effect.\n * @param {boolean} [options.premultipliedAlpha=false] - Whether to use premultiplied alpha for the blur effect.\n * @param {number} [options.resolutionScale=1] - The resolution of the effect. 0.5 means half the resolution of the texture node.\n * @returns {GaussianBlurNode}\n */\nexport const gaussianBlur = ( node, directionNode, sigma, options = {} ) => new GaussianBlurNode( convertToTexture( node ), directionNode, sigma, options );\n\n/**\n * TSL function for creating a gaussian blur node for post processing with enabled premultiplied alpha.\n *\n * @tsl\n * @function\n * @deprecated since r180. Use `gaussianBlur()` with `premultipliedAlpha: true` option instead.\n * @param {Node<vec4>} node - The node that represents the input of the effect.\n * @param {Node<vec2|float>} directionNode - Defines the direction and radius of the blur.\n * @param {number} sigma - Controls the kernel of the blur filter. Higher values mean a wider blur radius.\n * @returns {GaussianBlurNode}\n */\nexport function premultipliedGaussianBlur( node, directionNode, sigma ) {\n\n\tconsole.warn( 'THREE.TSL: \"premultipliedGaussianBlur()\" is deprecated. Use \"gaussianBlur()\" with \"premultipliedAlpha: true\" option instead.' ); // deprecated, r180\n\n\treturn gaussianBlur( node, directionNode, sigma, { premultipliedAlpha: true } );\n\n}\n"],"x_google_ignoreList":[0],"mappings":";;;;AAGA,IAAM,oBAA0B,IAAI,GAAU,EAE1C,GAQE,IAAN,cAA+B,EAAS;CAEvC,WAAW,OAAO;AAEjB,SAAO;;CAcR,YAAa,GAAa,IAAgB,MAAM,IAAQ,GAAG,IAAU,EAAE,EAAG;AA8GzE,EA5GA,MAAO,OAAQ,EAOf,KAAK,cAAc,GAOnB,KAAK,gBAAgB,GAOrB,KAAK,QAAQ,GAQb,KAAK,WAAW,EAAS,IAAI,GAAS,CAAE,EASxC,KAAK,iBAAiB,EAAS,IAAI,GAAS,CAAE,EAQ9C,KAAK,gBAAgB,IAAI,EAAc,GAAG,GAAG,EAAE,aAAa,IAAO,CAAE,EACrE,KAAK,cAAc,QAAQ,OAAO,+BAQlC,KAAK,cAAc,IAAI,EAAc,GAAG,GAAG,EAAE,aAAa,IAAO,CAAE,EACnE,KAAK,YAAY,QAAQ,OAAO,6B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AAM,IAAe,EAAE,EACjB,IAAQ,IAAe;AAE7B,OAAM,IAAI,IAAI,GAAG,IAAI,GAAc,IAElC,GAAa,KAAM,SAAU,KAAK,IAAK,MAAQ,IAAI,KAAM,IAAQ,GAAS,GAAG,EAAO;AAIrF,SAAO;;CAWR,IAAI,aAAa;AAIhB,SAFA,QAAQ,KAAM,2HAAwH,EAE/H,IAAI,EAAS,KAAK,iBAAiB,KAAK,gBAAiB;;CAIjE,IAAI,WAAY,GAAQ;AAIvB,EAFA,QAAQ,KAAM,2HAAwH,EAEtI,KAAK,kBAAkB,EAAM;;GAqBlB,KAAiB,GAAM,GAAe,GAAO,IAAU,EAAE,KAAM,IAAI,EAAkB,EAAkB,EAAM,EAAE,GAAe,GAAO,EAAS"}
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import { B as e, z as t } from "./roomle-sdk-Be4K-H8u.mjs";
1
+ import { B as e, z as t } from "./roomle-sdk-BCmaueGp.mjs";
2
2
  //#region packages/homag-intelligence/src/api.ts
3
3
  var n = class {
4
4
  constructor(e) {
@@ -52,4 +52,4 @@ var n = class {
52
52
  //#endregion
53
53
  export { n as t };
54
54
 
55
- //# sourceMappingURL=api-C-enDIJZ.mjs.map
55
+ //# sourceMappingURL=api-hQ0uOklW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-C-enDIJZ.mjs","names":[],"sources":["../../packages/homag-intelligence/src/api.ts"],"sourcesContent":["import type { RoomDesignerRequests } from './glue-logic';\nimport type { MasterData, PosGroup } from './model/oc-scripts-domain.model';\nimport type { PlanRoomGeometryMode } from './external-object-api';\nimport { PLAN_ROOM_GEOMETRY_MODE } from './external-object-api';\nimport type { RoomlePlannerType } from '../../typings/external-objects';\nimport {\n HI_CONTEXT_ACTION,\n type LoadExternalObjectOptions,\n} from './external-object-api';\n\nexport interface ExternalObjectModuleIdMap {\n originalModuleId: string;\n newModuleId: string;\n}\n\nexport class RoomDesignerApi implements RoomDesignerRequests {\n private _roomlePlanner: RoomlePlannerType;\n\n constructor(roomlePlanner: RoomlePlannerType) {\n this._roomlePlanner = roomlePlanner;\n }\n\n public loadMasterData(masterData: MasterData) {\n this._roomlePlanner.loadExternalObjectMasterData(masterData);\n }\n\n public async loadPosGroups(\n posDataJson: PosGroup | PosGroup[],\n options: LoadExternalObjectOptions,\n ): Promise<void> {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.loadExternalObjectGroups(posDataArray, options);\n }\n\n completelyLoaded(): void {\n this._roomlePlanner.externalObjectsCompletelyLoaded();\n }\n\n public async selectGroup(groupId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n groupId,\n null,\n HI_CONTEXT_ACTION.ROOM,\n );\n }\n\n public async selectRoot(rootModuleId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n null,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public async selectModule(\n rootModuleId: string,\n subModuleId: string,\n ): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n subModuleId,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public openCloseGroup(\n groupOrRootModuleId: string,\n subModuleId: string | null,\n open: boolean,\n animate: boolean,\n ) {\n this._roomlePlanner.openOrCloseGeometryOfExternalObject(\n groupOrRootModuleId,\n subModuleId ?? null,\n open,\n animate,\n );\n return Promise.resolve();\n }\n\n public deleteGroup(groupId: string) {\n this._roomlePlanner.removeExternalObject(groupId);\n }\n\n public deleteRootModule(rootModuleId: string) {\n this._roomlePlanner.removeExternalObject(rootModuleId);\n }\n\n public async getPosDataOfAllGroups() {\n const groups =\n (await this._roomlePlanner.getExternalObjectGroups()) as PosGroup[];\n return groups;\n }\n\n public async getRoomInformation(mode?: PlanRoomGeometryMode) {\n const rooms = await this._roomlePlanner.getExternalRoomInformation(\n mode ?? PLAN_ROOM_GEOMETRY_MODE.FLOOR,\n );\n return rooms;\n }\n\n public async saveExternalObjectSnapshot() {\n return this._roomlePlanner.saveExternalObjectSnapshot();\n }\n\n public async saveCurrentPlanSnapshot() {\n return this._roomlePlanner.saveCurrentPlanSnapshot();\n }\n\n public async renderPosDataImage(posDataJson: object) {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.renderImagesOfExternalObjectGroup(posDataArray);\n }\n}\n"],"mappings":";;AAeA,IAAa,IAAb,MAA6D;CAG3D,YAAY,GAAkC;AAC5C,OAAK,iBAAiB;;CAGxB,eAAsB,GAAwB;AAC5C,OAAK,eAAe,6BAA6B,EAAW;;CAG9D,MAAa,cACX,GACA,GACe;EACf,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,yBAAyB,GAAc,EAAQ;;CAG3E,mBAAyB;AACvB,OAAK,eAAe,iCAAiC;;CAGvD,MAAa,YAAY,GAAgC;AACvD,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,KACnB;;CAGH,MAAa,WAAW,GAAqC;AAC3D,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,UACnB;;CAGH,MAAa,aACX,GACA,GACe;AACf,QAAM,KAAK,eAAe,qBACxB,GACA,GACA,EAAkB,UACnB;;CAGH,eACE,GACA,GACA,GACA,GACA;AAOA,SANA,KAAK,eAAe,oCAClB,GACA,KAAe,MACf,GACA,EACD,EACM,QAAQ,SAAS;;CAG1B,YAAmB,GAAiB;AAClC,OAAK,eAAe,qBAAqB,EAAQ;;CAGnD,iBAAwB,GAAsB;AAC5C,OAAK,eAAe,qBAAqB,EAAa;;CAGxD,MAAa,wBAAwB;AAGnC,SADG,MAAM,KAAK,eAAe,yBAAyB;;CAIxD,MAAa,mBAAmB,GAA6B;AAI3D,SAHc,MAAM,KAAK,eAAe,2BACtC,KAAQ,EAAwB,MACjC;;CAIH,MAAa,6BAA6B;AACxC,SAAO,KAAK,eAAe,4BAA4B;;CAGzD,MAAa,0BAA0B;AACrC,SAAO,KAAK,eAAe,yBAAyB;;CAGtD,MAAa,mBAAmB,GAAqB;EACnD,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,kCAAkC,EAAa"}
1
+ {"version":3,"file":"api-hQ0uOklW.mjs","names":[],"sources":["../../packages/homag-intelligence/src/api.ts"],"sourcesContent":["import type { RoomDesignerRequests } from './glue-logic';\nimport type { MasterData, PosGroup } from './model/oc-scripts-domain.model';\nimport type { PlanRoomGeometryMode } from './external-object-api';\nimport { PLAN_ROOM_GEOMETRY_MODE } from './external-object-api';\nimport type { RoomlePlannerType } from '../../typings/external-objects';\nimport {\n HI_CONTEXT_ACTION,\n type LoadExternalObjectOptions,\n} from './external-object-api';\n\nexport interface ExternalObjectModuleIdMap {\n originalModuleId: string;\n newModuleId: string;\n}\n\nexport class RoomDesignerApi implements RoomDesignerRequests {\n private _roomlePlanner: RoomlePlannerType;\n\n constructor(roomlePlanner: RoomlePlannerType) {\n this._roomlePlanner = roomlePlanner;\n }\n\n public loadMasterData(masterData: MasterData) {\n this._roomlePlanner.loadExternalObjectMasterData(masterData);\n }\n\n public async loadPosGroups(\n posDataJson: PosGroup | PosGroup[],\n options: LoadExternalObjectOptions,\n ): Promise<void> {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.loadExternalObjectGroups(posDataArray, options);\n }\n\n completelyLoaded(): void {\n this._roomlePlanner.externalObjectsCompletelyLoaded();\n }\n\n public async selectGroup(groupId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n groupId,\n null,\n HI_CONTEXT_ACTION.ROOM,\n );\n }\n\n public async selectRoot(rootModuleId: string): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n null,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public async selectModule(\n rootModuleId: string,\n subModuleId: string,\n ): Promise<void> {\n await this._roomlePlanner.selectExternalObject(\n rootModuleId,\n subModuleId,\n HI_CONTEXT_ACTION.ISOLATION,\n );\n }\n\n public openCloseGroup(\n groupOrRootModuleId: string,\n subModuleId: string | null,\n open: boolean,\n animate: boolean,\n ) {\n this._roomlePlanner.openOrCloseGeometryOfExternalObject(\n groupOrRootModuleId,\n subModuleId ?? null,\n open,\n animate,\n );\n return Promise.resolve();\n }\n\n public deleteGroup(groupId: string) {\n this._roomlePlanner.removeExternalObject(groupId);\n }\n\n public deleteRootModule(rootModuleId: string) {\n this._roomlePlanner.removeExternalObject(rootModuleId);\n }\n\n public async getPosDataOfAllGroups() {\n const groups =\n (await this._roomlePlanner.getExternalObjectGroups()) as PosGroup[];\n return groups;\n }\n\n public async getRoomInformation(mode?: PlanRoomGeometryMode) {\n const rooms = await this._roomlePlanner.getExternalRoomInformation(\n mode ?? PLAN_ROOM_GEOMETRY_MODE.FLOOR,\n );\n return rooms;\n }\n\n public async saveExternalObjectSnapshot() {\n return this._roomlePlanner.saveExternalObjectSnapshot();\n }\n\n public async saveCurrentPlanSnapshot() {\n return this._roomlePlanner.saveCurrentPlanSnapshot();\n }\n\n public async renderPosDataImage(posDataJson: object) {\n const posDataArray = Array.isArray(posDataJson)\n ? posDataJson\n : [posDataJson];\n await this._roomlePlanner.renderImagesOfExternalObjectGroup(posDataArray);\n }\n}\n"],"mappings":";;AAeA,IAAa,IAAb,MAA6D;CAG3D,YAAY,GAAkC;AAC5C,OAAK,iBAAiB;;CAGxB,eAAsB,GAAwB;AAC5C,OAAK,eAAe,6BAA6B,EAAW;;CAG9D,MAAa,cACX,GACA,GACe;EACf,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,yBAAyB,GAAc,EAAQ;;CAG3E,mBAAyB;AACvB,OAAK,eAAe,iCAAiC;;CAGvD,MAAa,YAAY,GAAgC;AACvD,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,KACnB;;CAGH,MAAa,WAAW,GAAqC;AAC3D,QAAM,KAAK,eAAe,qBACxB,GACA,MACA,EAAkB,UACnB;;CAGH,MAAa,aACX,GACA,GACe;AACf,QAAM,KAAK,eAAe,qBACxB,GACA,GACA,EAAkB,UACnB;;CAGH,eACE,GACA,GACA,GACA,GACA;AAOA,SANA,KAAK,eAAe,oCAClB,GACA,KAAe,MACf,GACA,EACD,EACM,QAAQ,SAAS;;CAG1B,YAAmB,GAAiB;AAClC,OAAK,eAAe,qBAAqB,EAAQ;;CAGnD,iBAAwB,GAAsB;AAC5C,OAAK,eAAe,qBAAqB,EAAa;;CAGxD,MAAa,wBAAwB;AAGnC,SADG,MAAM,KAAK,eAAe,yBAAyB;;CAIxD,MAAa,mBAAmB,GAA6B;AAI3D,SAHc,MAAM,KAAK,eAAe,2BACtC,KAAQ,EAAwB,MACjC;;CAIH,MAAa,6BAA6B;AACxC,SAAO,KAAK,eAAe,4BAA4B;;CAGzD,MAAa,0BAA0B;AACrC,SAAO,KAAK,eAAe,yBAAyB;;CAGtD,MAAa,mBAAmB,GAAqB;EACnD,IAAM,IAAe,MAAM,QAAQ,EAAY,GAC3C,IACA,CAAC,EAAY;AACjB,QAAM,KAAK,eAAe,kCAAkC,EAAa"}
@@ -1 +1 @@
1
- {"version":3,"file":"asset-loader.worker-eqHzNAwa.mjs","names":[],"sources":["../../packages/workers/generated/asset-loader.worker.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__6kssa3xCT2YlMpIbbRNP$Q__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,0BAAA,OAAA,KAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"asset-loader.worker-eqHzNAwa.mjs","names":[],"sources":["../../packages/workers/generated/asset-loader.worker.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__m8R6TgWxwop2r_xOIPNRtg__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,0BAAA,OAAA,KAAA,IAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"budgeteer.sw-BUMElkO1.mjs","names":[],"sources":["../../packages/workers/generated/budgeteer.sw.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__dJ$ULFcuzX43djbIEsCZPw__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,mBAAA,OAAA,KAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"budgeteer.sw-BUMElkO1.mjs","names":[],"sources":["../../packages/workers/generated/budgeteer.sw.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__rN_1li4k2aIbHGs0zKW8QQ__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,mBAAA,OAAA,KAAA,IAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./configurator-CVg8_f9w.mjs";
2
+ export { e as Configurator };
@@ -1,5 +1,5 @@
1
- import { A as e, C as t, D as n, H as r, T as i, V as a, Z as o, ct as s, et as c, f as l, k as u, n as d, ot as f, pt as p, st as m, tt as h } from "./roomle-sdk-Be4K-H8u.mjs";
2
- import { t as g } from "./script-loader-CzikXnNg.mjs";
1
+ import { A as e, C as t, D as n, H as r, T as i, V as a, Z as o, ct as s, et as c, f as l, k as u, n as d, ot as f, pt as p, st as m, tt as h } from "./roomle-sdk-BCmaueGp.mjs";
2
+ import { t as g } from "./script-loader-Dmcvx-Qu.mjs";
3
3
  import { t as _ } from "./component-raycast-helper-CLX5fLt9.mjs";
4
4
  //#region packages/configurator-core/src/utils/injectables.ts
5
5
  var v = [
@@ -42,4 +42,4 @@ var v = [
42
42
  //#endregion
43
43
  export { y as t };
44
44
 
45
- //# sourceMappingURL=configurator-D8Bfu2_w.mjs.map
45
+ //# sourceMappingURL=configurator-CVg8_f9w.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"configurator-D8Bfu2_w.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/injectables.ts","../../packages/configurator-core/src/configurator.ts"],"sourcesContent":["import CameraControl from '../../../common-core/src/cameracontrol/camera-control';\nimport CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport Logger from '../../../common-core/src/logger';\nimport DataSyncer from '../../../common-core/src/services/data-syncer';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport ComponentRaycastHelper from './component-raycast-helper';\nimport ConfiguratorSceneManager from '../webgl/configurator-scene-manager';\nimport ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport GlobalInitData from '../../../common-core/src/utils/global-init-data';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment('camera-control-3d', CameraControl3D),\n new DependencyInjectionAssignment('camera-control', CameraControl),\n new DependencyInjectionAssignment('global-init-data', GlobalInitData),\n new DependencyInjectionAssignment('data-syncer', DataSyncer),\n new DependencyInjectionAssignment(\n 'configurator-scene-manager',\n ConfiguratorSceneManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment(\n 'configurator-view-model',\n ConfiguratorViewModel,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment(\n 'component-raycast-helper',\n ComponentRaycastHelper,\n DI_TYPE.GLOBAL,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type { AppState } from '../../common-core/src/utils/app-context';\nimport ConfiguratorAppContext from '../../common-core/src/utils/app-context';\nimport { INJECTABLES } from './utils/injectables';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport type ScriptLoader from '../../common-core/src/script-loader';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type Logger from '../../common-core/src/logger';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport type ConfiguratorSceneManager from './webgl/configurator-scene-manager';\nimport { RoomleConfigurator } from './roomle-configurator';\nimport type PlannerKernelAccess from '../../planner-core/src/services/planner-kernel-access';\nimport { KERNEL_TYPE } from '../../common-core/src/services/common-kernel-access';\n\nexport class Configurator extends Main {\n private _configurator: RoomleConfigurator;\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n // This needs to be done so that subscribe to events is done\n const plannerKernelAccess = this.lookup<PlannerKernelAccess>(\n 'planner-kernel-access',\n this._context,\n );\n plannerKernelAccess.init(KERNEL_TYPE.CONFIGURATOR);\n this.lookup<RapiAccess>('rapi-access', this._context);\n this.lookup<ScriptLoader>('script-loader', this._context);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n delete window.RoomleConfigurator;\n }\n\n protected cleanUpDependencies(): void {\n const scriptLoader = this.lookup<ScriptLoader>('script-loader');\n const rapiAccess = this.lookup<RapiAccess>('rapi-access');\n const domHelper = this.lookup<DomHelper>('dom-helper');\n const sceneManager = this.lookup<ConfiguratorSceneManager>(\n 'configurator-scene-manager',\n );\n\n if (scriptLoader) {\n scriptLoader.cleanUp();\n }\n\n if (rapiAccess) {\n rapiAccess.cleanUp();\n }\n\n if (domHelper) {\n //domHelper.cleanUp();\n }\n\n if (sceneManager) {\n sceneManager.cleanUp();\n }\n }\n\n /** Currently the only module that uses AppState — all others ignore the parameter. */\n protected setupGlobals(appState?: AppState): void {\n ConfiguratorAppContext.init(appState ?? {});\n }\n\n public getApi(): RoomleConfigurator {\n return this._configurator;\n }\n\n protected async bootFinished(): Promise<void> {\n this._configurator = new RoomleConfigurator(this._context);\n this._configurator.getMain = () => {\n return this;\n };\n\n if (!window.RoomleConfigurator) {\n window.RoomleConfigurator = this._configurator;\n }\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.CONFIGURATOR;\n }\n}\n"],"mappings":";;;;AAeA,IAAa,IAA+C;CAC1D,IAAI,EAA8B,UAAU,EAAO;CACnD,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EAA8B,iBAAiB,EAAa;CAChE,IAAI,EAA8B,qBAAqB,EAAgB;CACvE,IAAI,EAA8B,kBAAkB,EAAc;CAClE,IAAI,EAA8B,oBAAoB,EAAe;CACrE,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EACF,8BACA,GACA,EAAQ,QACT;CACD,IAAI,EACF,2BACA,GACA,EAAQ,QACT;CACD,IAAI,EACF,4BACA,GACA,EAAQ,OACT;CACF,ECvBY,IAAb,cAAkC,EAAK;CAGrC,oBAAoC;AAUlC,EATA,EAA0B,MAAM,EAAY,EAEhB,KAAK,OAC/B,yBACA,KAAK,SACN,CACmB,KAAK,EAAY,aAAa,EAClD,KAAK,OAAmB,eAAe,KAAK,SAAS,EACrD,KAAK,OAAqB,iBAAiB,KAAK,SAAS,EACzD,KAAK,OAAe,UAAU,KAAK,SAAS;;CAG9C,iBAAiC;AAC/B,SAAO,OAAO;;CAGhB,sBAAsC;EACpC,IAAM,IAAe,KAAK,OAAqB,gBAAgB,EACzD,IAAa,KAAK,OAAmB,cAAc;AACvC,OAAK,OAAkB,aAAa;EAFtD,IAGM,IAAe,KAAK,OACxB,6BACD;AAcD,EAZI,KACF,EAAa,SAAS,EAGpB,KACF,EAAW,SAAS,EAOlB,KACF,EAAa,SAAS;;CAK1B,aAAuB,GAA2B;AAChD,IAAuB,KAAK,KAAY,EAAE,CAAC;;CAG7C,SAAoC;AAClC,SAAO,KAAK;;CAGd,MAAgB,eAA8B;AAM5C,EALA,KAAK,gBAAgB,IAAI,EAAmB,KAAK,SAAS,EAC1D,KAAK,cAAc,gBACV,MAGJ,OAAO,uBACV,OAAO,qBAAqB,KAAK;;CAIrC,iBAAmC;AACjC,SAAO,EAAa"}
1
+ {"version":3,"file":"configurator-CVg8_f9w.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/injectables.ts","../../packages/configurator-core/src/configurator.ts"],"sourcesContent":["import CameraControl from '../../../common-core/src/cameracontrol/camera-control';\nimport CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\nimport Logger from '../../../common-core/src/logger';\nimport DataSyncer from '../../../common-core/src/services/data-syncer';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport ComponentRaycastHelper from './component-raycast-helper';\nimport ConfiguratorSceneManager from '../webgl/configurator-scene-manager';\nimport ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport GlobalInitData from '../../../common-core/src/utils/global-init-data';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment('camera-control-3d', CameraControl3D),\n new DependencyInjectionAssignment('camera-control', CameraControl),\n new DependencyInjectionAssignment('global-init-data', GlobalInitData),\n new DependencyInjectionAssignment('data-syncer', DataSyncer),\n new DependencyInjectionAssignment(\n 'configurator-scene-manager',\n ConfiguratorSceneManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment(\n 'configurator-view-model',\n ConfiguratorViewModel,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment(\n 'component-raycast-helper',\n ComponentRaycastHelper,\n DI_TYPE.GLOBAL,\n ),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type { AppState } from '../../common-core/src/utils/app-context';\nimport ConfiguratorAppContext from '../../common-core/src/utils/app-context';\nimport { INJECTABLES } from './utils/injectables';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport type ScriptLoader from '../../common-core/src/script-loader';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type Logger from '../../common-core/src/logger';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport type ConfiguratorSceneManager from './webgl/configurator-scene-manager';\nimport { RoomleConfigurator } from './roomle-configurator';\nimport type PlannerKernelAccess from '../../planner-core/src/services/planner-kernel-access';\nimport { KERNEL_TYPE } from '../../common-core/src/services/common-kernel-access';\n\nexport class Configurator extends Main {\n private _configurator: RoomleConfigurator;\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n // This needs to be done so that subscribe to events is done\n const plannerKernelAccess = this.lookup<PlannerKernelAccess>(\n 'planner-kernel-access',\n this._context,\n );\n plannerKernelAccess.init(KERNEL_TYPE.CONFIGURATOR);\n this.lookup<RapiAccess>('rapi-access', this._context);\n this.lookup<ScriptLoader>('script-loader', this._context);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n delete window.RoomleConfigurator;\n }\n\n protected cleanUpDependencies(): void {\n const scriptLoader = this.lookup<ScriptLoader>('script-loader');\n const rapiAccess = this.lookup<RapiAccess>('rapi-access');\n const domHelper = this.lookup<DomHelper>('dom-helper');\n const sceneManager = this.lookup<ConfiguratorSceneManager>(\n 'configurator-scene-manager',\n );\n\n if (scriptLoader) {\n scriptLoader.cleanUp();\n }\n\n if (rapiAccess) {\n rapiAccess.cleanUp();\n }\n\n if (domHelper) {\n //domHelper.cleanUp();\n }\n\n if (sceneManager) {\n sceneManager.cleanUp();\n }\n }\n\n /** Currently the only module that uses AppState — all others ignore the parameter. */\n protected setupGlobals(appState?: AppState): void {\n ConfiguratorAppContext.init(appState ?? {});\n }\n\n public getApi(): RoomleConfigurator {\n return this._configurator;\n }\n\n protected async bootFinished(): Promise<void> {\n this._configurator = new RoomleConfigurator(this._context);\n this._configurator.getMain = () => {\n return this;\n };\n\n if (!window.RoomleConfigurator) {\n window.RoomleConfigurator = this._configurator;\n }\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.CONFIGURATOR;\n }\n}\n"],"mappings":";;;;AAeA,IAAa,IAA+C;CAC1D,IAAI,EAA8B,UAAU,EAAO;CACnD,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EAA8B,iBAAiB,EAAa;CAChE,IAAI,EAA8B,qBAAqB,EAAgB;CACvE,IAAI,EAA8B,kBAAkB,EAAc;CAClE,IAAI,EAA8B,oBAAoB,EAAe;CACrE,IAAI,EAA8B,eAAe,EAAW;CAC5D,IAAI,EACF,8BACA,GACA,EAAQ,QACT;CACD,IAAI,EACF,2BACA,GACA,EAAQ,QACT;CACD,IAAI,EACF,4BACA,GACA,EAAQ,OACT;CACF,ECvBY,IAAb,cAAkC,EAAK;CAGrC,oBAAoC;AAUlC,EATA,EAA0B,MAAM,EAAY,EAEhB,KAAK,OAC/B,yBACA,KAAK,SACN,CACmB,KAAK,EAAY,aAAa,EAClD,KAAK,OAAmB,eAAe,KAAK,SAAS,EACrD,KAAK,OAAqB,iBAAiB,KAAK,SAAS,EACzD,KAAK,OAAe,UAAU,KAAK,SAAS;;CAG9C,iBAAiC;AAC/B,SAAO,OAAO;;CAGhB,sBAAsC;EACpC,IAAM,IAAe,KAAK,OAAqB,gBAAgB,EACzD,IAAa,KAAK,OAAmB,cAAc;AACvC,OAAK,OAAkB,aAAa;EAFtD,IAGM,IAAe,KAAK,OACxB,6BACD;AAcD,EAZI,KACF,EAAa,SAAS,EAGpB,KACF,EAAW,SAAS,EAOlB,KACF,EAAa,SAAS;;CAK1B,aAAuB,GAA2B;AAChD,IAAuB,KAAK,KAAY,EAAE,CAAC;;CAG7C,SAAoC;AAClC,SAAO,KAAK;;CAGd,MAAgB,eAA8B;AAM5C,EALA,KAAK,gBAAgB,IAAI,EAAmB,KAAK,SAAS,EAC1D,KAAK,cAAc,gBACV,MAGJ,OAAO,uBACV,OAAO,qBAAqB,KAAK;;CAIrC,iBAAmC;AACjC,SAAO,EAAa"}
@@ -3,8 +3,8 @@ import { Br as n, Ci as r, Ln as i, On as a, f as o, n as s, nt as c, w as l } f
3
3
  import { r as u } from "./three.module-dym6j3lO.mjs";
4
4
  import { n as d, r as f, t as p } from "./decorate-CjaqqbUP.mjs";
5
5
  import { g as m, v as h } from "./common-utils-CyQUubmw.mjs";
6
- import { $ as g, E as _, H as v, I as y, O as b, T as x, V as S, Y as C, ct as w, d as T, g as E, h as D, m as O, n as k, nt as A, ot as j, rt as M, st as N, tt as P } from "./roomle-sdk-Be4K-H8u.mjs";
7
- import { t as F } from "./script-loader-CzikXnNg.mjs";
6
+ import { $ as g, E as _, H as v, I as y, O as b, T as x, V as S, Y as C, ct as w, d as T, g as E, h as D, m as O, n as k, nt as A, ot as j, rt as M, st as N, tt as P } from "./roomle-sdk-BCmaueGp.mjs";
7
+ import { t as F } from "./script-loader-Dmcvx-Qu.mjs";
8
8
  //#region packages/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.ts
9
9
  var I = class extends x {
10
10
  constructor(...e) {
@@ -342,4 +342,4 @@ var H = class extends y {}, U = [
342
342
  //#endregion
343
343
  export { V as n, W as t };
344
344
 
345
- //# sourceMappingURL=glb-viewer-DMg1tKfk.mjs.map
345
+ //# sourceMappingURL=glb-viewer-Csx9GwVi.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"glb-viewer-DMg1tKfk.mjs","names":[],"sources":["../../packages/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-light-setting.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-scene-manager.ts","../../packages/glb-viewer-core/src/services/glb-render-worker.ts","../../../../node_modules/jszip/dist/jszip.min.js?no-inline?url","../../packages/glb-viewer-core/src/roomle-glb-viewer.ts","../../packages/glb-viewer-core/src/input/glb-input-manager.ts","../../packages/glb-viewer-core/src/utils/injectables.ts","../../packages/glb-viewer-core/src/glb-viewer.ts"],"sourcesContent":["import CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport { Box3, Euler, Quaternion, Vector3 } from 'three';\n\nexport default class AdjustableCameraControl3D extends CameraControl3D {\n public shouldIgnoreStandardBehavior = false;\n\n public adjust(\n bounds: Vector3,\n position: Vector3,\n\n yaw: number,\n pitch: number,\n _fov: number,\n ) {\n let minVector: Vector3 = new Vector3(-bounds.x / 2, 0, -bounds.z / 2);\n let maxVector: Vector3 = new Vector3(bounds.x / 2, bounds.y, bounds.z / 2);\n this._boundingBox = new Box3(minVector, maxVector);\n\n // before applying attis pitch value with have to rotate down, because we assume that attis rotation is upwards\n let euler = new Euler(-Math.PI / 2 + pitch, yaw, 0, 'ZYX');\n let quaternion = new Quaternion().setFromEuler(euler);\n\n this._camera.updateProjectionMatrix();\n\n this._camera.quaternion.copy(quaternion);\n this._camera.position.copy(position);\n }\n\n protected _update(overrideTarget?: Vector3) {\n if (!this.shouldIgnoreStandardBehavior) {\n super._update(overrideTarget);\n } else {\n this._saveYawAndPitch();\n }\n }\n\n public animateCamera(delta: number): boolean {\n if (!this.shouldIgnoreStandardBehavior) {\n return super.animateCamera(delta);\n } else {\n return true;\n }\n }\n}\n","import LightSetting from '../../../common-core/src/lightsetting/light-setting';\nimport type { ColorRepresentation, Scene } from 'three';\nimport { AmbientLight, Color } from 'three';\nimport type { GenericGUIParamFolder } from '../../../common-core/src/webgl/gui-types';\n\nexport default class GLBViewerLightSetting extends LightSetting {\n private _ambientLight: AmbientLight;\n\n private _params = {\n ambientLight: {\n color: '#ffffff',\n },\n };\n\n constructor(scene: Scene, oldLightSetting?: LightSetting) {\n super(scene, oldLightSetting);\n\n this._ambientLight = new AmbientLight(\n new Color(this._params.ambientLight.color as ColorRepresentation),\n 0.5,\n );\n\n this.addToScene();\n }\n\n public addToScene(): void {\n this._scene.add(this._ambientLight);\n }\n\n public removeFromScene(): void {\n this._scene.remove(this._ambientLight);\n }\n\n public reload(): void {\n this.removeFromScene();\n this.addToScene();\n }\n\n public showGUI(sceneParameters: GenericGUIParamFolder): void {\n if (this._ambientLight) {\n const ambientLightFolder = sceneParameters.addFolder('Ambient Light');\n ambientLightFolder.add(this._ambientLight, 'visible');\n ambientLightFolder\n .add(this._ambientLight, 'intensity')\n .min(0)\n .max(5)\n .step(0.1);\n ambientLightFolder\n .addColor(this._params.ambientLight, 'color')\n .onChange((color: string) => {\n this._ambientLight.color = new Color(color as ColorRepresentation);\n });\n }\n }\n}\n","import SceneManager from '../../../common-core/src/webgl/scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n} from '../../../common-core/src/common-interfaces';\nimport AdjustableCameraControl3D from '../camera-control/adjustable-camera-control-3d';\nimport type { GLBRenderWorkerListener } from '../services/glb-render-worker';\nimport type InputManager from '../../../common-core/src/input/input-manager';\nimport inject from '../../../common-core/src/di/inject';\nimport type GlbInputManager from '../input/glb-input-manager';\n\nimport DefaultLightSetting from '../../../configurator-core/src/webgl/lightsetting/default-light-setting';\nimport ImageRenderer, {\n type PrepareImageOptions,\n} from '../../../common-core/src/webgl/image-renderer';\nimport { CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';\nimport { toDegrees } from '../../../common-core/src/utils/math-helper';\nimport { dispose } from '../../../common-core/src/utils/threejs-utils';\nimport { type RapiAccess } from '../../../common-core/src/rapi-access';\nimport { getGlbUrl } from '../../../common-core/src/utils/common-utils';\nimport { CANVAS_ID } from '../../../common-core/src/utils/dom-helper';\nimport type { Enumify } from '#/common/src/utils/types';\nimport {\n BasicShadowMap,\n Box3,\n type Color,\n type Object3D,\n PerspectiveCamera,\n SRGBColorSpace,\n Vector3,\n WebGLRenderer,\n} from 'three';\nimport DynamicLightSettingLoader, {\n PREDEFINED_LIGHTSETTING,\n} from '../../../common-core/src/lightsetting/dynamic-light-setting-loader';\nimport GLBViewerLightSetting from './glb-viewer-light-setting';\nimport GlbViewerCameraBehaviour from '../../../common-core/src/cameracontrol/glb-viewer-camera-behaviour';\nimport {\n CAMERA_EVENT,\n type CameraParameter,\n} from '../../../common-core/src/cameracontrol/camera-control';\n\nexport default class GLBViewerSceneManager\n extends SceneManager\n implements GLBRenderWorkerListener\n{\n @inject\n private _glbInputManager: GlbInputManager;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n private _currentGLB: Object3D | null;\n private _standardSceneBackgroundColor: Color;\n\n private _itemsCount = 0;\n\n constructor(creator: string, offset: CanvasOffset) {\n super(creator, offset, CANVAS_ID.GLB, CAMERA_TYPE.CAMERA_3D);\n this._standardSceneBackgroundColor = this._scene.background as Color;\n if (this._initData.legacyLight && this._renderer instanceof WebGLRenderer) {\n if (this._renderer.capabilities.maxTextures > 8) {\n const lightSource =\n DynamicLightSettingLoader.createDynamicLightSettingSource(\n null,\n PREDEFINED_LIGHTSETTING.CAMERA,\n );\n if (lightSource) {\n this.loadDynamicLightSetting(lightSource);\n }\n } else {\n console.warn(\n 'this device has a maximum of 8 texture units thus we are using a simpler light setting',\n );\n this._lightSetting = new GLBViewerLightSetting(this._scene);\n }\n }\n }\n\n protected createCameraControl(\n _mode: Enumify<typeof CAMERA_TYPE>,\n _offset: CanvasOffset,\n ) {\n this._changeCameraBehaviour(\n new GlbViewerCameraBehaviour(\n new AdjustableCameraControl3D(\n this._creator_,\n this._getInputManager(),\n undefined,\n ),\n this._cameraBehaviourState,\n ),\n );\n }\n\n protected _getInputManager(): InputManager {\n return this._glbInputManager;\n }\n\n public async loadStaticItem(\n id: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n const rapiItem = await this._rapiAccess.getItem(id);\n if (rapiItem.configuration) {\n return Promise.reject();\n }\n const glbUrl = getGlbUrl(rapiItem);\n if (!glbUrl) {\n return Promise.reject(new Error('GLB Url not detected'));\n }\n return this.loadGLB(glbUrl, true, undefined, callback);\n }\n\n public loadGLB(\n url: string,\n automaticallyAdjustCamera: boolean = true,\n scaling: Vector3 = new Vector3(1, 1, 1),\n callback?: (percent: number) => void,\n ): Promise<void> {\n this.clearScene();\n return new Promise<void>((resolve, reject) => {\n this._loadGLB(\n url,\n new Vector3(0, 0, 0),\n 0,\n undefined,\n scaling,\n undefined,\n undefined,\n callback,\n ).then((glb) => {\n this._currentGLB = glb;\n this._scene.add(this._currentGLB);\n\n let boundingBox = new Box3().setFromObject(this._currentGLB);\n if (automaticallyAdjustCamera) {\n if (\n this.cameraBehaviour.cameraControl instanceof\n AdjustableCameraControl3D\n ) {\n this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(boundingBox);\n }\n }\n this._updateBounds(boundingBox, undefined, true);\n this._readyForRender();\n resolve();\n }, reject);\n });\n }\n\n public preparePerspectiveImage(\n options: PrepareImageOptions = {},\n providedRenderer?: WebGLRenderer,\n ): Promise<Base64Image> {\n if (!providedRenderer && this._initData.webGpu) {\n return this._prepareWebGpuPerspectiveImage(options);\n }\n\n // When a renderer is supplied (e.g. by GLBRenderWorker for a batched\n // thumbnail run), use its existing size; otherwise build a fresh\n // offscreen renderer sized off `options.size`.\n let renderer: WebGLRenderer;\n let width: number;\n let height: number;\n if (providedRenderer) {\n renderer = providedRenderer;\n width = renderer.domElement.width;\n height = renderer.domElement.height;\n } else {\n const size = options.size ?? 1000;\n width = size;\n height = size;\n renderer = new WebGLRenderer({ antialias: true });\n renderer.setSize(width, height);\n renderer.outputColorSpace = SRGBColorSpace;\n renderer.autoClear = false;\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = BasicShadowMap;\n }\n\n return new Promise<Base64Image>((resolve, reject) => {\n const camera = this.cameraBehaviour.cameraControl.getCamera().clone();\n if (camera instanceof PerspectiveCamera) {\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n }\n\n // Deterministic framing on the loaded GLB's bounds — avoids any\n // dependency on the live camera state, which may still be tweening\n // toward the new model when this method is called.\n const bounds = this.getBounds();\n if (bounds && camera instanceof PerspectiveCamera) {\n const cameraTarget = ImageRenderer.getCameraTargetForBBox(bounds);\n const angleY = -30 + toDegrees(options.rotationY ?? 0);\n ImageRenderer.placeCameraForPerspectiveImage(\n camera,\n cameraTarget,\n -20,\n angleY,\n );\n }\n\n this._lightSetting?.removeFromScene();\n const defaultLightSetting = new DefaultLightSetting(this._scene);\n\n // Honor preserveSceneBackground symmetrically with ImageRenderer:\n // null background+fog when stripping was requested. Default for the\n // GLB viewer is to keep the scene's existing background visible.\n const preserveSceneBackground = options.preserveSceneBackground ?? true;\n const savedFog = this._scene.fog;\n const savedBackground = this._scene.background;\n let image: string;\n try {\n if (!preserveSceneBackground) {\n this._scene.background = null;\n this._scene.fog = null;\n }\n renderer.render(this._scene, camera);\n image = renderer.domElement.toDataURL();\n } finally {\n // Restore mutated scene state regardless of success/failure so a\n // throw in render() / toDataURL() can't leave the scene with a\n // null background for the rest of the session.\n if (!preserveSceneBackground) {\n this._scene.background = savedBackground;\n this._scene.fog = savedFog;\n }\n defaultLightSetting.removeFromScene();\n this._lightSetting?.addToScene();\n }\n\n renderer.domElement.toBlob((blob) => {\n if (blob === null) {\n reject(new Error('Failed to create blob from canvas'));\n return;\n }\n resolve({ image, width, height, blob });\n }, 'image/png');\n });\n }\n\n private async _prepareWebGpuPerspectiveImage(\n options: PrepareImageOptions,\n ): Promise<Base64Image> {\n const camera = this.cameraBehaviour.cameraControl.getCamera().clone();\n const bounds = this.getBounds();\n const cameraTarget =\n bounds && camera instanceof PerspectiveCamera\n ? ImageRenderer.getCameraTargetForBBox(bounds)\n : undefined;\n\n this._lightSetting?.removeFromScene();\n const defaultLightSetting = new DefaultLightSetting(this._scene);\n try {\n return await this._imageRenderer.preparePerspectiveImage(\n this._scene,\n camera as PerspectiveCamera,\n cameraTarget,\n {\n ...options,\n preserveSceneBackground: options.preserveSceneBackground ?? true,\n },\n );\n } finally {\n defaultLightSetting.removeFromScene();\n this._lightSetting?.addToScene();\n }\n }\n\n public adjustCamera(\n position: Vector3,\n yaw: number,\n pitch: number,\n fov: number,\n ) {\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n let boundingBox = new Box3().setFromObject(this._scene);\n let bounds = boundingBox.getSize(new Vector3());\n (this.cameraBehaviour.cameraControl as AdjustableCameraControl3D).adjust(\n bounds,\n position,\n yaw,\n pitch,\n fov,\n );\n this._requestRender();\n }\n }\n\n public onStart(count: number) {\n this._itemsCount = count;\n this._scene.background = null;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = true;\n }\n console.log('start processing ' + count + ' items');\n }\n\n public onElementFinished(itemsFinished: number) {\n console.log(\n 'processed ' +\n itemsFinished +\n ' of ' +\n this._itemsCount +\n ' items (' +\n Math.round((100 / this._itemsCount) * itemsFinished) +\n '%)',\n );\n }\n\n public onFinished(_zip: any) {\n this._scene.background = this._standardSceneBackgroundColor;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = false;\n }\n }\n\n public clearScene() {\n if (this._currentGLB) {\n this._scene.remove(this._currentGLB);\n dispose(this._currentGLB);\n this._currentGLB = null;\n }\n super.clearScene();\n }\n\n public enableHD() {\n super.enableHD();\n }\n\n public sceneChanged(): void {\n //override when needed\n }\n\n getBounds(): Box3 | null {\n if (!this._currentGLB) {\n return null;\n }\n return new Box3().setFromObject(this._currentGLB);\n }\n\n protected get glbViewerCameraBehaviour(): GlbViewerCameraBehaviour {\n return this.cameraBehaviour as GlbViewerCameraBehaviour;\n }\n\n getGeometryBounds(): Box3 | null {\n return null;\n }\n\n cameraBehaviourChanged(updateDistance: boolean = true) {\n super.cameraBehaviourChanged(updateDistance);\n\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_IN,\n () => {\n this._requestRender();\n },\n this,\n );\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_OUT,\n () => {\n this._requestRender();\n },\n this,\n );\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this.glbViewerCameraBehaviour.externalApiMoveCamera(cameraParameter);\n }\n\n // info when scene is ready to render, used for testing\n protected _readyForRender() {\n console.log('ready_for_render');\n this._globalCallback.onReadyForRender();\n }\n}\n","import type { Base64Image } from '../../../common-core/src/common-interfaces';\nimport type GLBViewerSceneManager from '../webgl/glb-viewer-scene-manager';\nimport type { RenderEntry } from '../roomle-glb-viewer';\nimport { SRGBColorSpace, Vector3, WebGLRenderer } from 'three';\n\ninterface GLBRenderEntry {\n name: string;\n url: string;\n position: Vector3;\n fov: number;\n yaw: number;\n pitch: number;\n}\n\nexport interface GLBRenderWorkerListener {\n onStart(count: number): void;\n\n onElementFinished(finishedElements: number): void;\n\n onFinished(zip: any): void;\n}\n\nexport default class GLBRenderWorker {\n private _sceneManager: GLBViewerSceneManager;\n private _entries: GLBRenderEntry[];\n\n private _resolve: (zip: any) => void;\n\n private _prefix = 'https://furniture.roomle.com/3d/glb/';\n\n private _renderer: WebGLRenderer;\n private _width: number;\n private _height: number;\n\n private _listeners: Set<GLBRenderWorkerListener> =\n new Set<GLBRenderWorkerListener>();\n private _finishedItems: number = 0;\n\n private _zip: any;\n\n constructor(\n sceneManager: GLBViewerSceneManager,\n width: number,\n height: number,\n ) {\n this._sceneManager = sceneManager;\n\n this._renderer = new WebGLRenderer({ antialias: true, alpha: true });\n this._width = width;\n this._height = height;\n this._renderer.setSize(width, height);\n this._renderer.setClearColor(0xffffff, 0);\n this._renderer.outputColorSpace = SRGBColorSpace;\n }\n\n public addListener(listener: GLBRenderWorkerListener) {\n this._listeners.add(listener);\n }\n\n public removeListener(listener: GLBRenderWorkerListener) {\n this._listeners.delete(listener);\n }\n\n public start(entries: RenderEntry[]): Promise<any> {\n this._entries = [];\n entries.forEach((entry) => {\n this._entries.push(this._transform(entry)); // {name: url.replace('.glb', '.png'), url: this._prefix + url}\n });\n this._finishedItems = 0;\n this._listeners.forEach((listener) =>\n listener.onStart(this._entries.length),\n );\n this._zip = new (window as any).JSZip();\n this._doNextEntry();\n return new Promise<any>((resolve) => {\n this._resolve = resolve;\n });\n }\n\n private _transform(entry: RenderEntry): GLBRenderEntry {\n return {\n name: entry.path.replace('.glb', '.png'),\n url: this._prefix + entry.path,\n position: new Vector3(\n entry.camera.position.x,\n entry.camera.position.z,\n -entry.camera.position.y,\n ),\n fov: entry.camera.fieldOfView * 2, // * 2 because Atti suggested it after all images were cut on all sides\n yaw: entry.camera.rotation.z,\n pitch: entry.camera.rotation.x,\n };\n }\n\n private _doNextEntry() {\n if (this._entries.length === 0) {\n this._listeners.forEach((listener) => listener.onFinished(this._zip));\n this._resolve(this._zip);\n } else {\n this._processEntry(this._entries[0]);\n }\n }\n\n private _processEntry(entry: GLBRenderEntry) {\n this._sceneManager.loadGLB(entry.url, false, undefined).then(() => {\n this._sceneManager.adjustCamera(\n entry.position,\n entry.yaw,\n entry.pitch,\n entry.fov,\n );\n this._sceneManager\n .preparePerspectiveImage({}, this._renderer)\n .then((base64Image) => {\n this._entryFinished(entry, base64Image);\n });\n });\n }\n\n private _entryFinished(entry: GLBRenderEntry, base64Image: Base64Image) {\n let index = this._entries.indexOf(entry);\n if (index > -1) {\n this._entries.splice(index, 1);\n }\n this._finishedItems++;\n this._listeners.forEach((listener) =>\n listener.onElementFinished(this._finishedItems),\n );\n this._zip.file(entry.name, base64Image.blob);\n this._doNextEntry();\n }\n}\n","export default \"__VITE_ASSET__VRAku6fjghkApIISiBWPzg__\"","import type ScriptLoader from '../../common-core/src/script-loader';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport inject from '../../common-core/src/di/inject';\nimport GLBViewerSceneManager from './webgl/glb-viewer-scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n Position3,\n} from '../../common-core/src/common-interfaces';\nimport GLBRenderWorker from './services/glb-render-worker';\nimport type { ExternalEmbeddable, GlobalAPI } from '../../common-core/src/main';\nimport type { Main } from '../../common-core/src/main';\nimport type { Context } from '../../common-core/src/di/context';\nimport type { LifeCycleManager } from '../../common-core/src/life-cycle-manager';\nimport type { SceneSettings } from '../../common-core/src/scene-settings-loader';\nimport { JS_ZIP_FILE_NAME } from '../../common-core/src/static-files/libs';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport type {\n GlobalInitDataDefinition,\n InitDataDefinition,\n} from '../../common-core/src/utils/shims';\nimport type GlobalInitData from '../../common-core/src/utils/global-init-data';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type { PrepareImageOptions } from '../../common-core/src/webgl/image-renderer';\nimport type UnitFormatter from '../../configurator-core/src/services/unit-formatter';\nimport { download } from '../../common-core/src/utils/common-utils';\nimport type { Scene } from 'three';\nimport { Vector3 } from 'three';\nimport { type IdbManager } from '../../common-core/src/services/idb-manager';\nimport type { CameraParameter } from '../../common-core/src/cameracontrol/camera-control';\nimport type { GlobalCallback } from '../../common-core/src/services/global-callback';\n\ninterface RenderCameraInformation {\n fieldOfView: number;\n rotation: Position3;\n position: Position3;\n}\n\nexport declare interface RenderEntry {\n path: string;\n camera: RenderCameraInformation;\n}\n\nexport class GlbViewerUiCallbacks {}\n\nexport class RoomleGLBViewer\n implements GlobalAPI, Context, ExternalEmbeddable<GlbViewerUiCallbacks>\n{\n public _creator_: string;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n @inject\n private _domHelper: DomHelper;\n\n @inject\n private _scriptLoader: ScriptLoader;\n\n @inject\n private _lifeCycleManager: LifeCycleManager;\n\n @inject\n private _initData: InitData;\n\n @inject\n private _globalInitData: GlobalInitData;\n\n @inject\n private _globalCallback: GlobalCallback;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n @inject\n protected _idbManager: IdbManager;\n\n private _sceneManager: GLBViewerSceneManager;\n\n private _currentIdOrUrl: string | null = null;\n\n constructor(creator: string) {\n this._creator_ = creator;\n }\n\n public setCameraOffset(offset: CanvasOffset): void {\n this._sceneManager.setCameraOffset(offset);\n }\n\n public getCameraOffset(): CanvasOffset {\n return this._sceneManager.getCameraOffset();\n }\n\n public init(\n element: HTMLElement,\n initData?: InitDataDefinition,\n ): Promise<void> {\n this.setOverrides(initData);\n this._domHelper.setDomElement(element);\n\n if (this._sceneManager) {\n this._lifeCycleManager.resume();\n return Promise.resolve();\n }\n\n return new Promise<void>(this._initPromiseCallback.bind(this));\n }\n\n private _initPromiseCallback(resolve: () => void, _reject: () => void) {\n this._sceneManager = new GLBViewerSceneManager(this._creator_, {\n left: 0,\n top: 1,\n right: 1,\n bottom: 0,\n });\n // this.loadGLB('https://furniture.roomle.com/3d/glb/furniture/vitra/41206600/41206600.glb');\n this._sceneManager.enableHD();\n resolve();\n }\n\n public getSceneManager() {\n return this._sceneManager;\n }\n\n /**\n * Remove the current glb from the scene if it exists\n */\n public clearScene() {\n this._sceneManager.clearScene();\n }\n\n /**\n * Loads the GLB from the given URL Param\n * @param url\n * @param scaling defaults to 1\n * @param callback loading percent between 0 and 1\n */\n public loadGLB(\n url: string,\n scaling = 1,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = url;\n this._rapiAccess.trackView(url);\n return this._sceneManager.loadGLB(\n url,\n true,\n new Vector3(scaling, scaling, scaling),\n callback,\n );\n }\n\n /**\n * Loads the glb asset from the static item\n * @param staticItemId\n * @param callback loading percent between 0 and 1\n */\n public loadStaticItem(\n staticItemId: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = staticItemId;\n this._rapiAccess.trackView(staticItemId);\n return this._sceneManager.loadStaticItem(staticItemId, callback);\n }\n\n /**\n * Returns the current item id or url of the loaded object\n */\n public getCurrentId(): string | null {\n return this._currentIdOrUrl;\n }\n\n /**\n * Loads a SceneSettings object, currently it can can contain a light setting definition\n * (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loaderEnvironmentSetting}).\n * @param sceneSettings\n */\n public loadSceneSetting(sceneSettings: SceneSettings): Promise<void> {\n return this._sceneManager.loadSceneSettings(sceneSettings);\n }\n\n public preparePerspectiveImage(\n options: PrepareImageOptions = {},\n ): Promise<Base64Image> {\n return this._sceneManager.preparePerspectiveImage(options);\n }\n\n public processRenderList(\n jsonString: string,\n width: number = 320,\n height: number = 320,\n ) {\n const object = JSON.parse(jsonString);\n this._scriptLoader.fetch(JS_ZIP_FILE_NAME, { id: 'jszip-js' }).then(() => {\n const worker = new GLBRenderWorker(this._sceneManager, width, height);\n worker.addListener(this._sceneManager);\n worker.start(object.items).then((zip: any) => {\n zip.generateAsync({ type: 'blob' }).then((content: File) => {\n download('content.zip', URL.createObjectURL(content));\n worker.removeListener(this._sceneManager);\n });\n });\n });\n }\n\n public setOverrides(\n initData:\n | Partial<InitDataDefinition & GlobalInitDataDefinition>\n | InitData\n | undefined,\n ): void {\n if (!initData) {\n return;\n }\n this._initData.setOverrides(initData);\n this._globalInitData.setOverrides(initData);\n }\n\n public updateSize(): void {\n this._sceneManager.updateCamera();\n }\n\n /**\n * Return the main class which has access to lifecycle events and RapiAccess.\n * Hidden because it's only useful for embedding API.\n * Has to be overridden by main class.\n * @hidden\n */\n public getMain(): Main | undefined {\n return undefined;\n }\n\n public resumeTest(element: HTMLElement) {\n this._domHelper.setDomElement(element);\n this._lifeCycleManager.resume();\n }\n\n public pauseTest() {\n this._lifeCycleManager.pause();\n }\n\n public showGUI() {\n this._sceneManager.showGUI();\n }\n\n public get callbacks() {\n return {};\n }\n\n public getScene(): Scene {\n return this._sceneManager.getScene();\n }\n\n public updateScene(): void {\n this._sceneManager.updateScene();\n }\n\n /**\n * returns unit formatter for formatting input und output values in scene\n */\n public getUnitFormatter(): UnitFormatter {\n return this._unitFormatter;\n }\n\n /**\n * returns manager class to interface with indexedDB storage\n */\n public getStorage(): IdbManager {\n return this._idbManager;\n }\n\n public setEnvironmentMap(params: {\n url?: string;\n intensity?: number;\n rotation?: number;\n maxLightSources?: number;\n }): void {\n const { url, intensity, rotation, maxLightSources } = params;\n this._sceneManager.setEnvironmentMap(\n url,\n intensity,\n rotation,\n maxLightSources,\n );\n }\n\n public exportCanvasScreenshot(quality?: number): Promise<string> {\n return this._sceneManager.exportCanvasScreenshot(quality);\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this._sceneManager.moveCamera(cameraParameter);\n }\n\n /**\n * @internal\n * Use this callbacks to hook in your functionality\n */\n public get globalCallbacks(): GlobalCallback {\n return this._globalCallback;\n }\n}\n","import InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class GlbInputManager extends InputManager {\n //move on, nothing to see here\n}\n","import Logger from '../../../common-core/src/logger';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport GlbInputManager from '../input/glb-input-manager';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'glb-input-manager',\n GlbInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type Logger from '../../common-core/src/logger';\nimport { INJECTABLES } from './utils/injectables';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { RoomleGLBViewer } from './roomle-glb-viewer';\n\nexport class GlbViewer extends Main {\n private _viewer: RoomleGLBViewer;\n\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._viewer = new RoomleGLBViewer(this._context);\n\n if (!window.RoomleGLBViewer) {\n window.RoomleGLBViewer = this._viewer;\n }\n }\n\n public getApi(): RoomleGLBViewer {\n return this._viewer;\n }\n\n protected getContextName():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8B,eAAe,EAAA;CAClD,ECXY,IAAb,cAA+B,EAAK;CAGlC,eAA+B;CAI/B,oBAAoC;AAElC,EADA,EAA0B,MAAM,EAAY,EAC5C,KAAK,OAAe,UAAU,KAAK,SAAS;;CAG9C,iBAAiC;AAC/B,QAAU,MAAM,0BAA0B;;CAG5C,sBAAsC;AACpC,QAAU,MAAM,0BAA0B;;CAG5C,MAAgB,eAA8B;AAG5C,EAFA,KAAK,UAAU,IAAI,EAAgB,KAAK,SAAS,EAE5C,OAAO,oBACV,OAAO,kBAAkB,KAAK;;CAIlC,SAAiC;AAC/B,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
1
+ {"version":3,"file":"glb-viewer-Csx9GwVi.mjs","names":[],"sources":["../../packages/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-light-setting.ts","../../packages/glb-viewer-core/src/webgl/glb-viewer-scene-manager.ts","../../packages/glb-viewer-core/src/services/glb-render-worker.ts","../../../../node_modules/jszip/dist/jszip.min.js?no-inline?url","../../packages/glb-viewer-core/src/roomle-glb-viewer.ts","../../packages/glb-viewer-core/src/input/glb-input-manager.ts","../../packages/glb-viewer-core/src/utils/injectables.ts","../../packages/glb-viewer-core/src/glb-viewer.ts"],"sourcesContent":["import CameraControl3D from '../../../common-core/src/cameracontrol/camera-control-3d';\nimport { Box3, Euler, Quaternion, Vector3 } from 'three';\n\nexport default class AdjustableCameraControl3D extends CameraControl3D {\n public shouldIgnoreStandardBehavior = false;\n\n public adjust(\n bounds: Vector3,\n position: Vector3,\n\n yaw: number,\n pitch: number,\n _fov: number,\n ) {\n let minVector: Vector3 = new Vector3(-bounds.x / 2, 0, -bounds.z / 2);\n let maxVector: Vector3 = new Vector3(bounds.x / 2, bounds.y, bounds.z / 2);\n this._boundingBox = new Box3(minVector, maxVector);\n\n // before applying attis pitch value with have to rotate down, because we assume that attis rotation is upwards\n let euler = new Euler(-Math.PI / 2 + pitch, yaw, 0, 'ZYX');\n let quaternion = new Quaternion().setFromEuler(euler);\n\n this._camera.updateProjectionMatrix();\n\n this._camera.quaternion.copy(quaternion);\n this._camera.position.copy(position);\n }\n\n protected _update(overrideTarget?: Vector3) {\n if (!this.shouldIgnoreStandardBehavior) {\n super._update(overrideTarget);\n } else {\n this._saveYawAndPitch();\n }\n }\n\n public animateCamera(delta: number): boolean {\n if (!this.shouldIgnoreStandardBehavior) {\n return super.animateCamera(delta);\n } else {\n return true;\n }\n }\n}\n","import LightSetting from '../../../common-core/src/lightsetting/light-setting';\nimport type { ColorRepresentation, Scene } from 'three';\nimport { AmbientLight, Color } from 'three';\nimport type { GenericGUIParamFolder } from '../../../common-core/src/webgl/gui-types';\n\nexport default class GLBViewerLightSetting extends LightSetting {\n private _ambientLight: AmbientLight;\n\n private _params = {\n ambientLight: {\n color: '#ffffff',\n },\n };\n\n constructor(scene: Scene, oldLightSetting?: LightSetting) {\n super(scene, oldLightSetting);\n\n this._ambientLight = new AmbientLight(\n new Color(this._params.ambientLight.color as ColorRepresentation),\n 0.5,\n );\n\n this.addToScene();\n }\n\n public addToScene(): void {\n this._scene.add(this._ambientLight);\n }\n\n public removeFromScene(): void {\n this._scene.remove(this._ambientLight);\n }\n\n public reload(): void {\n this.removeFromScene();\n this.addToScene();\n }\n\n public showGUI(sceneParameters: GenericGUIParamFolder): void {\n if (this._ambientLight) {\n const ambientLightFolder = sceneParameters.addFolder('Ambient Light');\n ambientLightFolder.add(this._ambientLight, 'visible');\n ambientLightFolder\n .add(this._ambientLight, 'intensity')\n .min(0)\n .max(5)\n .step(0.1);\n ambientLightFolder\n .addColor(this._params.ambientLight, 'color')\n .onChange((color: string) => {\n this._ambientLight.color = new Color(color as ColorRepresentation);\n });\n }\n }\n}\n","import SceneManager from '../../../common-core/src/webgl/scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n} from '../../../common-core/src/common-interfaces';\nimport AdjustableCameraControl3D from '../camera-control/adjustable-camera-control-3d';\nimport type { GLBRenderWorkerListener } from '../services/glb-render-worker';\nimport type InputManager from '../../../common-core/src/input/input-manager';\nimport inject from '../../../common-core/src/di/inject';\nimport type GlbInputManager from '../input/glb-input-manager';\n\nimport DefaultLightSetting from '../../../configurator-core/src/webgl/lightsetting/default-light-setting';\nimport ImageRenderer, {\n type PrepareImageOptions,\n} from '../../../common-core/src/webgl/image-renderer';\nimport { CAMERA_TYPE } from '../../../common-core/src/cameracontrol/camera-type';\nimport { toDegrees } from '../../../common-core/src/utils/math-helper';\nimport { dispose } from '../../../common-core/src/utils/threejs-utils';\nimport { type RapiAccess } from '../../../common-core/src/rapi-access';\nimport { getGlbUrl } from '../../../common-core/src/utils/common-utils';\nimport { CANVAS_ID } from '../../../common-core/src/utils/dom-helper';\nimport type { Enumify } from '#/common/src/utils/types';\nimport {\n BasicShadowMap,\n Box3,\n type Color,\n type Object3D,\n PerspectiveCamera,\n SRGBColorSpace,\n Vector3,\n WebGLRenderer,\n} from 'three';\nimport DynamicLightSettingLoader, {\n PREDEFINED_LIGHTSETTING,\n} from '../../../common-core/src/lightsetting/dynamic-light-setting-loader';\nimport GLBViewerLightSetting from './glb-viewer-light-setting';\nimport GlbViewerCameraBehaviour from '../../../common-core/src/cameracontrol/glb-viewer-camera-behaviour';\nimport {\n CAMERA_EVENT,\n type CameraParameter,\n} from '../../../common-core/src/cameracontrol/camera-control';\n\nexport default class GLBViewerSceneManager\n extends SceneManager\n implements GLBRenderWorkerListener\n{\n @inject\n private _glbInputManager: GlbInputManager;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n private _currentGLB: Object3D | null;\n private _standardSceneBackgroundColor: Color;\n\n private _itemsCount = 0;\n\n constructor(creator: string, offset: CanvasOffset) {\n super(creator, offset, CANVAS_ID.GLB, CAMERA_TYPE.CAMERA_3D);\n this._standardSceneBackgroundColor = this._scene.background as Color;\n if (this._initData.legacyLight && this._renderer instanceof WebGLRenderer) {\n if (this._renderer.capabilities.maxTextures > 8) {\n const lightSource =\n DynamicLightSettingLoader.createDynamicLightSettingSource(\n null,\n PREDEFINED_LIGHTSETTING.CAMERA,\n );\n if (lightSource) {\n this.loadDynamicLightSetting(lightSource);\n }\n } else {\n console.warn(\n 'this device has a maximum of 8 texture units thus we are using a simpler light setting',\n );\n this._lightSetting = new GLBViewerLightSetting(this._scene);\n }\n }\n }\n\n protected createCameraControl(\n _mode: Enumify<typeof CAMERA_TYPE>,\n _offset: CanvasOffset,\n ) {\n this._changeCameraBehaviour(\n new GlbViewerCameraBehaviour(\n new AdjustableCameraControl3D(\n this._creator_,\n this._getInputManager(),\n undefined,\n ),\n this._cameraBehaviourState,\n ),\n );\n }\n\n protected _getInputManager(): InputManager {\n return this._glbInputManager;\n }\n\n public async loadStaticItem(\n id: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n const rapiItem = await this._rapiAccess.getItem(id);\n if (rapiItem.configuration) {\n return Promise.reject();\n }\n const glbUrl = getGlbUrl(rapiItem);\n if (!glbUrl) {\n return Promise.reject(new Error('GLB Url not detected'));\n }\n return this.loadGLB(glbUrl, true, undefined, callback);\n }\n\n public loadGLB(\n url: string,\n automaticallyAdjustCamera: boolean = true,\n scaling: Vector3 = new Vector3(1, 1, 1),\n callback?: (percent: number) => void,\n ): Promise<void> {\n this.clearScene();\n return new Promise<void>((resolve, reject) => {\n this._loadGLB(\n url,\n new Vector3(0, 0, 0),\n 0,\n undefined,\n scaling,\n undefined,\n undefined,\n callback,\n ).then((glb) => {\n this._currentGLB = glb;\n this._scene.add(this._currentGLB);\n\n let boundingBox = new Box3().setFromObject(this._currentGLB);\n if (automaticallyAdjustCamera) {\n if (\n this.cameraBehaviour.cameraControl instanceof\n AdjustableCameraControl3D\n ) {\n this.glbViewerCameraBehaviour.updateCameraOnItemLoaded(boundingBox);\n }\n }\n this._updateBounds(boundingBox, undefined, true);\n this._readyForRender();\n resolve();\n }, reject);\n });\n }\n\n public preparePerspectiveImage(\n options: PrepareImageOptions = {},\n providedRenderer?: WebGLRenderer,\n ): Promise<Base64Image> {\n if (!providedRenderer && this._initData.webGpu) {\n return this._prepareWebGpuPerspectiveImage(options);\n }\n\n // When a renderer is supplied (e.g. by GLBRenderWorker for a batched\n // thumbnail run), use its existing size; otherwise build a fresh\n // offscreen renderer sized off `options.size`.\n let renderer: WebGLRenderer;\n let width: number;\n let height: number;\n if (providedRenderer) {\n renderer = providedRenderer;\n width = renderer.domElement.width;\n height = renderer.domElement.height;\n } else {\n const size = options.size ?? 1000;\n width = size;\n height = size;\n renderer = new WebGLRenderer({ antialias: true });\n renderer.setSize(width, height);\n renderer.outputColorSpace = SRGBColorSpace;\n renderer.autoClear = false;\n renderer.shadowMap.enabled = true;\n renderer.shadowMap.type = BasicShadowMap;\n }\n\n return new Promise<Base64Image>((resolve, reject) => {\n const camera = this.cameraBehaviour.cameraControl.getCamera().clone();\n if (camera instanceof PerspectiveCamera) {\n camera.aspect = width / height;\n camera.updateProjectionMatrix();\n }\n\n // Deterministic framing on the loaded GLB's bounds — avoids any\n // dependency on the live camera state, which may still be tweening\n // toward the new model when this method is called.\n const bounds = this.getBounds();\n if (bounds && camera instanceof PerspectiveCamera) {\n const cameraTarget = ImageRenderer.getCameraTargetForBBox(bounds);\n const angleY = -30 + toDegrees(options.rotationY ?? 0);\n ImageRenderer.placeCameraForPerspectiveImage(\n camera,\n cameraTarget,\n -20,\n angleY,\n );\n }\n\n this._lightSetting?.removeFromScene();\n const defaultLightSetting = new DefaultLightSetting(this._scene);\n\n // Honor preserveSceneBackground symmetrically with ImageRenderer:\n // null background+fog when stripping was requested. Default for the\n // GLB viewer is to keep the scene's existing background visible.\n const preserveSceneBackground = options.preserveSceneBackground ?? true;\n const savedFog = this._scene.fog;\n const savedBackground = this._scene.background;\n let image: string;\n try {\n if (!preserveSceneBackground) {\n this._scene.background = null;\n this._scene.fog = null;\n }\n renderer.render(this._scene, camera);\n image = renderer.domElement.toDataURL();\n } finally {\n // Restore mutated scene state regardless of success/failure so a\n // throw in render() / toDataURL() can't leave the scene with a\n // null background for the rest of the session.\n if (!preserveSceneBackground) {\n this._scene.background = savedBackground;\n this._scene.fog = savedFog;\n }\n defaultLightSetting.removeFromScene();\n this._lightSetting?.addToScene();\n }\n\n renderer.domElement.toBlob((blob) => {\n if (blob === null) {\n reject(new Error('Failed to create blob from canvas'));\n return;\n }\n resolve({ image, width, height, blob });\n }, 'image/png');\n });\n }\n\n private async _prepareWebGpuPerspectiveImage(\n options: PrepareImageOptions,\n ): Promise<Base64Image> {\n const camera = this.cameraBehaviour.cameraControl.getCamera().clone();\n const bounds = this.getBounds();\n const cameraTarget =\n bounds && camera instanceof PerspectiveCamera\n ? ImageRenderer.getCameraTargetForBBox(bounds)\n : undefined;\n\n this._lightSetting?.removeFromScene();\n const defaultLightSetting = new DefaultLightSetting(this._scene);\n try {\n return await this._imageRenderer.preparePerspectiveImage(\n this._scene,\n camera as PerspectiveCamera,\n cameraTarget,\n {\n ...options,\n preserveSceneBackground: options.preserveSceneBackground ?? true,\n },\n );\n } finally {\n defaultLightSetting.removeFromScene();\n this._lightSetting?.addToScene();\n }\n }\n\n public adjustCamera(\n position: Vector3,\n yaw: number,\n pitch: number,\n fov: number,\n ) {\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n let boundingBox = new Box3().setFromObject(this._scene);\n let bounds = boundingBox.getSize(new Vector3());\n (this.cameraBehaviour.cameraControl as AdjustableCameraControl3D).adjust(\n bounds,\n position,\n yaw,\n pitch,\n fov,\n );\n this._requestRender();\n }\n }\n\n public onStart(count: number) {\n this._itemsCount = count;\n this._scene.background = null;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = true;\n }\n console.log('start processing ' + count + ' items');\n }\n\n public onElementFinished(itemsFinished: number) {\n console.log(\n 'processed ' +\n itemsFinished +\n ' of ' +\n this._itemsCount +\n ' items (' +\n Math.round((100 / this._itemsCount) * itemsFinished) +\n '%)',\n );\n }\n\n public onFinished(_zip: any) {\n this._scene.background = this._standardSceneBackgroundColor;\n if (\n this.cameraBehaviour.cameraControl instanceof AdjustableCameraControl3D\n ) {\n (\n this.cameraBehaviour.cameraControl as AdjustableCameraControl3D\n ).shouldIgnoreStandardBehavior = false;\n }\n }\n\n public clearScene() {\n if (this._currentGLB) {\n this._scene.remove(this._currentGLB);\n dispose(this._currentGLB);\n this._currentGLB = null;\n }\n super.clearScene();\n }\n\n public enableHD() {\n super.enableHD();\n }\n\n public sceneChanged(): void {\n //override when needed\n }\n\n getBounds(): Box3 | null {\n if (!this._currentGLB) {\n return null;\n }\n return new Box3().setFromObject(this._currentGLB);\n }\n\n protected get glbViewerCameraBehaviour(): GlbViewerCameraBehaviour {\n return this.cameraBehaviour as GlbViewerCameraBehaviour;\n }\n\n getGeometryBounds(): Box3 | null {\n return null;\n }\n\n cameraBehaviourChanged(updateDistance: boolean = true) {\n super.cameraBehaviourChanged(updateDistance);\n\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_IN,\n () => {\n this._requestRender();\n },\n this,\n );\n this.cameraBehaviour.cameraControl.addEventListener(\n CAMERA_EVENT.ZOOM_OUT,\n () => {\n this._requestRender();\n },\n this,\n );\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this.glbViewerCameraBehaviour.externalApiMoveCamera(cameraParameter);\n }\n\n // info when scene is ready to render, used for testing\n protected _readyForRender() {\n console.log('ready_for_render');\n this._globalCallback.onReadyForRender();\n }\n}\n","import type { Base64Image } from '../../../common-core/src/common-interfaces';\nimport type GLBViewerSceneManager from '../webgl/glb-viewer-scene-manager';\nimport type { RenderEntry } from '../roomle-glb-viewer';\nimport { SRGBColorSpace, Vector3, WebGLRenderer } from 'three';\n\ninterface GLBRenderEntry {\n name: string;\n url: string;\n position: Vector3;\n fov: number;\n yaw: number;\n pitch: number;\n}\n\nexport interface GLBRenderWorkerListener {\n onStart(count: number): void;\n\n onElementFinished(finishedElements: number): void;\n\n onFinished(zip: any): void;\n}\n\nexport default class GLBRenderWorker {\n private _sceneManager: GLBViewerSceneManager;\n private _entries: GLBRenderEntry[];\n\n private _resolve: (zip: any) => void;\n\n private _prefix = 'https://furniture.roomle.com/3d/glb/';\n\n private _renderer: WebGLRenderer;\n private _width: number;\n private _height: number;\n\n private _listeners: Set<GLBRenderWorkerListener> =\n new Set<GLBRenderWorkerListener>();\n private _finishedItems: number = 0;\n\n private _zip: any;\n\n constructor(\n sceneManager: GLBViewerSceneManager,\n width: number,\n height: number,\n ) {\n this._sceneManager = sceneManager;\n\n this._renderer = new WebGLRenderer({ antialias: true, alpha: true });\n this._width = width;\n this._height = height;\n this._renderer.setSize(width, height);\n this._renderer.setClearColor(0xffffff, 0);\n this._renderer.outputColorSpace = SRGBColorSpace;\n }\n\n public addListener(listener: GLBRenderWorkerListener) {\n this._listeners.add(listener);\n }\n\n public removeListener(listener: GLBRenderWorkerListener) {\n this._listeners.delete(listener);\n }\n\n public start(entries: RenderEntry[]): Promise<any> {\n this._entries = [];\n entries.forEach((entry) => {\n this._entries.push(this._transform(entry)); // {name: url.replace('.glb', '.png'), url: this._prefix + url}\n });\n this._finishedItems = 0;\n this._listeners.forEach((listener) =>\n listener.onStart(this._entries.length),\n );\n this._zip = new (window as any).JSZip();\n this._doNextEntry();\n return new Promise<any>((resolve) => {\n this._resolve = resolve;\n });\n }\n\n private _transform(entry: RenderEntry): GLBRenderEntry {\n return {\n name: entry.path.replace('.glb', '.png'),\n url: this._prefix + entry.path,\n position: new Vector3(\n entry.camera.position.x,\n entry.camera.position.z,\n -entry.camera.position.y,\n ),\n fov: entry.camera.fieldOfView * 2, // * 2 because Atti suggested it after all images were cut on all sides\n yaw: entry.camera.rotation.z,\n pitch: entry.camera.rotation.x,\n };\n }\n\n private _doNextEntry() {\n if (this._entries.length === 0) {\n this._listeners.forEach((listener) => listener.onFinished(this._zip));\n this._resolve(this._zip);\n } else {\n this._processEntry(this._entries[0]);\n }\n }\n\n private _processEntry(entry: GLBRenderEntry) {\n this._sceneManager.loadGLB(entry.url, false, undefined).then(() => {\n this._sceneManager.adjustCamera(\n entry.position,\n entry.yaw,\n entry.pitch,\n entry.fov,\n );\n this._sceneManager\n .preparePerspectiveImage({}, this._renderer)\n .then((base64Image) => {\n this._entryFinished(entry, base64Image);\n });\n });\n }\n\n private _entryFinished(entry: GLBRenderEntry, base64Image: Base64Image) {\n let index = this._entries.indexOf(entry);\n if (index > -1) {\n this._entries.splice(index, 1);\n }\n this._finishedItems++;\n this._listeners.forEach((listener) =>\n listener.onElementFinished(this._finishedItems),\n );\n this._zip.file(entry.name, base64Image.blob);\n this._doNextEntry();\n }\n}\n","export default \"__VITE_ASSET__WPGYjwIlzWVNM1bYhOc83w__\"","import type ScriptLoader from '../../common-core/src/script-loader';\nimport type DomHelper from '../../common-core/src/utils/dom-helper';\nimport inject from '../../common-core/src/di/inject';\nimport GLBViewerSceneManager from './webgl/glb-viewer-scene-manager';\nimport type {\n Base64Image,\n CanvasOffset,\n Position3,\n} from '../../common-core/src/common-interfaces';\nimport GLBRenderWorker from './services/glb-render-worker';\nimport type { ExternalEmbeddable, GlobalAPI } from '../../common-core/src/main';\nimport type { Main } from '../../common-core/src/main';\nimport type { Context } from '../../common-core/src/di/context';\nimport type { LifeCycleManager } from '../../common-core/src/life-cycle-manager';\nimport type { SceneSettings } from '../../common-core/src/scene-settings-loader';\nimport { JS_ZIP_FILE_NAME } from '../../common-core/src/static-files/libs';\nimport type InitData from '../../common-core/src/utils/init-data';\nimport type {\n GlobalInitDataDefinition,\n InitDataDefinition,\n} from '../../common-core/src/utils/shims';\nimport type GlobalInitData from '../../common-core/src/utils/global-init-data';\nimport { type RapiAccess } from '../../common-core/src/rapi-access';\nimport type { PrepareImageOptions } from '../../common-core/src/webgl/image-renderer';\nimport type UnitFormatter from '../../configurator-core/src/services/unit-formatter';\nimport { download } from '../../common-core/src/utils/common-utils';\nimport type { Scene } from 'three';\nimport { Vector3 } from 'three';\nimport { type IdbManager } from '../../common-core/src/services/idb-manager';\nimport type { CameraParameter } from '../../common-core/src/cameracontrol/camera-control';\nimport type { GlobalCallback } from '../../common-core/src/services/global-callback';\n\ninterface RenderCameraInformation {\n fieldOfView: number;\n rotation: Position3;\n position: Position3;\n}\n\nexport declare interface RenderEntry {\n path: string;\n camera: RenderCameraInformation;\n}\n\nexport class GlbViewerUiCallbacks {}\n\nexport class RoomleGLBViewer\n implements GlobalAPI, Context, ExternalEmbeddable<GlbViewerUiCallbacks>\n{\n public _creator_: string;\n\n @inject\n private _rapiAccess: RapiAccess;\n\n @inject\n private _domHelper: DomHelper;\n\n @inject\n private _scriptLoader: ScriptLoader;\n\n @inject\n private _lifeCycleManager: LifeCycleManager;\n\n @inject\n private _initData: InitData;\n\n @inject\n private _globalInitData: GlobalInitData;\n\n @inject\n private _globalCallback: GlobalCallback;\n\n @inject\n private _unitFormatter: UnitFormatter;\n\n @inject\n protected _idbManager: IdbManager;\n\n private _sceneManager: GLBViewerSceneManager;\n\n private _currentIdOrUrl: string | null = null;\n\n constructor(creator: string) {\n this._creator_ = creator;\n }\n\n public setCameraOffset(offset: CanvasOffset): void {\n this._sceneManager.setCameraOffset(offset);\n }\n\n public getCameraOffset(): CanvasOffset {\n return this._sceneManager.getCameraOffset();\n }\n\n public init(\n element: HTMLElement,\n initData?: InitDataDefinition,\n ): Promise<void> {\n this.setOverrides(initData);\n this._domHelper.setDomElement(element);\n\n if (this._sceneManager) {\n this._lifeCycleManager.resume();\n return Promise.resolve();\n }\n\n return new Promise<void>(this._initPromiseCallback.bind(this));\n }\n\n private _initPromiseCallback(resolve: () => void, _reject: () => void) {\n this._sceneManager = new GLBViewerSceneManager(this._creator_, {\n left: 0,\n top: 1,\n right: 1,\n bottom: 0,\n });\n // this.loadGLB('https://furniture.roomle.com/3d/glb/furniture/vitra/41206600/41206600.glb');\n this._sceneManager.enableHD();\n resolve();\n }\n\n public getSceneManager() {\n return this._sceneManager;\n }\n\n /**\n * Remove the current glb from the scene if it exists\n */\n public clearScene() {\n this._sceneManager.clearScene();\n }\n\n /**\n * Loads the GLB from the given URL Param\n * @param url\n * @param scaling defaults to 1\n * @param callback loading percent between 0 and 1\n */\n public loadGLB(\n url: string,\n scaling = 1,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = url;\n this._rapiAccess.trackView(url);\n return this._sceneManager.loadGLB(\n url,\n true,\n new Vector3(scaling, scaling, scaling),\n callback,\n );\n }\n\n /**\n * Loads the glb asset from the static item\n * @param staticItemId\n * @param callback loading percent between 0 and 1\n */\n public loadStaticItem(\n staticItemId: string,\n callback?: (percent: number) => void,\n ): Promise<void> {\n this._currentIdOrUrl = staticItemId;\n this._rapiAccess.trackView(staticItemId);\n return this._sceneManager.loadStaticItem(staticItemId, callback);\n }\n\n /**\n * Returns the current item id or url of the loaded object\n */\n public getCurrentId(): string | null {\n return this._currentIdOrUrl;\n }\n\n /**\n * Loads a SceneSettings object, currently it can can contain a light setting definition\n * (see {@link @roomle/web-sdk/configurator-core/src/roomle-configurator#RoomleConfigurator.loadDynamicLightSetting}) and an environment definition (see {@link @roomle/web-sdk/configurator-core/src/environment/dynamic-environment-setting-loaderEnvironmentSetting}).\n * @param sceneSettings\n */\n public loadSceneSetting(sceneSettings: SceneSettings): Promise<void> {\n return this._sceneManager.loadSceneSettings(sceneSettings);\n }\n\n public preparePerspectiveImage(\n options: PrepareImageOptions = {},\n ): Promise<Base64Image> {\n return this._sceneManager.preparePerspectiveImage(options);\n }\n\n public processRenderList(\n jsonString: string,\n width: number = 320,\n height: number = 320,\n ) {\n const object = JSON.parse(jsonString);\n this._scriptLoader.fetch(JS_ZIP_FILE_NAME, { id: 'jszip-js' }).then(() => {\n const worker = new GLBRenderWorker(this._sceneManager, width, height);\n worker.addListener(this._sceneManager);\n worker.start(object.items).then((zip: any) => {\n zip.generateAsync({ type: 'blob' }).then((content: File) => {\n download('content.zip', URL.createObjectURL(content));\n worker.removeListener(this._sceneManager);\n });\n });\n });\n }\n\n public setOverrides(\n initData:\n | Partial<InitDataDefinition & GlobalInitDataDefinition>\n | InitData\n | undefined,\n ): void {\n if (!initData) {\n return;\n }\n this._initData.setOverrides(initData);\n this._globalInitData.setOverrides(initData);\n }\n\n public updateSize(): void {\n this._sceneManager.updateCamera();\n }\n\n /**\n * Return the main class which has access to lifecycle events and RapiAccess.\n * Hidden because it's only useful for embedding API.\n * Has to be overridden by main class.\n * @hidden\n */\n public getMain(): Main | undefined {\n return undefined;\n }\n\n public resumeTest(element: HTMLElement) {\n this._domHelper.setDomElement(element);\n this._lifeCycleManager.resume();\n }\n\n public pauseTest() {\n this._lifeCycleManager.pause();\n }\n\n public showGUI() {\n this._sceneManager.showGUI();\n }\n\n public get callbacks() {\n return {};\n }\n\n public getScene(): Scene {\n return this._sceneManager.getScene();\n }\n\n public updateScene(): void {\n this._sceneManager.updateScene();\n }\n\n /**\n * returns unit formatter for formatting input und output values in scene\n */\n public getUnitFormatter(): UnitFormatter {\n return this._unitFormatter;\n }\n\n /**\n * returns manager class to interface with indexedDB storage\n */\n public getStorage(): IdbManager {\n return this._idbManager;\n }\n\n public setEnvironmentMap(params: {\n url?: string;\n intensity?: number;\n rotation?: number;\n maxLightSources?: number;\n }): void {\n const { url, intensity, rotation, maxLightSources } = params;\n this._sceneManager.setEnvironmentMap(\n url,\n intensity,\n rotation,\n maxLightSources,\n );\n }\n\n public exportCanvasScreenshot(quality?: number): Promise<string> {\n return this._sceneManager.exportCanvasScreenshot(quality);\n }\n\n public async moveCamera(cameraParameter: CameraParameter): Promise<void> {\n return this._sceneManager.moveCamera(cameraParameter);\n }\n\n /**\n * @internal\n * Use this callbacks to hook in your functionality\n */\n public get globalCallbacks(): GlobalCallback {\n return this._globalCallback;\n }\n}\n","import InputManager from '../../../common-core/src/input/input-manager';\n\nexport default class GlbInputManager extends InputManager {\n //move on, nothing to see here\n}\n","import Logger from '../../../common-core/src/logger';\nimport ScriptLoader from '../../../common-core/src/script-loader';\nimport {\n DependencyInjectionAssignment,\n DI_TYPE,\n} from '../../../common-core/src/di/container';\nimport GlbInputManager from '../input/glb-input-manager';\nimport { RapiAccess } from '../../../common-core/src/rapi-access';\n\nexport const INJECTABLES: DependencyInjectionAssignment[] = [\n new DependencyInjectionAssignment('script-loader', ScriptLoader),\n new DependencyInjectionAssignment(\n 'glb-input-manager',\n GlbInputManager,\n DI_TYPE.CONTEXT,\n ),\n new DependencyInjectionAssignment('logger', Logger),\n new DependencyInjectionAssignment('rapi-access', RapiAccess),\n];\n","import './utils/global-definitions';\nimport { Main, BASE_CONTEXT } from '../../common-core/src/main';\nimport type Logger from '../../common-core/src/logger';\nimport { INJECTABLES } from './utils/injectables';\nimport RoomleDependencyInjection from '../../common-core/src/di/roomle-dependency-injection';\nimport { RoomleGLBViewer } from './roomle-glb-viewer';\n\nexport class GlbViewer extends Main {\n private _viewer: RoomleGLBViewer;\n\n protected setupGlobals(): void {\n //globals are initialized in bootFinished()\n }\n\n protected setupDependencies(): void {\n RoomleDependencyInjection.setup(INJECTABLES);\n this.lookup<Logger>('logger', this._context);\n }\n\n protected cleanUpGlobals(): void {\n throw new Error('Method not implemented.');\n }\n\n protected cleanUpDependencies(): void {\n throw new Error('Method not implemented.');\n }\n\n protected async bootFinished(): Promise<void> {\n this._viewer = new RoomleGLBViewer(this._context);\n\n if (!window.RoomleGLBViewer) {\n window.RoomleGLBViewer = this._viewer;\n }\n }\n\n public getApi(): RoomleGLBViewer {\n return this._viewer;\n }\n\n protected getContextName(): string {\n return BASE_CONTEXT.GLB_VIEWER;\n }\n}\n"],"x_google_ignoreList":[4],"mappings":";;;;;;;;AAGA,IAAqB,IAArB,cAAuD,EAAgB;;mDAC/B;;CAEtC,OACE,GACA,GAEA,GACA,GACA,GACA;AAGA,OAAK,eAAe,IAAI,EAFC,IAAI,EAAQ,CAAC,EAAO,IAAI,GAAG,GAAG,CAAC,EAAO,IAAI,EAAE,EAC5C,IAAI,EAAQ,EAAO,IAAI,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AAgB,KAAK,SAAS,EAE5C,OAAO,oBACV,OAAO,kBAAkB,KAAK;;CAIlC,SAAiC;AAC/B,SAAO,KAAK;;CAGd,iBAAmC;AACjC,SAAO,EAAa"}
@@ -0,0 +1,2 @@
1
+ import { t as e } from "./glb-viewer-Csx9GwVi.mjs";
2
+ export { e as GlbViewer };
@@ -4,7 +4,7 @@ import { t as i } from "./component-raycast-helper-CLX5fLt9.mjs";
4
4
  //#region packages/configurator-core/src/utils/external-object-highlighting.ts
5
5
  var a = class {
6
6
  constructor() {
7
- this._needsUpdate = !0, this._sceneHasPreviews = !1, this._componentIds = [], this._object = null, this._transparentMaterials = /* @__PURE__ */ new Map(), this._originalMaterials = /* @__PURE__ */ new Map();
7
+ this._needsUpdate = !0, this._sceneHasPreviews = !1, this._componentIds = [], this._object = null, this._transparentMaterialsByUuid = /* @__PURE__ */ new Map(), this._originalMaterialsByUuid = /* @__PURE__ */ new Map();
8
8
  }
9
9
  init(e, t) {
10
10
  this._needsUpdate = !0, this._sceneHasPreviews = !1, this._componentIds = [], this._object = e, this._restoreAllMaterials();
@@ -56,24 +56,24 @@ var a = class {
56
56
  }
57
57
  _setTransparency(e, i) {
58
58
  if (!(!(e instanceof t) || !(e.material instanceof n))) if (i) {
59
- let t = this._originalMaterials.get(e.uuid) ?? e.material;
60
- this._originalMaterials.has(e.uuid) || this._originalMaterials.set(e.uuid, e.material);
61
- let n = this._transparentMaterials.get(t.uuid);
62
- n || (n = new r({ color: 8421504 }), n.opacity = .2, n.transparent = !0, n.depthWrite = !1, n.polygonOffset = !0, n.polygonOffsetFactor = -1, n.polygonOffsetUnits = 1, this._transparentMaterials.set(t.uuid, n)), e.material !== n && (e.material = n);
59
+ let t = this._originalMaterialsByUuid.get(e.uuid) ?? e.material;
60
+ this._originalMaterialsByUuid.has(e.uuid) || this._originalMaterialsByUuid.set(e.uuid, e.material);
61
+ let n = this._transparentMaterialsByUuid.get(t.uuid);
62
+ n || (n = new r({ color: 8421504 }), n.opacity = .2, n.transparent = !0, n.depthWrite = !1, n.polygonOffset = !0, n.polygonOffsetFactor = -1, n.polygonOffsetUnits = 1, this._transparentMaterialsByUuid.set(t.uuid, n)), e.material !== n && (e.material = n);
63
63
  } else {
64
- let t = this._originalMaterials.get(e.uuid);
65
- t && (e.material = t, this._originalMaterials.delete(e.uuid));
64
+ let t = this._originalMaterialsByUuid.get(e.uuid);
65
+ t && (e.material = t, this._originalMaterialsByUuid.delete(e.uuid));
66
66
  }
67
67
  }
68
68
  _restoreAllMaterials() {
69
69
  this._object?.traverse((e) => {
70
70
  if (e instanceof t) {
71
- let t = this._originalMaterials.get(e.uuid);
71
+ let t = this._originalMaterialsByUuid.get(e.uuid);
72
72
  t && (e.material = t);
73
73
  }
74
- }), this._originalMaterials.clear();
75
- for (let e of this._transparentMaterials.values()) e.dispose();
76
- this._transparentMaterials.clear();
74
+ }), this._originalMaterialsByUuid.clear();
75
+ for (let e of this._transparentMaterialsByUuid.values()) e.dispose();
76
+ this._transparentMaterialsByUuid.clear();
77
77
  }
78
78
  }, o = class {
79
79
  constructor(e) {
@@ -119,4 +119,4 @@ var a = class {
119
119
  //#endregion
120
120
  export { o as default };
121
121
 
122
- //# sourceMappingURL=highlight-coordinator-JwAVkMeS.mjs.map
122
+ //# sourceMappingURL=highlight-coordinator-C-PxNb40.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"highlight-coordinator-C-PxNb40.mjs","names":[],"sources":["../../packages/configurator-core/src/utils/external-object-highlighting.ts","../../packages/configurator-core/src/utils/highlight-coordinator.ts"],"sourcesContent":["import { type RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';\nimport type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';\nimport type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport type {\n Object3D,\n PerspectiveCamera,\n MeshStandardMaterial,\n Material,\n} from 'three';\nimport { Mesh, MeshBasicMaterial, MeshPhysicalMaterial } from 'three';\nimport { CORE_PLAN_COMPONENT_TYPE } from '../../../typings/kernel';\nimport type { HighlightHelper } from './highlight-helper';\n\nexport default class ExternalObjectHighlighting implements HighlightHelper {\n private _needsUpdate: boolean = true;\n private _sceneHasPreviews: boolean = false;\n private _componentIds: number[] = [];\n private _object: Object3D | null = null;\n private _transparentMaterialsByUuid = new Map<string, Material>();\n private _originalMaterialsByUuid = new Map<string, MeshStandardMaterial>();\n\n public init(_object: Object3D, _camera: PerspectiveCamera) {\n this._needsUpdate = true;\n this._sceneHasPreviews = false;\n this._componentIds = [];\n this._object = _object;\n this._restoreAllMaterials();\n }\n\n public setCamera(_camera: PerspectiveCamera) {\n // no-op: external highlighting does not use camera\n }\n\n public setObject(_object: Object3D | null) {\n this._object = _object;\n this._needsUpdate = true;\n }\n\n public cancelDocking(_object: Object3D, _callback?: () => void) {\n this._sceneHasPreviews = false;\n this._needsUpdate = true;\n }\n\n public invalidate() {\n this._needsUpdate = true;\n }\n\n public checkComponentAndPreviewVisibility(\n _sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._evaluatePreviewsAndUpdateTransparency(configuratorViewModel);\n }\n\n public checkComponentVisibility(\n _sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._evaluatePreviewsAndUpdateTransparency(configuratorViewModel);\n }\n\n public checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel) {\n this._evaluatePreviewsAndUpdateTransparency(configuratorViewModel);\n }\n\n private _evaluatePreviewsAndUpdateTransparency(\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n const sceneHasPreviews = configuratorViewModel.getPreviews().length > 0;\n if (this._sceneHasPreviews !== sceneHasPreviews) {\n this._sceneHasPreviews = sceneHasPreviews;\n this._needsUpdate = true;\n }\n this._updateMaterials();\n }\n\n public areAllComponentsInFrustum(_previews: RoomleComponent[]): boolean {\n // no-op: external object highlighting reacts to selection not camera movement\n return true;\n }\n\n public onSelectionChanged(\n _object: Object3D,\n componentIds: number[],\n callback?: () => void,\n ) {\n if (\n this._componentIds.length !== componentIds.length ||\n !this._componentIds.every((v, i) => v === componentIds[i])\n ) {\n this._needsUpdate = true;\n }\n this._componentIds = componentIds ?? [];\n this._updateMaterials();\n callback?.();\n }\n\n private _updateMaterials() {\n if (!this._needsUpdate) {\n return;\n }\n this._needsUpdate = false;\n if (!this._object) {\n return;\n }\n if (this._sceneHasPreviews || this._componentIds.length > 0) {\n this._makeNonComponentMeshesTransparent();\n } else {\n this._restoreAllMaterials();\n }\n }\n\n private _makeNonComponentMeshesTransparent() {\n if (!this._object || !this._object.hasOwnProperty('componentType')) {\n return;\n }\n const rootComponent = this._object as RoomleComponent;\n const transparent =\n this._componentIds.findIndex((id) => id === rootComponent.runtimeId) ===\n -1;\n this._recursivelySetTransparent(rootComponent, transparent);\n }\n\n private _recursivelySetTransparent(\n component: RoomleComponent,\n transparent: boolean,\n ) {\n component.children.forEach((child) => {\n this._setTransparency(child, transparent);\n });\n component.childComponents.forEach((childComponent) => {\n let childIsTransparent = transparent;\n if (this._sceneHasPreviews) {\n childIsTransparent = true;\n }\n if (\n this._componentIds.findIndex(\n (id) => id === childComponent.runtimeId,\n ) !== -1\n ) {\n childIsTransparent = false;\n } else if (\n childComponent.componentType.value ===\n CORE_PLAN_COMPONENT_TYPE.ROOT_MODULE\n ) {\n childIsTransparent = true;\n }\n this._recursivelySetTransparent(childComponent, childIsTransparent);\n });\n }\n\n private _setTransparency(child: Object3D, transparent: boolean) {\n if (\n !(child instanceof Mesh) ||\n !(child.material instanceof MeshPhysicalMaterial)\n ) {\n return;\n }\n if (transparent) {\n const originalMaterial =\n this._originalMaterialsByUuid.get(child.uuid) ?? child.material;\n if (!this._originalMaterialsByUuid.has(child.uuid)) {\n this._originalMaterialsByUuid.set(child.uuid, child.material);\n }\n let transparentMaterial = this._transparentMaterialsByUuid.get(\n originalMaterial.uuid,\n );\n if (!transparentMaterial) {\n transparentMaterial = new MeshBasicMaterial({ color: 0x808080 });\n transparentMaterial.opacity = 0.2;\n transparentMaterial.transparent = true;\n transparentMaterial.depthWrite = false;\n transparentMaterial.polygonOffset = true;\n transparentMaterial.polygonOffsetFactor = -1;\n transparentMaterial.polygonOffsetUnits = 1;\n this._transparentMaterialsByUuid.set(\n originalMaterial.uuid,\n transparentMaterial,\n );\n }\n if (child.material !== transparentMaterial) {\n child.material = transparentMaterial;\n }\n } else {\n const originalMaterial = this._originalMaterialsByUuid.get(child.uuid);\n if (originalMaterial) {\n child.material = originalMaterial;\n this._originalMaterialsByUuid.delete(child.uuid);\n }\n }\n }\n\n private _restoreAllMaterials() {\n this._object?.traverse((child) => {\n if (child instanceof Mesh) {\n const originalMaterial = this._originalMaterialsByUuid.get(child.uuid);\n if (originalMaterial) {\n child.material = originalMaterial;\n }\n }\n });\n this._originalMaterialsByUuid.clear();\n for (const material of this._transparentMaterialsByUuid.values()) {\n material.dispose();\n }\n this._transparentMaterialsByUuid.clear();\n }\n}\n","import { type RoomleComponent } from '../../../common-core/src/webgl/roomle-component-factory';\nimport type ConfiguratorSceneEventHandler from '../webgl/configurator-scene-event-handler';\nimport type ConfiguratorViewModel from '../../../common-core/src/view-model/configurator-view-model';\nimport type { Object3D, PerspectiveCamera } from 'three';\nimport type { HighlightHelper } from './highlight-helper';\nimport ComponentRaycastHelper from './component-raycast-helper';\nimport ExternalObjectHighlighting from './external-object-highlighting';\nimport { CORE_PLAN_COMPONENT_TYPE } from '../../../typings/kernel';\n\nexport interface HighlightCoordinatorOptions {\n transparentHighlighting?: boolean;\n externalTransparentHighlighting?: boolean;\n}\n\nexport default class HighlightCoordinator implements HighlightHelper {\n private _componentRaycastHelper: HighlightHelper | null = null;\n private _externalObjectHighlighting: HighlightHelper | null = null;\n private _isExternalObjectSelected: boolean = false;\n\n constructor(options: HighlightCoordinatorOptions) {\n if (options.transparentHighlighting) {\n this._componentRaycastHelper = new ComponentRaycastHelper();\n }\n if (options.externalTransparentHighlighting) {\n this._externalObjectHighlighting = new ExternalObjectHighlighting();\n }\n }\n\n private _isExternalObject(object: Object3D): boolean {\n return (\n object.hasOwnProperty('componentType') &&\n ((object as RoomleComponent).componentType.value ===\n CORE_PLAN_COMPONENT_TYPE.ROOT_MODULE ||\n (object as RoomleComponent).componentType.value ===\n CORE_PLAN_COMPONENT_TYPE.SUB_MODULE)\n );\n }\n\n private _getHighlightHelper(): HighlightHelper | null {\n return this._externalObjectHighlighting !== null &&\n this._isExternalObjectSelected\n ? this._externalObjectHighlighting\n : this._componentRaycastHelper;\n }\n\n public init(object: Object3D, camera: PerspectiveCamera) {\n this._isExternalObjectSelected = this._isExternalObject(object);\n this._componentRaycastHelper?.init(object, camera);\n this._externalObjectHighlighting?.init(object, camera);\n }\n\n public setCamera(camera: PerspectiveCamera) {\n this._componentRaycastHelper?.setCamera(camera);\n this._externalObjectHighlighting?.setCamera(camera);\n }\n\n public setObject(object: Object3D | null) {\n this._isExternalObjectSelected =\n object !== null && this._isExternalObject(object);\n this._componentRaycastHelper?.setObject(object);\n this._externalObjectHighlighting?.setObject(object);\n }\n\n public cancelDocking(object: Object3D, callback?: () => void) {\n this._getHighlightHelper()?.cancelDocking(object, callback);\n }\n\n public checkComponentAndPreviewVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._getHighlightHelper()?.checkComponentAndPreviewVisibility(\n sceneEventHandler,\n configuratorViewModel,\n );\n }\n\n public checkComponentVisibility(\n sceneEventHandler: ConfiguratorSceneEventHandler,\n configuratorViewModel: ConfiguratorViewModel,\n ) {\n this._getHighlightHelper()?.checkComponentVisibility(\n sceneEventHandler,\n configuratorViewModel,\n );\n }\n\n public checkPreviewVisibility(configuratorViewModel: ConfiguratorViewModel) {\n this._getHighlightHelper()?.checkPreviewVisibility(configuratorViewModel);\n }\n\n public areAllComponentsInFrustum(previews: RoomleComponent[]): boolean {\n return (\n this._componentRaycastHelper?.areAllComponentsInFrustum(previews) ?? false\n );\n }\n\n public onSelectionChanged(\n object: Object3D,\n componentIds: number[],\n callback?: () => void,\n ) {\n this._getHighlightHelper()?.onSelectionChanged(\n object,\n componentIds,\n callback,\n );\n }\n\n public invalidate() {\n this._componentRaycastHelper?.invalidate?.();\n this._externalObjectHighlighting?.invalidate?.();\n }\n}\n"],"mappings":";;;;AAaA,IAAqB,IAArB,MAA2E;;sBACzC,6BACK,yBACH,EAAE,iBACD,yDACG,IAAI,KAAuB,kDAC9B,IAAI,KAAmC;;CAE1E,KAAY,GAAmB,GAA4B;AAKzD,EAJA,KAAK,eAAe,IACpB,KAAK,oBAAoB,IACzB,KAAK,gBAAgB,EAAE,EACvB,KAAK,UAAU,GACf,KAAK,sBAAsB;;CAG7B,UAAiB,GAA4B;CAI7C,UAAiB,GAA0B;AAEzC,EADA,KAAK,UAAU,GACf,KAAK,eAAe;;CAGtB,cAAqB,GAAmB,GAAwB;AAE9D,EADA,KAAK,oBAAoB,IACzB,KAAK,eAAe;;CAGtB,aAAoB;AAClB,OAAK,eAAe;;CAGtB,mCACE,GACA,GACA;AACA,OAAK,uCAAuC,EAAsB;;CAGpE,yBACE,GACA,GACA;AACA,OAAK,uCAAuC,EAAsB;;CAGpE,uBAA8B,GAA8C;AAC1E,OAAK,uCAAuC,EAAsB;;CAGpE,uCACE,GACA;EACA,IAAM,IAAmB,EAAsB,aAAa,CAAC,SAAS;AAKtE,EAJI,KAAK,sBAAsB,MAC7B,KAAK,oBAAoB,GACzB,KAAK,eAAe,KAEtB,KAAK,kBAAkB;;CAGzB,0BAAiC,GAAuC;AAEtE,SAAO;;CAGT,mBACE,GACA,GACA,GACA;AASA,GAPE,KAAK,cAAc,WAAW,EAAa,UAC3C,CAAC,KAAK,cAAc,OAAO,GAAG,MAAM,MAAM,EAAa,GAAG,MAE1D,KAAK,eAAe,KAEtB,KAAK,gBAAgB,KAAgB,EAAE,EACvC,KAAK,kBAAkB,EACvB,KAAY;;CAGd,mBAA2B;AACpB,OAAK,iBAGV,KAAK,eA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AQ,EAAS;;CAG7D,mCACE,GACA,GACA;AACA,OAAK,qBAAqB,EAAE,mCAC1B,GACA,EACD;;CAGH,yBACE,GACA,GACA;AACA,OAAK,qBAAqB,EAAE,yBAC1B,GACA,EACD;;CAGH,uBAA8B,GAA8C;AAC1E,OAAK,qBAAqB,EAAE,uBAAuB,EAAsB;;CAG3E,0BAAiC,GAAsC;AACrE,SACE,KAAK,yBAAyB,0BAA0B,EAAS,IAAI;;CAIzE,mBACE,GACA,GACA,GACA;AACA,OAAK,qBAAqB,EAAE,mBAC1B,GACA,GACA,EACD;;CAGH,aAAoB;AAElB,EADA,KAAK,yBAAyB,cAAc,EAC5C,KAAK,6BAA6B,cAAc"}
@@ -1,5 +1,5 @@
1
- import { R as e } from "./roomle-sdk-Be4K-H8u.mjs";
2
- import { t } from "./api-C-enDIJZ.mjs";
1
+ import { R as e } from "./roomle-sdk-BCmaueGp.mjs";
2
+ import { t } from "./api-hQ0uOklW.mjs";
3
3
  //#region ../../node_modules/uuid/dist/esm-browser/stringify.js
4
4
  var n = [];
5
5
  for (let e = 0; e < 256; ++e) n.push((e + 256).toString(16).slice(1));
@@ -409,4 +409,4 @@ var g = Promise.resolve(), _ = () => {
409
409
  //#endregion
410
410
  export { v as HomagIntelligence };
411
411
 
412
- //# sourceMappingURL=homag-intelligence-CbzWp4pY.mjs.map
412
+ //# sourceMappingURL=homag-intelligence-Dh4VWYH6.mjs.map