@nebula-spatial/studio 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +2 -0
  2. package/dist/assets/openusd_three_loader-DLiqJWUM.js +13769 -0
  3. package/dist/assets/usd-export-worker-BRxTLqer.js +182 -0
  4. package/dist/assets/usd-worker-DekqMsQv.js +1392 -0
  5. package/dist/{builders-BAXRR5o5.js → builders-lydx4-Rh.js} +1 -1
  6. package/dist/core/session-persistence-controller.d.ts +55 -0
  7. package/dist/doc/placement-policy.d.ts +4 -0
  8. package/dist/editor/editor.d.ts +3 -1
  9. package/dist/editor/index.d.ts +2 -0
  10. package/dist/editor/session-persistence.d.ts +54 -0
  11. package/dist/editor.js +727 -490
  12. package/dist/export-evidence-z2Ne7Trf.js +2387 -0
  13. package/dist/generalization.js +2 -2
  14. package/dist/index.d.ts +4 -2
  15. package/dist/index.js +314 -306
  16. package/dist/mjcf-visual-IOy-ucto.js +72 -0
  17. package/dist/mujoco-runtime-BYZnrvbR.js +467 -0
  18. package/dist/persist/indexeddb-store.d.ts +22 -2
  19. package/dist/persist/session.d.ts +22 -0
  20. package/dist/persist/snapshot.d.ts +24 -0
  21. package/dist/{physics-facts-tfQYyNTD.js → physics-facts-D-URIBrt.js} +8 -7
  22. package/dist/{placement-policy-DY_FNRDu.js → placement-policy-C6dV6Tf-.js} +161 -141
  23. package/dist/ports/persistence.d.ts +45 -1
  24. package/dist/project/contracts.d.ts +3 -0
  25. package/dist/remote-asset-resolver-D-UeyDMD.js +311 -0
  26. package/dist/{scene-graph-DBLKAhxa.js → scene-graph-DVOXjMmp.js} +2 -2
  27. package/dist/scene-session-PhoFXFCY.js +22006 -0
  28. package/dist/scene.js +2 -2
  29. package/dist/session-2bp8YOA4.js +963 -0
  30. package/dist/session-B3WbC7Y2.js +296 -0
  31. package/dist/session-B9kEf4xN.js +915 -0
  32. package/dist/session-DYThdzLZ.js +825 -0
  33. package/dist/studio/index.d.ts +5 -0
  34. package/dist/studio/indexeddb-persistence.d.ts +2 -0
  35. package/dist/studio/indexeddb-session-persistence.d.ts +11 -0
  36. package/dist/studio/scene-package-asset-sources.d.ts +14 -0
  37. package/dist/studio.js +1423 -1220
  38. package/dist/urdf-session-CRXL4bHf.js +1230 -0
  39. package/dist/usd-session-CTzInpNy.js +7385 -0
  40. package/dist/version.d.ts +1 -1
  41. package/dist/view/scene-session.d.ts +5 -1
  42. package/dist/wasm-module-DZn2AM1W.js +13 -0
  43. package/dist/xacro-IpPHTMYs.js +76 -0
  44. package/package.json +1 -1
  45. package/dist/asset-source-BExlEcRt.js +0 -444
  46. package/dist/assets/usd-export-worker-BsGubtAE.js +0 -1
  47. package/dist/editorial-BkAFWfbg.js +0 -83
  48. package/dist/export-evidence-B_0zRmb8.js +0 -5027
  49. package/dist/remote-asset-resolver-Cb8cfNmw.js +0 -136
  50. package/dist/scene-session-BV1HnxNh.js +0 -3506
@@ -0,0 +1,2387 @@
1
+ var st = Object.defineProperty;
2
+ var rt = (e, t, s) => t in e ? st(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
3
+ var T = (e, t, s) => rt(e, typeof t != "symbol" ? t + "" : t, s);
4
+ import { W as ot, s as N, e as q, g as U, X as w, a4 as J, a3 as O } from "./builders-lydx4-Rh.js";
5
+ import { n as $, a as m, b as Ce, m as nt, P as at, A as it, Q as ct, r as lt, O as F } from "./session-B9kEf4xN.js";
6
+ import { d as V, Y as dt, u as ut, E as ft } from "./scene-graph-DVOXjMmp.js";
7
+ function pt(e) {
8
+ const t = [...e.resources].map((i) => ({
9
+ ...i,
10
+ locator: $(i.locator)
11
+ })).sort((i, l) => m(i.locator).localeCompare(m(l.locator)) || i.resourceId.localeCompare(l.resourceId)), s = /* @__PURE__ */ new Map();
12
+ for (const i of e.variantSets ?? []) {
13
+ const l = s.get(i.name);
14
+ if (!l) {
15
+ s.set(i.name, {
16
+ ...i,
17
+ options: [...new Set(i.options)].sort()
18
+ });
19
+ continue;
20
+ }
21
+ s.set(i.name, {
22
+ ...l,
23
+ options: [.../* @__PURE__ */ new Set([...l.options, ...i.options])].sort(),
24
+ ...l.authoredDefault ?? i.authoredDefault ? { authoredDefault: l.authoredDefault ?? i.authoredDefault } : {}
25
+ });
26
+ }
27
+ const r = [...s.values()].sort((i, l) => i.name.localeCompare(l.name)), o = {
28
+ assetId: e.assetId,
29
+ slug: e.slug,
30
+ label: e.label,
31
+ layout: e.layout,
32
+ fileKind: e.fileKind,
33
+ entryResourceId: e.entryResourceId,
34
+ resources: t,
35
+ variantSets: r,
36
+ capabilities: e.capabilities,
37
+ ...e.bounds ? { bounds: e.bounds } : {},
38
+ ...e.category ? { category: e.category } : {},
39
+ ...e.hints ? { hints: mt(e.hints) } : {},
40
+ ...e.metrics ? { metrics: e.metrics } : {},
41
+ ...e.semantic ? { semantic: e.semantic } : {}
42
+ }, n = ot(o);
43
+ return {
44
+ revisionId: `rev_${n.slice(0, 24)}`,
45
+ ...o,
46
+ contentHash: n,
47
+ provenance: e.provenance ?? { source: "user", repairs: [] }
48
+ };
49
+ }
50
+ function zs(e) {
51
+ const t = e.resources.find((s) => s.resourceId === e.entryResourceId);
52
+ if (!t) throw new Error(`Asset revision ${e.revisionId} has no entry resource.`);
53
+ return t;
54
+ }
55
+ function Vs(e, t) {
56
+ const s = m(t);
57
+ return e.resources.find((r) => m(r.locator) === s) ?? null;
58
+ }
59
+ function Fs(e) {
60
+ return e.resources.map((t) => m(t.locator));
61
+ }
62
+ function Bs(e) {
63
+ if (e.variantSets.length === 0) return null;
64
+ const t = {};
65
+ for (const s of e.variantSets) {
66
+ const r = s.authoredDefault ?? s.options[0];
67
+ r && (t[s.name] = r);
68
+ }
69
+ return Object.keys(t).length > 0 ? t : null;
70
+ }
71
+ function js(e) {
72
+ return e.layout === "glb" || e.fileKind === "glb";
73
+ }
74
+ function mt(e) {
75
+ return {
76
+ ...e.approximateSize ? { approximateSize: e.approximateSize } : {},
77
+ ...e.defaultRole ? { defaultRole: e.defaultRole } : {},
78
+ ...e.defaultPhysics ? { defaultPhysics: e.defaultPhysics } : {},
79
+ ...e.forwardAxis ? { forwardAxis: e.forwardAxis } : {},
80
+ ...e.tags ? { tags: [...new Set(e.tags)].sort() } : {}
81
+ };
82
+ }
83
+ function k(e) {
84
+ return e.kind === "package-path" ? e.path : e.url;
85
+ }
86
+ function ht(e) {
87
+ return k(e.entryLocator);
88
+ }
89
+ const yt = [".mdl"];
90
+ function xe(e) {
91
+ const t = e.split(/[?#]/, 1)[0] ?? e;
92
+ return yt.some((s) => t.toLowerCase().endsWith(s));
93
+ }
94
+ const ce = /@(?<target>[^@\r\n]+)@(?:\s*<(?<prim>[^>]*)>)?/g, Le = /^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//;
95
+ function de(e, t) {
96
+ const s = [], r = [];
97
+ for (const n of [...e].sort((i, l) => i.path.localeCompare(l.path))) {
98
+ const i = gt(n.path, n.text, t);
99
+ i.length > 0 && r.push(n.path), s.push(...i);
100
+ }
101
+ s.sort((n, i) => n.fromPath.localeCompare(i.fromPath) || n.target.localeCompare(i.target));
102
+ const o = s.filter((n) => n.kind === "asset");
103
+ return {
104
+ references: s,
105
+ missing: o.filter((n) => !n.external && n.resolvedPath === null),
106
+ external: o.filter((n) => n.external),
107
+ unanchored: o.filter((n) => !n.external && !n.anchored),
108
+ materialModules: s.filter((n) => n.kind === "material-module"),
109
+ layers: r
110
+ };
111
+ }
112
+ function Ks(e, t) {
113
+ const s = t.map($), r = new Set(s.map(m)), o = [], n = [], i = [...e].sort((d, c) => k(d.locator).localeCompare(
114
+ k(c.locator)
115
+ ));
116
+ for (const d of i) {
117
+ const c = $(d.locator), u = k(c), a = [];
118
+ for (const f of Oe(d.text)) {
119
+ const g = xe(f.target) ? "material-module" : "asset", h = Ce(
120
+ c,
121
+ f.target,
122
+ s
123
+ ), p = h && r.has(m(h)) ? k(h) : null, I = g === "asset" && h === null && Le.test(f.target);
124
+ a.push({
125
+ fromPath: u,
126
+ target: f.target,
127
+ resolvedPath: p,
128
+ external: I,
129
+ anchored: c.kind === "remote-url" ? !0 : f.target.startsWith("./") || f.target.startsWith("../"),
130
+ primPath: f.primPath,
131
+ kind: g
132
+ });
133
+ }
134
+ a.length > 0 && n.push(u), o.push(...a);
135
+ }
136
+ o.sort((d, c) => d.fromPath.localeCompare(c.fromPath) || d.target.localeCompare(c.target));
137
+ const l = o.filter((d) => d.kind === "asset");
138
+ return {
139
+ references: o,
140
+ missing: l.filter((d) => !d.external && d.resolvedPath === null),
141
+ external: l.filter((d) => d.external),
142
+ unanchored: l.filter((d) => !d.external && !d.anchored),
143
+ materialModules: o.filter((d) => d.kind === "material-module"),
144
+ layers: n
145
+ };
146
+ }
147
+ function gt(e, t, s) {
148
+ const r = [];
149
+ for (const o of Oe(t)) {
150
+ const { target: n } = o, i = Le.test(n), l = xe(n) ? "material-module" : "asset", d = n.startsWith("./") || n.startsWith("../"), c = i ? null : It(e, n, s);
151
+ r.push({
152
+ fromPath: e,
153
+ target: n,
154
+ resolvedPath: c,
155
+ external: i,
156
+ anchored: d,
157
+ primPath: o.primPath,
158
+ kind: l
159
+ });
160
+ }
161
+ return r;
162
+ }
163
+ function Oe(e) {
164
+ var r, o, n, i;
165
+ const t = [], s = /* @__PURE__ */ new Set();
166
+ ce.lastIndex = 0;
167
+ for (let l = ce.exec(e); l !== null; l = ce.exec(e)) {
168
+ const d = ((o = (r = l.groups) == null ? void 0 : r.target) == null ? void 0 : o.trim()) ?? "";
169
+ if (!d) continue;
170
+ const c = ((i = (n = l.groups) == null ? void 0 : n.prim) == null ? void 0 : i.trim()) || null, u = `${d}\0${c ?? ""}`;
171
+ s.has(u) || (s.add(u), t.push({ target: d, primPath: c }));
172
+ }
173
+ return t;
174
+ }
175
+ function It(e, t, s) {
176
+ if (t.startsWith("/")) {
177
+ const o = Q(t.slice(1));
178
+ return s.has(o) ? o : null;
179
+ }
180
+ const r = e.split("/");
181
+ r.pop();
182
+ for (let o = r.length; o >= 0; o -= 1) {
183
+ const n = r.slice(0, o).join("/"), i = Q(n ? `${n}/${t}` : t);
184
+ if (s.has(i)) return i;
185
+ }
186
+ return null;
187
+ }
188
+ function Q(e) {
189
+ const t = [];
190
+ for (const s of e.replace(/\\/g, "/").split("/"))
191
+ if (!(!s || s === ".")) {
192
+ if (s === "..") {
193
+ t.pop();
194
+ continue;
195
+ }
196
+ t.push(s);
197
+ }
198
+ return t.join("/");
199
+ }
200
+ function Me(e) {
201
+ return e.toLowerCase().endsWith(".usda");
202
+ }
203
+ const vt = "#usda", St = ["PXR-USDC", "PXR-USDA"];
204
+ function pe(e, t) {
205
+ if (!t || t.byteLength === 0) return Me(e);
206
+ if (e.toLowerCase().endsWith(".usdc")) return !1;
207
+ const s = new TextDecoder("utf-8", { fatal: !1 }).decode(t.subarray(0, 16));
208
+ return St.some((r) => s.startsWith(r)) ? !1 : s.trimStart().startsWith(vt);
209
+ }
210
+ function Ys(e) {
211
+ const t = Mt(e), s = t ? ee(t, "customLayerData") : null, r = s ? ee(s, "SimReady_Metadata") : null, o = b(t, "defaultPrim"), n = At(e, o);
212
+ return {
213
+ creator: b(t, "creator"),
214
+ startTimeCode: Y(t, "startTimeCode"),
215
+ endTimeCode: Y(t, "endTimeCode"),
216
+ timeCodesPerSecond: Y(t, "timeCodesPerSecond"),
217
+ rootPrim: n,
218
+ simReady: r || s ? {
219
+ assetName: b(r, "asset_name") ?? b(s, "asset_name"),
220
+ assetType: b(r, "asset_type") ?? b(s, "asset_type"),
221
+ category: b(r, "category"),
222
+ author: b(r, "author"),
223
+ license: b(r, "asset_license"),
224
+ sourceFile: b(r, "source_file") ?? b(s, "source_file"),
225
+ generatedDate: b(r, "usd_date_generated") ?? b(s, "usd_date_generated"),
226
+ qcode: b(r, "qcode"),
227
+ mass: Y(r, "mass"),
228
+ extents: zt(r, "asset_extents"),
229
+ rigidBodyCount: Ut(r, "rigid_body_count"),
230
+ validation: Ot(r)
231
+ } : null,
232
+ variantSets: bt(e)
233
+ };
234
+ }
235
+ async function Ws(e) {
236
+ const t = e.find((a) => L(a.path).endsWith("/com.nvidia.simready.packaging.json") || L(a.path) === "com.nvidia.simready.packaging.json"), s = e.find((a) => /(?:^|\/)[^/]+_validation\.json$/i.test(L(a.path))), r = e.find((a) => /(?:^|\/)[^/]+_benchmark\.json$/i.test(L(a.path))), o = e.find((a) => L(a.path).endsWith("/com.nvidia.simready.packaging.bom.json") || L(a.path) === "com.nvidia.simready.packaging.bom.json");
237
+ if (!t && !s && !r) return null;
238
+ const [n, i, l, d] = await Promise.all([
239
+ t ? H(t.blob) : null,
240
+ s ? H(s.blob) : null,
241
+ r ? H(r.blob) : null,
242
+ o ? H(o.blob) : null
243
+ ]), c = Array.isArray(S(d, "items")) ? S(d, "items").filter(P) : [], u = Array.isArray(S(n, "metadata")) ? S(n, "metadata").filter(P) : [];
244
+ return {
245
+ formatVersion: A(S(n, "format_version")),
246
+ bomFormatVersion: A(S(d, "format_version")),
247
+ packageId: A(S(n, "package_id")),
248
+ license: A(S(n, "license")),
249
+ contentSha256: A(S(S(n, "content_hash"), "sha256")),
250
+ packageSha256: A(S(S(n, "package_hash"), "sha256")),
251
+ metadataFileCount: u.length,
252
+ metadataNames: u.map((a) => A(S(a, "name"))).filter((a) => !!a),
253
+ loadedFileCount: e.length,
254
+ loadedTotalBytes: e.reduce((a, f) => a + f.blob.size, 0),
255
+ bomFileCount: c.length,
256
+ bomTotalBytes: c.reduce((a, f) => a + (Vt(S(f, "size")) ?? 0), 0),
257
+ validation: xt(i),
258
+ benchmark: Lt(l)
259
+ };
260
+ }
261
+ async function Gs(e) {
262
+ const t = [];
263
+ for (const a of e) {
264
+ if (!/\.(?:usda|usd)$/i.test(a.path)) continue;
265
+ const f = new Uint8Array(await a.blob.arrayBuffer());
266
+ pe(a.path, f) && t.push({
267
+ path: L(a.path),
268
+ text: new TextDecoder("utf-8").decode(f)
269
+ });
270
+ }
271
+ if (!t.length) return null;
272
+ const s = /* @__PURE__ */ new Map();
273
+ let r = 0;
274
+ for (const a of t)
275
+ for (const f of Rt(a.text)) {
276
+ r += 1;
277
+ const g = _t(f.header), h = Pt(f.source), p = s.get(f.path) ?? {
278
+ path: f.path,
279
+ typeName: f.typeName,
280
+ layers: /* @__PURE__ */ new Set(),
281
+ apiSchemas: /* @__PURE__ */ new Set(),
282
+ properties: /* @__PURE__ */ new Map(),
283
+ hasDriveAttributes: !1,
284
+ hasMimicAttributes: !1
285
+ };
286
+ p.typeName === "unknown" && f.typeName !== "unknown" && (p.typeName = f.typeName), p.layers.add(a.path);
287
+ for (const I of g) p.apiSchemas.add(I);
288
+ for (const I of h) {
289
+ const R = p.properties.get(I.name) ?? /* @__PURE__ */ new Map(), _ = R.get(I.value) ?? /* @__PURE__ */ new Set();
290
+ _.add(a.path), R.set(I.value, _), p.properties.set(I.name, R);
291
+ }
292
+ p.hasDriveAttributes || (p.hasDriveAttributes = h.some((I) => I.name.startsWith("drive:"))), p.hasMimicAttributes || (p.hasMimicAttributes = h.some((I) => /mimic/i.test(I.name))), s.set(f.path, p);
293
+ }
294
+ const o = [...s.values()].map((a) => ({
295
+ path: a.path,
296
+ typeName: a.typeName,
297
+ layers: [...a.layers].sort(),
298
+ apiSchemas: [...a.apiSchemas].filter(Dt).sort(),
299
+ properties: [...a.properties.entries()].map(([f, g]) => ({
300
+ name: f,
301
+ values: [...g.entries()].map(([h, p]) => ({
302
+ value: h,
303
+ layers: [...p].sort()
304
+ })).sort((h, p) => h.value.localeCompare(p.value))
305
+ })).sort((f, g) => f.name.localeCompare(g.name)),
306
+ hasDriveAttributes: a.hasDriveAttributes,
307
+ hasMimicAttributes: a.hasMimicAttributes
308
+ })).filter((a) => a.apiSchemas.length > 0 || _e(a) || a.typeName === "MjcActuator" || a.typeName === "PhysicsScene"), n = /* @__PURE__ */ new Map();
309
+ for (const a of o)
310
+ for (const f of a.apiSchemas)
311
+ n.set(f, (n.get(f) ?? 0) + 1);
312
+ const i = (a) => [...a].sort((f, g) => f.path.localeCompare(g.path)), l = o.filter((a) => a.apiSchemas.some(kt)), d = o.filter((a) => a.apiSchemas.some(Nt)), c = o.filter((a) => a.apiSchemas.some(Tt)), u = o.filter(_e);
313
+ return {
314
+ scannedLayerCount: t.length,
315
+ scannedLayers: t.map((a) => a.path).sort(),
316
+ scannedPrimCount: r,
317
+ physicsPrimCount: o.length,
318
+ apiSchemaCounts: [...n.entries()].map(([a, f]) => ({ schema: a, primCount: f })).sort((a, f) => f.primCount - a.primCount || a.schema.localeCompare(f.schema)),
319
+ colliderApproximationCounts: $t(l, "physics:approximation"),
320
+ physicsPrims: i(o),
321
+ rigidBodyPrims: i(d),
322
+ colliderPrims: i(l),
323
+ articulationRootPrims: i(c),
324
+ jointPrims: i(u),
325
+ massPrims: i(o.filter((a) => a.apiSchemas.some((f) => /^(?:Physics|Physx|Newton)MassAPI/.test(f)))),
326
+ materialPrims: i(o.filter((a) => a.apiSchemas.some((f) => /^PhysicsMaterialAPI/.test(f)))),
327
+ scenePrims: i(o.filter((a) => a.typeName === "PhysicsScene")),
328
+ actuatorPrims: i(o.filter((a) => a.typeName === "MjcActuator")),
329
+ driveAttributePrimCount: o.filter((a) => a.hasDriveAttributes).length,
330
+ mimicPrimCount: o.filter((a) => a.hasMimicAttributes).length
331
+ };
332
+ }
333
+ function bt(e) {
334
+ const t = Ct(e), s = [], r = /\bvariantSet\s+"([^"]+)"\s*=\s*\{/g;
335
+ for (let o = r.exec(e); o; o = r.exec(e)) {
336
+ const n = o[1], i = te(e, e.indexOf("{", o.index));
337
+ if (!i) continue;
338
+ const l = [...i.matchAll(/^\s*"([^"]+)"(?:\s*\([^)]*\))?\s*\{/gm)].map((c) => c[1]).filter((c, u, a) => a.indexOf(c) === u);
339
+ if (!l.length) continue;
340
+ const d = t[n];
341
+ s.push({
342
+ name: n,
343
+ options: l,
344
+ ...d && l.includes(d) ? { authoredDefault: d } : {}
345
+ }), r.lastIndex += i.length;
346
+ }
347
+ return s;
348
+ }
349
+ function At(e, t) {
350
+ const s = ze(e), o = [...e.slice((s == null ? void 0 : s.end) ?? 0).matchAll(
351
+ /^(?:def|over|class)\s+(?:([A-Za-z0-9_:]+)\s+)?"([^"]+)"/gm
352
+ )], n = t ? o.find((a) => a[2] === t) : o[0];
353
+ if (!n) return null;
354
+ const i = ((s == null ? void 0 : s.end) ?? 0) + n.index, l = e.indexOf("{", i), d = l >= 0 ? e.slice(i, l) : n[0], c = [...d.matchAll(/\bapiSchemas\s*=\s*\[([^\]]*)\]/g)].flatMap((a) => [...a[1].matchAll(/"([^"]+)"/g)].map((f) => f[1])), u = n[2];
355
+ return {
356
+ path: t ? `/${t.replace(/^\/+/, "")}` : `/${u}`,
357
+ name: u,
358
+ typeName: n[1] ?? "unknown",
359
+ kind: b(d, "kind"),
360
+ apiSchemas: [...new Set(c)].sort()
361
+ };
362
+ }
363
+ function Rt(e) {
364
+ const t = [], s = (r, o, n) => {
365
+ const i = /\b(?:def|over|class)\s+(?:([A-Za-z0-9_:]+)\s+)?"([^"]+)"/g;
366
+ for (i.lastIndex = r; i.lastIndex < o; ) {
367
+ const l = i.exec(e);
368
+ if (!l || l.index >= o) break;
369
+ const d = Ue(e, i.lastIndex, o);
370
+ if (d < 0) continue;
371
+ const c = se(e, d, "{", "}");
372
+ if (c < 0) break;
373
+ const u = l[2], a = Et(n, u), f = e.slice(l.index, c + 1);
374
+ t.push({
375
+ path: a,
376
+ typeName: l[1] ?? "unknown",
377
+ header: e.slice(l.index, d),
378
+ source: f
379
+ }), s(d + 1, c, a), i.lastIndex = c + 1;
380
+ }
381
+ };
382
+ return s(0, e.length, ""), t;
383
+ }
384
+ function Et(e, t) {
385
+ return t.startsWith("/") ? `/${t.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/")}` : `${e}/${t}`.replace(/\/+/g, "/");
386
+ }
387
+ function Ue(e, t, s) {
388
+ let r = 0, o = !1, n = !1;
389
+ for (let i = t; i < s; i += 1) {
390
+ const l = e[i];
391
+ if (n) {
392
+ l === `
393
+ ` && (n = !1);
394
+ continue;
395
+ }
396
+ if (l === "#" && !o) {
397
+ n = !0;
398
+ continue;
399
+ }
400
+ if (l === '"' && e[i - 1] !== "\\" && (o = !o), !o) {
401
+ if (l === "(") r += 1;
402
+ else if (l === ")") r = Math.max(0, r - 1);
403
+ else if (l === "{" && r === 0) return i;
404
+ }
405
+ }
406
+ return -1;
407
+ }
408
+ function _t(e) {
409
+ const t = /* @__PURE__ */ new Set();
410
+ for (const s of e.matchAll(/\bapiSchemas\s*=\s*\[([^\]]*)\]/g)) {
411
+ const r = e.slice(Math.max(0, (s.index ?? 0) - 16), s.index);
412
+ if (!/\bdelete\s*$/.test(r))
413
+ for (const o of s[1].matchAll(/"([^"]+)"|([A-Za-z][A-Za-z0-9_:]*)/g)) {
414
+ const n = o[1] ?? o[2];
415
+ n && t.add(n);
416
+ }
417
+ }
418
+ return [...t];
419
+ }
420
+ function Pt(e) {
421
+ const t = wt(e), s = [], r = /^\s*(?:(?:custom|uniform|varying|rel|append|prepend|delete)\s+)*(?:(?:[A-Za-z][A-Za-z0-9_:]*(?:\[\])?)\s+)?((?:physics|physx|newton|mjc|drive|state):[A-Za-z0-9_:]+)\s*=\s*(.+?)\s*$/gm;
422
+ for (const o of t.matchAll(r)) {
423
+ const n = o[1], i = o[2].replace(/\s+#.*$/, "").replace(/\s+/g, " ").trim();
424
+ i && s.push({ name: n, value: i });
425
+ }
426
+ return s;
427
+ }
428
+ function wt(e) {
429
+ const t = e.indexOf("{"), s = e.lastIndexOf("}");
430
+ if (t < 0 || s <= t) return "";
431
+ let r = e.slice(t + 1, s);
432
+ const o = /\b(?:def|over|class)\s+(?:[A-Za-z0-9_:]+\s+)?"[^"]+"/g;
433
+ for (; o.lastIndex < r.length; ) {
434
+ const n = o.exec(r);
435
+ if (!n) break;
436
+ const i = Ue(r, o.lastIndex, r.length);
437
+ if (i < 0) break;
438
+ const l = se(r, i, "{", "}");
439
+ if (l < 0) break;
440
+ r = `${r.slice(0, n.index)}${" ".repeat(l - n.index + 1)}${r.slice(l + 1)}`, o.lastIndex = l + 1;
441
+ }
442
+ return r;
443
+ }
444
+ function $t(e, t) {
445
+ const s = /* @__PURE__ */ new Map();
446
+ for (const r of e) {
447
+ const o = r.properties.find((n) => n.name === t);
448
+ if (o)
449
+ for (const n of o.values)
450
+ s.set(n.value, (s.get(n.value) ?? 0) + 1);
451
+ }
452
+ return [...s.entries()].map(([r, o]) => ({ value: r, primCount: o })).sort((r, o) => o.primCount - r.primCount || r.value.localeCompare(o.value));
453
+ }
454
+ function Dt(e) {
455
+ return /(?:Physics|Physx|Newton|Mjc)/.test(e);
456
+ }
457
+ function kt(e) {
458
+ return /^(?:PhysicsCollisionAPI|PhysxCollisionAPI|NewtonCollisionAPI|MjcCollisionAPI)/.test(e);
459
+ }
460
+ function Nt(e) {
461
+ return /^(?:PhysicsRigidBodyAPI|PhysxRigidBodyAPI|NewtonRigidBodyAPI)/.test(e);
462
+ }
463
+ function Tt(e) {
464
+ return /^(?:PhysicsArticulationRootAPI|PhysxArticulationAPI|NewtonArticulationRootAPI)/.test(e);
465
+ }
466
+ function _e(e) {
467
+ return e.typeName.endsWith("Joint") || e.apiSchemas.some((t) => /^(?:MjcJointAPI|PhysicsJointStateAPI|PhysxJointStateAPI|NewtonJointStateAPI)/.test(t));
468
+ }
469
+ function Ct(e) {
470
+ const t = /\bvariants\s*=\s*\{/.exec(e);
471
+ if (!t) return {};
472
+ const s = te(e, e.indexOf("{", t.index));
473
+ return s ? Object.fromEntries([...s.matchAll(
474
+ /\b(?:string|token)\s+([A-Za-z0-9_:]+)\s*=\s*"([^"]+)"/g
475
+ )].map((r) => [r[1], r[2]])) : {};
476
+ }
477
+ function xt(e) {
478
+ const t = P(e) ? Object.entries(e).find(([, c]) => P(c) && P(S(c, "features_summary"))) ?? null : null, s = (t == null ? void 0 : t[1]) ?? null, r = S(s, "features_summary");
479
+ if (!P(r)) return null;
480
+ const o = Object.entries(r).filter((c) => P(c[1])), n = o.filter(([, c]) => c.blocking_failure === !0 && c.passed !== !0).map(([c]) => c), i = o.filter(([, c]) => c.passed !== !0).map(([c]) => c), l = S(s, "tier_versions"), d = o.filter(([, c]) => c.passed === !0).length;
481
+ return {
482
+ entryPath: (t == null ? void 0 : t[0]) ?? null,
483
+ profileId: A(S(s, "profile_id")),
484
+ profileVersion: A(S(s, "profile_version")),
485
+ validatorVersion: A(S(s, "simready_validate_version")),
486
+ totalFeatures: o.length,
487
+ passedFeatures: d,
488
+ blockingFailures: n.length,
489
+ blockingFeatureIds: n,
490
+ failedFeatureIds: i,
491
+ tierVersions: P(l) ? Object.fromEntries(Object.entries(l).flatMap(([c, u]) => typeof u == "string" && u ? [[c, u]] : [])) : {},
492
+ status: n.length ? "fail" : o.length === 0 ? "unknown" : d === o.length ? "pass" : "partial"
493
+ };
494
+ }
495
+ function Lt(e) {
496
+ if (!P(e)) return null;
497
+ const t = Array.isArray(e.results) ? e.results.filter((o) => P(o)) : [], s = [...new Set(t.flatMap((o) => {
498
+ const n = A(o.engine), i = A(o.engine_version);
499
+ return n ? [`${n}${i ? ` ${i}` : ""}`] : [];
500
+ }))].sort(), r = t.filter((o) => o.status === "fail").map((o) => ({
501
+ testName: A(o.test_name) ?? "unnamed-test",
502
+ engine: A(o.engine) ?? "unknown-engine",
503
+ message: A(o.message) ?? ""
504
+ }));
505
+ return {
506
+ schemaVersion: A(e.schema_version),
507
+ assetName: A(e.asset),
508
+ passed: typeof e.passed == "boolean" ? e.passed : null,
509
+ runTimestamp: A(e.run_timestamp),
510
+ testCount: t.length,
511
+ passedCount: t.filter((o) => o.status === "pass").length,
512
+ failedCount: r.length,
513
+ skippedCount: t.filter((o) => o.status === "skipped").length,
514
+ failedTests: r,
515
+ engines: s
516
+ };
517
+ }
518
+ function Ot(e) {
519
+ const t = ee(e, "validation");
520
+ if (!t) return null;
521
+ const s = ee(t, "validated_features") ?? "", r = [...new Set(
522
+ [...s.matchAll(/dictionary\s+"(\d{4}-\d{2}-\d{2})"\s*=/g)].map((c) => c[1])
523
+ )].sort(), o = /* @__PURE__ */ new Map(), n = /\bdictionary\s+(?:"([^"]+)"|([A-Za-z0-9_:]+))\s*(?:=\s*)?\{/g;
524
+ for (let c = n.exec(s); c; c = n.exec(s)) {
525
+ const u = c[1] ?? c[2];
526
+ if (!u.startsWith("FET_")) continue;
527
+ const a = te(s, s.indexOf("{", c.index));
528
+ a && o.set(u, a);
529
+ }
530
+ const i = [...o.values()], l = i.filter((c) => le(c, "passed") === !0).length, d = i.filter((c) => le(c, "blocking_failure") === !0 && le(c, "passed") !== !0).length;
531
+ return !r.length && !o.size && !b(t, "profile") ? null : {
532
+ profileId: b(t, "profile"),
533
+ profileVersion: b(t, "profile_version"),
534
+ validatedDates: r,
535
+ featureCount: o.size,
536
+ passedFeatureCount: l,
537
+ blockingFailureCount: d
538
+ };
539
+ }
540
+ async function H(e) {
541
+ try {
542
+ return JSON.parse(await e.text());
543
+ } catch {
544
+ return null;
545
+ }
546
+ }
547
+ function Mt(e) {
548
+ const t = ze(e);
549
+ return t ? e.slice(t.start, t.end + 1) : null;
550
+ }
551
+ function ze(e) {
552
+ const t = /#usda\s+\S+\s*\(/m.exec(e);
553
+ if (!t) return null;
554
+ const s = e.indexOf("(", t.index), r = se(e, s, "(", ")");
555
+ return r >= 0 ? { start: s, end: r } : null;
556
+ }
557
+ function ee(e, t) {
558
+ if (!e) return null;
559
+ const s = new RegExp(`(?:\\bdictionary\\s+)?\\b${G(t)}\\s*=\\s*\\{`).exec(e);
560
+ return s ? te(e, e.indexOf("{", s.index)) : null;
561
+ }
562
+ function te(e, t) {
563
+ if (t < 0 || e[t] !== "{") return null;
564
+ const s = se(e, t, "{", "}");
565
+ return s >= 0 ? e.slice(t, s + 1) : null;
566
+ }
567
+ function se(e, t, s, r) {
568
+ if (e[t] !== s) return -1;
569
+ let o = 0, n = !1, i = !1;
570
+ for (let l = t; l < e.length; l += 1) {
571
+ const d = e[l];
572
+ if (i) {
573
+ d === `
574
+ ` && (i = !1);
575
+ continue;
576
+ }
577
+ if (d === "#" && !n) {
578
+ i = !0;
579
+ continue;
580
+ }
581
+ if (d === '"' && e[l - 1] !== "\\" && (n = !n), !n) {
582
+ if (d === s) o += 1;
583
+ else if (d === r && (o -= 1, o === 0))
584
+ return l;
585
+ }
586
+ }
587
+ return -1;
588
+ }
589
+ function b(e, t) {
590
+ var s;
591
+ return e ? ((s = new RegExp(`\\b(?:string|token)?\\s*${G(t)}\\s*=\\s*"([^"]*)"`).exec(e)) == null ? void 0 : s[1]) ?? null : null;
592
+ }
593
+ function Y(e, t) {
594
+ var r;
595
+ if (!e) return null;
596
+ const s = (r = new RegExp(`\\b(?:float|double|int)?\\s*${G(t)}\\s*=\\s*([0-9.eE+-]+)`).exec(e)) == null ? void 0 : r[1];
597
+ return s !== void 0 && Number.isFinite(Number(s)) ? Number(s) : null;
598
+ }
599
+ function Ut(e, t) {
600
+ const s = Y(e, t);
601
+ return s !== null && Number.isInteger(s) ? s : null;
602
+ }
603
+ function le(e, t) {
604
+ var r, o;
605
+ if (!e) return null;
606
+ const s = (o = (r = new RegExp(`\\bbool\\s+${G(t)}\\s*=\\s*(0|1|true|false)\\b`, "i").exec(e)) == null ? void 0 : r[1]) == null ? void 0 : o.toLowerCase();
607
+ return s === void 0 ? null : s === "1" || s === "true";
608
+ }
609
+ function zt(e, t) {
610
+ var o;
611
+ if (!e) return null;
612
+ const s = (o = new RegExp(`\\bfloat3\\s+${G(t)}\\s*=\\s*\\(([^)]+)\\)`).exec(e)) == null ? void 0 : o[1], r = (s == null ? void 0 : s.trim().split(/\s*,\s*|\s+/).map(Number)) ?? [];
613
+ return r.length === 3 && r.every(Number.isFinite) ? [r[0], r[1], r[2]] : null;
614
+ }
615
+ function S(e, t) {
616
+ return P(e) ? e[t] : null;
617
+ }
618
+ function Vt(e) {
619
+ return typeof e == "number" && Number.isFinite(e) ? e : null;
620
+ }
621
+ function A(e) {
622
+ return typeof e == "string" && e ? e : null;
623
+ }
624
+ function P(e) {
625
+ return !!e && typeof e == "object" && !Array.isArray(e);
626
+ }
627
+ function L(e) {
628
+ return e.replaceAll("\\", "/").replace(/^\.?\//, "");
629
+ }
630
+ function G(e) {
631
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
632
+ }
633
+ const Ft = [".usd", ".usda", ".usdc", ".usdz"], Ve = [".glb", ".gltf"], Fe = ["simready_usd", "asset", "usd"], Be = ["com.nvidia.simready.packaging.json", "manifest.json"];
634
+ function M(e) {
635
+ const t = e.lastIndexOf(".");
636
+ return t < 0 ? "" : e.slice(t).toLowerCase();
637
+ }
638
+ function B(e) {
639
+ return Ft.includes(M(e));
640
+ }
641
+ function Bt(e, t) {
642
+ const s = jt(e);
643
+ if (t === void 0) return s;
644
+ const r = e.files.find((o) => o.path === t && (B(o.path) || Ve.includes(M(o.path))));
645
+ return r ? { ...s, entryPath: r.path, reason: `${s.reason}; explicit entry ${r.path}` } : s;
646
+ }
647
+ function jt(e) {
648
+ var l;
649
+ const t = e.files.filter((d) => B(d.path)), s = t.find((d) => M(d.path) === ".usdz");
650
+ if (s)
651
+ return {
652
+ layout: "usdz",
653
+ entryPath: s.path,
654
+ reason: "self-contained .usdz archive"
655
+ };
656
+ const r = e.files.find((d) => Be.some((c) => d.path === c || d.path.endsWith(`/${c}`))), o = e.files.filter((d) => /(^|\/)payloads\//.test(d.path) && B(d.path)), n = Fe.some((d) => e.files.some((c) => c.path.startsWith(`${d}/`)));
657
+ if (t.length > 1 && (n || o.length > 0)) {
658
+ const d = Pe(t, e);
659
+ return {
660
+ layout: "simready-package",
661
+ entryPath: (d == null ? void 0 : d.path) ?? null,
662
+ reason: n ? "multi-layer package with a SimReady content directory" : "multi-layer package with payloads/"
663
+ };
664
+ }
665
+ if (t.length === 1)
666
+ return {
667
+ layout: "single-layer",
668
+ entryPath: t[0].path,
669
+ reason: r ? "single USD entry with a package manifest" : "single USD file"
670
+ };
671
+ const i = e.files.find((d) => Ve.includes(M(d.path)));
672
+ return i ? {
673
+ layout: "glb",
674
+ entryPath: i.path,
675
+ // A glTF/GLB has no USD representation yet; export must compile it first.
676
+ reason: "glTF/GLB source needs compilation to USD before export"
677
+ } : t.length > 1 ? {
678
+ layout: "simready-package",
679
+ entryPath: ((l = Pe(t, e)) == null ? void 0 : l.path) ?? null,
680
+ reason: "multi-layer USD package without a SimReady marker"
681
+ } : { layout: "single-layer", entryPath: null, reason: "no USD or glTF entry found" };
682
+ }
683
+ function Pe(e, t) {
684
+ var d;
685
+ const s = e.filter((c) => M(c.path) !== ".usdc"), r = s.length > 0 ? s : e, o = (c) => /(^|\/)(payloads|meshes|materials|physics|textures|variants)\//.test(c), n = r.filter((c) => !o(c.path)), i = t.rootName.toLowerCase(), l = (n.length > 0 ? n : r).map((c) => {
686
+ let a = c.path.split("/").length - 1;
687
+ return Fe.some((f) => c.path.startsWith(`${f}/`)) && (a -= 2), c.path.toLowerCase().includes(i) && (a -= 3), M(c.path) === ".usda" && (a -= 1), { file: c, score: a };
688
+ });
689
+ return l.sort((c, u) => c.score - u.score || c.file.path.localeCompare(u.file.path)), ((d = l[0]) == null ? void 0 : d.file) ?? null;
690
+ }
691
+ function Xs(e) {
692
+ const t = e.find((s) => Be.some((r) => s.path === r || s.path.endsWith(`/${r}`)));
693
+ return t != null && t.bytes ? new TextDecoder("utf-8").decode(t.bytes) : null;
694
+ }
695
+ function Kt(e, t, s) {
696
+ const r = /* @__PURE__ */ new Map(), o = [], n = /* @__PURE__ */ new Map();
697
+ for (const i of t) {
698
+ const l = n.get(i.fromPath) ?? [];
699
+ l.push(i), n.set(i.fromPath, l);
700
+ }
701
+ for (const i of e) {
702
+ const l = n.get(i.path);
703
+ if (!l || l.length === 0) continue;
704
+ let d = i.text;
705
+ for (const c of l) {
706
+ const u = `./${c.target}`;
707
+ d = Xt(d, c.target, u), o.push({
708
+ kind: "anchored-mdl-path",
709
+ detail: `${c.fromPath}: @${c.target}@ rewritten as @${u}@`,
710
+ at: s.now()
711
+ });
712
+ }
713
+ d !== i.text && r.set(i.path, d);
714
+ }
715
+ return { rewrites: r, repairs: o, unresolved: [] };
716
+ }
717
+ function Yt(e, t, s) {
718
+ const r = /* @__PURE__ */ new Map(), o = [], n = [], i = /* @__PURE__ */ new Map();
719
+ for (const l of t) {
720
+ const d = i.get(l.fromPath) ?? [];
721
+ d.push(l), i.set(l.fromPath, d);
722
+ }
723
+ for (const l of e) {
724
+ const d = i.get(l.path);
725
+ if (!d || d.length === 0) continue;
726
+ let c = l.text;
727
+ for (const u of d) {
728
+ const a = c;
729
+ if (c = Wt(c, u.target), c === a) {
730
+ n.push(u);
731
+ continue;
732
+ }
733
+ o.push({
734
+ kind: "stripped-external-uri",
735
+ detail: `${u.fromPath}: removed external reference ${u.target}`,
736
+ at: s.now()
737
+ });
738
+ }
739
+ c !== l.text && r.set(l.path, c);
740
+ }
741
+ return { rewrites: r, repairs: o, unresolved: n };
742
+ }
743
+ function Wt(e, t) {
744
+ const s = je(`@${t}@`), r = new RegExp(s), o = e.split(/\r?\n/), n = [];
745
+ let i = !1;
746
+ for (const l of o) {
747
+ if (!r.test(l)) {
748
+ n.push(l);
749
+ continue;
750
+ }
751
+ if (!Gt(l, s)) {
752
+ n.push(l);
753
+ continue;
754
+ }
755
+ i = !0;
756
+ }
757
+ return i ? n.join(`
758
+ `) : e;
759
+ }
760
+ function Gt(e, t) {
761
+ const s = e.trim().replace(/,$/, "");
762
+ return new RegExp(
763
+ `^[A-Za-z_:.]*\\s*(?:prepend|append|add|delete|reorder)?\\s*[A-Za-z_:.]*\\s*=\\s*${t}(?:\\s*<[^>]*>)?\\s*(?:#.*)?$`
764
+ ).test(s);
765
+ }
766
+ function Xt(e, t, s) {
767
+ const r = new RegExp(`@\\s*${je(t)}\\s*@`, "g");
768
+ return e.replace(r, `@${s}@`);
769
+ }
770
+ function Zs(e, t, s) {
771
+ return { kind: e, detail: t, at: s() };
772
+ }
773
+ function Zt(e) {
774
+ return [...e].sort((t, s) => t.kind.localeCompare(s.kind) || t.detail.localeCompare(s.detail) || t.at.localeCompare(s.at));
775
+ }
776
+ function je(e) {
777
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
778
+ }
779
+ const E = {
780
+ entryMissing: "ASSET_INTAKE_ENTRY_MISSING",
781
+ entryNotUsd: "ASSET_INTAKE_ENTRY_NOT_USD",
782
+ dependencyMissing: "ASSET_INTAKE_DEPENDENCY_MISSING",
783
+ externalReference: "ASSET_INTAKE_EXTERNAL_REFERENCE",
784
+ unanchoredReference: "ASSET_INTAKE_UNANCHORED_REFERENCE",
785
+ repairApplied: "ASSET_INTAKE_REPAIR_APPLIED",
786
+ annotationMissing: "ASSET_INTAKE_ANNOTATION_MISSING",
787
+ glbNeedsCompilation: "ASSET_INTAKE_GLB_NEEDS_COMPILATION",
788
+ physicsUnknown: "ASSET_INTAKE_PHYSICS_UNKNOWN",
789
+ materialModuleReference: "ASSET_INTAKE_MATERIAL_MODULE",
790
+ resourceBytesMissing: "ASSET_INTAKE_RESOURCE_BYTES_MISSING"
791
+ };
792
+ function qs(e, t, s = {}) {
793
+ var Ie, ve, Se, be, Ae;
794
+ const r = s.now ?? (() => (/* @__PURE__ */ new Date()).toISOString()), o = [], n = [], i = Bt(e, s.entryPath);
795
+ if (o.push({
796
+ code: "ASSET_INTAKE_LAYOUT",
797
+ level: "info",
798
+ message: `Detected layout ${i.layout}: ${i.reason}`
799
+ }), !i.entryPath)
800
+ return o.push({
801
+ code: E.entryMissing,
802
+ level: "error",
803
+ message: `No openable entry found in ${e.rootName}.`
804
+ }), { status: "blocked", record: null, rewrites: /* @__PURE__ */ new Map(), diagnostics: o };
805
+ const l = Ht(e), d = new Set(e.files.map((y) => Q(y.path))), c = de(l, d), u = qt(
806
+ i.entryPath,
807
+ c,
808
+ d,
809
+ l.some((y) => y.path === i.entryPath)
810
+ );
811
+ let a = l;
812
+ const f = /* @__PURE__ */ new Map();
813
+ if (c.unanchored.length > 0)
814
+ for (const y of c.unanchored)
815
+ o.push({
816
+ code: E.unanchoredReference,
817
+ level: "warning",
818
+ message: `${y.fromPath}: @${y.target}@ is not anchored; USD resolves it via a search path.`
819
+ });
820
+ const g = c.references.filter((y) => !y.external && !y.anchored), h = Kt(a, g, { now: r });
821
+ $e(f, h.rewrites), n.push(...h.repairs), a = we(a, h.rewrites);
822
+ for (const y of c.materialModules)
823
+ o.push({
824
+ code: E.materialModuleReference,
825
+ level: "info",
826
+ message: `${y.fromPath}: material module ${y.target} resolves from the host MDL search path, not the package.`
827
+ });
828
+ const p = Yt(a, c.external, { now: r });
829
+ $e(f, p.rewrites), n.push(...p.repairs), a = we(a, p.rewrites);
830
+ for (const y of c.external)
831
+ o.push({
832
+ code: E.externalReference,
833
+ level: p.unresolved.some((K) => K === y) ? "error" : "warning",
834
+ message: `${y.fromPath}: external reference ${y.target} cannot ship inside the package.`
835
+ });
836
+ const I = de(a, d), R = I.missing;
837
+ for (const y of R)
838
+ o.push({
839
+ code: E.dependencyMissing,
840
+ level: "error",
841
+ message: `${y.fromPath}: referenced file ${y.target} is not in the package.`
842
+ });
843
+ const _ = R.length > 0 || p.unresolved.length > 0 || I.external.length > 0;
844
+ _ && s.strict === !1 && o.push({
845
+ code: "ASSET_INTAKE_BLOCKING_OVERRIDDEN",
846
+ level: "warning",
847
+ message: "Structural problems were ignored because strict mode is off."
848
+ });
849
+ for (const y of n)
850
+ o.push({
851
+ code: E.repairApplied,
852
+ level: "info",
853
+ message: y.detail
854
+ });
855
+ i.layout === "glb" && o.push({
856
+ code: E.glbNeedsCompilation,
857
+ level: "warning",
858
+ message: "glTF/GLB assets must be compiled to USD before they can be exported."
859
+ });
860
+ const D = s.annotations ?? {}, ne = D.slug ?? Qt(e.rootName);
861
+ D.slug || o.push({
862
+ code: E.annotationMissing,
863
+ level: "info",
864
+ message: `slug defaulted to "${ne}"; confirm it before publishing.`
865
+ }), D.category || o.push({
866
+ code: E.annotationMissing,
867
+ level: "info",
868
+ message: "category is not inferable from file contents and must be annotated."
869
+ });
870
+ const z = (t == null ? void 0 : t.capability) ?? { hasPhysics: !1, hasArticulation: !1, hasColliderGeometry: !1, source: "none" };
871
+ if (t || o.push({
872
+ code: E.physicsUnknown,
873
+ level: "warning",
874
+ message: "No physics probe was supplied; the asset is recorded as carrying no physics."
875
+ }), _ && s.strict !== !1)
876
+ return { status: "blocked", record: null, rewrites: f, diagnostics: o };
877
+ const he = [.../* @__PURE__ */ new Set([i.entryPath, ...u])].sort(), Qe = new Map(e.files.map((y) => [Q(y.path), y])), X = [];
878
+ for (const y of he) {
879
+ const K = Qe.get(y), Re = f.get(y), ie = Re === void 0 ? K == null ? void 0 : K.bytes : new TextEncoder().encode(Re);
880
+ if (!ie) {
881
+ o.push({
882
+ code: E.resourceBytesMissing,
883
+ level: "error",
884
+ message: `${y}: resource bytes are required to calculate the immutable content hash.`
885
+ });
886
+ continue;
887
+ }
888
+ const Ee = N(ie);
889
+ X.push({
890
+ resourceId: at({ kind: "package-path", path: y }, Ee),
891
+ locator: { kind: "package-path", path: y },
892
+ mediaType: nt(y),
893
+ byteSize: ie.byteLength,
894
+ sha256: Ee
895
+ });
896
+ }
897
+ if (X.length !== he.length)
898
+ return { status: "blocked", record: null, rewrites: f, diagnostics: o };
899
+ const ye = X.find((y) => it(y.locator) === i.entryPath);
900
+ if (!ye)
901
+ return o.push({
902
+ code: E.resourceBytesMissing,
903
+ level: "error",
904
+ message: `${i.entryPath}: entry resource bytes are unavailable.`
905
+ }), { status: "blocked", record: null, rewrites: f, diagnostics: o };
906
+ const ae = D.category ?? "other", ge = D.label ?? e.rootName, Z = [], et = D.category || D.label || D.slug ? "annotated" : "imported", tt = pt({
907
+ assetId: `asset_${ne}`,
908
+ slug: ne,
909
+ label: ge,
910
+ layout: i.layout,
911
+ fileKind: Jt(i.entryPath) ? "glb" : "usd",
912
+ entryResourceId: ye.resourceId,
913
+ resources: X,
914
+ variantSets: (t == null ? void 0 : t.variantSets) ?? [],
915
+ capabilities: {
916
+ rendering: "supported",
917
+ physics: z.source === "usd-authored" ? "authored" : z.source === "none" ? "none" : "unknown",
918
+ articulation: z.hasArticulation,
919
+ rigidBody: z.hasPhysics || z.hasRigidBody === !0,
920
+ colliderGeometry: z.hasColliderGeometry
921
+ },
922
+ ...(Ie = t == null ? void 0 : t.measured) != null && Ie.bounds ? { bounds: t.measured.bounds } : {},
923
+ category: ae,
924
+ hints: {
925
+ ...t != null && t.approximateSize ? { approximateSize: t.approximateSize } : {},
926
+ ...t != null && t.forwardAxis ? { forwardAxis: t.forwardAxis } : {},
927
+ ...Z.length > 0 ? { tags: Z } : {}
928
+ },
929
+ ...((ve = t == null ? void 0 : t.measured) == null ? void 0 : ve.jointCount) !== void 0 || ((Se = t == null ? void 0 : t.measured) == null ? void 0 : Se.meshCount) !== void 0 ? {
930
+ metrics: {
931
+ ...((be = t.measured) == null ? void 0 : be.jointCount) !== void 0 ? { jointCount: t.measured.jointCount } : {},
932
+ ...((Ae = t.measured) == null ? void 0 : Ae.meshCount) !== void 0 ? { meshCount: t.measured.meshCount } : {}
933
+ }
934
+ } : {},
935
+ semantic: {
936
+ source: et,
937
+ labels: [ge],
938
+ taxonomy: [ae],
939
+ ...Z.length > 0 ? { tags: Z } : {},
940
+ category: ae
941
+ },
942
+ provenance: {
943
+ source: s.origin ?? "builtin",
944
+ sourceLabel: e.rootName,
945
+ ...s.origin === "user" || s.origin === "import" ? { importedAt: r() } : {},
946
+ ...D.externalRef ? { externalRef: { ...D.externalRef } } : {},
947
+ repairs: Zt(n)
948
+ }
949
+ });
950
+ return {
951
+ status: n.length > 0 ? "ready-with-repairs" : "ready",
952
+ record: tt,
953
+ rewrites: f,
954
+ diagnostics: o
955
+ };
956
+ }
957
+ function qt(e, t, s, r) {
958
+ const o = /* @__PURE__ */ new Map();
959
+ for (const l of t.references) {
960
+ if (l.resolvedPath === null) continue;
961
+ const d = o.get(l.fromPath) ?? [];
962
+ d.push(l.resolvedPath), o.set(l.fromPath, d);
963
+ }
964
+ const n = /* @__PURE__ */ new Set(), i = [e];
965
+ for (; i.length > 0; ) {
966
+ const l = i.pop();
967
+ for (const d of o.get(l) ?? [])
968
+ n.has(d) || !s.has(d) || (n.add(d), i.push(d));
969
+ }
970
+ if (B(e) && !r) {
971
+ for (const l of s)
972
+ l !== e && n.add(l);
973
+ return [...n].sort();
974
+ }
975
+ for (const l of s)
976
+ B(l) && !Me(l) && l !== e && n.add(l);
977
+ return [...n].sort();
978
+ }
979
+ function Ht(e) {
980
+ const t = [];
981
+ for (const s of [...e.files].sort((r, o) => r.path.localeCompare(o.path)))
982
+ B(s.path) && pe(s.path, s.bytes) && s.bytes && t.push({ path: s.path, text: new TextDecoder("utf-8").decode(s.bytes) });
983
+ return t;
984
+ }
985
+ function we(e, t) {
986
+ return e.map((s) => {
987
+ const r = t.get(s.path);
988
+ return r === void 0 ? s : { path: s.path, text: r };
989
+ });
990
+ }
991
+ function $e(e, t) {
992
+ for (const [s, r] of t) e.set(s, r);
993
+ }
994
+ function Jt(e) {
995
+ const t = M(e);
996
+ return t === ".glb" || t === ".gltf";
997
+ }
998
+ function Qt(e) {
999
+ return Array.from(e.normalize("NFKD")).map((s) => /[A-Za-z0-9]/.test(s) ? s.toLowerCase() : "-").join("").replace(/-+/g, "-").replace(/^-+|-+$/g, "") || "asset";
1000
+ }
1001
+ class Hs {
1002
+ constructor(t, s = {}) {
1003
+ T(this, "undoStack", []);
1004
+ T(this, "redoStack", []);
1005
+ T(this, "limit");
1006
+ T(this, "mergeWindowMs");
1007
+ T(this, "now");
1008
+ T(this, "timestamp");
1009
+ T(this, "doc");
1010
+ this.doc = V(t), this.limit = Math.max(1, s.limit ?? 200), this.mergeWindowMs = s.mergeWindowMs ?? 600, this.now = s.now ?? (() => Date.now()), this.timestamp = s.timestamp ?? (() => (/* @__PURE__ */ new Date()).toISOString());
1011
+ }
1012
+ get document() {
1013
+ return this.doc;
1014
+ }
1015
+ /** Current `meta.updatedAt` stamp, shared by every apply path. */
1016
+ stamp() {
1017
+ return this.timestamp();
1018
+ }
1019
+ getState() {
1020
+ const t = this.undoStack[this.undoStack.length - 1], s = this.redoStack[this.redoStack.length - 1];
1021
+ return {
1022
+ canUndo: this.undoStack.length > 0,
1023
+ canRedo: this.redoStack.length > 0,
1024
+ undoLabel: (t == null ? void 0 : t.label) ?? null,
1025
+ redoLabel: (s == null ? void 0 : s.label) ?? null,
1026
+ depth: this.undoStack.length
1027
+ };
1028
+ }
1029
+ /**
1030
+ * Applies a command and records it. A rejected command leaves both the
1031
+ * document and the history untouched.
1032
+ */
1033
+ apply(t) {
1034
+ const s = q(this.doc, t.payload, this.stamp());
1035
+ return s.diagnostics.some((r) => r.level === "error") ? { doc: this.doc, diagnostics: s.diagnostics, changed: !1 } : (this.doc = V(s.doc), this.redoStack.length = 0, this.record(t), { doc: this.doc, diagnostics: [], changed: !0 });
1036
+ }
1037
+ /** Applies several commands as one atomic step. */
1038
+ applyAll(t) {
1039
+ if (t.length === 0) return { doc: this.doc, diagnostics: [], changed: !1 };
1040
+ let s = this.doc;
1041
+ for (const o of t) {
1042
+ const n = q(s, o.payload, this.stamp());
1043
+ if (n.diagnostics.length > 0)
1044
+ return { doc: this.doc, diagnostics: n.diagnostics, changed: !1 };
1045
+ s = n.doc;
1046
+ }
1047
+ this.doc = V(s), this.redoStack.length = 0;
1048
+ const r = t[0].batchId;
1049
+ return this.undoStack.push({
1050
+ batchId: r,
1051
+ label: t[0].label,
1052
+ commands: [...t],
1053
+ at: this.now()
1054
+ }), this.trim(), { doc: this.doc, diagnostics: [], changed: !0 };
1055
+ }
1056
+ undo() {
1057
+ const t = this.undoStack.pop();
1058
+ if (!t) return { doc: this.doc, diagnostics: [], changed: !1 };
1059
+ let s = this.doc;
1060
+ for (const r of [...t.commands].reverse()) {
1061
+ const o = es(r);
1062
+ if (!o)
1063
+ return this.undoStack.push(t), {
1064
+ doc: this.doc,
1065
+ diagnostics: [{
1066
+ code: "HISTORY_NOT_INVERTIBLE",
1067
+ level: "error",
1068
+ message: `Command ${r.type} cannot be undone.`
1069
+ }],
1070
+ changed: !1
1071
+ };
1072
+ const n = q(s, o, this.stamp());
1073
+ if (n.diagnostics.length > 0)
1074
+ return this.undoStack.push(t), { doc: this.doc, diagnostics: n.diagnostics, changed: !1 };
1075
+ s = n.doc;
1076
+ }
1077
+ return this.doc = V(s), this.redoStack.push(t), { doc: this.doc, diagnostics: [], changed: !0 };
1078
+ }
1079
+ redo() {
1080
+ const t = this.redoStack.pop();
1081
+ if (!t) return { doc: this.doc, diagnostics: [], changed: !1 };
1082
+ let s = this.doc;
1083
+ for (const r of t.commands) {
1084
+ const o = q(s, r.payload, this.stamp());
1085
+ if (o.diagnostics.length > 0)
1086
+ return this.redoStack.push(t), { doc: this.doc, diagnostics: o.diagnostics, changed: !1 };
1087
+ s = o.doc;
1088
+ }
1089
+ return this.doc = V(s), this.undoStack.push(t), this.trim(), { doc: this.doc, diagnostics: [], changed: !0 };
1090
+ }
1091
+ clear() {
1092
+ this.undoStack.length = 0, this.redoStack.length = 0;
1093
+ }
1094
+ record(t) {
1095
+ V(t);
1096
+ const s = this.now(), r = this.undoStack[this.undoStack.length - 1];
1097
+ if (r && r.batchId === t.batchId && t.type === "node.transform" && r.commands.every((o) => o.type === "node.transform") && s - r.at <= this.mergeWindowMs) {
1098
+ this.undoStack[this.undoStack.length - 1] = {
1099
+ ...r,
1100
+ commands: [...r.commands, t],
1101
+ at: s
1102
+ };
1103
+ return;
1104
+ }
1105
+ this.undoStack.push({ batchId: t.batchId, label: t.label, commands: [t], at: s }), this.trim();
1106
+ }
1107
+ trim() {
1108
+ const t = this.undoStack.length - this.limit;
1109
+ t > 0 && this.undoStack.splice(0, t);
1110
+ }
1111
+ }
1112
+ function es(e) {
1113
+ const t = e.payload;
1114
+ switch (t.type) {
1115
+ case "node.add":
1116
+ return {
1117
+ type: "node.remove",
1118
+ nodeId: t.node.nodeId,
1119
+ parentNodeId: t.parentNodeId,
1120
+ removed: t.node
1121
+ };
1122
+ case "node.remove":
1123
+ return {
1124
+ type: "node.add",
1125
+ parentNodeId: t.parentNodeId,
1126
+ node: t.removed
1127
+ };
1128
+ case "node.transform":
1129
+ return { type: "node.transform", nodeId: t.nodeId, before: t.after, after: t.before };
1130
+ case "node.setOrigin":
1131
+ return {
1132
+ type: "node.setOrigin",
1133
+ nodeId: t.nodeId,
1134
+ before: t.after,
1135
+ after: t.before,
1136
+ beforeTransform: t.afterTransform,
1137
+ afterTransform: t.beforeTransform
1138
+ };
1139
+ case "node.reparent":
1140
+ return {
1141
+ type: "node.reparent",
1142
+ nodeId: t.nodeId,
1143
+ fromParentNodeId: t.toParentNodeId,
1144
+ toParentNodeId: t.fromParentNodeId,
1145
+ before: t.after,
1146
+ after: t.before
1147
+ };
1148
+ case "node.rename":
1149
+ return { type: "node.rename", nodeId: t.nodeId, before: t.after, after: t.before };
1150
+ case "node.setRole":
1151
+ return { type: "node.setRole", nodeId: t.nodeId, before: t.after, after: t.before };
1152
+ case "node.setPhysics":
1153
+ return { type: "node.setPhysics", nodeId: t.nodeId, before: t.after, after: t.before };
1154
+ case "node.setInitialPose":
1155
+ return { type: "node.setInitialPose", nodeId: t.nodeId, before: t.after, after: t.before };
1156
+ case "node.setAppearance":
1157
+ return { type: "node.setAppearance", nodeId: t.nodeId, before: t.after, after: t.before };
1158
+ case "node.setVisible":
1159
+ return { type: "node.setVisible", nodeId: t.nodeId, before: t.after, after: t.before };
1160
+ case "placeholder.bind":
1161
+ return {
1162
+ type: "placeholder.bind",
1163
+ nodeId: t.nodeId,
1164
+ before: t.after,
1165
+ after: t.before
1166
+ };
1167
+ case "node.replaceModel":
1168
+ return {
1169
+ type: "node.replaceModel",
1170
+ nodeId: t.nodeId,
1171
+ parentNodeId: t.parentNodeId,
1172
+ before: t.after,
1173
+ after: t.before
1174
+ };
1175
+ case "node.setVariants":
1176
+ return { type: "node.setVariants", nodeId: t.nodeId, before: t.after, after: t.before };
1177
+ case "node.setSemantic":
1178
+ return { type: "node.setSemantic", nodeId: t.nodeId, before: t.after, after: t.before };
1179
+ case "node.setDomainData":
1180
+ return {
1181
+ type: "node.setDomainData",
1182
+ nodeId: t.nodeId,
1183
+ before: t.after,
1184
+ after: t.before
1185
+ };
1186
+ case "node.duplicate":
1187
+ return {
1188
+ type: "node.remove",
1189
+ nodeId: t.created.nodeId,
1190
+ parentNodeId: t.parentNodeId,
1191
+ removed: t.created
1192
+ };
1193
+ case "asset.add":
1194
+ return { type: "asset.remove", revisionId: t.revision.revisionId, removed: t.revision };
1195
+ case "asset.remove":
1196
+ return { type: "asset.add", revision: t.removed };
1197
+ case "meta.update":
1198
+ return { type: "meta.update", before: t.after, after: t.before };
1199
+ case "coordinateSystem.update":
1200
+ return { type: "coordinateSystem.update", before: t.after, after: t.before };
1201
+ case "environment.update":
1202
+ return { type: "environment.update", before: t.after, after: t.before };
1203
+ case "semantic.update":
1204
+ return { type: "semantic.update", before: t.after, after: t.before };
1205
+ case "domain.update":
1206
+ return {
1207
+ type: "domain.update",
1208
+ domainId: t.domainId,
1209
+ before: t.after,
1210
+ after: t.before
1211
+ };
1212
+ case "extension.set":
1213
+ return { type: "extension.set", key: t.key, before: t.after, after: t.before };
1214
+ default:
1215
+ return null;
1216
+ }
1217
+ }
1218
+ const ts = /^[a-f0-9]{64}$/;
1219
+ function Ke(e) {
1220
+ var c;
1221
+ const t = e.files.map((u) => ({
1222
+ locator: $(u.locator),
1223
+ sha256: u.sha256.toLowerCase(),
1224
+ mediaType: u.mediaType,
1225
+ byteSize: u.byteSize
1226
+ })).sort((u, a) => m(u.locator).localeCompare(m(a.locator))), s = $(e.entryLocator), r = m(s);
1227
+ if (!t.some((u) => m(u.locator) === r))
1228
+ throw new Error(`Source entry is missing from its file set: ${r}`);
1229
+ if (t.some((u) => !ts.test(u.sha256)))
1230
+ throw new Error("Source file SHA-256 values must be lower-case 64-character hashes.");
1231
+ const o = new Set(t.map((u) => m(u.locator))), n = /* @__PURE__ */ new Map();
1232
+ for (const u of e.dependencies ?? []) {
1233
+ const a = {
1234
+ from: $(u.from),
1235
+ to: $(u.to),
1236
+ kind: u.kind
1237
+ };
1238
+ n.set(
1239
+ `${m(a.from)}\0${m(a.to)}\0${a.kind}`,
1240
+ a
1241
+ );
1242
+ }
1243
+ const i = [...n.values()].sort(rs);
1244
+ for (const u of i) {
1245
+ const a = m(u.from), f = m(u.to);
1246
+ if (!o.has(a) || !o.has(f))
1247
+ throw new Error(`Source dependency edge references an unknown file: ${a} -> ${f}`);
1248
+ }
1249
+ const l = ((c = e.declaredSubresource) == null ? void 0 : c.trim()) || r;
1250
+ return {
1251
+ sourceRevisionId: N(U({
1252
+ sourceFormat: e.sourceFormat,
1253
+ entryLocator: s,
1254
+ files: t,
1255
+ dependencies: i,
1256
+ declaredSubresource: l
1257
+ })),
1258
+ sourceFormat: e.sourceFormat,
1259
+ entryLocator: s,
1260
+ files: t,
1261
+ dependencies: i,
1262
+ declaredSubresource: l
1263
+ };
1264
+ }
1265
+ function Ye(e) {
1266
+ const t = ss(e.runtimeRevision);
1267
+ return {
1268
+ interpretationRevisionId: N(U({
1269
+ sourceRevisionId: e.sourceRevisionId,
1270
+ adapter: e.adapter,
1271
+ normalization: e.normalization,
1272
+ facts: t,
1273
+ variantPayloads: De(e.variantPayloads)
1274
+ })),
1275
+ adapter: e.adapter,
1276
+ normalization: e.normalization,
1277
+ runtimeRevision: e.runtimeRevision,
1278
+ variantPayloads: De(e.variantPayloads)
1279
+ };
1280
+ }
1281
+ function W(e) {
1282
+ const t = e.replaceAll("\\", "/");
1283
+ if (!t || t.startsWith("/") || /^[a-zA-Z]:\//.test(t))
1284
+ throw new Error(`Package paths must be relative: ${e}`);
1285
+ const s = [];
1286
+ for (const r of t.split("/"))
1287
+ if (!(!r || r === ".")) {
1288
+ if (r === "..") throw new Error(`Package paths must not escape their root: ${e}`);
1289
+ s.push(r);
1290
+ }
1291
+ if (s.length === 0) throw new Error(`Package path is empty: ${e}`);
1292
+ return s.join("/");
1293
+ }
1294
+ function Js(e) {
1295
+ return N(U(e));
1296
+ }
1297
+ function ss(e) {
1298
+ return "visualRevisionId" in e ? {
1299
+ format: e.format,
1300
+ capabilities: e.capabilities,
1301
+ upAxis: e.upAxis,
1302
+ suggestedScale: e.suggestedScale,
1303
+ bounds: e.bounds ?? null,
1304
+ metrics: e.metrics ?? null
1305
+ } : {
1306
+ layout: e.layout,
1307
+ fileKind: e.fileKind,
1308
+ capabilities: e.capabilities,
1309
+ variantSets: e.variantSets,
1310
+ bounds: e.bounds ?? null,
1311
+ metrics: e.metrics ?? null,
1312
+ category: e.category ?? null,
1313
+ semantic: e.semantic ?? null
1314
+ };
1315
+ }
1316
+ function De(e) {
1317
+ return Object.fromEntries(
1318
+ Object.entries(e ?? {}).sort(([t], [s]) => t.localeCompare(s)).map(([t, s]) => [
1319
+ t,
1320
+ Object.fromEntries(
1321
+ Object.entries(s).sort(([r], [o]) => r.localeCompare(o)).map(([r, o]) => [r, [...new Set(o)].sort()])
1322
+ )
1323
+ ])
1324
+ );
1325
+ }
1326
+ function rs(e, t) {
1327
+ return m(e.from).localeCompare(m(t.from)) || m(e.to).localeCompare(m(t.to)) || e.kind.localeCompare(t.kind);
1328
+ }
1329
+ async function os(e, t = {}) {
1330
+ var u;
1331
+ const s = await Promise.all(e.files.map(async (a) => ({
1332
+ locator: $(a.locator),
1333
+ path: k(a.locator),
1334
+ bytes: new Uint8Array(await a.blob.arrayBuffer())
1335
+ }))), r = new Map(s.map((a) => [a.path, a])), o = ht(e);
1336
+ if (!r.has(o))
1337
+ throw new Error(`Source entry is missing from its file set: ${o}`);
1338
+ const n = new Map(
1339
+ s.filter((a) => pe(a.path, a.bytes)).map((a) => [a.path, new TextDecoder("utf-8").decode(a.bytes)])
1340
+ ), i = de(
1341
+ [...n].map(([a, f]) => ({ path: a, text: f })),
1342
+ new Set(r.keys())
1343
+ ), l = /* @__PURE__ */ new Map(), d = s.map((a) => a.locator);
1344
+ for (const a of i.references) {
1345
+ if (a.kind === "material-module") continue;
1346
+ const f = r.get(a.fromPath);
1347
+ if (!f) continue;
1348
+ const g = Ce(
1349
+ f.locator,
1350
+ a.target,
1351
+ d
1352
+ );
1353
+ if (!g)
1354
+ throw new Error(
1355
+ `USD source has an unresolved or external reference: ${a.fromPath} -> ${a.target}`
1356
+ );
1357
+ const h = s.find((p) => m(p.locator) === m(g));
1358
+ if (!h)
1359
+ throw new Error(
1360
+ `USD source has an unresolved or external reference: ${a.fromPath} -> ${a.target}`
1361
+ );
1362
+ ke(l, {
1363
+ from: f.locator,
1364
+ to: h.locator,
1365
+ kind: as(a, n.get(a.fromPath) ?? "")
1366
+ });
1367
+ }
1368
+ const c = r.get(o);
1369
+ if (c && !n.has(o) && s.length > 1 && is(o) && (((u = t.explicitDependencies) == null ? void 0 : u.length) ?? 0) === 0)
1370
+ for (const a of s)
1371
+ a.path !== o && ke(l, {
1372
+ from: c.locator,
1373
+ to: a.locator,
1374
+ kind: "other"
1375
+ });
1376
+ return [...l.values()].sort(cs);
1377
+ }
1378
+ function ns(e, t) {
1379
+ const s = new Set(e.map(ue)), r = t.filter((o) => !s.has(ue(o)));
1380
+ if (r.length > 0)
1381
+ throw new Error(
1382
+ `Explicit source dependencies omit scanned USD topology: ${r.map((o) => `${m(o.from)} -> ${m(o.to)} (${o.kind})`).join(", ")}`
1383
+ );
1384
+ }
1385
+ function ke(e, t) {
1386
+ e.set(ue(t), t);
1387
+ }
1388
+ function as(e, t) {
1389
+ if (e.kind === "material-module") return "material-module";
1390
+ const s = `@${e.target}@`, r = t.indexOf(s);
1391
+ if (r < 0) return "other";
1392
+ const o = t.slice(Math.max(0, r - 180), r);
1393
+ return /\bsubLayers\s*=\s*\[[^\]]*$/is.test(o) ? "sublayer" : /\bpayload\s*=\s*(?:\[[^\]]*)?$/is.test(o) ? "payload" : /\b(?:inputs:file|sourceAsset)\s*=\s*$/is.test(o) ? "texture" : /\breferences\s*=\s*(?:\[[^\]]*)?$/is.test(o) ? "reference" : "other";
1394
+ }
1395
+ function ue(e) {
1396
+ return `${m(e.from)}\0${m(e.to)}\0${e.kind}`;
1397
+ }
1398
+ function is(e) {
1399
+ return /\.(?:usd|usda|usdc|usdz)$/i.test(e);
1400
+ }
1401
+ function cs(e, t) {
1402
+ return m(e.from).localeCompare(m(t.from)) || m(e.to).localeCompare(m(t.to)) || e.kind.localeCompare(t.kind);
1403
+ }
1404
+ const ls = /^[a-f0-9]{64}$/;
1405
+ async function Qs(e) {
1406
+ const t = [];
1407
+ for (const s of e.assets) {
1408
+ const r = [];
1409
+ for (const c of s.source.files) {
1410
+ const u = new Uint8Array(await c.blob.arrayBuffer());
1411
+ r.push({
1412
+ locator: $(c.locator),
1413
+ sha256: N(u),
1414
+ mediaType: lt(
1415
+ k(c.locator),
1416
+ c.blob.type
1417
+ ) ?? ct,
1418
+ byteSize: u.byteLength
1419
+ });
1420
+ }
1421
+ const o = await os(s.source, {
1422
+ explicitDependencies: s.dependencies
1423
+ });
1424
+ s.dependencies !== void 0 && ns(
1425
+ s.dependencies,
1426
+ o
1427
+ );
1428
+ const n = Ke({
1429
+ sourceFormat: s.sourceFormat ?? ds(s.asset),
1430
+ entryLocator: s.source.entryLocator,
1431
+ files: r,
1432
+ dependencies: s.dependencies ?? o,
1433
+ declaredSubresource: s.declaredSubresource
1434
+ }), i = s.adapter ?? {
1435
+ id: "sim-studio.m1.source-facts",
1436
+ version: "1"
1437
+ }, l = s.normalization ?? {
1438
+ upAxis: "visualRevisionId" in s.asset ? s.asset.upAxis : "z",
1439
+ unitScale: 1,
1440
+ originPolicy: "source"
1441
+ }, d = Ye({
1442
+ sourceRevisionId: n.sourceRevisionId,
1443
+ adapter: i,
1444
+ normalization: l,
1445
+ runtimeRevision: s.asset,
1446
+ variantPayloads: s.variantPayloads
1447
+ });
1448
+ t.push({
1449
+ assetId: s.asset.assetId,
1450
+ label: s.asset.label,
1451
+ kind: "visualRevisionId" in s.asset ? "visual" : "usd",
1452
+ source: n,
1453
+ interpretation: d,
1454
+ deliveryArtifacts: [...s.deliveryArtifacts ?? []]
1455
+ });
1456
+ }
1457
+ return {
1458
+ format: "sim-studio.asset-catalog@3",
1459
+ schemaVersion: 3,
1460
+ entries: t.sort((s, r) => s.assetId.localeCompare(r.assetId) || s.source.sourceRevisionId.localeCompare(r.source.sourceRevisionId)),
1461
+ deliveryLocks: [...e.deliveryLocks ?? []].sort((s, r) => s.assetId.localeCompare(r.assetId) || s.profileId.localeCompare(r.profileId) || s.artifactId.localeCompare(r.artifactId))
1462
+ };
1463
+ }
1464
+ function er(e) {
1465
+ if (!C(e) || e.format !== "sim-studio.asset-catalog@3" || e.schemaVersion !== 3 || !Array.isArray(e.entries) || !Array.isArray(e.deliveryLocks))
1466
+ throw new Error("Asset catalog format or structure is invalid.");
1467
+ const t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
1468
+ for (const r of e.entries) {
1469
+ if (!C(r) || typeof r.assetId != "string" || r.assetId.length === 0 || typeof r.label != "string" || r.kind !== "usd" && r.kind !== "visual" || !C(r.source) || typeof r.source.sourceFormat != "string" || r.source.sourceFormat.length === 0 || !C(r.source.entryLocator) || typeof r.source.declaredSubresource != "string" || !Array.isArray(r.source.files) || !Array.isArray(r.source.dependencies) || !C(r.interpretation) || !C(r.interpretation.runtimeRevision) || !Array.isArray(r.deliveryArtifacts))
1470
+ throw new Error("Asset catalog entry structure is invalid.");
1471
+ const o = r;
1472
+ for (const a of o.source.files)
1473
+ if (!C(a) || !C(a.locator) || typeof a.sha256 != "string" || !ls.test(a.sha256) || typeof a.mediaType != "string" || a.mediaType.length === 0 || typeof a.byteSize != "number" || !Number.isInteger(a.byteSize) || a.byteSize < 0)
1474
+ throw new Error(`Asset catalog source file facts are invalid: ${o.assetId}.`);
1475
+ let n;
1476
+ try {
1477
+ n = Ke({
1478
+ sourceFormat: o.source.sourceFormat,
1479
+ entryLocator: o.source.entryLocator,
1480
+ files: o.source.files,
1481
+ dependencies: o.source.dependencies,
1482
+ declaredSubresource: o.source.declaredSubresource
1483
+ });
1484
+ } catch (a) {
1485
+ throw new Error(
1486
+ `Asset catalog source is invalid for ${o.assetId}: ${us(a)}`
1487
+ );
1488
+ }
1489
+ if (n.sourceRevisionId !== o.source.sourceRevisionId)
1490
+ throw new Error(`Asset catalog sourceRevisionId does not match its source facts: ${o.assetId}.`);
1491
+ if (s.has(o.source.sourceRevisionId))
1492
+ throw new Error(
1493
+ `Asset catalog repeats sourceRevisionId ${o.source.sourceRevisionId}; node references would be ambiguous.`
1494
+ );
1495
+ s.add(o.source.sourceRevisionId);
1496
+ const i = o.interpretation.runtimeRevision, l = "visualRevisionId" in i ? "visual" : "usd", d = "visualRevisionId" in i ? i.visualRevisionId : i.revisionId;
1497
+ if (o.kind !== l || typeof d != "string" || d.length === 0 || i.assetId !== o.assetId)
1498
+ throw new Error(`Asset catalog runtime revision is inconsistent: ${o.assetId}.`);
1499
+ const c = `${l}\0${d}`;
1500
+ if (t.has(c))
1501
+ throw new Error(`Asset catalog repeats runtime revision ${d}.`);
1502
+ if (t.add(c), Ye({
1503
+ sourceRevisionId: o.source.sourceRevisionId,
1504
+ adapter: o.interpretation.adapter,
1505
+ normalization: o.interpretation.normalization,
1506
+ runtimeRevision: i,
1507
+ variantPayloads: o.interpretation.variantPayloads
1508
+ }).interpretationRevisionId !== o.interpretation.interpretationRevisionId)
1509
+ throw new Error(
1510
+ `Asset catalog interpretationRevisionId does not match its interpretation facts: ${o.assetId}.`
1511
+ );
1512
+ }
1513
+ }
1514
+ function tr(e, t) {
1515
+ return e.entries.find((s) => {
1516
+ const r = s.interpretation.runtimeRevision;
1517
+ return "visualRevisionId" in t ? "visualRevisionId" in r && r.visualRevisionId === t.visualRevisionId : "revisionId" in r && r.revisionId === t.revisionId;
1518
+ }) ?? null;
1519
+ }
1520
+ function ds(e) {
1521
+ return "visualRevisionId" in e ? e.format : e.fileKind;
1522
+ }
1523
+ function C(e) {
1524
+ return typeof e == "object" && e !== null && !Array.isArray(e);
1525
+ }
1526
+ function us(e) {
1527
+ return e instanceof Error ? e.message : String(e);
1528
+ }
1529
+ const sr = Object.freeze({
1530
+ format: "sim-studio.delivery-profile@1",
1531
+ schemaVersion: 1,
1532
+ profileId: "isaac-sim",
1533
+ profileVersion: "m1",
1534
+ target: "isaac-sim",
1535
+ stage: {
1536
+ upAxis: "Z",
1537
+ metersPerUnit: 1,
1538
+ kilogramsPerUnit: 1,
1539
+ defaultPrim: "World"
1540
+ },
1541
+ variants: {
1542
+ preferred: Object.freeze({ Physics: "physx" }),
1543
+ conflictPolicy: "block",
1544
+ fallbackPolicy: "source-authored-default"
1545
+ },
1546
+ visualArtifactPolicy: "require-resolved-artifact"
1547
+ });
1548
+ function fs(e) {
1549
+ return We(e), N(U(e));
1550
+ }
1551
+ function We(e) {
1552
+ if (e.format !== "sim-studio.delivery-profile@1" || e.schemaVersion !== 1)
1553
+ throw new Error("Unsupported delivery profile format.");
1554
+ if (e.target !== "isaac-sim") throw new Error(`Unsupported delivery target: ${e.target}.`);
1555
+ if (e.stage.upAxis !== "Z" || e.stage.metersPerUnit !== 1 || e.stage.kilogramsPerUnit !== 1 || e.stage.defaultPrim !== "World")
1556
+ throw new Error("M1 delivery profile requires Z-up metres/kilograms and World defaultPrim.");
1557
+ if (e.variants.conflictPolicy !== "block")
1558
+ throw new Error("M1 variant conflict policy must be block.");
1559
+ if (e.variants.fallbackPolicy !== "source-authored-default")
1560
+ throw new Error("M1 variant fallback policy must preserve the source-authored default.");
1561
+ if (e.visualArtifactPolicy !== "require-resolved-artifact")
1562
+ throw new Error("M1 visual nodes require resolved delivery artifacts.");
1563
+ }
1564
+ const ps = /^[A-Za-z_][A-Za-z0-9_]*$/;
1565
+ function ms(e) {
1566
+ const t = [...e].sort((i, l) => w(i.instanceId, l.instanceId)), s = /* @__PURE__ */ new Set(["World", "PhysicsScene"]), r = /* @__PURE__ */ new Map(), o = [];
1567
+ let n = 0;
1568
+ for (const i of t) {
1569
+ const l = j(i.label), d = l === null, c = l ?? `Instance${n += 1}`, u = hs(c, s);
1570
+ s.add(u), r.set(i.instanceId, u), u !== i.label && o.push({ instanceId: i.instanceId, from: i.label, to: u, fallback: d });
1571
+ }
1572
+ return { byInstanceId: r, renames: o };
1573
+ }
1574
+ function j(e) {
1575
+ const t = Array.from(e.normalize("NFKC")).map((r) => /[A-Za-z0-9_]/.test(r) ? r : "_").join("").replace(/_+/g, "_").replace(/^_+|_+$/g, "");
1576
+ if (!t) return null;
1577
+ const s = /^[0-9]/.test(t) ? `_${t}` : t;
1578
+ return ps.test(s) ? s : null;
1579
+ }
1580
+ function Ge(e, t) {
1581
+ const s = Array.from(e.normalize("NFKC")).map((o) => /[A-Za-z0-9]/.test(o) ? o.toLowerCase() : "-").join("").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
1582
+ return s && /[a-z]/.test(s) ? s : `asset-${t.replace(/[^a-zA-Z0-9]/g, "").toLowerCase().replace(/^asset/, "") || "item"}`;
1583
+ }
1584
+ function hs(e, t) {
1585
+ if (!t.has(e)) return e;
1586
+ let s = 2;
1587
+ for (; t.has(`${e}_${s}`); ) s += 1;
1588
+ return `${e}_${s}`;
1589
+ }
1590
+ const ys = "sim-studio.usd-delivery-plan@4", Ne = /^[a-f0-9]{64}$/;
1591
+ function Xe(e) {
1592
+ Ze(e);
1593
+ const { planDigest: t, ...s } = e;
1594
+ return N(U(s));
1595
+ }
1596
+ function rr(e) {
1597
+ if (Ze(e), !Ne.test(e.planDigest))
1598
+ throw Object.assign(
1599
+ new Error("USD delivery plan digest must be a lowercase SHA-256 value."),
1600
+ { code: "USD_DELIVERY_PLAN_DIGEST_INVALID" }
1601
+ );
1602
+ const t = Xe(e);
1603
+ if (e.planDigest !== t)
1604
+ throw Object.assign(
1605
+ new Error("USD delivery plan content does not match planDigest."),
1606
+ {
1607
+ code: "USD_DELIVERY_PLAN_DIGEST_MISMATCH",
1608
+ detail: {
1609
+ expectedDigest: t,
1610
+ actualDigest: e.planDigest
1611
+ }
1612
+ }
1613
+ );
1614
+ if (!Array.isArray(e.resources))
1615
+ throw x("USD delivery plan resources must be an array.");
1616
+ const s = /* @__PURE__ */ new Map();
1617
+ for (const r of e.resources) {
1618
+ if (!r || typeof r != "object" || typeof r.outputPath != "string" || !Ne.test(String(r.sourceSha256)) || !Number.isSafeInteger(r.sourceByteSize) || r.sourceByteSize < 0)
1619
+ throw x("USD delivery plan contains invalid resource facts.");
1620
+ const o = r.outputPath;
1621
+ if (!gs(o))
1622
+ throw x(`USD delivery plan contains unsafe resource path: ${o}.`);
1623
+ const n = o.toLowerCase(), i = s.get(n);
1624
+ if (i !== void 0)
1625
+ throw Object.assign(
1626
+ new Error(
1627
+ i === o ? `USD delivery plan repeats resource output path: ${o}.` : `USD delivery plan has a case-insensitive resource path collision: ${i}, ${o}.`
1628
+ ),
1629
+ { code: "USD_DELIVERY_PLAN_RESOURCE_PATH_CONFLICT" }
1630
+ );
1631
+ s.set(n, o);
1632
+ const l = r.outputTransform;
1633
+ if (!l || typeof l != "object" || l.kind !== "identity" && l.kind !== "canonicalize-usdz")
1634
+ throw x(
1635
+ `USD delivery plan contains an invalid outputTransform for resource: ${o}.`
1636
+ );
1637
+ if (o.toLowerCase().endsWith(".usdz") && l.kind !== "canonicalize-usdz")
1638
+ throw x(
1639
+ `USD delivery plan must canonicalize nested USDZ resource: ${o}.`
1640
+ );
1641
+ if (!o.toLowerCase().endsWith(".usdz") && l.kind === "canonicalize-usdz")
1642
+ throw x(
1643
+ `USD delivery plan cannot canonicalize a non-USDZ resource: ${o}.`
1644
+ );
1645
+ }
1646
+ if (e.outcome !== "blocked" && Array.isArray(e.diagnostics) && e.diagnostics.some((r) => r.severity === "error"))
1647
+ throw x("A supported or degraded USD delivery plan cannot contain error diagnostics.");
1648
+ }
1649
+ function Ze(e) {
1650
+ if (!e || typeof e != "object" || !("format" in e) || e.format !== ys || !("schemaVersion" in e) || e.schemaVersion !== 4)
1651
+ throw Object.assign(
1652
+ new Error("USD delivery plan must use format sim-studio.usd-delivery-plan@4 schemaVersion 4."),
1653
+ { code: "UNSUPPORTED_USD_DELIVERY_PLAN_FORMAT" }
1654
+ );
1655
+ }
1656
+ function gs(e) {
1657
+ return !e || e.startsWith("/") || e.includes("\\") || /^[A-Za-z]:/.test(e) || e.includes("\0") || e.includes("?") || e.includes("#") ? !1 : e.split("/").every((t) => t.length > 0 && t !== "." && t !== "..");
1658
+ }
1659
+ function x(e) {
1660
+ return Object.assign(new Error(e), {
1661
+ code: "USD_DELIVERY_PLAN_CONTRACT_INVALID"
1662
+ });
1663
+ }
1664
+ function or(e) {
1665
+ We(e.profile);
1666
+ const t = [], s = /* @__PURE__ */ new Map(), r = new Map(e.assetCatalog.entries.map((a) => [
1667
+ a.source.sourceRevisionId,
1668
+ a
1669
+ ])), o = J(
1670
+ fe(e.document.root).filter((a) => a.nodeType === "group" || a.nodeType === "asset" || a.nodeType === "visual"),
1671
+ (a, f) => w(a.nodeId, f.nodeId)
1672
+ ), n = ms(o.filter((a) => a.nodeId !== e.document.root.nodeId).map((a) => ({
1673
+ instanceId: a.nodeId,
1674
+ label: a.label
1675
+ })));
1676
+ for (const a of fe(e.document.root))
1677
+ a.nodeType === "placeholder" ? t.push(v(
1678
+ "USD_DELIVERY_PLACEHOLDER_BLOCKED",
1679
+ "error",
1680
+ `Placeholder ${a.label} cannot enter a resolved USD delivery plan.`,
1681
+ a.nodeId
1682
+ )) : a.nodeType === "domain" && t.push(v(
1683
+ "USD_DELIVERY_DOMAIN_BLOCKED",
1684
+ "error",
1685
+ `Domain node ${a.label} has no M1 USD delivery adapter for ${a.domainId}.`,
1686
+ a.nodeId
1687
+ ));
1688
+ const l = ((a, f, g = !1) => {
1689
+ const p = `/${g ? e.profile.stage.defaultPrim : n.byInstanceId.get(a.nodeId) ?? j(a.label) ?? "Group"}`, I = J(
1690
+ a.children.filter((R) => R.nodeType === "group" || R.nodeType === "asset" || R.nodeType === "visual"),
1691
+ (R, _) => w(R.nodeId, _.nodeId)
1692
+ ).flatMap((R) => qe(R, p, e, t, s, r, n.byInstanceId));
1693
+ return {
1694
+ nodeId: a.nodeId,
1695
+ primPath: p,
1696
+ nodeKind: "group",
1697
+ typeName: "Xform",
1698
+ attributes: re(a.localTransform),
1699
+ ...oe(a),
1700
+ visible: !0,
1701
+ children: I
1702
+ };
1703
+ })(e.document.root, "/", !0);
1704
+ Ps(r, s, t), _s(s, t);
1705
+ const d = Cs(t), c = bs(e.document.environment.physics.gravity), u = {
1706
+ format: "sim-studio.usd-delivery-plan@4",
1707
+ schemaVersion: 4,
1708
+ sourcePackageDigest: e.sourcePackageDigest,
1709
+ profileDigest: fs(e.profile),
1710
+ profile: {
1711
+ profileId: e.profile.profileId,
1712
+ profileVersion: e.profile.profileVersion
1713
+ },
1714
+ stage: {
1715
+ defaultPrim: l.primPath.slice(1),
1716
+ upAxis: e.profile.stage.upAxis,
1717
+ metersPerUnit: e.profile.stage.metersPerUnit,
1718
+ kilogramsPerUnit: e.profile.stage.kilogramsPerUnit,
1719
+ physicsScene: c
1720
+ },
1721
+ nodes: [l],
1722
+ resources: J([...s.values()], (a, f) => w(a.outputPath, f.outputPath) || w(a.sourceSha256, f.sourceSha256)),
1723
+ diagnostics: xs(t),
1724
+ outcome: d
1725
+ };
1726
+ return {
1727
+ ...u,
1728
+ planDigest: Xe(u)
1729
+ };
1730
+ }
1731
+ function qe(e, t, s, r, o, n, i) {
1732
+ const l = `/${s.profile.stage.defaultPrim}/PhysicsScene`, d = i.get(e.nodeId) ?? j(e.label);
1733
+ if ((t === "/" ? `/${d ?? "Node"}` : `${t}/${d ?? "Node"}`) === l && r.push(v(
1734
+ "USD_EXPORT_PHYSICS_SCENE_NAME_CONFLICT",
1735
+ "error",
1736
+ `Node ${e.label} collides with the required root PhysicsScene prim.`,
1737
+ e.nodeId
1738
+ )), e.nodeType === "group") {
1739
+ const u = i.get(e.nodeId) ?? j(e.label) ?? "Group", a = t === "/" ? `/${u}` : `${t}/${u}`;
1740
+ return [{
1741
+ nodeId: e.nodeId,
1742
+ primPath: a,
1743
+ nodeKind: "group",
1744
+ typeName: "Xform",
1745
+ attributes: re(e.localTransform),
1746
+ ...oe(e),
1747
+ visible: !0,
1748
+ children: e.children.flatMap((f) => qe(f, a, s, r, o, n, i))
1749
+ }];
1750
+ }
1751
+ return e.nodeType === "asset" ? Is(
1752
+ e,
1753
+ t,
1754
+ s,
1755
+ r,
1756
+ o,
1757
+ n,
1758
+ i
1759
+ ) : e.nodeType === "visual" ? vs(
1760
+ e,
1761
+ t,
1762
+ s,
1763
+ r,
1764
+ o,
1765
+ n,
1766
+ i
1767
+ ) : [];
1768
+ }
1769
+ function Is(e, t, s, r, o, n, i) {
1770
+ const l = ut(s.document, e.assetRevisionId), d = l ? He(s.assetCatalog, l) : null;
1771
+ if (!l || !d)
1772
+ return r.push(v(
1773
+ "USD_DELIVERY_ASSET_SOURCE_MISSING",
1774
+ "error",
1775
+ `Asset node ${e.label} has no matching AssetCatalog source.`,
1776
+ e.nodeId,
1777
+ e.assetRevisionId
1778
+ )), [];
1779
+ const c = Es(e, d, s.profile.variants.preferred, r);
1780
+ if (!c.ok) return [];
1781
+ const u = i.get(e.nodeId) ?? j(e.label) ?? "Asset", a = t === "/" ? `/${u}` : `${t}/${u}`;
1782
+ Je(e, a, r);
1783
+ const f = As(e, a, d, r);
1784
+ if (!f) return [];
1785
+ const g = $(d.source.entryLocator);
1786
+ if (g.kind === "remote-url")
1787
+ return r.push(v(
1788
+ "USD_EXPORT_REMOTE_NATIVE_REFERENCE_BLOCKED",
1789
+ "error",
1790
+ `Asset node ${e.label} uses a remote native USD source. Offline USD export requires a closed local resource set.`,
1791
+ e.nodeId,
1792
+ d.assetId
1793
+ )), [];
1794
+ const h = `assets/${Ge(d.label, d.assetId)}/${d.source.sourceRevisionId.slice(0, 16)}`, p = Ds(d, g), I = `${h}/${p}`, R = m(g);
1795
+ for (const _ of d.source.files)
1796
+ Ns(
1797
+ o,
1798
+ d,
1799
+ _,
1800
+ `${h}/${m(_.locator) === R ? p : F(_.locator)}`
1801
+ );
1802
+ return [{
1803
+ nodeId: e.nodeId,
1804
+ primPath: a,
1805
+ nodeKind: "reference",
1806
+ typeName: "Xform",
1807
+ assetId: d.assetId,
1808
+ sourceRevisionId: d.source.sourceRevisionId,
1809
+ reference: {
1810
+ assetPath: `./${I}`,
1811
+ ...c.selections ? { variantSelections: c.selections } : {}
1812
+ },
1813
+ attributes: re(e.localTransform),
1814
+ ...oe(e),
1815
+ visible: e.visible,
1816
+ classification: "native-usd",
1817
+ materialBinding: "source-authored",
1818
+ physics: f
1819
+ }];
1820
+ }
1821
+ function vs(e, t, s, r, o, n, i) {
1822
+ const l = ft(s.document, e.visualRevisionId), d = l ? He(s.assetCatalog, l) : null;
1823
+ if (!l || !d)
1824
+ return r.push(v(
1825
+ "USD_DELIVERY_VISUAL_SOURCE_MISSING",
1826
+ "error",
1827
+ `Visual node ${e.label} has no matching AssetCatalog source.`,
1828
+ e.nodeId,
1829
+ e.visualRevisionId
1830
+ )), [];
1831
+ const c = ks(
1832
+ s.assetCatalog,
1833
+ d,
1834
+ s.profile.profileId,
1835
+ s.profile.profileVersion
1836
+ );
1837
+ if (!c)
1838
+ return r.push(v(
1839
+ "USD_DELIVERY_VISUAL_ARTIFACT_MISSING",
1840
+ "error",
1841
+ `Visual node ${e.label} requires a resolved delivery artifact for ${s.profile.profileId}@${s.profile.profileVersion}.`,
1842
+ e.nodeId,
1843
+ d.assetId
1844
+ )), [];
1845
+ if (r.push(...c.artifact.diagnostics), c.artifact.outcome === "blocked") return [];
1846
+ const u = Ss(
1847
+ d,
1848
+ c.artifact,
1849
+ e,
1850
+ r
1851
+ );
1852
+ if (!u) return [];
1853
+ const a = i.get(e.nodeId) ?? j(e.label) ?? "Visual", f = t === "/" ? `/${a}` : `${t}/${a}`;
1854
+ Je(e, f, r);
1855
+ const g = `assets/${Ge(d.label, d.assetId)}/${d.source.sourceRevisionId.slice(0, 16)}`, h = `${g}/${W(c.artifact.entryOutputPath)}`;
1856
+ for (const p of u)
1857
+ Ts(
1858
+ o,
1859
+ d,
1860
+ c.artifact,
1861
+ p,
1862
+ `${g}/${F(p.locator)}`
1863
+ );
1864
+ return c.artifact.outcome === "degraded" && !r.some((p) => p.nodeId === e.nodeId && p.severity === "warning") && r.push(v(
1865
+ "USD_DELIVERY_VISUAL_ARTIFACT_DEGRADED",
1866
+ "warning",
1867
+ `Visual node ${e.label} uses a degraded delivery artifact.`,
1868
+ e.nodeId,
1869
+ d.assetId
1870
+ )), [{
1871
+ nodeId: e.nodeId,
1872
+ primPath: f,
1873
+ nodeKind: "reference",
1874
+ typeName: "Xform",
1875
+ assetId: d.assetId,
1876
+ sourceRevisionId: d.source.sourceRevisionId,
1877
+ artifactId: c.artifact.artifactId,
1878
+ reference: { assetPath: `./${h}` },
1879
+ attributes: re(e.localTransform),
1880
+ ...oe(e),
1881
+ visible: e.visible,
1882
+ classification: "visual-only",
1883
+ materialBinding: "visual-artifact",
1884
+ physics: { kind: "none", policy: "visual-only" }
1885
+ }];
1886
+ }
1887
+ function Ss(e, t, s, r) {
1888
+ const o = (c) => (r.push(v(
1889
+ "USD_DELIVERY_VISUAL_ARTIFACT_INVALID",
1890
+ "error",
1891
+ c,
1892
+ s.nodeId,
1893
+ e.assetId
1894
+ )), null);
1895
+ if (t.sourceRevisionId !== e.source.sourceRevisionId)
1896
+ return o(
1897
+ `Delivery artifact ${t.artifactId} is bound to ${t.sourceRevisionId}, not ${e.source.sourceRevisionId}.`
1898
+ );
1899
+ let n;
1900
+ try {
1901
+ n = W(t.entryOutputPath);
1902
+ } catch {
1903
+ return o(`Delivery artifact ${t.artifactId} has an invalid entry path: ${t.entryOutputPath}.`);
1904
+ }
1905
+ const i = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Set(), d = [];
1906
+ for (const c of t.resources) {
1907
+ const u = $(c.locator);
1908
+ if (!c.resourceId || l.has(c.resourceId))
1909
+ return o(`Delivery artifact ${t.artifactId} has a missing or duplicate resource id: ${c.resourceId}.`);
1910
+ if (!/^[a-f0-9]{64}$/.test(c.sha256) || !c.mediaType || !Number.isInteger(c.byteSize) || c.byteSize < 0)
1911
+ return o(`Delivery artifact ${t.artifactId} has invalid resource facts: ${m(c.locator)}.`);
1912
+ const a = F(u);
1913
+ if (i.has(a))
1914
+ return o(`Delivery artifact ${t.artifactId} repeats resource path ${a}.`);
1915
+ i.add(a), l.add(c.resourceId), d.push({ ...c, locator: u });
1916
+ }
1917
+ return i.has(n) ? d.sort((c, u) => F(c.locator).localeCompare(
1918
+ F(u.locator)
1919
+ ) || c.resourceId.localeCompare(u.resourceId)) : o(
1920
+ `Delivery artifact ${t.artifactId} entry ${n} is missing from its resources.`
1921
+ );
1922
+ }
1923
+ function He(e, t) {
1924
+ return e.entries.find((s) => {
1925
+ const r = s.interpretation.runtimeRevision;
1926
+ return "visualRevisionId" in t ? "visualRevisionId" in r && r.visualRevisionId === t.visualRevisionId : "revisionId" in r && r.revisionId === t.revisionId;
1927
+ }) ?? null;
1928
+ }
1929
+ function bs(e) {
1930
+ const t = Math.hypot(...e);
1931
+ if (!Number.isFinite(t))
1932
+ throw new Error("Scene gravity must contain finite values.");
1933
+ return t <= 1e-12 ? { gravityDirection: [0, 0, -1], gravityMagnitude: 0 } : {
1934
+ gravityDirection: e.map((s) => O(s / t, 12)),
1935
+ gravityMagnitude: O(t, 12)
1936
+ };
1937
+ }
1938
+ function Je(e, t, s) {
1939
+ var r, o, n, i;
1940
+ e.nodeType === "asset" ? (e.initialPose && s.push(v(
1941
+ "USD_EXPORT_INITIAL_POSE_UNSUPPORTED",
1942
+ "error",
1943
+ `Asset node ${e.label} declares an initial joint pose. OpenUSD has no lossless generic initial-joint-state contract, so the export is blocked.`,
1944
+ e.nodeId,
1945
+ e.assetRevisionId
1946
+ )), (r = e.appearance) != null && r.color && s.push(v(
1947
+ "USD_EXPORT_COLOR_OVERRIDE_NOT_ENCODED",
1948
+ "warning",
1949
+ `Asset node ${e.label} has a color override that is not authored in this physics-preserving native USD delivery.`,
1950
+ e.nodeId,
1951
+ e.assetRevisionId
1952
+ )), ((o = e.appearance) == null ? void 0 : o.opacity) !== void 0 && s.push(v(
1953
+ "USD_EXPORT_OPACITY_OVERRIDE_NOT_ENCODED",
1954
+ "warning",
1955
+ `Asset node ${e.label} has an opacity override that is not authored in this delivery.`,
1956
+ e.nodeId,
1957
+ e.assetRevisionId
1958
+ )), e.semantic && s.push(v(
1959
+ "USD_EXPORT_SEMANTIC_NOT_ENCODED",
1960
+ "warning",
1961
+ `Asset node ${e.label} has semantic annotations that are not authored into the USD stage.`,
1962
+ e.nodeId,
1963
+ e.assetRevisionId
1964
+ ))) : e.nodeType === "visual" && ((n = e.appearance) != null && n.color && s.push(v(
1965
+ "USD_EXPORT_COLOR_OVERRIDE_NOT_ENCODED",
1966
+ "warning",
1967
+ `Visual node ${e.label} has a color override that is not authored in this delivery.`,
1968
+ e.nodeId,
1969
+ e.visualRevisionId
1970
+ )), ((i = e.appearance) == null ? void 0 : i.opacity) !== void 0 && s.push(v(
1971
+ "USD_EXPORT_OPACITY_OVERRIDE_NOT_ENCODED",
1972
+ "warning",
1973
+ `Visual node ${e.label} has an opacity override that is not authored in this delivery.`,
1974
+ e.nodeId,
1975
+ e.visualRevisionId
1976
+ )), e.semantic && s.push(v(
1977
+ "USD_EXPORT_SEMANTIC_NOT_ENCODED",
1978
+ "warning",
1979
+ `Visual node ${e.label} has semantic annotations that are not authored into the USD stage.`,
1980
+ e.nodeId,
1981
+ e.visualRevisionId
1982
+ )));
1983
+ }
1984
+ function As(e, t, s, r) {
1985
+ var f, g, h, p;
1986
+ const o = e.physics, n = (f = o.colliderPrimPaths) == null ? void 0 : f.map((I) => Te(t, I)), i = (g = o.jointOverrides) == null ? void 0 : g.map((I) => ({
1987
+ ...I,
1988
+ jointPrimPath: Te(t, I.jointPrimPath)
1989
+ })), l = o.physicsMaterial ? Rs(o.physicsMaterial) : void 0;
1990
+ if (i != null && i.length)
1991
+ return r.push(v(
1992
+ "USD_EXPORT_JOINT_DRIVE_UNITS_NOT_VERIFIED",
1993
+ "error",
1994
+ `Asset node ${e.label} requests joint drive overrides, but OpenUSD core does not define the target PhysX angle, stiffness, damping, and max-force units.`,
1995
+ e.nodeId,
1996
+ e.assetRevisionId
1997
+ )), null;
1998
+ const d = !!(n != null && n.length || l), c = s.interpretation.runtimeRevision, u = !!((h = c.capabilities) != null && h.colliderGeometry), a = !!((p = c.capabilities) != null && p.rigidBody);
1999
+ if (o.kind === "static" || o.kind === "kinematic" || o.kind === "dynamic") {
2000
+ if (!(n != null && n.length) && !u)
2001
+ return r.push(v(
2002
+ "USD_EXPORT_COLLIDER_GEOMETRY_REQUIRED",
2003
+ "error",
2004
+ `Asset node ${e.label} requests ${o.kind} physics, but neither source collider geometry nor colliderPrimPaths are available.`,
2005
+ e.nodeId,
2006
+ e.assetRevisionId
2007
+ )), null;
2008
+ if (o.kind === "static" && a)
2009
+ return r.push(v(
2010
+ "USD_EXPORT_STATIC_OVERRIDE_CANNOT_REMOVE_RIGID_BODY",
2011
+ "error",
2012
+ `Asset node ${e.label} requests static physics, but its source-authored PhysicsRigidBodyAPI cannot be removed losslessly by core OpenUSD composition.`,
2013
+ e.nodeId,
2014
+ e.assetRevisionId
2015
+ )), null;
2016
+ }
2017
+ return o.kind === "asset-authored" ? {
2018
+ kind: "asset-authored",
2019
+ policy: d ? "preserve-with-overrides" : "preserve-source",
2020
+ ...n != null && n.length ? { colliderPrimPaths: n } : {},
2021
+ ...l ? { physicsMaterial: l } : {}
2022
+ } : o.kind === "dynamic" ? {
2023
+ kind: "dynamic",
2024
+ policy: "preserve-with-overrides",
2025
+ ...o.massKg !== void 0 ? { massKg: o.massKg } : {},
2026
+ ...o.centerOfMassM ? { centerOfMassM: o.centerOfMassM.map((I) => O(I, 6)) } : {},
2027
+ ...n != null && n.length ? { colliderPrimPaths: n } : {},
2028
+ ...l ? { physicsMaterial: l } : {}
2029
+ } : {
2030
+ kind: o.kind,
2031
+ policy: "preserve-with-overrides",
2032
+ ...n != null && n.length ? { colliderPrimPaths: n } : {},
2033
+ ...l ? { physicsMaterial: l } : {}
2034
+ };
2035
+ }
2036
+ function Rs(e) {
2037
+ return {
2038
+ ...e.densityKgPerM3 !== void 0 ? { densityKgPerM3: e.densityKgPerM3 } : {},
2039
+ ...e.staticFriction !== void 0 ? { staticFriction: e.staticFriction } : {},
2040
+ ...e.dynamicFriction !== void 0 ? { dynamicFriction: e.dynamicFriction } : {},
2041
+ ...e.restitution !== void 0 ? { restitution: e.restitution } : {}
2042
+ };
2043
+ }
2044
+ function Te(e, t) {
2045
+ if (!t.startsWith("/"))
2046
+ return `${e}/${t}`.replaceAll("//", "/");
2047
+ if (t === e || t.startsWith(`${e}/`))
2048
+ return t;
2049
+ const s = t.split("/").filter(Boolean);
2050
+ return s.length <= 1 ? e : `${e}/${s.slice(1).join("/")}`;
2051
+ }
2052
+ function Es(e, t, s, r) {
2053
+ var l, d;
2054
+ const o = t.interpretation.runtimeRevision, n = new Map(
2055
+ "variantSets" in o ? o.variantSets.map((c) => [c.name, c]) : []
2056
+ ), i = {};
2057
+ for (const [c, u] of Object.entries(s).sort(([a], [f]) => a.localeCompare(f))) {
2058
+ const a = e.variantSelections[c], f = n.get(c);
2059
+ if (!f) {
2060
+ r.push(v(
2061
+ "DELIVERY_VARIANT_SET_NOT_DECLARED",
2062
+ "info",
2063
+ `Asset ${t.label} does not declare ${c}; its source-authored default is preserved.`,
2064
+ e.nodeId,
2065
+ t.assetId
2066
+ ));
2067
+ continue;
2068
+ }
2069
+ if (!f.options.includes(u)) {
2070
+ r.push(v(
2071
+ "DELIVERY_PREFERRED_VARIANT_UNAVAILABLE",
2072
+ "info",
2073
+ `Asset ${t.label} has no ${c}=${u} branch; resolution follows the authored node selection or source-authored default.`,
2074
+ e.nodeId,
2075
+ t.assetId
2076
+ ));
2077
+ continue;
2078
+ }
2079
+ if (a !== void 0 && a !== u)
2080
+ return r.push(v(
2081
+ "DELIVERY_VARIANT_CONFLICT",
2082
+ "error",
2083
+ `Node ${e.label} selects ${c}=${a}, but profile prefers ${c}=${u}.`,
2084
+ e.nodeId,
2085
+ t.assetId
2086
+ )), { ok: !1 };
2087
+ const g = ((l = t.interpretation.variantPayloads[c]) == null ? void 0 : l[u]) ?? [];
2088
+ if (g.length === 0) {
2089
+ r.push(v(
2090
+ "DELIVERY_PREFERRED_VARIANT_UNAVAILABLE",
2091
+ "info",
2092
+ `Asset ${t.label} declares ${c}=${u}, but its variant payload is incomplete; resolution follows the authored node selection or source-authored default.`,
2093
+ e.nodeId,
2094
+ t.assetId
2095
+ ));
2096
+ continue;
2097
+ }
2098
+ const h = new Set(t.source.files.map((I) => k(I.locator))), p = g.filter((I) => !h.has(I));
2099
+ if (p.length > 0) {
2100
+ r.push(v(
2101
+ "DELIVERY_PREFERRED_VARIANT_UNAVAILABLE",
2102
+ "info",
2103
+ `Variant ${c}=${u} references missing payloads: ${p.join(", ")}; resolution follows the authored node selection or source-authored default.`,
2104
+ e.nodeId,
2105
+ t.assetId
2106
+ ));
2107
+ continue;
2108
+ }
2109
+ i[c] = u;
2110
+ }
2111
+ for (const [c, u] of Object.entries(e.variantSelections).sort(([a], [f]) => a.localeCompare(f))) {
2112
+ if (i[c] !== void 0) continue;
2113
+ const a = n.get(c);
2114
+ if (!a || !a.options.includes(u))
2115
+ return r.push(v(
2116
+ "DELIVERY_VARIANT_UNKNOWN",
2117
+ "error",
2118
+ `Node ${e.label} selects unknown variant ${c}=${u}.`,
2119
+ e.nodeId,
2120
+ t.assetId
2121
+ )), { ok: !1 };
2122
+ if (s[c] === u)
2123
+ return r.push(v(
2124
+ "DELIVERY_EXPLICIT_VARIANT_PAYLOAD_MISSING",
2125
+ "error",
2126
+ `Node ${e.label} explicitly selects ${c}=${u}, but its variant payload is incomplete.`,
2127
+ e.nodeId,
2128
+ t.assetId
2129
+ )), { ok: !1 };
2130
+ const f = ((d = t.interpretation.variantPayloads[c]) == null ? void 0 : d[u]) ?? [];
2131
+ if (f.length === 0)
2132
+ return r.push(v(
2133
+ "DELIVERY_EXPLICIT_VARIANT_PAYLOAD_MISSING",
2134
+ "error",
2135
+ `Node ${e.label} explicitly selects ${c}=${u}, but its variant payload is incomplete.`,
2136
+ e.nodeId,
2137
+ t.assetId
2138
+ )), { ok: !1 };
2139
+ const g = new Set(t.source.files.map((p) => k(p.locator))), h = f.filter((p) => !g.has(p));
2140
+ if (h.length > 0)
2141
+ return r.push(v(
2142
+ "DELIVERY_EXPLICIT_VARIANT_PAYLOAD_MISSING",
2143
+ "error",
2144
+ `Node ${e.label} explicitly selects ${c}=${u}, but its payloads are missing: ${h.join(", ")}.`,
2145
+ e.nodeId,
2146
+ t.assetId
2147
+ )), { ok: !1 };
2148
+ i[c] = u;
2149
+ }
2150
+ return { ok: !0, selections: Object.keys(i).length > 0 ? i : null };
2151
+ }
2152
+ function _s(e, t) {
2153
+ const s = /* @__PURE__ */ new Map();
2154
+ for (const r of e.values()) {
2155
+ const o = r.outputPath.toLocaleLowerCase("en-US"), n = s.get(o);
2156
+ if (n === void 0) {
2157
+ s.set(o, r.outputPath);
2158
+ continue;
2159
+ }
2160
+ t.push(v(
2161
+ n === r.outputPath ? "USD_EXPORT_RESOURCE_PATH_DUPLICATE" : "USD_EXPORT_RESOURCE_PATH_CASE_CONFLICT",
2162
+ "error",
2163
+ n === r.outputPath ? `USD delivery repeats resource output path ${r.outputPath}.` : `USD delivery resource paths case-collide: ${n}, ${r.outputPath}.`
2164
+ ));
2165
+ }
2166
+ }
2167
+ function Ps(e, t, s) {
2168
+ const r = new Map(
2169
+ [...t.values()].map((n) => [
2170
+ n.outputPath.toLocaleLowerCase("en-US"),
2171
+ n
2172
+ ])
2173
+ ), o = [...e.values()].flatMap((n) => ws(n)).sort((n, i) => w(n.outputPath, i.outputPath) || w(n.sourceSha256, i.sourceSha256) || w(n.resourceId, i.resourceId));
2174
+ for (const n of o) {
2175
+ const i = n.outputPath.toLocaleLowerCase("en-US"), l = r.get(i);
2176
+ if (l) {
2177
+ l.sourceSha256 !== n.sourceSha256 && s.push(v(
2178
+ "USD_EXPORT_RELATIVE_TEXTURE_ALIAS_CONFLICT",
2179
+ "error",
2180
+ `Texture alias ${n.outputPath} is required by different source bytes (${l.outputPath} and ${n.resourceId}).`,
2181
+ void 0,
2182
+ n.sourceRevisionId
2183
+ ));
2184
+ continue;
2185
+ }
2186
+ r.set(i, n), t.set(
2187
+ `relative-texture-alias\0${n.resourceId}`,
2188
+ n
2189
+ );
2190
+ }
2191
+ }
2192
+ function ws(e) {
2193
+ if (e.source.entryLocator.kind !== "package-path") return [];
2194
+ const t = W(e.source.entryLocator.path);
2195
+ if (!/\.(?:usd|usda|usdc|usdz)$/i.test(t)) return [];
2196
+ const s = t.lastIndexOf("/"), r = s >= 0 ? t.slice(0, s) : "", o = r ? `${r}/` : "", n = [];
2197
+ for (const i of e.source.files)
2198
+ if (!(i.locator.kind !== "package-path" || !$s(i.locator.path)))
2199
+ try {
2200
+ const l = W(i.locator.path);
2201
+ if (!l.startsWith(o)) continue;
2202
+ const d = W(l.slice(o.length));
2203
+ n.push({
2204
+ resourceId: `relative-texture-alias/${e.source.sourceRevisionId}/${m(i.locator)}`,
2205
+ sourceRevisionId: e.source.sourceRevisionId,
2206
+ outputPath: d,
2207
+ sourceLocator: i.locator,
2208
+ sourceSha256: i.sha256,
2209
+ mediaType: i.mediaType,
2210
+ sourceByteSize: i.byteSize,
2211
+ outputTransform: me(d, i.mediaType)
2212
+ });
2213
+ } catch {
2214
+ }
2215
+ return n;
2216
+ }
2217
+ function $s(e) {
2218
+ return /\.(?:png|jpe?g|webp|exr|ktx2)$/i.test(e);
2219
+ }
2220
+ function Ds(e, t) {
2221
+ var o;
2222
+ const s = F(t);
2223
+ if (!/[^\x20-\x7e]/.test(s) || e.source.files.length !== 1) return s;
2224
+ const r = ((o = /(\.[A-Za-z0-9]+)$/.exec(s)) == null ? void 0 : o[1]) ?? "";
2225
+ return `entry-${e.source.sourceRevisionId.slice(0, 16)}${r.toLowerCase()}`;
2226
+ }
2227
+ function ks(e, t, s, r) {
2228
+ const o = e.deliveryLocks.find((i) => i.assetId === t.assetId && i.sourceRevisionId === t.source.sourceRevisionId && i.profileId === s && i.profileVersion === r), n = o ? t.deliveryArtifacts.find((i) => i.artifactId === o.artifactId) : t.deliveryArtifacts.find((i) => i.profileId === s && i.profileVersion === r);
2229
+ return n ? { artifact: n, ...o ? { lock: o } : {} } : null;
2230
+ }
2231
+ function Ns(e, t, s, r, o) {
2232
+ const n = `${t.source.sourceRevisionId}\0${m(s.locator)}\0`;
2233
+ e.has(n) || e.set(n, {
2234
+ resourceId: `${t.source.sourceRevisionId}/${m(s.locator)}`,
2235
+ sourceRevisionId: t.source.sourceRevisionId,
2236
+ outputPath: r,
2237
+ sourceLocator: s.locator,
2238
+ sourceSha256: s.sha256,
2239
+ mediaType: s.mediaType,
2240
+ sourceByteSize: s.byteSize,
2241
+ outputTransform: me(r, s.mediaType)
2242
+ });
2243
+ }
2244
+ function Ts(e, t, s, r, o) {
2245
+ const n = `${t.source.sourceRevisionId}\0${s.artifactId}\0${r.resourceId}\0${m(r.locator)}`;
2246
+ e.has(n) || e.set(n, {
2247
+ resourceId: `${s.artifactId}/${r.resourceId}`,
2248
+ sourceRevisionId: t.source.sourceRevisionId,
2249
+ artifactId: s.artifactId,
2250
+ outputPath: o,
2251
+ sourceLocator: r.locator,
2252
+ sourceSha256: r.sha256,
2253
+ mediaType: r.mediaType,
2254
+ sourceByteSize: r.byteSize,
2255
+ outputTransform: me(o, r.mediaType)
2256
+ });
2257
+ }
2258
+ function me(e, t) {
2259
+ return t.toLowerCase() === "model/vnd.usdz+zip" || e.toLowerCase().endsWith(".usdz") ? { kind: "canonicalize-usdz" } : { kind: "identity" };
2260
+ }
2261
+ function re(e) {
2262
+ return {
2263
+ "xformOp:translate": {
2264
+ type: "double3",
2265
+ value: e.position.map((t) => O(t, 6))
2266
+ },
2267
+ "xformOp:orient": {
2268
+ type: "quatf",
2269
+ value: e.rotation.map((t) => O(t, 6))
2270
+ },
2271
+ "xformOp:scale": {
2272
+ type: "float3",
2273
+ value: e.scale.map((t) => O(t, 6))
2274
+ },
2275
+ xformOpOrder: {
2276
+ type: "token[]",
2277
+ value: ["xformOp:translate", "xformOp:orient", "xformOp:scale"]
2278
+ }
2279
+ };
2280
+ }
2281
+ function oe(e) {
2282
+ const t = dt(e);
2283
+ return t.every((s) => Math.abs(s) <= 1e-12) ? {} : {
2284
+ contentAttributes: {
2285
+ "xformOp:translate": {
2286
+ type: "double3",
2287
+ value: t.map((s) => O(-s, 6))
2288
+ },
2289
+ xformOpOrder: {
2290
+ type: "token[]",
2291
+ value: ["xformOp:translate"]
2292
+ }
2293
+ }
2294
+ };
2295
+ }
2296
+ function fe(e) {
2297
+ return [e, ...e.children.flatMap((t) => t.nodeType === "group" ? fe(t) : [t])];
2298
+ }
2299
+ function v(e, t, s, r, o) {
2300
+ return {
2301
+ code: e,
2302
+ severity: t,
2303
+ message: s,
2304
+ ...r ? { nodeId: r } : {},
2305
+ ...o ? { assetId: o } : {}
2306
+ };
2307
+ }
2308
+ function Cs(e) {
2309
+ return e.some((t) => t.severity === "error") ? "blocked" : e.some((t) => t.severity === "warning") ? "degraded" : "supported";
2310
+ }
2311
+ function xs(e) {
2312
+ return J(e, (t, s) => w(t.code, s.code) || w(t.nodeId ?? "", s.nodeId ?? "") || w(t.message, s.message));
2313
+ }
2314
+ function nr(e) {
2315
+ return N(U(e.map((t) => ({
2316
+ path: t.path,
2317
+ sha256: t.sha256,
2318
+ byteSize: t.bytes.byteLength
2319
+ })).sort((t, s) => t.path.localeCompare(s.path))));
2320
+ }
2321
+ function ar(e) {
2322
+ const t = {
2323
+ format: "sim-studio.usd-export-evidence@3",
2324
+ schemaVersion: 3,
2325
+ ...e
2326
+ };
2327
+ return {
2328
+ ...t,
2329
+ evidenceDigest: N(U(t))
2330
+ };
2331
+ }
2332
+ export {
2333
+ bt as $,
2334
+ os as A,
2335
+ Bt as B,
2336
+ M as C,
2337
+ gt as D,
2338
+ tr as E,
2339
+ qs as F,
2340
+ es as G,
2341
+ Me as H,
2342
+ E as I,
2343
+ B as J,
2344
+ Zs as K,
2345
+ Ke as L,
2346
+ Xs as M,
2347
+ Wt as N,
2348
+ Xt as O,
2349
+ js as P,
2350
+ Bs as Q,
2351
+ It as R,
2352
+ Hs as S,
2353
+ Vs as T,
2354
+ Fs as U,
2355
+ j as V,
2356
+ Qt as W,
2357
+ Zt as X,
2358
+ Yt as Y,
2359
+ Ge as Z,
2360
+ We as _,
2361
+ Ks as a,
2362
+ de as b,
2363
+ k as c,
2364
+ Ws as d,
2365
+ Gs as e,
2366
+ fs as f,
2367
+ er as g,
2368
+ W as h,
2369
+ pe as i,
2370
+ sr as j,
2371
+ Kt as k,
2372
+ ns as l,
2373
+ rr as m,
2374
+ Q as n,
2375
+ ms as o,
2376
+ Ys as p,
2377
+ or as q,
2378
+ zs as r,
2379
+ ht as s,
2380
+ Xe as t,
2381
+ nr as u,
2382
+ Js as v,
2383
+ Qs as w,
2384
+ Ye as x,
2385
+ pt as y,
2386
+ ar as z
2387
+ };