{"map":"{\"version\":3,\"file\":\"clampTo.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/operators/clampTo.ts\"],\"names\":[],\"mappings\":\"AAAA;;;;;;;;;;;;;;GAcG;AAWH,OAAO,EACL,SAAS,GACV,MAAM,eAAe,CAAC;AAmBvB,MAAM,sBAAuE,UAAa;IACxF,MAAM,CAAC,KAAM,SAAQ,UAAU;QAC7B,OAAO,CAAmC,EAAE,IAAI,EAAE,IAAI,EAAgB;YACpE,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC;gBACxB,SAAS,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC;sBACxC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC;sBACvB,QAAQ;gBACZ,MAAM,EAAE,IAAqB;aAE9B,CAAC,CAAC,aAAa,CAAC;gBACf,SAAS,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,SAAS,CAAC,GAAG,CAAC;sBACxC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC;sBACvB,QAAQ;gBACZ,MAAM,EAAE,IAAqB;aAC9B,CAAC,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 { isDefined, } from '../typeGuards';\r\nexport function withClampTo(superclass) {\r\n    return class extends superclass {\r\n        clampTo({ min$, max$ }) {\r\n            return this._mathOperator({\r\n                operation: (upstream, min) => isDefined(min)\r\n                    ? Math.max(upstream, min)\r\n                    : upstream,\r\n                value$: min$,\r\n            })._mathOperator({\r\n                operation: (upstream, max) => isDefined(max)\r\n                    ? Math.min(upstream, max)\r\n                    : upstream,\r\n                value$: max$,\r\n            });\r\n        }\r\n    };\r\n}\r\n//# sourceMappingURL=clampTo.js.map","dts":{"name":"/Users/brentons/Projects/material-motion-js/packages/core/operators/clampTo.d.ts","text":"/** @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 { Constructor, MaybeReactive, MotionMathOperable, ObservableWithMotionOperators, Point2D } from '../types';\r\nexport declare type ClampArgs<U> = Partial<MaybeReactive<{\r\n    min$: U;\r\n    max$: U;\r\n}>>;\r\nexport interface MotionClampable<T> {\r\n    clampTo<U extends T & number>(kwargs: ClampArgs<U>): ObservableWithMotionOperators<number>;\r\n    clampTo<U extends T & Point2D>(kwargs: ClampArgs<U>): ObservableWithMotionOperators<U>;\r\n}\r\nexport declare function withClampTo<T, S extends Constructor<MotionMathOperable<T>>>(superclass: S): S & Constructor<MotionClampable<T>>;\r\n"}}
