Socket
Socket
Sign inDemoInstall

@systemic-games/pixels-core-utils

Package Overview
Dependencies
2
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.2

dist/src/__tests__/index.test.d.ts

16

dist/cjs/keyValuesUtils.js

@@ -36,13 +36,10 @@ "use strict";

function valuesToKeys(values, keyValues, onMissingKey) {
const valueToKey = new Map();
for (const e of Object.entries(keyValues)) {
valueToKey.set(e[1], e[0]);
}
return values.map((value) => {
const k = valueToKey.get(value);
const ret = [];
for (const value of values) {
const k = getValueKeyName(value, keyValues);
if (k !== undefined) {
return k;
ret.push(k);
}
else if (onMissingKey) {
return onMissingKey(value);
ret.push(onMissingKey(value));
}

@@ -52,3 +49,4 @@ else {

}
});
}
return ret;
}

@@ -55,0 +53,0 @@ exports.valuesToKeys = valuesToKeys;

@@ -9,3 +9,3 @@ "use strict";

const encodeUtf8_1 = require("./encodeUtf8");
const serializableKey = Symbol("pixelAnimationSerializable");
const serializableKey = Symbol.for("PixelsAnimationSerializable");
/** Error thrown during (de)serialization. */

@@ -12,0 +12,0 @@ class SerializationError extends Error {

@@ -32,13 +32,10 @@ /**

export function valuesToKeys(values, keyValues, onMissingKey) {
const valueToKey = new Map();
for (const e of Object.entries(keyValues)) {
valueToKey.set(e[1], e[0]);
}
return values.map((value) => {
const k = valueToKey.get(value);
const ret = [];
for (const value of values) {
const k = getValueKeyName(value, keyValues);
if (k !== undefined) {
return k;
ret.push(k);
}
else if (onMissingKey) {
return onMissingKey(value);
ret.push(onMissingKey(value));
}

@@ -48,3 +45,4 @@ else {

}
});
}
return ret;
}

@@ -51,0 +49,0 @@ /**

@@ -6,3 +6,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

import { encodeUtf8 } from "./encodeUtf8";
const serializableKey = Symbol("pixelAnimationSerializable");
const serializableKey = Symbol.for("PixelsAnimationSerializable");
/** Error thrown during (de)serialization. */

@@ -9,0 +9,0 @@ export class SerializationError extends Error {

@@ -12,30 +12,42 @@ export type EventMap = Record<string, any>;

* for the event of the given type.
* @param eventType The type of the event.
* @param type A case-sensitive string representing the event type to listen for.
* @param listener The callback function.
* @returns A reference to the `EventEmitter`.
*/
addListener<K extends EventKey<T>>(eventType: K, listener: EventReceiver<T[K]>): void;
addListener<K extends EventKey<T>>(type: K, listener: EventReceiver<T[K]>): this;
/**
* Removes the specified listener function from the listener array
* for the event of the given type.
* @param eventType The type of the event.
* @param type A case-sensitive string representing the event type.
* @param listener The callback function to unregister.
* @returns A reference to the `EventEmitter`.
*/
removeListener<K extends EventKey<T>>(eventType: K, listener: EventReceiver<T[K]>): void;
removeListener<K extends EventKey<T>>(type: K, listener: EventReceiver<T[K]>): this;
/**
* Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
* with the given name.
* @param eventName The name of the event.
* Synchronously calls each of the listeners registered for the given
* event type, in the order they were registered, passing the supplied
* arguments.
* @param type A case-sensitive string representing the event type.
* @param params Optional parameters.
* @returns Whether the event had listeners.
*/
emit<K extends EventKey<T>>(eventName: K, params: T[K]): void;
emit<K extends EventKey<T>>(type: K, params: T[K]): boolean;
/**
* By default `EventEmitter`s will print a warning if more than `10` listeners are
* added for a particular event.
* Returns the number of listeners for the event of the given type.
* @param type A case-sensitive string representing the event type.
* @returns The number of listeners.
*/
listenerCount<K extends EventKey<T>>(type: K): number;
/**
* By default `EventEmitter`s will print a warning if more than 10
* listeners are added for a particular event.
* Use this function to modify the default threshold.
* @param n Number of listeners before printing a warning.
* The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
* The value can be set to`Infinity` (or `0`) to indicate
* an unlimited number of listeners.
* @returns A reference to the `EventEmitter`.
*/
setMaxListeners(n: number): this;
/**
* Returns the current max listener value for this `EventEmitter`.
* Gets the current max listener value for this `EventEmitter`.
*/

@@ -42,0 +54,0 @@ getMaxListeners(): number;

@@ -9,5 +9,5 @@ /**

*/
export declare function keysToValues<V>(keys: string[], keyValues: {
[key: string]: V;
}, onMissingKey?: (key: string) => V): V[];
export declare function keysToValues<T>(keys: string[], keyValues: {
[key: string]: T;
}, onMissingKey?: (key: string) => T): T[];
/**

@@ -21,5 +21,5 @@ * Map a list of values to the corresponding list of keys

*/
export declare function valuesToKeys<V, T extends {
[key: string]: V;
}>(values: V[], keyValues: T, onMissingKey?: (value: V) => string): (keyof T)[];
export declare function valuesToKeys<T, KeyValuesType extends {
[key: string]: T;
}>(values: T[], keyValues: KeyValuesType, onMissingKey?: (value: T) => string): (keyof KeyValuesType)[];
/**

@@ -26,0 +26,0 @@ * Returns the key name corresponding to a given value

@@ -15,4 +15,4 @@ /**

*/
run(promise: () => Promise<void>): Promise<void>;
run(promise: () => Promise<void> | void): Promise<void>;
}
//# sourceMappingURL=SequentialPromiseQueue.d.ts.map
/*! For license information please see index.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pixelsCoreUtils=t():e.pixelsCoreUtils=t()}(this,(()=>(()=>{var e={699:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var o,i,s,f;if(u(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=a(e))>0&&s.length>o&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,f=c,console&&console.warn&&console.warn(f)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=c.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):y(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)r(a,this,t);else{var f=a.length,c=y(a,f);for(n=0;n<f;++n)r(c[n],this,t)}return!0},i.prototype.addListener=function(e,t){return f(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return f(this,e,t,!0)},i.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,s;if(u(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},738:(e,t,n)=>{var r;!function(e){!function(t){var r="object"==typeof n.g?n.g:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=i(e);function i(e,t){return function(n,r){"function"!=typeof e[n]&&Object.defineProperty(e,n,{configurable:!0,writable:!0,value:r}),t&&t(n,r)}}void 0===r.Reflect?r.Reflect=e:o=i(r.Reflect,o),function(e){var t=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,r=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",i="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!i&&!s,a={create:i?function(){return I(Object.create(null))}:s?function(){return I({__proto__:null})}:function(){return I({})},has:u?function(e,n){return t.call(e,n)}:function(e,t){return t in e},get:u?function(e,n){return t.call(e,n)?e[n]:void 0}:function(e,t){return e[t]}},f=Object.getPrototypeOf(Function),c="object"==typeof process&&process.env&&"true"===process.env.REFLECT_METADATA_USE_MAP_POLYFILL,l=c||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var e={},t=[],n=function(){function e(e,t,n){this._index=0,this._keys=e,this._values=t,this._selector=n}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var n=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var n=this._find(e,!0);return this._values[n]=t,this},t.prototype.delete=function(t){var n=this._find(t,!1);if(n>=0){for(var r=this._keys.length,o=n+1;o<r;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,t===this._cacheKey&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new n(this._keys,this._values,r)},t.prototype.values=function(){return new n(this._keys,this._values,i)},t.prototype.entries=function(){return new n(this._keys,this._values,s)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[o]=function(){return this.entries()},t.prototype._find=function(e,t){return this._cacheKey!==e&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=e)),this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function r(e,t){return e}function i(e,t){return t}function s(e,t){return[e,t]}}():Map,p=c||"function"!=typeof Set||"function"!=typeof Set.prototype.entries?function(){function e(){this._map=new l}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.values()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[o]=function(){return this.keys()},e}():Set,d=new(c||"function"!=typeof WeakMap?function(){var e=16,n=a.create(),r=o();return function(){function e(){this._key=o()}return e.prototype.has=function(e){var t=i(e,!1);return void 0!==t&&a.has(t,this._key)},e.prototype.get=function(e){var t=i(e,!1);return void 0!==t?a.get(t,this._key):void 0},e.prototype.set=function(e,t){return i(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=i(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=o()},e}();function o(){var e;do{e="@@WeakMap@@"+u()}while(a.has(n,e));return n[e]=!0,e}function i(e,n){if(!t.call(e,r)){if(!n)return;Object.defineProperty(e,r,{value:a.create()})}return e[r]}function s(e,t){for(var n=0;n<t;++n)e[n]=255*Math.random()|0;return e}function u(){var t,n=(t=e,"function"==typeof Uint8Array?"undefined"!=typeof crypto?crypto.getRandomValues(new Uint8Array(t)):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(new Uint8Array(t)):s(new Uint8Array(t),t):s(new Array(t),t));n[6]=79&n[6]|64,n[8]=191&n[8]|128;for(var r="",o=0;o<e;++o){var i=n[o];4!==o&&6!==o&&8!==o||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}():WeakMap);function y(e,t,n){var r=d.get(e);if(E(r)){if(!n)return;r=new l,d.set(e,r)}var o=r.get(t);if(E(o)){if(!n)return;o=new l,r.set(t,o)}return o}function v(e,t,n){if(h(e,t,n))return!0;var r=U(t);return!x(r)&&v(e,r,n)}function h(e,t,n){var r=y(t,n,!1);return!E(r)&&!!r.has(e)}function b(e,t,n){if(h(e,t,n))return g(e,t,n);var r=U(t);return x(r)?void 0:b(e,r,n)}function g(e,t,n){var r=y(t,n,!1);if(!E(r))return r.get(e)}function w(e,t,n,r){y(n,r,!0).set(e,t)}function m(e,t){var n=_(e,t),r=U(e);if(null===r)return n;var o=m(r,t);if(o.length<=0)return n;if(n.length<=0)return o;for(var i=new p,s=[],u=0,a=n;u<a.length;u++){var f=a[u];i.has(f)||(i.add(f),s.push(f))}for(var c=0,l=o;c<l.length;c++)f=l[c],i.has(f)||(i.add(f),s.push(f));return s}function _(e,t){var n=[],r=y(e,t,!1);if(E(r))return n;for(var i=function(e){var t=M(e,o);if(!P(t))throw new TypeError;var n=t.call(e);if(!j(n))throw new TypeError;return n}(r.keys()),s=0;;){var u=A(i);if(!u)return n.length=s,n;var a=u.value;try{n[s]=a}catch(e){try{S(i)}finally{throw e}}s++}}function O(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function E(e){return void 0===e}function x(e){return null===e}function j(e){return"object"==typeof e?null!==e:"function"==typeof e}function L(e,t){switch(O(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var n=3===t?"string":5===t?"number":"default",o=M(e,r);if(void 0!==o){var i=o.call(e,n);if(j(i))throw new TypeError;return i}return function(e,t){if("string"===t){var n=e.toString;if(P(n)&&!j(o=n.call(e)))return o;if(P(r=e.valueOf)&&!j(o=r.call(e)))return o}else{var r;if(P(r=e.valueOf)&&!j(o=r.call(e)))return o;var o,i=e.toString;if(P(i)&&!j(o=i.call(e)))return o}throw new TypeError}(e,"default"===n?"number":n)}function T(e){var t=L(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function k(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function P(e){return"function"==typeof e}function z(e){return"function"==typeof e}function M(e,t){var n=e[t];if(null!=n){if(!P(n))throw new TypeError;return n}}function A(e){var t=e.next();return!t.done&&t}function S(e){var t=e.return;t&&t.call(e)}function U(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===f)return t;if(t!==f)return t;var n=e.prototype,r=n&&Object.getPrototypeOf(n);if(null==r||r===Object.prototype)return t;var o=r.constructor;return"function"!=typeof o||o===e?t:o}function I(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,n,r){if(E(n)){if(!k(e))throw new TypeError;if(!z(t))throw new TypeError;return function(e,t){for(var n=e.length-1;n>=0;--n){var r=(0,e[n])(t);if(!E(r)&&!x(r)){if(!z(r))throw new TypeError;t=r}}return t}(e,t)}if(!k(e))throw new TypeError;if(!j(t))throw new TypeError;if(!j(r)&&!E(r)&&!x(r))throw new TypeError;return x(r)&&(r=void 0),function(e,t,n,r){for(var o=e.length-1;o>=0;--o){var i=(0,e[o])(t,n,r);if(!E(i)&&!x(i)){if(!j(i))throw new TypeError;r=i}}return r}(e,t,n=T(n),r)})),e("metadata",(function(e,t){return function(n,r){if(!j(n))throw new TypeError;if(!E(r)&&!function(e){switch(O(e)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;w(e,t,n,r)}})),e("defineMetadata",(function(e,t,n,r){if(!j(n))throw new TypeError;return E(r)||(r=T(r)),w(e,t,n,r)})),e("hasMetadata",(function(e,t,n){if(!j(t))throw new TypeError;return E(n)||(n=T(n)),v(e,t,n)})),e("hasOwnMetadata",(function(e,t,n){if(!j(t))throw new TypeError;return E(n)||(n=T(n)),h(e,t,n)})),e("getMetadata",(function(e,t,n){if(!j(t))throw new TypeError;return E(n)||(n=T(n)),b(e,t,n)})),e("getOwnMetadata",(function(e,t,n){if(!j(t))throw new TypeError;return E(n)||(n=T(n)),g(e,t,n)})),e("getMetadataKeys",(function(e,t){if(!j(e))throw new TypeError;return E(t)||(t=T(t)),m(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!j(e))throw new TypeError;return E(t)||(t=T(t)),_(e,t)})),e("deleteMetadata",(function(e,t,n){if(!j(t))throw new TypeError;E(n)||(n=T(n));var r=y(t,n,!1);if(E(r))return!1;if(!r.delete(e))return!1;if(r.size>0)return!0;var o=d.get(t);return o.delete(n),o.size>0||d.delete(t),!0}))}(o)}()}(r||(r={}))},168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequentialPromiseQueue=void 0,t.SequentialPromiseQueue=class{constructor(){this._queue=[]}run(e){return new Promise(((t,n)=>{var r,o;this._queue.push((async()=>{var r,o;try{await e(),t()}catch(e){n(e)}this._queue.shift(),null===(o=(r=this._queue)[0])||void 0===o||o.call(r)})),1===this._queue.length&&(null===(o=(r=this._queue)[0])||void 0===o||o.call(r))}))}}},980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=t.AssertionError=void 0;class n extends Error{constructor(e){super(e),this.name="AssertionError"}}t.AssertionError=n,t.assert=function(e,t){if(!e)throw new n(null!=t?t:`Assertion failed with value ${e}`)}},581:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNever=void 0;const r=n(980);t.assertNever=function(e,t){(0,r.assert)(!1,null!=t?t:"assertNever() called")}},912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bernsteinHash=void 0,t.bernsteinHash=function(e){let t=5381;for(let n=0;n<e.length;++n)t=33*t^e[n];return t}},934:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitIndexToFlag=t.combineFlags=t.bitsToFlags=t.bitsToIndices=void 0;const r=n(980);function o(e){const t=[];if((e=Math.floor(null!=e?e:0))>0){let n=e.toString(2),r=0;for(;n.length;)"1"===n.at(-1)&&t.push(r),n=n.substring(0,n.length-1),++r}return t}function i(e){return(0,r.assert)(e<53,`bitIndexToFlag: Bit index greater than maximum precision of 64 bits floating-point numbers (52 bits mantissa), got ${e}`),Math.pow(2,e)}t.bitsToIndices=o,t.bitsToFlags=function(e){return o(e).map(i)},t.combineFlags=function(e){return e.reduce(((e,t)=>((0,r.assert)(t<2147483648,`combineFlags: Flag value greater or equal to 2^31, can't combine using OR operator, got ${t}`),e|t)),0)},t.bitIndexToFlag=i},188:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTypedEventEmitter=void 0;const r=n(699);t.createTypedEventEmitter=function(){return new r.EventEmitter}},431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8=t.DecodeUtf8Error=void 0;class n extends Error{constructor(e,t){super(e),this.name="DecodeUtf8Error",this.decodedString=t}}t.DecodeUtf8Error=n,t.decodeUtf8=function(e){let t=0,r="";for(;t<e.length;){let o=e[t++];if(!o)break;if(o>127)if(o>191&&o<224){if(t>=e.length)throw new n("Incomplete 2-bytes sequence",r);o=(31&o)<<6|63&e[t++]}else if(o>223&&o<240){if(t+1>=e.length)throw new n("Incomplete 3-bytes sequence",r);o=(15&o)<<12|(63&e[t++])<<6|63&e[t++]}else{if(!(o>239&&o<248))throw new n(`Unknown multibyte start 0x${o.toString(16)} at index ${t-1}`,r);if(t+2>=e.length)throw new n("Incomplete 4-bytes sequence",r);o=(7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++]}if(o<=65535)r+=String.fromCharCode(o);else{if(!(o<=1114111))throw new n(`Code point 0x${o.toString(16)} exceeds UTF-16 reach`,r);o-=65536,r+=String.fromCharCode(o>>10|55296),r+=String.fromCharCode(1023&o|56320)}}return r}},233:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=async function(e,t){return new Promise(((n,r)=>{if(null==t?void 0:t.aborted)r(new Error(`Call to delay(${e}) aborted on start`));else{const o=()=>{clearTimeout(i),r(new Error(`Call to delay(${e}) aborted before timeout`))};null==t||t.addEventListener("abort",o);const i=setTimeout((()=>{null==t||t.removeEventListener("abort",o),n()}),e)}}))}},306:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeUtf8=void 0,t.encodeUtf8=function(e){return new Uint8Array(function(e){const t=[];for(let n=0;n<e.length;n++){const r=e.codePointAt(n);r<128?t.push(r):r<2048?t.push(192|r>>6,128|63&r):r<65536?t.push(224|r>>12,128|r>>6&63,128|63&r):(n++,t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r))}return t}(e))}},860:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumFlag=t.enumValue=void 0;let n=0;t.enumValue=function(e){return void 0!==e&&(n=e),n++};let r=0;t.enumFlag=function(e){void 0!==e&&(r=e);const t=1<<r;return r+=1,t}},368:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var o=Object.getOwnPropertyDescriptor(t,n);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,o)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(980),t),o(n(581),t),o(n(912),t),o(n(188),t),o(n(431),t),o(n(306),t),o(n(233),t),o(n(860),t),o(n(48),t),o(n(208),t),o(n(168),t),o(n(934),t),o(n(831),t),o(n(52),t)},831:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getValueKeyName=t.valuesToKeys=t.keysToValues=void 0,t.keysToValues=function(e,t,n){return e.map((e=>{const r=t[e];if(void 0!==r)return r;if(n)return n(e);throw new Error(`keysToValues: Missing key ${e}`)}))},t.valuesToKeys=function(e,t,n){const r=new Map;for(const e of Object.entries(t))r.set(e[1],e[0]);return e.map((e=>{const t=r.get(e);if(void 0!==t)return t;if(n)return n(e);throw new Error(`valuesToKeys: Missing key for value ${e}`)}))},t.getValueKeyName=function(e,t){for(const[n,r]of Object.entries(t))if(r===e)return n}},52:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0,t.range=function(e,t,n){let r=e;void 0===t&&(t=e,r=0),n||(n=1);let o=(t-r)/n;o<0&&(o=-o,n=-n);const i=Array(Math.floor(o));let s=r,u=0;for(;u<o;)i[u]=s,s+=n,u+=1;return i}},48:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeAssign=void 0,t.safeAssign=function(e,t){return Object.assign(e,function(e){for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e}(t))}},208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=t.byteSizeOf=t.byteSizeOfPropWithPadding=t.byteSizeOfProp=t.getSerializableProperties=t.serializable=t.SerializationError=void 0,n(738);const r=n(980),o=n(431),i=n(306),s=Symbol("pixelAnimationSerializable");class u extends Error{constructor(e){super(e),this.name="SerializationError"}}function a(e){return Reflect.getMetadata(s,e)}function f(e){var t,n;return Array.isArray(e)?e.reduce(((e,t)=>e+f(t)),0):null!==(n=null===(t=a(e))||void 0===t?void 0:t.reduce(((e,t)=>{var n,r,o,i;if((null===(n=t.options)||void 0===n?void 0:n.nullTerminated)||(null===(r=null==t?void 0:t.options)||void 0===r?void 0:r.terminator))throw new u("Dynamic size");return e+t.size+(null!==(i=null===(o=t.options)||void 0===o?void 0:o.padding)&&void 0!==i?i:0)}),0))&&void 0!==n?n:0}function c(e,t){const n=a(e);if(!(null==n?void 0:n.length))throw new u("Object has no serializable property");for(const r of n){const n=e[r.propertyKey],o=n instanceof ArrayBuffer||n&&n.buffer instanceof ArrayBuffer;if("number"!=typeof n&&"bigint"!=typeof n&&"boolean"!=typeof n&&"string"!=typeof n&&!o)throw new u(Array.isArray(n)?"Invalid property type, got an array, use an 'ArrayBuffer' instead":`Invalid property type, got ${typeof n} for ${r.propertyKey} but expected number or bigint`);if(!t(r,n))break}}function l(e,t){const n=Number(e);let r,o;switch(t){case"int8":r=-128,o=127;break;case"uint8":r=0,o=255;break;case"int16":r=-32768,o=32767;break;case"uint16":r=0,o=65535;break;case"int32":r=-2147483648,o=2147483647;break;case"uint32":r=0,o=4294967295}if(r&&o){if(n<r)throw new u(`Value ${n} too small to fit in a ${t}`);if(n>o)throw new u(`Value ${n} too big to fit in a ${t}`)}return n}function p(e,t,n=0){if(Array.isArray(e)){const r={dataView:t,byteOffset:n};for(const t of e){const[e,n]=d(t,r);r.dataView=e,r.byteOffset=n}return[r.dataView,r.byteOffset]}return c(e,((e,r)=>{var o,s,a,f,c,p,d,y,v,h;let b;if("string"==typeof r?b=(0,i.encodeUtf8)(r).buffer:r instanceof ArrayBuffer?b=r:r.buffer&&r.buffer instanceof ArrayBuffer&&(b=r.buffer),b){const i=b.byteLength+("string"==typeof r?1:0);if(!(null===(o=e.options)||void 0===o?void 0:o.nullTerminated)&&!(null===(s=e.options)||void 0===s?void 0:s.terminator)&&e.size<i)throw new u(`Serialized value for \`${e.propertyKey}\` takes ${i} bytes but prop size is ${e.size}`);const l=new Uint8Array(b),d=(null===(a=e.options)||void 0===a?void 0:a.nullTerminated)||(null===(f=e.options)||void 0===f?void 0:f.terminator)?l.byteLength:Math.min(l.byteLength,e.size);for(let e=0;e<d;++e)t.setUint8(n,l[e]),++n;if(!(null===(c=e.options)||void 0===c?void 0:c.nullTerminated)&&!(null===(p=e.options)||void 0===p?void 0:p.terminator))for(let r=d;r<e.size;++r)t.setUint8(n,0),++n}else{const o="float"===(null===(d=e.options)||void 0===d?void 0:d.numberFormat),i="signed"===(null===(y=e.options)||void 0===y?void 0:y.numberFormat);!function(e,t,n,r,o,i){switch(r){case 1:o?e.setInt8(t,l(n,"int8")):e.setUint8(t,l(n,"uint8"));break;case 2:o?e.setInt16(t,l(n,"int16"),!0):e.setUint16(t,l(n,"uint16"),!0);break;case 4:i?e.setFloat32(t,l(n,"float32"),!0):o?e.setInt32(t,l(n,"int32"),!0):e.setInt32(t,l(n,"uint32"),!0);break;case 8:if(!i)throw new u("BigInt not supported");e.setFloat64(t,l(n,"float64"),!0);break;default:throw new u(`Invalid property size, got ${r} but expected 1, 2, 4, or 8`)}}(t,n,r,e.size,i,o),n+=e.size+(null!==(h=null===(v=e.options)||void 0===v?void 0:v.padding)&&void 0!==h?h:0)}return!0})),[t,n]}function d(e,t){var n;if(null==t?void 0:t.dataView)return p(e,t.dataView,null!==(n=t.byteOffset)&&void 0!==n?n:0);{const t=f(e),[n,o]=p(e,new DataView(new ArrayBuffer(t)));return(0,r.assert)(o===n.buffer.byteLength,`Incorrect offset after serialization, got ${o} but expected ${n.buffer.byteLength}`),[n,o]}}t.SerializationError=u,t.serializable=function(e,t){return function(n,r){const o=Reflect.getMetadata(s,n),i={propertyKey:r,size:e,options:t};o?o.push(i):Reflect.defineMetadata(s,[i],n)}},t.getSerializableProperties=a,t.byteSizeOfProp=function(e,t){var n,r,o,i;const s=null===(n=a(e))||void 0===n?void 0:n.find((e=>e.propertyKey===t));return(null===(r=null==s?void 0:s.options)||void 0===r?void 0:r.nullTerminated)||(null===(o=null==s?void 0:s.options)||void 0===o?void 0:o.terminator)?"dynamic":null!==(i=null==s?void 0:s.size)&&void 0!==i?i:0},t.byteSizeOfPropWithPadding=function(e,t){var n,r,o,i,s;const u=null===(n=a(e))||void 0===n?void 0:n.find((e=>e.propertyKey===t));return(null===(r=null==u?void 0:u.options)||void 0===r?void 0:r.nullTerminated)||(null===(o=null==u?void 0:u.options)||void 0===o?void 0:o.terminator)?"dynamic":u?u.size+(null!==(s=null===(i=u.options)||void 0===i?void 0:i.padding)&&void 0!==s?s:0):0},t.byteSizeOf=f,t.serialize=d,t.deserialize=function(e,t,n){return function(e,t,n){function r(e,t,n,r){if("boolean"!=typeof r||"number"!=typeof n&&"bigint"!=typeof n){if(typeof n!=typeof r)throw new u(`Type mismatch, deserialized a ${typeof n} but but expected a ${typeof r}`)}else n=Boolean(n);e[t.propertyKey]=n}let i=0;return c(e,((s,a)=>{var f,c,l,p,d,y,v,h,b,g,w;if((null==n?void 0:n.allowSkipLastProps)&&i===t.byteLength)return!1;if(!(null===(f=s.options)||void 0===f?void 0:f.nullTerminated)&&!(null===(c=s.options)||void 0===c?void 0:c.terminator)&&i+s.size>t.byteLength)throw new u(`Not enough bytes for deserializing \`${s.propertyKey}\` of size ${s.size}`);if(Array.isArray(e))throw new u("Array type not supported for deserialization");if("string"==typeof a){const n=t.byteOffset+i;if(!(null===(l=s.options)||void 0===l?void 0:l.nullTerminated)&&!(null===(p=s.options)||void 0===p?void 0:p.terminator)&&n+s.size>t.buffer.byteLength)throw new u(`Unexpected property size, got ${s.size} but there are only ${t.buffer.byteLength-n} left`);const f=t.buffer.slice(n,(null===(d=s.options)||void 0===d?void 0:d.nullTerminated)?function(e,t){for(let n=t;n<e.byteLength;++n)if(!e.getUint8(n))return n;throw new u("Data is not null terminated")}(t,i)-1:(null===(y=s.options)||void 0===y?void 0:y.terminator)?t.byteOffset+t.byteLength:n+s.size);try{r(e,s,(0,o.decodeUtf8)(new Uint8Array(f)),a)}catch(t){if(!(t instanceof o.DecodeUtf8Error))throw new u(null!==(v=null==t?void 0:t.message)&&void 0!==v?v:String(t));r(e,s,t.decodedString,a),console.warn(`Error decoding string for \`${s.propertyKey}\`: ${t}`)}i+=f.byteLength}else{const n="float"===(null===(h=s.options)||void 0===h?void 0:h.numberFormat),o="signed"===(null===(b=s.options)||void 0===b?void 0:b.numberFormat),f=function(e,t,n,r,o){switch(n){case 1:return r?e.getInt8(t):e.getUint8(t);case 2:return r?e.getInt16(t,!0):e.getUint16(t,!0);case 4:return o?e.getFloat32(t,!0):r?e.getInt32(t,!0):e.getUint32(t,!0);case 8:if(o)return e.getFloat64(t,!0);throw new u("BigInt not supported");default:throw new u(`Invalid property size, got ${n} but expected 1, 2, 4, or 8`)}}(t,i,s.size,o,n);r(e,s,f,a),i+=s.size}return i+=null!==(w=null===(g=s.options)||void 0===g?void 0:g.padding)&&void 0!==w?w:0,!0})),i}(e,t,n)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n(368)})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.pixelsCoreUtils=t():e.pixelsCoreUtils=t()}(this,(()=>(()=>{var e={699:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,s,f;if(u(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=a(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,f=c,console&&console.warn&&console.warn(f)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function d(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):v(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function y(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return a(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=o[e];if(void 0===a)return!1;if("function"==typeof a)n(a,this,t);else{var f=a.length,c=v(a,f);for(r=0;r<f;++r)n(c[r],this,t)}return!0},o.prototype.addListener=function(e,t){return f(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return f(this,e,t,!0)},o.prototype.once=function(e,t){return u(t),this.on(e,l(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return u(t),this.prependListener(e,l(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(u(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},168:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SequentialPromiseQueue=void 0,t.SequentialPromiseQueue=class{constructor(){this._queue=[]}run(e){return new Promise(((t,r)=>{var n,i;this._queue.push((async()=>{var n,i;try{await e(),t()}catch(e){r(e)}this._queue.shift(),null===(i=(n=this._queue)[0])||void 0===i||i.call(n)})),1===this._queue.length&&(null===(i=(n=this._queue)[0])||void 0===i||i.call(n))}))}}},980:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assert=t.AssertionError=void 0;class r extends Error{constructor(e){super(e),this.name="AssertionError"}}t.AssertionError=r,t.assert=function(e,t){if(!e)throw new r(null!=t?t:`Assertion failed with value ${e}`)}},581:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNever=void 0;const n=r(980);t.assertNever=function(e,t){(0,n.assert)(!1,null!=t?t:"assertNever() called")}},912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bernsteinHash=void 0,t.bernsteinHash=function(e){let t=5381;for(let r=0;r<e.length;++r)t=33*t^e[r];return t}},934:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bitIndexToFlag=t.combineFlags=t.bitsToFlags=t.bitsToIndices=void 0;const n=r(980);function i(e){const t=[];if((e=Math.floor(null!=e?e:0))>0){let r=e.toString(2),n=0;for(;r.length;)"1"===r.at(-1)&&t.push(n),r=r.substring(0,r.length-1),++n}return t}function o(e){return(0,n.assert)(e<53,`bitIndexToFlag: Bit index greater than maximum precision of 64 bits floating-point numbers (52 bits mantissa), got ${e}`),Math.pow(2,e)}t.bitsToIndices=i,t.bitsToFlags=function(e){return i(e).map(o)},t.combineFlags=function(e){return e.reduce(((e,t)=>((0,n.assert)(t<2147483648,`combineFlags: Flag value greater or equal to 2^31, can't combine using OR operator, got ${t}`),e|t)),0)},t.bitIndexToFlag=o},188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTypedEventEmitter=void 0;const n=r(699);t.createTypedEventEmitter=function(){return new n.EventEmitter}},431:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeUtf8=t.DecodeUtf8Error=void 0;class r extends Error{constructor(e,t){super(e),this.name="DecodeUtf8Error",this.decodedString=t}}t.DecodeUtf8Error=r,t.decodeUtf8=function(e){let t=0,n="";for(;t<e.length;){let i=e[t++];if(!i)break;if(i>127)if(i>191&&i<224){if(t>=e.length)throw new r("Incomplete 2-bytes sequence",n);i=(31&i)<<6|63&e[t++]}else if(i>223&&i<240){if(t+1>=e.length)throw new r("Incomplete 3-bytes sequence",n);i=(15&i)<<12|(63&e[t++])<<6|63&e[t++]}else{if(!(i>239&&i<248))throw new r(`Unknown multibyte start 0x${i.toString(16)} at index ${t-1}`,n);if(t+2>=e.length)throw new r("Incomplete 4-bytes sequence",n);i=(7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++]}if(i<=65535)n+=String.fromCharCode(i);else{if(!(i<=1114111))throw new r(`Code point 0x${i.toString(16)} exceeds UTF-16 reach`,n);i-=65536,n+=String.fromCharCode(i>>10|55296),n+=String.fromCharCode(1023&i|56320)}}return n}},233:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=async function(e,t){return new Promise(((r,n)=>{if(null==t?void 0:t.aborted)n(new Error(`Call to delay(${e}) aborted on start`));else{const i=()=>{clearTimeout(o),n(new Error(`Call to delay(${e}) aborted before timeout`))};null==t||t.addEventListener("abort",i);const o=setTimeout((()=>{null==t||t.removeEventListener("abort",i),r()}),e)}}))}},306:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeUtf8=void 0,t.encodeUtf8=function(e){return new Uint8Array(function(e){const t=[];for(let r=0;r<e.length;r++){const n=e.codePointAt(r);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<65536?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(e))}},860:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumFlag=t.enumValue=void 0;let r=0;t.enumValue=function(e){return void 0!==e&&(r=e),r++};let n=0;t.enumFlag=function(e){void 0!==e&&(n=e);const t=1<<n;return n+=1,t}},368:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(980),t),i(r(581),t),i(r(912),t),i(r(188),t),i(r(431),t),i(r(306),t),i(r(233),t),i(r(860),t),i(r(48),t),i(r(208),t),i(r(168),t),i(r(934),t),i(r(831),t),i(r(52),t)},831:(e,t)=>{"use strict";function r(e,t){for(const[r,n]of Object.entries(t))if(n===e)return r}Object.defineProperty(t,"__esModule",{value:!0}),t.getValueKeyName=t.valuesToKeys=t.keysToValues=void 0,t.keysToValues=function(e,t,r){return e.map((e=>{const n=t[e];if(void 0!==n)return n;if(r)return r(e);throw new Error(`keysToValues: Missing key ${e}`)}))},t.valuesToKeys=function(e,t,n){const i=[];for(const o of e){const e=r(o,t);if(void 0!==e)i.push(e);else{if(!n)throw new Error(`valuesToKeys: Missing key for value ${o}`);i.push(n(o))}}return i},t.getValueKeyName=r},52:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.range=void 0,t.range=function(e,t,r){let n=e;void 0===t&&(t=e,n=0),r||(r=1);let i=(t-n)/r;i<0&&(i=-i,r=-r);const o=Array(Math.floor(i));let s=n,u=0;for(;u<i;)o[u]=s,s+=r,u+=1;return o}},48:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.safeAssign=void 0,t.safeAssign=function(e,t){return Object.assign(e,function(e){for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e}(t))}},208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deserialize=t.serialize=t.byteSizeOf=t.byteSizeOfPropWithPadding=t.byteSizeOfProp=t.getSerializableProperties=t.serializable=t.SerializationError=void 0,r(605);const n=r(980),i=r(431),o=r(306),s=Symbol.for("PixelsAnimationSerializable");class u extends Error{constructor(e){super(e),this.name="SerializationError"}}function a(e){return Reflect.getMetadata(s,e)}function f(e){var t,r;return Array.isArray(e)?e.reduce(((e,t)=>e+f(t)),0):null!==(r=null===(t=a(e))||void 0===t?void 0:t.reduce(((e,t)=>{var r,n,i,o;if((null===(r=t.options)||void 0===r?void 0:r.nullTerminated)||(null===(n=null==t?void 0:t.options)||void 0===n?void 0:n.terminator))throw new u("Dynamic size");return e+t.size+(null!==(o=null===(i=t.options)||void 0===i?void 0:i.padding)&&void 0!==o?o:0)}),0))&&void 0!==r?r:0}function c(e,t){const r=a(e);if(!(null==r?void 0:r.length))throw new u("Object has no serializable property");for(const n of r){const r=e[n.propertyKey],i=r instanceof ArrayBuffer||r&&r.buffer instanceof ArrayBuffer;if("number"!=typeof r&&"bigint"!=typeof r&&"boolean"!=typeof r&&"string"!=typeof r&&!i)throw new u(Array.isArray(r)?"Invalid property type, got an array, use an 'ArrayBuffer' instead":`Invalid property type, got ${typeof r} for ${n.propertyKey} but expected number or bigint`);if(!t(n,r))break}}function l(e,t){const r=Number(e);let n,i;switch(t){case"int8":n=-128,i=127;break;case"uint8":n=0,i=255;break;case"int16":n=-32768,i=32767;break;case"uint16":n=0,i=65535;break;case"int32":n=-2147483648,i=2147483647;break;case"uint32":n=0,i=4294967295}if(n&&i){if(r<n)throw new u(`Value ${r} too small to fit in a ${t}`);if(r>i)throw new u(`Value ${r} too big to fit in a ${t}`)}return r}function d(e,t,r=0){if(Array.isArray(e)){const n={dataView:t,byteOffset:r};for(const t of e){const[e,r]=p(t,n);n.dataView=e,n.byteOffset=r}return[n.dataView,n.byteOffset]}return c(e,((e,n)=>{var i,s,a,f,c,d,p,v,y,h;let b;if("string"==typeof n?b=(0,o.encodeUtf8)(n).buffer:n instanceof ArrayBuffer?b=n:n.buffer&&n.buffer instanceof ArrayBuffer&&(b=n.buffer),b){const o=b.byteLength+("string"==typeof n?1:0);if(!(null===(i=e.options)||void 0===i?void 0:i.nullTerminated)&&!(null===(s=e.options)||void 0===s?void 0:s.terminator)&&e.size<o)throw new u(`Serialized value for \`${e.propertyKey}\` takes ${o} bytes but prop size is ${e.size}`);const l=new Uint8Array(b),p=(null===(a=e.options)||void 0===a?void 0:a.nullTerminated)||(null===(f=e.options)||void 0===f?void 0:f.terminator)?l.byteLength:Math.min(l.byteLength,e.size);for(let e=0;e<p;++e)t.setUint8(r,l[e]),++r;if(!(null===(c=e.options)||void 0===c?void 0:c.nullTerminated)&&!(null===(d=e.options)||void 0===d?void 0:d.terminator))for(let n=p;n<e.size;++n)t.setUint8(r,0),++r}else{const i="float"===(null===(p=e.options)||void 0===p?void 0:p.numberFormat),o="signed"===(null===(v=e.options)||void 0===v?void 0:v.numberFormat);!function(e,t,r,n,i,o){switch(n){case 1:i?e.setInt8(t,l(r,"int8")):e.setUint8(t,l(r,"uint8"));break;case 2:i?e.setInt16(t,l(r,"int16"),!0):e.setUint16(t,l(r,"uint16"),!0);break;case 4:o?e.setFloat32(t,l(r,"float32"),!0):i?e.setInt32(t,l(r,"int32"),!0):e.setInt32(t,l(r,"uint32"),!0);break;case 8:if(!o)throw new u("BigInt not supported");e.setFloat64(t,l(r,"float64"),!0);break;default:throw new u(`Invalid property size, got ${n} but expected 1, 2, 4, or 8`)}}(t,r,n,e.size,o,i),r+=e.size+(null!==(h=null===(y=e.options)||void 0===y?void 0:y.padding)&&void 0!==h?h:0)}return!0})),[t,r]}function p(e,t){var r;if(null==t?void 0:t.dataView)return d(e,t.dataView,null!==(r=t.byteOffset)&&void 0!==r?r:0);{const t=f(e),[r,i]=d(e,new DataView(new ArrayBuffer(t)));return(0,n.assert)(i===r.buffer.byteLength,`Incorrect offset after serialization, got ${i} but expected ${r.buffer.byteLength}`),[r,i]}}t.SerializationError=u,t.serializable=function(e,t){return function(r,n){const i=Reflect.getMetadata(s,r),o={propertyKey:n,size:e,options:t};i?i.push(o):Reflect.defineMetadata(s,[o],r)}},t.getSerializableProperties=a,t.byteSizeOfProp=function(e,t){var r,n,i,o;const s=null===(r=a(e))||void 0===r?void 0:r.find((e=>e.propertyKey===t));return(null===(n=null==s?void 0:s.options)||void 0===n?void 0:n.nullTerminated)||(null===(i=null==s?void 0:s.options)||void 0===i?void 0:i.terminator)?"dynamic":null!==(o=null==s?void 0:s.size)&&void 0!==o?o:0},t.byteSizeOfPropWithPadding=function(e,t){var r,n,i,o,s;const u=null===(r=a(e))||void 0===r?void 0:r.find((e=>e.propertyKey===t));return(null===(n=null==u?void 0:u.options)||void 0===n?void 0:n.nullTerminated)||(null===(i=null==u?void 0:u.options)||void 0===i?void 0:i.terminator)?"dynamic":u?u.size+(null!==(s=null===(o=u.options)||void 0===o?void 0:o.padding)&&void 0!==s?s:0):0},t.byteSizeOf=f,t.serialize=p,t.deserialize=function(e,t,r){return function(e,t,r){function n(e,t,r,n){if("boolean"!=typeof n||"number"!=typeof r&&"bigint"!=typeof r){if(typeof r!=typeof n)throw new u(`Type mismatch, deserialized a ${typeof r} but but expected a ${typeof n}`)}else r=Boolean(r);e[t.propertyKey]=r}let o=0;return c(e,((s,a)=>{var f,c,l,d,p,v,y,h,b,g,w;if((null==r?void 0:r.allowSkipLastProps)&&o===t.byteLength)return!1;if(!(null===(f=s.options)||void 0===f?void 0:f.nullTerminated)&&!(null===(c=s.options)||void 0===c?void 0:c.terminator)&&o+s.size>t.byteLength)throw new u(`Not enough bytes for deserializing \`${s.propertyKey}\` of size ${s.size}`);if(Array.isArray(e))throw new u("Array type not supported for deserialization");if("string"==typeof a){const r=t.byteOffset+o;if(!(null===(l=s.options)||void 0===l?void 0:l.nullTerminated)&&!(null===(d=s.options)||void 0===d?void 0:d.terminator)&&r+s.size>t.buffer.byteLength)throw new u(`Unexpected property size, got ${s.size} but there are only ${t.buffer.byteLength-r} left`);const f=t.buffer.slice(r,(null===(p=s.options)||void 0===p?void 0:p.nullTerminated)?function(e,t){for(let r=t;r<e.byteLength;++r)if(!e.getUint8(r))return r;throw new u("Data is not null terminated")}(t,o)-1:(null===(v=s.options)||void 0===v?void 0:v.terminator)?t.byteOffset+t.byteLength:r+s.size);try{n(e,s,(0,i.decodeUtf8)(new Uint8Array(f)),a)}catch(t){if(!(t instanceof i.DecodeUtf8Error))throw new u(null!==(y=null==t?void 0:t.message)&&void 0!==y?y:String(t));n(e,s,t.decodedString,a),console.warn(`Error decoding string for \`${s.propertyKey}\`: ${t}`)}o+=f.byteLength}else{const r="float"===(null===(h=s.options)||void 0===h?void 0:h.numberFormat),i="signed"===(null===(b=s.options)||void 0===b?void 0:b.numberFormat),f=function(e,t,r,n,i){switch(r){case 1:return n?e.getInt8(t):e.getUint8(t);case 2:return n?e.getInt16(t,!0):e.getUint16(t,!0);case 4:return i?e.getFloat32(t,!0):n?e.getInt32(t,!0):e.getUint32(t,!0);case 8:if(i)return e.getFloat64(t,!0);throw new u("BigInt not supported");default:throw new u(`Invalid property size, got ${r} but expected 1, 2, 4, or 8`)}}(t,o,s.size,i,r);n(e,s,f,a),o+=s.size}return o+=null!==(w=null===(g=s.options)||void 0===g?void 0:g.padding)&&void 0!==w?w:0,!0})),o}(e,t,r)}},605:(e,t,r)=>{var n;!function(e){!function(t){var n="object"==typeof globalThis?globalThis:"object"==typeof r.g?r.g:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(e){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(e){}}(),i=o(e);function o(e,t){return function(r,n){Object.defineProperty(e,r,{configurable:!0,writable:!0,value:n}),t&&t(r,n)}}void 0!==n.Reflect&&(i=o(n.Reflect,i)),function(e,t){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,i=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",s="function"==typeof Object.create,u={__proto__:[]}instanceof Array,a=!s&&!u,f={create:s?function(){return D(Object.create(null))}:u?function(){return D({__proto__:null})}:function(){return D({})},has:a?function(e,t){return r.call(e,t)}:function(e,t){return t in e},get:a?function(e,t){return r.call(e,t)?e[t]:void 0}:function(e,t){return e[t]}},c=Object.getPrototypeOf(Function),l="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:function(){var e={},t=[],r=function(){function e(e,t,r){this._index=0,this._keys=e,this._values=t,this._selector=r}return e.prototype["@@iterator"]=function(){return this},e.prototype[o]=function(){return this},e.prototype.next=function(){var e=this._index;if(e>=0&&e<this._keys.length){var r=this._selector(this._keys[e],this._values[e]);return e+1>=this._keys.length?(this._index=-1,this._keys=t,this._values=t):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},e.prototype.throw=function(e){throw this._index>=0&&(this._index=-1,this._keys=t,this._values=t),e},e.prototype.return=function(e){return this._index>=0&&(this._index=-1,this._keys=t,this._values=t),{value:e,done:!0}},e}();return function(){function t(){this._keys=[],this._values=[],this._cacheKey=e,this._cacheIndex=-2}return Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),t.prototype.has=function(e){return this._find(e,!1)>=0},t.prototype.get=function(e){var t=this._find(e,!1);return t>=0?this._values[t]:void 0},t.prototype.set=function(e,t){var r=this._find(e,!0);return this._values[r]=t,this},t.prototype.delete=function(t){var r=this._find(t,!1);if(r>=0){for(var n=this._keys.length,i=r+1;i<n;i++)this._keys[i-1]=this._keys[i],this._values[i-1]=this._values[i];return this._keys.length--,this._values.length--,F(t,this._cacheKey)&&(this._cacheKey=e,this._cacheIndex=-2),!0}return!1},t.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=e,this._cacheIndex=-2},t.prototype.keys=function(){return new r(this._keys,this._values,n)},t.prototype.values=function(){return new r(this._keys,this._values,i)},t.prototype.entries=function(){return new r(this._keys,this._values,s)},t.prototype["@@iterator"]=function(){return this.entries()},t.prototype[o]=function(){return this.entries()},t.prototype._find=function(e,t){if(!F(this._cacheKey,e)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(F(this._keys[r],e)){this._cacheIndex=r;break}}return this._cacheIndex<0&&t&&(this._cacheIndex=this._keys.length,this._keys.push(e),this._values.push(void 0)),this._cacheIndex},t}();function n(e,t){return e}function i(e,t){return t}function s(e,t){return[e,t]}}(),d="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:function(){function e(){this._map=new l}return Object.defineProperty(e.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),e.prototype.has=function(e){return this._map.has(e)},e.prototype.add=function(e){return this._map.set(e,e),this},e.prototype.delete=function(e){return this._map.delete(e)},e.prototype.clear=function(){this._map.clear()},e.prototype.keys=function(){return this._map.keys()},e.prototype.values=function(){return this._map.keys()},e.prototype.entries=function(){return this._map.entries()},e.prototype["@@iterator"]=function(){return this.keys()},e.prototype[o]=function(){return this.keys()},e}(),p="function"==typeof WeakMap?WeakMap:function(){var e=16,t=f.create(),n=i();return function(){function e(){this._key=i()}return e.prototype.has=function(e){var t=o(e,!1);return void 0!==t&&f.has(t,this._key)},e.prototype.get=function(e){var t=o(e,!1);return void 0!==t?f.get(t,this._key):void 0},e.prototype.set=function(e,t){return o(e,!0)[this._key]=t,this},e.prototype.delete=function(e){var t=o(e,!1);return void 0!==t&&delete t[this._key]},e.prototype.clear=function(){this._key=i()},e}();function i(){var e;do{e="@@WeakMap@@"+u()}while(f.has(t,e));return t[e]=!0,e}function o(e,t){if(!r.call(e,n)){if(!t)return;Object.defineProperty(e,n,{value:f.create()})}return e[n]}function s(e,t){for(var r=0;r<t;++r)e[r]=255*Math.random()|0;return e}function u(){var t=function(e){if("function"==typeof Uint8Array){var t=new Uint8Array(e);return"undefined"!=typeof crypto?crypto.getRandomValues(t):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(t):s(t,e),t}return s(new Array(e),e)}(e);t[6]=79&t[6]|64,t[8]=191&t[8]|128;for(var r="",n=0;n<e;++n){var i=t[n];4!==n&&6!==n&&8!==n||(r+="-"),i<16&&(r+="0"),r+=i.toString(16).toLowerCase()}return r}}(),v=n?Symbol.for("@reflect-metadata:registry"):void 0,y=function(){var e;return!M(v)&&k(t.Reflect)&&Object.isExtensible(t.Reflect)&&(e=t.Reflect[v]),M(e)&&(e=function(){var e,r,n,i;M(v)||void 0===t.Reflect||v in t.Reflect||"function"!=typeof t.Reflect.defineMetadata||(e=function(e){var t=e.defineMetadata,r=e.hasOwnMetadata,n=e.getOwnMetadata,i=e.getOwnMetadataKeys,o=e.deleteMetadata,s=new p;return{isProviderFor:function(e,t){var r=s.get(e);return!(M(r)||!r.has(t))||!!i(e,t).length&&(M(r)&&(r=new d,s.set(e,r)),r.add(t),!0)},OrdinaryDefineOwnMetadata:t,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:i,OrdinaryDeleteMetadata:o}}(t.Reflect));var o=new p,s={registerProvider:u,getProvider:f,setProvider:y};return s;function u(t){if(!Object.isExtensible(s))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case e===t:break;case M(r):r=t;break;case r===t:break;case M(n):n=t;break;case n===t:break;default:void 0===i&&(i=new d),i.add(t)}}function a(t,o){if(!M(r)){if(r.isProviderFor(t,o))return r;if(!M(n)){if(n.isProviderFor(t,o))return r;if(!M(i))for(var s=$(i);;){var u=C(s);if(!u)return;var a=U(u);if(a.isProviderFor(t,o))return R(s),a}}}if(!M(e)&&e.isProviderFor(t,o))return e}function f(e,t){var r,n=o.get(e);return M(n)||(r=n.get(t)),M(r)?(M(r=a(e,t))||(M(n)&&(n=new l,o.set(e,n)),n.set(t,r)),r):r}function c(e){if(M(e))throw new TypeError;return r===e||n===e||!M(i)&&i.has(e)}function y(e,t,r){if(!c(r))throw new Error("Metadata provider not registered.");var n=f(e,t);if(n!==r){if(!M(n))return!1;var i=o.get(e);M(i)&&(i=new l,o.set(e,i)),i.set(t,r)}return!0}}()),!M(v)&&k(t.Reflect)&&Object.isExtensible(t.Reflect)&&Object.defineProperty(t.Reflect,v,{enumerable:!1,configurable:!1,writable:!1,value:e}),e}(),h=function(e){var t=new p,r={isProviderFor:function(e,r){var n=t.get(e);return!M(n)&&n.has(r)},OrdinaryDefineOwnMetadata:function(e,t,r,i){n(r,i,!0).set(e,t)},OrdinaryHasOwnMetadata:function(e,t,r){var i=n(t,r,!1);return!M(i)&&T(i.has(e))},OrdinaryGetOwnMetadata:function(e,t,r){var i=n(t,r,!1);if(!M(i))return i.get(e)},OrdinaryOwnMetadataKeys:function(e,t){var r=[],i=n(e,t,!1);if(M(i))return r;for(var o=$(i.keys()),s=0;;){var u=C(o);if(!u)return r.length=s,r;var a=U(u);try{r[s]=a}catch(e){try{R(o)}finally{throw e}}s++}},OrdinaryDeleteMetadata:function(e,r,i){var o=n(r,i,!1);if(M(o))return!1;if(!o.delete(e))return!1;if(0===o.size){var s=t.get(r);M(s)||(s.delete(i),0===s.size&&t.delete(s))}return!0}};return y.registerProvider(r),r;function n(n,i,o){var s=t.get(n),u=!1;if(M(s)){if(!o)return;s=new l,t.set(n,s),u=!0}var a=s.get(i);if(M(a)){if(!o)return;if(a=new l,s.set(i,a),!e.setProvider(n,i,r))throw s.delete(i),u&&t.delete(n),new Error("Wrong provider for target.")}return a}}(y);function b(e,t,r){if(g(e,t,r))return!0;var n=K(t);return!j(n)&&b(e,n,r)}function g(e,t,r){var n=V(t,r,!1);return!M(n)&&T(n.OrdinaryHasOwnMetadata(e,t,r))}function w(e,t,r){if(g(e,t,r))return m(e,t,r);var n=K(t);return j(n)?void 0:w(e,n,r)}function m(e,t,r){var n=V(t,r,!1);if(!M(n))return n.OrdinaryGetOwnMetadata(e,t,r)}function _(e,t,r,n){V(r,n,!0).OrdinaryDefineOwnMetadata(e,t,r,n)}function O(e,t){var r=E(e,t),n=K(e);if(null===n)return r;var i=O(n,t);if(i.length<=0)return r;if(r.length<=0)return i;for(var o=new d,s=[],u=0,a=r;u<a.length;u++){var f=a[u];o.has(f)||(o.add(f),s.push(f))}for(var c=0,l=i;c<l.length;c++)f=l[c],o.has(f)||(o.add(f),s.push(f));return s}function E(e,t){var r=V(e,t,!1);return r?r.OrdinaryOwnMetadataKeys(e,t):[]}function x(e){if(null===e)return 1;switch(typeof e){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===e?1:6;default:return 6}}function M(e){return void 0===e}function j(e){return null===e}function k(e){return"object"==typeof e?null!==e:"function"==typeof e}function P(e,t){switch(x(e)){case 0:case 1:case 2:case 3:case 4:case 5:return e}var r=3===t?"string":5===t?"number":"default",n=I(e,i);if(void 0!==n){var o=n.call(e,r);if(k(o))throw new TypeError;return o}return function(e,t){if("string"===t){var r=e.toString;if(S(r)&&!k(i=r.call(e)))return i;if(S(n=e.valueOf)&&!k(i=n.call(e)))return i}else{var n;if(S(n=e.valueOf)&&!k(i=n.call(e)))return i;var i,o=e.toString;if(S(o)&&!k(i=o.call(e)))return i}throw new TypeError}(e,"default"===r?"number":r)}function T(e){return!!e}function L(e){var t=P(e,3);return"symbol"==typeof t?t:function(e){return""+e}(t)}function z(e){return Array.isArray?Array.isArray(e):e instanceof Object?e instanceof Array:"[object Array]"===Object.prototype.toString.call(e)}function S(e){return"function"==typeof e}function A(e){return"function"==typeof e}function F(e,t){return e===t||e!=e&&t!=t}function I(e,t){var r=e[t];if(null!=r){if(!S(r))throw new TypeError;return r}}function $(e){var t=I(e,o);if(!S(t))throw new TypeError;var r=t.call(e);if(!k(r))throw new TypeError;return r}function U(e){return e.value}function C(e){var t=e.next();return!t.done&&t}function R(e){var t=e.return;t&&t.call(e)}function K(e){var t=Object.getPrototypeOf(e);if("function"!=typeof e||e===c)return t;if(t!==c)return t;var r=e.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return t;var i=n.constructor;return"function"!=typeof i||i===e?t:i}function V(e,t,r){var n=y.getProvider(e,t);if(!M(n))return n;if(r){if(y.setProvider(e,t,h))return h;throw new Error("Illegal state.")}}function D(e){return e.__=void 0,delete e.__,e}e("decorate",(function(e,t,r,n){if(M(r)){if(!z(e))throw new TypeError;if(!A(t))throw new TypeError;return function(e,t){for(var r=e.length-1;r>=0;--r){var n=(0,e[r])(t);if(!M(n)&&!j(n)){if(!A(n))throw new TypeError;t=n}}return t}(e,t)}if(!z(e))throw new TypeError;if(!k(t))throw new TypeError;if(!k(n)&&!M(n)&&!j(n))throw new TypeError;return j(n)&&(n=void 0),function(e,t,r,n){for(var i=e.length-1;i>=0;--i){var o=(0,e[i])(t,r,n);if(!M(o)&&!j(o)){if(!k(o))throw new TypeError;n=o}}return n}(e,t,r=L(r),n)})),e("metadata",(function(e,t){return function(r,n){if(!k(r))throw new TypeError;if(!M(n)&&!function(e){switch(x(e)){case 3:case 4:return!0;default:return!1}}(n))throw new TypeError;_(e,t,r,n)}})),e("defineMetadata",(function(e,t,r,n){if(!k(r))throw new TypeError;return M(n)||(n=L(n)),_(e,t,r,n)})),e("hasMetadata",(function(e,t,r){if(!k(t))throw new TypeError;return M(r)||(r=L(r)),b(e,t,r)})),e("hasOwnMetadata",(function(e,t,r){if(!k(t))throw new TypeError;return M(r)||(r=L(r)),g(e,t,r)})),e("getMetadata",(function(e,t,r){if(!k(t))throw new TypeError;return M(r)||(r=L(r)),w(e,t,r)})),e("getOwnMetadata",(function(e,t,r){if(!k(t))throw new TypeError;return M(r)||(r=L(r)),m(e,t,r)})),e("getMetadataKeys",(function(e,t){if(!k(e))throw new TypeError;return M(t)||(t=L(t)),O(e,t)})),e("getOwnMetadataKeys",(function(e,t){if(!k(e))throw new TypeError;return M(t)||(t=L(t)),E(e,t)})),e("deleteMetadata",(function(e,t,r){if(!k(t))throw new TypeError;if(M(r)||(r=L(r)),!k(t))throw new TypeError;M(r)||(r=L(r));var n=V(t,r,!1);return!M(n)&&n.OrdinaryDeleteMetadata(e,t,r)}))}(i,n),void 0===n.Reflect&&(n.Reflect=e)}()}(n||(n={}))}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}return r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r(368)})()));
{
"name": "@systemic-games/pixels-core-utils",
"version": "1.2.0",
"version": "1.2.2",
"description": "Core classes and functions used throughout the TypeScript Pixels packages.",

@@ -53,3 +53,3 @@ "main": "dist/cjs/index",

"events": "^3.3.0",
"reflect-metadata": "^0.1.13"
"reflect-metadata": "^0.2.1"
},

@@ -56,0 +56,0 @@ "devDependencies": {

@@ -15,9 +15,10 @@ import { EventEmitter } from "events";

* for the event of the given type.
* @param eventType The type of the event.
* @param type A case-sensitive string representing the event type to listen for.
* @param listener The callback function.
* @returns A reference to the `EventEmitter`.
*/
addListener<K extends EventKey<T>>(
eventType: K,
type: K,
listener: EventReceiver<T[K]>
): void;
): this;

@@ -27,24 +28,36 @@ /**

* for the event of the given type.
* @param eventType The type of the event.
* @param type A case-sensitive string representing the event type.
* @param listener The callback function to unregister.
* @returns A reference to the `EventEmitter`.
*/
removeListener<K extends EventKey<T>>(
eventType: K,
type: K,
listener: EventReceiver<T[K]>
): void;
): this;
/**
* Synchronously calls each of the listeners registered for the event named`eventName`, in the order they were registered, passing the supplied arguments
* with the given name.
* @param eventName The name of the event.
* Synchronously calls each of the listeners registered for the given
* event type, in the order they were registered, passing the supplied
* arguments.
* @param type A case-sensitive string representing the event type.
* @param params Optional parameters.
* @returns Whether the event had listeners.
*/
emit<K extends EventKey<T>>(eventName: K, params: T[K]): void;
emit<K extends EventKey<T>>(type: K, params: T[K]): boolean;
/**
* By default `EventEmitter`s will print a warning if more than `10` listeners are
* added for a particular event.
* Returns the number of listeners for the event of the given type.
* @param type A case-sensitive string representing the event type.
* @returns The number of listeners.
*/
listenerCount<K extends EventKey<T>>(type: K): number;
/**
* By default `EventEmitter`s will print a warning if more than 10
* listeners are added for a particular event.
* Use this function to modify the default threshold.
* @param n Number of listeners before printing a warning.
* The value can be set to`Infinity` (or `0`) to indicate an unlimited number of listeners.
* The value can be set to`Infinity` (or `0`) to indicate
* an unlimited number of listeners.
* @returns A reference to the `EventEmitter`.
*/

@@ -54,3 +67,3 @@ setMaxListeners(n: number): this;

/**
* Returns the current max listener value for this `EventEmitter`.
* Gets the current max listener value for this `EventEmitter`.
*/

@@ -57,0 +70,0 @@ getMaxListeners(): number;

@@ -9,7 +9,7 @@ /**

*/
export function keysToValues<V>(
export function keysToValues<T>(
keys: string[],
keyValues: { [key: string]: V },
onMissingKey?: (key: string) => V
): V[] {
keyValues: { [key: string]: T },
onMissingKey?: (key: string) => T
): T[] {
return keys.map((key) => {

@@ -35,21 +35,19 @@ const v = keyValues[key];

*/
export function valuesToKeys<V, T extends { [key: string]: V }>(
values: V[],
keyValues: T,
onMissingKey?: (value: V) => string
): (keyof T)[] {
const valueToKey = new Map<V, string>();
for (const e of Object.entries(keyValues)) {
valueToKey.set(e[1], e[0]);
}
return values.map((value) => {
const k = valueToKey.get(value);
export function valuesToKeys<T, KeyValuesType extends { [key: string]: T }>(
values: T[],
keyValues: KeyValuesType,
onMissingKey?: (value: T) => string
): (keyof KeyValuesType)[] {
const ret: (keyof KeyValuesType)[] = [];
for (const value of values) {
const k = getValueKeyName(value, keyValues);
if (k !== undefined) {
return k;
ret.push(k);
} else if (onMissingKey) {
return onMissingKey(value);
ret.push(onMissingKey(value));
} else {
throw new Error(`valuesToKeys: Missing key for value ${value}`);
}
});
}
return ret;
}

@@ -56,0 +54,0 @@

@@ -16,3 +16,3 @@ /**

*/
run(promise: () => Promise<void>): Promise<void> {
run(promise: () => Promise<void> | void): Promise<void> {
// Create a new promise to be returned

@@ -19,0 +19,0 @@ return new Promise<void>((resolve, reject) => {

@@ -8,3 +8,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

const serializableKey = Symbol("pixelAnimationSerializable");
const serializableKey = Symbol.for("PixelsAnimationSerializable");

@@ -11,0 +11,0 @@ /** Error thrown during (de)serialization. */

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc