/** * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2. * Original file: /npm/d3-transition@3.0.1/src/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ import{namespace as t,matcher as n,selector as e,selectorAll as r,selection as i,style as o}from"../d3-selection@3.0.0/5dcd62f4.js";import{dispatch as u}from"../d3-dispatch@3.0.1/b5f7cdc6.js";import{timer as a,timeout as s,now as l}from"../d3-timer@3.0.1/f31b5398.js";import{interpolateNumber as f,interpolateRgb as c,interpolateString as h,interpolateTransformSvg as _,interpolateTransformCss as p}from"../d3-interpolate@3.0.1/034b7bcb.js";import{color as v}from"../d3-color@3.1.0/2c0cdfa2.js";import{easeCubicInOut as d}from"../d3-ease@3.0.1/6f15f633.js";var m=u("start","end","cancel","interrupt"),y=[],w=0,g=1,x=2,A=3,b=4,E=5,C=6;function N(t,n,e,r,i,o){var u=t.__transition;if(u){if(e in u)return}else t.__transition={};!function(t,n,e){var r,i=t.__transition;function o(t){e.state=g,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var a,c,h,_;if(e.state!==g)return f();for(a in i)if((_=i[a]).name===e.name){if(_.state===A)return s(u);_.state===b?(_.state=C,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete i[a]):+aw)throw new Error("too late; already scheduled");return e}function T(t,n){var e=P(t,n);if(e.state>A)throw new Error("too late; already running");return e}function P(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function z(t,n){var e,r,i,o=t.__transition,u=!0;if(o){for(i in n=null==n?null:n+"",o)(e=o[i]).name===n?(r=e.state>x&&e.state=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?S:T;return function(){var u=o(this,t),a=u.on;a!==r&&(i=(r=a).copy()).on(n,e),u.on=i}}(e,t,n))},attr:function(n,e){var r=t(n),i="transform"===r?_:V;return this.attrTween(n,"function"==typeof e?(r.local?F:D)(r,i,O(this,"attr."+n,e)):null==e?(r.local?j:$)(r):(r.local?B:q)(r,i,e))},attrTween:function(n,e){var r="attr."+n;if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;var i=t(n);return this.tween(r,(i.local?G:H)(i,e))},style:function(t,n,e){var r="transform"==(t+="")?p:V;return null==n?this.styleTween(t,function(t,n){var e,r,i;return function(){var u=o(this,t),a=(this.style.removeProperty(t),o(this,t));return u===a?null:u===e&&a===r?i:i=n(e=u,r=a)}}(t,r)).on("end.style."+t,R(t)):"function"==typeof n?this.styleTween(t,function(t,n,e){var r,i,u;return function(){var a=o(this,t),s=e(this),l=s+"";return null==s&&(this.style.removeProperty(t),l=s=o(this,t)),a===l?null:a===r&&l===i?u:(i=l,u=n(r=a,s))}}(t,r,O(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=T(this,t),l=s.on,f=null==s.value[u]?o||(o=R(n)):void 0;l===e&&i===f||(r=(e=l).copy()).on(a,i=f),s.on=r}}(this._id,t)):this.styleTween(t,function(t,n,e){var r,i,u=e+"";return function(){var a=o(this,t);return a===u?null:a===r?i:i=n(r=a,e)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==n)return this.tween(r,null);if("function"!=typeof n)throw new Error;return this.tween(r,function(t,n,e){var r,i;function o(){var o=n.apply(this,arguments);return o!==i&&(r=(i=o)&&function(t,n,e){return function(r){this.style.setProperty(t,n.call(this,r),e)}}(t,o,e)),r}return o._value=n,o}(t,n,null==e?"":e))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var n=t(this);this.textContent=null==n?"":n}}(O(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;return this.tween(n,function(t){var n,e;function r(){var r=t.apply(this,arguments);return r!==e&&(n=(e=r)&&function(t){return function(n){this.textContent=t.call(this,n)}}(r)),n}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=P(this.node(),e).tween,o=0,u=i.length;og&&e.name===n)return new W([[t]],et,n,+r);return null}export{rt as active,z as interrupt,X as transition};export default null;