// Metro module 366 (f367). import _classCallCheck from "./_classCallCheck"; import _createClass from "./_createClass"; import _possibleConstructorReturn from "./_possibleConstructorReturn"; import _getPrototypeOf from "./_getPrototypeOf"; import _get from "./_get"; import _inherits from "./_inherits"; import Module357 from "./Module357"; import AnimatedNode from "./AnimatedNode"; function $mk66269($env) { return function(a0) { const r0 = $env; return r0[1].apply(r0[0], a0); }; } let connectAnimatedNodes, disconnectAnimatedNodes; let AnimatedWithChildren; let env380 = {}; env380[4] = function _isNativeReflectConstruct() { let c12281_0; try { c12281_0 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); } catch ($e) {} const _isNativeReflectConstruct2 = function _isNativeReflectConstruct() { return !!c12281_0; }; env380[4] = _isNativeReflectConstruct2; return _isNativeReflectConstruct2(); }; connectAnimatedNodes = Module357.API.connectAnimatedNodes; disconnectAnimatedNodes = Module357.API.disconnectAnimatedNodes; AnimatedWithChildren = function AnimatedWithChildren(...args) { _classCallCheck(this, AnimatedWithChildren); const r9 = [...args]; const r8 = _getPrototypeOf(AnimatedWithChildren); const r26 = _possibleConstructorReturn(this, (0, env380[4])() ? Reflect.construct(r8, r9, _getPrototypeOf(this).constructor) : r8.apply(this, r9)); r26._children = []; return r26; }; _inherits(AnimatedWithChildren, AnimatedNode); export default _createClass(AnimatedWithChildren, [{ key: "__makeNative", value: function __makeNative(a0) { if (!this.__isNative) { this.__isNative = true; const _children = this._children; const length = _children.length; if (length > 0) { const r4 = 0 < length; let r16 = 0; if (r4) { do { const r13 = _children[r16]; r13.__makeNative(a0); connectAnimatedNodes(this.__getNativeTag(), r13.__getNativeTag()); r16 = r16 + 1; } while (r16 < length); } } } let env23706; const r25 = env23706 = {}; env23706[0] = this; let r32 = _get(_getPrototypeOf(AnimatedWithChildren.prototype), "__makeNative", this); env23706[1] = r32; if (typeof r32 === "function") { r32 = $mk66269(r25); } r32([a0]); } }, { key: "__addChild", value: function __addChild(a0) { if (this._children.length === 0) { this.__attach(); } this._children.push(a0); if (this.__isNative) { a0.__makeNative(this.__getPlatformConfig()); connectAnimatedNodes(this.__getNativeTag(), a0.__getNativeTag()); } } }, { key: "__removeChild", value: function __removeChild(a0) { const r5 = this._children.indexOf(a0); if (r5 !== -1) { if (this.__isNative && a0.__isNative) { disconnectAnimatedNodes(this.__getNativeTag(), a0.__getNativeTag()); } this._children.splice(r5, 1); if (this._children.length === 0) { this.__detach(); } } else { console.warn("Trying to remove a child that doesn't exist"); } } }, { key: "__getChildren", value: function __getChildren() { return this._children; } }, { key: "__callListeners", value: function __callListeners(a0) { let env23707; const r10 = env23707 = {}; env23707[0] = this; let r15 = _get(_getPrototypeOf(AnimatedWithChildren.prototype), "__callListeners", this); env23707[1] = r15; if (typeof r15 === "function") { r15 = $mk66269(r10); } r15([a0]); if (!this.__isNative) { const _children = this._children; const length = _children.length; let r0 = 0; while (r0 < length) { const r22 = _children[r0]; const __getValue = r22.__getValue; const r1 = r0; if (__getValue) { r22.__callListeners(r22.__getValue()); } r0 = r1 + 1; } } } }]);