@ifc-lite/viewer 1.26.0 → 1.28.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.
- package/.turbo/turbo-build.log +45 -38
- package/CHANGELOG.md +93 -0
- package/dist/assets/{basketViewActivator-ZpTYWE3K.js → basketViewActivator-BNRDNuUJ.js} +9 -9
- package/dist/assets/{bcf-Ctcu_Sc2.js → bcf-DCwCuP7n.js} +56 -56
- package/dist/assets/{browser-DXS29_v9.js → browser-BIoDDfBW.js} +1 -1
- package/dist/assets/{cesium-BoVuJvTC.js → cesium-CzZn5yVA.js} +319 -319
- package/dist/assets/{decode-worker-CgM1iNSK.js → decode-worker-Cjign7Zh.js} +1 -1
- package/dist/assets/deflate-DNGgs8Ur.js +1 -0
- package/dist/assets/drawing-2d-D0dDf6Lh.js +257 -0
- package/dist/assets/e57-source-2wI9jkCA.js +1 -0
- package/dist/assets/exceljs.min-DsuzKYnj.js +29 -0
- package/dist/assets/{exporters-DSq76AVM.js → exporters-B9v81gi9.js} +1861 -1524
- package/dist/assets/geometry.worker-Bpa3115V.js +1 -0
- package/dist/assets/{geotiff-A5UjhI6L.js → geotiff-D-YCLS4g.js} +10 -10
- package/dist/assets/html2canvas.esm-Ge7aVWlp.js +5 -0
- package/dist/assets/{ids-DiLcGTer.js → ids-CCpq-5d3.js} +952 -945
- package/dist/assets/ifc-lite_bg-DbgS5EUA.wasm +0 -0
- package/dist/assets/{index-BAH8IJVR.js → index-Bgb3_Pu_.js} +47682 -42474
- package/dist/assets/index-BtbXFKsX.css +1 -0
- package/dist/assets/index.es-CWfqZyyr.js +6866 -0
- package/dist/assets/{jpeg-BzSkwo5D.js → jpeg-DGOAeUqU.js} +1 -1
- package/dist/assets/jspdf.es.min-XPLU2Wkq.js +19571 -0
- package/dist/assets/jspdf.plugin.autotable-BBLUVd7n.js +2 -0
- package/dist/assets/lens-C4p1kQ0p.js +1 -0
- package/dist/assets/{lerc-Cg2Rz-D5.js → lerc-1PMSCHwX.js} +1 -1
- package/dist/assets/{lzw-BBPPLW-0.js → lzw-C65U9lNM.js} +1 -1
- package/dist/assets/{maplibre-gl-Do6O5tDc.js → maplibre-gl-BF3Z0idw.js} +1 -1
- package/dist/assets/{native-bridge-CPojOeGE.js → native-bridge-XxXos6yI.js} +2 -2
- package/dist/assets/{packbits-yLSpjW-V.js → packbits-BdMWXC3m.js} +1 -1
- package/dist/assets/{pako.esm-Cram60i4.js → pako.esm-n3Pgozwg.js} +1 -1
- package/dist/assets/parser.worker-Ddwo3_06.js +182 -0
- package/dist/assets/pdf-CRwaZf3s.js +135 -0
- package/dist/assets/raw-CJgQdyuZ.js +1 -0
- package/dist/assets/{sandbox-CsRXlgCO.js → sandbox-0sDo3g3m.js} +3037 -2554
- package/dist/assets/server-client-cTCJ-853.js +719 -0
- package/dist/assets/{webimage-YafxjjGr.js → webimage-BtakWX7W.js} +1 -1
- package/dist/assets/xlsx-B1YOg2QB.js +142 -0
- package/dist/assets/{zip-BJqVbRkU.js → zip-DFgP-l20.js} +1 -1
- package/dist/assets/{zstd-CkSLOiuu.js → zstd-CmwsbxmM.js} +1 -1
- package/dist/index.html +10 -10
- package/package.json +27 -23
- package/src/components/mcp/PlaygroundChat.tsx +1 -0
- package/src/components/mcp/data.ts +6 -0
- package/src/components/mcp/playground-dispatcher.ts +280 -0
- package/src/components/mcp/playground-files.ts +33 -1
- package/src/components/mcp/types.ts +2 -1
- package/src/components/ui/combo-input.tsx +163 -0
- package/src/components/ui/tabs.tsx +1 -1
- package/src/components/viewer/CommandPalette.tsx +6 -1
- package/src/components/viewer/ComparePanel.tsx +420 -0
- package/src/components/viewer/HierarchyPanel.tsx +46 -7
- package/src/components/viewer/MainToolbar.tsx +19 -2
- package/src/components/viewer/PropertiesPanel.tsx +84 -8
- package/src/components/viewer/SearchInline.tsx +62 -2
- package/src/components/viewer/SearchModal.filter.builder.tsx +24 -393
- package/src/components/viewer/SearchModal.filter.editors.tsx +503 -0
- package/src/components/viewer/SearchModal.filter.tsx +64 -1
- package/src/components/viewer/SearchModal.tsx +19 -6
- package/src/components/viewer/ViewerLayout.tsx +5 -0
- package/src/components/viewer/Viewport.tsx +18 -0
- package/src/components/viewer/hierarchy/HierarchyNode.tsx +3 -3
- package/src/components/viewer/hierarchy/ifc-icons.ts +9 -0
- package/src/components/viewer/hierarchy/treeDataBuilder.ts +87 -0
- package/src/components/viewer/hierarchy/types.ts +1 -0
- package/src/components/viewer/hierarchy/useHierarchyTree.ts +6 -2
- package/src/components/viewer/lists/ColumnHeaderMenu.tsx +84 -0
- package/src/components/viewer/lists/ListBuilder.tsx +789 -280
- package/src/components/viewer/lists/ListGroupingBar.tsx +72 -0
- package/src/components/viewer/lists/ListPanel.tsx +49 -5
- package/src/components/viewer/lists/ListResultsTable.tsx +270 -176
- package/src/components/viewer/lists/list-table-utils.ts +123 -0
- package/src/components/viewer/properties/MaterialTotalsPanel.tsx +283 -0
- package/src/generated/mcp-catalog.json +4 -0
- package/src/hooks/federationLoadGate.test.ts +12 -2
- package/src/hooks/federationLoadGate.ts +9 -2
- package/src/hooks/ingest/federationAlign.ts +481 -0
- package/src/hooks/ingest/viewerModelIngest.ts +3 -212
- package/src/hooks/source-key.ts +35 -0
- package/src/hooks/useAlignmentLines3D.ts +1 -26
- package/src/hooks/useCompare.ts +0 -0
- package/src/hooks/useCompareOverlay.ts +119 -0
- package/src/hooks/useDrawingGeneration.ts +23 -1
- package/src/hooks/useGridLines3D.ts +140 -0
- package/src/hooks/useIfc.ts +1 -1
- package/src/hooks/useIfcCache.ts +32 -9
- package/src/hooks/useIfcFederation.ts +42 -810
- package/src/hooks/useIfcLoader.ts +361 -488
- package/src/hooks/useIfcServer.ts +3 -0
- package/src/hooks/useLens.ts +5 -1
- package/src/hooks/useSymbolicAnnotations.ts +70 -38
- package/src/lib/compare/buildFingerprints.ts +173 -0
- package/src/lib/compare/describeChange.ts +0 -0
- package/src/lib/compare/geometricData.test.ts +54 -0
- package/src/lib/compare/geometricData.ts +37 -0
- package/src/lib/compare/overlay.test.ts +99 -0
- package/src/lib/compare/overlay.ts +91 -0
- package/src/lib/geo/cesium-placement.ts +1 -1
- package/src/lib/geo/reproject.ts +4 -1
- package/src/lib/length-unit-scale.ts +41 -0
- package/src/lib/lists/adapter.ts +136 -11
- package/src/lib/lists/export/csv.ts +47 -0
- package/src/lib/lists/export/index.ts +49 -0
- package/src/lib/lists/export/model.ts +111 -0
- package/src/lib/lists/export/pdf.ts +67 -0
- package/src/lib/lists/export/xlsx.ts +83 -0
- package/src/lib/lists/index.ts +2 -0
- package/src/lib/llm/script-edit-ops.ts +23 -0
- package/src/lib/llm/stream-client.ts +8 -1
- package/src/lib/search/filter-evaluate.test.ts +81 -0
- package/src/lib/search/filter-evaluate.ts +59 -87
- package/src/lib/search/filter-match.ts +167 -0
- package/src/lib/search/filter-rules.test.ts +25 -0
- package/src/lib/search/filter-rules.ts +75 -2
- package/src/lib/search/filter-schema.ts +0 -0
- package/src/lib/search/result-export.ts +7 -1
- package/src/lib/slab-edit.test.ts +72 -0
- package/src/lib/slab-edit.ts +159 -19
- package/src/sdk/adapters/export-adapter.ts +9 -4
- package/src/sdk/adapters/query-adapter.ts +3 -3
- package/src/store/globalId.ts +15 -13
- package/src/store/index.ts +16 -1
- package/src/store/slices/cesiumSlice.ts +8 -1
- package/src/store/slices/compareSlice.ts +96 -0
- package/src/store/slices/lensSlice.ts +8 -0
- package/src/store/slices/listSlice.ts +6 -0
- package/src/store/slices/mutationSlice.ts +14 -6
- package/src/store/slices/searchSlice.ts +29 -3
- package/src/utils/acquireFileBuffer.test.ts +12 -4
- package/src/utils/desktopModelSnapshot.ts +2 -1
- package/src/utils/loadingUtils.ts +32 -0
- package/src/utils/nativeSpatialDataStore.ts +6 -0
- package/src/utils/serverDataModel.test.ts +6 -0
- package/src/utils/serverDataModel.ts +7 -0
- package/src/utils/spatialHierarchy.test.ts +53 -1
- package/src/utils/spatialHierarchy.ts +42 -2
- package/src/vite-env.d.ts +2 -0
- package/dist/assets/deflate-Cnx0il6E.js +0 -1
- package/dist/assets/drawing-2d-C71b8Ugx.js +0 -257
- package/dist/assets/e57-source-CQHxE8n3.js +0 -1
- package/dist/assets/geometry.worker-0Q9qEa6p.js +0 -1
- package/dist/assets/ifc-lite_bg-CEZnhM2e.wasm +0 -0
- package/dist/assets/index-B9Ug2EqU.css +0 -1
- package/dist/assets/lens-PYsLu_MA.js +0 -1
- package/dist/assets/parser.worker-8md211IW.js +0 -182
- package/dist/assets/raw-BQrAgxwT.js +0 -1
- package/dist/assets/server-client-Bk4c1CPO.js +0 -626
- package/src/hooks/ingest/resolveDataStoreOrAbort.test.ts +0 -61
- package/src/hooks/ingest/resolveDataStoreOrAbort.ts +0 -28
- package/src/hooks/ingest/watchedGeometryStream.test.ts +0 -78
- package/src/hooks/ingest/watchedGeometryStream.ts +0 -76
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sandbox-
|
|
2
|
-
import {
|
|
3
|
-
let g,
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sandbox-0sDo3g3m.js","assets/lens-C4p1kQ0p.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { aC as $, aw as he, al as Z, au as ve, aj as Ee, ak as Te, am as Ie, o as be, _ as ge, a4 as Se, E as Ae, ac as xe, ad as Ce, p as A, a3 as N, ai as Re, ah as Me, ab as Ne, at as _e, __tla as __tla_0 } from "./sandbox-0sDo3g3m.js";
|
|
3
|
+
let g, ua, ca, pa, Pe, oa;
|
|
4
4
|
let __tla = Promise.all([
|
|
5
5
|
(()=>{
|
|
6
6
|
try {
|
|
@@ -10,8 +10,8 @@ let __tla = Promise.all([
|
|
|
10
10
|
]).then(async ()=>{
|
|
11
11
|
const O = "http://www.w3.org/2001/XMLSchema";
|
|
12
12
|
g = class extends Error {
|
|
13
|
-
constructor(t,
|
|
14
|
-
super(t), this.details =
|
|
13
|
+
constructor(t, i){
|
|
14
|
+
super(t), this.details = i, this.name = "IDSParseError";
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
let V = typeof globalThis < "u" && typeof globalThis.DOMParser == "function" ? globalThis.DOMParser : null;
|
|
@@ -19,28 +19,28 @@ let __tla = Promise.all([
|
|
|
19
19
|
await m.__tla;
|
|
20
20
|
return m;
|
|
21
21
|
})).DOMParser);
|
|
22
|
-
|
|
22
|
+
Pe = function(e) {
|
|
23
23
|
let t = typeof e == "string" ? e : new TextDecoder().decode(e);
|
|
24
24
|
if (t.charCodeAt(0) === 65279 && (t = t.slice(1)), !V) throw new g("No DOMParser implementation available", "Neither globalThis.DOMParser nor @xmldom/xmldom could be loaded.");
|
|
25
|
-
const
|
|
26
|
-
let
|
|
25
|
+
const i = new V;
|
|
26
|
+
let a;
|
|
27
27
|
try {
|
|
28
|
-
|
|
28
|
+
a = i.parseFromString(t, "text/xml");
|
|
29
29
|
} catch (s) {
|
|
30
30
|
throw new g("Failed to parse IDS XML", s instanceof Error ? s.message : String(s));
|
|
31
31
|
}
|
|
32
|
-
const n = typeof
|
|
32
|
+
const n = typeof a.querySelector == "function" ? a.querySelector("parsererror") : null;
|
|
33
33
|
if (n) throw new g("Invalid XML format", n.textContent || void 0);
|
|
34
|
-
const r =
|
|
34
|
+
const r = a.documentElement;
|
|
35
35
|
if (!r) throw new g("Failed to parse IDS XML", "Parser returned a document with no root element.");
|
|
36
36
|
if (r.localName !== "ids") throw new g(`Invalid root element: expected "ids", got "${r.localName}"`);
|
|
37
37
|
return {
|
|
38
|
-
info:
|
|
39
|
-
specifications:
|
|
38
|
+
info: $e(r),
|
|
39
|
+
specifications: we(r),
|
|
40
40
|
schemaLocation: r.getAttribute("xsi:schemaLocation") || r.getAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation") || void 0
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
function
|
|
43
|
+
function $e(e) {
|
|
44
44
|
const t = h(e, "info");
|
|
45
45
|
return t ? {
|
|
46
46
|
title: C(t, "title") || "Untitled IDS",
|
|
@@ -55,30 +55,30 @@ let __tla = Promise.all([
|
|
|
55
55
|
title: "Untitled IDS"
|
|
56
56
|
};
|
|
57
57
|
}
|
|
58
|
-
function
|
|
58
|
+
function we(e) {
|
|
59
59
|
const t = h(e, "specifications");
|
|
60
|
-
return t ? U(t, "specification").map((
|
|
60
|
+
return t ? U(t, "specification").map((a, n)=>Fe(a, n)) : [];
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
const
|
|
64
|
-
facets: r ?
|
|
62
|
+
function Fe(e, t) {
|
|
63
|
+
const i = e.getAttribute("name") || `Specification ${t + 1}`, n = (e.getAttribute("ifcVersion") || "IFC4").split(/\s+/).map((f)=>Oe(f)).filter((f)=>f !== null), r = h(e, "applicability"), s = {
|
|
64
|
+
facets: r ? Le(r) : [],
|
|
65
65
|
cardinality: r?.getAttribute("cardinality") ?? void 0
|
|
66
66
|
}, l = (r ? r.getAttribute("minOccurs") : null) ?? e.getAttribute("minOccurs"), o = (r ? r.getAttribute("maxOccurs") : null) ?? e.getAttribute("maxOccurs");
|
|
67
67
|
let u;
|
|
68
68
|
if (l !== null) {
|
|
69
|
-
const
|
|
70
|
-
Number.isFinite(
|
|
69
|
+
const f = parseInt(l, 10);
|
|
70
|
+
Number.isFinite(f) && (u = f);
|
|
71
71
|
}
|
|
72
72
|
let c;
|
|
73
73
|
if (o !== null) {
|
|
74
|
-
const
|
|
75
|
-
o === "unbounded" ? c = "unbounded" : Number.isFinite(
|
|
74
|
+
const f = parseInt(o, 10);
|
|
75
|
+
o === "unbounded" ? c = "unbounded" : Number.isFinite(f) && (c = f);
|
|
76
76
|
}
|
|
77
77
|
u === void 0 && (r || c !== void 0) && (u = 1);
|
|
78
|
-
const
|
|
78
|
+
const m = h(e, "requirements"), d = m ? He(m) : [];
|
|
79
79
|
return {
|
|
80
80
|
id: e.getAttribute("identifier") || `spec-${t}`,
|
|
81
|
-
name:
|
|
81
|
+
name: i,
|
|
82
82
|
description: e.getAttribute("description") || void 0,
|
|
83
83
|
instructions: e.getAttribute("instructions") || void 0,
|
|
84
84
|
identifier: e.getAttribute("identifier") || void 0,
|
|
@@ -92,7 +92,7 @@ let __tla = Promise.all([
|
|
|
92
92
|
maxOccurs: c
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Oe(e) {
|
|
96
96
|
const t = e.toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
97
97
|
switch(t){
|
|
98
98
|
case "IFC2X3":
|
|
@@ -106,90 +106,90 @@ let __tla = Promise.all([
|
|
|
106
106
|
return t.startsWith("IFC4X3") ? "IFC4X3" : t.startsWith("IFC4") ? "IFC4" : t.startsWith("IFC2X3") ? "IFC2X3" : null;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function Le(e) {
|
|
110
110
|
const t = [];
|
|
111
|
-
for (const
|
|
112
|
-
const
|
|
113
|
-
|
|
111
|
+
for (const i of Array.from(e.children)){
|
|
112
|
+
const a = ee(i);
|
|
113
|
+
a && t.push(a);
|
|
114
114
|
}
|
|
115
115
|
return t;
|
|
116
116
|
}
|
|
117
|
-
function
|
|
117
|
+
function ee(e) {
|
|
118
118
|
switch(e.localName.toLowerCase()){
|
|
119
119
|
case "entity":
|
|
120
|
-
return
|
|
120
|
+
return te(e);
|
|
121
121
|
case "attribute":
|
|
122
|
-
return
|
|
122
|
+
return Ve(e);
|
|
123
123
|
case "property":
|
|
124
|
-
return
|
|
124
|
+
return De(e);
|
|
125
125
|
case "classification":
|
|
126
|
-
return
|
|
126
|
+
return Ue(e);
|
|
127
127
|
case "material":
|
|
128
|
-
return
|
|
128
|
+
return ke(e);
|
|
129
129
|
case "partof":
|
|
130
|
-
return
|
|
130
|
+
return Be(e);
|
|
131
131
|
default:
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
const t = h(e, "name"),
|
|
135
|
+
function te(e) {
|
|
136
|
+
const t = h(e, "name"), i = h(e, "predefinedType");
|
|
137
137
|
if (!t) throw new g("Entity facet must have a name element");
|
|
138
138
|
return {
|
|
139
139
|
type: "entity",
|
|
140
140
|
name: T(t),
|
|
141
|
-
predefinedType:
|
|
141
|
+
predefinedType: i ? T(i) : void 0
|
|
142
142
|
};
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
const t = h(e, "name"),
|
|
144
|
+
function Ve(e) {
|
|
145
|
+
const t = h(e, "name"), i = h(e, "value");
|
|
146
146
|
if (!t) throw new g("Attribute facet must have a name element");
|
|
147
147
|
return {
|
|
148
148
|
type: "attribute",
|
|
149
149
|
name: T(t),
|
|
150
|
-
value:
|
|
150
|
+
value: i ? T(i) : void 0
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
const t = h(e, "propertySet"),
|
|
153
|
+
function De(e) {
|
|
154
|
+
const t = h(e, "propertySet"), i = h(e, "baseName"), a = e.getAttribute("dataType"), n = h(e, "dataType"), r = h(e, "value");
|
|
155
155
|
if (!t) throw new g("Property facet must have a propertySet element");
|
|
156
|
-
if (!
|
|
156
|
+
if (!i) throw new g("Property facet must have a baseName element");
|
|
157
157
|
let s;
|
|
158
|
-
return
|
|
158
|
+
return a ? s = {
|
|
159
159
|
type: "simpleValue",
|
|
160
|
-
value:
|
|
160
|
+
value: a
|
|
161
161
|
} : n && (s = T(n)), {
|
|
162
162
|
type: "property",
|
|
163
163
|
propertySet: T(t),
|
|
164
|
-
baseName: T(
|
|
164
|
+
baseName: T(i),
|
|
165
165
|
dataType: s,
|
|
166
166
|
value: r ? T(r) : void 0
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
const t = h(e, "system"),
|
|
169
|
+
function Ue(e) {
|
|
170
|
+
const t = h(e, "system"), i = h(e, "value");
|
|
171
171
|
return {
|
|
172
172
|
type: "classification",
|
|
173
173
|
system: t ? T(t) : void 0,
|
|
174
|
-
value:
|
|
174
|
+
value: i ? T(i) : void 0
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function ke(e) {
|
|
178
178
|
const t = h(e, "value");
|
|
179
179
|
return {
|
|
180
180
|
type: "material",
|
|
181
181
|
value: t ? T(t) : void 0
|
|
182
182
|
};
|
|
183
183
|
}
|
|
184
|
-
function
|
|
185
|
-
const t = e.getAttribute("relation"),
|
|
184
|
+
function Be(e) {
|
|
185
|
+
const t = e.getAttribute("relation"), i = t || "IfcRelContainedInSpatialStructure", a = h(e, "entity"), n = Ye(i), r = qe(i), s = {
|
|
186
186
|
type: "partOf",
|
|
187
187
|
relation: n,
|
|
188
|
-
entity:
|
|
188
|
+
entity: a ? te(a) : void 0
|
|
189
189
|
};
|
|
190
190
|
return !r && t && (s.rawRelation = t), s;
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function qe(e) {
|
|
193
193
|
switch(e){
|
|
194
194
|
case "IfcRelAggregates":
|
|
195
195
|
case "IfcRelContainedInSpatialStructure":
|
|
@@ -202,17 +202,17 @@ let __tla = Promise.all([
|
|
|
202
202
|
return !1;
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
function
|
|
205
|
+
function Ye(e) {
|
|
206
206
|
const t = e.toUpperCase();
|
|
207
207
|
return t.includes("ASSIGNSTOGROUP") || t.includes("GROUP") ? "IfcRelAssignsToGroup" : t.includes("AGGREGATE") ? "IfcRelAggregates" : t.includes("CONTAINED") || t.includes("SPATIAL") ? "IfcRelContainedInSpatialStructure" : t.includes("NEST") ? "IfcRelNests" : t.includes("VOID") ? "IfcRelVoidsElement" : t.includes("FILL") ? "IfcRelFillsElement" : "IfcRelContainedInSpatialStructure";
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function He(e) {
|
|
210
210
|
const t = [];
|
|
211
|
-
let
|
|
212
|
-
for (const
|
|
213
|
-
const n =
|
|
211
|
+
let i = 0;
|
|
212
|
+
for (const a of Array.from(e.children)){
|
|
213
|
+
const n = ee(a);
|
|
214
214
|
if (n) {
|
|
215
|
-
const r =
|
|
215
|
+
const r = a.getAttribute("cardinality"), s = a.getAttribute("minOccurs"), l = a.getAttribute("maxOccurs");
|
|
216
216
|
let o = "required", u;
|
|
217
217
|
if (r !== null) if (r === "required" || r === "optional" || r === "prohibited") o = r;
|
|
218
218
|
else {
|
|
@@ -221,12 +221,12 @@ let __tla = Promise.all([
|
|
|
221
221
|
}
|
|
222
222
|
else s === "0" && l === "0" ? o = "prohibited" : s === "0" && (o = "optional");
|
|
223
223
|
t.push({
|
|
224
|
-
id: `req-${
|
|
224
|
+
id: `req-${i++}`,
|
|
225
225
|
facet: n,
|
|
226
226
|
optionality: o,
|
|
227
227
|
cardinalityRaw: u,
|
|
228
|
-
description:
|
|
229
|
-
instructions:
|
|
228
|
+
description: a.getAttribute("description") || void 0,
|
|
229
|
+
instructions: a.getAttribute("instructions") || void 0
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
}
|
|
@@ -238,32 +238,32 @@ let __tla = Promise.all([
|
|
|
238
238
|
type: "simpleValue",
|
|
239
239
|
value: t.textContent?.trim() || ""
|
|
240
240
|
};
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
return
|
|
241
|
+
const i = ie(e, "restriction", O) || h(e, "restriction");
|
|
242
|
+
if (i) return Ge(i);
|
|
243
|
+
const a = e.textContent?.trim();
|
|
244
|
+
return a ? {
|
|
245
245
|
type: "simpleValue",
|
|
246
|
-
value:
|
|
246
|
+
value: a
|
|
247
247
|
} : {
|
|
248
248
|
type: "simpleValue",
|
|
249
249
|
value: ""
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
function
|
|
253
|
-
const t = e.getAttribute("base") || void 0,
|
|
252
|
+
function Ge(e) {
|
|
253
|
+
const t = e.getAttribute("base") || void 0, i = (()=>{
|
|
254
254
|
const s = q(e, "pattern", O);
|
|
255
255
|
return s.length > 0 ? s : U(e, "pattern");
|
|
256
256
|
})();
|
|
257
|
-
if (
|
|
258
|
-
const s =
|
|
257
|
+
if (i.length > 0) {
|
|
258
|
+
const s = i.map((o)=>o.getAttribute("value") || o.textContent || "").filter((o)=>o.length > 0);
|
|
259
259
|
return {
|
|
260
260
|
type: "pattern",
|
|
261
261
|
pattern: s.length === 1 ? s[0] : s.map((o)=>`(?:${o})`).join("|"),
|
|
262
262
|
base: t
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
|
-
const
|
|
266
|
-
if (
|
|
265
|
+
const a = q(e, "enumeration", O);
|
|
266
|
+
if (a.length === 0) {
|
|
267
267
|
const s = U(e, "enumeration");
|
|
268
268
|
if (s.length > 0) return {
|
|
269
269
|
type: "enumeration",
|
|
@@ -272,7 +272,7 @@ let __tla = Promise.all([
|
|
|
272
272
|
};
|
|
273
273
|
} else return {
|
|
274
274
|
type: "enumeration",
|
|
275
|
-
values:
|
|
275
|
+
values: a.map((s)=>s.getAttribute("value") || s.textContent || ""),
|
|
276
276
|
base: t
|
|
277
277
|
};
|
|
278
278
|
const n = {};
|
|
@@ -284,7 +284,7 @@ let __tla = Promise.all([
|
|
|
284
284
|
"length",
|
|
285
285
|
"minLength",
|
|
286
286
|
"maxLength"
|
|
287
|
-
])n[s] =
|
|
287
|
+
])n[s] = ie(e, s, O) || h(e, s);
|
|
288
288
|
if (Object.values(n).some((s)=>s !== null)) {
|
|
289
289
|
const s = {
|
|
290
290
|
type: "bounds",
|
|
@@ -315,99 +315,99 @@ let __tla = Promise.all([
|
|
|
315
315
|
};
|
|
316
316
|
}
|
|
317
317
|
function h(e, t) {
|
|
318
|
-
for (const
|
|
318
|
+
for (const i of Array.from(e.children))if (i.localName.toLowerCase() === t.toLowerCase()) return i;
|
|
319
319
|
return null;
|
|
320
320
|
}
|
|
321
321
|
function U(e, t) {
|
|
322
|
-
const
|
|
323
|
-
for (const
|
|
324
|
-
return
|
|
322
|
+
const i = [];
|
|
323
|
+
for (const a of Array.from(e.children))a.localName.toLowerCase() === t.toLowerCase() && i.push(a);
|
|
324
|
+
return i;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
327
|
-
for (const
|
|
326
|
+
function ie(e, t, i) {
|
|
327
|
+
for (const a of Array.from(e.children))if (a.localName.toLowerCase() === t.toLowerCase() && a.namespaceURI === i) return a;
|
|
328
328
|
return null;
|
|
329
329
|
}
|
|
330
|
-
function q(e, t,
|
|
331
|
-
const
|
|
332
|
-
for (const n of Array.from(e.children))n.localName.toLowerCase() === t.toLowerCase() && n.namespaceURI ===
|
|
333
|
-
return
|
|
330
|
+
function q(e, t, i) {
|
|
331
|
+
const a = [];
|
|
332
|
+
for (const n of Array.from(e.children))n.localName.toLowerCase() === t.toLowerCase() && n.namespaceURI === i && a.push(n);
|
|
333
|
+
return a;
|
|
334
334
|
}
|
|
335
335
|
function C(e, t) {
|
|
336
336
|
return h(e, t)?.textContent?.trim() || void 0;
|
|
337
337
|
}
|
|
338
|
-
const Y = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/,
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
return
|
|
342
|
-
}
|
|
343
|
-
function ie(e, t) {
|
|
344
|
-
const a = String(t), i = Y.test(e), n = typeof t == "number" || Y.test(a);
|
|
345
|
-
if (!i || !n) return;
|
|
346
|
-
const r = parseFloat(e), s = typeof t == "number" ? t : parseFloat(a);
|
|
347
|
-
if (!(Number.isNaN(r) || Number.isNaN(s))) return Math.abs(r - s) <= Xe(r, s);
|
|
338
|
+
const Y = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, Xe = 1e-6;
|
|
339
|
+
function je(e, t) {
|
|
340
|
+
const i = Xe * (1 + Math.abs(e)), a = 16 * Number.EPSILON * Math.max(Math.abs(e), typeof t == "number" ? Math.abs(t) : 0);
|
|
341
|
+
return i + a;
|
|
348
342
|
}
|
|
349
343
|
function ae(e, t) {
|
|
344
|
+
const i = String(t), a = Y.test(e), n = typeof t == "number" || Y.test(i);
|
|
345
|
+
if (!a || !n) return;
|
|
346
|
+
const r = parseFloat(e), s = typeof t == "number" ? t : parseFloat(i);
|
|
347
|
+
if (!(Number.isNaN(r) || Number.isNaN(s))) return Math.abs(r - s) <= je(r, s);
|
|
348
|
+
}
|
|
349
|
+
function ne(e, t) {
|
|
350
350
|
if (!(e !== "true" && e !== "false")) return typeof t == "boolean" ? e === "true" ? t === !0 : t === !1 : t === "true" || t === "false" ? t === e : !1;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
const
|
|
354
|
-
if (
|
|
352
|
+
function re(e, t, i) {
|
|
353
|
+
const a = String(t);
|
|
354
|
+
if (a === e || i && a.toUpperCase() === e.toUpperCase()) return !0;
|
|
355
355
|
}
|
|
356
|
-
function v(e, t,
|
|
356
|
+
function v(e, t, i) {
|
|
357
357
|
if (t == null) return !1;
|
|
358
|
-
const
|
|
358
|
+
const a = i?.caseInsensitive ?? !1;
|
|
359
359
|
switch(e.type){
|
|
360
360
|
case "simpleValue":
|
|
361
|
-
return
|
|
361
|
+
return We(e, t, a);
|
|
362
362
|
case "pattern":
|
|
363
|
-
return
|
|
363
|
+
return ze(e, t, a);
|
|
364
364
|
case "enumeration":
|
|
365
|
-
return
|
|
365
|
+
return Qe(e, t, a);
|
|
366
366
|
case "bounds":
|
|
367
|
-
return
|
|
367
|
+
return Je(e, t);
|
|
368
368
|
default:
|
|
369
369
|
return !1;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
const
|
|
372
|
+
function We(e, t, i) {
|
|
373
|
+
const a = e.value, n = re(a, t, i);
|
|
374
374
|
if (n !== void 0) return n;
|
|
375
|
-
const r =
|
|
375
|
+
const r = ae(a, t);
|
|
376
376
|
if (r !== void 0) return r;
|
|
377
|
-
const s =
|
|
377
|
+
const s = ne(a, t);
|
|
378
378
|
return s !== void 0 ? s : !1;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function ze(e, t, i = !1) {
|
|
381
381
|
if (typeof t == "number" || typeof t == "boolean") return !1;
|
|
382
|
-
const
|
|
382
|
+
const a = String(t);
|
|
383
383
|
try {
|
|
384
|
-
const n =
|
|
385
|
-
return new RegExp(`^${n}$`, r).test(
|
|
384
|
+
const n = Ke(e.pattern), r = i ? "i" : "";
|
|
385
|
+
return new RegExp(`^${n}$`, r).test(a);
|
|
386
386
|
} catch {
|
|
387
387
|
return !1;
|
|
388
388
|
}
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function Ke(e) {
|
|
391
391
|
return e.replace(/\\i/g, "[A-Za-z_:]").replace(/\\c/g, "[A-Za-z0-9._:-]").replace(/\\p\{[^}]+\}/g, ".").replace(/\[([^\]]+)-\[[^\]]+\]\]/g, "[$1]");
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
return e.values.some((
|
|
395
|
-
const n =
|
|
393
|
+
function Qe(e, t, i) {
|
|
394
|
+
return e.values.some((a)=>{
|
|
395
|
+
const n = re(a, t, i);
|
|
396
396
|
if (n !== void 0) return n;
|
|
397
|
-
const r =
|
|
397
|
+
const r = ae(a, t);
|
|
398
398
|
if (r !== void 0) return r;
|
|
399
|
-
const s =
|
|
399
|
+
const s = ne(a, t);
|
|
400
400
|
return s !== void 0 ? s : !1;
|
|
401
401
|
});
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Je(e, t) {
|
|
404
404
|
if (e.length !== void 0 || e.minLength !== void 0 || e.maxLength !== void 0) {
|
|
405
|
-
const
|
|
406
|
-
if (e.length !== void 0 &&
|
|
405
|
+
const a = String(t);
|
|
406
|
+
if (e.length !== void 0 && a.length !== e.length || e.minLength !== void 0 && a.length < e.minLength || e.maxLength !== void 0 && a.length > e.maxLength) return !1;
|
|
407
407
|
if (e.minInclusive === void 0 && e.maxInclusive === void 0 && e.minExclusive === void 0 && e.maxExclusive === void 0) return !0;
|
|
408
408
|
}
|
|
409
|
-
const
|
|
410
|
-
return !(isNaN(
|
|
409
|
+
const i = typeof t == "number" ? t : parseFloat(String(t));
|
|
410
|
+
return !(isNaN(i) || e.minInclusive !== void 0 && i < e.minInclusive || e.maxInclusive !== void 0 && i > e.maxInclusive || e.minExclusive !== void 0 && i <= e.minExclusive || e.maxExclusive !== void 0 && i >= e.maxExclusive);
|
|
411
411
|
}
|
|
412
412
|
function p(e) {
|
|
413
413
|
switch(e.type){
|
|
@@ -418,21 +418,21 @@ let __tla = Promise.all([
|
|
|
418
418
|
case "enumeration":
|
|
419
419
|
return e.values.length === 1 ? `"${e.values[0]}"` : `one of [${e.values.map((t)=>`"${t}"`).join(", ")}]`;
|
|
420
420
|
case "bounds":
|
|
421
|
-
return
|
|
421
|
+
return Ze(e);
|
|
422
422
|
default:
|
|
423
423
|
return "unknown";
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function Ze(e) {
|
|
427
427
|
const t = [];
|
|
428
428
|
return e.minInclusive !== void 0 && e.maxInclusive !== void 0 ? `between ${e.minInclusive} and ${e.maxInclusive}` : (e.minInclusive !== void 0 && t.push(`>= ${e.minInclusive}`), e.maxInclusive !== void 0 && t.push(`<= ${e.maxInclusive}`), e.minExclusive !== void 0 && t.push(`> ${e.minExclusive}`), e.maxExclusive !== void 0 && t.push(`< ${e.maxExclusive}`), t.join(" and ") || "any value");
|
|
429
429
|
}
|
|
430
|
-
const
|
|
430
|
+
const et = {
|
|
431
431
|
caseInsensitive: !0
|
|
432
432
|
};
|
|
433
|
-
function
|
|
434
|
-
const
|
|
435
|
-
if (!
|
|
433
|
+
function tt(e, t, i) {
|
|
434
|
+
const a = i.getEntityType(t);
|
|
435
|
+
if (!a) return {
|
|
436
436
|
passed: !1,
|
|
437
437
|
actualValue: void 0,
|
|
438
438
|
expectedValue: p(e.name),
|
|
@@ -445,31 +445,31 @@ let __tla = Promise.all([
|
|
|
445
445
|
};
|
|
446
446
|
if (e.name.type === "simpleValue" && e.name.value !== e.name.value.toUpperCase()) return {
|
|
447
447
|
passed: !1,
|
|
448
|
-
actualValue:
|
|
448
|
+
actualValue: a,
|
|
449
449
|
expectedValue: p(e.name),
|
|
450
450
|
failure: {
|
|
451
451
|
type: "ENTITY_TYPE_MISMATCH",
|
|
452
452
|
field: "entityType",
|
|
453
|
-
actual:
|
|
453
|
+
actual: a,
|
|
454
454
|
expected: p(e.name)
|
|
455
455
|
}
|
|
456
456
|
};
|
|
457
|
-
if (!v(e.name,
|
|
457
|
+
if (!v(e.name, a, et)) return {
|
|
458
458
|
passed: !1,
|
|
459
|
-
actualValue:
|
|
459
|
+
actualValue: a,
|
|
460
460
|
expectedValue: p(e.name),
|
|
461
461
|
failure: {
|
|
462
462
|
type: "ENTITY_TYPE_MISMATCH",
|
|
463
463
|
field: "entityType",
|
|
464
|
-
actual:
|
|
464
|
+
actual: a,
|
|
465
465
|
expected: p(e.name)
|
|
466
466
|
}
|
|
467
467
|
};
|
|
468
468
|
if (e.predefinedType) {
|
|
469
|
-
const n =
|
|
469
|
+
const n = i.getPredefinedTypeRaw?.(t), r = i.getObjectType(t);
|
|
470
470
|
if (!n && !r) return {
|
|
471
471
|
passed: !1,
|
|
472
|
-
actualValue:
|
|
472
|
+
actualValue: a,
|
|
473
473
|
expectedValue: `${p(e.name)} with predefinedType ${p(e.predefinedType)}`,
|
|
474
474
|
failure: {
|
|
475
475
|
type: "PREDEFINED_TYPE_MISSING",
|
|
@@ -482,7 +482,7 @@ let __tla = Promise.all([
|
|
|
482
482
|
const l = r || n || "(none)";
|
|
483
483
|
return {
|
|
484
484
|
passed: !1,
|
|
485
|
-
actualValue: `${
|
|
485
|
+
actualValue: `${a}[${l}]`,
|
|
486
486
|
expectedValue: `${p(e.name)} with predefinedType ${p(e.predefinedType)}`,
|
|
487
487
|
failure: {
|
|
488
488
|
type: "PREDEFINED_TYPE_MISMATCH",
|
|
@@ -495,44 +495,44 @@ let __tla = Promise.all([
|
|
|
495
495
|
}
|
|
496
496
|
return {
|
|
497
497
|
passed: !0,
|
|
498
|
-
actualValue: e.predefinedType ? `${
|
|
498
|
+
actualValue: e.predefinedType ? `${a}[${i.getObjectType(t) || ""}]` : a,
|
|
499
499
|
expectedValue: p(e.name)
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
505
|
-
if (
|
|
506
|
-
const
|
|
507
|
-
for (const n of
|
|
508
|
-
return
|
|
502
|
+
function it(e, t) {
|
|
503
|
+
const i = e.name;
|
|
504
|
+
if (i.type === "simpleValue") return t.getEntitiesByType(i.value);
|
|
505
|
+
if (i.type === "enumeration") {
|
|
506
|
+
const a = [];
|
|
507
|
+
for (const n of i.values)a.push(...t.getEntitiesByType(n));
|
|
508
|
+
return a;
|
|
509
509
|
}
|
|
510
510
|
}
|
|
511
|
-
const
|
|
512
|
-
function
|
|
513
|
-
return !t || t.length === 0 ? !0 : t.some((
|
|
511
|
+
const at = /^[+-]?\d+$/, nt = /^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/, rt = /^\d{4}-\d{2}-\d{2}(Z|[+-]\d{2}:\d{2})?$/, st = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?$/, lt = /^-?P(?:\d+Y)?(?:\d+M)?(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?$/;
|
|
512
|
+
function se(e, t) {
|
|
513
|
+
return !t || t.length === 0 ? !0 : t.some((i)=>ot(e, i));
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function ot(e, t) {
|
|
516
516
|
switch(t){
|
|
517
517
|
case "xs:integer":
|
|
518
|
-
return
|
|
518
|
+
return at.test(e);
|
|
519
519
|
case "xs:double":
|
|
520
|
-
return
|
|
520
|
+
return nt.test(e);
|
|
521
521
|
case "xs:boolean":
|
|
522
522
|
return e === "true" || e === "false";
|
|
523
523
|
case "xs:date":
|
|
524
|
-
return
|
|
524
|
+
return rt.test(e);
|
|
525
525
|
case "xs:dateTime":
|
|
526
|
-
return
|
|
526
|
+
return st.test(e);
|
|
527
527
|
case "xs:duration":
|
|
528
|
-
return
|
|
528
|
+
return lt.test(e);
|
|
529
529
|
case "xs:string":
|
|
530
530
|
return !0;
|
|
531
531
|
default:
|
|
532
532
|
return !0;
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
|
-
function
|
|
535
|
+
function ut(e) {
|
|
536
536
|
if (!e) return [];
|
|
537
537
|
const t = e.toUpperCase();
|
|
538
538
|
return t === "IFCINTEGER" || t === "IFCCOUNTMEASURE" ? [
|
|
@@ -554,9 +554,9 @@ let __tla = Promise.all([
|
|
|
554
554
|
"xs:string"
|
|
555
555
|
] : [];
|
|
556
556
|
}
|
|
557
|
-
const
|
|
557
|
+
const ct = {
|
|
558
558
|
caseInsensitive: !0
|
|
559
|
-
},
|
|
559
|
+
}, pt = [
|
|
560
560
|
"Name",
|
|
561
561
|
"Description",
|
|
562
562
|
"ObjectType",
|
|
@@ -564,34 +564,34 @@ let __tla = Promise.all([
|
|
|
564
564
|
"GlobalId",
|
|
565
565
|
"LongName"
|
|
566
566
|
];
|
|
567
|
-
function
|
|
568
|
-
const
|
|
567
|
+
function dt(e, t, i) {
|
|
568
|
+
const a = e.name;
|
|
569
569
|
let n;
|
|
570
|
-
if (
|
|
571
|
-
|
|
570
|
+
if (a.type === "simpleValue") n = [
|
|
571
|
+
a.value
|
|
572
572
|
];
|
|
573
573
|
else {
|
|
574
|
-
const s =
|
|
575
|
-
if (n = (s && s.length > 0 ? s :
|
|
574
|
+
const s = i.getAttributeNames?.(t);
|
|
575
|
+
if (n = (s && s.length > 0 ? s : pt).filter((o)=>v(a, o, ct)), n.length === 0) return {
|
|
576
576
|
passed: !1,
|
|
577
|
-
expectedValue: e.value ? p(e.value) : `attribute matching ${p(
|
|
577
|
+
expectedValue: e.value ? p(e.value) : `attribute matching ${p(a)} to exist`,
|
|
578
578
|
failure: {
|
|
579
579
|
type: "ATTRIBUTE_MISSING",
|
|
580
|
-
field: p(
|
|
581
|
-
expected: p(
|
|
580
|
+
field: p(a),
|
|
581
|
+
expected: p(a)
|
|
582
582
|
}
|
|
583
583
|
};
|
|
584
584
|
}
|
|
585
585
|
let r;
|
|
586
586
|
for (const s of n){
|
|
587
|
-
const l =
|
|
587
|
+
const l = mt(e, s, t, i);
|
|
588
588
|
if (l.passed) return l;
|
|
589
589
|
(!r || l.failure?.type !== "ATTRIBUTE_MISSING" && r.failure?.type === "ATTRIBUTE_MISSING") && (r = l);
|
|
590
590
|
}
|
|
591
591
|
return r;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
const n =
|
|
593
|
+
function mt(e, t, i, a) {
|
|
594
|
+
const n = ft(t, i, a);
|
|
595
595
|
if (n == null) return {
|
|
596
596
|
passed: !1,
|
|
597
597
|
actualValue: void 0,
|
|
@@ -619,8 +619,8 @@ let __tla = Promise.all([
|
|
|
619
619
|
expectedValue: `attribute "${t}" to exist`
|
|
620
620
|
};
|
|
621
621
|
if (e.value.type === "simpleValue") {
|
|
622
|
-
const r =
|
|
623
|
-
if (r && !
|
|
622
|
+
const r = a.getAttributeXsdTypes?.(i, t);
|
|
623
|
+
if (r && !se(e.value.value, r)) return {
|
|
624
624
|
passed: !1,
|
|
625
625
|
actualValue: String(n),
|
|
626
626
|
expectedValue: p(e.value),
|
|
@@ -648,26 +648,26 @@ let __tla = Promise.all([
|
|
|
648
648
|
}
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
|
-
function
|
|
651
|
+
function ft(e, t, i) {
|
|
652
652
|
switch(e.toLowerCase()){
|
|
653
653
|
case "name":
|
|
654
|
-
return
|
|
654
|
+
return i.getEntityName(t);
|
|
655
655
|
case "description":
|
|
656
|
-
return
|
|
656
|
+
return i.getDescription(t);
|
|
657
657
|
case "objecttype":
|
|
658
|
-
return
|
|
658
|
+
return i.getObjectType(t);
|
|
659
659
|
case "globalid":
|
|
660
|
-
return
|
|
660
|
+
return i.getGlobalId(t);
|
|
661
661
|
default:
|
|
662
|
-
return
|
|
662
|
+
return i.getAttribute(t, e);
|
|
663
663
|
}
|
|
664
664
|
}
|
|
665
|
-
const
|
|
665
|
+
const yt = {
|
|
666
666
|
caseInsensitive: !0
|
|
667
667
|
};
|
|
668
|
-
function
|
|
669
|
-
const
|
|
670
|
-
if (
|
|
668
|
+
function ht(e, t, i) {
|
|
669
|
+
const a = i.getPropertySets(t);
|
|
670
|
+
if (a.length === 0) return {
|
|
671
671
|
passed: !1,
|
|
672
672
|
expectedValue: `property "${p(e.baseName)}" in "${p(e.propertySet)}"`,
|
|
673
673
|
failure: {
|
|
@@ -676,9 +676,9 @@ let __tla = Promise.all([
|
|
|
676
676
|
expected: p(e.propertySet)
|
|
677
677
|
}
|
|
678
678
|
};
|
|
679
|
-
const n =
|
|
679
|
+
const n = a.filter((u)=>v(e.propertySet, u.name));
|
|
680
680
|
if (n.length === 0) {
|
|
681
|
-
const u =
|
|
681
|
+
const u = a.map((c)=>c.name).join(", ");
|
|
682
682
|
return {
|
|
683
683
|
passed: !1,
|
|
684
684
|
actualValue: u || "(none)",
|
|
@@ -696,7 +696,7 @@ let __tla = Promise.all([
|
|
|
696
696
|
}
|
|
697
697
|
let r, s;
|
|
698
698
|
for (const u of n){
|
|
699
|
-
const c =
|
|
699
|
+
const c = vt(e, u);
|
|
700
700
|
if (c.passed) {
|
|
701
701
|
r = c;
|
|
702
702
|
continue;
|
|
@@ -722,9 +722,9 @@ let __tla = Promise.all([
|
|
|
722
722
|
}
|
|
723
723
|
};
|
|
724
724
|
}
|
|
725
|
-
function
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
725
|
+
function vt(e, t) {
|
|
726
|
+
const i = t.properties.filter((r)=>v(e.baseName, r.name));
|
|
727
|
+
if (i.length === 0) return {
|
|
728
728
|
passed: !1,
|
|
729
729
|
failure: {
|
|
730
730
|
type: "PROPERTY_MISSING",
|
|
@@ -736,78 +736,78 @@ let __tla = Promise.all([
|
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
};
|
|
739
|
-
let
|
|
740
|
-
for (const r of
|
|
741
|
-
const s =
|
|
739
|
+
let a, n;
|
|
740
|
+
for (const r of i){
|
|
741
|
+
const s = Et(e, t, r);
|
|
742
742
|
if (s.passed) {
|
|
743
|
-
|
|
743
|
+
a = s;
|
|
744
744
|
continue;
|
|
745
745
|
}
|
|
746
746
|
n ? n.failure?.type === "PROPERTY_MISSING" && s.failure?.type !== "PROPERTY_MISSING" && (n = s) : n = s;
|
|
747
747
|
}
|
|
748
|
-
return n ||
|
|
748
|
+
return n || a;
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
if (
|
|
750
|
+
function Et(e, t, i) {
|
|
751
|
+
if (i.value === null || i.value === void 0 || i.value === "") return {
|
|
752
752
|
passed: !1,
|
|
753
753
|
actualValue: "(empty)",
|
|
754
|
-
expectedValue: e.value ? p(e.value) : `property "${t.name}.${
|
|
754
|
+
expectedValue: e.value ? p(e.value) : `property "${t.name}.${i.name}" must have a value`,
|
|
755
755
|
failure: {
|
|
756
756
|
type: "PROPERTY_VALUE_MISMATCH",
|
|
757
|
-
field: `${t.name}.${
|
|
757
|
+
field: `${t.name}.${i.name}`,
|
|
758
758
|
actual: "(empty)",
|
|
759
759
|
expected: e.value ? p(e.value) : "a non-empty value"
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
|
-
if (e.dataType &&
|
|
762
|
+
if (e.dataType && i.dataType && !v(e.dataType, i.dataType, yt)) return {
|
|
763
763
|
passed: !1,
|
|
764
|
-
actualValue: `${t.name}.${
|
|
764
|
+
actualValue: `${t.name}.${i.name} (${i.dataType})`,
|
|
765
765
|
expectedValue: `dataType ${p(e.dataType)}`,
|
|
766
766
|
failure: {
|
|
767
767
|
type: "PROPERTY_DATATYPE_MISMATCH",
|
|
768
|
-
field: `${t.name}.${
|
|
769
|
-
actual:
|
|
768
|
+
field: `${t.name}.${i.name}`,
|
|
769
|
+
actual: i.dataType,
|
|
770
770
|
expected: p(e.dataType)
|
|
771
771
|
}
|
|
772
772
|
};
|
|
773
773
|
if (e.value) {
|
|
774
|
-
const
|
|
775
|
-
if (
|
|
774
|
+
const a = i.value;
|
|
775
|
+
if (a == null || a === "") return {
|
|
776
776
|
passed: !1,
|
|
777
777
|
actualValue: "(empty)",
|
|
778
778
|
expectedValue: p(e.value),
|
|
779
779
|
failure: {
|
|
780
780
|
type: "PROPERTY_VALUE_MISMATCH",
|
|
781
|
-
field: `${t.name}.${
|
|
781
|
+
field: `${t.name}.${i.name}`,
|
|
782
782
|
actual: "(empty)",
|
|
783
783
|
expected: p(e.value)
|
|
784
784
|
}
|
|
785
785
|
};
|
|
786
786
|
if (e.value.type === "simpleValue") {
|
|
787
|
-
const s =
|
|
788
|
-
if (s.length > 0 && !
|
|
787
|
+
const s = ut(i.dataType);
|
|
788
|
+
if (s.length > 0 && !se(e.value.value, s)) return {
|
|
789
789
|
passed: !1,
|
|
790
|
-
actualValue: String(
|
|
790
|
+
actualValue: String(a),
|
|
791
791
|
expectedValue: p(e.value),
|
|
792
792
|
failure: {
|
|
793
793
|
type: "PROPERTY_VALUE_MISMATCH",
|
|
794
|
-
field: `${t.name}.${
|
|
795
|
-
actual: String(
|
|
794
|
+
field: `${t.name}.${i.name}`,
|
|
795
|
+
actual: String(a),
|
|
796
796
|
expected: p(e.value)
|
|
797
797
|
}
|
|
798
798
|
};
|
|
799
799
|
}
|
|
800
|
-
if (!(
|
|
801
|
-
|
|
800
|
+
if (!(i.values && i.values.length > 0 ? i.values : [
|
|
801
|
+
a
|
|
802
802
|
]).some((s)=>v(e.value, s))) {
|
|
803
|
-
const s = e.value.type === "bounds" ? "PROPERTY_OUT_OF_BOUNDS" : "PROPERTY_VALUE_MISMATCH", l =
|
|
803
|
+
const s = e.value.type === "bounds" ? "PROPERTY_OUT_OF_BOUNDS" : "PROPERTY_VALUE_MISMATCH", l = i.values && i.values.length > 0 ? i.values.join(", ") : String(a);
|
|
804
804
|
return {
|
|
805
805
|
passed: !1,
|
|
806
806
|
actualValue: l,
|
|
807
807
|
expectedValue: p(e.value),
|
|
808
808
|
failure: {
|
|
809
809
|
type: s,
|
|
810
|
-
field: `${t.name}.${
|
|
810
|
+
field: `${t.name}.${i.name}`,
|
|
811
811
|
actual: l,
|
|
812
812
|
expected: p(e.value)
|
|
813
813
|
}
|
|
@@ -816,15 +816,15 @@ let __tla = Promise.all([
|
|
|
816
816
|
}
|
|
817
817
|
return {
|
|
818
818
|
passed: !0,
|
|
819
|
-
actualValue: `${t.name}.${
|
|
819
|
+
actualValue: `${t.name}.${i.name} = ${i.value}`,
|
|
820
820
|
expectedValue: e.value ? p(e.value) : "property exists"
|
|
821
821
|
};
|
|
822
822
|
}
|
|
823
|
-
function
|
|
824
|
-
const
|
|
823
|
+
function Tt(e, t, i) {
|
|
824
|
+
const a = i.getClassifications(t), n = a.length > 0;
|
|
825
825
|
if (!e.system && !e.value) return n ? {
|
|
826
826
|
passed: !0,
|
|
827
|
-
actualValue:
|
|
827
|
+
actualValue: a.map((s)=>`${s.system}:${s.value}`).join(", "),
|
|
828
828
|
expectedValue: "any classification"
|
|
829
829
|
} : {
|
|
830
830
|
passed: !1,
|
|
@@ -847,10 +847,10 @@ let __tla = Promise.all([
|
|
|
847
847
|
}
|
|
848
848
|
};
|
|
849
849
|
}
|
|
850
|
-
let r =
|
|
851
|
-
if (e.system && (r =
|
|
850
|
+
let r = a;
|
|
851
|
+
if (e.system && (r = a.filter((s)=>v(e.system, s.system)), r.length === 0)) {
|
|
852
852
|
const s = [
|
|
853
|
-
...new Set(
|
|
853
|
+
...new Set(a.map((l)=>l.system))
|
|
854
854
|
].join(", ");
|
|
855
855
|
return {
|
|
856
856
|
passed: !1,
|
|
@@ -899,9 +899,9 @@ let __tla = Promise.all([
|
|
|
899
899
|
expectedValue: p(e.system)
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
|
-
function
|
|
903
|
-
const
|
|
904
|
-
if (!e.value) return
|
|
902
|
+
function It(e, t, i) {
|
|
903
|
+
const a = i.getMaterials(t);
|
|
904
|
+
if (!e.value) return a.length === 0 ? {
|
|
905
905
|
passed: !1,
|
|
906
906
|
actualValue: "(none)",
|
|
907
907
|
expectedValue: "any material",
|
|
@@ -911,12 +911,12 @@ let __tla = Promise.all([
|
|
|
911
911
|
}
|
|
912
912
|
} : {
|
|
913
913
|
passed: !0,
|
|
914
|
-
actualValue:
|
|
914
|
+
actualValue: a.map((r)=>r.name).join(", "),
|
|
915
915
|
expectedValue: "any material"
|
|
916
916
|
};
|
|
917
|
-
const n =
|
|
917
|
+
const n = a.filter((r)=>v(e.value, r.name) || r.category && v(e.value, r.category));
|
|
918
918
|
if (n.length === 0) {
|
|
919
|
-
if (
|
|
919
|
+
if (a.length === 0) return {
|
|
920
920
|
passed: !1,
|
|
921
921
|
actualValue: "(none)",
|
|
922
922
|
expectedValue: p(e.value),
|
|
@@ -925,7 +925,7 @@ let __tla = Promise.all([
|
|
|
925
925
|
expected: p(e.value)
|
|
926
926
|
}
|
|
927
927
|
};
|
|
928
|
-
const r =
|
|
928
|
+
const r = a.map((s)=>s.name).join(", ");
|
|
929
929
|
return {
|
|
930
930
|
passed: !1,
|
|
931
931
|
actualValue: r,
|
|
@@ -957,13 +957,13 @@ let __tla = Promise.all([
|
|
|
957
957
|
IfcRelVoidsElement: "voiding",
|
|
958
958
|
IfcRelFillsElement: "filling"
|
|
959
959
|
};
|
|
960
|
-
function
|
|
961
|
-
const
|
|
962
|
-
if (
|
|
963
|
-
const r =
|
|
964
|
-
r &&
|
|
960
|
+
function bt(e, t, i) {
|
|
961
|
+
const a = i.getAncestors ? i.getAncestors(t, e.relation) : [];
|
|
962
|
+
if (a.length === 0) {
|
|
963
|
+
const r = i.getParent(t, e.relation);
|
|
964
|
+
r && a.push(r);
|
|
965
965
|
}
|
|
966
|
-
if (
|
|
966
|
+
if (a.length === 0) {
|
|
967
967
|
const r = L[e.relation] || e.relation, s = e.entity ? p(e.entity.name) : "any entity";
|
|
968
968
|
return {
|
|
969
969
|
passed: !1,
|
|
@@ -980,14 +980,14 @@ let __tla = Promise.all([
|
|
|
980
980
|
};
|
|
981
981
|
}
|
|
982
982
|
let n;
|
|
983
|
-
for (const r of
|
|
984
|
-
const s =
|
|
983
|
+
for (const r of a){
|
|
984
|
+
const s = gt(e, r);
|
|
985
985
|
if (s.passed) return s;
|
|
986
986
|
(!n || s.failure?.type !== "PARTOF_ENTITY_MISMATCH" && n.failure?.type === "PARTOF_ENTITY_MISMATCH") && (n = s);
|
|
987
987
|
}
|
|
988
988
|
return n;
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function gt(e, t) {
|
|
991
991
|
if (!e.entity) {
|
|
992
992
|
const n = L[e.relation] || e.relation;
|
|
993
993
|
return {
|
|
@@ -1045,27 +1045,27 @@ let __tla = Promise.all([
|
|
|
1045
1045
|
}
|
|
1046
1046
|
};
|
|
1047
1047
|
}
|
|
1048
|
-
const
|
|
1048
|
+
const i = L[e.relation] || e.relation, a = t.predefinedType ? `${t.entityType}[${t.predefinedType}]` : t.entityType;
|
|
1049
1049
|
return {
|
|
1050
1050
|
passed: !0,
|
|
1051
|
-
actualValue: `${
|
|
1052
|
-
expectedValue: `${
|
|
1051
|
+
actualValue: `${i} ${a}`,
|
|
1052
|
+
expectedValue: `${i} ${p(e.entity.name)}`
|
|
1053
1053
|
};
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function le(e, t, i) {
|
|
1056
1056
|
switch(e.type){
|
|
1057
1057
|
case "entity":
|
|
1058
|
-
return
|
|
1058
|
+
return tt(e, t, i);
|
|
1059
1059
|
case "attribute":
|
|
1060
|
-
return
|
|
1060
|
+
return dt(e, t, i);
|
|
1061
1061
|
case "property":
|
|
1062
|
-
return
|
|
1062
|
+
return ht(e, t, i);
|
|
1063
1063
|
case "classification":
|
|
1064
|
-
return
|
|
1064
|
+
return Tt(e, t, i);
|
|
1065
1065
|
case "material":
|
|
1066
|
-
return
|
|
1066
|
+
return It(e, t, i);
|
|
1067
1067
|
case "partOf":
|
|
1068
|
-
return
|
|
1068
|
+
return bt(e, t, i);
|
|
1069
1069
|
default:
|
|
1070
1070
|
return {
|
|
1071
1071
|
passed: !1,
|
|
@@ -1077,18 +1077,18 @@ let __tla = Promise.all([
|
|
|
1077
1077
|
};
|
|
1078
1078
|
}
|
|
1079
1079
|
}
|
|
1080
|
-
function
|
|
1080
|
+
function St(e, t) {
|
|
1081
1081
|
switch(e.type){
|
|
1082
1082
|
case "entity":
|
|
1083
|
-
return
|
|
1083
|
+
return it(e, t);
|
|
1084
1084
|
default:
|
|
1085
1085
|
return;
|
|
1086
1086
|
}
|
|
1087
1087
|
}
|
|
1088
|
-
|
|
1089
|
-
const { translator: n, onProgress: r, includePassingEntities: s = !0 } =
|
|
1088
|
+
oa = async function(e, t, i, a = {}) {
|
|
1089
|
+
const { translator: n, onProgress: r, includePassingEntities: s = !0 } = a, l = [], o = e.specifications.length;
|
|
1090
1090
|
for(let c = 0; c < o; c++){
|
|
1091
|
-
const
|
|
1091
|
+
const m = e.specifications[c];
|
|
1092
1092
|
r && r({
|
|
1093
1093
|
phase: "filtering",
|
|
1094
1094
|
specificationIndex: c,
|
|
@@ -1097,12 +1097,12 @@ let __tla = Promise.all([
|
|
|
1097
1097
|
totalEntities: 0,
|
|
1098
1098
|
percentage: Math.floor(c / o * 100)
|
|
1099
1099
|
});
|
|
1100
|
-
const d = await
|
|
1100
|
+
const d = await At(m, t, i, a, (f)=>{
|
|
1101
1101
|
r && r({
|
|
1102
|
-
...
|
|
1102
|
+
...f,
|
|
1103
1103
|
specificationIndex: c,
|
|
1104
1104
|
totalSpecifications: o,
|
|
1105
|
-
percentage: Math.floor((c +
|
|
1105
|
+
percentage: Math.floor((c + f.entitiesProcessed / Math.max(f.totalEntities, 1)) / o * 100)
|
|
1106
1106
|
});
|
|
1107
1107
|
});
|
|
1108
1108
|
l.push(d);
|
|
@@ -1115,17 +1115,17 @@ let __tla = Promise.all([
|
|
|
1115
1115
|
totalEntities: 0,
|
|
1116
1116
|
percentage: 100
|
|
1117
1117
|
});
|
|
1118
|
-
const u =
|
|
1118
|
+
const u = Nt(l);
|
|
1119
1119
|
return {
|
|
1120
1120
|
document: e,
|
|
1121
|
-
modelInfo:
|
|
1121
|
+
modelInfo: i,
|
|
1122
1122
|
timestamp: new Date,
|
|
1123
1123
|
summary: u,
|
|
1124
1124
|
specificationResults: l
|
|
1125
1125
|
};
|
|
1126
1126
|
};
|
|
1127
|
-
async function
|
|
1128
|
-
const { translator: r, maxEntities: s, includePassingEntities: l = !0 } =
|
|
1127
|
+
async function At(e, t, i, a, n) {
|
|
1128
|
+
const { translator: r, maxEntities: s, includePassingEntities: l = !0 } = a, o = i.modelId, u = xt(e, t), c = s ? u.slice(0, s) : u, m = [], d = c.length;
|
|
1129
1129
|
for(let I = 0; I < d; I++){
|
|
1130
1130
|
const b = c[I];
|
|
1131
1131
|
n && I % 100 === 0 && n({
|
|
@@ -1133,43 +1133,43 @@ let __tla = Promise.all([
|
|
|
1133
1133
|
entitiesProcessed: I,
|
|
1134
1134
|
totalEntities: d
|
|
1135
1135
|
});
|
|
1136
|
-
const P =
|
|
1137
|
-
(l || !P.passed) &&
|
|
1136
|
+
const P = Ct(e, b, o, t, r);
|
|
1137
|
+
(l || !P.passed) && m.push(P);
|
|
1138
1138
|
}
|
|
1139
|
-
let
|
|
1140
|
-
for (const I of
|
|
1141
|
-
l || (
|
|
1142
|
-
const M =
|
|
1139
|
+
let f = 0, y = 0;
|
|
1140
|
+
for (const I of m)I.passed ? f++ : y++;
|
|
1141
|
+
l || (f = d - y);
|
|
1142
|
+
const M = Mt(e, u.length);
|
|
1143
1143
|
let x = "pass";
|
|
1144
1144
|
u.length === 0 ? M?.passed === !1 ? x = "fail" : M?.passed === !0 ? x = "pass" : x = "not_applicable" : (y > 0 || M?.passed === !1) && (x = "fail");
|
|
1145
|
-
const _ = d > 0 ? Math.floor(
|
|
1145
|
+
const _ = d > 0 ? Math.floor(f / d * 100) : 100;
|
|
1146
1146
|
return {
|
|
1147
1147
|
specification: e,
|
|
1148
1148
|
status: x,
|
|
1149
1149
|
applicableCount: u.length,
|
|
1150
|
-
passedCount:
|
|
1150
|
+
passedCount: f,
|
|
1151
1151
|
failedCount: y,
|
|
1152
1152
|
passRate: _,
|
|
1153
|
-
entityResults:
|
|
1153
|
+
entityResults: m,
|
|
1154
1154
|
cardinalityResult: M
|
|
1155
1155
|
};
|
|
1156
1156
|
}
|
|
1157
|
-
function
|
|
1158
|
-
const
|
|
1159
|
-
if (
|
|
1160
|
-
let
|
|
1161
|
-
for (const r of
|
|
1162
|
-
const s =
|
|
1157
|
+
function xt(e, t) {
|
|
1158
|
+
const i = e.applicability.facets;
|
|
1159
|
+
if (i.length === 0) return t.getAllEntityIds();
|
|
1160
|
+
let a;
|
|
1161
|
+
for (const r of i){
|
|
1162
|
+
const s = St(r, t);
|
|
1163
1163
|
if (s !== void 0) {
|
|
1164
|
-
|
|
1164
|
+
a = s;
|
|
1165
1165
|
break;
|
|
1166
1166
|
}
|
|
1167
1167
|
}
|
|
1168
|
-
|
|
1168
|
+
a === void 0 && (a = t.getAllEntityIds());
|
|
1169
1169
|
const n = [];
|
|
1170
|
-
for (const r of
|
|
1170
|
+
for (const r of a){
|
|
1171
1171
|
let s = !0;
|
|
1172
|
-
for (const l of
|
|
1172
|
+
for (const l of i)if (!le(l, r, t).passed) {
|
|
1173
1173
|
s = !1;
|
|
1174
1174
|
break;
|
|
1175
1175
|
}
|
|
@@ -1177,29 +1177,29 @@ let __tla = Promise.all([
|
|
|
1177
1177
|
}
|
|
1178
1178
|
return n;
|
|
1179
1179
|
}
|
|
1180
|
-
function
|
|
1180
|
+
function Ct(e, t, i, a, n) {
|
|
1181
1181
|
const r = [];
|
|
1182
1182
|
let s = !0;
|
|
1183
1183
|
for (const l of e.requirements){
|
|
1184
|
-
const o =
|
|
1184
|
+
const o = Rt(l, t, a, n);
|
|
1185
1185
|
r.push(o), o.status === "fail" && (s = !1);
|
|
1186
1186
|
}
|
|
1187
1187
|
return {
|
|
1188
1188
|
expressId: t,
|
|
1189
|
-
modelId:
|
|
1190
|
-
entityType:
|
|
1191
|
-
entityName:
|
|
1192
|
-
globalId:
|
|
1189
|
+
modelId: i,
|
|
1190
|
+
entityType: a.getEntityType(t) || "Unknown",
|
|
1191
|
+
entityName: a.getEntityName(t),
|
|
1192
|
+
globalId: a.getGlobalId(t),
|
|
1193
1193
|
passed: s,
|
|
1194
1194
|
requirementResults: r
|
|
1195
1195
|
};
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1198
|
-
const n =
|
|
1197
|
+
function Rt(e, t, i, a) {
|
|
1198
|
+
const n = le(e.facet, t, i);
|
|
1199
1199
|
let r, s;
|
|
1200
1200
|
switch(e.optionality){
|
|
1201
1201
|
case "required":
|
|
1202
|
-
r = n.passed ? "pass" : "fail", n.passed || (s =
|
|
1202
|
+
r = n.passed ? "pass" : "fail", n.passed || (s = a ? a.describeFailure({
|
|
1203
1203
|
requirement: e,
|
|
1204
1204
|
status: "fail",
|
|
1205
1205
|
facetType: e.facet.type,
|
|
@@ -1207,7 +1207,7 @@ let __tla = Promise.all([
|
|
|
1207
1207
|
actualValue: n.actualValue,
|
|
1208
1208
|
expectedValue: n.expectedValue,
|
|
1209
1209
|
failure: n.failure
|
|
1210
|
-
}) :
|
|
1210
|
+
}) : G(n));
|
|
1211
1211
|
break;
|
|
1212
1212
|
case "optional":
|
|
1213
1213
|
if (n.passed) r = "pass";
|
|
@@ -1220,7 +1220,7 @@ let __tla = Promise.all([
|
|
|
1220
1220
|
"MATERIAL_MISSING",
|
|
1221
1221
|
"PARTOF_RELATION_MISSING"
|
|
1222
1222
|
]);
|
|
1223
|
-
n.failure?.type && o.has(n.failure.type) ? r = "pass" : (r = "fail", s =
|
|
1223
|
+
n.failure?.type && o.has(n.failure.type) ? r = "pass" : (r = "fail", s = a ? a.describeFailure({
|
|
1224
1224
|
requirement: e,
|
|
1225
1225
|
status: "fail",
|
|
1226
1226
|
facetType: e.facet.type,
|
|
@@ -1228,18 +1228,18 @@ let __tla = Promise.all([
|
|
|
1228
1228
|
actualValue: n.actualValue,
|
|
1229
1229
|
expectedValue: n.expectedValue,
|
|
1230
1230
|
failure: n.failure
|
|
1231
|
-
}) :
|
|
1231
|
+
}) : G(n));
|
|
1232
1232
|
}
|
|
1233
1233
|
break;
|
|
1234
1234
|
case "prohibited":
|
|
1235
|
-
r = n.passed ? "fail" : "pass", r === "fail" && (s =
|
|
1235
|
+
r = n.passed ? "fail" : "pass", r === "fail" && (s = a ? a.t("failures.prohibited", {
|
|
1236
1236
|
field: n.actualValue || "value"
|
|
1237
1237
|
}) : `Prohibited: found ${n.actualValue}`);
|
|
1238
1238
|
break;
|
|
1239
1239
|
default:
|
|
1240
1240
|
r = n.passed ? "pass" : "fail";
|
|
1241
1241
|
}
|
|
1242
|
-
const l =
|
|
1242
|
+
const l = a ? a.describeRequirement(e) : _t(e);
|
|
1243
1243
|
return {
|
|
1244
1244
|
requirement: e,
|
|
1245
1245
|
status: r,
|
|
@@ -1251,12 +1251,12 @@ let __tla = Promise.all([
|
|
|
1251
1251
|
failure: n.failure
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
|
-
function
|
|
1254
|
+
function Mt(e, t) {
|
|
1255
1255
|
if (e.minOccurs === void 0 && e.maxOccurs === void 0) return;
|
|
1256
|
-
const
|
|
1256
|
+
const i = e.minOccurs ?? 0, a = e.maxOccurs;
|
|
1257
1257
|
let n = !0;
|
|
1258
1258
|
const r = [];
|
|
1259
|
-
return t <
|
|
1259
|
+
return t < i && (n = !1, r.push(`Expected at least ${i}, found ${t}`)), a !== "unbounded" && a !== void 0 && t > a && (n = !1, r.push(`Expected at most ${a}, found ${t}`)), {
|
|
1260
1260
|
passed: n,
|
|
1261
1261
|
actualCount: t,
|
|
1262
1262
|
minExpected: e.minOccurs,
|
|
@@ -1264,117 +1264,117 @@ let __tla = Promise.all([
|
|
|
1264
1264
|
message: r.length > 0 ? r.join("; ") : "Cardinality satisfied"
|
|
1265
1265
|
};
|
|
1266
1266
|
}
|
|
1267
|
-
function
|
|
1268
|
-
let t = e.length,
|
|
1269
|
-
for (const o of e)o.status === "pass" ?
|
|
1267
|
+
function Nt(e) {
|
|
1268
|
+
let t = e.length, i = 0, a = 0, n = 0, r = 0, s = 0;
|
|
1269
|
+
for (const o of e)o.status === "pass" ? i++ : o.status === "fail" && a++, n += o.applicableCount, r += o.passedCount, s += o.failedCount;
|
|
1270
1270
|
const l = n > 0 ? Math.floor(r / n * 100) : 100;
|
|
1271
1271
|
return {
|
|
1272
1272
|
totalSpecifications: t,
|
|
1273
|
-
passedSpecifications:
|
|
1274
|
-
failedSpecifications:
|
|
1273
|
+
passedSpecifications: i,
|
|
1274
|
+
failedSpecifications: a,
|
|
1275
1275
|
totalEntitiesChecked: n,
|
|
1276
1276
|
totalEntitiesPassed: r,
|
|
1277
1277
|
totalEntitiesFailed: s,
|
|
1278
1278
|
overallPassRate: l
|
|
1279
1279
|
};
|
|
1280
1280
|
}
|
|
1281
|
-
function
|
|
1281
|
+
function G(e) {
|
|
1282
1282
|
if (!e.failure) return `Expected ${e.expectedValue}, got ${e.actualValue}`;
|
|
1283
|
-
const { type: t, field:
|
|
1283
|
+
const { type: t, field: i, actual: a, expected: n } = e.failure;
|
|
1284
1284
|
switch(t){
|
|
1285
1285
|
case "ENTITY_TYPE_MISMATCH":
|
|
1286
|
-
return `Entity type "${
|
|
1286
|
+
return `Entity type "${a}" does not match expected ${n}`;
|
|
1287
1287
|
case "PREDEFINED_TYPE_MISMATCH":
|
|
1288
|
-
return `Predefined type "${
|
|
1288
|
+
return `Predefined type "${a}" does not match expected ${n}`;
|
|
1289
1289
|
case "PREDEFINED_TYPE_MISSING":
|
|
1290
1290
|
return `Predefined type is missing, expected ${n}`;
|
|
1291
1291
|
case "ATTRIBUTE_MISSING":
|
|
1292
|
-
return `Attribute "${
|
|
1292
|
+
return `Attribute "${i}" is missing`;
|
|
1293
1293
|
case "ATTRIBUTE_VALUE_MISMATCH":
|
|
1294
|
-
return `Attribute "${
|
|
1294
|
+
return `Attribute "${i}" value "${a}" does not match expected ${n}`;
|
|
1295
1295
|
case "ATTRIBUTE_PATTERN_MISMATCH":
|
|
1296
|
-
return `Attribute "${
|
|
1296
|
+
return `Attribute "${i}" value "${a}" does not match pattern ${n}`;
|
|
1297
1297
|
case "PSET_MISSING":
|
|
1298
|
-
return `Property set "${
|
|
1298
|
+
return `Property set "${i || n}" not found`;
|
|
1299
1299
|
case "PROPERTY_MISSING":
|
|
1300
|
-
return `Property "${
|
|
1300
|
+
return `Property "${i}" not found`;
|
|
1301
1301
|
case "PROPERTY_VALUE_MISMATCH":
|
|
1302
|
-
return `Property "${
|
|
1302
|
+
return `Property "${i}" value "${a}" does not match expected ${n}`;
|
|
1303
1303
|
case "PROPERTY_DATATYPE_MISMATCH":
|
|
1304
|
-
return `Property "${
|
|
1304
|
+
return `Property "${i}" type "${a}" does not match expected ${n}`;
|
|
1305
1305
|
case "PROPERTY_OUT_OF_BOUNDS":
|
|
1306
|
-
return `Property "${
|
|
1306
|
+
return `Property "${i}" value ${a} is out of bounds ${n}`;
|
|
1307
1307
|
case "CLASSIFICATION_MISSING":
|
|
1308
1308
|
return "No classification found";
|
|
1309
1309
|
case "CLASSIFICATION_SYSTEM_MISMATCH":
|
|
1310
|
-
return `Classification system "${
|
|
1310
|
+
return `Classification system "${a}" does not match expected ${n}`;
|
|
1311
1311
|
case "CLASSIFICATION_VALUE_MISMATCH":
|
|
1312
|
-
return `Classification value "${
|
|
1312
|
+
return `Classification value "${a}" does not match expected ${n}`;
|
|
1313
1313
|
case "MATERIAL_MISSING":
|
|
1314
1314
|
return "No material assigned";
|
|
1315
1315
|
case "MATERIAL_VALUE_MISMATCH":
|
|
1316
|
-
return `Material "${
|
|
1316
|
+
return `Material "${a}" does not match expected ${n}`;
|
|
1317
1317
|
case "PARTOF_RELATION_MISSING":
|
|
1318
|
-
return `Not ${
|
|
1318
|
+
return `Not ${i} any entity`;
|
|
1319
1319
|
case "PARTOF_ENTITY_MISMATCH":
|
|
1320
|
-
return `Parent entity "${
|
|
1320
|
+
return `Parent entity "${a}" does not match expected ${n}`;
|
|
1321
1321
|
case "PARTOF_PREDEFINED_TYPE_MISSING":
|
|
1322
1322
|
return `Parent entity predefined type is missing, expected ${n}`;
|
|
1323
1323
|
case "PARTOF_PREDEFINED_TYPE_MISMATCH":
|
|
1324
|
-
return `Parent entity predefined type "${
|
|
1324
|
+
return `Parent entity predefined type "${a}" does not match expected ${n}`;
|
|
1325
1325
|
default:
|
|
1326
1326
|
return `Validation failed: ${t}`;
|
|
1327
1327
|
}
|
|
1328
1328
|
}
|
|
1329
|
-
function
|
|
1330
|
-
const t = e.facet,
|
|
1331
|
-
let
|
|
1329
|
+
function _t(e) {
|
|
1330
|
+
const t = e.facet, i = e.optionality;
|
|
1331
|
+
let a;
|
|
1332
1332
|
switch(t.type){
|
|
1333
1333
|
case "entity":
|
|
1334
|
-
|
|
1334
|
+
a = `Must be ${p(t.name)}`, t.predefinedType && (a += ` with predefinedType ${p(t.predefinedType)}`);
|
|
1335
1335
|
break;
|
|
1336
1336
|
case "attribute":
|
|
1337
|
-
t.value ?
|
|
1337
|
+
t.value ? a = `Attribute "${p(t.name)}" must equal ${p(t.value)}` : a = `Attribute "${p(t.name)}" must exist`;
|
|
1338
1338
|
break;
|
|
1339
1339
|
case "property":
|
|
1340
|
-
t.value ?
|
|
1340
|
+
t.value ? a = `Property "${p(t.propertySet)}.${p(t.baseName)}" must equal ${p(t.value)}` : a = `Property "${p(t.propertySet)}.${p(t.baseName)}" must exist`;
|
|
1341
1341
|
break;
|
|
1342
1342
|
case "classification":
|
|
1343
|
-
t.system && t.value ?
|
|
1343
|
+
t.system && t.value ? a = `Must have classification ${p(t.value)} in ${p(t.system)}` : t.system ? a = `Must be classified in ${p(t.system)}` : t.value ? a = `Must have classification ${p(t.value)}` : a = "Must have a classification";
|
|
1344
1344
|
break;
|
|
1345
1345
|
case "material":
|
|
1346
|
-
t.value ?
|
|
1346
|
+
t.value ? a = `Must have material ${p(t.value)}` : a = "Must have a material assigned";
|
|
1347
1347
|
break;
|
|
1348
1348
|
case "partOf":
|
|
1349
1349
|
{
|
|
1350
1350
|
const n = t.relation.replace("IfcRel", "").toLowerCase();
|
|
1351
|
-
t.entity ?
|
|
1351
|
+
t.entity ? a = `Must be ${n} ${p(t.entity.name)}` : a = `Must be ${n} some entity`;
|
|
1352
1352
|
break;
|
|
1353
1353
|
}
|
|
1354
1354
|
default:
|
|
1355
|
-
|
|
1355
|
+
a = "Unknown requirement";
|
|
1356
1356
|
}
|
|
1357
|
-
return
|
|
1357
|
+
return i === "prohibited" ? a = a.replace("Must", "Must NOT").replace("must", "must NOT") : i === "optional" && (a = a.replace("Must", "Should").replace("must", "should")), a;
|
|
1358
1358
|
}
|
|
1359
|
-
function
|
|
1359
|
+
function Pt(e) {
|
|
1360
1360
|
if (/\[[^\]]*-\[/.test(e)) return {
|
|
1361
1361
|
pattern: e,
|
|
1362
1362
|
supported: !1,
|
|
1363
1363
|
reason: "XSD character-class subtraction is not supported in JS regex"
|
|
1364
1364
|
};
|
|
1365
|
-
let t = "",
|
|
1366
|
-
for(;
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1369
|
-
const n = e.charAt(
|
|
1365
|
+
let t = "", i = 0;
|
|
1366
|
+
for(; i < e.length;){
|
|
1367
|
+
const a = e.charAt(i);
|
|
1368
|
+
if (a === "\\" && i + 1 < e.length) {
|
|
1369
|
+
const n = e.charAt(i + 1), r = $t(n);
|
|
1370
1370
|
if (r) {
|
|
1371
|
-
t += r,
|
|
1371
|
+
t += r, i += 2;
|
|
1372
1372
|
continue;
|
|
1373
1373
|
}
|
|
1374
|
-
t +=
|
|
1374
|
+
t += a + n, i += 2;
|
|
1375
1375
|
continue;
|
|
1376
1376
|
}
|
|
1377
|
-
t +=
|
|
1377
|
+
t += a, i++;
|
|
1378
1378
|
}
|
|
1379
1379
|
return {
|
|
1380
1380
|
pattern: t,
|
|
@@ -1382,7 +1382,7 @@ let __tla = Promise.all([
|
|
|
1382
1382
|
reason: ""
|
|
1383
1383
|
};
|
|
1384
1384
|
}
|
|
1385
|
-
function
|
|
1385
|
+
function $t(e) {
|
|
1386
1386
|
switch(e){
|
|
1387
1387
|
case "i":
|
|
1388
1388
|
return "[\\p{L}_:]";
|
|
@@ -1404,13 +1404,13 @@ let __tla = Promise.all([
|
|
|
1404
1404
|
return;
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
|
-
function
|
|
1407
|
+
function wt(e) {
|
|
1408
1408
|
if (e === "") return {
|
|
1409
1409
|
ok: !1,
|
|
1410
1410
|
severity: "error",
|
|
1411
1411
|
reason: "pattern is empty"
|
|
1412
1412
|
};
|
|
1413
|
-
const t =
|
|
1413
|
+
const t = Pt(e);
|
|
1414
1414
|
if (!t.supported) return {
|
|
1415
1415
|
ok: !1,
|
|
1416
1416
|
severity: "warning",
|
|
@@ -1421,31 +1421,31 @@ let __tla = Promise.all([
|
|
|
1421
1421
|
ok: !0,
|
|
1422
1422
|
jsPattern: t.pattern
|
|
1423
1423
|
};
|
|
1424
|
-
} catch (
|
|
1424
|
+
} catch (i) {
|
|
1425
1425
|
return {
|
|
1426
1426
|
ok: !1,
|
|
1427
1427
|
severity: "error",
|
|
1428
|
-
reason:
|
|
1428
|
+
reason: i instanceof Error ? i.message : String(i)
|
|
1429
1429
|
};
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
|
-
function
|
|
1432
|
+
function Ft(e) {
|
|
1433
1433
|
const t = [];
|
|
1434
|
-
return e.specifications.forEach((
|
|
1435
|
-
|
|
1434
|
+
return e.specifications.forEach((i, a)=>{
|
|
1435
|
+
Ot(i, `specifications[${a}]`, t);
|
|
1436
1436
|
}), t;
|
|
1437
1437
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const
|
|
1440
|
-
|
|
1438
|
+
function Ot(e, t, i) {
|
|
1439
|
+
const a = e.minOccurs, n = e.maxOccurs;
|
|
1440
|
+
a !== void 0 && (!Number.isInteger(a) || a < 0) && i.push({
|
|
1441
1441
|
severity: "error",
|
|
1442
1442
|
code: "E_CARDINALITY_INVALID",
|
|
1443
|
-
message: `minOccurs must be a non-negative integer; got ${
|
|
1443
|
+
message: `minOccurs must be a non-negative integer; got ${a}`,
|
|
1444
1444
|
path: `${t}.minOccurs`,
|
|
1445
1445
|
detail: {
|
|
1446
|
-
value: String(
|
|
1446
|
+
value: String(a)
|
|
1447
1447
|
}
|
|
1448
|
-
}), n !== void 0 && n !== "unbounded" && (!Number.isInteger(n) || n < 0) &&
|
|
1448
|
+
}), n !== void 0 && n !== "unbounded" && (!Number.isInteger(n) || n < 0) && i.push({
|
|
1449
1449
|
severity: "error",
|
|
1450
1450
|
code: "E_CARDINALITY_INVALID",
|
|
1451
1451
|
message: `maxOccurs must be a non-negative integer or "unbounded"; got ${n}`,
|
|
@@ -1453,28 +1453,28 @@ let __tla = Promise.all([
|
|
|
1453
1453
|
detail: {
|
|
1454
1454
|
value: String(n)
|
|
1455
1455
|
}
|
|
1456
|
-
}), typeof
|
|
1456
|
+
}), typeof a == "number" && typeof n == "number" && a > n && i.push({
|
|
1457
1457
|
severity: "error",
|
|
1458
1458
|
code: "E_CARDINALITY_INVALID",
|
|
1459
|
-
message: `minOccurs (${
|
|
1459
|
+
message: `minOccurs (${a}) is greater than maxOccurs (${n})`,
|
|
1460
1460
|
path: `${t}.minOccurs`,
|
|
1461
1461
|
detail: {
|
|
1462
|
-
min:
|
|
1462
|
+
min: a,
|
|
1463
1463
|
max: n
|
|
1464
1464
|
}
|
|
1465
|
-
}), e.applicability.cardinality &&
|
|
1465
|
+
}), e.applicability.cardinality && i.push({
|
|
1466
1466
|
severity: "warning",
|
|
1467
1467
|
code: "W_CARDINALITY_PROHIBITED_APPLICABILITY",
|
|
1468
1468
|
message: `cardinality="${e.applicability.cardinality}" has no effect on <applicability>`,
|
|
1469
1469
|
path: `${t}.applicability.cardinality`
|
|
1470
1470
|
}), e.applicability.facets.forEach((r, s)=>{
|
|
1471
|
-
k(r, `${t}.applicability.facets[${s}]`,
|
|
1471
|
+
k(r, `${t}.applicability.facets[${s}]`, i);
|
|
1472
1472
|
}), e.requirements.forEach((r, s)=>{
|
|
1473
|
-
k(r.facet, `${t}.requirements[${s}]`,
|
|
1473
|
+
k(r.facet, `${t}.requirements[${s}]`, i), Lt(r, `${t}.requirements[${s}]`, i);
|
|
1474
1474
|
});
|
|
1475
1475
|
}
|
|
1476
|
-
function
|
|
1477
|
-
switch(e.cardinalityRaw !== void 0 &&
|
|
1476
|
+
function Lt(e, t, i) {
|
|
1477
|
+
switch(e.cardinalityRaw !== void 0 && i.push({
|
|
1478
1478
|
severity: "error",
|
|
1479
1479
|
code: "E_CARDINALITY_INVALID",
|
|
1480
1480
|
message: `@cardinality="${e.cardinalityRaw}" is not a valid value; expected one of {required, optional, prohibited}`,
|
|
@@ -1486,14 +1486,14 @@ let __tla = Promise.all([
|
|
|
1486
1486
|
}), e.facet.type){
|
|
1487
1487
|
case "property":
|
|
1488
1488
|
{
|
|
1489
|
-
const
|
|
1490
|
-
e.optionality === "optional" && !
|
|
1489
|
+
const a = e.facet.dataType !== void 0;
|
|
1490
|
+
e.optionality === "optional" && !a && i.push({
|
|
1491
1491
|
severity: "error",
|
|
1492
1492
|
code: "E_CARDINALITY_INVALID",
|
|
1493
1493
|
message: "optional <property> requirement requires @dataType to be specified",
|
|
1494
1494
|
path: `${t}.cardinality`,
|
|
1495
1495
|
facetType: "property"
|
|
1496
|
-
}), e.optionality === "prohibited" &&
|
|
1496
|
+
}), e.optionality === "prohibited" && a && i.push({
|
|
1497
1497
|
severity: "error",
|
|
1498
1498
|
code: "E_CARDINALITY_INVALID",
|
|
1499
1499
|
message: "prohibited <property> requirement is incompatible with @dataType",
|
|
@@ -1504,7 +1504,7 @@ let __tla = Promise.all([
|
|
|
1504
1504
|
}
|
|
1505
1505
|
case "material":
|
|
1506
1506
|
{
|
|
1507
|
-
e.optionality === "optional" && (e.facet.value !== void 0 && !D(e.facet.value) ||
|
|
1507
|
+
e.optionality === "optional" && (e.facet.value !== void 0 && !D(e.facet.value) || i.push({
|
|
1508
1508
|
severity: "error",
|
|
1509
1509
|
code: "E_CARDINALITY_INVALID",
|
|
1510
1510
|
message: "optional <material> requirement must specify a non-empty <value> constraint",
|
|
@@ -1516,8 +1516,8 @@ let __tla = Promise.all([
|
|
|
1516
1516
|
case "classification":
|
|
1517
1517
|
{
|
|
1518
1518
|
if (e.optionality === "optional") {
|
|
1519
|
-
const
|
|
1520
|
-
!
|
|
1519
|
+
const a = e.facet.system !== void 0 && !D(e.facet.system), n = e.facet.value !== void 0 && !D(e.facet.value);
|
|
1520
|
+
!a && !n && i.push({
|
|
1521
1521
|
severity: "error",
|
|
1522
1522
|
code: "E_CARDINALITY_INVALID",
|
|
1523
1523
|
message: "optional <classification> requirement must specify <system> or <value>",
|
|
@@ -1541,49 +1541,49 @@ let __tla = Promise.all([
|
|
|
1541
1541
|
return e.minInclusive === void 0 && e.maxInclusive === void 0 && e.minExclusive === void 0 && e.maxExclusive === void 0 && e.length === void 0 && e.minLength === void 0 && e.maxLength === void 0;
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
function k(e, t,
|
|
1544
|
+
function k(e, t, i) {
|
|
1545
1545
|
switch(e.type){
|
|
1546
1546
|
case "entity":
|
|
1547
|
-
E(e.name, `${t}.name`,
|
|
1547
|
+
E(e.name, `${t}.name`, i, e.type), e.predefinedType && E(e.predefinedType, `${t}.predefinedType`, i, e.type);
|
|
1548
1548
|
break;
|
|
1549
1549
|
case "attribute":
|
|
1550
|
-
E(e.name, `${t}.name`,
|
|
1550
|
+
E(e.name, `${t}.name`, i, e.type), e.value && E(e.value, `${t}.value`, i, e.type);
|
|
1551
1551
|
break;
|
|
1552
1552
|
case "property":
|
|
1553
|
-
E(e.propertySet, `${t}.propertySet`,
|
|
1553
|
+
E(e.propertySet, `${t}.propertySet`, i, e.type), E(e.baseName, `${t}.baseName`, i, e.type), e.dataType && E(e.dataType, `${t}.dataType`, i, e.type), e.value && E(e.value, `${t}.value`, i, e.type);
|
|
1554
1554
|
break;
|
|
1555
1555
|
case "classification":
|
|
1556
|
-
e.system && E(e.system, `${t}.system`,
|
|
1556
|
+
e.system && E(e.system, `${t}.system`, i, e.type), e.value && E(e.value, `${t}.value`, i, e.type);
|
|
1557
1557
|
break;
|
|
1558
1558
|
case "material":
|
|
1559
|
-
e.value && E(e.value, `${t}.value`,
|
|
1559
|
+
e.value && E(e.value, `${t}.value`, i, e.type);
|
|
1560
1560
|
break;
|
|
1561
1561
|
case "partOf":
|
|
1562
|
-
e.entity && k(e.entity, `${t}.entity`,
|
|
1562
|
+
e.entity && k(e.entity, `${t}.entity`, i);
|
|
1563
1563
|
break;
|
|
1564
1564
|
}
|
|
1565
1565
|
}
|
|
1566
|
-
function E(e, t,
|
|
1566
|
+
function E(e, t, i, a) {
|
|
1567
1567
|
switch(e.type){
|
|
1568
1568
|
case "enumeration":
|
|
1569
|
-
if (e.values.length === 0 ?
|
|
1569
|
+
if (e.values.length === 0 ? i.push({
|
|
1570
1570
|
severity: "error",
|
|
1571
1571
|
code: "E_RESTRICTION_EMPTY",
|
|
1572
1572
|
message: "xs:enumeration must have at least one value",
|
|
1573
1573
|
path: t,
|
|
1574
|
-
facetType:
|
|
1575
|
-
}) : e.values.some((n)=>n === "" || n == null) &&
|
|
1574
|
+
facetType: a
|
|
1575
|
+
}) : e.values.some((n)=>n === "" || n == null) && i.push({
|
|
1576
1576
|
severity: "warning",
|
|
1577
1577
|
code: "E_RESTRICTION_EMPTY",
|
|
1578
1578
|
message: "xs:enumeration has an empty entry",
|
|
1579
1579
|
path: t,
|
|
1580
|
-
facetType:
|
|
1581
|
-
}), e.base) for (const n of e.values)n == null || n === "" ||
|
|
1580
|
+
facetType: a
|
|
1581
|
+
}), e.base) for (const n of e.values)n == null || n === "" || kt(n, e.base) || i.push({
|
|
1582
1582
|
severity: "error",
|
|
1583
1583
|
code: "E_RESTRICTION_VALUE_MISMATCH",
|
|
1584
1584
|
message: `xs:enumeration value "${n}" is not valid for xs:restriction @base="${e.base}"`,
|
|
1585
1585
|
path: t,
|
|
1586
|
-
facetType:
|
|
1586
|
+
facetType: a,
|
|
1587
1587
|
detail: {
|
|
1588
1588
|
value: n,
|
|
1589
1589
|
base: e.base
|
|
@@ -1591,78 +1591,78 @@ let __tla = Promise.all([
|
|
|
1591
1591
|
});
|
|
1592
1592
|
break;
|
|
1593
1593
|
case "bounds":
|
|
1594
|
-
|
|
1594
|
+
Vt(e, t, i, a);
|
|
1595
1595
|
break;
|
|
1596
1596
|
case "pattern":
|
|
1597
|
-
|
|
1597
|
+
Dt(e.pattern, t, i, a);
|
|
1598
1598
|
break;
|
|
1599
1599
|
}
|
|
1600
1600
|
}
|
|
1601
|
-
function
|
|
1601
|
+
function Vt(e, t, i, a) {
|
|
1602
1602
|
const n = e.minInclusive ?? e.minExclusive, r = e.maxInclusive ?? e.maxExclusive;
|
|
1603
|
-
typeof n == "number" && typeof r == "number" && n > r &&
|
|
1603
|
+
typeof n == "number" && typeof r == "number" && n > r && i.push({
|
|
1604
1604
|
severity: "error",
|
|
1605
1605
|
code: "E_RESTRICTION_RANGE",
|
|
1606
1606
|
message: `xs:restriction bounds inverted: lower (${n}) > upper (${r})`,
|
|
1607
1607
|
path: t,
|
|
1608
|
-
facetType:
|
|
1608
|
+
facetType: a,
|
|
1609
1609
|
detail: {
|
|
1610
1610
|
min: n,
|
|
1611
1611
|
max: r
|
|
1612
1612
|
}
|
|
1613
|
-
}), typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength &&
|
|
1613
|
+
}), typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength && i.push({
|
|
1614
1614
|
severity: "error",
|
|
1615
1615
|
code: "E_RESTRICTION_RANGE",
|
|
1616
1616
|
message: `xs:restriction lengths inverted: minLength (${e.minLength}) > maxLength (${e.maxLength})`,
|
|
1617
1617
|
path: t,
|
|
1618
|
-
facetType:
|
|
1618
|
+
facetType: a,
|
|
1619
1619
|
detail: {
|
|
1620
1620
|
min: e.minLength,
|
|
1621
1621
|
max: e.maxLength
|
|
1622
1622
|
}
|
|
1623
|
-
}), typeof e.length == "number" && (typeof e.minLength == "number" || typeof e.maxLength == "number") &&
|
|
1623
|
+
}), typeof e.length == "number" && (typeof e.minLength == "number" || typeof e.maxLength == "number") && i.push({
|
|
1624
1624
|
severity: "warning",
|
|
1625
1625
|
code: "E_RESTRICTION_RANGE",
|
|
1626
1626
|
message: "xs:length is mutually exclusive with xs:minLength/xs:maxLength",
|
|
1627
1627
|
path: t,
|
|
1628
|
-
facetType:
|
|
1629
|
-
}), e.minInclusive === void 0 && e.minExclusive === void 0 && e.maxInclusive === void 0 && e.maxExclusive === void 0 && e.length === void 0 && e.minLength === void 0 && e.maxLength === void 0 &&
|
|
1628
|
+
facetType: a
|
|
1629
|
+
}), e.minInclusive === void 0 && e.minExclusive === void 0 && e.maxInclusive === void 0 && e.maxExclusive === void 0 && e.length === void 0 && e.minLength === void 0 && e.maxLength === void 0 && i.push({
|
|
1630
1630
|
severity: "error",
|
|
1631
1631
|
code: "E_RESTRICTION_EMPTY",
|
|
1632
1632
|
message: "xs:restriction has no min/max bounds or length facets",
|
|
1633
1633
|
path: t,
|
|
1634
|
-
facetType:
|
|
1634
|
+
facetType: a
|
|
1635
1635
|
});
|
|
1636
1636
|
}
|
|
1637
|
-
function
|
|
1638
|
-
const n =
|
|
1637
|
+
function Dt(e, t, i, a) {
|
|
1638
|
+
const n = wt(e);
|
|
1639
1639
|
if (!n.ok) {
|
|
1640
1640
|
if (n.severity === "error") {
|
|
1641
|
-
|
|
1641
|
+
i.push({
|
|
1642
1642
|
severity: "error",
|
|
1643
1643
|
code: "E_RESTRICTION_EMPTY",
|
|
1644
1644
|
message: e === "" ? "xs:pattern @value is empty" : `xs:pattern is not a valid regular expression: ${n.reason}`,
|
|
1645
1645
|
path: t,
|
|
1646
|
-
facetType:
|
|
1646
|
+
facetType: a,
|
|
1647
1647
|
detail: e === "" ? void 0 : {
|
|
1648
1648
|
pattern: e
|
|
1649
1649
|
}
|
|
1650
1650
|
});
|
|
1651
1651
|
return;
|
|
1652
1652
|
}
|
|
1653
|
-
|
|
1653
|
+
i.push({
|
|
1654
1654
|
severity: "warning",
|
|
1655
1655
|
code: "W_REGEX_UNVERIFIED",
|
|
1656
1656
|
message: `xs:pattern uses XSD-specific syntax not verifiable in JS: ${n.reason}`,
|
|
1657
1657
|
path: t,
|
|
1658
|
-
facetType:
|
|
1658
|
+
facetType: a,
|
|
1659
1659
|
detail: {
|
|
1660
1660
|
pattern: e
|
|
1661
1661
|
}
|
|
1662
1662
|
});
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
|
-
const
|
|
1665
|
+
const Ut = {
|
|
1666
1666
|
"xs:integer": /^[+-]?(\d+)$/,
|
|
1667
1667
|
"xs:double": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
|
|
1668
1668
|
"xs:float": /^([-+]?[0-9]*\.?[0-9]*([eE][-+]?[0-9]+)?|NaN|\+INF|-INF)$/,
|
|
@@ -1673,42 +1673,42 @@ let __tla = Promise.all([
|
|
|
1673
1673
|
"xs:time": /^\d{2}:\d{2}:\d{2}(\.\d+)?(Z|([+-]\d{2}:\d{2}))?$/,
|
|
1674
1674
|
"xs:duration": /^[-+]?P(\d+Y)?(\d+M)?(\d+D)?(T(\d+H)?(\d+M)?(\d+S)?)?$/
|
|
1675
1675
|
};
|
|
1676
|
-
function
|
|
1677
|
-
const
|
|
1678
|
-
return
|
|
1676
|
+
function kt(e, t) {
|
|
1677
|
+
const i = Ut[t];
|
|
1678
|
+
return i ? (t === "xs:double" || t === "xs:float" || t === "xs:decimal") && !/[0-9]/.test(e) ? !1 : i.test(e) : !0;
|
|
1679
1679
|
}
|
|
1680
|
-
async function
|
|
1681
|
-
const
|
|
1682
|
-
for(let
|
|
1683
|
-
const n = e.specifications[
|
|
1680
|
+
async function Bt(e, t) {
|
|
1681
|
+
const i = [];
|
|
1682
|
+
for(let a = 0; a < e.specifications.length; a++){
|
|
1683
|
+
const n = e.specifications[a], r = qt(n, t.ifcVersion);
|
|
1684
1684
|
if (r.length === 0) continue;
|
|
1685
1685
|
const s = new Set;
|
|
1686
1686
|
for (const l of r){
|
|
1687
1687
|
const o = [];
|
|
1688
|
-
await
|
|
1688
|
+
await Yt(n, l, `specifications[${a}]`, o);
|
|
1689
1689
|
for (const u of o){
|
|
1690
1690
|
const c = `${u.code}|${u.path}|${u.message}`;
|
|
1691
|
-
s.has(c) || (s.add(c),
|
|
1691
|
+
s.has(c) || (s.add(c), i.push(u));
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
1694
|
}
|
|
1695
|
-
return
|
|
1695
|
+
return i;
|
|
1696
1696
|
}
|
|
1697
|
-
function
|
|
1697
|
+
function qt(e, t) {
|
|
1698
1698
|
if (t) {
|
|
1699
|
-
const n =
|
|
1699
|
+
const n = X(t);
|
|
1700
1700
|
return n ? [
|
|
1701
1701
|
n
|
|
1702
1702
|
] : [];
|
|
1703
1703
|
}
|
|
1704
|
-
const
|
|
1704
|
+
const i = [], a = new Set;
|
|
1705
1705
|
for (const n of e.ifcVersions){
|
|
1706
|
-
const r =
|
|
1707
|
-
r && !
|
|
1706
|
+
const r = X(n);
|
|
1707
|
+
r && !a.has(r) && (a.add(r), i.push(r));
|
|
1708
1708
|
}
|
|
1709
|
-
return
|
|
1709
|
+
return i;
|
|
1710
1710
|
}
|
|
1711
|
-
function
|
|
1711
|
+
function X(e) {
|
|
1712
1712
|
switch(e){
|
|
1713
1713
|
case "IFC2X3":
|
|
1714
1714
|
case "IFC4":
|
|
@@ -1719,49 +1719,49 @@ let __tla = Promise.all([
|
|
|
1719
1719
|
return;
|
|
1720
1720
|
}
|
|
1721
1721
|
}
|
|
1722
|
-
async function
|
|
1722
|
+
async function Yt(e, t, i, a) {
|
|
1723
1723
|
const n = e.applicability.facets.find((r)=>r.type === "entity");
|
|
1724
1724
|
for(let r = 0; r < e.applicability.facets.length; r++){
|
|
1725
1725
|
const s = e.applicability.facets[r];
|
|
1726
|
-
await j(s, t, `${
|
|
1726
|
+
await j(s, t, `${i}.applicability.facets[${r}]`, n, a);
|
|
1727
1727
|
}
|
|
1728
1728
|
for(let r = 0; r < e.requirements.length; r++){
|
|
1729
1729
|
const s = e.requirements[r];
|
|
1730
|
-
await j(s.facet, t, `${
|
|
1730
|
+
await j(s.facet, t, `${i}.requirements[${r}]`, n, a);
|
|
1731
1731
|
}
|
|
1732
1732
|
}
|
|
1733
|
-
async function j(e, t,
|
|
1733
|
+
async function j(e, t, i, a, n) {
|
|
1734
1734
|
switch(e.type){
|
|
1735
1735
|
case "entity":
|
|
1736
|
-
await
|
|
1736
|
+
await Xt(e, t, i, n);
|
|
1737
1737
|
break;
|
|
1738
1738
|
case "property":
|
|
1739
|
-
await
|
|
1739
|
+
await Wt(e, t, i, a, n);
|
|
1740
1740
|
break;
|
|
1741
1741
|
case "attribute":
|
|
1742
|
-
await
|
|
1742
|
+
await ti(e, t, i, a, n);
|
|
1743
1743
|
break;
|
|
1744
1744
|
case "partOf":
|
|
1745
|
-
await
|
|
1745
|
+
await ai(e, t, i, a, n);
|
|
1746
1746
|
break;
|
|
1747
1747
|
case "classification":
|
|
1748
|
-
await
|
|
1748
|
+
await Ht(t, a, i, n);
|
|
1749
1749
|
break;
|
|
1750
1750
|
case "material":
|
|
1751
|
-
await
|
|
1751
|
+
await Gt(t, a, i, n);
|
|
1752
1752
|
break;
|
|
1753
1753
|
}
|
|
1754
1754
|
}
|
|
1755
|
-
async function
|
|
1755
|
+
async function Ht(e, t, i, a) {
|
|
1756
1756
|
if (!t || t.name.type !== "simpleValue") return;
|
|
1757
1757
|
const n = t.name.value;
|
|
1758
1758
|
if (!n) return;
|
|
1759
1759
|
const r = e === "IFC2X3" ? "IfcRoot" : "IfcObjectDefinition";
|
|
1760
|
-
await $(e, n, r) ||
|
|
1760
|
+
await $(e, n, r) || a.push({
|
|
1761
1761
|
severity: "error",
|
|
1762
1762
|
code: "E_IFC_PARTOF_ENTITY",
|
|
1763
1763
|
message: `applicability entity "${n}" cannot be classified in ${e} (must be a subtype of ${r})`,
|
|
1764
|
-
path:
|
|
1764
|
+
path: i,
|
|
1765
1765
|
facetType: "classification",
|
|
1766
1766
|
detail: {
|
|
1767
1767
|
value: n,
|
|
@@ -1770,16 +1770,16 @@ let __tla = Promise.all([
|
|
|
1770
1770
|
}
|
|
1771
1771
|
});
|
|
1772
1772
|
}
|
|
1773
|
-
async function
|
|
1773
|
+
async function Gt(e, t, i, a) {
|
|
1774
1774
|
if (!t || t.name.type !== "simpleValue") return;
|
|
1775
1775
|
const n = t.name.value;
|
|
1776
1776
|
if (!n) return;
|
|
1777
1777
|
const r = e === "IFC2X3" ? "IfcRoot" : "IfcObjectDefinition";
|
|
1778
|
-
await $(e, n, r) ||
|
|
1778
|
+
await $(e, n, r) || a.push({
|
|
1779
1779
|
severity: "error",
|
|
1780
1780
|
code: "E_IFC_PARTOF_ENTITY",
|
|
1781
1781
|
message: `applicability entity "${n}" cannot have a material in ${e} (must be a subtype of ${r})`,
|
|
1782
|
-
path:
|
|
1782
|
+
path: i,
|
|
1783
1783
|
facetType: "material",
|
|
1784
1784
|
detail: {
|
|
1785
1785
|
value: n,
|
|
@@ -1788,17 +1788,17 @@ let __tla = Promise.all([
|
|
|
1788
1788
|
}
|
|
1789
1789
|
});
|
|
1790
1790
|
}
|
|
1791
|
-
async function
|
|
1791
|
+
async function Xt(e, t, i, a) {
|
|
1792
1792
|
if (e.name.type !== "simpleValue") return;
|
|
1793
1793
|
const n = e.name.value;
|
|
1794
1794
|
if (!n) return;
|
|
1795
|
-
const r = await
|
|
1795
|
+
const r = await Z(t, n);
|
|
1796
1796
|
if (!r) {
|
|
1797
|
-
|
|
1797
|
+
a.push({
|
|
1798
1798
|
severity: "error",
|
|
1799
1799
|
code: "E_IFC_ENTITY_UNKNOWN",
|
|
1800
1800
|
message: `entity name "${n}" is not a known IFC entity for ${t}`,
|
|
1801
|
-
path: `${
|
|
1801
|
+
path: `${i}.name`,
|
|
1802
1802
|
facetType: "entity",
|
|
1803
1803
|
detail: {
|
|
1804
1804
|
value: n,
|
|
@@ -1807,9 +1807,9 @@ let __tla = Promise.all([
|
|
|
1807
1807
|
});
|
|
1808
1808
|
return;
|
|
1809
1809
|
}
|
|
1810
|
-
e.predefinedType && r.predefinedTypes.length > 0 &&
|
|
1810
|
+
e.predefinedType && r.predefinedTypes.length > 0 && jt(e.predefinedType, r, t, `${i}.predefinedType`, a);
|
|
1811
1811
|
}
|
|
1812
|
-
function
|
|
1812
|
+
function jt(e, t, i, a, n) {
|
|
1813
1813
|
const r = (s)=>t.predefinedTypes.includes(s.toUpperCase());
|
|
1814
1814
|
switch(e.type){
|
|
1815
1815
|
case "simpleValue":
|
|
@@ -1818,13 +1818,13 @@ let __tla = Promise.all([
|
|
|
1818
1818
|
s && !r(s) && n.push({
|
|
1819
1819
|
severity: "error",
|
|
1820
1820
|
code: "E_IFC_PREDEF_TYPE_INVALID",
|
|
1821
|
-
message: `predefined type "${s}" is not valid for ${t.name} (${
|
|
1822
|
-
path:
|
|
1821
|
+
message: `predefined type "${s}" is not valid for ${t.name} (${i})`,
|
|
1822
|
+
path: a,
|
|
1823
1823
|
facetType: "entity",
|
|
1824
1824
|
detail: {
|
|
1825
1825
|
value: s,
|
|
1826
1826
|
entity: t.name,
|
|
1827
|
-
version:
|
|
1827
|
+
version: i
|
|
1828
1828
|
}
|
|
1829
1829
|
});
|
|
1830
1830
|
break;
|
|
@@ -1834,13 +1834,13 @@ let __tla = Promise.all([
|
|
|
1834
1834
|
for (const s of e.values)s && !r(s) && n.push({
|
|
1835
1835
|
severity: "error",
|
|
1836
1836
|
code: "E_IFC_PREDEF_TYPE_INVALID",
|
|
1837
|
-
message: `predefined type enumeration value "${s}" is not valid for ${t.name} (${
|
|
1838
|
-
path:
|
|
1837
|
+
message: `predefined type enumeration value "${s}" is not valid for ${t.name} (${i})`,
|
|
1838
|
+
path: a,
|
|
1839
1839
|
facetType: "entity",
|
|
1840
1840
|
detail: {
|
|
1841
1841
|
value: s,
|
|
1842
1842
|
entity: t.name,
|
|
1843
|
-
version:
|
|
1843
|
+
version: i
|
|
1844
1844
|
}
|
|
1845
1845
|
});
|
|
1846
1846
|
break;
|
|
@@ -1852,13 +1852,13 @@ let __tla = Promise.all([
|
|
|
1852
1852
|
t.predefinedTypes.some((o)=>s.test(o)) || n.push({
|
|
1853
1853
|
severity: "error",
|
|
1854
1854
|
code: "E_IFC_PREDEF_TYPE_INVALID",
|
|
1855
|
-
message: `predefined type pattern "${e.pattern}" matches no value for ${t.name} (${
|
|
1856
|
-
path:
|
|
1855
|
+
message: `predefined type pattern "${e.pattern}" matches no value for ${t.name} (${i})`,
|
|
1856
|
+
path: a,
|
|
1857
1857
|
facetType: "entity",
|
|
1858
1858
|
detail: {
|
|
1859
1859
|
pattern: e.pattern,
|
|
1860
1860
|
entity: t.name,
|
|
1861
|
-
version:
|
|
1861
|
+
version: i
|
|
1862
1862
|
}
|
|
1863
1863
|
});
|
|
1864
1864
|
} catch {}
|
|
@@ -1866,16 +1866,16 @@ let __tla = Promise.all([
|
|
|
1866
1866
|
}
|
|
1867
1867
|
}
|
|
1868
1868
|
}
|
|
1869
|
-
async function
|
|
1869
|
+
async function Wt(e, t, i, a, n) {
|
|
1870
1870
|
if (e.dataType && e.dataType.type === "simpleValue") {
|
|
1871
1871
|
const o = e.dataType.value;
|
|
1872
1872
|
if (o) {
|
|
1873
|
-
const u = await
|
|
1874
|
-
u ? e.value &&
|
|
1873
|
+
const u = await Te(t, o);
|
|
1874
|
+
u ? e.value && Kt(e.value, u.backingType, o, `${i}.value`, n) : n.push({
|
|
1875
1875
|
severity: "error",
|
|
1876
1876
|
code: "E_IFC_DATATYPE_UNKNOWN",
|
|
1877
1877
|
message: `dataType "${o}" is not a known IFC measure/type for ${t}`,
|
|
1878
|
-
path: `${
|
|
1878
|
+
path: `${i}.dataType`,
|
|
1879
1879
|
facetType: "property",
|
|
1880
1880
|
detail: {
|
|
1881
1881
|
value: o,
|
|
@@ -1887,13 +1887,13 @@ let __tla = Promise.all([
|
|
|
1887
1887
|
if (e.propertySet.type !== "simpleValue") return;
|
|
1888
1888
|
const r = e.propertySet.value;
|
|
1889
1889
|
if (!r) return;
|
|
1890
|
-
const s = await
|
|
1890
|
+
const s = await Ie(t, r), l = be.some((o)=>r.startsWith(o));
|
|
1891
1891
|
if (!s) {
|
|
1892
1892
|
l && n.push({
|
|
1893
1893
|
severity: "warning",
|
|
1894
1894
|
code: "W_IFC_PSET_RESERVED_PREFIX",
|
|
1895
1895
|
message: `property set "${r}" uses a reserved buildingSMART prefix but is not a known standard ${r.startsWith("Qto_") ? "quantity set" : "pset"} for ${t}`,
|
|
1896
|
-
path: `${
|
|
1896
|
+
path: `${i}.propertySet`,
|
|
1897
1897
|
facetType: "property",
|
|
1898
1898
|
detail: {
|
|
1899
1899
|
value: r,
|
|
@@ -1902,15 +1902,15 @@ let __tla = Promise.all([
|
|
|
1902
1902
|
});
|
|
1903
1903
|
return;
|
|
1904
1904
|
}
|
|
1905
|
-
if (
|
|
1906
|
-
const o = await
|
|
1907
|
-
if (o.length > 0 && !(await Promise.all(o.map((c)=>
|
|
1905
|
+
if (a && s.applicableEntities.length > 0) {
|
|
1906
|
+
const o = await ei(a, t);
|
|
1907
|
+
if (o.length > 0 && !(await Promise.all(o.map((c)=>Zt(t, c, s.applicableEntities)))).some(Boolean)) {
|
|
1908
1908
|
const c = o.length === 1 ? o[0] : `{${o.join(", ")}}`;
|
|
1909
1909
|
n.push({
|
|
1910
1910
|
severity: "error",
|
|
1911
1911
|
code: "E_IFC_PROP_NOT_IN_PSET",
|
|
1912
1912
|
message: `${s.name} is not applicable to ${c} in ${t}`,
|
|
1913
|
-
path: `${
|
|
1913
|
+
path: `${i}.propertySet`,
|
|
1914
1914
|
facetType: "property",
|
|
1915
1915
|
detail: {
|
|
1916
1916
|
pset: s.name,
|
|
@@ -1924,11 +1924,11 @@ let __tla = Promise.all([
|
|
|
1924
1924
|
const o = e.baseName.value;
|
|
1925
1925
|
if (o) {
|
|
1926
1926
|
const u = s.properties.find((c)=>c.name === o);
|
|
1927
|
-
u ? e.dataType && e.dataType.type === "simpleValue" && e.dataType.value &&
|
|
1927
|
+
u ? e.dataType && e.dataType.type === "simpleValue" && e.dataType.value && zt(u, e.dataType.value, i, s.name, o, n) : n.push({
|
|
1928
1928
|
severity: "error",
|
|
1929
1929
|
code: "E_IFC_PROP_NOT_IN_PSET",
|
|
1930
1930
|
message: `property "${o}" is not part of ${s.name} (${t})`,
|
|
1931
|
-
path: `${
|
|
1931
|
+
path: `${i}.baseName`,
|
|
1932
1932
|
facetType: "property",
|
|
1933
1933
|
detail: {
|
|
1934
1934
|
property: o,
|
|
@@ -1939,15 +1939,15 @@ let __tla = Promise.all([
|
|
|
1939
1939
|
}
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function zt(e, t, i, a, n, r) {
|
|
1943
1943
|
const s = t.toUpperCase();
|
|
1944
1944
|
if (e.dataType && e.dataType.toUpperCase() === s) return;
|
|
1945
|
-
const l =
|
|
1945
|
+
const l = Jt(e.kind);
|
|
1946
1946
|
l && s === l || r.push({
|
|
1947
1947
|
severity: "error",
|
|
1948
1948
|
code: "W_IFC_DATATYPE_MISMATCH",
|
|
1949
|
-
message: `${
|
|
1950
|
-
path: `${
|
|
1949
|
+
message: `${a}.${n} is typed ${e.dataType ?? e.kind} in the standard, not ${t}`,
|
|
1950
|
+
path: `${i}.dataType`,
|
|
1951
1951
|
facetType: "property",
|
|
1952
1952
|
detail: {
|
|
1953
1953
|
expected: e.dataType ?? e.kind,
|
|
@@ -1956,7 +1956,7 @@ let __tla = Promise.all([
|
|
|
1956
1956
|
}
|
|
1957
1957
|
});
|
|
1958
1958
|
}
|
|
1959
|
-
function
|
|
1959
|
+
function Kt(e, t, i, a, n) {
|
|
1960
1960
|
if (e.type === "simpleValue") return;
|
|
1961
1961
|
const r = e.type === "pattern" || e.type === "enumeration" || e.type === "bounds" ? e.base : void 0;
|
|
1962
1962
|
let s;
|
|
@@ -1970,29 +1970,29 @@ let __tla = Promise.all([
|
|
|
1970
1970
|
typeof e.length == "number" || typeof e.minLength == "number" || typeof e.maxLength == "number" ? s = "xs:string" : s = "xs:double";
|
|
1971
1971
|
break;
|
|
1972
1972
|
}
|
|
1973
|
-
s && (
|
|
1973
|
+
s && (Qt(s, t) || n.push({
|
|
1974
1974
|
severity: "error",
|
|
1975
1975
|
code: "E_RESTRICTION_BASE_MISMATCH",
|
|
1976
|
-
message: `xs:restriction base (${s}) is not compatible with dataType "${
|
|
1977
|
-
path:
|
|
1976
|
+
message: `xs:restriction base (${s}) is not compatible with dataType "${i}" (backing ${t})`,
|
|
1977
|
+
path: a,
|
|
1978
1978
|
facetType: "property",
|
|
1979
1979
|
detail: {
|
|
1980
1980
|
inferred: s,
|
|
1981
1981
|
expected: t,
|
|
1982
|
-
dataType:
|
|
1982
|
+
dataType: i
|
|
1983
1983
|
}
|
|
1984
1984
|
}));
|
|
1985
1985
|
}
|
|
1986
|
-
function
|
|
1986
|
+
function Qt(e, t) {
|
|
1987
1987
|
if (e === t) return !0;
|
|
1988
|
-
const
|
|
1988
|
+
const i = new Set([
|
|
1989
1989
|
"xs:double",
|
|
1990
1990
|
"xs:decimal",
|
|
1991
1991
|
"xs:float"
|
|
1992
1992
|
]);
|
|
1993
|
-
return !!(
|
|
1993
|
+
return !!(i.has(e) && i.has(t));
|
|
1994
1994
|
}
|
|
1995
|
-
function
|
|
1995
|
+
function Jt(e) {
|
|
1996
1996
|
switch(e){
|
|
1997
1997
|
case "single":
|
|
1998
1998
|
return "IFCPROPERTYSINGLEVALUE";
|
|
@@ -2008,30 +2008,30 @@ let __tla = Promise.all([
|
|
|
2008
2008
|
return;
|
|
2009
2009
|
}
|
|
2010
2010
|
}
|
|
2011
|
-
async function
|
|
2012
|
-
for (const
|
|
2011
|
+
async function Zt(e, t, i) {
|
|
2012
|
+
for (const a of i)if (await $(e, t, a)) return !0;
|
|
2013
2013
|
return !1;
|
|
2014
2014
|
}
|
|
2015
|
-
async function
|
|
2015
|
+
async function ei(e, t) {
|
|
2016
2016
|
switch(e.name.type){
|
|
2017
2017
|
case "simpleValue":
|
|
2018
2018
|
return e.name.value ? [
|
|
2019
2019
|
e.name.value
|
|
2020
2020
|
] : [];
|
|
2021
2021
|
case "enumeration":
|
|
2022
|
-
return e.name.values.filter((
|
|
2022
|
+
return e.name.values.filter((i)=>!!i);
|
|
2023
2023
|
case "pattern":
|
|
2024
2024
|
try {
|
|
2025
|
-
const
|
|
2026
|
-
const { getEntities: r } = await import("./sandbox-
|
|
2025
|
+
const i = new RegExp(`^${e.name.pattern}$`), { getEntities: a } = await ge(async ()=>{
|
|
2026
|
+
const { getEntities: r } = await import("./sandbox-0sDo3g3m.js").then(async (m)=>{
|
|
2027
2027
|
await m.__tla;
|
|
2028
2028
|
return m;
|
|
2029
|
-
}).then((s)=>s.
|
|
2029
|
+
}).then((s)=>s.az);
|
|
2030
2030
|
return {
|
|
2031
2031
|
getEntities: r
|
|
2032
2032
|
};
|
|
2033
2033
|
}, __vite__mapDeps([0,1]));
|
|
2034
|
-
return (await
|
|
2034
|
+
return (await a(t)).filter((r)=>i.test(r.name.toUpperCase()) || i.test(r.name)).map((r)=>r.name);
|
|
2035
2035
|
} catch {
|
|
2036
2036
|
return [];
|
|
2037
2037
|
}
|
|
@@ -2039,18 +2039,18 @@ let __tla = Promise.all([
|
|
|
2039
2039
|
return [];
|
|
2040
2040
|
}
|
|
2041
2041
|
}
|
|
2042
|
-
async function
|
|
2043
|
-
if (!
|
|
2044
|
-
const r =
|
|
2042
|
+
async function ti(e, t, i, a, n) {
|
|
2043
|
+
if (!a || a.name.type !== "simpleValue" || e.name.type !== "simpleValue") return;
|
|
2044
|
+
const r = a.name.value, s = e.name.value;
|
|
2045
2045
|
if (!r || !s) return;
|
|
2046
|
-
const l = await
|
|
2046
|
+
const l = await ve(t, r);
|
|
2047
2047
|
if (l.length === 0) return;
|
|
2048
|
-
if (!
|
|
2048
|
+
if (!ii(l, s)) {
|
|
2049
2049
|
n.push({
|
|
2050
2050
|
severity: "error",
|
|
2051
2051
|
code: "E_IFC_ATTR_UNKNOWN_FOR_ENTITY",
|
|
2052
2052
|
message: `attribute "${s}" is not defined on ${l[0].name} (${t})`,
|
|
2053
|
-
path: `${
|
|
2053
|
+
path: `${i}.name`,
|
|
2054
2054
|
facetType: "attribute",
|
|
2055
2055
|
detail: {
|
|
2056
2056
|
attribute: s,
|
|
@@ -2061,14 +2061,14 @@ let __tla = Promise.all([
|
|
|
2061
2061
|
return;
|
|
2062
2062
|
}
|
|
2063
2063
|
if (e.value === void 0) return;
|
|
2064
|
-
const o = await
|
|
2064
|
+
const o = await Ee(t, s);
|
|
2065
2065
|
if (!o) return;
|
|
2066
|
-
const u = l[0].name.toUpperCase(), c = l.map((
|
|
2067
|
-
!
|
|
2066
|
+
const u = l[0].name.toUpperCase(), c = l.map((f)=>f.name.toUpperCase()), m = c.some((f)=>o.simpleValueEntities.includes(f)), d = c.some((f)=>o.complexEntities.includes(f));
|
|
2067
|
+
!m && d && n.push({
|
|
2068
2068
|
severity: "error",
|
|
2069
2069
|
code: "E_IFC_ATTR_UNKNOWN_FOR_ENTITY",
|
|
2070
2070
|
message: `attribute "${s}" on ${u} is a complex/entity-typed attribute and cannot carry a simple <value> constraint (${t})`,
|
|
2071
|
-
path: `${
|
|
2071
|
+
path: `${i}.value`,
|
|
2072
2072
|
facetType: "attribute",
|
|
2073
2073
|
detail: {
|
|
2074
2074
|
attribute: s,
|
|
@@ -2077,19 +2077,19 @@ let __tla = Promise.all([
|
|
|
2077
2077
|
}
|
|
2078
2078
|
});
|
|
2079
2079
|
}
|
|
2080
|
-
function
|
|
2081
|
-
const
|
|
2082
|
-
for (const
|
|
2080
|
+
function ii(e, t) {
|
|
2081
|
+
const i = t.toLowerCase();
|
|
2082
|
+
for (const a of e)for (const n of a.attributes)if (n.toLowerCase() === i) return !0;
|
|
2083
2083
|
return !1;
|
|
2084
2084
|
}
|
|
2085
|
-
async function
|
|
2086
|
-
const r = await
|
|
2085
|
+
async function ai(e, t, i, a, n) {
|
|
2086
|
+
const r = await he(t), s = e.rawRelation ?? e.relation, l = s.toUpperCase(), o = r.find((u)=>u.relation === l);
|
|
2087
2087
|
if (!o) {
|
|
2088
2088
|
n.push({
|
|
2089
2089
|
severity: "error",
|
|
2090
2090
|
code: "E_IFC_PARTOF_RELATION",
|
|
2091
2091
|
message: `partOf relation "${s}" is not valid for ${t}`,
|
|
2092
|
-
path: `${
|
|
2092
|
+
path: `${i}.relation`,
|
|
2093
2093
|
facetType: "partOf",
|
|
2094
2094
|
detail: {
|
|
2095
2095
|
value: s,
|
|
@@ -2099,13 +2099,13 @@ let __tla = Promise.all([
|
|
|
2099
2099
|
return;
|
|
2100
2100
|
}
|
|
2101
2101
|
if (e.entity && e.entity.name.type === "simpleValue" && e.entity.name.value) {
|
|
2102
|
-
const u = e.entity.name.value, c = await
|
|
2102
|
+
const u = e.entity.name.value, c = await Z(t, u);
|
|
2103
2103
|
if (!c) {
|
|
2104
2104
|
n.push({
|
|
2105
2105
|
severity: "error",
|
|
2106
2106
|
code: "E_IFC_PARTOF_ENTITY",
|
|
2107
2107
|
message: `partOf entity "${u}" is not a known IFC entity for ${t}`,
|
|
2108
|
-
path: `${
|
|
2108
|
+
path: `${i}.entity.name`,
|
|
2109
2109
|
facetType: "partOf",
|
|
2110
2110
|
detail: {
|
|
2111
2111
|
value: u,
|
|
@@ -2114,28 +2114,28 @@ let __tla = Promise.all([
|
|
|
2114
2114
|
});
|
|
2115
2115
|
return;
|
|
2116
2116
|
}
|
|
2117
|
-
const
|
|
2118
|
-
await $(t, c.name,
|
|
2117
|
+
const m = o.owner;
|
|
2118
|
+
await $(t, c.name, m) || n.push({
|
|
2119
2119
|
severity: "error",
|
|
2120
2120
|
code: "E_IFC_PARTOF_ENTITY",
|
|
2121
|
-
message: `partOf @entity "${c.name}" is not a subtype of "${
|
|
2122
|
-
path: `${
|
|
2121
|
+
message: `partOf @entity "${c.name}" is not a subtype of "${m}" required by ${e.relation} (${t})`,
|
|
2122
|
+
path: `${i}.entity.name`,
|
|
2123
2123
|
facetType: "partOf",
|
|
2124
2124
|
detail: {
|
|
2125
2125
|
value: c.name,
|
|
2126
|
-
required:
|
|
2126
|
+
required: m,
|
|
2127
2127
|
relation: e.relation,
|
|
2128
2128
|
version: t
|
|
2129
2129
|
}
|
|
2130
2130
|
});
|
|
2131
2131
|
}
|
|
2132
|
-
if (
|
|
2133
|
-
const u =
|
|
2132
|
+
if (a && a.name.type === "simpleValue" && a.name.value) {
|
|
2133
|
+
const u = a.name.value;
|
|
2134
2134
|
await $(t, u, o.member) || n.push({
|
|
2135
2135
|
severity: "error",
|
|
2136
2136
|
code: "E_IFC_PARTOF_ENTITY",
|
|
2137
2137
|
message: `applicability entity "${u}" cannot be the member of ${e.relation}; ${e.relation} requires the member to be a subtype of "${o.member}" (${t})`,
|
|
2138
|
-
path: `${
|
|
2138
|
+
path: `${i}.relation`,
|
|
2139
2139
|
facetType: "partOf",
|
|
2140
2140
|
detail: {
|
|
2141
2141
|
applicability: u,
|
|
@@ -2146,27 +2146,27 @@ let __tla = Promise.all([
|
|
|
2146
2146
|
});
|
|
2147
2147
|
}
|
|
2148
2148
|
}
|
|
2149
|
-
function
|
|
2149
|
+
function ni(e) {
|
|
2150
2150
|
try {
|
|
2151
2151
|
return {
|
|
2152
|
-
document:
|
|
2152
|
+
document: Pe(e),
|
|
2153
2153
|
issues: []
|
|
2154
2154
|
};
|
|
2155
2155
|
} catch (t) {
|
|
2156
2156
|
return {
|
|
2157
2157
|
issues: [
|
|
2158
|
-
|
|
2158
|
+
ri(t)
|
|
2159
2159
|
]
|
|
2160
2160
|
};
|
|
2161
2161
|
}
|
|
2162
2162
|
}
|
|
2163
|
-
function
|
|
2163
|
+
function ri(e) {
|
|
2164
2164
|
if (e instanceof g) {
|
|
2165
2165
|
const t = e.details ? `${e.message}: ${e.details}` : e.message;
|
|
2166
|
-
let
|
|
2167
|
-
return e.message.includes("Failed to parse IDS XML") || e.message.includes("Invalid XML format") || e.message.includes("No DOMParser") ?
|
|
2166
|
+
let i = "E_PARSE_UNKNOWN";
|
|
2167
|
+
return e.message.includes("Failed to parse IDS XML") || e.message.includes("Invalid XML format") || e.message.includes("No DOMParser") ? i = "E_PARSE_XML" : e.message.includes("Invalid root element") ? i = "E_PARSE_ROOT" : e.message.includes("facet") && (i = "E_PARSE_FACET"), {
|
|
2168
2168
|
severity: "error",
|
|
2169
|
-
code:
|
|
2169
|
+
code: i,
|
|
2170
2170
|
message: t,
|
|
2171
2171
|
path: ""
|
|
2172
2172
|
};
|
|
@@ -2178,17 +2178,17 @@ let __tla = Promise.all([
|
|
|
2178
2178
|
path: ""
|
|
2179
2179
|
};
|
|
2180
2180
|
}
|
|
2181
|
-
const
|
|
2181
|
+
const oe = "http://www.w3.org/2001/XMLSchema", ue = new Set([
|
|
2182
2182
|
"xmlns",
|
|
2183
2183
|
"xsi",
|
|
2184
2184
|
"xml"
|
|
2185
|
-
]),
|
|
2185
|
+
]), si = {
|
|
2186
2186
|
attrs: [],
|
|
2187
2187
|
children: [
|
|
2188
2188
|
"info",
|
|
2189
2189
|
"specifications"
|
|
2190
2190
|
]
|
|
2191
|
-
},
|
|
2191
|
+
}, li = {
|
|
2192
2192
|
attrs: [],
|
|
2193
2193
|
children: [
|
|
2194
2194
|
"title",
|
|
@@ -2200,12 +2200,12 @@ let __tla = Promise.all([
|
|
|
2200
2200
|
"purpose",
|
|
2201
2201
|
"milestone"
|
|
2202
2202
|
]
|
|
2203
|
-
},
|
|
2203
|
+
}, oi = {
|
|
2204
2204
|
attrs: [],
|
|
2205
2205
|
children: [
|
|
2206
2206
|
"specification"
|
|
2207
2207
|
]
|
|
2208
|
-
},
|
|
2208
|
+
}, ui = {
|
|
2209
2209
|
attrs: [
|
|
2210
2210
|
"name",
|
|
2211
2211
|
"ifcVersion",
|
|
@@ -2221,7 +2221,7 @@ let __tla = Promise.all([
|
|
|
2221
2221
|
"applicability",
|
|
2222
2222
|
"requirements"
|
|
2223
2223
|
]
|
|
2224
|
-
},
|
|
2224
|
+
}, ci = {
|
|
2225
2225
|
attrs: [
|
|
2226
2226
|
"minOccurs",
|
|
2227
2227
|
"maxOccurs"
|
|
@@ -2234,7 +2234,7 @@ let __tla = Promise.all([
|
|
|
2234
2234
|
"property",
|
|
2235
2235
|
"material"
|
|
2236
2236
|
]
|
|
2237
|
-
},
|
|
2237
|
+
}, pi = {
|
|
2238
2238
|
attrs: [
|
|
2239
2239
|
"description"
|
|
2240
2240
|
],
|
|
@@ -2246,32 +2246,32 @@ let __tla = Promise.all([
|
|
|
2246
2246
|
"property",
|
|
2247
2247
|
"material"
|
|
2248
2248
|
]
|
|
2249
|
-
},
|
|
2249
|
+
}, di = {
|
|
2250
2250
|
attrs: [],
|
|
2251
2251
|
children: [
|
|
2252
2252
|
"name",
|
|
2253
2253
|
"predefinedType"
|
|
2254
2254
|
]
|
|
2255
|
-
},
|
|
2255
|
+
}, mi = {
|
|
2256
2256
|
attrs: [],
|
|
2257
2257
|
children: [
|
|
2258
2258
|
"name",
|
|
2259
2259
|
"value"
|
|
2260
2260
|
]
|
|
2261
|
-
},
|
|
2261
|
+
}, fi = {
|
|
2262
2262
|
attrs: [],
|
|
2263
2263
|
children: [
|
|
2264
2264
|
"value",
|
|
2265
2265
|
"system"
|
|
2266
2266
|
]
|
|
2267
|
-
},
|
|
2267
|
+
}, yi = {
|
|
2268
2268
|
attrs: [
|
|
2269
2269
|
"relation"
|
|
2270
2270
|
],
|
|
2271
2271
|
children: [
|
|
2272
2272
|
"entity"
|
|
2273
2273
|
]
|
|
2274
|
-
},
|
|
2274
|
+
}, hi = {
|
|
2275
2275
|
attrs: [
|
|
2276
2276
|
"dataType"
|
|
2277
2277
|
],
|
|
@@ -2280,14 +2280,14 @@ let __tla = Promise.all([
|
|
|
2280
2280
|
"baseName",
|
|
2281
2281
|
"value"
|
|
2282
2282
|
]
|
|
2283
|
-
},
|
|
2283
|
+
}, vi = {
|
|
2284
2284
|
attrs: [],
|
|
2285
2285
|
children: [
|
|
2286
2286
|
"value"
|
|
2287
2287
|
]
|
|
2288
2288
|
};
|
|
2289
|
-
function
|
|
2290
|
-
const t =
|
|
2289
|
+
function Ei(e) {
|
|
2290
|
+
const t = ce(e);
|
|
2291
2291
|
switch(e.toLowerCase()){
|
|
2292
2292
|
case "entity":
|
|
2293
2293
|
return {
|
|
@@ -2331,20 +2331,20 @@ let __tla = Promise.all([
|
|
|
2331
2331
|
return t;
|
|
2332
2332
|
}
|
|
2333
2333
|
}
|
|
2334
|
-
function
|
|
2334
|
+
function ce(e) {
|
|
2335
2335
|
switch(e.toLowerCase()){
|
|
2336
2336
|
case "entity":
|
|
2337
|
-
return
|
|
2337
|
+
return di;
|
|
2338
2338
|
case "attribute":
|
|
2339
|
-
return
|
|
2339
|
+
return mi;
|
|
2340
2340
|
case "classification":
|
|
2341
|
-
return
|
|
2341
|
+
return fi;
|
|
2342
2342
|
case "partof":
|
|
2343
|
-
return
|
|
2343
|
+
return yi;
|
|
2344
2344
|
case "property":
|
|
2345
|
-
return
|
|
2345
|
+
return hi;
|
|
2346
2346
|
case "material":
|
|
2347
|
-
return
|
|
2347
|
+
return vi;
|
|
2348
2348
|
default:
|
|
2349
2349
|
return {
|
|
2350
2350
|
attrs: [],
|
|
@@ -2352,7 +2352,7 @@ let __tla = Promise.all([
|
|
|
2352
2352
|
};
|
|
2353
2353
|
}
|
|
2354
2354
|
}
|
|
2355
|
-
const
|
|
2355
|
+
const Ti = {
|
|
2356
2356
|
attrs: [],
|
|
2357
2357
|
children: [
|
|
2358
2358
|
"simpleValue"
|
|
@@ -2360,11 +2360,11 @@ let __tla = Promise.all([
|
|
|
2360
2360
|
xsChildren: [
|
|
2361
2361
|
"restriction"
|
|
2362
2362
|
]
|
|
2363
|
-
},
|
|
2363
|
+
}, Ii = {
|
|
2364
2364
|
attrs: [],
|
|
2365
2365
|
children: [],
|
|
2366
2366
|
textOnly: !0
|
|
2367
|
-
},
|
|
2367
|
+
}, pe = [
|
|
2368
2368
|
"enumeration",
|
|
2369
2369
|
"pattern",
|
|
2370
2370
|
"minInclusive",
|
|
@@ -2377,84 +2377,84 @@ let __tla = Promise.all([
|
|
|
2377
2377
|
"totalDigits",
|
|
2378
2378
|
"fractionDigits",
|
|
2379
2379
|
"whiteSpace"
|
|
2380
|
-
],
|
|
2380
|
+
], bi = {
|
|
2381
2381
|
attrs: [
|
|
2382
2382
|
"base"
|
|
2383
2383
|
],
|
|
2384
2384
|
children: [],
|
|
2385
|
-
xsChildren:
|
|
2386
|
-
},
|
|
2385
|
+
xsChildren: pe
|
|
2386
|
+
}, gi = {
|
|
2387
2387
|
attrs: [
|
|
2388
2388
|
"value"
|
|
2389
2389
|
],
|
|
2390
2390
|
children: [],
|
|
2391
2391
|
textOnly: !0
|
|
2392
2392
|
};
|
|
2393
|
-
async function
|
|
2394
|
-
const t = [],
|
|
2393
|
+
async function Si(e) {
|
|
2394
|
+
const t = [], i = typeof e == "string" ? e : new TextDecoder().decode(e), a = i.charCodeAt(0) === 65279 ? i.slice(1) : i, n = await Ai();
|
|
2395
2395
|
let r;
|
|
2396
2396
|
try {
|
|
2397
|
-
r = n.parseFromString(
|
|
2397
|
+
r = n.parseFromString(a, "text/xml");
|
|
2398
2398
|
} catch {
|
|
2399
2399
|
return t;
|
|
2400
2400
|
}
|
|
2401
2401
|
const s = r.documentElement;
|
|
2402
|
-
return !s || (s.localName ?? "").toLowerCase() !== "ids" ||
|
|
2402
|
+
return !s || (s.localName ?? "").toLowerCase() !== "ids" || xi(s, t), t;
|
|
2403
2403
|
}
|
|
2404
2404
|
let w;
|
|
2405
|
-
function
|
|
2405
|
+
function Ai() {
|
|
2406
2406
|
return w || (w = (async ()=>{
|
|
2407
2407
|
const e = globalThis.DOMParser;
|
|
2408
2408
|
if (typeof e == "function") return new e;
|
|
2409
|
-
const
|
|
2409
|
+
const i = await import("@xmldom/xmldom").then(async (m)=>{
|
|
2410
2410
|
await m.__tla;
|
|
2411
2411
|
return m;
|
|
2412
2412
|
});
|
|
2413
|
-
return new
|
|
2413
|
+
return new i.DOMParser;
|
|
2414
2414
|
})(), w);
|
|
2415
2415
|
}
|
|
2416
|
-
function
|
|
2417
|
-
S(e,
|
|
2418
|
-
for (const
|
|
2419
|
-
const
|
|
2420
|
-
|
|
2416
|
+
function xi(e, t) {
|
|
2417
|
+
S(e, si, "ids", t);
|
|
2418
|
+
for (const i of R(e)){
|
|
2419
|
+
const a = (i.localName ?? "").toLowerCase();
|
|
2420
|
+
a === "info" ? Ci(i, "ids.info", t) : a === "specifications" && Ri(i, "ids.specifications", t);
|
|
2421
2421
|
}
|
|
2422
2422
|
}
|
|
2423
|
-
function
|
|
2424
|
-
S(e,
|
|
2423
|
+
function Ci(e, t, i) {
|
|
2424
|
+
S(e, li, t, i);
|
|
2425
2425
|
}
|
|
2426
|
-
function
|
|
2427
|
-
S(e,
|
|
2428
|
-
let
|
|
2429
|
-
for (const n of R(e))(n.localName ?? "").toLowerCase() === "specification" &&
|
|
2426
|
+
function Ri(e, t, i) {
|
|
2427
|
+
S(e, oi, t, i);
|
|
2428
|
+
let a = 0;
|
|
2429
|
+
for (const n of R(e))(n.localName ?? "").toLowerCase() === "specification" && Mi(n, `${t}.specification[${a++}]`, i);
|
|
2430
2430
|
}
|
|
2431
|
-
function
|
|
2432
|
-
S(e,
|
|
2433
|
-
for (const
|
|
2434
|
-
const n = (
|
|
2435
|
-
n === "applicability" ? W(
|
|
2431
|
+
function Mi(e, t, i) {
|
|
2432
|
+
S(e, ui, t, i);
|
|
2433
|
+
for (const a of R(e)){
|
|
2434
|
+
const n = (a.localName ?? "").toLowerCase();
|
|
2435
|
+
n === "applicability" ? W(a, `${t}.applicability`, !1, i) : n === "requirements" && W(a, `${t}.requirements`, !0, i);
|
|
2436
2436
|
}
|
|
2437
2437
|
}
|
|
2438
|
-
function W(e, t,
|
|
2439
|
-
S(e,
|
|
2438
|
+
function W(e, t, i, a) {
|
|
2439
|
+
S(e, i ? pi : ci, t, a);
|
|
2440
2440
|
let n = 0;
|
|
2441
2441
|
for (const r of R(e)){
|
|
2442
2442
|
const s = (r.localName ?? "").toLowerCase();
|
|
2443
|
-
|
|
2443
|
+
de(r, s, `${t}.facets[${n++}]`, i, a);
|
|
2444
2444
|
}
|
|
2445
2445
|
}
|
|
2446
|
-
function
|
|
2447
|
-
const r =
|
|
2448
|
-
S(e, r,
|
|
2446
|
+
function de(e, t, i, a, n) {
|
|
2447
|
+
const r = a ? Ei(t) : ce(t);
|
|
2448
|
+
S(e, r, i, n);
|
|
2449
2449
|
for (const s of R(e)){
|
|
2450
2450
|
const l = (s.localName ?? "").toLowerCase();
|
|
2451
|
-
|
|
2451
|
+
Ni(s, l, `${i}.${l}`, a, n);
|
|
2452
2452
|
}
|
|
2453
2453
|
}
|
|
2454
|
-
function
|
|
2454
|
+
function Ni(e, t, i, a, n) {
|
|
2455
2455
|
switch(t){
|
|
2456
2456
|
case "entity":
|
|
2457
|
-
|
|
2457
|
+
de(e, "entity", i, !1, n);
|
|
2458
2458
|
return;
|
|
2459
2459
|
case "name":
|
|
2460
2460
|
case "value":
|
|
@@ -2462,49 +2462,49 @@ let __tla = Promise.all([
|
|
|
2462
2462
|
case "propertySet":
|
|
2463
2463
|
case "system":
|
|
2464
2464
|
case "predefinedType":
|
|
2465
|
-
|
|
2465
|
+
_i(e, i, n);
|
|
2466
2466
|
return;
|
|
2467
2467
|
default:
|
|
2468
2468
|
return;
|
|
2469
2469
|
}
|
|
2470
2470
|
}
|
|
2471
|
-
function
|
|
2472
|
-
S(e,
|
|
2473
|
-
for (const
|
|
2474
|
-
const n = (
|
|
2475
|
-
n === "simpleValue" ? S(
|
|
2471
|
+
function _i(e, t, i) {
|
|
2472
|
+
S(e, Ti, t, i);
|
|
2473
|
+
for (const a of R(e)){
|
|
2474
|
+
const n = (a.localName ?? "").toLowerCase();
|
|
2475
|
+
n === "simpleValue" ? S(a, Ii, `${t}.simpleValue`, i) : n === "restriction" && (a.namespaceURI === oe || a.namespaceURI === null) && Pi(a, `${t}.restriction`, i);
|
|
2476
2476
|
}
|
|
2477
2477
|
}
|
|
2478
|
-
function
|
|
2479
|
-
S(e,
|
|
2480
|
-
for (const
|
|
2481
|
-
const n = (
|
|
2482
|
-
|
|
2478
|
+
function Pi(e, t, i) {
|
|
2479
|
+
S(e, bi, t, i);
|
|
2480
|
+
for (const a of R(e)){
|
|
2481
|
+
const n = (a.localName ?? "").toLowerCase();
|
|
2482
|
+
pe.includes(n) && S(a, gi, `${t}.${n}`, i);
|
|
2483
2483
|
}
|
|
2484
2484
|
}
|
|
2485
|
-
function S(e, t,
|
|
2485
|
+
function S(e, t, i, a) {
|
|
2486
2486
|
const n = new Set(t.attrs.map((l)=>l.toLowerCase()));
|
|
2487
2487
|
for (const l of Array.from(e.attributes ?? [])){
|
|
2488
|
-
if (
|
|
2488
|
+
if (Oi(l)) continue;
|
|
2489
2489
|
const o = l.nodeName ?? "";
|
|
2490
|
-
if (
|
|
2491
|
-
const u = l.localName ?? l.nodeName ?? "", c = u.indexOf(":"),
|
|
2492
|
-
!
|
|
2490
|
+
if (wi(o)) continue;
|
|
2491
|
+
const u = l.localName ?? l.nodeName ?? "", c = u.indexOf(":"), m = c === -1 ? u.toLowerCase() : u.slice(c + 1).toLowerCase(), d = c === -1 ? "" : u.slice(0, c).toLowerCase();
|
|
2492
|
+
!m || m === "xmlns" || d === "xmlns" || ue.has(d) || n.has(m) || a.push({
|
|
2493
2493
|
severity: "error",
|
|
2494
2494
|
code: "E_XSD_STRUCTURE",
|
|
2495
2495
|
message: `unexpected attribute "${u}" on <${e.localName}>`,
|
|
2496
|
-
path:
|
|
2496
|
+
path: i,
|
|
2497
2497
|
detail: {
|
|
2498
2498
|
attribute: u,
|
|
2499
2499
|
element: e.localName ?? ""
|
|
2500
2500
|
}
|
|
2501
2501
|
});
|
|
2502
2502
|
}
|
|
2503
|
-
if (t.requiredAttrs) for (const l of t.requiredAttrs)
|
|
2503
|
+
if (t.requiredAttrs) for (const l of t.requiredAttrs)$i(e, l) || a.push({
|
|
2504
2504
|
severity: "error",
|
|
2505
2505
|
code: "E_XSD_REQUIRED_ATTR",
|
|
2506
2506
|
message: `<${e.localName}> is missing required @${l}`,
|
|
2507
|
-
path:
|
|
2507
|
+
path: i,
|
|
2508
2508
|
detail: {
|
|
2509
2509
|
attribute: l,
|
|
2510
2510
|
element: e.localName ?? ""
|
|
@@ -2513,12 +2513,12 @@ let __tla = Promise.all([
|
|
|
2513
2513
|
const r = new Set(t.children.map((l)=>l.toLowerCase())), s = new Set((t.xsChildren ?? []).map((l)=>l.toLowerCase()));
|
|
2514
2514
|
for (const l of R(e)){
|
|
2515
2515
|
const o = (l.localName ?? "").toLowerCase();
|
|
2516
|
-
if (l.namespaceURI ===
|
|
2517
|
-
s.has(o) ||
|
|
2516
|
+
if (l.namespaceURI === oe) {
|
|
2517
|
+
s.has(o) || a.push({
|
|
2518
2518
|
severity: "error",
|
|
2519
2519
|
code: "E_XSD_STRUCTURE",
|
|
2520
2520
|
message: `unexpected XSD child <xs:${o}> in <${e.localName}>`,
|
|
2521
|
-
path:
|
|
2521
|
+
path: i,
|
|
2522
2522
|
detail: {
|
|
2523
2523
|
child: `xs:${o}`,
|
|
2524
2524
|
parent: e.localName ?? ""
|
|
@@ -2526,11 +2526,11 @@ let __tla = Promise.all([
|
|
|
2526
2526
|
});
|
|
2527
2527
|
continue;
|
|
2528
2528
|
}
|
|
2529
|
-
r.has(o) ||
|
|
2529
|
+
r.has(o) || a.push({
|
|
2530
2530
|
severity: "error",
|
|
2531
2531
|
code: "E_XSD_STRUCTURE",
|
|
2532
2532
|
message: `unexpected child <${l.localName}> in <${e.localName}>`,
|
|
2533
|
-
path:
|
|
2533
|
+
path: i,
|
|
2534
2534
|
detail: {
|
|
2535
2535
|
child: l.localName ?? "",
|
|
2536
2536
|
parent: e.localName ?? ""
|
|
@@ -2539,68 +2539,70 @@ let __tla = Promise.all([
|
|
|
2539
2539
|
}
|
|
2540
2540
|
t.textOnly;
|
|
2541
2541
|
}
|
|
2542
|
-
function
|
|
2542
|
+
function $i(e, t) {
|
|
2543
2543
|
if (typeof e.hasAttribute == "function" && e.hasAttribute(t)) return !0;
|
|
2544
|
-
for (const
|
|
2544
|
+
for (const i of Array.from(e.attributes ?? []))if ((i.localName ?? i.nodeName ?? "").toLowerCase() === t.toLowerCase()) return !0;
|
|
2545
2545
|
return !1;
|
|
2546
2546
|
}
|
|
2547
|
-
function
|
|
2547
|
+
function wi(e) {
|
|
2548
2548
|
if (!e) return !1;
|
|
2549
2549
|
if (e === "xmlns") return !0;
|
|
2550
2550
|
const t = e.indexOf(":");
|
|
2551
|
-
return t === -1 ? !1 :
|
|
2551
|
+
return t === -1 ? !1 : ue.has(e.slice(0, t));
|
|
2552
2552
|
}
|
|
2553
|
-
const
|
|
2553
|
+
const Fi = new Set([
|
|
2554
2554
|
"http://www.w3.org/2000/xmlns/",
|
|
2555
2555
|
"http://www.w3.org/XML/1998/namespace",
|
|
2556
2556
|
"http://www.w3.org/2001/XMLSchema-instance"
|
|
2557
2557
|
]);
|
|
2558
|
-
function
|
|
2559
|
-
return e.namespaceURI !== null &&
|
|
2558
|
+
function Oi(e) {
|
|
2559
|
+
return e.namespaceURI !== null && Fi.has(e.namespaceURI);
|
|
2560
2560
|
}
|
|
2561
2561
|
function R(e) {
|
|
2562
2562
|
if (e.children && e.children.length !== void 0) return Array.from(e.children);
|
|
2563
|
-
const t = [],
|
|
2564
|
-
for(let
|
|
2565
|
-
const n = a
|
|
2563
|
+
const t = [], i = e.childNodes ?? [];
|
|
2564
|
+
for(let a = 0; a < i.length; a++){
|
|
2565
|
+
const n = i[a];
|
|
2566
2566
|
n && n.nodeType === 1 && t.push(n);
|
|
2567
2567
|
}
|
|
2568
2568
|
return t;
|
|
2569
2569
|
}
|
|
2570
|
-
const
|
|
2570
|
+
const Li = [
|
|
2571
2571
|
"IFC2X3",
|
|
2572
2572
|
"IFC4",
|
|
2573
2573
|
"IFC4X3_ADD2",
|
|
2574
2574
|
"IFC4X3"
|
|
2575
|
-
],
|
|
2575
|
+
], me = new Set([
|
|
2576
2576
|
"IFC2X3",
|
|
2577
2577
|
"IFC4",
|
|
2578
2578
|
"IFC4X3",
|
|
2579
2579
|
"IFC4X3_ADD2"
|
|
2580
|
-
])
|
|
2581
|
-
|
|
2582
|
-
|
|
2580
|
+
]), z = [
|
|
2581
|
+
...me
|
|
2582
|
+
].join(", ");
|
|
2583
|
+
function Vi(e) {
|
|
2584
|
+
return me.has(e.toUpperCase().replace(/[^A-Z0-9_]/g, ""));
|
|
2583
2585
|
}
|
|
2584
|
-
const
|
|
2586
|
+
const Di = new Set([
|
|
2585
2587
|
"entity",
|
|
2586
2588
|
"attribute",
|
|
2587
2589
|
"classification",
|
|
2588
2590
|
"material",
|
|
2589
2591
|
"partOf",
|
|
2590
2592
|
"property"
|
|
2591
|
-
]),
|
|
2593
|
+
]), Ui = [
|
|
2592
2594
|
"http://standards.buildingsmart.org/IDS/1.0/ids.xsd",
|
|
2593
2595
|
"http://standards.buildingsmart.org/IDS/0.9.7/ids.xsd",
|
|
2594
2596
|
"http://standards.buildingsmart.org/IDS/0.9.6/ids.xsd",
|
|
2595
2597
|
"http://standards.buildingsmart.org/IDS/ids.xsd"
|
|
2596
2598
|
];
|
|
2597
|
-
function
|
|
2599
|
+
function ki(e) {
|
|
2598
2600
|
const t = [];
|
|
2599
2601
|
if (e.schemaLocation) {
|
|
2600
|
-
const
|
|
2601
|
-
for(let
|
|
2602
|
-
const n = a
|
|
2603
|
-
n === "http://standards.buildingsmart.org/IDS" && (
|
|
2602
|
+
const i = e.schemaLocation.split(/\s+/).filter((a)=>a.length > 0);
|
|
2603
|
+
for(let a = 0; a + 1 < i.length; a += 2){
|
|
2604
|
+
const n = i[a], r = i[a + 1];
|
|
2605
|
+
n === "http://standards.buildingsmart.org/IDS" && (Ui.includes(r) || t.push({
|
|
2604
2606
|
severity: "error",
|
|
2605
2607
|
code: "E_XSD_SCHEMA_LOCATION",
|
|
2606
2608
|
message: `xsi:schemaLocation references "${r}", not a recognised IDS XSD`,
|
|
@@ -2616,61 +2618,61 @@ let __tla = Promise.all([
|
|
|
2616
2618
|
code: "E_XSD_REQUIRED_ATTR",
|
|
2617
2619
|
message: "IDS document is missing a non-empty <info><title> element",
|
|
2618
2620
|
path: "info.title"
|
|
2619
|
-
}), e.specifications.forEach((
|
|
2621
|
+
}), e.specifications.forEach((i, a)=>Bi(i, a, t)), t;
|
|
2620
2622
|
}
|
|
2621
|
-
function
|
|
2622
|
-
const
|
|
2623
|
-
if ((!e.name || e.name.trim() === "" || /^Specification \d+$/.test(e.name)) &&
|
|
2623
|
+
function Bi(e, t, i) {
|
|
2624
|
+
const a = `specifications[${t}]`;
|
|
2625
|
+
if ((!e.name || e.name.trim() === "" || /^Specification \d+$/.test(e.name)) && i.push({
|
|
2624
2626
|
severity: "error",
|
|
2625
2627
|
code: "E_XSD_REQUIRED_ATTR",
|
|
2626
2628
|
message: "specification is missing a non-empty @name attribute",
|
|
2627
|
-
path: `${
|
|
2628
|
-
}), !e.ifcVersions || e.ifcVersions.length === 0)
|
|
2629
|
+
path: `${a}.name`
|
|
2630
|
+
}), !e.ifcVersions || e.ifcVersions.length === 0) i.push({
|
|
2629
2631
|
severity: "error",
|
|
2630
2632
|
code: "E_XSD_REQUIRED_ATTR",
|
|
2631
2633
|
message: "specification is missing the @ifcVersion attribute",
|
|
2632
|
-
path: `${
|
|
2634
|
+
path: `${a}.ifcVersion`
|
|
2633
2635
|
});
|
|
2634
|
-
else for (const n of e.ifcVersions)
|
|
2636
|
+
else for (const n of e.ifcVersions)Li.includes(n) || i.push({
|
|
2635
2637
|
severity: "error",
|
|
2636
2638
|
code: "E_XSD_ENUM",
|
|
2637
|
-
message: `@ifcVersion "${n}" is not in {
|
|
2638
|
-
path: `${
|
|
2639
|
+
message: `@ifcVersion "${n}" is not in {${z}}`,
|
|
2640
|
+
path: `${a}.ifcVersion`,
|
|
2639
2641
|
detail: {
|
|
2640
2642
|
value: n
|
|
2641
2643
|
}
|
|
2642
2644
|
});
|
|
2643
2645
|
if (e.ifcVersionRaw) {
|
|
2644
2646
|
const n = e.ifcVersionRaw.split(/\s+/).filter((r)=>r.length > 0);
|
|
2645
|
-
for (const r of n)
|
|
2647
|
+
for (const r of n)Vi(r) || i.push({
|
|
2646
2648
|
severity: "error",
|
|
2647
2649
|
code: "E_XSD_ENUM",
|
|
2648
|
-
message: `@ifcVersion token "${r}" is not in {
|
|
2649
|
-
path: `${
|
|
2650
|
+
message: `@ifcVersion token "${r}" is not in {${z}}`,
|
|
2651
|
+
path: `${a}.ifcVersion`,
|
|
2650
2652
|
detail: {
|
|
2651
2653
|
value: r
|
|
2652
2654
|
}
|
|
2653
2655
|
});
|
|
2654
2656
|
}
|
|
2655
|
-
e.applicability.facets.length === 0 &&
|
|
2657
|
+
e.applicability.facets.length === 0 && i.push({
|
|
2656
2658
|
severity: "error",
|
|
2657
2659
|
code: "E_XSD_STRUCTURE",
|
|
2658
2660
|
message: "specification has an empty <applicability> — at least one facet is required",
|
|
2659
|
-
path: `${
|
|
2661
|
+
path: `${a}.applicability`
|
|
2660
2662
|
}), e.applicability.facets.forEach((n, r)=>{
|
|
2661
|
-
|
|
2662
|
-
}), e.requirements.length === 0 &&
|
|
2663
|
+
K(n, `${a}.applicability.facets[${r}]`, i);
|
|
2664
|
+
}), e.requirements.length === 0 && i.push({
|
|
2663
2665
|
severity: "warning",
|
|
2664
2666
|
code: "E_XSD_STRUCTURE",
|
|
2665
2667
|
message: "specification has no <requirements>; matched entities will not be checked",
|
|
2666
|
-
path: `${
|
|
2668
|
+
path: `${a}.requirements`
|
|
2667
2669
|
}), e.requirements.forEach((n, r)=>{
|
|
2668
|
-
|
|
2670
|
+
K(n.facet, `${a}.requirements[${r}]`, i);
|
|
2669
2671
|
});
|
|
2670
2672
|
}
|
|
2671
|
-
function
|
|
2672
|
-
if (!
|
|
2673
|
-
|
|
2673
|
+
function K(e, t, i) {
|
|
2674
|
+
if (!Di.has(e.type)) {
|
|
2675
|
+
i.push({
|
|
2674
2676
|
severity: "error",
|
|
2675
2677
|
code: "E_XSD_STRUCTURE",
|
|
2676
2678
|
message: `unknown facet type "${e.type}"`,
|
|
@@ -2681,67 +2683,67 @@ let __tla = Promise.all([
|
|
|
2681
2683
|
}
|
|
2682
2684
|
switch(e.type){
|
|
2683
2685
|
case "entity":
|
|
2684
|
-
F(e.name, `${t}.name`, "entity.name",
|
|
2686
|
+
F(e.name, `${t}.name`, "entity.name", i, e.type);
|
|
2685
2687
|
break;
|
|
2686
2688
|
case "attribute":
|
|
2687
|
-
F(e.name, `${t}.name`, "attribute.name",
|
|
2689
|
+
F(e.name, `${t}.name`, "attribute.name", i, e.type);
|
|
2688
2690
|
break;
|
|
2689
2691
|
case "property":
|
|
2690
|
-
F(e.propertySet, `${t}.propertySet`, "property.propertySet",
|
|
2692
|
+
F(e.propertySet, `${t}.propertySet`, "property.propertySet", i, e.type), F(e.baseName, `${t}.baseName`, "property.baseName", i, e.type);
|
|
2691
2693
|
break;
|
|
2692
2694
|
}
|
|
2693
2695
|
}
|
|
2694
|
-
function F(e, t,
|
|
2696
|
+
function F(e, t, i, a, n) {
|
|
2695
2697
|
if (!e) {
|
|
2696
|
-
|
|
2698
|
+
a.push({
|
|
2697
2699
|
severity: "error",
|
|
2698
2700
|
code: "E_XSD_REQUIRED_ATTR",
|
|
2699
|
-
message: `${
|
|
2701
|
+
message: `${i} is required`,
|
|
2700
2702
|
path: t,
|
|
2701
2703
|
facetType: n
|
|
2702
2704
|
});
|
|
2703
2705
|
return;
|
|
2704
2706
|
}
|
|
2705
|
-
e.type === "simpleValue" && (!e.value || e.value.trim() === "") &&
|
|
2707
|
+
e.type === "simpleValue" && (!e.value || e.value.trim() === "") && a.push({
|
|
2706
2708
|
severity: "error",
|
|
2707
2709
|
code: "E_XSD_REQUIRED_ATTR",
|
|
2708
|
-
message: `${
|
|
2710
|
+
message: `${i} must have a non-empty value`,
|
|
2709
2711
|
path: t,
|
|
2710
2712
|
facetType: n
|
|
2711
2713
|
});
|
|
2712
2714
|
}
|
|
2713
|
-
|
|
2714
|
-
const { document:
|
|
2715
|
-
if (!
|
|
2716
|
-
const n = t.xsdValidation === !1 ? [] : await
|
|
2715
|
+
ua = async function(e, t = {}) {
|
|
2716
|
+
const { document: i, issues: a } = ni(e);
|
|
2717
|
+
if (!i) return B(a);
|
|
2718
|
+
const n = t.xsdValidation === !1 ? [] : await Si(e), r = await qi(i, t);
|
|
2717
2719
|
return B([
|
|
2718
|
-
...
|
|
2720
|
+
...a,
|
|
2719
2721
|
...n,
|
|
2720
2722
|
...r.issues
|
|
2721
|
-
],
|
|
2723
|
+
], i);
|
|
2722
2724
|
};
|
|
2723
|
-
async function
|
|
2724
|
-
const
|
|
2725
|
-
return
|
|
2725
|
+
async function qi(e, t = {}) {
|
|
2726
|
+
const i = t.xsdValidation !== !1, a = t.ifcSchemaChecks !== !1, n = t.coherenceChecks !== !1, r = [];
|
|
2727
|
+
return i && r.push(...ki(e)), n && r.push(...Ft(e)), a && r.push(...await Bt(e, {
|
|
2726
2728
|
ifcVersion: t.ifcVersion
|
|
2727
2729
|
})), B(r, e);
|
|
2728
2730
|
}
|
|
2729
2731
|
function B(e, t) {
|
|
2730
|
-
let
|
|
2731
|
-
for (const
|
|
2732
|
-
if (
|
|
2733
|
-
|
|
2732
|
+
let i = "valid";
|
|
2733
|
+
for (const a of e){
|
|
2734
|
+
if (a.severity === "error") {
|
|
2735
|
+
i = "error";
|
|
2734
2736
|
break;
|
|
2735
2737
|
}
|
|
2736
|
-
(
|
|
2738
|
+
(a.severity === "warning" || a.severity === "info") && (i = "warning");
|
|
2737
2739
|
}
|
|
2738
2740
|
return {
|
|
2739
|
-
status:
|
|
2741
|
+
status: i,
|
|
2740
2742
|
issues: e,
|
|
2741
2743
|
parsedDocument: t
|
|
2742
2744
|
};
|
|
2743
2745
|
}
|
|
2744
|
-
const
|
|
2746
|
+
const Yi = {
|
|
2745
2747
|
status: {
|
|
2746
2748
|
pass: "PASS",
|
|
2747
2749
|
fail: "FAIL",
|
|
@@ -2926,7 +2928,7 @@ let __tla = Promise.all([
|
|
|
2926
2928
|
runValidation: "Run validation",
|
|
2927
2929
|
clearResults: "Clear results"
|
|
2928
2930
|
}
|
|
2929
|
-
},
|
|
2931
|
+
}, Hi = {
|
|
2930
2932
|
status: {
|
|
2931
2933
|
pass: "BESTANDEN",
|
|
2932
2934
|
fail: "FEHLGESCHLAGEN",
|
|
@@ -3111,7 +3113,7 @@ let __tla = Promise.all([
|
|
|
3111
3113
|
runValidation: "Validierung starten",
|
|
3112
3114
|
clearResults: "Ergebnisse löschen"
|
|
3113
3115
|
}
|
|
3114
|
-
},
|
|
3116
|
+
}, Gi = {
|
|
3115
3117
|
status: {
|
|
3116
3118
|
pass: "CONFORME",
|
|
3117
3119
|
fail: "NON CONFORME",
|
|
@@ -3296,180 +3298,180 @@ let __tla = Promise.all([
|
|
|
3296
3298
|
runValidation: "Lancer la validation",
|
|
3297
3299
|
clearResults: "Effacer les résultats"
|
|
3298
3300
|
}
|
|
3299
|
-
},
|
|
3300
|
-
en:
|
|
3301
|
-
de:
|
|
3302
|
-
fr:
|
|
3301
|
+
}, Q = {
|
|
3302
|
+
en: Yi,
|
|
3303
|
+
de: Hi,
|
|
3304
|
+
fr: Gi
|
|
3303
3305
|
};
|
|
3304
|
-
|
|
3306
|
+
ca = function(e = "en") {
|
|
3305
3307
|
return new Xi(e);
|
|
3306
3308
|
};
|
|
3307
3309
|
class Xi {
|
|
3308
3310
|
locale;
|
|
3309
3311
|
translations;
|
|
3310
3312
|
constructor(t){
|
|
3311
|
-
this.locale = t, this.translations =
|
|
3313
|
+
this.locale = t, this.translations = Q[t] || Q.en;
|
|
3312
3314
|
}
|
|
3313
|
-
t(t,
|
|
3314
|
-
const
|
|
3315
|
+
t(t, i) {
|
|
3316
|
+
const a = t.split(".");
|
|
3315
3317
|
let n = this.translations;
|
|
3316
|
-
for (const r of
|
|
3318
|
+
for (const r of a)if (n && typeof n == "object" && r in n) n = n[r];
|
|
3317
3319
|
else return t;
|
|
3318
|
-
return typeof n != "string" ? t :
|
|
3320
|
+
return typeof n != "string" ? t : i ? this.interpolate(n, i) : n;
|
|
3319
3321
|
}
|
|
3320
|
-
interpolate(t,
|
|
3321
|
-
return t.replace(/\{(\w+)\}/g, (
|
|
3322
|
+
interpolate(t, i) {
|
|
3323
|
+
return t.replace(/\{(\w+)\}/g, (a, n)=>n in i ? String(i[n]) : a);
|
|
3322
3324
|
}
|
|
3323
|
-
describeFacet(t,
|
|
3325
|
+
describeFacet(t, i) {
|
|
3324
3326
|
switch(this.translations, t.type){
|
|
3325
3327
|
case "entity":
|
|
3326
|
-
return this.describeEntityFacet(t,
|
|
3328
|
+
return this.describeEntityFacet(t, i);
|
|
3327
3329
|
case "attribute":
|
|
3328
|
-
return this.describeAttributeFacet(t,
|
|
3330
|
+
return this.describeAttributeFacet(t, i);
|
|
3329
3331
|
case "property":
|
|
3330
|
-
return this.describePropertyFacet(t,
|
|
3332
|
+
return this.describePropertyFacet(t, i);
|
|
3331
3333
|
case "classification":
|
|
3332
|
-
return this.describeClassificationFacet(t,
|
|
3334
|
+
return this.describeClassificationFacet(t, i);
|
|
3333
3335
|
case "material":
|
|
3334
|
-
return this.describeMaterialFacet(t,
|
|
3336
|
+
return this.describeMaterialFacet(t, i);
|
|
3335
3337
|
case "partOf":
|
|
3336
|
-
return this.describePartOfFacet(t,
|
|
3338
|
+
return this.describePartOfFacet(t, i);
|
|
3337
3339
|
default:
|
|
3338
3340
|
return "Unknown facet";
|
|
3339
3341
|
}
|
|
3340
3342
|
}
|
|
3341
|
-
describeEntityFacet(t,
|
|
3342
|
-
const
|
|
3343
|
-
return
|
|
3343
|
+
describeEntityFacet(t, i) {
|
|
3344
|
+
const a = this.translations, n = this.describeConstraint(t.name);
|
|
3345
|
+
return i === "applicability" ? t.predefinedType ? this.interpolate(a.applicability.entity.withPredefined, {
|
|
3344
3346
|
entityType: n,
|
|
3345
3347
|
predefinedType: this.describeConstraint(t.predefinedType)
|
|
3346
|
-
}) : this.interpolate(
|
|
3348
|
+
}) : this.interpolate(a.applicability.entity.simple, {
|
|
3347
3349
|
entityType: n
|
|
3348
|
-
}) : t.predefinedType ? this.interpolate(
|
|
3350
|
+
}) : t.predefinedType ? this.interpolate(a.requirements.entity.mustBeWithPredefined, {
|
|
3349
3351
|
entityType: n,
|
|
3350
3352
|
predefinedType: this.describeConstraint(t.predefinedType)
|
|
3351
|
-
}) : this.interpolate(
|
|
3353
|
+
}) : this.interpolate(a.requirements.entity.mustBe, {
|
|
3352
3354
|
entityType: n
|
|
3353
3355
|
});
|
|
3354
3356
|
}
|
|
3355
|
-
describeAttributeFacet(t,
|
|
3356
|
-
const
|
|
3357
|
-
return
|
|
3357
|
+
describeAttributeFacet(t, i) {
|
|
3358
|
+
const a = this.translations, n = this.describeConstraint(t.name);
|
|
3359
|
+
return i === "applicability" ? t.value ? t.value.type === "pattern" ? this.interpolate(a.applicability.attribute.pattern, {
|
|
3358
3360
|
name: n,
|
|
3359
3361
|
pattern: this.describeConstraint(t.value)
|
|
3360
|
-
}) : this.interpolate(
|
|
3362
|
+
}) : this.interpolate(a.applicability.attribute.equals, {
|
|
3361
3363
|
name: n,
|
|
3362
3364
|
value: this.describeConstraint(t.value)
|
|
3363
|
-
}) : this.interpolate(
|
|
3365
|
+
}) : this.interpolate(a.applicability.attribute.exists, {
|
|
3364
3366
|
name: n
|
|
3365
|
-
}) : t.value ? t.value.type === "pattern" ? this.interpolate(
|
|
3367
|
+
}) : t.value ? t.value.type === "pattern" ? this.interpolate(a.requirements.attribute.mustMatch, {
|
|
3366
3368
|
name: n,
|
|
3367
3369
|
pattern: this.describeConstraint(t.value)
|
|
3368
|
-
}) : this.interpolate(
|
|
3370
|
+
}) : this.interpolate(a.requirements.attribute.mustEqual, {
|
|
3369
3371
|
name: n,
|
|
3370
3372
|
value: this.describeConstraint(t.value)
|
|
3371
|
-
}) : this.interpolate(
|
|
3373
|
+
}) : this.interpolate(a.requirements.attribute.mustExist, {
|
|
3372
3374
|
name: n
|
|
3373
3375
|
});
|
|
3374
3376
|
}
|
|
3375
|
-
describePropertyFacet(t,
|
|
3376
|
-
const
|
|
3377
|
-
return
|
|
3377
|
+
describePropertyFacet(t, i) {
|
|
3378
|
+
const a = this.translations, n = this.describeConstraint(t.propertySet), r = this.describeConstraint(t.baseName);
|
|
3379
|
+
return i === "applicability" ? t.value ? t.value.type === "pattern" ? this.interpolate(a.applicability.property.pattern, {
|
|
3378
3380
|
pset: n,
|
|
3379
3381
|
property: r,
|
|
3380
3382
|
pattern: this.describeConstraint(t.value)
|
|
3381
|
-
}) : t.value.type === "bounds" ? this.interpolate(
|
|
3383
|
+
}) : t.value.type === "bounds" ? this.interpolate(a.applicability.property.bounded, {
|
|
3382
3384
|
pset: n,
|
|
3383
3385
|
property: r,
|
|
3384
3386
|
bounds: this.describeConstraint(t.value)
|
|
3385
|
-
}) : this.interpolate(
|
|
3387
|
+
}) : this.interpolate(a.applicability.property.equals, {
|
|
3386
3388
|
pset: n,
|
|
3387
3389
|
property: r,
|
|
3388
3390
|
value: this.describeConstraint(t.value)
|
|
3389
|
-
}) : this.interpolate(
|
|
3391
|
+
}) : this.interpolate(a.applicability.property.exists, {
|
|
3390
3392
|
pset: n,
|
|
3391
3393
|
property: r
|
|
3392
|
-
}) : t.value ? t.value.type === "pattern" ? this.interpolate(
|
|
3394
|
+
}) : t.value ? t.value.type === "pattern" ? this.interpolate(a.requirements.property.mustMatch, {
|
|
3393
3395
|
pset: n,
|
|
3394
3396
|
property: r,
|
|
3395
3397
|
pattern: this.describeConstraint(t.value)
|
|
3396
|
-
}) : t.value.type === "bounds" ? this.interpolate(
|
|
3398
|
+
}) : t.value.type === "bounds" ? this.interpolate(a.requirements.property.mustBeBounded, {
|
|
3397
3399
|
pset: n,
|
|
3398
3400
|
property: r,
|
|
3399
3401
|
bounds: this.describeConstraint(t.value)
|
|
3400
|
-
}) : this.interpolate(
|
|
3402
|
+
}) : this.interpolate(a.requirements.property.mustEqual, {
|
|
3401
3403
|
pset: n,
|
|
3402
3404
|
property: r,
|
|
3403
3405
|
value: this.describeConstraint(t.value)
|
|
3404
|
-
}) : this.interpolate(
|
|
3406
|
+
}) : this.interpolate(a.requirements.property.mustExist, {
|
|
3405
3407
|
pset: n,
|
|
3406
3408
|
property: r
|
|
3407
3409
|
});
|
|
3408
3410
|
}
|
|
3409
|
-
describeClassificationFacet(t,
|
|
3410
|
-
const
|
|
3411
|
-
return
|
|
3411
|
+
describeClassificationFacet(t, i) {
|
|
3412
|
+
const a = this.translations;
|
|
3413
|
+
return i === "applicability" ? t.system && t.value ? this.interpolate(a.applicability.classification.systemAndValue, {
|
|
3412
3414
|
system: this.describeConstraint(t.system),
|
|
3413
3415
|
value: this.describeConstraint(t.value)
|
|
3414
|
-
}) : t.system ? this.interpolate(
|
|
3416
|
+
}) : t.system ? this.interpolate(a.applicability.classification.system, {
|
|
3415
3417
|
system: this.describeConstraint(t.system)
|
|
3416
|
-
}) : t.value ? this.interpolate(
|
|
3418
|
+
}) : t.value ? this.interpolate(a.applicability.classification.value, {
|
|
3417
3419
|
value: this.describeConstraint(t.value)
|
|
3418
|
-
}) :
|
|
3420
|
+
}) : a.applicability.classification.any : t.system && t.value ? this.interpolate(a.requirements.classification.mustBeInSystemWithValue, {
|
|
3419
3421
|
system: this.describeConstraint(t.system),
|
|
3420
3422
|
value: this.describeConstraint(t.value)
|
|
3421
|
-
}) : t.system ? this.interpolate(
|
|
3423
|
+
}) : t.system ? this.interpolate(a.requirements.classification.mustBeInSystem, {
|
|
3422
3424
|
system: this.describeConstraint(t.system)
|
|
3423
|
-
}) : t.value ? this.interpolate(
|
|
3425
|
+
}) : t.value ? this.interpolate(a.requirements.classification.mustHaveValue, {
|
|
3424
3426
|
value: this.describeConstraint(t.value)
|
|
3425
|
-
}) :
|
|
3427
|
+
}) : a.requirements.classification.mustHave;
|
|
3426
3428
|
}
|
|
3427
|
-
describeMaterialFacet(t,
|
|
3428
|
-
const
|
|
3429
|
-
return
|
|
3429
|
+
describeMaterialFacet(t, i) {
|
|
3430
|
+
const a = this.translations;
|
|
3431
|
+
return i === "applicability" ? t.value ? t.value.type === "pattern" ? this.interpolate(a.applicability.material.pattern, {
|
|
3430
3432
|
pattern: this.describeConstraint(t.value)
|
|
3431
|
-
}) : this.interpolate(
|
|
3433
|
+
}) : this.interpolate(a.applicability.material.value, {
|
|
3432
3434
|
value: this.describeConstraint(t.value)
|
|
3433
|
-
}) :
|
|
3435
|
+
}) : a.applicability.material.any : t.value ? t.value.type === "pattern" ? this.interpolate(a.requirements.material.mustMatch, {
|
|
3434
3436
|
pattern: this.describeConstraint(t.value)
|
|
3435
|
-
}) : this.interpolate(
|
|
3437
|
+
}) : this.interpolate(a.requirements.material.mustBe, {
|
|
3436
3438
|
value: this.describeConstraint(t.value)
|
|
3437
|
-
}) :
|
|
3439
|
+
}) : a.requirements.material.mustHave;
|
|
3438
3440
|
}
|
|
3439
|
-
describePartOfFacet(t,
|
|
3440
|
-
const
|
|
3441
|
-
return
|
|
3441
|
+
describePartOfFacet(t, i) {
|
|
3442
|
+
const a = this.translations, n = this.getRelationDescription(t.relation);
|
|
3443
|
+
return i === "applicability" ? t.entity ? t.entity.predefinedType ? this.interpolate(a.applicability.partOf.withEntityAndType, {
|
|
3442
3444
|
relation: n,
|
|
3443
3445
|
entity: this.describeConstraint(t.entity.name),
|
|
3444
3446
|
predefinedType: this.describeConstraint(t.entity.predefinedType)
|
|
3445
|
-
}) : this.interpolate(
|
|
3447
|
+
}) : this.interpolate(a.applicability.partOf.withEntity, {
|
|
3446
3448
|
relation: n,
|
|
3447
3449
|
entity: this.describeConstraint(t.entity.name)
|
|
3448
|
-
}) : this.interpolate(
|
|
3450
|
+
}) : this.interpolate(a.applicability.partOf.simple, {
|
|
3449
3451
|
relation: n
|
|
3450
|
-
}) : t.entity ? this.interpolate(
|
|
3452
|
+
}) : t.entity ? this.interpolate(a.requirements.partOf.mustBe, {
|
|
3451
3453
|
relation: n,
|
|
3452
3454
|
entity: this.describeConstraint(t.entity.name)
|
|
3453
|
-
}) : this.interpolate(
|
|
3455
|
+
}) : this.interpolate(a.requirements.partOf.mustBeSimple, {
|
|
3454
3456
|
relation: n
|
|
3455
3457
|
});
|
|
3456
3458
|
}
|
|
3457
3459
|
describeConstraint(t) {
|
|
3458
|
-
const
|
|
3460
|
+
const i = this.translations;
|
|
3459
3461
|
switch(t.type){
|
|
3460
3462
|
case "simpleValue":
|
|
3461
|
-
return this.interpolate(
|
|
3463
|
+
return this.interpolate(i.constraints.simpleValue, {
|
|
3462
3464
|
value: t.value
|
|
3463
3465
|
});
|
|
3464
3466
|
case "pattern":
|
|
3465
|
-
return this.interpolate(
|
|
3467
|
+
return this.interpolate(i.constraints.pattern, {
|
|
3466
3468
|
pattern: t.pattern
|
|
3467
3469
|
});
|
|
3468
3470
|
case "enumeration":
|
|
3469
|
-
return t.values.length === 1 ? this.interpolate(
|
|
3471
|
+
return t.values.length === 1 ? this.interpolate(i.constraints.enumeration.single, {
|
|
3470
3472
|
value: t.values[0]
|
|
3471
|
-
}) : this.interpolate(
|
|
3472
|
-
values: t.values.map((
|
|
3473
|
+
}) : this.interpolate(i.constraints.enumeration.multiple, {
|
|
3474
|
+
values: t.values.map((a)=>`"${a}"`).join(", ")
|
|
3473
3475
|
});
|
|
3474
3476
|
case "bounds":
|
|
3475
3477
|
return this.describeBounds(t);
|
|
@@ -3478,129 +3480,129 @@ let __tla = Promise.all([
|
|
|
3478
3480
|
}
|
|
3479
3481
|
}
|
|
3480
3482
|
describeBounds(t) {
|
|
3481
|
-
const
|
|
3482
|
-
return t.minInclusive !== void 0 && t.maxInclusive !== void 0 ? this.interpolate(
|
|
3483
|
+
const i = this.translations.constraints.bounds;
|
|
3484
|
+
return t.minInclusive !== void 0 && t.maxInclusive !== void 0 ? this.interpolate(i.between, {
|
|
3483
3485
|
min: t.minInclusive,
|
|
3484
3486
|
max: t.maxInclusive
|
|
3485
|
-
}) : t.minInclusive !== void 0 ? this.interpolate(
|
|
3487
|
+
}) : t.minInclusive !== void 0 ? this.interpolate(i.atLeast, {
|
|
3486
3488
|
min: t.minInclusive
|
|
3487
|
-
}) : t.maxInclusive !== void 0 ? this.interpolate(
|
|
3489
|
+
}) : t.maxInclusive !== void 0 ? this.interpolate(i.atMost, {
|
|
3488
3490
|
max: t.maxInclusive
|
|
3489
|
-
}) : t.minExclusive !== void 0 ? this.interpolate(
|
|
3491
|
+
}) : t.minExclusive !== void 0 ? this.interpolate(i.greaterThan, {
|
|
3490
3492
|
min: t.minExclusive
|
|
3491
|
-
}) : t.maxExclusive !== void 0 ? this.interpolate(
|
|
3493
|
+
}) : t.maxExclusive !== void 0 ? this.interpolate(i.lessThan, {
|
|
3492
3494
|
max: t.maxExclusive
|
|
3493
3495
|
}) : "any value";
|
|
3494
3496
|
}
|
|
3495
3497
|
describeFailure(t) {
|
|
3496
|
-
const
|
|
3497
|
-
if (!t.failure) return t.actualValue && t.expectedValue ? `${t.actualValue} ≠ ${t.expectedValue}` :
|
|
3498
|
-
const { type:
|
|
3499
|
-
switch(
|
|
3498
|
+
const i = this.translations.failures;
|
|
3499
|
+
if (!t.failure) return t.actualValue && t.expectedValue ? `${t.actualValue} ≠ ${t.expectedValue}` : i.unknown.replace("{reason}", "no details");
|
|
3500
|
+
const { type: a, field: n, actual: r, expected: s, context: l } = t.failure;
|
|
3501
|
+
switch(a){
|
|
3500
3502
|
case "ENTITY_TYPE_MISMATCH":
|
|
3501
|
-
return this.interpolate(
|
|
3503
|
+
return this.interpolate(i.entityTypeMismatch, {
|
|
3502
3504
|
actual: r || "?",
|
|
3503
3505
|
expected: s || "?"
|
|
3504
3506
|
});
|
|
3505
3507
|
case "PREDEFINED_TYPE_MISMATCH":
|
|
3506
|
-
return this.interpolate(
|
|
3508
|
+
return this.interpolate(i.predefinedTypeMismatch, {
|
|
3507
3509
|
actual: r || "?",
|
|
3508
3510
|
expected: s || "?"
|
|
3509
3511
|
});
|
|
3510
3512
|
case "PREDEFINED_TYPE_MISSING":
|
|
3511
|
-
return this.interpolate(
|
|
3513
|
+
return this.interpolate(i.predefinedTypeMissing, {
|
|
3512
3514
|
expected: s || "?"
|
|
3513
3515
|
});
|
|
3514
3516
|
case "ATTRIBUTE_MISSING":
|
|
3515
|
-
return this.interpolate(
|
|
3517
|
+
return this.interpolate(i.attributeMissing, {
|
|
3516
3518
|
name: n || "?"
|
|
3517
3519
|
});
|
|
3518
3520
|
case "ATTRIBUTE_VALUE_MISMATCH":
|
|
3519
|
-
return this.interpolate(
|
|
3521
|
+
return this.interpolate(i.attributeValueMismatch, {
|
|
3520
3522
|
name: n || "?",
|
|
3521
3523
|
actual: r || "?",
|
|
3522
3524
|
expected: s || "?"
|
|
3523
3525
|
});
|
|
3524
3526
|
case "ATTRIBUTE_PATTERN_MISMATCH":
|
|
3525
|
-
return this.interpolate(
|
|
3527
|
+
return this.interpolate(i.attributePatternMismatch, {
|
|
3526
3528
|
name: n || "?",
|
|
3527
3529
|
actual: r || "?",
|
|
3528
3530
|
expected: s || "?"
|
|
3529
3531
|
});
|
|
3530
3532
|
case "PSET_MISSING":
|
|
3531
|
-
return l?.availablePsets ? this.interpolate(
|
|
3533
|
+
return l?.availablePsets ? this.interpolate(i.psetMissingAvailable, {
|
|
3532
3534
|
pset: n || s || "?",
|
|
3533
3535
|
available: l.availablePsets
|
|
3534
|
-
}) : this.interpolate(
|
|
3536
|
+
}) : this.interpolate(i.psetMissing, {
|
|
3535
3537
|
pset: n || s || "?"
|
|
3536
3538
|
});
|
|
3537
3539
|
case "PROPERTY_MISSING":
|
|
3538
|
-
return l?.availableProperties ? this.interpolate(
|
|
3540
|
+
return l?.availableProperties ? this.interpolate(i.propertyMissingAvailable, {
|
|
3539
3541
|
property: n || "?",
|
|
3540
3542
|
pset: l.propertySet || "?",
|
|
3541
3543
|
available: l.availableProperties
|
|
3542
|
-
}) : this.interpolate(
|
|
3544
|
+
}) : this.interpolate(i.propertyMissing, {
|
|
3543
3545
|
property: n || "?",
|
|
3544
3546
|
pset: l?.propertySet || "?"
|
|
3545
3547
|
});
|
|
3546
3548
|
case "PROPERTY_VALUE_MISMATCH":
|
|
3547
|
-
return this.interpolate(
|
|
3549
|
+
return this.interpolate(i.propertyValueMismatch, {
|
|
3548
3550
|
pset: this.extractPsetFromField(n),
|
|
3549
3551
|
property: this.extractPropertyFromField(n),
|
|
3550
3552
|
actual: r || "?",
|
|
3551
3553
|
expected: s || "?"
|
|
3552
3554
|
});
|
|
3553
3555
|
case "PROPERTY_DATATYPE_MISMATCH":
|
|
3554
|
-
return this.interpolate(
|
|
3556
|
+
return this.interpolate(i.propertyDatatypeMismatch, {
|
|
3555
3557
|
pset: this.extractPsetFromField(n),
|
|
3556
3558
|
property: this.extractPropertyFromField(n),
|
|
3557
3559
|
actual: r || "?",
|
|
3558
3560
|
expected: s || "?"
|
|
3559
3561
|
});
|
|
3560
3562
|
case "PROPERTY_OUT_OF_BOUNDS":
|
|
3561
|
-
return this.interpolate(
|
|
3563
|
+
return this.interpolate(i.propertyOutOfBounds, {
|
|
3562
3564
|
pset: this.extractPsetFromField(n),
|
|
3563
3565
|
property: this.extractPropertyFromField(n),
|
|
3564
3566
|
actual: r || "?",
|
|
3565
3567
|
expected: s || "?"
|
|
3566
3568
|
});
|
|
3567
3569
|
case "CLASSIFICATION_MISSING":
|
|
3568
|
-
return
|
|
3570
|
+
return i.classificationMissing;
|
|
3569
3571
|
case "CLASSIFICATION_SYSTEM_MISMATCH":
|
|
3570
|
-
return l?.availableSystems ? this.interpolate(
|
|
3572
|
+
return l?.availableSystems ? this.interpolate(i.classificationSystemMissingAvailable, {
|
|
3571
3573
|
expected: s || "?",
|
|
3572
3574
|
available: l.availableSystems
|
|
3573
|
-
}) : this.interpolate(
|
|
3575
|
+
}) : this.interpolate(i.classificationSystemMismatch, {
|
|
3574
3576
|
actual: r || "?",
|
|
3575
3577
|
expected: s || "?"
|
|
3576
3578
|
});
|
|
3577
3579
|
case "CLASSIFICATION_VALUE_MISMATCH":
|
|
3578
|
-
return l?.availableValues ? this.interpolate(
|
|
3580
|
+
return l?.availableValues ? this.interpolate(i.classificationValueMissingAvailable, {
|
|
3579
3581
|
expected: s || "?",
|
|
3580
3582
|
available: l.availableValues
|
|
3581
|
-
}) : this.interpolate(
|
|
3583
|
+
}) : this.interpolate(i.classificationValueMismatch, {
|
|
3582
3584
|
actual: r || "?",
|
|
3583
3585
|
expected: s || "?"
|
|
3584
3586
|
});
|
|
3585
3587
|
case "MATERIAL_MISSING":
|
|
3586
|
-
return
|
|
3588
|
+
return i.materialMissing;
|
|
3587
3589
|
case "MATERIAL_VALUE_MISMATCH":
|
|
3588
|
-
return l?.availableMaterials ? this.interpolate(
|
|
3590
|
+
return l?.availableMaterials ? this.interpolate(i.materialValueMissingAvailable, {
|
|
3589
3591
|
expected: s || "?",
|
|
3590
3592
|
available: l.availableMaterials
|
|
3591
|
-
}) : this.interpolate(
|
|
3593
|
+
}) : this.interpolate(i.materialValueMismatch, {
|
|
3592
3594
|
actual: r || "?",
|
|
3593
3595
|
expected: s || "?"
|
|
3594
3596
|
});
|
|
3595
3597
|
case "PARTOF_RELATION_MISSING":
|
|
3596
|
-
return l?.entity ? this.interpolate(
|
|
3598
|
+
return l?.entity ? this.interpolate(i.partOfMissing, {
|
|
3597
3599
|
relation: this.getRelationDescription(n || "IfcRelContainedInSpatialStructure"),
|
|
3598
3600
|
entity: l.entity
|
|
3599
|
-
}) : this.interpolate(
|
|
3601
|
+
}) : this.interpolate(i.partOfMissingSimple, {
|
|
3600
3602
|
relation: this.getRelationDescription(n || "IfcRelContainedInSpatialStructure")
|
|
3601
3603
|
});
|
|
3602
3604
|
case "PARTOF_ENTITY_MISMATCH":
|
|
3603
|
-
return this.interpolate(
|
|
3605
|
+
return this.interpolate(i.partOfEntityMismatch, {
|
|
3604
3606
|
actual: r || "?",
|
|
3605
3607
|
expected: s || "?"
|
|
3606
3608
|
});
|
|
@@ -3608,29 +3610,29 @@ let __tla = Promise.all([
|
|
|
3608
3610
|
case "PROHIBITED_PROPERTY_EXISTS":
|
|
3609
3611
|
case "PROHIBITED_CLASSIFICATION_EXISTS":
|
|
3610
3612
|
case "PROHIBITED_MATERIAL_EXISTS":
|
|
3611
|
-
return this.interpolate(
|
|
3613
|
+
return this.interpolate(i.prohibited, {
|
|
3612
3614
|
field: n || "value",
|
|
3613
3615
|
actual: r || "?"
|
|
3614
3616
|
});
|
|
3615
3617
|
default:
|
|
3616
|
-
return this.interpolate(
|
|
3617
|
-
reason:
|
|
3618
|
+
return this.interpolate(i.unknown, {
|
|
3619
|
+
reason: a
|
|
3618
3620
|
});
|
|
3619
3621
|
}
|
|
3620
3622
|
}
|
|
3621
3623
|
extractPsetFromField(t) {
|
|
3622
3624
|
if (!t) return "?";
|
|
3623
|
-
const
|
|
3624
|
-
return
|
|
3625
|
+
const i = t.split(".");
|
|
3626
|
+
return i.length > 1 ? i[0] : "?";
|
|
3625
3627
|
}
|
|
3626
3628
|
extractPropertyFromField(t) {
|
|
3627
3629
|
if (!t) return "?";
|
|
3628
|
-
const
|
|
3629
|
-
return
|
|
3630
|
+
const i = t.split(".");
|
|
3631
|
+
return i.length > 1 ? i.slice(1).join(".") : t;
|
|
3630
3632
|
}
|
|
3631
3633
|
describeRequirement(t) {
|
|
3632
|
-
let
|
|
3633
|
-
return t.optionality === "prohibited" ?
|
|
3634
|
+
let i = this.describeFacet(t.facet, "requirement");
|
|
3635
|
+
return t.optionality === "prohibited" ? i = this.applyProhibited(i) : t.optionality === "optional" && (i = this.applyOptional(i)), i;
|
|
3634
3636
|
}
|
|
3635
3637
|
applyProhibited(t) {
|
|
3636
3638
|
return t.replace(/^Must be/i, "Must NOT be").replace(/^Must have/i, "Must NOT have").replace(/^Muss/i, "Darf nicht").replace(/^Doit être/i, "Ne doit pas être").replace(/^Doit avoir/i, "Ne doit pas avoir");
|
|
@@ -3648,61 +3650,61 @@ let __tla = Promise.all([
|
|
|
3648
3650
|
return this.translations.relations[t] || t.replace("IfcRel", "").toLowerCase();
|
|
3649
3651
|
}
|
|
3650
3652
|
}
|
|
3651
|
-
function
|
|
3653
|
+
function ji(e) {
|
|
3652
3654
|
if (!e) return [];
|
|
3653
|
-
const t = [],
|
|
3654
|
-
|
|
3655
|
-
name:
|
|
3655
|
+
const t = [], i = (a, n)=>{
|
|
3656
|
+
a && t.push({
|
|
3657
|
+
name: a,
|
|
3656
3658
|
category: n
|
|
3657
3659
|
});
|
|
3658
3660
|
};
|
|
3659
3661
|
switch(e.type){
|
|
3660
3662
|
case "Material":
|
|
3661
|
-
|
|
3663
|
+
i(e.name, e.category), e.category && i(e.category, e.category);
|
|
3662
3664
|
break;
|
|
3663
3665
|
case "MaterialList":
|
|
3664
|
-
for (const
|
|
3666
|
+
for (const a of e.materials || [])typeof a == "string" ? i(a) : a && typeof a == "object" && (i(a.name, a.category), a.category && i(a.category, a.category));
|
|
3665
3667
|
break;
|
|
3666
3668
|
case "MaterialLayerSet":
|
|
3667
|
-
|
|
3668
|
-
for (const
|
|
3669
|
+
i(e.name);
|
|
3670
|
+
for (const a of e.layers || [])i(a.materialName, a.category), i(a.name, a.category), a.materialCategory && i(a.materialCategory, a.materialCategory);
|
|
3669
3671
|
break;
|
|
3670
3672
|
case "MaterialConstituentSet":
|
|
3671
|
-
|
|
3672
|
-
for (const
|
|
3673
|
+
i(e.name);
|
|
3674
|
+
for (const a of e.constituents || [])i(a.materialName, a.category), i(a.name, a.category), a.materialCategory && i(a.materialCategory, a.materialCategory);
|
|
3673
3675
|
break;
|
|
3674
3676
|
case "MaterialProfileSet":
|
|
3675
|
-
|
|
3676
|
-
for (const
|
|
3677
|
+
i(e.name);
|
|
3678
|
+
for (const a of e.profiles || [])i(a.materialName, a.category), i(a.name, a.category), a.materialCategory && i(a.materialCategory, a.materialCategory);
|
|
3677
3679
|
break;
|
|
3678
3680
|
}
|
|
3679
3681
|
return t;
|
|
3680
3682
|
}
|
|
3681
|
-
function
|
|
3682
|
-
const
|
|
3683
|
-
...
|
|
3683
|
+
function Wi(e, t) {
|
|
3684
|
+
const i = [
|
|
3685
|
+
...Se(e, t) || []
|
|
3684
3686
|
];
|
|
3685
|
-
|
|
3686
|
-
const
|
|
3687
|
-
for (const n of
|
|
3687
|
+
zi(e, t, i);
|
|
3688
|
+
const a = [];
|
|
3689
|
+
for (const n of i){
|
|
3688
3690
|
const r = n.system || "", s = n.identification || n.name || "";
|
|
3689
|
-
if (
|
|
3691
|
+
if (a.push({
|
|
3690
3692
|
system: r,
|
|
3691
3693
|
value: s,
|
|
3692
3694
|
name: n.name
|
|
3693
|
-
}), Array.isArray(n.path)) for (const l of n.path)l && l !== s &&
|
|
3695
|
+
}), Array.isArray(n.path)) for (const l of n.path)l && l !== s && a.push({
|
|
3694
3696
|
system: r,
|
|
3695
3697
|
value: l,
|
|
3696
3698
|
name: n.name
|
|
3697
3699
|
});
|
|
3698
3700
|
}
|
|
3699
|
-
return
|
|
3701
|
+
return a;
|
|
3700
3702
|
}
|
|
3701
|
-
function
|
|
3702
|
-
const
|
|
3703
|
-
if (
|
|
3704
|
-
const n = new
|
|
3705
|
-
for (const r of
|
|
3703
|
+
function zi(e, t, i) {
|
|
3704
|
+
const a = e.entityIndex?.byType?.get?.("IFCEXTERNALREFERENCERELATIONSHIP") || [];
|
|
3705
|
+
if (a.length === 0 || !e.source?.length) return;
|
|
3706
|
+
const n = new Ae(e.source);
|
|
3707
|
+
for (const r of a){
|
|
3706
3708
|
const s = e.entityIndex.byId.get(r);
|
|
3707
3709
|
if (!s) continue;
|
|
3708
3710
|
const l = n.extractEntity(s);
|
|
@@ -3711,9 +3713,9 @@ let __tla = Promise.all([
|
|
|
3711
3713
|
if (typeof o != "number" || !Array.isArray(u) || !u.includes(t)) continue;
|
|
3712
3714
|
const c = e.entityIndex.byId.get(o);
|
|
3713
3715
|
if (!c) continue;
|
|
3714
|
-
const
|
|
3715
|
-
if (!
|
|
3716
|
-
const d =
|
|
3716
|
+
const m = n.extractEntity(c);
|
|
3717
|
+
if (!m || m.type.toUpperCase() !== "IFCCLASSIFICATIONREFERENCE") continue;
|
|
3718
|
+
const d = m.attributes || [], f = {
|
|
3717
3719
|
identification: typeof d[1] == "string" ? d[1] : void 0,
|
|
3718
3720
|
name: typeof d[2] == "string" ? d[2] : void 0,
|
|
3719
3721
|
path: []
|
|
@@ -3728,20 +3730,20 @@ let __tla = Promise.all([
|
|
|
3728
3730
|
if (!_) break;
|
|
3729
3731
|
const I = _.type.toUpperCase(), b = _.attributes || [];
|
|
3730
3732
|
if (I === "IFCCLASSIFICATION") {
|
|
3731
|
-
|
|
3733
|
+
f.system = typeof b[3] == "string" ? b[3] : void 0;
|
|
3732
3734
|
break;
|
|
3733
3735
|
}
|
|
3734
3736
|
if (I === "IFCCLASSIFICATIONREFERENCE") {
|
|
3735
3737
|
const P = typeof b[1] == "string" ? b[1] : typeof b[2] == "string" ? b[2] : void 0;
|
|
3736
|
-
P &&
|
|
3738
|
+
P && f.path.unshift(P), y = typeof b[3] == "number" ? b[3] : void 0;
|
|
3737
3739
|
continue;
|
|
3738
3740
|
}
|
|
3739
3741
|
break;
|
|
3740
3742
|
}
|
|
3741
|
-
|
|
3743
|
+
i.push(f);
|
|
3742
3744
|
}
|
|
3743
3745
|
}
|
|
3744
|
-
function
|
|
3746
|
+
function fe(e) {
|
|
3745
3747
|
if (typeof e == "string") return e.startsWith("IFC") || e.startsWith("Ifc") ? e.toUpperCase() : "IFCLABEL";
|
|
3746
3748
|
switch(e){
|
|
3747
3749
|
case 0:
|
|
@@ -3770,7 +3772,7 @@ let __tla = Promise.all([
|
|
|
3770
3772
|
return "IFCLABEL";
|
|
3771
3773
|
}
|
|
3772
3774
|
}
|
|
3773
|
-
function
|
|
3775
|
+
function Ki(e) {
|
|
3774
3776
|
switch(e){
|
|
3775
3777
|
case 0:
|
|
3776
3778
|
return "IFCLENGTHMEASURE";
|
|
@@ -3788,27 +3790,27 @@ let __tla = Promise.all([
|
|
|
3788
3790
|
return "IFCLABEL";
|
|
3789
3791
|
}
|
|
3790
3792
|
}
|
|
3791
|
-
function
|
|
3792
|
-
if (!
|
|
3793
|
+
function Qi(e, t, i, a) {
|
|
3794
|
+
if (!a || a === 1) return {
|
|
3793
3795
|
value: e,
|
|
3794
3796
|
values: t
|
|
3795
3797
|
};
|
|
3796
|
-
const n =
|
|
3798
|
+
const n = i ? i.toUpperCase() : "", r = n === "IFCLENGTHMEASURE" || n === "IFCPOSITIVELENGTHMEASURE", s = !i && Array.isArray(t) && t.length > 0;
|
|
3797
3799
|
if (!r && !s) return {
|
|
3798
3800
|
value: e,
|
|
3799
3801
|
values: t
|
|
3800
3802
|
};
|
|
3801
3803
|
const l = (u)=>{
|
|
3802
3804
|
const c = typeof u == "number" ? u : parseFloat(String(u));
|
|
3803
|
-
return Number.isFinite(c) ? c *
|
|
3805
|
+
return Number.isFinite(c) ? c * a : null;
|
|
3804
3806
|
};
|
|
3805
3807
|
if (r) {
|
|
3806
3808
|
const u = (()=>{
|
|
3807
|
-
const
|
|
3808
|
-
return
|
|
3809
|
-
})(), c = Array.isArray(t) ? t.map((
|
|
3810
|
-
const d = l(
|
|
3811
|
-
return d == null ? String(
|
|
3809
|
+
const m = l(e);
|
|
3810
|
+
return m ?? e;
|
|
3811
|
+
})(), c = Array.isArray(t) ? t.map((m)=>{
|
|
3812
|
+
const d = l(m);
|
|
3813
|
+
return d == null ? String(m) : String(d);
|
|
3812
3814
|
}) : t;
|
|
3813
3815
|
return {
|
|
3814
3816
|
value: u,
|
|
@@ -3826,84 +3828,84 @@ let __tla = Promise.all([
|
|
|
3826
3828
|
values: o
|
|
3827
3829
|
};
|
|
3828
3830
|
}
|
|
3829
|
-
function
|
|
3830
|
-
const
|
|
3831
|
-
return
|
|
3831
|
+
function J(e, t) {
|
|
3832
|
+
const i = [], a = e.lengthUnitScale;
|
|
3833
|
+
return Ji(e, t, a, i), Zi(e, t, i), ea(e, t, i), ta(e, t, a, i), i.length === 0 && ia(e, t, i), i;
|
|
3832
3834
|
}
|
|
3833
|
-
function
|
|
3835
|
+
function Ji(e, t, i, a) {
|
|
3834
3836
|
let n = e.properties?.getForEntity?.(t);
|
|
3835
|
-
if ((!n || n.length === 0) && (n =
|
|
3837
|
+
if ((!n || n.length === 0) && (n = xe(e, t)), !(!n || n.length === 0)) for (const r of n)a.push({
|
|
3836
3838
|
name: r.name,
|
|
3837
|
-
properties: (r.properties || []).map((s)=>
|
|
3839
|
+
properties: (r.properties || []).map((s)=>ye(s, i))
|
|
3838
3840
|
});
|
|
3839
3841
|
}
|
|
3840
|
-
function
|
|
3841
|
-
let
|
|
3842
|
-
if ((!
|
|
3842
|
+
function Zi(e, t, i) {
|
|
3843
|
+
let a = e.quantities?.getForEntity?.(t);
|
|
3844
|
+
if ((!a || a.length === 0) && (a = Ce(e, t)), !(!a || a.length === 0)) for (const n of a)i.push({
|
|
3843
3845
|
name: n.name,
|
|
3844
3846
|
properties: (n.quantities || []).map((r)=>({
|
|
3845
3847
|
name: r.name,
|
|
3846
3848
|
value: r.value,
|
|
3847
|
-
dataType:
|
|
3849
|
+
dataType: Ki(r.type)
|
|
3848
3850
|
}))
|
|
3849
3851
|
});
|
|
3850
3852
|
}
|
|
3851
|
-
function
|
|
3852
|
-
const
|
|
3853
|
-
for (const n of
|
|
3853
|
+
function ea(e, t, i) {
|
|
3854
|
+
const a = e.relationships?.getRelated?.(t, A.DefinesByProperties, "inverse") || [];
|
|
3855
|
+
for (const n of a){
|
|
3854
3856
|
const r = e.entityIndex?.byId?.get?.(n);
|
|
3855
3857
|
if (!r) continue;
|
|
3856
3858
|
const s = String(r.type).toUpperCase();
|
|
3857
3859
|
if (s === "IFCPROPERTYSET" || s === "IFCELEMENTQUANTITY" || !s.endsWith("PROPERTIES")) continue;
|
|
3858
3860
|
const l = N(e, n), o = l.find((c)=>c.name === "Name")?.value;
|
|
3859
|
-
if (typeof o != "string" || !o ||
|
|
3861
|
+
if (typeof o != "string" || !o || i.some((c)=>c.name === o)) continue;
|
|
3860
3862
|
const u = l.filter((c)=>c.name !== "GlobalId" && c.name !== "Name" && c.name !== "Description" && c.value !== void 0 && c.value !== "").map((c)=>({
|
|
3861
3863
|
name: c.name,
|
|
3862
3864
|
value: c.value,
|
|
3863
3865
|
dataType: ""
|
|
3864
3866
|
}));
|
|
3865
|
-
u.length > 0 &&
|
|
3867
|
+
u.length > 0 && i.push({
|
|
3866
3868
|
name: o,
|
|
3867
3869
|
properties: u
|
|
3868
3870
|
});
|
|
3869
3871
|
}
|
|
3870
3872
|
}
|
|
3871
|
-
function
|
|
3872
|
-
const n =
|
|
3873
|
+
function ta(e, t, i, a) {
|
|
3874
|
+
const n = Re(e, t);
|
|
3873
3875
|
if (!n || !n.properties || n.properties.length === 0) return;
|
|
3874
|
-
const r = new Set(
|
|
3875
|
-
for (const s of n.properties)r.has(s.name) ||
|
|
3876
|
+
const r = new Set(a.map((s)=>s.name));
|
|
3877
|
+
for (const s of n.properties)r.has(s.name) || a.push({
|
|
3876
3878
|
name: s.name,
|
|
3877
|
-
properties: (s.properties || []).map((l)=>
|
|
3879
|
+
properties: (s.properties || []).map((l)=>ye(l, i))
|
|
3878
3880
|
});
|
|
3879
3881
|
}
|
|
3880
|
-
function
|
|
3881
|
-
const
|
|
3882
|
-
if (
|
|
3882
|
+
function ia(e, t, i) {
|
|
3883
|
+
const a = Me(e, t);
|
|
3884
|
+
if (a.length !== 0) for (const n of a)i.push({
|
|
3883
3885
|
name: n.name,
|
|
3884
3886
|
properties: (n.properties || []).map((r)=>({
|
|
3885
3887
|
name: r.name,
|
|
3886
3888
|
value: Array.isArray(r.value) ? JSON.stringify(r.value) : r.value,
|
|
3887
|
-
dataType:
|
|
3889
|
+
dataType: fe(r.type),
|
|
3888
3890
|
...Array.isArray(r.values) && r.values.length > 0 ? {
|
|
3889
3891
|
values: r.values
|
|
3890
3892
|
} : {}
|
|
3891
3893
|
}))
|
|
3892
3894
|
});
|
|
3893
3895
|
}
|
|
3894
|
-
function
|
|
3895
|
-
const
|
|
3896
|
+
function ye(e, t) {
|
|
3897
|
+
const i = Array.isArray(e.values) && e.values.length > 0, a = e.dataType ?? (i ? void 0 : fe(e.type)), n = Array.isArray(e.value) ? JSON.stringify(e.value) : e.value, r = i ? e.values : void 0, s = Qi(n, r, a, t);
|
|
3896
3898
|
return {
|
|
3897
3899
|
name: e.name,
|
|
3898
3900
|
value: s.value,
|
|
3899
|
-
dataType:
|
|
3901
|
+
dataType: a ?? "",
|
|
3900
3902
|
...s.values ? {
|
|
3901
3903
|
values: s.values
|
|
3902
3904
|
} : {}
|
|
3903
3905
|
};
|
|
3904
3906
|
}
|
|
3905
|
-
function
|
|
3906
|
-
const
|
|
3907
|
+
function aa(e, t) {
|
|
3908
|
+
const a = N(e, t).find((s)=>s.name === "PredefinedType"), n = typeof a?.value == "string" && a.value ? a.value : void 0;
|
|
3907
3909
|
if (n && n !== "NOTDEFINED") return n;
|
|
3908
3910
|
const r = e.relationships?.getRelated?.(t, A.DefinesByType, "inverse") || [];
|
|
3909
3911
|
for (const s of r){
|
|
@@ -3912,22 +3914,22 @@ let __tla = Promise.all([
|
|
|
3912
3914
|
}
|
|
3913
3915
|
return n;
|
|
3914
3916
|
}
|
|
3915
|
-
function
|
|
3916
|
-
const
|
|
3917
|
+
function na(e, t, i) {
|
|
3918
|
+
const a = N(e, t), r = a.find((u)=>u.name === "PredefinedType")?.value;
|
|
3917
3919
|
if (typeof r == "string" && r && r !== "NOTDEFINED" && r !== "USERDEFINED") return r;
|
|
3918
|
-
const s =
|
|
3920
|
+
const s = a.find((u)=>u.name === "ElementType") || a.find((u)=>u.name === "ObjectType") || a.find((u)=>u.name === "ProcessType") || a.find((u)=>u.name === "ResourceType");
|
|
3919
3921
|
if (s && typeof s.value == "string" && s.value) return s.value;
|
|
3920
3922
|
const l = e.relationships?.getRelated?.(t, A.DefinesByType, "inverse") || [];
|
|
3921
3923
|
for (const u of l){
|
|
3922
3924
|
const c = N(e, u), d = c.find((y)=>y.name === "PredefinedType")?.value;
|
|
3923
3925
|
if (typeof d == "string" && d && d !== "NOTDEFINED" && d !== "USERDEFINED") return d;
|
|
3924
|
-
const
|
|
3925
|
-
if (
|
|
3926
|
+
const f = c.find((y)=>y.name === "ElementType") || c.find((y)=>y.name === "ObjectType") || c.find((y)=>y.name === "ProcessType") || c.find((y)=>y.name === "ResourceType");
|
|
3927
|
+
if (f && typeof f.value == "string" && f.value) return f.value;
|
|
3926
3928
|
}
|
|
3927
|
-
const o =
|
|
3929
|
+
const o = i();
|
|
3928
3930
|
return o || (typeof r == "string" && r ? r : void 0);
|
|
3929
3931
|
}
|
|
3930
|
-
function
|
|
3932
|
+
function ra(e) {
|
|
3931
3933
|
switch((e || "").toUpperCase()){
|
|
3932
3934
|
case "IFC2X3":
|
|
3933
3935
|
return "IFC2X3";
|
|
@@ -3941,7 +3943,7 @@ let __tla = Promise.all([
|
|
|
3941
3943
|
return "IFC4";
|
|
3942
3944
|
}
|
|
3943
3945
|
}
|
|
3944
|
-
const
|
|
3946
|
+
const sa = {
|
|
3945
3947
|
IfcRelAggregates: A.Aggregates,
|
|
3946
3948
|
IfcRelAssignsToGroup: A.AssignsToGroup,
|
|
3947
3949
|
IfcRelContainedInSpatialStructure: A.ContainsElements,
|
|
@@ -3949,119 +3951,124 @@ let __tla = Promise.all([
|
|
|
3949
3951
|
IfcRelVoidsElement: A.VoidsElement,
|
|
3950
3952
|
IfcRelFillsElement: A.FillsElement
|
|
3951
3953
|
};
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3954
|
+
pa = function(e) {
|
|
3955
|
+
const t = new Map;
|
|
3956
|
+
function i(r) {
|
|
3957
|
+
let s = t.get(r);
|
|
3958
|
+
return s || (s = N(e, r), t.set(r, s)), s;
|
|
3959
|
+
}
|
|
3960
|
+
function a(r, s) {
|
|
3961
|
+
const l = s.toLowerCase(), o = i(r);
|
|
3962
|
+
for (const u of o)if (u.name.toLowerCase() === l) return u.value;
|
|
3963
|
+
}
|
|
3964
|
+
const n = {
|
|
3965
|
+
getEntityType (r) {
|
|
3966
|
+
const s = e.entities?.getTypeName?.(r);
|
|
3967
|
+
if (s && s !== "Unknown") return s;
|
|
3968
|
+
const l = e.entityIndex?.byId;
|
|
3969
|
+
if (!l) return;
|
|
3970
|
+
const o = l.get(r);
|
|
3971
|
+
if (o) return typeof o == "object" && "type" in o ? String(o.type) : void 0;
|
|
3965
3972
|
},
|
|
3966
|
-
getEntityName (
|
|
3967
|
-
const
|
|
3968
|
-
return
|
|
3973
|
+
getEntityName (r) {
|
|
3974
|
+
const s = a(r, "Name");
|
|
3975
|
+
return s !== void 0 && typeof s == "string" ? s : e.entities?.getName?.(r) || void 0;
|
|
3969
3976
|
},
|
|
3970
|
-
getGlobalId (
|
|
3971
|
-
const
|
|
3972
|
-
return
|
|
3977
|
+
getGlobalId (r) {
|
|
3978
|
+
const s = a(r, "GlobalId");
|
|
3979
|
+
return s !== void 0 && typeof s == "string" ? s : e.entities?.getGlobalId?.(r) || void 0;
|
|
3973
3980
|
},
|
|
3974
|
-
getDescription (
|
|
3975
|
-
const
|
|
3976
|
-
return
|
|
3981
|
+
getDescription (r) {
|
|
3982
|
+
const s = a(r, "Description");
|
|
3983
|
+
return s !== void 0 && typeof s == "string" ? s : e.entities?.getDescription?.(r) || void 0;
|
|
3977
3984
|
},
|
|
3978
|
-
getAttributeNames (
|
|
3979
|
-
return
|
|
3985
|
+
getAttributeNames (r) {
|
|
3986
|
+
return i(r).map((s)=>s.name);
|
|
3980
3987
|
},
|
|
3981
|
-
getAttributeXsdTypes (
|
|
3982
|
-
const
|
|
3983
|
-
if (
|
|
3988
|
+
getAttributeXsdTypes (r, s) {
|
|
3989
|
+
const l = n.getEntityType(r);
|
|
3990
|
+
if (l) return _e(ra(e.schemaVersion), l, s);
|
|
3984
3991
|
},
|
|
3985
|
-
getPredefinedTypeRaw (
|
|
3986
|
-
return
|
|
3992
|
+
getPredefinedTypeRaw (r) {
|
|
3993
|
+
return aa(e, r);
|
|
3987
3994
|
},
|
|
3988
|
-
getObjectType (
|
|
3989
|
-
return
|
|
3995
|
+
getObjectType (r) {
|
|
3996
|
+
return na(e, r, ()=>e.entities?.getObjectType?.(r));
|
|
3990
3997
|
},
|
|
3991
|
-
getEntitiesByType (
|
|
3992
|
-
const
|
|
3993
|
-
return
|
|
3998
|
+
getEntitiesByType (r) {
|
|
3999
|
+
const s = e.entityIndex?.byType?.get(r.toUpperCase());
|
|
4000
|
+
return s ? Array.from(s) : [];
|
|
3994
4001
|
},
|
|
3995
4002
|
getAllEntityIds () {
|
|
3996
|
-
const
|
|
3997
|
-
return
|
|
4003
|
+
const r = e.entityIndex?.byId;
|
|
4004
|
+
return r ? Array.from(r.keys()) : [];
|
|
3998
4005
|
},
|
|
3999
|
-
getPropertyValue (
|
|
4000
|
-
const
|
|
4001
|
-
for (const
|
|
4002
|
-
for (const
|
|
4003
|
-
value:
|
|
4004
|
-
dataType:
|
|
4005
|
-
propertySetName:
|
|
4006
|
-
propertyName:
|
|
4006
|
+
getPropertyValue (r, s, l) {
|
|
4007
|
+
const o = s.toLowerCase(), u = l.toLowerCase(), c = J(e, r);
|
|
4008
|
+
for (const m of c)if (m.name.toLowerCase() === o) {
|
|
4009
|
+
for (const d of m.properties || [])if (d.name.toLowerCase() === u) return {
|
|
4010
|
+
value: d.value,
|
|
4011
|
+
dataType: d.dataType,
|
|
4012
|
+
propertySetName: m.name,
|
|
4013
|
+
propertyName: d.name
|
|
4007
4014
|
};
|
|
4008
4015
|
}
|
|
4009
4016
|
},
|
|
4010
|
-
getPropertySets (
|
|
4011
|
-
return
|
|
4017
|
+
getPropertySets (r) {
|
|
4018
|
+
return J(e, r);
|
|
4012
4019
|
},
|
|
4013
|
-
getClassifications (
|
|
4014
|
-
return
|
|
4020
|
+
getClassifications (r) {
|
|
4021
|
+
return Wi(e, r);
|
|
4015
4022
|
},
|
|
4016
|
-
getMaterials (
|
|
4017
|
-
return
|
|
4023
|
+
getMaterials (r) {
|
|
4024
|
+
return ji(Ne(e, r));
|
|
4018
4025
|
},
|
|
4019
|
-
getParent (
|
|
4020
|
-
const
|
|
4021
|
-
return
|
|
4026
|
+
getParent (r, s) {
|
|
4027
|
+
const l = n.getAncestors(r, s);
|
|
4028
|
+
return l.length > 0 ? l[0] : void 0;
|
|
4022
4029
|
},
|
|
4023
|
-
getAncestors (
|
|
4024
|
-
const
|
|
4025
|
-
if (!
|
|
4026
|
-
const
|
|
4027
|
-
if (
|
|
4028
|
-
const
|
|
4029
|
-
|
|
4030
|
-
]),
|
|
4031
|
-
|
|
4030
|
+
getAncestors (r, s) {
|
|
4031
|
+
const l = e.relationships;
|
|
4032
|
+
if (!l?.getRelated) return [];
|
|
4033
|
+
const o = sa[s];
|
|
4034
|
+
if (o === void 0) return [];
|
|
4035
|
+
const u = [], c = new Set([
|
|
4036
|
+
r
|
|
4037
|
+
]), m = [
|
|
4038
|
+
r
|
|
4032
4039
|
];
|
|
4033
|
-
for(;
|
|
4034
|
-
const
|
|
4035
|
-
for (const
|
|
4036
|
-
expressId:
|
|
4037
|
-
entityType:
|
|
4038
|
-
predefinedType:
|
|
4039
|
-
}),
|
|
4040
|
+
for(; m.length > 0;){
|
|
4041
|
+
const d = m.shift(), f = l.getRelated(d, o, "inverse");
|
|
4042
|
+
for (const y of f || [])c.has(y) || (c.add(y), u.push({
|
|
4043
|
+
expressId: y,
|
|
4044
|
+
entityType: n.getEntityType(y) || "Unknown",
|
|
4045
|
+
predefinedType: n.getObjectType(y)
|
|
4046
|
+
}), m.push(y));
|
|
4040
4047
|
}
|
|
4041
|
-
return
|
|
4048
|
+
return u;
|
|
4042
4049
|
},
|
|
4043
|
-
getAttribute (
|
|
4044
|
-
switch(
|
|
4050
|
+
getAttribute (r, s) {
|
|
4051
|
+
switch(s.toLowerCase()){
|
|
4045
4052
|
case "name":
|
|
4046
|
-
return
|
|
4053
|
+
return n.getEntityName(r);
|
|
4047
4054
|
case "description":
|
|
4048
|
-
return
|
|
4055
|
+
return n.getDescription(r);
|
|
4049
4056
|
case "globalid":
|
|
4050
|
-
return
|
|
4057
|
+
return n.getGlobalId(r);
|
|
4051
4058
|
case "objecttype":
|
|
4052
4059
|
case "predefinedtype":
|
|
4053
|
-
return
|
|
4060
|
+
return n.getObjectType(r);
|
|
4054
4061
|
default:
|
|
4055
4062
|
{
|
|
4056
|
-
const
|
|
4057
|
-
if (
|
|
4058
|
-
const
|
|
4059
|
-
return
|
|
4063
|
+
const o = a(r, s);
|
|
4064
|
+
if (o !== void 0) return o;
|
|
4065
|
+
const u = e.entities;
|
|
4066
|
+
return u?.getAttribute ? u.getAttribute(r, s) : void 0;
|
|
4060
4067
|
}
|
|
4061
4068
|
}
|
|
4062
4069
|
}
|
|
4063
4070
|
};
|
|
4064
|
-
return
|
|
4071
|
+
return n;
|
|
4065
4072
|
};
|
|
4066
4073
|
});
|
|
4067
|
-
export { g as I,
|
|
4074
|
+
export { g as I, ua as a, ca as b, pa as c, Pe as p, oa as v, __tla };
|