/** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. * Original file: /npm/d3-scale@4.0.2/src/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ import{InternMap as n,range as t,bisect as r,tickStep as e,ticks as u,tickIncrement as a,ascending as o,quantileSorted as i,quantile as c}from"../d3-array@3.2.4/e95f898e.js";import{interpolateNumber as l,interpolate as f,interpolateRound as s,piecewise as p}from"../d3-interpolate@3.0.1/034b7bcb.js";import{formatSpecifier as h,precisionFixed as g,precisionRound as m,precisionPrefix as d,formatPrefix as y,format as v}from"../d3-format@3.1.0/5851d7ef.js";import{timeSecond as M,timeMinute as w,timeHour as k,timeDay as N,timeWeek as x,timeMonth as b,timeYear as A,timeTickInterval as q,timeTicks as S,utcSecond as D,utcMinute as I,utcHour as O,utcDay as R,utcWeek as E,utcMonth as L,utcYear as F,utcTickInterval as P,utcTicks as T}from"../d3-time@3.1.0/5bc129e1.js";import{timeFormat as Q,utcFormat as U}from"../d3-time-format@4.1.0/19c92b44.js";function B(n,t){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(t).domain(n)}return this}function C(n,t){switch(arguments.length){case 0:break;case 1:"function"==typeof n?this.interpolator(n):this.range(n);break;default:this.domain(n),"function"==typeof t?this.interpolator(t):this.range(t)}return this}const z=Symbol("implicit");function Y(){var t=new n,r=[],e=[],u=z;function a(n){let a=t.get(n);if(void 0===a){if(u!==z)return u;t.set(n,a=r.push(n)-1)}return e[a%e.length]}return a.domain=function(e){if(!arguments.length)return r.slice();r=[],t=new n;for(const n of e)t.has(n)||t.set(n,r.push(n)-1);return a},a.range=function(n){return arguments.length?(e=Array.from(n),a):e.slice()},a.unknown=function(n){return arguments.length?(u=n,a):u},a.copy=function(){return Y(r,e).unknown(u)},B.apply(a,arguments),a}function j(){var n,r,e=Y().unknown(void 0),u=e.domain,a=e.range,o=0,i=1,c=!1,l=0,f=0,s=.5;function p(){var e=u().length,p=it&&(r=n,n=t,t=r),p=function(r){return Math.max(n,Math.min(t,r))}),e=c>2?Z:X,u=a=null,g}function g(t){return null==t||isNaN(t=+t)?r:(u||(u=e(o.map(n),i,c)))(n(p(t)))}return g.invert=function(r){return p(t((a||(a=e(i,o.map(n),l)))(r)))},g.domain=function(n){return arguments.length?(o=Array.from(n,J),h()):o.slice()},g.range=function(n){return arguments.length?(i=Array.from(n),h()):i.slice()},g.rangeRound=function(n){return i=Array.from(n),c=s,h()},g.clamp=function(n){return arguments.length?(p=!!n||V,h()):p!==V},g.interpolate=function(n){return arguments.length?(c=n,h()):c},g.unknown=function(n){return arguments.length?(r=n,g):r},function(r,e){return n=r,t=e,h()}}function nn(){return _()(V,V)}function tn(n,t,r,u){var a,o=e(n,t,r);switch((u=h(null==u?",f":u)).type){case"s":var i=Math.max(Math.abs(n),Math.abs(t));return null!=u.precision||isNaN(a=d(o,i))||(u.precision=a),y(u,i);case"":case"e":case"g":case"p":case"r":null!=u.precision||isNaN(a=m(o,Math.max(Math.abs(n),Math.abs(t))))||(u.precision=a-("e"===u.type));break;case"f":case"%":null!=u.precision||isNaN(a=g(o))||(u.precision=a-2*("%"===u.type))}return v(u)}function rn(n){var t=n.domain;return n.ticks=function(n){var r=t();return u(r[0],r[r.length-1],null==n?10:n)},n.tickFormat=function(n,r){var e=t();return tn(e[0],e[e.length-1],null==n?10:n,r)},n.nice=function(r){null==r&&(r=10);var e,u,o=t(),i=0,c=o.length-1,l=o[i],f=o[c],s=10;for(f0;){if((u=a(l,f,r))===e)return o[i]=l,o[c]=f,t(o);if(u>0)l=Math.floor(l/u)*u,f=Math.ceil(f/u)*u;else{if(!(u<0))break;l=Math.ceil(l*u)/u,f=Math.floor(f*u)/u}e=u}return n},n}function en(){var n=nn();return n.copy=function(){return $(n,en())},B.apply(n,arguments),rn(n)}function un(n){var t;function r(n){return null==n||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(t){return arguments.length?(n=Array.from(t,J),r):n.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return un(n).unknown(t)},n=arguments.length?Array.from(n,J):[0,1],rn(r)}function an(n,t){var r,e=0,u=(n=n.slice()).length-1,a=n[e],o=n[u];return o-n(-t,r)}function hn(n){const t=n(on,cn),r=t.domain;let e,a,o=10;function i(){return e=function(n){return n===Math.E?Math.log:10===n&&Math.log10||2===n&&Math.log2||(n=Math.log(n),t=>Math.log(t)/n)}(o),a=function(n){return 10===n?sn:n===Math.E?Math.exp:t=>Math.pow(n,t)}(o),r()[0]<0?(e=pn(e),a=pn(a),n(ln,fn)):n(on,cn),t}return t.base=function(n){return arguments.length?(o=+n,i()):o},t.domain=function(n){return arguments.length?(r(n),i()):r()},t.ticks=n=>{const t=r();let i=t[0],c=t[t.length-1];const l=c0){for(;p<=h;++p)for(f=1;fc)break;m.push(s)}}else for(;p<=h;++p)for(f=o-1;f>=1;--f)if(s=p>0?f/a(-p):f*a(p),!(sc)break;m.push(s)}2*m.length{if(null==n&&(n=10),null==r&&(r=10===o?"s":","),"function"!=typeof r&&(o%1||null!=(r=h(r)).precision||(r.trim=!0),r=v(r)),n===1/0)return r;const u=Math.max(1,o*n/t.ticks().length);return n=>{let t=n/a(Math.round(e(n)));return t*or(an(r(),{floor:n=>a(Math.floor(e(n))),ceil:n=>a(Math.ceil(e(n)))})),t}function gn(){const n=hn(_()).domain([1,10]);return n.copy=()=>$(n,gn()).base(n.base()),B.apply(n,arguments),n}function mn(n){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/n))}}function dn(n){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*n}}function yn(n){var t=1,r=n(mn(t),dn(t));return r.constant=function(r){return arguments.length?n(mn(t=+r),dn(t)):t},rn(r)}function vn(){var n=yn(_());return n.copy=function(){return $(n,vn()).constant(n.constant())},B.apply(n,arguments)}function Mn(n){return function(t){return t<0?-Math.pow(-t,n):Math.pow(t,n)}}function wn(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function kn(n){return n<0?-n*n:n*n}function Nn(n){var t=n(V,V),r=1;return t.exponent=function(t){return arguments.length?1===(r=+t)?n(V,V):.5===r?n(wn,kn):n(Mn(r),Mn(1/r)):r},rn(t)}function xn(){var n=Nn(_());return n.copy=function(){return $(n,xn()).exponent(n.exponent())},B.apply(n,arguments),n}function bn(){return xn.apply(null,arguments).exponent(.5)}function An(n){return Math.sign(n)*n*n}function qn(){var n,t=nn(),r=[0,1],e=!1;function u(r){var u=function(n){return Math.sign(n)*Math.sqrt(Math.abs(n))}(t(r));return isNaN(u)?n:e?Math.round(u):u}return u.invert=function(n){return t.invert(An(n))},u.domain=function(n){return arguments.length?(t.domain(n),u):t.domain()},u.range=function(n){return arguments.length?(t.range((r=Array.from(n,J)).map(An)),u):r.slice()},u.rangeRound=function(n){return u.range(n).round(!0)},u.round=function(n){return arguments.length?(e=!!n,u):e},u.clamp=function(n){return arguments.length?(t.clamp(n),u):t.clamp()},u.unknown=function(t){return arguments.length?(n=t,u):n},u.copy=function(){return qn(t.domain(),r).round(e).clamp(t.clamp()).unknown(n)},B.apply(u,arguments),rn(u)}function Sn(){var n,t=[],e=[],u=[];function a(){var n=0,r=Math.max(1,e.length);for(u=new Array(r-1);++n0?u[r-1]:t[0],r=u?[a[u-1],e]:[a[r-1],a[r]]},i.unknown=function(t){return arguments.length?(n=t,i):i},i.thresholds=function(){return a.slice()},i.copy=function(){return Dn().domain([t,e]).range(o).unknown(n)},B.apply(rn(i),arguments)}function In(){var n,t=[.5],e=[0,1],u=1;function a(a){return null!=a&&a<=a?e[r(t,a,0,u)]:n}return a.domain=function(n){return arguments.length?(t=Array.from(n),u=Math.min(t.length,e.length-1),a):t.slice()},a.range=function(n){return arguments.length?(e=Array.from(n),u=Math.min(t.length,e.length-1),a):e.slice()},a.invertExtent=function(n){var r=e.indexOf(n);return[t[r-1],t[r]]},a.unknown=function(t){return arguments.length?(n=t,a):n},a.copy=function(){return In().domain(t).range(e).unknown(n)},B.apply(a,arguments)}function On(n){return new Date(n)}function Rn(n){return n instanceof Date?+n:+new Date(+n)}function En(n,t,r,e,u,a,o,i,c,l){var f=nn(),s=f.invert,p=f.domain,h=l(".%L"),g=l(":%S"),m=l("%I:%M"),d=l("%I %p"),y=l("%a %d"),v=l("%b %d"),M=l("%B"),w=l("%Y");function k(n){return(c(n)t(e/(n.length-1))))},e.quantiles=function(t){return Array.from({length:t+1},((r,e)=>c(n,e/t)))},e.copy=function(){return Yn(t).domain(n)},C.apply(e,arguments)}function jn(){var n,t,r,e,u,a,o,i=0,c=.5,l=1,h=1,g=V,m=!1;function d(n){return isNaN(n=+n)?o:(n=.5+((n=+a(n))-t)*(h*n