import{r as D,c as I}from"./d3-color.js";const q=n=>()=>n;function G(n,t){return function(e){return n+e*t}}function K(n,t,e){return n=Math.pow(n,e),t=Math.pow(t,e)-n,e=1/e,function(o){return Math.pow(n+o*t,e)}}function W(n){return(n=+n)==1?V:function(t,e){return e-t?K(t,e,n):q(isNaN(t)?e:t)}}function V(n,t){var e=t-n;return e?G(n,e):q(isNaN(n)?t:n)}const z=function n(t){var e=W(t);function o(r,a){var i=e((r=D(r)).r,(a=D(a)).r),s=e(r.g,a.g),h=e(r.b,a.b),u=V(r.opacity,a.opacity);return function(f){return r.r=i(f),r.g=s(f),r.b=h(f),r.opacity=u(f),r+""}}return o.gamma=n,o}(1);function Z(n,t){t||(t=[]);var e=n?Math.min(t.length,n.length):0,o=t.slice(),r;return function(a){for(r=0;r<e;++r)o[r]=n[r]*(1-a)+t[r]*a;return o}}function $(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function F(n,t){var e=t?t.length:0,o=n?Math.min(e,n.length):0,r=new Array(o),a=new Array(e),i;for(i=0;i<o;++i)r[i]=_(n[i],t[i]);for(;i<e;++i)a[i]=t[i];return function(s){for(i=0;i<o;++i)a[i]=r[i](s);return a}}function H(n,t){var e=new Date;return n=+n,t=+t,function(o){return e.setTime(n*(1-o)+t*o),e}}function M(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function J(n,t){var e={},o={},r;(n===null||typeof n!="object")&&(n={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in n?e[r]=_(n[r],t[r]):o[r]=t[r];return function(a){for(r in e)o[r]=e[r](a);return o}}var y=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,k=new RegExp(y.source,"g");function L(n){return function(){return n}}function U(n){return function(t){return n(t)+""}}function P(n,t){var e=y.lastIndex=k.lastIndex=0,o,r,a,i=-1,s=[],h=[];for(n=n+"",t=t+"";(o=y.exec(n))&&(r=k.exec(t));)(a=r.index)>e&&(a=t.slice(e,a),s[i]?s[i]+=a:s[++i]=a),(o=o[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,h.push({i,x:M(o,r)})),e=k.lastIndex;return e<t.length&&(a=t.slice(e),s[i]?s[i]+=a:s[++i]=a),s.length<2?h[0]?U(h[0].x):L(t):(t=h.length,function(u){for(var f=0,c;f<t;++f)s[(c=h[f]).i]=c.x(u);return s.join("")})}function _(n,t){var e=typeof t,o;return t==null||e==="boolean"?q(t):(e==="number"?M:e==="string"?(o=I(t))?(t=o,z):P:t instanceof I?z:t instanceof Date?H:$(t)?Z:Array.isArray(t)?F:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?J:M)(n,t)}function un(n,t){return n=+n,t=+t,function(e){return Math.round(n*(1-e)+t*e)}}var E=180/Math.PI,Y={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function B(n,t,e,o,r,a){var i,s,h;return(i=Math.sqrt(n*n+t*t))&&(n/=i,t/=i),(h=n*e+t*o)&&(e-=n*h,o-=t*h),(s=Math.sqrt(e*e+o*o))&&(e/=s,o/=s,h/=s),n*o<t*e&&(n=-n,t=-t,h=-h,i=-i),{translateX:r,translateY:a,rotate:Math.atan2(t,n)*E,skewX:Math.atan(h)*E,scaleX:i,scaleY:s}}var d;function b(n){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return t.isIdentity?Y:B(t.a,t.b,t.c,t.d,t.e,t.f)}function nn(n){return n==null||(d||(d=document.createElementNS("http://www.w3.org/2000/svg","g")),d.setAttribute("transform",n),!(n=d.transform.baseVal.consolidate()))?Y:(n=n.matrix,B(n.a,n.b,n.c,n.d,n.e,n.f))}function C(n,t,e,o){function r(u){return u.length?u.pop()+" ":""}function a(u,f,c,l,p,m){if(u!==c||f!==l){var g=p.push("translate(",null,t,null,e);m.push({i:g-4,x:M(u,c)},{i:g-2,x:M(f,l)})}else(c||l)&&p.push("translate("+c+t+l+e)}function i(u,f,c,l){u!==f?(u-f>180?f+=360:f-u>180&&(u+=360),l.push({i:c.push(r(c)+"rotate(",null,o)-2,x:M(u,f)})):f&&c.push(r(c)+"rotate("+f+o)}function s(u,f,c,l){u!==f?l.push({i:c.push(r(c)+"skewX(",null,o)-2,x:M(u,f)}):f&&c.push(r(c)+"skewX("+f+o)}function h(u,f,c,l,p,m){if(u!==c||f!==l){var g=p.push(r(p)+"scale(",null,",",null,")");m.push({i:g-4,x:M(u,c)},{i:g-2,x:M(f,l)})}else(c!==1||l!==1)&&p.push(r(p)+"scale("+c+","+l+")")}return function(u,f){var c=[],l=[];return u=n(u),f=n(f),a(u.translateX,u.translateY,f.translateX,f.translateY,c,l),i(u.rotate,f.rotate,c,l),s(u.skewX,f.skewX,c,l),h(u.scaleX,u.scaleY,f.scaleX,f.scaleY,c,l),u=f=null,function(p){for(var m=-1,g=l.length,w;++m<g;)c[(w=l[m]).i]=w.x(p);return c.join("")}}}var fn=C(b,"px, ","px)","deg)"),an=C(nn,", ",")",")"),tn=1e-12;function O(n){return((n=Math.exp(n))+1/n)/2}function en(n){return((n=Math.exp(n))-1/n)/2}function rn(n){return((n=Math.exp(2*n))-1)/(n+1)}const sn=function n(t,e,o){function r(a,i){var s=a[0],h=a[1],u=a[2],f=i[0],c=i[1],l=i[2],p=f-s,m=c-h,g=p*p+m*m,w,v;if(g<tn)v=Math.log(l/u)/t,w=function(X){return[s+X*p,h+X*m,u*Math.exp(t*X*v)]};else{var A=Math.sqrt(g),N=(l*l-u*u+o*g)/(2*u*e*A),S=(l*l-u*u-o*g)/(2*l*e*A),x=Math.log(Math.sqrt(N*N+1)-N),Q=Math.log(Math.sqrt(S*S+1)-S);v=(Q-x)/t,w=function(X){var R=X*v,T=O(x),j=u/(e*A)*(T*rn(t*R+x)-en(x));return[s+j*p,h+j*m,u*T/O(t*R+x)]}}return w.duration=v*1e3*t/Math.SQRT2,w}return r.rho=function(a){var i=Math.max(.001,+a),s=i*i,h=s*s;return n(i,s,h)},r}(Math.SQRT2,2,4);export{_ as a,un as b,z as c,P as d,an as e,fn as f,sn as g,M as i};
