"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./order.mjs.js"),s=require("./render-step.mjs.js"),r=require("../../../../motion-utils/dist/es/global-config.mjs.js");exports.createRenderBatcher=function(t,o){let n=!1,c=!0;const i={delta:0,timestamp:0,isProcessing:!1},p=()=>n=!0,a=e.stepsOrder.reduce(((e,r)=>(e[r]=s.createRenderStep(p,o?r:void 0),e)),{}),{setup:d,read:l,resolveKeyframes:u,preUpdate:m,update:g,preRender:f,render:h,postRender:j}=a,v=()=>{const e=r.MotionGlobalConfig.useManualTiming,s=e?i.timestamp:performance.now();n=!1,e||(i.delta=c?1e3/60:Math.max(Math.min(s-i.timestamp,40),1)),i.timestamp=s,i.isProcessing=!0,d.process(i),l.process(i),u.process(i),m.process(i),g.process(i),f.process(i),h.process(i),j.process(i),i.isProcessing=!1,n&&o&&(c=!1,t(v))};return{schedule:e.stepsOrder.reduce(((e,s)=>{const r=a[s];return e[s]=function(e){let s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return n||(n=!0,c=!0,i.isProcessing||t(v)),r.schedule(e,s,o)},e}),{}),cancel:s=>{for(let r=0;r<e.stepsOrder.length;r++)a[e.stepsOrder[r]].cancel(s)},state:i,steps:a}};
//# sourceMappingURL=batcher.mjs.js.map
