/** * Bundled by jsDelivr using Rollup v2.79.2 and Terser v5.39.0. * 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/4d94e5b7.js";import{dispatch as u}from"../d3-dispatch@3.0.1/9ba9c7f3.js";import{timer as a,timeout as s,now as l}from"../d3-timer@3.0.1/b58a267d.js";import{interpolateNumber as f,interpolateRgb as c,interpolateString as h,interpolateTransformSvg as _,interpolateTransformCss as p}from"../d3-interpolate@3.0.1/8d1e5425.js";import{color as v}from"../d3-color@3.1.0/aeb57b94.js";import{easeCubicInOut as d}from"../d3-ease@3.0.1/cdd7e898.js";var m=u("start","end","cancel","interrupt"),y=[];function w(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=1,e.timer.restart(u,e.delay,e.time),e.delay<=t&&u(t-e.delay)}function u(o){var a,c,h,_;if(1!==e.state)return f();for(a in i)if((_=i[a]).name===e.name){if(3===_.state)return s(u);4===_.state?(_.state=6,_.timer.stop(),_.on.call("interrupt",t,t.__data__,_.index,_.group),delete i[a]):+a0)throw new Error("too late; already scheduled");return e}function x(t,n){var e=A(t,n);if(e.state>3)throw new Error("too late; already running");return e}function A(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function b(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>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete o[i]):u=!1;u&&delete t.__transition}}function E(t,n){var e,r;return function(){var i=x(this,t),o=i.tween;if(o!==e)for(var u=0,a=(r=e=o).length;u=0&&(t=t.slice(0,n)),!t||"start"===t}))}(n)?g:x;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?_:S;return this.attrTween(n,"function"==typeof e?(r.local?O:M)(r,i,N(this,"attr."+n,e)):null==e?(r.local?P:T)(r):(r.local?k:z)(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?V:$)(i,e))},style:function(t,n,e){var r="transform"==(t+="")?p:S;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,G(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,N(this,"style."+t,n))).each(function(t,n){var e,r,i,o,u="style."+n,a="end."+u;return function(){var s=x(this,t),l=s.on,f=null==s.value[u]?o||(o=G(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}}(N(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=A(this.node(),e).tween,o=0,u=i.length;o1&&e.name===n)return new I([[t]],U,n,+r);return null}export{W as active,b as interrupt,J as transition};export default null;