@ifc-lite/create 3.1.0 → 4.0.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 (208) hide show
  1. package/README.md +9 -0
  2. package/dist/ifc-creator-math.d.ts +5 -7
  3. package/dist/ifc-creator-math.d.ts.map +1 -1
  4. package/dist/ifc-creator-math.js +8 -15
  5. package/dist/ifc-creator-math.js.map +1 -1
  6. package/dist/in-store/anchor.d.ts +25 -0
  7. package/dist/in-store/anchor.d.ts.map +1 -1
  8. package/dist/in-store/auto-space-detect.d.ts +1 -1
  9. package/dist/in-store/auto-space-detect.js +1 -1
  10. package/dist/in-store/beam.d.ts +10 -1
  11. package/dist/in-store/beam.d.ts.map +1 -1
  12. package/dist/in-store/beam.js +14 -25
  13. package/dist/in-store/beam.js.map +1 -1
  14. package/dist/in-store/column.d.ts +18 -1
  15. package/dist/in-store/column.d.ts.map +1 -1
  16. package/dist/in-store/column.js +37 -29
  17. package/dist/in-store/column.js.map +1 -1
  18. package/dist/in-store/copy-frame.d.ts +52 -0
  19. package/dist/in-store/copy-frame.d.ts.map +1 -0
  20. package/dist/in-store/copy-frame.js +99 -0
  21. package/dist/in-store/copy-frame.js.map +1 -0
  22. package/dist/in-store/copy-product.d.ts +96 -0
  23. package/dist/in-store/copy-product.d.ts.map +1 -0
  24. package/dist/in-store/copy-product.js +318 -0
  25. package/dist/in-store/copy-product.js.map +1 -0
  26. package/dist/in-store/curtain-wall.d.ts +87 -0
  27. package/dist/in-store/curtain-wall.d.ts.map +1 -0
  28. package/dist/in-store/curtain-wall.js +237 -0
  29. package/dist/in-store/curtain-wall.js.map +1 -0
  30. package/dist/in-store/door.d.ts +10 -4
  31. package/dist/in-store/door.d.ts.map +1 -1
  32. package/dist/in-store/door.js +23 -17
  33. package/dist/in-store/door.js.map +1 -1
  34. package/dist/in-store/element-type.d.ts +40 -0
  35. package/dist/in-store/element-type.d.ts.map +1 -0
  36. package/dist/in-store/element-type.js +60 -0
  37. package/dist/in-store/element-type.js.map +1 -0
  38. package/dist/in-store/extract-grids.d.ts +46 -0
  39. package/dist/in-store/extract-grids.d.ts.map +1 -0
  40. package/dist/in-store/extract-grids.js +211 -0
  41. package/dist/in-store/extract-grids.js.map +1 -0
  42. package/dist/in-store/extract-walls.d.ts +12 -23
  43. package/dist/in-store/extract-walls.d.ts.map +1 -1
  44. package/dist/in-store/extract-walls.js +14 -83
  45. package/dist/in-store/extract-walls.js.map +1 -1
  46. package/dist/in-store/generate-spaces.d.ts +1 -1
  47. package/dist/in-store/grid.d.ts +118 -0
  48. package/dist/in-store/grid.d.ts.map +1 -0
  49. package/dist/in-store/grid.js +194 -0
  50. package/dist/in-store/grid.js.map +1 -0
  51. package/dist/in-store/host-geometry-frame.d.ts +44 -0
  52. package/dist/in-store/host-geometry-frame.d.ts.map +1 -0
  53. package/dist/in-store/host-geometry-frame.js +146 -0
  54. package/dist/in-store/host-geometry-frame.js.map +1 -0
  55. package/dist/in-store/hosted-element-edit.d.ts +29 -0
  56. package/dist/in-store/hosted-element-edit.d.ts.map +1 -0
  57. package/dist/in-store/hosted-element-edit.js +120 -0
  58. package/dist/in-store/hosted-element-edit.js.map +1 -0
  59. package/dist/in-store/hosted-element.d.ts +41 -0
  60. package/dist/in-store/hosted-element.d.ts.map +1 -0
  61. package/dist/in-store/hosted-element.js +124 -0
  62. package/dist/in-store/hosted-element.js.map +1 -0
  63. package/dist/in-store/hosted-fill-read.d.ts +56 -0
  64. package/dist/in-store/hosted-fill-read.d.ts.map +1 -0
  65. package/dist/in-store/hosted-fill-read.js +197 -0
  66. package/dist/in-store/hosted-fill-read.js.map +1 -0
  67. package/dist/in-store/hosted-fill.d.ts +48 -0
  68. package/dist/in-store/hosted-fill.d.ts.map +1 -0
  69. package/dist/in-store/hosted-fill.js +58 -0
  70. package/dist/in-store/hosted-fill.js.map +1 -0
  71. package/dist/in-store/hosted-global-id.d.ts +8 -0
  72. package/dist/in-store/hosted-global-id.d.ts.map +1 -0
  73. package/dist/in-store/hosted-global-id.js +53 -0
  74. package/dist/in-store/hosted-global-id.js.map +1 -0
  75. package/dist/in-store/hosted-placement-edit.d.ts +30 -0
  76. package/dist/in-store/hosted-placement-edit.d.ts.map +1 -0
  77. package/dist/in-store/hosted-placement-edit.js +123 -0
  78. package/dist/in-store/hosted-placement-edit.js.map +1 -0
  79. package/dist/in-store/hosted-scale-chain.d.ts +12 -0
  80. package/dist/in-store/hosted-scale-chain.d.ts.map +1 -0
  81. package/dist/in-store/hosted-scale-chain.js +74 -0
  82. package/dist/in-store/hosted-scale-chain.js.map +1 -0
  83. package/dist/in-store/hosted-shape-edit.d.ts +9 -0
  84. package/dist/in-store/hosted-shape-edit.d.ts.map +1 -0
  85. package/dist/in-store/hosted-shape-edit.js +79 -0
  86. package/dist/in-store/hosted-shape-edit.js.map +1 -0
  87. package/dist/in-store/index.d.ts +59 -0
  88. package/dist/in-store/index.d.ts.map +1 -0
  89. package/dist/in-store/index.js +64 -0
  90. package/dist/in-store/index.js.map +1 -0
  91. package/dist/in-store/material.d.ts +62 -0
  92. package/dist/in-store/material.d.ts.map +1 -0
  93. package/dist/in-store/material.js +107 -0
  94. package/dist/in-store/material.js.map +1 -0
  95. package/dist/in-store/member.d.ts +8 -2
  96. package/dist/in-store/member.d.ts.map +1 -1
  97. package/dist/in-store/member.js +12 -14
  98. package/dist/in-store/member.js.map +1 -1
  99. package/dist/in-store/opening.d.ts +45 -0
  100. package/dist/in-store/opening.d.ts.map +1 -0
  101. package/dist/in-store/opening.js +104 -0
  102. package/dist/in-store/opening.js.map +1 -0
  103. package/dist/in-store/placement-frame.d.ts +9 -4
  104. package/dist/in-store/placement-frame.d.ts.map +1 -1
  105. package/dist/in-store/placement-frame.js +39 -39
  106. package/dist/in-store/placement-frame.js.map +1 -1
  107. package/dist/in-store/profile.d.ts +141 -0
  108. package/dist/in-store/profile.d.ts.map +1 -0
  109. package/dist/in-store/profile.js +174 -0
  110. package/dist/in-store/profile.js.map +1 -0
  111. package/dist/in-store/railing.d.ts +65 -0
  112. package/dist/in-store/railing.d.ts.map +1 -0
  113. package/dist/in-store/railing.js +112 -0
  114. package/dist/in-store/railing.js.map +1 -0
  115. package/dist/in-store/rel-connects-path.d.ts +43 -0
  116. package/dist/in-store/rel-connects-path.d.ts.map +1 -0
  117. package/dist/in-store/rel-connects-path.js +65 -0
  118. package/dist/in-store/rel-connects-path.js.map +1 -0
  119. package/dist/in-store/relate.d.ts +32 -0
  120. package/dist/in-store/relate.d.ts.map +1 -0
  121. package/dist/in-store/relate.js +39 -0
  122. package/dist/in-store/relate.js.map +1 -0
  123. package/dist/in-store/resolve-anchor.d.ts +21 -1
  124. package/dist/in-store/resolve-anchor.d.ts.map +1 -1
  125. package/dist/in-store/resolve-anchor.js +6 -2
  126. package/dist/in-store/resolve-anchor.js.map +1 -1
  127. package/dist/in-store/resolve-host.d.ts +16 -0
  128. package/dist/in-store/resolve-host.d.ts.map +1 -0
  129. package/dist/in-store/resolve-host.js +333 -0
  130. package/dist/in-store/resolve-host.js.map +1 -0
  131. package/dist/in-store/resolve-relations.d.ts +23 -0
  132. package/dist/in-store/resolve-relations.d.ts.map +1 -0
  133. package/dist/in-store/resolve-relations.js +57 -0
  134. package/dist/in-store/resolve-relations.js.map +1 -0
  135. package/dist/in-store/resolve-source.d.ts.map +1 -1
  136. package/dist/in-store/resolve-source.js +59 -63
  137. package/dist/in-store/resolve-source.js.map +1 -1
  138. package/dist/in-store/schema-attributes.d.ts +33 -0
  139. package/dist/in-store/schema-attributes.d.ts.map +1 -0
  140. package/dist/in-store/schema-attributes.js +102 -0
  141. package/dist/in-store/schema-attributes.js.map +1 -0
  142. package/dist/in-store/space-footprints.d.ts +55 -0
  143. package/dist/in-store/space-footprints.d.ts.map +1 -0
  144. package/dist/in-store/space-footprints.js +260 -0
  145. package/dist/in-store/space-footprints.js.map +1 -0
  146. package/dist/in-store/space.d.ts.map +1 -1
  147. package/dist/in-store/space.js +15 -3
  148. package/dist/in-store/space.js.map +1 -1
  149. package/dist/in-store/spatial-children.d.ts +1 -1
  150. package/dist/in-store/spatial-children.js +1 -1
  151. package/dist/in-store/stair-edit.d.ts +24 -0
  152. package/dist/in-store/stair-edit.d.ts.map +1 -0
  153. package/dist/in-store/stair-edit.js +190 -0
  154. package/dist/in-store/stair-edit.js.map +1 -0
  155. package/dist/in-store/stair.d.ts +58 -0
  156. package/dist/in-store/stair.d.ts.map +1 -0
  157. package/dist/in-store/stair.js +156 -0
  158. package/dist/in-store/stair.js.map +1 -0
  159. package/dist/in-store/wall-join-apply.d.ts +74 -0
  160. package/dist/in-store/wall-join-apply.d.ts.map +1 -0
  161. package/dist/in-store/wall-join-apply.js +137 -0
  162. package/dist/in-store/wall-join-apply.js.map +1 -0
  163. package/dist/in-store/wall-join-edit.d.ts +70 -0
  164. package/dist/in-store/wall-join-edit.d.ts.map +1 -0
  165. package/dist/in-store/wall-join-edit.js +217 -0
  166. package/dist/in-store/wall-join-edit.js.map +1 -0
  167. package/dist/in-store/wall-join-read.d.ts +60 -0
  168. package/dist/in-store/wall-join-read.d.ts.map +1 -0
  169. package/dist/in-store/wall-join-read.js +230 -0
  170. package/dist/in-store/wall-join-read.js.map +1 -0
  171. package/dist/in-store/wall-join.d.ts +122 -0
  172. package/dist/in-store/wall-join.d.ts.map +1 -0
  173. package/dist/in-store/wall-join.js +231 -0
  174. package/dist/in-store/wall-join.js.map +1 -0
  175. package/dist/in-store/wall-opening-fit.d.ts +11 -0
  176. package/dist/in-store/wall-opening-fit.d.ts.map +1 -0
  177. package/dist/in-store/wall-opening-fit.js +27 -0
  178. package/dist/in-store/wall-opening-fit.js.map +1 -0
  179. package/dist/in-store/wall.d.ts +32 -0
  180. package/dist/in-store/wall.d.ts.map +1 -1
  181. package/dist/in-store/wall.js +77 -13
  182. package/dist/in-store/wall.js.map +1 -1
  183. package/dist/in-store/window.d.ts +7 -0
  184. package/dist/in-store/window.d.ts.map +1 -1
  185. package/dist/in-store/window.js +24 -17
  186. package/dist/in-store/window.js.map +1 -1
  187. package/dist/index.d.ts +1 -31
  188. package/dist/index.d.ts.map +1 -1
  189. package/dist/index.js +2 -34
  190. package/dist/index.js.map +1 -1
  191. package/dist/landxml/cant-superelevation.d.ts +28 -0
  192. package/dist/landxml/cant-superelevation.d.ts.map +1 -0
  193. package/dist/landxml/cant-superelevation.js +31 -0
  194. package/dist/landxml/cant-superelevation.js.map +1 -0
  195. package/dist/landxml/landxml-to-ifc.d.ts +8 -2
  196. package/dist/landxml/landxml-to-ifc.d.ts.map +1 -1
  197. package/dist/landxml/landxml-to-ifc.js +34 -2
  198. package/dist/landxml/landxml-to-ifc.js.map +1 -1
  199. package/dist/landxml/refusals.d.ts.map +1 -1
  200. package/dist/landxml/refusals.js +8 -3
  201. package/dist/landxml/refusals.js.map +1 -1
  202. package/dist/landxml/result-types.d.ts +44 -0
  203. package/dist/landxml/result-types.d.ts.map +1 -1
  204. package/dist/landxml/writers.d.ts +4 -0
  205. package/dist/landxml/writers.d.ts.map +1 -1
  206. package/dist/landxml/writers.js +4 -2
  207. package/dist/landxml/writers.js.map +1 -1
  208. package/package.json +8 -7
@@ -37,6 +37,10 @@ export interface OverlayWallReader {
37
37
  getTypeMutations?(): ReadonlyMap<number, {
38
38
  readonly newType: string;
39
39
  }>;
40
+ /** Point lookup of a live retype, without copying the whole retype map. */
41
+ getEntityTypeMutation?(expressId: number): {
42
+ readonly newType: string;
43
+ } | null | undefined;
40
44
  /** Queued positional attribute edits of one entity (#5249). */
41
45
  getPositionalMutationsForEntity?(expressId: number): ReadonlyMap<number, IfcAttributeValue> | null;
42
46
  }
@@ -51,7 +55,8 @@ export interface PlacementFrame {
51
55
  * Walk IfcLocalPlacement → IfcAxis2Placement3D → CartesianPoint and read the
52
56
  * ground-plane origin + RefDirection *of this one placement*, i.e. expressed
53
57
  * in its own `PlacementRelTo` parent's frame. Returns null when any link is
54
- * missing.
58
+ * missing or explicitly unreadable. Only horizontal +Z frames can be
59
+ * represented by this planar contract (#6511 / #6232).
55
60
  */
56
61
  export declare function readOwnPlacementFrame(store: IfcDataStore, extractor: EntityExtractor, overlay: OverlayWallReader | undefined, placementId: number): PlacementFrame | null;
57
62
  /**
@@ -77,9 +82,9 @@ export declare function storeyPlacementChain(store: IfcDataStore, extractor: Ent
77
82
  * innermost one first. `hops === 0` is the storey's own placement, whose frame
78
83
  * relative to itself is the identity.
79
84
  *
80
- * Returns `null` when any of those placements has no readable frame — the
81
- * caller must then leave the element where it is rather than move it by a
82
- * partial chain.
85
+ * Returns `null` when any required placement has no readable frame; callers
86
+ * refuse the element instead of labelling a partial transform storey-local.
87
+ * Placements at or above the shared ancestor cancel and need not be read.
83
88
  */
84
89
  export declare function storeyFrameAboveBy(store: IfcDataStore, extractor: EntityExtractor, overlay: OverlayWallReader | undefined, storeyChain: ReadonlyMap<number, number>, hops: number): PlacementFrame | null;
85
90
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"placement-frame.d.ts","sourceRoot":"","sources":["../../src/in-store/placement-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EACL,eAAe,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,4CAA4C;IAC5C,cAAc,IAAI,QAAQ,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,iBAAiB,EAAE,CAAA;KAAE,CAAC,CAAC;IACjG,+DAA+D;IAC/D,YAAY,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAAC;IAC/E,yEAAyE;IACzE,SAAS,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IACvC,2CAA2C;IAC3C,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
1
  /* This Source Code Form is subject to the terms of the Mozilla Public
2
2
  * License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ import { axis3d } from './host-geometry-frame.js';
4
5
  export const AXIS_EPS = 1e-6;
5
6
  /**
6
7
  * Walk IfcLocalPlacement → IfcAxis2Placement3D → CartesianPoint and read the
7
8
  * ground-plane origin + RefDirection *of this one placement*, i.e. expressed
8
9
  * in its own `PlacementRelTo` parent's frame. Returns null when any link is
9
- * missing.
10
+ * missing or explicitly unreadable. Only horizontal +Z frames can be
11
+ * represented by this planar contract (#6511 / #6232).
10
12
  */
11
13
  export function readOwnPlacementFrame(store, extractor, overlay, placementId) {
12
14
  const placement = readEntity(store, extractor, overlay, placementId);
13
- if (!placement)
15
+ if (placement?.type?.toUpperCase() !== 'IFCLOCALPLACEMENT')
14
16
  return null;
15
17
  const axisPlacementId = numericAttr(placement.attributes[1]);
16
18
  if (axisPlacementId === null)
17
19
  return null;
18
- const axisPlacement = readEntity(store, extractor, overlay, axisPlacementId);
19
- if (!axisPlacement)
20
+ const frame = axis3d({ entity: (id) => {
21
+ const entity = readEntity(store, extractor, overlay, id);
22
+ return entity?.type ? { type: entity.type, attributes: entity.attributes } : null;
23
+ } }, axisPlacementId);
24
+ if (!frame || Math.abs(frame.z[0]) > AXIS_EPS || Math.abs(frame.z[1]) > AXIS_EPS || frame.z[2] <= 0)
20
25
  return null;
21
- const locationId = numericAttr(axisPlacement.attributes[0]);
22
- const refDirId = numericAttr(axisPlacement.attributes[2]);
23
- if (locationId === null)
24
- return null;
25
- const locationEnt = readEntity(store, extractor, overlay, locationId);
26
- if (!locationEnt)
27
- return null;
28
- const origin = readVec3(locationEnt.attributes[0]);
29
- if (!origin)
30
- return null;
31
- let axisX = [1, 0];
32
- if (refDirId !== null) {
33
- const refDir = readEntity(store, extractor, overlay, refDirId);
34
- if (refDir) {
35
- const dir = readVec3(refDir.attributes[0]);
36
- if (dir) {
37
- const len = Math.hypot(dir[0], dir[1]);
38
- if (len > AXIS_EPS)
39
- axisX = [dir[0] / len, dir[1] / len];
40
- }
41
- }
42
- }
43
- return { origin: [origin[0], origin[1]], axisX };
26
+ return { origin: [frame.o[0], frame.o[1]], axisX: [frame.x[0], frame.x[1]] };
44
27
  }
45
28
  /**
46
29
  * The storey's OWN placement chain: its `ObjectPlacement` and every ancestor
@@ -81,9 +64,9 @@ export function storeyPlacementChain(store, extractor, overlay, storeyId) {
81
64
  * innermost one first. `hops === 0` is the storey's own placement, whose frame
82
65
  * relative to itself is the identity.
83
66
  *
84
- * Returns `null` when any of those placements has no readable frame — the
85
- * caller must then leave the element where it is rather than move it by a
86
- * partial chain.
67
+ * Returns `null` when any required placement has no readable frame; callers
68
+ * refuse the element instead of labelling a partial transform storey-local.
69
+ * Placements at or above the shared ancestor cancel and need not be read.
87
70
  */
88
71
  export function storeyFrameAboveBy(store, extractor, overlay, storeyChain, hops) {
89
72
  let frame = { origin: [0, 0], axisX: [1, 0] };
@@ -195,15 +178,14 @@ export function frameInStoreyFrame(store, extractor, overlay, placementId, store
195
178
  // remove it, so the two directions land on different coordinates and the
196
179
  // #3003 fixture pins which one this is.
197
180
  const storeyFrame = storeyFrameAboveBy(store, extractor, overlay, storeyChain, hops);
198
- return storeyFrame ? composeFrames(invertFrame(storeyFrame), frame) : frame;
181
+ return storeyFrame ? composeFrames(invertFrame(storeyFrame), frame) : null;
199
182
  }
200
- // A cycle in a malformed `PlacementRelTo`: nothing above is trustworthy,
201
- // so stop with what has been composed so far.
183
+ // A cycle or unreadable parent cannot make a trustworthy partial frame.
202
184
  if (visited.has(relToId))
203
- return frame;
185
+ return null;
204
186
  const parent = readOwnPlacementFrame(store, extractor, overlay, relToId);
205
187
  if (!parent)
206
- return frame;
188
+ return null;
207
189
  frame = composeFrames(parent, frame);
208
190
  visited.add(relToId);
209
191
  currentId = relToId;
@@ -226,19 +208,37 @@ export function applyFrame(frame, local) {
226
208
  ];
227
209
  }
228
210
  export function readEntity(store, extractor, overlay, expressId) {
211
+ if (overlay?.isDeleted?.(expressId))
212
+ return null;
213
+ // Source bytes provide the unchanged record; positional edits are applied
214
+ // below so placement walks follow the current references (#5249).
215
+ // @raw-entity-enumeration-ok Single source byte lookup with overlay tombstones, creations and edits applied here.
229
216
  const ref = store.entityIndex.byId.get(expressId);
217
+ let entity = null;
230
218
  if (ref && ref.byteLength > 0 && ref.byteOffset >= 0) {
231
- return extractor.extractEntity(ref);
219
+ entity = extractor.extractEntity(ref);
232
220
  }
233
221
  // Overlay-only entity: fall back to the overlay reader.
234
- if (overlay) {
222
+ if (!entity && overlay) {
235
223
  for (const ent of overlay.getNewEntities()) {
236
224
  if (ent.expressId === expressId) {
237
- return { type: ent.type, attributes: ent.attributes };
225
+ entity = { type: ent.type, attributes: ent.attributes };
226
+ break;
238
227
  }
239
228
  }
240
229
  }
241
- return null;
230
+ if (!entity)
231
+ return null;
232
+ const retype = overlay?.getEntityTypeMutation?.(expressId)?.newType;
233
+ if (retype)
234
+ entity = { ...entity, type: retype };
235
+ const edits = overlay?.getPositionalMutationsForEntity?.(expressId);
236
+ if (!edits?.size)
237
+ return entity;
238
+ const attributes = [...entity.attributes];
239
+ for (const [index, value] of edits)
240
+ attributes[index] = value;
241
+ return { ...entity, attributes };
242
242
  }
243
243
  export function numericAttr(v) {
244
244
  if (typeof v === 'number')
@@ -1 +1 @@
1
- {"version":3,"file":"placement-frame.js","sourceRoot":"","sources":["../../src/in-store/placement-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA6C/D,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC;AAS7B;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAmB,EACnB,SAA0B,EAC1B,OAAsC,EACtC,WAAmB;IAEnB,MAAM,SAAS,GAAG,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;IACrE,IAAI,CAAC,SAAS;QAAE,OAAO,I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C;YAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QACvC,CAAC;QACD,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QACpB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACvC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,CAAgC;IACvD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5B,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACnB,CAAC"}
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Shared parametric-profile factory for the in-store builders (#6232).
3
+ *
4
+ * One discriminated union covers the cross-sections a beam, column or member
5
+ * can carry: the default rectangle plus the steel/hollow sections IfcCreator
6
+ * offers (`addIShapeProfile`, `addLShapeProfile`, ...). Every profile is
7
+ * centred on its own origin, the IFC convention for parameterised profiles,
8
+ * so an extrusion along the element axis runs through the section's centre.
9
+ *
10
+ * Attributes are laid out from the target schema's registry by name
11
+ * (`schemaAttributes`, decision D2): IFC2X3 and IFC4/IFC4X3 differ in the
12
+ * optional tail of several of these classes (IFC2X3 has `CentreOfGravityIn*`,
13
+ * IFC4 has `FlangeEdgeRadius`, `FlangeSlope`, ...), and IFC5 is refused.
14
+ *
15
+ * Params are metres; dimensions are converted to the file's native length
16
+ * unit on emit, like every other in-store builder.
17
+ */
18
+ import type { StoreEditor } from '@ifc-lite/mutations';
19
+ import { type SpatialAnchor } from './anchor.js';
20
+ import { schemaRegistry } from './schema-attributes.js';
21
+ /** Centred rectangle, XDim along profile X, YDim along profile Y. */
22
+ export interface RectangleSection {
23
+ Type: 'Rectangle';
24
+ XDim: number;
25
+ YDim: number;
26
+ }
27
+ /** I / H section (`IfcIShapeProfileDef`). Depth along profile Y. */
28
+ export interface ISection {
29
+ Type: 'I';
30
+ OverallWidth: number;
31
+ OverallDepth: number;
32
+ WebThickness: number;
33
+ FlangeThickness: number;
34
+ FilletRadius?: number;
35
+ }
36
+ /** Angle (`IfcLShapeProfileDef`). Depth along profile Y, Width along X. */
37
+ export interface LSection {
38
+ Type: 'L';
39
+ Depth: number;
40
+ Width: number;
41
+ Thickness: number;
42
+ FilletRadius?: number;
43
+ }
44
+ /** Tee (`IfcTShapeProfileDef`). Flange at +Y. */
45
+ export interface TSection {
46
+ Type: 'T';
47
+ Depth: number;
48
+ FlangeWidth: number;
49
+ WebThickness: number;
50
+ FlangeThickness: number;
51
+ FilletRadius?: number;
52
+ }
53
+ /** Channel (`IfcUShapeProfileDef`). Web at -X, flanges towards +X. */
54
+ export interface USection {
55
+ Type: 'U';
56
+ Depth: number;
57
+ FlangeWidth: number;
58
+ WebThickness: number;
59
+ FlangeThickness: number;
60
+ FilletRadius?: number;
61
+ }
62
+ /** Cold-formed lipped channel (`IfcCShapeProfileDef`). */
63
+ export interface CSection {
64
+ Type: 'C';
65
+ Depth: number;
66
+ Width: number;
67
+ WallThickness: number;
68
+ Girth: number;
69
+ InternalFilletRadius?: number;
70
+ }
71
+ /** Solid circle (`IfcCircleProfileDef`). */
72
+ export interface CircleSection {
73
+ Type: 'Circle';
74
+ Radius: number;
75
+ }
76
+ /** Rectangular hollow section / tube (`IfcRectangleHollowProfileDef`). */
77
+ export interface RectangleHollowSection {
78
+ Type: 'RectangleHollow';
79
+ XDim: number;
80
+ YDim: number;
81
+ WallThickness: number;
82
+ InnerFilletRadius?: number;
83
+ OuterFilletRadius?: number;
84
+ }
85
+ /** Circular hollow section / pipe (`IfcCircleHollowProfileDef`). */
86
+ export interface CircleHollowSection {
87
+ Type: 'CircleHollow';
88
+ Radius: number;
89
+ WallThickness: number;
90
+ }
91
+ /** A parameterised cross-section for a beam, column or member. Metres. */
92
+ export type ProfileSection = RectangleSection | ISection | LSection | TSection | USection | CSection | CircleSection | RectangleHollowSection | CircleHollowSection;
93
+ export type ProfileSectionType = ProfileSection['Type'];
94
+ /** The IFC profile class a section is written as. */
95
+ export declare function profileSectionIfcClass(section: ProfileSection): string;
96
+ /**
97
+ * Refuse a section the mesher could not build or would build inside out:
98
+ * non-positive dimensions, and walls, webs or flanges that do not fit in the
99
+ * outer size. Throws with `op` in the message.
100
+ */
101
+ export declare function validateProfileSection(section: ProfileSection, op: string): void;
102
+ /**
103
+ * The section's axis-aligned extent in its own frame (metres):
104
+ * `[along profile X, along profile Y]`. Profiles are centred, so the section
105
+ * spans half of each on either side of the element axis. For callers that
106
+ * need the outer size without meshing (fallback meshes, snapping, HUDs).
107
+ */
108
+ export declare function profileSectionExtent(section: ProfileSection): [number, number];
109
+ /**
110
+ * Everything `emitProfileSection` would refuse, checked without emitting, so a
111
+ * builder can validate its whole input before it writes its first entity.
112
+ */
113
+ export declare function assertProfileSectionAuthorable(anchor: Pick<SpatialAnchor, 'schema'>, section: ProfileSection, op: string): ReturnType<typeof schemaRegistry>;
114
+ /**
115
+ * Emit a centred parameterised profile (`IfcAxis2Placement2D` at the origin +
116
+ * the profile class for `section.Type`) and return the profile's expressId.
117
+ * Validates the section, converts it to native units, and lays the attributes
118
+ * out for `anchor.schema` (IFC5 refused).
119
+ */
120
+ export declare function emitProfileSection(editor: StoreEditor, anchor: Pick<SpatialAnchor, 'schema' | 'lengthUnitScale'>, section: ProfileSection, op?: string): number;
121
+ /** A linear element's validated section: the default rectangle or a `Profile`. */
122
+ export type LinearSection = {
123
+ Profile: ProfileSection;
124
+ Width?: undefined;
125
+ Height?: undefined;
126
+ } | {
127
+ Width: number;
128
+ Height: number;
129
+ Profile?: undefined;
130
+ };
131
+ /**
132
+ * Validate a beam's or member's section params: exactly one of the rectangle
133
+ * (`Width` + `Height`, finite and positive) or a `Profile`, checked before
134
+ * anything is emitted.
135
+ */
136
+ export declare function linearSection(anchor: Pick<SpatialAnchor, 'schema'>, params: {
137
+ Width?: number;
138
+ Height?: number;
139
+ Profile?: ProfileSection;
140
+ }, op: string): LinearSection;
141
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/in-store/profile.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAoB,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE1E,qEAAqE;AACrE,MAAM,WAAW,gBAAgB;IAAG,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACnF,oEAAoE;AACpE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,GAAG,CAAC;IACV,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AACD,2EAA2E;AAC3E,MAA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AAC;IAAC,OAAO,CAAC,EAAE,SAAS,CAAA;CAAE,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EACrC,MAAM,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,cAAc,CAAA;CAAE,EACrE,EAAE,EAAE,MAAM,GACT,aAAa,CAWf"}
@@ -0,0 +1,174 @@
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 { assertPositiveFinite } from './_emit-helpers.js';
5
+ import { toNativeLength } from './anchor.js';
6
+ import { schemaAttributes, schemaRegistry } from './schema-attributes.js';
7
+ const IFC_CLASS = {
8
+ Rectangle: 'IfcRectangleProfileDef',
9
+ I: 'IfcIShapeProfileDef',
10
+ L: 'IfcLShapeProfileDef',
11
+ T: 'IfcTShapeProfileDef',
12
+ U: 'IfcUShapeProfileDef',
13
+ C: 'IfcCShapeProfileDef',
14
+ Circle: 'IfcCircleProfileDef',
15
+ RectangleHollow: 'IfcRectangleHollowProfileDef',
16
+ CircleHollow: 'IfcCircleHollowProfileDef',
17
+ };
18
+ /** The IFC profile class a section is written as. */
19
+ export function profileSectionIfcClass(section) {
20
+ const cls = IFC_CLASS[section?.Type];
21
+ if (!cls)
22
+ throw new Error(`profile: unknown section Type ${String(section?.Type)}`);
23
+ return cls;
24
+ }
25
+ /** The section's dimension fields (everything but `Type`), keyed by IFC attribute name. */
26
+ function dimensions(section) {
27
+ const { Type: _type, ...dims } = section;
28
+ return dims;
29
+ }
30
+ /** Mandatory dimensions per section: finite and > 0. Optional ones (fillets): finite and >= 0 when set. */
31
+ const REQUIRED = {
32
+ Rectangle: ['XDim', 'YDim'],
33
+ I: ['OverallWidth', 'OverallDepth', 'WebThickness', 'FlangeThickness'],
34
+ L: ['Depth', 'Width', 'Thickness'],
35
+ T: ['Depth', 'FlangeWidth', 'WebThickness', 'FlangeThickness'],
36
+ U: ['Depth', 'FlangeWidth', 'WebThickness', 'FlangeThickness'],
37
+ C: ['Depth', 'Width', 'WallThickness', 'Girth'],
38
+ Circle: ['Radius'],
39
+ RectangleHollow: ['XDim', 'YDim', 'WallThickness'],
40
+ CircleHollow: ['Radius', 'WallThickness'],
41
+ };
42
+ /**
43
+ * Refuse a section the mesher could not build or would build inside out:
44
+ * non-positive dimensions, and walls, webs or flanges that do not fit in the
45
+ * outer size. Throws with `op` in the message.
46
+ */
47
+ export function validateProfileSection(section, op) {
48
+ const cls = profileSectionIfcClass(section);
49
+ const dims = dimensions(section);
50
+ const required = REQUIRED[section.Type];
51
+ for (const [name, value] of Object.entries(dims)) {
52
+ if (value === undefined)
53
+ continue;
54
+ if (!required.includes(name) && !isNonNegativeFinite(value)) {
55
+ throw new Error(`${op}: ${cls}.${name} must be a finite number >= 0`);
56
+ }
57
+ }
58
+ for (const name of required) {
59
+ const value = dims[name];
60
+ if (typeof value !== 'number' || !Number.isFinite(value) || value <= 0) {
61
+ throw new Error(`${op}: ${cls}.${name} must be a finite positive number`);
62
+ }
63
+ }
64
+ const fits = (ok, what) => {
65
+ if (!ok)
66
+ throw new Error(`${op}: ${cls} ${what}`);
67
+ };
68
+ switch (section.Type) {
69
+ case 'I':
70
+ fits(section.WebThickness < section.OverallWidth, 'WebThickness must be less than OverallWidth');
71
+ fits(2 * section.FlangeThickness < section.OverallDepth, 'two FlangeThicknesses must be less than OverallDepth');
72
+ break;
73
+ case 'L':
74
+ fits(section.Thickness < section.Depth && section.Thickness < section.Width, 'Thickness must be less than Depth and Width');
75
+ break;
76
+ case 'T':
77
+ fits(section.WebThickness < section.FlangeWidth, 'WebThickness must be less than FlangeWidth');
78
+ fits(section.FlangeThickness < section.Depth, 'FlangeThickness must be less than Depth');
79
+ break;
80
+ case 'U':
81
+ fits(section.WebThickness < section.FlangeWidth, 'WebThickness must be less than FlangeWidth');
82
+ fits(2 * section.FlangeThickness < section.Depth, 'two FlangeThicknesses must be less than Depth');
83
+ break;
84
+ case 'C':
85
+ fits(2 * section.WallThickness < section.Width, 'two WallThicknesses must be less than Width');
86
+ fits(2 * section.Girth < section.Depth, 'two Girths must be less than Depth');
87
+ fits(section.WallThickness < section.Girth, 'WallThickness must be less than Girth');
88
+ break;
89
+ case 'RectangleHollow':
90
+ fits(2 * section.WallThickness < Math.min(section.XDim, section.YDim), 'two WallThicknesses must be less than XDim and YDim');
91
+ break;
92
+ case 'CircleHollow':
93
+ fits(section.WallThickness < section.Radius, 'WallThickness must be less than Radius');
94
+ break;
95
+ default:
96
+ break;
97
+ }
98
+ }
99
+ function isNonNegativeFinite(value) {
100
+ return typeof value === 'number' && Number.isFinite(value) && value >= 0;
101
+ }
102
+ /**
103
+ * The section's axis-aligned extent in its own frame (metres):
104
+ * `[along profile X, along profile Y]`. Profiles are centred, so the section
105
+ * spans half of each on either side of the element axis. For callers that
106
+ * need the outer size without meshing (fallback meshes, snapping, HUDs).
107
+ */
108
+ export function profileSectionExtent(section) {
109
+ switch (section.Type) {
110
+ case 'Rectangle':
111
+ case 'RectangleHollow':
112
+ return [section.XDim, section.YDim];
113
+ case 'I':
114
+ return [section.OverallWidth, section.OverallDepth];
115
+ case 'L':
116
+ case 'C':
117
+ return [section.Width, section.Depth];
118
+ case 'T':
119
+ case 'U':
120
+ return [section.FlangeWidth, section.Depth];
121
+ case 'Circle':
122
+ case 'CircleHollow':
123
+ return [2 * section.Radius, 2 * section.Radius];
124
+ }
125
+ }
126
+ /**
127
+ * Everything `emitProfileSection` would refuse, checked without emitting, so a
128
+ * builder can validate its whole input before it writes its first entity.
129
+ */
130
+ export function assertProfileSectionAuthorable(anchor, section, op) {
131
+ validateProfileSection(section, op);
132
+ return schemaRegistry(anchor.schema, op);
133
+ }
134
+ /**
135
+ * Emit a centred parameterised profile (`IfcAxis2Placement2D` at the origin +
136
+ * the profile class for `section.Type`) and return the profile's expressId.
137
+ * Validates the section, converts it to native units, and lays the attributes
138
+ * out for `anchor.schema` (IFC5 refused).
139
+ */
140
+ export function emitProfileSection(editor, anchor, section, op = 'emitProfileSection') {
141
+ const registry = assertProfileSectionAuthorable(anchor, section, op);
142
+ const cls = profileSectionIfcClass(section);
143
+ const native = {};
144
+ for (const [name, value] of Object.entries(dimensions(section))) {
145
+ if (value !== undefined)
146
+ native[name] = toNativeLength(anchor, value);
147
+ }
148
+ const originPt = editor.addEntity('IfcCartesianPoint', [[0, 0]]).expressId;
149
+ const position = editor.addEntity('IfcAxis2Placement2D', [`#${originPt}`, null]).expressId;
150
+ const attrs = schemaAttributes(registry, cls, {
151
+ ProfileType: 'AREA',
152
+ Position: `#${position}`,
153
+ ...native,
154
+ }, op);
155
+ return editor.addEntity(cls, attrs).expressId;
156
+ }
157
+ /**
158
+ * Validate a beam's or member's section params: exactly one of the rectangle
159
+ * (`Width` + `Height`, finite and positive) or a `Profile`, checked before
160
+ * anything is emitted.
161
+ */
162
+ export function linearSection(anchor, params, op) {
163
+ if (params.Profile !== undefined) {
164
+ if (params.Width !== undefined || params.Height !== undefined) {
165
+ throw new Error(`${op}: give either Width and Height or a Profile, not both`);
166
+ }
167
+ assertProfileSectionAuthorable(anchor, params.Profile, op);
168
+ return { Profile: params.Profile };
169
+ }
170
+ const { Width, Height } = params;
171
+ assertPositiveFinite([Width, Height], `${op}: Width and Height must be positive`);
172
+ return { Width, Height };
173
+ }
174
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/in-store/profile.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAqB/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAsB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,wB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MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QACjC,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC9D,MAAM,IAAI,KAAK,CAAC,GAAG,EAAE,uDAAuD,CAAC,CAAC;QAChF,CAAC;QACD,8BAA8B,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC;IACrC,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAA2C,CAAC;IACtE,oBAAoB,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,EAAE,qCAAqC,CAAC,CAAC;IAClF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Anchored builder for IfcRailing along a polyline path (#6232).
3
+ *
4
+ * `IfcCreator.addIfcRailing` draws one straight run (a square rail box plus a
5
+ * post at each end). This builder takes a whole path: the handrail is one
6
+ * IfcSweptDiskSolid swept along an IfcPolyline, so corners stay continuous,
7
+ * and circular posts (IfcExtrudedAreaSolid of an IfcCircleProfileDef) stand at
8
+ * every path vertex, plus intermediate ones when `PostSpacing` is set.
9
+ *
10
+ * `Height` is the height of the top of the handrail above the path, so the
11
+ * rail's centreline runs at `Height - RailDiameter / 2` and the posts stop
12
+ * there. The path is the railing's base line in storey coordinates; it may
13
+ * slope (a stair or ramp railing).
14
+ *
15
+ * Schema gating (D2): attributes are laid out from the target schema's
16
+ * registry; IFC2X3's mandatory `IfcSweptDiskSolid.StartParam`/`EndParam` are
17
+ * written as the polyline's full parameter range, and IFC5 is refused.
18
+ */
19
+ import type { StoreEditor } from '@ifc-lite/mutations';
20
+ import { type SpatialAnchor } from './anchor.js';
21
+ type Vec3 = [number, number, number];
22
+ export interface RailingInStoreParams {
23
+ /** Base line of the railing, storey-local (metres). At least two distinct consecutive points. */
24
+ Path: ReadonlyArray<readonly [number, number, number]>;
25
+ /** Height of the top of the handrail above the path (metres). */
26
+ Height: number;
27
+ /** Handrail diameter (metres). Default 0.05. */
28
+ RailDiameter?: number;
29
+ /** Post diameter (metres). Default `RailDiameter`. */
30
+ PostDiameter?: number;
31
+ /**
32
+ * Largest distance between posts along a segment (metres). Posts always
33
+ * stand at every path vertex; with a spacing, each segment gets evenly
34
+ * spaced intermediate posts no further apart than this.
35
+ */
36
+ PostSpacing?: number;
37
+ /** IfcRailing PredefinedType. Default `HANDRAIL`. */
38
+ PredefinedType?: string;
39
+ Name?: string;
40
+ Description?: string;
41
+ ObjectType?: string;
42
+ Tag?: string;
43
+ /** Explicit GlobalId (22-char IFC GUID); generated when omitted. */
44
+ GlobalId?: string;
45
+ }
46
+ export interface RailingBuildResult {
47
+ railingId: number;
48
+ placementId: number;
49
+ /** The handrail's IfcSweptDiskSolid. */
50
+ railSolidId: number;
51
+ /** One IfcExtrudedAreaSolid per post, in path order. */
52
+ postSolidIds: number[];
53
+ shapeRepId: number;
54
+ productShapeId: number;
55
+ relContainedId: number;
56
+ }
57
+ /**
58
+ * Post base points along `path` (vertices, plus intermediates at `spacing`).
59
+ * `spacing`, when given, must be finite and positive: a zero spacing would
60
+ * need infinitely many posts, and NaN would silently drop segment ends.
61
+ */
62
+ export declare function railingPostPoints(path: ReadonlyArray<Vec3>, spacing?: number): Vec3[];
63
+ export declare function addRailingToStore(editor: StoreEditor, anchor: SpatialAnchor, params: RailingInStoreParams): RailingBuildResult;
64
+ export {};
65
+ //# sourceMappingURL=railing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"railing.d.ts","sourceRoot":"","sources":["../../src/in-store/railing.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAk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