{
  "version": 3,
  "sources": ["../../../node_modules/lodash/_listCacheClear.js", "../../../node_modules/lodash/eq.js", "../../../node_modules/lodash/_assocIndexOf.js", "../../../node_modules/lodash/_listCacheDelete.js", "../../../node_modules/lodash/_listCacheGet.js", "../../../node_modules/lodash/_listCacheHas.js", "../../../node_modules/lodash/_listCacheSet.js", "../../../node_modules/lodash/_ListCache.js", "../../../node_modules/lodash/_stackClear.js", "../../../node_modules/lodash/_stackDelete.js", "../../../node_modules/lodash/_stackGet.js", "../../../node_modules/lodash/_stackHas.js", "../../../node_modules/lodash/_freeGlobal.js", "../../../node_modules/lodash/_root.js", "../../../node_modules/lodash/_Symbol.js", "../../../node_modules/lodash/_getRawTag.js", "../../../node_modules/lodash/_objectToString.js", "../../../node_modules/lodash/_baseGetTag.js", "../../../node_modules/lodash/isObject.js", "../../../node_modules/lodash/isFunction.js", "../../../node_modules/lodash/_coreJsData.js", "../../../node_modules/lodash/_isMasked.js", "../../../node_modules/lodash/_toSource.js", "../../../node_modules/lodash/_baseIsNative.js", "../../../node_modules/lodash/_getValue.js", "../../../node_modules/lodash/_getNative.js", "../../../node_modules/lodash/_Map.js", "../../../node_modules/lodash/_nativeCreate.js", "../../../node_modules/lodash/_hashClear.js", "../../../node_modules/lodash/_hashDelete.js", "../../../node_modules/lodash/_hashGet.js", "../../../node_modules/lodash/_hashHas.js", "../../../node_modules/lodash/_hashSet.js", "../../../node_modules/lodash/_Hash.js", "../../../node_modules/lodash/_mapCacheClear.js", "../../../node_modules/lodash/_isKeyable.js", "../../../node_modules/lodash/_getMapData.js", "../../../node_modules/lodash/_mapCacheDelete.js", "../../../node_modules/lodash/_mapCacheGet.js", "../../../node_modules/lodash/_mapCacheHas.js", "../../../node_modules/lodash/_mapCacheSet.js", "../../../node_modules/lodash/_MapCache.js", "../../../node_modules/lodash/_stackSet.js", "../../../node_modules/lodash/_Stack.js", "../../../node_modules/lodash/_setCacheAdd.js", "../../../node_modules/lodash/_setCacheHas.js", "../../../node_modules/lodash/_SetCache.js", "../../../node_modules/lodash/_arraySome.js", "../../../node_modules/lodash/_cacheHas.js", "../../../node_modules/lodash/_equalArrays.js", "../../../node_modules/lodash/_Uint8Array.js", "../../../node_modules/lodash/_mapToArray.js", "../../../node_modules/lodash/_setToArray.js", "../../../node_modules/lodash/_equalByTag.js", "../../../node_modules/lodash/_arrayPush.js", "../../../node_modules/lodash/isArray.js", "../../../node_modules/lodash/_baseGetAllKeys.js", "../../../node_modules/lodash/_arrayFilter.js", "../../../node_modules/lodash/stubArray.js", "../../../node_modules/lodash/_getSymbols.js", "../../../node_modules/lodash/_baseTimes.js", "../../../node_modules/lodash/isObjectLike.js", "../../../node_modules/lodash/_baseIsArguments.js", "../../../node_modules/lodash/isArguments.js", "../../../node_modules/lodash/stubFalse.js", "../../../node_modules/lodash/isBuffer.js", "../../../node_modules/lodash/_isIndex.js", "../../../node_modules/lodash/isLength.js", "../../../node_modules/lodash/_baseIsTypedArray.js", "../../../node_modules/lodash/_baseUnary.js", "../../../node_modules/lodash/_nodeUtil.js", "../../../node_modules/lodash/isTypedArray.js", "../../../node_modules/lodash/_arrayLikeKeys.js", "../../../node_modules/lodash/_isPrototype.js", "../../../node_modules/lodash/_overArg.js", "../../../node_modules/lodash/_nativeKeys.js", "../../../node_modules/lodash/_baseKeys.js", "../../../node_modules/lodash/isArrayLike.js", "../../../node_modules/lodash/keys.js", "../../../node_modules/lodash/_getAllKeys.js", "../../../node_modules/lodash/_equalObjects.js", "../../../node_modules/lodash/_DataView.js", "../../../node_modules/lodash/_Promise.js", "../../../node_modules/lodash/_Set.js", "../../../node_modules/lodash/_WeakMap.js", "../../../node_modules/lodash/_getTag.js", "../../../node_modules/lodash/_baseIsEqualDeep.js", "../../../node_modules/lodash/_baseIsEqual.js", "../../../node_modules/lodash/isEqual.js", "../../../node_modules/lodash/_arrayEach.js", "../../../node_modules/lodash/_defineProperty.js", "../../../node_modules/lodash/_baseAssignValue.js", "../../../node_modules/lodash/_assignValue.js", "../../../node_modules/lodash/_copyObject.js", "../../../node_modules/lodash/_baseAssign.js", "../../../node_modules/lodash/_nativeKeysIn.js", "../../../node_modules/lodash/_baseKeysIn.js", "../../../node_modules/lodash/keysIn.js", "../../../node_modules/lodash/_baseAssignIn.js", "../../../node_modules/lodash/_cloneBuffer.js", "../../../node_modules/lodash/_copyArray.js", "../../../node_modules/lodash/_copySymbols.js", "../../../node_modules/lodash/_getPrototype.js", "../../../node_modules/lodash/_getSymbolsIn.js", "../../../node_modules/lodash/_copySymbolsIn.js", "../../../node_modules/lodash/_getAllKeysIn.js", "../../../node_modules/lodash/_initCloneArray.js", "../../../node_modules/lodash/_cloneArrayBuffer.js", "../../../node_modules/lodash/_cloneDataView.js", "../../../node_modules/lodash/_cloneRegExp.js", "../../../node_modules/lodash/_cloneSymbol.js", "../../../node_modules/lodash/_cloneTypedArray.js", "../../../node_modules/lodash/_initCloneByTag.js", "../../../node_modules/lodash/_baseCreate.js", "../../../node_modules/lodash/_initCloneObject.js", "../../../node_modules/lodash/_baseIsMap.js", "../../../node_modules/lodash/isMap.js", "../../../node_modules/lodash/_baseIsSet.js", "../../../node_modules/lodash/isSet.js", "../../../node_modules/lodash/_baseClone.js", "../../../node_modules/lodash/cloneDeep.js", "../../livelink.base/sources/EditionEvent.ts", "../../../node_modules/@3dverse/livelink.core/sources/DynamicLoader.ts", "../../../node_modules/@3dverse/livelink.core/sources/library.ts", "../../livelink.base/sources/config/api.ts", "../../livelink.base/sources/rates.ts", "../../livelink.base/sources/LivelinkBase.ts", "../../livelink.base/sources/TypedEventTarget.ts", "../../livelink.base/sources/session/Client.ts", "../../livelink.base/sources/session/SessionEvents.ts", "../../livelink.base/sources/session/Session.ts", "../../livelink.base/_prebuild/EntityComponents.ts", "../../livelink.base/sources/scene/EntityEvents.ts", "../../livelink.base/sources/scene/ScriptEvents.ts", "../../livelink.base/sources/maths/quaternion.ts", "../../livelink.base/sources/maths/index.ts", "../../livelink.base/sources/scene/Entity.ts", "../../livelink.base/sources/scene/Filters.ts", "../../livelink.base/sources/scene/EntityRegistry.ts", "../../livelink.base/sources/scene/SceneEvents.ts", "../../livelink.base/sources/scene/PromiseWithResolver.ts", "../../livelink.base/sources/scene/SceneSettings.ts", "../../livelink.base/sources/scene/Scene.ts", "../sources/inactivity.ts", "../sources/nodeSocketGuard.ts", "../sources/Livelink.ts", "../sources/AgentEvents.ts", "../sources/Agent.ts", "../sources/data/util/channel.ts", "../sources/data/transports/PlaybackTransport.ts", "../sources/data/transports/MqttTransport.ts", "../sources/data/transports/AzureEventHubTransport.ts", "../sources/data/transports/OpcUaClientModule.ts", "../sources/data/transports/OpcUaTransport.ts", "../sources/data/transports/TransportRegistry.ts", "../sources/data/EventMapping.ts", "../sources/data/util/reporting.ts", "../sources/data/resolvers/EntityResolver.ts", "../sources/data/resolvers/ExistingEntityResolver.ts", "../sources/data/resolvers/SpawningEntityResolver.ts", "../sources/data/apply/ComponentPatchApplier.ts", "../sources/data/SchemaValidator.ts", "../sources/data/IngestionStats.ts", "../sources/data/IngestionPipeline.ts", "../sources/ObservedEventTarget.ts", "../sources/data/SceneIngestionEvents.ts", "../sources/data/SceneIngestion.ts"],
  "sourcesContent": ["/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n  this.__data__ = [];\n  this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n", "/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n  return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n", "var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n  var length = array.length;\n  while (length--) {\n    if (eq(array[length][0], key)) {\n      return length;\n    }\n  }\n  return -1;\n}\n\nmodule.exports = assocIndexOf;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    return false;\n  }\n  var lastIndex = data.length - 1;\n  if (index == lastIndex) {\n    data.pop();\n  } else {\n    splice.call(data, index, 1);\n  }\n  --this.size;\n  return true;\n}\n\nmodule.exports = listCacheDelete;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n  return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n", "var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n  var data = this.__data__,\n      index = assocIndexOf(data, key);\n\n  if (index < 0) {\n    ++this.size;\n    data.push([key, value]);\n  } else {\n    data[index][1] = value;\n  }\n  return this;\n}\n\nmodule.exports = listCacheSet;\n", "var listCacheClear = require('./_listCacheClear'),\n    listCacheDelete = require('./_listCacheDelete'),\n    listCacheGet = require('./_listCacheGet'),\n    listCacheHas = require('./_listCacheHas'),\n    listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n", "var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n  this.__data__ = new ListCache;\n  this.size = 0;\n}\n\nmodule.exports = stackClear;\n", "/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n  var data = this.__data__,\n      result = data['delete'](key);\n\n  this.size = data.size;\n  return result;\n}\n\nmodule.exports = stackDelete;\n", "/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n  return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n", "/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n  return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n", "/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n  var isOwn = hasOwnProperty.call(value, symToStringTag),\n      tag = value[symToStringTag];\n\n  try {\n    value[symToStringTag] = undefined;\n    var unmasked = true;\n  } catch (e) {}\n\n  var result = nativeObjectToString.call(value);\n  if (unmasked) {\n    if (isOwn) {\n      value[symToStringTag] = tag;\n    } else {\n      delete value[symToStringTag];\n    }\n  }\n  return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n  return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n    getRawTag = require('./_getRawTag'),\n    objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n    undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n  if (value == null) {\n    return value === undefined ? undefinedTag : nullTag;\n  }\n  return (symToStringTag && symToStringTag in Object(value))\n    ? getRawTag(value)\n    : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n  var type = typeof value;\n  return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n", "var baseGetTag = require('./_baseGetTag'),\n    isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n  if (!isObject(value)) {\n    return false;\n  }\n  // The use of `Object#toString` avoids issues with the `typeof` operator\n  // in Safari 9 which returns 'object' for typed arrays and other constructors.\n  var tag = baseGetTag(value);\n  return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n", "var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n", "var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n  var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n  return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n  return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n", "/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n  if (func != null) {\n    try {\n      return funcToString.call(func);\n    } catch (e) {}\n    try {\n      return (func + '');\n    } catch (e) {}\n  }\n  return '';\n}\n\nmodule.exports = toSource;\n", "var isFunction = require('./isFunction'),\n    isMasked = require('./_isMasked'),\n    isObject = require('./isObject'),\n    toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n    objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n  funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n  .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n *  else `false`.\n */\nfunction baseIsNative(value) {\n  if (!isObject(value) || isMasked(value)) {\n    return false;\n  }\n  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n  return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n", "/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n  return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n", "var baseIsNative = require('./_baseIsNative'),\n    getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n  var value = getValue(object, key);\n  return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n", "var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n", "var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n", "var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n  this.__data__ = nativeCreate ? nativeCreate(null) : {};\n  this.size = 0;\n}\n\nmodule.exports = hashClear;\n", "/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n  var result = this.has(key) && delete this.__data__[key];\n  this.size -= result ? 1 : 0;\n  return result;\n}\n\nmodule.exports = hashDelete;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n  var data = this.__data__;\n  if (nativeCreate) {\n    var result = data[key];\n    return result === HASH_UNDEFINED ? undefined : result;\n  }\n  return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n  var data = this.__data__;\n  return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n", "var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n  var data = this.__data__;\n  this.size += this.has(key) ? 0 : 1;\n  data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n  return this;\n}\n\nmodule.exports = hashSet;\n", "var hashClear = require('./_hashClear'),\n    hashDelete = require('./_hashDelete'),\n    hashGet = require('./_hashGet'),\n    hashHas = require('./_hashHas'),\n    hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n", "var Hash = require('./_Hash'),\n    ListCache = require('./_ListCache'),\n    Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n  this.size = 0;\n  this.__data__ = {\n    'hash': new Hash,\n    'map': new (Map || ListCache),\n    'string': new Hash\n  };\n}\n\nmodule.exports = mapCacheClear;\n", "/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n  var type = typeof value;\n  return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n    ? (value !== '__proto__')\n    : (value === null);\n}\n\nmodule.exports = isKeyable;\n", "var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n  var data = map.__data__;\n  return isKeyable(key)\n    ? data[typeof key == 'string' ? 'string' : 'hash']\n    : data.map;\n}\n\nmodule.exports = getMapData;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n  var result = getMapData(this, key)['delete'](key);\n  this.size -= result ? 1 : 0;\n  return result;\n}\n\nmodule.exports = mapCacheDelete;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n  return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n  return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n", "var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n  var data = getMapData(this, key),\n      size = data.size;\n\n  data.set(key, value);\n  this.size += data.size == size ? 0 : 1;\n  return this;\n}\n\nmodule.exports = mapCacheSet;\n", "var mapCacheClear = require('./_mapCacheClear'),\n    mapCacheDelete = require('./_mapCacheDelete'),\n    mapCacheGet = require('./_mapCacheGet'),\n    mapCacheHas = require('./_mapCacheHas'),\n    mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n  var index = -1,\n      length = entries == null ? 0 : entries.length;\n\n  this.clear();\n  while (++index < length) {\n    var entry = entries[index];\n    this.set(entry[0], entry[1]);\n  }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n", "var ListCache = require('./_ListCache'),\n    Map = require('./_Map'),\n    MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n  var data = this.__data__;\n  if (data instanceof ListCache) {\n    var pairs = data.__data__;\n    if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n      pairs.push([key, value]);\n      this.size = ++data.size;\n      return this;\n    }\n    data = this.__data__ = new MapCache(pairs);\n  }\n  data.set(key, value);\n  this.size = data.size;\n  return this;\n}\n\nmodule.exports = stackSet;\n", "var ListCache = require('./_ListCache'),\n    stackClear = require('./_stackClear'),\n    stackDelete = require('./_stackDelete'),\n    stackGet = require('./_stackGet'),\n    stackHas = require('./_stackHas'),\n    stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n  var data = this.__data__ = new ListCache(entries);\n  this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n", "/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n  this.__data__.set(value, HASH_UNDEFINED);\n  return this;\n}\n\nmodule.exports = setCacheAdd;\n", "/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n  return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n", "var MapCache = require('./_MapCache'),\n    setCacheAdd = require('./_setCacheAdd'),\n    setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n  var index = -1,\n      length = values == null ? 0 : values.length;\n\n  this.__data__ = new MapCache;\n  while (++index < length) {\n    this.add(values[index]);\n  }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n", "/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n *  else `false`.\n */\nfunction arraySome(array, predicate) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (predicate(array[index], index, array)) {\n      return true;\n    }\n  }\n  return false;\n}\n\nmodule.exports = arraySome;\n", "/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n  return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n", "var SetCache = require('./_SetCache'),\n    arraySome = require('./_arraySome'),\n    cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n      arrLength = array.length,\n      othLength = other.length;\n\n  if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n    return false;\n  }\n  // Check that cyclic values are equal.\n  var arrStacked = stack.get(array);\n  var othStacked = stack.get(other);\n  if (arrStacked && othStacked) {\n    return arrStacked == other && othStacked == array;\n  }\n  var index = -1,\n      result = true,\n      seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n  stack.set(array, other);\n  stack.set(other, array);\n\n  // Ignore non-index properties.\n  while (++index < arrLength) {\n    var arrValue = array[index],\n        othValue = other[index];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, arrValue, index, other, array, stack)\n        : customizer(arrValue, othValue, index, array, other, stack);\n    }\n    if (compared !== undefined) {\n      if (compared) {\n        continue;\n      }\n      result = false;\n      break;\n    }\n    // Recursively compare arrays (susceptible to call stack limits).\n    if (seen) {\n      if (!arraySome(other, function(othValue, othIndex) {\n            if (!cacheHas(seen, othIndex) &&\n                (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n              return seen.push(othIndex);\n            }\n          })) {\n        result = false;\n        break;\n      }\n    } else if (!(\n          arrValue === othValue ||\n            equalFunc(arrValue, othValue, bitmask, customizer, stack)\n        )) {\n      result = false;\n      break;\n    }\n  }\n  stack['delete'](array);\n  stack['delete'](other);\n  return result;\n}\n\nmodule.exports = equalArrays;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n", "/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n  var index = -1,\n      result = Array(map.size);\n\n  map.forEach(function(value, key) {\n    result[++index] = [key, value];\n  });\n  return result;\n}\n\nmodule.exports = mapToArray;\n", "/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n  var index = -1,\n      result = Array(set.size);\n\n  set.forEach(function(value) {\n    result[++index] = value;\n  });\n  return result;\n}\n\nmodule.exports = setToArray;\n", "var Symbol = require('./_Symbol'),\n    Uint8Array = require('./_Uint8Array'),\n    eq = require('./eq'),\n    equalArrays = require('./_equalArrays'),\n    mapToArray = require('./_mapToArray'),\n    setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n    COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n  switch (tag) {\n    case dataViewTag:\n      if ((object.byteLength != other.byteLength) ||\n          (object.byteOffset != other.byteOffset)) {\n        return false;\n      }\n      object = object.buffer;\n      other = other.buffer;\n\n    case arrayBufferTag:\n      if ((object.byteLength != other.byteLength) ||\n          !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n        return false;\n      }\n      return true;\n\n    case boolTag:\n    case dateTag:\n    case numberTag:\n      // Coerce booleans to `1` or `0` and dates to milliseconds.\n      // Invalid dates are coerced to `NaN`.\n      return eq(+object, +other);\n\n    case errorTag:\n      return object.name == other.name && object.message == other.message;\n\n    case regexpTag:\n    case stringTag:\n      // Coerce regexes to strings and treat strings, primitives and objects,\n      // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n      // for more details.\n      return object == (other + '');\n\n    case mapTag:\n      var convert = mapToArray;\n\n    case setTag:\n      var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n      convert || (convert = setToArray);\n\n      if (object.size != other.size && !isPartial) {\n        return false;\n      }\n      // Assume cyclic values are equal.\n      var stacked = stack.get(object);\n      if (stacked) {\n        return stacked == other;\n      }\n      bitmask |= COMPARE_UNORDERED_FLAG;\n\n      // Recursively compare objects (susceptible to call stack limits).\n      stack.set(object, other);\n      var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n      stack['delete'](object);\n      return result;\n\n    case symbolTag:\n      if (symbolValueOf) {\n        return symbolValueOf.call(object) == symbolValueOf.call(other);\n      }\n  }\n  return false;\n}\n\nmodule.exports = equalByTag;\n", "/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n  var index = -1,\n      length = values.length,\n      offset = array.length;\n\n  while (++index < length) {\n    array[offset + index] = values[index];\n  }\n  return array;\n}\n\nmodule.exports = arrayPush;\n", "/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n", "var arrayPush = require('./_arrayPush'),\n    isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n  var result = keysFunc(object);\n  return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n", "/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n  var index = -1,\n      length = array == null ? 0 : array.length,\n      resIndex = 0,\n      result = [];\n\n  while (++index < length) {\n    var value = array[index];\n    if (predicate(value, index, array)) {\n      result[resIndex++] = value;\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayFilter;\n", "/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n  return [];\n}\n\nmodule.exports = stubArray;\n", "var arrayFilter = require('./_arrayFilter'),\n    stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n  if (object == null) {\n    return [];\n  }\n  object = Object(object);\n  return arrayFilter(nativeGetSymbols(object), function(symbol) {\n    return propertyIsEnumerable.call(object, symbol);\n  });\n};\n\nmodule.exports = getSymbols;\n", "/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n  var index = -1,\n      result = Array(n);\n\n  while (++index < n) {\n    result[index] = iteratee(index);\n  }\n  return result;\n}\n\nmodule.exports = baseTimes;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n  return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n  return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n", "var baseIsArguments = require('./_baseIsArguments'),\n    isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n *  else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n  return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n    !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n", "/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n  return false;\n}\n\nmodule.exports = stubFalse;\n", "var root = require('./_root'),\n    stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n  var type = typeof value;\n  length = length == null ? MAX_SAFE_INTEGER : length;\n\n  return !!length &&\n    (type == 'number' ||\n      (type != 'symbol' && reIsUint.test(value))) &&\n        (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n", "/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n  return typeof value == 'number' &&\n    value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n", "var baseGetTag = require('./_baseGetTag'),\n    isLength = require('./isLength'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n  return isObjectLike(value) &&\n    isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n", "/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n  return function(value) {\n    return func(value);\n  };\n}\n\nmodule.exports = baseUnary;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n  try {\n    // Use `util.types` for Node.js 10+.\n    var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n    if (types) {\n      return types;\n    }\n\n    // Legacy `process.binding('util')` for Node.js < 10.\n    return freeProcess && freeProcess.binding && freeProcess.binding('util');\n  } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n", "var baseIsTypedArray = require('./_baseIsTypedArray'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n", "var baseTimes = require('./_baseTimes'),\n    isArguments = require('./isArguments'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isIndex = require('./_isIndex'),\n    isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n  var isArr = isArray(value),\n      isArg = !isArr && isArguments(value),\n      isBuff = !isArr && !isArg && isBuffer(value),\n      isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n      skipIndexes = isArr || isArg || isBuff || isType,\n      result = skipIndexes ? baseTimes(value.length, String) : [],\n      length = result.length;\n\n  for (var key in value) {\n    if ((inherited || hasOwnProperty.call(value, key)) &&\n        !(skipIndexes && (\n           // Safari 9 has enumerable `arguments.length` in strict mode.\n           key == 'length' ||\n           // Node.js 0.10 has enumerable non-index properties on buffers.\n           (isBuff && (key == 'offset' || key == 'parent')) ||\n           // PhantomJS 2 has enumerable non-index properties on typed arrays.\n           (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n           // Skip index properties.\n           isIndex(key, length)\n        ))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = arrayLikeKeys;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n  var Ctor = value && value.constructor,\n      proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n  return value === proto;\n}\n\nmodule.exports = isPrototype;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n  return function(arg) {\n    return func(transform(arg));\n  };\n}\n\nmodule.exports = overArg;\n", "var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n", "var isPrototype = require('./_isPrototype'),\n    nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n  if (!isPrototype(object)) {\n    return nativeKeys(object);\n  }\n  var result = [];\n  for (var key in Object(object)) {\n    if (hasOwnProperty.call(object, key) && key != 'constructor') {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeys;\n", "var isFunction = require('./isFunction'),\n    isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n  return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n", "var arrayLikeKeys = require('./_arrayLikeKeys'),\n    baseKeys = require('./_baseKeys'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n", "var baseGetAllKeys = require('./_baseGetAllKeys'),\n    getSymbols = require('./_getSymbols'),\n    keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n  return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n", "var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n  var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n      objProps = getAllKeys(object),\n      objLength = objProps.length,\n      othProps = getAllKeys(other),\n      othLength = othProps.length;\n\n  if (objLength != othLength && !isPartial) {\n    return false;\n  }\n  var index = objLength;\n  while (index--) {\n    var key = objProps[index];\n    if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n      return false;\n    }\n  }\n  // Check that cyclic values are equal.\n  var objStacked = stack.get(object);\n  var othStacked = stack.get(other);\n  if (objStacked && othStacked) {\n    return objStacked == other && othStacked == object;\n  }\n  var result = true;\n  stack.set(object, other);\n  stack.set(other, object);\n\n  var skipCtor = isPartial;\n  while (++index < objLength) {\n    key = objProps[index];\n    var objValue = object[key],\n        othValue = other[key];\n\n    if (customizer) {\n      var compared = isPartial\n        ? customizer(othValue, objValue, key, other, object, stack)\n        : customizer(objValue, othValue, key, object, other, stack);\n    }\n    // Recursively compare objects (susceptible to call stack limits).\n    if (!(compared === undefined\n          ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n          : compared\n        )) {\n      result = false;\n      break;\n    }\n    skipCtor || (skipCtor = key == 'constructor');\n  }\n  if (result && !skipCtor) {\n    var objCtor = object.constructor,\n        othCtor = other.constructor;\n\n    // Non `Object` object instances with different constructors are not equal.\n    if (objCtor != othCtor &&\n        ('constructor' in object && 'constructor' in other) &&\n        !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n          typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n      result = false;\n    }\n  }\n  stack['delete'](object);\n  stack['delete'](other);\n  return result;\n}\n\nmodule.exports = equalObjects;\n", "var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n", "var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n", "var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n", "var getNative = require('./_getNative'),\n    root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n", "var DataView = require('./_DataView'),\n    Map = require('./_Map'),\n    Promise = require('./_Promise'),\n    Set = require('./_Set'),\n    WeakMap = require('./_WeakMap'),\n    baseGetTag = require('./_baseGetTag'),\n    toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n    objectTag = '[object Object]',\n    promiseTag = '[object Promise]',\n    setTag = '[object Set]',\n    weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n    mapCtorString = toSource(Map),\n    promiseCtorString = toSource(Promise),\n    setCtorString = toSource(Set),\n    weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n    (Map && getTag(new Map) != mapTag) ||\n    (Promise && getTag(Promise.resolve()) != promiseTag) ||\n    (Set && getTag(new Set) != setTag) ||\n    (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n  getTag = function(value) {\n    var result = baseGetTag(value),\n        Ctor = result == objectTag ? value.constructor : undefined,\n        ctorString = Ctor ? toSource(Ctor) : '';\n\n    if (ctorString) {\n      switch (ctorString) {\n        case dataViewCtorString: return dataViewTag;\n        case mapCtorString: return mapTag;\n        case promiseCtorString: return promiseTag;\n        case setCtorString: return setTag;\n        case weakMapCtorString: return weakMapTag;\n      }\n    }\n    return result;\n  };\n}\n\nmodule.exports = getTag;\n", "var Stack = require('./_Stack'),\n    equalArrays = require('./_equalArrays'),\n    equalByTag = require('./_equalByTag'),\n    equalObjects = require('./_equalObjects'),\n    getTag = require('./_getTag'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n  var objIsArr = isArray(object),\n      othIsArr = isArray(other),\n      objTag = objIsArr ? arrayTag : getTag(object),\n      othTag = othIsArr ? arrayTag : getTag(other);\n\n  objTag = objTag == argsTag ? objectTag : objTag;\n  othTag = othTag == argsTag ? objectTag : othTag;\n\n  var objIsObj = objTag == objectTag,\n      othIsObj = othTag == objectTag,\n      isSameTag = objTag == othTag;\n\n  if (isSameTag && isBuffer(object)) {\n    if (!isBuffer(other)) {\n      return false;\n    }\n    objIsArr = true;\n    objIsObj = false;\n  }\n  if (isSameTag && !objIsObj) {\n    stack || (stack = new Stack);\n    return (objIsArr || isTypedArray(object))\n      ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n      : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n  }\n  if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n    var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n        othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n    if (objIsWrapped || othIsWrapped) {\n      var objUnwrapped = objIsWrapped ? object.value() : object,\n          othUnwrapped = othIsWrapped ? other.value() : other;\n\n      stack || (stack = new Stack);\n      return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n    }\n  }\n  if (!isSameTag) {\n    return false;\n  }\n  stack || (stack = new Stack);\n  return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n", "var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n    isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Unordered comparison\n *  2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n  if (value === other) {\n    return true;\n  }\n  if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n    return value !== value && other !== other;\n  }\n  return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n", "var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n  return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n", "/**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\nfunction arrayEach(array, iteratee) {\n  var index = -1,\n      length = array == null ? 0 : array.length;\n\n  while (++index < length) {\n    if (iteratee(array[index], index, array) === false) {\n      break;\n    }\n  }\n  return array;\n}\n\nmodule.exports = arrayEach;\n", "var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n  try {\n    var func = getNative(Object, 'defineProperty');\n    func({}, '', {});\n    return func;\n  } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n", "var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n  if (key == '__proto__' && defineProperty) {\n    defineProperty(object, key, {\n      'configurable': true,\n      'enumerable': true,\n      'value': value,\n      'writable': true\n    });\n  } else {\n    object[key] = value;\n  }\n}\n\nmodule.exports = baseAssignValue;\n", "var baseAssignValue = require('./_baseAssignValue'),\n    eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n  var objValue = object[key];\n  if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n      (value === undefined && !(key in object))) {\n    baseAssignValue(object, key, value);\n  }\n}\n\nmodule.exports = assignValue;\n", "var assignValue = require('./_assignValue'),\n    baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n  var isNew = !object;\n  object || (object = {});\n\n  var index = -1,\n      length = props.length;\n\n  while (++index < length) {\n    var key = props[index];\n\n    var newValue = customizer\n      ? customizer(object[key], source[key], key, object, source)\n      : undefined;\n\n    if (newValue === undefined) {\n      newValue = source[key];\n    }\n    if (isNew) {\n      baseAssignValue(object, key, newValue);\n    } else {\n      assignValue(object, key, newValue);\n    }\n  }\n  return object;\n}\n\nmodule.exports = copyObject;\n", "var copyObject = require('./_copyObject'),\n    keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n  return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n", "/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n  var result = [];\n  if (object != null) {\n    for (var key in Object(object)) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = nativeKeysIn;\n", "var isObject = require('./isObject'),\n    isPrototype = require('./_isPrototype'),\n    nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n  if (!isObject(object)) {\n    return nativeKeysIn(object);\n  }\n  var isProto = isPrototype(object),\n      result = [];\n\n  for (var key in object) {\n    if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n      result.push(key);\n    }\n  }\n  return result;\n}\n\nmodule.exports = baseKeysIn;\n", "var arrayLikeKeys = require('./_arrayLikeKeys'),\n    baseKeysIn = require('./_baseKeysIn'),\n    isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n *   this.a = 1;\n *   this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n  return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n", "var copyObject = require('./_copyObject'),\n    keysIn = require('./keysIn');\n\n/**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssignIn(object, source) {\n  return object && copyObject(source, keysIn(source), object);\n}\n\nmodule.exports = baseAssignIn;\n", "var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n    allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of  `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n  if (isDeep) {\n    return buffer.slice();\n  }\n  var length = buffer.length,\n      result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n  buffer.copy(result);\n  return result;\n}\n\nmodule.exports = cloneBuffer;\n", "/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n  var index = -1,\n      length = source.length;\n\n  array || (array = Array(length));\n  while (++index < length) {\n    array[index] = source[index];\n  }\n  return array;\n}\n\nmodule.exports = copyArray;\n", "var copyObject = require('./_copyObject'),\n    getSymbols = require('./_getSymbols');\n\n/**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbols(source, object) {\n  return copyObject(source, getSymbols(source), object);\n}\n\nmodule.exports = copySymbols;\n", "var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n", "var arrayPush = require('./_arrayPush'),\n    getPrototype = require('./_getPrototype'),\n    getSymbols = require('./_getSymbols'),\n    stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n  var result = [];\n  while (object) {\n    arrayPush(result, getSymbols(object));\n    object = getPrototype(object);\n  }\n  return result;\n};\n\nmodule.exports = getSymbolsIn;\n", "var copyObject = require('./_copyObject'),\n    getSymbolsIn = require('./_getSymbolsIn');\n\n/**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\nfunction copySymbolsIn(source, object) {\n  return copyObject(source, getSymbolsIn(source), object);\n}\n\nmodule.exports = copySymbolsIn;\n", "var baseGetAllKeys = require('./_baseGetAllKeys'),\n    getSymbolsIn = require('./_getSymbolsIn'),\n    keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n  return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\nfunction initCloneArray(array) {\n  var length = array.length,\n      result = new array.constructor(length);\n\n  // Add properties assigned by `RegExp#exec`.\n  if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n    result.index = array.index;\n    result.input = array.input;\n  }\n  return result;\n}\n\nmodule.exports = initCloneArray;\n", "var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n  var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n  new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n  return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\nfunction cloneDataView(dataView, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n  return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n}\n\nmodule.exports = cloneDataView;\n", "/** Used to match `RegExp` flags from their coerced string values. */\nvar reFlags = /\\w*$/;\n\n/**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\nfunction cloneRegExp(regexp) {\n  var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n  result.lastIndex = regexp.lastIndex;\n  return result;\n}\n\nmodule.exports = cloneRegExp;\n", "var Symbol = require('./_Symbol');\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n    symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\nfunction cloneSymbol(symbol) {\n  return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n}\n\nmodule.exports = cloneSymbol;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n  var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n  return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n", "var cloneArrayBuffer = require('./_cloneArrayBuffer'),\n    cloneDataView = require('./_cloneDataView'),\n    cloneRegExp = require('./_cloneRegExp'),\n    cloneSymbol = require('./_cloneSymbol'),\n    cloneTypedArray = require('./_cloneTypedArray');\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneByTag(object, tag, isDeep) {\n  var Ctor = object.constructor;\n  switch (tag) {\n    case arrayBufferTag:\n      return cloneArrayBuffer(object);\n\n    case boolTag:\n    case dateTag:\n      return new Ctor(+object);\n\n    case dataViewTag:\n      return cloneDataView(object, isDeep);\n\n    case float32Tag: case float64Tag:\n    case int8Tag: case int16Tag: case int32Tag:\n    case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n      return cloneTypedArray(object, isDeep);\n\n    case mapTag:\n      return new Ctor;\n\n    case numberTag:\n    case stringTag:\n      return new Ctor(object);\n\n    case regexpTag:\n      return cloneRegExp(object);\n\n    case setTag:\n      return new Ctor;\n\n    case symbolTag:\n      return cloneSymbol(object);\n  }\n}\n\nmodule.exports = initCloneByTag;\n", "var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n  function object() {}\n  return function(proto) {\n    if (!isObject(proto)) {\n      return {};\n    }\n    if (objectCreate) {\n      return objectCreate(proto);\n    }\n    object.prototype = proto;\n    var result = new object;\n    object.prototype = undefined;\n    return result;\n  };\n}());\n\nmodule.exports = baseCreate;\n", "var baseCreate = require('./_baseCreate'),\n    getPrototype = require('./_getPrototype'),\n    isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n  return (typeof object.constructor == 'function' && !isPrototype(object))\n    ? baseCreate(getPrototype(object))\n    : {};\n}\n\nmodule.exports = initCloneObject;\n", "var getTag = require('./_getTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]';\n\n/**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\nfunction baseIsMap(value) {\n  return isObjectLike(value) && getTag(value) == mapTag;\n}\n\nmodule.exports = baseIsMap;\n", "var baseIsMap = require('./_baseIsMap'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsMap = nodeUtil && nodeUtil.isMap;\n\n/**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\nvar isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\nmodule.exports = isMap;\n", "var getTag = require('./_getTag'),\n    isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar setTag = '[object Set]';\n\n/**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\nfunction baseIsSet(value) {\n  return isObjectLike(value) && getTag(value) == setTag;\n}\n\nmodule.exports = baseIsSet;\n", "var baseIsSet = require('./_baseIsSet'),\n    baseUnary = require('./_baseUnary'),\n    nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsSet = nodeUtil && nodeUtil.isSet;\n\n/**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\nvar isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\nmodule.exports = isSet;\n", "var Stack = require('./_Stack'),\n    arrayEach = require('./_arrayEach'),\n    assignValue = require('./_assignValue'),\n    baseAssign = require('./_baseAssign'),\n    baseAssignIn = require('./_baseAssignIn'),\n    cloneBuffer = require('./_cloneBuffer'),\n    copyArray = require('./_copyArray'),\n    copySymbols = require('./_copySymbols'),\n    copySymbolsIn = require('./_copySymbolsIn'),\n    getAllKeys = require('./_getAllKeys'),\n    getAllKeysIn = require('./_getAllKeysIn'),\n    getTag = require('./_getTag'),\n    initCloneArray = require('./_initCloneArray'),\n    initCloneByTag = require('./_initCloneByTag'),\n    initCloneObject = require('./_initCloneObject'),\n    isArray = require('./isArray'),\n    isBuffer = require('./isBuffer'),\n    isMap = require('./isMap'),\n    isObject = require('./isObject'),\n    isSet = require('./isSet'),\n    keys = require('./keys'),\n    keysIn = require('./keysIn');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_FLAT_FLAG = 2,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n    arrayTag = '[object Array]',\n    boolTag = '[object Boolean]',\n    dateTag = '[object Date]',\n    errorTag = '[object Error]',\n    funcTag = '[object Function]',\n    genTag = '[object GeneratorFunction]',\n    mapTag = '[object Map]',\n    numberTag = '[object Number]',\n    objectTag = '[object Object]',\n    regexpTag = '[object RegExp]',\n    setTag = '[object Set]',\n    stringTag = '[object String]',\n    symbolTag = '[object Symbol]',\n    weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n    dataViewTag = '[object DataView]',\n    float32Tag = '[object Float32Array]',\n    float64Tag = '[object Float64Array]',\n    int8Tag = '[object Int8Array]',\n    int16Tag = '[object Int16Array]',\n    int32Tag = '[object Int32Array]',\n    uint8Tag = '[object Uint8Array]',\n    uint8ClampedTag = '[object Uint8ClampedArray]',\n    uint16Tag = '[object Uint16Array]',\n    uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values supported by `_.clone`. */\nvar cloneableTags = {};\ncloneableTags[argsTag] = cloneableTags[arrayTag] =\ncloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\ncloneableTags[boolTag] = cloneableTags[dateTag] =\ncloneableTags[float32Tag] = cloneableTags[float64Tag] =\ncloneableTags[int8Tag] = cloneableTags[int16Tag] =\ncloneableTags[int32Tag] = cloneableTags[mapTag] =\ncloneableTags[numberTag] = cloneableTags[objectTag] =\ncloneableTags[regexpTag] = cloneableTags[setTag] =\ncloneableTags[stringTag] = cloneableTags[symbolTag] =\ncloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\ncloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\ncloneableTags[errorTag] = cloneableTags[funcTag] =\ncloneableTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n *  1 - Deep clone\n *  2 - Flatten inherited properties\n *  4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\nfunction baseClone(value, bitmask, customizer, key, object, stack) {\n  var result,\n      isDeep = bitmask & CLONE_DEEP_FLAG,\n      isFlat = bitmask & CLONE_FLAT_FLAG,\n      isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n  if (customizer) {\n    result = object ? customizer(value, key, object, stack) : customizer(value);\n  }\n  if (result !== undefined) {\n    return result;\n  }\n  if (!isObject(value)) {\n    return value;\n  }\n  var isArr = isArray(value);\n  if (isArr) {\n    result = initCloneArray(value);\n    if (!isDeep) {\n      return copyArray(value, result);\n    }\n  } else {\n    var tag = getTag(value),\n        isFunc = tag == funcTag || tag == genTag;\n\n    if (isBuffer(value)) {\n      return cloneBuffer(value, isDeep);\n    }\n    if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n      result = (isFlat || isFunc) ? {} : initCloneObject(value);\n      if (!isDeep) {\n        return isFlat\n          ? copySymbolsIn(value, baseAssignIn(result, value))\n          : copySymbols(value, baseAssign(result, value));\n      }\n    } else {\n      if (!cloneableTags[tag]) {\n        return object ? value : {};\n      }\n      result = initCloneByTag(value, tag, isDeep);\n    }\n  }\n  // Check for circular references and return its corresponding clone.\n  stack || (stack = new Stack);\n  var stacked = stack.get(value);\n  if (stacked) {\n    return stacked;\n  }\n  stack.set(value, result);\n\n  if (isSet(value)) {\n    value.forEach(function(subValue) {\n      result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n    });\n  } else if (isMap(value)) {\n    value.forEach(function(subValue, key) {\n      result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n    });\n  }\n\n  var keysFunc = isFull\n    ? (isFlat ? getAllKeysIn : getAllKeys)\n    : (isFlat ? keysIn : keys);\n\n  var props = isArr ? undefined : keysFunc(value);\n  arrayEach(props || value, function(subValue, key) {\n    if (props) {\n      key = subValue;\n      subValue = value[key];\n    }\n    // Recursively populate clone (susceptible to call stack limits).\n    assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n  });\n  return result;\n}\n\nmodule.exports = baseClone;\n", "var baseClone = require('./_baseClone');\n\n/** Used to compose bitmasks for cloning. */\nvar CLONE_DEEP_FLAG = 1,\n    CLONE_SYMBOLS_FLAG = 4;\n\n/**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\nfunction cloneDeep(value) {\n  return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n}\n\nmodule.exports = cloneDeep;\n", "import type { Client } from \"./session/Client\";\n\n/**\n * @noInheritDoc\n * @category Utils\n */\nexport class EditionEvent extends Event {\n    /**\n     * The client id that emitted the event.\n     */\n    public readonly emitter: Client | null;\n\n    /**\n     * Returns true if the event was made by the current app.\n     */\n    isLocal(): boolean {\n        return this.emitter === null;\n    }\n\n    /**\n     * Returns true if the event was made by another user from another instance of the app or even another app.\n     */\n    isExternal(): boolean {\n        return this.emitter !== null;\n    }\n\n    /**\n     * @internal\n     */\n    constructor(event_name: string, emitter: Client | null) {\n        super(event_name);\n        this.emitter = emitter;\n    }\n}\n", "import type { LivelinkCore } from \"./LivelinkCore\";\nimport type VM from \"node:vm\";\n\n/**\n *\n */\nconst isNode = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n\n/**\n * The URL of the Livelink core library. Injected by the build system.\n */\ndeclare const LIVELINK_CORE_URL: string;\n\n/**\n *\n */\ntype LivelinkCoreType = typeof LivelinkCore;\n\n/**\n *\n */\ntype CoreImporter = () => Promise<{\n    LivelinkCore: LivelinkCoreType;\n    LIVELINK_CORE_VERSION: string;\n    LIVELINK_CORE_COMMIT_SHA: string;\n}>;\n\n/**\n * @inline\n */\ntype BuildTarget = \"prod\" | \"dev\" | \"debug\";\n\n/**\n * Dynamically loads the Livelink core library.\n *\n * {@link DynamicLoader.load} must be called before accessing {@link DynamicLoader.Core}.\n *\n * ### Usage\n * ```typescript\n * await DynamicLoader.load();\n * const core = new DynamicLoader.Core();\n * ```\n *\n * @category Core\n */\nexport class DynamicLoader {\n    /**\n     *\n     */\n    static #core: LivelinkCoreType | null = null;\n\n    /**\n     *\n     */\n    static #importPromise: Promise<void> | null = null;\n\n    /**\n     * Returns the core.\n     */\n    static get Core(): LivelinkCoreType {\n        if (!DynamicLoader.#core) {\n            throw new Error(\"Livelink core not initialized\");\n        }\n        return DynamicLoader.#core;\n    }\n\n    /**\n     * Dynamically loads the Livelink core library.\n     *\n     * Must be called before accessing {@link DynamicLoader.Core}.\n     * Only one target can be loaded at a time.\n     *\n     * @param target - The target build to load.\n     *  - `\"prod\"`: Contains no debug information.\n     *  - `\"dev\"`: Contains some debug information.\n     *  - `\"debug\"`: Contains extra debug information.\n     */\n    static load(target: BuildTarget = \"prod\"): Promise<void> {\n        if (!DynamicLoader.#importPromise) {\n            DynamicLoader.#importPromise = DynamicLoader.#importCore(target);\n        }\n\n        return DynamicLoader.#importPromise;\n    }\n\n    /**\n     *\n     */\n    static async #importCore(target: BuildTarget): Promise<void> {\n        const dynamicImport = await DynamicLoader.#createImporter(target);\n        const { LivelinkCore } = await dynamicImport();\n\n        DynamicLoader.#core = LivelinkCore;\n\n        const TARGET_COLOR = {\n            prod: \"#FFC700\",\n            dev: \"#36D399\",\n            debug: \"#FB4949\",\n        } satisfies Record<BuildTarget, string>;\n\n        console.info(\n            `%c Livelink Core initialized \uD83D\uDE80 %c ${LivelinkCore.VERSION} %c ${LivelinkCore.COMMIT_SHA} %c${target}`,\n            \"background: #080A12; color: #FFC700; font-weight: bold; padding: 8px; padding-right: 164px; border-radius: 16px; margin: 16px 0 16px 0\",\n            \"background: #9EA6D6; color: #0A1018; font-weight: bold; padding: 1px; padding-right: 0px; margin-left: -160px; border-radius: 16px 0 0 16px;\",\n            \"background: #6973A8; color: #0A1018; font-weight: bold; padding: 1px; padding-left: 0; border-radius: 0 16px 16px 0;\",\n            `background: ${TARGET_COLOR[target]}; color: #000; font-weight: bold; padding: 6px 16px; border: 4px solid #080A12; border-radius: 16px; margin-left: 16px`,\n        );\n    }\n\n    /**\n     *\n     */\n    static async #createImporter(target: string): Promise<CoreImporter> {\n        const moduleURL = LIVELINK_CORE_URL + \"/\" + (target !== \"prod\" ? `core.${target}.mjs` : \"core.mjs\");\n\n        if (!isNode) {\n            return new Function(\"return import('\" + moduleURL + \"')\") as CoreImporter;\n        }\n\n        const response = await fetch(moduleURL);\n        const source = await response.text();\n\n        // As a platform neutral build, we needs to load node:vm dynamically.\n        // We can't use await import('node:vm') directly because it will be resolved at build time\n        // and will not be available in the browser.\n        const vm = (await new Function(\"return import('node:vm')\")()) as {\n            SourceTextModule: typeof VM.SourceTextModule;\n        };\n\n        // VM Modules is an experimental feature, so it may not be available in all versions of Node.js.\n        // This feature is only available with the --experimental-vm-modules command flag enabled.\n        if (!vm.SourceTextModule) {\n            return new Function(\"return import('data:text/javascript;base64,\" + btoa(source) + \"')\") as CoreImporter;\n        }\n\n        console.info(\"Using experimental VM SourceTextModule to load Livelink core\");\n        return (async () => {\n            const module = new vm.SourceTextModule(source, { identifier: moduleURL });\n            // @ts-expect-error: Since core has no dependencies, the linker function will never be called.\n            await module.link(() => {});\n            await module.evaluate();\n\n            return module.namespace;\n        }) as CoreImporter;\n    }\n\n    /**\n     *\n     */\n    private constructor() {}\n}\n", "export * from \"./DynamicLoader\";\nexport type * from \"./core\";\n\n//------------------------------------------------------------------------------\n/**\n * Version of the Livelink Core library, injected by the build system.\n * @internal\n */\ndeclare const LIVELINK_CORE_VERSION: string;\n\n/**\n * Name of the package, injected by the build system.\n * @internal\n */\ndeclare const PACKAGE_NAME: string;\n\n//------------------------------------------------------------------------------\ndeclare global {\n    interface Window {\n        __LIVELINK__: Record<string, string>;\n    }\n}\n\n//------------------------------------------------------------------------------\nif (typeof window !== \"undefined\") {\n    if (!window.__LIVELINK__) {\n        window.__LIVELINK__ = {};\n    }\n\n    if (Object.prototype.hasOwnProperty.call(window.__LIVELINK__, PACKAGE_NAME)) {\n        console.warn(\"\u26A0\uFE0F WARNING \u26A0\uFE0F Multiple instances of Livelink Core being imported.\");\n    } else {\n        window.__LIVELINK__[PACKAGE_NAME] = LIVELINK_CORE_VERSION;\n    }\n}\n", "/**\n * Base URL of the 3dverse application API.\n *\n * `API_HOSTNAME` is injected at build time by each client SDK's bundler (see the\n * `define` block in the consuming SDK's `esbuild.js`, and `vitest.config.ts` for tests).\n *\n * Mutable so that applications can retarget another environment at runtime through the\n * `Livelink._api_url` accessor exposed by each SDK facade.\n */\nlet api_url = `https://${API_HOSTNAME}/app/v1`;\n\n/**\n * @internal\n * The current base URL of the 3dverse application API. Read at call time by every API request.\n */\nexport function getApiUrl(): string {\n    return api_url;\n}\n\n/**\n * @internal\n * Retarget the 3dverse application API. Must be set before any API call is made.\n */\nexport function setApiUrl(url: string): void {\n    api_url = url;\n}\n", "/**\n * Convert an update rate in Hz to a timer interval in milliseconds.\n *\n * Shared by every rate the SDK turns into a `setInterval`, so they all reject the same things. In\n * particular `NaN` \u2014 which `Number(process.env.SOMETHING)` produces from any bad value, and which\n * `setInterval` coerces to 0 ms, turning a configuration typo into a busy loop.\n *\n * @throws RangeError if the rate is not a finite number in the `(0, 125]` range.\n *\n * @internal\n */\nexport function computeIntervalInMs({ name, rate }: { name: string; rate: number }): number {\n    const interval_in_ms = 1000 / rate;\n    if (!Number.isFinite(interval_in_ms) || interval_in_ms < 8) {\n        throw new RangeError(\n            `${name} must be a finite number in the (0, 125] range so that the resulting interval` +\n                ` is at least 8 ms, got ${rate}.`,\n        );\n    }\n    return interval_in_ms;\n}\n", "//------------------------------------------------------------------------------\nimport type { ActivityWatcher, Commands, Events, LivelinkCore } from \"@3dverse/livelink.core\";\nimport { DynamicLoader } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport type { LivelinkInstance } from \"./LivelinkInstance\";\nimport { getApiUrl, setApiUrl } from \"./config/api\";\nimport { computeIntervalInMs } from \"./rates\";\nimport type { SceneBase } from \"./scene/Scene\";\nimport type { Entity } from \"./scene/Entity\";\nimport type { Session } from \"./session/Session\";\n\n/**\n * Represents the various stages of the Livelink connection process.\n *\n * Each stage represents a different phase of establishing a connection to the Livelink service:\n *\n * - `\"initializing\"` - Loading dynamic dependencies and preparing the connection infrastructure\n * - `\"finding-session\"` - Looking for existing sessions on the server (used with join and join_or_start methods)\n * - `\"creating-session\"` - Creating a new session on the server (used with start method or join_or_start fallback)\n * - `\"registering-client\"` - Registering the client with the session and obtaining session credentials\n * - `\"connecting\"` - Establishing the WebSocket connection to the gateway server\n * - `\"configuring\"` - Setting up the client configuration and preparing for streaming\n * - `\"ready\"` - Connection is complete and streaming can begin\n *\n * This is the vocabulary of the whole connection process, not the set a given facade emits: the\n * headless agent never reports `\"configuring\"` since it has no renderer to configure, and the\n * browser SDK reports `\"configuring\"` and `\"ready\"` from its React layer rather than from\n * `Livelink` itself.\n *\n * @category Main\n */\nexport type LivelinkConnectionStage =\n    | \"initializing\"\n    | \"finding-session\"\n    | \"creating-session\"\n    | \"registering-client\"\n    | \"connecting\"\n    | \"configuring\"\n    | \"ready\";\n\n/**\n * Callback function type for receiving connection progress updates.\n *\n * @param stage - The current stage of the connection process.\n *\n * @category Main\n */\nexport type LivelinkProgressCallback = (stage: LivelinkConnectionStage) => void;\n\n/**\n * The rates at which a client flushes its pending changes to the server.\n *\n * Both must be a finite number in the `(0, 125]` range so that the resulting interval is at least 8 milliseconds.\n *\n * @category Main\n */\nexport type UpdateLoopRates = {\n    /**\n     * How many times per second the entity and scene setting changes are sent to the server.\n     * This is the rate at which own edits become visible to everyone, so it bounds\n     * the sample rate of anything animated.\n     *\n     * @defaultValue 30\n     */\n    updates_per_second?: number;\n\n    /**\n     * @deprecated\n     *\n     * How many times per second the transient, non-persisted state of this client \u2014 broadcast\n     * entities, broadcast scene settings \u2014 is sent to the server.\n     *\n     * @defaultValue 1\n     */\n    broadcasts_per_second?: number;\n};\n\n/**\n * Shared implementation of a livelink client facade.\n *\n * Owns the connection to the core, the wiring of the core event listeners to the session and the\n * scene, and the update/broadcast loop that flushes dirty entities and scene settings to the\n * server.\n *\n * Each SDK derives its own facade from this class:\n * - the browser SDK adds the streaming, rendering and input layers,\n * - the headless agent SDK exposes it almost as-is.\n *\n * @category Main\n */\nexport abstract class LivelinkBase<\n    // The entity type is threaded explicitly because SceneBase is invariant in it: constraining on\n    // SceneBase<EntityType> lets each SDK's Scene match the constraint with its own entity flavour.\n    EntityType extends Entity,\n    SceneType extends SceneBase<EntityType>,\n    SessionType extends Session,\n> implements LivelinkInstance {\n    /**\n     * @internal\n     * Base URL of the 3dverse application API.\n     *\n     * Reassign it to target another environment. Must be set before any session is created or\n     * joined.\n     */\n    static get _api_url(): string {\n        return getApiUrl();\n    }\n\n    static set _api_url(url: string) {\n        setApiUrl(url);\n    }\n\n    /**\n     * The session this instance is connected to.\n     */\n    public readonly session: SessionType;\n\n    /**\n     * The scene the current session is running.\n     */\n    public readonly scene: SceneType;\n\n    /**\n     * The core object managing the connection to the server.\n     */\n    readonly #core: LivelinkCore;\n\n    /**\n     * Interval between updates sent to the renderer.\n     */\n    #update_interval: ReturnType<typeof setInterval> | null = null;\n\n    /**\n     * Interval between broadcasts sent to the editor.\n     */\n    #broadcast_interval: ReturnType<typeof setInterval> | null = null;\n\n    /**\n     * Whether the instance has been disconnected.\n     */\n    #disconnected: boolean = false;\n\n    /**\n     * The activity watcher disconnects the session if no activity is detected for a certain amount\n     * of time.\n     */\n    get activity_watcher(): ActivityWatcher {\n        return this.#core.activity_watcher;\n    }\n\n    /**\n     * The latency of the connection in milliseconds.\n     */\n    get latency(): number {\n        return this.#core.latency;\n    }\n\n    /**\n     * @internal\n     * The core object managing the connection to the server.\n     */\n    protected get _core(): LivelinkCore {\n        return this.#core;\n    }\n\n    /**\n     * @internal\n     * Whether the instance has been disconnected.\n     */\n    protected get _is_disconnected(): boolean {\n        return this.#disconnected;\n    }\n\n    /**\n     * @internal\n     */\n    protected constructor({ session }: { session: SessionType }) {\n        this.session = session;\n        this.#core = new DynamicLoader.Core();\n        this.scene = this._createScene({ core: this.#core });\n    }\n\n    /**\n     * @internal\n     *\n     * Instantiate the concrete scene type for this facade.\n     *\n     * Called from the base constructor: implementations must not touch any subclass state, only\n     * construct the scene from the given core (same rule as `SceneBase._instantiateEntity`).\n     */\n    protected abstract _createScene({ core }: { core: LivelinkCore }): SceneType;\n\n    /**\n     * @internal\n     * Register the client on the session, connect the core to the gateway and install the core\n     * event listeners.\n     */\n    protected async _connect({\n        is_headless,\n        onProgress,\n    }: {\n        is_headless: boolean;\n        onProgress?: LivelinkProgressCallback;\n    }): Promise<void> {\n        onProgress?.(\"registering-client\");\n        await this.session.registerClient({ is_headless });\n\n        onProgress?.(\"connecting\");\n        await this.#core.connect({ session: this.session });\n        this._installCoreEventListeners();\n    }\n\n    /**\n     * Disconnect from the server and release the core resources.\n     *\n     * Note that the session is not closed, it can be reconnected later.\n     * Safe to call multiple times.\n     */\n    async disconnect(): Promise<void> {\n        if (this.#disconnected) {\n            return;\n        }\n        this.#disconnected = true;\n        // Told rather than listened for: the core's own `on-disconnected` never reaches the scene on\n        // a disconnect we initiate, since the listeners come off just below.\n        this.scene._onDisconnected();\n\n        this._uninstallCoreEventListeners();\n        this._stopUpdateLoop();\n\n        await this.#core.disconnect();\n    }\n\n    /**\n     * Send a script event to the server to start the simulation.\n     */\n    startSimulation(): void {\n        this.#core.setSimulationState({ state: \"start_simulation\" });\n    }\n\n    /**\n     * Send a script event to the server to pause the simulation.\n     */\n    pauseSimulation(): void {\n        this.#core.setSimulationState({ state: \"pause_simulation\" });\n    }\n\n    /**\n     * Send a script event to the server to stop the simulation.\n     */\n    stopSimulation(): void {\n        this.#core.setSimulationState({ state: \"stop_simulation\" });\n    }\n\n    /**\n     * Send a partial skeleton pose targeting a specific animation controller.\n     *\n     * @param params\n     * @param params.controller The entity having the animation controller component.\n     * @param params.partial_pose The partial pose to send.\n     */\n    sendSkeletonPose({\n        controller,\n        partial_pose,\n    }: {\n        controller: EntityType;\n        partial_pose: Commands.SkeletonPartialPose;\n    }): void {\n        this._core.sendSkeletonPose({\n            controller_rtid: controller.rtid,\n            partial_pose,\n        });\n    }\n\n    /**\n     * @internal\n     * Start the loops flushing entity and scene settings changes to the server.\n     *\n     * Each rate must be a finite number in the `(0, 125]` range so that the resulting interval is\n     * at least 8 milliseconds.\n     *\n     * Safe to call again: any loop already running is stopped first, so a second start never orphans\n     * the previous intervals.\n     *\n     * Does nothing once the instance is disconnected: `disconnect()` early-returns on every later\n     * call, so intervals installed after it would never be cleared again.\n     *\n     * @throws RangeError if a rate falls outside the accepted range.\n     */\n    protected _startUpdateLoop({ updates_per_second = 30, broadcasts_per_second = 1 }: UpdateLoopRates = {}): void {\n        if (this.#disconnected) {\n            return;\n        }\n\n        const update_interval_in_ms = computeIntervalInMs({ name: \"updates_per_second\", rate: updates_per_second });\n        const broadcast_interval_in_ms = computeIntervalInMs({\n            name: \"broadcasts_per_second\",\n            rate: broadcasts_per_second,\n        });\n\n        // Clear any loop already running before installing the new intervals \u2014 an orphaned interval\n        // keeps flushing entities forever and survives `disconnect()`, which only clears the last\n        // handles. Done after the rate validation above so an invalid rate never tears down a\n        // healthy running loop.\n        this._stopUpdateLoop();\n\n        this.#update_interval = setInterval(() => {\n            this._updateEntities();\n            this.#updateSceneSettings();\n        }, update_interval_in_ms);\n\n        this.#broadcast_interval = setInterval(() => {\n            this.#broadcastEntities();\n            this.#broadcastSceneSettings();\n        }, broadcast_interval_in_ms);\n    }\n\n    /**\n     * @internal\n     * Stop the update and broadcast loops.\n     */\n    protected _stopUpdateLoop(): void {\n        if (this.#update_interval !== null) {\n            clearInterval(this.#update_interval);\n            this.#update_interval = null;\n        }\n\n        if (this.#broadcast_interval !== null) {\n            clearInterval(this.#broadcast_interval);\n            this.#broadcast_interval = null;\n        }\n    }\n\n    /**\n     * @internal\n     */\n    _updateEntities(): void {\n        const update_commands = this.scene._entity_registry._flushDirtyEntities();\n        if (update_commands.length > 0) {\n            this.#core.updateEntities({ update_commands, persist: false });\n        }\n    }\n\n    /**\n     *\n     */\n    #broadcastEntities = (): void => {\n        const update_commands = this.scene._entity_registry._flushPersistentEntities();\n        if (update_commands.length > 0) {\n            this.#core.updateEntities({ update_commands, persist: true });\n        }\n    };\n\n    /**\n     *\n     */\n    #updateSceneSettings = (): void => {\n        const updated_settings = this.scene._settings._getAndClearSettingsToUpdate();\n        if (Object.keys(updated_settings).length > 0) {\n            this.#core.updateSceneSettings({ updated_settings, persist: false });\n        }\n    };\n\n    /**\n     *\n     */\n    #broadcastSceneSettings = (): void => {\n        const updated_settings = this.scene._settings._getAndClearSettingsToBroadcast();\n        if (Object.keys(updated_settings).length > 0) {\n            this.#core.updateSceneSettings({ updated_settings, persist: true });\n        }\n    };\n\n    /**\n     * @internal\n     * Install the core event listeners shared by all facades.\n     */\n    protected _installCoreEventListeners(): void {\n        this.#core.addEventListener(\"on-disconnected\", this.session._onDisconnected);\n        this.#core.addEventListener(\"on-disconnected\", this.scene._onDisconnected);\n        this.#core.addEventListener(\"on-inactivity-warning\", this.session._onInactivityWarning);\n        this.#core.addEventListener(\"on-scene-info-loaded\", this.scene._onSceneInfoLoaded);\n        this.#core.addEventListener(\"on-activity-detected\", this.session._onActivityDetected);\n        this.#core.addEventListener(\"on-entities-created\", this.scene._onEntitiesCreated);\n        this.#core.addEventListener(\"on-entities-updated\", this.#onEntitiesUpdated);\n        this.#core.addEventListener(\"on-entities-deleted\", this.scene._onEntitiesDeleted);\n        this.#core.addEventListener(\"on-entity-visibility-changed\", this.scene._onEntityVisibilityChanged);\n        this.#core.addEventListener(\"on-scene-settings-updated\", this.scene._settings._onSceneSettingsUpdated);\n        this.#core.addEventListener(\"on-script-event-received\", this.scene._onScriptEventReceived);\n        this.#core.addEventListener(\"on-client-connected\", this.#onClientConnectedEvent);\n        this.#core.addEventListener(\"on-clients-disconnected\", this.#onClientsDisconnectedEvent);\n        this.#core.addEventListener(\"on-asset-loading-status-received\", this.scene._onAssetLoadingStatusReceived);\n    }\n\n    /**\n     * @internal\n     * Uninstall the core event listeners shared by all facades.\n     */\n    protected _uninstallCoreEventListeners(): void {\n        this.#core.removeEventListener(\"on-disconnected\", this.session._onDisconnected);\n        this.#core.removeEventListener(\"on-disconnected\", this.scene._onDisconnected);\n        this.#core.removeEventListener(\"on-inactivity-warning\", this.session._onInactivityWarning);\n        this.#core.removeEventListener(\"on-scene-info-loaded\", this.scene._onSceneInfoLoaded);\n        this.#core.removeEventListener(\"on-activity-detected\", this.session._onActivityDetected);\n        this.#core.removeEventListener(\"on-entities-created\", this.scene._onEntitiesCreated);\n        this.#core.removeEventListener(\"on-entities-updated\", this.#onEntitiesUpdated);\n        this.#core.removeEventListener(\"on-entities-deleted\", this.scene._onEntitiesDeleted);\n        this.#core.removeEventListener(\"on-entity-visibility-changed\", this.scene._onEntityVisibilityChanged);\n        this.#core.removeEventListener(\"on-scene-settings-updated\", this.scene._settings._onSceneSettingsUpdated);\n        this.#core.removeEventListener(\"on-script-event-received\", this.scene._onScriptEventReceived);\n        this.#core.removeEventListener(\"on-client-connected\", this.#onClientConnectedEvent);\n        this.#core.removeEventListener(\"on-clients-disconnected\", this.#onClientsDisconnectedEvent);\n        this.#core.removeEventListener(\"on-asset-loading-status-received\", this.scene._onAssetLoadingStatusReceived);\n    }\n\n    /**\n     *\n     */\n    #onEntitiesUpdated = ({ updated_entities, emitter }: Events.EntitiesUpdatedEvent): void => {\n        for (const { entity_euid, updated_components, deleted_components } of updated_entities) {\n            this.scene._updateEntityFromEvent({ entity_euid, updated_components, deleted_components, emitter });\n        }\n    };\n\n    /**\n     *\n     */\n    #onClientConnectedEvent = ({ client_info }: Events.ClientConnectedEvent): void => {\n        this.session._onClientJoined({ core: this, client_info });\n    };\n\n    /**\n     *\n     */\n    #onClientsDisconnectedEvent = ({ client_ids }: Events.ClientsDisconnectedEvent): void => {\n        for (const client_id of client_ids) {\n            this.session._onClientLeft({ client_id });\n        }\n    };\n}\n", "/**\n * @category Utils\n */\nexport class TypedEventTarget<EventMap extends Record<string, Event>> {\n    #event_target = new EventTarget();\n\n    /**\n     *\n     */\n    addEventListener<_EventName extends keyof EventMap & string>(\n        event_name: _EventName,\n        listener: (event: EventMap[_EventName]) => void,\n        options?: AddEventListenerOptions | boolean,\n    ): void {\n        this.#event_target.addEventListener(event_name, listener as EventListener, options);\n    }\n\n    /**\n     *\n     */\n    removeEventListener<_EventName extends keyof EventMap & string>(\n        event_name: _EventName,\n        listener: (event: EventMap[_EventName]) => void,\n        options?: EventListenerOptions | boolean,\n    ): void {\n        this.#event_target.removeEventListener(event_name, listener as EventListener, options);\n    }\n\n    /**\n     * @internal\n     */\n    _dispatchEvent<T extends keyof EventMap>(event: EventMap[T]): boolean {\n        return this.#event_target.dispatchEvent(event as Event);\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { UUID } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport { ClientInfo } from \"./ClientInfo\";\nimport { LivelinkInstance } from \"../LivelinkInstance\";\n\n/**\n * A client in a session.\n *\n * A client represents an instance of a 3dverse user viewing the session.\n *\n * A user can have multiple clients in the same session.\n *\n * Clients must not be instantiated but can be accessed through the {@link Session} object.\n *\n * A client seen from here has identity only. Everything a client *shows* \u2014 the camera entities it\n * views the scene through, the entity under its mouse pointer \u2014 is carried by the client metadata\n * piggybacked on the video frames, which only a streaming client receives. Those members therefore\n * live on the browser SDK's `Client` subclass; a livelink.agent client never receives frames\n * and would only ever see them empty.\n *\n * @category Session\n */\nexport class Client {\n    /**\n     * The Livelink core object.\n     */\n    readonly #core: LivelinkInstance;\n\n    /**\n     * Information about the client.\n     */\n    readonly #client_info: ClientInfo;\n\n    /**\n     * The unique identifier of the session the client is associated with.\n     */\n    readonly session_id: UUID;\n\n    /**\n     * The unique identifier of the client.\n     */\n    get id(): UUID {\n        return this.#client_info.client_id;\n    }\n\n    /**\n     * The id of the user that the client is associated with.\n     * Note that the same user can have multiple clients in the same session.\n     */\n    get user_id(): UUID {\n        return this.#client_info.user_id;\n    }\n\n    /**\n     * The username of the user that the client is associated with.\n     */\n    get username(): string {\n        return this.#client_info.username;\n    }\n\n    /**\n     * The type of the client.\n     */\n    get client_type(): \"user\" | \"guest\" | \"api\" | \"unknown\" {\n        return this.#client_info.client_type;\n    }\n\n    /**\n     * Indicates if the client is external to the current session.\n     */\n    get is_external(): boolean {\n        return this.#core.session.session_id !== this.session_id;\n    }\n\n    /**\n     * @internal\n     */\n    constructor({\n        core,\n        client_info,\n        session_id,\n    }: {\n        core: LivelinkInstance;\n        client_info: ClientInfo;\n        session_id: UUID;\n    }) {\n        this.#core = core;\n        this.#client_info = client_info;\n        this.session_id = session_id;\n    }\n}\n", "import { Client } from \"./Client\";\n\n/**\n * Event emitted when the session is disconnected.\n *\n * Dispatched by {@link Session} as `on-disconnected`.\n *\n * @event\n * @noInheritDoc\n * @category Session / Events\n */\nexport class DisconnectedEvent extends Event {\n    /**\n     * The reason for the disconnection.\n     */\n    public readonly reason: string;\n\n    /**\n     * @internal\n     */\n    constructor({ reason }: { reason: string }) {\n        super(\"on-disconnected\");\n        this.reason = reason;\n    }\n}\n\n/**\n * Event emitted when the client is about to be disconnected due to inactivity.\n *\n * Dispatched by {@link Session} as `on-inactivity-warning`.\n *\n * @event\n * @noInheritDoc\n * @category Session / Events\n */\nexport class InactivityWarningEvent extends Event {\n    /**\n     * The number of seconds remaining before the client is disconnected.\n     */\n    public readonly seconds_remaining: number;\n    /**\n     * Resets the timer for the activity warning.\n     */\n    public readonly resetTimer: () => void;\n\n    /**\n     * @internal\n     */\n    constructor({ seconds_remaining, reset_timer }: { seconds_remaining: number; reset_timer: () => void }) {\n        super(\"on-inactivity-warning\");\n        this.seconds_remaining = seconds_remaining;\n        this.resetTimer = reset_timer;\n    }\n}\n\n/**\n * Event emitted when activity is detected after a period of inactivity.\n *\n * Dispatched by {@link Session} as `on-activity-detected`.\n *\n * @event\n * @noInheritDoc\n * @category Session / Events\n */\nexport class ActivityDetectedEvent extends Event {\n    /**\n     * @internal\n     */\n    constructor() {\n        super(\"on-activity-detected\");\n    }\n}\n\n/**\n * Event emitted when a client joins the session.\n *\n * Dispatched by {@link Session} as `on-client-joined`.\n *\n * @event\n * @noInheritDoc\n * @category Session / Events\n */\nexport class ClientJoinedEvent<ClientType extends Client = Client> extends Event {\n    /**\n     * The client that joined the session.\n     */\n    public readonly client: ClientType;\n\n    /**\n     * @internal\n     */\n    constructor({ client }: { client: ClientType }) {\n        super(\"on-client-joined\");\n        this.client = client;\n    }\n}\n\n/**\n * Event emitted when a client leaves the session.\n *\n * Dispatched by {@link Session} as `on-client-left`.\n *\n * @event\n * @noInheritDoc\n * @category Session / Events\n */\nexport class ClientLeftEvent<ClientType extends Client = Client> extends Event {\n    /**\n     * The client that left the session.\n     */\n    public readonly client: ClientType;\n\n    /**\n     * @internal\n     */\n    constructor({ client }: { client: ClientType }) {\n        super(\"on-client-left\");\n        this.client = client;\n    }\n}\n\n/**\n * The events dispatched by {@link Session}.\n *\n * @event\n * @category Session / Events\n */\nexport type SessionEvents<ClientType extends Client = Client> = {\n    \"on-inactivity-warning\": InactivityWarningEvent;\n    \"on-activity-detected\": ActivityDetectedEvent;\n    \"on-disconnected\": DisconnectedEvent;\n    \"on-client-joined\": ClientJoinedEvent<ClientType>;\n    \"on-client-left\": ClientLeftEvent<ClientType>;\n};\n", "//------------------------------------------------------------------------------\nimport type { Events, SessionInterface, UUID } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport { Client } from \"./Client\";\nimport { getApiUrl } from \"../config/api\";\nimport type { LivelinkInstance } from \"../LivelinkInstance\";\nimport { ClientInfo } from \"./ClientInfo\";\nimport { SessionInfo } from \"./SessionInfo\";\nimport { TypedEventTarget } from \"../TypedEventTarget\";\nimport {\n    ActivityDetectedEvent,\n    ClientJoinedEvent,\n    ClientLeftEvent,\n    DisconnectedEvent,\n    InactivityWarningEvent,\n    SessionEvents,\n} from \"./SessionEvents\";\n\n/**\n * @internal\n *\n * A function that selects a session from a list of sessions.\n *\n * @param params\n * @param params.sessions - The list of sessions to select from.\n *\n * @returns The selected session or null if no session was selected.\n *\n * @inline\n */\nexport type SessionSelector = ({ sessions }: { sessions: Array<SessionInfo> }) => SessionInfo | null;\n\n/**\n * @internal\n *\n * Instance type of a class constructor.\n *\n * Unlike the built-in {@link InstanceType}, this does not constrain `T` to a public constructor,\n * so it works with classes that have a `protected` constructor (like {@link Session}). The instance\n * type is extracted from the constructor's `prototype` property instead of its construct signature.\n *\n * @inline\n */\ntype InstanceOf<T> = T extends { prototype: infer P } ? P : never;\n\n/**\n * @internal\n *\n * Structural class shape used by the polymorphic statics ({@link Session.create} and friends).\n *\n * Only `prototype` (for the instance type, see {@link InstanceOf}) and `_make` are inspected, so\n * the constraint is satisfied by classes with a `protected` constructor and by non-generic\n * subclasses alike. A `T extends typeof Session` constraint would instead compare construct\n * signatures, and a subclass fixing the `ClientType` parameter (like the browser SDK's `Session`)\n * would fail that comparison.\n *\n * @inline\n */\ntype SessionClass = Pick<typeof Session, \"prototype\" | \"_make\">;\n\n/**\n * A session running a scene.\n *\n * A session is a running instance of a 3dverse server rendering a scene that can be joined by\n * multiple clients.\n *\n * A session can be transient or not.\n * A transient session is temporary and changes made to the entities in the scene are not saved.\n *\n * ### Usage\n * This class is not meant to be instantiated directly. Use the static methods to create or find\n * an existing session.\n *\n * A session can be created or joined:\n * - To create a new session, use the {@link Session.create} method.\n * - To find an existing session, use the {@link Session.find} method.\n * - Or if you know the session id, use the {@link Session.findById} method.\n *\n * ### Authentication\n * To create or find a session, you need a valid authentication token that has at least\n * read access to the scene the session will use.\n *\n * See: https://docs.3dverse.com/references/api/generate-user-token\n *\n * ### Events\n * - {@link ClientJoinedEvent} - Fired when a client joins the session.\n * - {@link ClientLeftEvent} - Fired when a client leaves the session.\n * - {@link InactivityWarningEvent} - Fired when the client is inactive for a certain amount of time.\n * - {@link ActivityDetectedEvent} - Fired when the client is active again.\n * - {@link DisconnectedEvent} - Fired when the session is disconnected.\n *\n * See: {@link SessionEvents} for more details.\n *\n * @category Session\n */\nexport class Session<ClientType extends Client = Client>\n    extends TypedEventTarget<SessionEvents<ClientType>>\n    implements SessionInterface\n{\n    /**\n     * @internal\n     *\n     * Create a new session instance of the class this is called on.\n     */\n    static _make<T extends SessionClass>(\n        this: T,\n        params: { token: string; session_info: SessionInfo; created: boolean; is_guest?: boolean },\n    ): InstanceOf<T> {\n        // `this` is the concrete (sub)class; its constructor is protected, so it exposes no\n        // structural construct signature \u2014 cast once, here.\n        const Ctor = this as unknown as new (params: {\n            token: string;\n            session_info: SessionInfo;\n            created: boolean;\n            is_guest?: boolean;\n        }) => InstanceOf<T>;\n        return new Ctor(params);\n    }\n\n    /**\n     * Create a new session.\n     *\n     * @param params\n     * @param params.scene_id - The unique identifier of the scene the session will launch.\n     * @param params.token - The authentication token. This token must have at least read access to the scene.\n     * @param params.is_transient - Whether the session is transient. Transient sessions are temporary and changes are not saved.\n     *\n     * @returns A promise that resolves to the created session.\n     *\n     * @throws Error if the session could not be created.\n     */\n    static async create<T extends SessionClass>(\n        this: T,\n        {\n            scene_id,\n            token,\n            is_transient,\n            options,\n        }: {\n            scene_id: UUID;\n            token: string;\n            is_transient?: boolean;\n            options?: Record<string, boolean>;\n        },\n    ): Promise<InstanceOf<T>> {\n        const res = await fetch(`${getApiUrl()}/sessions`, {\n            method: \"POST\",\n            body: JSON.stringify({ scene_id, is_transient, options }),\n            headers: {\n                \"Content-Type\": \"application/json\",\n                user_token: token,\n            },\n        });\n\n        if (!res.ok) {\n            throw new Error(\"Error when creating session\");\n        }\n\n        const session_info = (await res.json()) as { session_id: UUID };\n        return this._make({\n            token,\n            session_info: {\n                ...session_info,\n                scene_id,\n                is_transient_session: is_transient ?? false,\n            },\n            created: true,\n        });\n    }\n\n    /**\n     * Create a session instance from a session info, without creating or joining anything server-side.\n     *\n     * @param params\n     * @param params.session_info - The information about the session.\n     * @param params.token - The authentication token.\n     *\n     * @returns The session instance.\n     */\n    static createFromInfo<T extends SessionClass>(\n        this: T,\n        { session_info, token }: { session_info: SessionInfo; token: string },\n    ): InstanceOf<T> {\n        return this._make({ token, session_info, created: false });\n    }\n\n    /**\n     * List all existing sessions running the specified scene.\n     *\n     * @param params\n     * @param params.scene_id - The unique identifier of the scene the sessions must be running.\n     * @param params.token - The authentication token.\n     *\n     * @returns A promise that resolves to the list of sessions running the scene, or to an empty\n     * list if the sessions could not be listed (a non-OK API response is treated as a legitimate\n     * impossibility to list the sessions of the scene, not as an error).\n     */\n    static async list({ scene_id, token }: { scene_id: UUID; token: string }): Promise<Array<SessionInfo>> {\n        const res = await fetch(`${getApiUrl()}/sessions?filters[scene_id]=${scene_id}`, {\n            method: \"GET\",\n            headers: {\n                user_token: token,\n            },\n        });\n\n        if (!res.ok) {\n            console.debug(`Could not list sessions for scene ${scene_id}: ${res.status}.`);\n            return [];\n        }\n\n        return (await res.json()) as Array<SessionInfo>;\n    }\n\n    /**\n     * Find an existing session running the specified scene.\n     *\n     * @param params\n     * @param params.scene_id - The unique identifier of the scene the session must be running.\n     * @param params.token - The authentication token. This token must have at least read access to the scene.\n     * @param params.session_selector - A callback that selects a session from a list of candidate sessions.\n     *\n     * @returns A promise that resolves to the found session, or null if no session was found:\n     * no session is running the scene, the session selector selected none, or the sessions could\n     * not be listed (see {@link Session.list}).\n     */\n    static async find<T extends SessionClass>(\n        this: T,\n        {\n            scene_id,\n            token,\n            session_selector,\n        }: {\n            scene_id: UUID;\n            token: string;\n            session_selector: SessionSelector;\n        },\n    ): Promise<InstanceOf<T> | null> {\n        const sessions = await Session.list({ scene_id, token });\n\n        if (sessions.length === 0) {\n            return null;\n        }\n\n        const session_info = session_selector({ sessions });\n        if (!session_info) {\n            return null;\n        }\n\n        return this._make({ token, session_info, created: false });\n    }\n\n    /**\n     * Find an existing session by its unique identifier.\n     *\n     * @param params\n     * @param params.session_id - The unique identifier of the session to find.\n     * @param params.token - The authentication token. This token must have at least read access to the scene.\n     *\n     * @returns A promise that resolves to the found session or null if no session was found.\n     */\n    static async findById<T extends SessionClass>(\n        this: T,\n        {\n            session_id,\n            token,\n        }: {\n            session_id: UUID;\n            token: string;\n        },\n    ): Promise<InstanceOf<T> | null> {\n        const res = await fetch(`${getApiUrl()}/sessions/${session_id}`, {\n            method: \"GET\",\n            headers: {\n                user_token: token,\n            },\n        });\n\n        if (!res.ok) {\n            console.debug(`Could not find session with id ${session_id}.`);\n            return null;\n        }\n\n        const session_info = (await res.json()) as SessionInfo;\n        return this._make({ token, session_info, created: false });\n    }\n\n    /**\n     * Find the session tied to a guest token.\n     *\n     * @param params\n     * @param params.guest_token - The guest token generated by the [Generate Guest Token](https://docs.3dverse.com/references/api/generate-guest-token) endpoint.\n     *\n     * @returns A promise that resolves to the found session or null if no session was found.\n     */\n    static async findByGuestToken<T extends SessionClass>(\n        this: T,\n        { guest_token }: { guest_token: string },\n    ): Promise<InstanceOf<T> | null> {\n        const res = await fetch(`${getApiUrl()}/sessions`, {\n            method: \"GET\",\n            headers: { guest_token },\n        });\n\n        if (!res.ok) {\n            throw new Error(\"Could not find session as guest, guest token might be expired\");\n        }\n\n        const [session_info] = (await res.json()) as [SessionInfo];\n        return this._make({ token: guest_token, session_info, created: false, is_guest: true });\n    }\n\n    /**\n     * The information about the session.\n     */\n    public readonly info: SessionInfo;\n\n    /**\n     * Whether the session has been created or joined by the current client.\n     */\n    public readonly has_been_created: boolean;\n\n    /**\n     * The id of the client that is currently connected to the session.\n     */\n    public client_id: UUID | null = null;\n\n    /**\n     * The authentication token.\n     */\n    public readonly token: string;\n\n    /**\n     * Whether the authentication token is a guest token.\n     */\n    public readonly is_guest: boolean = false;\n\n    /**\n     * The address of the gateway the session is running on.\n     */\n    #gateway_url: string | null = null;\n\n    /**\n     * The session key used as an authentication method on the gateway.\n     */\n    #session_key: string | null = null;\n\n    /**\n     * A map of all connected clients\n     */\n    #clients: Map<UUID, ClientType> = new Map<UUID, ClientType>();\n\n    /**\n     * The unique identifier of the scene the session is running.\n     */\n    get scene_id(): UUID {\n        return this.info.scene_id;\n    }\n\n    /**\n     * The unique identifier of the session.\n     */\n    get session_id(): UUID {\n        return this.info.session_id;\n    }\n\n    /**\n     * The unique identifiers of all clients connected to the session.\n     */\n    get client_ids(): Array<UUID> {\n        return Array.from(this.#clients.keys());\n    }\n\n    /**\n     * All the clients connected to the session.\n     */\n    get clients(): Array<ClientType> {\n        return Array.from(this.#clients.values());\n    }\n\n    /**\n     * All the clients connected to the session except the current client.\n     */\n    get other_clients(): Array<ClientType> {\n        return Array.from(this.#clients.values()).filter(c => c.id !== this.client_id);\n    }\n\n    /**\n     * The current client connected to the session.\n     */\n    get current_client(): ClientType | null {\n        return this.client_id ? (this.#clients.get(this.client_id) ?? null) : null;\n    }\n\n    /**\n     * @internal\n     * The address of the gateway the session is running on.\n     */\n    get gateway_url(): string | null {\n        return this.#gateway_url;\n    }\n\n    /**\n     * @internal\n     * The session key used as an authentication method on the gateway.\n     */\n    get session_key(): string | null {\n        return this.#session_key;\n    }\n\n    /**\n     * Authentication headers to be used in requests to the API.\n     */\n    get #authentication_headers(): Record<string, string> {\n        return this.is_guest ? { guest_token: this.token } : { user_token: this.token };\n    }\n\n    /**\n     * Create a new session.\n     *\n     * @param params\n     * @param params.token - The authentication token. This token must have at least read access to the scene.\n     * @param params.session_info - The information about the session.\n     * @param params.created - Whether the session has been created or found by the current client.\n     */\n    protected constructor({\n        token,\n        session_info,\n        created,\n        is_guest = false,\n    }: {\n        token: string;\n        session_info: SessionInfo;\n        created: boolean;\n        is_guest?: boolean;\n    }) {\n        super();\n\n        this.token = token;\n        this.info = session_info;\n        this.has_been_created = created;\n        this.is_guest = is_guest;\n    }\n\n    /**\n     * Whether the session is joinable.\n     */\n    isJoinable(): boolean {\n        return this.#gateway_url !== null && this.#session_key !== null;\n    }\n\n    /**\n     * @internal\n     * Get the session key to be used as an authentication method on the gateway.\n     */\n    async registerClient({ is_headless }: { is_headless: boolean }): Promise<void> {\n        const res = await fetch(`${getApiUrl()}/sessions/${this.session_id}/clients`, {\n            method: \"POST\",\n            headers: { ...this.#authentication_headers, \"Content-Type\": \"application/json\" },\n            body: JSON.stringify({ is_headless }),\n        });\n\n        if (!res.ok) {\n            throw new Error(\"Error when registering client to session\");\n        }\n\n        const { session_token, endpoint_info } = (await res.json()) as {\n            session_token: string;\n            endpoint_info: { ip: string; port: number; ssl_port: number };\n        };\n\n        // Gateways that don't support secure connections set their SSL port to 0.\n        const protocol = endpoint_info.ssl_port ? \"wss\" : \"ws\";\n        const port = endpoint_info.ssl_port !== 0 ? endpoint_info.ssl_port : endpoint_info.port;\n        this.#gateway_url = `${protocol}://${endpoint_info.ip}:${port}`;\n        this.#session_key = session_token;\n    }\n\n    /**\n     * @internal\n     * Close the session.\n     */\n    async close(): Promise<void> {\n        await fetch(`${getApiUrl()}/sessions/${this.session_id}`, {\n            method: \"DELETE\",\n            headers: this.#authentication_headers,\n        });\n    }\n\n    /**\n     * Get a client by its unique identifier.\n     *\n     * @param params\n     * @param params.client_id - The unique identifier of the client to look for.\n     *\n     * @returns The client or null if the client is not found.\n     */\n    getClient = ({ client_id }: { client_id: UUID }): ClientType | null => {\n        return this.#clients.get(client_id) ?? null;\n    };\n\n    /**\n     * Evict a client from the session.\n     *\n     * The client will be disconnected.\n     *\n     * The token used to create the session must have manage access to the scene.\n     *\n     * Note that nothing prevents the client from reconnecting while the session is still running.\n     *\n     * @param params\n     * @param params.client - The client to evict, either a {@link Client} object or the unique identifier of the client.\n     *\n     * @returns A promise that resolves to true if the client was evicted, false otherwise.\n     */\n    async evictClient({ client }: { client: Client | UUID }): Promise<boolean> {\n        const client_id = client instanceof Client ? client.id : client;\n        const res = await fetch(`${getApiUrl()}/sessions/${this.session_id}/clients/${client_id}`, {\n            method: \"DELETE\",\n            headers: this.#authentication_headers,\n        });\n\n        return res.ok;\n    }\n\n    /**\n     * @internal\n     */\n    _onDisconnected = (e: Events.DisconnectedEvent): void => {\n        this._dispatchEvent(new DisconnectedEvent({ reason: e.reason }));\n    };\n\n    /**\n     * @internal\n     */\n    _onInactivityWarning = (e: Events.InactivityWarningEvent): void => {\n        this._dispatchEvent(\n            new InactivityWarningEvent({ seconds_remaining: e.seconds_remaining, reset_timer: e.resetTimer }),\n        );\n    };\n\n    /**\n     * @internal\n     */\n    _onActivityDetected = (_: Events.ActivityDetectedEvent): void => {\n        this._dispatchEvent(new ActivityDetectedEvent());\n    };\n\n    /**\n     * @internal\n     */\n    _onClientJoined({ core, client_info }: { core: LivelinkInstance; client_info: ClientInfo }): void {\n        console.debug(\"--- Client joined\", client_info);\n        const client = this._instantiateClient({ core, client_info, session_id: this.session_id });\n        this.#clients.set(client.id, client);\n        if (client.id !== this.client_id) {\n            this._dispatchEvent(new ClientJoinedEvent({ client }));\n        }\n    }\n\n    /**\n     * @internal\n     */\n    _onClientLeft({ client_id }: { client_id: UUID }): void {\n        const client = this.#clients.get(client_id);\n        if (client) {\n            this.#clients.delete(client_id);\n            this._dispatchEvent(new ClientLeftEvent({ client }));\n        }\n    }\n\n    /**\n     * @internal\n     */\n    _instantiateClient({\n        core,\n        client_info,\n        session_id,\n    }: {\n        core: LivelinkInstance;\n        client_info: ClientInfo;\n        session_id: UUID;\n    }): ClientType {\n        const client = new Client({\n            core,\n            client_info,\n            session_id,\n        });\n        return client as ClientType;\n    }\n}\n", "/**\n * DO NOT EDIT THIS FILE MANUALLY.\n * This file has been generated automatically from ftl-schemas\n */\nimport type { Components, ComponentName, ComponentType, EntityCore } from \"@3dverse/livelink.core\";\nimport { TypedEventTarget } from \"../sources/TypedEventTarget\";\nimport { EntityEvents } from \"../sources/scene/EntityEvents\";\n\n/**\n * If specified as a component value, the default values will be applied.\n * Note that the component default values might change on future versions of their schema.\n *\n * @category Scene\n */\nexport type DefaultValue = \"default\";\n\n/**\n * Storage core shared by every livelink client SDK entity with generated component accessor layer.\n * \n * It owns the raw component record ({@link EntityCore}) and exposes the minimal protected primitives\n * to read/write it. It intentionally does NOT impose a component-access paradigm nor any entity\n * behaviour: the concrete {@link Entity} builds the public API (component accessors, dirty tracking,\n * scripts, \u2026) on top of these primitives.\n * \n * The generated component layer exposes one getter per component returning the live, mutable component object\n * stored on the paradigm-neutral. Reading a component returns the actual stored value, so it may be mutated in place;\n * mutations are not auto-detected \u2014 flag them explicitly with {@link Entity.updateComponent} / {@link Entity.updateComponents}. \n * Use {@link Entity.deleteComponent} to remove a component. The generated layer also exposes one setter per component \n * that delegates to the core's {@link Entity.updateComponent} & {@link Entity.deleteComponent}.\n * \n * @category Scene\n */\nexport abstract class EntityComponents extends TypedEventTarget<EntityEvents> {\n    /**\n     * @internal\n     */\n    public static readonly component_names: Array<ComponentName> = [\n        \"animation_controller\",\n        \"animation_sequence_controller\",\n        \"bone\",\n        \"box_geometry\",\n        \"camera\",\n        \"capsule_geometry\",\n        \"character_controller\",\n        \"collision_geometry_ref\",\n        \"constraint\",\n        \"constraint_actuator\",\n        \"culling_geometry\",\n        \"custom_lens\",\n        \"cylinder_geometry\",\n        \"debug_name\",\n        \"decal_projector\",\n        \"environment\",\n        \"joint\",\n        \"label\",\n        \"lineage\",\n        \"local_aabb\",\n        \"material\",\n        \"material_ref\",\n        \"measure\",\n        \"mesh_ref\",\n        \"morph_targets\",\n        \"orthographic_lens\",\n        \"overrider\",\n        \"perspective_lens\",\n        \"physics_material\",\n        \"plane_geometry\",\n        \"point_cloud_ref\",\n        \"point_light\",\n        \"reflection_probe\",\n        \"rigid_body\",\n        \"rigid_body_actuator\",\n        \"scene_ref\",\n        \"script_map\",\n        \"shadow_caster\",\n        \"skeleton_ref\",\n        \"sound_ref\",\n        \"sphere_geometry\",\n        \"spline\",\n        \"spot_light\",\n        \"tags\",\n        \"vehicle_controller\",\n        \"volume_filter\",\n        \"volume_material_ref\",\n        \"volume_ref\",\n    ];\n\n    /**\n     *\n     */\n    #core: EntityCore;\n\n    /**\n     * @internal\n     */\n    get _core(): EntityCore {\n        return this.#core;\n    }\n\n    /**\n     *\n     */\n    get euid(): Readonly<Components.Euid> {\n        return this.#core.euid;\n    }\n\n    /**\n     * Drives skeletal animation using an Animation Graph and Animation Set; animates descendant skinned meshes whose skeletons are compatible with the set.\n     */\n    get animation_controller() : Components.AnimationController | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"animation_controller\" }) as Components.AnimationController | undefined;\n    }\n        \n    set animation_controller(value: Partial<Components.AnimationController> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"animation_controller\", value});\n    }\n\n    /**\n     * Controls playback of an Animation Sequence; assigns tracks to entities.\n     */\n    get animation_sequence_controller() : Components.AnimationSequenceController | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"animation_sequence_controller\" }) as Components.AnimationSequenceController | undefined;\n    }\n        \n    set animation_sequence_controller(value: Partial<Components.AnimationSequenceController> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"animation_sequence_controller\", value});\n    }\n\n    /**\n     * Associates this entity with a bone in a skeleton (for attachments and transforms).\n     */\n    get bone() : Components.Bone | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"bone\" }) as Components.Bone | undefined;\n    }\n        \n    set bone(value: Partial<Components.Bone> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"bone\", value});\n    }\n\n    /**\n     * Box geometry.\n     */\n    get box_geometry() : Components.BoxGeometry | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"box_geometry\" }) as Components.BoxGeometry | undefined;\n    }\n        \n    set box_geometry(value: Partial<Components.BoxGeometry> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"box_geometry\", value});\n    }\n\n    /**\n     * Virtual camera.\n     */\n    get camera() : Components.Camera | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"camera\" }) as Components.Camera | undefined;\n    }\n        \n    set camera(value: Partial<Components.Camera> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"camera\", value});\n    }\n\n    /**\n     * Capsule geometry.\n     */\n    get capsule_geometry() : Components.CapsuleGeometry | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"capsule_geometry\" }) as Components.CapsuleGeometry | undefined;\n    }\n        \n    set capsule_geometry(value: Partial<Components.CapsuleGeometry> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"capsule_geometry\", value});\n    }\n\n    /**\n     * Kinematic character controller for collision-constrained movement without a rigid body. Uses tuned collision handling for responsive control.\n     */\n    get character_controller() : Components.CharacterController | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"character_controller\" }) as Components.CharacterController | undefined;\n    }\n        \n    set character_controller(value: Partial<Components.CharacterController> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"character_controller\", value});\n    }\n\n    /**\n     * Reference to a collision geometry asset used by physics.\n     */\n    get collision_geometry_ref() : Components.CollisionGeometryRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"collision_geometry_ref\" }) as Components.CollisionGeometryRef | undefined;\n    }\n        \n    set collision_geometry_ref(value: Partial<Components.CollisionGeometryRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"collision_geometry_ref\", value});\n    }\n\n    /**\n     * 6-DoF constraint built on a Joint. Defaults to fixed; selectively unlock translation and rotation on X/Y/Z and configure limits and springs.\n     */\n    get constraint() : Components.Constraint | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"constraint\" }) as Components.Constraint | undefined;\n    }\n        \n    set constraint(value: Partial<Components.Constraint> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"constraint\", value});\n    }\n\n    /**\n     * Drives a Constraint toward target position/orientation and velocities using configurable stiffness, damping, and force limits.\n     */\n    get constraint_actuator() : Components.ConstraintActuator | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"constraint_actuator\" }) as Components.ConstraintActuator | undefined;\n    }\n        \n    set constraint_actuator(value: Partial<Components.ConstraintActuator> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"constraint_actuator\", value});\n    }\n\n    /**\n     * Enables culling using a simple analytic shape. Add alongside a geometry component (box, cylinder, plane, sphere).\n     */\n    get culling_geometry() : Components.CullingGeometry | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"culling_geometry\" }) as Components.CullingGeometry | undefined;\n    }\n        \n    set culling_geometry(value: Partial<Components.CullingGeometry> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"culling_geometry\", value});\n    }\n\n    /**\n     * Custom projection lens using an explicit projection matrix.\n     */\n    get custom_lens() : Components.CustomLens | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"custom_lens\" }) as Components.CustomLens | undefined;\n    }\n        \n    set custom_lens(value: Partial<Components.CustomLens> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"custom_lens\", value});\n    }\n\n    /**\n     * Cylinder geometry.\n     */\n    get cylinder_geometry() : Components.CylinderGeometry | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"cylinder_geometry\" }) as Components.CylinderGeometry | undefined;\n    }\n        \n    set cylinder_geometry(value: Partial<Components.CylinderGeometry> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"cylinder_geometry\", value});\n    }\n\n    /**\n     * Human-readable name of the entity.\n     */\n    get debug_name() : Components.DebugName | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"debug_name\" }) as Components.DebugName | undefined;\n    }\n        \n    set debug_name(value: Partial<Components.DebugName> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"debug_name\", value});\n    }\n\n    /**\n     * Projects a material onto scene surfaces within the projector's box volume.\n     */\n    get decal_projector() : Components.DecalProjector | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"decal_projector\" }) as Components.DecalProjector | undefined;\n    }\n        \n    set decal_projector(value: Partial<Components.DecalProjector> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"decal_projector\", value});\n    }\n\n    /**\n     * Scene environment settings, including skybox background and precomputed image-based lighting (IBL). This component is only applied in the scene where this entity lives, it is discarded for subscenes.\n     */\n    get environment() : Components.Environment | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"environment\" }) as Components.Environment | undefined;\n    }\n        \n    set environment(value: Partial<Components.Environment> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"environment\", value});\n    }\n\n    /**\n     * Base joint connecting two bodies. By default locks relative position and orientation between constrainer and constrainee.\n     */\n    get joint() : Components.Joint | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"joint\" }) as Components.Joint | undefined;\n    }\n        \n    set joint(value: Partial<Components.Joint> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"joint\", value});\n    }\n\n    /**\n     * Displays an editor-only label in the 3D view.\n     */\n    get label() : Components.Label | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"label\" }) as Components.Label | undefined;\n    }\n        \n    set label(value: Partial<Components.Label> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"label\", value});\n    }\n\n    /**\n     * Records the entity's lineage through linkers and parentage.\n     */\n    get lineage() : Components.Lineage | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"lineage\" }) as Components.Lineage | undefined;\n    }\n        \n    set lineage(value: Partial<Components.Lineage> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"lineage\", value});\n    }\n\n    /**\n     * Local-space axis-aligned bounding box.\n     */\n    get local_aabb() : Components.LocalAabb | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"local_aabb\" }) as Components.LocalAabb | undefined;\n    }\n        \n    set local_aabb(value: Partial<Components.LocalAabb> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"local_aabb\", value});\n    }\n\n    /**\n     * Assigns a shader to the entity's mesh and provides its input values and specialization constants.\n     */\n    get material() : Components.Material | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"material\" }) as Components.Material | undefined;\n    }\n        \n    set material(value: Partial<Components.Material> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"material\", value});\n    }\n\n    /**\n     * Reference to a material to use for rendering.\n     */\n    get material_ref() : Components.MaterialRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"material_ref\" }) as Components.MaterialRef | undefined;\n    }\n        \n    set material_ref(value: Partial<Components.MaterialRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"material_ref\", value});\n    }\n\n    /**\n     * Displays editor-only measurement annotations in the 3D view.\n     */\n    get measure() : Components.Measure | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"measure\" }) as Components.Measure | undefined;\n    }\n        \n    set measure(value: Partial<Components.Measure> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"measure\", value});\n    }\n\n    /**\n     * Reference to a mesh to render (with submesh selection).\n     */\n    get mesh_ref() : Components.MeshRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"mesh_ref\" }) as Components.MeshRef | undefined;\n    }\n        \n    set mesh_ref(value: Partial<Components.MeshRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"mesh_ref\", value});\n    }\n\n    /**\n     * Contains weights assigned to morph targets of the mesh referred to by the entity's mesh_ref.\n     */\n    get morph_targets() : Components.MorphTargets | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"morph_targets\" }) as Components.MorphTargets | undefined;\n    }\n        \n    set morph_targets(value: Partial<Components.MorphTargets> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"morph_targets\", value});\n    }\n\n    /**\n     * Orthographic projection lens with configurable zoom and depth range.\n     */\n    get orthographic_lens() : Components.OrthographicLens | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"orthographic_lens\" }) as Components.OrthographicLens | undefined;\n    }\n        \n    set orthographic_lens(value: Partial<Components.OrthographicLens> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"orthographic_lens\", value});\n    }\n\n    /**\n     * Overrides an entity from a subscene: mark for deletion, replace components, or detach specific components.\n     */\n    get overrider() : Components.Overrider | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"overrider\" }) as Components.Overrider | undefined;\n    }\n        \n    set overrider(value: Partial<Components.Overrider> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"overrider\", value});\n    }\n\n    /**\n     * Perspective projection lens with vertical field of view and near/far clipping planes.\n     */\n    get perspective_lens() : Components.PerspectiveLens | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"perspective_lens\" }) as Components.PerspectiveLens | undefined;\n    }\n        \n    set perspective_lens(value: Partial<Components.PerspectiveLens> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"perspective_lens\", value});\n    }\n\n    /**\n     * Physical surface properties used for contact: friction, restitution, optional contact modification, and trigger mode.\n     */\n    get physics_material() : Components.PhysicsMaterial | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"physics_material\" }) as Components.PhysicsMaterial | undefined;\n    }\n        \n    set physics_material(value: Partial<Components.PhysicsMaterial> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"physics_material\", value});\n    }\n\n    /**\n     * Infinite plane geometry.\n     */\n    get plane_geometry() : Components.PlaneGeometry | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"plane_geometry\" }) as Components.PlaneGeometry | undefined;\n    }\n        \n    set plane_geometry(value: Partial<Components.PlaneGeometry> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"plane_geometry\", value});\n    }\n\n    /**\n     * Reference to a point cloud.\n     */\n    get point_cloud_ref() : Components.PointCloudRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"point_cloud_ref\" }) as Components.PointCloudRef | undefined;\n    }\n        \n    set point_cloud_ref(value: Partial<Components.PointCloudRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"point_cloud_ref\", value});\n    }\n\n    /**\n     * Omnidirectional light source with physically based intensity and falloff. Acts as a point light by default; enable isDirectional to emit parallel rays. Attach a Spot Light component to add a cone cutoff. Can optionally drive the atmosphere sun direction.\n     */\n    get point_light() : Components.PointLight | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"point_light\" }) as Components.PointLight | undefined;\n    }\n        \n    set point_light(value: Partial<Components.PointLight> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"point_light\", value});\n    }\n\n    /**\n     * Omnidirectional reflection probe that captures the local environment into a cubemap for specular reflections (IBL).\n     */\n    get reflection_probe() : Components.ReflectionProbe | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"reflection_probe\" }) as Components.ReflectionProbe | undefined;\n    }\n        \n    set reflection_probe(value: Partial<Components.ReflectionProbe> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"reflection_probe\", value});\n    }\n\n    /**\n     * Rigid body parameters for dynamic simulation (mass, damping, limits, CCD, and kinematic/gravity behavior).\n     */\n    get rigid_body() : Components.RigidBody | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"rigid_body\" }) as Components.RigidBody | undefined;\n    }\n        \n    set rigid_body(value: Partial<Components.RigidBody> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"rigid_body\", value});\n    }\n\n    /**\n     * Frame-by-frame actuator for rigid bodies. Sets velocities and applies forces/impulses/torques; values are reset each frame.\n     */\n    get rigid_body_actuator() : Components.RigidBodyActuator | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"rigid_body_actuator\" }) as Components.RigidBodyActuator | undefined;\n    }\n        \n    set rigid_body_actuator(value: Partial<Components.RigidBodyActuator> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"rigid_body_actuator\", value});\n    }\n\n    /**\n     * Reference to a subscene (linker); used to compose scenes.\n     */\n    get scene_ref() : Components.SceneRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"scene_ref\" }) as Components.SceneRef | undefined;\n    }\n        \n    set scene_ref(value: Partial<Components.SceneRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"scene_ref\", value});\n    }\n\n    /**\n     * Holds a set of script elements keyed by UUID.\n     */\n    get script_map() : Components.ScriptMap | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"script_map\" }) as Components.ScriptMap | undefined;\n    }\n        \n    set script_map(value: Partial<Components.ScriptMap> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"script_map\", value});\n    }\n\n    /**\n     * Enables a light to cast real-time shadows with configurable map resolution, depth range, and (for directional lights) cascades.\n     */\n    get shadow_caster() : Components.ShadowCaster | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"shadow_caster\" }) as Components.ShadowCaster | undefined;\n    }\n        \n    set shadow_caster(value: Partial<Components.ShadowCaster> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"shadow_caster\", value});\n    }\n\n    /**\n     * Reference to a skeleton asset for skinning and animation.\n     */\n    get skeleton_ref() : Components.SkeletonRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"skeleton_ref\" }) as Components.SkeletonRef | undefined;\n    }\n        \n    set skeleton_ref(value: Partial<Components.SkeletonRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"skeleton_ref\", value});\n    }\n\n    /**\n     * Reference to a sound asset with playback and spatialization controls.\n     */\n    get sound_ref() : Components.SoundRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"sound_ref\" }) as Components.SoundRef | undefined;\n    }\n        \n    set sound_ref(value: Partial<Components.SoundRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"sound_ref\", value});\n    }\n\n    /**\n     * Sphere geometry.\n     */\n    get sphere_geometry() : Components.SphereGeometry | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"sphere_geometry\" }) as Components.SphereGeometry | undefined;\n    }\n        \n    set sphere_geometry(value: Partial<Components.SphereGeometry> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"sphere_geometry\", value});\n    }\n\n    /**\n     * Displays an editor-only spline in the 3D view.\n     */\n    get spline() : Components.Spline | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"spline\" }) as Components.Spline | undefined;\n    }\n        \n    set spline(value: Partial<Components.Spline> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"spline\", value});\n    }\n\n    /**\n     * Adds a cone cutoff to a light, producing a spotlight. Requires a Point Light component for color/intensity and falloff.\n     */\n    get spot_light() : Components.SpotLight | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"spot_light\" }) as Components.SpotLight | undefined;\n    }\n        \n    set spot_light(value: Partial<Components.SpotLight> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"spot_light\", value});\n    }\n\n    /**\n     * Free-form tags used to group and filter entities.\n     */\n    get tags() : Components.Tags | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"tags\" }) as Components.Tags | undefined;\n    }\n        \n    set tags(value: Partial<Components.Tags> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"tags\", value});\n    }\n\n    /**\n     * Vehicle Controller parameters.\n     */\n    get vehicle_controller() : Components.VehicleController | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"vehicle_controller\" }) as Components.VehicleController | undefined;\n    }\n        \n    set vehicle_controller(value: Partial<Components.VehicleController> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"vehicle_controller\", value});\n    }\n\n    /**\n     * View filtering and display controls applied to the referenced volume.\n     */\n    get volume_filter() : Components.VolumeFilter | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"volume_filter\" }) as Components.VolumeFilter | undefined;\n    }\n        \n    set volume_filter(value: Partial<Components.VolumeFilter> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"volume_filter\", value});\n    }\n\n    /**\n     * Reference to the volume material used for shading and transfer functions.\n     */\n    get volume_material_ref() : Components.VolumeMaterialRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"volume_material_ref\" }) as Components.VolumeMaterialRef | undefined;\n    }\n        \n    set volume_material_ref(value: Partial<Components.VolumeMaterialRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"volume_material_ref\", value});\n    }\n\n    /**\n     * Reference to a volumetric dataset stored as a 3D texture (voxels).\n     */\n    get volume_ref() : Components.VolumeRef | undefined {\n        return this._unsafeGetComponentValue({ component_name: \"volume_ref\" }) as Components.VolumeRef | undefined;\n    }\n        \n    set volume_ref(value: Partial<Components.VolumeRef> | DefaultValue | undefined) {\n        this._setComponentValue({component_name: \"volume_ref\", value});\n    }\n\n    /**\n     *\n     */\n    constructor({ euid }: { euid: Components.Euid }) {\n        super();\n        this.#core = { euid };\n    }\n\n    /**\n     *\n     */\n    toJSON(): object {\n        const { euid, ...components } = this.#core;\n        return { euid: { value: euid.value }, ...components };\n    }\n\n    /**\n     * @internal\n     */\n    protected _unsafeSetComponentValue<_ComponentName extends ComponentName>({\n        component_name,\n        value,\n    }: {\n        component_name: _ComponentName;\n        value: ComponentType<_ComponentName> | undefined;\n    }): void {\n        //@ts-expect-error: sssh go back to sleep\n        this.#core[component_name] = value;\n    }\n\n    /**\n     * @internal\n     */\n    protected _unsafeGetComponentValue<_ComponentName extends ComponentName>({\n        component_name,\n    }: {\n        component_name: _ComponentName;\n    }): ComponentType<_ComponentName> | undefined {\n        //@ts-expect-error: sssh go back to sleep\n        return this.#core[component_name];\n    }\n\n    /**\n     * @internal\n     */\n    protected abstract _setComponentValue<_ComponentName extends ComponentName>({\n        component_name,\n        value,\n    }: {\n        component_name: _ComponentName;\n        value: Partial<ComponentType<_ComponentName>> | DefaultValue | undefined;\n    }): void;\n}\n", "import type { ComponentName } from \"@3dverse/livelink.core\";\nimport { EditionEvent } from \"../EditionEvent\";\nimport { Client } from \"../session/Client\";\n\n/**\n * The event that is fired when an entity is updated, either by adding, modifying or removing\n * components.\n *\n * Dispatched by {@link Entity} as `on-entity-updated`.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class EntityUpdatedEvent extends EditionEvent {\n    /**\n     * @deprecated\n     *\n     * Use {@link EditionEvent.isLocal} and {@link EditionEvent.isExternal} instead.\n     *\n     * The source of the change.\n     * - \"external\": The change was made by another user from another instance of the app or even another app.\n     * - \"internal\": The change was made by the current app.\n     */\n    public readonly change_source: \"local\" | \"external\";\n\n    /**\n     * The names of the components that were added.\n     */\n    public readonly new_components: Array<ComponentName>;\n\n    /**\n     * The names of the components that were updated.\n     */\n    public readonly updated_components: Array<ComponentName>;\n\n    /**\n     * The names of the components that were removed.\n     */\n    public readonly deleted_components: Array<ComponentName>;\n\n    /**\n     *\n     */\n    isAnyComponentDirty({ components }: { components: Array<ComponentName> }): boolean {\n        return (\n            this.new_components.some(component => components.includes(component)) ||\n            this.updated_components.some(component => components.includes(component)) ||\n            this.deleted_components.some(component => components.includes(component))\n        );\n    }\n\n    /**\n     * @internal\n     */\n    constructor({\n        emitter,\n        new_components,\n        updated_components,\n        deleted_components,\n    }: {\n        emitter: Client | null;\n        new_components: Array<ComponentName>;\n        updated_components: Array<ComponentName>;\n        deleted_components: Array<ComponentName>;\n    }) {\n        super(\"on-entity-updated\", emitter);\n        this.change_source = emitter ? \"external\" : \"local\";\n        this.new_components = new_components;\n        this.updated_components = updated_components;\n        this.deleted_components = deleted_components;\n    }\n\n    /**\n     * Checks if the event includes any of the specified components, whether they were added, updated or removed.\n     */\n    includes(...components: ComponentName[]): boolean {\n        return components.some(\n            component =>\n                this.new_components.includes(component) ||\n                this.updated_components.includes(component) ||\n                this.deleted_components.includes(component),\n        );\n    }\n}\n\n/**\n * The event that is fired when the entity visibility changes.\n *\n * Dispatched by {@link Entity} as `on-entity-visibility-changed`.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class EntityVisibilityChangedEvent extends Event {\n    /**\n     * The source of the change.\n     * - \"external\": The visibility change was made by another user from another instance of the app or even another app.\n     * - \"internal\": The visibility change was made by the current app.\n     */\n    public readonly change_source: \"local\" | \"external\";\n\n    /**\n     * The new visibility state of the entity.\n     */\n    public readonly is_visible: boolean;\n\n    /**\n     * @internal\n     */\n    constructor({ change_source, is_visible }: { change_source: \"local\" | \"external\"; is_visible: boolean }) {\n        super(\"on-entity-visibility-changed\");\n        this.change_source = change_source;\n        this.is_visible = is_visible;\n    }\n}\n\n/**\n * The events dispatched by {@link Entity}.\n *\n * @event\n * @category Scene / Events\n */\nexport type EntityEvents = {\n    \"on-entity-updated\": EntityUpdatedEvent;\n    \"on-entity-visibility-changed\": EntityVisibilityChangedEvent;\n};\n", "import { RTID, ScriptDataObject } from \"@3dverse/livelink.core\";\nimport type { Entity } from \"./Entity\";\nimport type { SceneScriptEventInterface } from \"./Scene\";\n\n/**\n * The event that is fired when an entity receives a script event.\n *\n * Dispatched by the entity the script targets \u2014 listen with its `addScriptEventListener` method,\n * whose `onReceived` callback takes this event. The event name is the script event's own\n * `<event_map_id>/<event_name>` id, not a fixed key.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class ScriptEventReceived extends Event {\n    /**\n     * The entity that emitted the script event.\n     */\n    readonly emitter_entity: Entity | null;\n\n    /**\n     * The data object associated with the script event.\n     */\n    readonly data_object: ScriptDataObject;\n\n    /**\n     * @internal\n     */\n    constructor({\n        event_name,\n        emitter_entity,\n        data_object,\n    }: {\n        event_name: string;\n        emitter_entity: Entity | null;\n        data_object: ScriptDataObject;\n    }) {\n        super(event_name);\n        this.emitter_entity = emitter_entity;\n        this.data_object = data_object;\n    }\n}\n\n/**\n * The event that is fired when an entity emits a script event.\n *\n * Dispatched by the emitting entity \u2014 listen with its `addScriptEventListener` method, whose\n * `onEmitted` callback takes this event. The event name is the script event's own\n * `<event_map_id>/<event_name>` id, not a fixed key.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class ScriptEventEmitted extends Event {\n    /**\n     * The entity that emitted the script event.\n     */\n    readonly emitter_entity: Entity;\n\n    /**\n     * The data object associated with the script event.\n     */\n    readonly data_object: ScriptDataObject;\n\n    /**\n     *\n     */\n    #scene: SceneScriptEventInterface;\n\n    /**\n     *\n     */\n    #target_rtids: Array<RTID>;\n\n    /**\n     *\n     */\n    #target_entities: Promise<Array<Entity | null>> | null = null;\n\n    /**\n     * The entities that are targeted by the script event.\n     * @returns A promise that resolves to an array of entities or null if the entity could not be found.\n     */\n    get target_entities(): Promise<Array<Entity | null>> {\n        if (!this.#target_entities) {\n            this.#target_entities = Promise.all(\n                this.#target_rtids.map(entity_rtid => this.#scene._findEntity({ entity_rtid })),\n            );\n        }\n        return this.#target_entities;\n    }\n\n    /**\n     * @internal\n     */\n    constructor({\n        scene,\n        event_name,\n        emitter_entity,\n        target_rtids,\n        data_object,\n    }: {\n        scene: SceneScriptEventInterface;\n        event_name: string;\n        emitter_entity: Entity;\n        target_rtids: Array<RTID>;\n        data_object: ScriptDataObject;\n    }) {\n        super(event_name);\n        this.#scene = scene;\n        this.emitter_entity = emitter_entity;\n        this.#target_rtids = target_rtids;\n        this.data_object = data_object;\n    }\n}\n\n/**\n * @internal\n * @event\n * @category Scene / Events\n */\nexport type ScriptEvents<T> = {\n    [event_id: string]: T;\n};\n", "import { copySign } from \".\";\nimport type { Quat, Vec3 } from \"@3dverse/livelink.core\";\n\n/**\n * @internal\n */\nexport function quaternionToEuler([x, y, z, w]: Quat): Vec3 {\n    const euler = { roll: 0.0, pitch: 0.0, yaw: 0.0 };\n    const q = { x, y, z, w };\n\n    // roll (x-axis rotation)\n    const sinr_cosp = +2.0 * (q.w * q.x + q.y * q.z);\n    const cosr_cosp = +1.0 - 2.0 * (q.x * q.x + q.y * q.y);\n    euler.roll = Math.atan2(sinr_cosp, cosr_cosp);\n\n    // pitch (y-axis rotation)\n    const sinp = +2.0 * (q.w * q.y - q.z * q.x);\n    if (Math.abs(sinp) >= 1) {\n        euler.pitch = copySign(Math.PI / 2, sinp); // use 90 degrees if out of range: ;\n    } else {\n        euler.pitch = Math.asin(sinp);\n    }\n\n    // yaw (z-axis rotation)\n    const siny_cosp = +2.0 * (q.w * q.z + q.x * q.y);\n    const cosy_cosp = +1.0 - 2.0 * (q.y * q.y + q.z * q.z);\n    euler.yaw = Math.atan2(siny_cosp, cosy_cosp);\n\n    return [euler.roll, euler.pitch, euler.yaw].map(radian => (radian * 180.0) / Math.PI) as Vec3;\n}\n\n/**\n * @internal\n */\nexport function quaternionFromEuler(eulers: Vec3): Quat {\n    const [roll, pitch, yaw] = eulers.map(degree => (degree * Math.PI) / 180.0);\n\n    const cy = Math.cos(yaw / 2);\n    const sy = Math.sin(yaw / 2);\n    const cp = Math.cos(pitch / 2);\n    const sp = Math.sin(pitch / 2);\n    const cr = Math.cos(roll / 2);\n    const sr = Math.sin(roll / 2);\n\n    return [\n        cy * cp * sr - sy * sp * cr,\n        sy * cp * sr + cy * sp * cr,\n        sy * cp * cr - cy * sp * sr,\n        cy * cp * cr + sy * sp * sr,\n    ];\n}\n", "export * from \"./quaternion\";\n\n/**\n * @internal\n */\nexport function copySign(a: number, b: number): number {\n    return b < 0 ? -Math.abs(a) : Math.abs(a);\n}\n", "//------------------------------------------------------------------------------\nimport type {\n    ComponentName,\n    RTID,\n    UUID,\n    ComponentType,\n    EntityCore,\n    ComponentsManifest,\n    ComponentsRecord,\n    ScriptDataObject,\n    Events,\n    Quat,\n    Vec3,\n} from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport { EntityComponents, type DefaultValue } from \"../../_prebuild/EntityComponents\";\n\n//------------------------------------------------------------------------------\nimport type { EntityCreationOptions, SceneEntityInterface } from \"./Scene\";\nimport { EntityUpdatedEvent, EntityVisibilityChangedEvent } from \"./EntityEvents\";\nimport { ScriptEventEmitted, ScriptEventReceived, ScriptEvents } from \"./ScriptEvents\";\nimport { TypedEventTarget } from \"../TypedEventTarget\";\nimport { quaternionFromEuler, quaternionToEuler } from \"../maths\";\n\n/**\n * An entity in a scene.\n *\n * An entity is a collection of components.\n *\n * Components are accessed through explicit methods: getComponent() returns the current value of a component, while\n * updateComponent() and updateComponents() mark the component as dirty and send its current value to the server on the\n * next update. The deleteComponent() method marks the component as deleted and sends this information to the server.\n *\n * All relevant modifications to entities are batched and automatically sent to the server and\n * broadcasted to other clients if the `auto_broadcast` property is set to \"on\".\n *\n * On top of providing direct access to the components, this class provides helper methods to\n * retrieve the parent entity and the children entities.\n *\n * This class cannot be instantiated directly.\n * Use the {@link SceneBase.newEntity} or {@link SceneBase.newEntities} methods on an existing scene to\n * create an entity.\n *\n * @category Scene\n */\nexport class Entity extends EntityComponents {\n    /**\n     *\n     */\n    readonly #scene: SceneEntityInterface;\n\n    /**\n     *\n     */\n    readonly #dirty_components = new Set<ComponentName>();\n\n    /**\n     *\n     */\n    readonly #deleted_components = new Set<ComponentName>();\n\n    /**\n     * Last-known-synchronized rotation pair of the `local_transform` component, stored as value\n     * copies (never references into the live component). Used by the mutate-then-flag path to\n     * detect which rotation representation the caller mutated, so the other one can be recomputed\n     * (see {@link Entity.updateComponent}).\n     */\n    #rotation_shadow: { orientation: Quat; eulerOrientation: Vec3 } | null = null;\n\n    /**\n     *\n     */\n    readonly #script_event_received_event_target = new TypedEventTarget<ScriptEvents<ScriptEventReceived>>();\n\n    /**\n     *\n     */\n    readonly #script_event_emitted_event_target = new TypedEventTarget<ScriptEvents<ScriptEventEmitted>>();\n\n    /**\n     * @deprecated\n     */\n    #auto_broadcast: boolean = true;\n\n    /**\n     *\n     */\n    #is_visible: boolean = true;\n\n    /**\n     *\n     */\n    #children_rtid: Array<RTID> = [];\n\n    /**\n     *\n     */\n    #parent: Entity | null = null;\n\n    /**\n     * @internal\n     */\n    get children_rtid(): Array<RTID> {\n        return this.#children_rtid;\n    }\n\n    /**\n     * @internal\n     */\n    get rtid(): RTID {\n        return this.euid.rtid;\n    }\n\n    /**\n     * The UUID of the entity.\n     *\n     * Note that multiple entities can share the same UUID if they are different instances of the\n     * same entity brought by multiple instances of the same scene.\n     */\n    get id(): UUID {\n        return this.euid.value;\n    }\n\n    /**\n     * The name of the entity.\n     */\n    get name(): string {\n        return this.debug_name?.value ?? \"<unnamed>\";\n    }\n\n    /**\n     * @deprecated\n     * Whether the entity has its components updates broadcasted to other clients.\n     */\n    get auto_broadcast(): boolean {\n        return this.#auto_broadcast;\n    }\n\n    /**\n     * @deprecated\n     * Set whether the entity has its components updates broadcasted to other clients.\n     */\n    set auto_broadcast(state: boolean) {\n        this.#auto_broadcast = state;\n        if (state === false) {\n            this.#scene._entity_registry._removeEntityFromBroadcastList({ entity: this });\n        }\n    }\n\n    /**\n     * Whether the entity is visible.\n     */\n    get is_visible(): boolean {\n        return this.#is_visible;\n    }\n\n    /**\n     * Set whether the entity is visible.\n     */\n    set is_visible(is_visible: boolean) {\n        this.#scene._setEntityVisibility({ entity_rtid: this.rtid, is_visible });\n        this.#is_visible = is_visible;\n        this._dispatchEvent(new EntityVisibilityChangedEvent({ is_visible, change_source: \"local\" }));\n    }\n\n    /**\n     * The parent entity of this entity or null if it has no parent.\n     */\n    get parent(): Entity | null {\n        return this.#parent;\n    }\n\n    /**\n     * Re-parent the entity by setting a parent entity.\n     */\n    set parent(parent: Entity | null) {\n        if (parent) {\n            let current: Entity | null = parent;\n            while (current) {\n                if (current === this) {\n                    throw new Error(\"Cannot reparent an entity to itself or one of its children\");\n                }\n                current = current.parent;\n            }\n        }\n\n        this._set_parent(parent);\n        const lineage = this.lineage;\n        this.updateComponent(\"lineage\", {\n            parentUUID: parent ? parent.id : \"00000000-0000-0000-0000-000000000000\",\n            value: lineage?.value ?? [],\n        });\n        this.#scene._onEntityReparented();\n    }\n\n    /**\n     * @internal\n     */\n    get _dirty_components(): Array<ComponentName> {\n        return Array.from(this.#dirty_components);\n    }\n\n    /**\n     * @internal\n     */\n    get _deleted_components(): Array<ComponentName> {\n        return Array.from(this.#deleted_components);\n    }\n\n    /**\n     * @internal\n     */\n    constructor({\n        scene,\n        parent = null,\n        components,\n        options,\n        is_visible = true,\n        children_rtid = [],\n    }: {\n        scene: SceneEntityInterface;\n        parent: Entity | null;\n        components: EntityCore;\n        options?: EntityCreationOptions;\n        is_visible?: boolean;\n        children_rtid?: Array<RTID>;\n    }) {\n        super({ euid: components.euid });\n\n        this.#parent = parent;\n        this.#scene = scene;\n        this.#is_visible = is_visible;\n        this.#children_rtid = children_rtid;\n        // Call the private (non-virtual) applier so subclasses don't run overridden hooks before\n        // their own fields are initialized.\n        this.#applyComponents({ components });\n        this.#scene._entity_registry.add({ entity: this });\n\n        if (!options) {\n            return;\n        }\n\n        if (options.auto_broadcast !== undefined) {\n            this.auto_broadcast = options.auto_broadcast;\n        }\n    }\n\n    /**\n     * Returns the children of this entity.\n     */\n    async getChildren(): Promise<Entity[]> {\n        return await this.#scene._getChildren({ entity: this });\n    }\n\n    /**\n     * Add an event listener for a script event.\n     * Script events are triggered by the server when a script attached to an entity emits an event.\n     *\n     * @param params\n     * @param params.event_map_id - The ID of the event map.\n     * @param params.event_name - The name of the event.\n     * @param params.onReceived - The callback to be called when the current entity is targetted by the script event.\n     * @param params.onEmitted - The callback to be called when the current entity emits the script event.\n     */\n    addScriptEventListener({\n        event_map_id,\n        event_name,\n        onReceived,\n        onEmitted,\n    }: {\n        event_map_id: UUID;\n        event_name: string;\n        onReceived?: (evt: ScriptEventReceived) => void;\n        onEmitted?: (evt: ScriptEventEmitted) => void;\n    }): void {\n        if (onReceived) {\n            this.#script_event_received_event_target.addEventListener(event_map_id + \"/\" + event_name, onReceived);\n        }\n\n        if (onEmitted) {\n            this.#script_event_emitted_event_target.addEventListener(event_map_id + \"/\" + event_name, onEmitted);\n        }\n    }\n\n    /**\n     * Remove an event listener for a script event.\n     *\n     * @param params\n     * @param params.event_map_id - The ID of the event map.\n     * @param params.event_name - The name of the event.\n     * @param params.onReceived - A previously registered callback.\n     * @param params.onEmitted - A previously registered callback.\n     */\n    removeScriptEventListener({\n        event_map_id,\n        event_name,\n        onReceived,\n        onEmitted,\n    }: {\n        event_map_id: UUID;\n        event_name: string;\n        onReceived?: (evt: ScriptEventReceived) => void;\n        onEmitted?: (evt: ScriptEventEmitted) => void;\n    }): void {\n        if (onReceived) {\n            this.#script_event_received_event_target.removeEventListener(event_map_id + \"/\" + event_name, onReceived);\n        }\n\n        if (onEmitted) {\n            this.#script_event_emitted_event_target.removeEventListener(event_map_id + \"/\" + event_name, onEmitted);\n        }\n    }\n\n    /**\n     * @experimental\n     */\n    async assignClientToScripts({ client_uuid }: { client_uuid: UUID }): Promise<void> {\n        if (!this.script_map || !this.script_map.elements) {\n            throw new Error(\"Entity has no scripts\");\n        }\n        const script_ids = Object.keys(this.script_map.elements);\n        await Promise.all(\n            script_ids.map(script_id =>\n                this.#scene._assignClientToScripts({ client_uuid, entity_rtid: this.rtid, script_uuid: script_id }),\n            ),\n        );\n    }\n\n    /**\n     * Get the live, mutable value of a component.\n     * Returns undefined if the component doesn't exist on this entity.\n     *\n     * The returned object is the actual stored value: it may be mutated in place, but such mutations\n     * are not auto-detected. Flag them explicitly with {@link Entity.updateComponent} /\n     * {@link Entity.updateComponents}.\n     *\n     * @example\n     * ```typescript\n     * const transform = entity.getComponent('local_transform');\n     * if (transform) {\n     *     console.log(transform.position);\n     * }\n     * ```\n     */\n    public getComponent<_ComponentName extends ComponentName>(\n        component_name: _ComponentName,\n    ): ComponentType<_ComponentName> | undefined {\n        return this._unsafeGetComponentValue({ component_name });\n    }\n\n    /**\n     * Flag a component as dirty so its current value is sent to the server on the next update.\n     *\n     * If a `value` is provided, it is applied first (partial update, creating the component if\n     * needed; `\"default\"` resets to default values). If `value` is omitted, the component's current\n     * stored value is flagged as-is \u2014 the intended pattern is to mutate the object returned by a\n     * getter, then call this to flag it.\n     *\n     * Flagging `local_transform` re-synchronizes its two rotation representations: the\n     * representation the caller mutated (`orientation` or `eulerOrientation`) is detected and the\n     * other one is recomputed from it. When both were mutated, they are trusted as-is, like on the\n     * value-patch path.\n     *\n     * @example\n     * ```typescript\n     * // Mutate-then-flag\n     * entity.local_transform!.position[1] = 1;\n     * entity.updateComponent('local_transform');\n     *\n     * // Apply a partial update and flag in one call\n     * entity.updateComponent('local_transform', { position: [0, 1, 0] });\n     *\n     * // Reset to defaults\n     * entity.updateComponent('mesh_ref', 'default');\n     * ```\n     */\n    public updateComponent<_ComponentName extends ComponentName>(\n        component_name: _ComponentName,\n        value?: Partial<ComponentType<_ComponentName>> | DefaultValue,\n    ): void {\n        if (value === undefined) {\n            // Mutate-then-flag: flag the current stored value, if any.\n            if (this._unsafeGetComponentValue({ component_name }) === undefined) {\n                return;\n            }\n            if (component_name === \"local_transform\") {\n                this.#resyncLocalTransformRotation();\n            }\n            this._markComponentAsDirty({ component_name, is_new: false });\n            return;\n        }\n\n        let processed_value: Partial<ComponentType<_ComponentName>> =\n            value === \"default\" ? this.#scene._sanitizeComponentValue({ component_name, value: undefined }) : value;\n\n        if (component_name === \"local_transform\") {\n            processed_value = normalizeLocalTransformPatch(processed_value as LocalTransformPatch) as Partial<\n                ComponentType<_ComponentName>\n            >;\n        }\n\n        const existing_component = this._unsafeGetComponentValue({ component_name });\n        const isNewComponent = existing_component === undefined;\n\n        if (existing_component !== undefined) {\n            // Update existing component\n            assignComponentPatchInPlace(existing_component, processed_value);\n        } else {\n            // Create new component\n            const sanitized_value = this.#scene._sanitizeComponentValue({\n                component_name,\n                value: processed_value,\n            });\n            this._unsafeSetComponentValue({ component_name, value: sanitized_value });\n        }\n\n        // Mark as dirty and dispatch event\n        this._markComponentAsDirty({ component_name, is_new: isNewComponent });\n    }\n\n    /**\n     * Flag several components as dirty at once, using their current stored values.\n     *\n     * @param component_names - The components to flag.\n     *\n     * @example\n     * ```typescript\n     * entity.local_transform!.position[1] = 1;\n     * entity.debug_name!.value = \"renamed\";\n     * entity.updateComponents([\"local_transform\", \"debug_name\"]);\n     *\n     * ```\n     */\n    public updateComponents(component_names: Array<ComponentName>): void {\n        for (const component_name of component_names) {\n            this.updateComponent(component_name);\n        }\n    }\n\n    /**\n     * Delete a component from the entity.\n     * If the component doesn't exist, this is a no-op.\n     *\n     * @example\n     * ```typescript\n     * entity.deleteComponent('mesh_renderer');\n     * ```\n     */\n    public deleteComponent(component_name: ComponentName): void {\n        const existing_component = this._unsafeGetComponentValue({ component_name });\n        if (existing_component === undefined) {\n            return;\n        }\n\n        this._unsafeSetComponentValue({ component_name, value: undefined });\n        if (component_name === \"local_transform\") {\n            this.#rotation_shadow = null;\n        }\n        this._markComponentAsDeleted({ component_name });\n    }\n\n    /**\n     * @internal\n     *\n     * Re-copy the stored `local_transform` rotation pair into the shadow used by the\n     * mutate-then-flag direction detection (see {@link Entity.updateComponent}). Called after every\n     * code path that establishes a synchronized quaternion/euler pair. Protected so subclasses\n     * writing the stored value directly (the browser entity's constructor and\n     * `_setLocalTransform`) can keep the shadow fresh.\n     */\n    protected _refreshLocalTransformShadow(): void {\n        const local_transform = this._unsafeGetComponentValue({ component_name: \"local_transform\" });\n        if (local_transform === undefined) {\n            this.#rotation_shadow = null;\n            return;\n        }\n\n        this.#rotation_shadow = {\n            orientation: [...local_transform.orientation] as Quat,\n            eulerOrientation: [...local_transform.eulerOrientation] as Vec3,\n        };\n    }\n\n    /**\n     * Re-synchronize the quaternion / euler representations of the stored `local_transform` after\n     * caller-side mutations (the mutate-then-flag path). The shadow tells which representation the\n     * caller mutated: that one is authoritative and the other is recomputed from it. When both (or\n     * neither) changed, the stored values are trusted as-is \u2014 the same policy as the value-patch\n     * path (see {@link normalizeLocalTransformPatch}). Recomputed values are written element-wise\n     * in place so the array references captured by the browser transform proxies stay live.\n     */\n    #resyncLocalTransformRotation(): void {\n        const local_transform = this._unsafeGetComponentValue({ component_name: \"local_transform\" });\n        if (local_transform === undefined) {\n            this.#rotation_shadow = null;\n            return;\n        }\n\n        const shadow = this.#rotation_shadow;\n        if (shadow !== null) {\n            const orientation_changed = !areArraysEqual(local_transform.orientation, shadow.orientation);\n            const euler_changed = !areArraysEqual(local_transform.eulerOrientation, shadow.eulerOrientation);\n\n            if (orientation_changed && !euler_changed) {\n                copyArrayInPlace(local_transform.eulerOrientation, quaternionToEuler(local_transform.orientation));\n            } else if (euler_changed && !orientation_changed) {\n                copyArrayInPlace(local_transform.orientation, quaternionFromEuler(local_transform.eulerOrientation));\n            }\n        }\n\n        this._refreshLocalTransformShadow();\n    }\n\n    /**\n     * @internal\n     */\n    protected _setComponentValue<_ComponentName extends ComponentName>({\n        component_name,\n        value,\n    }: {\n        component_name: _ComponentName;\n        value?: Partial<ComponentType<_ComponentName>> | DefaultValue;\n    }): void {\n        if (value === undefined) {\n            this.deleteComponent(component_name);\n        } else {\n            this.updateComponent(component_name, value);\n        }\n    }\n\n    /**\n     * @internal\n     */\n    _set_parent(parent: Entity | null): void {\n        this.#parent = parent;\n    }\n\n    /**\n     * @internal\n     */\n    _applyComponentsUpdate({\n        components,\n        deleted_components = [],\n        dispatch_event,\n        emitter,\n    }: {\n        components: EntityCore | ComponentsManifest | Partial<ComponentsRecord>;\n        deleted_components?: Array<ComponentName>;\n    } & (\n        | { dispatch_event: false; emitter?: undefined }\n        | { dispatch_event: true; emitter: Events.Emitter | null }\n    )): void {\n        this.#applyComponents({ components, deleted_components });\n\n        if (dispatch_event) {\n            this._dispatchEvent(\n                new EntityUpdatedEvent({\n                    emitter: this.#scene._resolveEmitter(emitter),\n                    updated_components: Object.keys(components) as Array<ComponentName>,\n                    deleted_components,\n                    new_components: [],\n                }),\n            );\n        }\n    }\n\n    /**\n     * Apply component values to the storage core without marking anything dirty or dispatching an\n     * event. Private (non-virtual) so it is safe to call from the constructor.\n     */\n    #applyComponents({\n        components,\n        deleted_components = [],\n    }: {\n        components: EntityCore | ComponentsManifest | Partial<ComponentsRecord>;\n        deleted_components?: Array<ComponentName>;\n    }): void {\n        for (const key in components) {\n            const component_name = key as ComponentName | \"euid\";\n\n            switch (component_name) {\n                case \"euid\":\n                    break;\n                default: {\n                    // Apply component value without marking as dirty\n                    const existing = this._unsafeGetComponentValue({ component_name });\n                    if (existing !== undefined) {\n                        Object.assign(existing, components[component_name]);\n                    } else {\n                        const sanitized = this.#scene._sanitizeComponentValue({\n                            component_name,\n                            value: components[component_name],\n                        });\n                        this._unsafeSetComponentValue({ component_name, value: sanitized });\n                    }\n                    break;\n                }\n            }\n        }\n\n        for (const component_name of deleted_components) {\n            this.#unsafeDeleteComponent({ component_name });\n        }\n\n        if (\"local_transform\" in components || deleted_components.includes(\"local_transform\")) {\n            this._refreshLocalTransformShadow();\n        }\n    }\n\n    /**\n     * @internal\n     */\n    _markComponentAsDirty({ component_name, is_new }: { component_name: ComponentName; is_new?: boolean }): void {\n        if (component_name === \"local_transform\") {\n            // Keep the mutate-then-flag shadow fresh after every path that establishes a\n            // synchronized rotation pair and flags dirty: the value-patch path and the browser\n            // transform-proxy writes.\n            this._refreshLocalTransformShadow();\n        }\n        this.#dirty_components.add(component_name);\n        this.#scene._entity_registry._addDirtyEntity({ entity: this });\n        if (is_new === undefined) {\n            is_new = this._unsafeGetComponentValue({ component_name }) === undefined;\n        }\n        this._dispatchEvent(\n            new EntityUpdatedEvent({\n                emitter: null,\n                updated_components: !is_new ? [component_name] : [],\n                deleted_components: [],\n                new_components: is_new ? [component_name] : [],\n            }),\n        );\n    }\n\n    /**\n     * @internal\n     */\n    _markComponentAsDeleted({ component_name }: { component_name: ComponentName }): void {\n        this.#deleted_components.add(component_name);\n        this.#scene._entity_registry._addDirtyEntity({ entity: this });\n        this._dispatchEvent(\n            new EntityUpdatedEvent({\n                emitter: null,\n                updated_components: [],\n                deleted_components: [component_name],\n                new_components: [],\n            }),\n        );\n    }\n\n    /**\n     * @internal\n     */\n    _clearDirtyState(): void {\n        this.#dirty_components.clear();\n        this.#deleted_components.clear();\n    }\n\n    /**\n     * @internal\n     */\n    _onVisibilityChanged({ is_visible }: { is_visible: boolean }): void {\n        this.#is_visible = is_visible;\n        this._dispatchEvent(new EntityVisibilityChangedEvent({ is_visible, change_source: \"external\" }));\n    }\n\n    /**\n     * @internal\n     */\n    _onScriptEventEmitted({\n        event_name,\n        target_rtids,\n        data_object,\n    }: {\n        event_name: string;\n        target_rtids: Array<RTID>;\n        data_object: ScriptDataObject;\n    }): void {\n        this.#script_event_emitted_event_target._dispatchEvent(\n            new ScriptEventEmitted({\n                scene: this.#scene,\n                event_name,\n                emitter_entity: this,\n                target_rtids,\n                data_object,\n            }),\n        );\n    }\n\n    /**\n     * @internal\n     */\n    _onScriptEventReceived({\n        script_event_received_event,\n    }: {\n        script_event_received_event: ScriptEventReceived;\n    }): void {\n        this.#script_event_received_event_target._dispatchEvent(script_event_received_event);\n    }\n\n    /**\n     *\n     */\n    #unsafeDeleteComponent<_ComponentName extends ComponentName>({\n        component_name,\n    }: {\n        component_name: _ComponentName;\n    }): void {\n        this._unsafeSetComponentValue({ component_name, value: undefined });\n    }\n}\n\n/**\n * The subset of a `local_transform` patch that carries a rotation, in either representation.\n */\ntype LocalTransformPatch = {\n    orientation?: Quat;\n    eulerOrientation?: Vec3;\n};\n\n/**\n * Keep the quaternion `orientation` and its `eulerOrientation` counterpart in sync in a\n * `local_transform` patch.\n *\n * When a patch sets only one of the two representations, the other is recomputed so the merged\n * component stays consistent. When it sets both, the caller's values are trusted as-is.\n */\nfunction normalizeLocalTransformPatch<T extends LocalTransformPatch>(patch: T): T {\n    const has_orientation = patch.orientation !== undefined;\n    const has_euler = patch.eulerOrientation !== undefined;\n\n    if (has_orientation && !has_euler) {\n        return { ...patch, eulerOrientation: quaternionToEuler(patch.orientation as Quat) };\n    }\n    if (has_euler && !has_orientation) {\n        return { ...patch, orientation: quaternionFromEuler(patch.eulerOrientation as Vec3) };\n    }\n    return patch;\n}\n\n/**\n * Merge a component patch into the stored component value, preserving object identity.\n *\n * Unlike `Object.assign`, array values are copied element-wise into the existing arrays instead of\n * replacing them. This is a contract of the explicit component model, not an optimization: a handle\n * obtained from {@link Entity.getComponent} (and any nested array pulled off it) must keep reading\n * and writing the live values across patch merges, or the documented mutate-then-flag pattern would\n * silently operate on stale objects. The browser SDK's transform proxies are one consumer of this\n * contract \u2014 they capture the component's arrays at construction time.\n */\nfunction assignComponentPatchInPlace(existing: object, patch: object): void {\n    const target = existing as Record<string, unknown>;\n    for (const [key, value] of Object.entries(patch)) {\n        const current = target[key];\n        if (Array.isArray(current) && Array.isArray(value)) {\n            current.length = value.length;\n            for (let i = 0; i < value.length; i++) {\n                current[i] = value[i];\n            }\n        } else {\n            target[key] = value;\n        }\n    }\n}\n\n/**\n * Exact element-wise equality. Used by the mutate-then-flag rotation shadow: the shadow holds exact\n * copies of the last-synchronized values, so any caller mutation differs exactly \u2014 no epsilon\n * needed.\n */\nfunction areArraysEqual(a: ReadonlyArray<number>, b: ReadonlyArray<number>): boolean {\n    return a.length === b.length && a.every((value, index) => value === b[index]);\n}\n\n/**\n * Copy values into an existing array without replacing it, so references captured elsewhere (the\n * browser SDK's transform proxies) keep reading and writing the live values.\n */\nfunction copyArrayInPlace(target: Array<number>, values: ReadonlyArray<number>): void {\n    target.length = values.length;\n    for (let i = 0; i < values.length; i++) {\n        target[i] = values[i];\n    }\n}\n", "/**\n *\n */\nconst op_prio = {\n    \"!\": 3,\n    \"&\": 2,\n    \"|\": 1,\n    \"^\": 1,\n} as const;\n\n/**\n *\n */\nfunction is_operator(op: string): boolean {\n    return Object.prototype.hasOwnProperty.call(op_prio, op);\n}\n\n/**\n *\n */\nfunction has_greater_precedence(op1: keyof typeof op_prio, op2: keyof typeof op_prio): boolean {\n    return op_prio[op1] > op_prio[op2];\n}\n\n/**\n * Unary prefix operators are right-associative: \"! ! a\" must parse as !(!(a)),\n * so a second \"!\" should not pop the first one off the stack.\n */\nconst right_associative = new Set<string>([\"!\"]);\n\n/**\n * @internal\n */\nexport function compute_rpn(filter_value: string): string {\n    const tokens = filter_value.split(\" \");\n    const output: Array<string> = [];\n    const operators: Array<string> = [];\n\n    for (const token of tokens) {\n        switch (token) {\n            case \"!\":\n            case \"&\":\n            case \"|\":\n            case \"^\":\n                {\n                    while (operators.length > 0) {\n                        const op = operators[operators.length - 1] as keyof typeof op_prio;\n                        if (!is_operator(op) || has_greater_precedence(token, op) || right_associative.has(token) && op_prio[op] === op_prio[token]) {\n                            break;\n                        }\n                        operators.pop();\n                        output.push(op);\n                    }\n                    operators.push(token);\n                }\n                break;\n            case \"(\":\n                {\n                    operators.push(token);\n                }\n                break;\n            case \")\":\n                {\n                    while (operators.length > 0 && operators[operators.length - 1] !== \"(\") {\n                        output.push(operators.pop()!);\n                    }\n                    console.assert(operators[operators.length - 1] === \"(\");\n                    operators.pop();\n                }\n                break;\n            default:\n                {\n                    output.push(token);\n                }\n                break;\n        }\n    }\n\n    while (operators.length !== 0) {\n        const op = operators.pop()!;\n        console.assert(op !== \"(\");\n        output.push(op);\n    }\n\n    return JSON.stringify(output);\n}\n", "//------------------------------------------------------------------------------\nimport type { RTID, UUID, ComponentName, UpdateEntityCommand } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport type { Entity } from \"./Entity\";\n\n/**\n * @internal\n *\n * The EntityRegistry class is responsible for managing the entities in the scene.\n * It keeps track of all entities and provides methods to add, remove, and find entities.\n * It also keeps track of:\n *  - dirty entities that have components that have been updated and need to be broadcasted to the editor.\n *  - entities that have components that have been detached and need to be removed from the editor.\n *  - entities that have updates that need to be broadcasted to the editor.\n *\n * Generic over the concrete entity type `EntityType` so each SDK gets its own entity flavour back.\n */\nexport class EntityRegistry<EntityType extends Entity = Entity> {\n    /**\n     * A set of all resolved entities that are ready to be used in the client application.\n     */\n    #entities = new Set<EntityType>();\n\n    /**\n     * Map from rtid to entity.\n     */\n    #entity_rtid_lut = new Map<RTID, EntityType>();\n\n    /**\n     * Map from EUID to a list of entities sharing the same EUID.\n     */\n    #entity_euid_lut = new Map<UUID, Array<EntityType>>();\n\n    /**\n     * List of dirty entities sorted by component type.\n     */\n    #dirty_entities = new Set<EntityType>();\n\n    /**\n     * List of dirty entities that need to be broadcasted to the editor sorted by component type.\n     */\n    #entities_to_persist = new Map<\n        EntityType,\n        {\n            unsaved_components: Set<ComponentName>;\n            deleted_components: Set<ComponentName>;\n        }\n    >();\n\n    /**\n     * Adds a new entity in the registry. The entity must be valid, i.e. have valid RTID and EUID and must not have the\n     * same RTID as any registered entity.\n     *\n     * @param entity The entity to add.\n     * @throws Error if the entity is invalid or if an entity with the same RTID is already registered.\n     */\n    add({ entity }: { entity: EntityType }): void {\n        const existingEntity = this.#entity_rtid_lut.get(entity.rtid);\n        if (existingEntity) {\n            throw new Error(\n                `Cannot add entity ${entity.name} to the registry, because entity ${existingEntity.name} has the same RTID.`,\n            );\n        }\n\n        this.#entities.add(entity);\n        this.#entity_rtid_lut.set(entity.rtid, entity);\n        const entities = this.#entity_euid_lut.get(entity.id);\n\n        if (entities) {\n            entities.push(entity);\n        } else {\n            this.#entity_euid_lut.set(entity.id, [entity]);\n        }\n    }\n\n    /**\n     * Removes an entity from the registry. The entity must have been previously added to the registry.\n     *\n     * @param entity The entity to remove.\n     * @throws Error if the entity is not registered in the registry.\n     */\n    remove({ entity }: { entity: EntityType }): void {\n        const entities = this.#entity_euid_lut.get(entity.id);\n        if (!entities) {\n            throw new Error(`Trying to remove entity ${entity.id} which has not been registered to the EUID LUT.`);\n        }\n\n        const index = entities.indexOf(entity);\n        if (index == -1) {\n            throw new Error(`Trying to remove entity ${entity.id} which has not been registered to the EUID LUT.`);\n        }\n\n        entities.splice(index, 1);\n\n        if (entities.length === 0) {\n            this.#entity_euid_lut.delete(entity.id);\n        }\n\n        this.#removeEntity({ entity });\n    }\n\n    /**\n     * @internal\n     *\n     * Returns the entity with the given RTID or null if not found.\n     *\n     * @param entity_rtid The RTID of the entity to get.\n     * @returns The entity with the given RTID or null if not found.\n     */\n    get({ entity_rtid }: { entity_rtid: RTID }): EntityType | null {\n        return this.#entity_rtid_lut.get(entity_rtid) ?? null;\n    }\n\n    /**\n     * @internal\n     *\n     * @returns An iterable of all registered entities.\n     */\n    all(): Iterable<EntityType> {\n        return this.#entity_rtid_lut.values();\n    }\n\n    /**\n     * Returns all entities matching the given EUID or empty array if not found.\n     *\n     * @param entity_euid The EUID of the entities to get.\n     * @returns All entities matching the given EUID or empty array if not found.\n     */\n    find({ entity_euid }: { entity_euid: UUID }): Array<EntityType> {\n        return this.#entity_euid_lut.get(entity_euid) ?? [];\n    }\n\n    /**\n     * @internal\n     */\n    _removeAll({ entity_euid }: { entity_euid: UUID }): Array<EntityType> {\n        const entities = this.#entity_euid_lut.get(entity_euid);\n        if (!entities) {\n            return [];\n        }\n\n        this.#entity_euid_lut.delete(entity_euid);\n        for (const entity of entities) {\n            this.#removeEntity({ entity });\n        }\n\n        return entities;\n    }\n\n    /**\n     * @internal\n     */\n    _addDirtyEntity({ entity }: { entity: EntityType }): void {\n        this.#dirty_entities.add(entity);\n    }\n\n    /**\n     * @internal\n     */\n    _removeEntityFromBroadcastList({ entity }: { entity: EntityType }): void {\n        this.#entities_to_persist.delete(entity);\n    }\n\n    /**\n     * @internal\n     */\n    _flushDirtyEntities(): Array<UpdateEntityCommand> {\n        const update_command = new Array<UpdateEntityCommand>(this.#dirty_entities.size);\n\n        let i = 0;\n        for (const entity of this.#dirty_entities) {\n            update_command[i++] = {\n                entity_components: entity._core,\n                dirty_components: entity._dirty_components,\n                deleted_components: entity._deleted_components,\n            };\n\n            if (entity.auto_broadcast) {\n                this.#updateBroadcastList({ entity });\n            }\n\n            entity._clearDirtyState();\n        }\n\n        this.#dirty_entities.clear();\n\n        return update_command;\n    }\n\n    /**\n     * @internal\n     */\n    _flushPersistentEntities(): Array<UpdateEntityCommand> {\n        const update_command = new Array<UpdateEntityCommand>(this.#entities_to_persist.size);\n\n        let i = 0;\n        for (const [entity, { unsaved_components, deleted_components }] of this.#entities_to_persist) {\n            update_command[i++] = {\n                entity_components: entity._core,\n                dirty_components: Array.from(unsaved_components),\n                deleted_components: Array.from(deleted_components),\n            };\n        }\n\n        this.#entities_to_persist.clear();\n\n        return update_command;\n    }\n\n    /**\n     *\n     */\n    #removeEntity({ entity }: { entity: EntityType }): void {\n        if (!this.#entity_rtid_lut.delete(entity.rtid)) {\n            throw new Error(`Trying to remove entity ${entity.rtid} which has not been registred to the RTID LUT.`);\n        }\n\n        if (!this.#entities.delete(entity)) {\n            throw new Error(`Trying to remove entity ${entity.id} which has not been registered to the registry.`);\n        }\n\n        this.#dirty_entities.delete(entity);\n        this.#entities_to_persist.delete(entity);\n    }\n\n    /**\n     * @internal\n     */\n    #updateBroadcastList({ entity }: { entity: EntityType }): void {\n        const broadcast_data = this.#entities_to_persist.get(entity);\n        if (!broadcast_data) {\n            this.#entities_to_persist.set(entity, {\n                unsaved_components: new Set(entity._dirty_components),\n                deleted_components: new Set(entity._deleted_components),\n            });\n        } else {\n            for (const component_name of entity._dirty_components) {\n                broadcast_data.unsaved_components.add(component_name);\n                broadcast_data.deleted_components.delete(component_name);\n            }\n            for (const component_name of entity._deleted_components) {\n                broadcast_data.deleted_components.add(component_name);\n                broadcast_data.unsaved_components.delete(component_name);\n            }\n        }\n    }\n}\n", "import { EditionEvent } from \"../EditionEvent\";\nimport type { Client } from \"../session/Client\";\nimport type { Entity } from \"./Entity\";\nimport type { RTID, SceneSettingsManifest } from \"@3dverse/livelink.core\";\n\n/**\n * Event that is fired when one or more entities are created.\n *\n * Dispatched by {@link Scene} as `on-entities-created`.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class EntitiesCreatedEvent<EntityType extends Entity = Entity> extends EditionEvent {\n    /**\n     * The entities that were created.\n     */\n    public readonly entities: Array<EntityType>;\n\n    /**\n     * @internal\n     */\n    constructor({ entities, emitter }: { entities: Array<EntityType>; emitter: Client | null }) {\n        super(\"on-entities-created\", emitter);\n        this.entities = entities;\n    }\n}\n\n/**\n * Event that is fired when one or more entities are deleted.\n *\n * Dispatched by {@link Scene} as `on-entities-deleted`.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class EntitiesDeletedEvent extends EditionEvent {\n    /**\n     * @internal\n     */\n    public readonly entity_ids: Array<RTID>;\n\n    /**\n     * Checks if the event includes the given entity.\n     */\n    includes(entity: Entity): boolean {\n        return this.entity_ids.includes(entity.rtid);\n    }\n\n    /**\n     * @internal\n     */\n    constructor({ entity_ids, emitter }: { entity_ids: Array<RTID>; emitter: Client | null }) {\n        super(\"on-entities-deleted\", emitter);\n        this.entity_ids = entity_ids;\n    }\n}\n\n/**\n * Event that is fired when the scene settings are updated.\n *\n * Dispatched by {@link Scene} as `on-scene-settings-updated`.\n *\n * @event\n * @noInheritDoc\n * @category Scene / Events\n */\nexport class SceneSettingsUpdatedEvent extends EditionEvent {\n    /**\n     * The updated scene settings that has been applied.\n     * Contains only the settings that were changed.\n     */\n    public readonly updated_settings: SceneSettingsManifest;\n\n    /**\n     * @internal\n     */\n    constructor({ updated_settings, emitter }: { updated_settings: SceneSettingsManifest; emitter: Client | null }) {\n        super(\"on-scene-settings-updated\", emitter);\n        this.updated_settings = updated_settings;\n    }\n}\n\n/**\n * The events dispatched by {@link Scene}.\n *\n * @event\n * @category Scene / Events\n */\nexport type SceneEvents<EntityType extends Entity = Entity> = {\n    \"on-entities-created\": EntitiesCreatedEvent<EntityType>;\n    \"on-entities-deleted\": EntitiesDeletedEvent;\n    \"on-scene-settings-updated\": SceneSettingsUpdatedEvent;\n};\n", "/**\n * Creates a Promise along with its resolve and reject functions.\n *\n * @internal\n */\nexport class PromiseWithResolver<T> {\n    readonly promise: Promise<T>;\n    #resolve!: (value: T) => void;\n    #reject!: (reason?: unknown) => void;\n\n    /**\n     *\n     */\n    constructor() {\n        this.promise = new Promise((resolve, reject) => {\n            this.#resolve = resolve;\n            this.#reject = reject;\n        });\n    }\n\n    /**\n     *\n     */\n    get resolve(): (value: T) => void {\n        return this.#resolve;\n    }\n\n    /**\n     *\n     */\n    get reject(): (reason?: unknown) => void {\n        return this.#reject;\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { Events, SceneSettingsManifest, SceneSettingsRecord } from \"@3dverse/livelink.core\";\n//------------------------------------------------------------------------------\n\nimport type { SceneBase } from \"./Scene\";\nimport { PromiseWithResolver } from \"./PromiseWithResolver\";\nimport { SceneSettingsUpdatedEvent } from \"./SceneEvents\";\n\n/**\n * @internal\n *\n * The SceneHost type is a subset of the SceneBase class that is used by the SceneSettings class to interact with the scene.\n * It exposes only the methods that are needed by the SceneSettings class, and hides the rest of the SceneBase API.\n * This allows for better encapsulation and separation of concerns between the SceneSettings and SceneBase classes.\n * It also allows for easier testing and mocking of the SceneBase class in unit tests for the SceneSettings class.\n */\ntype SceneHost = Pick<SceneBase, \"_dispatchEvent\" | \"_resolveEmitter\">;\n\n/**\n * @internal\n *\n * The SceneSettings class is responsible for managing the settings of the scene.\n * It wraps the scene settings with proxies to trigger updates when the values are changed.\n * It also listens to updates from the editor and updates the local settings values accordingly.\n */\nexport class SceneSettings {\n    /**\n     *\n     */\n    #scene: SceneHost;\n\n    /**\n     * The settings for the scene without proxies.\n     */\n    #raw_settings: SceneSettingsRecord | null = null;\n\n    /**\n     *  The settings for the scene with proxies.\n     */\n    #proxied_settings: SceneSettingsRecord | null = null;\n\n    /**\n     * Dirty settings that need to be updated to the renderer.\n     */\n    #dirty_settings_to_update: SceneSettingsManifest = {};\n\n    /**\n     * Dirty settings that need to be broadcasted to other clients.\n     */\n    #dirty_settings_to_broadcast: SceneSettingsManifest = {};\n\n    /**\n     * Promise that resolves when the settings are loaded.\n     */\n    #initialization_promise = new PromiseWithResolver<SceneSettingsRecord>();\n\n    /**\n     * @internal\n     */\n    constructor(scene: SceneHost) {\n        this.#scene = scene;\n    }\n\n    /**\n     *\n     */\n    get values(): Promise<Readonly<SceneSettingsRecord>> {\n        return this.#initialization_promise.promise;\n    }\n\n    /**\n     * @internal\n     */\n    _onSceneSettingsUpdated = ({ updated_settings, emitter }: Events.SceneSettingsUpdatedEvent): void => {\n        if (!this.#raw_settings) {\n            this.#initializeSceneSettingsProxy(updated_settings as SceneSettingsRecord);\n            return;\n        }\n\n        console.debug(\"\u26A1 Scene settings updated:\", updated_settings);\n\n        for (const [settingSectionName, settingSection] of Object.entries(updated_settings)) {\n            for (const [key, value] of Object.entries(settingSection)) {\n                Reflect.set(this.#raw_settings[settingSectionName as keyof SceneSettingsRecord], key, value);\n            }\n        }\n\n        this.#scene._dispatchEvent(\n            new SceneSettingsUpdatedEvent({ updated_settings, emitter: this.#scene._resolveEmitter(emitter) }),\n        );\n    };\n\n    /**\n     * @internal\n     */\n    #initializeSceneSettingsProxy = (initial_settings: SceneSettingsRecord): void => {\n        this.#raw_settings = initial_settings;\n        this.#proxied_settings = {} as SceneSettingsRecord;\n\n        for (const [settingSectionName, settingSection] of Object.entries(this.#raw_settings)) {\n            const settingProxy = {} as typeof settingSection;\n\n            const onSettingAttributeChanged = (attributeName: keyof SceneSettingsRecord, value: unknown): void => {\n                console.debug(`\u2699\uFE0F Scene setting changed: ${settingSectionName}.${String(attributeName)} =`, value);\n                const updated_settings = { [settingSectionName]: { [attributeName]: value } } as SceneSettingsManifest;\n\n                this.#addToDirtySettingsToUpdate(updated_settings);\n                this.#addToDirtySettingsToBroadcast(updated_settings);\n                this.#scene._dispatchEvent(new SceneSettingsUpdatedEvent({ updated_settings, emitter: null }));\n            };\n\n            for (const [attributeName, attributeValue] of Object.entries(settingSection)) {\n                const typedAttributeName = attributeName as keyof typeof settingSection;\n                if (typeof attributeValue !== \"object\" && !Array.isArray(attributeValue)) {\n                    continue;\n                }\n\n                settingProxy[typedAttributeName] = new Proxy(settingSection[typedAttributeName], {\n                    get: (_, prop): unknown => Reflect.get(settingSection[typedAttributeName], prop),\n                    set: (_, prop, v: unknown): boolean => {\n                        const result = Reflect.set(settingSection[typedAttributeName], prop, v);\n                        const value = settingSection[typedAttributeName];\n                        onSettingAttributeChanged(typedAttributeName, value);\n                        return result;\n                    },\n                });\n            }\n\n            //@ts-expect-error Cannot infer the type here\n            this.#proxied_settings[settingSectionName as keyof SceneSettingsRecord] = new Proxy(settingProxy, {\n                get: (_, prop): unknown => {\n                    if (Object.prototype.hasOwnProperty.call(settingProxy, prop)) {\n                        return Reflect.get(settingProxy, prop);\n                    }\n                    return Reflect.get(this.#raw_settings![settingSectionName as keyof SceneSettingsRecord], prop);\n                },\n                set: (_, prop: keyof SceneSettingsRecord, value: unknown): boolean => {\n                    onSettingAttributeChanged(prop, value);\n                    return Reflect.set(\n                        this.#raw_settings![settingSectionName as keyof SceneSettingsRecord],\n                        prop,\n                        value,\n                    );\n                },\n            });\n        }\n\n        this.#initialization_promise.resolve(this.#proxied_settings);\n    };\n\n    /**\n     *\n     */\n    _getAndClearSettingsToUpdate = (): SceneSettingsManifest => {\n        const settings = this.#dirty_settings_to_update;\n        this.#dirty_settings_to_update = {};\n        return settings;\n    };\n\n    /**\n     *\n     */\n    _getAndClearSettingsToBroadcast = (): SceneSettingsManifest => {\n        const settings = this.#dirty_settings_to_broadcast;\n        this.#dirty_settings_to_broadcast = {};\n        return settings;\n    };\n\n    /**\n     *\n     */\n    #addToDirtySettingsToUpdate = (updated_settings: SceneSettingsManifest): void => {\n        for (const [section, settings] of Object.entries(updated_settings)) {\n            const typedSection = section as keyof SceneSettingsManifest;\n            if (!this.#dirty_settings_to_update[typedSection]) {\n                this.#dirty_settings_to_update[typedSection] = {};\n            }\n\n            Object.assign(this.#dirty_settings_to_update[typedSection], settings);\n        }\n    };\n\n    /**\n     *\n     */\n    #addToDirtySettingsToBroadcast = (updated_settings: SceneSettingsManifest): void => {\n        for (const [section, settings] of Object.entries(updated_settings)) {\n            const typedSection = section as keyof SceneSettingsManifest;\n            if (!this.#dirty_settings_to_broadcast[typedSection]) {\n                this.#dirty_settings_to_broadcast[typedSection] = {};\n            }\n\n            Object.assign(this.#dirty_settings_to_broadcast[typedSection], settings);\n        }\n    };\n}\n", "//------------------------------------------------------------------------------\nimport type {\n    LivelinkCore,\n    RTID,\n    UUID,\n    ScriptDataObject,\n    Components,\n    ComponentName,\n    EntityCore,\n    EntityResponse,\n    ComponentType,\n    ComponentsManifest,\n    ComponentsRecord,\n    Events,\n    SceneSettingsRecord,\n} from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport type { LivelinkInstance } from \"../LivelinkInstance\";\nimport { Entity } from \"./Entity\";\nimport { compute_rpn } from \"./Filters\";\nimport { EntityRegistry } from \"./EntityRegistry\";\nimport { ScriptEventReceived } from \"./ScriptEvents\";\nimport { EntitiesCreatedEvent, EntitiesDeletedEvent, SceneEvents } from \"./SceneEvents\";\nimport { TypedEventTarget } from \"../TypedEventTarget\";\nimport type { Client } from \"../session/Client\";\nimport { PromiseWithResolver } from \"./PromiseWithResolver\";\nimport { SceneSettings } from \"./SceneSettings\";\n\n/**\n * Options for creating a new entity.\n *\n * @inline\n * @category Scene\n */\nexport type EntityCreationOptions = {\n    /**\n     * Whether to delete the entity when the client disconnects.\n     */\n    delete_on_client_disconnection?: boolean;\n\n    /**\n     * @deprecated\n     * Whether to broadcast the entity automatically.\n     */\n    auto_broadcast?: boolean;\n};\n\n/**\n * Information about the scene.\n *\n * @category Scene\n */\nexport type SceneInfo<EntityType extends Entity = Entity> = Omit<Events.SceneInfo, \"root_entities\"> & {\n    root_entities: Array<EntityType>;\n};\n\n/**\n * @internal\n * The scene operations an {@link Entity} needs from its owning scene.\n */\nexport interface SceneEntityInterface<EntityType extends Entity = Entity> {\n    /** @internal */\n    _resolveEmitter(emitter: Events.Emitter | null): Client | null;\n\n    /** @internal */\n    readonly _entity_registry: EntityRegistry<EntityType>;\n\n    /** @internal */\n    _sanitizeComponentValue<_ComponentName extends ComponentName>(params: {\n        component_name: _ComponentName;\n        value: Partial<ComponentType<_ComponentName>> | undefined;\n    }): ComponentType<_ComponentName>;\n\n    /** @internal */\n    _setEntityVisibility(params: { entity_rtid: RTID; is_visible: boolean }): Promise<void>;\n\n    /** @internal */\n    _getChildren(params: { entity: EntityType }): Promise<Array<EntityType>>;\n\n    /** @internal */\n    _assignClientToScripts(params: { client_uuid: UUID; entity_rtid: RTID; script_uuid: UUID }): void;\n\n    /** @internal */\n    _onEntityReparented(): void;\n\n    /**\n     * @internal\n     * Not called by `Entity` itself \u2014 forwarded to {@link ScriptEventEmitted} (see\n     * {@link Entity._onScriptEventEmitted}), which uses it to resolve `target_entities`.\n     */\n    _findEntity(params: { entity_rtid: RTID }): Promise<EntityType | null>;\n}\n\n/**\n * @internal\n * The scene operations {@link ScriptEventEmitted} needs from its owning scene.\n */\nexport interface SceneScriptEventInterface<EntityType extends Entity = Entity> {\n    /** @internal */\n    _findEntity(params: { entity_rtid: RTID }): Promise<EntityType | null>;\n}\n\n/**\n * The scene class.\n *\n * It is the main entry point to interact with the entities in the scene.\n * It is responsible for creating, finding, and deleting entities.\n *\n * It is generic over the concrete entity type `EntityType` so each SDK gets its own entity flavour back from\n * every scene method. The actual entity instantiation is delegated to the abstract\n * `_instantiateEntity` factory implemented by each concrete `Scene`.\n *\n * This class is not meant to be instantiated directly.\n * Instead, it is created by the livelink instance and can be accessed through the `scene` property.\n *\n * @category Scene\n */\nexport abstract class SceneBase<EntityType extends Entity = Entity>\n    extends TypedEventTarget<SceneEvents<EntityType>>\n    implements SceneEntityInterface<EntityType>, SceneScriptEventInterface<EntityType>\n{\n    /**\n     * @internal\n     * Registry of entities discovered until now.\n     */\n    public readonly _entity_registry = new EntityRegistry<EntityType>();\n\n    /**\n     * @internal\n     * The scene settings.\n     */\n    public readonly _settings: SceneSettings = new SceneSettings(this);\n\n    /**\n     * The livelink instance.\n     */\n    readonly #instance: LivelinkInstance;\n\n    /**\n     * The core instance.\n     */\n    #core: LivelinkCore;\n\n    /**\n     * The pending entity requests.\n     * Used to avoid duplicate requests for the same entity.\n     */\n    #pending_entity_requests = new Map<RTID, Promise<Array<EntityResponse>>>();\n\n    /**\n     * Promise that resolves when the scene graph has finished loading.\n     */\n    #scene_info_promise = new PromiseWithResolver<SceneInfo<EntityType>>();\n\n    /**\n     * Whether the server has finished loading every pending referenced scene, as reported by the\n     * last asset loading status received.\n     */\n    #is_scene_loaded: boolean = false;\n\n    /**\n     * Resolves once the server reports it has finished loading every pending referenced scene.\n     * Replaced with a fresh pending promise whenever the server starts loading scenes again.\n     */\n    #scene_loaded_promise = new PromiseWithResolver<void>();\n\n    /**\n     * Resolves when the livelink instance is disconnected, so that a pending\n     * {@link waitForSceneLoaded} can resolve immediately.\n     */\n    #disconnected_promise = new PromiseWithResolver<void>();\n\n    /**\n     * @internal\n     */\n    constructor(instance: LivelinkInstance, core: LivelinkCore) {\n        super();\n        this.#instance = instance;\n        this.#core = core;\n    }\n\n    /**\n     * @internal\n     *\n     * Instantiate the concrete entity type for this scene. Implemented by each SDK's `Scene` so that\n     * the shared scene logic produces the right entity flavour (browser proxied entity vs. headless\n     * entity) while staying entity-type agnostic.\n     */\n    protected abstract _instantiateEntity(params: {\n        parent: EntityType | null;\n        components: EntityCore;\n        options?: EntityCreationOptions;\n        is_visible?: boolean;\n        children_rtid?: Array<RTID>;\n    }): EntityType;\n\n    /**\n     * Create a new entity.\n     *\n     * @param params\n     * @param params.name - The name of the entity.\n     * @param params.components - The components to add to the entity with their initial values.\n     * If no initial values are provided, the default values are used.\n     * @param params.options - Additional options for the entity creation.\n     *\n     * @returns A promise that resolves to the created entity.\n     *\n     * @example\n     * ```typescript\n     * const entity = await scene.newEntity({\n     *     name: \"My Entity\",\n     *     components: {\n     *         local_transform: {\n     *             position: [0, 2, 0],\n     *             // default values are used for scale and orientation\n     *         }\n     *     },\n     * });\n     * ```\n     */\n    async newEntity({\n        name,\n        components,\n        options,\n        parent = null,\n    }: {\n        name: string;\n        components: ComponentsManifest;\n        options?: EntityCreationOptions;\n        parent?: EntityType | null;\n    }): Promise<EntityType> {\n        const lineage: Partial<Components.Lineage> | undefined = parent ? { parentUUID: parent.id } : undefined;\n        const entity_cores = await this.#core.createEntities({\n            components: [{ debug_name: { value: name }, ...components, lineage }],\n            delete_on_client_disconnection: options?.delete_on_client_disconnection ?? false,\n            is_transient: true,\n        });\n        const entity = this._instantiateEntity({ parent, components: entity_cores[0], options });\n        this._dispatchEvent(new EntitiesCreatedEvent({ entities: [entity], emitter: null }));\n        return entity;\n    }\n\n    /**\n     * Create multiple entities at once.\n     * This method is more efficient than calling `newEntity` multiple times.\n     * It creates all entities in a single call to the core.\n     *\n     * @param params\n     * @param params.components_array - An array of objects with the name and components of each entity.\n     * @param params.options - Additional options for the entity creation.\n     *\n     * @returns A promise that resolves to an array of the created entities.\n     */\n    async newEntities({\n        components_array,\n        options,\n    }: {\n        components_array: Array<ComponentsManifest>;\n        options?: EntityCreationOptions;\n    }): Promise<Array<EntityType>> {\n        const entity_cores = await this.#core.createEntities({\n            components: components_array,\n            delete_on_client_disconnection: options?.delete_on_client_disconnection ?? false,\n            is_transient: true,\n        });\n\n        //TODO: compute each entity's parent\n        const entities = entity_cores.map(components => this._instantiateEntity({ parent: null, components, options }));\n        this._dispatchEvent(new EntitiesCreatedEvent({ entities, emitter: null }));\n        return entities;\n    }\n\n    /**\n     * Find an entity by its UUID and linkage.\n     *\n     * @param params\n     * @param params.entity_uuid - The UUID of the entity to find.\n     * @param params.linkage - The linkage of the entity to find.\n     *\n     * @returns A promise that resolves to the found entity or null if not found.\n     */\n    async findEntity({\n        entity_uuid,\n        linkage = [],\n    }: {\n        entity_uuid: UUID;\n        linkage?: Array<UUID>;\n    }): Promise<EntityType | null> {\n        const foundEntity = this._entity_registry\n            .find({ entity_euid: entity_uuid })\n            .find(\n                entity =>\n                    (entity.lineage?.value?.length ?? 0) === linkage.length &&\n                    (entity.lineage?.value ?? []).every((uuid, i) => uuid === linkage[i]),\n            );\n\n        if (foundEntity) {\n            return foundEntity;\n        }\n\n        const entity_reponses = await this.#core.findEntities({\n            query: { euid: entity_uuid, linkage },\n            options: { include_ancestors: true },\n        });\n\n        if (entity_reponses.length === 0) {\n            return null;\n        }\n\n        return this.#resolveEntityResponse(entity_reponses[0]);\n    }\n\n    /**\n     * Find entities by their UUID.\n     *\n     * This can return multiple entities if the entity is a child of a {@link Components.SceneRef}\n     * that is instanced multiple times.\n     *\n     * @param params\n     * @param params.entity_uuid - The UUID of the entity to find.\n     *\n     * @returns A promise that resolves to an array of entities with the given UUID.\n     */\n    async findEntities({ entity_uuid }: { entity_uuid: UUID }): Promise<Array<EntityType>> {\n        const foundEntities = this._entity_registry.find({ entity_euid: entity_uuid });\n        if (foundEntities.length > 0) {\n            return foundEntities;\n        }\n\n        const entity_responses = await this.#core.findEntities({\n            query: { euid: entity_uuid },\n            options: { include_ancestors: true },\n        });\n        return this.#resolveEntityResponses({ entity_responses });\n    }\n\n    /**\n     * Delete a batch of entities.\n     *\n     * @param params\n     * @param params.entities - The entities to delete.\n     *\n     * @returns A promise that resolves when the entities are deleted.\n     */\n    async deleteEntities({ entities }: { entities: Array<EntityType> }): Promise<void> {\n        await this.#core.deleteEntities({ entity_uuids: entities.map(e => e.id) });\n\n        for (const entity of entities) {\n            this._entity_registry.remove({ entity });\n        }\n    }\n\n    /**\n     * Highlight a batch of entities.\n     *\n     * @param params\n     * @param params.entities - The entities to highlight.\n     * @param params.keep_old_selection - Whether to keep the old selection or not.\n     *\n     * @returns A promise that resolves when the message is sent.\n     */\n    async highlightEntities({\n        entities,\n        keep_old_selection = false,\n    }: {\n        entities: Array<EntityType>;\n        keep_old_selection?: boolean;\n    }): Promise<void> {\n        this.#core.highlightEntities({\n            highlightEntitiesMessage: {\n                entities: entities.map(e => e.rtid),\n                keep_old_selection,\n            },\n        });\n    }\n\n    /**\n     * Fire a script event.\n     *\n     * @param params\n     * @param params.event_map_id - The UUID of the event map.\n     * @param params.event_name - The name of the event.\n     * @param params.emitter_entity - The entity that emits the event.\n     * @param params.target_entities - The entities that are the target of the event. Leave empty for global events.\n     * @param params.data_object - The data object to pass with the event.\n     *\n     * @returns A promise that resolves when the message is sent.\n     *\n     * @experimental\n     */\n    fireEvent({\n        event_map_id,\n        event_name,\n        emitter_entity,\n        target_entities = [],\n        data_object = {},\n    }: {\n        event_map_id: UUID;\n        event_name: string;\n        emitter_entity?: EntityType;\n        target_entities?: Array<EntityType>;\n        data_object?: ScriptDataObject;\n    }): void {\n        this.#core.fireEvent({\n            event_map_id,\n            event_name,\n            emitter_entity: emitter_entity ? emitter_entity.rtid : 0n,\n            target_entities: target_entities.map(e => e.rtid),\n            data_object,\n        });\n    }\n\n    /**\n     * @experimental\n     */\n    setFilter({ name, value }: { name: string; value: string }): void {\n        const rpn = compute_rpn(value);\n        this.#core.setFilter({ name, rpn });\n    }\n\n    /**\n     * @experimental\n     */\n    toggleFilter({ name, enabled }: { name: string; enabled: boolean }): void {\n        this.#core.toggleFilter({ name, enabled });\n    }\n\n    /**\n     * @experimental\n     */\n    removeFilter({ name }: { name: string }): void {\n        this.#core.removeFilter({ name });\n    }\n\n    /**\n     *  @deprecated\n     */\n    async findEntitiesByNames({ entity_names }: { entity_names: Array<string> }): Promise<Array<EntityType>> {\n        const entity_responses = await this.#core.findEntities({\n            query: { names: entity_names },\n            options: { include_ancestors: true },\n        });\n        return this.#resolveEntityResponses({ entity_responses });\n    }\n\n    /**\n     *  @deprecated\n     */\n    async findEntitiesWithComponents({\n        mandatory_components,\n        forbidden_components,\n    }: {\n        mandatory_components: Array<ComponentName>;\n        forbidden_components?: Array<ComponentName>;\n    }): Promise<Array<EntityType>> {\n        const entity_responses = await this.#core.findEntities({\n            query: { mandatory_components, forbidden_components },\n            options: { include_ancestors: true },\n        });\n        return this.#resolveEntityResponses({ entity_responses });\n    }\n\n    /**\n     * @internal\n     *\n     * Get an entity by its RTID.\n     */\n    async _findEntity({ entity_rtid }: { entity_rtid: RTID }): Promise<EntityType | null> {\n        if (entity_rtid === 0n) {\n            return null;\n        }\n\n        const entity = this._entity_registry.get({ entity_rtid });\n        if (entity) {\n            return entity;\n        }\n\n        let promise = this.#pending_entity_requests.get(entity_rtid);\n        if (!promise) {\n            promise = this.#core.findEntities({ query: { rtid: entity_rtid } });\n            this.#pending_entity_requests.set(entity_rtid, promise);\n        }\n\n        const entity_responses = await promise;\n        this.#pending_entity_requests.delete(entity_rtid);\n        if (entity_responses.length === 0) {\n            return null;\n        }\n\n        return this.#resolveEntityResponse(entity_responses[0]);\n    }\n\n    /**\n     * @internal\n     */\n    async _getChildren({ entity }: { entity: EntityType }): Promise<Array<EntityType>> {\n        const children_components = await this.#core.getChildren({ entity_rtid: entity.rtid });\n        return children_components.map(\n            components =>\n                this._entity_registry.get({ entity_rtid: components.euid.rtid }) ??\n                this._instantiateEntity({ parent: entity, components }),\n        );\n    }\n\n    /**\n     * @internal\n     */\n    _assignClientToScripts({\n        client_uuid,\n        entity_rtid,\n        script_uuid,\n    }: {\n        client_uuid: UUID;\n        entity_rtid: RTID;\n        script_uuid: UUID;\n    }): void {\n        this.#core.assignClientToScript({ client_uuid, script_uuid, entity_rtid });\n    }\n\n    /**\n     * @internal\n     */\n    async _setEntityVisibility({ entity_rtid, is_visible }: { entity_rtid: RTID; is_visible: boolean }): Promise<void> {\n        return this.#core.setEntityVisibility({ entity_rtid, is_visible });\n    }\n\n    /**\n     * @internal\n     */\n    _onEntityVisibilityChanged = ({ entity_rtid, is_visible }: Events.EntityVisibilityChangedEvent): void => {\n        const entity = this._entity_registry.get({ entity_rtid });\n        if (entity) {\n            entity._onVisibilityChanged({ is_visible });\n\n            for (const child_rtid of entity.children_rtid) {\n                this._setEntityVisibility({ entity_rtid: child_rtid, is_visible });\n            }\n        }\n    };\n\n    /**\n     * @internal\n     */\n    _onEntitiesCreated = async ({ created_entities, emitter }: Events.EntitiesCreatedEvent): Promise<void> => {\n        const entities: Array<EntityType> = [];\n\n        for (const [parent_rtid, children] of created_entities.entries()) {\n            const parent: EntityType | null =\n                parent_rtid !== 0n ? await this._findEntity({ entity_rtid: parent_rtid }) : null;\n\n            for (const entity of children) {\n                entities.push(this._instantiateEntity({ parent, components: entity }));\n            }\n        }\n\n        this._dispatchEvent(new EntitiesCreatedEvent({ entities, emitter: this._resolveEmitter(emitter) }));\n    };\n\n    /**\n     * @internal\n     */\n    _onEntitiesDeleted = ({\n        deleted_entity_euids,\n        deleted_entity_rtids,\n        emitter,\n    }: Events.EntitiesDeletedEvent): void => {\n        const entity_ids = Array<RTID>();\n        for (const entity_euid of deleted_entity_euids) {\n            const entities = this._entity_registry._removeAll({ entity_euid });\n            for (const entity of entities) {\n                entity_ids.push(entity.rtid);\n            }\n        }\n\n        for (const entity_rtid of deleted_entity_rtids) {\n            const entity = this._entity_registry.get({ entity_rtid });\n            if (entity) {\n                entity_ids.push(entity.rtid);\n                this._entity_registry.remove({ entity });\n            }\n        }\n\n        this._dispatchEvent(new EntitiesDeletedEvent({ entity_ids, emitter: this._resolveEmitter(emitter) }));\n    };\n\n    /**\n     * @internal\n     */\n    _updateEntityFromEvent({\n        entity_euid,\n        updated_components,\n        deleted_components,\n        emitter,\n    }: {\n        entity_euid: UUID;\n        updated_components: Partial<ComponentsRecord>;\n        deleted_components?: Array<ComponentName>;\n        emitter: Events.Emitter | null;\n    }): void {\n        const entities = this._entity_registry.find({ entity_euid });\n\n        if (entities.length === 0) {\n            console.log(\"Received an update for an undiscovered entity\", entity_euid);\n            return;\n        }\n\n        for (const entity of entities) {\n            if (updated_components.lineage) {\n                this.#onEntityReparentedByEuid({\n                    entity,\n                    new_parent_euid: updated_components.lineage.parentUUID ?? null,\n                });\n            }\n\n            entity._applyComponentsUpdate({\n                components: updated_components,\n                deleted_components,\n                dispatch_event: true,\n                emitter,\n            });\n        }\n    }\n\n    /**\n     * @internal\n     */\n    _onEntityReparented = (): void => {\n        this.#instance._updateEntities();\n    };\n\n    /**\n     *\n     */\n    #onEntityReparentedByEuid = async ({\n        entity,\n        new_parent_euid,\n    }: {\n        entity: EntityType;\n        new_parent_euid: UUID | null;\n    }): Promise<void> => {\n        if (!new_parent_euid) {\n            entity._set_parent(null);\n            return;\n        }\n\n        const parent_entities = await this.findEntities({ entity_uuid: new_parent_euid });\n        const entityLineage = entity.lineage;\n        if (!entityLineage) {\n            entity._set_parent(parent_entities[0] ?? null);\n            return;\n        }\n\n        const parentEntity = parent_entities.find(parent => {\n            if (!parent.lineage) {\n                return false;\n            }\n            return parent.lineage.value.every((linkerEUID, i) => linkerEUID === entityLineage.value[i]);\n        });\n\n        entity._set_parent(parentEntity ?? null);\n    };\n\n    /**\n     * @internal\n     */\n    _onScriptEventReceived = ({\n        emitter_rtid,\n        event_name,\n        target_rtids,\n        data_object,\n    }: Events.ScriptEventTriggeredEvent): void => {\n        const emitter_entity = this._entity_registry.get({ entity_rtid: emitter_rtid });\n        if (emitter_entity) {\n            emitter_entity._onScriptEventEmitted({ event_name, target_rtids, data_object });\n        }\n\n        const script_event_received_event = new ScriptEventReceived({ event_name, emitter_entity, data_object });\n\n        // If no target RTIDs are specified, broadcast to all entities\n        if (target_rtids.length === 0) {\n            for (const entity of this._entity_registry.all()) {\n                entity._onScriptEventReceived({ script_event_received_event });\n            }\n        } else {\n            for (const entity_rtid of target_rtids) {\n                const target_entity = this._entity_registry.get({ entity_rtid });\n                if (target_entity) {\n                    target_entity._onScriptEventReceived({ script_event_received_event });\n                }\n            }\n        }\n    };\n\n    /**\n     * @internal\n     */\n    _sanitizeComponentValue<_ComponentName extends ComponentName>({\n        component_name,\n        value,\n    }: {\n        component_name: _ComponentName;\n        value: Partial<ComponentType<_ComponentName>> | undefined;\n    }): ComponentType<_ComponentName> {\n        return this.#core.sanitizeComponentValue({ component_name, value });\n    }\n\n    /**\n     *\n     */\n    #resolveEntityResponses({ entity_responses }: { entity_responses: Array<EntityResponse> }): Array<EntityType> {\n        return entity_responses.map(this.#resolveEntityResponse);\n    }\n\n    /**\n     *\n     */\n    #resolveEntityResponse = (entity_response: EntityResponse): EntityType => {\n        const entity = this._entity_registry.get({ entity_rtid: entity_response.components.euid.rtid });\n        if (entity) {\n            return entity;\n        }\n\n        const parent: EntityType | null = entity_response.ancestors\n            ? this.#resolveEntityAncestors(entity_response.ancestors)\n            : null;\n\n        return this._instantiateEntity({\n            parent,\n            components: entity_response.components,\n            is_visible: entity_response.is_visible,\n            children_rtid: entity_response.children_rtid,\n        });\n    };\n\n    /**\n     *\n     */\n    #resolveEntityAncestors = (ancestors: EntityResponse[]): EntityType | null => {\n        let current_parent: EntityType | null = null;\n\n        for (const ancestor of ancestors) {\n            const entity = this._entity_registry.get({ entity_rtid: ancestor.components.euid.rtid });\n            if (entity) {\n                current_parent = entity;\n            } else {\n                current_parent = this._instantiateEntity({\n                    parent: current_parent,\n                    components: ancestor.components,\n                    is_visible: ancestor.is_visible,\n                    children_rtid: ancestor.children_rtid,\n                });\n            }\n        }\n\n        return current_parent;\n    };\n\n    /**\n     * @internal\n     */\n    _resolveEmitter(emitter: Events.Emitter | null): Client | null {\n        if (emitter === null) {\n            return null;\n        }\n\n        const session = this.#instance.session;\n\n        if (emitter.session_id !== this.#instance.session.session_id) {\n            return session._instantiateClient({\n                core: this.#instance,\n                client_info: emitter,\n                session_id: emitter.session_id,\n            });\n        }\n\n        return session.getClient(emitter);\n    }\n\n    /**\n     * Get the current scene settings.\n     * These values can be updated in real-time by other clients.\n     * Altering these values locally will update the scene settings on the server\n     * and broadcast the changes to other connected clients.\n     *\n     * @returns The current scene settings.\n     */\n    async getSettings(): Promise<Readonly<SceneSettingsRecord>> {\n        return this._settings.values;\n    }\n\n    /**\n     * Get scene information such as the entity count, triangle count,\n     * and scene bounding box.\n     *\n     * @returns The scene info.\n     */\n    async getInfo(): Promise<SceneInfo<EntityType>> {\n        return this.#scene_info_promise.promise;\n    }\n\n    /**\n     * Wait until the server reports it has finished loading every pending scene, so that the\n     * entities of the scenes referenced through `scene_ref` components are addressable. Resolves\n     * immediately if the server already reported so.\n     *\n     * A scene referencing others is streamed in progressively: until the server is done, entities\n     * living in those referenced scenes are not available yet. It starts loading again \u2014 and this\n     * starts waiting again \u2014 whenever a new scene is referenced.\n     *\n     * **This has no timeout, so it may never resolve.** It waits on the server, and the server does\n     * not always report: a scene whose reference the session's token cannot read never finishes\n     * loading, and nothing marks that as an error. Disconnecting is then the only thing that ends\n     * the wait, resolving it `false`. Never rejects \u2014 a caller that cannot afford to be parked\n     * indefinitely should race it against a deadline of its own.\n     *\n     * @returns `true` once the server reports the scenes loaded, `false` if the session was\n     * disconnected before it did.\n     */\n    async waitForSceneLoaded(): Promise<boolean> {\n        if (this.#is_scene_loaded) {\n            return true;\n        }\n\n        return await Promise.race([\n            this.#scene_loaded_promise.promise.then(() => true),\n            this.#disconnected_promise.promise.then(() => false),\n        ]);\n    }\n\n    /**\n     * @internal\n     * Track whether the server is done loading scenes, applying the same test the core applies to\n     * decide a scene is loaded. `loading_payloads` is deliberately not part of it: payloads are mesh\n     * and texture data, whose streaming says nothing about whether an entity exists yet.\n     */\n    _onAssetLoadingStatusReceived = ({ pending_scenes, pending_requests }: Events.AssetLoadingStatusEvent): void => {\n        const loaded = pending_scenes === 0 && pending_requests === 0;\n\n        if (loaded) {\n            if (!this.#is_scene_loaded) {\n                this.#is_scene_loaded = true;\n                this.#scene_loaded_promise.resolve();\n            }\n        } else if (this.#is_scene_loaded) {\n            // Loading started again after having completed: the current promise is settled, so arm a\n            // fresh one for the new batch. Only done on that transition \u2014 swapping a still-pending\n            // promise would orphan whoever is already awaiting it.\n            this.#is_scene_loaded = false;\n            this.#scene_loaded_promise = new PromiseWithResolver<void>();\n        }\n    };\n\n    /**\n     * @internal\n     * Release whoever is waiting on the scene to load.\n     */\n    _onDisconnected = (): void => {\n        this.#disconnected_promise.resolve();\n    };\n\n    /**\n     * @internal\n     */\n    _onSceneInfoLoaded = (event: Events.SceneInfoLoadedEvent): void => {\n        const root_entities = this.#resolveEntityResponses({ entity_responses: event.scene_info.root_entities });\n\n        this.#scene_info_promise.resolve({\n            aabb: event.scene_info.aabb,\n            entity_count: event.scene_info.entity_count,\n            triangle_count: event.scene_info.triangle_count,\n            root_entities: root_entities,\n        });\n    };\n}\n\n/**\n * The headless core {@link Scene}, producing the headless {@link Entity}.\n *\n * @category Scene\n */\nexport class Scene extends SceneBase<Entity> {\n    /**\n     * @internal\n     */\n    protected _instantiateEntity({\n        parent,\n        components,\n        options,\n        is_visible = true,\n        children_rtid = [],\n    }: {\n        parent: Entity | null;\n        components: EntityCore;\n        options?: EntityCreationOptions;\n        is_visible?: boolean;\n        children_rtid?: Array<RTID>;\n    }): Entity {\n        return new Entity({ scene: this, parent, components, options, is_visible, children_rtid });\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { ActivityWatcher } from \"@3dverse/livelink.core\";\n\n/**\n * The longest timeout the core's activity watcher can hold, in seconds.\n *\n * The watcher hands `seconds * 1000` to `setTimeout`, whose delay is a signed 32-bit integer: past\n * 2^31 - 1 ms Node warns (`TimeoutOverflowWarning`) and fires the timer at once. So \"never\" is\n * spelled as the largest delay that does not overflow \u2014 a little under 25 days, longer than any\n * session a gateway keeps.\n */\nexport const MAX_INACTIVITY_TIMEOUT_SECONDS = Math.floor((2 ** 31 - 1) / 1000);\n\n/**\n * Turns off the core's inactivity disconnect for an agent connection.\n *\n * The watcher exists for people: a browser client that has sent nothing but heartbeats for six\n * minutes (its defaults: a warning at 300 s, disconnection at 360 s) is a user who walked away, and\n * the gateway gets its seat back. An agent has no user to walk away, and a connection that only\n * *receives* \u2014 a {@link CameraStream} on a non-headless client, which sends nothing after its\n * setup \u2014 looks exactly like one: it was being disconnected six minutes after joining, with\n * `\"inactivity\"` as the reason. Whether an agent should leave a session is {@link Agent}'s\n * `leave_on_condition` policy, not a timer counting messages.\n *\n * The watcher has no \"off\" switch, only timeouts, so both are pushed to the largest value its\n * timers can hold ({@link MAX_INACTIVITY_TIMEOUT_SECONDS}); setting them resets a watcher that is\n * already running.\n */\nexport function disableInactivityTimeout(activity_watcher: ActivityWatcher): void {\n    activity_watcher.setTimeouts({\n        warn_after_seconds: MAX_INACTIVITY_TIMEOUT_SECONDS - 1,\n        timeout_after_seconds: MAX_INACTIVITY_TIMEOUT_SECONDS,\n    });\n}\n", "/**\n * Neutralizes a `throw` from a WebSocket `onerror` handler under Node.\n *\n * `livelink.core`'s `GatewayConnection.connect` installs `socket.onerror = () => { throw new\n * Error(\"Gateway socket error\") }`. A throw from an event listener reaches no caller: under Node it\n * escapes undici's dispatch as an `uncaughtException`, with a stack whose top frame is the whole\n * base64 `data:` module the core is evaluated from. It also says nothing new \u2014 `close` always\n * follows `error`, and the core turns that into a `forcibly_closed` disconnect the agent handles.\n *\n * Remove this once the core no longer throws.\n */\n\n//------------------------------------------------------------------------------\ntype ErrorHandler = ((this: WebSocket, event: Event) => unknown) | null;\n\n//------------------------------------------------------------------------------\nlet installed = false;\n\n/**\n * Wraps the global `WebSocket` so that an exception thrown out of an `onerror` handler is logged\n * instead of crashing the process. Handlers that don't throw are unaffected.\n *\n * No-op outside Node, and idempotent.\n */\nexport function installGatewaySocketGuard(): void {\n    const is_node = typeof process !== \"undefined\" && process.versions != null && process.versions.node != null;\n    if (installed || !is_node || typeof globalThis.WebSocket !== \"function\") {\n        return;\n    }\n\n    installed = true;\n    const NativeWebSocket = globalThis.WebSocket;\n\n    class GuardedWebSocket extends NativeWebSocket {\n        constructor(url: string | URL, protocols?: string | string[]) {\n            super(url, protocols);\n\n            let handler: ErrorHandler = null;\n            let wrapped: ((event: Event) => void) | null = null;\n\n            Object.defineProperty(this, \"onerror\", {\n                configurable: true,\n                enumerable: true,\n                get: (): ErrorHandler => handler,\n                set: (new_handler: ErrorHandler): void => {\n                    if (wrapped) {\n                        this.removeEventListener(\"error\", wrapped);\n                        wrapped = null;\n                    }\n\n                    handler = typeof new_handler === \"function\" ? new_handler : null;\n\n                    if (handler) {\n                        const callee = handler;\n                        wrapped = (event: Event): void => {\n                            try {\n                                callee.call(this, event);\n                            } catch (error) {\n                                // The message only: the stack of a handler living in the core is\n                                // rooted in the base64 `data:` module, which is what makes the\n                                // uncaught version unreadable in the first place.\n                                const message = error instanceof Error ? error.message : String(error);\n                                console.warn(`[livelink.agent] suppressed error thrown from onerror: ${message}`);\n                            }\n                        };\n                        this.addEventListener(\"error\", wrapped);\n                    }\n                },\n            });\n        }\n    }\n\n    globalThis.WebSocket = GuardedWebSocket;\n}\n", "//------------------------------------------------------------------------------\nimport type { LivelinkCore, UUID } from \"@3dverse/livelink.core\";\nimport { DynamicLoader } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport { LivelinkBase, type LivelinkProgressCallback, type UpdateLoopRates } from \"@livelink.base/LivelinkBase\";\nimport type { Entity } from \"@livelink.base/scene/Entity\";\nimport { Scene } from \"@livelink.base/scene/Scene\";\nimport { Session, type SessionSelector } from \"@livelink.base/session/Session\";\nimport type { SessionInfo } from \"@livelink.base/session/SessionInfo\";\n\n//------------------------------------------------------------------------------\nimport { disableInactivityTimeout } from \"./inactivity\";\nimport { installGatewaySocketGuard } from \"./nodeSocketGuard\";\n\n/**\n * The main class for connecting a headless agent to a 3dverse session.\n *\n * Usage:\n * - `Livelink.start()` to create a new session\n * - `Livelink.join()` to join an existing session\n * - `Livelink.join_or_start()` to join or create a session\n *\n * @category Main\n */\nexport class Livelink extends LivelinkBase<Entity, Scene, Session> {\n    /**\n     * Creates a new session and connects to it.\n     */\n    static async start({\n        scene_id,\n        token,\n        is_transient = false,\n        session_options,\n        onProgress,\n    }: {\n        scene_id: UUID;\n        token: string;\n        is_transient?: boolean;\n        session_options?: Record<string, boolean>;\n        onProgress?: LivelinkProgressCallback;\n    }): Promise<Livelink> {\n        onProgress?.(\"creating-session\");\n        const session = await Session.create({ scene_id, token, is_transient, options: session_options });\n        return await Livelink.join({ session, onProgress });\n    }\n\n    /**\n     * Connects to an existing session matching the given scene ID.\n     * If no session is found, a new session is created.\n     */\n    static async join_or_start({\n        scene_id,\n        token,\n        session_selector = ({ sessions }: { sessions: Array<SessionInfo> }): SessionInfo => sessions[0],\n        is_transient = false,\n        session_options,\n        onProgress,\n    }: {\n        scene_id: UUID;\n        token: string;\n        session_selector?: SessionSelector;\n        is_transient?: boolean;\n        session_options?: Record<string, boolean>;\n        onProgress?: LivelinkProgressCallback;\n    }): Promise<Livelink> {\n        onProgress?.(\"finding-session\");\n        const session = await Session.find({ scene_id, token, session_selector });\n        if (session === null) {\n            return await Livelink.start({ scene_id, token, is_transient, session_options, onProgress });\n        }\n\n        try {\n            return await Livelink.join({ session, onProgress });\n        } catch {\n            return await Livelink.join_or_start({\n                scene_id,\n                token,\n                session_selector: ({ sessions }) => {\n                    const filtered = sessions.filter(s => s.session_id !== session.session_id);\n                    return filtered.length === 0 ? null : session_selector({ sessions: filtered });\n                },\n                is_transient,\n                session_options,\n                onProgress,\n            });\n        }\n    }\n\n    /**\n     * Connects to an existing session.\n     *\n     * The session can be provided either as a fully-constructed {@link Session} instance, or as a\n     * {@link SessionInfo} along with the authentication token to use against it.\n     */\n    static async join({\n        session,\n        onProgress,\n    }: {\n        session: Session | { session_info: SessionInfo; token: string };\n        onProgress?: LivelinkProgressCallback;\n    }): Promise<Livelink> {\n        onProgress?.(\"initializing\");\n        installGatewaySocketGuard();\n        await DynamicLoader.load();\n\n        const session_instance = session instanceof Session ? session : Session.createFromInfo(session);\n\n        const livelink = new Livelink({ session: session_instance });\n        await livelink._connect({ is_headless: true, onProgress });\n\n        // An agent is never \"idle\" the way a user is; without this the core drops a connection\n        // that has sent nothing but heartbeats for six minutes. See `disableInactivityTimeout`.\n        disableInactivityTimeout(livelink.activity_watcher);\n\n        onProgress?.(\"ready\");\n        return livelink;\n    }\n\n    /**\n     * @internal\n     */\n    protected _createScene({ core }: { core: LivelinkCore }): Scene {\n        return new Scene(this, core);\n    }\n\n    /**\n     * Starts the client update loop.\n     *\n     * Each rate must be a finite number in the `(0, 125]` range so that the resulting interval is\n     * at least 8 milliseconds.\n     *\n     * @throws RangeError if a rate falls outside the accepted range.\n     */\n    async startUpdateLoop({ updates_per_second, broadcasts_per_second }: UpdateLoopRates = {}): Promise<void> {\n        this._startUpdateLoop({ updates_per_second, broadcasts_per_second });\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { Livelink } from \"./Livelink\";\nimport type { SessionLeaveReason } from \"./Agent\";\n\n/**\n * Event emitted when the agent has created a new session.\n *\n * Dispatched by {@link Agent} as `on-session-created`.\n *\n * @event\n * @noInheritDoc\n * @category Main / Events\n */\nexport class SessionCreatedEvent extends Event {\n    /**\n     * The livelink of the created session.\n     */\n    public readonly livelink: Livelink;\n\n    /**\n     * @internal\n     */\n    constructor({ livelink }: { livelink: Livelink }) {\n        super(\"on-session-created\");\n        this.livelink = livelink;\n    }\n}\n\n/**\n * Event emitted when the agent has joined a pre-existing session.\n *\n * Dispatched by {@link Agent} as `on-session-joined`.\n *\n * @event\n * @noInheritDoc\n * @category Main / Events\n */\nexport class SessionJoinedEvent extends Event {\n    /**\n     * The livelink of the joined session.\n     */\n    public readonly livelink: Livelink;\n\n    /**\n     * @internal\n     */\n    constructor({ livelink }: { livelink: Livelink }) {\n        super(\"on-session-joined\");\n        this.livelink = livelink;\n    }\n}\n\n/**\n * Event emitted when a session is ready, after it has been created or joined.\n *\n * Dispatched by {@link Agent} as `on-session-ready`.\n *\n * @event\n * @noInheritDoc\n * @category Main / Events\n */\nexport class SessionReadyEvent extends Event {\n    /**\n     * The livelink of the ready session.\n     */\n    public readonly livelink: Livelink;\n\n    /**\n     * @internal\n     */\n    constructor({ livelink }: { livelink: Livelink }) {\n        super(\"on-session-ready\");\n        this.livelink = livelink;\n    }\n}\n\n/**\n * Event emitted when the agent has left a session.\n *\n * Dispatched by {@link Agent} as `on-session-left`.\n *\n * @event\n * @noInheritDoc\n * @category Main / Events\n */\nexport class SessionLeftEvent extends Event {\n    /**\n     * The livelink of the left session.\n     */\n    public readonly livelink: Livelink;\n\n    /**\n     * The reason why the session was left.\n     */\n    public readonly reason: SessionLeaveReason;\n\n    /**\n     * @internal\n     */\n    constructor({ livelink, reason }: { livelink: Livelink; reason: SessionLeaveReason }) {\n        super(\"on-session-left\");\n        this.livelink = livelink;\n        this.reason = reason;\n    }\n}\n\n/**\n * Event emitted when an error occurs in the agent.\n *\n * Dispatched by {@link Agent} as `on-error`.\n *\n * @event\n * @noInheritDoc\n * @category Main / Events\n */\nexport class AgentErrorEvent extends Event {\n    /**\n     * The error that occurred.\n     */\n    public readonly error: Error;\n\n    /**\n     * The livelink of the session tied to the error, or null if the error is not tied to an\n     * established session (e.g. a failed join or a failed session list poll).\n     */\n    public readonly livelink: Livelink | null;\n\n    /**\n     * @internal\n     */\n    constructor({ error, livelink }: { error: Error; livelink: Livelink | null }) {\n        super(\"on-error\");\n        this.error = error;\n        this.livelink = livelink;\n    }\n}\n\n/**\n * Event emitted when the agent stops, whether it was stopped through {@link Agent.stop} or stopped\n * itself having run out of work (see {@link AgentConfig.mode}).\n *\n * Dispatched by {@link Agent} as `on-stopped`, once all sessions have been left.\n *\n * @event\n * @noInheritDoc\n * @category Main / Events\n */\nexport class AgentStoppedEvent extends Event {\n    /**\n     * Whether the agent stopped itself rather than being stopped through {@link Agent.stop}.\n     */\n    public readonly is_automatic: boolean;\n\n    /**\n     * @internal\n     */\n    constructor({ is_automatic }: { is_automatic: boolean }) {\n        super(\"on-stopped\");\n        this.is_automatic = is_automatic;\n    }\n}\n\n/**\n * Events emitted by the {@link Agent}.\n *\n * @event\n * @category Main / Events\n */\nexport type AgentEvents = {\n    \"on-session-created\": SessionCreatedEvent;\n    \"on-session-joined\": SessionJoinedEvent;\n    \"on-session-ready\": SessionReadyEvent;\n    \"on-session-left\": SessionLeftEvent;\n    \"on-stopped\": AgentStoppedEvent;\n    \"on-error\": AgentErrorEvent;\n};\n", "//------------------------------------------------------------------------------\nimport type { UUID } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport { Livelink } from \"./Livelink\";\nimport {\n    AgentErrorEvent,\n    AgentEvents,\n    AgentStoppedEvent,\n    SessionCreatedEvent,\n    SessionJoinedEvent,\n    SessionLeftEvent,\n    SessionReadyEvent,\n} from \"./AgentEvents\";\nimport type { LivelinkConnectionStage, LivelinkProgressCallback, UpdateLoopRates } from \"@livelink.base/LivelinkBase\";\nimport { Client } from \"@livelink.base/session/Client\";\nimport { Scene } from \"@livelink.base/scene/Scene\";\nimport { Session, type SessionSelector } from \"@livelink.base/session/Session\";\nimport type { SessionInfo } from \"@livelink.base/session/SessionInfo\";\nimport { TypedEventTarget } from \"@livelink.base/TypedEventTarget\";\n\n/**\n * The reason why the agent left a session.\n *\n * - `\"left-on-condition\"`: the agent left because the leave condition was met for longer than\n *   the configured `leave_on_condition.after_seconds`.\n * - `\"disconnected\"`: the connection to the session was lost.\n * - `\"stopped\"`: the agent left deliberately, either via {@link Agent.stop} or {@link Agent.leave}.\n *\n * @inline\n * @category Main\n */\nexport type SessionLeaveReason = \"left-on-condition\" | \"disconnected\" | \"stopped\";\n\n/**\n * The strategy used by the agent to attach to sessions of a scene.\n *\n * - `\"start\"`: always create a new session.\n * - `\"join\"`: join a single existing session. If none exists, fail unless `watch` is enabled, in\n *   which case the agent idles and joins the first session that appears.\n * - `\"join-or-start\"`: join an existing session if one exists, otherwise create a new one.\n * - `\"join-all\"`: join all existing sessions of the scene. Combine with `watch` to also join\n *   sessions appearing later.\n * - `\"manual\"`: attach to nothing on start; the agent stays idle and joins sessions on demand\n *   through its `join` method.\n *\n * Except in `\"manual\"` mode and when `watch` is enabled, an agent that loses its last session\n * without being told to \u2014 the session dropped, or its leave condition fired \u2014 has no way of getting\n * more work, and stops itself, dispatching `on-stopped`. A session left deliberately through\n * {@link Agent.leave} does not stop the agent, so it can be rejoined with {@link Agent.join}.\n *\n * @inline\n * @category Main\n */\nexport type AgentMode = \"start\" | \"join\" | \"join-or-start\" | \"join-all\" | \"manual\";\n\n/**\n * Configuration for an agent.\n *\n * @inline\n * @category Main\n */\nexport type AgentConfig = {\n    /**\n     * The unique identifier of the scene to run.\n     */\n    scene_id: UUID;\n\n    /**\n     * The authentication token.\n     */\n    token: string;\n\n    /**\n     * The strategy used to attach to sessions of the scene.\n     * Defaults to `\"join-or-start\"`.\n     */\n    mode?: AgentMode;\n\n    /**\n     * Whether sessions created by the agent are transient. Transient sessions are temporary and\n     * changes are not saved. Only used by the `\"start\"` and `\"join-or-start\"` modes.\n     */\n    is_transient?: boolean;\n\n    /**\n     * Options for creating the session. Only used by the `\"start\"` and `\"join-or-start\"` modes.\n     */\n    session_options?: Record<string, boolean>;\n\n    /**\n     * A callback that selects a session from a list of candidate sessions.\n     * Only used by the `\"join\"` and `\"join-or-start\"` modes.\n     */\n    session_selector?: SessionSelector;\n\n    /**\n     * Poll the session list regularly and join sessions that appear.\n     * Only valid with the `\"join\"` and `\"join-all\"` modes.\n     */\n    watch?: {\n        /**\n         * The polling interval in seconds. Defaults to 10.\n         */\n        interval_seconds?: number;\n    };\n\n    /**\n     * Leave a session when the configured leave condition is met for the given duration.\n     */\n    leave_on_condition?: {\n        /**\n         * The number of seconds the condition must persist before leaving the session.\n         */\n        after_seconds: number;\n\n        /**\n         * The UUID of the `agent_roster` entity, under which each agent registers a marker entity\n         * named after its own client id (see {@link Session.client_id}). When set, the default\n         * `should_stay` predicate uses the roster's children to identify which of the other clients are agents.\n         * If the entity is not found in the scene, an error is logged and the check falls back to plain\n         * other-client presence.\n         */\n        agent_roster_id?: UUID;\n\n        /**\n         * Determines whether the agent should stay in the session based on the given livelink and the\n         * other clients connected. Defaults to stay while a non-agent client is present (see `agent_roster_id`),\n         * or any other client is present when roster is absent.\n         */\n        should_stay?: (params: {\n            livelink: Livelink;\n            other_clients: ReadonlyArray<Client>;\n        }) => boolean | Promise<boolean>;\n    };\n\n    /**\n     * Options for the headless client update loop started in each session.\n     */\n    headless_client?: UpdateLoopRates;\n\n    /**\n     * Callback for tracking connection progress of each session the agent attaches to.\n     */\n    onProgress?: (stage: LivelinkConnectionStage, info: { session_id?: UUID }) => void;\n};\n\n/**\n * @internal\n */\ntype SessionRecord = {\n    livelink: Livelink;\n    leave_timer: ReturnType<typeof setTimeout> | null;\n    detachListeners: () => void;\n};\n\n/**\n * The default interval, in seconds, at which the agent watches for sessions to join.\n */\nconst DEFAULT_WATCH_INTERVAL_SECONDS = 10;\n\n/**\n * The default stay predicate.\n *\n * When an `agent_roster_id` is configured and the roster entity is found, the agent stays only\n * while a non-agent client is present: the roster's children are marker entities named after each\n * agent's client id, so any other client whose id is not a marker name is a real viewer. When the\n * roster entity is configured but missing, an error is logged. Absent a usable roster, the agent\n * falls back to staying while any other client with client_type \"guest\" or \"user\" is present.\n * Meaningwhile, it's recommeneded to use an api key as the agent's token, so that the agent is always a \"api\" client\n * and never counts as company, so the roster becomes unnecessary.\n */\nconst defaultShouldStay = async ({\n    livelink,\n    other_clients,\n    agent_roster_id,\n}: {\n    livelink: Livelink;\n    other_clients: ReadonlyArray<Client>;\n    agent_roster_id?: UUID;\n}): Promise<boolean> => {\n    if (agent_roster_id) {\n        const roster = await livelink.scene.findEntity({ entity_uuid: agent_roster_id });\n        if (roster) {\n            const marker_names = new Set((await roster.getChildren()).map(child => child.name));\n            // Stay only while a non-agent (real viewer) client is present.\n            return other_clients.some(client => !marker_names.has(client.id));\n        }\n        console.error(\n            `agent_roster entity ${agent_roster_id} not found in session ${livelink.session.session_id}; ` +\n                `falling back to other-client presence.`,\n        );\n    }\n    // Fallback: stay while any other client is connected.\n    const viewers = other_clients.filter(({ client_type }) => [\"guest\", \"user\"].includes(client_type));\n    return viewers.length > 0;\n};\n\n/**\n * The default session selector, which picks the first session in the list.\n */\nconst defaultSessionSelector: SessionSelector = ({ sessions }) => {\n    return sessions[0] ?? null;\n};\n\n/**\n * A headless 3dverse agent.\n *\n * Instantiate this class to create an agent that attaches to one or more sessions of a scene and\n * controls them programmatically. The attachment policy is fixed at construction via the\n * {@link AgentConfig}:\n * - the attachment mode (see {@link AgentMode}),\n * - an optional watch loop polling the session list and joining sessions as they appear,\n * - an optional leave-on-condition policy.\n *\n * Each session the agent attaches to gets its own {@link Livelink}. Observe the lifecycle through\n * the typed events the agent dispatches (see {@link AgentEvents}); every session event carries its\n * `livelink`. The agent is driven by composition \u2014 there is nothing to subclass.\n *\n * Example:\n * ```typescript\n * const agent = new Agent({\n *     config: {\n *         scene_id: \"...\",\n *         token: \"...\",\n *         mode: \"join-all\",\n *         watch: { interval_seconds: 10 },\n *         leave_on_condition: { after_seconds: 60 },\n *     },\n * });\n *\n * agent.addEventListener(\"on-session-ready\", async event => {\n *     const entity = await event.livelink.scene.findEntity({ entity_uuid: \"...\" });\n *     // control the scene...\n * });\n *\n * await agent.start();\n * ```\n *\n * @category Main\n */\nexport class Agent extends TypedEventTarget<AgentEvents> {\n    /**\n     * The immutable configuration of the agent, fixed at construction.\n     */\n    readonly #config: AgentConfig;\n\n    /**\n     * Active sessions, keyed by session id.\n     */\n    readonly #records = new Map<UUID, SessionRecord>();\n\n    /**\n     * Sessions with a join attempt in flight, to dedup concurrent attempts.\n     */\n    readonly #joining = new Set<UUID>();\n\n    /**\n     * Sessions asked to leave while their join was still in flight, keyed by session id with the\n     * requested reason. Consumed by {@link #establish} to abort the join instead of staying attached,\n     * or by {@link #join} when the join failed before reaching {@link #establish}.\n     */\n    readonly #leave_during_join = new Map<UUID, SessionLeaveReason>();\n\n    /**\n     * Sessions the agent has left, with the reason, used by the watch rejoin policy.\n     */\n    readonly #left = new Map<UUID, SessionLeaveReason>();\n\n    /**\n     *\n     */\n    #watch_timeout: ReturnType<typeof setTimeout> | null = null;\n\n    /**\n     * Whether the agent is currently started. Everything the agent does off the back of a timer or\n     * an in-flight promise checks this before touching a session, so that a `stop()` landing\n     * mid-flight is honoured.\n     */\n    #started: boolean = false;\n\n    /**\n     * The configuration this agent was built with, fixed at construction. Read-only: an agent's\n     * attach policy and update rates are settled before it starts.\n     */\n    get config(): Readonly<AgentConfig> {\n        return this.#config;\n    }\n\n    /**\n     * The livelinks of all sessions the agent is currently attached to.\n     */\n    get livelinks(): ReadonlyArray<Livelink> {\n        return Array.from(this.#records.values(), record => record.livelink);\n    }\n\n    /**\n     * The session the agent is connected to.\n     * Only valid when the agent is attached to exactly one session, throws otherwise.\n     * Convenience for single-session agents; use {@link livelinks} otherwise.\n     */\n    get session(): Session {\n        return this.#single_livelink.session;\n    }\n\n    /**\n     * The scene managed by the agent.\n     * Only valid when the agent is attached to exactly one session, throws otherwise.\n     * Convenience for single-session agents; use {@link livelinks} otherwise.\n     */\n    get scene(): Scene {\n        return this.#single_livelink.scene;\n    }\n\n    /**\n     *\n     */\n    get #single_livelink(): Livelink {\n        const livelinks = this.livelinks;\n        if (livelinks.length === 0) {\n            throw new Error(\"Agent is not connected to a session\");\n        }\n        if (livelinks.length > 1) {\n            throw new Error(\"Agent is connected to multiple sessions, use livelinks or getLivelink instead\");\n        }\n        return livelinks[0];\n    }\n\n    /**\n     * @param config - The immutable configuration of the agent.\n     */\n    constructor({ config }: { config: AgentConfig }) {\n        super();\n\n        const mode = config.mode ?? \"join-or-start\";\n        if (config.watch && mode !== \"join\" && mode !== \"join-all\") {\n            throw new Error(`The watch option is only valid with the \"join\" and \"join-all\" modes, got \"${mode}\".`);\n        }\n\n        this.#config = config;\n    }\n\n    /**\n     * Get the livelink of a session the agent is attached to, or null if not attached to it.\n     */\n    getLivelink({ session_id }: { session_id: UUID }): Livelink | null {\n        return this.#records.get(session_id)?.livelink ?? null;\n    }\n\n    /**\n     * Attach to sessions according to the configured mode and start the agent.\n     * Resolves once the initial attachment wave is done; the watch loop, if enabled, keeps\n     * running in the background.\n     *\n     * @throws If the agent is already started, or if the initial attachment fails. A failed start\n     * leaves the agent stopped: any session attached by the failed wave is left behind.\n     */\n    async start(): Promise<void> {\n        if (this.#started) {\n            throw new Error(\"Agent is already started\");\n        }\n        this.#started = true;\n        this.#joining.clear();\n        this.#left.clear();\n        this.#leave_during_join.clear();\n\n        try {\n            await this.#attach();\n\n            if (this.#config.watch && this.#started) {\n                this.#scheduleWatchTick();\n            }\n        } catch (error) {\n            await this.stop();\n            throw error;\n        }\n    }\n\n    /**\n     * The initial attachment wave: attach to sessions according to the configured mode.\n     */\n    async #attach(): Promise<void> {\n        const { scene_id, token, is_transient, session_options, session_selector } = this.#config;\n        const mode = this.#config.mode ?? \"join-or-start\";\n\n        switch (mode) {\n            case \"start\": {\n                const livelink = await Livelink.start({\n                    scene_id,\n                    token,\n                    is_transient,\n                    session_options,\n                    onProgress: this.#makeProgressCallback({}),\n                });\n                await this.#establish({ livelink });\n                break;\n            }\n\n            case \"join-or-start\": {\n                const livelink = await Livelink.join_or_start({\n                    scene_id,\n                    token,\n                    session_selector,\n                    is_transient,\n                    session_options,\n                    onProgress: this.#makeProgressCallback({}),\n                });\n                await this.#establish({ livelink });\n                break;\n            }\n\n            case \"join\": {\n                const sessions = await Session.list({ scene_id, token });\n                const selector = session_selector ?? defaultSessionSelector;\n                const session_info = sessions.length > 0 ? selector({ sessions }) : null;\n                if (session_info) {\n                    await this.#join({ session_info });\n                } else if (!this.#config.watch) {\n                    throw new Error(`No session found for scene ${scene_id}.`);\n                }\n                break;\n            }\n\n            case \"join-all\": {\n                const sessions = await Session.list({ scene_id, token });\n                await Promise.all(sessions.map(session_info => this.#join({ session_info })));\n                break;\n            }\n\n            case \"manual\": {\n                // Attach to nothing on start; the agent joins sessions on demand via join().\n                break;\n            }\n        }\n    }\n\n    /**\n     * Stop the agent: leave all sessions (with reason `\"stopped\"`) and stop the watch loop.\n     * Resolves once all sessions have been left; do any post-stop cleanup after it returns.\n     * No-op if the agent is not started.\n     *\n     * Dispatches `on-stopped`. The agent may also stop itself, dispatching the same event with\n     * `is_automatic` set \u2014 see {@link AgentMode}.\n     */\n    async stop(): Promise<void> {\n        await this.#stop({ is_automatic: false });\n    }\n\n    /**\n     * Stop the agent, recording whether it stopped itself. A no-op if not started.\n     */\n    async #stop({ is_automatic }: { is_automatic: boolean }): Promise<void> {\n        if (!this.#started) {\n            return;\n        }\n        // Cleared before any await: it is what makes #maybeStopWhenIdle a no-op for the leaves\n        // below, so tearing down the last session here cannot re-enter this method.\n        this.#started = false;\n\n        if (this.#watch_timeout !== null) {\n            clearTimeout(this.#watch_timeout);\n            this.#watch_timeout = null;\n        }\n\n        const session_ids = Array.from(this.#records.keys());\n        const leave_promises = session_ids.map(session_id => this.#leave({ session_id, reason: \"stopped\" }));\n        await Promise.all(leave_promises);\n\n        this._dispatchEvent(new AgentStoppedEvent({ is_automatic }));\n    }\n\n    /**\n     * Stop the agent once it has run out of work and has no way of getting more on its own: nothing\n     * attached, nothing joining, no watch loop to pick up a new session. The `\"manual\"` mode is\n     * excluded because its consumer drives the joins, and so is a deliberate {@link Agent.leave},\n     * which documents rejoining later through {@link Agent.join}.\n     *\n     * Without this the process behind a single-session agent would stay alive with nothing left to\n     * do, since the update loop and the leave timer are gone but nobody said to shut down.\n     */\n    async #maybeStopWhenIdle({ reason }: { reason: SessionLeaveReason }): Promise<void> {\n        const mode = this.#config.mode ?? \"join-or-start\";\n        const is_idle = this.#records.size === 0 && this.#joining.size === 0;\n\n        if (!this.#started || !is_idle || reason === \"stopped\" || mode === \"manual\" || this.#config.watch) {\n            return;\n        }\n\n        console.log(\n            `[agent] Last session left (\"${reason}\") and the \"${mode}\" mode has no watch loop to pick up ` +\n                `another one: stopping.`,\n        );\n\n        await this.#stop({ is_automatic: true });\n    }\n\n    /**\n     * Leave a single session deliberately. The watch loop never rejoins it on its own; call\n     * {@link Agent.join} to rejoin it later.\n     */\n    async leave({ session_id }: { session_id: UUID }): Promise<void> {\n        await this.#leave({ session_id, reason: \"stopped\" });\n    }\n\n    /**\n     * Join a session on demand, in particular to rejoin one previously left with\n     * {@link Agent.leave}. Clears any prior leave marker so the watch loop treats the session\n     * normally afterwards. No-op if the agent is not started, or if it is already attached to, or\n     * attaching, the session.\n     *\n     * @throws If no session with the given id is running the agent's scene.\n     */\n    async join({ session_id }: { session_id: UUID }): Promise<void> {\n        if (!this.#started) {\n            return;\n        }\n\n        this.#left.delete(session_id);\n\n        if (this.#records.has(session_id) || this.#joining.has(session_id)) {\n            return;\n        }\n\n        const sessions = await Session.list({\n            scene_id: this.#config.scene_id,\n            token: this.#config.token,\n        });\n        const session_info = sessions.find(info => info.session_id === session_id);\n        if (!session_info) {\n            throw new Error(`No session ${session_id} found for scene ${this.#config.scene_id}.`);\n        }\n\n        await this.#join({ session_info });\n    }\n\n    /**\n     * Leave a session for the given reason.\n     */\n    async #leave({ session_id, reason }: { session_id: UUID; reason: SessionLeaveReason }): Promise<void> {\n        const record = this.#records.get(session_id);\n        if (!record) {\n            // No record yet: a join for this session may still be in flight (its livelink is not\n            // attached until #establish runs). Record the leave request so #establish aborts the\n            // join instead of silently completing and staying attached.\n            if (this.#joining.has(session_id)) {\n                this.#leave_during_join.set(session_id, reason);\n            }\n            return;\n        }\n\n        this.#left.set(session_id, reason);\n        await this.#teardownRecord({ session_id, record });\n\n        this._dispatchEvent(new SessionLeftEvent({ livelink: record.livelink, reason }));\n\n        // After the event, so a listener still sees the agent started when it handles the leave.\n        await this.#maybeStopWhenIdle({ reason });\n    }\n\n    /**\n     * Consume a leave request recorded while the join was in flight, moving its reason to the left\n     * markers so the watch rejoin policy honours it. Returns the reason, or null if none was pending.\n     */\n    #consumePendingLeave({ session_id }: { session_id: UUID }): SessionLeaveReason | null {\n        const reason = this.#leave_during_join.get(session_id);\n        if (reason === undefined) {\n            return null;\n        }\n\n        this.#leave_during_join.delete(session_id);\n        this.#left.set(session_id, reason);\n        return reason;\n    }\n\n    /**\n     * Tear down an attached session's record: remove it from the agent, clear the leave timer,\n     * detach the lifecycle listeners and disconnect the livelink. Disconnection errors are\n     * dispatched as `on-error` events, never thrown.\n     */\n    async #teardownRecord({ session_id, record }: { session_id: UUID; record: SessionRecord }): Promise<void> {\n        this.#records.delete(session_id);\n\n        if (record.leave_timer !== null) {\n            clearTimeout(record.leave_timer);\n            record.leave_timer = null;\n        }\n        record.detachListeners();\n\n        const { livelink } = record;\n        try {\n            await livelink.disconnect();\n        } catch (error) {\n            this._dispatchEvent(new AgentErrorEvent({ error: error as Error, livelink }));\n        }\n    }\n\n    /**\n     *\n     */\n    #makeProgressCallback({ session_id }: { session_id?: UUID }): LivelinkProgressCallback | undefined {\n        const onProgress = this.#config.onProgress;\n        if (!onProgress) {\n            return undefined;\n        }\n        return stage => {\n            onProgress(stage, { session_id });\n        };\n    }\n\n    /**\n     * Join a session from its info. Errors are dispatched as `on-error` events, never thrown.\n     */\n    async #join({ session_info }: { session_info: SessionInfo }): Promise<void> {\n        const session_id = session_info.session_id;\n        if (this.#records.has(session_id) || this.#joining.has(session_id)) {\n            return;\n        }\n\n        this.#joining.add(session_id);\n        try {\n            const livelink = await Livelink.join({\n                session: { session_info, token: this.#config.token },\n                onProgress: this.#makeProgressCallback({ session_id }),\n            });\n            await this.#establish({ livelink });\n        } catch (error) {\n            this._dispatchEvent(new AgentErrorEvent({ error: error as Error, livelink: null }));\n        } finally {\n            this.#joining.delete(session_id);\n            // #establish consumes the marker on the paths that reach it. If the join failed before\n            // that, honour the leave here so the watch loop does not rejoin a session we left.\n            this.#consumePendingLeave({ session_id });\n        }\n    }\n\n    /**\n     * Set up an attached session: update loop, lifecycle listeners, leave timer, and dispatch the\n     * `on-session-created`/`on-session-joined` and `on-session-ready` events.\n     */\n    async #establish({ livelink }: { livelink: Livelink }): Promise<void> {\n        if (!this.#started) {\n            await livelink.disconnect();\n            return;\n        }\n\n        const { session } = livelink;\n        const { session_id } = session;\n\n        // A leave()/stop() may have targeted this session while its join was still in flight. Abort\n        // the join rather than staying attached: mark it left (so the watch loop honours the reason)\n        // and disconnect without ever dispatching created/joined/ready for a session we are leaving.\n        const pending_leave = this.#consumePendingLeave({ session_id });\n        if (pending_leave !== null) {\n            try {\n                await livelink.disconnect();\n            } catch (error) {\n                this._dispatchEvent(new AgentErrorEvent({ error: error as Error, livelink }));\n            }\n            return;\n        }\n\n        const record: SessionRecord = {\n            livelink,\n            leave_timer: null,\n            detachListeners: () => {},\n        };\n\n        const onClientCountChanged = (): void => {\n            // The evaluation awaits scene queries and a possibly user-provided `should_stay`, either\n            // of which can reject on a network hiccup. Catch here: an unhandled rejection from this\n            // listener would otherwise crash a Node agent (the sibling `onDisconnected` guards too).\n            void this.#evaluateLeaveCondition({ record }).catch((error: Error) => {\n                this._dispatchEvent(new AgentErrorEvent({ error, livelink }));\n            });\n        };\n        const onDisconnected = (): void => {\n            void this.#leave({ session_id, reason: \"disconnected\" }).catch((error: Error) => {\n                this._dispatchEvent(new AgentErrorEvent({ error, livelink }));\n            });\n        };\n\n        session.addEventListener(\"on-client-joined\", onClientCountChanged);\n        session.addEventListener(\"on-client-left\", onClientCountChanged);\n        session.addEventListener(\"on-disconnected\", onDisconnected);\n        record.detachListeners = (): void => {\n            session.removeEventListener(\"on-client-joined\", onClientCountChanged);\n            session.removeEventListener(\"on-client-left\", onClientCountChanged);\n            session.removeEventListener(\"on-disconnected\", onDisconnected);\n        };\n\n        this.#records.set(session_id, record);\n        this.#left.delete(session_id);\n\n        try {\n            await livelink.startUpdateLoop(this.#config.headless_client);\n            await this.#registerInRoster({ livelink });\n            await this.#evaluateLeaveCondition({ record });\n        } catch (error) {\n            // Setup failed (e.g. an invalid update rate or a rejecting `should_stay`): tear the\n            // session down so it does not linger with its listeners attached and its update loop\n            // running. Skipped if a concurrent disconnect already removed the record.\n            if (this.#records.get(session_id) === record) {\n                await this.#teardownRecord({ session_id, record });\n            }\n            throw error;\n        }\n\n        // The session may have disconnected during the awaits above, in which case `onDisconnected`\n        // already ran the leave (removed the record and dispatched `on-session-left`). Never fire\n        // the created/joined/ready events for a session that is gone.\n        if (!this.#started || this.#records.get(session_id) !== record) {\n            return;\n        }\n\n        if (session.has_been_created) {\n            this._dispatchEvent(new SessionCreatedEvent({ livelink }));\n        } else {\n            this._dispatchEvent(new SessionJoinedEvent({ livelink }));\n        }\n        this._dispatchEvent(new SessionReadyEvent({ livelink }));\n    }\n\n    /**\n     * Register the agent in the `agent_roster` entity by creating a marker entity named after the\n     * agent's client id. The marker is removed automatically when the agent disconnects\n     * (`delete_on_client_disconnection`). No-op when no `agent_roster_id` is configured. Errors are\n     * dispatched as `on-error` events so a roster failure never aborts the session setup.\n     */\n    async #registerInRoster({ livelink }: { livelink: Livelink }): Promise<void> {\n        const leave_on_condition = this.#config.leave_on_condition;\n        const agent_roster_id = leave_on_condition?.agent_roster_id;\n        if (!agent_roster_id) {\n            return;\n        }\n\n        try {\n            const client_id = livelink.session.client_id;\n            const roster = await livelink.scene.findEntity({ entity_uuid: agent_roster_id });\n            if (roster && client_id) {\n                await livelink.scene.newEntity({\n                    name: client_id,\n                    parent: roster,\n                    components: {},\n                    options: { delete_on_client_disconnection: true },\n                });\n            } else {\n                console.error(\n                    `agent_roster entity ${agent_roster_id} (or client id) missing in session ` +\n                        `${livelink.session.session_id}; leave-when-alone will fall back to other-client presence.`,\n                );\n            }\n        } catch (error) {\n            this._dispatchEvent(new AgentErrorEvent({ error: error as Error, livelink }));\n        }\n    }\n\n    /**\n     * Evaluate whether the agent should stay in the session, using the configured `should_stay`\n     * predicate or the default roster/other-client presence check. Returns `true` (stay) when no\n     * leave condition is configured.\n     */\n    async #shouldStay({ livelink }: { livelink: Livelink }): Promise<boolean> {\n        const leave_on_condition = this.#config.leave_on_condition;\n        if (!leave_on_condition) {\n            return true;\n        }\n\n        const other_clients = livelink.session.other_clients;\n        return leave_on_condition.should_stay\n            ? leave_on_condition.should_stay({ livelink, other_clients })\n            : defaultShouldStay({\n                  livelink,\n                  other_clients,\n                  agent_roster_id: leave_on_condition.agent_roster_id,\n              });\n    }\n\n    /**\n     * Arm the leave timer if the leave condition is not met, clear it otherwise.\n     */\n    async #evaluateLeaveCondition({ record }: { record: SessionRecord }): Promise<void> {\n        if (!this.#config.leave_on_condition) {\n            return;\n        }\n\n        const { livelink } = record;\n        if (await this.#shouldStay({ livelink })) {\n            if (record.leave_timer !== null) {\n                clearTimeout(record.leave_timer);\n                record.leave_timer = null;\n            }\n            return;\n        }\n\n        if (record.leave_timer === null) {\n            record.leave_timer = setTimeout(() => {\n                record.leave_timer = null;\n                void this.#leaveIfStillAlone({ record }).catch((error: Error) => {\n                    this._dispatchEvent(new AgentErrorEvent({ error, livelink }));\n                });\n            }, this.#config.leave_on_condition.after_seconds * 1000);\n        }\n    }\n\n    /**\n     * Leave the session because the leave condition held for the configured duration \u2014 but only\n     * after re-checking it. Condition evaluations are async and unordered, so a stale \"alone\"\n     * evaluation can arm the timer after a newer one saw company; re-evaluating here before leaving\n     * closes that race and prevents abandoning a session with a live viewer.\n     */\n    async #leaveIfStillAlone({ record }: { record: SessionRecord }): Promise<void> {\n        const { livelink } = record;\n        const session_id = livelink.session.session_id;\n\n        // The record may have been torn down (disconnect/stop/leave) while the timer was pending.\n        if (this.#records.get(session_id) !== record) {\n            return;\n        }\n\n        try {\n            if (await this.#shouldStay({ livelink })) {\n                // Company reappeared: do not leave. A later client event re-arms the timer if needed.\n                return;\n            }\n        } catch (error) {\n            // Uncertain: err on staying rather than abandoning a possibly-occupied session.\n            this._dispatchEvent(new AgentErrorEvent({ error: error as Error, livelink }));\n            return;\n        }\n\n        // Re-check the record is still ours after the await above before leaving.\n        if (this.#records.get(session_id) !== record) {\n            return;\n        }\n\n        const after_seconds = this.#config.leave_on_condition?.after_seconds;\n        console.log(`[agent] Nothing to stay for in session ${session_id} for ${after_seconds}s: leaving it.`);\n\n        await this.#leave({ session_id, reason: \"left-on-condition\" });\n    }\n\n    /**\n     *\n     */\n    #scheduleWatchTick(): void {\n        const interval_seconds = this.#config.watch?.interval_seconds ?? DEFAULT_WATCH_INTERVAL_SECONDS;\n        this.#watch_timeout = setTimeout(() => {\n            void this.#watchTick();\n        }, interval_seconds * 1000);\n    }\n\n    /**\n     * A single watch poll: list the sessions of the scene and join the new ones according to the\n     * mode and the rejoin policy. The loop survives any error.\n     */\n    async #watchTick(): Promise<void> {\n        try {\n            const sessions = await Session.list({\n                scene_id: this.#config.scene_id,\n                token: this.#config.token,\n            });\n\n            if (!this.#started) {\n                return;\n            }\n\n            const candidates = sessions.filter(session_info => {\n                const session_id = session_info.session_id;\n                if (this.#records.has(session_id) || this.#joining.has(session_id)) {\n                    return false;\n                }\n                return this.#mayRejoin({ session_info });\n            });\n\n            const mode = this.#config.mode ?? \"join-or-start\";\n            if (mode === \"join-all\") {\n                await Promise.all(candidates.map(session_info => this.#join({ session_info })));\n            } else if (mode === \"join\") {\n                if (this.#records.size === 0 && this.#joining.size === 0 && candidates.length > 0) {\n                    const selector = this.#config.session_selector ?? defaultSessionSelector;\n                    const session_info = selector({ sessions: candidates });\n                    if (session_info) {\n                        await this.#join({ session_info });\n                    }\n                }\n            }\n        } catch (error) {\n            this._dispatchEvent(new AgentErrorEvent({ error: error as Error, livelink: null }));\n        } finally {\n            if (this.#started) {\n                this.#scheduleWatchTick();\n            }\n        }\n    }\n\n    /**\n     * The watch rejoin policy for sessions the agent has previously left:\n     * - left on condition: rejoin only once the listed session has company again,\n     * - left because disconnected: rejoin freely,\n     * - left deliberately: never rejoin.\n     *\n     * The agent is disconnected while this runs, so it cannot consult the `agent_roster` markers\n     * (which require a live scene). It instead judges company from the session list's clients:\n     * any clients with client_type \"guest\" or \"user\" count as company.\n     * Meaningwhile, it's recommeneded to use an api key as the agent's token, so that the agent is always a \"api\" client\n     * and never counts as company, so the roster becomes unnecessary.\n     */\n    #mayRejoin({ session_info }: { session_info: SessionInfo }): boolean {\n        const reason = this.#left.get(session_info.session_id);\n        if (reason === undefined) {\n            return true;\n        }\n\n        switch (reason) {\n            case \"stopped\": {\n                return false;\n            }\n\n            case \"disconnected\": {\n                this.#left.delete(session_info.session_id);\n                return true;\n            }\n\n            case \"left-on-condition\": {\n                const { clients, session_id } = session_info;\n                const viewers = clients?.filter(({ client_type }) => [\"guest\", \"user\"].includes(client_type)) ?? [];\n                if (viewers.length > 0) {\n                    this.#left.delete(session_id);\n                    return true;\n                }\n                return false;\n            }\n        }\n    }\n}\n", "/**\n * Match a channel pattern against an event channel.\n *\n * Patterns use MQTT-style topic wildcards over `/`-separated segments: `+` or `*` matches exactly\n * one segment, a trailing `#` matches the rest. A pattern without wildcards is an exact match.\n *\n * ```\n * matchChannel(\"uagv/+/visualization\", \"uagv/23070/visualization\")  // true\n * matchChannel(\"uagv/#\", \"uagv/23070/state\")                        // true\n * matchChannel(\"file\", \"file\")                                     // true\n * ```\n *\n * @category Data\n */\nexport function matchChannel(pattern: string, channel: string): boolean {\n    if (pattern === channel) {\n        return true;\n    }\n    const pattern_segments = pattern.split(\"/\");\n    const channel_segments = channel.split(\"/\");\n\n    for (let i = 0; i < pattern_segments.length; i++) {\n        const segment = pattern_segments[i];\n        if (segment === \"#\") {\n            return i === pattern_segments.length - 1;\n        }\n        if (i >= channel_segments.length) {\n            return false;\n        }\n        if (segment !== \"+\" && segment !== \"*\" && segment !== channel_segments[i]) {\n            return false;\n        }\n    }\n    return pattern_segments.length === channel_segments.length;\n}\n", "//------------------------------------------------------------------------------\nimport type { EventSink, Transport } from \"../Transport\";\nimport { matchChannel } from \"../util/channel\";\n\n/**\n * Where a {@link PlaybackTransport} reads its recording from.\n *\n * A recording is a *dump of an event stream*, not necessarily a file: the same bytes are just as\n * likely to arrive as a string already in memory, an HTTP response, or records the caller parsed\n * itself. Whatever the form, the recorded content is one of three shapes:\n *\n * - an **MQTT trace dump** \u2014 lines of `<topic> <json>`; the topic becomes the event's channel;\n * - a JSON array of **envelopes** \u2014 `{ \"channel\": \"...\", \"payload\": {...}, \"timestamp\": \"...\" }`;\n * - a JSON array of **bare payloads** \u2014 no channel information, so every event is replayed on\n *   {@link PlaybackTransportConfig.default_channel}.\n *\n * @category Data\n */\nexport type PlaybackSource =\n    //--------------------------------------------------------------------------\n    // Already in memory. A `string` is the dump *itself* \u2014 never a path or a URL, which are\n    // spelled out below so the two can never be confused.\n    | string\n    | Uint8Array\n    | ArrayBuffer\n    /** Records the caller already parsed: envelopes or bare payloads, skipping `JSON.parse`. */\n    | Array<unknown>\n\n    //--------------------------------------------------------------------------\n    // Read to completion before the replay starts (see the class doc).\n    | ReadableStream<Uint8Array | string>\n    | AsyncIterable<Uint8Array | string>\n\n    //--------------------------------------------------------------------------\n    // Located. These stay plain JSON, so a `TransportSpec` naming them survives a round trip\n    // through a config file or an HTTP API.\n    /** A path on the local file system. **Node.js only.** */\n    | { file_path: string }\n    /** Anything `fetch` can retrieve. Works in the browser and in Node.js. */\n    | { url: string; init?: RequestInit }\n\n    //--------------------------------------------------------------------------\n    /** Produced on `start()`, for a source that cannot be built ahead of time. */\n    | (() => PlaybackSource | Promise<PlaybackSource>);\n\n/**\n * Configuration of a {@link PlaybackTransport}.\n *\n * @inline\n * @category Data\n */\nexport type PlaybackTransportConfig = {\n    /**\n     * The recording to replay.\n     */\n    source: PlaybackSource;\n\n    /**\n     * Only replay the messages whose channel matches this MQTT-style pattern (`+`/`*` = one segment,\n     * trailing `#` = the rest) \u2014 e.g. `\"uagv/+/+/+/visualization\"` to replay only the position\n     * frames out of a full VDA 5050 trace. Omitted = replay everything.\n     */\n    channel_filter?: string;\n\n    /**\n     * The channel given to messages that carry none (a bare-payload recording). Defaults to\n     * `\"playback\"`.\n     */\n    default_channel?: string;\n\n    /**\n     * How fast to replay, relative to the recorded pace: `1` (the default) replays in real time,\n     * `10` replays ten times faster. Only meaningful for a recording that carries timestamps \u2014\n     * without them messages are replayed back to back whatever the speed.\n     */\n    speed?: number;\n\n    /**\n     * Whether to start over when the recording ends. Defaults to `true`.\n     */\n    loop?: boolean;\n};\n\n/**\n * Configuration of the deprecated `\"file\"` transport kind.\n *\n * @deprecated Use {@link PlaybackTransportConfig} with `source: { file_path }` and the `\"playback\"`\n * kind.\n *\n * @category Data\n */\nexport type FileTransportConfig = {\n    /** Path of the playback file. Relative paths resolve against the process working directory. */\n    file_path: string;\n    /** See {@link PlaybackTransportConfig.channel_filter}. */\n    channel_filter?: string;\n    /** See {@link PlaybackTransportConfig.default_channel}. */\n    default_channel?: string;\n};\n\n/**\n * One message of a parsed recording.\n */\ntype PlaybackMessage = {\n    channel: string;\n    payload: unknown;\n    /** Epoch milliseconds, or null when the message carries no usable timestamp. */\n    timestamp: number | null;\n};\n\n/**\n * How many `() => source` hops are followed before giving up, so a factory returning itself fails\n * loudly instead of hanging.\n */\nconst MAX_SOURCE_INDIRECTIONS = 8;\n\n/**\n * How many messages one timer tick may emit before yielding to the event loop, so a dense stretch\n * of a recording never starves it.\n */\nconst MAX_MESSAGES_PER_TICK = 256;\n\n/**\n * Replays a recorded sequence of messages, pacing them from their own timestamps and looping when\n * the sequence ends.\n *\n * The recording comes from wherever {@link PlaybackSource} allows \u2014 a file, a URL, a string, a\n * buffer, a stream, an array of records \u2014 so the same transport drives a Node.js replay from disk\n * and a browser demo from a bundled dump. Only `{ file_path }` is Node-only.\n *\n * **It buffers the whole recording before replaying it.** Looping needs every message to stay in\n * memory, and pacing needs the first timestamp before the second message can be scheduled; a\n * streamed source is therefore drained to completion by `start()`. This is a replayer, not a reader\n * of live streams \u2014 for a genuinely live source, write a {@link Transport} that pushes as it reads.\n *\n * **The recorded channel is preserved**, so a mapping selecting on `channel` behaves identically\n * against a live broker and against a dump of that broker \u2014 which is the point of replaying in the\n * first place. Only a recording that carries no channel information at all falls back to a constant\n * ({@link PlaybackTransportConfig.default_channel}, `\"playback\"` by default).\n *\n * @category Data\n */\nexport class PlaybackTransport implements Transport {\n    /**\n     * The sink to push replayed events into.\n     */\n    readonly #sink: EventSink;\n\n    /**\n     * The transport configuration.\n     */\n    readonly #config: PlaybackTransportConfig;\n\n    /**\n     * The messages loaded from the recording.\n     */\n    #messages: Array<PlaybackMessage> = [];\n\n    /**\n     * The timer ID for the next scheduled message, or null if no message is scheduled.\n     */\n    #timer: ReturnType<typeof setTimeout> | null = null;\n\n    /**\n     * The index of the next message to be sent.\n     */\n    #current_index = 0;\n\n    /**\n     * The timestamp when playback started, in epoch milliseconds, or null if not started.\n     */\n    #start_time: number | null = null;\n\n    /**\n     * The timestamp of the first message of the recording, in epoch milliseconds, or null if it has\n     * none \u2014 in which case messages are replayed back to back.\n     */\n    #base_timestamp: number | null = null;\n\n    /**\n     * Whether the transport has been stopped. Used to prevent scheduling further messages after\n     * stop. Cleared on start.\n     */\n    #stopped = false;\n\n    /**\n     *\n     */\n    constructor(config: PlaybackTransportConfig, sink: EventSink) {\n        if (config.source === undefined || config.source === null) {\n            throw new Error(\"source is required in transport config\");\n        }\n        if (config.speed !== undefined && (!isFinite(config.speed) || config.speed <= 0)) {\n            throw new Error(`speed must be a finite number greater than 0, got ${config.speed}`);\n        }\n        this.#sink = sink;\n        this.#config = config;\n    }\n\n    /**\n     * Read the recording and start replaying its messages.\n     */\n    async start(): Promise<void> {\n        this.#stopped = false;\n\n        const content = await readSource(this.#config.source);\n\n        let messages: Array<PlaybackMessage>;\n        try {\n            messages = typeof content === \"string\" ? this.#parse(content) : this.#parseRecords(content);\n        } catch (error) {\n            throw new Error(\n                `Failed to parse recording: ${error instanceof Error ? error.message : String(error)}`,\n                { cause: error },\n            );\n        }\n\n        const filter = this.#config.channel_filter;\n        this.#messages =\n            filter === undefined ? messages : messages.filter(message => matchChannel(filter, message.channel));\n\n        if (messages.length > 0 && this.#messages.length === 0) {\n            console.warn(\n                `[playback-transport] None of the ${messages.length} recorded messages match the channel filter ` +\n                    `\"${filter}\"; nothing will be replayed.`,\n            );\n        }\n\n        this.#current_index = 0;\n        this.#start_time = Date.now();\n        this.#base_timestamp = this.#messages[0]?.timestamp ?? null;\n        this.#scheduleNext();\n    }\n\n    /**\n     * Stop the playback.\n     */\n    async stop(): Promise<void> {\n        this.#stopped = true;\n        if (this.#timer !== null) {\n            clearTimeout(this.#timer);\n            this.#timer = null;\n        }\n    }\n\n    /**\n     * Parse the text of a recording, telling a JSON array from an MQTT trace dump.\n     */\n    #parse(content: string): Array<PlaybackMessage> {\n        let parsed: unknown;\n        try {\n            parsed = JSON.parse(content);\n        } catch {\n            return this.#parseMqttDump(content);\n        }\n\n        if (!Array.isArray(parsed)) {\n            throw new Error(\"A JSON recording must be an array\");\n        }\n        return this.#parseRecords(parsed);\n    }\n\n    /**\n     * Parse already-decoded records \u2014 envelopes, bare payloads, or a mix of both.\n     */\n    #parseRecords(entries: Array<unknown>): Array<PlaybackMessage> {\n        const default_channel = this.#config.default_channel ?? \"playback\";\n        return entries.map(entry => {\n            // An envelope carries its own channel; anything else is a bare payload.\n            if (entry !== null && typeof entry === \"object\" && \"channel\" in entry && \"payload\" in entry) {\n                const envelope = entry as { channel: unknown; payload: unknown; timestamp?: unknown };\n                return {\n                    channel: typeof envelope.channel === \"string\" ? envelope.channel : default_channel,\n                    payload: envelope.payload,\n                    timestamp: parseTimestamp(envelope.timestamp) ?? parseTimestamp(readTimestamp(envelope.payload)),\n                };\n            }\n            return {\n                channel: default_channel,\n                payload: entry,\n                timestamp: parseTimestamp(readTimestamp(entry)),\n            };\n        });\n    }\n\n    /**\n     * Parse an MQTT trace dump \u2014 lines of `<topic> <json>` \u2014 preserving each message's topic as its\n     * channel. Malformed lines are skipped.\n     */\n    #parseMqttDump(content: string): Array<PlaybackMessage> {\n        const messages: Array<PlaybackMessage> = [];\n        for (const line of content.split(\"\\n\")) {\n            const trimmed = line.trim();\n            if (!trimmed) {\n                continue;\n            }\n            const space_index = trimmed.indexOf(\" \");\n            if (space_index === -1) {\n                continue;\n            }\n            const channel = trimmed.slice(0, space_index);\n            try {\n                const payload = JSON.parse(trimmed.slice(space_index + 1));\n                messages.push({ channel, payload, timestamp: parseTimestamp(readTimestamp(payload)) });\n            } catch {\n                // Skip malformed lines.\n            }\n        }\n\n        if (messages.length === 0) {\n            throw new Error(\"The recording is neither valid JSON nor a recognised MQTT trace dump\");\n        }\n        return messages;\n    }\n\n    /**\n     * Emit every message whose recorded time has come, then arm a timer for the next one. Loops\n     * back to the start at the end of the sequence unless `loop` is off. Does nothing once stopped.\n     *\n     * Messages that are due are emitted in the same tick rather than one timer apart: recorded at\n     * the same instant, they should be replayed at the same instant, and a timer per message would\n     * cap the replay at the host's timer granularity \u2014 around 1 kHz in Node, and 250 Hz in a\n     * browser, which clamps nested timeouts to 4 ms. That cap would silently slow down a dense\n     * recording, and `speed` with it.\n     */\n    #scheduleNext(): void {\n        if (this.#stopped) {\n            return;\n        }\n\n        let emitted = 0;\n        for (;;) {\n            if (this.#current_index >= this.#messages.length) {\n                // An empty sequence has nothing to loop over; scheduling again would spin.\n                if (this.#config.loop === false || this.#messages.length === 0) {\n                    return;\n                }\n                // Loop the recording from the messages already in memory. Re-running `start()` here\n                // would re-read and re-parse the source on every lap, and its rejection would be\n                // unhandled (fatal under Node's default `--unhandled-rejections=throw`).\n                this.#current_index = 0;\n                this.#start_time = Date.now();\n            }\n\n            const message = this.#messages[this.#current_index];\n            const delay = this.#delayFor(message);\n\n            // Yield at the burst cap even when nothing is due yet: a recording carrying no\n            // timestamps at all paces off nothing, and would otherwise spin the loop forever.\n            if (delay > 0 || emitted >= MAX_MESSAGES_PER_TICK) {\n                this.#timer = setTimeout(() => this.#scheduleNext(), delay);\n                return;\n            }\n\n            // Not awaited on purpose: the sink may be async but must not delay the next message.\n            void this.#emit(message);\n            this.#current_index++;\n            emitted++;\n        }\n    }\n\n    /**\n     * How long to wait before a message is due, from its timestamp relative to the first one and\n     * the configured speed. Zero for a recording that carries no usable timestamps.\n     */\n    #delayFor(message: PlaybackMessage): number {\n        if (this.#base_timestamp === null || message.timestamp === null || this.#start_time === null) {\n            return 0;\n        }\n        const speed = this.#config.speed ?? 1;\n        return Math.max(0, (message.timestamp - this.#base_timestamp) / speed - (Date.now() - this.#start_time));\n    }\n\n    /**\n     *\n     */\n    async #emit(message: PlaybackMessage): Promise<void> {\n        try {\n            await this.#sink.ingest({\n                channel: message.channel,\n                payload: message.payload,\n                received_at: new Date(),\n                ...(message.timestamp !== null ? { source_timestamp: new Date(message.timestamp) } : {}),\n            });\n        } catch (error) {\n            console.error(`[playback-transport] Sink failed:`, error);\n        }\n    }\n}\n\n/**\n * Resolve any {@link PlaybackSource} down to the recording's text, or to the records it already is.\n */\nasync function readSource(source: PlaybackSource, depth = 0): Promise<string | Array<unknown>> {\n    if (typeof source === \"function\") {\n        if (depth >= MAX_SOURCE_INDIRECTIONS) {\n            throw new Error(\n                `Playback source still resolved to a function after ${MAX_SOURCE_INDIRECTIONS} hops; ` +\n                    `it most likely returns itself.`,\n            );\n        }\n        return readSource(await source(), depth + 1);\n    }\n\n    if (typeof source === \"string\") {\n        return source;\n    }\n    if (Array.isArray(source)) {\n        return source;\n    }\n    if (source instanceof Uint8Array) {\n        return new TextDecoder().decode(source);\n    }\n    if (source instanceof ArrayBuffer) {\n        return new TextDecoder().decode(new Uint8Array(source));\n    }\n    if (typeof ReadableStream !== \"undefined\" && source instanceof ReadableStream) {\n        return readStream(source);\n    }\n    if (Symbol.asyncIterator in source) {\n        return readAsyncIterable(source);\n    }\n    if (\"file_path\" in source) {\n        return readFilePath(source.file_path);\n    }\n    if (\"url\" in source) {\n        return readUrl(source);\n    }\n\n    throw new Error(`Unsupported playback source: ${Object.prototype.toString.call(source)}`);\n}\n\n/**\n * Drain a `ReadableStream` into a string. Read through a reader rather than `for await`: async\n * iteration over a `ReadableStream` is still not universal in browsers.\n */\nasync function readStream(stream: ReadableStream<Uint8Array | string>): Promise<string> {\n    const reader = stream.getReader();\n    const decoder = new TextDecoder();\n    let content = \"\";\n    try {\n        for (;;) {\n            const { done, value } = await reader.read();\n            if (done) {\n                break;\n            }\n            content += typeof value === \"string\" ? value : decoder.decode(value, { stream: true });\n        }\n    } finally {\n        reader.releaseLock();\n    }\n    return content + decoder.decode();\n}\n\n/**\n * Drain an async iterable of chunks into a string.\n */\nasync function readAsyncIterable(iterable: AsyncIterable<Uint8Array | string>): Promise<string> {\n    const decoder = new TextDecoder();\n    let content = \"\";\n    for await (const chunk of iterable) {\n        content += typeof chunk === \"string\" ? chunk : decoder.decode(chunk, { stream: true });\n    }\n    return content + decoder.decode();\n}\n\n/**\n * Read a recording off the local file system. The only Node.js-only source form.\n */\nasync function readFilePath(file_path: string): Promise<string> {\n    if (!file_path) {\n        throw new Error(\"file_path is required in a { file_path } playback source\");\n    }\n    // The specifier is assembled at runtime so a bundler cannot statically analyse it. Spelled\n    // literally, `import(\"node:fs/promises\")` is a hard resolve error for any browser-targeted\n    // esbuild consumer of this package (Vite only warns), even though nothing they ship ever\n    // reaches this Node-only source form. The type-position import below is erased at compile\n    // time, so the module stays fully typed.\n    const node_fs_promises = \"node:fs\" + \"/promises\";\n    const { readFile } = (await import(/* @vite-ignore */ node_fs_promises)) as typeof import(\"node:fs/promises\");\n    return readFile(file_path, \"utf8\");\n}\n\n/**\n * Fetch a recording. A failed request throws rather than replaying the error page as a recording.\n */\nasync function readUrl({ url, init }: { url: string; init?: RequestInit }): Promise<string> {\n    const response = await fetch(url, init);\n    if (!response.ok) {\n        throw new Error(`Failed to fetch playback source \"${url}\": ${response.status} ${response.statusText}`);\n    }\n    return response.text();\n}\n\n/**\n * The `timestamp` field of a recorded payload, if it has one.\n */\nfunction readTimestamp(payload: unknown): unknown {\n    if (payload === null || typeof payload !== \"object\") {\n        return undefined;\n    }\n    return (payload as { timestamp?: unknown }).timestamp;\n}\n\n/**\n * A recorded timestamp as epoch milliseconds, or null if absent or invalid.\n */\nfunction parseTimestamp(timestamp: unknown): number | null {\n    if (typeof timestamp !== \"string\" && typeof timestamp !== \"number\") {\n        return null;\n    }\n    const date = new Date(timestamp);\n    return isNaN(date.getTime()) ? null : date.getTime();\n}\n", "//------------------------------------------------------------------------------\nimport type { IClientOptions, MqttClient } from \"mqtt\";\n\n//------------------------------------------------------------------------------\nimport type { EventSink, Transport } from \"../Transport\";\n\n/**\n * The shape of the lazily imported `mqtt` module, which differs between the CJS build Node\n * resolves and the ESM build a browser bundler resolves \u2014 see {@link MqttTransport.start}.\n */\ntype MqttModule = {\n    connect?: typeof import(\"mqtt\").connect;\n    default?: { connect: typeof import(\"mqtt\").connect };\n};\n\n/**\n * MQTT 5 DISCONNECT reason code for \"Session taken over\": another client connected with the same\n * client id, and the broker gave it the session (MQTT 5.0 \u00A73.14.2.1).\n */\nconst SESSION_TAKEN_OVER = 0x8e;\n\n/**\n * How many closes-without-error inside {@link SILENT_CLOSE_WINDOW_MS} are read as a session\n * takeover on MQTT 3.1.1, which has no packet to say so. Three: one is a network blip, two can be\n * a broker restart, three with the client reconnecting in between is another client on the same id.\n */\nconst SILENT_CLOSE_BURST = 3;\n\n/**\n * The window over which silent closes are counted, in milliseconds.\n */\nconst SILENT_CLOSE_WINDOW_MS = 30_000;\n\n/**\n * Configuration of an {@link MqttTransport}.\n *\n * @inline\n * @category Data\n */\nexport type MqttTransportConfig = {\n    /**\n     * URL of the MQTT broker, e.g. `mqtt://user:pass@broker.example.com:1883`.\n     *\n     * Optional when `options` fully describes the connection (e.g. via its `host`/`port` or\n     * `servers` fields), matching the underlying `mqtt` module's own `connect(options)` overload.\n     */\n    broker_url?: string;\n\n    /**\n     * MQTT client options passed through to the underlying `mqtt` module's `connect()`.\n     */\n    options?: IClientOptions;\n\n    /**\n     * Topics to subscribe to. MQTT wildcards (`+`, `#`) are supported.\n     */\n    topics?: Array<string>;\n};\n\n/**\n * Transport that subscribes to an MQTT broker and forwards each JSON message as an event **on its\n * topic** \u2014 the one bundled transport whose channel is a genuine routing key, so mappings can\n * select on it with a `channel` pattern.\n *\n * The QoS and retain flag travel along in the event's `metadata`.\n *\n * Requires the optional dependency `mqtt` (loaded lazily on {@link MqttTransport.start}).\n *\n * @category Data\n */\nexport class MqttTransport implements Transport {\n    /**\n     * The transport configuration.\n     */\n    readonly #config: MqttTransportConfig;\n\n    /**\n     * The sink to push events into.\n     */\n    readonly #sink: EventSink;\n\n    /**\n     * The MQTT client instance, or null if not connected.\n     */\n    #client: MqttClient | null = null;\n\n    /**\n     * Whether an `error` was reported since the last successful connect. A `close` that no error\n     * preceded is the broker \u2014 or the network \u2014 closing the socket, which is worth saying: the\n     * `mqtt` module reports every teardown it initiates itself (keepalive or connack timeout) as an\n     * error first, so a silent close never comes from this side.\n     */\n    #errored_since_connect = false;\n\n    /**\n     * How many reconnects the client has attempted since `start()`, so a reconnect loop can be\n     * counted from the log.\n     */\n    #reconnect_count = 0;\n\n    /**\n     * When the broker closed the socket without any error having been reported, most recent last,\n     * pruned to {@link SILENT_CLOSE_WINDOW_MS}. Several of these in a short window is the MQTT\n     * 3.1.1 face of a session takeover \u2014 another client connecting with this one's `clientId` \u2014\n     * which is the one thing a broker enforces that the module cannot check up front.\n     */\n    #silent_closes: Array<number> = [];\n\n    /**\n     * Whether the takeover warning has been printed since `start()`; it is printed once.\n     */\n    #takeover_warned = false;\n\n    /**\n     *\n     */\n    constructor(config: MqttTransportConfig, sink: EventSink) {\n        this.#config = config;\n        this.#sink = sink;\n    }\n\n    /**\n     * Connect to the broker and subscribe to the configured topics.\n     */\n    async start(): Promise<void> {\n        const url = this.#config.broker_url;\n        const options = this.#config.options;\n        if (!url && !options) {\n            throw new Error(\"MQTT transport config requires broker_url and/or options\");\n        }\n\n        let mqtt_module: MqttModule;\n        try {\n            mqtt_module = (await import(\"mqtt\")) as unknown as MqttModule;\n        } catch {\n            throw new Error(\n                'The MQTT transport requires the optional dependency \"mqtt\". Install it with `npm install mqtt`.',\n            );\n        }\n\n        // `mqtt` resolves to a different build per runtime: Node gets the CJS one, whose named\n        // exports interop exposes `connect` directly, while a bundler targeting the browser gets\n        // `dist/mqtt.esm.js`, whose *only* export is the default one. The package types declare\n        // both, so reading `connect` off the namespace type-checks and is undefined in a page.\n        const connect = mqtt_module.connect ?? mqtt_module.default?.connect;\n        if (!connect) {\n            throw new Error('The optional dependency \"mqtt\" resolved to a module without a `connect` export.');\n        }\n\n        // A copy, never the config's own object: `mqtt` keeps the object it is given as the\n        // client's live options and writes the `clientId` it generates into it. Handed through as\n        // is, the config would come back carrying this client's id, and anything else connecting\n        // from the same config \u2014 a second transport, a caller's own client \u2014 would connect *as*\n        // this client and take its session over.\n        const connect_options = { ...options };\n        this.#client = url ? connect(url, connect_options) : connect(connect_options);\n        if (url) {\n            console.log(\n                `[mqtt-transport] Connecting to MQTT broker at ${url.replace(/\\/\\/([^@]+)@/, \"//<credentials>@\")}...`,\n            );\n        } else {\n            console.log(\"[mqtt-transport] Connecting to MQTT broker via options...\");\n        }\n\n        this.#errored_since_connect = false;\n        this.#reconnect_count = 0;\n        this.#silent_closes = [];\n        this.#takeover_warned = false;\n\n        this.#client.on(\"connect\", () => {\n            console.log(`[mqtt-transport] Connected as ${this.#clientId()}`);\n            this.#errored_since_connect = false;\n            for (const topic of this.#config.topics ?? []) {\n                this.#client!.subscribe(topic);\n            }\n        });\n        this.#client.on(\"message\", (topic: string, payload: Buffer, packet?: { qos?: number; retain?: boolean }) => {\n            void this.#handleMessage(topic, payload.toString(), packet);\n        });\n\n        this.#client.on(\"error\", err => {\n            this.#errored_since_connect = true;\n            console.error(\"========================================\");\n            console.error(\"[mqtt-transport] >>> ERROR\");\n            console.error(\"========================================\");\n            console.error(\"Message:\", err.message);\n            console.error(\"Cause:\", err.cause);\n            console.error(\"Name:\", err.name);\n            console.error(\"Stack:\");\n            console.error(err.stack);\n        });\n\n        // An MQTT 5 broker says why it is dropping a client in a DISCONNECT packet; on MQTT 3.1.1\n        // it can only close the socket, and this never fires.\n        this.#client.on(\"disconnect\", packet => {\n            const reason = packet.properties?.reasonString;\n            console.error(\"========================================\");\n            console.error(\"[mqtt-transport] >>> DISCONNECTED BY THE BROKER\");\n            console.error(\"========================================\");\n            console.error(\"Reason code:\", packet.reasonCode ?? \"(none)\");\n            console.error(\"Reason:\", reason ?? \"(none given)\");\n            if (packet.reasonCode === SESSION_TAKEN_OVER) {\n                console.error(\n                    `Session taken over: another client connected with this client's id \"${this.#clientId()}\".`,\n                );\n            }\n        });\n\n        this.#client.on(\"close\", () => {\n            if (this.#errored_since_connect) {\n                console.log(\"[mqtt-transport] >>> CONNECTION CLOSED\");\n                return;\n            }\n            console.log(\n                \"[mqtt-transport] >>> CONNECTION CLOSED (no error was reported: the broker closed the socket, or the network did)\",\n            );\n            this.#noteSilentClose();\n        });\n\n        this.#client.on(\"offline\", () => {\n            console.log(\"[mqtt-transport] >>> CLIENT OFFLINE\");\n        });\n\n        this.#client.on(\"end\", () => {\n            console.log(\"[mqtt-transport] >>> CLIENT END\");\n        });\n\n        this.#client.on(\"reconnect\", () => {\n            this.#reconnect_count++;\n            console.log(`[mqtt-transport] >>> RECONNECTING (attempt ${this.#reconnect_count} since start)`);\n        });\n    }\n\n    /**\n     * The id this client presents to the broker \u2014 the one `mqtt` generated when the config carried\n     * none \u2014 or `\"?\"` before there is a client.\n     */\n    #clientId(): string {\n        const client_id = (this.#client?.options as { clientId?: unknown } | undefined)?.clientId;\n        return typeof client_id === \"string\" ? client_id : \"?\";\n    }\n\n    /**\n     * Records one silent close and, once, warns when they come in a burst. A broker that takes a\n     * session over says so in a DISCONNECT packet on MQTT 5, but on 3.1.1 it can only drop the\n     * socket, and a client dropped without error several times in a row while it keeps\n     * reconnecting is that, far more often than a flaky network.\n     */\n    #noteSilentClose(): void {\n        const now = Date.now();\n        this.#silent_closes.push(now);\n        this.#silent_closes = this.#silent_closes.filter(at => now - at <= SILENT_CLOSE_WINDOW_MS);\n        if (this.#takeover_warned || this.#silent_closes.length < SILENT_CLOSE_BURST) {\n            return;\n        }\n        this.#takeover_warned = true;\n        const span_s = Math.round((now - this.#silent_closes[0]) / 1000);\n        console.warn(\n            `[mqtt-transport] >>> closed by the broker ${this.#silent_closes.length} times in ${span_s} s with no error ` +\n                `reported. Most likely another client is connecting with the same clientId \"${this.#clientId()}\" ` +\n                `and the broker is handing the session back and forth (session takeover).`,\n        );\n    }\n\n    /**\n     * Disconnect from the broker.\n     */\n    async stop(): Promise<void> {\n        if (this.#client) {\n            this.#client.end();\n            this.#client = null;\n        }\n    }\n\n    /**\n     * Handle a message received from the broker by parsing it as JSON and pushing it to the sink,\n     * on its topic.\n     *\n     * @param topic The topic the message was received on.\n     * @param payload The message payload as a string.\n     * @param packet The MQTT packet, whose QoS and retain flag travel in the event's metadata.\n     */\n    async #handleMessage(topic: string, payload: string, packet?: { qos?: number; retain?: boolean }): Promise<void> {\n        let message: unknown;\n        try {\n            message = JSON.parse(payload);\n        } catch {\n            console.warn(`[mqtt-transport] Invalid JSON on topic ${topic}`);\n            return;\n        }\n\n        try {\n            await this.#sink.ingest({\n                channel: topic,\n                payload: message,\n                received_at: new Date(),\n                metadata: { transport: \"mqtt\", qos: packet?.qos, retain: packet?.retain },\n            });\n        } catch (error) {\n            console.error(`[mqtt-transport] Sink failed:`, error);\n        }\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { EventHubConsumerClient, EventPosition, Subscription } from \"@azure/event-hubs\";\n\n//------------------------------------------------------------------------------\nimport type { EventSink, Transport } from \"../Transport\";\n\n/**\n * Minimal structural view of the `@azure/event-hubs` module, avoiding a hard type dependency on\n * its dual (ESM/CJS) type declarations.\n *\n * @internal\n */\ntype EventHubsModule = {\n    EventHubConsumerClient: typeof EventHubConsumerClient;\n    latestEventPosition: EventPosition;\n};\n\n/**\n * Configuration of an {@link AzureEventHubTransport}.\n *\n * @inline\n * @category Data\n */\nexport type AzureEventHubTransportConfig = {\n    /**\n     * Azure Event Hubs connection string. Publishers that expose an Event Hubs-compatible\n     * endpoint (e.g. a Microsoft Fabric Eventstream \"custom endpoint\") provide one too; it\n     * usually embeds an `EntityPath=` segment, e.g.:\n     *   Endpoint=sb://xxxx.servicebus.windows.net/;SharedAccessKeyName=key_xxxx;SharedAccessKey=xxxx;EntityPath=xxxx\n     */\n    connection_string: string;\n\n    /**\n     * Consumer group to read with. Defaults to the Event Hubs default consumer group (`\"$Default\"`).\n     */\n    consumer_group?: string;\n\n    /**\n     * Event hub (entity) name. Only needed when the connection string does NOT embed `EntityPath=`.\n     */\n    event_hub_name?: string;\n};\n\n/**\n * Transport that subscribes to an Azure Event Hub, under the `\"azure-event-hub\"` kind.\n *\n * Any publisher speaking the Event Hubs protocol works, including Microsoft Fabric \"Real-Time\n * Intelligence\" Eventstreams via their Event Hubs-compatible custom endpoint.\n *\n * **Channel caveat.** Event Hubs has no per-message routing key, so events are emitted on their\n * partition id \u2014 a load-balancing artifact, not a topic: the same logical device can land on\n * different partitions, and the assignment can change. Never write a mapping that selects on\n * `channel` against this transport; select on the payload with `when` instead. The partition id,\n * offset and sequence number are all available in the event's `metadata` for diagnostics.\n *\n * Requires the optional dependency `@azure/event-hubs` (loaded lazily on\n * {@link AzureEventHubTransport.start}).\n *\n * This transport reads from the latest position and does NOT checkpoint. A production deployment\n * that must not miss events across restarts should extend it with a `CheckpointStore` (e.g.\n * `@azure/eventhubs-checkpointstore-blob`) and start from the stored offsets \u2014 the\n * `sequence_number` / `offset` carried in each event's metadata are what such a store records.\n *\n * @category Data\n */\nexport class AzureEventHubTransport implements Transport {\n    /**\n     * The transport configuration.\n     */\n    readonly #config: AzureEventHubTransportConfig;\n\n    /**\n     * The sink to push events into.\n     */\n    readonly #sink: EventSink;\n\n    /**\n     * The Event Hub client instance, or null if not connected.\n     */\n    #client: EventHubConsumerClient | null = null;\n\n    /**\n     * The subscription to the Event Hub, or null if not subscribed.\n     */\n    #subscription: Subscription | null = null;\n\n    /**\n     *\n     */\n    constructor(config: AzureEventHubTransportConfig, sink: EventSink) {\n        this.#config = config;\n        this.#sink = sink;\n    }\n\n    /**\n     * Connect to the event hub and start receiving events.\n     */\n    async start(): Promise<void> {\n        const connection_string = this.#config.connection_string;\n        if (!connection_string) {\n            throw new Error(\"Event Hub connection_string is required in transport config\");\n        }\n\n        let event_hubs: EventHubsModule;\n        try {\n            event_hubs = (await import(\"@azure/event-hubs\")) as unknown as EventHubsModule;\n        } catch {\n            throw new Error(\n                'The Azure Event Hub transport requires the optional dependency \"@azure/event-hubs\". ' +\n                    \"Install it with `npm install @azure/event-hubs`.\",\n            );\n        }\n\n        const consumer_group =\n            this.#config.consumer_group || event_hubs.EventHubConsumerClient.defaultConsumerGroupName;\n\n        // Most connection strings embed `EntityPath=`, so the 2-arg form is the common case. Only\n        // when a separate event_hub_name is supplied (string lacks EntityPath) do we fall back to\n        // the 3-arg form.\n        const has_entity_path = /;EntityPath=/i.test(connection_string);\n        if (this.#config.event_hub_name && !has_entity_path) {\n            this.#client = new event_hubs.EventHubConsumerClient(\n                consumer_group,\n                connection_string,\n                this.#config.event_hub_name,\n            );\n        } else {\n            this.#client = new event_hubs.EventHubConsumerClient(consumer_group, connection_string);\n        }\n\n        const endpoint_for_log = connection_string.replace(/SharedAccessKey=[^;]+/i, \"SharedAccessKey=<redacted>\");\n        console.log(`[azure-event-hub-transport] Subscribing to Event Hub (${endpoint_for_log})...`);\n\n        this.#subscription = this.#client.subscribe(\n            {\n                processEvents: async (events, context) => {\n                    for (const event of events) {\n                        await this.#handleEvent(context.partitionId, event);\n                    }\n                },\n                processError: async (error, context) => {\n                    console.error(`[azure-event-hub-transport] Error on partition ${context.partitionId}:`, error);\n                },\n            },\n            // Read only events that arrive after we connect.\n            { startPosition: event_hubs.latestEventPosition },\n        );\n    }\n\n    /**\n     * Stop receiving events and close the connection.\n     */\n    async stop(): Promise<void> {\n        try {\n            await this.#subscription?.close();\n        } finally {\n            this.#subscription = null;\n            await this.#client?.close();\n            this.#client = null;\n        }\n    }\n\n    /**\n     * Push an event received from the Event Hub into the sink, on its partition id, carrying the\n     * broker's own timestamp and position in its metadata.\n     *\n     * @param partition_id The partition id the event was received from.\n     * @param received The received event, whose body is already deserialized by the Event Hubs SDK.\n     */\n    async #handleEvent(\n        partition_id: string,\n        received: { body: unknown; enqueuedTimeUtc?: Date; offset?: string | number; sequenceNumber?: number },\n    ): Promise<void> {\n        // Event Hubs delivers the event body already deserialized (JSON \u2192 object). Guard against\n        // non-object bodies (e.g. raw strings) so the pipeline gets a stable shape.\n        if (received.body === null || typeof received.body !== \"object\") {\n            console.warn(`[azure-event-hub-transport] Skipping non-object event body on partition ${partition_id}`);\n            return;\n        }\n\n        try {\n            await this.#sink.ingest({\n                // A partition id, NOT a topic \u2014 see the class doc. Mappings select on the payload.\n                channel: partition_id,\n                payload: received.body,\n                received_at: new Date(),\n                ...(received.enqueuedTimeUtc ? { source_timestamp: received.enqueuedTimeUtc } : {}),\n                metadata: {\n                    transport: \"azure-event-hub\",\n                    partition_id,\n                    offset: received.offset,\n                    sequence_number: received.sequenceNumber,\n                },\n            });\n        } catch (error) {\n            console.error(`[azure-event-hub-transport] Sink failed:`, error);\n        }\n    }\n}\n", "//------------------------------------------------------------------------------\n// Everything the OPC UA transport needs to know about `node-opcua-client`.\n//\n// That package stays an **optional peer** for consumers \u2014 `opc.tcp://` is raw TCP, so the transport\n// is Node-only and most consumers never install it, which is why {@link OpcUaTransport.start} reaches\n// it through a lazy `import()` and esbuild keeps it `external`. But it *is* a devDependency here, so\n// the types below are the real ones and a signature change upstream fails the build rather than a\n// PLC connection. (Every type in this file is `@internal`, so `stripInternal` deletes it from the\n// emitted `.d.ts`: a consumer who installs no such peer never sees a reference to it.)\n//\n// The file has two halves:\n//\n//   - **Specification constants.** Attribute ids, data types, security modes, status severities.\n//     These travel on the wire and are fixed by the OPC UA specification (Parts 4 and 6), so\n//     hard-coding them cannot drift: node-opcua's enums merely spell them out. `AttributeIds.Value`\n//     has been `13` since 2006 and will stay `13`. They are kept spelled out because they read more\n//     cheaply than the enum lookups they replace.\n//   - **The module types**, derived from the real module rather than restated \u2014 the instance types\n//     come back out of the three `create` calls, so there is no hand-maintained shape left to drift.\n//\n// The two payload projections ({@link OpcUaVariant}, {@link OpcUaDataValue}) are the deliberate\n// exception: they name only the fields the decoder reads, so a sample can be written as a plain\n// object literal in a test instead of a fully constructed `DataValue`. `opcua-transport.test.ts`\n// pins them against the real `DataValue` / `Variant` with type-level assertions, so narrowing them\n// costs no drift detection.\n\n//------------------------------------------------------------------------------\n// Specification constants.\n\n/**\n * `AttributeIds.Value`, the only attribute the transport monitors.\n */\nexport const ATTRIBUTE_ID_VALUE = 13;\n\n/**\n * `TimestampsToReturn.Both`: the source clock is the one worth carrying, the server clock is the\n * fallback when a server does not keep one.\n */\nexport const TIMESTAMPS_TO_RETURN_BOTH = 2;\n\n/**\n * `UserTokenType.UserName`, used when the config carries credentials.\n */\nexport const USER_TOKEN_TYPE_USER_NAME = 1;\n\n/**\n * `VariantArrayType.Scalar`.\n */\nexport const VARIANT_ARRAY_TYPE_SCALAR = 0;\n\n/**\n * `DataType.Int64` and `DataType.UInt64` \u2014 the two types node-opcua hands over as a `[high, low]`\n * pair rather than a number.\n */\nexport const DATA_TYPE_INT64 = 8;\nexport const DATA_TYPE_UINT64 = 9;\n\n/**\n * Severity lives in the top two bits of a status code: `0` is Good, `1` is Uncertain, anything above\n * is Bad. This is what node-opcua's `StatusCode.isGood()` / `isUncertain()` read.\n */\nexport const STATUS_SEVERITY_UNCERTAIN = 1;\n\n/**\n * `MessageSecurityMode`, by name. The names are also the transport's config vocabulary, so this map\n * doubles as the validator for `security_mode`.\n */\nexport const MESSAGE_SECURITY_MODES: Record<string, number | undefined> = { None: 1, Sign: 2, SignAndEncrypt: 3 };\n\n/**\n * The security policy short names defined by the specification, and the namespace that turns one\n * into the policy URI the client expects \u2014 which is exactly what the values of node-opcua's\n * `SecurityPolicy` enum are.\n */\nexport const SECURITY_POLICIES = [\n    \"None\",\n    \"Basic128Rsa15\",\n    \"Basic256\",\n    \"Basic256Sha256\",\n    \"Aes128_Sha256_RsaOaep\",\n    \"Aes256_Sha256_RsaPss\",\n];\nexport const SECURITY_POLICY_URI_PREFIX = \"http://opcfoundation.org/UA/SecurityPolicy#\";\n\n//------------------------------------------------------------------------------\n// The module types.\n//\n// `import type` is erased at compile time, so naming these costs no runtime import: the transport\n// still reaches the module only through the lazy `import()` in `start()`, and esbuild still keeps\n// the package `external`. Aliases rather than derivations through the methods that produce them \u2014\n// `createSession` is overloaded three ways, and `Parameters<>` / `ReturnType<>` resolve against the\n// last overload (the callback form), which yields the callback type and `void` instead of an\n// identity and a session.\n\nimport type {\n    ClientMonitoredItem,\n    ClientSession,\n    ClientSubscription,\n    OPCUAClient,\n    UserIdentityInfo,\n} from \"node-opcua-client\";\n\n/**\n * The `node-opcua-client` module, as the lazy `import()` in {@link OpcUaTransport.start} hands it\n * over. Naming the real module is what makes the calls the transport makes checked against the\n * upstream signatures.\n *\n * @internal\n */\nexport type OpcUaClientModule = typeof import(\"node-opcua-client\");\n\n/**\n * The identity a session is opened with. Omitted = anonymous.\n *\n * @internal\n */\nexport type OpcUaUserIdentity = UserIdentityInfo;\n\n/**\n * Produced by `OPCUAClient.create`.\n *\n * @internal\n */\nexport type OpcUaClient = OPCUAClient;\n\n/**\n * Produced by {@link OpcUaClient.createSession}.\n *\n * @internal\n */\nexport type OpcUaSession = ClientSession;\n\n/**\n * Produced by `ClientSubscription.create`. Carries `publishingInterval`, the interval the server\n * **revised** the request to \u2014 the only one that describes how the subscription actually behaves,\n * readable from `\"started\"` on.\n *\n * @internal\n */\nexport type OpcUaSubscription = ClientSubscription;\n\n/**\n * Produced by `ClientMonitoredItem.create`. Carries `result`, the `MonitoredItemCreateResult` the\n * server answered with \u2014 readable from `\"initialized\"` on, which is what tells you the revised\n * sampling interval and queue size.\n *\n * @internal\n */\nexport type OpcUaMonitoredItem = ClientMonitoredItem;\n\n//------------------------------------------------------------------------------\n// Payload projections.\n//\n// These two name only the fields {@link decodeOpcUaVariant} and the sample handler read, rather than\n// aliasing node-opcua's `Variant` / `DataValue` classes. That keeps a test sample a plain object\n// literal instead of a fully constructed `DataValue` \u2014 worth it for a decoder that is pure\n// projection. `opcua-transport.test.ts` asserts at type level that the real classes are assignable\n// to both, so narrowing them here still cannot drift away from what arrives at runtime.\n\n/**\n * A variant, as node-opcua delivers it: the decoded value plus what is needed to know how to read it\n * back.\n *\n * @internal\n */\nexport type OpcUaVariant = {\n    value?: unknown;\n    dataType?: number;\n    arrayType?: number;\n};\n\n/**\n * A data value, as node-opcua delivers it to a monitored item's `changed` listener.\n *\n * @internal\n */\nexport type OpcUaDataValue = {\n    value?: OpcUaVariant | null;\n    statusCode?: { value?: number; name?: string } | null;\n    sourceTimestamp?: Date | null;\n    serverTimestamp?: Date | null;\n};\n", "//------------------------------------------------------------------------------\nimport type { EventSink, Transport } from \"../Transport\";\n// `node-opcua-client` is an optional peer this repository does not install; everything the transport\n// knows about it is declared there rather than imported from it.\nimport {\n    ATTRIBUTE_ID_VALUE,\n    DATA_TYPE_INT64,\n    DATA_TYPE_UINT64,\n    MESSAGE_SECURITY_MODES,\n    SECURITY_POLICIES,\n    SECURITY_POLICY_URI_PREFIX,\n    STATUS_SEVERITY_UNCERTAIN,\n    TIMESTAMPS_TO_RETURN_BOTH,\n    USER_TOKEN_TYPE_USER_NAME,\n    VARIANT_ARRAY_TYPE_SCALAR,\n    type OpcUaClient,\n    type OpcUaClientModule,\n    type OpcUaDataValue,\n    type OpcUaSession,\n    type OpcUaSubscription,\n    type OpcUaUserIdentity,\n    type OpcUaVariant,\n} from \"./OpcUaClientModule\";\n\n/**\n * One OPC UA variable to monitor, and the channel its samples are published on.\n *\n * @category Data\n */\nexport type OpcUaNodeSpec = {\n    /**\n     * Identifier of the node to monitor, e.g. `ns=3;s=\"DB_Line1\".\"Temperature\"` on a Siemens PLC or\n     * `ns=2;i=1042` on a server using numeric identifiers.\n     */\n    node_id: string;\n\n    /**\n     * Channel the samples of this node are published on. Defaults to {@link OpcUaNodeSpec.node_id}.\n     *\n     * Worth setting: channel patterns match over `/`-separated segments, and a raw node id is a\n     * single opaque segment full of `;`, `=` and quotes. Aliasing `ns=3;s=\"DB1\".\"Temp\"` to\n     * `plc/line1/temperature` is what lets a mapping select it with `channel: \"plc/+/temperature\"`.\n     */\n    channel?: string;\n\n    /**\n     * How often the server samples this node, in milliseconds. Overrides\n     * {@link OpcUaTransportConfig.sampling_interval} for this node alone \u2014 the one knob worth\n     * setting per node, a fast counter and a slow temperature rarely deserving the same rate.\n     */\n    sampling_interval?: number;\n};\n\n/**\n * Configuration of an {@link OpcUaTransport}.\n *\n * @inline\n * @category Data\n */\nexport type OpcUaTransportConfig = {\n    /**\n     * Endpoint of the OPC UA server, e.g. `opc.tcp://plc.example.com:4840`.\n     */\n    endpoint_url: string;\n\n    /**\n     * Nodes to monitor. A bare string is a node id whose channel is that same node id; use the\n     * {@link OpcUaNodeSpec} form to alias it to a readable channel.\n     */\n    nodes: Array<string | OpcUaNodeSpec>;\n\n    /**\n     * How often the server publishes the samples it has collected, in milliseconds. Defaults to\n     * `1000`. This is the latency floor of the whole ingestion: sampling faster than this only\n     * fills the queue.\n     *\n     * This is a *request*: the server answers with the interval it will actually publish at, and\n     * that is the one that holds. Most servers refuse to go below **50 ms** \u2014 node-opcua's own server\n     * clamps there, and caps at one minute \u2014 so asking for less buys nothing. A request the server\n     * revises upward is logged once rather than absorbed silently, since everything downstream of a\n     * halved sample rate looks like a bug elsewhere.\n     */\n    publishing_interval?: number;\n\n    /**\n     * How often the server samples the monitored nodes, in milliseconds. Defaults to\n     * {@link OpcUaTransportConfig.publishing_interval}, i.e. one sample per publication.\n     *\n     * Revised by the server the same way the publishing interval is, and logged the same way: a node\n     * whose underlying device cannot be read faster comes back with its own minimum, whatever this\n     * asks for.\n     */\n    sampling_interval?: number;\n\n    /**\n     * How many samples the server buffers per node between two publications. Defaults to `1`, which\n     * keeps only the latest \u2014 the right choice for telemetry driving a scene. Raise it to receive\n     * every sample of a node sampled faster than it is published.\n     */\n    queue_size?: number;\n\n    /**\n     * Message security to negotiate. Defaults to `\"None\"`, or to `\"SignAndEncrypt\"` when a\n     * {@link OpcUaTransportConfig.security_policy} other than `\"None\"` is named.\n     */\n    security_mode?: \"None\" | \"Sign\" | \"SignAndEncrypt\";\n\n    /**\n     * Security policy to negotiate, by short name (`\"Basic256Sha256\"`,\n     * `\"Aes128_Sha256_RsaOaep\"`, ...) or by full policy URI. Defaults to `\"None\"`, or to\n     * `\"Basic256Sha256\"` when a {@link OpcUaTransportConfig.security_mode} other than `\"None\"` is\n     * named. The two must agree: either both are `\"None\"`, or neither is.\n     */\n    security_policy?: string;\n\n    /**\n     * User name to authenticate with. Omitted = connect anonymously.\n     */\n    username?: string;\n\n    /**\n     * Password that goes with {@link OpcUaTransportConfig.username}.\n     */\n    password?: string;\n\n    /**\n     * Application name announced to the server, and carried by the client certificate generated for\n     * a secured connection. Defaults to `\"livelink-agent\"`.\n     */\n    application_name?: string;\n\n    /**\n     * How many times to retry the connection before giving up. Defaults to `3`.\n     *\n     * Deliberately bounded: sources are started sequentially and awaited, so a transport retrying\n     * forever would hang the whole ingestion rather than report. A failed start surfaces on\n     * `on-error` and is retried by the next session to bind, which is the loop that actually\n     * survives a PLC being down at boot. The same budget governs the automatic reconnection after\n     * an established connection drops.\n     */\n    max_retry?: number;\n};\n\n//------------------------------------------------------------------------------\n/**\n * Defaults for the subscription's pace.\n */\nconst DEFAULT_PUBLISHING_INTERVAL = 1_000;\nconst DEFAULT_QUEUE_SIZE = 1;\nconst DEFAULT_MAX_RETRY = 3;\n\n/**\n * How much slower than requested a revised interval has to be before it is worth reporting. Revised\n * values come back as floats, and a server rounding a request to its own timer granularity is not\n * what this is here to catch.\n */\nconst INTERVAL_REVISION_EPSILON_MS = 0.5;\n\n//------------------------------------------------------------------------------\n/**\n * Turn a variant into something a component patch can hold: a number, a string, a boolean, a `Date`\n * or an array of those.\n *\n * Two shapes need help. Numeric arrays arrive as typed arrays, which are not what a component\n * expects to be handed. And 64-bit integers arrive as a `[high, low]` pair of 32-bit halves \u2014\n * writing that straight into a component would silently store a two-element array where a Siemens\n * `LInt` was meant, so the halves are recombined here. Beyond 2^53 the result is rounded, which is\n * the price of staying a `number`.\n *\n * Returns `undefined` when the variant carries no value at all \u2014 OPC UA has no such value, so the\n * caller can read it as \"nothing to publish\".\n *\n * @internal\n */\nexport function decodeOpcUaVariant(variant: OpcUaVariant | null | undefined): unknown {\n    const value = variant?.value;\n    if (value === undefined || value === null) {\n        return undefined;\n    }\n\n    if (variant?.dataType === DATA_TYPE_INT64 || variant?.dataType === DATA_TYPE_UINT64) {\n        const is_scalar = variant.arrayType === undefined || variant.arrayType === VARIANT_ARRAY_TYPE_SCALAR;\n        return is_scalar ? decode64BitInteger(value) : toArray(value).map(decode64BitInteger);\n    }\n\n    if (ArrayBuffer.isView(value) && !(value instanceof DataView)) {\n        return Array.from(value as unknown as ArrayLike<unknown>);\n    }\n\n    return value;\n}\n\n/**\n * Recombine the `[high, low]` pair node-opcua uses for a 64-bit integer. `BigInt` bitwise operators\n * work in two's complement, so a negative high half yields the negative `Int64` it encodes.\n */\nfunction decode64BitInteger(value: unknown): unknown {\n    if (typeof value === \"bigint\") {\n        return Number(value);\n    }\n    if (Array.isArray(value) && value.length === 2 && typeof value[0] === \"number\" && typeof value[1] === \"number\") {\n        return Number((BigInt(value[0]) << 32n) | BigInt(value[1] >>> 0));\n    }\n    return value;\n}\n\n/**\n * Read a variant's array value as an array, whatever container it came in.\n */\nfunction toArray(value: unknown): Array<unknown> {\n    return Array.isArray(value) ? value : Array.from(value as ArrayLike<unknown>);\n}\n\n/**\n * Expand the node list into full specs, so the constructor is where a config mistake is reported\n * rather than the first sample that never arrives.\n */\nfunction normalizeNodes(nodes: Array<string | OpcUaNodeSpec> | undefined): Array<OpcUaNodeSpec> {\n    if (!Array.isArray(nodes) || nodes.length === 0) {\n        throw new Error(\"At least one node is required in the OPC UA transport config\");\n    }\n    return nodes.map(node => {\n        const spec = typeof node === \"string\" ? { node_id: node } : node;\n        if (!spec?.node_id) {\n            throw new Error(`Every OPC UA node needs a node_id, got ${JSON.stringify(node)}`);\n        }\n        return spec;\n    });\n}\n\n/**\n * Resolve the security mode and policy to what the client expects, each defaulting from the other:\n * naming a policy means security is wanted, and asking for `Sign` or `SignAndEncrypt` without a\n * policy means the modern default.\n */\nfunction resolveSecurity(config: OpcUaTransportConfig): { mode: number; policy: string } {\n    const wants_security = config.security_policy !== undefined && config.security_policy !== \"None\";\n    const mode_name = config.security_mode ?? (wants_security ? \"SignAndEncrypt\" : \"None\");\n    const policy_name = config.security_policy ?? (mode_name === \"None\" ? \"None\" : \"Basic256Sha256\");\n\n    const mode = MESSAGE_SECURITY_MODES[mode_name];\n    if (mode === undefined) {\n        throw new Error(\n            `Unknown OPC UA security_mode \"${mode_name}\". Expected one of: ${Object.keys(MESSAGE_SECURITY_MODES).join(\", \")}.`,\n        );\n    }\n\n    // A full policy URI passes through, so a policy published after this SDK can still be named.\n    const is_uri = policy_name.startsWith(\"http\");\n    if (!is_uri && !SECURITY_POLICIES.includes(policy_name)) {\n        throw new Error(\n            `Unknown OPC UA security_policy \"${policy_name}\". Expected one of: ${SECURITY_POLICIES.join(\", \")}, or a full policy URI.`,\n        );\n    }\n\n    if ((mode_name === \"None\") !== (policy_name === \"None\")) {\n        throw new Error(\n            `OPC UA security_mode \"${mode_name}\" and security_policy \"${policy_name}\" disagree: either both are \"None\", or neither is.`,\n        );\n    }\n\n    return { mode, policy: is_uri ? policy_name : `${SECURITY_POLICY_URI_PREFIX}${policy_name}` };\n}\n\n/**\n * Run a teardown step, reporting rather than throwing: a session that already died under us must\n * not stop the socket below it from being closed.\n */\nasync function closeQuietly(action: () => Promise<void> | undefined): Promise<void> {\n    try {\n        await action();\n    } catch (error) {\n        console.warn(`[opcua-transport] Error while closing:`, error);\n    }\n}\n\n//------------------------------------------------------------------------------\n/**\n * Transport that subscribes to variables on an OPC UA server over `opc.tcp://` and forwards each\n * value change as an event **on the node's channel** \u2014 the node id, or the readable alias given in\n * its {@link OpcUaNodeSpec}. Like MQTT and unlike Event Hubs, that channel is a genuine routing key\n * a mapping can select on.\n *\n * This is the classic client/server profile, which is what a PLC whose firmware predates PubSub\n * exposes. **If the plant already bridges OPC UA to MQTT** \u2014 via OPC UA PubSub over MQTT, Telegraf's\n * `inputs.opcua`, Kepware, Ignition \u2014 point the `mqtt` transport at that broker instead: one hop\n * fewer, and no OPC UA client to keep alive next to the scene.\n *\n * Each event's payload is `{ node_id, value, status }` and its `source_timestamp` is the server's\n * own clock. Samples whose status is Bad carry no meaningful value and are dropped, logging once per\n * node rather than at every publication.\n *\n * Requires the optional dependency `node-opcua-client` (loaded lazily on\n * {@link OpcUaTransport.start}). `opc.tcp` is raw TCP, so **this transport is Node.js only** \u2014 in a\n * browser the lazy import is what fails, with the same message as a missing install.\n *\n * A secured connection (`security_mode` other than `\"None\"`) makes node-opcua generate a\n * self-signed client certificate under a `certificates/` folder on first use. The server has to\n * trust it \u2014 on a Siemens PLC, that is a manual step in the web interface, and the failure everyone\n * hits first.\n *\n * @category Data\n */\nexport class OpcUaTransport implements Transport {\n    /**\n     * The transport configuration.\n     */\n    readonly #config: OpcUaTransportConfig;\n\n    /**\n     * The sink to push events into.\n     */\n    readonly #sink: EventSink;\n\n    /**\n     * The nodes to monitor, expanded from the config's shorthand.\n     */\n    readonly #nodes: Array<OpcUaNodeSpec>;\n\n    /**\n     * The security mode and policy to negotiate, resolved from the config.\n     */\n    readonly #security: { mode: number; policy: string };\n\n    /**\n     * Nodes already reported as unusable, so an unhealthy one logs once instead of at every\n     * publication. Cleared for a node as soon as it publishes a usable sample again, so a later\n     * outage is reported anew.\n     */\n    readonly #warned_nodes = new Set<string>();\n\n    /**\n     * Interval revisions already reported, keyed by the request they answered rather than by the node\n     * that revealed them \u2014 a whole node list revised the same way is one fact, and deserves one line.\n     * Cleared with the connection, so the next `start()` reports against the server it finds then.\n     */\n    readonly #warned_intervals = new Set<string>();\n\n    /**\n     * The OPC UA client, or null when not connected.\n     */\n    #client: OpcUaClient | null = null;\n\n    /**\n     * The session opened on the server, or null when not connected.\n     */\n    #session: OpcUaSession | null = null;\n\n    /**\n     * The subscription carrying every monitored item, or null when not subscribed.\n     */\n    #subscription: OpcUaSubscription | null = null;\n\n    /**\n     *\n     */\n    constructor(config: OpcUaTransportConfig, sink: EventSink) {\n        if (!config.endpoint_url) {\n            throw new Error(\"endpoint_url is required in the OPC UA transport config\");\n        }\n        this.#nodes = normalizeNodes(config.nodes);\n        this.#security = resolveSecurity(config);\n        this.#config = config;\n        this.#sink = sink;\n    }\n\n    /**\n     * Connect to the server, open a session and subscribe to every configured node.\n     */\n    async start(): Promise<void> {\n        let opcua: OpcUaClientModule;\n        try {\n            opcua = (await import(\"node-opcua-client\")) as OpcUaClientModule;\n        } catch {\n            throw new Error(\n                'The OPC UA transport requires the optional dependency \"node-opcua-client\". ' +\n                    \"Install it with `npm install node-opcua-client`.\",\n            );\n        }\n\n        const endpoint_url = this.#config.endpoint_url;\n        const client = opcua.OPCUAClient.create({\n            applicationName: this.#config.application_name ?? \"livelink-agent\",\n            // Servers routinely advertise their endpoint under a hostname the client cannot resolve\n            // \u2014 a PLC on a plant network almost always does. Refusing to connect over that is never\n            // what the caller meant by giving us a reachable URL.\n            endpointMustExist: false,\n            keepSessionAlive: true,\n            securityMode: this.#security.mode,\n            securityPolicy: this.#security.policy,\n            connectionStrategy: {\n                initialDelay: 1_000,\n                maxDelay: 10_000,\n                maxRetry: this.#config.max_retry ?? DEFAULT_MAX_RETRY,\n            },\n        });\n        this.#client = client;\n\n        try {\n            await this.#subscribe(opcua, client, endpoint_url);\n        } catch (error) {\n            // Nothing upstream tears down a transport whose `start` rejected, so a connection that\n            // came up before the failing step has to be released here.\n            await this.stop();\n            throw error;\n        }\n    }\n\n    /**\n     * Terminate the subscription, close the session and disconnect. Safe when never started, and\n     * safe when only part of the connection was ever established.\n     */\n    async stop(): Promise<void> {\n        const subscription = this.#subscription;\n        const session = this.#session;\n        const client = this.#client;\n        this.#subscription = null;\n        this.#session = null;\n        this.#client = null;\n        this.#warned_nodes.clear();\n        this.#warned_intervals.clear();\n\n        await closeQuietly(() => subscription?.terminate());\n        await closeQuietly(() => session?.close());\n        await closeQuietly(() => client?.disconnect());\n    }\n\n    /**\n     * Open the session and put every configured node under one subscription.\n     *\n     * @param opcua The lazily loaded client module.\n     * @param client The client to connect with.\n     * @param endpoint_url The endpoint to connect to.\n     */\n    async #subscribe(opcua: OpcUaClientModule, client: OpcUaClient, endpoint_url: string): Promise<void> {\n        client.on(\"connection_lost\", () => console.warn(`[opcua-transport] Lost ${endpoint_url}, reconnecting...`));\n        client.on(\"connection_reestablished\", () => console.log(`[opcua-transport] Reconnected to ${endpoint_url}`));\n\n        console.log(`[opcua-transport] Connecting to ${endpoint_url}...`);\n        await client.connect(endpoint_url);\n        this.#session = await client.createSession(this.#userIdentity());\n\n        const publishing_interval = this.#config.publishing_interval ?? DEFAULT_PUBLISHING_INTERVAL;\n        const subscription = opcua.ClientSubscription.create(this.#session, {\n            requestedPublishingInterval: publishing_interval,\n            // Both counts are in publishing intervals, and the specification wants the lifetime to\n            // be at least three keep-alives.\n            requestedLifetimeCount: 100,\n            requestedMaxKeepAliveCount: 10,\n            // 0 = no limit: the cap exists to protect small servers, and throttling it here would\n            // only spread one publication of a wide node list over several.\n            maxNotificationsPerPublish: 0,\n            publishingEnabled: true,\n            priority: 10,\n        });\n        this.#subscription = subscription;\n        subscription.on(\"internal_error\", error => console.error(`[opcua-transport] Subscription failed:`, error));\n        // The server answers `create()` asynchronously, and what it answers is the interval that\n        // actually holds \u2014 see `#reportRevision`.\n        subscription.on(\"started\", () => {\n            if (this.#subscription !== subscription) {\n                return;\n            }\n            this.#reportRevision(\"publishing interval\", publishing_interval, subscription.publishingInterval);\n        });\n\n        for (const node of this.#nodes) {\n            const sampling_interval = node.sampling_interval ?? this.#config.sampling_interval ?? publishing_interval;\n            const item = opcua.ClientMonitoredItem.create(\n                subscription,\n                { nodeId: node.node_id, attributeId: ATTRIBUTE_ID_VALUE },\n                {\n                    samplingInterval: sampling_interval,\n                    discardOldest: true,\n                    queueSize: this.#config.queue_size ?? DEFAULT_QUEUE_SIZE,\n                },\n                TIMESTAMPS_TO_RETURN_BOTH,\n            );\n            item.on(\"changed\", data_value => void this.#handleSample(node, data_value));\n            item.on(\"err\", message => console.error(`[opcua-transport] Cannot monitor ${node.node_id}: ${message}`));\n            item.on(\"initialized\", () => {\n                if (this.#subscription !== subscription) {\n                    return;\n                }\n                this.#reportRevision(\n                    \"sampling interval\",\n                    sampling_interval,\n                    item.result?.revisedSamplingInterval,\n                    node.node_id,\n                );\n            });\n        }\n\n        console.log(`[opcua-transport] Connected, monitoring ${this.#nodes.length} node(s)`);\n    }\n\n    /**\n     * The identity to open the session with, or undefined to connect anonymously.\n     */\n    #userIdentity(): OpcUaUserIdentity | undefined {\n        const { username, password } = this.#config;\n        if (username === undefined) {\n            return undefined;\n        }\n        return { type: USER_TOKEN_TYPE_USER_NAME, userName: username, password: password ?? \"\" };\n    }\n\n    /**\n     * Push a value change into the sink, on the node's channel, carrying the server's own clock.\n     *\n     * @param node The node the sample came from.\n     * @param data_value The sample, as delivered by the monitored item.\n     */\n    async #handleSample(node: OpcUaNodeSpec, data_value: OpcUaDataValue): Promise<void> {\n        // `stop()` clears the subscription before tearing anything down, so a publication already\n        // in flight when it was called never reaches a sink that has been let go of.\n        if (this.#subscription === null) {\n            return;\n        }\n\n        const status_code = data_value.statusCode?.value ?? 0;\n        const status = data_value.statusCode?.name ?? \"Good\";\n        if (status_code >>> 30 > STATUS_SEVERITY_UNCERTAIN) {\n            this.#warnOnce(node.node_id, `${node.node_id} reports ${status}, samples dropped`);\n            return;\n        }\n\n        const value = decodeOpcUaVariant(data_value.value);\n        if (value === undefined) {\n            this.#warnOnce(node.node_id, `${node.node_id} published no value, samples dropped`);\n            return;\n        }\n        this.#warned_nodes.delete(node.node_id);\n\n        const source_timestamp = data_value.sourceTimestamp ?? data_value.serverTimestamp ?? undefined;\n        try {\n            await this.#sink.ingest({\n                channel: node.channel ?? node.node_id,\n                payload: { node_id: node.node_id, value, status },\n                received_at: new Date(),\n                ...(source_timestamp ? { source_timestamp } : {}),\n                metadata: { transport: \"opcua\", status_code, server_timestamp: data_value.serverTimestamp },\n            });\n        } catch (error) {\n            console.error(`[opcua-transport] Sink failed:`, error);\n        }\n    }\n\n    /**\n     * Report an interval the server revised to something slower than what was asked for.\n     *\n     * Requesting a pace is all a client can do \u2014 the server answers with the one it will hold to, and\n     * absorbing that answer silently is how a scene ends up moving at half the rate its configuration\n     * describes, with nothing anywhere to say why. Most servers floor the publishing interval at\n     * 50 ms; a node can also come back with the fastest its device can be read.\n     *\n     * A revision to something *faster* than requested costs the caller nothing and is not reported.\n     *\n     * @param what The interval being reported on, as it reads in the message.\n     * @param requested The value asked for, in milliseconds.\n     * @param revised The value the server answered with, if it gave one.\n     * @param node_id The node the revision applies to, for a per-node interval.\n     */\n    #reportRevision(what: string, requested: number, revised: number | undefined, node_id?: string): void {\n        if (revised === undefined || !(revised > requested + INTERVAL_REVISION_EPSILON_MS)) {\n            return;\n        }\n\n        const key = `${what}:${requested}->${revised}`;\n        if (this.#warned_intervals.has(key)) {\n            return;\n        }\n        this.#warned_intervals.add(key);\n\n        const subject = node_id === undefined ? what : `${what} of ${node_id}`;\n        console.warn(\n            `[opcua-transport] The server revised the ${subject} from ${requested} ms up to ${revised} ms \u2014 ` +\n                `it will not go faster than that, whatever this transport requests.`,\n        );\n    }\n\n    /**\n     * Report a node as unusable, once per outage.\n     *\n     * @param node_id The node the message is about.\n     * @param message The message to log.\n     */\n    #warnOnce(node_id: string, message: string): void {\n        if (this.#warned_nodes.has(node_id)) {\n            return;\n        }\n        this.#warned_nodes.add(node_id);\n        console.warn(`[opcua-transport] ${message}`);\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { EventSink, Transport } from \"../Transport\";\nimport { PlaybackTransport, type FileTransportConfig, type PlaybackTransportConfig } from \"./PlaybackTransport\";\nimport { MqttTransport, type MqttTransportConfig } from \"./MqttTransport\";\nimport { AzureEventHubTransport, type AzureEventHubTransportConfig } from \"./AzureEventHubTransport\";\nimport { OpcUaTransport, type OpcUaTransportConfig } from \"./OpcUaTransport\";\n\n/**\n * A fully-resolved transport configuration: the registered kind and its kind-specific config.\n * The built-in kinds are typed below; custom kinds carry whatever config their factory expects.\n *\n * @category Data\n */\nexport type TransportSpec =\n    | { kind: \"playback\"; config: PlaybackTransportConfig }\n    | { kind: \"file\"; config: FileTransportConfig }\n    | { kind: \"mqtt\"; config: MqttTransportConfig }\n    | { kind: \"azure-event-hub\"; config: AzureEventHubTransportConfig }\n    | { kind: \"opcua\"; config: OpcUaTransportConfig }\n    | { kind: string; config: unknown };\n\n/**\n * The transport kinds bundled with the SDK.\n *\n * @category Data\n */\nexport type BuiltinTransportKind = \"playback\" | \"file\" | \"mqtt\" | \"azure-event-hub\" | \"opcua\";\n\n/**\n * A fully-resolved configuration for a **built-in** transport, its config typed per kind.\n *\n * Unlike the open {@link TransportSpec} (whose `{ kind: string; config: unknown }` member defeats\n * per-kind narrowing so custom kinds can be registered), this closed union lets a consumer that\n * only exposes the bundled transports narrow the config by `kind`. Custom kinds still go through\n * {@link TransportSpec}.\n *\n * @category Data\n */\nexport type BuiltinTransportSpec =\n    | { kind: \"playback\"; config: PlaybackTransportConfig }\n    | { kind: \"file\"; config: FileTransportConfig }\n    | { kind: \"mqtt\"; config: MqttTransportConfig }\n    | { kind: \"azure-event-hub\"; config: AzureEventHubTransportConfig }\n    | { kind: \"opcua\"; config: OpcUaTransportConfig };\n\n/**\n * Builds a {@link Transport} bound to a sink from a kind-specific config.\n *\n * @category Data\n */\nexport type TransportFactory = (config: unknown, sink: EventSink) => Transport | Promise<Transport>;\n\n/**\n * Registry of transport kinds.\n *\n * The {@link defaultTransportRegistry} ships with the built-in kinds (`\"playback\"`, `\"mqtt\"`,\n * `\"azure-event-hub\"`, `\"opcua\"`, plus `\"file\"` as a deprecated alias of `\"playback\"`); register\n * custom sources (a serial port, a proprietary bus, ...) under their own kind:\n *\n * ```typescript\n * defaultTransportRegistry.register({\n *     kind: \"serial\",\n *     factory: (config, sink) => new MySerialTransport(config as MySerialConfig, sink),\n * });\n * ```\n *\n * @category Data\n */\nexport class TransportRegistry {\n    /**\n     * The registered factories, keyed by kind.\n     */\n    readonly #factories = new Map<string, TransportFactory>();\n\n    /**\n     * The registered transport kinds.\n     */\n    get kinds(): Array<string> {\n        return Array.from(this.#factories.keys());\n    }\n\n    /**\n     * Register a transport factory under a kind.\n     *\n     * @throws If the kind is already registered.\n     */\n    register({ kind, factory }: { kind: string; factory: TransportFactory }): void {\n        if (this.#factories.has(kind)) {\n            throw new Error(`Transport kind \"${kind}\" is already registered.`);\n        }\n        this.#factories.set(kind, factory);\n    }\n\n    /**\n     * Whether a transport kind is registered.\n     */\n    has({ kind }: { kind: string }): boolean {\n        return this.#factories.has(kind);\n    }\n\n    /**\n     * Build a transport bound to a sink from a spec.\n     *\n     * @throws If the spec's kind is not registered.\n     */\n    async create({ spec, sink }: { spec: TransportSpec; sink: EventSink }): Promise<Transport> {\n        const factory = this.#factories.get(spec.kind);\n        if (!factory) {\n            throw new Error(`Unknown transport kind \"${spec.kind}\". Registered kinds: ${this.kinds.join(\", \")}.`);\n        }\n        return factory(spec.config, sink);\n    }\n}\n\n/**\n * The default transport registry, pre-populated with the built-in transport kinds.\n *\n * @category Data\n */\nexport const defaultTransportRegistry = new TransportRegistry();\n\ndefaultTransportRegistry.register({\n    kind: \"playback\",\n    factory: (config, sink) => new PlaybackTransport(config as PlaybackTransportConfig, sink),\n});\n// Deprecated alias of `\"playback\"`, kept so a config naming the file-only transport still resolves.\n// It also keeps that transport's old `\"file\"` default channel, which `\"playback\"` has moved on from.\ndefaultTransportRegistry.register({\n    kind: \"file\",\n    factory: (config, sink) => {\n        const { file_path, ...rest } = config as FileTransportConfig;\n        return new PlaybackTransport({ default_channel: \"file\", ...rest, source: { file_path } }, sink);\n    },\n});\ndefaultTransportRegistry.register({\n    kind: \"mqtt\",\n    factory: (config, sink) => new MqttTransport(config as MqttTransportConfig, sink),\n});\ndefaultTransportRegistry.register({\n    kind: \"azure-event-hub\",\n    factory: (config, sink) => new AzureEventHubTransport(config as AzureEventHubTransportConfig, sink),\n});\ndefaultTransportRegistry.register({\n    kind: \"opcua\",\n    factory: (config, sink) => new OpcUaTransport(config as OpcUaTransportConfig, sink),\n});\n\n/**\n * Builds a transport bound to a sink from a spec, using the\n * {@link defaultTransportRegistry}.\n *\n * @category Data\n */\nexport function createTransport(spec: TransportSpec, sink: EventSink): Promise<Transport> {\n    return defaultTransportRegistry.create({ spec, sink });\n}\n", "//------------------------------------------------------------------------------\nimport type { UUID, ComponentsManifest } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\nimport type { IngestEvent } from \"./IngestEvent\";\nimport type { JsonSchema } from \"./SchemaValidator\";\nimport type { EntityMap, MappedEntity } from \"./resolvers/ExistingEntityResolver\";\nimport type { EntityTemplate } from \"./resolvers/SpawningEntityResolver\";\n\n/**\n * The component patches to apply to one entity, keyed by component name. Values are partial\n * component values, applied through `entity.updateComponent` (which merges top-level attributes).\n *\n * @category Data\n */\nexport type ComponentUpdates = ComponentsManifest;\n\n/**\n * A whole-entity action, written instead of component patches when an event does not *change* the\n * entity but changes whether it is there at all \u2014 a device leaving the fleet, a machine part going\n * out of service.\n *\n * - `\"delete\"` removes the entity from the scene (and forgets its resolution, so a later event\n *   carrying the same id resolves \u2014 or respawns \u2014 it);\n * - `\"hide\"` / `\"show\"` toggle `entity.is_visible`, keeping the entity and its resolution.\n *\n * Both `\"delete\"` and `\"hide\"` also stop a {@link continuous} update driving that id \u2014 nothing\n * visible is moving, so nothing should be written for it. `\"delete\"` drops the entity's state with\n * it; `\"hide\"` keeps it, so a later event resumes the motion from where it stopped rather than from\n * the beginning.\n *\n * @category Data\n */\nexport type EntityDirective = \"delete\" | \"hide\" | \"show\";\n\n/**\n * Brands a {@link ContinuousUpdate}, so a plain function is never mistaken for one. Not a lock \u2014\n * `Symbol.for` is reachable by string, and building the object by hand is a supported (if verbose)\n * alternative to {@link continuous}. It exists so `update: () => buildPatch(payload)`, a plausible\n * slip, cannot be read as a motion.\n *\n * Registered rather than module-private on two counts: two copies of the package loaded side by side\n * still recognise each other's continuations, and `tsc` cannot emit a declaration file for a type\n * keyed on a symbol it cannot name.\n *\n * @internal\n */\nexport const CONTINUOUS_UPDATE: unique symbol = Symbol.for(\"@3dverse/livelink-agent.continuous\");\n\n/**\n * What a {@link ContinuousUpdate} is handed every time it is sampled.\n *\n * @category Data\n */\nexport type ContinuousUpdateContext<TState extends object = Record<string, never>> = {\n    /**\n     * Seconds since the previous sample, and `0` on the event that installs the continuation \u2014 so a\n     * value integrated with it (`state.x += rate * delta_seconds`) never double-counts the install,\n     * and never runs away as re-reading {@link since_seconds} would.\n     *\n     * This is the one to reach for when a value **accumulates**; use {@link since_seconds} when it is\n     * a closed-form function of how long the motion has been running.\n     */\n    delta_seconds: number;\n\n    /**\n     * Seconds since this continuation was installed \u2014 since the event that set the rate. `0` on that\n     * installing event.\n     */\n    since_seconds: number;\n\n    /**\n     * Scratch space belonging to the **entity**, not to this motion: it outlives the event that\n     * replaces the continuation, so a shaft told a new rpm carries on from the angle it had reached\n     * rather than snapping back to zero. It is dropped only when the entity is deleted.\n     *\n     * This is what a mapping would otherwise keep in a `Map` of its own, with the phase read at event\n     * time and written back on every tick \u2014 a pattern that is one misplaced read away from\n     * accelerating forever.\n     */\n    state: TState;\n};\n\n/**\n * An update that keeps producing values after the event that installed it. Build one with\n * {@link continuous}.\n *\n * Some events carry a **rate**, not a value \u2014 \"the shaft is turning at 90 rpm\". A rate still means\n * something once the message that delivered it is gone, so a mapping that returned a finished patch\n * would leave the entity frozen until the next message. Returning one of these instead says *what\n * the entity is doing*, and the pipeline re-samples it on its own clock until a later event for the\n * same id replaces it.\n *\n * @category Data\n */\nexport type ContinuousUpdate<TState extends object = Record<string, never>> = {\n    /** @internal */\n    readonly [CONTINUOUS_UPDATE]: true;\n\n    /**\n     * Where the entity is *now*. Returns component patches, a whole-entity {@link EntityDirective}\n     * (so a motion can end by hiding or deleting what it was driving \u2014 both also uninstall it), or\n     * `null` when the motion is over \u2014 the continuation is then forgotten and the entity keeps its\n     * last value.\n     */\n    sample(context: ContinuousUpdateContext<TState>): ComponentUpdates | EntityDirective | null;\n\n    /**\n     * The state to start from. Used **only** the first time this entity is given a state, so a later\n     * event does not reset a motion already under way.\n     */\n    readonly initial_state?: TState;\n};\n\n/**\n * A {@link ContinuousUpdate} whose state type has been erased \u2014 what an {@link EntityUpdate} holds,\n * since one `updates` call may return several continuations, each with its own state shape.\n *\n * @category Data\n */\n// The single point where `TState` is erased. `state` sits in both a parameter and a property\n// position, so no concrete type (not `unknown`, not `never`) accepts every `ContinuousUpdate<T>`;\n// the pipeline never reads the state, it only hands it back to the mapping that owns it.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyContinuousUpdate = ContinuousUpdate<any>;\n\n/**\n * Declare that an entity **keeps moving** between events, instead of writing one finished value.\n *\n * The function is re-sampled on the pipeline's clock until a later event for the same id replaces\n * it, it returns `null` when the motion is over, and `state` is scratch space that survives those\n * replacements \u2014 which is exactly what a phase needs:\n *\n * ```typescript\n * updates: event => {\n *     const rpm = (event.payload as { rpm: number }).rpm;\n *     return {\n *         id: event.channel.split(\"/\")[2],\n *         update: continuous<{ angle_deg: number }>(\n *             ({ delta_seconds, state }) => {\n *                 // 360 degrees a turn, 60 seconds a minute.\n *                 state.angle_deg = (state.angle_deg + rpm * 6 * delta_seconds) % 360;\n *                 return { local_transform: { eulerOrientation: [state.angle_deg, 0, 0] } };\n *             },\n *             { initial_state: { angle_deg: 0 } },\n *         ),\n *     };\n * };\n * ```\n *\n * A motion runs until something replaces or stops it: a later event for the same id, a sample\n * returning `null`, a `\"hide\"` or `\"delete\"`, or {@link IngestionPipeline.clearContinuations}. An\n * event whose `updates` returns `null` is **not** one of those \u2014 it means \"this message said nothing\n * about this entity\", so a topic carrying payloads of several shapes leaves the motion alone.\n *\n * Wrapping is not ceremony: it is what keeps `update: () => buildPatch(payload)` \u2014 a plausible\n * slip, and a perfectly well-typed function \u2014 from silently installing a motion that never stops.\n *\n * @param sample - Where the entity is now, given the time elapsed and its own state.\n * @param options - `initial_state` for the value the entity's state starts at.\n *\n * @category Data\n */\nexport function continuous<TState extends object = Record<string, never>>(\n    sample: (context: ContinuousUpdateContext<TState>) => ComponentUpdates | EntityDirective | null,\n    options: { initial_state?: TState } = {},\n): ContinuousUpdate<TState> {\n    return {\n        [CONTINUOUS_UPDATE]: true,\n        sample,\n        initial_state: options.initial_state,\n    };\n}\n\n/**\n * Whether an {@link EntityUpdate.update} is a motion rather than a patch or a directive.\n *\n * @internal\n */\nexport function isContinuousUpdate(update: EntityUpdate[\"update\"]): update is AnyContinuousUpdate {\n    return typeof update === \"object\" && update !== null && CONTINUOUS_UPDATE in update;\n}\n\n/**\n * One entity driven by an event: the id addressing it, and what the event does to it. This is what\n * an {@link EventMapping.updates} function returns \u2014 one of these, or an array of them.\n *\n * @category Data\n */\nexport type EntityUpdate = {\n    /**\n     * The unique id of the object this update addresses \u2014 whatever that object is in the use case\n     * (an AGV serial number, a machine part id, ...). It is resolved to an actual scene entity\n     * through the mapping's {@link EventMapping.entities}.\n     */\n    id: string | number;\n\n    /**\n     * What the event does to that entity: component patches, a whole-entity {@link EntityDirective},\n     * or a {@link continuous} update for something that keeps moving between events.\n     */\n    update: ComponentUpdates | EntityDirective | AnyContinuousUpdate;\n};\n\n/**\n * How an id from the event stream finds an entity **already present** in the scene. Exactly one of:\n *\n * - `byName` \u2014 the entity whose *name* the id produces, from a pattern embedding `{id}` (or a\n *   function). Use it when the scene names its entities after the ids the stream carries: it removes\n *   the need to collect and configure UUIDs entirely;\n * - `byUuid` \u2014 a fixed `id \u2192 entity UUID` table, for a known, closed population (the moving parts\n *   of one machine);\n * - `resolve` \u2014 a function, for anything else (a lookup service, a naming convention with\n *   exceptions, an id needing normalization).\n *\n * @category Data\n */\nexport type EntityLookup = {\n    /**\n     * The linkage to find the entities under \u2014 the chain of scene references leading to them, empty\n     * (the default) for entities of the scene itself. A `byUuid` entry declaring its own linkage wins.\n     */\n    linkage?: Array<UUID>;\n} & (\n    | { byName: string | ((params: { id: string; event: IngestEvent }) => string); byUuid?: never; resolve?: never }\n    | { byUuid: EntityMap; byName?: never; resolve?: never }\n    | {\n          resolve: (params: {\n              id: string;\n              event: IngestEvent;\n          }) => UUID | MappedEntity | null | Promise<UUID | MappedEntity | null>;\n          byName?: never;\n          byUuid?: never;\n      }\n);\n\n/**\n * The entities **of the 3dverse scene** a mapping drives, and how an id carried by its events finds\n * \u2014 or creates \u2014 one of them. Exactly one of four strategies:\n *\n * - `byName` \u2014 the entity whose *name* the id produces (a pattern embedding `{id}`, or a function);\n * - `byUuid` \u2014 a fixed `id \u2192 entity UUID` table;\n * - `resolve` \u2014 an arbitrary function, for lookups the two above cannot express;\n * - `spawn` \u2014 no pre-existing entity: one is **created** per new id, from a template. Use it when\n *   the stream itself defines the population (one entity per device serial number).\n *\n * The first three find entities already in the scene and accept a `linkage` (see\n * {@link EntityLookup}); `spawn` creates at the scene root, and so takes none.\n *\n * @category Data\n */\nexport type SceneEntities =\n    | (EntityLookup & { spawn?: never })\n    | { spawn: EntityTemplate; byName?: never; byUuid?: never; resolve?: never; linkage?: never };\n\n/**\n * Describes how ONE event type drives entities in the scene: which events it covers (`channel` /\n * `when`), which entities those events drive (`entities`), and what each event does to them\n * (`updates`).\n *\n * A source carrying several event types (e.g. one schema per MQTT topic family) uses several\n * mappings \u2014 each event is handled by every mapping whose selectors match it.\n *\n * `updates` returns one {@link EntityUpdate} when an event is about a single object:\n *\n * ```typescript\n * const mapping: EventMapping = {\n *     channel: \"uagv/+/+/+/visualization\",\n *     entities: { spawn: { name: \"AGV-{id}\", components: { scene_ref: { value: SCENE } } } },\n *     updates: event => ({\n *         id: event.channel.split(\"/\")[3], // the serial number, from the topic\n *         update: { local_transform: agvPoseToTransform(event.payload.agvPosition) },\n *     }),\n * };\n * ```\n *\n * ...or an array of them when one event carries the state of several objects at once, the norm for a\n * machine publishing a whole-state frame:\n *\n * ```typescript\n * const mapping: EventMapping = {\n *     entities: { byName: \"{id}\" },\n *     updates: ({ payload }) => [\n *         { id: \"blade\", update: { local_transform: { eulerOrientation: [0, payload.angle, 0] } } },\n *         { id: \"carriage\", update: { local_transform: { position: [0, payload.posZ, 0] } } },\n *     ],\n * };\n * ```\n *\n * The ids need not be written out: a controller publishing a whole data block names each value in the\n * payload **key**, so walking the payload into one entry per key drives as many entities as the frame\n * carries. Whichever way they are derived, they must be unique across everything the mapping drives \u2014\n * a key alone is not, once the channel pattern matches a second device.\n *\n * @category Data\n */\nexport type EventMapping = {\n    /**\n     * Only handle events whose channel matches this MQTT-style pattern (`+`/`*` = one segment,\n     * trailing `#` = the rest). Omitted = all channels.\n     *\n     * Note that `channel` is only a meaningful selector on transports that put routing information\n     * in it \u2014 see {@link IngestEvent.channel}. On an Azure Event Hub stream, select with `when`\n     * instead.\n     */\n    channel?: string;\n\n    /**\n     * Only handle events for which this predicate returns true. Omitted = all events.\n     */\n    when?: (event: IngestEvent) => boolean;\n\n    /**\n     * JSON Schema of this event type. The **first** matching event is validated against it (a\n     * cheap sanity check of the stream's shape); every event is validated when the\n     * pipeline's `validate` option is on (debugging).\n     */\n    schema?: JsonSchema;\n\n    /**\n     * The scene entities this mapping's events drive, and how the ids they carry find \u2014 or create \u2014\n     * one. See {@link SceneEntities}.\n     */\n    entities: SceneEntities;\n\n    /**\n     * What one event does: one {@link EntityUpdate} when it is about a single object, an array of\n     * them when it carries several at once. Return `null` (or an empty array) to ignore the event.\n     *\n     * The whole event is passed, so an id can come from the payload, the channel, the metadata, or\n     * several fields combined.\n     *\n     * Note that extracting this function to a bare `const` loses TypeScript's contextual typing of\n     * its parameter; annotate it `EventMapping[\"updates\"]` if you do.\n     */\n    updates: (event: IngestEvent) => EntityUpdate | Array<EntityUpdate> | null;\n};\n", "/**\n * A console reporter that emits each distinct warning only once, to keep high-frequency event\n * streams from flooding the logs with the same message.\n *\n * @internal\n */\nexport class WarnOnceReporter {\n    readonly #seen = new Set<string>();\n\n    /**\n     * Log `message` as a warning, unless a message was already logged under the same `key`.\n     */\n    warnOnce(key: string, message: string): void {\n        if (this.#seen.has(key)) {\n            return;\n        }\n        this.#seen.add(key);\n        console.warn(message);\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { Entity } from \"@livelink.base/scene/Entity\";\nimport type { Scene } from \"@livelink.base/scene/Scene\";\nimport type { EntitiesCreatedEvent, EntitiesDeletedEvent } from \"@livelink.base/scene/SceneEvents\";\n\n//------------------------------------------------------------------------------\nimport type { IngestEvent } from \"../IngestEvent\";\nimport { WarnOnceReporter } from \"../util/reporting\";\n\n/**\n * Resolves the entity an ingested event addresses, from the unique id extracted from the\n * event (a serial number, a part id, ...).\n *\n * The SDK ships two strategies:\n * - {@link ExistingEntityResolver}: ids address entities already in the scene (by map, by name, or\n *   through a resolve function),\n * - {@link SpawningEntityResolver}: an entity is spawned live for each new id.\n *\n * @internal\n */\nexport interface EntityResolver {\n    /**\n     * Resolve the entity for an id, or null when it cannot be resolved (unknown id, entity\n     * not found, creation failed...).\n     */\n    resolve(params: { id: string; event: IngestEvent }): Promise<Entity | null>;\n\n    /**\n     * Drop whatever is remembered about an id, so the next event carrying it resolves afresh.\n     *\n     * Called by the pipeline after a `\"delete\"` directive: the scene does **not** announce a\n     * deletion the client itself performed, so the resolution has to be dropped explicitly (see\n     * {@link CachingEntityResolver}).\n     */\n    forget(id: string): void;\n\n    /**\n     * Release whatever the resolver holds on the scene (event listeners, caches). Called when the\n     * binding this resolver belongs to is unbound.\n     */\n    dispose?(): void;\n}\n\n/**\n * Base class for entity resolvers, factoring the concerns every strategy needs:\n *\n * - resolutions are cached per id (including null results, so a missing entity is looked up once),\n * - concurrent resolutions of the same id share a single in-flight production (events arriving\n *   while an entity is being looked up or created await it instead of duplicating the work),\n * - production errors are logged, not cached, and resolve to null (so the next event retries),\n * - {@link CachingEntityResolver._warnOnce} avoids log spam for repeated unresolvable ids.\n *\n * **The cache largely invalidates itself from the scene's own events**: an id that resolved to\n * nothing is retried as soon as an entity that could satisfy it appears, and a resolution is dropped\n * when another client deletes its entity.\n *\n * Unless told not to (`manage_auto_broadcast: false`), the first successful resolution of an id sets\n * `entity.auto_broadcast = false` \u2014 the entity is being driven by this stream, so it should not\n * re-broadcast those writes to other clients.\n *\n * The one case the scene cannot announce is a deletion *this* client performed \u2014 `Scene.deleteEntities`\n * removes the entities from its registry and dispatches nothing, and the server's echo then matches\n * no registered entity. So a mapping returning the `\"delete\"` directive has its id dropped through an\n * explicit {@link forget}, which the pipeline calls.\n *\n * Subclasses implement {@link CachingEntityResolver._produce}.\n *\n * @internal\n */\nexport abstract class CachingEntityResolver implements EntityResolver {\n    /**\n     * Resolved entities (or null when unresolvable), keyed by id.\n     */\n    readonly #cache = new Map<string, Entity | null>();\n\n    /**\n     * Productions in flight, to dedup concurrent resolutions of the same id.\n     */\n    readonly #in_flight = new Map<string, Promise<Entity | null>>();\n\n    /**\n     * Warn-once reporter shared by the strategy implementations.\n     */\n    readonly #reporter = new WarnOnceReporter();\n\n    /**\n     * The scene this resolver resolves against, and whose events invalidate its cache.\n     */\n    readonly #scene: Scene;\n\n    /**\n     * Whether the first successful resolution of an id forces `entity.auto_broadcast = false`.\n     */\n    readonly #manage_auto_broadcast: boolean;\n\n    /**\n     * @param params\n     * @param params.scene - The scene to resolve entities against.\n     * @param params.manage_auto_broadcast - Whether to force `auto_broadcast = false` on the first\n     * resolution of an id. See the class doc.\n     */\n    constructor({ scene, manage_auto_broadcast }: { scene: Scene; manage_auto_broadcast: boolean }) {\n        this.#scene = scene;\n        this.#manage_auto_broadcast = manage_auto_broadcast;\n        this.#scene.addEventListener(\"on-entities-created\", this.#onEntitiesCreated);\n        this.#scene.addEventListener(\"on-entities-deleted\", this.#onEntitiesDeleted);\n    }\n\n    /**\n     * The scene this resolver resolves against.\n     */\n    protected get _scene(): Scene {\n        return this.#scene;\n    }\n\n    /**\n     * Resolve the entity for an id, producing (and caching) it on first sight.\n     */\n    async resolve({ id, event }: { id: string; event: IngestEvent }): Promise<Entity | null> {\n        const cached = this.#cache.get(id);\n        if (cached !== undefined) {\n            return cached;\n        }\n\n        const pending = this.#in_flight.get(id);\n        if (pending) {\n            return pending;\n        }\n\n        const production: Promise<Entity | null> = this._produce({ id, event })\n            .then(entity => {\n                if (entity && this.#manage_auto_broadcast) {\n                    entity.auto_broadcast = false;\n                }\n\n                // A `forget` (or a `dispose`) landing while this was in flight drops the in-flight\n                // entry; caching the result then would resurrect exactly what was asked to go.\n                if (this.#in_flight.get(id) === production) {\n                    this.#cache.set(id, entity);\n                }\n                return entity;\n            })\n            .catch(error => {\n                console.error(`[entity-resolver] Failed to resolve entity for id \"${id}\":`, error);\n                return null;\n            })\n            .finally(() => {\n                if (this.#in_flight.get(id) === production) {\n                    this.#in_flight.delete(id);\n                }\n            });\n\n        this.#in_flight.set(id, production);\n        return production;\n    }\n\n    /**\n     * Drop what is remembered about an id \u2014 its cached resolution and any production in\n     * flight \u2014 so the next event carrying it resolves (or respawns) afresh.\n     */\n    forget(id: string): void {\n        this.#cache.delete(id);\n        this.#in_flight.delete(id);\n    }\n\n    /**\n     * Stop listening to the scene and drop everything cached.\n     */\n    dispose(): void {\n        this.#scene.removeEventListener(\"on-entities-created\", this.#onEntitiesCreated);\n        this.#scene.removeEventListener(\"on-entities-deleted\", this.#onEntitiesDeleted);\n        this.#cache.clear();\n        this.#in_flight.clear();\n    }\n\n    /**\n     * Entities appeared in the scene: the ids that resolved to *nothing* and could be satisfied by\n     * one of them are dropped, so they resolve again. Successful resolutions are untouched \u2014 they\n     * are still valid.\n     *\n     * This is what makes an id mentioned by the stream before its entity exists work on its own,\n     * instead of needing the caller to invalidate the cache by hand. {@link _couldBeSatisfiedBy}\n     * keeps it from turning into a lookup storm when something else is spawning entities into the\n     * same scene at stream rate.\n     */\n    #onEntitiesCreated = (event: EntitiesCreatedEvent): void => {\n        for (const [id, entity] of this.#cache) {\n            if (entity === null && this._couldBeSatisfiedBy({ id, created: event.entities })) {\n                this.#cache.delete(id);\n            }\n        }\n    };\n\n    /**\n     * An entity was deleted: drop the resolutions pointing at it, so the next event carrying that\n     * id resolves again (and, with a spawning resolver, recreates it).\n     */\n    #onEntitiesDeleted = (event: EntitiesDeletedEvent): void => {\n        for (const [id, entity] of this.#cache) {\n            if (entity !== null && event.includes(entity)) {\n                this.#cache.delete(id);\n            }\n        }\n    };\n\n    /**\n     * Produce the entity for an id seen for the first time. Return null when the id is\n     * unresolvable (the null is cached); throw to leave the id unresolved (the next event\n     * retries).\n     */\n    protected abstract _produce(params: { id: string; event: IngestEvent }): Promise<Entity | null>;\n\n    /**\n     * Whether any of the entities that just appeared could be the one an unresolved id addresses \u2014\n     * i.e. whether it is worth paying for another lookup.\n     *\n     * Defaults to yes, which is always correct but re-looks-up every unresolved id on every\n     * creation. A strategy that knows what it is looking for should narrow it: with a spawning\n     * mapping feeding the same scene, an unnarrowed retry means one round trip per unresolved id\n     * per spawn.\n     */\n    protected _couldBeSatisfiedBy(_params: { id: string; created: Array<Entity> }): boolean {\n        return true;\n    }\n\n    /**\n     * Log a warning for an id once.\n     */\n    protected _warnOnce({ id, message }: { id: string; message: string }): void {\n        this.#reporter.warnOnce(id, message);\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { UUID } from \"@3dverse/livelink.core\";\nimport type { Entity } from \"@livelink.base/scene/Entity\";\nimport type { Scene } from \"@livelink.base/scene/Scene\";\n\n//------------------------------------------------------------------------------\nimport type { IngestEvent } from \"../IngestEvent\";\nimport type { EntityLookup } from \"../EventMapping\";\nimport { CachingEntityResolver } from \"./EntityResolver\";\n\n/**\n * One entry of an {@link EntityMap}: the UUID of the entity an id drives, either bare or paired with\n * the linkage to find it under (the chain of scene references leading to it, empty for an entity of\n * the scene itself). A bare UUID takes the linkage declared alongside the map.\n *\n * @category Data\n */\nexport type MappedEntity = {\n    /**\n     * The UUID of the existing entity the id drives.\n     */\n    entity_uuid: UUID;\n\n    /**\n     * The linkage to find this entity under. Overrides the linkage declared alongside the map when\n     * defined.\n     */\n    linkage?: Array<UUID>;\n};\n\n/**\n * The mapping of ids (as carried by the events) to the existing entities they drive \u2014 the `byUuid`\n * strategy of an {@link EntityLookup}.\n *\n * @category Data\n */\nexport type EntityMap = Record<string, UUID | MappedEntity>;\n\n/**\n * The entry an id maps to, or null when the map does not declare it.\n *\n * An own-property test rather than an index read: an id is stream data, and a mapping is free to\n * take it straight from a payload key. `payload[\"constructor\"]` would otherwise reach\n * `Object.prototype`, pass the null check below, and send an `undefined` UUID to the scene instead of\n * being reported as the unmapped id it is.\n */\nfunction entryFor(by_uuid: EntityMap | undefined, id: string): UUID | MappedEntity | null {\n    if (by_uuid === undefined || !Object.hasOwn(by_uuid, id)) {\n        return null;\n    }\n    return by_uuid[id];\n}\n\n/**\n * Whether an entity sits under exactly the given linkage \u2014 the same lineage test\n * `Scene.findEntity` applies, needed because name lookups cannot express one.\n */\nfunction isUnderLinkage(entity: Entity, linkage: Array<UUID>): boolean {\n    const lineage = entity.lineage?.value ?? [];\n    return lineage.length === linkage.length && lineage.every((uuid, index) => uuid === linkage[index]);\n}\n\n/**\n * Resolves ids against entities **already present** in the scene, through any of the three\n * {@link EntityLookup} strategies:\n *\n * - `byName` \u2014 the entity whose *name* the id produces (pattern with `{id}`, or a function), so a\n *   scene that names its entities after the ids the stream carries needs no UUID configuration at\n *   all;\n * - `byUuid` \u2014 a fixed `id \u2192 entity UUID` table, for a known, closed population;\n * - `resolve` \u2014 an arbitrary function, for lookups the two above cannot express.\n *\n * Ids that resolve to nothing, or to an entity missing from the scene, resolve to null with a\n * single warning \u2014 and are retried automatically once any entity appears in the scene (see\n * {@link CachingEntityResolver}).\n *\n * @internal\n */\nexport class ExistingEntityResolver extends CachingEntityResolver {\n    /**\n     * The lookup strategy and its shared linkage.\n     */\n    readonly #lookup: EntityLookup;\n\n    /**\n     * The linkage applied to the lookups that do not define one of their own.\n     */\n    readonly #linkage: Array<UUID>;\n\n    /**\n     * What each id that failed to resolve was looking for \u2014 a name for `byName`, a UUID for\n     * `byUuid` / `resolve` \u2014 so a later creation only triggers another lookup when it could actually\n     * satisfy it. See {@link CachingEntityResolver._couldBeSatisfiedBy}.\n     */\n    readonly #sought = new Map<string, { name?: string; entity_uuid?: UUID }>();\n\n    /**\n     * @param params\n     * @param params.scene - The scene holding the pre-existing entities.\n     * @param params.lookup - The lookup strategy (`byName`, `byUuid` or `resolve`) and its linkage.\n     * @param params.manage_auto_broadcast - Whether to force `auto_broadcast = false` on the entity\n     * resolved for each new id. Defaults to `true`. See {@link CachingEntityResolver}.\n     */\n    constructor({\n        scene,\n        lookup,\n        manage_auto_broadcast,\n    }: {\n        scene: Scene;\n        lookup: EntityLookup;\n        manage_auto_broadcast?: boolean;\n    }) {\n        super({ scene, manage_auto_broadcast: manage_auto_broadcast ?? true });\n        this.#lookup = lookup;\n        this.#linkage = lookup.linkage ?? [];\n    }\n\n    /**\n     * Produce the entity for the given id and event.\n     */\n    protected async _produce({ id, event }: { id: string; event: IngestEvent }): Promise<Entity | null> {\n        // Cleared up front, so what is remembered is always this attempt's outcome: the lookup paths\n        // below record what they failed to find, and record nothing when they succeed.\n        this.#sought.delete(id);\n\n        if (this.#lookup.byName !== undefined) {\n            return this.#produceByName({ id, event });\n        }\n        return this.#produceByUuid({ id, event });\n    }\n\n    /**\n     * Resolve through the `byName` strategy: find the entity carrying the name the id produces,\n     * keeping only the candidates sitting under the configured linkage.\n     */\n    async #produceByName({ id, event }: { id: string; event: IngestEvent }): Promise<Entity | null> {\n        const by_name = this.#lookup.byName!;\n        const name = typeof by_name === \"function\" ? by_name({ id, event }) : by_name.replaceAll(\"{id}\", id);\n\n        const candidates = await this._scene.findEntitiesByNames({ entity_names: [name] });\n        const matching = candidates.filter(entity => isUnderLinkage(entity, this.#linkage));\n\n        if (matching.length === 0) {\n            this.#sought.set(id, { name });\n            this._warnOnce({\n                id,\n                message:\n                    `[entity-resolver] No entity named \"${name}\" (id \"${id}\") found in the scene` +\n                    `${this.#linkage.length > 0 ? ` under linkage [${this.#linkage.join(\", \")}]` : \"\"}; ` +\n                    `ignoring its events until one appears.`,\n            });\n            return null;\n        }\n        if (matching.length > 1) {\n            this._warnOnce({\n                id,\n                message:\n                    `[entity-resolver] ${matching.length} entities are named \"${name}\" (id \"${id}\"); ` +\n                    `driving the first one. Give them distinct names, or use a linkage, to disambiguate.`,\n            });\n        }\n        return matching[0];\n    }\n\n    /**\n     * Resolve through the `byUuid` or `resolve` strategies, both of which produce a UUID (+ optional\n     * per-entry linkage) to look up.\n     */\n    async #produceByUuid({ id, event }: { id: string; event: IngestEvent }): Promise<Entity | null> {\n        const entry = this.#lookup.resolve\n            ? await this.#lookup.resolve({ id, event })\n            : entryFor(this.#lookup.byUuid, id);\n\n        if (!entry) {\n            this._warnOnce({\n                id,\n                message: `[entity-resolver] No entity mapping for id \"${id}\"; ignoring its events.`,\n            });\n            return null;\n        }\n\n        const entity_uuid = typeof entry === \"string\" ? entry : entry.entity_uuid;\n        const linkage = (typeof entry === \"string\" ? undefined : entry.linkage) ?? this.#linkage;\n\n        const entity = await this._scene.findEntity({ entity_uuid, linkage });\n        if (!entity) {\n            this.#sought.set(id, { entity_uuid });\n            this._warnOnce({\n                id,\n                message: `[entity-resolver] Entity ${entity_uuid} (id \"${id}\") not found in the scene; ignoring its events.`,\n            });\n        }\n        return entity;\n    }\n\n    /**\n     * Retry an unresolved id only when one of the entities that just appeared carries the name (or\n     * the UUID) that id was looking for. An id whose lookup never got that far \u2014 a `resolve`\n     * function returning null, an unmapped id \u2014 has nothing to match on, so it keeps the broad\n     * retry.\n     */\n    protected override _couldBeSatisfiedBy({ id, created }: { id: string; created: Array<Entity> }): boolean {\n        const sought = this.#sought.get(id);\n        if (!sought) {\n            return true;\n        }\n        return created.some(entity => entity.name === sought.name || entity.id === sought.entity_uuid);\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { ComponentsManifest } from \"@3dverse/livelink.core\";\nimport type { Entity } from \"@livelink.base/scene/Entity\";\nimport type { Scene, EntityCreationOptions } from \"@livelink.base/scene/Scene\";\n\n//------------------------------------------------------------------------------\nimport type { IngestEvent } from \"../IngestEvent\";\nimport { CachingEntityResolver } from \"./EntityResolver\";\n\n/**\n * Describes the entity the pipeline creates for each new id, under a mapping whose `entities`\n * declares `spawn`.\n *\n * @category Data\n */\nexport type EntityTemplate = {\n    /**\n     * The name of the spawned entity. A string may embed the `{id}` placeholder\n     * (e.g. `\"AGV-{id}\"`); a function receives the id and the triggering event.\n     */\n    name: string | ((params: { id: string; event: IngestEvent }) => string);\n\n    /**\n     * The components of the spawned entity. A function receives the id and the triggering event, to\n     * derive initial values (e.g. the initial transform) from the first sighting.\n     */\n    components: ComponentsManifest | ((params: { id: string; event: IngestEvent }) => ComponentsManifest);\n\n    /**\n     * Additional entity creation options. Consider `delete_on_client_disconnection: true` so\n     * spawned entities vanish with the agent.\n     */\n    options?: EntityCreationOptions;\n};\n\n/**\n * Spawns an entity for each new id, from a template.\n *\n * Use it when the data stream itself defines the population (e.g. one entity per device serial\n * number). The entity is created on the id's first sighting; concurrent events for the same id\n * await the single in-flight creation.\n *\n * @internal\n */\nexport class SpawningEntityResolver extends CachingEntityResolver {\n    /**\n     * The template describing the entity spawned for each new id.\n     */\n    readonly #template: EntityTemplate;\n\n    /**\n     * @param params\n     * @param params.scene - The scene to spawn entities in.\n     * @param params.template - The template describing the entity spawned for each new id.\n     * @param params.manage_auto_broadcast - Whether to force `auto_broadcast = false` on the entity\n     * spawned for each new id. Defaults to `true`. See {@link CachingEntityResolver}.\n     */\n    constructor({\n        scene,\n        template,\n        manage_auto_broadcast,\n    }: {\n        scene: Scene;\n        template: EntityTemplate;\n        manage_auto_broadcast?: boolean;\n    }) {\n        super({ scene, manage_auto_broadcast: manage_auto_broadcast ?? true });\n        this.#template = template;\n    }\n\n    /**\n     * Produce the entity for the given id and event.\n     */\n    protected async _produce({ id, event }: { id: string; event: IngestEvent }): Promise<Entity | null> {\n        const { name, components, options } = this.#template;\n        return this._scene.newEntity({\n            name: typeof name === \"function\" ? name({ id, event }) : name.replaceAll(\"{id}\", id),\n            components: typeof components === \"function\" ? components({ id, event }) : components,\n            options,\n        });\n    }\n}\n", "//------------------------------------------------------------------------------\nimport isEqual from \"lodash/isEqual\";\nimport cloneDeep from \"lodash/cloneDeep\";\n\n//------------------------------------------------------------------------------\nimport type { ComponentName } from \"@3dverse/livelink.core\";\nimport type { Entity } from \"@livelink.base/scene/Entity\";\n\n//------------------------------------------------------------------------------\nimport type { ComponentUpdates } from \"../EventMapping\";\n\n/**\n * Applies component updates to entities, skipping redundant writes: the last patch applied per\n * (entity, component) is remembered and a deep-equal patch is a no-op \u2014 so a high-frequency stream\n * repeating the same values does not flood the update loop. (If another client rewrites the\n * component in between, the skip keeps the other client's value until the stream produces a\n * different one.)\n *\n * @internal\n */\nexport class ComponentPatchApplier {\n    /**\n     * The last patch applied, per entity and component.\n     */\n    readonly #last_applied = new WeakMap<Entity, Map<string, unknown>>();\n\n    /**\n     * Apply component updates to an entity.\n     *\n     * @returns How many component writes reached the scene and how many were skipped as redundant\n     * \u2014 the pipeline reports both, so a stream that looks idle can be told apart from one whose\n     * values simply are not changing.\n     */\n    apply({ entity, updates }: { entity: Entity; updates: ComponentUpdates }): {\n        written: number;\n        deduped: number;\n    } {\n        let written = 0;\n        let deduped = 0;\n\n        for (const [component_name, patch] of Object.entries(updates)) {\n            if (patch === undefined) {\n                continue;\n            }\n\n            let last_per_component = this.#last_applied.get(entity);\n            if (!last_per_component) {\n                last_per_component = new Map<string, unknown>();\n                this.#last_applied.set(entity, last_per_component);\n            }\n            if (isEqual(last_per_component.get(component_name), patch)) {\n                deduped++;\n                continue;\n            }\n            last_per_component.set(component_name, cloneDeep(patch));\n\n            entity.updateComponent(component_name as ComponentName, patch);\n            written++;\n        }\n\n        return { written, deduped };\n    }\n}\n", "/**\n * A JSON Schema, as a plain JSON object.\n *\n * @category Data\n */\nexport type JsonSchema = Record<string, unknown>;\n\n/**\n * Minimal structural view of the ajv module, avoiding a hard type dependency on its dual\n * (ESM/CJS) type declarations.\n *\n * @internal\n */\ntype AjvValidateFn = ((payload: unknown) => boolean) & { errors?: unknown };\ntype AjvLike = {\n    compile(schema: object): AjvValidateFn;\n    errorsText(errors?: unknown): string;\n};\ntype AjvConstructor = new (options?: object) => AjvLike;\n\n/**\n * The outcome of validating a payload.\n *\n * @inline\n * @internal\n */\nexport type ValidationResult = { valid: true } | { valid: false; errors: string };\n\n/**\n * Validates event payloads against a JSON Schema.\n *\n * Requires the optional dependency `ajv`, loaded lazily by {@link SchemaValidator.create} \u2014 the\n * rest of the data module works without it when no schema is configured.\n *\n * @internal\n */\nexport class SchemaValidator {\n    /**\n     * The validation function.\n     *\n     * @param payload The payload to validate.\n     * @returns `true` if the payload is valid, `false` otherwise.\n     */\n    readonly #validate: (payload: unknown) => boolean;\n\n    /**\n     * Returns a human-readable string of the last validation errors.\n     *\n     * @returns A string describing the last validation errors.\n     */\n    readonly #errorsText: () => string;\n\n    /**\n     * Compile a validator for a schema.\n     *\n     * @throws If `ajv` is not installed or the schema does not compile.\n     */\n    static async create({ schema }: { schema: JsonSchema }): Promise<SchemaValidator> {\n        let ajv_module: { default?: AjvConstructor };\n        try {\n            ajv_module = (await import(\"ajv\")) as unknown as { default?: AjvConstructor };\n        } catch {\n            throw new Error(\n                'Event schema validation requires the optional dependency \"ajv\". Install it with `npm install ajv`.',\n            );\n        }\n\n        // Depending on the module system the default export is either on `.default` or is the\n        // module itself.\n        const Ajv = ajv_module.default ?? (ajv_module as unknown as AjvConstructor);\n        const ajv = new Ajv({ allErrors: true });\n        const validate = ajv.compile(schema);\n        return new SchemaValidator({\n            validate: payload => validate(payload),\n            errorsText: () => ajv.errorsText(validate.errors),\n        });\n    }\n\n    /**\n     *\n     */\n    private constructor({\n        validate,\n        errorsText,\n    }: {\n        validate: (payload: unknown) => boolean;\n        errorsText: () => string;\n    }) {\n        this.#validate = validate;\n        this.#errorsText = errorsText;\n    }\n\n    /**\n     * Validate a payload against the schema.\n     */\n    validate(payload: unknown): ValidationResult {\n        if (this.#validate(payload)) {\n            return { valid: true };\n        }\n        return { valid: false, errors: this.#errorsText() };\n    }\n}\n", "/**\n * Why an event (or one of the entity updates it produced) did not reach an entity.\n *\n * `no_binding` and `no_mapping_matched` are the two that matter during bring-up: they are the\n * difference between \"the stream is not arriving\", \"it arrives but nothing is listening yet\" and\n * \"it arrives but no mapping wants it\" \u2014 three failures that otherwise look identical from outside.\n *\n * @category Data\n */\nexport type IngestionDropReason =\n    /** No scene was bound yet (no session ready), so the event had nowhere to go. */\n    | \"no_binding\"\n    /** No mapping's `channel` / `when` selectors matched the event. */\n    | \"no_mapping_matched\"\n    /** The payload did not match the mapping's JSON Schema. */\n    | \"schema\"\n    /** The mapping produced an update carrying no usable `id`. */\n    | \"no_id\"\n    /**\n     * The event produced nothing to write: the mapping's `updates` returned null (or nothing) \u2014 a\n     * deliberate ignore \u2014 or every entry it did return was a {@link continuous} update that reported\n     * itself already over on its first sample, leaving nothing installed and nothing to apply.\n     */\n    | \"no_updates\"\n    /** The id resolved to no entity in the scene. */\n    | \"unresolved_entity\";\n\n/**\n * The ingestion counters of one {@link EventMapping}.\n *\n * @category Data\n */\nexport type MappingStats = {\n    /** Index of the mapping in the pipeline's mapping list. */\n    index: number;\n    /** The mapping's channel pattern, when it declares one. */\n    channel?: string;\n    /** Events whose selectors matched this mapping. */\n    events_matched: number;\n    /** (entity update, scene) pairs this mapping successfully applied. */\n    updates_applied: number;\n    /** Events this mapping matched but did not apply, by reason. */\n    drops: Partial<Record<IngestionDropReason, number>>;\n    /** When this mapping last matched an event. */\n    last_event_at: Date | null;\n    /**\n     * {@link ContinuousUpdate}s this mapping currently drives. The global gauge answers \"is anything\n     * moving?\"; this one answers \"which mapping is moving it?\", which is the question with more than\n     * one mapping in play \u2014 and the one that tells a motion nobody replaced apart from a stream that\n     * genuinely stopped.\n     */\n    continuations_active: number;\n};\n\n/**\n * A snapshot of what an {@link IngestionPipeline} has actually done \u2014 the answer to \"is data\n * flowing?\", which the transports and the scene cannot give on their own.\n *\n * Note that {@link events_matched} and {@link events_dropped} **overlap**: an event a mapping\n * selected but then applied nothing for (no id, no updates, unresolved entity) counts in both, so\n * their sum can exceed {@link events_received}.\n *\n * @category Data\n */\nexport type IngestionStats = {\n    /** Events submitted to the pipeline, whatever became of them. */\n    events_received: number;\n    /** Events at least one mapping matched. Overlaps {@link events_dropped}. */\n    events_matched: number;\n    /** Events no mapping applied at all, for any reason. Overlaps {@link events_matched}. */\n    events_dropped: number;\n    /** (entity update, scene) pairs successfully applied. */\n    updates_applied: number;\n    /**\n     * Component writes actually sent to the scene. Includes writes produced by a\n     * {@link ContinuousUpdate} on a clock tick, not only those an event caused directly.\n     */\n    components_written: number;\n    /** Component writes skipped because the value was unchanged. */\n    components_deduped: number;\n    /** Whole-entity directives (`delete` / `hide` / `show`) carried out. */\n    directives_applied: number;\n    /** Drop totals across every mapping. */\n    drops: Partial<Record<IngestionDropReason, number>>;\n    /** When the pipeline last received an event, whatever became of it. */\n    last_event_at: Date | null;\n    /** When the pipeline last wrote to a scene. */\n    last_applied_at: Date | null;\n    /** Scenes currently bound. */\n    bound_scene_count: number;\n    /**\n     * Clock ticks the pipeline has processed. Ticks are deliberately **not** counted as events:\n     * {@link events_received} and {@link last_event_at} keep meaning \"data is arriving\" even while a\n     * continuous update drives the scene on its own.\n     */\n    ticks_processed: number;\n    /**\n     * {@link ContinuousUpdate}s currently installed, across every mapping \u2014 the answer to \"the\n     * stream is fine, so why is nothing moving?\". {@link MappingStats.continuations_active} breaks\n     * it down by mapping.\n     */\n    continuations_active: number;\n    /** Per-mapping breakdown, index-aligned with the pipeline's mappings. */\n    per_mapping: Array<MappingStats>;\n};\n\n/**\n * What an {@link IngestionPipeline} reports its work to. Two implementations: {@link StatsCollector},\n * which counts, and {@link NoopStatsCollector}, which does nothing \u2014 chosen by the pipeline's\n * `stats` option.\n *\n * Timestamps travel as epoch milliseconds so the counting path allocates nothing; `Date`s are\n * materialized in {@link snapshot} only.\n *\n * @internal\n */\nexport interface IngestionStatsCollector {\n    eventReceived(at_ms: number): void;\n    eventMatched(): void;\n    eventDropped(): void;\n    mappingMatched(index: number, at_ms: number): void;\n    dropped(reason: IngestionDropReason, mapping_index?: number): void;\n    applied(params: { mapping_index: number; written: number; deduped: number; directive: boolean }): void;\n    tickProcessed(): void;\n    /**\n     * @param params.continuations_active - How many continuations each mapping currently drives,\n     * index-aligned with them. A gauge rather than a counter: it is read off the pipeline at snapshot\n     * time instead of being tracked here, so it cannot drift from the maps it describes.\n     */\n    snapshot(params: { bound_scene_count: number; continuations_active: Array<number> }): IngestionStats;\n}\n\n/**\n * Mutable counters behind {@link IngestionStats}. Kept internal: consumers read immutable snapshots\n * through `pipeline.stats`.\n *\n * @internal\n */\nexport class StatsCollector implements IngestionStatsCollector {\n    #events_received = 0;\n    #events_matched = 0;\n    #events_dropped = 0;\n    #updates_applied = 0;\n    #components_written = 0;\n    #components_deduped = 0;\n    #directives_applied = 0;\n    #ticks_processed = 0;\n    #last_event_at_ms: number | null = null;\n    #last_applied_at_ms: number | null = null;\n    readonly #drops = new Map<IngestionDropReason, number>();\n    readonly #per_mapping: Array<{\n        index: number;\n        channel?: string;\n        events_matched: number;\n        updates_applied: number;\n        drops: Map<IngestionDropReason, number>;\n        last_event_at_ms: number | null;\n    }>;\n\n    constructor({ channels }: { channels: Array<string | undefined> }) {\n        this.#per_mapping = channels.map((channel, index) => ({\n            index,\n            ...(channel !== undefined ? { channel } : {}),\n            events_matched: 0,\n            updates_applied: 0,\n            drops: new Map<IngestionDropReason, number>(),\n            last_event_at_ms: null,\n        }));\n    }\n\n    eventReceived(at_ms: number): void {\n        this.#events_received++;\n        this.#last_event_at_ms = at_ms;\n    }\n\n    eventMatched(): void {\n        this.#events_matched++;\n    }\n\n    eventDropped(): void {\n        this.#events_dropped++;\n    }\n\n    mappingMatched(index: number, at_ms: number): void {\n        const mapping = this.#per_mapping[index];\n        mapping.events_matched++;\n        mapping.last_event_at_ms = at_ms;\n    }\n\n    dropped(reason: IngestionDropReason, mapping_index?: number): void {\n        this.#drops.set(reason, (this.#drops.get(reason) ?? 0) + 1);\n        if (mapping_index !== undefined) {\n            const drops = this.#per_mapping[mapping_index].drops;\n            drops.set(reason, (drops.get(reason) ?? 0) + 1);\n        }\n    }\n\n    applied({\n        mapping_index,\n        written,\n        deduped,\n        directive,\n    }: {\n        mapping_index: number;\n        written: number;\n        deduped: number;\n        directive: boolean;\n    }): void {\n        this.#updates_applied++;\n        this.#components_written += written;\n        this.#components_deduped += deduped;\n        if (directive) {\n            this.#directives_applied++;\n        }\n        this.#last_applied_at_ms = Date.now();\n        this.#per_mapping[mapping_index].updates_applied++;\n    }\n\n    tickProcessed(): void {\n        this.#ticks_processed++;\n    }\n\n    snapshot({\n        bound_scene_count,\n        continuations_active,\n    }: {\n        bound_scene_count: number;\n        continuations_active: Array<number>;\n    }): IngestionStats {\n        return {\n            events_received: this.#events_received,\n            events_matched: this.#events_matched,\n            events_dropped: this.#events_dropped,\n            updates_applied: this.#updates_applied,\n            components_written: this.#components_written,\n            components_deduped: this.#components_deduped,\n            directives_applied: this.#directives_applied,\n            drops: Object.fromEntries(this.#drops),\n            last_event_at: toDate(this.#last_event_at_ms),\n            last_applied_at: toDate(this.#last_applied_at_ms),\n            bound_scene_count,\n            ticks_processed: this.#ticks_processed,\n            // Summed rather than passed in twice, so the total and the breakdown cannot disagree.\n            continuations_active: continuations_active.reduce((total, count) => total + count, 0),\n            per_mapping: this.#per_mapping.map(mapping => ({\n                index: mapping.index,\n                ...(mapping.channel !== undefined ? { channel: mapping.channel } : {}),\n                events_matched: mapping.events_matched,\n                updates_applied: mapping.updates_applied,\n                drops: Object.fromEntries(mapping.drops),\n                last_event_at: toDate(mapping.last_event_at_ms),\n                continuations_active: continuations_active[mapping.index] ?? 0,\n            })),\n        };\n    }\n}\n\n/**\n * The collector used when a pipeline is built with `stats: false`: every call is a no-op, so the\n * applied path costs nothing at all. Its {@link snapshot} is never called \u2014 a pipeline with stats\n * off reports `null` rather than a snapshot of zeros, which would read as \"nothing flowed\".\n *\n * @internal\n */\nexport class NoopStatsCollector implements IngestionStatsCollector {\n    eventReceived(): void {}\n    eventMatched(): void {}\n    eventDropped(): void {}\n    mappingMatched(): void {}\n    dropped(): void {}\n    applied(): void {}\n    tickProcessed(): void {}\n    snapshot(): IngestionStats {\n        throw new Error(\"Stats are disabled on this pipeline (`stats: false`).\");\n    }\n}\n\n/**\n * An epoch-millisecond timestamp as a `Date`, for a snapshot.\n */\nfunction toDate(at_ms: number | null): Date | null {\n    return at_ms === null ? null : new Date(at_ms);\n}\n", "//------------------------------------------------------------------------------\nimport type { Entity } from \"@livelink.base/scene/Entity\";\nimport type { Scene } from \"@livelink.base/scene/Scene\";\n\n//------------------------------------------------------------------------------\nimport type { IngestEvent } from \"./IngestEvent\";\nimport type {\n    AnyContinuousUpdate,\n    ComponentUpdates,\n    EntityDirective,\n    EntityUpdate,\n    EventMapping,\n    SceneEntities,\n} from \"./EventMapping\";\nimport { isContinuousUpdate } from \"./EventMapping\";\nimport type { EntityResolver } from \"./resolvers/EntityResolver\";\nimport { ExistingEntityResolver } from \"./resolvers/ExistingEntityResolver\";\nimport { SpawningEntityResolver } from \"./resolvers/SpawningEntityResolver\";\nimport { ComponentPatchApplier } from \"./apply/ComponentPatchApplier\";\nimport { SchemaValidator } from \"./SchemaValidator\";\nimport {\n    NoopStatsCollector,\n    StatsCollector,\n    type IngestionStats,\n    type IngestionStatsCollector,\n} from \"./IngestionStats\";\nimport { matchChannel } from \"./util/channel\";\nimport { WarnOnceReporter } from \"./util/reporting\";\n\n/**\n * A scene attached to an {@link IngestionPipeline}. Hold it to detach that scene again; the\n * pipeline keeps ingesting into whatever is still bound.\n *\n * @category Data\n */\nexport type PipelineBinding = {\n    /** The bound scene. */\n    readonly scene: Scene;\n\n    /** Detach the scene and release the per-scene resolvers (and their scene listeners). */\n    unbind(): void;\n};\n\n/**\n * Options for an {@link IngestionPipeline}.\n *\n * @category Data\n */\nexport type IngestionPipelineOptions = {\n    /**\n     * The mapping(s) describing how events drive entities. An event is handled by every mapping\n     * whose `channel` / `when` selectors match it.\n     */\n    mappings: EventMapping | Array<EventMapping>;\n\n    /**\n     * Validate **every** event against the schema of the mappings that declare one (requires the\n     * optional `ajv` dependency). Off by default: only the first matching event of each such\n     * mapping is validated; full per-event validation is a debugging tool.\n     */\n    validate?: boolean;\n\n    /**\n     * Count what the pipeline does, readable through {@link IngestionPipeline.stats}. On by default:\n     * the counting path allocates nothing and costs a handful of integer increments, well under what\n     * a single component write already costs, and the `no_binding` / `no_mapping_matched` /\n     * `unresolved_entity` breakdown is the only thing that tells \"the stream is not arriving\" apart\n     * from \"nothing is listening yet\" and \"no mapping wants it\".\n     *\n     * Set it to `false` for the very highest-frequency streams; `stats` then reports `null`.\n     */\n    stats?: boolean;\n\n    /**\n     * Called when a mapping's `updates` function throws or returns something unusable, or when an\n     * entity write fails. Ingestion continues \u2014 one bad event does not stop the stream.\n     */\n    onError?: (error: Error) => void;\n\n    /**\n     * On by default: the first time the pipeline resolves or spawns an entity for an id, it sets\n     * `entity.auto_broadcast = false` \u2014 the entity is being driven by this stream, so it should not\n     * re-broadcast those writes to other clients. Set to `false` to leave `auto_broadcast` untouched\n     * and manage it yourself, e.g. through a `spawn` template's `options.auto_broadcast`, or directly\n     * on entities found by `byName` / `byUuid` / `resolve`.\n     */\n    manage_auto_broadcast?: boolean;\n};\n\n/**\n * A continuous update currently driving one id, with what it needs to be re-sampled.\n */\ntype InstalledContinuation = {\n    update: AnyContinuousUpdate;\n    /**\n     * Seconds this continuation has been advanced, accumulated from the ticks themselves rather\n     * than read off the wall clock \u2014 so `tick` is the only thing that moves a motion forward, and\n     * replaying the same ticks replays the same motion.\n     */\n    since_seconds: number;\n    /**\n     * The event to resolve this id against: a tick has none of its own, and resolution takes one.\n     * Deliberately **stale** \u2014 it is the message that said which entity this motion is about.\n     */\n    event: IngestEvent;\n};\n\n/**\n * One mapping, its schema-validation state, the continuations it currently drives and the per-entity\n * state those hand back to it \u2014 all held once for the pipeline's lifetime.\n *\n * Continuations sit here, per mapping and keyed by id, rather than on a {@link BindingState} slot:\n * `updates` runs once per event and fans out to every bound scene, so a continuation must be sampled\n * once per tick and fan out the same way. Per binding, a stateful closure would advance once per\n * session \u2014 two sessions, and a shaft turns at double speed.\n *\n * `states` is keyed the same way and deliberately **outlives** the continuations reading it: a new\n * rate installs a new continuation, and the shaft must carry on from the angle it had reached.\n */\ntype CompiledMapping = {\n    config: EventMapping;\n    validator_promise: Promise<SchemaValidator> | null;\n    validated_first: boolean;\n    continuations: Map<string, InstalledContinuation>;\n    states: Map<string, object>;\n};\n\n/**\n * One entity update on its way to the bound scenes, with the event that produced it \u2014 the event\n * itself for an ingested update, the installing event for one a continuation produced.\n */\ntype PendingUpdate = {\n    entry: EntityUpdate;\n    event: IngestEvent;\n};\n\n/**\n * The per-scene resolve+apply state of one mapping (index-aligned with the compiled mappings).\n */\ntype BindingState = {\n    scene: Scene;\n    slots: Array<{ resolver: EntityResolver; applier: ComponentPatchApplier }>;\n};\n\n/**\n * Turns ingested events into entity updates, in every scene bound to it, according to one or more\n * {@link EventMapping}s.\n *\n * This is the whole data layer, with **no** dependency on an {@link Agent}, a {@link Transport} or a\n * session: you bind scenes to it and push events in. That makes {@link IngestionPipeline.ingest} the\n * primary verb of the SDK's data module \u2014 a mapping can be exercised from a test, a webhook, a REST\n * handler or a replay tool without a broker anywhere in sight:\n *\n * ```typescript\n * const pipeline = new IngestionPipeline({ mappings });\n * pipeline.bind({ scene });\n * await pipeline.ingest({ channel: \"uagv/v2/m/AGV-1/visualization\", payload });\n * ```\n *\n * For each event: pick the matching mappings; per mapping, (opt.) validate the payload against its\n * schema, call its `updates` function to get one entity update or several \u2014 then, in each bound\n * scene, resolve every id to an entity (found or spawned per the mapping's `entities`) and apply its\n * update, skipping redundant component writes.\n *\n * To drive the scenes an {@link Agent} is attached to, and to feed the pipeline from a transport,\n * use {@link SceneIngestion} \u2014 it owns a pipeline and binds/unbinds sessions for you.\n *\n * @category Data\n */\nexport class IngestionPipeline {\n    /**\n     * The mappings, compiled once at construction.\n     */\n    readonly #mappings: Array<CompiledMapping>;\n\n    /**\n     * Whether to validate every event against its schema (requires the optional `ajv` dependency).\n     */\n    readonly #validate_all: boolean;\n\n    /**\n     * Called when a mapping's own code throws or an entity write fails.\n     */\n    readonly #on_error: (error: Error) => void;\n\n    /**\n     * Whether the pipeline forces `auto_broadcast = false` on entities it resolves or spawns.\n     */\n    readonly #manage_auto_broadcast: boolean;\n\n    /**\n     * Warns once per unique message, to avoid log spam when many events fail the same way.\n     */\n    readonly #reporter = new WarnOnceReporter();\n\n    /**\n     * The bound scenes and their per-mapping resolve+apply state.\n     */\n    readonly #bindings = new Map<PipelineBinding, BindingState>();\n\n    /**\n     * What the pipeline has actually done, exposed as immutable snapshots through {@link stats}.\n     * A {@link NoopStatsCollector} when the `stats` option is off.\n     */\n    readonly #stats: IngestionStatsCollector;\n\n    /**\n     * Whether {@link #stats} counts anything, so {@link stats} can report `null` instead of zeros.\n     */\n    readonly #stats_enabled: boolean;\n\n    /**\n     * @throws If no mapping is given, or a mapping is malformed \u2014 its `entities` declaring none of\n     * the four strategies, or its `updates` not being a function. Both are unreachable from\n     * TypeScript; they are what a JavaScript consumer gets instead of a compile error.\n     */\n    constructor({ mappings, validate, stats, onError, manage_auto_broadcast }: IngestionPipelineOptions) {\n        this.#validate_all = validate ?? false;\n        this.#on_error = onError ?? ((error): void => console.error(\"[ingestion-pipeline]\", error));\n        this.#manage_auto_broadcast = manage_auto_broadcast ?? true;\n\n        const list = Array.isArray(mappings) ? mappings : [mappings];\n        if (list.length === 0) {\n            throw new Error(\"IngestionPipeline requires at least one mapping.\");\n        }\n        this.#mappings = list.map((config, index) => {\n            validateMapping(config, index);\n            return {\n                config,\n                validator_promise: null,\n                validated_first: false,\n                continuations: new Map(),\n                states: new Map(),\n            };\n        });\n\n        this.#stats_enabled = stats ?? true;\n        this.#stats = this.#stats_enabled\n            ? new StatsCollector({ channels: list.map(mapping => mapping.channel) })\n            : new NoopStatsCollector();\n    }\n\n    /**\n     * What the pipeline has done so far \u2014 events in, updates out, and why anything was dropped.\n     * `null` when the pipeline was built with `stats: false`.\n     */\n    get stats(): IngestionStats | null {\n        if (!this.#stats_enabled) {\n            return null;\n        }\n        return this.#stats.snapshot({\n            bound_scene_count: this.#bindings.size,\n            continuations_active: this.#continuationCounts(),\n        });\n    }\n\n    /**\n     * How many {@link ContinuousUpdate}s are installed across every mapping \u2014 the answer to \"the\n     * stream is fine, so why is nothing moving?\".\n     *\n     * Also readable as `stats.continuations_active`; this getter works with `stats: false` too, and\n     * is what {@link SceneIngestion} checks to know whether its clock has anything to advance.\n     */\n    get continuationCount(): number {\n        let count = 0;\n        for (const mapping of this.#mappings) {\n            count += mapping.continuations.size;\n        }\n        return count;\n    }\n\n    /**\n     * How many continuations each mapping drives, index-aligned with the mappings \u2014 what\n     * {@link MappingStats.continuations_active} reports.\n     */\n    #continuationCounts(): Array<number> {\n        return this.#mappings.map(mapping => mapping.continuations.size);\n    }\n\n    /**\n     * The number of scenes currently bound.\n     */\n    get boundSceneCount(): number {\n        return this.#bindings.size;\n    }\n\n    /**\n     * Attach a scene: ingested events start driving its entities. Each scene gets its own resolvers,\n     * because a resolution (and its cache) is only meaningful against one scene.\n     *\n     * Binding the same scene twice returns two independent bindings; unbind the one you no longer\n     * want.\n     */\n    bind({ scene }: { scene: Scene }): PipelineBinding {\n        const binding: PipelineBinding = {\n            scene,\n            unbind: (): void => {\n                const state = this.#bindings.get(binding);\n                if (!state) {\n                    return;\n                }\n                this.#bindings.delete(binding);\n                for (const { resolver } of state.slots) {\n                    resolver.dispose?.();\n                }\n            },\n        };\n\n        this.#bindings.set(binding, {\n            scene,\n            slots: this.#mappings.map(mapping => ({\n                resolver: createResolver(mapping.config.entities, scene, this.#manage_auto_broadcast),\n                applier: new ComponentPatchApplier(),\n            })),\n        });\n\n        return binding;\n    }\n\n    /**\n     * Stop the {@link ContinuousUpdate}s currently installed \u2014 one id's, or every one of them. The\n     * entities keep their last value, and a later event carrying the same id installs a fresh motion.\n     *\n     * The answer to \"the broker died, why is the scene still moving?\". Nothing expires a motion on\n     * its own, because \"no event replaced it\" is not the same fact as \"the stream is dead\" \u2014 one\n     * topic may carry payloads of several shapes. {@link SceneIngestion} calls this when it stops\n     * its sources.\n     *\n     * The per-entity state is **not** dropped, so a motion started again picks up where this one\n     * stopped rather than snapping back.\n     */\n    clearContinuations({ id }: { id?: string } = {}): void {\n        for (const mapping of this.#mappings) {\n            if (id === undefined) {\n                mapping.continuations.clear();\n            } else {\n                mapping.continuations.delete(id);\n            }\n        }\n    }\n\n    /**\n     * Detach every bound scene.\n     */\n    unbindAll(): void {\n        for (const binding of Array.from(this.#bindings.keys())) {\n            binding.unbind();\n        }\n    }\n\n    /**\n     * Push one event through the pipeline: every mapping whose selectors match it drives the\n     * entities it addresses, in every bound scene.\n     *\n     * Never throws \u2014 a mapping that throws is reported to `onError` and the stream continues.\n     */\n    async ingest(event: IngestEvent): Promise<void> {\n        const received_at_ms = event.received_at?.getTime() ?? Date.now();\n        this.#stats.eventReceived(received_at_ms);\n\n        if (this.#bindings.size === 0) {\n            this.#stats.dropped(\"no_binding\");\n            this.#stats.eventDropped();\n            return;\n        }\n\n        let matched = false;\n        let applied = false;\n        for (let index = 0; index < this.#mappings.length; index++) {\n            const mapping = this.#mappings[index];\n            if (!this.#matches(mapping.config, event)) {\n                continue;\n            }\n            matched = true;\n            this.#stats.mappingMatched(index, received_at_ms);\n            applied = (await this.#processWithMapping(mapping, index, event)) || applied;\n        }\n\n        if (!matched) {\n            this.#stats.dropped(\"no_mapping_matched\");\n        } else {\n            this.#stats.eventMatched();\n        }\n        if (!applied) {\n            this.#stats.eventDropped();\n        }\n    }\n\n    /**\n     * Advance every {@link ContinuousUpdate} currently installed, and write what they produce.\n     *\n     * This is what keeps a machine moving between two messages: an event that reported a *rate*\n     * installed a continuation, and each tick asks it where the entity is now. It owns **no timer** \u2014\n     * the caller decides the cadence, which is what makes a moving scene reproducible from a test:\n     *\n     * ```typescript\n     * await pipeline.ingest(event);   // \"turning at 90 rpm\"\n     * await pipeline.tick(0.5);       // half a second later, wherever that puts it\n     * ```\n     *\n     * {@link SceneIngestion} calls this on its own interval, so a consumer using it has nothing to\n     * do. A tick is deliberately **not** an event: it leaves `events_received` and `last_event_at`\n     * alone, so those keep answering \"is data still arriving?\" while the scene moves.\n     *\n     * Never throws \u2014 a continuation that throws is reported to `onError` and dropped.\n     */\n    async tick(elapsed_seconds: number): Promise<void> {\n        this.#stats.tickProcessed();\n        if (this.#bindings.size === 0) {\n            return;\n        }\n\n        for (let index = 0; index < this.#mappings.length; index++) {\n            const mapping = this.#mappings[index];\n            if (mapping.continuations.size === 0) {\n                continue;\n            }\n            const pending = this.#sampleContinuations(mapping, elapsed_seconds);\n            if (pending.length === 0) {\n                continue;\n            }\n            await Promise.all(\n                Array.from(this.#bindings, ([binding, state]) =>\n                    this.#applyToBinding(binding, state, index, pending, { from_tick: true }),\n                ),\n            );\n        }\n    }\n\n    /**\n     * Sample one mapping's continuations once, dropping those that report they are done.\n     *\n     * Sampling happens here, once, rather than inside {@link #applyToBinding}: a continuation is\n     * usually stateful, and running it once per bound scene would advance it once per session.\n     */\n    #sampleContinuations(mapping: CompiledMapping, elapsed_seconds: number): Array<PendingUpdate> {\n        const pending: Array<PendingUpdate> = [];\n\n        for (const [id, installed] of mapping.continuations) {\n            installed.since_seconds += elapsed_seconds;\n\n            const sampled = this.#sample(mapping, id, installed.update, {\n                delta_seconds: elapsed_seconds,\n                since_seconds: installed.since_seconds,\n            });\n            if (sampled === null) {\n                mapping.continuations.delete(id);\n                continue;\n            }\n            pending.push({ entry: { id, update: sampled }, event: installed.event });\n        }\n\n        return pending;\n    }\n\n    /**\n     * Ask one continuous update where its entity is now, against the state the pipeline holds for\n     * that id.\n     *\n     * @returns What to write, or null when the motion is over (or reported a failure) \u2014 in both cases\n     * the caller uninstalls it.\n     */\n    #sample(\n        mapping: CompiledMapping,\n        id: string,\n        update: AnyContinuousUpdate,\n        time: { delta_seconds: number; since_seconds: number },\n    ): ComponentUpdates | EntityDirective | null {\n        // `initial_state` applies only to an id that has no state yet, so a later event carrying a\n        // fresh rate cannot reset a motion already under way. Copied rather than shared, so one\n        // `initial_state` object declared once in a mapping cannot end up driving every entity.\n        const held = mapping.states.get(id);\n        const state: object = held ?? { ...(update.initial_state ?? {}) };\n        if (held === undefined) {\n            mapping.states.set(id, state);\n        }\n\n        try {\n            return update.sample({ ...time, state }) ?? null;\n        } catch (error) {\n            // A throwing continuation would throw again on every tick: drop it rather than report the\n            // same failure thirty times a second.\n            this.#on_error(error as Error);\n            return null;\n        }\n    }\n\n    /**\n     * Whether an event is covered by a mapping's `channel`/`when` selectors.\n     */\n    #matches(config: EventMapping, event: IngestEvent): boolean {\n        if (config.channel !== undefined && !matchChannel(config.channel, event.channel)) {\n            return false;\n        }\n        return config.when === undefined || config.when(event);\n    }\n\n    /**\n     * One mapping's pipeline: validate \u2192 work out the updates \u2192 resolve+apply in each bound scene.\n     *\n     * @returns Whether anything reached a scene.\n     */\n    async #processWithMapping(mapping: CompiledMapping, index: number, event: IngestEvent): Promise<boolean> {\n        if (!(await this.#validatePayload(mapping, event))) {\n            this.#stats.dropped(\"schema\", index);\n            return false;\n        }\n\n        const updates = this.#resolveUpdates(mapping, index, event);\n        if (!updates) {\n            return false;\n        }\n\n        const results = await Promise.all(\n            Array.from(this.#bindings, ([binding, state]) =>\n                this.#applyToBinding(\n                    binding,\n                    state,\n                    index,\n                    updates.map(entry => ({ entry, event })),\n                    { from_tick: false },\n                ),\n            ),\n        );\n        return results.some(Boolean);\n    }\n\n    /**\n     * The entity updates one event produces through one mapping, normalized to an array: `updates`\n     * may return a single {@link EntityUpdate}, an array of them, or null.\n     *\n     * Entries carrying no usable id are dropped here rather than in {@link #applyToBinding}, which\n     * runs once per bound scene and would count each one twice over.\n     */\n    #resolveUpdates(mapping: CompiledMapping, index: number, event: IngestEvent): Array<EntityUpdate> | null {\n        let produced: EntityUpdate | Array<EntityUpdate> | null;\n        try {\n            produced = mapping.config.updates(event);\n        } catch (error) {\n            this.#on_error(error as Error);\n            return null;\n        }\n\n        if (produced === null || produced === undefined) {\n            this.#stats.dropped(\"no_updates\", index);\n            return null;\n        }\n\n        const updates = Array.isArray(produced) ? produced : [produced];\n        if (updates.length === 0) {\n            this.#stats.dropped(\"no_updates\", index);\n            return null;\n        }\n\n        // The id is the only part of an entry the pipeline cannot work without \u2014 see `hasUsableId`.\n        let usable = updates;\n        if (!updates.every(hasUsableId)) {\n            usable = updates.filter(hasUsableId);\n            for (let dropped = usable.length; dropped < updates.length; dropped++) {\n                this.#stats.dropped(\"no_id\", index);\n            }\n            this.#reporter.warnOnce(\n                `no-id:${index}`,\n                `[ingestion-pipeline] Mapping #${index} produced an update with no usable \\`id\\` for an event ` +\n                    `on channel \"${event.channel}\"; ignoring such updates. Its \\`updates\\` must return ` +\n                    `\\`{ id, update }\\` entries.`,\n            );\n        }\n\n        const installed = this.#installContinuations(mapping, usable, event);\n        if (installed.length === 0) {\n            // Every entry was a motion already over on its first sample. Counted, so `events_dropped`\n            // never lands with nothing in `drops` \u2014 which reads as the pipeline losing the event\n            // rather than the mapping declining it. `usable` is empty only when `no_id` already\n            // counted every entry.\n            if (usable.length > 0) {\n                this.#stats.dropped(\"no_updates\", index);\n            }\n            return null;\n        }\n        return installed;\n    }\n\n    /**\n     * Install every continuation this event produced, and turn each into the patch it is worth right\n     * now, so the entity moves on the event rather than waiting for the first tick.\n     *\n     * Installing here \u2014 where `updates` ran, once per event \u2014 is what keeps a continuation shared by\n     * every bound scene instead of one per session.\n     */\n    #installContinuations(\n        mapping: CompiledMapping,\n        updates: Array<EntityUpdate>,\n        event: IngestEvent,\n    ): Array<EntityUpdate> {\n        if (!updates.some(entry => isContinuousUpdate(entry.update))) {\n            return updates;\n        }\n\n        const entries: Array<EntityUpdate> = [];\n\n        for (const entry of updates) {\n            const update = entry.update;\n            if (!isContinuousUpdate(update)) {\n                entries.push(entry);\n                continue;\n            }\n\n            const id = String(entry.id);\n            mapping.continuations.set(id, { update, since_seconds: 0, event });\n\n            // `delta_seconds` is 0 here: the install itself covers no time, so a value integrated\n            // with it starts from wherever the entity's state already stood.\n            const sampled = this.#sample(mapping, id, update, { delta_seconds: 0, since_seconds: 0 });\n            // A continuation that is already done on its first sample never had anything to say.\n            if (sampled === null) {\n                mapping.continuations.delete(id);\n                continue;\n            }\n            entries.push({ id: entry.id, update: sampled });\n        }\n\n        return entries;\n    }\n\n    /**\n     * Resolve and apply every update of one mapping in one bound scene.\n     *\n     * @param from_tick - Whether these came from a clock tick rather than an event, which is what\n     * decides whether a miss is worth counting: `drops` is an event-level story, and a continuation\n     * driving an id one scene does not have would otherwise post a drop thirty times a second.\n     *\n     * @returns Whether at least one update reached an entity.\n     */\n    async #applyToBinding(\n        binding: PipelineBinding,\n        state: BindingState,\n        index: number,\n        updates: Array<PendingUpdate>,\n        { from_tick }: { from_tick: boolean },\n    ): Promise<boolean> {\n        const { resolver, applier } = state.slots[index];\n\n        // Nothing here can address an entity that does not exist yet: a scene pulling others in\n        // through `scene_ref` components is streamed in progressively, and resolving against a\n        // half-loaded one would answer misses for entities that are simply still on their way.\n        //\n        // This wait has no deadline of its own, so a scene the server never reports as loaded parks\n        // every event and every tick until the session disconnects \u2014 which settles them all and lets\n        // them drain. Deliberate: a scene still loading has nothing to drive, and going ahead would\n        // only cache misses for entities that are on their way.\n        await state.scene.waitForSceneLoaded();\n\n        const results = await Promise.all(\n            updates.map(async ({ entry, event }) => {\n                const id = String(entry.id);\n                // The resolver caches every answer, misses included, so a tick costs a map lookup\n                // rather than a trip through the mapping's own `byName` / `resolve`.\n                const entity = await resolver.resolve({ id, event });\n                if (!entity) {\n                    if (!from_tick) {\n                        this.#stats.dropped(\"unresolved_entity\", index);\n                    }\n                    // A continuation is deliberately left installed. This runs once per bound scene\n                    // against a map shared by all of them, so uninstalling would stop the motion in\n                    // every other scene \u2014 and at bring-up it would stop it inside the very\n                    // `ingest()` that installed it. The scene's own `on-entities-created` drops the\n                    // cached miss, so the motion starts by itself once the entity appears.\n                    return false;\n                }\n                // The scene may have gone while the resolution was in flight: writing now would\n                // drive a session this pipeline no longer has anything to do with.\n                if (!this.#bindings.has(binding)) {\n                    return false;\n                }\n                try {\n                    await this.#applyUpdate({\n                        scene: state.scene,\n                        entity,\n                        update: entry.update,\n                        resolver,\n                        applier,\n                        id,\n                        index,\n                    });\n                    return true;\n                } catch (error) {\n                    this.#on_error(error as Error);\n                    return false;\n                }\n            }),\n        );\n        return results.some(Boolean);\n    }\n\n    /**\n     * Apply one entry's update to its entity: component patches, or a whole-entity directive.\n     *\n     * A `\"delete\"` drops the id from the resolver explicitly: `Scene.deleteEntities` does not\n     * announce a deletion the client performed itself (it empties its registry, so the server's echo\n     * then matches nothing), so the resolver's `on-entities-deleted` listener \u2014 which does cover\n     * deletions by *other* clients \u2014 never fires for this one.\n     */\n    async #applyUpdate({\n        scene,\n        entity,\n        update,\n        resolver,\n        applier,\n        id,\n        index,\n    }: {\n        scene: Scene;\n        entity: Entity;\n        update: EntityUpdate[\"update\"];\n        resolver: EntityResolver;\n        applier: ComponentPatchApplier;\n        id: string;\n        index: number;\n    }): Promise<void> {\n        if (typeof update === \"string\") {\n            switch (update) {\n                case \"delete\":\n                    await scene.deleteEntities({ entities: [entity] });\n                    resolver.forget(id);\n                    // Whatever this entity was doing, it is not doing it any more \u2014 and the state it\n                    // was doing it with goes with it, so an id that comes back starts clean.\n                    this.#mappings[index].continuations.delete(id);\n                    this.#mappings[index].states.delete(id);\n                    break;\n                case \"hide\":\n                    entity.is_visible = false;\n                    // Nothing anyone can see is moving, so stop paying thirty writes a second for\n                    // it. The entity's state stays \u2014 a later event can pick the motion back up from\n                    // where it left off, which is what \"hide\" rather than \"delete\" asked for.\n                    this.#mappings[index].continuations.delete(id);\n                    break;\n                case \"show\":\n                    entity.is_visible = true;\n                    break;\n                default:\n                    // A string that is not a directive is a mapping bug, not a silent no-op: report\n                    // it rather than counting it as something that reached the scene.\n                    this.#on_error(\n                        new Error(\n                            `Mapping #${index} returned \"${update}\", which is not an entity directive ` +\n                                `(\"delete\", \"hide\" or \"show\"); ignoring it.`,\n                        ),\n                    );\n                    return;\n            }\n            this.#stats.applied({ mapping_index: index, written: 0, deduped: 0, directive: true });\n            return;\n        }\n\n        if (typeof update === \"function\") {\n            // A bare function is not a motion \u2014 `continuous()` is. Caught here rather than passed to\n            // the applier, which would write a function's enumerable properties (nothing at all) and\n            // silently move nothing.\n            this.#on_error(\n                new Error(\n                    `Mapping #${index} returned a bare function as an \\`update\\`; ignoring it. ` +\n                        `Wrap it in \\`continuous(fn)\\` to declare an entity that keeps moving between events.`,\n                ),\n            );\n            return;\n        }\n\n        if (isContinuousUpdate(update)) {\n            // Unreachable: continuations are installed and sampled into patches before they get here.\n            this.#on_error(\n                new Error(\n                    `Mapping #${index} produced a continuous update that reached the applier unsampled; ` +\n                        `ignoring it. This is an SDK bug, please report it.`,\n                ),\n            );\n            return;\n        }\n\n        const { written, deduped } = applier.apply({ entity, updates: update as ComponentUpdates });\n        this.#stats.applied({ mapping_index: index, written, deduped, directive: false });\n    }\n\n    /**\n     * Validate the event payload against the mapping's schema: the first matching event always,\n     * every event when the `validate` option is on. Mappings without a schema always pass.\n     */\n    async #validatePayload(mapping: CompiledMapping, event: IngestEvent): Promise<boolean> {\n        const schema = mapping.config.schema;\n        if (!schema) {\n            return true;\n        }\n        if (!this.#validate_all && mapping.validated_first) {\n            return true;\n        }\n        mapping.validated_first = true;\n\n        // Lazy ajv import + compilation, shared across events; a schema that cannot compile (or a\n        // missing ajv install) is reported once and skips validation from then on.\n        mapping.validator_promise ??= SchemaValidator.create({ schema });\n        let validator: SchemaValidator;\n        try {\n            validator = await mapping.validator_promise;\n        } catch (error) {\n            this.#reporter.warnOnce(\n                `validator:${event.channel}`,\n                `[ingestion-pipeline] ${error instanceof Error ? error.message : String(error)}`,\n            );\n            return true;\n        }\n\n        const result = validator.validate(event.payload);\n        if (!result.valid) {\n            this.#reporter.warnOnce(\n                `invalid:${result.errors}`,\n                `[ingestion-pipeline] Event on channel \"${event.channel}\" does not match the mapping's schema: ` +\n                    result.errors,\n            );\n            return false;\n        }\n        return true;\n    }\n}\n\n/**\n * Whether an update entry carries an id the pipeline can resolve.\n *\n * Not defensive typing, despite `id` being typed: `String(undefined)` is `\"undefined\"`, a\n * valid-looking id that would silently drive \u2014 or spawn \u2014 one wrong entity for every entry missing\n * one. And it is reachable from clean TypeScript through the documented idiom, since\n * `event.channel.split(\"/\")[3]` is typed `string` but is `undefined` on a shorter channel. Catching\n * it here turns that into a counted `no_id` drop and one warning.\n */\nfunction hasUsableId(entry: EntityUpdate): boolean {\n    return typeof entry.id === \"string\" || typeof entry.id === \"number\";\n}\n\n/**\n * Check a mapping is well-formed, at construction rather than on the first event (or, for\n * `entities`, rather than on the first `bind`, where the failure would surface from a session-ready\n * handler and read as a session error).\n *\n * Neither condition is reachable from TypeScript; this is what a JavaScript consumer gets in place\n * of a compile error, so both messages name the whole shape rather than the missing key.\n */\nfunction validateMapping(config: EventMapping, index: number): void {\n    const entities = config.entities as SceneEntities | undefined;\n    if (\n        entities === undefined ||\n        (entities.byName === undefined &&\n            entities.byUuid === undefined &&\n            entities.resolve === undefined &&\n            entities.spawn === undefined)\n    ) {\n        throw new Error(\n            `Mapping #${index}: \\`entities\\` must declare exactly one of \\`byName\\`, \\`byUuid\\`, ` +\n                `\\`resolve\\` (entities already in the scene) or \\`spawn\\` (one created per new id).`,\n        );\n    }\n    if (typeof config.updates !== \"function\") {\n        throw new Error(\n            `Mapping #${index}: \\`updates\\` must be a function of the event, returning one ` +\n                `\\`{ id, update }\\` entry, an array of them, or null.`,\n        );\n    }\n}\n\n/**\n * Build the resolver of one mapping for one scene, per its `entities` declaration. Total: a mapping\n * declaring no strategy was rejected at construction by {@link validateMapping}.\n */\nfunction createResolver(entities: SceneEntities, scene: Scene, manage_auto_broadcast: boolean): EntityResolver {\n    return entities.spawn !== undefined\n        ? new SpawningEntityResolver({ scene, template: entities.spawn, manage_auto_broadcast })\n        : new ExistingEntityResolver({ scene, lookup: entities, manage_auto_broadcast });\n}\n", "//------------------------------------------------------------------------------\nimport { TypedEventTarget } from \"@livelink.base/TypedEventTarget\";\n\n/**\n * A {@link TypedEventTarget} that knows whether anyone is listening to it.\n *\n * A plain `EventTarget` cannot answer that \u2014 `dispatchEvent` returns whether the event was\n * cancelled, not whether it reached anybody \u2014 so an emitter with something worth saying when nobody\n * subscribed (an error that would otherwise vanish) has no way to tell. This subclass tracks its own\n * listeners to answer it, and stays out of `livelink.base` because only {@link SceneIngestion} needs\n * the capability.\n *\n * It is not exported from the package root, but it deliberately carries **no** internal-marker tag:\n * this tsconfig sets `stripInternal`, which erases a marked declaration from the emitted `.d.ts`\n * altogether \u2014 and since {@link SceneIngestion} extends this class, stripping it would take\n * `addEventListener` and every other inherited member off `SceneIngestion`'s public type with it.\n * (Beware: `stripInternal` scans the comment text, so even naming that tag in prose here triggers\n * it.)\n */\nexport class ObservedEventTarget<EventMap extends Record<string, Event>> extends TypedEventTarget<EventMap> {\n    /**\n     * The listeners currently registered, per event name, mapping the listener the caller passed to\n     * the function actually registered on the underlying target (they differ for a `once` listener,\n     * which is wrapped to keep this bookkeeping honest).\n     *\n     * Capture is deliberately not part of the identity: the underlying {@link EventTarget} is not in\n     * a DOM tree, so nothing ever propagates and the capture flag cannot distinguish two listeners.\n     */\n    readonly #listeners = new Map<string, Map<unknown, (event: never) => void>>();\n\n    /**\n     * Register a listener, remembering it so {@link _hasListeners} can report on it.\n     */\n    override addEventListener<_EventName extends keyof EventMap & string>(\n        event_name: _EventName,\n        listener: (event: EventMap[_EventName]) => void,\n        options?: AddEventListenerOptions | boolean,\n    ): void {\n        let registered = this.#listeners.get(event_name);\n        if (!registered) {\n            registered = new Map();\n            this.#listeners.set(event_name, registered);\n        }\n        // The underlying target ignores a duplicate (name, listener) pair; mirror that here so the\n        // tracking cannot double-count.\n        if (registered.has(listener)) {\n            return;\n        }\n\n        // A `once` listener is dropped by the underlying target without going through\n        // `removeEventListener`, and an aborted `signal` does the same \u2014 both would otherwise leave\n        // this map claiming a listener that is gone.\n        const once = typeof options === \"object\" && options.once === true;\n        const actual: (event: EventMap[_EventName]) => void = once\n            ? (event): void => {\n                  this.#untrack(event_name, listener);\n                  listener(event);\n              }\n            : listener;\n\n        if (typeof options === \"object\" && options.signal) {\n            options.signal.addEventListener(\"abort\", () => this.#untrack(event_name, listener), { once: true });\n        }\n\n        registered.set(listener, actual as (event: never) => void);\n        super.addEventListener(event_name, actual, options);\n    }\n\n    /**\n     * Remove a listener \u2014 the function that was actually registered for it, which for a `once`\n     * listener is the wrapper rather than the listener itself.\n     */\n    override removeEventListener<_EventName extends keyof EventMap & string>(\n        event_name: _EventName,\n        listener: (event: EventMap[_EventName]) => void,\n        options?: EventListenerOptions | boolean,\n    ): void {\n        const actual = this.#listeners.get(event_name)?.get(listener);\n        if (!actual) {\n            return;\n        }\n        this.#untrack(event_name, listener);\n        super.removeEventListener(event_name, actual as (event: EventMap[_EventName]) => void, options);\n    }\n\n    /**\n     * Whether anything is currently listening for an event. Lets an emitter fall back to another\n     * channel \u2014 a console log for an error nobody observes \u2014 instead of dispatching into the void.\n     */\n    protected _hasListeners<_EventName extends keyof EventMap & string>(event_name: _EventName): boolean {\n        return (this.#listeners.get(event_name)?.size ?? 0) > 0;\n    }\n\n    /**\n     * Drop a listener from the tracking map, without touching the underlying target.\n     */\n    #untrack(event_name: string, listener: unknown): void {\n        const registered = this.#listeners.get(event_name);\n        if (!registered) {\n            return;\n        }\n        registered.delete(listener);\n        if (registered.size === 0) {\n            this.#listeners.delete(event_name);\n        }\n    }\n}\n", "//------------------------------------------------------------------------------\nimport type { Livelink } from \"../Livelink\";\nimport type {\n    AgentStoppedEvent,\n    SessionCreatedEvent,\n    SessionJoinedEvent,\n    SessionLeftEvent,\n    SessionReadyEvent,\n} from \"../AgentEvents\";\n\n/**\n * Event emitted once the sources have started and the ingestion is live.\n *\n * Dispatched by {@link SceneIngestion} as `on-running`.\n *\n * @event\n * @noInheritDoc\n * @category Data / Events\n */\nexport class IngestionRunningEvent extends Event {\n    /**\n     * @internal\n     */\n    constructor() {\n        super(\"on-running\");\n    }\n}\n\n/**\n * Event emitted when a session's scene has been bound to the pipeline \u2014 from here on, ingested\n * events drive its entities.\n *\n * Dispatched by {@link SceneIngestion} as `on-session-bound`.\n *\n * @event\n * @noInheritDoc\n * @category Data / Events\n */\nexport class SessionBoundEvent extends Event {\n    /**\n     * The livelink of the bound session.\n     */\n    public readonly livelink: Livelink;\n\n    /**\n     * @internal\n     */\n    constructor({ livelink }: { livelink: Livelink }) {\n        super(\"on-session-bound\");\n        this.livelink = livelink;\n    }\n}\n\n/**\n * Event emitted when a session's scene has been unbound from the pipeline.\n *\n * Dispatched by {@link SceneIngestion} as `on-session-unbound`.\n *\n * @event\n * @noInheritDoc\n * @category Data / Events\n */\nexport class SessionUnboundEvent extends Event {\n    /**\n     * The livelink of the unbound session.\n     */\n    public readonly livelink: Livelink;\n\n    /**\n     * @internal\n     */\n    constructor({ livelink }: { livelink: Livelink }) {\n        super(\"on-session-unbound\");\n        this.livelink = livelink;\n    }\n}\n\n/**\n * Event emitted when a source fails to start, a mapping throws, or the underlying agent errors.\n * Ingestion continues \u2014 this reports, it does not stop.\n *\n * Dispatched by {@link SceneIngestion} as `on-error`.\n *\n * @event\n * @noInheritDoc\n * @category Data / Events\n */\nexport class IngestionErrorEvent extends Event {\n    /**\n     * The error that occurred.\n     */\n    public readonly error: Error;\n\n    /**\n     * @internal\n     */\n    constructor({ error }: { error: Error }) {\n        super(\"on-error\");\n        this.error = error;\n    }\n}\n\n/**\n * Events emitted by a {@link SceneIngestion}.\n *\n * The {@link Agent}'s own session-lifecycle events are **re-emitted here as they happen**, so a\n * consumer observes one object instead of reaching through `ingestion.agent` for half of what it\n * needs. `on-error` covers both the agent's errors and the ingestion's own.\n *\n * Declared key by key rather than as `Omit<AgentEvents, \"on-error\"> & { \u2026 }`: TypeDoc expands only\n * the literal half of an intersection, so the re-emitted session events went undocumented.\n * `livelink.agent/tests/EventMaps.test.ts` fails to compile if this drifts from {@link AgentEvents}.\n *\n * @event\n * @category Data / Events\n */\nexport type SceneIngestionEvents = {\n    \"on-session-created\": SessionCreatedEvent;\n    \"on-session-joined\": SessionJoinedEvent;\n    \"on-session-ready\": SessionReadyEvent;\n    \"on-session-left\": SessionLeftEvent;\n    \"on-stopped\": AgentStoppedEvent;\n    \"on-running\": IngestionRunningEvent;\n    \"on-session-bound\": SessionBoundEvent;\n    \"on-session-unbound\": SessionUnboundEvent;\n    \"on-error\": IngestionErrorEvent;\n};\n", "//------------------------------------------------------------------------------\nimport type { UUID } from \"@3dverse/livelink.core\";\n\n//------------------------------------------------------------------------------\n// Not a plain `TypedEventTarget`: `#reportError` falls back to the console when nobody is listening\n// for `on-error`, which needs to know whether anybody is.\nimport { ObservedEventTarget } from \"../ObservedEventTarget\";\n\n//------------------------------------------------------------------------------\n// `SceneIngestion` receives a pre-built `Agent` rather than constructing one \u2014 the caller owns the\n// agent's attachment policy (mode, watch, leave-on-condition) and can observe it before start. It\n// only ever references `Agent`/`Livelink` as types (never `new`s them), so these stay `import type`.\nimport type { Agent } from \"../Agent\";\nimport type { Livelink } from \"../Livelink\";\nimport {\n    SessionCreatedEvent,\n    SessionJoinedEvent,\n    SessionLeftEvent,\n    SessionReadyEvent,\n    type AgentErrorEvent,\n    AgentStoppedEvent,\n} from \"../AgentEvents\";\n\n//------------------------------------------------------------------------------\nimport type { EventSink, Transport } from \"./Transport\";\nimport type { IngestEvent } from \"./IngestEvent\";\nimport type { IngestionStats } from \"./IngestionStats\";\nimport type { IngestionPipeline, PipelineBinding } from \"./IngestionPipeline\";\nimport {\n    IngestionErrorEvent,\n    IngestionRunningEvent,\n    SessionBoundEvent,\n    SessionUnboundEvent,\n    type SceneIngestionEvents,\n} from \"./SceneIngestionEvents\";\nimport { createTransport, type TransportSpec } from \"./transports/TransportRegistry\";\n\n//------------------------------------------------------------------------------\n// The same guard every rate in the SDK goes through, so `ticks_per_second` and `updates_per_second`\n// reject the same things \u2014 and so `NaN` never reaches `setInterval`.\nimport { computeIntervalInMs } from \"@livelink.base/rates\";\n\n/**\n * The most time one tick may report, in seconds. A process that was suspended \u2014 a laptop lid, a\n * debugger stopped on a breakpoint, a container throttled \u2014 comes back with minutes of wall clock to\n * account for, and handing that to a motion teleports it. Clamping loses that time on purpose: the\n * scene resumes where it was rather than where it would have been.\n */\nconst MAX_TICK_SECONDS = 0.5;\n\n/**\n * The clock rate to use when the caller does not choose one: twice the client's own flush rate,\n * capped at what a timer will accept.\n *\n * Ticking *at* the flush rate reads as free \u2014 the extra samples merge away \u2014 but the two timers are\n * free-running and beat against each other, so the age of the sample at flush time wanders across a\n * whole flush window (33 ms at 30 Hz) and the motion visibly jitters. Sampling twice as often bounds\n * that wander to half a window. Falls back to 60, twice `LivelinkBase`'s own default of 30.\n */\nfunction defaultTicksPerSecond(agent: Agent): number {\n    const updates_per_second = agent.config.headless_client?.updates_per_second;\n    if (typeof updates_per_second !== \"number\" || !(updates_per_second > 0)) {\n        return 60;\n    }\n    return Math.min(updates_per_second * 2, 125);\n}\n\n/**\n * Builds a {@link Transport} bound to the ingestion, for a source a {@link TransportSpec} cannot\n * describe.\n *\n * Reach for it when you want **this ingestion to own the transport's lifecycle** \u2014 started lazily\n * with the others on the first bound session, stopped with them on `stop()` \u2014 but the transport is a\n * one-off you would rather not publish as a kind on the process-wide\n * {@link defaultTransportRegistry}. Register a kind instead when several ingestions (or an HTTP API)\n * need to name that transport; construct the transport yourself against the ingestion \u2014 it *is* an\n * {@link EventSink} \u2014 when you would rather own its start and stop.\n *\n * Distinct from the registry's `TransportFactory`, which also takes the kind-specific config.\n *\n * @category Data\n */\nexport type IngestionTransportFactory = (sink: EventSink) => Transport | Promise<Transport>;\n\n/**\n * One upstream data source of a {@link SceneIngestion}.\n *\n * @category Data\n */\nexport type IngestionSource = TransportSpec | IngestionTransportFactory;\n\n/**\n * Options for a {@link SceneIngestion}.\n *\n * @category Data\n */\nexport type SceneIngestionOptions = {\n    /**\n     * The (pre-built, not-yet-started) agent to drive. `SceneIngestion` owns its start/stop; do not\n     * start it yourself. Built by the caller so its attachment policy (mode, watch,\n     * leave-on-condition) stays the caller's choice \u2014 `mode: \"join-all\"` for many sessions,\n     * `mode: \"join-or-start\"` for a single shared session.\n     */\n    agent: Agent;\n\n    /**\n     * The mapping engine driving the scenes, built by the caller:\n     *\n     * ```typescript\n     * pipeline: new IngestionPipeline({ mappings, onError })\n     * ```\n     *\n     * Always the caller's to build, so it can be unit-tested on its own, shared between ingestions,\n     * fed from somewhere else as well, and \u2014 the reason it is not sugar here \u2014 so its `onError`\n     * always reaches the caller, whoever constructed it.\n     *\n     * **Errors split by layer**: the pipeline's own `onError` reports a mapping that throws or an\n     * entity write that fails; this object's `on-error` event reports a source that fails to start\n     * or an underlying agent error. Point both at the same handler for one channel.\n     */\n    pipeline: IngestionPipeline;\n\n    /**\n     * The upstream data sources, as {@link TransportSpec}s or factories.\n     *\n     * **Started lazily, when the first session becomes ready**, and shared by every session (one\n     * subscription, one timeline). Until then \u2014 and again once every session is gone \u2014 nothing is\n     * subscribed and events that would have arrived are simply not received; the pipeline counts\n     * anything that does arrive with no scene bound under the `no_binding` drop reason.\n     *\n     * Optional: events can be pushed straight in with {@link SceneIngestion.ingest}, and any\n     * transport can be pointed at the ingestion itself (it *is* a {@link EventSink}), in which\n     * case you own that transport's lifecycle.\n     */\n    sources?: Array<IngestionSource>;\n\n    /**\n     * How often per second to advance the pipeline's continuous updates \u2014 the mappings that returned\n     * a {@link continuous} update rather than a patch, because what they were told was a rate.\n     *\n     * Defaults to **twice** the agent's `headless_client.updates_per_second` (60 when it declares\n     * none). Not once: the two timers free-run and beat against each other, so ticking at exactly\n     * the flush rate lets the age of the sample at flush time wander across a whole flush window and\n     * the motion jitters. Set it to `0` to run no clock at all and call\n     * {@link IngestionPipeline.tick} yourself, from your own loop.\n     *\n     * The clock starts with the sources, on the first ready session, and stops again when the last\n     * session goes \u2014 so a process with nothing bound is not left holding a timer. It costs nothing\n     * while no mapping has installed a continuation.\n     *\n     * @throws RangeError unless it is `0` or a finite rate in the `(0, 125]` range \u2014 the same rule\n     * `updates_per_second` follows, since both end up in a `setInterval`.\n     */\n    ticks_per_second?: number;\n};\n\n/**\n * Binds data sources to the scenes an {@link Agent} is attached to.\n *\n * It is the wiring layer, and only that: the mapping work lives in its {@link IngestionPipeline},\n * the attachment policy in its {@link Agent}. It binds each ready session's scene to the pipeline,\n * unbinds it when the session goes, and starts the shared sources on the first binding.\n *\n * It **is** a {@link EventSink}, so any transport \u2014 the bundled ones, or your own \u2014 can be\n * pointed straight at it, and events can be pushed in by hand with {@link ingest}:\n *\n * ```typescript\n * const ingestion = new SceneIngestion({\n *     agent: new Agent({ config: { scene_id, token } }),\n *     pipeline: new IngestionPipeline({ mappings, onError }),\n *     sources: [{ kind: \"mqtt\", config: { broker_url, topics } }],\n * });\n * ingestion.addEventListener(\"on-error\", ({ error }) => report(error));\n * await ingestion.start();\n *\n * // ...or with no source at all, driven by whatever you like:\n * await ingestion.ingest({ channel: \"devices/42\", payload });\n *\n * await ingestion.stop();\n * ```\n *\n * The agent's session-lifecycle events are re-emitted here, so one object is enough to observe the\n * whole thing. An error nobody is listening for falls back to the console rather than vanishing.\n *\n * @category Data\n */\nexport class SceneIngestion extends ObservedEventTarget<SceneIngestionEvents> implements EventSink {\n    /**\n     * The agent whose sessions are driven.\n     */\n    readonly #agent: Agent;\n\n    /**\n     * The mapping engine every bound scene goes through.\n     */\n    readonly #pipeline: IngestionPipeline;\n\n    /**\n     * The upstream data sources, started lazily on the first bound session.\n     */\n    readonly #sources: Array<IngestionSource>;\n\n    /**\n     * The per-session pipeline bindings, keyed by session id.\n     */\n    readonly #bindings = new Map<UUID, { binding: PipelineBinding; livelink: Livelink }>();\n\n    /**\n     * The started transports, published only once they have all successfully started.\n     */\n    #transports: Array<Transport> = [];\n\n    /**\n     * The interval between two advances of the pipeline's continuous updates, in milliseconds;\n     * `null` when the clock is switched off. Validated at construction, so nothing unusable \u2014 `NaN`\n     * above all \u2014 can reach `setInterval`.\n     */\n    readonly #tick_interval_ms: number | null;\n\n    /**\n     * The clock advancing continuous updates, running while a session is bound.\n     */\n    #tick_interval: ReturnType<typeof setInterval> | null = null;\n\n    /**\n     * When the clock last advanced, on a **monotonic** reading, so each tick reports the time it\n     * actually covered. `performance.now()` and not `Date.now()`: an NTP step backwards would\n     * otherwise hand every motion a negative elapsed time and rewind the whole scene, and a step\n     * forwards would jump it.\n     */\n    #last_tick_ms = 0;\n\n    /**\n     * The advance currently in flight, or `null`. Ticks must not overlap: a resolution can take a\n     * round trip (a `spawn`, a user `resolve` hitting a service), and two overlapping ticks can\n     * apply their samples out of order \u2014 which also poisons {@link ComponentPatchApplier}'s dedup\n     * memory, so the stale value is remembered as the last written and the next correct one skipped.\n     */\n    #tick_in_flight: Promise<void> | null = null;\n\n    /**\n     * Elapsed time an overlapping tick could not deliver, folded into the next one so a motion runs\n     * at the right speed under load rather than losing whatever the skipped ticks covered.\n     */\n    #carried_seconds = 0;\n\n    /**\n     * True while the sources are starting, so concurrent first-bindings share the one start.\n     */\n    #sources_starting = false;\n\n    /**\n     * True after `start()` and before `stop()`. Makes a second `start()` throw and a second (or\n     * premature) `stop()` a no-op.\n     */\n    #started = false;\n\n    /**\n     * @throws RangeError if `ticks_per_second` is neither `0` nor a finite rate in `(0, 125]`.\n     */\n    constructor({ agent, pipeline, sources, ticks_per_second: requested_ticks_per_second }: SceneIngestionOptions) {\n        super();\n\n        this.#agent = agent;\n        this.#pipeline = pipeline;\n        this.#sources = sources ?? [];\n\n        const ticks_per_second = requested_ticks_per_second ?? defaultTicksPerSecond(agent);\n        this.#tick_interval_ms =\n            ticks_per_second === 0 ? null : computeIntervalInMs({ name: \"ticks_per_second\", rate: ticks_per_second });\n    }\n\n    /**\n     * The underlying agent. Its lifecycle events are re-emitted on this object, so reaching for it\n     * is only needed to act on it (`join`, `leave`) \u2014 not to observe it.\n     */\n    get agent(): Agent {\n        return this.#agent;\n    }\n\n    /**\n     * The mapping engine. Push events straight into it, or read its {@link IngestionStats}.\n     */\n    get pipeline(): IngestionPipeline {\n        return this.#pipeline;\n    }\n\n    /**\n     * What the ingestion has actually done \u2014 events in, updates out, and why anything was dropped.\n     * `null` when the pipeline was built with `stats: false`.\n     */\n    get stats(): IngestionStats | null {\n        return this.#pipeline.stats;\n    }\n\n    /**\n     * The number of sessions currently bound to the pipeline.\n     */\n    get boundSessionCount(): number {\n        return this.#bindings.size;\n    }\n\n    /**\n     * Push one event through the pipeline, into every bound session's scene.\n     *\n     * This is both the {@link EventSink} implementation \u2014 which is how the configured sources feed\n     * it \u2014 and the direct entry point for events that come from anywhere else: a webhook, a test, a\n     * replay tool, a \"send one frame\" debug control.\n     */\n    async ingest(event: IngestEvent): Promise<void> {\n        // Settle the motions up to *now* before the event gets to replace any of them. Otherwise the\n        // slice between the last tick and this event is credited to whatever the event installs, at\n        // its new rate, instead of to the rate that was actually in force during it \u2014 a sub-tick\n        // misattribution paid once per event, which a rate that keeps changing turns into a\n        // persistent lead. Costs nothing while nothing is moving, and this is the one layer that\n        // owns both the clock and the events, so the split can be made exact.\n        if (this.#tick_interval !== null && this.#pipeline.continuationCount > 0) {\n            await this.#advance();\n        }\n        await this.#pipeline.ingest(event);\n    }\n\n    /**\n     * Attach the session-lifecycle wiring and start the agent. The sources start lazily on the\n     * first ready session.\n     *\n     * @throws If already started, or if the agent fails to start.\n     */\n    async start(): Promise<void> {\n        if (this.#started) {\n            throw new Error(\"SceneIngestion is already started.\");\n        }\n        this.#started = true;\n\n        this.#agent.addEventListener(\"on-session-created\", this.#onSessionCreated);\n        this.#agent.addEventListener(\"on-session-joined\", this.#onSessionJoined);\n        this.#agent.addEventListener(\"on-session-ready\", this.#onSessionReady);\n        this.#agent.addEventListener(\"on-session-left\", this.#onSessionLeft);\n        this.#agent.addEventListener(\"on-stopped\", this.#onAgentStopped);\n        this.#agent.addEventListener(\"on-error\", this.#onAgentError);\n\n        await this.#agent.start();\n    }\n\n    /**\n     * Stop the sources, then stop the agent (leaving all sessions). A no-op when not started.\n     */\n    async stop(): Promise<void> {\n        if (!this.#started) {\n            return;\n        }\n        // Cleared first, before any await: a source start still in flight must be able to see the\n        // stop and close itself instead of publishing a connection nobody will ever close.\n        this.#started = false;\n\n        this.#agent.removeEventListener(\"on-session-created\", this.#onSessionCreated);\n        this.#agent.removeEventListener(\"on-session-joined\", this.#onSessionJoined);\n        this.#agent.removeEventListener(\"on-session-ready\", this.#onSessionReady);\n        this.#agent.removeEventListener(\"on-session-left\", this.#onSessionLeft);\n        this.#agent.removeEventListener(\"on-stopped\", this.#onAgentStopped);\n        this.#agent.removeEventListener(\"on-error\", this.#onAgentError);\n\n        this.#stopClock();\n        // The sources are going: whatever rate a mapping was last told is now unconfirmed, and this\n        // is the closest thing the SDK has to \"the data stopped\". Leaving the motions installed\n        // would have them resume on that stale rate if this ingestion is ever started again.\n        this.#pipeline.clearContinuations();\n\n        const transports = this.#transports;\n        this.#transports = [];\n        try {\n            await Promise.all(transports.map(transport => transport.stop()));\n        } finally {\n            try {\n                await this.#agent.stop();\n            } finally {\n                this.#pipeline.unbindAll();\n                this.#bindings.clear();\n            }\n        }\n    }\n\n    //--------------------------------------------------------------------------\n    // Agent lifecycle. Each event is re-emitted as a fresh instance: an Event object that is being\n    // dispatched cannot be dispatched again.\n\n    #onSessionCreated = (event: SessionCreatedEvent): void => {\n        this._dispatchEvent(new SessionCreatedEvent({ livelink: event.livelink }));\n    };\n\n    #onSessionJoined = (event: SessionJoinedEvent): void => {\n        this._dispatchEvent(new SessionJoinedEvent({ livelink: event.livelink }));\n    };\n\n    #onSessionReady = (event: SessionReadyEvent): void => {\n        this._dispatchEvent(new SessionReadyEvent({ livelink: event.livelink }));\n        this.#bindSession(event.livelink);\n    };\n\n    #onSessionLeft = (event: SessionLeftEvent): void => {\n        this.#unbindSession(event.livelink);\n        this._dispatchEvent(new SessionLeftEvent({ livelink: event.livelink, reason: event.reason }));\n    };\n\n    // The agent is done, either by its own decision or because someone stopped it directly. Nothing\n    // will bind another session, so the sources have to go too: a broker connection or a playback\n    // timer left running holds a Node process open with no session left to drive.\n    // Our own stop() detaches this listener before stopping the agent, so it never re-enters.\n    #onAgentStopped = (event: AgentStoppedEvent): void => {\n        this._dispatchEvent(new AgentStoppedEvent({ is_automatic: event.is_automatic }));\n        void this.stop().catch((error: Error) => this.#reportError(error));\n    };\n\n    #onAgentError = (event: AgentErrorEvent): void => {\n        this.#reportError(event.error);\n    };\n\n    //--------------------------------------------------------------------------\n\n    /**\n     * Bind a ready session's scene to the pipeline, and ensure the shared sources run.\n     */\n    async #bindSession(livelink: Livelink): Promise<void> {\n        const session_id = livelink.session.session_id;\n        if (this.#bindings.has(session_id)) {\n            return;\n        }\n\n        const binding = this.#pipeline.bind({ scene: livelink.scene });\n        this.#bindings.set(session_id, { binding, livelink });\n        this._dispatchEvent(new SessionBoundEvent({ livelink }));\n\n        this.#startClock();\n        await this.#ensureSourcesStarted();\n    }\n\n    /**\n     * Start the clock advancing continuous updates, on the first bound session. Idempotent, and a\n     * no-op when the clock is switched off.\n     */\n    #startClock(): void {\n        if (this.#tick_interval !== null || this.#tick_interval_ms === null) {\n            return;\n        }\n        this.#last_tick_ms = performance.now();\n        this.#carried_seconds = 0;\n        this.#tick_interval = setInterval(() => void this.#advance(), this.#tick_interval_ms);\n    }\n\n    /**\n     * Stop the clock. Safe to call when it never started.\n     */\n    #stopClock(): void {\n        if (this.#tick_interval === null) {\n            return;\n        }\n        clearInterval(this.#tick_interval);\n        this.#tick_interval = null;\n    }\n\n    /**\n     * Advance the pipeline's continuous updates by the time since the last advance.\n     *\n     * @returns The advance that will cover this call's elapsed time \u2014 the one it started, or the one\n     * already in flight that this call folded its time into.\n     */\n    #advance(): Promise<void> {\n        const now_ms = performance.now();\n        this.#carried_seconds += Math.min((now_ms - this.#last_tick_ms) / 1000, MAX_TICK_SECONDS);\n        this.#last_tick_ms = now_ms;\n\n        // Already advancing: the time just measured is kept rather than dropped, and the advance in\n        // flight is what the caller waits on. Nothing is lost and nothing is applied out of order.\n        if (this.#tick_in_flight !== null) {\n            return this.#tick_in_flight;\n        }\n\n        const seconds = this.#carried_seconds;\n        this.#carried_seconds = 0;\n        // `tick` never throws; it reports to the pipeline's own `onError`.\n        const running = this.#pipeline.tick(seconds).finally(() => {\n            if (this.#tick_in_flight === running) {\n                this.#tick_in_flight = null;\n            }\n        });\n        this.#tick_in_flight = running;\n        return running;\n    }\n\n    /**\n     * Unbind a session's scene, releasing its resolvers.\n     */\n    #unbindSession(livelink: Livelink): void {\n        const session_id = livelink.session.session_id;\n        const bound = this.#bindings.get(session_id);\n        if (!bound) {\n            return;\n        }\n        this.#bindings.delete(session_id);\n        bound.binding.unbind();\n\n        // Nothing left to drive: a timer firing thirty times a second into an empty pipeline keeps\n        // `ticks_processed` climbing and keeps a Node process from idling. `#bindSession` starts it\n        // again on the next ready session.\n        if (this.#bindings.size === 0) {\n            this.#stopClock();\n        }\n\n        this._dispatchEvent(new SessionUnboundEvent({ livelink }));\n    }\n\n    /**\n     * Start the shared sources on the first binding. Concurrent first-bindings share the one start.\n     *\n     * A failed start is reported and leaves `#transports` empty, so the next session to bind retries\n     * it \u2014 a broker that is down when the first session comes up does not disable the ingestion for\n     * good. (Nothing retries on its own while the bound sessions are unchanged.)\n     */\n    async #ensureSourcesStarted(): Promise<void> {\n        if (this.#sources.length === 0 || this.#transports.length > 0 || this.#sources_starting) {\n            return;\n        }\n        this.#sources_starting = true;\n\n        const started: Array<Transport> = [];\n        try {\n            for (const source of this.#sources) {\n                const transport =\n                    typeof source === \"function\" ? await source(this) : await createTransport(source, this);\n                await transport.start();\n                started.push(transport);\n            }\n\n            // `stop()` may have landed while these were being built or started: it saw an empty\n            // `#transports` and had nothing to stop, so close them here rather than leak live broker\n            // connections (which would also keep a Node process alive).\n            if (!this.#started) {\n                await Promise.all(started.map(transport => transport.stop()));\n                return;\n            }\n\n            // Published only once every source started, so a failure above leaves the field empty.\n            this.#transports = started;\n            this._dispatchEvent(new IngestionRunningEvent());\n        } catch (error) {\n            await Promise.all(started.map(transport => transport.stop().catch(() => {})));\n            this.#reportError(error as Error);\n        } finally {\n            this.#sources_starting = false;\n        }\n    }\n\n    /**\n     * Emit an error, falling back to the console when nobody is listening \u2014 an ingestion failing\n     * silently is the one outcome worth avoiding.\n     */\n    #reportError(error: Error): void {\n        if (!this._hasListeners(\"on-error\")) {\n            console.error(\"[scene-ingestion]\", error);\n        }\n        this._dispatchEvent(new IngestionErrorEvent({ error }));\n    }\n}\n"],
  "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAOA,aAAS,iBAAiB;AACxB,WAAK,WAAW,CAAC;AACjB,WAAK,OAAO;AAAA,IACd;AAHS;AAKT,WAAO,UAAU;AAAA;AAAA;;;ACZjB;AAAA;AAgCA,aAAS,GAAG,OAAO,OAAO;AACxB,aAAO,UAAU,SAAU,UAAU,SAAS,UAAU;AAAA,IAC1D;AAFS;AAIT,WAAO,UAAU;AAAA;AAAA;;;ACpCjB;AAAA;AAAA,QAAI,KAAK;AAUT,aAAS,aAAa,OAAO,KAAK;AAChC,UAAI,SAAS,MAAM;AACnB,aAAO,UAAU;AACf,YAAI,GAAG,MAAM,MAAM,EAAE,CAAC,GAAG,GAAG,GAAG;AAC7B,iBAAO;AAAA,QACT;AAAA,MACF;AACA,aAAO;AAAA,IACT;AARS;AAUT,WAAO,UAAU;AAAA;AAAA;;;ACpBjB;AAAA;AAAA,QAAI,eAAe;AAGnB,QAAI,aAAa,MAAM;AAGvB,QAAI,SAAS,WAAW;AAWxB,aAAS,gBAAgB,KAAK;AAC5B,UAAI,OAAO,KAAK,UACZ,QAAQ,aAAa,MAAM,GAAG;AAElC,UAAI,QAAQ,GAAG;AACb,eAAO;AAAA,MACT;AACA,UAAI,YAAY,KAAK,SAAS;AAC9B,UAAI,SAAS,WAAW;AACtB,aAAK,IAAI;AAAA,MACX,OAAO;AACL,eAAO,KAAK,MAAM,OAAO,CAAC;AAAA,MAC5B;AACA,QAAE,KAAK;AACP,aAAO;AAAA,IACT;AAfS;AAiBT,WAAO,UAAU;AAAA;AAAA;;;AClCjB;AAAA;AAAA,QAAI,eAAe;AAWnB,aAAS,aAAa,KAAK;AACzB,UAAI,OAAO,KAAK,UACZ,QAAQ,aAA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AAoB;AAEzB,UAAM,UAA4B,CAAC;AACnC,QAAI;AACA,iBAAW,UAAU,KAAK,UAAU;AAChC,cAAM,YACF,OAAO,WAAW,aAAa,MAAM,OAAO,IAAI,IAAI,MAAM,gBAAgB,QAAQ,IAAI;AAC1F,cAAM,UAAU,MAAM;AACtB,gBAAQ,KAAK,SAAS;AAAA,MAC1B;AAKA,UAAI,CAAC,KAAK,UAAU;AAChB,cAAM,QAAQ,IAAI,QAAQ,IAAI,eAAa,UAAU,KAAK,CAAC,CAAC;AAC5D;AAAA,MACJ;AAGA,WAAK,cAAc;AACnB,WAAK,eAAe,IAAI,sBAAsB,CAAC;AAAA,IACnD,SAAS,OAAO;AACZ,YAAM,QAAQ,IAAI,QAAQ,IAAI,eAAa,UAAU,KAAK,EAAE,MAAM,MAAM;AAAA,MAAC,CAAC,CAAC,CAAC;AAC5E,WAAK,aAAa,KAAc;AAAA,IACpC,UAAE;AACE,WAAK,oBAAoB;AAAA,IAC7B;AAAA,EACJ;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,aAAa,OAAoB;AAC7B,QAAI,CAAC,KAAK,cAAc,UAAU,GAAG;AACjC,cAAQ,MAAM,qBAAqB,KAAK;AAAA,IAC5C;AACA,SAAK,eAAe,IAAI,oBAAoB,EAAE,MAAM,CAAC,CAAC;AAAA,EAC1D;AACJ;",
  "names": ["Symbol", "Symbol", "e", "Symbol", "e", "Map", "Map", "Map", "othValue", "Uint8Array", "Symbol", "Uint8Array", "Buffer", "e", "DataView", "Promise", "Set", "WeakMap", "DataView", "Map", "Promise", "Set", "WeakMap", "isEqual", "e", "Buffer", "Uint8Array", "Symbol", "key", "cloneDeep", "isNode", "DynamicLoader", "_DynamicLoader", "#core", "#importPromise", "target", "#importCore", "dynamicImport", "#createImporter", "LivelinkCore", "TARGET_COLOR", "moduleURL", "source", "vm", "module", "e", "a", "a", "e", "s", "isEqual", "cloneDeep", "installed"]
}
