kitchen-simulator 1.1.1-test.49 → 1.1.1-test.50

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 (358) hide show
  1. package/es/@history.js +2 -0
  2. package/es/AppContext.js +3 -0
  3. package/es/KitchenConfigurator.js +645 -0
  4. package/es/KitchenConfiguratorApp.js +480 -0
  5. package/es/actions/area-actions.js +14 -0
  6. package/es/actions/export.js +23 -0
  7. package/es/actions/groups-actions.js +89 -0
  8. package/es/actions/holes-actions.js +119 -0
  9. package/es/actions/items-actions.js +313 -0
  10. package/es/actions/lines-actions.js +81 -0
  11. package/es/actions/project-actions.js +281 -0
  12. package/es/actions/scene-actions.js +33 -0
  13. package/es/actions/vertices-actions.js +27 -0
  14. package/es/actions/viewer2d-actions.js +58 -0
  15. package/es/actions/viewer3d-actions.js +23 -0
  16. package/es/catalog/areas/area/planner-element.js +40 -0
  17. package/es/catalog/areas/area/textures/ceramic-tile.jpg +0 -0
  18. package/es/catalog/areas/area/textures/grass.jpg +0 -0
  19. package/es/catalog/areas/area/textures/parquet.jpg +0 -0
  20. package/es/catalog/areas/area/textures/strand-porcelain.jpg +0 -0
  21. package/es/catalog/areas/area/textures/tile1.jpg +0 -0
  22. package/es/catalog/catalog.js +277 -0
  23. package/es/catalog/envMap/nx.hdr +0 -0
  24. package/es/catalog/envMap/ny.hdr +0 -0
  25. package/es/catalog/envMap/nz.hdr +0 -0
  26. package/es/catalog/envMap/px.hdr +0 -0
  27. package/es/catalog/envMap/py.hdr +0 -0
  28. package/es/catalog/envMap/pz.hdr +0 -0
  29. package/es/catalog/factories/area-factory-3d.js +181 -0
  30. package/es/catalog/factories/area-factory.js +81 -0
  31. package/es/catalog/factories/export.js +7 -0
  32. package/es/catalog/factories/wall-factory-3d.js +202 -0
  33. package/es/catalog/factories/wall-factory.js +268 -0
  34. package/es/catalog/holes/door-closet/planner-element.js +222 -0
  35. package/es/catalog/holes/door-double/door_double.png +0 -0
  36. package/es/catalog/holes/door-double/planner-element.js +315 -0
  37. package/es/catalog/holes/door-exterior/planner-element.js +215 -0
  38. package/es/catalog/holes/door-interior/planner-element.js +227 -0
  39. package/es/catalog/holes/door-panic/panicDoor.png +0 -0
  40. package/es/catalog/holes/door-panic/planner-element.js +503 -0
  41. package/es/catalog/holes/door-panic-double/panicDoorDouble.png +0 -0
  42. package/es/catalog/holes/door-panic-double/planner-element.js +463 -0
  43. package/es/catalog/holes/door-sliding/planner-element.js +225 -0
  44. package/es/catalog/holes/doorway-framed/planner-element.js +145 -0
  45. package/es/catalog/holes/doorway-frameless/planner-element.js +104 -0
  46. package/es/catalog/holes/export.js +13 -0
  47. package/es/catalog/holes/gate/gate.jpg +0 -0
  48. package/es/catalog/holes/window-clear/planner-element.js +166 -0
  49. package/es/catalog/holes/window-clear/texture.png +0 -0
  50. package/es/catalog/holes/window-cross/planner-element.js +165 -0
  51. package/es/catalog/holes/window-cross/texture.png +0 -0
  52. package/es/catalog/holes/window-double-hung/planner-element.js +303 -0
  53. package/es/catalog/holes/window-double-hung/texture.png +0 -0
  54. package/es/catalog/holes/window-vertical/planner-element.js +276 -0
  55. package/es/catalog/holes/window-vertical/texture.png +0 -0
  56. package/es/catalog/lines/wall/planner-element.js +70 -0
  57. package/es/catalog/lines/wall/textures/bricks-normal.jpg +0 -0
  58. package/es/catalog/lines/wall/textures/bricks-normal2.jpg +0 -0
  59. package/es/catalog/lines/wall/textures/bricks.jpg +0 -0
  60. package/es/catalog/lines/wall/textures/bricks2.jpg +0 -0
  61. package/es/catalog/lines/wall/textures/bricks3.jpg +0 -0
  62. package/es/catalog/lines/wall/textures/morden-normal.jpg +0 -0
  63. package/es/catalog/lines/wall/textures/morden.jpg +0 -0
  64. package/es/catalog/lines/wall/textures/painted-normal.jpg +0 -0
  65. package/es/catalog/lines/wall/textures/painted.jpg +0 -0
  66. package/es/catalog/lines/wall/textures/plaster-normal.jpg +0 -0
  67. package/es/catalog/lines/wall/textures/plaster.jpg +0 -0
  68. package/es/catalog/lines/wall/wall.png +0 -0
  69. package/es/catalog/molding/molding-dcm/planner-element.js +28 -0
  70. package/es/catalog/molding/molding-dcm/texture.png +0 -0
  71. package/es/catalog/molding/molding-fbm/planner-element.js +28 -0
  72. package/es/catalog/molding/molding-fbm/texture.png +0 -0
  73. package/es/catalog/molding/molding-lrm/planner-element.js +28 -0
  74. package/es/catalog/molding/molding-lrm/texture.png +0 -0
  75. package/es/catalog/properties/export.js +21 -0
  76. package/es/catalog/properties/property-checkbox.js +116 -0
  77. package/es/catalog/properties/property-color.js +39 -0
  78. package/es/catalog/properties/property-enum.js +97 -0
  79. package/es/catalog/properties/property-hidden.js +19 -0
  80. package/es/catalog/properties/property-lenght-measure.js +101 -0
  81. package/es/catalog/properties/property-length-measure.js +134 -0
  82. package/es/catalog/properties/property-length-measure_hole.js +101 -0
  83. package/es/catalog/properties/property-number.js +48 -0
  84. package/es/catalog/properties/property-read-only.js +26 -0
  85. package/es/catalog/properties/property-string.js +48 -0
  86. package/es/catalog/properties/property-toggle.js +39 -0
  87. package/es/catalog/properties/shared-property-style.js +14 -0
  88. package/es/catalog/utils/FuseUtils.js +82 -0
  89. package/es/catalog/utils/exporter.js +148 -0
  90. package/es/catalog/utils/geom-utils.js +189 -0
  91. package/es/catalog/utils/item-loader.js +1521 -0
  92. package/es/catalog/utils/load-obj.js +91 -0
  93. package/es/catalog/utils/mtl-loader.js +358 -0
  94. package/es/catalog/utils/obj-loader.js +477 -0
  95. package/es/class/FuseUtils.js +82 -0
  96. package/es/class/area.js +145 -0
  97. package/es/class/export.js +24 -0
  98. package/es/class/group.js +440 -0
  99. package/es/class/guide.js +62 -0
  100. package/es/class/hole.js +929 -0
  101. package/es/class/item.js +1883 -0
  102. package/es/class/layer.js +667 -0
  103. package/es/class/line.js +1180 -0
  104. package/es/class/project.js +793 -0
  105. package/es/class/vertex.js +202 -0
  106. package/es/components/content.js +107 -0
  107. package/es/components/disclaimer/disclaimer.js +97 -0
  108. package/es/components/export.js +9 -0
  109. package/es/components/style/button.js +113 -0
  110. package/es/components/style/cancel-button.js +22 -0
  111. package/es/components/style/content-container.js +33 -0
  112. package/es/components/style/content-title.js +29 -0
  113. package/es/components/style/delete-button.js +25 -0
  114. package/es/components/style/export.js +31 -0
  115. package/es/components/style/form-block.js +24 -0
  116. package/es/components/style/form-color-input.js +27 -0
  117. package/es/components/style/form-label.js +26 -0
  118. package/es/components/style/form-number-input.js +213 -0
  119. package/es/components/style/form-number-input_2.js +206 -0
  120. package/es/components/style/form-select.js +68 -0
  121. package/es/components/style/form-slider.js +61 -0
  122. package/es/components/style/form-submit-button.js +26 -0
  123. package/es/components/style/form-text-input.js +95 -0
  124. package/es/components/viewer2d/area.js +81 -0
  125. package/es/components/viewer2d/export.js +31 -0
  126. package/es/components/viewer2d/grids/grid-horizontal-streak.js +37 -0
  127. package/es/components/viewer2d/grids/grid-streak.js +37 -0
  128. package/es/components/viewer2d/grids/grid-vertical-streak.js +37 -0
  129. package/es/components/viewer2d/grids/grids.js +35 -0
  130. package/es/components/viewer2d/group.js +53 -0
  131. package/es/components/viewer2d/item.js +513 -0
  132. package/es/components/viewer2d/layer.js +164 -0
  133. package/es/components/viewer2d/line.js +882 -0
  134. package/es/components/viewer2d/ruler.js +100 -0
  135. package/es/components/viewer2d/rulerDist.js +146 -0
  136. package/es/components/viewer2d/rulerX.js +151 -0
  137. package/es/components/viewer2d/rulerY.js +153 -0
  138. package/es/components/viewer2d/scene.js +140 -0
  139. package/es/components/viewer2d/snap.js +74 -0
  140. package/es/components/viewer2d/state.js +78 -0
  141. package/es/components/viewer2d/utils.js +198 -0
  142. package/es/components/viewer2d/vertex.js +65 -0
  143. package/es/components/viewer2d/viewer2d.js +1398 -0
  144. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +2592 -0
  145. package/es/components/viewer3d/dcm.js +401 -0
  146. package/es/components/viewer3d/fbm.js +414 -0
  147. package/es/components/viewer3d/front3D.js +66 -0
  148. package/es/components/viewer3d/grid-creator.js +25 -0
  149. package/es/components/viewer3d/grids/grid-horizontal-streak.js +36 -0
  150. package/es/components/viewer3d/grids/grid-streak.js +27 -0
  151. package/es/components/viewer3d/grids/grid-vertical-streak.js +36 -0
  152. package/es/components/viewer3d/libs/first-person-controls.js +67 -0
  153. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +1281 -0
  154. package/es/components/viewer3d/libs/mtl-loader.js +357 -0
  155. package/es/components/viewer3d/libs/obj-loader.js +462 -0
  156. package/es/components/viewer3d/libs/orbit-controls.js +699 -0
  157. package/es/components/viewer3d/libs/pointer-lock-controls.js +46 -0
  158. package/es/components/viewer3d/lrm.js +305 -0
  159. package/es/components/viewer3d/model.js +708 -0
  160. package/es/components/viewer3d/pointer-lock-navigation.js +115 -0
  161. package/es/components/viewer3d/ruler-utils/itemRect.js +61 -0
  162. package/es/components/viewer3d/ruler-utils/layer3D.js +495 -0
  163. package/es/components/viewer3d/ruler-utils/ruler3D.js +227 -0
  164. package/es/components/viewer3d/ruler-utils/scene3D.js +60 -0
  165. package/es/components/viewer3d/ruler-utils/state3D.js +18 -0
  166. package/es/components/viewer3d/scene-creator.js +3608 -0
  167. package/es/components/viewer3d/three-memory-cleaner.js +51 -0
  168. package/es/components/viewer3d/viewer3d-first-person.js +315 -0
  169. package/es/components/viewer3d/viewer3d.js +2527 -0
  170. package/es/constants.js +636 -0
  171. package/es/index.js +16 -0
  172. package/es/models.js +510 -0
  173. package/es/plugins/SVGLoader.js +1412 -0
  174. package/es/plugins/autosave.js +33 -0
  175. package/es/plugins/console-debugger.js +37 -0
  176. package/es/plugins/export.js +9 -0
  177. package/es/plugins/keyboard.js +101 -0
  178. package/es/reducers/areas-reducer.js +12 -0
  179. package/es/reducers/export.js +25 -0
  180. package/es/reducers/groups-reducer.js +38 -0
  181. package/es/reducers/holes-reducer.js +62 -0
  182. package/es/reducers/items-reducer.js +140 -0
  183. package/es/reducers/lines-reducer.js +45 -0
  184. package/es/reducers/project-reducer.js +129 -0
  185. package/es/reducers/reducer.js +19 -0
  186. package/es/reducers/scene-reducer.js +28 -0
  187. package/es/reducers/user-reducer.js +40 -0
  188. package/es/reducers/vertices-reducer.js +19 -0
  189. package/es/reducers/viewer2d-reducer.js +75 -0
  190. package/es/reducers/viewer3d-reducer.js +56 -0
  191. package/es/shared-style.js +66 -0
  192. package/es/styles/export.js +5 -0
  193. package/es/styles/tabs.css +40 -0
  194. package/es/translator/en.js +104 -0
  195. package/es/translator/it.js +79 -0
  196. package/es/translator/ru.js +79 -0
  197. package/es/translator/translator.js +84 -0
  198. package/es/utils/browser.js +33 -0
  199. package/es/utils/email-validator.js +4 -0
  200. package/es/utils/export.js +25 -0
  201. package/es/utils/geometry.js +2420 -0
  202. package/es/utils/get-edges-of-subgraphs.js +27 -0
  203. package/es/utils/graph-cycles.js +237 -0
  204. package/es/utils/graph-inner-cycles.js +46 -0
  205. package/es/utils/graph.js +150 -0
  206. package/es/utils/helper.js +268 -0
  207. package/es/utils/history.js +29 -0
  208. package/es/utils/id-broker.js +19 -0
  209. package/es/utils/logger.js +8 -0
  210. package/es/utils/math.js +50 -0
  211. package/es/utils/molding.js +871 -0
  212. package/es/utils/name-generator.js +18 -0
  213. package/es/utils/objects-utils.js +50 -0
  214. package/es/utils/phone-validator.js +4 -0
  215. package/es/utils/process-black-list.js +18 -0
  216. package/es/utils/react-if.js +18 -0
  217. package/es/utils/snap-scene.js +99 -0
  218. package/es/utils/snap.js +237 -0
  219. package/es/utils/summarizeCart.js +24 -0
  220. package/es/utils/threeCSG.es6.js +498 -0
  221. package/es/version.js +2 -0
  222. package/lib/catalog/properties/property-string.js +55 -0
  223. package/lib/catalog/properties/property-toggle.js +46 -0
  224. package/lib/catalog/properties/shared-property-style.js +20 -0
  225. package/lib/catalog/utils/FuseUtils.js +88 -0
  226. package/lib/catalog/utils/exporter.js +155 -0
  227. package/lib/catalog/utils/geom-utils.js +205 -0
  228. package/lib/catalog/utils/item-loader.js +1533 -0
  229. package/lib/catalog/utils/load-obj.js +99 -0
  230. package/lib/catalog/utils/mtl-loader.js +363 -0
  231. package/lib/catalog/utils/obj-loader.js +482 -0
  232. package/lib/class/FuseUtils.js +88 -0
  233. package/lib/class/area.js +150 -0
  234. package/lib/class/export.js +96 -0
  235. package/lib/class/group.js +445 -0
  236. package/lib/class/guide.js +67 -0
  237. package/lib/class/hole.js +934 -0
  238. package/lib/class/item.js +1889 -0
  239. package/lib/class/layer.js +672 -0
  240. package/lib/class/line.js +1186 -0
  241. package/lib/class/project.js +799 -0
  242. package/lib/class/vertex.js +207 -0
  243. package/lib/components/content.js +116 -0
  244. package/lib/components/disclaimer/disclaimer.js +105 -0
  245. package/lib/components/export.js +33 -0
  246. package/lib/components/style/button.js +120 -0
  247. package/lib/components/style/cancel-button.js +29 -0
  248. package/lib/components/style/content-container.js +40 -0
  249. package/lib/components/style/content-title.js +37 -0
  250. package/lib/components/style/delete-button.js +34 -0
  251. package/lib/components/style/export.js +121 -0
  252. package/lib/components/style/form-block.js +31 -0
  253. package/lib/components/style/form-color-input.js +34 -0
  254. package/lib/components/style/form-label.js +33 -0
  255. package/lib/components/style/form-number-input.js +220 -0
  256. package/lib/components/style/form-number-input_2.js +213 -0
  257. package/lib/components/style/form-select.js +75 -0
  258. package/lib/components/style/form-slider.js +68 -0
  259. package/lib/components/style/form-submit-button.js +35 -0
  260. package/lib/components/style/form-text-input.js +101 -0
  261. package/lib/components/viewer2d/area.js +88 -0
  262. package/lib/components/viewer2d/export.js +121 -0
  263. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +44 -0
  264. package/lib/components/viewer2d/grids/grid-streak.js +44 -0
  265. package/lib/components/viewer2d/grids/grid-vertical-streak.js +44 -0
  266. package/lib/components/viewer2d/grids/grids.js +44 -0
  267. package/lib/components/viewer2d/group.js +62 -0
  268. package/lib/components/viewer2d/item.js +521 -0
  269. package/lib/components/viewer2d/layer.js +171 -0
  270. package/lib/components/viewer2d/line.js +892 -0
  271. package/lib/components/viewer2d/ruler.js +107 -0
  272. package/lib/components/viewer2d/rulerDist.js +153 -0
  273. package/lib/components/viewer2d/rulerX.js +158 -0
  274. package/lib/components/viewer2d/rulerY.js +160 -0
  275. package/lib/components/viewer2d/scene.js +147 -0
  276. package/lib/components/viewer2d/snap.js +83 -0
  277. package/lib/components/viewer2d/state.js +87 -0
  278. package/lib/components/viewer2d/utils.js +210 -0
  279. package/lib/components/viewer2d/vertex.js +74 -0
  280. package/lib/components/viewer2d/viewer2d.js +1405 -0
  281. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +2597 -0
  282. package/lib/components/viewer3d/dcm.js +407 -0
  283. package/lib/components/viewer3d/fbm.js +420 -0
  284. package/lib/components/viewer3d/front3D.js +75 -0
  285. package/lib/components/viewer3d/grid-creator.js +34 -0
  286. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +44 -0
  287. package/lib/components/viewer3d/grids/grid-streak.js +35 -0
  288. package/lib/components/viewer3d/grids/grid-vertical-streak.js +44 -0
  289. package/lib/components/viewer3d/libs/first-person-controls.js +74 -0
  290. package/lib/components/viewer3d/libs/helvetiker_regular.typeface.js +1287 -0
  291. package/lib/components/viewer3d/libs/mtl-loader.js +363 -0
  292. package/lib/components/viewer3d/libs/obj-loader.js +468 -0
  293. package/lib/components/viewer3d/libs/orbit-controls.js +705 -0
  294. package/lib/components/viewer3d/libs/pointer-lock-controls.js +52 -0
  295. package/lib/components/viewer3d/lrm.js +311 -0
  296. package/lib/components/viewer3d/model.js +714 -0
  297. package/lib/components/viewer3d/pointer-lock-navigation.js +122 -0
  298. package/lib/components/viewer3d/ruler-utils/itemRect.js +68 -0
  299. package/lib/components/viewer3d/ruler-utils/layer3D.js +502 -0
  300. package/lib/components/viewer3d/ruler-utils/ruler3D.js +234 -0
  301. package/lib/components/viewer3d/ruler-utils/scene3D.js +68 -0
  302. package/lib/components/viewer3d/ruler-utils/state3D.js +25 -0
  303. package/lib/components/viewer3d/scene-creator.js +3642 -0
  304. package/lib/components/viewer3d/three-memory-cleaner.js +60 -0
  305. package/lib/components/viewer3d/viewer3d-first-person.js +320 -0
  306. package/lib/components/viewer3d/viewer3d.js +2532 -0
  307. package/lib/constants.js +645 -0
  308. package/lib/index.js +96 -0
  309. package/lib/models.js +517 -0
  310. package/lib/plugins/SVGLoader.js +1417 -0
  311. package/lib/plugins/autosave.js +39 -0
  312. package/lib/plugins/console-debugger.js +44 -0
  313. package/lib/plugins/export.js +33 -0
  314. package/lib/plugins/keyboard.js +107 -0
  315. package/lib/reducers/areas-reducer.js +18 -0
  316. package/lib/reducers/export.js +97 -0
  317. package/lib/reducers/groups-reducer.js +44 -0
  318. package/lib/reducers/holes-reducer.js +68 -0
  319. package/lib/reducers/items-reducer.js +146 -0
  320. package/lib/reducers/lines-reducer.js +51 -0
  321. package/lib/reducers/project-reducer.js +135 -0
  322. package/lib/reducers/reducer.js +26 -0
  323. package/lib/reducers/scene-reducer.js +34 -0
  324. package/lib/reducers/user-reducer.js +46 -0
  325. package/lib/reducers/vertices-reducer.js +25 -0
  326. package/lib/reducers/viewer2d-reducer.js +82 -0
  327. package/lib/reducers/viewer3d-reducer.js +63 -0
  328. package/lib/shared-style.js +72 -0
  329. package/lib/styles/export.js +13 -0
  330. package/lib/translator/en.js +110 -0
  331. package/lib/translator/it.js +85 -0
  332. package/lib/translator/ru.js +85 -0
  333. package/lib/translator/translator.js +90 -0
  334. package/lib/utils/browser.js +40 -0
  335. package/lib/utils/email-validator.js +10 -0
  336. package/lib/utils/export.js +56 -0
  337. package/lib/utils/geometry.js +2516 -0
  338. package/lib/utils/get-edges-of-subgraphs.js +34 -0
  339. package/lib/utils/graph-cycles.js +240 -0
  340. package/lib/utils/graph-inner-cycles.js +54 -0
  341. package/lib/utils/graph.js +157 -0
  342. package/lib/utils/helper.js +291 -0
  343. package/lib/utils/history.js +36 -0
  344. package/lib/utils/id-broker.js +25 -0
  345. package/lib/utils/logger.js +14 -0
  346. package/lib/utils/math.js +57 -0
  347. package/lib/utils/molding.js +895 -0
  348. package/lib/utils/name-generator.js +23 -0
  349. package/lib/utils/objects-utils.js +60 -0
  350. package/lib/utils/phone-validator.js +10 -0
  351. package/lib/utils/process-black-list.js +24 -0
  352. package/lib/utils/react-if.js +24 -0
  353. package/lib/utils/snap-scene.js +105 -0
  354. package/lib/utils/snap.js +249 -0
  355. package/lib/utils/summarizeCart.js +30 -0
  356. package/lib/utils/threeCSG.es6.js +503 -0
  357. package/lib/version.js +8 -0
  358. package/package.json +3 -3
@@ -0,0 +1,480 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["width", "height", "projectElement", "categoryData", "dataBundle", "configData", "toolbarButtons", "options", "user", "auth", "featureFlags", "sentry", "analytics", "onEvent", "onSave", "onError"];
3
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
10
+ function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
11
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
12
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
13
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
14
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
16
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
17
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
19
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
20
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
21
+ import React, { useEffect } from 'react';
22
+ import PropTypes from 'prop-types';
23
+ import { Provider } from 'react-redux';
24
+ import { createStore } from 'redux';
25
+ import * as Models from "./models";
26
+ import KitchenConfigurator from "./KitchenConfigurator";
27
+ import AppContext from "./AppContext";
28
+ import Catalog from "./catalog/catalog";
29
+ import { SVGLoader } from 'three/addons/loaders/SVGLoader';
30
+ import { isEmpty } from "./utils/helper";
31
+ import { TOE_KICK_MOLDING } from "./constants";
32
+ import * as Areas from "./catalog/areas/area/planner-element";
33
+ import * as Lines from "./catalog/lines/wall/planner-element";
34
+ import * as Holes from "./catalog/holes/export";
35
+ import { render2DItem, render3DApplianceItem, render3DItem, render3DLightingItem } from "./catalog/utils/item-loader";
36
+ import { Models as PlannerModels, Plugins as PlannerPlugins, reducer as PlannerReducer } from "./index";
37
+ import { Map } from 'immutable';
38
+ import * as Sentry from '@sentry/react';
39
+ import { loadProject, rename } from "./actions/project-actions";
40
+ import exporter from "./catalog/utils/exporter";
41
+ import * as THREE from 'three';
42
+ if (typeof window !== 'undefined') window.THREE = THREE;
43
+
44
+ /* ============================== component ============================= */
45
+ var MyCatalog = new Catalog();
46
+ var AppState = Map({
47
+ KitchenConfigurator: new PlannerModels.State()
48
+ });
49
+ console.log('Version: 378.45-202509_DIY-364-mbox-crash');
50
+ isProduction && Sentry.init({
51
+ dsn: process.env.SENTRY_DSN,
52
+ environment: process.env.SENTRY_ENVIRONMENT
53
+ });
54
+
55
+ //define reducer
56
+ var reducer = function reducer(state, action) {
57
+ state = state || AppState;
58
+ state = state.update('KitchenConfigurator', function (plannerState) {
59
+ return PlannerReducer(plannerState, action);
60
+ });
61
+ return state;
62
+ };
63
+ var store = createStore(reducer, null, !isProduction && window.devToolsExtension ? window.devToolsExtension({
64
+ features: {
65
+ pause: true,
66
+ // start/pause recording of dispatched actions
67
+ lock: true,
68
+ // lock/unlock dispatching actions and side effects
69
+ persist: true,
70
+ // persist states on page reloading
71
+ "export": true,
72
+ // export history of actions in a file
73
+ "import": 'custom',
74
+ // import history of actions from a file
75
+ jump: true,
76
+ // jump back and forth (time travelling)
77
+ skip: true,
78
+ // skip (cancel) actions
79
+ reorder: true,
80
+ // drag and drop actions in the history list
81
+ dispatch: true,
82
+ // dispatch custom actions or action creators
83
+ test: true // generate tests for the selected actions
84
+ },
85
+ maxAge: 999999
86
+ }) : function (f) {
87
+ return f;
88
+ });
89
+ var plugins = [PlannerPlugins.Keyboard(), PlannerPlugins.ConsoleDebugger()];
90
+ export default function KitchenConfiguratorApp(props) {
91
+ var width = props.width,
92
+ height = props.height,
93
+ projectElement = props.projectElement,
94
+ categoryData = props.categoryData,
95
+ dataBundle = props.dataBundle,
96
+ configData = props.configData,
97
+ toolbarButtons = props.toolbarButtons,
98
+ options = props.options,
99
+ user = props.user,
100
+ auth = props.auth,
101
+ featureFlags = props.featureFlags,
102
+ sentry = props.sentry,
103
+ analytics = props.analytics,
104
+ onEvent = props.onEvent,
105
+ onSave = props.onSave,
106
+ onError = props.onError,
107
+ passThrough = _objectWithoutProperties(props, _excluded);
108
+ var _ref = categoryData && categoryData.data || {},
109
+ catalogs = _ref.catalogs,
110
+ colorAlias = _ref.colorAlias,
111
+ subgroups = _ref.subgroups;
112
+ var _ref2 = dataBundle || {},
113
+ _ref2$data = _ref2.data,
114
+ data = _ref2$data === void 0 ? [] : _ref2$data,
115
+ _ref2$appliances = _ref2.appliances,
116
+ appliances = _ref2$appliances === void 0 ? [] : _ref2$appliances,
117
+ _ref2$furnishing = _ref2.furnishing,
118
+ furnishing = _ref2$furnishing === void 0 ? [] : _ref2$furnishing,
119
+ _ref2$lighting = _ref2.lighting,
120
+ lighting = _ref2$lighting === void 0 ? [] : _ref2$lighting;
121
+ var _projectElement = _slicedToArray(projectElement, 1),
122
+ project_data = _projectElement[0].project_data;
123
+ var id = configData.id,
124
+ logoImg = configData.logoImg,
125
+ companyUrl = configData.companyUrl;
126
+ var _React$useState = React.useState([]),
127
+ _React$useState2 = _slicedToArray(_React$useState, 2),
128
+ outlineSVGData = _React$useState2[0],
129
+ setOutlineSVGData = _React$useState2[1];
130
+ var _React$useState3 = React.useState(false),
131
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
132
+ catalogInitiated = _React$useState4[0],
133
+ setCatalogInitiated = _React$useState4[1];
134
+ useEffect(function () {
135
+ var initMyCatalog = /*#__PURE__*/function () {
136
+ var _ref3 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
137
+ var x, _x, _x2;
138
+ return _regenerator().w(function (_context) {
139
+ while (1) switch (_context.n) {
140
+ case 0:
141
+ for (x in Areas) MyCatalog.registerElement(Areas[x]);
142
+ for (_x in Lines) MyCatalog.registerElement(Lines[_x]);
143
+ for (_x2 in Holes) MyCatalog.registerElement(Holes[_x2]);
144
+ MyCatalog.registerCategory('Windows', 'Windows', [Holes.windowClear, Holes.windowCross, Holes.windowDoubleHung, Holes.windowVertical]);
145
+ MyCatalog.registerCategory('Doors', 'Doors', [Holes.doorInterior, Holes.doorExterior, Holes.doorCloset, Holes.doorSliding, Holes.doorwayFramed, Holes.doorwayFrameless]);
146
+ case 1:
147
+ return _context.a(2);
148
+ }
149
+ }, _callee);
150
+ }));
151
+ return function initMyCatalog() {
152
+ return _ref3.apply(this, arguments);
153
+ };
154
+ }();
155
+ var loadMoldings = /*#__PURE__*/function () {
156
+ var _ref4 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
157
+ var door_color_alias, subgroup_ids, door_color_alias_ids, doorStyleData, molding, toeMoldingData, cabinets, promises;
158
+ return _regenerator().w(function (_context2) {
159
+ while (1) switch (_context2.n) {
160
+ case 0:
161
+ door_color_alias = [];
162
+ subgroup_ids = catalogs.filter(function (item) {
163
+ return item.id == id;
164
+ })[0].manufacturer_subgroup_ids.split(',');
165
+ door_color_alias_ids = [];
166
+ subgroups.forEach(function (subgroup) {
167
+ if (subgroup_ids.some(function (id) {
168
+ return id == subgroup.id.toString();
169
+ })) {
170
+ subgroup.door_color_alias_ids.split(',').forEach(function (item) {
171
+ item != '' && door_color_alias_ids.push(item);
172
+ });
173
+ }
174
+ });
175
+ colorAlias.forEach(function (color) {
176
+ return door_color_alias_ids.some(function (id) {
177
+ return id == color.id.toString();
178
+ }) && door_color_alias.push(color);
179
+ });
180
+ doorStyleData = categoryData.data.doorStyles.items;
181
+ categoryData.data.doorStyles.items = doorStyleData.treeStruct;
182
+ door_color_alias.forEach(function (dca) {
183
+ doorStyleData.doorColorData.forEach(function (dc) {
184
+ dc.door_style_id = parseInt(dc.door_style_id);
185
+ if (dc.id !== dca.door_color_id) return;
186
+ dc.name = dca.alias_name;
187
+ dc.color_sku_alias = dca.sku_alias_name;
188
+ doorStyleData.treeStruct.forEach(function (el) {
189
+ el.items.forEach(function (elem) {
190
+ return dc.door_style_id === elem.id && (dc.door_style_name = elem.name);
191
+ });
192
+ });
193
+ dca.alias_installation_type = isEmpty(dca.alias_installation_type) ? [] : dca.alias_installation_type.split(',').map(function (n) {
194
+ return parseInt(n);
195
+ });
196
+ categoryData.data.doorStyles.items.forEach(function (item) {
197
+ if (dca.alias_installation_type.some(function (ait) {
198
+ return ait === item.id;
199
+ })) item.items.forEach(function (ds) {
200
+ if (ds.name === dc.door_style_name) ds.items.push(dc);
201
+ });
202
+ });
203
+ });
204
+ });
205
+ molding = [];
206
+ toeMoldingData = [];
207
+ cabinets = categoryData.data.cabinets;
208
+ cabinets[cabinets.length - 1].items.forEach(function (index) {
209
+ if (index.name.toLowerCase().includes('molding')) {
210
+ index.items.forEach(function (item) {
211
+ return molding.push(item);
212
+ });
213
+ }
214
+ if (index.name.includes(TOE_KICK_MOLDING)) {
215
+ index.items.forEach(function (item) {
216
+ return toeMoldingData.push(item);
217
+ });
218
+ }
219
+ });
220
+ categoryData.data.toeMoldingData = toeMoldingData;
221
+ promises = molding.map(function (child) {
222
+ return new Promise(function (resolve, reject) {
223
+ var url = child === null || child === void 0 ? void 0 : child.shape_svg;
224
+ if (!url) return resolve();
225
+ var loader = new SVGLoader();
226
+ loader.load(url, function (data) {
227
+ var _data$xml$viewBox$ani, _data$xml, _data$xml$viewBox$ani2, _data$xml2;
228
+ child.data = {
229
+ paths: data.paths,
230
+ svg_width: (_data$xml$viewBox$ani = (_data$xml = data.xml) === null || _data$xml === void 0 || (_data$xml = _data$xml.viewBox) === null || _data$xml === void 0 || (_data$xml = _data$xml.animVal) === null || _data$xml === void 0 ? void 0 : _data$xml.width) !== null && _data$xml$viewBox$ani !== void 0 ? _data$xml$viewBox$ani : 0,
231
+ svg_height: (_data$xml$viewBox$ani2 = (_data$xml2 = data.xml) === null || _data$xml2 === void 0 || (_data$xml2 = _data$xml2.viewBox) === null || _data$xml2 === void 0 || (_data$xml2 = _data$xml2.animVal) === null || _data$xml2 === void 0 ? void 0 : _data$xml2.height) !== null && _data$xml$viewBox$ani2 !== void 0 ? _data$xml$viewBox$ani2 : 0
232
+ };
233
+ resolve();
234
+ }, null, function (error) {
235
+ console.error(error);
236
+ reject(error);
237
+ });
238
+ });
239
+ });
240
+ return _context2.a(2, Promise.all(promises));
241
+ }
242
+ }, _callee2);
243
+ }));
244
+ return function loadMoldings() {
245
+ return _ref4.apply(this, arguments);
246
+ };
247
+ }();
248
+ var loadSVGs = /*#__PURE__*/function () {
249
+ var _ref5 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4() {
250
+ var svgLoadPromises, outlineData;
251
+ return _regenerator().w(function (_context4) {
252
+ while (1) switch (_context4.n) {
253
+ case 0:
254
+ svgLoadPromises = data.map(/*#__PURE__*/function () {
255
+ var _ref6 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(item) {
256
+ var _parsed$xml$viewBox, _parsed$xml$viewBox2, response, svgText, loader, parsed, _t;
257
+ return _regenerator().w(function (_context3) {
258
+ while (1) switch (_context3.p = _context3.n) {
259
+ case 0:
260
+ if (item.outline) {
261
+ _context3.n = 1;
262
+ break;
263
+ }
264
+ return _context3.a(2, null);
265
+ case 1:
266
+ _context3.p = 1;
267
+ _context3.n = 2;
268
+ return fetch(item.outline, {
269
+ cache: 'no-store'
270
+ });
271
+ case 2:
272
+ response = _context3.v;
273
+ _context3.n = 3;
274
+ return response.text();
275
+ case 3:
276
+ svgText = _context3.v;
277
+ loader = new SVGLoader();
278
+ parsed = loader.parse(svgText);
279
+ if (!isEmpty(parsed.paths)) {
280
+ _context3.n = 4;
281
+ break;
282
+ }
283
+ return _context3.a(2, null);
284
+ case 4:
285
+ return _context3.a(2, {
286
+ paths: parsed.paths,
287
+ svgWidth: parseFloat(parsed.xml.getAttribute('width')) || ((_parsed$xml$viewBox = parsed.xml.viewBox) === null || _parsed$xml$viewBox === void 0 || (_parsed$xml$viewBox = _parsed$xml$viewBox.animVal) === null || _parsed$xml$viewBox === void 0 ? void 0 : _parsed$xml$viewBox.width) || 0,
288
+ svgHeight: parseFloat(parsed.xml.getAttribute('height')) || ((_parsed$xml$viewBox2 = parsed.xml.viewBox) === null || _parsed$xml$viewBox2 === void 0 || (_parsed$xml$viewBox2 = _parsed$xml$viewBox2.animVal) === null || _parsed$xml$viewBox2 === void 0 ? void 0 : _parsed$xml$viewBox2.height) || 0,
289
+ reverse: !parseFloat(parsed.xml.getAttribute('height'))
290
+ });
291
+ case 5:
292
+ _context3.p = 5;
293
+ _t = _context3.v;
294
+ console.error('Failed to load SVG:', item.outline, _t);
295
+ return _context3.a(2, null);
296
+ }
297
+ }, _callee3, null, [[1, 5]]);
298
+ }));
299
+ return function (_x3) {
300
+ return _ref6.apply(this, arguments);
301
+ };
302
+ }());
303
+ _context4.n = 1;
304
+ return Promise.all(svgLoadPromises);
305
+ case 1:
306
+ outlineData = _context4.v;
307
+ setOutlineSVGData(outlineData);
308
+ case 2:
309
+ return _context4.a(2);
310
+ }
311
+ }, _callee4);
312
+ }));
313
+ return function loadSVGs() {
314
+ return _ref5.apply(this, arguments);
315
+ };
316
+ }();
317
+ var initCatalog = /*#__PURE__*/function () {
318
+ var _ref7 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5() {
319
+ return _regenerator().w(function (_context5) {
320
+ while (1) switch (_context5.n) {
321
+ case 0:
322
+ setCatalogInitiated(false);
323
+ _context5.n = 1;
324
+ return initMyCatalog();
325
+ case 1:
326
+ _context5.n = 2;
327
+ return loadMoldings();
328
+ case 2:
329
+ _context5.n = 3;
330
+ return loadSVGs();
331
+ case 3:
332
+ setCatalogInitiated(true);
333
+ case 4:
334
+ return _context5.a(2);
335
+ }
336
+ }, _callee5);
337
+ }));
338
+ return function initCatalog() {
339
+ return _ref7.apply(this, arguments);
340
+ };
341
+ }();
342
+ initCatalog();
343
+ // eslint-disable-next-line react-hooks/exhaustive-deps
344
+ }, [categoryData, data, id, catalogs, colorAlias, subgroups]);
345
+
346
+ // Register items once SVGs are loaded
347
+ useEffect(function () {
348
+ if (!outlineSVGData.length) return;
349
+ var Item = [];
350
+ data.forEach(function (obj, index) {
351
+ Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
352
+ type: 'cabinet',
353
+ outlineSVGData: outlineSVGData[index],
354
+ render2DItem: render2DItem,
355
+ render3DItem: render3DItem
356
+ })));
357
+ });
358
+ appliances.forEach(function (obj) {
359
+ Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
360
+ render2DItem: render2DItem,
361
+ render3DItem: render3DApplianceItem,
362
+ type: 'appliance'
363
+ })));
364
+ });
365
+ lighting.forEach(function (obj) {
366
+ Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
367
+ type: 'lighting',
368
+ render2DItem: render2DItem,
369
+ render3DItem: render3DLightingItem
370
+ })));
371
+ });
372
+ furnishing.forEach(function (obj) {
373
+ Item.push(exporter(_objectSpread(_objectSpread({}, obj), {}, {
374
+ type: 'furnishing',
375
+ render2DItem: render2DItem,
376
+ render3DItem: render3DApplianceItem
377
+ })));
378
+ });
379
+ for (var x in Item) MyCatalog.registerElement(Item[x]);
380
+ }, [outlineSVGData, data, appliances, furnishing, lighting]);
381
+
382
+ // Forward updates/save moments to host
383
+ useEffect(function () {
384
+ if (!onEvent && !onSave && !onError) return;
385
+ var unsubscribe = store.subscribe(function () {
386
+ var _state$get, _state$get$get, _state$get$get$get;
387
+ var state = store.getState();
388
+ onEvent === null || onEvent === void 0 || onEvent({
389
+ type: 'state-update',
390
+ payload: {
391
+ state: state
392
+ }
393
+ });
394
+ var pendingSave = state === null || state === void 0 || (_state$get = state.get) === null || _state$get === void 0 || (_state$get = _state$get.call(state, 'KitchenConfigurator')) === null || _state$get === void 0 || (_state$get$get = _state$get.get) === null || _state$get$get === void 0 || (_state$get$get = _state$get$get.call(_state$get, 'misc')) === null || _state$get$get === void 0 || (_state$get$get$get = _state$get$get.get) === null || _state$get$get$get === void 0 ? void 0 : _state$get$get$get.call(_state$get$get, 'pendingSave');
395
+ if (pendingSave && onSave) {
396
+ try {
397
+ var _planner$get, _planner$get2;
398
+ var planner = state.get('KitchenConfigurator');
399
+ var currentScene = planner !== null && planner !== void 0 && (_planner$get = planner.get) !== null && _planner$get !== void 0 && (_planner$get = _planner$get.call(planner, 'scene')) !== null && _planner$get !== void 0 && _planner$get.toJS ? planner.get('scene').toJS() : (planner === null || planner === void 0 || (_planner$get2 = planner.get) === null || _planner$get2 === void 0 ? void 0 : _planner$get2.call(planner, 'scene')) || null;
400
+ onSave({
401
+ type: 'save',
402
+ payload: {
403
+ scene: currentScene
404
+ }
405
+ });
406
+ } catch (e) {
407
+ onError === null || onError === void 0 || onError({
408
+ type: 'save-error',
409
+ error: e
410
+ });
411
+ }
412
+ }
413
+ });
414
+ return function () {
415
+ return unsubscribe();
416
+ };
417
+ }, [store, onEvent, onSave, onError]);
418
+ useEffect(function () {
419
+ if (projectElement.length === 0) return;
420
+ if (!catalogInitiated) return;
421
+ sessionStorage.setItem('projectTitle', projectElement[0].title);
422
+ store.dispatch(rename(projectElement[0].title));
423
+ sessionStorage.setItem('projectId', projectElement[0].id);
424
+ sessionStorage.setItem('email', projectElement[0].email);
425
+ sessionStorage.setItem('firstName', projectElement[0].firstName);
426
+ sessionStorage.setItem('lastName', projectElement[0].lastName);
427
+ sessionStorage.setItem('phone', projectElement[0].phone);
428
+ var jsonData;
429
+ jsonData = JSON.parse(projectElement[0].project_data);
430
+ jsonData.isLoadingCabinet = false;
431
+ store.dispatch(loadProject(jsonData, categoryData));
432
+ }, [project_data, catalogInitiated]);
433
+ return /*#__PURE__*/React.createElement(AppContext.Provider, null, /*#__PURE__*/React.createElement(Provider, {
434
+ store: store
435
+ }, /*#__PURE__*/React.createElement(KitchenConfigurator, _extends({
436
+ catalog: MyCatalog,
437
+ width: width,
438
+ height: height,
439
+ logoImage: logoImg,
440
+ companyURL: companyUrl,
441
+ plugins: plugins,
442
+ toolbarButtons: toolbarButtons,
443
+ stateExtractor: function stateExtractor(state) {
444
+ return state.get('KitchenConfigurator');
445
+ },
446
+ categoryData: categoryData,
447
+ data: data,
448
+ configData: configData,
449
+ onEvent: onEvent,
450
+ onSave: onSave,
451
+ onError: onError
452
+ }, passThrough))));
453
+ }
454
+
455
+ /* ============================== prop types ============================== */
456
+
457
+ KitchenConfiguratorApp.propTypes = {
458
+ width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
459
+ height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
460
+ projectElement: PropTypes.arrayOf(PropTypes.object),
461
+ categoryData: PropTypes.any,
462
+ dataBundle: PropTypes.any,
463
+ configData: PropTypes.any,
464
+ catalog: PropTypes.oneOfType([PropTypes.object, PropTypes.instanceOf(Models.Catalog)]),
465
+ logoImg: PropTypes.any,
466
+ companyUrl: PropTypes.string,
467
+ toolbarButtons: PropTypes.any,
468
+ options: PropTypes.object,
469
+ user: PropTypes.object,
470
+ auth: PropTypes.object,
471
+ featureFlags: PropTypes.object,
472
+ sentry: PropTypes.shape({
473
+ dsn: PropTypes.string,
474
+ environment: PropTypes.string
475
+ }),
476
+ onEvent: PropTypes.func,
477
+ onSave: PropTypes.func,
478
+ onError: PropTypes.func,
479
+ store: PropTypes.object
480
+ };
@@ -0,0 +1,14 @@
1
+ import { SELECT_AREA, SET_FLOOR_STYLES } from "../constants";
2
+ export function selectArea(layerID, areaID) {
3
+ return {
4
+ type: SELECT_AREA,
5
+ layerID: layerID,
6
+ areaID: areaID
7
+ };
8
+ }
9
+ export function setFloorStyles(texture) {
10
+ return {
11
+ type: SET_FLOOR_STYLES,
12
+ texture: texture
13
+ };
14
+ }
@@ -0,0 +1,23 @@
1
+ import * as projectActions from "./project-actions";
2
+ import * as viewer2DActions from "./viewer2d-actions";
3
+ import * as viewer3DActions from "./viewer3d-actions";
4
+ import * as linesActions from "./lines-actions";
5
+ import * as holesActions from "./holes-actions";
6
+ import * as sceneActions from "./scene-actions";
7
+ import * as verticesActions from "./vertices-actions";
8
+ import * as itemsActions from "./items-actions";
9
+ import * as areaActions from "./area-actions";
10
+ import * as groupsActions from "./groups-actions";
11
+ export { projectActions, viewer2DActions, viewer3DActions, linesActions, holesActions, sceneActions, verticesActions, itemsActions, areaActions, groupsActions };
12
+ export default {
13
+ projectActions: projectActions,
14
+ viewer2DActions: viewer2DActions,
15
+ viewer3DActions: viewer3DActions,
16
+ linesActions: linesActions,
17
+ holesActions: holesActions,
18
+ sceneActions: sceneActions,
19
+ verticesActions: verticesActions,
20
+ itemsActions: itemsActions,
21
+ areaActions: areaActions,
22
+ groupsActions: groupsActions
23
+ };
@@ -0,0 +1,89 @@
1
+ import { GROUP_ACTIONS } from "../constants";
2
+ export function addGroup() {
3
+ return {
4
+ type: GROUP_ACTIONS.ADD_GROUP
5
+ };
6
+ }
7
+ export function addGroupFromSelected() {
8
+ return {
9
+ type: GROUP_ACTIONS.ADD_GROUP_FROM_SELECTED
10
+ };
11
+ }
12
+ export function selectGroup(groupID) {
13
+ return {
14
+ type: GROUP_ACTIONS.SELECT_GROUP,
15
+ groupID: groupID
16
+ };
17
+ }
18
+ export function unselectGroup(groupID) {
19
+ return {
20
+ type: GROUP_ACTIONS.UNSELECT_GROUP,
21
+ groupID: groupID
22
+ };
23
+ }
24
+ export function addToGroup(groupID, layerID, elementPrototype, elementID) {
25
+ return {
26
+ type: GROUP_ACTIONS.ADD_TO_GROUP,
27
+ groupID: groupID,
28
+ layerID: layerID,
29
+ elementPrototype: elementPrototype,
30
+ elementID: elementID
31
+ };
32
+ }
33
+ export function removeFromGroup(groupID, layerID, elementPrototype, elementID) {
34
+ return {
35
+ type: GROUP_ACTIONS.REMOVE_FROM_GROUP,
36
+ groupID: groupID,
37
+ layerID: layerID,
38
+ elementPrototype: elementPrototype,
39
+ elementID: elementID
40
+ };
41
+ }
42
+ export function setGroupAttributes(groupID, attributes) {
43
+ return {
44
+ type: GROUP_ACTIONS.SET_GROUP_ATTRIBUTES,
45
+ groupID: groupID,
46
+ attributes: attributes
47
+ };
48
+ }
49
+ export function setGroupProperties(groupID, properties) {
50
+ return {
51
+ type: GROUP_ACTIONS.SET_GROUP_PROPERTIES,
52
+ groupID: groupID,
53
+ properties: properties
54
+ };
55
+ }
56
+ export function setGroupBarycenter(groupID, barycenter) {
57
+ return {
58
+ type: GROUP_ACTIONS.SET_GROUP_BARYCENTER,
59
+ groupID: groupID,
60
+ barycenter: barycenter
61
+ };
62
+ }
63
+ export function removeGroup(groupID) {
64
+ return {
65
+ type: GROUP_ACTIONS.REMOVE_GROUP,
66
+ groupID: groupID
67
+ };
68
+ }
69
+ export function removeGroupAndDeleteElements(groupID) {
70
+ return {
71
+ type: GROUP_ACTIONS.REMOVE_GROUP_AND_DELETE_ELEMENTS,
72
+ groupID: groupID
73
+ };
74
+ }
75
+ export function groupTranslate(groupID, x, y) {
76
+ return {
77
+ type: GROUP_ACTIONS.GROUP_TRANSLATE,
78
+ groupID: groupID,
79
+ x: x,
80
+ y: y
81
+ };
82
+ }
83
+ export function groupRotate(groupID, rotation) {
84
+ return {
85
+ type: GROUP_ACTIONS.GROUP_ROTATE,
86
+ groupID: groupID,
87
+ rotation: rotation
88
+ };
89
+ }