@roomle/web-sdk 4.2.0-alpha.7 → 4.3.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 (87) hide show
  1. package/lib/ConfiguratorKernel.wasm +0 -0
  2. package/lib/{GaussianBlurNode-DEczNsyD.mjs → GaussianBlurNode-Bjszve7N.mjs} +15 -15
  3. package/lib/{GaussianBlurNode-DEczNsyD.mjs.map → GaussianBlurNode-Bjszve7N.mjs.map} +1 -1
  4. package/lib/RoomleCore.wasm +0 -0
  5. package/lib/RoomleToolsCore.wasm +0 -0
  6. package/lib/{api-B6sLiuiL.mjs → api-C0UElaCW.mjs} +2 -2
  7. package/lib/{api-B6sLiuiL.mjs.map → api-C0UElaCW.mjs.map} +1 -1
  8. package/lib/asset-loader.worker-eqHzNAwa.mjs.map +1 -1
  9. package/lib/{banana-for-scale-C-grIlTK.mjs → banana-for-scale-DGYmxeBG.mjs} +3 -3
  10. package/lib/{banana-for-scale-C-grIlTK.mjs.map → banana-for-scale-DGYmxeBG.mjs.map} +1 -1
  11. package/lib/budgeteer.sw-BUMElkO1.mjs.map +1 -1
  12. package/lib/{common-utils-6T8eGlhX.mjs → common-utils-CyQUubmw.mjs} +29 -15
  13. package/lib/{common-utils-6T8eGlhX.mjs.map → common-utils-CyQUubmw.mjs.map} +1 -1
  14. package/lib/{component-dimensioning-DJuokZnv.mjs → component-dimensioning--4sX2AgY.mjs} +4 -4
  15. package/lib/{component-dimensioning-DJuokZnv.mjs.map → component-dimensioning--4sX2AgY.mjs.map} +1 -1
  16. package/lib/{component-raycast-helper-SZg14d7A.mjs → component-raycast-helper-CskJedpv.mjs} +3 -3
  17. package/lib/{component-raycast-helper-SZg14d7A.mjs.map → component-raycast-helper-CskJedpv.mjs.map} +1 -1
  18. package/lib/configurator-CjFo24FH.mjs +2 -0
  19. package/lib/{configurator-Cbof6AET.mjs → configurator-vxRFxJ-B.mjs} +4 -4
  20. package/lib/{configurator-Cbof6AET.mjs.map → configurator-vxRFxJ-B.mjs.map} +1 -1
  21. package/lib/{decorate-CX1ZGuFY.mjs → decorate-CjaqqbUP.mjs} +12 -9
  22. package/lib/decorate-CjaqqbUP.mjs.map +1 -0
  23. package/lib/dimensioning-helper-0s61LK9R.mjs +2 -0
  24. package/lib/{dimensioning-helper-BwvR76_I.mjs → dimensioning-helper-Cgao7A18.mjs} +2 -2
  25. package/lib/{dimensioning-helper-BwvR76_I.mjs.map → dimensioning-helper-Cgao7A18.mjs.map} +1 -1
  26. package/lib/{glb-viewer-DmVh1uJg.mjs → glb-viewer-B-r0E1aa.mjs} +6 -6
  27. package/lib/{glb-viewer-DmVh1uJg.mjs.map → glb-viewer-B-r0E1aa.mjs.map} +1 -1
  28. package/lib/glb-viewer-BnJkmakv.mjs +2 -0
  29. package/lib/{highlight-coordinator-Qonmfsu1.mjs → highlight-coordinator-CR5rcFh_.mjs} +2 -2
  30. package/lib/{highlight-coordinator-Qonmfsu1.mjs.map → highlight-coordinator-CR5rcFh_.mjs.map} +1 -1
  31. package/lib/{homag-intelligence-CzD_RMQo.mjs → homag-intelligence-DHTCBB64.mjs} +8 -5
  32. package/lib/{homag-intelligence-CzD_RMQo.mjs.map → homag-intelligence-DHTCBB64.mjs.map} +1 -1
  33. package/lib/{imos-ix-poc-export-helper-Q6-OXziY.mjs → imos-ix-poc-export-helper-DRQK_p2h.mjs} +2 -2
  34. package/lib/{imos-ix-poc-export-helper-Q6-OXziY.mjs.map → imos-ix-poc-export-helper-DRQK_p2h.mjs.map} +1 -1
  35. package/lib/{material-viewer-BkSh-aG7.mjs → material-viewer-ZlNDhA8D.mjs} +6 -6
  36. package/lib/{material-viewer-BkSh-aG7.mjs.map → material-viewer-ZlNDhA8D.mjs.map} +1 -1
  37. package/lib/{packages-BGVMQMZK.mjs → packages-C9J0u-cc.mjs} +5 -5
  38. package/lib/{packages-BGVMQMZK.mjs.map → packages-C9J0u-cc.mjs.map} +1 -1
  39. package/lib/planner-C-5Mg-Lv.mjs +2 -0
  40. package/lib/{planner-DFa8uJOF.mjs → planner-ClY-VUWt.mjs} +3 -3
  41. package/lib/{planner-DFa8uJOF.mjs.map → planner-ClY-VUWt.mjs.map} +1 -1
  42. package/lib/{plugin-system-CqXT37-v.mjs → plugin-system-vlnG8j2T.mjs} +3 -3
  43. package/lib/{plugin-system-CqXT37-v.mjs.map → plugin-system-vlnG8j2T.mjs.map} +1 -1
  44. package/lib/{roomle-headless-setup-7xnQlZl3.mjs → roomle-headless-setup-DbO_rLjK.mjs} +54 -40
  45. package/lib/roomle-headless-setup-DbO_rLjK.mjs.map +1 -0
  46. package/lib/roomle-headless.d.ts +125 -115
  47. package/lib/roomle-headless.js +289 -358
  48. package/lib/roomle-headless.js.map +1 -1
  49. package/lib/roomle-renderer-FUqNfNIf.mjs.map +1 -1
  50. package/lib/{roomle-sdk-B73VmWod.mjs → roomle-sdk-BpCPIwDm.mjs} +2447 -2306
  51. package/lib/roomle-sdk-BpCPIwDm.mjs.map +1 -0
  52. package/lib/roomle-sdk.d.ts +79 -4
  53. package/lib/roomle-sdk.js +7 -7
  54. package/lib/{roomle-webgpu-renderer-Dzuy_Y39.mjs → roomle-webgpu-renderer-Lt55gNj5.mjs} +370 -303
  55. package/lib/roomle-webgpu-renderer-Lt55gNj5.mjs.map +1 -0
  56. package/lib/{scene-renderer-DR7EFd-8.mjs → scene-renderer-CLkhNnnv.mjs} +5 -5
  57. package/lib/{scene-renderer-DR7EFd-8.mjs.map → scene-renderer-CLkhNnnv.mjs.map} +1 -1
  58. package/lib/{script-loader-BlsGBrYo.mjs → script-loader-9GrUxzSB.mjs} +3 -3
  59. package/lib/{script-loader-BlsGBrYo.mjs.map → script-loader-9GrUxzSB.mjs.map} +1 -1
  60. package/lib/{shading-settings-Bnt9v9xJ.mjs → shading-settings-CRNmMpcn.mjs} +2 -2
  61. package/lib/{shading-settings-Bnt9v9xJ.mjs.map → shading-settings-CRNmMpcn.mjs.map} +1 -1
  62. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/package.json +1 -1
  63. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/ConfiguratorKernel.wasm +0 -0
  64. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleCore.wasm +0 -0
  65. package/lib/static/roomle-core-hsc/node_modules/roomle-core-hsc/wasm_modern/RoomleToolsCore.wasm +0 -0
  66. package/lib/{stats-helper-vEwFkDIt.mjs → stats-helper-D9l8soWd.mjs} +3 -3
  67. package/lib/{stats-helper-vEwFkDIt.mjs.map → stats-helper-D9l8soWd.mjs.map} +1 -1
  68. package/lib/three.tsl-BnL9nfJa.mjs +2 -0
  69. package/lib/{three.tsl-BElp7_oF.mjs → three.tsl-Dew9p5yF.mjs} +46 -48
  70. package/lib/{three.tsl-BElp7_oF.mjs.map → three.tsl-Dew9p5yF.mjs.map} +1 -1
  71. package/lib/{threejs-utils-C9zED_Tu.mjs → threejs-utils-CKV1QNU9.mjs} +4 -3
  72. package/lib/threejs-utils-CKV1QNU9.mjs.map +1 -0
  73. package/lib/{tools-core-DKYMilYC.mjs → tools-core-CKaB3WsP.mjs} +3 -3
  74. package/lib/{tools-core-DKYMilYC.mjs.map → tools-core-CKaB3WsP.mjs.map} +1 -1
  75. package/lib/{webgpu-BMwlJflc.mjs → webgpu-B0rxiqW-.mjs} +313 -313
  76. package/lib/{webgpu-BMwlJflc.mjs.map → webgpu-B0rxiqW-.mjs.map} +1 -1
  77. package/package.json +2 -2
  78. package/lib/configurator-BFd5022u.mjs +0 -2
  79. package/lib/decorate-CX1ZGuFY.mjs.map +0 -1
  80. package/lib/dimensioning-helper-yMfkA1IY.mjs +0 -2
  81. package/lib/glb-viewer-DlH5_aTU.mjs +0 -2
  82. package/lib/planner-CSKuhBke.mjs +0 -2
  83. package/lib/roomle-headless-setup-7xnQlZl3.mjs.map +0 -1
  84. package/lib/roomle-sdk-B73VmWod.mjs.map +0 -1
  85. package/lib/roomle-webgpu-renderer-Dzuy_Y39.mjs.map +0 -1
  86. package/lib/three.tsl-BtDRDR0q.mjs +0 -2
  87. package/lib/threejs-utils-C9zED_Tu.mjs.map +0 -1
Binary file
@@ -1,13 +1,13 @@
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 { Nt as s, Ot as c, Tt as l, X as u, g as d, jt as f, kt as p, n as m, tt as h, w as g } from "./three.tsl-BElp7_oF.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";
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() {
7
7
  return "GaussianBlurNode";
8
8
  }
9
9
  constructor(n, r = null, a = 4, o = {}) {
10
- super("vec4"), this.textureNode = n, this.directionNode = r, this.sigma = a, this._invSize = l(new e()), this._passDirection = l(new e()), this._horizontalRT = new t(1, 1, { depthBuffer: !1 }), this._horizontalRT.texture.name = "GaussianBlurNode.horizontal", this._verticalRT = new t(1, 1, { depthBuffer: !1 }), this._verticalRT.texture.name = "GaussianBlurNode.vertical", this._textureNode = u(this, this._verticalRT.texture), this._textureNode.uvNode = n.uvNode, this._material = null, this.updateBeforeType = i.FRAME, this.resolutionScale = o.resolutionScale || 1, this.premultipliedAlpha = o.premultipliedAlpha || !1, this.isGaussianBlurNode = !0;
10
+ super("vec4"), this.textureNode = n, this.directionNode = r, this.sigma = a, this._invSize = c(new e()), this._passDirection = c(new e()), this._horizontalRT = new t(1, 1, { depthBuffer: !1 }), this._horizontalRT.texture.name = "GaussianBlurNode.horizontal", this._verticalRT = new t(1, 1, { depthBuffer: !1 }), this._verticalRT.texture.name = "GaussianBlurNode.vertical", this._textureNode = d(this, this._verticalRT.texture), this._textureNode.uvNode = n.uvNode, this._material = null, this.updateBeforeType = i.FRAME, this.resolutionScale = o.resolutionScale || 1, this.premultipliedAlpha = o.premultipliedAlpha || !1, this.isGaussianBlurNode = !0;
11
11
  }
12
12
  setSize(e, t) {
13
13
  e = Math.max(Math.round(e * this.resolutionScale), 1), t = Math.max(Math.round(t * this.resolutionScale), 1), this._invSize.value.set(1 / e, 1 / t), this._horizontalRT.setSize(e, t), this._verticalRT.setSize(e, t);
@@ -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 = p(), i = f(this.directionNode || 1), a, o;
28
- this.premultipliedAlpha ? (a = (e) => h(t.sample(e)), o = (e) => c(e)) : (a = (e) => t.sample(e), o = (e) => e);
29
- let l = m(() => {
30
- let e = 3 + 2 * this.sigma, t = this._getCoefficients(e), n = this._invSize, c = i.mul(this._passDirection), l = s(a(r).mul(t[0])).toVar();
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();
31
31
  for (let i = 1; i < e; i++) {
32
- let e = g(i), o = g(t[i]), s = f(c.mul(n.mul(e))).toVar(), u = a(r.add(s)), d = a(r.sub(s));
33
- l.addAssign(u.add(d).mul(o));
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));
34
34
  }
35
- return o(l);
36
- }), u = this._material ||= new n();
37
- u.fragmentNode = l().context(e.getSharedContext()), u.name = "Gaussian_blur", u.needsUpdate = !0;
38
- let d = e.getNodeProperties(this);
39
- return d.textureNode = t, this._textureNode;
35
+ return o(c);
36
+ }), d = this._material ||= new n();
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;
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(d(e), t, n, r);
55
+ }, b = (e, t, n, r = {}) => new y(f(e), t, n, r);
56
56
  //#endregion
57
57
  export { b as gaussianBlur };
58
58
 
59
- //# sourceMappingURL=GaussianBlurNode-DEczNsyD.mjs.map
59
+ //# sourceMappingURL=GaussianBlurNode-Bjszve7N.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"GaussianBlurNode-DEczNsyD.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,6BAQhC,KAAK,eAAe,EAAa,MAAM,KAAK,YAAY,QAAS,EACjE,KAAK,aAAa,SAAS,EAAY,QAQvC,KAAK,YAAY,MASjB,KAAK,mBAAmB,EAAe,OAQvC,KAAK,kBAAkB,EAAQ,mBAAmB,GASlD,KAAK,qBAAqB,EAAQ,sBAAsB,IASxD,KAAK,qBAAqB;;CAU3B,QAAS,GAAO,GAAS;AAOxB,EALA,IAAQ,KAAK,IAAK,KAAK,MAAO,IAAQ,KAAK,gBAAiB,EAAE,EAAG,EACjE,IAAS,KAAK,IAAK,KAAK,MAAO,IAAS,KAAK,gBAAiB,EAAE,EAAG,EAEnE,KAAK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AAU,EAAE,KAAM,IAAI,EAAkB,EAAkB,EAAM,EAAE,GAAe,GAAO,EAAS"}
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":";;;;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,G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AC,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"}
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import { B as e, z as t } from "./roomle-sdk-B73VmWod.mjs";
1
+ import { B as e, z as t } from "./roomle-sdk-BpCPIwDm.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-B6sLiuiL.mjs.map
55
+ //# sourceMappingURL=api-C0UElaCW.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-B6sLiuiL.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-C0UElaCW.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__$oUiuAXR7gZMKRQU56HW2w__\""],"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__gOpBNSELCNdnM_yZlyA5OQ__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,0BAAA,OAAA,KAAA,IAAA,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { Ci as e } from "./three.core-0KaTx8dm.mjs";
2
- import { n as t, r as n, t as r } from "./decorate-CX1ZGuFY.mjs";
3
- import { n as i } from "./plugin-system-CqXT37-v.mjs";
2
+ import { n as t, r as n, t as r } from "./decorate-CjaqqbUP.mjs";
3
+ import { n as i } from "./plugin-system-vlnG8j2T.mjs";
4
4
  //#region packages/configurator-core/public/geometry/banana.glb?no-inline?url
5
5
  var a = "" + new URL("banana.glb", import.meta.url).href, o = class extends i {
6
6
  setScene(e) {
@@ -33,4 +33,4 @@ r([n, t("design:type", Object)], o.prototype, "_staticItemLoader", void 0);
33
33
  //#endregion
34
34
  export { o as default };
35
35
 
36
- //# sourceMappingURL=banana-for-scale-C-grIlTK.mjs.map
36
+ //# sourceMappingURL=banana-for-scale-DGYmxeBG.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-C-grIlTK.mjs","names":[],"sources":["../../packages/configurator-core/public/geometry/banana.glb?no-inline?url","../../packages/configurator-core/src/webgl/banana-for-scale.ts"],"sourcesContent":["export default \"__VITE_ASSET__6MQCagmCrZzS5dHPKhXWKQ__\"","import inject from '../../../common-core/src/di/inject';\nimport type StaticItemLoader from '../../../common-core/src/webgl/static-item-loader';\nimport { ScenePluginDefaultImplementation } from './plugin-system';\nimport { BANANA_FILE_NAME } from '../static-files/geometries';\nimport type { Box3, Object3D, Scene } from 'three';\nimport { Vector3 } from 'three';\n\nexport default class BananaForScale extends ScenePluginDefaultImplementation {\n private _scene: Scene;\n private _bounds: Box3;\n private _banana: Object3D;\n\n @inject\n private _staticItemLoader: StaticItemLoader;\n\n public setScene(scene: Scene) {\n this._scene = scene;\n\n this._staticItemLoader.loadGLB(BANANA_FILE_NAME).then((glb) => {\n this._banana = glb.scene;\n this.updateBounds(null);\n });\n\n console.log(\n '%c' + 'Banana 3D model by https://sketchfab.com/daniel132',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Banana source: https://sketchfab.com/3d-models/banana-mark-2-a7fef734bf4544cb8a780a858fa6af97',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Licensed under Creative Commons 4.0: https://creativecommons.org/licenses/by/4.0/',\n 'color: #ffe135',\n );\n }\n\n public updateBounds(bounds: Box3 | null) {\n if (bounds) {\n this._bounds = bounds;\n }\n if (!this._bounds) {\n return;\n }\n if (this._banana) {\n const size = this._bounds.getSize(new Vector3());\n const center = this._bounds.getCenter(new Vector3());\n const position = center.clone();\n position.x -= size.x / 2 + 0.18;\n position.z += size.z / 2 + 0.05;\n position.y = 0;\n let scale = 0.1;\n this._banana.scale.copy(new Vector3(scale, scale, scale));\n this._banana.rotation.y = 0.6;\n this._banana.position.copy(position);\n }\n if (!this._scene.children.includes(this._banana)) {\n this.addToScene();\n }\n }\n\n public clearScene(scene: Scene, uiScene: Scene): void {\n super.clearScene(scene, uiScene);\n\n this.removeFromScene();\n }\n\n public addToScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.add(this._banana);\n }\n\n public removeFromScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.remove(this._banana);\n }\n}\n"],"mappings":";;;;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,cAAA,OAAA,KAAA,IAAA,CAAA,MCOM,IAArB,cAA4C,EAAiC;CAQ3E,SAAgB,GAAc;AAiB5B,EAhBA,KAAK,SAAS,GAEd,KAAK,kBAAkB,QAAQ,EAAiB,CAAC,MAAM,MAAQ;AAE7D,GADA,KAAK,UAAU,EAAI,OACnB,KAAK,aAAa,KAAK;IACvB,EAEF,QAAQ,IACN,wDACA,iBACD,EACD,QAAQ,IACN,mGAEA,iBACD,EACD,QAAQ,IACN,uFAEA,iBACD;;CAGH,aAAoB,GAAqB;AACvC,MAAI,MACF,KAAK,UAAU,IAEZ,KAAK,SAGV;OAAI,KAAK,SAAS;IAChB,IAAM,IAAO,KAAK,QAAQ,QAAQ,IAAI,GAAS,CAAC,EAE1C,IADS,KAAK,QAAQ,UAAU,IAAI,GAAS,CAAC,CAC5B,OAAO;AAG/B,IAFA,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,KAAK,EAAK,IAAI,IAAI,KAC3B,EAAS,IAAI;IACb,IAAI,IAAQ;AAGZ,IAFA,KAAK,QAAQ,MAAM,KAAK,IAAI,EAAQ,GAAO,GAAO,EAAM,CAAC,EACzD,KAAK,QAAQ,SAAS,IAAI,IAC1B,KAAK,QAAQ,SAAS,KAAK,EAAS;;AAEtC,GAAK,KAAK,OAAO,SAAS,SAAS,KAAK,QAAQ,IAC9C,KAAK,YAAY;;;CAIrB,WAAkB,GAAc,GAAsB;AAGpD,EAFA,MAAM,WAAW,GAAO,EAAQ,EAEhC,KAAK,iBAAiB;;CAGxB,aAA0B;AACpB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,IAAI,KAAK,QAAQ;;CAG/B,kBAA+B;AACzB,GAAC,KAAK,UAAU,CAAC,KAAK,WAG1B,KAAK,OAAO,OAAO,KAAK,QAAQ;;;GApEjC,GAAA,EAAA,eAAA,OAAA,CAAA,EAAA,EAAA,WAAA,qBAAA,KAAA,EAAA"}
1
+ {"version":3,"file":"banana-for-scale-DGYmxeBG.mjs","names":[],"sources":["../../packages/configurator-core/public/geometry/banana.glb?no-inline?url","../../packages/configurator-core/src/webgl/banana-for-scale.ts"],"sourcesContent":["export default \"__VITE_ASSET__6MQCagmCrZzS5dHPKhXWKQ__\"","import inject from '../../../common-core/src/di/inject';\nimport type StaticItemLoader from '../../../common-core/src/webgl/static-item-loader';\nimport { ScenePluginDefaultImplementation } from './plugin-system';\nimport { BANANA_FILE_NAME } from '../static-files/geometries';\nimport type { Box3, Object3D, Scene } from 'three';\nimport { Vector3 } from 'three';\n\nexport default class BananaForScale extends ScenePluginDefaultImplementation {\n private _scene: Scene;\n private _bounds: Box3;\n private _banana: Object3D;\n\n @inject\n private _staticItemLoader: StaticItemLoader;\n\n public setScene(scene: Scene) {\n this._scene = scene;\n\n this._staticItemLoader.loadGLB(BANANA_FILE_NAME).then((glb) => {\n this._banana = glb.scene;\n this.updateBounds(null);\n });\n\n console.log(\n '%c' + 'Banana 3D model by https://sketchfab.com/daniel132',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Banana source: https://sketchfab.com/3d-models/banana-mark-2-a7fef734bf4544cb8a780a858fa6af97',\n 'color: #ffe135',\n );\n console.log(\n '%c' +\n 'Licensed under Creative Commons 4.0: https://creativecommons.org/licenses/by/4.0/',\n 'color: #ffe135',\n );\n }\n\n public updateBounds(bounds: Box3 | null) {\n if (bounds) {\n this._bounds = bounds;\n }\n if (!this._bounds) {\n return;\n }\n if (this._banana) {\n const size = this._bounds.getSize(new Vector3());\n const center = this._bounds.getCenter(new Vector3());\n const position = center.clone();\n position.x -= size.x / 2 + 0.18;\n position.z += size.z / 2 + 0.05;\n position.y = 0;\n let scale = 0.1;\n this._banana.scale.copy(new Vector3(scale, scale, scale));\n this._banana.rotation.y = 0.6;\n this._banana.position.copy(position);\n }\n if (!this._scene.children.includes(this._banana)) {\n this.addToScene();\n }\n }\n\n public clearScene(scene: Scene, uiScene: Scene): void {\n super.clearScene(scene, uiScene);\n\n this.removeFromScene();\n }\n\n public addToScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.add(this._banana);\n }\n\n public removeFromScene(): void {\n if (!this._scene || !this._banana) {\n return;\n }\n this._scene.remove(this._banana);\n }\n}\n"],"mappings":";;;;AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,cAAA,OAA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w-BUMElkO1.mjs","names":[],"sources":["../../packages/workers/generated/budgeteer.sw.js?no-inline?url"],"sourcesContent":["export default \"__VITE_ASSET__Msg57USEadASvSStYSdmzA__\""],"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__2$LtLFQdS6IeO$uJxLxRJQ__\""],"mappings":";AAAA,IAAA,IAAe,KAAA,IAAA,IAAA,mBAAA,OAAA,KAAA,IAAA,CAAA"}
@@ -131,34 +131,39 @@ var t = /* @__PURE__ */ function(e) {
131
131
  let e = Array.from(r.entries()).map(([e, t]) => a(e, t));
132
132
  return Promise.allSettled(e).then(() => void 0);
133
133
  }, o;
134
- }, b = async (e) => new Promise((t) => setTimeout(t, e)), x = async () => b(0), S = (e, t) => {
134
+ }, b = async (e) => new Promise((t) => setTimeout(t, e)), x = async () => b(0), S = (e, t, n) => {
135
+ let r, i = new Promise((e, i) => {
136
+ r = setTimeout(() => i(/* @__PURE__ */ Error(`${t} (timed out after ${n}ms)`)), n);
137
+ });
138
+ return Promise.race([e, i]).finally(() => clearTimeout(r));
139
+ }, C = (e, t) => {
135
140
  if (t === -1) return e;
136
141
  let n = 10 ** t;
137
142
  return Math.round(e * n) / n;
138
- }, C = /* @__PURE__ */ new RegExp(/\/3d\/[0-9]+\//), w = (e) => {
143
+ }, w = /* @__PURE__ */ new RegExp(/\/3d\/[0-9]+\//), T = (e) => {
139
144
  if (e.assets?.glb?.url) return e.assets.glb.url;
140
145
  if (e.threeDimensionalAsset) return e.threeDimensionalAsset;
141
146
  let t = e.threeDimensionalAssetWeb;
142
- return !t || typeof t != "string" ? null : t.match(C) ? t.replace(C, "/3d/glb/").replace(".flash.u3d", ".glb") : t;
143
- }, T = (e, t) => {
147
+ return !t || typeof t != "string" ? null : t.match(w) ? t.replace(w, "/3d/glb/").replace(".flash.u3d", ".glb") : t;
148
+ }, E = (e, t) => {
144
149
  for (let n in t) try {
145
- t[n].constructor === Object ? e[n] = T(e[n], t[n]) : e[n] = t[n];
150
+ t[n].constructor === Object ? e[n] = E(e[n], t[n]) : e[n] = t[n];
146
151
  } catch {
147
152
  e[n] = t[n];
148
153
  }
149
154
  return e;
150
- }, E = (e, t) => e === void 0 ? t : e, D = (e, t) => {
155
+ }, D = (e, t) => e === void 0 ? t : e, O = (e, t) => {
151
156
  let n = e.indexOf(t);
152
157
  n > -1 && e.splice(n, 1);
153
- }, O = (e) => e && JSON.parse(JSON.stringify(e)), k = (e, t) => new Proxy(e, { get(e, n, r) {
158
+ }, k = (e) => e && JSON.parse(JSON.stringify(e)), A = (e, t) => new Proxy(e, { get(e, n, r) {
154
159
  let i = Reflect.get(e, n, r);
155
160
  return typeof i == "function" ? function(...e) {
156
161
  return console.trace(t, n, e), i.apply(this, e);
157
162
  } : i;
158
- } }), A = (t) => j(t) ? t : typeof t == "string" && (M(t) || N(t)) ? new e(Number(t)) : new e(t), j = (t) => t instanceof e, M = (e) => !!e.match(/^0x[0-9a-f]+$/i), N = (e) => !!e.match(/^[0-9]+$/i), P = (e) => e ? Number("0x" + e.substring(1)) : -1, F = (e, t) => (t.materialId ? e.materialId = t.materialId : t.color ? e.rgbValue = P(t.color) : t.rgbValue ? e.rgbValue = t.rgbValue : t.catalogItemId === void 0 ? t.id ? e.materialId = t.id : console.warn("Can not set material because neither a texture nor a RGB value was found") : e.catalogItemId = t.catalogItemId, e), I = (e, t) => {
163
+ } }), j = (t) => M(t) ? t : typeof t == "string" && (N(t) || P(t)) ? new e(Number(t)) : new e(t), M = (t) => t instanceof e, N = (e) => !!e.match(/^0x[0-9a-f]+$/i), P = (e) => !!e.match(/^[0-9]+$/i), F = (e) => e ? Number("0x" + e.substring(1)) : -1, I = (e, t) => (t.materialId ? e.materialId = t.materialId : t.color ? e.rgbValue = F(t.color) : t.rgbValue ? e.rgbValue = t.rgbValue : t.catalogItemId === void 0 ? t.id ? e.materialId = t.id : console.warn("Can not set material because neither a texture nor a RGB value was found") : e.catalogItemId = t.catalogItemId, e), L = (e, t) => {
159
164
  let n = document.createElement("a");
160
165
  n.setAttribute("href", t), n.setAttribute("download", e), n.style.display = "none", document.body.appendChild(n), n.click(), document.body.removeChild(n);
161
- }, L = (e, t) => !(!e || !t || e.targetX === void 0 || t.targetX === void 0 || Math.abs(e.targetX - t.targetX) > .01 || e.targetY === void 0 || t.targetY === void 0 || Math.abs(e.targetY - t.targetY) > .01 || e.targetZ === void 0 || t.targetZ === void 0 || Math.abs(e.targetZ - t.targetZ) > .01 || e.yaw === void 0 || t.yaw === void 0 || Math.abs(e.yaw - t.yaw) > .01 || e.distance === void 0 || t.distance === void 0 || Math.abs(e.distance - t.distance) > .01), R = (e) => {
166
+ }, R = (e, t) => !(!e || !t || e.targetX === void 0 || t.targetX === void 0 || Math.abs(e.targetX - t.targetX) > .01 || e.targetY === void 0 || t.targetY === void 0 || Math.abs(e.targetY - t.targetY) > .01 || e.targetZ === void 0 || t.targetZ === void 0 || Math.abs(e.targetZ - t.targetZ) > .01 || e.yaw === void 0 || t.yaw === void 0 || Math.abs(e.yaw - t.yaw) > .01 || e.distance === void 0 || t.distance === void 0 || Math.abs(e.distance - t.distance) > .01), z = (e) => {
162
167
  let t = 0;
163
168
  if (e.length === 0) return t;
164
169
  for (let n = 0; n < e.length; n++) {
@@ -166,7 +171,7 @@ var t = /* @__PURE__ */ function(e) {
166
171
  t = (t << 5) - t + r, t |= 0;
167
172
  }
168
173
  return t;
169
- }, z = (e, t, n = "id") => {
174
+ }, B = (e, t, n = "id") => {
170
175
  let r = /* @__PURE__ */ new Map(), i = e.length;
171
176
  for (let t = 0; t < i; t++) r.set(e[t], t);
172
177
  let a = Array(i), o = t.length;
@@ -175,18 +180,27 @@ var t = /* @__PURE__ */ function(e) {
175
180
  s === void 0 ? a.push(i) : a[s] = i;
176
181
  }
177
182
  return a.filter((e) => e !== void 0);
178
- }, B = (e, t, n) => Math.max(t, Math.min(n, e)), V = (e = 8) => [...Array(e)].map(() => Math.random().toString(36).charAt(2)).join(""), H = (e) => JSON.parse(JSON.stringify(e)), U = (e) => typeof e == "object" && !!e && !Array.isArray(e), W = (e) => {
183
+ }, V = () => {
184
+ let e, t;
185
+ return {
186
+ promise: new Promise((n, r) => {
187
+ e = n, t = r;
188
+ }),
189
+ resolve: e,
190
+ reject: t
191
+ };
192
+ }, H = (e, t, n) => Math.max(t, Math.min(n, e)), U = (e = 8) => [...Array(e)].map(() => Math.random().toString(36).charAt(2)).join(""), W = (e) => JSON.parse(JSON.stringify(e)), G = (e) => typeof e == "object" && !!e && !Array.isArray(e), K = (e) => {
179
193
  try {
180
194
  let t = new URL(e);
181
195
  return new URLSearchParams(t.search).get("id");
182
196
  } catch {
183
197
  return null;
184
198
  }
185
- }, G = (e) => e.key === "Meta" || e.key === "Control", K = (e, t = !1) => {
186
- let n = t === !1 ? t : G(e);
199
+ }, q = (e) => e.key === "Meta" || e.key === "Control", J = (e, t = !1) => {
200
+ let n = t === !1 ? t : q(e);
187
201
  return e.key && (e.metaKey || e.ctrlKey || n);
188
202
  };
189
203
  //#endregion
190
- export { z as A, n as B, G as C, x as D, j as E, l as F, g as I, k as L, S as M, o as N, h as O, u as P, c as R, R as S, m as T, t as V, A as _, L as a, E as b, O as c, K as d, v as f, I as g, T as h, F as i, D as j, V as k, d as l, H as m, i as n, _ as o, y as p, a as r, B as s, r as t, f as u, w as v, U as w, s as x, W as y, b as z };
204
+ export { U as A, b as B, q as C, x as D, M as E, u as F, n as H, l as I, g as L, O as M, C as N, h as O, o as P, A as R, z as S, m as T, t as U, S as V, j as _, R as a, D as b, k as c, J as d, v as f, L as g, E as h, I as i, B as j, V as k, d as l, W as m, i as n, _ as o, y as p, a as r, H as s, r as t, f as u, T as v, G as w, s as x, K as y, c as z };
191
205
 
192
- //# sourceMappingURL=common-utils-6T8eGlhX.mjs.map
206
+ //# sourceMappingURL=common-utils-CyQUubmw.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"common-utils-6T8eGlhX.mjs","names":[],"sources":["../../packages/typings/rapi-types.ts","../../packages/common-core/src/utils/common-utils.ts"],"sourcesContent":["import type { Enumify } from '#/common/src/utils/types';\nimport type { InitDataDefinition } from '../common-core/src/utils/shims';\nimport type { UiPossibleChild } from './kernel';\n\nexport type RapiId = string;\nexport type AssetUrl = string;\nexport type ConfigurationString = string;\nexport type ConfigurationHash = string;\nexport type Base64String = string;\nexport type RapiServerUrlType = 'live' | 'test';\nexport type HexColorString = string; // #ffffff\nexport type HexColorNumber = number; // 0xffffff\nexport type PriceId = string;\nexport type ArticleNumber = string;\n\nexport interface LinksCollection {\n [key: string]: string;\n}\n\nexport interface RoomleSortable {\n sort?: number;\n}\n\nexport interface RapiJsonBox {\n meta?: RapiMeta;\n\n [key: string]: RapiMeta | RapiJson | RapiJson[] | undefined;\n}\n\nexport interface RapiMeta {\n serverTime: string;\n total: number;\n\n [key: string]: string | number;\n}\n\nexport interface RapiJson {\n id?: RapiId | number | null;\n isLocally?: boolean;\n __rapi_path__?: string;\n\n links?: LinksCollection;\n [key: string]: any;\n}\n\nexport interface RapiPackage extends RapiJson {\n components: RapiComponent[];\n materials: RapiMaterial[];\n textures: RapiTexture[];\n}\n\nexport interface RapiBaseColor {\n r: number;\n g: number;\n b: number;\n\n [key: string]: number;\n}\n\nexport interface RapiMesh extends RapiJson {\n catalog: RapiId;\n id: RapiId;\n}\n\nexport interface RapiMeshData {\n format: string;\n quality: number;\n url: string;\n created: string;\n changed: string;\n meshId: RapiId;\n\n [key: string]: number | string | RapiId;\n}\n\nexport interface RapiMaterialShading {\n version?: string;\n alpha: number;\n metallic: number;\n specularity?: number;\n basecolor: RapiBaseColor;\n roughness: number;\n doubleSided: boolean;\n alphaCutoff?: number;\n occlusion?: number;\n transmission?: number;\n reflectivity?: number;\n transmissionIOR?: number;\n emissiveColor?: RapiBaseColor;\n emissiveIntensity?: number;\n clearcoatIntensity?: number;\n clearcoatRoughness?: number;\n clearcoatNormalScale?: number;\n sheenColor?: RapiBaseColor;\n sheenIntensity?: number;\n sheenRoughness?: number;\n specularColor?: RapiBaseColor;\n thicknessFactor?: number;\n attenuationColor?: RapiBaseColor;\n attenuationDistance?: number;\n embeddedTextures?: RapiTexture[];\n\n [key: string]:\n | number\n | boolean\n | string\n | RapiBaseColor\n | RapiTexture[]\n | undefined;\n}\n\nexport interface RapiMaterial extends RapiJson {\n id: RapiId;\n name: string;\n externalIdentifier: string;\n group: string;\n groupLabel: string;\n color: string;\n thumbnail: AssetUrl;\n label: string;\n textures: number[];\n shading: RapiMaterialShading;\n tags: RapiId[];\n active: boolean;\n additionalInfos?: AdditionalInfo[];\n properties?: Record<string, string>;\n sort?: number;\n\n [key: string]:\n | string\n | RapiMaterialShading\n | AssetUrl\n | RapiId\n | number[]\n | AdditionalInfo[]\n | boolean\n | number\n | LinksCollection\n | RapiId[]\n | Record<string, string>\n | undefined;\n}\n\nexport interface RapiMaterialGroup extends RapiJson {\n id: RapiId | null;\n label?: string | null;\n materials: RapiMaterial[];\n legacyId?: RapiId;\n sort?: number;\n\n [key: string]:\n | string\n | RapiMaterial[]\n | RapiId\n | boolean\n | LinksCollection\n | number\n | null\n | undefined;\n}\n\nexport const enum RAPI_TEXTURE_TYPE {\n RGB = 'RGB', // diffuse color texture\n RGBA = 'RGBA', // Diffuse color texture and opacity map\n XYZ = 'XYZ', // normal vectors encoded in the 3 color channels\n ORM = 'ORM', // ambient Occlusion, roughness and metalness stored in the red, green and blue channels of the texture (in this order)\n EMRGB = 'EMRGB', // emissive color texture\n CCRG = 'CCRG', // clear coat intensity and clear coat roughness stored in the red and green channels of the texture (in this order)\n CCXYZ = 'CCXYZ', // separate normal vectors for the clear coat effect\n SHRGBA = 'SHRGBA', // sheen effect color texture and sheen roughness, the color is stored in the RGB channels and the roughness is stored in the alpha channel\n SPRGBA = 'SPRGBA', // specular color texture and specular intensity, the color is stored in the RGB channels and the intensity is stored in the alpha channel\n TTRG = 'TTRG', // transmission degree and thickness stored in the red and green channels of the texture (in this order)\n}\n\nexport interface RapiTexture extends RapiJson {\n mapping: RAPI_TEXTURE_TYPE;\n url: AssetUrl;\n image: AssetUrl;\n height: number;\n width: number;\n mmHeight: number;\n mmWidth: number;\n tileable: boolean;\n material: RapiId;\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | LinksCollection\n | null\n | undefined;\n}\n\nexport interface RapiCatalog extends RapiJson {\n id: RapiId;\n name: string;\n featuredImage: string;\n externalIdentifier: string;\n cover: string;\n brandIcon: string;\n description: string;\n free: boolean;\n public: boolean;\n featured: boolean;\n sort: number;\n created: string;\n updated: string;\n hidden: boolean;\n hiddenByUser: boolean;\n hiddenByTenant: boolean;\n tenantIsOwner: boolean;\n orderable: boolean;\n active: boolean;\n purchased: boolean;\n branded: boolean;\n\n tenant: RapiTenant;\n items: RapiItem[];\n allItems: RapiItem[];\n components: RapiComponent[];\n materials: RapiMaterial[];\n tags: RapiId[];\n allTags: RapiTag[];\n rootTags: RapiTag[];\n retailers: RapiRetailer[];\n\n [key: string]:\n | string\n | number\n | boolean\n | RapiRetailer[]\n | RapiTag[]\n | RapiMaterial[]\n | RapiComponent[]\n | RapiItem[]\n | RapiId[]\n | RapiTenant\n | LinksCollection\n | undefined;\n}\n\nexport interface RapiTenant extends RapiJson {\n name: string;\n label: string;\n defaultLanguage: string;\n active: boolean;\n showLanguageSwitch: boolean;\n branded: boolean;\n authenticationRequired: boolean;\n configuration: string;\n privacyUrl: string;\n\n catalogs: RapiCatalog[];\n users: RapiUser[];\n roles: RapiRole[];\n skin: RapiSkin[];\n plans: RapiPlan[];\n}\n\nexport interface RapiUser extends RapiJson {\n username: string;\n salutationCode: number;\n firstname: string;\n lastname: string;\n email: string;\n street: string;\n zipcode: string;\n city: string;\n countryCode: string;\n birthdate: string;\n phone: string;\n locale: string;\n registerDate: string;\n password: string;\n lastLogin: string;\n active: boolean;\n newsletter: boolean;\n emailValidated: string;\n termsChanged: boolean;\n providedConsentInTenant: boolean;\n priceLists: any;\n\n // Relationships\n tenants: RapiTenant[];\n roles: RapiRole[];\n catalogs: RapiCatalog[];\n plans: RapiPlan[];\n favorites: RapiFavorite[];\n setting: RapiUserSetting;\n}\n\nexport const enum RapiFavoriteType {\n ITEM = 1,\n CONFIG = 2,\n AFFILIATE = 3,\n}\n\nexport interface RapiFavorite extends RapiJson {\n objectId: string;\n type: RapiFavoriteType;\n created: string;\n user: RapiUser;\n}\n\nexport interface RapiUserSetting extends RapiJson {\n metric: boolean;\n measurements: boolean;\n area: boolean;\n furnitureSnap: boolean;\n\n user: RapiUser;\n}\n\nexport interface RapiRole extends RapiJson {\n // Data\n role: number;\n\n allowedModules: any;\n\n // Relationships\n tenantId: RapiTenant;\n userId: RapiUser;\n}\n\nexport interface RapiSkin extends RapiJson {\n accentColor: string;\n appIcon: string;\n backgroundImage: string;\n btnColorDark: string;\n btnColorLight: string;\n ciColor: string;\n dashboardBackground: string;\n loginBackground: string;\n dashboardLogo: string;\n fontColor: string;\n headerBackgroundColor: string;\n headerForegroundColor: string;\n logo: string;\n mailBackgroundColor: string;\n mailHeaderImage: string;\n planBackground: string;\n planLogo: string;\n splashScreenImage: string;\n tenantUrl: string;\n watermarkImage: string;\n brandedCatalogsIcon: string;\n planNote: string;\n inquiryImage: string;\n inquiryLink: string;\n hideMadeByRoomle: boolean;\n hidePressLink: boolean;\n hideShareButton: boolean;\n translationPath: string;\n hideFeedbackButton: boolean;\n referralUrl: string;\n hideCatalogOverview: boolean;\n // Relationships\n tenant: RapiTenant;\n catalogEntryTags: RapiTag;\n}\n\nexport interface RapiPlan extends RapiJson {\n name: string;\n description: string;\n changeDate: string;\n created: string;\n draftId: number | null; // THIS IS NOT USED BY THE BACKEND! USE DRAFT INSTEAD!!!!\n thumbnail: string;\n planObjects: string | null;\n active: boolean;\n right?: number;\n draft?: number;\n open: number;\n planDirectory: number;\n changed: number;\n version: number;\n floorLevel: number;\n //assets: array;\n visibility: number;\n\n // Relationships\n user: RapiUser | RapiId | null;\n tenant: RapiTenant | RapiId | null;\n assets: RapiPlanAsset[];\n parent: RapiPlan | RapiId | null;\n setting: RapiPlanSetting | null;\n}\n\nexport interface RapiPlanAsset extends RapiJson {\n image: string;\n}\n\nexport interface RapiPlanSetting extends RapiJson {\n metric: boolean;\n measurements: boolean;\n area: boolean;\n furnitureSnap: boolean;\n\n plan: RapiPlan;\n}\n\nexport type RapiPlanSnapshotId = `ps_${string}`;\nexport interface RapiPlanSnapshotPostData extends RapiJson {\n parentId: RapiId | null;\n planObjects: Array<{\n combinedId: RapiId;\n position: string;\n }>;\n plan: string;\n}\n\nexport interface RapiPlanSnapshotGetData extends RapiPlanSnapshotPostData {\n combinedIds: RapiId[];\n embedId: RapiId;\n perspectiveImage: string;\n topImage: string;\n}\n\n/* eslint-disable */\nexport interface RapiRetailer extends RapiJson {\n // NO ATTRS --> ask KUEGI how table looks\n}\n\n/* eslint:enable */\n\nexport interface RapiConfiguration extends RapiJson {\n id: RapiId;\n created: string;\n lastAccess: string;\n configuration: ConfigurationString;\n configurationHash: string;\n parts: string;\n perspectiveImage?: AssetUrl | null;\n topImage?: AssetUrl | null;\n rootComponentId: RapiId;\n orderable?: boolean;\n requestable?: boolean;\n width: number;\n height: number;\n depth: number;\n catalog?: RapiId;\n assets?: AssetItem;\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | LinksCollection\n | AssetItem\n | null\n | undefined;\n}\n\nexport interface RapiConfigurationEnhanced extends RapiConfiguration {\n label: string;\n}\n\nexport interface Element {\n id: string;\n label: string;\n perspectiveImage: AssetUrl;\n}\n\nexport interface RapiElement extends RapiJson, RoomleSortable, Element {\n id: RapiId;\n configuration?: ConfigurationString;\n externalIdentifier: string;\n tags: RapiId[];\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | RapiId[]\n | LinksCollection\n | AdditionalInfo[]\n | UiPossibleChild[]\n | AssetItem\n | undefined;\n}\nexport const CATALOG_INFOS_TYPES = {\n PARAMETER: 'parameter',\n PARAMETER_VALUE: 'paramValue',\n MATERIAL: 'material',\n COMPONENT: 'component',\n ITEM: 'item',\n} as const;\nexport interface AdditionalInfo {\n type: Enumify<typeof CATALOG_INFOS_TYPES>;\n key: string;\n parentIdFilter: string;\n catalog: string;\n tooltip: {\n [key: string]: string;\n };\n fullInfo: {\n type: string;\n url: {\n [key: string]: string;\n };\n };\n}\nexport interface RapiComponent extends RapiElement {\n active: boolean;\n additionalInfos: AdditionalInfo[];\n}\n\nexport interface Asset {\n format: string;\n url: string;\n}\n\nexport interface AssetItem {\n [key: string]: Asset;\n}\n\nexport interface RapiItem extends RapiElement {\n width: number;\n height: number;\n depth: number;\n basecolor: number;\n displayedWidth: number;\n displayedHeight: number;\n displayedDepth: number;\n perspectiveImageHD: AssetUrl;\n topImage: AssetUrl;\n threeDimensionalAssetWeb: AssetUrl;\n threeDimensionalAssetIOS: AssetUrl;\n threeDimensionalAsset: AssetUrl;\n flipable: boolean;\n scaleable: boolean;\n meta: string;\n hidden: boolean;\n link?: string;\n colorable: boolean;\n layer: number;\n language: string;\n type: string;\n detailType: string;\n currencySymbol?: string;\n customerPrice?: number;\n sort: number;\n orderable: boolean;\n requestable: boolean;\n catalog: RapiId;\n assets?: AssetItem;\n rootComponentId?: string;\n}\n\nexport const enum RAPI_ADDITIONAL_CONTENTS {\n UNKNOWN,\n LINK,\n TEXT,\n VIDEO,\n DOWNLOAD,\n IMAGE,\n SKETCH,\n}\n\nexport interface RapiAdditionalContent extends RapiJson {\n changed: string;\n content: string;\n created: string;\n itemId: RapiId;\n label: string;\n language: string;\n type: RAPI_ADDITIONAL_CONTENTS;\n}\n\nexport interface RapiTagGeneric extends RapiJson {\n label?: string;\n externalIdentifier: string;\n pngIcon?: AssetUrl;\n svgIcon?: AssetUrl;\n inspirationImage?: AssetUrl;\n global: boolean;\n sort?: number;\n created: string;\n updated: string;\n language: string;\n description?: string;\n\n // Relationships\n catalog: RapiId;\n tags: RapiId[];\n parents: RapiId[];\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | RapiId[]\n | RapiElement[]\n | RapiMaterial[]\n | LinksCollection\n | null\n | undefined;\n}\n\nexport interface RapiTag extends RapiTagGeneric {\n id: RapiId;\n items: RapiId[];\n materials: RapiId[];\n}\n\nexport interface RapiTagForUi extends RapiTagGeneric {\n materials: RapiMaterial[];\n items: RapiItem[];\n}\n\nexport interface RapiShortId {\n shortId: string;\n referencedId: string;\n url: string;\n type: number;\n created: string;\n lastAccess: string;\n\n [key: string]: string | number;\n}\n\nexport interface RapiPrice {\n priceId: PriceId;\n price: number;\n currencySymbol: string;\n}\n\nexport interface RapiConfiguratorSettings {\n id: string;\n tenant: number;\n allowedHosts: string;\n settings: InitDataDefinition;\n}\n\nexport interface UserAction {\n module: number;\n action: number;\n planId: RapiId;\n actionId: RapiId;\n actionValue: number;\n actionLabel: number;\n}\n\nexport const enum MAIL_TYPE {\n STANDARD = 1,\n AUGMENTED_REALITY = 2,\n SAVE_DRAFT = 3,\n PLANNER_SHARE = 13,\n}\n\nexport interface RapiAuth {\n token: string;\n lastActionDate: string;\n loginDate: string;\n userId: RapiId;\n}\n","import '../../../typings/global-definitions';\nimport type {\n RapiId,\n RapiItem,\n RapiJson,\n RapiMaterial,\n RapiTexture,\n} from '../../../typings/rapi-types';\nimport { RAPI_TEXTURE_TYPE } from '../../../typings/rapi-types';\nimport type {\n KernelFloorMaterial,\n KernelWallMaterial,\n} from '../../../typings/planner';\nimport type { BatchPaintMaterial } from '../../../planner-core/src/roomle-planner';\nimport { Color } from 'three';\nimport type { CameraParameter } from '../cameracontrol/camera-control';\n\nexport const enum CURSOR_STYLE {\n HOVER = 'pointer',\n DEFAULT = 'default',\n MOVE = 'move',\n DRAGGING = 'grabbing',\n ROTATE = 'ew-resize',\n NODE_HOVER = 'crosshair',\n LOADING = 'wait',\n // eslint-disable-next-line @typescript-eslint/quotes\n DRAW = \"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 3 20, auto\",\n // eslint-disable-next-line @typescript-eslint/quotes\n DRAW_FALLBACK = \"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 0 15, auto\",\n}\n\n/**\n * Colors can be set as hex value, eg 0x00ff00 or as official HTML color name: https://www.w3schools.com/colors/colors_names.asp\n */\nexport const ROOMLE_COLORS = {\n PRIMARY: 0xdb0000,\n ON_PRIMARY: 0xffffff,\n DEFAULT_BACKGROUND: 0xf7f7f7,\n SELECTION: 0xffffff,\n PREVIEW_DOCKING_COLOR: 0xfdddddd,\n SNAP_DOCKING: 0x80ff80,\n SNAP_COLLISION: 0xff8080,\n} as const;\n\nexport const ROOMLE_HIGHLIGHTNG = {\n SMART: 'smart',\n OFF: 'off',\n ALWAYS: 'always',\n};\n\nexport const setCursor = (style: CURSOR_STYLE) => {\n // refactor into dom helper to be save in SDK\n document.body.style.cursor = style;\n};\n\nexport const handleJsonResponse = (response: Response): Promise<any> => {\n const contentType = response.headers.get('content-type');\n if (contentType && contentType.includes('application/json')) {\n return response.json();\n }\n throw new TypeError('No JSON returned');\n};\n\nexport const uuid = (a: string | null = null): string => {\n return a\n ? (\n parseInt(a, 10) ^\n ((Math.random() * 16) >> (parseInt(a, 10) / 4))\n ).toString(16)\n : ((1e7).toString() + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid);\n};\n\nexport const setEnumerable = (\n target: any,\n property: string,\n isEnumerable: boolean,\n) => {\n setDescriptor(target, property, { enumerable: isEnumerable });\n};\n\nexport const setWriteable = (\n target: any,\n property: string,\n isWritable: boolean,\n) => {\n setDescriptor(target, property, { writable: isWritable });\n};\n\nexport const setDescriptor = (\n target: any,\n property: string,\n options: PropertyDescriptor,\n) => {\n const descriptor = Object.getOwnPropertyDescriptor(target, property);\n if (!descriptor) {\n throw new Error(`Property \"${property}\" not found on target`);\n }\n for (const prop in options) {\n if (options.hasOwnProperty(prop)) {\n (descriptor as any)[prop] = (options as any)[prop]; // as any because there are no signature types defined in std.lib\n }\n }\n Object.defineProperty(target, property, descriptor);\n};\n\nexport const setPropertiesFromOptions = (\n target: any,\n options: any,\n writeable?: true,\n) => {\n if (!options) {\n return;\n }\n Object.keys(options).forEach((key) => {\n Object.defineProperty(target, key, {\n value: options[key],\n writable: writeable,\n });\n });\n};\n\nexport const createBenchmarkMaterial = (materialId: string): RapiMaterial => {\n const color = new Color(0.5, 0.5, 0.5);\n const hexColor = color.getHexString();\n const material: RapiMaterial = {\n id: materialId,\n name: materialId,\n externalIdentifier: 'test-identifier',\n group: 'test-group',\n groupLabel: 'test-group-label',\n color: '#' + hexColor,\n thumbnail: createBenchmarkUrl(materialId, 15),\n label: 'test-label',\n textures: [1, 2, 3],\n shading: {\n alpha: 1,\n metallic: 0.5,\n basecolor: {\n r: 0.5,\n g: 0.5,\n b: 0.5,\n },\n roughness: 0.5,\n doubleSided: false,\n alphaCutoff: 0.5,\n },\n active: true,\n tags: [],\n };\n\n return material;\n};\n\nexport const createBenchmarkTexture = (materialId: string): RapiTexture => {\n const parts = materialId.split('_');\n const size = parseInt(parts[1], 10);\n const texture = {\n mapping: RAPI_TEXTURE_TYPE.RGB,\n id: materialId,\n material: materialId,\n image: createBenchmarkUrl(materialId),\n url: createBenchmarkUrl(materialId),\n height: size,\n width: size,\n mmHeight: 1,\n mmWidth: 1,\n tileable: true,\n };\n\n return texture;\n};\n\nexport const createBenchmarkUrl = (\n materialId: string,\n size?: number,\n): string => {\n const parts = materialId.split('_');\n if (!size) {\n size = parseInt(parts[1], 10);\n }\n const uniqueId = Math.abs(parseFloat(parts[2]));\n const dummyUrl =\n 'https://loremflickr.com/' + size + '/' + size + '?lock=' + uniqueId;\n return dummyUrl;\n};\n\nexport const isString = (value: unknown): boolean => {\n return typeof value === 'string' || value instanceof String;\n};\n\nexport const objectArrayToMap = <K extends V[keyof V], V extends object>(\n arr: V[],\n key: keyof V,\n): Map<K, V> => {\n return arr.reduce((acc, data) => {\n if (typeof data !== 'object') {\n console.warn('objectArrayToMap only works for arrays of objects');\n return acc;\n }\n const mapKey = data[key];\n if (!mapKey) {\n console.warn(\n 'Object has no key \"' +\n key.toString() +\n '\" therefore we do not know where to put it',\n );\n return acc;\n }\n if (!acc.has(mapKey)) {\n acc.set(mapKey, data);\n }\n return acc;\n }, new Map());\n};\n\nexport const throttle = <T extends (...args: any[]) => any>(\n func: T,\n delay: number = 16,\n): ((...funcArgs: Parameters<T>) => void) => {\n let time: number;\n let called = false;\n let skippedCalls = 0;\n let trailingCall: NodeJS.Timeout | null = null;\n return function (this: T, ..._args: Parameters<T>): void {\n if (!time) {\n time = Date.now();\n }\n if (!called || time + delay - Date.now() < 0) {\n func.apply(this, [...arguments]);\n time = Date.now();\n called = true;\n } else {\n skippedCalls++;\n }\n if (!trailingCall) {\n trailingCall = setInterval(() => {\n if (skippedCalls) {\n func.apply(this, [...arguments]);\n }\n skippedCalls = 0;\n if (trailingCall !== null) {\n clearInterval(trailingCall);\n }\n trailingCall = null;\n }, delay);\n }\n };\n};\n\n/**\n * Calls the function only if there has been no call for x (param after) milliseconds\n * @param func\n * @param after\n */\nexport const callAgainAfter = <T extends (...args: any[]) => any>(\n func: T,\n after: number = 16,\n): ((...funcArgs: Parameters<T>) => void) => {\n let lastCall: number;\n let called = false;\n return function (this: T, ..._args: Parameters<T>): void {\n if (!called || lastCall + after - Date.now() < 0) {\n lastCall = Date.now();\n func.apply(this, [...arguments]);\n called = true;\n } else {\n lastCall = Date.now();\n }\n };\n};\n\nexport const debounce = <Params extends any[]>(\n func: (...args: Params) => any,\n timeout: number,\n): ((...args: Params) => void) => {\n let timer: NodeJS.Timeout;\n return (...args: Params) => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n func(...args);\n }, timeout);\n };\n};\n\n/**\n * A generic type for a function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFunction = (...args: any[]) => any;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `delay`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked with the same key. The debounced function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them.\n *\n * T The type of the function to debounce.\n * @param {T} func The function to debounce.\n * @param {number} delay The number of milliseconds to delay.\n * @param {(...args: Parameters<T>) => unknown} [keyResolver]\n * Optional. A function to resolve the key from the arguments.\n * Defaults to using the first argument as the key.\n * @returns {((...args: Parameters<T>) => void)} The new debounced function.\n */\nexport const debounceByKey = <T extends AnyFunction>(\n func: T,\n delay: number,\n keyResolver?: (...args: Parameters<T>) => unknown,\n) => {\n // 1. Use a Map to store timers, keyed by your object or resolved key.\n // The key can be of any type, and the value is the timer ID from setTimeout.\n const timers = new Map<unknown, ReturnType<typeof setTimeout>>();\n\n // 2. The default resolver just uses the first argument as the key.\n const resolver = keyResolver || ((...args: Parameters<T>) => args[0]);\n\n // 3. Return the new debounced function.\n // It accepts the same parameters as the original function.\n return function (this: ThisParameterType<T>, ...args: Parameters<T>): void {\n // 4. Capture the 'this' context from the call.\n const context = this;\n\n // 5. Get the unique key for this specific call (e.g., the object itself).\n const key = resolver.apply(context, args);\n\n // 6. Check for an existing timer *for this specific key*.\n const existingTimer = timers.get(key);\n\n // 7. If a timer already exists for this key, clear it.\n if (existingTimer) {\n clearTimeout(existingTimer);\n }\n\n // 8. Set a new timer.\n const newTimer = setTimeout(() => {\n // 9. When the timer finally fires, call the original function\n // with the saved context and arguments from the *last* call.\n func.apply(context, args);\n\n // 10. Clean up the map to prevent memory leaks for this key.\n timers.delete(key);\n }, delay);\n\n // 11. Store the new timer ID, associated with its key.\n timers.set(key, newTimer);\n };\n};\n\n/**\n * Interface for storing a single promise's resolve and reject handlers.\n */\ninterface PromiseHandlers<T extends AnyFunction> {\n resolve: (value: ReturnType<T> | PromiseLike<ReturnType<T>>) => void;\n reject: (reason?: any) => void;\n}\n\n/**\n * Interface for storing timer details along with promise handlers for a given key.\n */\ninterface TimerDetails<T extends AnyFunction> {\n timer: ReturnType<typeof setTimeout>;\n handlers: Array<PromiseHandlers<T>>;\n context: ThisParameterType<T>;\n args: Parameters<T>;\n}\n\n/**\n * A key-debounced async function that additionally exposes `flush()` to run all\n * currently pending invocations immediately and resolve once they settle.\n */\nexport type DebouncedByKeyAsync<T extends AnyFunction> = ((\n ...args: Parameters<T>\n) => Promise<Awaited<ReturnType<T>>>) & {\n /**\n * Fire every pending (still-debouncing) invocation right now instead of waiting\n * for its timer, and resolve once all of them have settled.\n */\n flush: () => Promise<void>;\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `delay`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked with the same key. All calls made with the same key during the\n * delay period will have their returned promises resolved with the result\n * of the single final invocation.\n *\n * T The type of the function to debounce.\n * @param {T} func The function to debounce. This function can be synchronous or asynchronous.\n * @param {number} delay The number of milliseconds to delay.\n * @param {(...args: Parameters<T>) => unknown} [keyResolver]\n * Optional. A function to resolve the key from the arguments.\n * Defaults to using the first argument as the key.\n * @returns {((...args: Parameters<T>) => Promise<ReturnType<T>>)} The new debounced function.\n */\nexport const debounceByKeyAsync = <T extends AnyFunction>(\n func: T,\n delay: number,\n keyResolver?: (...args: Parameters<T>) => unknown,\n): DebouncedByKeyAsync<T> => {\n // 1. Use a Map to store timers and promise handlers, keyed by the resolved key.\n const timers = new Map<unknown, TimerDetails<T>>();\n\n // 2. The default resolver uses the first argument as the key.\n const resolver = keyResolver || ((...args: Parameters<T>) => args[0]);\n\n // Invoke `func` for a single pending key now, resolve/reject its handlers, and\n // remove it from the map. Shared by the timer callback and `flush()`.\n const fire = (key: unknown, details: TimerDetails<T>): Promise<void> => {\n clearTimeout(details.timer);\n timers.delete(key);\n return Promise.resolve(func.apply(details.context, details.args))\n .then((result) => {\n details.handlers.forEach((handler) => handler.resolve(result));\n })\n .catch((error) => {\n details.handlers.forEach((handler) => handler.reject(error));\n });\n };\n\n // 3. Return the new promise-based debounced function.\n const debounced = function (\n this: ThisParameterType<T>,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const context = this;\n const key = resolver.apply(context, args);\n\n return new Promise((resolve, reject) => {\n // 4. Check for existing timer details for this specific key.\n const existingTimerDetails = timers.get(key);\n\n // 5. If a timer already exists, clear it.\n if (existingTimerDetails) {\n clearTimeout(existingTimerDetails.timer);\n }\n\n // 6. Get the list of promise handlers, or create a new one.\n const handlers = existingTimerDetails?.handlers || [];\n handlers.push({ resolve, reject }); // Add the current promise's handlers.\n\n // 7. Store the timer plus the latest context/args so the invocation can be\n // fired either by the timer or eagerly by flush().\n const details: TimerDetails<T> = {\n timer: undefined as unknown as ReturnType<typeof setTimeout>,\n handlers,\n context,\n args,\n };\n details.timer = setTimeout(() => {\n void fire(key, details);\n }, delay);\n timers.set(key, details);\n });\n };\n\n // Run every pending invocation immediately (skipping the remaining debounce\n // delay) and resolve once all of them have settled.\n debounced.flush = (): Promise<void> => {\n const pending = Array.from(timers.entries()).map(([key, details]) =>\n fire(key, details),\n );\n return Promise.allSettled(pending).then(() => undefined);\n };\n\n return debounced;\n};\n\nexport const wait = async (delay: number): Promise<void> =>\n new Promise((resolve) => setTimeout(resolve, delay));\n\nexport const nextTick = async (): Promise<void> => wait(0);\n\nexport const roundWithPrecision = (float: number, precision: number) => {\n if (precision === -1) {\n return float;\n }\n const factor = Math.pow(10, precision);\n return Math.round(float * factor) / factor;\n};\n\nconst LEGACY_ASSET_URL_REG_EX = new RegExp(/\\/3d\\/[0-9]+\\//);\n\nexport const getGlbUrl = (item: RapiItem): string | null => {\n // use glb asset without ktx textures as default\n // glb2 used ktx textures\n if (item.assets?.glb?.url) {\n return item.assets.glb.url;\n }\n if (item.threeDimensionalAsset) {\n return item.threeDimensionalAsset;\n }\n const assetUrl = item.threeDimensionalAssetWeb;\n if (!assetUrl || typeof assetUrl !== 'string') {\n // Maybe we should introduce Nullable so we can turn on\n // strict null checks for SDK? But that's probably\n // a separate user story\n return null;\n }\n return !assetUrl.match(LEGACY_ASSET_URL_REG_EX)\n ? assetUrl\n : assetUrl\n .replace(LEGACY_ASSET_URL_REG_EX, '/3d/glb/')\n .replace('.flash.u3d', '.glb');\n};\n\n/**\n * Recursively merge properties of two objects.\n * If a property exists in both, property of obj2 is used\n * @param obj1\n * @param obj2\n */\nexport const deepMerge = (obj1: any, obj2: any): any => {\n for (const p in obj2) {\n try {\n // Property in destination object set; update its value.\n if (obj2[p].constructor === Object) {\n obj1[p] = deepMerge(obj1[p], obj2[p]);\n } else {\n obj1[p] = obj2[p];\n }\n } catch (_e) {\n // Property in destination object not set; create it and set its value.\n obj1[p] = obj2[p];\n }\n }\n return obj1;\n};\n\nexport const getValue = (value: any, defaultValue: any): any => {\n if (value === undefined) {\n return defaultValue;\n }\n return value;\n};\n\nexport const removeItem = (arr: any[], element: any) => {\n const index = arr.indexOf(element);\n if (index > -1) {\n arr.splice(index, 1);\n }\n};\n\nexport type ValuesFromObject<T> = T[keyof T];\n\nexport type MaybePromise<T> = (() => T) | (() => Promise<T>);\n\nexport const copy = <T>(object: T): T => {\n if (!object) {\n return object;\n }\n return JSON.parse(JSON.stringify(object));\n};\n\nexport const isWebGl2 = (): boolean => {\n const canvas = document.createElement('canvas');\n if (\n !canvas ||\n !canvas.getContext ||\n typeof canvas.getContext !== 'function'\n ) {\n return false;\n }\n try {\n return canvas ? !!canvas.getContext('webgl2') : false;\n } catch (_e) {\n return false;\n }\n};\n\n/**\n * Creates a proxy around that class that logs all calls to it\n * @param obj the class to trace\n * @param name the tag under which it will be logged\n */\nexport const traceMethodCalls = (obj: object, name: string) => {\n const handler = {\n get(target: any, propKey: any, receiver: any) {\n const targetValue = Reflect.get(target, propKey, receiver);\n if (typeof targetValue === 'function') {\n return function (...args: any) {\n console.trace(name, propKey, args);\n // @ts-ignore -- helper for better debugging, TS does not know what we are doing\n return targetValue.apply(this, args); // (A)\n };\n } else {\n return targetValue;\n }\n },\n };\n return new Proxy(obj, handler);\n};\n\n/**\n * Creates a proxy around that class that can be used to track property access\n * @param obj the class to track\n * @param name the tag under which it will be logged\n */\nexport const trackPropertyAccess = (obj: object, _name: string) => {\n const handler = {\n get(target: any, propKey: any, _receiver: any) {\n return target[propKey];\n },\n set(target: any, propKey: any, value: any, _receiver: any) {\n target[propKey] = value;\n return true;\n },\n };\n return new Proxy(obj, handler);\n};\n\nexport const getColor = (value: string | number | Color): Color => {\n if (isThreeJsColor(value)) {\n return value;\n }\n if (typeof value === 'string' && (isHex(value) || isOnlyNumbers(value))) {\n return new Color(Number(value));\n } else {\n return new Color(value);\n }\n};\n\nexport const isThreeJsColor = (value: any): value is Color => {\n return value instanceof Color;\n};\n\nexport const isHex = (num: string) => {\n return Boolean(num.match(/^0x[0-9a-f]+$/i));\n};\n\nexport const isOnlyNumbers = (num: string) => {\n return Boolean(num.match(/^[0-9]+$/i));\n};\n\nexport const parseColorToHexDecimal = (color: string) =>\n !color ? -1 : Number('0x' + color.substring(1));\n\n/**\n * Copies the properties of an incoming material to a kernel material, used mainly\n * to avoid copying core data when applying a material to a planObject\n * @param materialPtr Kernel material pointer to apply properties to\n * @param material material to copy color properties from\n */\nexport const applyMaterialToKernelMaterial = (\n materialPtr: KernelWallMaterial | KernelFloorMaterial,\n material: BatchPaintMaterial,\n): KernelWallMaterial | KernelFloorMaterial => {\n if (material.materialId) {\n materialPtr.materialId = material.materialId;\n } else if (material.color) {\n // Material is a hex string, so we convert it to a rgb value.\n materialPtr.rgbValue = parseColorToHexDecimal(material.color);\n } else if (material.rgbValue) {\n materialPtr.rgbValue = material.rgbValue;\n } else if (material.catalogItemId !== undefined) {\n materialPtr.catalogItemId = material.catalogItemId;\n } else if (material.id) {\n materialPtr.materialId = material.id;\n } else {\n console.warn(\n 'Can not set material because neither a texture nor a RGB value was found',\n );\n }\n return materialPtr;\n};\n\nexport const download = (filename: string, content: string): void => {\n const element = document.createElement('a');\n element.setAttribute('href', content);\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n};\n\nexport const areCameraParametersEqual = (\n start: CameraParameter,\n end: CameraParameter,\n): boolean => {\n if (!start || !end) {\n return false;\n }\n if (\n start.targetX === undefined ||\n end.targetX === undefined ||\n Math.abs(start.targetX - end.targetX) > 0.01\n ) {\n return false;\n }\n if (\n start.targetY === undefined ||\n end.targetY === undefined ||\n Math.abs(start.targetY - end.targetY) > 0.01\n ) {\n return false;\n }\n if (\n start.targetZ === undefined ||\n end.targetZ === undefined ||\n Math.abs(start.targetZ - end.targetZ) > 0.01\n ) {\n return false;\n }\n if (\n start.yaw === undefined ||\n end.yaw === undefined ||\n Math.abs(start.yaw - end.yaw) > 0.01\n ) {\n return false;\n }\n if (\n start.distance === undefined ||\n end.distance === undefined ||\n Math.abs(start.distance - end.distance) > 0.01\n ) {\n return false;\n }\n return true;\n};\n\n/**\n * transforms a value from one range (oldMin, oldMax) to a new range (newMin, newMax)\n * @param value the value to transform\n * @param oldMin\n * @param oldMax\n * @param newMin\n * @param newMax\n * @returns the transformed value\n */\nexport const transformRange = (\n value: number,\n oldMin: number,\n oldMax: number,\n newMin: number,\n newMax: number,\n): number => {\n return ((value - oldMin) * (newMax - newMin)) / (oldMax - oldMin) + newMin;\n};\n\nexport const hashCode = (value: string): number => {\n let hash = 0;\n if (value.length === 0) {\n return hash;\n }\n for (let i = 0; i < value.length; i++) {\n const chr = value.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n};\n\nexport const rearrangeArrayByIdOrder = <T extends RapiJson>(\n idsInOrder: RapiId[],\n rapiJson: T[],\n idKey: string = 'id',\n): T[] => {\n const indexMap = new Map<RapiId, number>();\n const length = idsInOrder.length;\n for (let i = 0; i < length; i++) {\n indexMap.set(idsInOrder[i], i);\n }\n\n const sortedResult = new Array<T>(length);\n\n // Place each element from the result array at its corresponding index in sortedResult\n const rapiJsonLength = rapiJson.length;\n for (let j = 0; j < rapiJsonLength; j++) {\n const entry = rapiJson[j];\n const id = entry[idKey];\n const index = indexMap.get(id as RapiId);\n if (index !== undefined) {\n sortedResult[index] = entry;\n } else {\n sortedResult.push(entry);\n }\n }\n\n return sortedResult.filter((element) => element !== undefined);\n};\n\nexport const promiseWithResolvers = <T>() => {\n let resolve!: (value: T) => void;\n let reject!: (reason?: any) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n};\n\nexport const clamp = (value: number, min: number, max: number): number => {\n return Math.max(min, Math.min(max, value));\n};\n\nexport const randomString = (length: number = 8): string => {\n return [...Array(length)]\n .map(() => Math.random().toString(36).charAt(2))\n .join('');\n};\n\nexport const deepCopy = <T>(obj: T): T => {\n return JSON.parse(JSON.stringify(obj));\n};\n\nexport const isRecord = (value: any): value is Record<string, any> => {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n};\n\nexport const getIdQueryParam = (urlString: string): string | null => {\n try {\n const url = new URL(urlString);\n const params = new URLSearchParams(url.search);\n return params.get('id');\n } catch (_error) {\n return null; // Return null if URL is invalid or 'id' param is not found\n }\n};\n\nexport const isCtrlOrCmd = (event: KeyboardEvent) =>\n event.key === 'Meta' || event.key === 'Control';\n\nexport const ctrlOrCmd = (\n event: KeyboardEvent,\n checkIfItIsTheOnlyKey: boolean = false,\n) => {\n const isMultiSelectKey =\n checkIfItIsTheOnlyKey === false\n ? checkIfItIsTheOnlyKey\n : isCtrlOrCmd(event);\n return event.key && (event.metaKey || event.ctrlKey || isMultiSelectKey);\n};\n\nexport const runIfNotEmpty = <T extends any[]>(\n ids: string[],\n executor: () => Promise<T>,\n): Promise<T> => {\n if (!ids || ids.length === 0) {\n return Promise.resolve([] as unknown as T);\n }\n return executor();\n};\n"],"mappings":";;AAiKA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,MAAA,OACA,EAAA,OAAA,QACA,EAAA,MAAA,OACA,EAAA,MAAA,OACA,EAAA,QAAA,SACA,EAAA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,IAAI,EAAW,IAAI,EAAE;CAGhC,IAAM,IAAmB,MAAS,EAAO,EAGnC,IAAiB,EAAS;AAChC,MAAK,IAAI,IAAI,GAAG,IAAI,GAAgB,KAAK;EACvC,IAAM,IAAQ,EAAS,IACjB,IAAK,EAAM,IACX,IAAQ,EAAS,IAAI,EAAa;AACxC,EAAI,MAAU,KAAA,IAGZ,EAAa,KAAK,EAAM,GAFxB,EAAa,KAAS;;AAM1B,QAAO,EAAa,QAAQ,MAAY,MAAY,KAAA,EAAU;GAanD,KAAS,GAAe,GAAa,MACzC,KAAK,IAAI,GAAK,KAAK,IAAI,GAAK,EAAM,CAAC,EAG/B,KAAgB,IAAiB,MACrC,CAAC,GAAG,MAAM,EAAO,CAAC,CACtB,UAAU,KAAK,QAAQ,CAAC,SAAS,GAAG,CAAC,OAAO,EAAE,CAAC,CAC/C,KAAK,GAAG,EAGA,KAAe,MACnB,KAAK,MAAM,KAAK,UAAU,EAAI,CAAC,EAG3B,KAAY,MAChB,OAAO,KAAU,cAAY,KAAkB,CAAC,MAAM,QAAQ,EAAM,EAGhE,KAAmB,MAAqC;AACnE,KAAI;EACF,IAAM,IAAM,IAAI,IAAI,EAAU;AAE9B,SADe,IAAI,gBAAgB,EAAI,OAAO,CAChC,IAAI,KAAK;SACR;AACf,SAAO;;GAIE,KAAe,MAC1B,EAAM,QAAQ,UAAU,EAAM,QAAQ,WAE3B,KACX,GACA,IAAiC,OAC9B;CACH,IAAM,IACJ,MAA0B,KACtB,IACA,EAAY,EAAM;AACxB,QAAO,EAAM,QAAQ,EAAM,WAAW,EAAM,WAAW"}
1
+ {"version":3,"file":"common-utils-CyQUubmw.mjs","names":[],"sources":["../../packages/typings/rapi-types.ts","../../packages/common-core/src/utils/common-utils.ts"],"sourcesContent":["import type { Enumify } from '#/common/src/utils/types';\nimport type { InitDataDefinition } from '../common-core/src/utils/shims';\nimport type { UiPossibleChild } from './kernel';\n\nexport type RapiId = string;\nexport type AssetUrl = string;\nexport type ConfigurationString = string;\nexport type ConfigurationHash = string;\nexport type Base64String = string;\nexport type RapiServerUrlType = 'live' | 'test';\nexport type HexColorString = string; // #ffffff\nexport type HexColorNumber = number; // 0xffffff\nexport type PriceId = string;\nexport type ArticleNumber = string;\n\nexport interface LinksCollection {\n [key: string]: string;\n}\n\nexport interface RoomleSortable {\n sort?: number;\n}\n\nexport interface RapiJsonBox {\n meta?: RapiMeta;\n\n [key: string]: RapiMeta | RapiJson | RapiJson[] | undefined;\n}\n\nexport interface RapiMeta {\n serverTime: string;\n total: number;\n\n [key: string]: string | number;\n}\n\nexport interface RapiJson {\n id?: RapiId | number | null;\n isLocally?: boolean;\n __rapi_path__?: string;\n\n links?: LinksCollection;\n [key: string]: any;\n}\n\nexport interface RapiPackage extends RapiJson {\n components: RapiComponent[];\n materials: RapiMaterial[];\n textures: RapiTexture[];\n}\n\nexport interface RapiBaseColor {\n r: number;\n g: number;\n b: number;\n\n [key: string]: number;\n}\n\nexport interface RapiMesh extends RapiJson {\n catalog: RapiId;\n id: RapiId;\n}\n\nexport interface RapiMeshData {\n format: string;\n quality: number;\n url: string;\n created: string;\n changed: string;\n meshId: RapiId;\n\n [key: string]: number | string | RapiId;\n}\n\nexport interface RapiMaterialShading {\n version?: string;\n alpha: number;\n metallic: number;\n specularity?: number;\n basecolor: RapiBaseColor;\n roughness: number;\n doubleSided: boolean;\n alphaCutoff?: number;\n occlusion?: number;\n transmission?: number;\n reflectivity?: number;\n transmissionIOR?: number;\n emissiveColor?: RapiBaseColor;\n emissiveIntensity?: number;\n clearcoatIntensity?: number;\n clearcoatRoughness?: number;\n clearcoatNormalScale?: number;\n sheenColor?: RapiBaseColor;\n sheenIntensity?: number;\n sheenRoughness?: number;\n specularColor?: RapiBaseColor;\n thicknessFactor?: number;\n attenuationColor?: RapiBaseColor;\n attenuationDistance?: number;\n embeddedTextures?: RapiTexture[];\n\n [key: string]:\n | number\n | boolean\n | string\n | RapiBaseColor\n | RapiTexture[]\n | undefined;\n}\n\nexport interface RapiMaterial extends RapiJson {\n id: RapiId;\n name: string;\n externalIdentifier: string;\n group: string;\n groupLabel: string;\n color: string;\n thumbnail: AssetUrl;\n label: string;\n textures: number[];\n shading: RapiMaterialShading;\n tags: RapiId[];\n active: boolean;\n additionalInfos?: AdditionalInfo[];\n properties?: Record<string, string>;\n sort?: number;\n\n [key: string]:\n | string\n | RapiMaterialShading\n | AssetUrl\n | RapiId\n | number[]\n | AdditionalInfo[]\n | boolean\n | number\n | LinksCollection\n | RapiId[]\n | Record<string, string>\n | undefined;\n}\n\nexport interface RapiMaterialGroup extends RapiJson {\n id: RapiId | null;\n label?: string | null;\n materials: RapiMaterial[];\n legacyId?: RapiId;\n sort?: number;\n\n [key: string]:\n | string\n | RapiMaterial[]\n | RapiId\n | boolean\n | LinksCollection\n | number\n | null\n | undefined;\n}\n\nexport const enum RAPI_TEXTURE_TYPE {\n RGB = 'RGB', // diffuse color texture\n RGBA = 'RGBA', // Diffuse color texture and opacity map\n XYZ = 'XYZ', // normal vectors encoded in the 3 color channels\n ORM = 'ORM', // ambient Occlusion, roughness and metalness stored in the red, green and blue channels of the texture (in this order)\n EMRGB = 'EMRGB', // emissive color texture\n CCRG = 'CCRG', // clear coat intensity and clear coat roughness stored in the red and green channels of the texture (in this order)\n CCXYZ = 'CCXYZ', // separate normal vectors for the clear coat effect\n SHRGBA = 'SHRGBA', // sheen effect color texture and sheen roughness, the color is stored in the RGB channels and the roughness is stored in the alpha channel\n SPRGBA = 'SPRGBA', // specular color texture and specular intensity, the color is stored in the RGB channels and the intensity is stored in the alpha channel\n TTRG = 'TTRG', // transmission degree and thickness stored in the red and green channels of the texture (in this order)\n}\n\nexport interface RapiTexture extends RapiJson {\n mapping: RAPI_TEXTURE_TYPE;\n url: AssetUrl;\n image: AssetUrl;\n height: number;\n width: number;\n mmHeight: number;\n mmWidth: number;\n tileable: boolean;\n material: RapiId;\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | LinksCollection\n | null\n | undefined;\n}\n\nexport interface RapiCatalog extends RapiJson {\n id: RapiId;\n name: string;\n featuredImage: string;\n externalIdentifier: string;\n cover: string;\n brandIcon: string;\n description: string;\n free: boolean;\n public: boolean;\n featured: boolean;\n sort: number;\n created: string;\n updated: string;\n hidden: boolean;\n hiddenByUser: boolean;\n hiddenByTenant: boolean;\n tenantIsOwner: boolean;\n orderable: boolean;\n active: boolean;\n purchased: boolean;\n branded: boolean;\n\n tenant: RapiTenant;\n items: RapiItem[];\n allItems: RapiItem[];\n components: RapiComponent[];\n materials: RapiMaterial[];\n tags: RapiId[];\n allTags: RapiTag[];\n rootTags: RapiTag[];\n retailers: RapiRetailer[];\n\n [key: string]:\n | string\n | number\n | boolean\n | RapiRetailer[]\n | RapiTag[]\n | RapiMaterial[]\n | RapiComponent[]\n | RapiItem[]\n | RapiId[]\n | RapiTenant\n | LinksCollection\n | undefined;\n}\n\nexport interface RapiTenant extends RapiJson {\n name: string;\n label: string;\n defaultLanguage: string;\n active: boolean;\n showLanguageSwitch: boolean;\n branded: boolean;\n authenticationRequired: boolean;\n configuration: string;\n privacyUrl: string;\n\n catalogs: RapiCatalog[];\n users: RapiUser[];\n roles: RapiRole[];\n skin: RapiSkin[];\n plans: RapiPlan[];\n}\n\nexport interface RapiUser extends RapiJson {\n username: string;\n salutationCode: number;\n firstname: string;\n lastname: string;\n email: string;\n street: string;\n zipcode: string;\n city: string;\n countryCode: string;\n birthdate: string;\n phone: string;\n locale: string;\n registerDate: string;\n password: string;\n lastLogin: string;\n active: boolean;\n newsletter: boolean;\n emailValidated: string;\n termsChanged: boolean;\n providedConsentInTenant: boolean;\n priceLists: any;\n\n // Relationships\n tenants: RapiTenant[];\n roles: RapiRole[];\n catalogs: RapiCatalog[];\n plans: RapiPlan[];\n favorites: RapiFavorite[];\n setting: RapiUserSetting;\n}\n\nexport const enum RapiFavoriteType {\n ITEM = 1,\n CONFIG = 2,\n AFFILIATE = 3,\n}\n\nexport interface RapiFavorite extends RapiJson {\n objectId: string;\n type: RapiFavoriteType;\n created: string;\n user: RapiUser;\n}\n\nexport interface RapiUserSetting extends RapiJson {\n metric: boolean;\n measurements: boolean;\n area: boolean;\n furnitureSnap: boolean;\n\n user: RapiUser;\n}\n\nexport interface RapiRole extends RapiJson {\n // Data\n role: number;\n\n allowedModules: any;\n\n // Relationships\n tenantId: RapiTenant;\n userId: RapiUser;\n}\n\nexport interface RapiSkin extends RapiJson {\n accentColor: string;\n appIcon: string;\n backgroundImage: string;\n btnColorDark: string;\n btnColorLight: string;\n ciColor: string;\n dashboardBackground: string;\n loginBackground: string;\n dashboardLogo: string;\n fontColor: string;\n headerBackgroundColor: string;\n headerForegroundColor: string;\n logo: string;\n mailBackgroundColor: string;\n mailHeaderImage: string;\n planBackground: string;\n planLogo: string;\n splashScreenImage: string;\n tenantUrl: string;\n watermarkImage: string;\n brandedCatalogsIcon: string;\n planNote: string;\n inquiryImage: string;\n inquiryLink: string;\n hideMadeByRoomle: boolean;\n hidePressLink: boolean;\n hideShareButton: boolean;\n translationPath: string;\n hideFeedbackButton: boolean;\n referralUrl: string;\n hideCatalogOverview: boolean;\n // Relationships\n tenant: RapiTenant;\n catalogEntryTags: RapiTag;\n}\n\nexport interface RapiPlan extends RapiJson {\n name: string;\n description: string;\n changeDate: string;\n created: string;\n draftId: number | null; // THIS IS NOT USED BY THE BACKEND! USE DRAFT INSTEAD!!!!\n thumbnail: string;\n planObjects: string | null;\n active: boolean;\n right?: number;\n draft?: number;\n open: number;\n planDirectory: number;\n changed: number;\n version: number;\n floorLevel: number;\n //assets: array;\n visibility: number;\n\n // Relationships\n user: RapiUser | RapiId | null;\n tenant: RapiTenant | RapiId | null;\n assets: RapiPlanAsset[];\n parent: RapiPlan | RapiId | null;\n setting: RapiPlanSetting | null;\n}\n\nexport interface RapiPlanAsset extends RapiJson {\n image: string;\n}\n\nexport interface RapiPlanSetting extends RapiJson {\n metric: boolean;\n measurements: boolean;\n area: boolean;\n furnitureSnap: boolean;\n\n plan: RapiPlan;\n}\n\nexport type RapiPlanSnapshotId = `ps_${string}`;\nexport interface RapiPlanSnapshotPostData extends RapiJson {\n parentId: RapiId | null;\n planObjects: Array<{\n combinedId: RapiId;\n position: string;\n }>;\n plan: string;\n}\n\nexport interface RapiPlanSnapshotGetData extends RapiPlanSnapshotPostData {\n combinedIds: RapiId[];\n embedId: RapiId;\n perspectiveImage: string;\n topImage: string;\n}\n\n/* eslint-disable */\nexport interface RapiRetailer extends RapiJson {\n // NO ATTRS --> ask KUEGI how table looks\n}\n\n/* eslint:enable */\n\nexport interface RapiConfiguration extends RapiJson {\n id: RapiId;\n created: string;\n lastAccess: string;\n configuration: ConfigurationString;\n configurationHash: string;\n parts: string;\n perspectiveImage?: AssetUrl | null;\n topImage?: AssetUrl | null;\n rootComponentId: RapiId;\n orderable?: boolean;\n requestable?: boolean;\n width: number;\n height: number;\n depth: number;\n catalog?: RapiId;\n assets?: AssetItem;\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | LinksCollection\n | AssetItem\n | null\n | undefined;\n}\n\nexport interface RapiConfigurationEnhanced extends RapiConfiguration {\n label: string;\n}\n\nexport interface Element {\n id: string;\n label: string;\n perspectiveImage: AssetUrl;\n}\n\nexport interface RapiElement extends RapiJson, RoomleSortable, Element {\n id: RapiId;\n configuration?: ConfigurationString;\n externalIdentifier: string;\n tags: RapiId[];\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | RapiId[]\n | LinksCollection\n | AdditionalInfo[]\n | UiPossibleChild[]\n | AssetItem\n | undefined;\n}\nexport const CATALOG_INFOS_TYPES = {\n PARAMETER: 'parameter',\n PARAMETER_VALUE: 'paramValue',\n MATERIAL: 'material',\n COMPONENT: 'component',\n ITEM: 'item',\n} as const;\nexport interface AdditionalInfo {\n type: Enumify<typeof CATALOG_INFOS_TYPES>;\n key: string;\n parentIdFilter: string;\n catalog: string;\n tooltip: {\n [key: string]: string;\n };\n fullInfo: {\n type: string;\n url: {\n [key: string]: string;\n };\n };\n}\nexport interface RapiComponent extends RapiElement {\n active: boolean;\n additionalInfos: AdditionalInfo[];\n}\n\nexport interface Asset {\n format: string;\n url: string;\n}\n\nexport interface AssetItem {\n [key: string]: Asset;\n}\n\nexport interface RapiItem extends RapiElement {\n width: number;\n height: number;\n depth: number;\n basecolor: number;\n displayedWidth: number;\n displayedHeight: number;\n displayedDepth: number;\n perspectiveImageHD: AssetUrl;\n topImage: AssetUrl;\n threeDimensionalAssetWeb: AssetUrl;\n threeDimensionalAssetIOS: AssetUrl;\n threeDimensionalAsset: AssetUrl;\n flipable: boolean;\n scaleable: boolean;\n meta: string;\n hidden: boolean;\n link?: string;\n colorable: boolean;\n layer: number;\n language: string;\n type: string;\n detailType: string;\n currencySymbol?: string;\n customerPrice?: number;\n sort: number;\n orderable: boolean;\n requestable: boolean;\n catalog: RapiId;\n assets?: AssetItem;\n rootComponentId?: string;\n}\n\nexport const enum RAPI_ADDITIONAL_CONTENTS {\n UNKNOWN,\n LINK,\n TEXT,\n VIDEO,\n DOWNLOAD,\n IMAGE,\n SKETCH,\n}\n\nexport interface RapiAdditionalContent extends RapiJson {\n changed: string;\n content: string;\n created: string;\n itemId: RapiId;\n label: string;\n language: string;\n type: RAPI_ADDITIONAL_CONTENTS;\n}\n\nexport interface RapiTagGeneric extends RapiJson {\n label?: string;\n externalIdentifier: string;\n pngIcon?: AssetUrl;\n svgIcon?: AssetUrl;\n inspirationImage?: AssetUrl;\n global: boolean;\n sort?: number;\n created: string;\n updated: string;\n language: string;\n description?: string;\n\n // Relationships\n catalog: RapiId;\n tags: RapiId[];\n parents: RapiId[];\n\n [key: string]:\n | string\n | number\n | boolean\n | AssetUrl\n | RapiId\n | RapiId[]\n | RapiElement[]\n | RapiMaterial[]\n | LinksCollection\n | null\n | undefined;\n}\n\nexport interface RapiTag extends RapiTagGeneric {\n id: RapiId;\n items: RapiId[];\n materials: RapiId[];\n}\n\nexport interface RapiTagForUi extends RapiTagGeneric {\n materials: RapiMaterial[];\n items: RapiItem[];\n}\n\nexport interface RapiShortId {\n shortId: string;\n referencedId: string;\n url: string;\n type: number;\n created: string;\n lastAccess: string;\n\n [key: string]: string | number;\n}\n\nexport interface RapiPrice {\n priceId: PriceId;\n price: number;\n currencySymbol: string;\n}\n\nexport interface RapiConfiguratorSettings {\n id: string;\n tenant: number;\n allowedHosts: string;\n settings: InitDataDefinition;\n}\n\nexport interface UserAction {\n module: number;\n action: number;\n planId: RapiId;\n actionId: RapiId;\n actionValue: number;\n actionLabel: number;\n}\n\nexport const enum MAIL_TYPE {\n STANDARD = 1,\n AUGMENTED_REALITY = 2,\n SAVE_DRAFT = 3,\n PLANNER_SHARE = 13,\n}\n\nexport interface RapiAuth {\n token: string;\n lastActionDate: string;\n loginDate: string;\n userId: RapiId;\n}\n","import '../../../typings/global-definitions';\nimport type {\n RapiId,\n RapiItem,\n RapiJson,\n RapiMaterial,\n RapiTexture,\n} from '../../../typings/rapi-types';\nimport { RAPI_TEXTURE_TYPE } from '../../../typings/rapi-types';\nimport type {\n KernelFloorMaterial,\n KernelWallMaterial,\n} from '../../../typings/planner';\nimport type { BatchPaintMaterial } from '../../../planner-core/src/roomle-planner';\nimport { Color } from 'three';\nimport type { CameraParameter } from '../cameracontrol/camera-control';\n\nexport const enum CURSOR_STYLE {\n HOVER = 'pointer',\n DEFAULT = 'default',\n MOVE = 'move',\n DRAGGING = 'grabbing',\n ROTATE = 'ew-resize',\n NODE_HOVER = 'crosshair',\n LOADING = 'wait',\n // eslint-disable-next-line @typescript-eslint/quotes\n DRAW = \"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 3 20, auto\",\n // eslint-disable-next-line @typescript-eslint/quotes\n DRAW_FALLBACK = \"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 0 15, auto\",\n}\n\n/**\n * Colors can be set as hex value, eg 0x00ff00 or as official HTML color name: https://www.w3schools.com/colors/colors_names.asp\n */\nexport const ROOMLE_COLORS = {\n PRIMARY: 0xdb0000,\n ON_PRIMARY: 0xffffff,\n DEFAULT_BACKGROUND: 0xf7f7f7,\n SELECTION: 0xffffff,\n PREVIEW_DOCKING_COLOR: 0xfdddddd,\n SNAP_DOCKING: 0x80ff80,\n SNAP_COLLISION: 0xff8080,\n} as const;\n\nexport const ROOMLE_HIGHLIGHTNG = {\n SMART: 'smart',\n OFF: 'off',\n ALWAYS: 'always',\n};\n\nexport const setCursor = (style: CURSOR_STYLE) => {\n // refactor into dom helper to be save in SDK\n document.body.style.cursor = style;\n};\n\nexport const handleJsonResponse = (response: Response): Promise<any> => {\n const contentType = response.headers.get('content-type');\n if (contentType && contentType.includes('application/json')) {\n return response.json();\n }\n throw new TypeError('No JSON returned');\n};\n\nexport const uuid = (a: string | null = null): string => {\n return a\n ? (\n parseInt(a, 10) ^\n ((Math.random() * 16) >> (parseInt(a, 10) / 4))\n ).toString(16)\n : ((1e7).toString() + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, uuid);\n};\n\nexport const setEnumerable = (\n target: any,\n property: string,\n isEnumerable: boolean,\n) => {\n setDescriptor(target, property, { enumerable: isEnumerable });\n};\n\nexport const setWriteable = (\n target: any,\n property: string,\n isWritable: boolean,\n) => {\n setDescriptor(target, property, { writable: isWritable });\n};\n\nexport const setDescriptor = (\n target: any,\n property: string,\n options: PropertyDescriptor,\n) => {\n const descriptor = Object.getOwnPropertyDescriptor(target, property);\n if (!descriptor) {\n throw new Error(`Property \"${property}\" not found on target`);\n }\n for (const prop in options) {\n if (options.hasOwnProperty(prop)) {\n (descriptor as any)[prop] = (options as any)[prop]; // as any because there are no signature types defined in std.lib\n }\n }\n Object.defineProperty(target, property, descriptor);\n};\n\nexport const setPropertiesFromOptions = (\n target: any,\n options: any,\n writeable?: true,\n) => {\n if (!options) {\n return;\n }\n Object.keys(options).forEach((key) => {\n Object.defineProperty(target, key, {\n value: options[key],\n writable: writeable,\n });\n });\n};\n\nexport const createBenchmarkMaterial = (materialId: string): RapiMaterial => {\n const color = new Color(0.5, 0.5, 0.5);\n const hexColor = color.getHexString();\n const material: RapiMaterial = {\n id: materialId,\n name: materialId,\n externalIdentifier: 'test-identifier',\n group: 'test-group',\n groupLabel: 'test-group-label',\n color: '#' + hexColor,\n thumbnail: createBenchmarkUrl(materialId, 15),\n label: 'test-label',\n textures: [1, 2, 3],\n shading: {\n alpha: 1,\n metallic: 0.5,\n basecolor: {\n r: 0.5,\n g: 0.5,\n b: 0.5,\n },\n roughness: 0.5,\n doubleSided: false,\n alphaCutoff: 0.5,\n },\n active: true,\n tags: [],\n };\n\n return material;\n};\n\nexport const createBenchmarkTexture = (materialId: string): RapiTexture => {\n const parts = materialId.split('_');\n const size = parseInt(parts[1], 10);\n const texture = {\n mapping: RAPI_TEXTURE_TYPE.RGB,\n id: materialId,\n material: materialId,\n image: createBenchmarkUrl(materialId),\n url: createBenchmarkUrl(materialId),\n height: size,\n width: size,\n mmHeight: 1,\n mmWidth: 1,\n tileable: true,\n };\n\n return texture;\n};\n\nexport const createBenchmarkUrl = (\n materialId: string,\n size?: number,\n): string => {\n const parts = materialId.split('_');\n if (!size) {\n size = parseInt(parts[1], 10);\n }\n const uniqueId = Math.abs(parseFloat(parts[2]));\n const dummyUrl =\n 'https://loremflickr.com/' + size + '/' + size + '?lock=' + uniqueId;\n return dummyUrl;\n};\n\nexport const isString = (value: unknown): boolean => {\n return typeof value === 'string' || value instanceof String;\n};\n\nexport const objectArrayToMap = <K extends V[keyof V], V extends object>(\n arr: V[],\n key: keyof V,\n): Map<K, V> => {\n return arr.reduce((acc, data) => {\n if (typeof data !== 'object') {\n console.warn('objectArrayToMap only works for arrays of objects');\n return acc;\n }\n const mapKey = data[key];\n if (!mapKey) {\n console.warn(\n 'Object has no key \"' +\n key.toString() +\n '\" therefore we do not know where to put it',\n );\n return acc;\n }\n if (!acc.has(mapKey)) {\n acc.set(mapKey, data);\n }\n return acc;\n }, new Map());\n};\n\nexport const throttle = <T extends (...args: any[]) => any>(\n func: T,\n delay: number = 16,\n): ((...funcArgs: Parameters<T>) => void) => {\n let time: number;\n let called = false;\n let skippedCalls = 0;\n let trailingCall: NodeJS.Timeout | null = null;\n return function (this: T, ..._args: Parameters<T>): void {\n if (!time) {\n time = Date.now();\n }\n if (!called || time + delay - Date.now() < 0) {\n func.apply(this, [...arguments]);\n time = Date.now();\n called = true;\n } else {\n skippedCalls++;\n }\n if (!trailingCall) {\n trailingCall = setInterval(() => {\n if (skippedCalls) {\n func.apply(this, [...arguments]);\n }\n skippedCalls = 0;\n if (trailingCall !== null) {\n clearInterval(trailingCall);\n }\n trailingCall = null;\n }, delay);\n }\n };\n};\n\n/**\n * Calls the function only if there has been no call for x (param after) milliseconds\n * @param func\n * @param after\n */\nexport const callAgainAfter = <T extends (...args: any[]) => any>(\n func: T,\n after: number = 16,\n): ((...funcArgs: Parameters<T>) => void) => {\n let lastCall: number;\n let called = false;\n return function (this: T, ..._args: Parameters<T>): void {\n if (!called || lastCall + after - Date.now() < 0) {\n lastCall = Date.now();\n func.apply(this, [...arguments]);\n called = true;\n } else {\n lastCall = Date.now();\n }\n };\n};\n\nexport const debounce = <Params extends any[]>(\n func: (...args: Params) => any,\n timeout: number,\n): ((...args: Params) => void) => {\n let timer: NodeJS.Timeout;\n return (...args: Params) => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n func(...args);\n }, timeout);\n };\n};\n\n/**\n * A generic type for a function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyFunction = (...args: any[]) => any;\n\n/**\n * Creates a debounced function that delays invoking `func` until after `delay`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked with the same key. The debounced function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them.\n *\n * T The type of the function to debounce.\n * @param {T} func The function to debounce.\n * @param {number} delay The number of milliseconds to delay.\n * @param {(...args: Parameters<T>) => unknown} [keyResolver]\n * Optional. A function to resolve the key from the arguments.\n * Defaults to using the first argument as the key.\n * @returns {((...args: Parameters<T>) => void)} The new debounced function.\n */\nexport const debounceByKey = <T extends AnyFunction>(\n func: T,\n delay: number,\n keyResolver?: (...args: Parameters<T>) => unknown,\n) => {\n // 1. Use a Map to store timers, keyed by your object or resolved key.\n // The key can be of any type, and the value is the timer ID from setTimeout.\n const timers = new Map<unknown, ReturnType<typeof setTimeout>>();\n\n // 2. The default resolver just uses the first argument as the key.\n const resolver = keyResolver || ((...args: Parameters<T>) => args[0]);\n\n // 3. Return the new debounced function.\n // It accepts the same parameters as the original function.\n return function (this: ThisParameterType<T>, ...args: Parameters<T>): void {\n // 4. Capture the 'this' context from the call.\n const context = this;\n\n // 5. Get the unique key for this specific call (e.g., the object itself).\n const key = resolver.apply(context, args);\n\n // 6. Check for an existing timer *for this specific key*.\n const existingTimer = timers.get(key);\n\n // 7. If a timer already exists for this key, clear it.\n if (existingTimer) {\n clearTimeout(existingTimer);\n }\n\n // 8. Set a new timer.\n const newTimer = setTimeout(() => {\n // 9. When the timer finally fires, call the original function\n // with the saved context and arguments from the *last* call.\n func.apply(context, args);\n\n // 10. Clean up the map to prevent memory leaks for this key.\n timers.delete(key);\n }, delay);\n\n // 11. Store the new timer ID, associated with its key.\n timers.set(key, newTimer);\n };\n};\n\n/**\n * Interface for storing a single promise's resolve and reject handlers.\n */\ninterface PromiseHandlers<T extends AnyFunction> {\n resolve: (value: ReturnType<T> | PromiseLike<ReturnType<T>>) => void;\n reject: (reason?: any) => void;\n}\n\n/**\n * Interface for storing timer details along with promise handlers for a given key.\n */\ninterface TimerDetails<T extends AnyFunction> {\n timer: ReturnType<typeof setTimeout>;\n handlers: Array<PromiseHandlers<T>>;\n context: ThisParameterType<T>;\n args: Parameters<T>;\n}\n\n/**\n * A key-debounced async function that additionally exposes `flush()` to run all\n * currently pending invocations immediately and resolve once they settle.\n */\nexport type DebouncedByKeyAsync<T extends AnyFunction> = ((\n ...args: Parameters<T>\n) => Promise<Awaited<ReturnType<T>>>) & {\n /**\n * Fire every pending (still-debouncing) invocation right now instead of waiting\n * for its timer, and resolve once all of them have settled.\n */\n flush: () => Promise<void>;\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `delay`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked with the same key. All calls made with the same key during the\n * delay period will have their returned promises resolved with the result\n * of the single final invocation.\n *\n * T The type of the function to debounce.\n * @param {T} func The function to debounce. This function can be synchronous or asynchronous.\n * @param {number} delay The number of milliseconds to delay.\n * @param {(...args: Parameters<T>) => unknown} [keyResolver]\n * Optional. A function to resolve the key from the arguments.\n * Defaults to using the first argument as the key.\n * @returns {((...args: Parameters<T>) => Promise<ReturnType<T>>)} The new debounced function.\n */\nexport const debounceByKeyAsync = <T extends AnyFunction>(\n func: T,\n delay: number,\n keyResolver?: (...args: Parameters<T>) => unknown,\n): DebouncedByKeyAsync<T> => {\n // 1. Use a Map to store timers and promise handlers, keyed by the resolved key.\n const timers = new Map<unknown, TimerDetails<T>>();\n\n // 2. The default resolver uses the first argument as the key.\n const resolver = keyResolver || ((...args: Parameters<T>) => args[0]);\n\n // Invoke `func` for a single pending key now, resolve/reject its handlers, and\n // remove it from the map. Shared by the timer callback and `flush()`.\n const fire = (key: unknown, details: TimerDetails<T>): Promise<void> => {\n clearTimeout(details.timer);\n timers.delete(key);\n return Promise.resolve(func.apply(details.context, details.args))\n .then((result) => {\n details.handlers.forEach((handler) => handler.resolve(result));\n })\n .catch((error) => {\n details.handlers.forEach((handler) => handler.reject(error));\n });\n };\n\n // 3. Return the new promise-based debounced function.\n const debounced = function (\n this: ThisParameterType<T>,\n ...args: Parameters<T>\n ): Promise<Awaited<ReturnType<T>>> {\n const context = this;\n const key = resolver.apply(context, args);\n\n return new Promise((resolve, reject) => {\n // 4. Check for existing timer details for this specific key.\n const existingTimerDetails = timers.get(key);\n\n // 5. If a timer already exists, clear it.\n if (existingTimerDetails) {\n clearTimeout(existingTimerDetails.timer);\n }\n\n // 6. Get the list of promise handlers, or create a new one.\n const handlers = existingTimerDetails?.handlers || [];\n handlers.push({ resolve, reject }); // Add the current promise's handlers.\n\n // 7. Store the timer plus the latest context/args so the invocation can be\n // fired either by the timer or eagerly by flush().\n const details: TimerDetails<T> = {\n timer: undefined as unknown as ReturnType<typeof setTimeout>,\n handlers,\n context,\n args,\n };\n details.timer = setTimeout(() => {\n void fire(key, details);\n }, delay);\n timers.set(key, details);\n });\n };\n\n // Run every pending invocation immediately (skipping the remaining debounce\n // delay) and resolve once all of them have settled.\n debounced.flush = (): Promise<void> => {\n const pending = Array.from(timers.entries()).map(([key, details]) =>\n fire(key, details),\n );\n return Promise.allSettled(pending).then(() => undefined);\n };\n\n return debounced;\n};\n\nexport const wait = async (delay: number): Promise<void> =>\n new Promise((resolve) => setTimeout(resolve, delay));\n\nexport const nextTick = async (): Promise<void> => wait(0);\n\nexport const withTimeout = <T>(\n promise: Promise<T>,\n message: string,\n timeout: number,\n): Promise<T> => {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const expired = new Promise<never>((_resolve, reject) => {\n timer = setTimeout(\n () => reject(new Error(`${message} (timed out after ${timeout}ms)`)),\n timeout,\n );\n });\n return Promise.race([promise, expired]).finally(() => clearTimeout(timer));\n};\n\nexport const roundWithPrecision = (float: number, precision: number) => {\n if (precision === -1) {\n return float;\n }\n const factor = Math.pow(10, precision);\n return Math.round(float * factor) / factor;\n};\n\nconst LEGACY_ASSET_URL_REG_EX = new RegExp(/\\/3d\\/[0-9]+\\//);\n\nexport const getGlbUrl = (item: RapiItem): string | null => {\n // use glb asset without ktx textures as default\n // glb2 used ktx textures\n if (item.assets?.glb?.url) {\n return item.assets.glb.url;\n }\n if (item.threeDimensionalAsset) {\n return item.threeDimensionalAsset;\n }\n const assetUrl = item.threeDimensionalAssetWeb;\n if (!assetUrl || typeof assetUrl !== 'string') {\n // Maybe we should introduce Nullable so we can turn on\n // strict null checks for SDK? But that's probably\n // a separate user story\n return null;\n }\n return !assetUrl.match(LEGACY_ASSET_URL_REG_EX)\n ? assetUrl\n : assetUrl\n .replace(LEGACY_ASSET_URL_REG_EX, '/3d/glb/')\n .replace('.flash.u3d', '.glb');\n};\n\n/**\n * Recursively merge properties of two objects.\n * If a property exists in both, property of obj2 is used\n * @param obj1\n * @param obj2\n */\nexport const deepMerge = (obj1: any, obj2: any): any => {\n for (const p in obj2) {\n try {\n // Property in destination object set; update its value.\n if (obj2[p].constructor === Object) {\n obj1[p] = deepMerge(obj1[p], obj2[p]);\n } else {\n obj1[p] = obj2[p];\n }\n } catch (_e) {\n // Property in destination object not set; create it and set its value.\n obj1[p] = obj2[p];\n }\n }\n return obj1;\n};\n\nexport const getValue = (value: any, defaultValue: any): any => {\n if (value === undefined) {\n return defaultValue;\n }\n return value;\n};\n\nexport const removeItem = (arr: any[], element: any) => {\n const index = arr.indexOf(element);\n if (index > -1) {\n arr.splice(index, 1);\n }\n};\n\nexport type ValuesFromObject<T> = T[keyof T];\n\nexport type MaybePromise<T> = (() => T) | (() => Promise<T>);\n\nexport const copy = <T>(object: T): T => {\n if (!object) {\n return object;\n }\n return JSON.parse(JSON.stringify(object));\n};\n\nexport const isWebGl2 = (): boolean => {\n const canvas = document.createElement('canvas');\n if (\n !canvas ||\n !canvas.getContext ||\n typeof canvas.getContext !== 'function'\n ) {\n return false;\n }\n try {\n return canvas ? !!canvas.getContext('webgl2') : false;\n } catch (_e) {\n return false;\n }\n};\n\n/**\n * Creates a proxy around that class that logs all calls to it\n * @param obj the class to trace\n * @param name the tag under which it will be logged\n */\nexport const traceMethodCalls = (obj: object, name: string) => {\n const handler = {\n get(target: any, propKey: any, receiver: any) {\n const targetValue = Reflect.get(target, propKey, receiver);\n if (typeof targetValue === 'function') {\n return function (...args: any) {\n console.trace(name, propKey, args);\n // @ts-ignore -- helper for better debugging, TS does not know what we are doing\n return targetValue.apply(this, args); // (A)\n };\n } else {\n return targetValue;\n }\n },\n };\n return new Proxy(obj, handler);\n};\n\n/**\n * Creates a proxy around that class that can be used to track property access\n * @param obj the class to track\n * @param name the tag under which it will be logged\n */\nexport const trackPropertyAccess = (obj: object, _name: string) => {\n const handler = {\n get(target: any, propKey: any, _receiver: any) {\n return target[propKey];\n },\n set(target: any, propKey: any, value: any, _receiver: any) {\n target[propKey] = value;\n return true;\n },\n };\n return new Proxy(obj, handler);\n};\n\nexport const getColor = (value: string | number | Color): Color => {\n if (isThreeJsColor(value)) {\n return value;\n }\n if (typeof value === 'string' && (isHex(value) || isOnlyNumbers(value))) {\n return new Color(Number(value));\n } else {\n return new Color(value);\n }\n};\n\nexport const isThreeJsColor = (value: any): value is Color => {\n return value instanceof Color;\n};\n\nexport const isHex = (num: string) => {\n return Boolean(num.match(/^0x[0-9a-f]+$/i));\n};\n\nexport const isOnlyNumbers = (num: string) => {\n return Boolean(num.match(/^[0-9]+$/i));\n};\n\nexport const parseColorToHexDecimal = (color: string) =>\n !color ? -1 : Number('0x' + color.substring(1));\n\n/**\n * Copies the properties of an incoming material to a kernel material, used mainly\n * to avoid copying core data when applying a material to a planObject\n * @param materialPtr Kernel material pointer to apply properties to\n * @param material material to copy color properties from\n */\nexport const applyMaterialToKernelMaterial = (\n materialPtr: KernelWallMaterial | KernelFloorMaterial,\n material: BatchPaintMaterial,\n): KernelWallMaterial | KernelFloorMaterial => {\n if (material.materialId) {\n materialPtr.materialId = material.materialId;\n } else if (material.color) {\n // Material is a hex string, so we convert it to a rgb value.\n materialPtr.rgbValue = parseColorToHexDecimal(material.color);\n } else if (material.rgbValue) {\n materialPtr.rgbValue = material.rgbValue;\n } else if (material.catalogItemId !== undefined) {\n materialPtr.catalogItemId = material.catalogItemId;\n } else if (material.id) {\n materialPtr.materialId = material.id;\n } else {\n console.warn(\n 'Can not set material because neither a texture nor a RGB value was found',\n );\n }\n return materialPtr;\n};\n\nexport const download = (filename: string, content: string): void => {\n const element = document.createElement('a');\n element.setAttribute('href', content);\n element.setAttribute('download', filename);\n\n element.style.display = 'none';\n document.body.appendChild(element);\n\n element.click();\n\n document.body.removeChild(element);\n};\n\nexport const areCameraParametersEqual = (\n start: CameraParameter,\n end: CameraParameter,\n): boolean => {\n if (!start || !end) {\n return false;\n }\n if (\n start.targetX === undefined ||\n end.targetX === undefined ||\n Math.abs(start.targetX - end.targetX) > 0.01\n ) {\n return false;\n }\n if (\n start.targetY === undefined ||\n end.targetY === undefined ||\n Math.abs(start.targetY - end.targetY) > 0.01\n ) {\n return false;\n }\n if (\n start.targetZ === undefined ||\n end.targetZ === undefined ||\n Math.abs(start.targetZ - end.targetZ) > 0.01\n ) {\n return false;\n }\n if (\n start.yaw === undefined ||\n end.yaw === undefined ||\n Math.abs(start.yaw - end.yaw) > 0.01\n ) {\n return false;\n }\n if (\n start.distance === undefined ||\n end.distance === undefined ||\n Math.abs(start.distance - end.distance) > 0.01\n ) {\n return false;\n }\n return true;\n};\n\n/**\n * transforms a value from one range (oldMin, oldMax) to a new range (newMin, newMax)\n * @param value the value to transform\n * @param oldMin\n * @param oldMax\n * @param newMin\n * @param newMax\n * @returns the transformed value\n */\nexport const transformRange = (\n value: number,\n oldMin: number,\n oldMax: number,\n newMin: number,\n newMax: number,\n): number => {\n return ((value - oldMin) * (newMax - newMin)) / (oldMax - oldMin) + newMin;\n};\n\nexport const hashCode = (value: string): number => {\n let hash = 0;\n if (value.length === 0) {\n return hash;\n }\n for (let i = 0; i < value.length; i++) {\n const chr = value.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n};\n\nexport const rearrangeArrayByIdOrder = <T extends RapiJson>(\n idsInOrder: RapiId[],\n rapiJson: T[],\n idKey: string = 'id',\n): T[] => {\n const indexMap = new Map<RapiId, number>();\n const length = idsInOrder.length;\n for (let i = 0; i < length; i++) {\n indexMap.set(idsInOrder[i], i);\n }\n\n const sortedResult = new Array<T>(length);\n\n // Place each element from the result array at its corresponding index in sortedResult\n const rapiJsonLength = rapiJson.length;\n for (let j = 0; j < rapiJsonLength; j++) {\n const entry = rapiJson[j];\n const id = entry[idKey];\n const index = indexMap.get(id as RapiId);\n if (index !== undefined) {\n sortedResult[index] = entry;\n } else {\n sortedResult.push(entry);\n }\n }\n\n return sortedResult.filter((element) => element !== undefined);\n};\n\nexport interface PromiseWithResolvers<T> {\n promise: Promise<T>;\n resolve: (value: T) => void;\n reject: (reason?: any) => void;\n}\n\nexport const promiseWithResolvers = <T>(): PromiseWithResolvers<T> => {\n let resolve!: (value: T) => void;\n let reject!: (reason?: any) => void;\n const promise = new Promise<T>((res, rej) => {\n resolve = res;\n reject = rej;\n });\n return { promise, resolve, reject };\n};\n\nexport const clamp = (value: number, min: number, max: number): number => {\n return Math.max(min, Math.min(max, value));\n};\n\nexport const randomString = (length: number = 8): string => {\n return [...Array(length)]\n .map(() => Math.random().toString(36).charAt(2))\n .join('');\n};\n\nexport const deepCopy = <T>(obj: T): T => {\n return JSON.parse(JSON.stringify(obj));\n};\n\nexport const isRecord = (value: any): value is Record<string, any> => {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n};\n\nexport const getIdQueryParam = (urlString: string): string | null => {\n try {\n const url = new URL(urlString);\n const params = new URLSearchParams(url.search);\n return params.get('id');\n } catch (_error) {\n return null; // Return null if URL is invalid or 'id' param is not found\n }\n};\n\nexport const isCtrlOrCmd = (event: KeyboardEvent) =>\n event.key === 'Meta' || event.key === 'Control';\n\nexport const ctrlOrCmd = (\n event: KeyboardEvent,\n checkIfItIsTheOnlyKey: boolean = false,\n) => {\n const isMultiSelectKey =\n checkIfItIsTheOnlyKey === false\n ? checkIfItIsTheOnlyKey\n : isCtrlOrCmd(event);\n return event.key && (event.metaKey || event.ctrlKey || isMultiSelectKey);\n};\n\nexport const runIfNotEmpty = <T extends any[]>(\n ids: string[],\n executor: () => Promise<T>,\n): Promise<T> => {\n if (!ids || ids.length === 0) {\n return Promise.resolve([] as unknown as T);\n }\n return executor();\n};\n"],"mappings":";;AAiKA,IAAkB,IAAX,yBAAA,GAAA;QACL,EAAA,MAAA,OACA,EAAA,OAAA,QACA,EAAA,MAAA,OACA,EAAA,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AAe,MAC1B,EAAM,QAAQ,UAAU,EAAM,QAAQ,WAE3B,KACX,GACA,IAAiC,OAC9B;CACH,IAAM,IACJ,MAA0B,KACtB,IACA,EAAY,EAAM;AACxB,QAAO,EAAM,QAAQ,EAAM,WAAW,EAAM,WAAW"}
@@ -1,7 +1,7 @@
1
- import { R as e } from "./threejs-utils-C9zED_Tu.mjs";
1
+ import { R as e } from "./threejs-utils-CKV1QNU9.mjs";
2
2
  import { Bt as t, Ci as n, Tn as r, Vt as i, h as a, m as o, zt as s } from "./three.core-0KaTx8dm.mjs";
3
- import { n as c, r as l, t as u } from "./decorate-CX1ZGuFY.mjs";
4
- import { c as d, t as f } from "./dimensioning-helper-BwvR76_I.mjs";
3
+ import { n as c, r as l, t as u } from "./decorate-CjaqqbUP.mjs";
4
+ import { c as d, t as f } from "./dimensioning-helper-Cgao7A18.mjs";
5
5
  import { a as p } from "./kernel-utils-voLUOj-0.mjs";
6
6
  import { t as m } from "./layer-DvZF9ur3.mjs";
7
7
  //#region packages/configurator-core/src/utils/component-dimensioning-html-util.ts
@@ -165,4 +165,4 @@ u([l, c("design:type", Object)], w.prototype, "_cacheHolder", void 0), u([l, c("
165
165
  //#endregion
166
166
  export { w as default };
167
167
 
168
- //# sourceMappingURL=component-dimensioning-DJuokZnv.mjs.map
168
+ //# sourceMappingURL=component-dimensioning--4sX2AgY.mjs.map