x_ite 16.4.3 → 16.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +6 -6
  2. package/dist/assets/components/AnnotationComponent.js +1 -1
  3. package/dist/assets/components/AnnotationComponent.min.js +1 -1
  4. package/dist/assets/components/CADGeometryComponent.js +1 -1
  5. package/dist/assets/components/CADGeometryComponent.min.js +1 -1
  6. package/dist/assets/components/CubeMapTexturingComponent.js +2 -2
  7. package/dist/assets/components/CubeMapTexturingComponent.min.js +2 -2
  8. package/dist/assets/components/DISComponent.js +1 -1
  9. package/dist/assets/components/DISComponent.min.js +1 -1
  10. package/dist/assets/components/EventUtilitiesComponent.js +1 -1
  11. package/dist/assets/components/EventUtilitiesComponent.min.js +1 -1
  12. package/dist/assets/components/GaussianSplatsComponent.js +1 -1
  13. package/dist/assets/components/GaussianSplatsComponent.min.js +1 -1
  14. package/dist/assets/components/Geometry2DComponent.js +1 -1
  15. package/dist/assets/components/Geometry2DComponent.min.js +1 -1
  16. package/dist/assets/components/Geometry3DComponent.js +1 -1
  17. package/dist/assets/components/Geometry3DComponent.min.js +1 -1
  18. package/dist/assets/components/GeospatialComponent.js +1 -1
  19. package/dist/assets/components/GeospatialComponent.min.js +1 -1
  20. package/dist/assets/components/HAnimComponent.js +5 -5
  21. package/dist/assets/components/HAnimComponent.min.js +2 -2
  22. package/dist/assets/components/KeyDeviceSensorComponent.js +1 -1
  23. package/dist/assets/components/KeyDeviceSensorComponent.min.js +1 -1
  24. package/dist/assets/components/LayoutComponent.js +1 -1
  25. package/dist/assets/components/LayoutComponent.min.js +1 -1
  26. package/dist/assets/components/NURBSComponent.js +1 -1
  27. package/dist/assets/components/NURBSComponent.min.js +1 -1
  28. package/dist/assets/components/ParticleSystemsComponent.js +1 -1
  29. package/dist/assets/components/ParticleSystemsComponent.min.js +1 -1
  30. package/dist/assets/components/PickingComponent.js +1 -1
  31. package/dist/assets/components/PickingComponent.min.js +1 -1
  32. package/dist/assets/components/RigidBodyPhysicsComponent.js +1 -1
  33. package/dist/assets/components/RigidBodyPhysicsComponent.min.js +1 -1
  34. package/dist/assets/components/ScriptingComponent.js +1 -1
  35. package/dist/assets/components/ScriptingComponent.min.js +1 -1
  36. package/dist/assets/components/TextComponent.js +1 -1
  37. package/dist/assets/components/TextComponent.min.js +1 -1
  38. package/dist/assets/components/TextureProjectionComponent.js +1 -1
  39. package/dist/assets/components/TextureProjectionComponent.min.js +1 -1
  40. package/dist/assets/components/Texturing3DComponent.js +10 -10
  41. package/dist/assets/components/Texturing3DComponent.min.js +2 -2
  42. package/dist/assets/components/VolumeRenderingComponent.js +1 -1
  43. package/dist/assets/components/VolumeRenderingComponent.min.js +1 -1
  44. package/dist/assets/components/WebXRComponent.js +1 -1
  45. package/dist/assets/components/WebXRComponent.min.js +1 -1
  46. package/dist/assets/components/X_ITEComponent.js +1 -1
  47. package/dist/assets/components/X_ITEComponent.min.js +1 -1
  48. package/dist/example.html +1 -1
  49. package/dist/x_ite.css +1 -1
  50. package/dist/x_ite.d.ts +4 -0
  51. package/dist/x_ite.js +475 -483
  52. package/dist/x_ite.min.js +2 -2
  53. package/dist/x_ite.min.mjs +2 -2
  54. package/dist/x_ite.mjs +475 -483
  55. package/dist/x_ite.zip +0 -0
  56. package/package.json +2 -1
package/dist/x_ite.mjs CHANGED
@@ -1,7 +1,7 @@
1
- /* X_ITE v16.4.3 */
1
+ /* X_ITE v16.5.0 */
2
2
  var __webpack_modules__ = ({
3
3
 
4
- /***/ 802
4
+ /***/ 829
5
5
  (module, exports) {
6
6
 
7
7
  var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*
@@ -1006,7 +1006,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
1006
1006
 
1007
1007
  /***/ },
1008
1008
 
1009
- /***/ 528
1009
+ /***/ 247
1010
1010
  (module) {
1011
1011
 
1012
1012
  (function webpackUniversalModuleDefinition(root, factory) {
@@ -2002,7 +2002,7 @@ return /******/ (function(modules) { // webpackBootstrap
2002
2002
 
2003
2003
  /***/ },
2004
2004
 
2005
- /***/ 628
2005
+ /***/ 67
2006
2006
  (module) {
2007
2007
 
2008
2008
  /**
@@ -7561,21 +7561,21 @@ Object .assign (Generator .prototype,
7561
7561
 
7562
7562
  return false;
7563
7563
  },
7564
- ImportedName (importedNode)
7564
+ ImportedName (importedNodeInstance)
7565
7565
  {
7566
7566
  const importedNames = this .importedNames .get (this .ExecutionContext ());
7567
7567
 
7568
- if (importedNames .has (importedNode))
7569
- return importedNames .get (importedNode);
7568
+ if (importedNames .has (importedNodeInstance))
7569
+ return importedNames .get (importedNodeInstance);
7570
7570
 
7571
7571
  const
7572
7572
  names = this .names .get (this .ExecutionContext ()),
7573
- newName = getUniqueName (names, importedNode .getImportedName ());
7573
+ newName = getUniqueName (names, importedNodeInstance .getName ());
7574
7574
 
7575
7575
  // Add to indices.
7576
7576
 
7577
7577
  names .add (newName);
7578
- importedNames .set (importedNode, newName);
7578
+ importedNames .set (importedNodeInstance, newName);
7579
7579
 
7580
7580
  return newName;
7581
7581
  },
@@ -7800,7 +7800,7 @@ Object .assign (Object .setPrototypeOf (JSONGenerator .prototype, X3DGenerator .
7800
7800
  },
7801
7801
  RemoveComma ()
7802
7802
  {
7803
- this .string = this .string .replace (/,\s*$/s, "");
7803
+ this .string = this .string .replace (/,\s*$/, "");
7804
7804
  },
7805
7805
  stringProperty (key, value, comma = true)
7806
7806
  {
@@ -8253,14 +8253,14 @@ Object .assign (X3DObject .prototype,
8253
8253
  {
8254
8254
  return this .constructor .typeName;
8255
8255
  },
8256
- setName (value)
8257
- {
8258
- this [_name] = value;
8259
- },
8260
8256
  getName ()
8261
8257
  {
8262
8258
  return this [_name];
8263
8259
  },
8260
+ setName (value)
8261
+ {
8262
+ this [_name] = value;
8263
+ },
8264
8264
  getDisplayName ()
8265
8265
  {
8266
8266
  return this [_name];
@@ -14341,14 +14341,14 @@ const SFNode_handler =
14341
14341
  {
14342
14342
  get (target, key)
14343
14343
  {
14344
- if (typeof key === "string")
14344
+ try
14345
14345
  {
14346
- const
14347
- node = target .getValue (),
14348
- field = node ?.getField (key, false);
14349
-
14350
- if (field)
14346
+ if (typeof key === "string")
14351
14347
  {
14348
+ const
14349
+ node = target .getValue (),
14350
+ field = node ?.getField (key);
14351
+
14352
14352
  // Specification conform would be: `accessType & X3DConstants .outputOnly`.
14353
14353
  // However, we also allow read access to initializeOnly fields.
14354
14354
  if (field .getAccessType () === Base_X3DConstants .inputOnly)
@@ -14357,19 +14357,21 @@ const SFNode_handler =
14357
14357
  return field .valueOf ();
14358
14358
  }
14359
14359
  }
14360
+ catch
14361
+ { }
14360
14362
 
14361
14363
  return Reflect .get (target, key);
14362
14364
  },
14363
14365
  set (target, key, value)
14364
14366
  {
14365
- if (typeof key === "string")
14367
+ try
14366
14368
  {
14367
- const
14368
- node = target .getValue (),
14369
- field = node ?.getField (key, false);
14370
-
14371
- if (field)
14369
+ if (typeof key === "string")
14372
14370
  {
14371
+ const
14372
+ node = target .getValue (),
14373
+ field = node ?.getField (key);
14374
+
14373
14375
  if (field .getAccessType () === Base_X3DConstants .outputOnly)
14374
14376
  return false;
14375
14377
 
@@ -14377,13 +14379,21 @@ const SFNode_handler =
14377
14379
  return true;
14378
14380
  }
14379
14381
  }
14382
+ catch
14383
+ { }
14380
14384
 
14381
14385
  return Reflect .set (target, key, value);
14382
14386
  },
14383
14387
  has (target, key)
14384
14388
  {
14385
- return Boolean (target .getValue () ?.getField (key, false))
14386
- || Reflect .has (target, key);
14389
+ try
14390
+ {
14391
+ return Boolean (target .getValue () ?.getField (key));
14392
+ }
14393
+ catch
14394
+ {
14395
+ return Reflect .has (target, key);
14396
+ }
14387
14397
  },
14388
14398
  ownKeys (target)
14389
14399
  {
@@ -18424,7 +18434,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18424
18434
  {
18425
18435
  return this [_fieldDefinitions];
18426
18436
  },
18427
- getField (name, _throw = true)
18437
+ getField (name)
18428
18438
  {
18429
18439
  const field = getFieldFromArray (this [_userDefinedFields], name)
18430
18440
  ?? getFieldFromArray (this [_predefinedFields], name);
@@ -18432,8 +18442,7 @@ Object .assign (Object .setPrototypeOf (X3DBaseNode .prototype, Base_X3DChildObj
18432
18442
  if (field)
18433
18443
  return field;
18434
18444
 
18435
- if (_throw)
18436
- throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18445
+ throw new Error (`Unknown field '${name}' in node class ${this .getTypeName ()}.`);
18437
18446
  },
18438
18447
  getFields ()
18439
18448
  {
@@ -18865,7 +18874,7 @@ const Legacy_default_ = Legacy;
18865
18874
 
18866
18875
  /* harmony default export */ const Browser_Legacy = (x_ite_Namespace .add ("Legacy", Legacy_default_));
18867
18876
  ;// ./src/x_ite/BROWSER_VERSION.js
18868
- const BROWSER_VERSION_default_ = "16.4.3";
18877
+ const BROWSER_VERSION_default_ = "16.5.0";
18869
18878
  ;
18870
18879
 
18871
18880
  /* harmony default export */ const BROWSER_VERSION = (x_ite_Namespace .add ("BROWSER_VERSION", BROWSER_VERSION_default_));
@@ -21378,6 +21387,7 @@ const URLs_default_ = URLs;
21378
21387
 
21379
21388
 
21380
21389
 
21390
+
21381
21391
  const _metaDataCallbacks = Symbol ();
21382
21392
 
21383
21393
  function X3DNode (executionContext)
@@ -21427,17 +21437,19 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21427
21437
  else
21428
21438
  {
21429
21439
  // Make a copy for a X3DPrototypeInstance.
21430
-
21440
+
21431
21441
  const executionContext = instance .getBody ();
21432
21442
 
21433
21443
  // First try to get a named node with the node's name.
21434
21444
 
21435
- if (this .getName () .length)
21445
+ if (this .getName ())
21436
21446
  {
21437
- const namedNode = executionContext .getNamedNodes () .get (this .getName ());
21438
-
21439
- if (namedNode)
21440
- return namedNode .getValue ();
21447
+ try
21448
+ {
21449
+ return executionContext .getLocalNode (this .getName ()) .getValue ();
21450
+ }
21451
+ catch
21452
+ { }
21441
21453
  }
21442
21454
 
21443
21455
  // Create copy.
@@ -21448,7 +21460,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21448
21460
  if (this .getNeedsName ())
21449
21461
  this .getExecutionContext () .updateNamedNode (this .getExecutionContext () .getUniqueName (), this);
21450
21462
 
21451
- if (this .getName () .length)
21463
+ if (this .getName ())
21452
21464
  executionContext .updateNamedNode (this .getName (), copy);
21453
21465
 
21454
21466
  // Default fields
@@ -21549,7 +21561,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
21549
21561
  },
21550
21562
  getNeedsName ()
21551
21563
  {
21552
- if (this .getName () .length)
21564
+ if (this .getName ())
21553
21565
  return false;
21554
21566
 
21555
21567
  if (this .getCloneCount () > 1)
@@ -22275,7 +22287,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22275
22287
  if (cdata ?.length === 0)
22276
22288
  cdata = null;
22277
22289
 
22278
- if (!cdata ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)))
22290
+ if (!cdata ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/)))
22279
22291
  cdata = null;
22280
22292
 
22281
22293
  generator .IncIndent ();
@@ -22554,7 +22566,7 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22554
22566
  if (sourceText ?.length !== 1)
22555
22567
  sourceText = null;
22556
22568
 
22557
- if (!sourceText ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/s)))
22569
+ if (!sourceText ?.some (string => string .match (/^\s*(?:data|ecmascript|javascript|vrmlscript):/)))
22558
22570
  sourceText = null;
22559
22571
 
22560
22572
  // Predefined fields
@@ -22773,22 +22785,47 @@ Object .assign (Object .setPrototypeOf (X3DNode .prototype, Base_X3DBaseNode .pr
22773
22785
 
22774
22786
  if (executionContext .isScene)
22775
22787
  {
22776
- // Remove exported node if any.
22788
+ // Collect imported nodes in parent context.
22789
+ // This must be done before the exported nodes are removed.
22790
+
22791
+ const
22792
+ parentContext = executionContext .getExecutionContext (),
22793
+ importedNodes = [ ];
22794
+
22795
+ if (parentContext)
22796
+ {
22797
+ for (const importedNode of parentContext .getImportedNodes ())
22798
+ {
22799
+ if (helper.try (() => importedNode .getExportedNode ()) === this)
22800
+ importedNodes .push (importedNode);
22801
+ }
22802
+ }
22803
+
22804
+ // Remove exported nodes if any.
22777
22805
 
22778
22806
  for (const exportedNode of Array .from (executionContext .getExportedNodes ()))
22779
22807
  {
22780
- if (exportedNode .getLocalNode () === this)
22781
- executionContext .removeExportedNode (exportedNode .getExportedName ());
22808
+ if (exportedNode .getLocalNode () !== this)
22809
+ continue;
22810
+
22811
+ executionContext .removeExportedNode (exportedNode .getExportedName ());
22782
22812
  }
22783
22813
 
22784
- // Remove imported node if any.
22814
+ // Update imported node instances in parent context if any.
22815
+ // This must be done after the exported nodes are removed.
22785
22816
 
22786
- const parentContext = executionContext .getExecutionContext ();
22817
+ for (const importedNode of importedNodes)
22818
+ importedNode .getInstance () .update ();
22787
22819
 
22788
- if (parentContext)
22820
+ // Update routes after the exported nodes are removed.
22821
+
22822
+ for (const field of this .getFields ())
22789
22823
  {
22790
- for (const importedNode of parentContext .getImportedNodes ())
22791
- importedNode .getExportedNode () .update ();
22824
+ for (const route of Array .from (field .getInputRoutes ()))
22825
+ route .reconnect ();
22826
+
22827
+ for (const route of Array .from (field .getOutputRoutes ()))
22828
+ route .reconnect ();
22792
22829
  }
22793
22830
  }
22794
22831
 
@@ -23933,146 +23970,66 @@ const NamedNodesArray_default_ = NamedNodesArray;
23933
23970
  ;
23934
23971
 
23935
23972
  /* harmony default export */ const Execution_NamedNodesArray = (x_ite_Namespace .add ("NamedNodesArray", NamedNodesArray_default_));
23936
- ;// ./src/x_ite/Components/Core/X3DImportedNodeProxy.js
23973
+ ;// ./src/x_ite/Components/Core/X3DImportedNodeInstance.js
23937
23974
 
23938
23975
 
23939
23976
 
23940
23977
 
23941
23978
 
23942
- const
23943
- _importedName = Symbol (),
23944
- _importedNode = Symbol (),
23945
- X3DImportedNodeProxy_type = Symbol (),
23946
- _functions = Symbol ();
23979
+ const _importedNode = Symbol ();
23947
23980
 
23948
- const X3DImportedNodeProxy_handler =
23949
- {
23950
- get (target, key)
23951
- {
23952
- if (Reflect .has (target, key))
23953
- return Reflect .get (target, key);
23954
-
23955
- const node = target .getSharedNode ();
23956
-
23957
- if (node)
23958
- {
23959
- const property = Reflect .get (node, key);
23960
-
23961
- if (typeof property === "function")
23962
- {
23963
- return target [_functions] .get (key) ?? (() =>
23964
- {
23965
- const func = property .bind (node);
23966
-
23967
- target [_functions] .set (key, func);
23968
-
23969
- return func;
23970
- })();
23971
- }
23972
-
23973
- return property;
23974
- }
23975
- },
23976
- set (target, key, value)
23977
- {
23978
- if (Reflect .has (target, key))
23979
- {
23980
- return Reflect .set (target, key, value);
23981
- }
23982
- else
23983
- {
23984
- const node = target .getSharedNode ();
23985
-
23986
- if (node)
23987
- return Reflect .set (node, key, value);
23988
-
23989
- return false;
23990
- }
23991
- },
23992
- has (target, key)
23993
- {
23994
- return Reflect .has (target, key)
23995
- || Reflect .has (target .getSharedNode () ?? { }, key);
23996
- },
23997
- ownKeys (target)
23998
- {
23999
- return Array .from (new Set (Reflect .ownKeys (target)
24000
- .concat (Reflect .ownKeys (target .getSharedNode () ?? { }))));
24001
- },
24002
- getOwnPropertyDescriptor (target, key)
24003
- {
24004
- return Reflect .getOwnPropertyDescriptor (target, key)
24005
- ?? Reflect .getOwnPropertyDescriptor (target .getSharedNode () ?? { }, key);
24006
- },
24007
- };
24008
-
24009
- function X3DImportedNodeProxy (executionContext, importedName, type)
23981
+ function X3DImportedNodeInstance (executionContext, importedNode)
24010
23982
  {
24011
23983
  Core_X3DNode .call (this, executionContext);
24012
23984
 
24013
- const proxy = new Proxy (this, X3DImportedNodeProxy_handler);
24014
-
24015
- this [_importedName] = importedName;
24016
- this [X3DImportedNodeProxy_type] = type;
24017
- this [_functions] = new Map ();
23985
+ this .addType (Base_X3DConstants .X3DImportedNodeInstance);
24018
23986
 
24019
- this .setup ();
23987
+ // Private properties
24020
23988
 
24021
- return proxy;
23989
+ this [_importedNode] = importedNode;
24022
23990
  }
24023
23991
 
24024
- Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3DNode .prototype),
23992
+ Object .assign (Object .setPrototypeOf (X3DImportedNodeInstance .prototype, Core_X3DNode .prototype),
24025
23993
  {
24026
23994
  initialize ()
24027
23995
  {
24028
23996
  Core_X3DNode .prototype .initialize .call (this);
24029
23997
 
24030
- this .getExecutionContext () .importedNodes .addInterest ("update", this);
23998
+ this [_importedNode] .getInlineNode () ._loadState .addInterest ("update", this);
24031
23999
 
24032
24000
  this .update ();
24033
24001
  },
24034
- getExtendedEventHandling ()
24002
+ update ()
24035
24003
  {
24036
- return false;
24004
+ if (this [_importedNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE)
24005
+ helper.try (() => this [_importedNode] .getExportedNode ()) ?.addInterest ("addNodeEvent", this);
24006
+
24007
+ this ._typeName_changed ?.setValue (Date .now () / 1000);
24008
+
24009
+ Base_X3DChildObject .prototype .addEvent .call (this);
24037
24010
  },
24038
- setTypeHint (value)
24011
+ getExtendedEventHandling ()
24039
24012
  {
24040
- this [X3DImportedNodeProxy_type] ??= value;
24013
+ return false;
24041
24014
  },
24042
- getSharedNode ()
24015
+ getInnerNode ()
24043
24016
  {
24044
- return helper.try (() => this [_importedNode] .getSharedNode ()) ?? null;
24017
+ return this [_importedNode] .getExportedNode () .getInnerNode ();
24045
24018
  },
24046
24019
  getImportedNode ()
24047
24020
  {
24048
24021
  return this [_importedNode];
24049
24022
  },
24050
- getInnerNode ()
24051
- {
24052
- return this [_importedNode] .getSharedNode () .getInnerNode ();
24053
- },
24054
24023
  getName ()
24055
24024
  {
24056
- return this [_importedName];
24057
- },
24058
- setName (value)
24059
- {
24060
- this [_importedName] = value;
24061
-
24062
- this ._name_changed ?.setValue (Date .now () / 1000);
24025
+ return this [_importedNode] .getImportedName ();
24063
24026
  },
24064
24027
  ... Object .fromEntries ([
24065
- ["getComponentInfo", "componentInfo"],
24066
- ["getContainerField", "containerField"],
24067
- ["getSpecificationRange", "specificationRange"],
24068
- ["getTypeName", "typeName"],
24069
- ]
24070
- .map (([fn, property]) => [fn, function ()
24071
- {
24072
- return this .getSharedNode () ?.[fn] () ?? this .constructor [property];
24073
- }])),
24074
- ... Object .fromEntries ([
24028
+ "getTypeName",
24075
24029
  "getType",
24030
+ "getComponentInfo",
24031
+ "getContainerField",
24032
+ "getSpecificationRange",
24076
24033
  "getFieldDefinitions",
24077
24034
  "getPredefinedField",
24078
24035
  "getPredefinedFields",
@@ -24086,42 +24043,15 @@ Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3
24086
24043
  ]
24087
24044
  .map (fn => [fn, function (... args)
24088
24045
  {
24089
- return this .getSharedNode () ?.[fn] (... args) ?? Core_X3DNode .prototype [fn] .call (this, ... args);
24046
+ return helper.try (() => this [_importedNode] .getExportedNode ()) ?.[fn] (... args)
24047
+ ?? Core_X3DNode .prototype [fn] .call (this, ... args);
24090
24048
  }])),
24091
- update ()
24092
- {
24093
- const importedNode = this .getExecutionContext () .getImportedNodes () .get (this [_importedName])
24094
- ?? null;
24095
-
24096
- this [_importedNode] ?.getInlineNode () ._loadState .removeInterest ("set_loadState__", this);
24097
-
24098
- this [_importedNode] = importedNode;
24099
-
24100
- this [_importedNode] ?.getInlineNode () ._loadState .addInterest ("set_loadState__", this);
24101
-
24102
- this .set_loadState__ ();
24103
- },
24104
- set_loadState__ ()
24105
- {
24106
- if (this [_importedNode] ?.getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE)
24107
- {
24108
- const sharedNode = this .getSharedNode ();
24109
-
24110
- this [X3DImportedNodeProxy_type] = sharedNode ?.constructor ?? this [X3DImportedNodeProxy_type];
24111
-
24112
- sharedNode ?.addInterest ("addNodeEvent", this);
24113
- }
24114
-
24115
- this ._typeName_changed ?.setValue (Date .now () / 1000);
24116
-
24117
- Base_X3DChildObject .prototype .addEvent .call (this);
24118
- },
24119
24049
  toVRMLStream (generator)
24120
24050
  {
24121
24051
  generator .CheckSpace ();
24122
24052
  generator .string += "USE";
24123
24053
  generator .Space ();
24124
- generator .string += this [_importedName];
24054
+ generator .string += this [_importedNode] .getImportedName ();
24125
24055
  generator .NeedsSpace ();
24126
24056
  },
24127
24057
  toXMLStream (generator)
@@ -24131,36 +24061,48 @@ Object .assign (Object .setPrototypeOf (X3DImportedNodeProxy .prototype, Core_X3
24131
24061
  if (generator .html && this .getTypeName () === "Script")
24132
24062
  generator .attribute ("type", "model/x3d+xml");
24133
24063
 
24134
- generator .attribute ("USE", this [_importedName]);
24064
+ generator .attribute ("USE", this [_importedNode] .getImportedName ());
24135
24065
  generator .containerField (this .getContainerField ());
24136
24066
  generator .closeTag (this .getTypeName ());
24137
24067
  },
24138
24068
  toJSONStream (generator)
24139
24069
  {
24140
24070
  generator .beginObject (this .getTypeName (), false, true);
24141
- generator .stringProperty ("@USE", this [_importedName], false);
24071
+ generator .stringProperty ("@USE", this [_importedNode] .getImportedName (), false);
24142
24072
  generator .endObject ();
24143
24073
  generator .endObject ();
24144
24074
  },
24145
- });
24146
-
24147
- Object .defineProperties (X3DImportedNodeProxy .prototype,
24148
- {
24149
- constructor:
24075
+ dispose ()
24150
24076
  {
24151
- get ()
24077
+ const executionContext = this .getExecutionContext ();
24078
+
24079
+ for (const route of Array .from (executionContext .getRoutes ()))
24152
24080
  {
24153
- return this [X3DImportedNodeProxy_type] ?? Core_X3DNode;
24154
- },
24155
- }
24081
+ if (route .getSourceNode () === this)
24082
+ {
24083
+ executionContext .deleteRoute (route);
24084
+ continue;
24085
+ }
24086
+
24087
+ if (route .getDestinationNode () === this)
24088
+ {
24089
+ executionContext .deleteRoute (route);
24090
+ continue;
24091
+ }
24092
+ }
24093
+
24094
+ this .getImportedNode () .refreshInstance ();
24095
+
24096
+ Core_X3DNode .prototype .dispose .call (this);
24097
+ },
24156
24098
  });
24157
24099
 
24158
- Object .defineProperties (X3DImportedNodeProxy, Core_X3DNode .getStaticProperties ("X3DImportedNodeProxy", "Core", 2, "children", "4.1"));
24100
+ Object .defineProperties (X3DImportedNodeInstance, Core_X3DNode .getStaticProperties ("X3DImportedNodeInstance", "Core", 2, "children", "4.1"));
24159
24101
 
24160
- const X3DImportedNodeProxy_default_ = X3DImportedNodeProxy;
24102
+ const X3DImportedNodeInstance_default_ = X3DImportedNodeInstance;
24161
24103
  ;
24162
24104
 
24163
- /* harmony default export */ const Core_X3DImportedNodeProxy = (x_ite_Namespace .add ("X3DImportedNodeProxy", X3DImportedNodeProxy_default_));
24105
+ /* harmony default export */ const Core_X3DImportedNodeInstance = (x_ite_Namespace .add ("X3DImportedNodeInstance", X3DImportedNodeInstance_default_));
24164
24106
  ;// ./src/x_ite/Execution/X3DImportedNode.js
24165
24107
 
24166
24108
 
@@ -24170,20 +24112,23 @@ const
24170
24112
  X3DImportedNode_executionContext = Symbol (),
24171
24113
  _inlineNode = Symbol (),
24172
24114
  _exportedName = Symbol (),
24173
- X3DImportedNode_importedName = Symbol (),
24174
- _description = Symbol (),
24175
- _exportedNodes = Symbol ();
24115
+ _importedName = Symbol (),
24116
+ _instance = Symbol (),
24117
+ _description = Symbol ();
24176
24118
 
24177
24119
  function X3DImportedNode (executionContext, inlineNode, exportedName, importedName, description)
24178
24120
  {
24179
24121
  Base_X3DObject .call (this);
24180
24122
 
24123
+ // Private properties
24124
+
24181
24125
  this [X3DImportedNode_executionContext] = executionContext;
24182
24126
  this [_inlineNode] = inlineNode;
24183
24127
  this [_exportedName] = exportedName;
24184
- this [X3DImportedNode_importedName] = importedName;
24128
+ this [_importedName] = importedName;
24185
24129
  this [_description] = description;
24186
- this [_exportedNodes] = executionContext [_exportedNodes] ??= new Map ();
24130
+
24131
+ this .refreshInstance ();
24187
24132
  }
24188
24133
 
24189
24134
  Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObject .prototype),
@@ -24200,27 +24145,7 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24200
24145
  {
24201
24146
  return this [_exportedName];
24202
24147
  },
24203
- getExportedNode (type)
24204
- {
24205
- const exportedNode = this [_exportedNodes] .get (this [X3DImportedNode_importedName]);
24206
-
24207
- exportedNode ?.setTypeHint (type);
24208
-
24209
- return exportedNode ?? this .createExportedNode (type);
24210
- },
24211
- createExportedNode (type)
24212
- {
24213
- const exportedNode = new Core_X3DImportedNodeProxy (this .getExecutionContext (), this [X3DImportedNode_importedName], type);
24214
-
24215
- this [_exportedNodes] .set (this [X3DImportedNode_importedName], exportedNode);
24216
-
24217
- return exportedNode;
24218
- },
24219
- updateExportedNode ()
24220
- {
24221
- this [_exportedNodes] .get (this [X3DImportedNode_importedName]) ?.update ();
24222
- },
24223
- getSharedNode ()
24148
+ getExportedNode ()
24224
24149
  {
24225
24150
  const exportedNode = this .getInlineNode () .getInternalScene () .getExportedNodes () .get (this [_exportedName]);
24226
24151
 
@@ -24231,20 +24156,26 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24231
24156
  },
24232
24157
  getImportedName ()
24233
24158
  {
24234
- return this [X3DImportedNode_importedName];
24159
+ return this [_importedName];
24235
24160
  },
24236
- [Symbol .for ("X_ITE.X3DImportedNode.setImportName")] (importedName)
24161
+ setImportName (importedName)
24237
24162
  {
24238
- const
24239
- exportedNode = this .getExportedNode (),
24240
- exportedNodes = this [_exportedNodes];
24163
+ this [_instance] .setName (importedName);
24241
24164
 
24242
- exportedNodes .delete (this [X3DImportedNode_importedName]);
24243
- exportedNodes .set (importedName, exportedNode);
24165
+ this [_importedName] = importedName;
24166
+ },
24167
+ getInstance ()
24168
+ {
24169
+ return this [_instance];
24170
+ },
24171
+ refreshInstance ()
24172
+ {
24173
+ if (this [_instance] && !this [X3DImportedNode_executionContext] .getImportedNodes () .has (this [_importedName]))
24174
+ return;
24244
24175
 
24245
- this [X3DImportedNode_importedName] = importedName;
24176
+ this [_instance] = new Core_X3DImportedNodeInstance (this [X3DImportedNode_executionContext], this);
24246
24177
 
24247
- exportedNode .setName (importedName);
24178
+ this [_instance] .setup ();
24248
24179
  },
24249
24180
  getDescription ()
24250
24181
  {
@@ -24259,9 +24190,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24259
24190
  if (!generator .ExistsNode (this .getInlineNode ()))
24260
24191
  throw new Error ("X3DImportedNode.toVRMLStream: Inline node does not exist.");
24261
24192
 
24262
- generator .AddRouteNode (this);
24193
+ generator .AddRouteNode (this .getInstance ());
24263
24194
 
24264
- const importedName = generator .ImportedName (this);
24195
+ const importedName = generator .ImportedName (this .getInstance ());
24265
24196
 
24266
24197
  generator .Indent ();
24267
24198
  generator .string += "IMPORT";
@@ -24293,9 +24224,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24293
24224
  if (!generator .ExistsNode (this .getInlineNode ()))
24294
24225
  throw new Error ("X3DImportedNode.toXMLStream: Inline node does not exist.");
24295
24226
 
24296
- generator .AddRouteNode (this);
24227
+ generator .AddRouteNode (this .getInstance ());
24297
24228
 
24298
- const importedName = generator .ImportedName (this);
24229
+ const importedName = generator .ImportedName (this .getInstance ());
24299
24230
 
24300
24231
  generator .openTag ("IMPORT");
24301
24232
  generator .attribute ("inlineDEF", generator .Name (this .getInlineNode ()));
@@ -24317,12 +24248,12 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24317
24248
  generator .TidyBreak ();
24318
24249
  generator .Indent ();
24319
24250
 
24320
- generator .AddRouteNode (this);
24251
+ generator .AddRouteNode (this .getInstance ());
24321
24252
  generator .beginObject ("IMPORT", false, true);
24322
24253
  generator .stringProperty ("@inlineDEF", generator .Name (this .getInlineNode ()), false);
24323
24254
  generator .stringProperty ("@importedDEF", this .getExportedName ());
24324
24255
 
24325
- const importedName = generator .ImportedName (this);
24256
+ const importedName = generator .ImportedName (this .getInstance ());
24326
24257
 
24327
24258
  if (importedName !== this .getExportedName ())
24328
24259
  generator .stringProperty ("@AS", importedName);
@@ -24335,20 +24266,9 @@ Object .assign (Object .setPrototypeOf (X3DImportedNode .prototype, Base_X3DObje
24335
24266
  },
24336
24267
  dispose ()
24337
24268
  {
24338
- for (const route of Array .from (this [X3DImportedNode_executionContext] .getRoutes ()))
24339
- {
24340
- if (route .getSourceNode () === this)
24341
- {
24342
- this [X3DImportedNode_executionContext] .deleteRoute (route);
24343
- continue;
24344
- }
24269
+ this [X3DImportedNode_executionContext] .removeImportedNode (this [_importedName]);
24345
24270
 
24346
- if (route .getDestinationNode () === this)
24347
- {
24348
- this [X3DImportedNode_executionContext] .deleteRoute (route);
24349
- continue;
24350
- }
24351
- }
24271
+ this .instance .dispose ();
24352
24272
 
24353
24273
  Base_X3DObject .prototype .dispose .call (this);
24354
24274
  },
@@ -24385,6 +24305,14 @@ Object .defineProperties (X3DImportedNode .prototype,
24385
24305
  get: X3DImportedNode .prototype .getImportedName,
24386
24306
  enumerable: true,
24387
24307
  },
24308
+ instance:
24309
+ {
24310
+ get ()
24311
+ {
24312
+ return Fields_SFNodeCache .get (this .getInstance ());
24313
+ },
24314
+ enumerable: true,
24315
+ },
24388
24316
  description:
24389
24317
  {
24390
24318
  get: X3DImportedNode .prototype .getDescription,
@@ -24746,11 +24674,14 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
24746
24674
 
24747
24675
  this .set_live__ ();
24748
24676
 
24749
- this .importExternProtos (proto .getBody () .externprotos);
24750
- this .importProtos (proto .getBody () .protos);
24751
- this .copyRootNodes (proto .getBody () .rootNodes);
24752
- this .importImportedNodes (proto .getBody () .importedNodes);
24753
- this .copyRoutes (proto .getBody () .routes);
24677
+ const protoBody = proto .getBody ();
24678
+
24679
+ this .addExternProtos (protoBody .externprotos);
24680
+ this .addProtos (protoBody .protos);
24681
+ this .copyNamedNodes (protoBody .namedNodes);
24682
+ this .copyImportedNodes (protoBody .importedNodes);
24683
+ this .copyRootNodes (protoBody .rootNodes);
24684
+ this .copyRoutes (protoBody .routes);
24754
24685
 
24755
24686
  // Propagate events.
24756
24687
 
@@ -25010,20 +24941,25 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25010
24941
 
25011
24942
  return Core_X3DNode .prototype .isDefaultValue .call (this, field);
25012
24943
  },
25013
- importExternProtos (externprotos1)
24944
+ addExternProtos (externprotos1)
25014
24945
  {
25015
24946
  const externprotos2 = this [_body] .externprotos;
25016
24947
 
25017
24948
  for (const externproto of externprotos1)
25018
24949
  externprotos2 .add (externproto .getName (), externproto);
25019
24950
  },
25020
- importProtos (protos1)
24951
+ addProtos (protos1)
25021
24952
  {
25022
24953
  const protos2 = this [_body] .protos;
25023
24954
 
25024
24955
  for (const proto of protos1)
25025
24956
  protos2 .add (proto .getName (), proto);
25026
24957
  },
24958
+ copyNamedNodes (namedNodes)
24959
+ {
24960
+ for (const node of namedNodes)
24961
+ node .copy (this);
24962
+ },
25027
24963
  copyRootNodes (rootNodes1)
25028
24964
  {
25029
24965
  const rootNodes2 = this [_body] .getRootNodes ();
@@ -25031,15 +24967,17 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25031
24967
  for (const node of rootNodes1 .getValue ())
25032
24968
  rootNodes2 .push (node .copy (this));
25033
24969
  },
25034
- importImportedNodes (importedNodes)
24970
+ copyImportedNodes (importedNodes)
25035
24971
  {
24972
+ const body = this [_body];
24973
+
25036
24974
  for (const importedNode of importedNodes)
25037
24975
  {
25038
24976
  try
25039
24977
  {
25040
- const inlineNode = this [_body] .getNamedNode (importedNode .getInlineNode () .getName ());
24978
+ const inlineNode = body .getNamedNode (importedNode .getInlineNode () .getName ());
25041
24979
 
25042
- this [_body] .addImportedNode (inlineNode, importedNode .getExportedName (), importedNode .getImportedName ());
24980
+ body .addImportedNode (inlineNode, importedNode .getExportedName (), importedNode .getImportedName ());
25043
24981
  }
25044
24982
  catch (error)
25045
24983
  {
@@ -25049,19 +24987,17 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, Core_X3
25049
24987
  },
25050
24988
  copyRoutes (routes)
25051
24989
  {
24990
+ const body = this [_body];
24991
+
25052
24992
  for (const route of routes)
25053
24993
  {
25054
24994
  try
25055
24995
  {
25056
- const sourceNode = route .getSourceNode () instanceof Core_X3DNode
25057
- ? this [_body] .getLocalNode (route .getSourceNode () .getName ())
25058
- : this [_body] .getLocalNode (route .getSourceNode () .getImportedName ());
25059
-
25060
- const destinationNode = route .getDestinationNode () instanceof Core_X3DNode
25061
- ? this [_body] .getLocalNode (route .getDestinationNode () .getName ())
25062
- : this [_body] .getLocalNode (route .getDestinationNode () .getImportedName ());
24996
+ const
24997
+ sourceNode = body .getLocalNode (route .getSourceNode () .getName ()),
24998
+ destinationNode = body .getLocalNode (route .getDestinationNode () .getName ());
25063
24999
 
25064
- this [_body] .addRoute (sourceNode, route .sourceField, destinationNode, route .destinationField);
25000
+ body .addRoute (sourceNode, route .sourceField, destinationNode, route .destinationField);
25065
25001
  }
25066
25002
  catch (error)
25067
25003
  {
@@ -26013,6 +25949,11 @@ Object .assign (X3DParser .prototype,
26013
25949
 
26014
25950
  return values;
26015
25951
  },
25952
+ checkColorName (color, name)
25953
+ {
25954
+ if (color .every (v => v === 1) && name .toLowerCase () !== "white" && name .match (/^[a-zA-Z]+$/))
25955
+ throw new Error ("Invalid color name.");
25956
+ },
26016
25957
  sanitizeName (name = "")
26017
25958
  {
26018
25959
  // NonIdFirstChar
@@ -26216,7 +26157,7 @@ class Placeholder extends Core_X3DNode
26216
26157
  localNode = this .#namedNodes .get (name) ?? this .#importedNodes .get (name);
26217
26158
 
26218
26159
  const node = localNode instanceof Execution_X3DImportedNode
26219
- ? localNode .getExportedNode (this .#type)
26160
+ ? localNode .getInstance ()
26220
26161
  : localNode;
26221
26162
 
26222
26163
  if (node)
@@ -26326,7 +26267,7 @@ const Grammar = Parser_Expressions ({
26326
26267
 
26327
26268
  // Values
26328
26269
  int32: /(?:0[xX][\da-fA-F]+)|(?:[+-]?\d+)/y,
26329
- double: /[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/y,
26270
+ double: /(?!0[xX])[+-]?(?:(?:(?:\d*\.\d+)|(?:\d+(?:\.)?))(?:[eE][+-]?\d+)?)/y,
26330
26271
  doubleQuotes: /"/y,
26331
26272
  noDoubleQuotes: /[^"]+/y,
26332
26273
 
@@ -26428,6 +26369,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26428
26369
  }
26429
26370
  catch (error)
26430
26371
  {
26372
+ if (DEVELOPMENT)
26373
+ console .error (error);
26374
+
26431
26375
  throw new Error (this .getError (error), { cause: error });
26432
26376
  }
26433
26377
  },
@@ -26581,6 +26525,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26581
26525
  }
26582
26526
  catch (error)
26583
26527
  {
26528
+ if (DEVELOPMENT)
26529
+ console .error (error);
26530
+
26584
26531
  throw new Error (this .getError (error), { cause: error });
26585
26532
  }
26586
26533
  })
@@ -26935,11 +26882,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
26935
26882
 
26936
26883
  try
26937
26884
  {
26938
- const localNode = this .getExecutionContext () .getLocalNode (nodeNameId);
26939
-
26940
- return localNode instanceof Execution_X3DImportedNode
26941
- ? localNode .getExportedNode ()
26942
- : localNode .getValue ();
26885
+ return this .getExecutionContext () .getLocalNode (nodeNameId) .getValue ();
26943
26886
  }
26944
26887
  catch
26945
26888
  {
@@ -27980,7 +27923,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
27980
27923
 
27981
27924
  if (Grammar .HTMLColor .parse (this))
27982
27925
  {
27983
- const color = this .convertColor (this .result [0] .replace (/0x/i, "#"));
27926
+ const color = this .convertColor (this .result [0] .replace (/^0x/i, "#"));
27927
+
27928
+ this .checkColorName (color, this .result [0]);
27984
27929
 
27985
27930
  field .r = color [0];
27986
27931
  field .g = color [1];
@@ -28013,12 +27958,28 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28013
27958
 
28014
27959
  return false;
28015
27960
  },
27961
+ sfColor: new x_ite_Fields .SFColor (),
28016
27962
  sfcolorValues (field)
28017
27963
  {
28018
27964
  const array = [ ];
28019
27965
 
28020
- while (this .double ())
28021
- array .push (this .value);
27966
+ for (;;)
27967
+ {
27968
+ if (this .double ())
27969
+ {
27970
+ array .push (this .value);
27971
+ continue;
27972
+ }
27973
+
27974
+ // Try parse HTML/CSS color values.
27975
+ if (this .sfcolorValue (this .sfColor))
27976
+ {
27977
+ array .push (... this .sfColor);
27978
+ continue;
27979
+ }
27980
+
27981
+ break;
27982
+ }
28022
27983
 
28023
27984
  field .setValue (array);
28024
27985
 
@@ -28061,7 +28022,9 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28061
28022
 
28062
28023
  if (Grammar .HTMLColor .parse (this))
28063
28024
  {
28064
- const color = this .convertColor (this .result [0] .replace (/0x/i, "#"));
28025
+ const color = this .convertColor (this .result [0] .replace (/^0x/i, "#"));
28026
+
28027
+ this .checkColorName (color, this .result [0]);
28065
28028
 
28066
28029
  field .r = color [0];
28067
28030
  field .g = color [1];
@@ -28085,7 +28048,7 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28085
28048
 
28086
28049
  if (Grammar .OpenBracket .parse (this))
28087
28050
  {
28088
- this .sfcolorValues (field);
28051
+ this .sfcolorrgbaValues (field);
28089
28052
 
28090
28053
  if (Grammar .CloseBracket .parse (this))
28091
28054
  return true;
@@ -28095,6 +28058,33 @@ Object .assign (Object .setPrototypeOf (VRMLParser .prototype, Parser_X3DParser
28095
28058
 
28096
28059
  return false;
28097
28060
  },
28061
+ sfColorRGBA: new x_ite_Fields .SFColorRGBA (),
28062
+ sfcolorrgbaValues (field)
28063
+ {
28064
+ const array = [ ];
28065
+
28066
+ for (;;)
28067
+ {
28068
+ if (this .double ())
28069
+ {
28070
+ array .push (this .value);
28071
+ continue;
28072
+ }
28073
+
28074
+ // Try parse HTML/CSS color values.
28075
+ if (this .sfcolorrgbaValue (this .sfColorRGBA))
28076
+ {
28077
+ array .push (... this .sfColorRGBA);
28078
+ continue;
28079
+ }
28080
+
28081
+ break;
28082
+ }
28083
+
28084
+ field .setValue (array);
28085
+
28086
+ return field .length !== 0;
28087
+ },
28098
28088
  sfdoubleValue (field)
28099
28089
  {
28100
28090
  if (this .double ())
@@ -29865,11 +29855,7 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29865
29855
 
29866
29856
  try
29867
29857
  {
29868
- const localNode = this .getExecutionContext () .getLocalNode (name);
29869
-
29870
- const node = localNode instanceof Execution_X3DImportedNode
29871
- ? localNode .getExportedNode (type)
29872
- : localNode .getValue ();
29858
+ const node = this .getExecutionContext () .getLocalNode (name) .getValue ();
29873
29859
 
29874
29860
  this .checkNodeType (node, name, type, typeName);
29875
29861
  this .addNode (xmlElement, node);
@@ -29898,6 +29884,9 @@ Object .assign (Object .setPrototypeOf (XMLParser .prototype, Parser_X3DParser .
29898
29884
  },
29899
29885
  checkNodeType (node, name, type, typeName)
29900
29886
  {
29887
+ if (node instanceof Core_X3DImportedNodeInstance)
29888
+ return;
29889
+
29901
29890
  if (type === Core_X3DNode)
29902
29891
  return;
29903
29892
 
@@ -31172,7 +31161,7 @@ const Plane3_default_ = Plane3;
31172
31161
 
31173
31162
  /* harmony default export */ const Geometry_Plane3 = (x_ite_Namespace .add ("Plane3", Plane3_default_));
31174
31163
  ;// ./src/standard/Math/Geometry/Triangle3.js
31175
- /* provided dependency */ var libtess = __webpack_require__(628);
31164
+ /* provided dependency */ var libtess = __webpack_require__(67);
31176
31165
 
31177
31166
 
31178
31167
  const Triangle3 =
@@ -37866,7 +37855,7 @@ Object .assign (Object .setPrototypeOf (ImageTexture .prototype, Texturing_X3DTe
37866
37855
  {
37867
37856
  fileURL = new URL (fileURL);
37868
37857
 
37869
- if (fileURL .pathname .match (/\.ktx2?(?:\.gz)?$/) || fileURL .href .match (/^\s*data:image\/ktx2[;,]/s))
37858
+ if (fileURL .pathname .match (/\.ktx2?(?:\.gz)?$/) || fileURL .href .match (/^\s*data:image\/ktx2[;,]/))
37870
37859
  {
37871
37860
  this .setLinear (true);
37872
37861
  this .setMipMaps (false);
@@ -47894,7 +47883,7 @@ const Bezier_default_ = Bezier;
47894
47883
 
47895
47884
  /* harmony default export */ const Algorithms_Bezier = (x_ite_Namespace .add ("Bezier", Bezier_default_));
47896
47885
  ;// ./src/x_ite/Parser/SVGParser.js
47897
- /* provided dependency */ var SVGParser_libtess = __webpack_require__(628);
47886
+ /* provided dependency */ var SVGParser_libtess = __webpack_require__(67);
47898
47887
 
47899
47888
 
47900
47889
 
@@ -50753,9 +50742,15 @@ class GoldenGate extends Parser_X3DParser
50753
50742
  if (string === undefined)
50754
50743
  return;
50755
50744
 
50756
- if (string .match (/^\s*$/s))
50745
+ // An empty string should result in an empty XML (encoding) scene.
50746
+ if (string .match (/^\s*$/))
50757
50747
  return "";
50758
50748
 
50749
+ // XML must start with markup. Do not try DOMParser on other input, because
50750
+ // some browsers (Firefox) log a parsing error to the console when it fails.
50751
+ if (!string .match (/^\s*</))
50752
+ return;
50753
+
50759
50754
  return helper.parseXML (string);
50760
50755
  }
50761
50756
  case "JSON":
@@ -51176,9 +51171,6 @@ class FileLoader
51176
51171
  {
51177
51172
  const scene = new Execution_X3DScene (this .browser);
51178
51173
 
51179
- if (!(this .node instanceof Execution_X3DWorld))
51180
- scene .setExecutionContext (this .executionContext);
51181
-
51182
51174
  scene .setWorldURL (new URL (worldURL, this .getBaseURL ()));
51183
51175
  scene .setup ();
51184
51176
 
@@ -51283,7 +51275,7 @@ class FileLoader
51283
51275
 
51284
51276
  // Script:
51285
51277
  {
51286
- const result = url .match (/^\s*(?:ecmascript|javascript|vrmlscript):/s);
51278
+ const result = url .match (/^\s*(?:ecmascript|javascript|vrmlscript):/);
51287
51279
 
51288
51280
  if (result)
51289
51281
  return await this .dataCallback (url .substring (result [0] .length));
@@ -51294,7 +51286,7 @@ class FileLoader
51294
51286
  // Handle data URLs that are not base64 decoded here:
51295
51287
  if (this .dataAsString)
51296
51288
  {
51297
- const result = url .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/s);
51289
+ const result = url .match (/^\s*data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,/);
51298
51290
 
51299
51291
  if (result && result [3] !== "base64")
51300
51292
  {
@@ -51922,8 +51914,6 @@ const ProtoDeclarationArray_default_ = ProtoDeclarationArray;
51922
51914
 
51923
51915
 
51924
51916
 
51925
-
51926
-
51927
51917
  const
51928
51918
  X3DRoute_executionContext = Symbol (),
51929
51919
  _sourceNode = Symbol (),
@@ -51931,8 +51921,7 @@ const
51931
51921
  _sourceField = Symbol (),
51932
51922
  _destinationNode = Symbol (),
51933
51923
  _destinationFieldName = Symbol (),
51934
- _destinationField = Symbol (),
51935
- _disposed = Symbol ();
51924
+ _destinationField = Symbol ();
51936
51925
 
51937
51926
  function X3DRoute (executionContext, sourceNode, sourceFieldName, destinationNode, destinationFieldName)
51938
51927
  {
@@ -51944,11 +51933,11 @@ function X3DRoute (executionContext, sourceNode, sourceFieldName, destinationNod
51944
51933
  this [_destinationNode] = destinationNode;
51945
51934
  this [_destinationFieldName] = destinationFieldName;
51946
51935
 
51947
- if (sourceNode instanceof Execution_X3DImportedNode)
51948
- sourceNode .getInlineNode () ._loadState .addInterest ("reconnect", this);
51936
+ if (sourceNode instanceof Core_X3DImportedNodeInstance)
51937
+ sourceNode .getImportedNode () .getInlineNode () ._loadState .addInterest ("reconnect", this);
51949
51938
 
51950
- if (destinationNode instanceof Execution_X3DImportedNode)
51951
- destinationNode .getInlineNode () ._loadState .addInterest ("reconnect", this);
51939
+ if (destinationNode instanceof Core_X3DImportedNodeInstance)
51940
+ destinationNode .getImportedNode () .getInlineNode () ._loadState .addInterest ("reconnect", this);
51952
51941
 
51953
51942
  this .reconnect ();
51954
51943
  }
@@ -51959,17 +51948,8 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
51959
51948
  {
51960
51949
  return this [X3DRoute_executionContext];
51961
51950
  },
51962
- getRouteId ()
51963
- {
51964
- return X3DRoute .getRouteId (this [_sourceNode], this [_sourceFieldName], this [_destinationNode], this [_destinationFieldName]);
51965
- },
51966
51951
  getSourceNode ()
51967
51952
  {
51968
- /// SAI
51969
-
51970
- if (this [_sourceNode] instanceof Execution_X3DImportedNode)
51971
- return this [_sourceNode] .getExportedNode ();
51972
-
51973
51953
  return this [_sourceNode];
51974
51954
  },
51975
51955
  getSourceField ()
@@ -51990,11 +51970,6 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
51990
51970
  },
51991
51971
  getDestinationNode ()
51992
51972
  {
51993
- /// SAI
51994
-
51995
- if (this [_destinationNode] instanceof Execution_X3DImportedNode)
51996
- return this [_destinationNode] .getExportedNode ();
51997
-
51998
51973
  return this [_destinationNode];
51999
51974
  },
52000
51975
  getDestinationField ()
@@ -52021,10 +51996,10 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52021
51996
  }
52022
51997
  catch (error)
52023
51998
  {
52024
- if ((this [_sourceNode] instanceof Core_X3DNode ||
52025
- this [_sourceNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE) &&
52026
- (this [_destinationNode] instanceof Core_X3DNode ||
52027
- this [_destinationNode] .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE))
51999
+ if ((!(this [_sourceNode] instanceof Core_X3DImportedNodeInstance) ||
52000
+ this [_sourceNode] .getImportedNode () .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE) &&
52001
+ (!(this [_destinationNode] instanceof Core_X3DImportedNodeInstance) ||
52002
+ this [_destinationNode] .getImportedNode () .getInlineNode () .checkLoadState () === Base_X3DConstants .COMPLETE_STATE))
52028
52003
  {
52029
52004
  console .warn (error);
52030
52005
  }
@@ -52032,18 +52007,11 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52032
52007
  },
52033
52008
  connect ()
52034
52009
  {
52035
- if (this [_disposed])
52036
- return;
52037
-
52038
52010
  const errors = [ ];
52039
52011
 
52040
52012
  try
52041
52013
  {
52042
- const sourceNode = this [_sourceNode] instanceof Core_X3DNode
52043
- ? this [_sourceNode]
52044
- : this [_sourceNode] .getExportedNode ();
52045
-
52046
- this [_sourceField] = sourceNode .getField (this [_sourceFieldName]);
52014
+ this [_sourceField] = this [_sourceNode] .getField (this [_sourceFieldName]);
52047
52015
  }
52048
52016
  catch (error)
52049
52017
  {
@@ -52052,11 +52020,7 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52052
52020
 
52053
52021
  try
52054
52022
  {
52055
- const destinationNode = this [_destinationNode] instanceof Core_X3DNode
52056
- ? this [_destinationNode]
52057
- : this [_destinationNode] .getExportedNode ();
52058
-
52059
- this [_destinationField] = destinationNode .getField (this [_destinationFieldName]);
52023
+ this [_destinationField] = this [_destinationNode] .getField (this [_destinationFieldName]);
52060
52024
  }
52061
52025
  catch (error)
52062
52026
  {
@@ -52095,13 +52059,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52095
52059
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52096
52060
  throw new Error (`Destination node does not exist in scene graph.`);
52097
52061
 
52098
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52099
- ? generator .Name (this [_sourceNode])
52100
- : generator .ImportedName (this [_sourceNode]);
52062
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52063
+ ? generator .ImportedName (this [_sourceNode])
52064
+ : generator .Name (this [_sourceNode]);
52101
52065
 
52102
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52103
- ? generator .Name (this [_destinationNode])
52104
- : generator .ImportedName (this [_destinationNode]);
52066
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52067
+ ? generator .ImportedName (this [_destinationNode])
52068
+ : generator .Name (this [_destinationNode]);
52105
52069
 
52106
52070
  generator .Indent ();
52107
52071
  generator .string += "ROUTE";
@@ -52124,13 +52088,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52124
52088
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52125
52089
  throw new Error (`Destination node does not exist in scene graph.`);
52126
52090
 
52127
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52128
- ? generator .Name (this [_sourceNode])
52129
- : generator .ImportedName (this [_sourceNode]);
52091
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52092
+ ? generator .ImportedName (this [_sourceNode])
52093
+ : generator .Name (this [_sourceNode]);
52130
52094
 
52131
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52132
- ? generator .Name (this [_destinationNode])
52133
- : generator .ImportedName (this [_destinationNode]);
52095
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52096
+ ? generator .ImportedName (this [_destinationNode])
52097
+ : generator .Name (this [_destinationNode]);
52134
52098
 
52135
52099
  generator .openTag ("ROUTE");
52136
52100
  generator .attribute ("fromNode", sourceNodeName);
@@ -52147,13 +52111,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52147
52111
  if (!generator .ExistsRouteNode (this [_destinationNode]))
52148
52112
  throw new Error (`Destination node does not exist in scene graph.`);
52149
52113
 
52150
- const sourceNodeName = this [_sourceNode] instanceof Core_X3DNode
52151
- ? generator .Name (this [_sourceNode])
52152
- : generator .ImportedName (this [_sourceNode]);
52114
+ const sourceNodeName = this [_sourceNode] instanceof Core_X3DImportedNodeInstance
52115
+ ? generator .ImportedName (this [_sourceNode])
52116
+ : generator .Name (this [_sourceNode]);
52153
52117
 
52154
- const destinationNodeName = this [_destinationNode] instanceof Core_X3DNode
52155
- ? generator .Name (this [_destinationNode])
52156
- : generator .ImportedName (this [_destinationNode]);
52118
+ const destinationNodeName = this [_destinationNode] instanceof Core_X3DImportedNodeInstance
52119
+ ? generator .ImportedName (this [_destinationNode])
52120
+ : generator .Name (this [_destinationNode]);
52157
52121
 
52158
52122
  generator .TidyBreak ();
52159
52123
  generator .Indent ();
@@ -52170,18 +52134,13 @@ Object .assign (Object .setPrototypeOf (X3DRoute .prototype, Base_X3DObject .pro
52170
52134
  },
52171
52135
  dispose ()
52172
52136
  {
52173
- if (this [_disposed])
52174
- return;
52175
-
52176
- this [_disposed] = true;
52177
-
52178
52137
  this .disconnect ();
52179
52138
 
52180
- if (this [_sourceNode] instanceof Execution_X3DImportedNode)
52181
- this [_sourceNode] .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52139
+ if (this [_sourceNode] instanceof Core_X3DImportedNodeInstance)
52140
+ this [_sourceNode] .getImportedNode () .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52182
52141
 
52183
- if (this [_destinationNode] instanceof Execution_X3DImportedNode)
52184
- this [_destinationNode] .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52142
+ if (this [_destinationNode] instanceof Core_X3DImportedNodeInstance)
52143
+ this [_destinationNode] .getImportedNode () .getInlineNode () ._loadState .removeInterest ("reconnect", this);
52185
52144
 
52186
52145
  this [X3DRoute_executionContext] .deleteRoute (this);
52187
52146
 
@@ -52233,36 +52192,6 @@ Object .defineProperties (X3DRoute,
52233
52192
 
52234
52193
  Object .assign (X3DRoute,
52235
52194
  {
52236
- getRouteId (sourceNode, sourceFieldName, destinationNode, destinationFieldName)
52237
- {
52238
- const sourceField = sourceNode instanceof Core_X3DNode
52239
- ? sourceNode .getField (sourceFieldName)
52240
- : helper.try (() => sourceNode .getExportedNode () .getField (sourceFieldName));
52241
-
52242
- const destinationField = destinationNode instanceof Core_X3DNode
52243
- ? destinationNode .getField (destinationFieldName)
52244
- : helper.try (() => destinationNode .getExportedNode () .getField (destinationFieldName));
52245
-
52246
- X3DRoute .checkFields (sourceField, destinationField);
52247
-
52248
- if (sourceField)
52249
- {
52250
- sourceFieldName = sourceField .getName ();
52251
-
52252
- if (sourceField .getAccessType () === Base_X3DConstants .inputOutput)
52253
- sourceFieldName += "_changed";
52254
- }
52255
-
52256
- if (destinationField)
52257
- {
52258
- destinationFieldName = destinationField .getName ();
52259
-
52260
- if (destinationField .getAccessType () === Base_X3DConstants .inputOutput)
52261
- destinationFieldName = "set_" + destinationFieldName;
52262
- }
52263
-
52264
- return `${sourceNode .getId ()}.${sourceFieldName}.${destinationNode .getId ()}.${destinationFieldName}`;
52265
- },
52266
52195
  checkFields (sourceField, destinationField)
52267
52196
  {
52268
52197
  if (sourceField && destinationField)
@@ -52335,6 +52264,7 @@ const RouteArray_default_ = RouteArray;
52335
52264
 
52336
52265
 
52337
52266
 
52267
+
52338
52268
  const
52339
52269
  _outerNode = Symbol (),
52340
52270
  _namedNodes = Symbol (),
@@ -52543,10 +52473,13 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52543
52473
  if (!node)
52544
52474
  throw new Error ("Couldn't add named node: node must be of type X3DNode.");
52545
52475
 
52476
+ if (node instanceof Core_X3DImportedNodeInstance)
52477
+ throw new Error ("Couldn't add named node: node cannot be of type X3DImportedNodeInstance.");
52478
+
52546
52479
  if (node .getExecutionContext () !== this)
52547
52480
  throw new Error ("Couldn't add named node: node does not belong to this execution context.");
52548
52481
 
52549
- if (name .length === 0)
52482
+ if (!name)
52550
52483
  throw new Error ("Couldn't add named node: node name is empty.");
52551
52484
 
52552
52485
  if (this [_namedNodes] .has (name))
@@ -52569,10 +52502,13 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52569
52502
  if (!node)
52570
52503
  throw new Error ("Couldn't update named node: node must be of type X3DNode.");
52571
52504
 
52505
+ if (node instanceof Core_X3DImportedNodeInstance)
52506
+ throw new Error ("Couldn't add named node: node cannot be of type X3DImportedNodeInstance.");
52507
+
52572
52508
  if (node .getExecutionContext () !== this)
52573
52509
  throw new Error ("Couldn't update named node: node does not belong to this execution context.");
52574
52510
 
52575
- if (name .length === 0)
52511
+ if (!name)
52576
52512
  throw new Error ("Couldn't update named node: node name is empty.");
52577
52513
 
52578
52514
  // Remove named node.
@@ -52641,10 +52577,10 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52641
52577
  if (inlineNode .getExecutionContext () !== this)
52642
52578
  throw new Error ("Couldn't update imported node: Inline node does not belong to this execution context.");
52643
52579
 
52644
- if (exportedName .length === 0)
52580
+ if (!exportedName)
52645
52581
  throw new Error ("Couldn't update imported node: exported name is empty.");
52646
52582
 
52647
- if (importedName .length === 0)
52583
+ if (!importedName)
52648
52584
  throw new Error ("Couldn't update imported node: imported name is empty.");
52649
52585
 
52650
52586
  // Update imported node.
@@ -52655,8 +52591,6 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52655
52591
 
52656
52592
  this [_importedNodes] .add (importedName, importedNode);
52657
52593
 
52658
- importedNode .updateExportedNode ();
52659
-
52660
52594
  this ._sceneGraph_changed = Date .now () / 1000;
52661
52595
  },
52662
52596
  renameImportedNode (oldImportedName, newImportedName)
@@ -52669,7 +52603,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52669
52603
  if (this [_importedNodes] .get (newImportedName))
52670
52604
  throw new Error ("Couldn't rename imported node: new imported name does already exists.");
52671
52605
 
52672
- importedNode [Symbol .for ("X_ITE.X3DImportedNode.setImportName")] (newImportedName);
52606
+ importedNode .setImportName (newImportedName);
52673
52607
 
52674
52608
  this [_importedNodes] .update (oldImportedName, newImportedName, importedNode);
52675
52609
 
@@ -52684,10 +52618,10 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52684
52618
  if (!importedNode)
52685
52619
  return;
52686
52620
 
52687
- importedNode .dispose ();
52688
-
52689
52621
  this [_importedNodes] .remove (importedName);
52690
52622
 
52623
+ importedNode .dispose ();
52624
+
52691
52625
  this ._sceneGraph_changed = Date .now () / 1000;
52692
52626
  },
52693
52627
  getImportedNode (importedName)
@@ -52697,7 +52631,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52697
52631
  const importedNode = this [_importedNodes] .get (importedName);
52698
52632
 
52699
52633
  if (importedNode)
52700
- return importedNode .exportedNode;
52634
+ return importedNode .instance;
52701
52635
 
52702
52636
  throw new Error (`Imported node '${importedName}' not found.`);
52703
52637
  },
@@ -52722,7 +52656,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52722
52656
  const importedNode = this [_importedNodes] .get (name);
52723
52657
 
52724
52658
  if (importedNode)
52725
- return importedNode;
52659
+ return importedNode .instance;
52726
52660
 
52727
52661
  throw new Error (`Unknown named or imported node '${name}'.`);
52728
52662
  }
@@ -52732,28 +52666,19 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52732
52666
  * @param {SFNode|X3DNode|X3DImportedNode} node
52733
52667
  * @returns either an X3DImportedNode if possible or X3DNode
52734
52668
  */
52735
- getLocalizedNode (node)
52669
+ getNodeOrImportedNode (node)
52736
52670
  {
52737
- node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false)
52738
- ?? (node instanceof Execution_X3DImportedNode ? node : null);
52671
+ node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false);
52739
52672
 
52740
52673
  if (!node)
52741
52674
  throw new Error ("Couldn't get localized node: node must be of type X3DNode.");
52742
52675
 
52743
- if (node .getExecutionContext () === this)
52744
- {
52745
- if (node instanceof Core_X3DImportedNodeProxy)
52746
- return node .getImportedNode ();
52747
-
52748
- return node;
52749
- }
52750
-
52751
52676
  for (const importedNode of this [_importedNodes])
52752
52677
  {
52753
52678
  try
52754
52679
  {
52755
- if (importedNode .getSharedNode () === node)
52756
- return importedNode;
52680
+ if (importedNode .getExportedNode () === node)
52681
+ return importedNode .getInstance ();
52757
52682
  }
52758
52683
  catch
52759
52684
  { }
@@ -52794,7 +52719,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52794
52719
  if (this [_protos] .get (proto .getName ()) === proto)
52795
52720
  throw new Error (`Couldn't add proto declaration: proto '${proto .getName ()}' already added.`);
52796
52721
 
52797
- if (name .length === 0)
52722
+ if (!name)
52798
52723
  throw new Error ("Couldn't add proto declaration: proto name is empty.");
52799
52724
 
52800
52725
  if (this [_externprotos] .has (name))
@@ -52818,7 +52743,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52818
52743
  if (proto .getExecutionContext () !== this)
52819
52744
  throw new Error ("Couldn't update proto declaration: proto does not belong to this execution context.");
52820
52745
 
52821
- if (name .length === 0)
52746
+ if (!name)
52822
52747
  throw new Error ("Couldn't update proto declaration: proto name is empty.");
52823
52748
 
52824
52749
  if (this [_externprotos] .has (name))
@@ -52875,7 +52800,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52875
52800
  if (this [_externprotos] .get (externproto .getName ()) === externproto)
52876
52801
  throw new Error (`Couldn't add extern proto declaration: extern proto '${externproto .getName ()}' already added.`);
52877
52802
 
52878
- if (name .length === 0)
52803
+ if (!name)
52879
52804
  throw new Error ("Couldn't add extern proto declaration: extern proto name is empty.");
52880
52805
 
52881
52806
  if (this [_protos] .has (name))
@@ -52899,7 +52824,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52899
52824
  if (externproto .getExecutionContext () !== this)
52900
52825
  throw new Error ("Couldn't update extern proto declaration: extern proto does not belong to this execution context.");
52901
52826
 
52902
- if (name .length === 0)
52827
+ if (!name)
52903
52828
  throw new Error ("Couldn't update extern proto declaration: extern proto name is empty.");
52904
52829
 
52905
52830
  if (this [_protos] .has (name))
@@ -52933,13 +52858,9 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52933
52858
  {
52934
52859
  // Normalize arguments.
52935
52860
 
52936
- const
52937
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52938
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
52939
-
52940
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
52861
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false);
52941
52862
  sourceField = String (sourceField);
52942
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
52863
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false);
52943
52864
  destinationField = String (destinationField);
52944
52865
 
52945
52866
  // Check nodes.
@@ -52952,14 +52873,11 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52952
52873
 
52953
52874
  // Resolve imported source and destination node.
52954
52875
 
52955
- sourceNode = this .getLocalizedNode (sourceNode);
52956
- destinationNode = this .getLocalizedNode (destinationNode);
52876
+ sourceNode = this .getNodeOrImportedNode (sourceNode);
52877
+ destinationNode = this .getNodeOrImportedNode (destinationNode);
52957
52878
 
52958
52879
  // Add route.
52959
-
52960
- const
52961
- id = Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField),
52962
- route = this [_routes] .get (id);
52880
+ const route = this .getRoute (sourceNode, sourceField, destinationNode, destinationField);
52963
52881
 
52964
52882
  if (route)
52965
52883
  {
@@ -52969,7 +52887,7 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52969
52887
  {
52970
52888
  const route = new Routing_X3DRoute (this, sourceNode, sourceField, destinationNode, destinationField);
52971
52889
 
52972
- this [_routes] .add (id, route);
52890
+ this [_routes] .add (route .getId (), route);
52973
52891
 
52974
52892
  return route;
52975
52893
  }
@@ -52983,25 +52901,21 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
52983
52901
  if (!(route instanceof Routing_X3DRoute))
52984
52902
  return;
52985
52903
 
52986
- if (this [_routes] .get (route .getRouteId ()) !== route)
52904
+ if (!this .routes .has (route .getId ()))
52987
52905
  return;
52988
52906
 
52989
- this [_routes] .remove (route .getRouteId ());
52907
+ this [_routes] .remove (route .getId ());
52990
52908
 
52991
52909
  route .dispose ();
52992
52910
  },
52993
- getRoute (sourceNode, sourceField, destinationNode, destinationField)
52911
+ getRoute (sourceNode, sourceFieldName, destinationNode, destinationFieldName)
52994
52912
  {
52995
52913
  // Normalize arguments.
52996
52914
 
52997
- const
52998
- importedSourceNode = sourceNode instanceof Execution_X3DImportedNode ? sourceNode : null,
52999
- importedDestinationNode = destinationNode instanceof Execution_X3DImportedNode ? destinationNode : null;
53000
-
53001
- sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false) ?? importedSourceNode;
53002
- sourceField = String (sourceField);
53003
- destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false) ?? importedDestinationNode;
53004
- destinationField = String (destinationField);
52915
+ sourceNode = Base_X3DCast (Base_X3DConstants .X3DNode, sourceNode, false);
52916
+ sourceFieldName = String (sourceFieldName);
52917
+ destinationNode = Base_X3DCast (Base_X3DConstants .X3DNode, destinationNode, false);
52918
+ destinationFieldName = String (destinationFieldName);
53005
52919
 
53006
52920
  // Check nodes.
53007
52921
 
@@ -53013,12 +52927,69 @@ Object .assign (Object .setPrototypeOf (X3DExecutionContext .prototype, Base_X3D
53013
52927
 
53014
52928
  // Resolve imported source and destination node.
53015
52929
 
53016
- sourceNode = this .getLocalizedNode (sourceNode);
53017
- destinationNode = this .getLocalizedNode (destinationNode);
52930
+ sourceNode = this .getNodeOrImportedNode (sourceNode);
52931
+ destinationNode = this .getNodeOrImportedNode (destinationNode);
52932
+
52933
+ // Get fields if possible.
52934
+
52935
+ const sourceField = sourceNode instanceof Core_X3DImportedNodeInstance
52936
+ ? helper.try (() => sourceNode .getField (sourceFieldName))
52937
+ : sourceNode .getField (sourceFieldName);
52938
+
52939
+ const destinationField = destinationNode instanceof Core_X3DImportedNodeInstance
52940
+ ? helper.try (() => destinationNode .getField (destinationFieldName))
52941
+ : destinationNode .getField (destinationFieldName);
52942
+
52943
+ Routing_X3DRoute .checkFields (sourceField, destinationField);
53018
52944
 
53019
52945
  // Return route.
53020
52946
 
53021
- return this [_routes] .get (Routing_X3DRoute .getRouteId (sourceNode, sourceField, destinationNode, destinationField));
52947
+ return this [_routes] .find (route =>
52948
+ {
52949
+ if (route .getSourceNode () !== sourceNode)
52950
+ return false;
52951
+
52952
+ if (route .getDestinationNode () !== destinationNode)
52953
+ return false;
52954
+
52955
+ if (sourceField)
52956
+ {
52957
+ if (helper.try (() => sourceNode .getField (route .getSourceField ())) !== sourceField)
52958
+ return false;
52959
+ }
52960
+ else
52961
+ {
52962
+ if (sourceNode instanceof Core_X3DImportedNodeInstance)
52963
+ {
52964
+ if (route .getSourceField () !== sourceFieldName)
52965
+ return false;
52966
+ }
52967
+ else
52968
+ {
52969
+ return false;
52970
+ }
52971
+ }
52972
+
52973
+ if (destinationField)
52974
+ {
52975
+ if (helper.try (() => destinationNode .getField (route .getDestinationField ())) !== destinationField)
52976
+ return false;
52977
+ }
52978
+ else
52979
+ {
52980
+ if (destinationNode instanceof Core_X3DImportedNodeInstance)
52981
+ {
52982
+ if (route .getDestinationField () !== destinationFieldName)
52983
+ return false;
52984
+ }
52985
+ else
52986
+ {
52987
+ return false;
52988
+ }
52989
+ }
52990
+
52991
+ return true;
52992
+ });
53022
52993
  },
53023
52994
  getRoutes ()
53024
52995
  {
@@ -53584,6 +53555,12 @@ Object .assign (Object .setPrototypeOf (X3DExportedNode .prototype, Base_X3DObje
53584
53555
  generator .endObject ();
53585
53556
  generator .endObject ();
53586
53557
  },
53558
+ dispose ()
53559
+ {
53560
+ this [X3DExportedNode_executionContext] .removeExportedNode (this [X3DExportedNode_exportedName]);
53561
+
53562
+ Base_X3DObject .prototype .dispose .call (this);
53563
+ },
53587
53564
  });
53588
53565
 
53589
53566
  for (const key of Object .keys (X3DExportedNode .prototype))
@@ -53674,6 +53651,7 @@ const LATEST_VERSION_default_ = "4.1";
53674
53651
 
53675
53652
 
53676
53653
 
53654
+
53677
53655
  const
53678
53656
  _specificationVersion = Symbol (),
53679
53657
  _encoding = Symbol (),
@@ -53682,7 +53660,7 @@ const
53682
53660
  _worldURL = Symbol (),
53683
53661
  _units = Symbol (),
53684
53662
  _metadata = Symbol (),
53685
- X3DScene_exportedNodes = Symbol (),
53663
+ _exportedNodes = Symbol (),
53686
53664
  _loadingObjects = Symbol ();
53687
53665
 
53688
53666
  function X3DScene (browser)
@@ -53714,12 +53692,12 @@ function X3DScene (browser)
53714
53692
  this [_units] .add ("mass", new Configuration_UnitInfo ("mass", "kilogram", 1));
53715
53693
 
53716
53694
  this [_metadata] = [ ];
53717
- this [X3DScene_exportedNodes] = new Execution_ExportedNodesArray ();
53695
+ this [_exportedNodes] = new Execution_ExportedNodesArray ();
53718
53696
  this [_loadingObjects] = new Set ();
53719
53697
 
53720
53698
  this [_components] .addParent (this);
53721
53699
  this [_units] .addParent (this);
53722
- this [X3DScene_exportedNodes] .addParent (this);
53700
+ this [_exportedNodes] .addParent (this);
53723
53701
  }
53724
53702
 
53725
53703
  Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecutionContext .prototype),
@@ -53775,7 +53753,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53775
53753
  hasComponent (name, level = 0)
53776
53754
  {
53777
53755
  if (name instanceof Configuration_ComponentInfo)
53778
- var { name, level } = name;
53756
+ ({ name, level } = name);
53779
53757
 
53780
53758
  const
53781
53759
  browser = this .getBrowser (),
@@ -53946,7 +53924,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53946
53924
  {
53947
53925
  exportedName = String (exportedName);
53948
53926
 
53949
- if (this [X3DScene_exportedNodes] .has (exportedName))
53927
+ if (this [_exportedNodes] .has (exportedName))
53950
53928
  throw new Error (`Couldn't add exported node: exported name '${exportedName}' already in use.`);
53951
53929
 
53952
53930
  this .updateExportedNode (exportedName, node, description);
@@ -53959,18 +53937,21 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53959
53937
  node = Base_X3DCast (Base_X3DConstants .X3DNode, node, false);
53960
53938
  description = String (description);
53961
53939
 
53962
- if (exportedName .length === 0)
53963
- throw new Error ("Couldn't update exported node: node exported name is empty.");
53964
-
53965
53940
  if (!node)
53966
53941
  throw new Error ("Couldn't update exported node: node must be of type X3DNode.");
53967
53942
 
53968
- //if (node .getExecutionContext () !== this)
53969
- // throw new Error ("Couldn't update exported node: node does not belong to this execution context.");
53943
+ if (node instanceof Core_X3DImportedNodeInstance)
53944
+ throw new Error ("Couldn't update exported node: node cannot be of type X3DImportedNodeInstance.");
53945
+
53946
+ if (node .getExecutionContext () !== this)
53947
+ throw new Error ("Couldn't update exported node: node does not belong to this execution context.");
53948
+
53949
+ if (!exportedName)
53950
+ throw new Error ("Couldn't update exported node: node exported name is empty.");
53970
53951
 
53971
53952
  const exportedNode = new Execution_X3DExportedNode (this, exportedName, node, description);
53972
53953
 
53973
- this [X3DScene_exportedNodes] .update (exportedName, exportedName, exportedNode);
53954
+ this [_exportedNodes] .update (exportedName, exportedName, exportedNode);
53974
53955
 
53975
53956
  this ._sceneGraph_changed = Date .now () / 1000;
53976
53957
  },
@@ -53978,7 +53959,14 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53978
53959
  {
53979
53960
  exportedName = String (exportedName);
53980
53961
 
53981
- this [X3DScene_exportedNodes] .remove (exportedName);
53962
+ const exportedNode = this [_exportedNodes] .get (exportedName);
53963
+
53964
+ if (!exportedNode)
53965
+ return;
53966
+
53967
+ this [_exportedNodes] .remove (exportedName);
53968
+
53969
+ exportedNode .dispose ();
53982
53970
 
53983
53971
  this ._sceneGraph_changed = Date .now () / 1000;
53984
53972
  },
@@ -53986,7 +53974,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53986
53974
  {
53987
53975
  exportedName = String (exportedName);
53988
53976
 
53989
- const exportedNode = this [X3DScene_exportedNodes] .get (exportedName);
53977
+ const exportedNode = this [_exportedNodes] .get (exportedName);
53990
53978
 
53991
53979
  if (exportedNode)
53992
53980
  return exportedNode .localNode;
@@ -53995,11 +53983,11 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
53995
53983
  },
53996
53984
  getExportedNodes ()
53997
53985
  {
53998
- return this [X3DScene_exportedNodes];
53986
+ return this [_exportedNodes];
53999
53987
  },
54000
53988
  getUniqueExportName (name)
54001
53989
  {
54002
- return getUniqueName (this [X3DScene_exportedNodes], name);
53990
+ return getUniqueName (this [_exportedNodes], name);
54003
53991
  },
54004
53992
  addRootNode (node)
54005
53993
  {
@@ -54275,7 +54263,7 @@ Object .assign (Object .setPrototypeOf (X3DScene .prototype, Execution_X3DExecut
54275
54263
 
54276
54264
  generator .endArray ();
54277
54265
 
54278
- headLastProperty = true;
54266
+ // headLastProperty = true;
54279
54267
  }
54280
54268
 
54281
54269
  // Head end
@@ -54604,6 +54592,7 @@ Fonts_add ("PT_Sans/PTSans-Italic.woff2", false, true);
54604
54592
 
54605
54593
 
54606
54594
 
54595
+
54607
54596
  const
54608
54597
  _instanceId = Symbol (),
54609
54598
  _element = Symbol (),
@@ -54667,7 +54656,9 @@ function X3DCoreContext (element)
54667
54656
  {
54668
54657
  const link = document .createElement ("link");
54669
54658
 
54670
- link .integrity = "sha384-r+Z33c1QviLoOgodJzYHRhRIxsvRFnZVj3GbeoohZ//iR51ZK8cK/Jq4mcMi8WV6";
54659
+ if (!DEVELOPMENT)
54660
+ link .integrity = "sha384-PV+KMMYFFsD4yJSRNZxR5SQtB1+/svusY5D4rmCUw1HodNYMj3Nx2fKast5z9E0g";
54661
+
54671
54662
  link .rel = "stylesheet";
54672
54663
  link .crossOrigin = "anonymous";
54673
54664
  link .onload = resolve;
@@ -65662,6 +65653,7 @@ const
65662
65653
  _defaultFramebuffer = Symbol (),
65663
65654
  _textureBuffers = Symbol (),
65664
65655
  _resizer = Symbol (),
65656
+ _traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
65665
65657
  _localObjects = Symbol (),
65666
65658
  _fullscreenArray = Symbol (),
65667
65659
  _fullscreenBuffer = Symbol (),
@@ -65706,12 +65698,7 @@ Object .assign (X3DRenderingContext .prototype,
65706
65698
 
65707
65699
  helper.on (this, window, "orientationchange", () => this .reshape ());
65708
65700
 
65709
- this [_resizer] = new ResizeObserver (() =>
65710
- {
65711
- this .reshape ();
65712
-
65713
- this [Symbol .for ("X_ITE.X3DBrowserContext.traverse")] (performance .now ());
65714
- });
65701
+ this [_resizer] = new ResizeObserver (() => this .reshape ());
65715
65702
 
65716
65703
  this [_resizer] .observe (this .getSurface ());
65717
65704
 
@@ -65988,6 +65975,9 @@ Object .assign (X3DRenderingContext .prototype,
65988
65975
 
65989
65976
  this .reshapeFramebuffer (0, 0, 0, width, height);
65990
65977
 
65978
+ if (this .getWorld ())
65979
+ this [_traverse] (-1);
65980
+
65991
65981
  this .addBrowserEvent ();
65992
65982
  },
65993
65983
  limitFramebufferSize (width, height)
@@ -72681,14 +72671,14 @@ Object .assign (X3DTimeContext .prototype,
72681
72671
  {
72682
72672
  const lastPosition = new Numbers_Vector3 ();
72683
72673
 
72684
- return function ()
72674
+ return function (checkFrameRate)
72685
72675
  {
72686
72676
  const
72687
72677
  time = Date .now () / 1000,
72688
72678
  interval = time - this [_lastTime],
72689
72679
  viewpointNode = this .getActiveViewpoint ();
72690
72680
 
72691
- if (interval <= 1 / Math .max (this .getBrowserOption ("MaximumFrameRate"), 1))
72681
+ if (checkFrameRate && interval <= 1 / Math .max (this .getBrowserOption ("MaximumFrameRate"), 1))
72692
72682
  return false;
72693
72683
 
72694
72684
  this [_lastTime] = time;
@@ -72930,7 +72920,7 @@ const ConcreteNodes_default_ = new Configuration_ConcreteNodesArray ();
72930
72920
  const
72931
72921
  _world = Symbol (),
72932
72922
  X3DBrowserContext_tainted = Symbol (),
72933
- _traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
72923
+ X3DBrowserContext_traverse = Symbol .for ("X_ITE.X3DBrowserContext.traverse"),
72934
72924
  _renderCallback = Symbol (),
72935
72925
  _animFrame = Symbol (),
72936
72926
  _previousTime = Symbol (),
@@ -72986,7 +72976,7 @@ function X3DBrowserContext (element)
72986
72976
 
72987
72977
  this [X3DBrowserContext_tainted] = false;
72988
72978
  this [_previousTime] = 0;
72989
- this [_renderCallback] = this [_traverse] .bind (this);
72979
+ this [_renderCallback] = this [X3DBrowserContext_traverse] .bind (this);
72990
72980
  this [_systemTime] = new Time_StopWatch ();
72991
72981
  this [_browserTime] = new Time_StopWatch ();
72992
72982
  this [_cameraTime] = new Time_StopWatch ();
@@ -73097,13 +73087,15 @@ Object .assign (Object .setPrototypeOf (X3DBrowserContext .prototype, Base_X3DBa
73097
73087
  this .addBrowserEvent ();
73098
73088
  });
73099
73089
  },
73100
- [_traverse] (now, frame)
73090
+ [X3DBrowserContext_traverse] (now, frame)
73101
73091
  {
73102
73092
  // Limit frame rate.
73103
73093
 
73104
73094
  this [X3DBrowserContext_tainted] = false;
73105
73095
 
73106
- if (!this .advanceTime ())
73096
+ // If now is negative, don't check framerate.
73097
+ // Now can be negative when reshape is called.
73098
+ if (!this .advanceTime (now >= 0))
73107
73099
  {
73108
73100
  this .addBrowserEvent ();
73109
73101
  return;
@@ -74871,7 +74863,7 @@ const CoreComponent_default_ = {
74871
74863
  [
74872
74864
  Core_X3DBindableNode,
74873
74865
  Core_X3DChildNode,
74874
- Core_X3DImportedNodeProxy,
74866
+ Core_X3DImportedNodeInstance,
74875
74867
  Core_X3DInfoNode,
74876
74868
  Core_X3DMetadataObject,
74877
74869
  Core_X3DNode,
@@ -91540,8 +91532,8 @@ const PNGMedia_default_ = PNGMedia;
91540
91532
 
91541
91533
  /* harmony default export */ const Texturing_PNGMedia = (x_ite_Namespace .add ("PNGMedia", PNGMedia_default_));
91542
91534
  ;// ./src/x_ite/Components/Texturing/MovieTexture.js
91543
- /* provided dependency */ var SuperGif = __webpack_require__(802);
91544
- /* provided dependency */ var APNG = __webpack_require__(528);
91535
+ /* provided dependency */ var SuperGif = __webpack_require__(829);
91536
+ /* provided dependency */ var APNG = __webpack_require__(247);
91545
91537
 
91546
91538
 
91547
91539
 
@@ -91614,7 +91606,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
91614
91606
 
91615
91607
  try
91616
91608
  {
91617
- if (fileURL .pathname .endsWith (".gif") || fileURL .href .match (/^\s*data:image\/gif[;,]/s))
91609
+ if (fileURL .pathname .endsWith (".gif") || fileURL .href .match (/^\s*data:image\/gif[;,]/))
91618
91610
  {
91619
91611
  const
91620
91612
  data = await this .loadDocument (fileURL),
@@ -91633,7 +91625,7 @@ Object .assign (Object .setPrototypeOf (MovieTexture .prototype, Texturing_X3DTe
91633
91625
  this .setGif (gif);
91634
91626
  return;
91635
91627
  }
91636
- else if (fileURL .pathname .endsWith (".png") || fileURL .href .match (/^\s*data:image\/png[;,]/s))
91628
+ else if (fileURL .pathname .endsWith (".png") || fileURL .href .match (/^\s*data:image\/png[;,]/))
91637
91629
  {
91638
91630
  const
91639
91631
  data = await this .loadDocument (fileURL),
@@ -92892,7 +92884,7 @@ const Components_default_ = Components;
92892
92884
 
92893
92885
  /* eslint no-undef: "off"
92894
92886
  --------
92895
- no-undef: global variable is used here for use in node projects.
92887
+ no-undef: node `global` variable is used here for use in node projects.
92896
92888
  */
92897
92889
 
92898
92890
  const
@@ -94185,7 +94177,7 @@ const QuickSort_default_ = QuickSort;
94185
94177
 
94186
94178
  /* harmony default export */ const Algorithms_QuickSort = (x_ite_Namespace .add ("QuickSort", QuickSort_default_));
94187
94179
  ;// ./src/lib/libtess.js
94188
- /* provided dependency */ var libtess_libtess = __webpack_require__(628);
94180
+ /* provided dependency */ var libtess_libtess = __webpack_require__(67);
94189
94181
  const libtess_default_ = libtess_libtess;
94190
94182
  ;
94191
94183