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AU,CAAC;yBAC3F,CAAC;oBAET,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACN,MAAM,CAAC,SAAS,CAAC,QAAkB,EAAE,KAAe,CAAM,CAAC;oBAC7D,CAAC;gBACH,CAAC,EACD,MAAM,EAAE;oBACN,KAAK,EAAE,MAAM;iBACd,IACE,kBAAkB,EACrB,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC\"}","code":"/** @license\r\n *  Copyright 2016 - present The Material Motion Authors. All Rights Reserved.\r\n *\r\n *  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n *  use this file except in compliance with the License. You may obtain a copy\r\n *  of the License at\r\n *\r\n *      http://www.apache.org/licenses/LICENSE-2.0\r\n *\r\n *  Unless required by applicable law or agreed to in writing, software\r\n *  distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n *  License for the specific language governing permissions and limitations\r\n *  under the License.\r\n */\r\nimport * as tslib_1 from \"tslib\";\r\nimport { isDefined, isDimensions, isPoint2D, } from '../../typeGuards';\r\nexport function withMathOperator(superclass) {\r\n    return class extends superclass {\r\n        /**\r\n         * Applies the operation to each dimension and emits the result.\r\n         */\r\n        _mathOperator(_a) {\r\n            var { operation, value$ } = _a, reactiveMapOptions = tslib_1.__rest(_a, [\"operation\", \"value$\"]);\r\n            return this._reactiveMap(Object.assign({ transform: ({ upstream, value }) => {\r\n                    if (isPoint2D(upstream)) {\r\n                        return {\r\n                            x: operation(upstream.x, isDefined(value) ? value.x : undefined),\r\n                            y: operation(upstream.y, isDefined(value) ? value.y : undefined),\r\n                        };\r\n                        // This block is just copy/pasted from the isPoint2D block.  It may\r\n                        // eventually be worth making this smart enough to handle arbitrarily-\r\n                        // shaped objects, but for now, we can cover most cases with just\r\n                        // these two shapes.\r\n                    }\r\n                    else if (isDimensions(upstream)) {\r\n                        return {\r\n                            width: operation(upstream.width, isDefined(value) ? value.width : undefined),\r\n                            height: operation(upstream.height, isDefined(value) ? value.height : undefined),\r\n                        };\r\n                    }\r\n                    else {\r\n                        return operation(upstream, value);\r\n                    }\r\n                }, inputs: {\r\n                    value: value$,\r\n                } }, reactiveMapOptions));\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=_mathOperator.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/operators/foundation/_mathOperator.d.ts","text":"import { Constructor, Dimensions, MathOperation, MotionReactiveMappable, Observable, ObservableWithMotionOperators, Point2D } from '../../types';\r\nimport { _ReactiveMapOptions } from './_reactiveMap';\r\nexport declare type _MathOperatorArgs<U> = _ReactiveMapOptions & {\r\n    operation: MathOperation;\r\n    value$: U | Observable<U>;\r\n};\r\nexport interface MotionMathOperable<T> {\r\n    _mathOperator<U extends T & (number | Point2D | Dimensions)>(kwargs: _MathOperatorArgs<U>): ObservableWithMotionOperators<U>;\r\n}\r\nexport declare function withMathOperator<T, S extends Constructor<MotionReactiveMappable<T>>>(superclass: S): S & Constructor<MotionMathOperable<T>>;\r\n"}}
