310 lines
13 KiB
JavaScript
310 lines
13 KiB
JavaScript
// Metro module 1636 (f1637).
|
|
import _slicedToArray from "./_slicedToArray";
|
|
import * as _Module1609 from "./Module1609";
|
|
import { shareableMappingCache, shareableMappingFlag } from "./Module1637";
|
|
import * as _Module1617 from "./Module1617";
|
|
import { isWorkletFunction } from "./Module1631";
|
|
import { WorkletsModule } from "./Module1622";
|
|
let shouldBeUseWeb, c1294_5, isHostObject, c1294_7, c1294_8, _excluded, makeShareableCloneRecursiveWeb2, __initData, __initData2, __initData3, __initData4, isRemoteFunction, __initData5;
|
|
const freezeObjectInDev = function freezeObjectInDev(a0) {};
|
|
shouldBeUseWeb = _Module1609.shouldBeUseWeb();
|
|
c1294_5 = "REANIMATED_MAGIC_KEY";
|
|
const isHostObject2 = function isHostObject(a0) {
|
|
return c1294_5 in a0;
|
|
};
|
|
isHostObject2.__closure = {
|
|
MAGIC_KEY: "REANIMATED_MAGIC_KEY"
|
|
};
|
|
isHostObject2.__workletHash = 10372729533958;
|
|
isHostObject2.__initData = {
|
|
code: "function isHostObject_Pnpm_shareablesTs1(value){const{MAGIC_KEY}=this.__closure;return MAGIC_KEY in value;}"
|
|
};
|
|
isHostObject = isHostObject2;
|
|
const __init = function u() {
|
|
return new Proxy({}, {
|
|
get: (a0, a1) => {
|
|
if (a1 !== "_isReanimatedSharedValue" && a1 !== "__remoteFunction") {
|
|
throw new _Module1617.ReanimatedError(`Trying to access property \`${String(a1)}\` of an object which cannot be sent to the UI runtime.`);
|
|
}
|
|
return false;
|
|
},
|
|
set: () => {
|
|
throw new _Module1617.ReanimatedError("Trying to write to an object which cannot be sent to the UI runtime.");
|
|
}
|
|
});
|
|
};
|
|
__init.__closure = {};
|
|
__init.__workletHash = 15880119471501;
|
|
__init.__initData = {
|
|
code: "function pnpm_shareablesTs2(){return new Proxy({},{get:function(_,prop){if(prop==='_isReanimatedSharedValue'||prop==='__remoteFunction'){return false;}throw new ReanimatedError(\"Trying to access property `\"+String(prop)+\"` of an object which cannot be sent to the UI runtime.\");},set:function(){throw new ReanimatedError('Trying to write to an object which cannot be sent to the UI runtime.');}});}"
|
|
};
|
|
c1294_8 = {
|
|
__init
|
|
};
|
|
_excluded = ["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array", "BigInt64Array", "BigUint64Array", "DataView"];
|
|
makeShareableCloneRecursiveWeb2 = shouldBeUseWeb ? function makeShareableCloneRecursiveWeb(a0) {
|
|
return a0;
|
|
} : function makeShareableCloneRecursiveNative(a0, r6 = false, r11 = 0) {
|
|
let r48, r94;
|
|
if (r11 >= 30) {
|
|
if (r11 === 30) {
|
|
c1294_7 = a0;
|
|
} else if (a0 === c1294_7) {
|
|
throw new _Module1617.ReanimatedError("Trying to convert a cyclic object to a shareable. This is not supported.");
|
|
}
|
|
} else {
|
|
c1294_7 = void 0;
|
|
}
|
|
if (!(typeof a0 !== "object" && typeof a0 !== "function") && a0 !== null) {
|
|
let r33 = shareableMappingCache.get(a0);
|
|
if (r33 === shareableMappingFlag) {
|
|
r33 = a0;
|
|
}
|
|
if (r33 === void 0) {
|
|
L53: {
|
|
if (Array.isArray(a0)) {
|
|
let c13137_0 = r6;
|
|
let c13137_1 = r11;
|
|
const r199 = WorkletsModule.makeShareableClone(a0.map((item) => makeShareableCloneRecursiveWeb2(item, c13137_0, c13137_1 + 1)), r6, a0);
|
|
shareableMappingCache.set(a0, r199);
|
|
shareableMappingCache.set(r199);
|
|
r48 = r199;
|
|
} else {
|
|
if (typeof a0 === "function" && !isWorkletFunction(a0)) {
|
|
r48 = WorkletsModule.makeShareableClone(a0, r6, a0);
|
|
shareableMappingCache.set(a0, r48);
|
|
shareableMappingCache.set(r48);
|
|
break L53;
|
|
}
|
|
L50: {
|
|
if (c1294_5 in a0) {
|
|
const r180 = WorkletsModule.makeShareableClone(a0, r6, a0);
|
|
shareableMappingCache.set(a0, r180);
|
|
shareableMappingCache.set(r180);
|
|
r94 = r180;
|
|
} else {
|
|
if (Object.getPrototypeOf(a0) === Object.prototype && a0.__workletContextObjectFactory) {
|
|
const __workletContextObjectFactory = a0.__workletContextObjectFactory;
|
|
const c = function c() {
|
|
return __workletContextObjectFactory();
|
|
};
|
|
c.__closure = {
|
|
workletContextObjectFactory: __workletContextObjectFactory
|
|
};
|
|
c.__workletHash = 16264240301234;
|
|
c.__initData = __initData;
|
|
const r170 = makeShareableCloneRecursiveWeb2({
|
|
__init: c
|
|
});
|
|
shareableMappingCache.set(a0, r170);
|
|
r94 = r170;
|
|
break L50;
|
|
}
|
|
if (!(Object.getPrototypeOf(a0) !== Object.prototype && typeof a0 !== "function") && isWorkletFunction(a0)) {
|
|
r94 = (function cloneWorklet(a0, a1, a2) {
|
|
if (a0.__stackDetails) {
|
|
delete a0["__stackDetails"];
|
|
}
|
|
const r8 = {
|
|
__initData: makeShareableCloneRecursiveWeb2(a0.__initData, true, a2 + 1)
|
|
};
|
|
for (const item of Object.entries(a0)) {
|
|
const [r46, r48] = item;
|
|
if (!(r46 === "__initData" && r8.__initData !== void 0)) {
|
|
r8[r46] = makeShareableCloneRecursiveWeb2(r48, a1, a2 + 1);
|
|
}
|
|
}
|
|
const r61 = WorkletsModule.makeShareableClone(r8, true, a0);
|
|
shareableMappingCache.set(a0, r61);
|
|
shareableMappingCache.set(r61);
|
|
freezeObjectInDev(0);
|
|
return r61;
|
|
})(a0, r6, r11);
|
|
break L50;
|
|
}
|
|
if (Object.getPrototypeOf(a0) !== Object.prototype && typeof a0 !== "function") {
|
|
if (a0 instanceof RegExp) {
|
|
const { source, flags } = a0;
|
|
const __init3 = function() {
|
|
return new RegExp(source, flags);
|
|
};
|
|
__init3.__closure = {
|
|
pattern: source,
|
|
flags
|
|
};
|
|
__init3.__workletHash = 17343605339188;
|
|
__init3.__initData = __initData2;
|
|
const r152 = makeShareableCloneRecursiveWeb2({
|
|
__init: __init3
|
|
});
|
|
shareableMappingCache.set(a0, r152);
|
|
r94 = r152;
|
|
break L50;
|
|
}
|
|
if (a0 instanceof Error) {
|
|
const { name: name2, message, stack } = a0;
|
|
const __init2 = function u() {
|
|
const error = new Error();
|
|
error.name = name2;
|
|
error.message = message;
|
|
error.stack = stack;
|
|
return error;
|
|
};
|
|
__init2.__closure = {
|
|
name: name2,
|
|
message,
|
|
stack
|
|
};
|
|
__init2.__workletHash = 1273124072033;
|
|
__init2.__initData = __initData3;
|
|
const r137 = makeShareableCloneRecursiveWeb2({
|
|
__init: __init2
|
|
});
|
|
shareableMappingCache.set(a0, r137);
|
|
r94 = r137;
|
|
break L50;
|
|
}
|
|
if (a0 instanceof ArrayBuffer) {
|
|
const r116 = WorkletsModule.makeShareableClone(a0, r6, a0);
|
|
shareableMappingCache.set(a0, r116);
|
|
shareableMappingCache.set(r116);
|
|
r94 = r116;
|
|
break L50;
|
|
}
|
|
if (ArrayBuffer.isView(a0)) {
|
|
const buffer = a0.buffer;
|
|
const name = a0.constructor.name;
|
|
const __init = function() {
|
|
if (_excluded.includes(name)) {
|
|
const r24 = global[name];
|
|
if (r24 === void 0) {
|
|
throw new _Module1617.ReanimatedError(`[Reanimated] Constructor for \`${name}\` not found.`);
|
|
}
|
|
return new r24(buffer);
|
|
}
|
|
throw new _Module1617.ReanimatedError(`[Reanimated] Invalid array view name \`${name}\`.`);
|
|
};
|
|
__init.__closure = {
|
|
VALID_ARRAY_VIEWS_NAMES: _excluded,
|
|
typeName: name,
|
|
buffer
|
|
};
|
|
__init.__workletHash = 2440560686150;
|
|
__init.__initData = __initData4;
|
|
const r106 = makeShareableCloneRecursiveWeb2({
|
|
__init
|
|
});
|
|
shareableMappingCache.set(a0, r106);
|
|
r94 = r106;
|
|
break L50;
|
|
}
|
|
r94 = makeShareableCloneRecursiveWeb2(c1294_8);
|
|
shareableMappingCache.set(a0, r94);
|
|
break L50;
|
|
}
|
|
r94 = (function clonePlainJSObject(a0, a1, a2) {
|
|
const r6 = {};
|
|
for (const item of Object.entries(a0)) {
|
|
const [r38, r40] = item;
|
|
if (!(r38 === "__initData" && r6.__initData !== void 0)) {
|
|
r6[r38] = makeShareableCloneRecursiveWeb2(r40, a1, a2 + 1);
|
|
}
|
|
}
|
|
const r53 = WorkletsModule.makeShareableClone(r6, a1, a0);
|
|
shareableMappingCache.set(a0, r53);
|
|
shareableMappingCache.set(r53);
|
|
freezeObjectInDev(0);
|
|
return r53;
|
|
})(a0, r6, r11);
|
|
}
|
|
}
|
|
r48 = r94;
|
|
}
|
|
}
|
|
r33 = r48;
|
|
}
|
|
return r33;
|
|
}
|
|
return WorkletsModule.makeShareableClone(a0, r6);
|
|
};
|
|
__initData = {
|
|
code: "function pnpm_shareablesTs3(){const{workletContextObjectFactory}=this.__closure;return workletContextObjectFactory();}"
|
|
};
|
|
__initData2 = {
|
|
code: "function pnpm_shareablesTs4(){const{pattern,flags}=this.__closure;return new RegExp(pattern,flags);}"
|
|
};
|
|
__initData3 = {
|
|
code: "function pnpm_shareablesTs5(){const{name,message,stack}=this.__closure;const error=new Error();error.name=name;error.message=message;error.stack=stack;return error;}"
|
|
};
|
|
__initData4 = {
|
|
code: "function pnpm_shareablesTs6(){const{VALID_ARRAY_VIEWS_NAMES,typeName,buffer}=this.__closure;if(!VALID_ARRAY_VIEWS_NAMES.includes(typeName)){throw new ReanimatedError(\"[Reanimated] Invalid array view name `\"+typeName+\"`.\");}const constructor=global[typeName];if(constructor===undefined){throw new ReanimatedError(\"[Reanimated] Constructor for `\"+typeName+\"` not found.\");}return new constructor(buffer);}"
|
|
};
|
|
const isRemoteFunction2 = function isRemoteFunction(a0) {
|
|
return !!a0.__remoteFunction;
|
|
};
|
|
isRemoteFunction2.__closure = {};
|
|
isRemoteFunction2.__workletHash = 12817663616448;
|
|
isRemoteFunction2.__initData = {
|
|
code: "function isRemoteFunction_Pnpm_shareablesTs7(value){return!!value.__remoteFunction;}"
|
|
};
|
|
isRemoteFunction = isRemoteFunction2;
|
|
export function makeShareableCloneOnUIRecursive(a0) {
|
|
if (shouldBeUseWeb) {
|
|
return a0;
|
|
}
|
|
const cloneRecursive2 = function cloneRecursive(a0) {
|
|
if (!(typeof a0 === "object" && a0 !== null) && typeof a0 !== "function") {
|
|
return global._makeShareableClone(a0, void 0);
|
|
}
|
|
if (isHostObject(a0)) {
|
|
return global._makeShareableClone(a0, void 0);
|
|
}
|
|
if (isRemoteFunction(a0)) {
|
|
return a0.__remoteFunction;
|
|
}
|
|
if (Array.isArray(a0)) {
|
|
return global._makeShareableClone(a0.map(cloneRecursive2), void 0);
|
|
}
|
|
const r34 = {};
|
|
for (const item of Object.entries(a0)) {
|
|
const r43 = _slicedToArray(item, 2);
|
|
r34[r43[0]] = cloneRecursive2(r43[1]);
|
|
}
|
|
return global._makeShareableClone(r34, a0);
|
|
};
|
|
return cloneRecursive2(a0);
|
|
}
|
|
makeShareableCloneOnUIRecursive.__closure = {
|
|
SHOULD_BE_USE_WEB: shouldBeUseWeb,
|
|
isHostObject,
|
|
isRemoteFunction
|
|
};
|
|
makeShareableCloneOnUIRecursive.__workletHash = 10912061747670;
|
|
makeShareableCloneOnUIRecursive.__initData = {
|
|
code: "function makeShareableCloneOnUIRecursive_Pnpm_shareablesTs8(value){const{SHOULD_BE_USE_WEB,isHostObject,isRemoteFunction}=this.__closure;if(SHOULD_BE_USE_WEB){return value;}function cloneRecursive(value){if(typeof value==='object'&&value!==null||typeof value==='function'){if(isHostObject(value)){return global._makeShareableClone(value,undefined);}if(isRemoteFunction(value)){return value.__remoteFunction;}if(Array.isArray(value)){return global._makeShareableClone(value.map(cloneRecursive),undefined);}const toAdapt={};for(const[key,element]of Object.entries(value)){toAdapt[key]=cloneRecursive(element);}return global._makeShareableClone(toAdapt,value);}return global._makeShareableClone(value,undefined);}return cloneRecursive(value);}"
|
|
};
|
|
__initData5 = {
|
|
code: "function pnpm_shareablesTs9(){const{value}=this.__closure;return value;}"
|
|
};
|
|
const r45 = shouldBeUseWeb ? function makeShareableJS(a0) {
|
|
return a0;
|
|
} : function makeShareableNative(a0) {
|
|
if (shareableMappingCache.get(a0)) {
|
|
return a0;
|
|
}
|
|
const n = function n() {
|
|
return a0;
|
|
};
|
|
n.__closure = {
|
|
value: a0
|
|
};
|
|
n.__workletHash = 5731865988281;
|
|
n.__initData = __initData5;
|
|
shareableMappingCache.set(a0, makeShareableCloneRecursiveWeb2({
|
|
__init: n
|
|
}));
|
|
return a0;
|
|
};
|
|
export { makeShareableCloneRecursiveWeb2 as makeShareableCloneRecursive };
|
|
export { r45 as makeShareable };
|