@ifc-lite/create 3.2.0 → 5.1.0

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 (426) hide show
  1. package/README.md +43 -0
  2. package/dist/in-store/align-boxes.d.ts +38 -0
  3. package/dist/in-store/align-boxes.d.ts.map +1 -0
  4. package/dist/in-store/align-boxes.js +97 -0
  5. package/dist/in-store/align-boxes.js.map +1 -0
  6. package/dist/in-store/anchor.d.ts.map +1 -1
  7. package/dist/in-store/anchor.js +13 -2
  8. package/dist/in-store/anchor.js.map +1 -1
  9. package/dist/in-store/auto-space-detect.d.ts +1 -1
  10. package/dist/in-store/auto-space-detect.js +1 -1
  11. package/dist/in-store/beam.d.ts +10 -1
  12. package/dist/in-store/beam.d.ts.map +1 -1
  13. package/dist/in-store/beam.js +17 -35
  14. package/dist/in-store/beam.js.map +1 -1
  15. package/dist/in-store/column.d.ts +10 -1
  16. package/dist/in-store/column.d.ts.map +1 -1
  17. package/dist/in-store/column.js +23 -22
  18. package/dist/in-store/column.js.map +1 -1
  19. package/dist/in-store/copy-array.d.ts +17 -0
  20. package/dist/in-store/copy-array.d.ts.map +1 -0
  21. package/dist/in-store/copy-array.js +47 -0
  22. package/dist/in-store/copy-array.js.map +1 -0
  23. package/dist/in-store/copy-batch.d.ts +27 -0
  24. package/dist/in-store/copy-batch.d.ts.map +1 -0
  25. package/dist/in-store/copy-batch.js +101 -0
  26. package/dist/in-store/copy-batch.js.map +1 -0
  27. package/dist/in-store/copy-dependent-walk.d.ts +27 -0
  28. package/dist/in-store/copy-dependent-walk.d.ts.map +1 -0
  29. package/dist/in-store/copy-dependent-walk.js +61 -0
  30. package/dist/in-store/copy-dependent-walk.js.map +1 -0
  31. package/dist/in-store/copy-frame.d.ts +53 -0
  32. package/dist/in-store/copy-frame.d.ts.map +1 -0
  33. package/dist/in-store/copy-frame.js +112 -0
  34. package/dist/in-store/copy-frame.js.map +1 -0
  35. package/dist/in-store/copy-product.d.ts +76 -0
  36. package/dist/in-store/copy-product.d.ts.map +1 -0
  37. package/dist/in-store/copy-product.js +318 -0
  38. package/dist/in-store/copy-product.js.map +1 -0
  39. package/dist/in-store/curtain-wall.d.ts +87 -0
  40. package/dist/in-store/curtain-wall.d.ts.map +1 -0
  41. package/dist/in-store/curtain-wall.js +237 -0
  42. package/dist/in-store/curtain-wall.js.map +1 -0
  43. package/dist/in-store/edit/effective-mutation-view.d.ts +6 -0
  44. package/dist/in-store/edit/effective-mutation-view.d.ts.map +1 -0
  45. package/dist/in-store/edit/effective-mutation-view.js +45 -0
  46. package/dist/in-store/edit/effective-mutation-view.js.map +1 -0
  47. package/dist/in-store/edit/effective-storey.d.ts +13 -0
  48. package/dist/in-store/edit/effective-storey.d.ts.map +1 -0
  49. package/dist/in-store/edit/effective-storey.js +36 -0
  50. package/dist/in-store/edit/effective-storey.js.map +1 -0
  51. package/dist/in-store/edit/effective-storeys.d.ts +9 -0
  52. package/dist/in-store/edit/effective-storeys.d.ts.map +1 -0
  53. package/dist/in-store/edit/effective-storeys.js +16 -0
  54. package/dist/in-store/edit/effective-storeys.js.map +1 -0
  55. package/dist/in-store/edit/hosted-opening-refit.d.ts +29 -0
  56. package/dist/in-store/edit/hosted-opening-refit.d.ts.map +1 -0
  57. package/dist/in-store/edit/hosted-opening-refit.js +168 -0
  58. package/dist/in-store/edit/hosted-opening-refit.js.map +1 -0
  59. package/dist/in-store/edit/length-unit-scale.d.ts +24 -0
  60. package/dist/in-store/edit/length-unit-scale.d.ts.map +1 -0
  61. package/dist/in-store/edit/length-unit-scale.js +37 -0
  62. package/dist/in-store/edit/length-unit-scale.js.map +1 -0
  63. package/dist/in-store/edit/linear-element-edit.d.ts +131 -0
  64. package/dist/in-store/edit/linear-element-edit.d.ts.map +1 -0
  65. package/dist/in-store/edit/linear-element-edit.js +259 -0
  66. package/dist/in-store/edit/linear-element-edit.js.map +1 -0
  67. package/dist/in-store/edit/metadata-clone-effective.d.ts +5 -0
  68. package/dist/in-store/edit/metadata-clone-effective.d.ts.map +1 -0
  69. package/dist/in-store/edit/metadata-clone-effective.js +47 -0
  70. package/dist/in-store/edit/metadata-clone-effective.js.map +1 -0
  71. package/dist/in-store/edit/metadata-clone.d.ts +40 -0
  72. package/dist/in-store/edit/metadata-clone.d.ts.map +1 -0
  73. package/dist/in-store/edit/metadata-clone.js +107 -0
  74. package/dist/in-store/edit/metadata-clone.js.map +1 -0
  75. package/dist/in-store/edit/placement-core.d.ts +140 -0
  76. package/dist/in-store/edit/placement-core.d.ts.map +1 -0
  77. package/dist/in-store/edit/placement-core.js +317 -0
  78. package/dist/in-store/edit/placement-core.js.map +1 -0
  79. package/dist/in-store/edit/polygon-clip.d.ts +58 -0
  80. package/dist/in-store/edit/polygon-clip.d.ts.map +1 -0
  81. package/dist/in-store/edit/polygon-clip.js +153 -0
  82. package/dist/in-store/edit/polygon-clip.js.map +1 -0
  83. package/dist/in-store/edit/read-profile.d.ts +6 -0
  84. package/dist/in-store/edit/read-profile.d.ts.map +1 -0
  85. package/dist/in-store/edit/read-profile.js +95 -0
  86. package/dist/in-store/edit/read-profile.js.map +1 -0
  87. package/dist/in-store/edit/slab-edit-frame.d.ts +40 -0
  88. package/dist/in-store/edit/slab-edit-frame.d.ts.map +1 -0
  89. package/dist/in-store/edit/slab-edit-frame.js +146 -0
  90. package/dist/in-store/edit/slab-edit-frame.js.map +1 -0
  91. package/dist/in-store/edit/slab-edit.d.ts +112 -0
  92. package/dist/in-store/edit/slab-edit.d.ts.map +1 -0
  93. package/dist/in-store/edit/slab-edit.js +275 -0
  94. package/dist/in-store/edit/slab-edit.js.map +1 -0
  95. package/dist/in-store/edit/slab-opening-carry.d.ts +10 -0
  96. package/dist/in-store/edit/slab-opening-carry.d.ts.map +1 -0
  97. package/dist/in-store/edit/slab-opening-carry.js +65 -0
  98. package/dist/in-store/edit/slab-opening-carry.js.map +1 -0
  99. package/dist/in-store/edit/split-guid.d.ts +29 -0
  100. package/dist/in-store/edit/split-guid.d.ts.map +1 -0
  101. package/dist/in-store/edit/split-guid.js +64 -0
  102. package/dist/in-store/edit/split-guid.js.map +1 -0
  103. package/dist/in-store/edit/split-target.d.ts +90 -0
  104. package/dist/in-store/edit/split-target.d.ts.map +1 -0
  105. package/dist/in-store/edit/split-target.js +116 -0
  106. package/dist/in-store/edit/split-target.js.map +1 -0
  107. package/dist/in-store/edit/target.d.ts +8 -0
  108. package/dist/in-store/edit/target.d.ts.map +1 -0
  109. package/dist/in-store/edit/target.js +5 -0
  110. package/dist/in-store/edit/target.js.map +1 -0
  111. package/dist/in-store/edit/trim-extend-geometry.d.ts +99 -0
  112. package/dist/in-store/edit/trim-extend-geometry.d.ts.map +1 -0
  113. package/dist/in-store/edit/trim-extend-geometry.js +105 -0
  114. package/dist/in-store/edit/trim-extend-geometry.js.map +1 -0
  115. package/dist/in-store/edit/wall-axis-edit.d.ts +16 -0
  116. package/dist/in-store/edit/wall-axis-edit.d.ts.map +1 -0
  117. package/dist/in-store/edit/wall-axis-edit.js +40 -0
  118. package/dist/in-store/edit/wall-axis-edit.js.map +1 -0
  119. package/dist/in-store/edit/wall-edit.d.ts +157 -0
  120. package/dist/in-store/edit/wall-edit.d.ts.map +1 -0
  121. package/dist/in-store/edit/wall-edit.js +276 -0
  122. package/dist/in-store/edit/wall-edit.js.map +1 -0
  123. package/dist/in-store/edit/wall-hosted-cuts.d.ts +35 -0
  124. package/dist/in-store/edit/wall-hosted-cuts.d.ts.map +1 -0
  125. package/dist/in-store/edit/wall-hosted-cuts.js +27 -0
  126. package/dist/in-store/edit/wall-hosted-cuts.js.map +1 -0
  127. package/dist/in-store/edit/wall-opening-reassign.d.ts +18 -0
  128. package/dist/in-store/edit/wall-opening-reassign.d.ts.map +1 -0
  129. package/dist/in-store/edit/wall-opening-reassign.js +50 -0
  130. package/dist/in-store/edit/wall-opening-reassign.js.map +1 -0
  131. package/dist/in-store/element-align.d.ts +13 -0
  132. package/dist/in-store/element-align.d.ts.map +1 -0
  133. package/dist/in-store/element-align.js +90 -0
  134. package/dist/in-store/element-align.js.map +1 -0
  135. package/dist/in-store/element-replacement.d.ts +26 -0
  136. package/dist/in-store/element-replacement.d.ts.map +1 -0
  137. package/dist/in-store/element-replacement.js +68 -0
  138. package/dist/in-store/element-replacement.js.map +1 -0
  139. package/dist/in-store/element-size-edit.d.ts +40 -0
  140. package/dist/in-store/element-size-edit.d.ts.map +1 -0
  141. package/dist/in-store/element-size-edit.js +103 -0
  142. package/dist/in-store/element-size-edit.js.map +1 -0
  143. package/dist/in-store/element-split-axis.d.ts +6 -0
  144. package/dist/in-store/element-split-axis.d.ts.map +1 -0
  145. package/dist/in-store/element-split-axis.js +87 -0
  146. package/dist/in-store/element-split-axis.js.map +1 -0
  147. package/dist/in-store/element-split-joined.d.ts +13 -0
  148. package/dist/in-store/element-split-joined.d.ts.map +1 -0
  149. package/dist/in-store/element-split-joined.js +74 -0
  150. package/dist/in-store/element-split-joined.js.map +1 -0
  151. package/dist/in-store/element-split-placement.d.ts +19 -0
  152. package/dist/in-store/element-split-placement.d.ts.map +1 -0
  153. package/dist/in-store/element-split-placement.js +48 -0
  154. package/dist/in-store/element-split-placement.js.map +1 -0
  155. package/dist/in-store/element-split-slab.d.ts +19 -0
  156. package/dist/in-store/element-split-slab.d.ts.map +1 -0
  157. package/dist/in-store/element-split-slab.js +86 -0
  158. package/dist/in-store/element-split-slab.js.map +1 -0
  159. package/dist/in-store/element-split.d.ts +49 -0
  160. package/dist/in-store/element-split.d.ts.map +1 -0
  161. package/dist/in-store/element-split.js +52 -0
  162. package/dist/in-store/element-split.js.map +1 -0
  163. package/dist/in-store/element-transform-edit.d.ts +33 -0
  164. package/dist/in-store/element-transform-edit.d.ts.map +1 -0
  165. package/dist/in-store/element-transform-edit.js +97 -0
  166. package/dist/in-store/element-transform-edit.js.map +1 -0
  167. package/dist/in-store/element-transform-frames.d.ts +58 -0
  168. package/dist/in-store/element-transform-frames.d.ts.map +1 -0
  169. package/dist/in-store/element-transform-frames.js +110 -0
  170. package/dist/in-store/element-transform-frames.js.map +1 -0
  171. package/dist/in-store/element-transform-joins.d.ts +4 -0
  172. package/dist/in-store/element-transform-joins.d.ts.map +1 -0
  173. package/dist/in-store/element-transform-joins.js +62 -0
  174. package/dist/in-store/element-transform-joins.js.map +1 -0
  175. package/dist/in-store/element-transform-plan.d.ts +38 -0
  176. package/dist/in-store/element-transform-plan.d.ts.map +1 -0
  177. package/dist/in-store/element-transform-plan.js +115 -0
  178. package/dist/in-store/element-transform-plan.js.map +1 -0
  179. package/dist/in-store/element-trim-extend.d.ts +25 -0
  180. package/dist/in-store/element-trim-extend.d.ts.map +1 -0
  181. package/dist/in-store/element-trim-extend.js +97 -0
  182. package/dist/in-store/element-trim-extend.js.map +1 -0
  183. package/dist/in-store/extract-grids.d.ts +36 -0
  184. package/dist/in-store/extract-grids.d.ts.map +1 -0
  185. package/dist/in-store/extract-grids.js +220 -0
  186. package/dist/in-store/extract-grids.js.map +1 -0
  187. package/dist/in-store/extract-walls.d.ts +12 -23
  188. package/dist/in-store/extract-walls.d.ts.map +1 -1
  189. package/dist/in-store/extract-walls.js +6 -69
  190. package/dist/in-store/extract-walls.js.map +1 -1
  191. package/dist/in-store/generate-spaces.d.ts +1 -1
  192. package/dist/in-store/grid-column.d.ts +23 -0
  193. package/dist/in-store/grid-column.d.ts.map +1 -0
  194. package/dist/in-store/grid-column.js +73 -0
  195. package/dist/in-store/grid-column.js.map +1 -0
  196. package/dist/in-store/grid-intersection-read.d.ts +10 -0
  197. package/dist/in-store/grid-intersection-read.d.ts.map +1 -0
  198. package/dist/in-store/grid-intersection-read.js +45 -0
  199. package/dist/in-store/grid-intersection-read.js.map +1 -0
  200. package/dist/in-store/grid.d.ts +124 -0
  201. package/dist/in-store/grid.d.ts.map +1 -0
  202. package/dist/in-store/grid.js +204 -0
  203. package/dist/in-store/grid.js.map +1 -0
  204. package/dist/in-store/group-evidence.d.ts +49 -0
  205. package/dist/in-store/group-evidence.d.ts.map +1 -0
  206. package/dist/in-store/group-evidence.js +111 -0
  207. package/dist/in-store/group-evidence.js.map +1 -0
  208. package/dist/in-store/group-graph.d.ts +51 -0
  209. package/dist/in-store/group-graph.d.ts.map +1 -0
  210. package/dist/in-store/group-graph.js +213 -0
  211. package/dist/in-store/group-graph.js.map +1 -0
  212. package/dist/in-store/group.d.ts +34 -0
  213. package/dist/in-store/group.d.ts.map +1 -0
  214. package/dist/in-store/group.js +181 -0
  215. package/dist/in-store/group.js.map +1 -0
  216. package/dist/in-store/host-geometry-frame.d.ts +48 -0
  217. package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
  218. package/dist/in-store/host-geometry-frame.js +190 -0
  219. package/dist/in-store/host-geometry-frame.js.map +1 -0
  220. package/dist/in-store/hosted-element-edit.d.ts +29 -0
  221. package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
  222. package/dist/in-store/hosted-element-edit.js +120 -0
  223. package/dist/in-store/hosted-element-edit.js.map +1 -0
  224. package/dist/in-store/hosted-element.d.ts +41 -0
  225. package/dist/in-store/hosted-element.d.ts.map +1 -0
  226. package/dist/in-store/hosted-element.js +124 -0
  227. package/dist/in-store/hosted-element.js.map +1 -0
  228. package/dist/in-store/hosted-fill-read.d.ts +56 -0
  229. package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
  230. package/dist/in-store/hosted-fill-read.js +197 -0
  231. package/dist/in-store/hosted-fill-read.js.map +1 -0
  232. package/dist/in-store/hosted-global-id.d.ts +8 -0
  233. package/dist/in-store/hosted-global-id.d.ts.map +1 -0
  234. package/dist/in-store/hosted-global-id.js +53 -0
  235. package/dist/in-store/hosted-global-id.js.map +1 -0
  236. package/dist/in-store/hosted-placement-edit.d.ts +30 -0
  237. package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
  238. package/dist/in-store/hosted-placement-edit.js +123 -0
  239. package/dist/in-store/hosted-placement-edit.js.map +1 -0
  240. package/dist/in-store/hosted-scale-chain.d.ts +12 -0
  241. package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
  242. package/dist/in-store/hosted-scale-chain.js +74 -0
  243. package/dist/in-store/hosted-scale-chain.js.map +1 -0
  244. package/dist/in-store/hosted-shape-edit.d.ts +9 -0
  245. package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
  246. package/dist/in-store/hosted-shape-edit.js +79 -0
  247. package/dist/in-store/hosted-shape-edit.js.map +1 -0
  248. package/dist/in-store/index.d.ts +66 -0
  249. package/dist/in-store/index.d.ts.map +1 -0
  250. package/dist/in-store/index.js +71 -0
  251. package/dist/in-store/index.js.map +1 -0
  252. package/dist/in-store/linear-profile-frame.d.ts +10 -0
  253. package/dist/in-store/linear-profile-frame.d.ts.map +1 -0
  254. package/dist/in-store/linear-profile-frame.js +17 -0
  255. package/dist/in-store/linear-profile-frame.js.map +1 -0
  256. package/dist/in-store/material.d.ts.map +1 -1
  257. package/dist/in-store/material.js +17 -6
  258. package/dist/in-store/material.js.map +1 -1
  259. package/dist/in-store/member.d.ts +8 -2
  260. package/dist/in-store/member.d.ts.map +1 -1
  261. package/dist/in-store/member.js +15 -21
  262. package/dist/in-store/member.js.map +1 -1
  263. package/dist/in-store/ordinary-element.d.ts +47 -0
  264. package/dist/in-store/ordinary-element.d.ts.map +1 -0
  265. package/dist/in-store/ordinary-element.js +38 -0
  266. package/dist/in-store/ordinary-element.js.map +1 -0
  267. package/dist/in-store/placement-frame.d.ts +15 -5
  268. package/dist/in-store/placement-frame.d.ts.map +1 -1
  269. package/dist/in-store/placement-frame.js +25 -36
  270. package/dist/in-store/placement-frame.js.map +1 -1
  271. package/dist/in-store/profile.d.ts +141 -0
  272. package/dist/in-store/profile.d.ts.map +1 -0
  273. package/dist/in-store/profile.js +174 -0
  274. package/dist/in-store/profile.js.map +1 -0
  275. package/dist/in-store/railing.d.ts +65 -0
  276. package/dist/in-store/railing.d.ts.map +1 -0
  277. package/dist/in-store/railing.js +112 -0
  278. package/dist/in-store/railing.js.map +1 -0
  279. package/dist/in-store/rel-connects-path.d.ts +43 -0
  280. package/dist/in-store/rel-connects-path.d.ts.map +1 -0
  281. package/dist/in-store/rel-connects-path.js +65 -0
  282. package/dist/in-store/rel-connects-path.js.map +1 -0
  283. package/dist/in-store/resolve-anchor.d.ts +3 -2
  284. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  285. package/dist/in-store/resolve-anchor.js +7 -5
  286. package/dist/in-store/resolve-anchor.js.map +1 -1
  287. package/dist/in-store/resolve-host.d.ts +12 -1
  288. package/dist/in-store/resolve-host.d.ts.map +1 -1
  289. package/dist/in-store/resolve-host.js +169 -85
  290. package/dist/in-store/resolve-host.js.map +1 -1
  291. package/dist/in-store/resolve-relations.d.ts +3 -1
  292. package/dist/in-store/resolve-relations.d.ts.map +1 -1
  293. package/dist/in-store/resolve-relations.js +8 -3
  294. package/dist/in-store/resolve-relations.js.map +1 -1
  295. package/dist/in-store/resolve-source.d.ts.map +1 -1
  296. package/dist/in-store/resolve-source.js +39 -59
  297. package/dist/in-store/resolve-source.js.map +1 -1
  298. package/dist/in-store/room-candidates.d.ts +58 -0
  299. package/dist/in-store/room-candidates.d.ts.map +1 -0
  300. package/dist/in-store/room-candidates.js +135 -0
  301. package/dist/in-store/room-candidates.js.map +1 -0
  302. package/dist/in-store/room-creation-plan.d.ts +16 -0
  303. package/dist/in-store/room-creation-plan.d.ts.map +1 -0
  304. package/dist/in-store/room-creation-plan.js +28 -0
  305. package/dist/in-store/room-creation-plan.js.map +1 -0
  306. package/dist/in-store/room-floor-height.d.ts +24 -0
  307. package/dist/in-store/room-floor-height.d.ts.map +1 -0
  308. package/dist/in-store/room-floor-height.js +32 -0
  309. package/dist/in-store/room-floor-height.js.map +1 -0
  310. package/dist/in-store/room-footprint-native.d.ts +19 -0
  311. package/dist/in-store/room-footprint-native.d.ts.map +1 -0
  312. package/dist/in-store/room-footprint-native.js +117 -0
  313. package/dist/in-store/room-footprint-native.js.map +1 -0
  314. package/dist/in-store/room-layout-cache.d.ts +23 -0
  315. package/dist/in-store/room-layout-cache.d.ts.map +1 -0
  316. package/dist/in-store/room-layout-cache.js +84 -0
  317. package/dist/in-store/room-layout-cache.js.map +1 -0
  318. package/dist/in-store/room-layout-core.d.ts +68 -0
  319. package/dist/in-store/room-layout-core.d.ts.map +1 -0
  320. package/dist/in-store/room-layout-core.js +153 -0
  321. package/dist/in-store/room-layout-core.js.map +1 -0
  322. package/dist/in-store/room-population.d.ts +5 -0
  323. package/dist/in-store/room-population.d.ts.map +1 -0
  324. package/dist/in-store/room-population.js +28 -0
  325. package/dist/in-store/room-population.js.map +1 -0
  326. package/dist/in-store/room-space-meshes.d.ts +15 -0
  327. package/dist/in-store/room-space-meshes.d.ts.map +1 -0
  328. package/dist/in-store/room-space-meshes.js +38 -0
  329. package/dist/in-store/room-space-meshes.js.map +1 -0
  330. package/dist/in-store/room-store.d.ts +55 -0
  331. package/dist/in-store/room-store.d.ts.map +1 -0
  332. package/dist/in-store/room-store.js +173 -0
  333. package/dist/in-store/room-store.js.map +1 -0
  334. package/dist/in-store/room-storey-elevation.d.ts +5 -0
  335. package/dist/in-store/room-storey-elevation.d.ts.map +1 -0
  336. package/dist/in-store/room-storey-elevation.js +42 -0
  337. package/dist/in-store/room-storey-elevation.js.map +1 -0
  338. package/dist/in-store/room-storey-frame.d.ts +47 -0
  339. package/dist/in-store/room-storey-frame.d.ts.map +1 -0
  340. package/dist/in-store/room-storey-frame.js +48 -0
  341. package/dist/in-store/room-storey-frame.js.map +1 -0
  342. package/dist/in-store/room-wall-rects.d.ts +117 -0
  343. package/dist/in-store/room-wall-rects.d.ts.map +1 -0
  344. package/dist/in-store/room-wall-rects.js +157 -0
  345. package/dist/in-store/room-wall-rects.js.map +1 -0
  346. package/dist/in-store/schema-attributes.d.ts +8 -3
  347. package/dist/in-store/schema-attributes.d.ts.map +1 -1
  348. package/dist/in-store/schema-attributes.js +18 -9
  349. package/dist/in-store/schema-attributes.js.map +1 -1
  350. package/dist/in-store/slab.d.ts.map +1 -1
  351. package/dist/in-store/slab.js +1 -4
  352. package/dist/in-store/slab.js.map +1 -1
  353. package/dist/in-store/space-footprints.d.ts +55 -0
  354. package/dist/in-store/space-footprints.d.ts.map +1 -0
  355. package/dist/in-store/space-footprints.js +260 -0
  356. package/dist/in-store/space-footprints.js.map +1 -0
  357. package/dist/in-store/space.d.ts.map +1 -1
  358. package/dist/in-store/space.js +15 -3
  359. package/dist/in-store/space.js.map +1 -1
  360. package/dist/in-store/spatial-children.d.ts +1 -1
  361. package/dist/in-store/spatial-children.js +1 -1
  362. package/dist/in-store/stair-edit.d.ts +24 -0
  363. package/dist/in-store/stair-edit.d.ts.map +1 -0
  364. package/dist/in-store/stair-edit.js +190 -0
  365. package/dist/in-store/stair-edit.js.map +1 -0
  366. package/dist/in-store/stair-removal.d.ts +17 -0
  367. package/dist/in-store/stair-removal.d.ts.map +1 -0
  368. package/dist/in-store/stair-removal.js +134 -0
  369. package/dist/in-store/stair-removal.js.map +1 -0
  370. package/dist/in-store/stair.d.ts +58 -0
  371. package/dist/in-store/stair.d.ts.map +1 -0
  372. package/dist/in-store/stair.js +156 -0
  373. package/dist/in-store/stair.js.map +1 -0
  374. package/dist/in-store/storey-plan-frame.d.ts +2 -1
  375. package/dist/in-store/storey-plan-frame.d.ts.map +1 -1
  376. package/dist/in-store/storey-plan-frame.js +20 -11
  377. package/dist/in-store/storey-plan-frame.js.map +1 -1
  378. package/dist/in-store/storey-reassignment-plan.d.ts +53 -0
  379. package/dist/in-store/storey-reassignment-plan.d.ts.map +1 -0
  380. package/dist/in-store/storey-reassignment-plan.js +237 -0
  381. package/dist/in-store/storey-reassignment-plan.js.map +1 -0
  382. package/dist/in-store/storey-reassignment.d.ts +8 -0
  383. package/dist/in-store/storey-reassignment.d.ts.map +1 -0
  384. package/dist/in-store/storey-reassignment.js +52 -0
  385. package/dist/in-store/storey-reassignment.js.map +1 -0
  386. package/dist/in-store/trim-extend-plan.d.ts +27 -0
  387. package/dist/in-store/trim-extend-plan.d.ts.map +1 -0
  388. package/dist/in-store/trim-extend-plan.js +49 -0
  389. package/dist/in-store/trim-extend-plan.js.map +1 -0
  390. package/dist/in-store/wall-join-apply.d.ts +74 -0
  391. package/dist/in-store/wall-join-apply.d.ts.map +1 -0
  392. package/dist/in-store/wall-join-apply.js +137 -0
  393. package/dist/in-store/wall-join-apply.js.map +1 -0
  394. package/dist/in-store/wall-join-edit.d.ts +53 -0
  395. package/dist/in-store/wall-join-edit.d.ts.map +1 -0
  396. package/dist/in-store/wall-join-edit.js +251 -0
  397. package/dist/in-store/wall-join-edit.js.map +1 -0
  398. package/dist/in-store/wall-join-read.d.ts +60 -0
  399. package/dist/in-store/wall-join-read.d.ts.map +1 -0
  400. package/dist/in-store/wall-join-read.js +230 -0
  401. package/dist/in-store/wall-join-read.js.map +1 -0
  402. package/dist/in-store/wall-join.d.ts +122 -0
  403. package/dist/in-store/wall-join.d.ts.map +1 -0
  404. package/dist/in-store/wall-join.js +231 -0
  405. package/dist/in-store/wall-join.js.map +1 -0
  406. package/dist/in-store/wall-opening-fit.d.ts +11 -0
  407. package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
  408. package/dist/in-store/wall-opening-fit.js +27 -0
  409. package/dist/in-store/wall-opening-fit.js.map +1 -0
  410. package/dist/in-store/wall-section-edit.d.ts +16 -0
  411. package/dist/in-store/wall-section-edit.d.ts.map +1 -0
  412. package/dist/in-store/wall-section-edit.js +75 -0
  413. package/dist/in-store/wall-section-edit.js.map +1 -0
  414. package/dist/in-store/wall-size-edit.d.ts +29 -0
  415. package/dist/in-store/wall-size-edit.d.ts.map +1 -0
  416. package/dist/in-store/wall-size-edit.js +65 -0
  417. package/dist/in-store/wall-size-edit.js.map +1 -0
  418. package/dist/in-store/wall.d.ts +32 -0
  419. package/dist/in-store/wall.d.ts.map +1 -1
  420. package/dist/in-store/wall.js +77 -13
  421. package/dist/in-store/wall.js.map +1 -1
  422. package/dist/index.d.ts +25 -38
  423. package/dist/index.d.ts.map +1 -1
  424. package/dist/index.js +25 -40
  425. package/dist/index.js.map +1 -1
  426. package/package.json +9 -8
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Wall joins (#6232 D1): where two straight walls meet, decide which one runs
3
+ * through and how far each body extends past, or stops short of, its axis end,
4
+ * so the two bodies meet with no overlap and no gap. Pure plan geometry: no
5
+ * editor, no store.
6
+ *
7
+ * Three kinds, told apart by where the two axes' lines cross:
8
+ *
9
+ * - `L` both walls end at the crossing (a corner). One wall runs through
10
+ * to the outer corner, the other stops at its inner face.
11
+ * - `T` one wall ends on the other's path. The path wall runs through
12
+ * unchanged, the ending wall stops at its near face.
13
+ * - `butt` the walls are collinear and meet end to end. Both stop square at
14
+ * the shared point, whatever their thicknesses or offsets.
15
+ *
16
+ * The joined end of each axis is snapped to the crossing, so a wall drawn to
17
+ * the other's face (or a little short of it) gets an axis that meets the
18
+ * other's axis, which is what `IfcRelConnectsPathElements` describes.
19
+ *
20
+ * A body end is a cut across the wall's thickness: how far the body reaches
21
+ * past the axis end along its left face and along its right face. A right-angle
22
+ * join or a butt join cuts square (both the same), so the body stays an
23
+ * `IfcRectangleProfileDef`. At any other angle the cut runs along the other
24
+ * wall's face, which a rectangle cannot follow: the body becomes a four-point
25
+ * `IfcArbitraryClosedProfileDef`. It is still a butt join (one wall runs through,
26
+ * the other stops at its face), not a mitre, and no boolean clipping is used.
27
+ */
28
+ /** A point in the storey plan, metres. */
29
+ export type PlanPoint = [number, number];
30
+ /** Which face of the wall its axis runs along. `left`/`right` are relative to Start -> End. */
31
+ export type WallAlignment = 'center' | 'left' | 'right';
32
+ /** `IfcConnectionTypeEnum` values a wall join writes. */
33
+ export type WallConnectionType = 'ATSTART' | 'ATEND' | 'ATPATH';
34
+ /**
35
+ * How far a wall body reaches past one end of its axis, in metres, measured
36
+ * along the axis at each face. Positive extends past the end, negative trims
37
+ * back from it. Equal values are a square cut.
38
+ */
39
+ export interface WallEndCut {
40
+ /** At the left face (left of Start -> End). */
41
+ left: number;
42
+ /** At the right face. */
43
+ right: number;
44
+ }
45
+ /** A straight wall as the join sees it: plan axis, thickness and where the body sits across the axis. */
46
+ export interface WallJoinWall {
47
+ start: PlanPoint;
48
+ end: PlanPoint;
49
+ /** Metres, > 0. */
50
+ thickness: number;
51
+ /** Default `center`. */
52
+ alignment?: WallAlignment;
53
+ /** Extra shift of the body across the axis, metres, positive to the left. Default 0. */
54
+ offset?: number;
55
+ /** Body end at Start. Default square at the axis end. */
56
+ startCut?: WallEndCut;
57
+ /** Body end at End. Default square at the axis end. */
58
+ endCut?: WallEndCut;
59
+ }
60
+ export type WallJoinKind = 'L' | 'T' | 'butt';
61
+ export interface WallJoinSide {
62
+ /** Where this wall takes part: the end that is joined, or its path for the through wall of a T. */
63
+ connection: WallConnectionType;
64
+ /** True for the wall whose body runs through the joint. */
65
+ runsThrough: boolean;
66
+ /** The wall after the join: joined end snapped to the joint, body cut there. The other end is kept as it was. */
67
+ wall: WallJoinWall;
68
+ }
69
+ export interface WallJoin {
70
+ kind: WallJoinKind;
71
+ /** Where the axes meet, storey plan metres. */
72
+ point: PlanPoint;
73
+ /** The wall written as `RelatingElement`: the one that runs through (wall `a` for a butt join). */
74
+ relating: 'a' | 'b';
75
+ a: WallJoinSide;
76
+ b: WallJoinSide;
77
+ }
78
+ export interface WallJoinOptions {
79
+ /**
80
+ * How far (metres, along each axis) an axis end may sit from the crossing and
81
+ * still count as joined there. Default twice the larger thickness, which
82
+ * covers a wall drawn to the other's face.
83
+ */
84
+ tolerance?: number;
85
+ /**
86
+ * Which wall runs through at an `L` corner, and is the relating wall of a
87
+ * `butt` join. Default: the thicker wall, `a` on a tie. Ignored for a `T`,
88
+ * where the path wall always runs through.
89
+ */
90
+ priority?: 'a' | 'b';
91
+ }
92
+ /** The wall body's plan outline in the wall's own frame: origin at Start, +X along the axis, +Y to the left. */
93
+ export interface WallBodyOutline {
94
+ /** Right-start, right-end, left-end, left-start (counter-clockwise). */
95
+ corners: [PlanPoint, PlanPoint, PlanPoint, PlanPoint];
96
+ /** Both ends are square, so the outline is a rectangle. */
97
+ rectangular: boolean;
98
+ /** Axis length, Start to End. */
99
+ length: number;
100
+ /** Body extent across the axis. */
101
+ yMin: number;
102
+ yMax: number;
103
+ }
104
+ /** The body's extent across the axis, `[min, max]`, positive to the left of Start -> End. */
105
+ export declare function wallBodyLateralRange(wall: Pick<WallJoinWall, 'thickness' | 'alignment' | 'offset'>): [number, number];
106
+ /** Put a wall on a new axis, retaining cuts only at unchanged ends with the
107
+ * same direction. Cuts are distances from their OWN end, so extending Start
108
+ * does not rebase EndCut. Changed ends start square before a join recuts them.
109
+ * Shared by the canonical editor and its preview (#6232/#6535). */
110
+ export declare function reshapeWallAxis(wall: WallJoinWall, start: Readonly<PlanPoint>, end: Readonly<PlanPoint>): WallJoinWall;
111
+ /**
112
+ * The body outline of `wall` in its own frame. Throws when the cuts leave a
113
+ * face with no length (the ends cross), which no single extrusion can build.
114
+ */
115
+ export declare function wallBodyOutline(wall: WallJoinWall): WallBodyOutline;
116
+ /**
117
+ * Join two straight walls. Works at any angle in plan; throws when the walls
118
+ * do not meet within `tolerance`, when they cross (split one first), or when
119
+ * they are parallel without being collinear and end to end.
120
+ */
121
+ export declare function computeWallJoin(a: WallJoinWall, b: WallJoinWall, options?: WallJoinOptions): WallJoin;
122
+ //# sourceMappingURL=wall-join.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-join.d.ts","sourceRoot":"","sources":["../../src/in-store/wall-join.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAEzC,+FAA+F;AAC/F,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAExD,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEhE;;;;GAIG;AACH,MAAM,WAAW,UAAU;I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iCAAiC;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AA4BD,6FAA6F;AAC7F,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMrH;AAED;;;mEAGmE;AACnE,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,YAAY,CAatH;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,eAAe,CAiBnE;AA+DD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,EAAE,OAAO,GAAE,eAAoB,GAAG,QAAQ,CA+DzG"}
@@ -0,0 +1,231 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /** Directions closer to parallel than this (sine of the angle) are treated as parallel. */
5
+ const PARALLEL_SIN = 1e-6;
6
+ /** Length slack for "the same point" / "on the line" / "non-empty face". */
7
+ const LENGTH_EPS = 1e-9;
8
+ const SQUARE_EPS = 1e-9;
9
+ const sub = (a, b) => [a[0] - b[0], a[1] - b[1]];
10
+ const add = (a, b) => [a[0] + b[0], a[1] + b[1]];
11
+ const scale = (a, s) => [a[0] * s, a[1] * s];
12
+ const dot = (a, b) => a[0] * b[0] + a[1] * b[1];
13
+ const cross = (a, b) => a[0] * b[1] - a[1] * b[0];
14
+ function assertWall(wall, label, op) {
15
+ const finite = [...wall.start, ...wall.end, wall.thickness, wall.offset ?? 0,
16
+ wall.startCut?.left ?? 0, wall.startCut?.right ?? 0, wall.endCut?.left ?? 0, wall.endCut?.right ?? 0];
17
+ if (finite.some((v) => !Number.isFinite(v)))
18
+ throw new Error(`${op}: wall ${label} has a non-finite coordinate or dimension`);
19
+ if (!(wall.thickness > 0))
20
+ throw new Error(`${op}: wall ${label} thickness must be positive`);
21
+ if (Math.hypot(wall.end[0] - wall.start[0], wall.end[1] - wall.start[1]) <= LENGTH_EPS) {
22
+ throw new Error(`${op}: wall ${label} Start and End must be distinct points`);
23
+ }
24
+ const alignment = wall.alignment ?? 'center';
25
+ if (alignment !== 'center' && alignment !== 'left' && alignment !== 'right') {
26
+ throw new Error(`${op}: wall ${label} alignment must be center, left or right; got ${String(alignment)}`);
27
+ }
28
+ }
29
+ /** The body's extent across the axis, `[min, max]`, positive to the left of Start -> End. */
30
+ export function wallBodyLateralRange(wall) {
31
+ const half = wall.thickness / 2;
32
+ const alignment = wall.alignment ?? 'center';
33
+ // The axis runs along the named face, so the body lies on the other side of it.
34
+ const centre = (wall.offset ?? 0) + (alignment === 'left' ? -half : alignment === 'right' ? half : 0);
35
+ return [centre - half, centre + half];
36
+ }
37
+ /** Put a wall on a new axis, retaining cuts only at unchanged ends with the
38
+ * same direction. Cuts are distances from their OWN end, so extending Start
39
+ * does not rebase EndCut. Changed ends start square before a join recuts them.
40
+ * Shared by the canonical editor and its preview (#6232/#6535). */
41
+ export function reshapeWallAxis(wall, start, end) {
42
+ assertWall(wall, '', 'reshapeWallAxis');
43
+ const { startCut, endCut, ...rest } = wall;
44
+ const next = { ...rest, start: [start[0], start[1]], end: [end[0], end[1]] };
45
+ assertWall(next, '', 'reshapeWallAxis');
46
+ const directionHeld = dot(frameOf(wall).dir, frameOf(next).dir) > 1 - 1e-12;
47
+ if (directionHeld && startCut && Math.hypot(start[0] - wall.start[0], start[1] - wall.start[1]) <= LENGTH_EPS) {
48
+ next.startCut = { ...startCut };
49
+ }
50
+ if (directionHeld && endCut && Math.hypot(end[0] - wall.end[0], end[1] - wall.end[1]) <= LENGTH_EPS) {
51
+ next.endCut = { ...endCut };
52
+ }
53
+ return next;
54
+ }
55
+ /**
56
+ * The body outline of `wall` in its own frame. Throws when the cuts leave a
57
+ * face with no length (the ends cross), which no single extrusion can build.
58
+ */
59
+ export function wallBodyOutline(wall) {
60
+ assertWall(wall, '', 'wallBodyOutline');
61
+ const length = Math.hypot(wall.end[0] - wall.start[0], wall.end[1] - wall.start[1]);
62
+ const [yMin, yMax] = wallBodyLateralRange(wall);
63
+ const s = wall.startCut ?? { left: 0, right: 0 };
64
+ const e = wall.endCut ?? { left: 0, right: 0 };
65
+ const corners = [
66
+ [-s.right, yMin],
67
+ [length + e.right, yMin],
68
+ [length + e.left, yMax],
69
+ [-s.left, yMax],
70
+ ];
71
+ if (corners[1][0] - corners[0][0] <= LENGTH_EPS || corners[2][0] - corners[3][0] <= LENGTH_EPS) {
72
+ throw new Error('wallBodyOutline: the body ends cross; the wall is too short for this join');
73
+ }
74
+ const rectangular = Math.abs(s.left - s.right) <= SQUARE_EPS && Math.abs(e.left - e.right) <= SQUARE_EPS;
75
+ return { corners, rectangular, length, yMin, yMax };
76
+ }
77
+ function frameOf(wall) {
78
+ const d = sub(wall.end, wall.start);
79
+ const length = Math.hypot(d[0], d[1]);
80
+ const dir = scale(d, 1 / length);
81
+ const [yMin, yMax] = wallBodyLateralRange(wall);
82
+ return { wall, origin: wall.start, dir, normal: [-dir[1], dir[0]], length, yMin, yMax };
83
+ }
84
+ /** Where parameter `s` (metres along the axis from Start) falls on a wall of `length`. */
85
+ function placeOn(s, length, tolerance) {
86
+ const fromStart = Math.abs(s);
87
+ const fromEnd = Math.abs(s - length);
88
+ if (fromStart <= tolerance || fromEnd <= tolerance)
89
+ return fromStart <= fromEnd ? 'ATSTART' : 'ATEND';
90
+ return s > 0 && s < length ? 'ATPATH' : 'OFF';
91
+ }
92
+ /** Outward direction of the body at a joined end. */
93
+ function outward(f, end) {
94
+ return end === 'ATEND' ? f.dir : scale(f.dir, -1);
95
+ }
96
+ /**
97
+ * The cut at a joined end of `f` that lies along the line through `linePoint`
98
+ * with direction `lineDir`: distance past the axis end (the joint `p`) at each
99
+ * face, measured outward.
100
+ */
101
+ function cutAlong(f, end, p, linePoint, lineDir) {
102
+ const u = outward(f, end);
103
+ const denom = cross(u, lineDir);
104
+ // p + s·u + y·n = linePoint + r·lineDir => s = cross(linePoint - p - y·n, lineDir) / cross(u, lineDir)
105
+ const at = (y) => cross(sub(sub(linePoint, p), scale(f.normal, y)), lineDir) / denom;
106
+ return { left: at(f.yMax), right: at(f.yMin) };
107
+ }
108
+ /** `f`'s wall with the joined end moved to `p` and cut by `cut`. */
109
+ function joinedWall(f, end, p, cut) {
110
+ const wall = end === 'ATSTART'
111
+ ? { ...f.wall, start: [p[0], p[1]], startCut: cut }
112
+ : { ...f.wall, end: [p[0], p[1]], endCut: cut };
113
+ wallBodyOutline(wall);
114
+ return wall;
115
+ }
116
+ /** Which side (+1 left, -1 right) of `f`'s axis the direction `v` points to. */
117
+ function sideOf(f, v) {
118
+ return dot(v, f.normal) >= 0 ? 1 : -1;
119
+ }
120
+ /**
121
+ * Join two straight walls. Works at any angle in plan; throws when the walls
122
+ * do not meet within `tolerance`, when they cross (split one first), or when
123
+ * they are parallel without being collinear and end to end.
124
+ */
125
+ export function computeWallJoin(a, b, options = {}) {
126
+ const op = 'computeWallJoin';
127
+ assertWall(a, 'a', op);
128
+ assertWall(b, 'b', op);
129
+ const tolerance = options.tolerance ?? 2 * Math.max(a.thickness, b.thickness);
130
+ if (!Number.isFinite(tolerance) || tolerance < 0)
131
+ throw new Error(`${op}: tolerance must be a finite, non-negative length`);
132
+ if (options.priority !== undefined && options.priority !== 'a' && options.priority !== 'b') {
133
+ throw new Error(`${op}: priority must be 'a' or 'b'`);
134
+ }
135
+ const fa = frameOf(a);
136
+ const fb = frameOf(b);
137
+ const denom = cross(fa.dir, fb.dir);
138
+ if (Math.abs(denom) <= PARALLEL_SIN)
139
+ return buttJoin(fa, fb, tolerance, options, op);
140
+ const w = sub(fb.origin, fa.origin);
141
+ const sA = cross(w, fb.dir) / denom;
142
+ const sB = cross(w, fa.dir) / denom;
143
+ const point = add(fa.origin, scale(fa.dir, sA));
144
+ const placeA = placeOn(sA, fa.length, tolerance);
145
+ const placeB = placeOn(sB, fb.length, tolerance);
146
+ if (placeA === 'OFF' || placeB === 'OFF') {
147
+ throw new Error(`${op}: the walls do not meet (their axes cross more than ${tolerance} m past an end)`);
148
+ }
149
+ if (placeA === 'ATPATH' && placeB === 'ATPATH') {
150
+ throw new Error(`${op}: the walls cross each other; split one of them at the crossing first`);
151
+ }
152
+ if (placeA === 'ATPATH' || placeB === 'ATPATH') {
153
+ // T: the path wall runs through untouched; the other stops at its near face.
154
+ const throughIsA = placeA === 'ATPATH';
155
+ const [fr, fw] = throughIsA ? [fa, fb] : [fb, fa];
156
+ const endW = (throughIsA ? placeB : placeA);
157
+ const ending = endingSide(fr, fw, endW, point);
158
+ const through = { connection: 'ATPATH', runsThrough: true, wall: { ...fr.wall } };
159
+ return {
160
+ kind: 'T',
161
+ point,
162
+ relating: throughIsA ? 'a' : 'b',
163
+ a: throughIsA ? through : ending,
164
+ b: throughIsA ? ending : through,
165
+ };
166
+ }
167
+ // L: both walls end at the corner.
168
+ const throughIsA = (options.priority ?? (b.thickness > a.thickness ? 'b' : 'a')) === 'a';
169
+ const [fr, fw] = throughIsA ? [fa, fb] : [fb, fa];
170
+ const [endR, endW] = (throughIsA ? [placeA, placeB] : [placeB, placeA]);
171
+ const ending = endingSide(fr, fw, endW, point);
172
+ // The through wall reaches the ending wall's outer face: the face on the far
173
+ // side from where the through wall comes in.
174
+ const comesFrom = sideOf(fw, scale(outward(fr, endR), -1));
175
+ const outerY = comesFrom > 0 ? fw.yMin : fw.yMax;
176
+ const cut = cutAlong(fr, endR, point, add(point, scale(fw.normal, outerY)), fw.dir);
177
+ const through = { connection: endR, runsThrough: true, wall: joinedWall(fr, endR, point, cut) };
178
+ return {
179
+ kind: 'L',
180
+ point,
181
+ relating: throughIsA ? 'a' : 'b',
182
+ a: throughIsA ? through : ending,
183
+ b: throughIsA ? ending : through,
184
+ };
185
+ }
186
+ /** The wall that stops at the through wall's face: the face on the side it comes in from. */
187
+ function endingSide(fr, fw, endW, point) {
188
+ const comesFrom = sideOf(fr, scale(outward(fw, endW), -1));
189
+ const faceY = comesFrom > 0 ? fr.yMax : fr.yMin;
190
+ const cut = cutAlong(fw, endW, point, add(point, scale(fr.normal, faceY)), fr.dir);
191
+ return { connection: endW, runsThrough: false, wall: joinedWall(fw, endW, point, cut) };
192
+ }
193
+ function buttJoin(fa, fb, tolerance, options, op) {
194
+ const reach = Math.max(fa.length, fb.length);
195
+ if (Math.abs(cross(sub(fb.origin, fa.origin), fa.dir)) > Math.max(1e-6 * reach, LENGTH_EPS)) {
196
+ throw new Error(`${op}: the walls are parallel but not in line; a join needs the axes to meet`);
197
+ }
198
+ const ends = ['ATSTART', 'ATEND'];
199
+ const endPoint = (f, end) => (end === 'ATSTART' ? f.wall.start : f.wall.end);
200
+ let best = null;
201
+ for (const endA of ends) {
202
+ for (const endB of ends) {
203
+ // End to end means the two bodies leave the joint in opposite directions.
204
+ if (dot(outward(fa, endA), outward(fb, endB)) >= 0)
205
+ continue;
206
+ const gap = Math.hypot(...sub(endPoint(fa, endA), endPoint(fb, endB)));
207
+ if (!best || gap < best.gap)
208
+ best = { endA, endB, gap };
209
+ }
210
+ }
211
+ // The ends must meet within tolerance, and the walls must not overlap along the line.
212
+ const overlap = best
213
+ ? dot(sub(endPoint(fb, best.endB), endPoint(fa, best.endA)), outward(fa, best.endA)) < -tolerance
214
+ : true;
215
+ if (!best || best.gap > tolerance || overlap) {
216
+ throw new Error(`${op}: the walls are in line but do not meet end to end within ${tolerance} m`);
217
+ }
218
+ const pa = endPoint(fa, best.endA);
219
+ const pb = endPoint(fb, best.endB);
220
+ const point = [(pa[0] + pb[0]) / 2, (pa[1] + pb[1]) / 2];
221
+ const square = { left: 0, right: 0 };
222
+ const relating = options.priority ?? 'a';
223
+ return {
224
+ kind: 'butt',
225
+ point,
226
+ relating,
227
+ a: { connection: best.endA, runsThrough: false, wall: joinedWall(fa, best.endA, point, square) },
228
+ b: { connection: best.endB, runsThrough: false, wall: joinedWall(fb, best.endB, point, square) },
229
+ };
230
+ }
231
+ //# sourceMappingURL=wall-join.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-join.js","sourceRoot":"","sources":["../../src/in-store/wall-join.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAoH/D,2FAA2F;AAC3F,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,4EAA4E;AAC5E,MAAM,UAAU,GAAG,IAAI,CAAC;AACxB,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,MAAM,GAAG,GAAG,CAAC,CAAY,EAAE,CAAY,EAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,MAAM,GAAG,GAAG,CAAC,CAAY,EAAE,CAAY,EAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClF,MAAM,KAAK,GAAG,CAAC,CAAY,EAAE,CAAS,EAAa,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3E,MAAM,GAAG,GAAG,CAAC,CAAY,EAAE,CAAY,EAAU,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9E,MAAM,KA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AAC,EAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,GAAG,CAAC;IACzC,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,KAAK;QACL,QAAQ;QACR,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE;QAChG,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE;KACjG,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** Hosted openings must fit both end faces after a wall join (#6232 D5).
2
+ * A wall axis can still span an opening when an oblique body face cuts it. */
3
+ import type { IfcDataStore } from '@ifc-lite/parser';
4
+ import type { MutablePropertyView } from '@ifc-lite/mutations';
5
+ import type { WallJoinTarget } from './wall-join-apply.js';
6
+ import { type WallJoinWall } from './wall-join.js';
7
+ /** Safe longitudinal interval in the ORIGINAL placement frame, in metres.
8
+ * Using both faces deliberately refuses a cut straddling an oblique end. */
9
+ export declare function wallOpeningBodySpan(original: WallJoinTarget, next: WallJoinWall): [number, number];
10
+ export declare function assertWallOpeningsFit(store: IfcDataStore, view: MutablePropertyView, original: WallJoinTarget, next: WallJoinWall, scale: number): void;
11
+ //# sourceMappingURL=wall-opening-fit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-opening-fit.d.ts","sourceRoot":"","sources":["../../src/in-store/wall-opening-fit.ts"],"names":[],"mappings":"AAIA;8EAC8E;AAC9E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGpE;4EAC4E;AAC5E,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAOlG;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,mBAAmB,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAC1G,IAAI,CASN"}
@@ -0,0 +1,27 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { wallBodyOutline } from './wall-join.js';
5
+ import { readHostOpeningExtents } from './hosted-element.js';
6
+ /** Safe longitudinal interval in the ORIGINAL placement frame, in metres.
7
+ * Using both faces deliberately refuses a cut straddling an oblique end. */
8
+ export function wallOpeningBodySpan(original, next) {
9
+ const length = Math.hypot(original.wall.end[0] - original.wall.start[0], original.wall.end[1] - original.wall.start[1]);
10
+ const ux = (original.wall.end[0] - original.wall.start[0]) / length;
11
+ const uy = (original.wall.end[1] - original.wall.start[1]) / length;
12
+ const first = (next.start[0] - original.origin[0]) * ux + (next.start[1] - original.origin[1]) * uy;
13
+ const { corners } = wallBodyOutline(next);
14
+ return [first + Math.max(corners[0][0], corners[3][0]), first + Math.min(corners[1][0], corners[2][0])];
15
+ }
16
+ export function assertWallOpeningsFit(store, view, original, next, scale) {
17
+ const hosted = readHostOpeningExtents(store, original.wallId, view);
18
+ if (hosted.unreadable.length) {
19
+ throw new Error(`Wall #${original.wallId} has unreadable opening geometry ${hosted.unreadable.map(id => `#${id}`).join(', ')}; joining is refused`);
20
+ }
21
+ const [from, to] = wallOpeningBodySpan(original, next);
22
+ // The existing Trim/Extend contract allows 1 mm of modelling roundoff.
23
+ const outside = hosted.cuts.find(({ bounds }) => bounds.min[0] * scale < from - 1e-3 || bounds.max[0] * scale > to + 1e-3);
24
+ if (outside)
25
+ throw new Error(`Opening #${outside.openingId} would not fit between the joined end faces of wall #${original.wallId}`);
26
+ }
27
+ //# sourceMappingURL=wall-opening-fit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-opening-fit.js","sourceRoot":"","sources":["../../src/in-store/wall-opening-fit.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAO/D,OAAO,EAAE,eAAe,EAAqB,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D;4EAC4E;AAC5E,MAAM,UAAU,mBAAmB,CAAC,QAAwB,EAAE,IAAkB;IAC9E,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IACxH,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IACpE,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC;IACpE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,C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AK,GAAG,IAAI,GAAG,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IAC3H,IAAI,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,SAAS,wDAAwD,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;AACvI,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { EditTarget } from './edit/target.js';
2
+ export interface WallSection {
3
+ /** Metres across the wall. */
4
+ readonly thickness?: number;
5
+ /** Metres from the wall's base up. */
6
+ readonly height?: number;
7
+ }
8
+ export type WallSectionOutcome = {
9
+ ok: true; /** Express ids whose mesh the write changed: the wall and the openings it re-cut. */
10
+ remesh: number[];
11
+ } | {
12
+ ok: false;
13
+ reason: string;
14
+ };
15
+ export declare function setWallSectionInStore(target: EditTarget, expressId: number, section: WallSection): WallSectionOutcome;
16
+ //# sourceMappingURL=wall-section-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-section-edit.d.ts","sourceRoot":"","sources":["../../src/in-store/wall-section-edit.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,sCAAsC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC,CAAC,qFAAqF;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,GACpH;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAMlC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,kBAAkB,CAoDrH"}
@@ -0,0 +1,75 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { editOwnershipRefusal, expandAffectedSet } from '@ifc-lite/export';
5
+ import { readWallJoinRels } from './wall-join-read.js';
6
+ import { reshapeWallsInStore, resolveWallJoinAnchor } from './wall-join-edit.js';
7
+ import { toNativeLength } from './anchor.js';
8
+ import { heightRefusal, hostBodyExtent, openingsOf, planCutRefit } from './edit/hosted-opening-refit.js';
9
+ import { getModelLengthUnitScale } from './edit/length-unit-scale.js';
10
+ import { readWallMetres } from './wall-size-edit.js';
11
+ /** IfcRectangleProfileDef.YDim and IfcExtrudedAreaSolid.Depth. */
12
+ const PROFILE_YDIM = 4;
13
+ const EXTRUSION_DEPTH = 3;
14
+ export function setWallSectionInStore(target, expressId, section) {
15
+ for (const value of [section.thickness, section.height]) {
16
+ if (value !== undefined && !(Number.isFinite(value) && value > 0))
17
+ return { ok: false, reason: 'Wall thickness and height must be greater than zero' };
18
+ }
19
+ const wall = readWallMetres(target, expressId);
20
+ if (!target || !wall) {
21
+ return { ok: false, reason: 'Wall does not have a simple IfcRectangleProfileDef → IfcExtrudedAreaSolid representation' };
22
+ }
23
+ const scale = getModelLengthUnitScale(target.dataStore);
24
+ const unit = { lengthUnitScale: scale };
25
+ const updates = [];
26
+ const remesh = [expressId];
27
+ // Refuse before writing anything: an opening the new height would leave above the wall.
28
+ if (section.height !== undefined && section.height !== wall.height) {
29
+ const refusal = heightRefusal(target, expressId, toNativeLength(unit, section.height), scale);
30
+ if (refusal)
31
+ return { ok: false, reason: refusal };
32
+ }
33
+ if (section.thickness !== undefined && section.thickness !== wall.thickness) {
34
+ const thickness = toNativeLength(unit, section.thickness);
35
+ const hosts = openingsOf(target, expressId).length > 0;
36
+ // The profile is centred on the axis, so a plain wall's faces stay symmetric about the body's centre.
37
+ const before = hosts ? hostBodyExtent(target, expressId) : null;
38
+ if (hosts && !before)
39
+ return { ok: false, reason: "This wall's body can't be read, so its openings can't follow the new thickness" };
40
+ const joined = wall.read !== null && readWallJoinRels(target.dataStore, target.view, new Set([expressId])).length > 0;
41
+ const plain = wall.chain !== null && (wall.read === null || (wall.read.plain && !joined));
42
+ if (wall.chain && plain) {
43
+ updates.push({ entityId: wall.chain.profileId, index: PROFILE_YDIM, value: thickness });
44
+ }
45
+ else {
46
+ const reshaped = reshapeWallsInStore(target.editor, target.dataStore, resolveWallJoinAnchor(target.dataStore, target.view), [{ wallId: expressId, thickness: section.thickness }], {});
47
+ remesh.push(...reshaped.walls);
48
+ }
49
+ if (hosts) {
50
+ // A reshape may have moved the body (an offset wall): span where it is now; a plain wall grows about its centre.
51
+ const now = plain ? null : hostBodyExtent(target, expressId);
52
+ const centre = (before.min[1] + before.max[1]) / 2;
53
+ const extent = now ? [now.min[1], now.max[1]] : [centre - thickness / 2, centre + thickness / 2];
54
+ const refit = planCutRefit(target, expressId, 1, extent, scale);
55
+ if (!refit.ok)
56
+ return refit;
57
+ updates.push(...refit.updates);
58
+ remesh.push(...refit.openings);
59
+ }
60
+ }
61
+ if (section.height !== undefined && section.height !== wall.height) {
62
+ // Read the wall again: a reshape above rewrote its body, so the ids read at entry may be stale.
63
+ const solidId = readWallMetres(target, expressId)?.read?.solidId ?? wall.chain?.extrudedSolidId;
64
+ if (solidId === undefined)
65
+ return { ok: false, reason: 'The wall has no body extrusion to take a new height' };
66
+ updates.push({ entityId: solidId, index: EXTRUSION_DEPTH, value: toNativeLength(unit, section.height) });
67
+ }
68
+ const ownership = editOwnershipRefusal(target.dataStore, target.view, updates.map(update => update.entityId), expandAffectedSet(target.dataStore, target.view, [expressId], 'hostsChanged'));
69
+ if (ownership)
70
+ return { ok: false, reason: ownership };
71
+ for (const update of updates)
72
+ target.editor.setPositionalAttribute(update.entityId, update.index, update.value);
73
+ return { ok: true, remesh: [...new Set(remesh)] };
74
+ }
75
+ //# sourceMappingURL=wall-section-edit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-section-edit.js","sourceRoot":"","sources":["../../src/in-store/wall-section-edit.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAyB,MAAM,gCAAgC,CAAC;AAChI,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAcrD,kEAAkE;AAClE,MAAM,YAAY,GAAG,CAAC,CAAC;AACvB,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,MAAM,UAAU,qBAAqB,CAAC,MAAkB,EAAE,SAAiB,EAAE,OAAoB;IAC/F,KAAK,MAAM,KAAK,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QACxD,IAAI,KAAK,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC;YAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,qDAAqD,EAAE,CAAC;IACzJ,CAAC;IACD,MAAM,IAAI,GAAG,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/C,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QACrB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,0FAA0F,EAAE,CAAC;I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SAAS;QAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACvD,KAAK,MAAM,MAAM,IAAI,OAAO;QAAE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAChH,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { type WallJoinRead } from './wall-join-read.js';
2
+ import { type WallEditChain } from './edit/wall-edit.js';
3
+ import type { EditTarget } from './edit/target.js';
4
+ type Vec3 = [number, number, number];
5
+ export type WallEditContext = EditTarget;
6
+ export type WallResizeOutcome = {
7
+ ok: true;
8
+ newLength: number;
9
+ walls: number[];
10
+ } | {
11
+ ok: false;
12
+ reason: string;
13
+ };
14
+ export interface WallResizeOptions {
15
+ moveJoinedEnds?: boolean;
16
+ }
17
+ export interface WallMetres {
18
+ start: Vec3;
19
+ end: Vec3;
20
+ thickness: number;
21
+ height: number;
22
+ chain: WallEditChain | null;
23
+ read: WallJoinRead | null;
24
+ }
25
+ export declare function readWallMetres(ctx: WallEditContext, expressId: number): WallMetres | null;
26
+ /** Caller owns an atomic transaction. Coordinates are storey-local IFC Z-up metres. */
27
+ export declare function resizeWallInStore(ctx: EditTarget, expressId: number, newStart: Vec3, newEnd: Vec3, options?: WallResizeOptions): WallResizeOutcome;
28
+ export {};
29
+ //# sourceMappingURL=wall-size-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wall-size-edit.d.ts","sourceRoot":"","sources":["../../src/in-store/wall-size-edit.ts"],"names":[],"mappings":"AAKA,OAAO,EAAwC,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAG9F,OAAO,EAAwB,KAAK,aAAa,EAAE,M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