import{progress as r}from"./progress.js";import{mix as t}from"./mix.js";import{mixColor as e}from"./mix-color.js";import{mixComplex as n,mixArray as o,mixObject as i}from"./mix-complex.js";import{clamp as s}from"./clamp.js";import{pipe as a}from"./pipe.js";import{invariant as u}from"../../../../hey-listen/dist/hey-listen.es.js";import{color as f}from"../../../../style-value-types/dist/es/color/index.js";var m=function(r,e){return function(n){return t(r,e,n)}};function p(r,t,s){for(var u,p=[],c=s||("number"==typeof(u=r[0])?m:"string"==typeof u?f.test(u)?e:n:Array.isArray(u)?o:"object"==typeof u?i:void 0),l=r.length-1,v=0;v<l;v++){var h=c(r[v],r[v+1]);if(t){var y=Array.isArray(t)?t[v]:t;h=a(y,h)}p.push(h)}return p}function c(t,e,n){var o=void 0===n?{}:n,i=o.clamp,a=void 0===i||i,f=o.ease,m=o.mixer,c=t.length;u(c===e.length,"Both input and output ranges must be the same length"),u(!f||!Array.isArray(f)||f.length===c-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[c-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var l=p(e,f,m),v=2===c?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(r(n,o,t))}}(t,l):function(t,e){var n=t.length,o=n-1;return function(i){var s=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(s=o-1,a=!0),!a){for(var u=1;u<n&&!(t[u]>i||u===o);u++);s=u-1}var f=r(t[s],t[s+1],i);return e[s](f)}}(t,l);return a?function(r){return v(s(t[0],t[c-1],r))}:v}export{c as interpolate};
//# sourceMappingURL=interpolate.js.map
