PageSourceSearch

https://www.trycaddi.com/_next/static/immutable/chunks/15g645d8pdtim.js

js trycaddi.com collected 2026-10-04 19:39:25 UTC 169,441 bytes, 40 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,19839,e=>{"use strict";var t=e.i(47167),r=e.i(71645),n=e.i(74080),o=e.i(43476),a=Object.defineProperty,i=(e,t)=>{for(var r in t)a(e,r,{get:t[r],enumerable:!0,configurable:!0,set:e=>t[r]=()=>e})};if("function"!=typeof r.createContext)throw Error(['Remotion requires React.createContext, but it is "undefined".','If you are in a React Server Component, turn it into a client component by adding "use client" at the top of the file.',"","Before:",'  import {useCurrentFrame} from "remotion";',"","After:",'  "use client";','  import {useCurrentFrame} from "remotion";'].join(`
2`));var s=(0,r.createContext)(!1),l=({children:e})=>(0,o.jsx)(s.Provider,{value:!0,children:e}),u=(0,r.createContext)({setError:()=>{},clearError:()=>{}}),d=()=>{try{if("u"<typeof __webpack_module__)return null;return __webpack_module__.hot??null}catch{return null}};class f extends r.default.Component{state={hasError:!1};hmrStatusHandler=null;static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError(e),this.subscribeToHmrReset()}componentDidMount(){this.state.hasError||this.props.onClear()}componentDidUpdate(e,t){t.hasError&&!this.state.hasError&&this.props.onClear()}componentWillUnmount(){this.unsubscribeFromHmrReset()}subscribeToHmrReset(){if(this.hmrStatusHandler)return;let e=d();if(!e)return;let t=e=>{"idle"===e&&(this.unsubscribeFromHmrReset(),this.setState({hasError:!1}))};this.hmrStatusHandler=t,e.addStatusHandler(t)}unsubscribeFromHmrReset(){let e=this.hmrStatusHandler;if(!e)return;this.hmrStatusHandler=null;let t=d();t&&t.removeStatusHandler(e)}render(){return this.state.hasError?null:this.props.children}}var c=(0,r.createContext)({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),m=(0,r.createContext)({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},onlyRenderComposition:null}),p=(0,r.createContext)({getNonce:()=>0}),h=0;try{"u">typeof __webpack_module__&&__webpack_module__.hot&&__webpack_module__.hot.addStatusHandler(e=>{"idle"===e&&h++})}catch{}var g=()=>{let e=(0,r.useContext)(p).getNonce(),t=(0,r.useRef)(e);t.current=e;let n=(0,r.useRef)([[h,e]]),o=(0,r.useCallback)(()=>(h!==n.current[n.current.length-1][0]&&(n.current=[...n.current,[h,t.current]]),n.current),[n]);return(0,r.useMemo)(()=>({get:o}),[o])};function y(e){return!!e}var v=e=>e.match(/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g),w=`Folder name must match ${String(/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g)}`,b=(0,r.createContext)({folderName:null,parentName:null});function x(){return"NODE_ENV"}var E=()=>{let e="u">typeof window&&window.remotion_isPlayer,t="u">typeof window&&void 0!==window.process&&void 0!==window.process.env&&("test"===window.process.env[x()]||"production"===window.process.env[x()]&&"u">typeof window&&void 0!==window.remotion_puppeteerTimeout);return{isStudio:"u">typeof window&&window.remotion_isStudio,isRendering:t,isPlayer:e,isReadOnlyStudio:"u">typeof window&&window.remotion_isReadOnlyStudio,isClientSideRendering:!1}},C="remotion-date:",R="remotion-file:",k=e=>JSON.parse(e,(e,t)=>"string"==typeof t&&t.startsWith(C)?new Date(t.replace(C,"")):"string"==typeof t&&t.startsWith(R)?`${window.remotion_staticBase}/${t.replace(R,"")}`:t),I=e=>E().isStudio?k((({data:e,indent:t,staticBase:r})=>{let n=!1,o=!1,a=!1,i=!1;try{return{serializedString:JSON.stringify(e,function(e,t){let s=this[e];return s instanceof Date?(n=!0,`${C}${s.toISOString()}`):s instanceof Map?(a=!0,t):s instanceof Set?(i=!0,t):"string"==typeof s&&null!==r&&s.startsWith(r)?(o=!0,`${R}${s.replace(r+"/","")}`):t},t),customDateUsed:n,customFileUsed:o,mapUsed:a,setUsed:i}}catch(e){throw Error("Could not serialize the passed input props to JSON: "+e.message)}})({data:e,indent:2,staticBase:window.remotion_staticBase}).serializedString):e,F=(0,r.createContext)(!1),T=()=>(0,r.useContext)(F),$=({className:e,classPrefix:t,type:r})=>{if(!e)return!1;if("exact"===r){let r=e.split(" ");return t.some(e=>r.some(t=>t.trim()===e||t.trim().endsWith(`:${e}`)||t.trim().endsWith(`!${e}`)))}return t.some(t=>e.startsWith(t)||e.includes(` ${t}`)||e.includes(`!${t}`)||e.includes(`:${t}`))},S=(0,r.forwardRef)((e,t)=>{let{style:n,...a}=e,i=(0,r.useMemo)(()=>({position:"absolute",top:$({className:a.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:$({className:a.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:$({className:a.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:$({className:a.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:$({className:a.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:$({className:a.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:$({className:a.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:$({className:a.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...n}),[a.className,n]);return(0,o.jsx)("div",{ref:t,style:i,...a})}),P={transform:"rotate(90deg)"},N={color:"white",fontSize:14,fontFamily:"sans-serif"},M={justifyContent:"center",alignItems:"center"},V=()=>(0,o.jsxs)(S,{style:M,id:"remotion-comp-loading",children:[(0,o.jsx)("style",{type:"text/css",children:`
3				@keyframes anim {
4					from {
5						opacity: 0
6					}
7					to {
8						opacity: 1
9					}
10				}
11				#remotion-comp-loading {
12					animation: anim 2s;
13					animation-fill-mode: forwards;
14				}
15			`}),(0,o.jsx)("svg",{width:40,height:40,viewBox:"-100 -100 400 400",style:P,children:(0,o.jsx)("path",{fill:"#555",stroke:"#555",strokeWidth:"100",strokeLinejoin:"round",d:"M 2 172 a 196 100 0 0 0 195 5 A 196 240 0 0 0 100 2.259 A 196 240 0 0 0 2 172 z"})}),(0,o.jsxs)("p",{style:N,children:["Resolving ","<Suspense>","..."]})]}),A=null,j=()=>
15{if(!A){if("u"<typeof document)throw Error("Tried to call an API that only works in the browser from outside the browser");(A=document.createElement("div")).style.position="absolute",A.style.top="0px",A.style.left="0px",A.style.right="0px",A.style.bottom="0px",A.style.width="100%",A.style.height="100%",A.style.display="flex",A.style.flexDirection="column";let e=document.createElement("div");e.style.position="fixed",e.style.top="-999999px",e.appendChild(A),document.body.appendChild(e)}return A},_=()=>{if("u"<typeof localStorage)return null;let e=localStorage.getItem("remotion_inputPropsOverride"+window.location.origin);return e?JSON.parse(e):null},L=!1,O=(0,r.createContext)({props:{},updateProps:()=>{throw Error("Not implemented")}}),D=r.default.createRef(),q=({children:e})=>{let[t,n]=r.default.useState({}),a=(0,r.useCallback)(({defaultProps:e,id:t,newProps:r})=>{n(n=>({...n,[t]:"function"==typeof r?r(n[t]??e):r}))},[]),i=(0,r.useMemo)(()=>({props:t,updateProps:a}),[t,a]);return(0,o.jsx)(O.Provider,{value:i,children:e})},H=r.default.createContext(null),W=()=>{let e=(0,r.useContext)(H),[t]=(0,r.useState)(()=>E());return e??t};function z(e,t,r){if("number"!=typeof e)throw Error(`The "${t}" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw TypeError(`The "${t}" prop ${r} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw TypeError(`The "${t}" prop ${r} must be finite, but is ${e}.`);if(e%1!=0)throw TypeError(`The "${t}" prop ${r} must be an integer, but is ${e}.`);if(e<=0)throw TypeError(`The "${t}" prop ${r} must be positive, but got ${e}.`)}function U(e,t){let{allowFloats:r,component:n}=t;if(void 0===e)throw Error(`The "durationInFrames" prop ${n} is missing.`);if("number"!=typeof e)throw Error(`The "durationInFrames" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw TypeError(`The "durationInFrames" prop ${n} must be positive, but got ${e}.`);if(!r&&e%1!=0)throw TypeError(`The "durationInFrames" prop ${n} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw TypeError(`The "durationInFrames" prop ${n} must be finite, but got ${e}.`)}function B(e,t,r){if("number"!=typeof e)throw Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw TypeError(`"fps" must be positive, but got ${e} ${t}`);if(r&&e>50)throw TypeError("The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif")}var Y=(0,r.createContext)(null),J=(0,r.createRef)(),K=e=>{let t=(0,r.useContext)(Y),{props:n}=(0,r.useContext)(O),{compositions:o,canvasContent:a,currentCompositionMetadata:i}=(0,r.useContext)(c),s=a?.type==="composition"?a.compositionId:null,l=e??s,u=o.find(e=>e.id===l),d=(0,r.useMemo)(()=>u?n[u.id]??{}:{},[n,u]),f=W();return(0,r.useMemo)(()=>u?i?{type:"success",result:{...i,id:u.id,defaultProps:u.defaultProps??{}}}:u.calculateMetadata?t&&t[u.id]?t[u.id]:null:(U(u.durationInFrames,{allowFloats:!1,component:`in <Composition id="${u.id}">`}),B(u.fps,`in <Composition id="${u.id}">`,!1),z(u.width,"width",`in <Composition id="${u.id}">`),z(u.height,"height",`in <Composition id="${u.id}">`),{type:"success",result:{width:u.width,height:u.height,fps:u.fps,id:u.id,durationInFrames:u.durationInFrames,defaultProps:u.defaultProps??{},props:{...u.defaultProps??{},...d??{},..."u"<typeof window||f.isPlayer||!window.remotion_inputProps?{}:(()=>{if("u"<typeof window)return L||(L=!0,console.warn("Called `getInputProps()` on the server. This function is not available server-side and has returned an empty object."),console.warn("To hide this warning, don't call this function on the server:"),console.warn("  typeof window === 'undefined' ? {} : getInputProps()")),{};if(E().isPlayer)throw Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");let e=_();if(e)return e;if("u"<typeof window||void 0===window.remotion_inputProps)throw Error("Cannot call `getInputProps()` - window.remotion_inputProps is not set. This API is only available if you are in the Studio, or while you are rendering server-side.");let t=window.remotion_inputProps;return t?k(t):{}})()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}}):null,[u,t,i,d,f.isPlayer])},G=e=>{let t=e.stack??"";return t.startsWith("Error:")?t:`${e.message}
16${t}`};function Z(e,t){let r;throw(t instanceof Error?0:+(null===t||"object"!=typeof t||!("stack"in t)||"string"!=typeof t.stack||!("message"in t)||"string"!=typeof t.message))?r="string"==typeof t?Error(t):Error("Rendering was cancelled"):(r=t).stack||(r.stack=Error(r.message).stack),e&&(e.remotion_cancelledError=G(r)),r}function Q(e){return Z("u">typeof window?window:void 0,e)}var X=["trace","verbose","info","warn","error"],ee=(e,t)=>
16X.indexOf(e)<=X.indexOf(t),et=({args:e,logLevel:t,tag:r})=>{let n=[...e];return E().isRendering&&!E().isClientSideRendering&&n.unshift(Symbol.for(`__remotion_level_${t}`)),r&&E().isRendering&&!E().isClientSideRendering&&n.unshift(Symbol.for(`__remotion_tag_${r}`)),n},er={trace:(e,...t)=>{if(ee(e.logLevel,"trace"))return console.debug(...et({args:t,logLevel:"trace",tag:e.tag}))},verbose:(e,...t)=>{if(ee(e.logLevel,"verbose"))return console.debug(...et({args:t,logLevel:"verbose",tag:e.tag}))},info:(e,...t)=>{if(ee(e.logLevel,"info"))return console.log(...et({args:t,logLevel:"info",tag:e.tag}))},warn:(e,...t)=>{if(ee(e.logLevel,"warn"))return console.warn(...et({args:t,logLevel:"warn",tag:e.tag}))},error:(e,...t)=>console.error(...et({args:t,logLevel:"error",tag:e.tag}))};"u">typeof window&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var en=({scope:e,environment:t,label:r,options:n})=>{if("string"!=typeof r&&null!==r)throw Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(r));let o=Math.random();e.remotion_delayRenderHandles.push(o);let a=Error().stack?.replace(/^Error/g,"")??"";if(t.isRendering){let i=(n?.timeoutInMilliseconds??e.remotion_puppeteerTimeout??3e4)-2e3,s=(n?.retries??0)-(e.remotion_attempt-1);e.remotion_delayRenderTimeouts[o]={label:r??null,startTime:Date.now(),timeout:setTimeout(()=>{let n=["A delayRender()",r?`"${r}"`:null,`was called but not cleared after ${i}ms. See https://remotion.dev/docs/timeout for help.`,s>0?"Retries left: "+s:null,s>0?"- Rendering the frame will be retried.":null,"The delayRender was called:",a].filter(y).join(" ");t.isClientSideRendering?e.remotion_cancelledError=G(Error(n)):Z(e,Error(n))},i)}}return e.remotion_renderReady=!1,o},eo=(e,t)=>"u"<typeof window?Math.random():en({scope:window,environment:E(),label:e??null,options:t??{}}),ea=({scope:e,handle:t,environment:r,logLevel:n})=>{if(void 0===t)throw TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");if("number"!=typeof t)throw TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(t));e.remotion_delayRenderHandles=e.remotion_delayRenderHandles.filter(o=>{if(o===t){if(r.isRendering&&void 0!==e){if(!e.remotion_delayRenderTimeouts[t])return!1;let{label:r,startTime:o,timeout:a}=e.remotion_delayRenderTimeouts[t];clearTimeout(a);let i=[r?`"${r}"`:"A handle","handle was cleared after",`${Date.now()-o}ms`].filter(y).join(" ");er.verbose({logLevel:n,tag:"delayRender()"},i),delete e.remotion_delayRenderTimeouts[t]}return!1}return!0}),0===e.remotion_delayRenderHandles.length&&(e.remotion_renderReady=!0)},ei=(0,r.createContext)({logLevel:"info",mountTime:0}),es=()=>{let{logLevel:e}=r.useContext(ei);if(null===e)throw Error("useLogLevel must be used within a LogLevelProvider");return e},el=()=>{let{mountTime:e}=r.useContext(ei);if(null===e)throw Error("useMountTime must be used within a LogLevelProvider");return e},eu=(0,r.createContext)(null),ed=()=>{let e=W(),t=(0,r.useContext)(eu)??("u">typeof window?window:void 0),n=es();return{delayRender:(0,r.useCallback)((r,n)=>t?en({scope:t,environment:e,label:r??null,options:n??{}}):Math.random(),[e,t]),continueRender:(0,r.useCallback)(r=>{t&&ea({scope:t,handle:r,environment:e,logLevel:n})},[e,n,t]),cancelRender:(0,r.useCallback)(e=>Z(t??("u">typeof window?window:void 0),e),[t])}},ef=({compProps:e,componentName:t,noSuspense:n})=>{let o=(0,r.useRef)(null);return"component"in e&&(o.current=e.component),(0,r.useMemo)(()=>{if("component"in e){if("u"<typeof document||n)return e.component;if(void 0===e.component)throw Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${t}/> component.`);return e=>{let t=o.current;return r.default.createElement(t,e)}}if("lazyComponent"in e&&void 0!==e.lazyComponent){if(void 0===e.lazyComponent)throw Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${t}/> component.`);return r.default.lazy(e.lazyComponent)}throw Error("You must pass either 'component' or 'lazyComponent'")},[e.lazyComponent])},ec=()=>{let{canvasContent:e,compositions:t,currentCompositionMetadata:n}=(0,r.useContext)(c),o=t.find(t=>e?.type==="composition"&&t.id===e.compositionId),a=K(o?.id??null);return(0,r.useMemo)(()=>a&&"error"!==a.type&&"loading"!==a.type&&o?{...a.result,defaultProps:o.defaultProps??{},id:o.id,...n??{},component:o.component}:null,[n,a,o])},em=e=>e.match(/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g),ep=`Composition ID must match ${String(/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g)}`,eh=()=>{let{continueRender:e,delayRender:t}=ed();return(0,r.useEffect)(()=>{let r=t("Waiting for Root component to unsuspend");return()=>e(r)},[e,t]),null},eg=({width:e,height:t,fps:a,durationInFrames:i,id:d,defaultProps:c,schema:p,...h})=>{let{registerComposition:y,unregisterComposition:v}=(0,r.useContext)(m),w=ec(),x=ef({compProps:h,componentName:"Composition",noSuspense:!1}
16),E=g(),C=T(),R=W(),k=(0,r.useContext)(s);if("u">typeof window&&(window.remotion_seenCompositionIds=Array.from(new Set([...window.remotion_seenCompositionIds??[],d]))),k){if(C)throw Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help.");throw Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.")}let{folderName:F,parentName:$}=(0,r.useContext)(b),S=h.stack??null;(0,r.useEffect)(()=>{if(!d)throw Error("No id for composition passed.");if(!em(d))throw Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${d}`);var r="defaultProps";if(c){if("object"!=typeof c)throw Error(`"${r}" must be an object, but you passed a value of type ${typeof c}`);if(Array.isArray(c))throw Error(`"${r}" must be an object, an array was passed ${d?`for composition "${d}"`:""}`)}return y({durationInFrames:i??void 0,fps:a??void 0,height:t??void 0,width:e??void 0,id:d,folderName:F,component:x,defaultProps:I(c??{}),nonce:E.get(),parentFolderName:$,schema:p??null,calculateMetadata:h.calculateMetadata??null,stack:S}),()=>{v(d)}},[i,a,t,x,d,F,c,e,E,$,p,h.calculateMetadata,S,y,v]);let P=K(d),{setError:N,clearError:M}=(0,r.useContext)(u),A=(0,r.useCallback)(e=>{N(e)},[N]),_=(0,r.useCallback)(()=>{M()},[M]);return R.isStudio&&w&&w.component===x&&w.id===d?null===P||"success"!==P.type&&"success-and-refreshing"!==P.type?null:(0,n.createPortal)((0,o.jsx)(l,{children:(0,o.jsx)(f,{onError:A,onClear:_,children:(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(V,{}),children:(0,o.jsx)(x,{...P.result.props??{}})})})}),j()):R.isRendering&&w&&w.component===x&&w.id===d?null===P||"success"!==P.type&&"success-and-refreshing"!==P.type?null:(0,n.createPortal)((0,o.jsx)(l,{children:(0,o.jsx)(r.Suspense,{fallback:(0,o.jsx)(eh,{}),children:(0,o.jsx)(x,{...P.result.props??{}})})}),j()):null},ey=e=>{let{onlyRenderComposition:t}=(0,r.useContext)(m);return t&&t!==e.id?null:(0,o.jsx)(eg,{...e})},ev=[],ew=e=>{ev.push(e)},eb="4.0.479",ex=(0,r.createContext)(null),eE={};function eC(e){let t=e+0x6d2b79f5;return t=Math.imul(t^t>>>15,1|t),(((t^=t+Math.imul(t^t>>>7,61|t))^t>>>14)>>>0)/0x100000000}i(eE,{useTimelineSetFrame:()=>eO,useTimelinePosition:()=>e_,useTimelineContext:()=>eA,usePlayingState:()=>eD,usePlaybackRate:()=>ej,useAbsoluteTimelinePosition:()=>eL,persistCurrentFrame:()=>eS,getInitialFrameState:()=>eP,getFrameForComposition:()=>eN,clampFrameToCompositionRange:()=>eM});var eR=(e,t)=>{if(void 0!==t)throw TypeError("random() takes only one argument");if(null===e)return Math.random();if("string"==typeof e)return eC(function(e){let t=0,r=0;for(t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t)|0;return r}(e));if("number"==typeof e)return eC(1e10*e);throw Error("random() argument must be a number or a string")},ek=(0,r.createContext)({setFrame:()=>{throw Error("default")},setPlaying:()=>{throw Error("default")}}),eI=(0,r.createContext)(null),eF=(0,r.createContext)(null),eT=(0,r.createContext)(null),e$=({children:e,frameState:t})=>{let[n,a]=(0,r.useState)(!1),i=(0,r.useRef)(!1),[s,l]=(0,r.useState)(1),u=(0,r.useRef)([]),[d]=(0,r.useState)(()=>String(eR(null))),[f,c]=(0,r.useState)(()=>eP()),m=t??f,{delayRender:p,continueRender:h}=ed();"u">typeof window&&(0,r.useLayoutEffect)(()=>{window.remotion_setFrame=(e,t,r)=>{window.remotion_attempt=r;let n=p(`Setting the current frame to ${e}`),o=!0;c(r=>(r[t]??window.remotion_initialFrame)===e?(o=!1,r):{...r,[t]:e}),o?requestAnimationFrame(()=>h(n)):h(n)},window.remotion_isPlayer=!1},[h,p]);let g=(0,r.useMemo)(()=>({frame:m,playing:n,imperativePlaying:i,rootId:d,audioAndVideoTags:u}),[m,n,d]),y=(0,r.useMemo)(()=>({playbackRate:s,setPlaybackRate:l}),[s]),v=(0,r.useMemo)(()=>({setFrame:c,setPlaying:a}),[]);return(0,o.jsx)(eT.Provider,{value:g,children:(0,o.jsx)(eF.Provider,{value:y,children:(0,o.jsx)(eI.Provider,{value:g,children:(0,o.jsx)(ek.Provider,{value:v,children:e})})})})},eS=e=>{localStorage.setItem("remotion.time-all",JSON.stringify(e))},eP=()=>JSON.parse(localStorage.getItem("remotion.time-all")??"{}"),eN=e=>{let t=JSON.parse(localStorage.getItem("remotion.time-all")??"{}");return void 0!==t[e]?Number(t[e]):"u"<typeof window?0:window.remotion_initialFrame??0},eM=(e,t)=>Math.max(0,Math.min(Math.max(0,t-1),e)),eV=e=>{let t=ec(),r=W();return t?eM(e.frame[t.id]??(r.isPlayer?0:eN(t.id)),t.durationInFrames):"u"<typeof window?0:window.remotion_initialFrame??0},eA=()=>{let e=(0,r.useContext)(eI);if(null===e)throw Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},ej=()=>{let e=(0,r.useContext)(eF);if(null===e)throw Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},e_=()=>eV(eA()),eL=()=>{let e=(0,r.useContext)(eT);if(null===e)throw Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return eV(e)},eO=()=>{let{setFrame:e}=(0,r.useContext)(ek);return e},eD=()=>{let{playing:e,imperativePlaying:t}=eA(),{setPlaying:n}=(0,r.useContext)(ek);return(0,r.useMemo)(()=>[e,n,t],[t,e,n])},eq=()=>{let e=(0,r.useContext)(s),t=W();if(!e){if(t.isPlayer)throw Error("useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples");throw Error("useCurrentFrame() can only be called inside a component that was registered as a composition. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions")}let n=e_(),o=(0,r.useContext)(ex);return n-(o?o.cumulatedFrom+o.relativeFrom:0)},eH=()=>{let e=(0,r.useContext)(ex),t=e?.width??null,n=e?.height??null,o=e?.durationInFrames??null,a=ec();return(0,r.useMemo)(()=>
16{if(!a)return null;let{id:e,durationInFrames:r,fps:i,height:s,width:l,defaultProps:u,props:d,defaultCodec:f,defaultOutName:c,defaultVideoImageFormat:m,defaultPixelFormat:p,defaultProResProfile:h,defaultSampleRate:g}=a;return{id:e,width:t??l,height:n??s,fps:i,durationInFrames:o??r,defaultProps:u,props:d,defaultCodec:f,defaultOutName:c,defaultVideoImageFormat:m,defaultPixelFormat:p,defaultProResProfile:h,defaultSampleRate:g}},[o,n,t,a])},eW=()=>{let e=eH(),t=(0,r.useContext)(s),n=T();if(!e){if("u">typeof window&&window.remotion_isPlayer||n)throw Error("No video config found. Likely reasons:-- You are probably calling useVideoConfig() from outside the component passed to <Player />. See https://www.remotion.dev/docs/player/examples for how to set up the Player correctly.-- You have multiple versions of Remotion installed which causes the React context to get lost.");throw Error("No video config found. You are probably calling useVideoConfig() from a component which has not been registered as a <Composition />. See https://www.remotion.dev/docs/the-fundamentals#defining-compositions for more information.")}if(!t)throw Error("Called useVideoConfig() outside a Remotion composition.");return e},ez=({frame:e,children:t,active:n=!0})=>{let a=eq(),i=eW();if(void 0===e)throw Error("The <Freeze /> component requires a 'frame' prop, but none was passed.");if("number"!=typeof e)throw Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof e}`);if(Number.isNaN(e))throw Error("The 'frame' prop of <Freeze /> must be a real number, but it is NaN.");if(!Number.isFinite(e))throw Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${e}.`);let s=(0,r.useMemo)(()=>"boolean"==typeof n?n:"function"==typeof n?n(a):void 0,[n,a]),l=eA(),u=(0,r.useContext)(ex),d=u?.relativeFrom??0,f=(0,r.useMemo)(()=>s?{...l,playing:!1,imperativePlaying:{current:!1},frame:{[i.id]:e+d}}:l,[s,l,i.id,e,d]),c=(0,r.useMemo)(()=>u?s?{...u,cumulatedFrom:0}:u:null,[u,s]);return(0,o.jsx)(eI.Provider,{value:f,children:(0,o.jsx)(ex.Provider,{value:c,children:t})})},eU={"style.transformOrigin":{type:"transform-origin",step:1,default:"50% 50%",description:"Transform origin"},"style.translate":{type:"translate",step:1,default:"0px 0px",description:"Offset"},"style.scale":{type:"scale",max:100,step:.01,default:1,description:"Scale"},"style.rotate":{type:"rotation-css",step:1,default:"0deg",description:"Rotation"},"style.opacity":{type:"number",min:0,max:1,step:.01,default:1,description:"Opacity",hiddenFromList:!1}},eB={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0},styleWhilePremounted:{type:"hidden"},styleWhilePostmounted:{type:"hidden"}},eY={...eU,...eB},eJ={type:"boolean",default:!1,description:"Hidden"},eK={type:"hidden"},eG={type:"hidden"},eZ={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},eQ={type:"number",default:0,step:1,hiddenFromList:!0},eX={type:"number",default:null,step:1,hiddenFromList:!0},e0={durationInFrames:eZ,from:eQ,freeze:eX,hidden:eJ,name:eG,showInTimeline:eK},e1={...e0,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":eY,none:{}}}},e2={...{durationInFrames:eZ,freeze:eX,hidden:eJ,name:eG,showInTimeline:eK},layout:e1.layout},e5={...e1,layout:{...e1.layout,default:"none"}},e3=(0,r.createContext)({premountFramesRemaining:0}),e4=r.default.createContext({registerSequence:()=>{throw Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw Error("SequenceManagerContext not initialized")},sequences:[]}),e6=r.default.createContext({current:[]}),e8=e=>`${e.nodePath.join(".")}.${e.sequenceKeys.join(".")}.${e.effectKeys.map(e=>e.join(".")).join(".")}`,e9=r.default.createContext({propStatuses:{}}),e7=r.default.createContext({current:{}}),te=r.default.createContext({getDragOverrides:()=>{throw Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw Error("VisualModeDragOverridesContext not initialized")}}),tt=r.default.createContext({setDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},clearDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},setEffectDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},clearEffectDragOverrides:()=>{throw Error("VisualModeSettersContext not initialized")},setPropStatuses:()=>{throw Error("VisualModeSettersContext not initialized")}}),tr=(e,t)=>`${e8(e)}.effects.${t}`,tn=({children:e})=>{let[t,n]=(0,r.useState)([]),a=(0,r.useRef)(t);a.current=t;let[i,s]=(0,r.useState)({});(0,r.useRef)(i).current=i;let[l,u]=(0,r.useState)({}),[d,f]=(0,r.useState)({}),c=(0,r.useRef)(d);c.current=d;let m=(0,r.useCallback)((e,t,r)=>{s(n=>({...n,[e8(e)]:{...n[e8(e)],[t]:r}}))},[]),p=(0,r.useCallback)(e=>{s(t=>
16{let r=e8(e);if(!t[r])return t;let n={...t};return delete n[r],n})},[]),h=(0,r.useCallback)((e,t,r,n)=>{u(o=>{let a=tr(e,t);return{...o,[a]:{...o[a],[r]:n}}})},[]),g=(0,r.useCallback)((e,t)=>{u(r=>{let n=tr(e,t);if(!r[n])return r;let o={...r};return delete o[n],o})},[]),y=(0,r.useCallback)((e,t)=>{f(r=>{let n=e8(e),o=r[n],a=t(o);return o===a?r:{...r,[n]:a}})},[]),v=(0,r.useCallback)(e=>{n(t=>[...t,e])},[]),w=(0,r.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),b=(0,r.useMemo)(()=>({registerSequence:v,sequences:t,unregisterSequence:w}),[v,t,w]),x=(0,r.useCallback)(e=>i[e8(e)]??{},[i]),E=(0,r.useCallback)((e,t)=>l[tr(e,t)]??{},[l]),C=(0,r.useMemo)(()=>({propStatuses:d}),[d]),R=(0,r.useMemo)(()=>({getDragOverrides:x,getEffectDragOverrides:E}),[x,E]),k=(0,r.useMemo)(()=>({setDragOverrides:m,clearDragOverrides:p,setEffectDragOverrides:h,clearEffectDragOverrides:g,setPropStatuses:y}),[m,p,h,g,y]);return(0,o.jsx)(e6.Provider,{value:a,children:(0,o.jsx)(e4.Provider,{value:b,children:(0,o.jsx)(e7.Provider,{value:c,children:(0,o.jsx)(e9.Provider,{value:C,children:(0,o.jsx)(te.Provider,{value:R,children:(0,o.jsx)(tt.Provider,{value:k,children:e})})})})})})},to=(0,r.createContext)(!1),ta=({children:e})=>(0,o.jsx)(to.Provider,{value:!0,children:e}),ti=({children:e})=>(0,o.jsx)(to.Provider,{value:!1,children:e}),ts="function"==typeof Float32Array;function tl(e,t,r){return(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e}function tu(e,t,r){return 3*(1-3*r+3*t)*e*e+2*(3*r-6*t)*e+3*t}function td(e,t,r,n){if(!(e>=0&&e<=1&&r>=0&&r<=1))throw Error("bezier x values must be in [0, 1] range");let o=ts?new Float32Array(11):Array(11);if(e!==t||r!==n)for(let t=0;t<11;++t)o[t]=tl(.1*t,e,r);return function(a){let i=Math.min(1,Math.max(0,a));return e===t&&r===n?i:0===i?0:1===i?1:tl(function(t){let n=0,a=1;for(;10!==a&&o[a]<=t;++a)n+=.1;let i=n+(t-o[--a])/(o[a+1]-o[a])*.1,s=tu(i,e,r);if(s>=.001){let n=i;for(let o=0;o<4;++o){let o=tu(n,e,r);if(0===o)break;let a=tl(n,e,r)-t;n-=a/o}return n}return 0===s?i:function({aX:e,_aA:t,_aB:r,mX1:n,mX2:o}){let a,i,s=0,l=t,u=r;do(a=tl(i=l+(u-l)/2,n,o)-e)>0?u=i:l=i;while(Math.abs(a)>1e-7&&++s<10)return i}({aX:t,_aA:n,_aB:n+.1,mX1:e,mX2:r})}(i),t,n)}}var tf=new Set(["deg","rad","grad","turn"]),tc=new Set(["%","cap","ch","cm","cqb","cqh","cqi","cqmax","cqmin","cqw","dvh","dvw","em","ex","ic","in","lh","lvh","lvw","mm","pc","pt","px","q","rem","rlh","svh","svw","vb","vh","vi","vmax","vmin","vw"]),tm=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,tp=new Set(["left","center","right","top","bottom"]),th=e=>"left"===e?[{axis:"x",value:{value:0,unit:"%"}}]:"right"===e?[{axis:"x",value:{value:100,unit:"%"}}]:"top"===e?[{axis:"y",value:{value:0,unit:"%"}}]:"bottom"===e?[{axis:"y",value:{value:100,unit:"%"}}]:[{axis:"x",value:{value:50,unit:"%"}},{axis:"y",value:{value:50,unit:"%"}}],tg={value:50,unit:"%"},ty=e=>String(Math.round(1e6*e)/1e6),tv=({component:e,value:t,allowPercentage:r})=>{let n=tm.exec(e);if(null===n)throw TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${r?"length-percentage":"z length"}`);let o=n[2]??null,a=Number(n[1]);if(!Number.isFinite(a))throw TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(null===o||!tc.has(o)||!r&&"%"===o)throw TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${r?"length-percentage":"z length"}`);return{value:a,unit:o}},tw=(e,t)=>{let r=e.toLowerCase();return tp.has(r)?{type:"keyword",keyword:r}:{type:"length-percentage",parsed:tv({component:e,value:t,allowPercentage:!0})}},tb=e=>{if("number"==typeof e){if(!Number.isFinite(e))throw Error(`outputRange must contain only finite numbers, but got [${e}
16]`);return{kind:"scale",values:[e,e,1],units:[null,null,null],dimensions:1}}let t=e.trim().split(/\s+/);if(t.length<1||t.length>3||""===t[0])throw TypeError(`String outputRange values must contain 1 to 3 components, but got "${e}"`);if(t.some(e=>tp.has(e.toLowerCase())))return((e,t)=>{let[r,n]=((e,t)=>{if(1===e.length){let r=tw(e[0],t);return"length-percentage"===r.type?[r.parsed,tg]:"top"===r.keyword||"bottom"===r.keyword?[tg,th(r.keyword)[0].value]:[th(r.keyword)[0].value,tg]}let r=tw(e[0],t),n=tw(e[1],t);if("length-percentage"===r.type&&"length-percentage"===n.type)return[r.parsed,n.parsed];if("keyword"===r.type&&"keyword"===n.type)return((e,t,r)=>{let n=[];for(let r of th(e))for(let e of th(t))r.axis!==e.axis&&n.push("x"===r.axis?[r.value,e.value]:[e.value,r.value]);if(0===n.length)throw TypeError(`Cannot interpolate "${r}" because "${e} ${t}" is not a valid transform-origin keyword pair`);return n[0]})(r.keyword,n.keyword,t);let o="keyword"===r.type?r:"keyword"===n.type?n:null,a="length-percentage"===r.type?r.parsed:"length-percentage"===n.type?n.parsed:null;if(null===o||null===a)throw Error("Expected a keyword and a length-percentage value");let i="keyword"===r.type;if("left"===o.keyword||"right"===o.keyword){if(!i)throw TypeError(`Cannot interpolate "${t}" because horizontal transform-origin keywords must come before a length-percentage value`);return[th(o.keyword)[0].value,a]}return"top"===o.keyword||"bottom"===o.keyword?[a,th(o.keyword)[0].value]:i?[tg,a]:[a,tg]})(t.slice(0,2),e),o=void 0===t[2]?{value:0,unit:null}:tv({component:t[2],value:e,allowPercentage:!1});return{kind:"translate",values:[r.value,n.value,o.value],units:[r.unit,n.unit,o.unit],dimensions:void 0===t[2]?2:3}})(e,t);let r=t.map(t=>((e,t)=>{let r=tm.exec(e);if(null===r)throw TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported scale, translate, or rotate value`);let n=r[2]??null,o=Number(r[1]);if(!Number.isFinite(o))throw TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(null===n)return{kind:"scale",value:o,unit:null};if(tf.has(n))return{kind:"rotate",value:o,unit:n};if(tc.has(n))return{kind:"translate",value:o,unit:n};throw TypeError(`Cannot interpolate "${t}" because "${n}" is not a supported translate or rotate unit`)})(t,e)),[{kind:n}]=r;for(let t of r)if(t.kind!==n)throw TypeError(`Cannot interpolate "${e}" because it mixes ${n} and ${t.kind} values`);if("scale"===n){let e=r[0].value,t=r[1]?.value??e;return{kind:n,values:[e,t,r[2]?.value??1],units:[null,null,null],dimensions:r.length}}return{kind:n,values:[r[0].value,r[1]?.value??0,r[2]?.value??0],units:[r[0].unit,r[1]?.unit??null,r[2]?.unit??null],dimensions:r.length}},tx=e=>e,tE=({input:e,inputRange:t,outputRange:r,options:n})=>{if(1===t.length)return r[0];let o=n?.easing,a="extend";n?.extrapolateLeft!==void 0&&(a=n.extrapolateLeft);let i="extend";n?.extrapolateRight!==void 0&&(i=n.extrapolateRight);let s=n?.posterize===void 0?e:Math.floor(e/n.posterize)*n.posterize,l=function(e,t){let r;for(r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(s,t);return function(e,t,r,n){let{extrapolateLeft:o,extrapolateRight:a,easing:i}=n,s=e,[l,u]=t,[d,f]=r;if(s<l){if("identity"===o)return s;if("clamp"===o)s=l;else if("wrap"===o){let e=u-l;s=((s-l)%e+e)%e+l}}if(s>u){if("identity"===a)return s;if("clamp"===a)s=u;else if("wrap"===a){let e=u-l;s=((s-l)%e+e)%e+l}}return d===f?d:s=(s=i(s=(s-l)/(u-l)))*(f-d)+d}(s,[t[l],t[l+1]],[r[l],r[l+1]],{easing:void 0===o?tx:"function"==typeof o?o:o[l],extrapolateLeft:a,extrapolateRight:i})};function tC(e,t){if(t.length<1)throw Error(e+" must have at least 1 element");for(let r of t){if("number"!=typeof r)throw Error(`${e} must contain only numbers`);if(!Number.isFinite(r))throw Error(`${e} must contain only finite numbers, but got [${t.join(",")}]`)}}function tR(e,t,r,n){if(void 0===e)throw Error("input can not be undefined");if(void 0===t)throw Error("inputRange can not be undefined");if(void 0===r)throw Error("outputRange can not be undefined");if(t.length!==r.length)throw Error("inputRange ("+t.length+") and outputRange ("+r.length+") must have the same length");tC("inputRange",t);for(let e=1;e<t.length;++e)if(!(t[e]>t[e-1]))throw Error(`inputRange must be strictly monotonically increasing but got [${t.join(",")}]`);!function(e,t){if(void 0===e||"function"==typeof e)return;let r=t-1;if(e.length!==r)throw Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${r}), but got length ${e.length}`);for(let t=0;t<e.length;t++)if("function"!=typeof e[t])throw Error(`easing[${t}] must be a function`)}(n?.easing,t.length);var o=n?.posterize;if(void 0!==o&&("number"!=typeof o||!Number.isFinite(o)||o<=0))throw Error(`posterize must be a positive finite number, but got ${o}`);if("number"!=typeof e)throw TypeError("Cannot interpolate an input which is not a number");if(!Array.isArray(r))throw Error("outputRange must contain only numbers");if(r.some(e=>"string"==typeof e)){if(!r.every(e=>"string"==typeof e||"number"==typeof e))throw TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate str
16ings");return(({input:e,inputRange:t,outputRange:r,options:n})=>{let o=r.map(tb),a=o[0]?.kind;if(void 0===a)throw Error("outputRange must have at least 1 element");for(let e of o)if(e.kind!==a)throw TypeError(`Cannot interpolate ${a} values with ${e.kind} values`);let i=Math.max(...o.map(e=>e.dimensions)),s=[null,null,null];if("scale"!==a)for(let e=0;e<i;e++){for(let t of o){let r=t.units[e];if(null!==r){if(null===s[e]){s[e]=r;continue}if(s[e]!==r)throw TypeError(`Cannot interpolate ${a} values with different units on axis ${e+1}: ${s[e]} and ${r}`)}}if(null===s[e])throw TypeError(`Cannot interpolate ${a} values because axis ${e+1} has no unit`)}return(({kind:e,values:t,units:r,dimensions:n})=>"scale"===e?t.slice(0,n).map(e=>ty(e)).join(" "):t.slice(0,n).map((e,t)=>`${ty(e)}${r[t]}`).join(" "))({kind:a,values:[0,0,0].map((r,a)=>tE({input:e,inputRange:t,outputRange:o.map(e=>e.values[a]),options:n})),units:s,dimensions:i})})({input:e,inputRange:t,outputRange:r,options:n})}if(r.every(e=>Array.isArray(e)))return(({input:e,inputRange:t,outputRange:r,options:n})=>Array((e=>{let t=e[0]?.length;if(void 0===t)throw Error("outputRange must have at least 1 element");if(0===t)throw TypeError("outputRange tuples must contain at least 1 number");for(let r of e){if(r.length!==t)throw TypeError(`outputRange tuples must all have the same length, but got ${t} and ${r.length}`);for(let e of r)if("number"!=typeof e||!Number.isFinite(e))throw TypeError(`outputRange tuples must contain only finite numbers, but got [${r.join(",")}]`)}return t})(r)).fill(!0).map((o,a)=>tE({input:e,inputRange:t,outputRange:r.map(e=>e[a]),options:n})))({input:e,inputRange:t,outputRange:r,options:n});if(!r.every(e=>"number"==typeof e))throw TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");return tC("outputRange",r),tE({input:e,inputRange:t,outputRange:r,options:n})}var tk={damping:10,mass:1,stiffness:100,overshootClamping:!1},tI={},tF={};function tT({frame:e,fps:t,config:r={}}){let n=[e,t,r.damping,r.mass,r.overshootClamping,r.stiffness].join("-");if(tF[n])return tF[n];let o={lastTimestamp:0,current:0,toValue:1,velocity:0,prevPosition:0},a=Math.max(0,e),i=a%1;for(let e=0;e<=Math.floor(a);e++)e===Math.floor(a)&&(e+=i),o=function({animation:e,now:t,config:r}){let{toValue:n,lastTimestamp:o,current:a,velocity:i}=e,s=Math.min(t-o,64);if(r.damping<=0)throw Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");let l=r.damping,u=r.mass,d=r.stiffness,f=[n,o,a,i,l,u,d,t].join("-");if(tI[f])return tI[f];let c=-i,m=n-a,p=l/(2*Math.sqrt(d*u)),h=Math.sqrt(d/u),g=h*Math.sqrt(1-p**2),y=s/1e3,v=Math.sin(g*y),w=Math.cos(g*y),b=Math.exp(-p*h*y),x=b*((c+p*h*m)/g*v+m*w),E=n-x,C=p*h*x-b*(w*(c+p*h*m)-g*m*v),R=Math.exp(-h*y),k=n-R*(m+(c+h*m)*y),I={toValue:n,prevPosition:a,lastTimestamp:t,current:p<1?E:k,velocity:p<1?C:R*(c*(y*h-1)+y*m*h*h)};return tI[f]=I,I}({animation:o,now:e/t*1e3,config:{...tk,...r}});return tF[n]=o,o}var t$=new Map;function tS({frame:e,fps:t,config:r={},from:n=0,to:o=1,durationInFrames:a,durationRestThreshold:i,delay:s=0,reverse:l=!1}){if(void 0!==a){if("number"!=typeof a)throw TypeError(`A "duration" of a spring must be a "number" but is "${typeof a}"`);if(Number.isNaN(a))throw TypeError('A "duration" of a spring is NaN, which it must not be');if(!Number.isFinite(a))throw TypeError('A "duration" of a spring must be finite, but is '+a);if(a<=0)throw TypeError('A "duration" of a spring must be positive, but is '+a)}(({allowFloats:e,durationInFrames:t,frame:r})=>{if(void 0===r)throw TypeError('Argument missing for parameter "frame"');if("number"!=typeof r)throw TypeError(`Argument passed for "frame" is not a number: ${r}`);if(!Number.isFinite(r))throw RangeError(`Frame ${r} is not finite`);if(r%1!=0&&!e)throw RangeError(`Argument for frame must be an integer, but got ${r}`);if(r<0&&r<-t)throw RangeError(`Cannot use frame ${r}: Duration of composition is ${t}, therefore the lowest frame that can be rendered is ${-t}`);if(r>t-1)throw RangeError(`Cannot use frame ${r}: Duration of composition is ${t}, therefore the highest frame that can be rendered is ${t-1}`)})({frame:e,durationInFrames:1/0,allowFloats:!0}),B(t,"to spring()",!1);let u=l||void 0!==a,d=u?function({fps:e,config:t={},threshold:r=.005}){if("number"!=typeof r)throw TypeError(`threshold must be a number, got ${r} of type ${typeof r}`);if(0===r)return 1/0;if(1===r)return 0;if(isNaN(r))throw TypeError("Threshold is NaN");if(!Number.isFinite(r))throw TypeError("Threshold is not finite");if(r<0)throw TypeError("Threshold is below 0");let n=[e,t.damping,t.mass,t.overshootClamping,t.stiffness,r].join("-");if(t$.has(n))return t$.get(n);B(e,"to the measureSpring() function",!1);let o=0,a=0,i=()=>tT({fps:e,frame:o,config:t}),s=i(),l=()=>Math.abs(s.current-s.toValue),u=l();for(;u>=r;)o++,s=i(),u=l();a=o;for(let e=0;e<20;e++)o++,s=i(),(u=l())>=r&&(e=0,a=o+1);return t$.set(n,a),a}({fps:t,config:r,threshold:i}):void 0,f=u?{get:()=>d}:{get:()=>{throw Error("did not calculate natural duration, this is an error with Remotion. Please report")}},c=(l?(a??f.get())-e:e)+(l?s:-s),m=void 0===a?c:c/(a/f.get());if(a&&c>a)return o;let p=tT({fps:t,frame:m,config:r}),h=r.overshootClamping?o>=n?Math.min(p.current,o):Math.max(p.current,o):p.current;return 0===n&&1===o?h:tR(h,[0,1],[n,o])}var tP=e=>Math.min(1,Math.max(0,e));class tN{static step0(e){return+(e>0)}static step1(e){return+(e>=1)}static linear(e){return e}static ease(e){return tN.bezier(.42,0,1,1)(e)}static quad(e){return e*e}static cubic(e){return e*e*e}static poly(e){return t=>t**e}static sin(e){return 1-Math.cos(e*Math.PI/2)}static circle(e){let t=tP(e);return 1-Math.sqrt(1-t*t)}static exp(e){return 2**(10*(e-1))}static elastic(e=1){let t=e*Math.PI;return e=>1-Math.cos(e*Math.PI/2)**3*Math.cos(e*t)}static back(e=1.70158){return t=>t*t*((e+1)*t-e)}static spring(e={}){return t=>t<=0?0:t>=1?1:tS({fps:30,frame:30*t,config:e,durationInFrames:30})}static bounce(e){let t=tP(e);if(t<1/2.75)return 7.5625*t*t;if(t<2/2.75){let e=t-1.5/2.75;return 7.5625*e*e+.75}if(t<2.5/2.75){let e=t-2.25/2.75;return 7.5625*e*e+.9375}let r=t-2.625/2.75;return 7.5625*r*r+.984375}static bezier(e,t,r,n){return td(e,t,r,n)}static in(e){return e}static out(e){return t=>1-e(1-t)}static inOut(e){return t=>t<.5?e(2*t)/2:1-e((1-t)*2)/2}}var tM="[-+]?\\d*\\.?\\d+",tV=tM+"%";function tA(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var tj="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function t_(e){return RegExp(e+"\\(\\s*("+tj+")\\s+("+tj+")\\s+("+tj+")(?:\\s*\\/\\s*("+tj+"))?\\s*\\)")}function tL(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function tO(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,o=2*r-n;return Math.round(255*tL(o,n,e+1/3))<<24|Math.round(255*tL(o,n,e))<<16|Math.round(255*tL(o,n,e-1/3))<<8}function tD(e){let t=Number.parseInt(e,10);return t<0?0:t>255?255:t}function tq(e){return(Number.parseFloat(e)%360+360)%360/360}function tH(e){let t=Number.parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function tW(e){let t=Number.parseFloat(e);return t<0?0:t>100?1:t/100}function tz(e,t){return"none"===e?0:e.endsWith("%")?Number.parseFloat(e)/100*t:Number.parseFloat(e)}function tU(e){return"none"===e?0:e.endsWith("rad")?180*Number.parseFloat(e)/Math.PI:e.endsWith("grad")?.9*Number.parseFloat(e):e.endsWith("turn")?360*Number.parseFloat(e):Number.parseFloat(e)}function tB(e){return void 0===e||"none"===e?1:e.endsWith("%")?Math.max(0,Math.min(1,Number.parseFloat(e)/100)):Math.max(0,Math.min(1,Number.parseFloat(e)))}function tY(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function tJ(e){return Math.max(0,Math.min(1,e))}function tK(e,t,r,n){return(Math.round(255*tJ(e))<<24|Math.round(255*tJ(t))<<16|Math.round(255*tJ(r))<<8|Math.round(255*tJ(n)))>>>0}function tG(e,t,r){let n=e+.3963377774*t+.2158037573*r,o=e-.1055613458*t-.0638541728*r,a=e-.0894841775*t-1.291485548*r,i=n*n*n,s=o*o*o,l=a*a*a;return[tY(4.0767416621*i-3.3077115913*s+.2309699292*l),tY(-1.2684380046*i+2.6097574011*s-.3413193965*l),tY(-.0041960863*i-.7034186147*s+1.707614701*l)]}function tZ(e,t,r){let n=24389/27,o=(e+16)/116,a=t/500+o,i=o-r/200,s=a*a*a,l=i*i*i,u=(s>216/24389?s:(116*a-16)/n)*.95047,d=(e>216/24389*n?((e+16)/116)**3:e/n)*1,f=(l>216/24389?l:(116*i-16)/n)*1.08883;return[tY(3.2404542*u-1.5371385*d-.4985314*f),tY(-.969266*u+1.8760108*d+.041556*f),tY(.0556434*u-.2040259*d+1.0572252*f)]}var tQ={transparent:0,aliceblue:0xf0f8ffff,antiquewhite:0xfaebd7ff,aqua:0xffffff,aquamarine:0x7fffd4ff,azure:0xf0ffffff,beige:0xf5f5dcff,bisque:0xffe4c4ff,black:255,blanchedalmond:0xffebcdff,blue:65535,blueviolet:0x8a2be2ff,brown:0xa52a2aff,burlywood:0xdeb887ff,burntsienna:0xea7e5dff,cadetblue:0x5f9ea0ff,chartreuse:0x7fff00ff,chocolate:0xd2691eff,coral:0xff7f50ff,cornflowerblue:0x6495edff,cornsilk:0xfff8dcff,crimson:0xdc143cff,cyan:0xffffff,darkblue:35839,darkcyan:9145343,dar
16kgoldenrod:0xb8860bff,darkgray:0xa9a9a9ff,darkgreen:6553855,darkgrey:0xa9a9a9ff,darkkhaki:0xbdb76bff,darkmagenta:0x8b008bff,darkolivegreen:0x556b2fff,darkorange:0xff8c00ff,darkorchid:0x9932ccff,darkred:0x8b0000ff,darksalmon:0xe9967aff,darkseagreen:0x8fbc8fff,darkslateblue:0x483d8bff,darkslategray:0x2f4f4fff,darkslategrey:0x2f4f4fff,darkturquoise:0xced1ff,darkviolet:0x9400d3ff,deeppink:0xff1493ff,deepskyblue:0xbfffff,dimgray:0x696969ff,dimgrey:0x696969ff,dodgerblue:0x1e90ffff,firebrick:0xb22222ff,floralwhite:0xfffaf0ff,forestgreen:0x228b22ff,fuchsia:0xff00ffff,gainsboro:0xdcdcdcff,ghostwhite:0xf8f8ffff,gold:0xffd700ff,goldenrod:0xdaa520ff,gray:0x808080ff,green:8388863,greenyellow:0xadff2fff,grey:0x808080ff,honeydew:0xf0fff0ff,hotpink:0xff69b4ff,indianred:0xcd5c5cff,indigo:0x4b0082ff,ivory:0xfffff0ff,khaki:0xf0e68cff,lavender:0xe6e6faff,lavenderblush:0xfff0f5ff,lawngreen:0x7cfc00ff,lemonchiffon:0xfffacdff,lightblue:0xadd8e6ff,lightcoral:0xf08080ff,lightcyan:0xe0ffffff,lightgoldenrodyellow:0xfafad2ff,lightgray:0xd3d3d3ff,lightgreen:0x90ee90ff,lightgrey:0xd3d3d3ff,lightpink:0xffb6c1ff,lightsalmon:0xffa07aff,lightseagreen:0x20b2aaff,lightskyblue:0x87cefaff,lightslategray:0x778899ff,lightslategrey:0x778899ff,lightsteelblue:0xb0c4deff,lightyellow:0xffffe0ff,lime:0xff00ff,limegreen:0x32cd32ff,linen:0xfaf0e6ff,magenta:0xff00ffff,maroon:0x800000ff,mediumaquamarine:0x66cdaaff,mediumblue:52735,mediumorchid:0xba55d3ff,mediumpurple:0x9370dbff,mediumseagreen:0x3cb371ff,mediumslateblue:0x7b68eeff,mediumspringgreen:0xfa9aff,mediumturquoise:0x48d1ccff,mediumvioletred:0xc71585ff,midnightblue:0x191970ff,mintcream:0xf5fffaff,mistyrose:0xffe4e1ff,moccasin:0xffe4b5ff,navajowhite:0xffdeadff,navy:33023,oldlace:0xfdf5e6ff,olive:0x808000ff,olivedrab:0x6b8e23ff,orange:0xffa500ff,orangered:0xff4500ff,orchid:0xda70d6ff,palegoldenrod:0xeee8aaff,palegreen:0x98fb98ff,paleturquoise:0xafeeeeff,palevioletred:0xdb7093ff,papayawhip:0xffefd5ff,peachpuff:0xffdab9ff,peru:0xcd853fff,pink:0xffc0cbff,plum:0xdda0ddff,powderblue:0xb0e0e6ff,purple:0x800080ff,rebeccapurple:0x663399ff,red:0xff0000ff,rosybrown:0xbc8f8fff,royalblue:0x4169e1ff,saddlebrown:0x8b4513ff,salmon:0xfa8072ff,sandybrown:0xf4a460ff,seagreen:0x2e8b57ff,seashell:0xfff5eeff,sienna:0xa0522dff,silver:0xc0c0c0ff,skyblue:0x87ceebff,slateblue:0x6a5acdff,slategray:0x708090ff,slategrey:0x708090ff,snow:0xfffafaff,springgreen:0xff7fff,steelblue:0x4682b4ff,tan:0xd2b48cff,teal:8421631,thistle:0xd8bfd8ff,tomato:0xff6347ff,turquoise:0x40e0d0ff,violet:0xee82eeff,wheat:0xf5deb3ff,white:0xffffffff,whitesmoke:0xf5f5f5ff,yellow:0xffff00ff,yellowgreen:0x9acd32ff},tX=e=>(e>>24&255)/255,t0=e=>e>>16&255,t1=e=>e>>8&255,t2=e=>255&e,t5=e=>{switch(e.type){case"linear":return tN.linear;case"spring":return tN.spring({damping:e.damping,mass:e.mass,overshootClamping:e.overshootClamping,stiffness:e.stiffness});case"bezier":return td(e.x1,e.y1,e.x2,e.y2);default:throw TypeError(`Unsupported easing: ${JSON.stringify(e)}`)}},t3=({frame:e,status:t})=>{let{keyframes:r,easing:n,clamping:o,interpolationFunction:a}=t;if(0===r.length)return null;let i=[...r].sort((e,t)=>e.frame-t.frame),s=i.map(e=>e.frame),l=i.map(e=>e.value);if("interpolateColors"===a){if(!l.every(e=>"string"==typeof e))return null;if(1===r.length)return l[0];try{var u={easing:n.map(t5),posterize:t.posterize};if(void 0===e)throw TypeError("input can not be undefined");if(void 0===s)throw TypeError("inputRange can not be undefined");if(void 0===l)throw TypeError("outputRange can not be undefined");if(s.length!==l.length)throw TypeError("inputRange ("+s.length+" values provided) and outputRange ("+l.length+" values provided) must have the same length");return((e,t,r,n)=>{let[o,a,i,s]=[t0,t1,t2,tX].map(o=>{let a=tR(e,t,r.map(e=>o(e)),{easing:n?.easing,extrapolateLeft:"clamp",extrapolateRight:"clamp",posterize:n?.posterize});return o===tX?Number(a.toFixed(3)):Math.round(a)});return`rgba(${o}, ${a}, ${i}, ${s})`})(e,s,l.map(e=>{let t;return((t=function(e){let t,r,n=(r={rgb:void 0,rgba:void 0,hsl:void 0,hsla:void 0,hex3:void 0,hex4:void 0,hex5:void 0,hex6:void 0,hex8:void 0,oklch:void 0,oklab:void 0,lab:void 0,lch:void 0,hwb:void 0},void 0===r.rgb&&(r.rgb=RegExp("rgb"+tA(tM,tM,tM)),r.rgba=RegExp("rgba"+tA(tM,tM,tM,tM)),r.hsl=RegExp("hsl"+tA(tM,tV,tV)),r.hsla=RegExp("hsla"
16+tA(tM,tV,tV,tM)),r.hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,r.hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,r.hex6=/^#([0-9a-fA-F]{6})$/,r.hex8=/^#([0-9a-fA-F]{8})$/,r.oklch=t_("oklch"),r.oklab=t_("oklab"),r.lab=t_("lab"),r.lch=t_("lch"),r.hwb=t_("hwb")),r);if(n.hex6&&(t=n.hex6.exec(e)))return Number.parseInt(t[1]+"ff",16)>>>0;if(void 0!==tQ[e])return tQ[e];if(n.rgb&&(t=n.rgb.exec(e)))return(tD(t[1])<<24|tD(t[2])<<16|tD(t[3])<<8|255)>>>0;if(n.rgba&&(t=n.rgba.exec(e)))return(tD(t[1])<<24|tD(t[2])<<16|tD(t[3])<<8|tH(t[4]))>>>0;if(n.hex3&&(t=n.hex3.exec(e)))return Number.parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0;if(n.hex8&&(t=n.hex8.exec(e)))return Number.parseInt(t[1],16)>>>0;if(n.hex4&&(t=n.hex4.exec(e)))return Number.parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0;if(n.hsl&&(t=n.hsl.exec(e)))return(255|tO(tq(t[1]),tW(t[2]),tW(t[3])))>>>0;if(n.hsla&&(t=n.hsla.exec(e)))return(tO(tq(t[1]),tW(t[2]),tW(t[3]))|tH(t[4]))>>>0;if(n.oklch&&(t=n.oklch.exec(e))){let e=tz(t[1],1),r=tz(t[2],.4),n=tU(t[3]),o=tB(t[4]),a=n*Math.PI/180,[i,s,l]=tG(e,r*Math.cos(a),r*Math.sin(a));return tK(i,s,l,o)}if(n.oklab&&(t=n.oklab.exec(e))){let e=tz(t[1],1),r=tz(t[2],.4),n=tz(t[3],.4),o=tB(t[4]),[a,i,s]=tG(e,r,n);return tK(a,i,s,o)}if(n.lab&&(t=n.lab.exec(e))){let e=tz(t[1],100),r=tz(t[2],125),n=tz(t[3],125),o=tB(t[4]),[a,i,s]=tZ(e,r,n);return tK(a,i,s,o)}if(n.lch&&(t=n.lch.exec(e))){let e=tz(t[1],100),r=tz(t[2],150),n=tU(t[3]),o=tB(t[4]),a=n*Math.PI/180,[i,s,l]=tZ(e,r*Math.cos(a),r*Math.sin(a));return tK(i,s,l,o)}if(n.hwb&&(t=n.hwb.exec(e))){let e=tU(t[1]),r=tz(t[2],1),n=tz(t[3],1),o=tB(t[4]),[a,i,s]=function(e,t,r){if(t+r>=1){let e=t/(t+r);return[e,e,e]}let n=tL(0,1,e+1/3),o=tL(0,1,e),a=tL(0,1,e-1/3),i=1-t-r;return[n*i+t,o*i+t,a*i+t]}(e/360,r,n);return tK(a,i,s,o)}throw Error(`invalid color string ${e} provided`)}(e))<<24|t>>>8)>>>0}),u)}catch{return null}}if("interpolate"!==a)return null;try{return tR(e,s,l,{easing:n.map(t5),extrapolateLeft:o.left,extrapolateRight:o.right,posterize:t.posterize})}catch{return null}},t4=({dragOverrideValue:e,frame:t})=>{if(void 0===e)return{type:"none"};if("static"===e.type)return{type:"resolved",value:e.value};if(null===t)return{type:"none"};let r=t3({frame:t,status:e.status});return null===r?{type:"none"}:{type:"resolved",value:r}},t6=({propStatus:e,dragOverrideValue:t,defaultValue:r,frame:n=null,shouldResortToDefaultValueIfUndef
16ined:o=!1})=>{let a=t4({dragOverrideValue:t,frame:n});return"resolved"===a.type&&void 0!==a.value?a.value:"keyframed"===e.status?null!==n?t3({frame:n,status:e}):o?r:void 0:void 0===e.codeValue&&o?r:e.codeValue},t8=(0,r.createContext)({overrideIdToNodePathMappings:{}}),t9=(0,r.createContext)({setOverrideIdToNodePath:()=>{throw Error("OverrideIdsToNodePathsSettersContext not initialized")}}),t7=e=>{let t=(0,r.useRef)(null),n=e.map(e=>e.definition),o=t.current;return null!==o&&o.length===n.length&&o.every((e,t)=>e===n[t])?o:(t.current=n,n)},re=({propStatuses:e,nodePath:t,effectIndex:r})=>{let n=e[e8(t)];if(!n)return{type:"cannot-update-sequence",reason:"not-found"};if(!n.canUpdate)return{type:"cannot-update-sequence",reason:n.reason};let o=n.effects.find(e=>e.effectIndex===r);return o?o.canUpdate?{type:"can-update-effect",props:o.props}:{type:"cannot-update-effect",reason:o.reason}:{type:"cannot-update-effect",reason:"not-found"}},rt=(e,t)=>{let r=e[e8(t)];if(r&&r.canUpdate)return r.props},rr=({effects:e,overrideId:t})=>{let n=(0,r.useRef)(null),{propStatuses:o}=(0,r.useContext)(e9),{getEffectDragOverrides:a}=(0,r.useContext)(te),i=eq(),{overrideIdToNodePathMappings:s}=(0,r.useContext)(t8),l=n.current,u=t?s[t]??null:null,d=e.map((e,t)=>{if(null===u)return{descriptor:e,params:e.params,effectKey:e.effectKey};let r=re({propStatuses:o,nodePath:u,effectIndex:t}),n="can-update-effect"===r.type?((e,t)=>{if(!e)return null;let r={},n=!1;for(let[o,a]of Object.entries(e)){if("static"===a.status){r[o]=a.codeValue,n=!0;continue}if("keyframed"===a.status){let e=t3({frame:t,status:a});null!==e&&(r[o]=e,n=!0)}}return n?r:null})(r.props,i):null,s=a(u,t),{params:l,effectKey:d}=(({descriptor:e,propStatusOverrides:t,dragOverrides:r,frame:n})=>{if(!t&&!r)return{params:e.params,effectKey:e.effectKey};let o={...e.params};if(t)for(let[e,r]of Object.entries(t))void 0!==r&&(o[e]=r);if(r)for(let[e,t]of Object.entries(r)){let r=t4({dragOverrideValue:t,frame:n});"resolved"===r.type&&(o[e]=r.value)}return{params:o,effectKey:e.definition.calculateKey(o)}})({descriptor:e,propStatusOverrides:n,dragOverrides:0===Object.keys(s).length?null:s,frame:i});return{descriptor:e,params:l,effectKey:d}});if(null!==l&&l.length===d.length&&l.every((e,t)=>e.definition===d[t].descriptor.definition&&e.effectKey===d[t].effectKey))return l;let f=d.map(({descriptor:e,params:t,effectKey:r})=>({definition:e.definition,effectKey:r,params:t,memoized:!0}));return n.current=f,f},rn=(e,t)=>{let r={};for(let n of Object.keys(e)){let o=e[n];if("hidden"!==o.type)if("enum"===o.type){r[n]=o;let e=t(n)??o.default,a=o.variants[e];a&&Object.assign(r,rn(a,t))}else r[n]=o}return r},ro=e=>{let t={},r=(e,r)=>{if(e in t)throw Error(`Duplicate key "${e}" in schema: discriminated union variants must not share keys`);t[e]=r};for(let t of Object.keys(e)){let n=e[t];if(r(t,n),"enum"===n.type)for(let e of Object.values(n.variants)){let t=ro(e);for(let e of Object.keys(t))r(e,t[e])}}return t},ra=({schema:e,key:t,value:r})=>{let n=e[t];if(!n)throw Error("Key "+JSON.stringify(t)+" not found in schema");if("string"!=typeof r)throw Error("Value must be a string, but is "+JSON.stringify(r));if("enum"!==n.type)throw Error("Key "+JSON.stringify(t)+" is not an enum");if(!n.variants[r])throw Error("Value for "+JSON.stringify(t)+" must be one of "+Object.keys(n.variants).map(e=>JSON.stringify(e)).join(", ")+", got "+JSON.stringify(r));let o=Object.keys(n.variants).filter(e=>e!==r),a=new Set;for(let e of o)for(let t of Object.keys(n.variants[e]))a.add(t);return[...a]},ri={type:"linear"},rs=e=>null!==e&&"keyframed"===e.status,rl=(e,t)=>{if(t in e)return e[t];for(let r of Object.values(e))if("enum"===r.type)for(let e of Object.values(r.variants)
16){let r=rl(e,t);if(r)return r}},ru=({schema:e,currentValue:t,overrideValues:r,propStatus:n,frame:o})=>{let a={},i=new Set;for(let s of Object.keys(t)){let l,u=n?.[s]??null,d=rl(e,s);if(d?.type!=="hidden"){if(null===u)l=t[s];else if(rs(u))if(d?.type==="array"||d?.keyframable===!1)l=t[s];else{let e=t4({dragOverrideValue:r[s],frame:o});l="resolved"===e.type?e.value:null!==o?t3({frame:o,status:u})??t[s]:t[s]}else l="computed"===u.status?t[s]:t6({propStatus:u,dragOverrideValue:r[s],defaultValue:d?.default,frame:o,shouldResortToDefaultValueIfUndefined:!1});void 0===l&&i.add(s),a[s]=l}}for(let t of Object.keys(r))if(e[t]?.type==="enum")for(let r of ra({schema:e,key:t,value:a[t]}))i.add(r);return{merged:a,propsToDelete:i}},rd=(e,t)=>{let r=t.split("."),n=e;for(let e of r){if(null==n||"object"!=typeof n)return;n=n[e]}return n},rf={},rc=({Component:e,componentIdentity:t,schema:n,supportsEffects:o})=>{let a={name:eG,...n},i=Object.keys(ro(a)),s=(0,r.forwardRef)((n,s)=>{let l=W();if(!l.isStudio||l.isReadOnlyStudio||l.isRendering)return r.default.createElement(e,{...n,controls:null,ref:s});let{propStatuses:u}=(0,r.useContext)(e9),{getDragOverrides:d}=(0,r.useContext)(te),f=(0,r.useContext)(t8),c=eq();if(n.controls)return r.default.createElement(e,{...n,ref:s});let[m]=(0,r.useState)(()=>{let{stack:e}=n;if(!e)return String(Math.random());let t=rf[e];if(t)return t;let r=String(Math.random());return rf[e]=r,r}),p=f.overrideIdToNodePathMappings[m]??null,h=i.map(e=>rd(n,e)),g=(0,r.useMemo)(()=>((e,t)=>{let r={};for(let n of t)r[n]=rd(e,n);return r})(n,i),h),y=(0,r.useMemo)(()=>({schema:a,currentRuntimeValueDotNotation:g,overrideId:m,supportsEffects:o,componentIdentity:t}),[g,m]),{merged:v,propsToDelete:w}=(0,r.useMemo)(()=>ru({schema:a,currentValue:g,overrideValues:null===p?{}:d(p),propStatus:null===p?void 0:rt(u,p),frame:c}),[g,d,p,u,c]),b=Object.keys(rn(a,e=>v[e])),x=(({props:e,valuesDotNotation:t,schemaKeys:r,propsToDelete:n})=>{let o={...e};for(let e of r){let r=t[e],n=e.split(".");if(1===n.length){o[e]=r;continue}let a=o;for(let e=0;e<n.length-1;e++){let t=n[e];"object"==typeof a[t]&&null!==a[t]?a[t]={...a[t]}:a[t]={},a=a[t]}a[n[n.length-1]]=r}return((e,t)=>{for(let r of t){let t=r.split("."),n=[e],o=e;for(let e=0;e<t.length-1;e++){let r=o[t[e]];if(null==r){o=null;break}o=r,n.push(o)}if(null!==o){delete o[t[t.length-1]];for(let e=n.length-1;e>0;e--)if(0===Object.keys(n[e]).length){let r=t[e-1];delete n[e-1][r]}else break}}})(o,n),o})({props:n,valuesDotNotation:v,schemaKeys:b,propsToDelete:w});return r.default.createElement(e,{...x,controls:y,ref:s})});return s.displayName=`withInteractivitySchema(${e.displayName||e.name||"Component"})`,s},rm=[],rp=(0,r.forwardRef)(({from:e=0,freeze:t,durationInFrames:n=1/0,children:a,name:i,height:s,width:l,showInTimeline:u=!0,hidden:d=!1,controls:f,_remotionInternalEffects:c,_remotionInternalLoopDisplay:m,_remotionInternalStack:p,_remotionInternalDocumentationLink:h,_remotionInternalPremountDisplay:y,_remotionInternalPostmountDisplay:v,_remotionInternalIsMedia:w,outlineRef:b,...x},E)=>{let{layout:C="absolute-fill"}=x,[R]=(0,r.useState)(()=>String(Math.random())),k=(0,r.useContext)(ex),{rootId:I}=eA(),F=k?k.cumulatedFrom+k.relativeFrom:0,T=(k?.absoluteFrom??0)+e,$=g();if("absolute-fill"!==C&&"none"!==C)throw TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${C}`);if("none"===C&&void 0!==x.style)throw TypeError('If layout="none", you may not pass a style. Passed: '+JSON.stringify(x.style));if("number"!=typeof n)throw TypeError(`You passed to durationInFrames an argument of type ${typeof n}, but it must be a number.`);if(n<=0)throw TypeError(`durationInFrames must be positive, but got ${n}`);if("number"!=typeof e)throw TypeError(`You passed to the "from" props of your <Sequence> an argument of type ${typeof e}, but it must be a number.`);if(!Number.isFinite(e))throw TypeError(`The "from" prop of a sequence must be finite, but got ${e}.`);if(null!=t){if("number"!=typeof t)throw TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof t}.`);if(Number.isNaN(t))throw TypeError('The "freeze" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(t))throw TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${t}.`)}let P=e_(),N=eW(),M=k?Math.min(k.durationInFrames-e,n):n,V=Math.max(0,Math.min(N.durationInFrames-e,M)),{registerSequence:A,unregisterSequence:j}=(0,r.useContext)(e4),_=(0,r.useRef)(null),L="none"===x.layout?b??null:b??_,O=(0,r.useMemo)(()=>k?.premounting||!!x._remotionInternalIsPremounting,[x._remotionInternalIsPremounting,k?.premounting]),D=(0,r.useMemo)(()=>k?.postmounting||!!x._remotionInternalIsPostmounting,[x._remotionInternalIsPostmounting,k?.postmounting]),q=F+e,H=k?k.cumulatedFrom+k.relativeFrom:0,z=Math.max(0,k?H-k.cumulatedNegativeFrom:0,q),U=q-z,B=(0,r.useMemo)(()=>({absoluteFrom:T,cumulatedFrom:F,relativeFrom:e,cumulatedNegativeFrom:U,durationInFrames:V,parentFrom:k?.relativeFrom??0,id:R,height:s??k?.height??null,width:l??k?.width??null,premounting:O,postmounting:D,premou
16ntDisplay:y??null,postmountDisplay:v??null}),[F,T,e,V,k,R,s,l,O,D,y,v,U]),Y=(0,r.useMemo)(()=>i??"",[i]),J=h??"https://www.remotion.dev/docs/sequence",K=W(),G=(0,r.useContext)(to),Z=x?.stack??null,Q=(0,r.useRef)(null);Q.current=p??Z;let X="number"==typeof t?t:null,ee=k?.cumulatedNegativeFrom??0,et=w&&"image"!==w.type?w.data.startMediaFrom+ee-U:null,er=w&&"image"!==w.type?w.data.startMediaFrom+ee:null,en=w&&"image"!==w.type&&null!==er?null===X?null:er+(m?X%m.durationInFrames:X)*w.data.playbackRate:null;(0,r.useEffect)(()=>{if(K.isStudio)return w?("image"===w.type?A({type:"image",controls:f??null,effects:c??rm,displayName:Y,documentationLink:J,duration:V,from:e,id:R,loopDisplay:m,nonce:$.get(),parent:k?.id??null,postmountDisplay:v??null,premountDisplay:y??null,rootId:I,showInTimeline:u,src:w.src,getStack:()=>Q.current,refForOutline:L??null,isInsideSeries:G,frozenFrame:X}):A({type:w.type,controls:f??null,effects:c??rm,displayName:Y,documentationLink:J,doesVolumeChange:w.data.doesVolumeChange,duration:V,from:e,id:R,loopDisplay:m,nonce:$.get(),parent:k?.id??null,playbackRate:w.data.playbackRate,postmountDisplay:v??null,premountDisplay:y??null,rootId:I,showInTimeline:u,src:w.data.src,getStack:()=>Q.current,startMediaFrom:et??w.data.startMediaFrom,volume:w.data.volumes,refForOutline:L??null,isInsideSeries:G,frozenFrame:X,frozenMediaFrame:en}),()=>{j(R)}):(A({from:e,duration:V,id:R,displayName:Y,documentationLink:J,parent:k?.id??null,type:"sequence",rootId:I,showInTimeline:u,nonce:$.get(),loopDisplay:m,getStack:()=>Q.current,premountDisplay:y??null,postmountDisplay:v??null,controls:f??null,effects:c??rm,refForOutline:L??null,isInsideSeries:G,frozenFrame:X}),()=>{j(R)})},[n,R,i,A,Y,j,k?.id,V,I,e,u,$,m,y,v,K.isStudio,f,c,w,J,L,G,X,et,en]);let eo=Math.ceil(F+e+n-1),ea=P<F+e||P>eo?null:a,ei=null===ea||null==t?ea:(0,o.jsx)(ez,{frame:t,children:ea}),es="none"===x.layout?void 0:x.style,el=(0,r.useCallback)(e=>{_.current=e,"function"==typeof E?E(e):E&&(E.current=e)},[E]),eu=(0,r.useMemo)(()=>({flexDirection:void 0,...l?{width:l}:{},...s?{height:s}:{},...es??{}}),[s,es,l]);if(null!==E&&"none"===C)throw TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');return d?null:(0,o.jsx)(ex.Provider,{value:B,children:null===ei?null:"none"===x.layout?ei:(0,o.jsx)(S,{ref:el,style:eu,className:x.className,children:ei})})}),rh=(0,r.forwardRef)((e,t)=>{let n=(0,r.useContext)(e3),a=eq()-n.premountFramesRemaining;if("none"===e.layout)throw Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');let{style:i,from:s=0,durationInFrames:l=1/0,premountFor:u=0,postmountFor:d=0,styleWhilePremounted:f,styleWhilePostmounted:c,...m}=e,p=Math.ceil(s+l-1),h=a<s&&a>=s-u,g=a>p&&a<=p+d,y=h?s:g?s+l-1:0,v=h||g,w=(0,r.useMemo)(()=>({...i,opacity:h||g?0:1,pointerEvents:h||g?"none":i?.pointerEvents??void 0,...h?f:{},...g?c:{}}),[i,h,g,f,c]);return(0,o.jsx)(ez,{frame:y,active:v,children:(0,o.jsx)(rg,{ref:t,from:s,durationInFrames:l,style:w,_remotionInternalPremountDisplay:u,_remotionInternalPostmountDisplay:d,_remotionInternalIsPremounting:h,_remotionInternalIsPostmounting:g,...m})})}),rg=(0,r.forwardRef)((e,t)=>{let r=W(),{fps:n}=eW();if("none"!==e.layout&&!r.isRendering){let r=e.premountFor;if(r||e.postmountFor)return(0,o.jsx)(rh,{ref:t,...e,premountFor:r})}return(0,o.jsx)(rp,{...e,ref:t})}),ry=rc({Component:rg,componentIdentity:"dev.remotion.remotion.Sequence",schema:e1,supportsEffects:!1});rc({Component:rg,componentIdentity:null,schema:e2,supportsEffects:!1});var rv=(e,t,r)=>{switch(e){case"fill":return[0,0,t.width,t.height,0,0,r.width,r.height];case"contain":{let e=Math.min(r.width/t.width,r.height/t.height),n=(r.width-t.width*e)/2,o=(r.height-t.height*e)/2;return[0,0,t.width,t.height,n,o,t.width*e,t.height*e]}case"cover":{let e=Math.max(r.width/t.width,r.height/t.height),n=(r.width-t.width*e)/2,o=(r.height-t.height*e)/2;return[0,0,t.width,t.height,n,o,t.width*e,t.height*e]}default:throw Error("Unknown fit: "+e)}},rw=(e,t)=>`Failed to acquire ${e} context for ${t}. Pass --gl=angle when using the CLI, set chromiumOptions: { gl: "angle" } when using SSR APIs, or set "OpenGL render backend" to "angle" in the Advanced section when rendering in the Studio. See https://remotion.dev/docs/troubleshooting/webgl2-context`,rb=e=>Error(rw("WebGL2",e));class rx{width;height;pairs=new Map;lostContexts=new Set;constructor(e,t){this.width=e,this.height=t}getPair(e){let t=this.pairs.get(e);if(t)return t;let r=[this.allocateCanvas(e),this.allocateCanvas(e)];return this.pairs.set(e,r),r}assertContextNotLost(e){if(this.lostContexts.has(e))throw Error("WebGL context was lost during canvas effect rendering. This typically happens in headless or memory-constrained environments (e.g. Remotion Lambda). Try reducing concurrency or increasing the Lambda function memory.")}allocateCanvas(e){let t=document.createElement("canvas");switch(t.width=this.width,t.height=this.height,e){case"2d":if(!t.getContext("2d",{colorSpace:"srgb"}))throw Error("Failed to acquire 2D context for canvas effect");return t;case"webgl2":{let e=t.getContext("webgl2",{premultipliedAlpha:!0,alpha:!0,preserveDrawingBuffer:!0});if(!e)throw rb("canvas effect");return t.addEventListener("webglcontextlost",e=>{e.preventDefault(),this.lostContexts.add(t)}),t.addEventListener("webglcontextrestored",()=>{this.lostContexts.delete(t)}),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t}case"webgpu":if("u"<typeof navigator||!("gpu"in navigator))throw Error("WebGPU is not available in this environment for canvas effect");return t;default:throw Error(`Unknown effect backend: ${e}`)}}}var rE=null,rC=(e,t)=>({pool:new rx(e,t),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),rR=e=>{for(let t of(e.currentRunId++,e.cleanupRegistry))t.definition.cleanup(t.state)},rk=(e,t,r)=>{let n=e.setupCache.get(t);if(n||(n=new WeakMap,e.setupCache.set(t,n)),n.has(r))return n.get(r);let o=t.setup(r);return n.set(r,o),e.cleanupRegistry.push({definition:t,state:o}),o},rI=async({state:e,source:t,effects:r,output:n,width:o,height:a})=>{let i=++e.currentRunId,s=()=>e.currentRunId!==i,l=(e=>{let t=[],r=[],n=null;for(let o of e){let{backend:e}=o.definition;null===n||e===n?r.push(o):(t.push({backend:n,effects:r}),r=[o]),n=e}return null!==n&&r.length>0&&t.push({backend:n,effects:r}),t})(r.filter(e=>!e.params.disabled)),u=t,d=null;if(0===l.length){if(t===n)return!0;let e=n.getContext("2d");if(!e)throw Error("Failed to acquire 2D context for output canvas");return e.clearRect(0,0,o,a),e.drawImage(u,0,0,o,a),!0}let f=!1;for(let e of l)if("webgpu"===e.backend){f=!0;break}let c=f?await (rE||(rE=(async()=>
16{if("u"<typeof navigator||!("gpu"in navigator))throw Error("WebGPU is not available in this environment");let{gpu:e}=navigator,t=await e.requestAdapter();if(!t)throw Error("No WebGPU adapter available");return t.requestDevice()})())):null;if(s())return!1;let m=!0;for(let t=0;t<l.length;t++){let r=l[t],[n,i]=e.pool.getPair(r.backend),f=n;for(let t of r.effects){let s=t.definition,l=rk(e,s,f);s.apply({source:u,target:f,state:l,params:t.params,width:o,height:a,gpuDevice:c,flipSourceY:"webgl2"===r.backend&&m}),"webgl2"===r.backend&&(m=!0,e.pool.assertContextNotLost(f)),u=f,f=f===n?i:n}d=u??d;let p=l[t+1];if(p&&p.backend!==r.backend&&d)if("2d"===r.backend&&"webgl2"===p.backend)u=d,m=!0;else{let e=await createImageBitmap(d);if(s())return e.close(),!1;u=e,"webgl2"===p.backend&&(m=!1)}}if(!d)return!0;let p=n.getContext("2d");if(!p)throw Error("Failed to acquire 2D context for output canvas");return p.clearRect(0,0,o,a),p.drawImage(d,0,0,o,a),!0},rF=()=>{let e=(0,r.useRef)(null),t=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{e.current&&rR(e.current)},[]),(0,r.useMemo)(()=>({get:(r,n)=>(t.current&&t.current.width===r&&t.current.height===n||(e.current&&rR(e.current),e.current=rC(r,n),t.current={width:r,height:n}),e.current)}),[])},rT=r.default.forwardRef(({width:e,height:t,fit:n,className:a,style:i,effects:s},l)=>{let u=(0,r.useRef)(null),d=rF(),f=(0,r.useMemo)(()=>"u"<typeof document?null:document.createElement("canvas"),[]),c=(0,r.useCallback)(r=>{let o=u.current,a=e??r.displayWidth,i=t??r.displayHeight;if(!o)throw Error("Canvas ref is not set");if(!f)throw Error("Source canvas is not available");f.width=a,f.height=i;let l=f.getContext("2d");if(!l)throw Error("Could not get 2d context for source canvas");return l.drawImage(r,...rv(n,{height:r.displayHeight,width:r.displayWidth},{width:a,height:i})),o.width=a,o.height=i,rI({state:d.get(a,i),source:f,effects:s,output:o,width:a,height:i})},[d,s,n,t,f,e]);return(0,r.useImperativeHandle)(l,()=>({draw:c,getCanvas:()=>{if(!u.current)throw Error("Canvas ref is not set");return u.current},clear:()=>{let e=u.current?.getContext("2d");if(!e)throw Error("Could not get 2d context");e.clearRect(0,0,u.current.width,u.current.height)}}),[c]),(0,o.jsx)("canvas",{ref:u,className:a,style:i})}),r$=({loopBehavior:e,durationFound:t,timeInSec:r})=>"loop"===e?t?r%t:r:Math.min(r,t||1/0),rS=async({resolvedSrc:e,signal:t,requestInit:r,currentTime:n,initialLoopBehavior:o})=>{if("u"<typeof ImageDecoder)throw Error("Your browser does not support the WebCodecs ImageDecoder API.");let a=await fetch(e,{...r,signal:t}),{body:i}=a;if(!i)throw Error("Got no body");let s=new ImageDecoder({data:i,type:a.headers.get("Content-Type")||"image/gif"});await s.completed;let{selectedTrack:l}=s.tracks;if(!l)throw Error("No selected track");let u=[],d=null,f=async e=>{let t=u.find(t=>t.frameIndex===e);if(t&&t.frame)return t;let r=await s.decode({frameIndex:e,completeFramesOnly:!0});return t?t.frame=r.image:u.push({frame:r.image,frameIndex:e,timeInSeconds:r.image.timestamp/1e6}),{frame:r.image,frameIndex:e,timeInSeconds:r.image.timestamp/1e6}},c=async({timeInSec:e,loopBehavior:t})=>{let r=r$({durationFound:d,loopBehavior:t,timeInSec:e}),n=u.filter(e=>e.timeInSeconds<=r).map(e=>e.frameIndex).reduce((e,t)=>Math.max(e,t),0),o=n;for(;;){let e=await f(o);if(o++,!e.frame)throw Error("No frame found");if(!e.frame.duration||(o===l.frameCount&&null===d&&(d=(e.frame.timestamp+e.frame.duration)/1e6),e.timeInSeconds>r||o===l.frameCount))break}l.frameCount-n<3&&"loop"===t&&await f(0);let a=u.filter(e=>e.frame).sort((e,t)=>Math.abs(e.timeInSeconds-r)-Math.abs(t.timeInSeconds-r));for(let e=0;e<a.length;e++)e<5||(a[e].frame=null)};return await c({timeInSec:n,loopBehavior:o}),await c({timeInSec:n,loopBehavior:o}),{getFrame:async(e,t)=>{if(null!==d&&e>d&&"clear-after-finish"===t)return null;let r=r$({loopBehavior:t,durationFound:d,timeInSec:e});await c({timeInSec:r,loopBehavior:t});let n=u.filter(e=>e.frame).reduce((e,t)=>Math.abs(e.timeInSeconds-r)<Math.abs(t.timeInSeconds-r)?e:t);if(!n.frame)throw Error("No frame found");return n},frameCount:l.frameCount}},rP={...e0,playbackRate:{type:"number",min:0,max:10,step:.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},...eU},rN=(0,r.forwardRef)(({src:e,width:t,height:n,onError:a,loopBehavior:i="loop",playbackRate:s=1,fit:l="fill",requestInit:u,effects:d,controls:f,...c},m)=>{let p="u"<typeof window?e:new URL(e,window.origin).href,[h,g]=(0,r.useState)(null),{delayRender:y,continueRender:v}=ed(),[w]=(0,r.useState)(()=>y(`Rendering <AnimatedImage/> with src="${p}"`)),b=eq(),{fps:x}=eW(),E=b/s/x,C=(0,r.useRef)(E);C.current=E;let R=(e=>{if(!e)return null;let t={...e};delete t.signal;let{headers:r,...n}=t;return JSON.stringify({...n,headers:r?Array.from(new Headers(r).entries()):null})})(u),k=(0,r.useRef)(u);k.current=u;let I=(0,r.useRef)(null),F=rr({effects:d,overrideId:f?.overrideId??null});(0,r.useImperativeHandle)(m,()=>{let e=I.current?.getCanvas();if(!e)throw Error("Canvas ref is not set");return e},[]);let[T]=(0,r.useState)(()=>i);return(0,r.useEffect)(()=>{let e=new AbortController;return rS({resolvedSrc:p,signal:e.signal,requestInit:k.current,currentTime:C.current,initialLoopBehavior:T}).then(e=>{g(e),v(w)}).catch(e=>{"AbortError"===e.name?v(w):a?(a?.(e),v(w)):Q(e)}
16),()=>{e.abort()}},[p,w,a,R,T,v]),(0,r.useLayoutEffect)(()=>{if(!h)return;let t=y(`Rendering frame at ${E} of <AnimatedImage src="${e}"/>`),r=!1;return h.getFrame(E,i).then(async e=>{if(!r){if(null===e){I.current?.clear(),v(t);return}await I.current?.draw(e.frame)&&!r&&v(t)}}).catch(e=>{r||(a?(a(e),v(t)):Q(e))}),()=>{r=!0,v(t)}},[E,h,i,a,e,v,y,F,l,t,n]),(0,o.jsx)(rT,{ref:I,width:t,height:n,fit:l,effects:F,...c})});rN.displayName="AnimatedImageContent";var rM=rc({Component:({src:e,width:t,height:n,onError:a,fit:i,playbackRate:s,loopBehavior:l,id:u,className:d,style:f,durationInFrames:c,requestInit:m,effects:p=[],controls:h,ref:g,...y})=>{let{durationInFrames:v}=eW(),w=(0,r.useRef)(null),b=t7(p);return(0,r.useImperativeHandle)(g,()=>w.current,[]),(0,o.jsx)(ry,{layout:"none",durationInFrames:c??v,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:h,_remotionInternalEffects:b,...y,outlineRef:w,children:(0,o.jsx)(rN,{src:e,width:t,height:n,onError:a,fit:i,playbackRate:s,loopBehavior:l,id:u,className:d,style:f,requestInit:m,ref:w,effects:p,controls:h})})},componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:rP,supportsEffects:!0});rM.displayName="AnimatedImage",ew(rM);var rV={type:"boolean",default:!1,description:"Disabled"},rA=e=>{if("artifact"===e.type){var t=e.filename;if("string"!=typeof t)throw TypeError(`The "filename" must be a string, but you passed a value of type ${typeof t}`);if(""===t.trim())throw Error("The `filename` must not be empty");if(!t.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g))throw Error('The `filename` must match "/^([0-9a-zA-Z-!_.*\'()/:&$@=;+,?]+)/g". Use forward slashes only, even on Windows.');if("thumbnail"!==e.contentType){var r=e.content;if("string"!=typeof r&&!(r instanceof Uint8Array))throw TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof r}`);if("string"==typeof r&&""===r.trim())throw Error("The `content` must not be empty")}}},rj=(0,r.createContext)({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]});Symbol("Thumbnail");var r_=e=>"u"<typeof window||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://")||e.startsWith("blob:")||e.startsWith("data:")?e:ne
16w URL(e,window.origin).href,rL=({trimAfter:e,mediaDurationInFrames:t,playbackRate:r,trimBefore:n})=>{let o=t;return void 0!==e&&(o=e),void 0!==n&&(o-=n),Number((o/r).toFixed(10))},rO=(0,r.createContext)(null),rD=({durationInFrames:e,times:t=1/0,children:n,name:a,showInTimeline:i,...s})=>{let l=eq(),{durationInFrames:u}=eW();if(U(e,{component:"of the <Loop /> component",allowFloats:!0}),"number"!=typeof t)throw TypeError(`You passed to "times" an argument of type ${typeof t}, but it must be a number.`);if(t!==1/0&&t%1!=0)throw TypeError(`The "times" prop of a loop must be an integer, but got ${t}.`);if(t<0)throw TypeError(`The "times" prop of a loop must be at least 0, but got ${t}`);let d=Math.min(Math.ceil(u/e),t),f="none"===s.layout?void 0:s.style,c=e*(d-1),m=Math.min(Math.floor(l/e)*e,c),p=(0,r.useMemo)(()=>({numberOfTimes:Math.min(u/e,t),startOffset:-m,durationInFrames:e}),[u,e,m,t]),h=(0,r.useMemo)(()=>({iteration:Math.floor(l/e),durationInFrames:e}),[l,e]);return(0,o.jsx)(rO.Provider,{value:h,children:(0,o.jsx)(ry,{durationInFrames:e,from:m,name:a??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:p,layout:s.layout,style:f,showInTimeline:i,children:n})})};rD.useLoop=()=>r.default.useContext(rO);var rq=({logLevel:e,tag:t,message:r,mountTime:n})=>{let o=[n?Date.now()-n+"ms ":null,t].filter(Boolean).join(" ");er.trace({logLevel:e,tag:null},`[${o}]`,r)},rH=(0,r.createContext)({}),rW={},rz=[],rU=({children:e})=>{let[t,n]=(0,r.useState)(()=>rW);return(0,r.useEffect)(()=>{let e=()=>{n(rW)};return rz.push(e),()=>{rz=rz.filter(t=>t!==e)}},[]),(0,o.jsx)(rH.Provider,{value:t,children:e})},rB=e=>{let t=e.indexOf("#");return -1===t?null:t},rY=e=>{let t,n=(0,r.useContext)(rH),o=rB(e),a=null===(t=rB(e))?e:e.slice(0,t);return n[a]?null!==o?n[a]+e.slice(o):n[a]:e},rJ=(e,t)=>{if("number"!=typeof e.volume&&"function"!=typeof e.volume&&void 0!==e.volume)throw TypeError(`You have passed a volume of type ${typeof e.volume} to your <${t} /> component. Volume must be a number or a function with the signature '(frame: number) => number' undefined.`);if("number"==typeof e.volume&&e.volume<0)throw TypeError(`You have passed a volume below 0 to your <${t} /> component. Volume must be between 0 and 1`);if("number"!=typeof e.playbackRate&&void 0!==e.playbackRate)throw TypeError(`You have passed a playbackRate of type ${typeof e.playbackRate} to your <${t} /> component. Playback rate must a real number or undefined.`);if("number"==typeof e.playbackRate&&(isNaN(e.playbackRate)||!Number.isFinite(e.playbackRate)||e.playbackRate<=0))throw TypeError(`You have passed a playbackRate of ${e.playbackRate} to your <${t} /> component. Playback rate must be a real number above 0.`);if("boolean"!=typeof e.preservePitch&&void 0!==e.preservePitch)throw TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof e.preservePitch}' instead`)},rK=({startFrom:e,endAt:t,trimBefore:r,trimAfter:n})=>{if(void 0!==e&&void 0!==r)throw TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(void 0!==t&&void 0!==n)throw TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");let o=void 0!==e||void 0!==t;if(void 0!==r||void 0!==n){if(void 0!==r){if("number"!=typeof r)throw TypeError(`type of trimBefore prop must be a number, instead got type ${typeof r}.`);if(isNaN(r)||r===1/0)throw TypeError("trimBefore prop can not be NaN or Infinity.");if(r<0)throw TypeError(`trimBefore must be greater than equal to 0 instead got ${r}.`)}if(void 0!==n){if("number"!=typeof n)throw TypeError(`type of trimAfter prop must be a number, instead got type ${typeof n}.`);if(isNaN(n))throw TypeError("trimAfter prop can not be NaN.");if(n<=0)throw TypeError(`trimAfter must be a positive number, instead got ${n}.`)}if(n<=r)throw TypeError("trimAfter prop must be greater than trimBefore prop.")}else o&&((e,t)=>{if(void 0!==e){if("number"!=typeof e)throw TypeError(`type of startFrom prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw TypeError("startFrom prop can not be NaN or Infinity.");if(e<0)throw TypeError(`startFrom must be greater than equal to 0 instead got ${e}.`)}if(void 0!==t){if("number"!=typeof t)throw TypeError(`type of endAt prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw TypeError("endAt prop can not be NaN.");
16if(t<=0)throw TypeError(`endAt must be a positive number, instead got ${t}.`)}if(t<e)throw TypeError("endAt prop must be greater than startFrom prop.")})(e,t)},rG=({startFrom:e,endAt:t,trimBefore:r,trimAfter:n})=>({trimBeforeValue:r??e??void 0,trimAfterValue:n??t??void 0}),rZ=(e,t)=>{if("got-duration"!==t.type)return e;{let r=r_(t.src);return e[r]===t.durationInSeconds?e:{...e,[r]:t.durationInSeconds}}},rQ=(0,r.createContext)({durations:{},setDurations:()=>{throw Error("context missing")}}),rX=({children:e})=>{let[t,n]=(0,r.useReducer)(rZ,{}),a=(0,r.useMemo)(()=>({durations:t,setDurations:n}),[t]);return(0,o.jsx)(rQ.Provider,{value:a,children:e})},r0=({crossOrigin:e,requestsVideoFrame:t,isClientSideRendering:r})=>null!=e?e:r||t?"anonymous":void 0,r1=({mediaRef:e,mediaType:t,onAutoPlayError:r,logLevel:n,mountTime:o,reason:a,isPlayer:i})=>{let{current:s}=e;if(!s)return;rq({logLevel:n,tag:"play",message:`Attempting to play ${s.src}. Reason: ${a}`,mountTime:o});let l=s.play();l.catch&&l.catch(e=>{if(!(!s||e.message.includes("request was interrupted by a call to pause")||e.message.includes("The operation was aborted.")||e.message.includes("The fetching process for the media resource was aborted by the user agent")||e.message.includes("request was interrupted by a new load request")||e.message.includes("because the media was removed from the document"))&&(!e.message.includes("user didn't interact with the document")||!s.muted)&&(console.log(`Could not play ${t} due to following error: `,e),!s.muted)){if(r)return void r();"video"===t&&i&&(er.info({logLevel:n,tag:"<"+t+">"},"The video will be muted and we'll retry playing it."),er.info({logLevel:n,tag:"<"+t+">"},"Use onAutoPlayError() to handle this error yourself."),s.muted=!0,s.play())}})},r2=({audioContext:e,ref:t})=>{let r=null,n=!1;return{attemptToConnect:()=>{if(n)throw Error("SharedElementSourceNode has been disposed");!r&&t.current&&(r=e.createMediaElementSource(t.current))},get:()=>{if(!r)throw Error("Audio element not connected");return r},cleanup:()=>{r&&(r.disconnect(),r=null),n=!0}}},r5=!1,r3="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",r4=(0,r.createContext)(null),r6=(0,r.createContext)(null),r8=({children:e,audioLatencyHint:t,audioEnabled:n,previewSampleRate:a})=>{let i=es(),s=a??48e3;(0,r.useEffect)(()=>{"u">typeof window&&(window.remotion_sampleRate=s)},[s]);let l=(({logLevel:e,latencyHint:t,audioEnabled:n,sampleRate:o})=>{let a=W(),i=(0,r.useRef)(o);if(o!==i.current)throw Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${i.current} Hz, but ${o} Hz was passed later.`);return(0,r.useMemo)(()=>{if(a.isRendering||!n)return null;if("u"<typeof AudioContext)return!r5&&(r5=!0,"u">typeof window&&er.warn({logLevel:e,tag:null},"AudioContext is not supported in this browser")),null;let r=new AudioContext({latencyHint:t,sampleRate:o}),i=r.createGain();i.connect(r.destination),er.trace({logLevel:e,tag:"audio"},"Creating new audio context"),r.suspend();let s=null;return{audioContext:r,gainNode:i,getState:()=>{let e=r.state;return"running"===s&&"running"!==e?"suspended-to-running":"suspended"===s&&"suspended"!==e?"running-to-suspended":e},resume:()=>{s="running";let e=r.resume();return e.finally(()=>{"running"===s&&(s=null)}),e},suspend:()=>{s="suspended";let e=r.suspend();return e.finally(()=>{"suspended"===s&&(s=null)}),e}}},[e,t,a.isRendering,n,o])})({logLevel:i,latencyHint:t,audioEnabled:n,sampleRate:s}),u=(0,r.useRef)(!1),d=(0,r.useRef)(null),f=(0,r.useMemo)(()=>({value:0}),[]),c=(0,r.useRef)([]),m=(0,r.useMemo)(()=>({dispatch:e=>{c.current.forEach(t=>t(e))},subscribe:e=>(c.current.push(e),{remove:()=>{c.current=c.current.filter(t=>t!==e)}})}),[]),p=(0,r.useRef)({scheduledEndTime:null,mediaEndTime:null}),h=(0,r.useRef)(new Map),g=(0,r.useCallback)(e=>{h.current.delete(e)},[]),y=(0,r.useMemo)(()=>({node:e,mediaTimestamp:t,scheduledTime:r,duration:n,offset:o,originalUnloopedMediaTimestamp:a})=>{if(!l)throw Error("Audio context not found");let s=l.getState();if("closed"===s)return{type:"not-started",reason:"audio context is closed"};let u=(e=>{if("suspended"===e||"running-to-suspended"===e||"interrupted"===e)return!0;
16if("running"===e||"suspended-to-running"===e)return!1;throw Error(`Unexpected audio context state: ${e}`)})(s);n>0&&(u?h.current.set(e,{scheduledTime:r,offset:o,duration:n}):e.start(r,o,n));let d=r+n/e.playbackRate.value,f=t+o,c=f+n,m=l.audioContext.baseLatency+l.audioContext.outputLatency,g=r-l.audioContext.currentTime,y=p.current,v=null!==y.scheduledEndTime&&Math.abs(r-y.scheduledEndTime)>.001,w=null!==y.mediaEndTime&&Math.abs(f-y.mediaEndTime)>.001;return er.verbose({logLevel:i,tag:"audio-scheduling"},"scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s",v?"color: red; font-weight: bold":"",r.toFixed(4),"",d.toFixed(4),w?"color: red; font-weight: bold":"",f.toFixed(4),"",c.toFixed(4),n<0||g<0?"color: red; font-weight: bold":"color: blue; font-weight: bold",n<0?"missed "+Math.abs(o).toFixed(2)+"s":Math.abs(g).toFixed(2)+(g<0?" delay":" ahead"),"","current="+l.audioContext.currentTime.toFixed(4),"offset="+o.toFixed(4),"latency="+m.toFixed(4),"state="+l.audioContext.state,a!==f?"original_ts="+a.toFixed(4):"","action="+(u?"schedule":"start"),""),y.scheduledEndTime=d,y.mediaEndTime=c,n>0?{type:"started",scheduledTime:r}:{type:"not-started",reason:"missed "+Math.abs(o).toFixed(2)+"s"}},[l,i]),v=(0,r.useCallback)(()=>{if(!l||u.current)return Promise.resolve();u.current=!0,l.gainNode.gain.cancelScheduledValues(l.audioContext.currentTime),l.gainNode.gain.setValueAtTime(0,l.audioContext.currentTime),l.gainNode.gain.linearRampToValueAtTime(1,l.audioContext.currentTime+.03),h.current.forEach((e,t)=>{t.start(e.scheduledTime,e.offset,e.duration)}),h.current.clear();let e=l.resume();return d.current=new Promise(t=>{let r;(r=l.audioContext,new Promise(e=>{let t=r.currentTime,n=r.getOutputTimestamp().performanceTime,o=performance.now(),a=()=>{let{currentTime:s}=r,l=r.getOutputTimestamp(),u=performance.now()-o;if(void 0!==n&&void 0!==l.performanceTime&&l.performanceTime>n&&void 0!==l.contextTime&&l.contextTime>t){er.verbose({logLevel:i,tag:"audio"},`waitUntilActuallyResumed: getOutputTimestamp.performanceTime advanced from ${n.toFixed(6)} to ${l.performanceTime.toFixed(6)} after ${u.toFixed(1)}ms. currentTime=${s.toFixed(6)} (advanced by ${(s-t).toFixed(6)}), getOutputTimestamp.performanceTime=${l.performanceTime?.toFixed(1)??"undefined"}`),e();return}requestAnimationFrame(a)};requestAnimationFrame(a)})).then(t),e.catch(e=>{er.warn({logLevel:i,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",e),t()})}).finally(()=>{d.current=null}),e.catch(()=>{})},[l,i]),w=(0,r.useCallback)(()=>d.current,[]),b=(0,r.useCallback)(()=>l&&u.current?(u.current=!1,l.suspend()):Promise.resolve(),[l]),x=(0,r.useMemo)(()=>({audioContext:l?.audioContext??null,getAudioContextState:()=>l?.getState()??null,gainNode:l?.gainNode??null,audioSyncAnchor:f,audioSyncAnchorEmitter:m,scheduleAudioNode:y,resume:v,suspend:b,getIsResumingAudioContext:w,unscheduleAudioNode:g}),[l,f,m,y,v,b,w,g]);return(0,o.jsx)(r4.Provider,{value:x,children:e})},r9=({children:e,numberOfAudioTags:t})=>{let n=(0,r.useRef)([]),[a]=(0,r.useState)(t);if(t!==a)throw Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");let i=es(),s=el(),l=W(),u=(0,r.useContext)(r4),d=u?.audioContext??null,f=u?.resume,c=(0,r.useMemo)(()=>Array(t).fill(!0).map(()=>{let e=(0,r.createRef)();return{id:Math.random(),ref:e,mediaElementSourceNode:d?r2({audioContext:d,ref:e}):null}}),[d,t]);(r.default.useInsertionEffect??r.default.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{c.forEach(({mediaElementSourceNode:e})=>{e?.cleanup()})})},[c]);let m=(0,r.useRef)(Array(t).fill(!1)),p=(0,r.useCallback)(()=>{c.forEach(({ref:e,id:t})=>{let r=n.current?.find(e=>e.id===t),{current:o}=e;if(o){if(void 0===r){o.src=r3;return}if(!r)throw TypeError("Expected audio data to be there");Object.keys(r.props).forEach(e=>{var t,n;t=r.props[e],n=o[e],("src"!==e||n.startsWith("data:")||t.startsWith("data:")?n===t||0:new URL(n,window.origin).toString()===new URL(t,window.origin).toString())||(o[e]=r.props[e])})}})},[c]),h=(0,r.useCallback)(e=>
16{let{aud:r,audioId:o,premounting:a,postmounting:i}=e,s=n.current?.find(e=>e.audioId===o);if(s)return s;let l=m.current.findIndex(e=>!1===e);if(-1===l)throw Error(`Tried to simultaneously mount ${t+1} <Html5Audio /> tags at the same time. With the current settings, the maximum amount of <Html5Audio /> tags is limited to ${t} at the same time. Remotion pre-mounts silent audio tags to help avoid browser autoplay restrictions. See https://remotion.dev/docs/player/autoplay#using-the-numberofsharedaudiotags-prop for more information on how to increase this limit.`);let{id:u,ref:d,mediaElementSourceNode:f}=c[l],h=[...m.current];h[l]=u,m.current=h;let g={props:r,id:u,el:d,audioId:o,mediaElementSourceNode:f,premounting:a,audioMounted:!!d.current,postmounting:i,cleanupOnMediaTagUnmount:()=>{}};return n.current?.push(g),p(),g},[t,c,p]),g=(0,r.useCallback)(e=>{let t=[...m.current],r=c.findIndex(t=>t.id===e);if(-1===r)throw TypeError("Error occured in ");t[r]=!1,m.current=t,n.current=n.current?.filter(t=>t.id!==e),p()},[c,p]),y=(0,r.useCallback)(({aud:e,audioId:t,id:r,premounting:o,postmounting:a})=>{let i=!1;n.current=n.current?.map(n=>{let s=!!n.el.current;return(n.audioMounted!==s&&(i=!0),n.id===r)?((e,t)=>{let r=Object.keys(e).sort(),n=Object.keys(t).sort();if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==n[o]||e[r[o]]!==t[n[o]])return!1;return!0})(e,n.props)&&n.premounting===o&&n.postmounting===a?n:(i=!0,{...n,props:e,premounting:o,postmounting:a,audioId:t,audioMounted:s}):n}),i&&p()},[p]),v=(0,r.useCallback)(()=>{c.forEach(e=>{let t=n.current.find(t=>t.el===e.ref);t?.premounting||r1({mediaRef:e.ref,mediaType:"audio",onAutoPlayError:null,logLevel:i,mountTime:s,reason:"playing all audios",isPlayer:l.isPlayer})}),f?.()},[i,s,c,l.isPlayer,f]),w=(0,r.useMemo)(()=>({registerAudio:h,unregisterAudio:g,updateAudio:y,playAllAudios:v,numberOfAudioTags:t}),[t,v,h,g,y]);return(0,o.jsxs)(r6.Provider,{value:w,children:[c.map(({id:e,ref:t})=>(0,o.jsx)("audio",{ref:t,preload:"metadata",src:r3},e)),e]})},r7=(e,t)=>1e-5>Math.abs(e-t),ne=(e,t)=>Math.round(e/t*100)/100,nt=()=>
16!("u"<typeof window)&&!!/AppleWebKit/.test(window.navigator.userAgent)&&!window.navigator.userAgent.includes("Chrome/"),nr=()=>!("u"<typeof window)&&/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&nt(),nn=({actualFrom:e,fps:t})=>ne(Math.max(0,-e),t),no=!1,na=({mediaRef:e,volume:t,logLevel:n,source:o,shouldUseWebAudioApi:a})=>{let i=(0,r.useRef)(null),s=(0,r.useRef)(t);s.current=t;let l=(0,r.useContext)(r4);if(!l)throw Error("useAmplification must be used within a SharedAudioContext");let{audioContext:u,gainNode:d}=l;return"u">typeof window&&(0,r.useLayoutEffect)(()=>{if(!u||!e.current||!a)return;if(1!==e.current.playbackRate&&nt())return void(!no&&(no=!0,er.warn({logLevel:n,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),er.warn({logLevel:n,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),er.warn({logLevel:n,tag:null},n,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set.")));if(!o||!d)return;let t=new GainNode(u,{gain:s.current});return o.attemptToConnect(),o.get().connect(t),t.connect(d),i.current={gainNode:t},er.trace({logLevel:n,tag:null},`Starting to amplify ${e.current?.src}. Gain = ${s.current}, playbackRate = ${e.current?.playbackRate}`),()=>{i.current=null,t.disconnect(),o.get().disconnect()}},[n,e,u,o,a,d]),i.current&&(r7(i.current.gainNode.gain.value,t)||(i.current.gainNode.gain.value=t,er.trace({logLevel:n,tag:null},`Setting gain to ${t} for ${e.current?.src}`))),(nt()&&e.current&&e.current?.playbackRate!==1||!a)&&e.current&&!r7(t,e.current?.volume)&&(e.current.volume=Math.min(t,1)),i},ni=()=>{let e=(0,r.useContext)(ex);return e?.cumulatedNegativeFrom??0},ns=e=>{let t=rD.useLoop(),r=eq(),n=ni();return"repeat"===e||null===t?r+n:r+n+t.durationInFrames*t.iteration},nl=e=>{if(/data:|blob:/.test(e.substring(0,5)))return"Data URL";let t=e.split("/").map(e=>e.split("\\")).flat(1);return t[t.length-1]},nu=({frame:e,volume:t,mediaVolume:r=1})=>{if("number"==typeof t)return t*r;if(void 0===t)return Number(r);let n=t(e)*r;if("number"!=typeof n)throw TypeError(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof n} for frame ${e}`);if(Number.isNaN(n))throw TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${e}.`);if(!Number.isFinite(n))throw TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${e}.`);return Math.max(0,n)},nd={},nf=({volume:e,mediaVolume:t,mediaType:n,src:o,displayName:a,trimBefore:i,trimAfter:s,playbackRate:l,sequenceDurationInFrames:u,mediaStartsAt:d,loop:f})=>{if(!o)throw Error("No src passed");let c=(0,r.useContext)(ex),[m]=(0,r.useState)(()=>e),p=(({compositionDurationInFrames:e,playbackRate:t,trimBefore:r,trimAfter:n,parentSequenceDurationInFrames:o,loop:a})=>{if(a)return e;let i=rL({mediaDurationInFrames:e*t+(r??0),playbackRate:t,trimBefore:r,trimAfter:n});return null!==o?Number(Math.min(o*t,i).toFixed(10)):i})({compositionDurationInFrames:u,playbackRate:l,trimBefore:i,trimAfter:s,parentSequenceDurationInFrames:c?.durationInFrames??null,loop:f}),h=(0,r.useMemo)(()=>"number"==typeof e?e:Array(Math.floor(Math.max(0,p+d))).fill(!0).map((r,n)=>nu({frame:n+d,volume:e,mediaVolume:t})).join(","),[p,d,e,t]);(0,r.useEffect)(()=>{var t;"number"==typeof e&&e!==m&&(nd[t=`Remotion: The ${n} with src ${o} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`]||(console.warn(t),nd[t]=!0))},[m,n,o,e]);let y="function"==typeof e,v=g(),{rootId:w}=eA(),b=0-d+(i??0);return(0,r.useMemo)(()=>({volumes:h,duration:p,doesVolumeChange:y,nonce:v,rootId:w,finalDisplayName:a??nl(o),startMediaFrom:b,src:o,playbackRate:l}),[h,p,y,v,w,a,o,b,l])},nc=({volume:e,mediaVolume:t,src:n,mediaType:o,playbackRate:a,displayName:i,id:s,getStack:l,showInTimeline:u,premountDisplay:d,postmountDisplay:f,loopDisplay:c,documentationLink:m,refForOutline:p})=>{let h=(0,r.useContext)(ex),g=ni(),{registerSequence:y,unregisterSequence:v}=(0,r.useContext)(e4),{durationInFrames:w}=eW(),{volumes:b,duration:x,doesVolumeChange:E,nonce:C,rootId:R,finalDisplayName:k}=nf({volume:e,mediaVolume:t,mediaType:o,src:n,displayName:i,trimAfter:void 0,trimBefore:void 0,playbackRate:a,sequenceDurationInFrames:w,mediaStartsAt
16:ni(),loop:!1}),{isStudio:I}=W();(0,r.useEffect)(()=>{if(!n)throw Error("No src passed");if((I||window.process?.env?.NODE_ENV==="test")&&u)return y({type:o,src:n,id:s,duration:x,from:0,parent:h?.id??null,displayName:k,documentationLink:m,rootId:R,volume:b,showInTimeline:!0,nonce:C.get(),startMediaFrom:0-g,doesVolumeChange:E,loopDisplay:c,playbackRate:a,getStack:l,premountDisplay:d,postmountDisplay:f,controls:null,effects:[],refForOutline:p,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{v(s)}},[x,s,h,n,y,v,b,E,C,o,g,a,l,u,d,f,c,m,R,k,I,p])},nm=r.default.createContext(null),np=({children:e})=>{let{logLevel:t,mountTime:n}=(0,r.useContext)(ei),a=((e,t)=>{let[n,o]=(0,r.useState)([]),[a,i]=(0,r.useState)([]),[s,l]=(0,r.useState)([]),u=W().isRendering,d=(0,r.useRef)(!1),f=(0,r.useCallback)(e=>{if(u)return{unblock:()=>{}};let t=!1;return o(t=>[...t,e]),{unblock:()=>{t||(t=!0,o(t=>{let r=t.filter(t=>t!==e);return r.length===t.length?t:r}))}}},[u]),c=(0,r.useCallback)(e=>(i(t=>[...t,e]),{remove:()=>{i(t=>t.filter(t=>t!==e))}}),[]),m=(0,r.useCallback)(e=>(l(t=>[...t,e]),{remove:()=>{l(t=>t.filter(t=>t!==e))}}),[]);return(0,r.useEffect)(()=>{!u&&n.length>0&&(a.forEach(e=>e()),rq({logLevel:e,message:"Player is entering buffer state",mountTime:t,tag:"player"}))},[n]),"u">typeof window&&(0,r.useLayoutEffect)(()=>{u||0===n.length&&(s.forEach(e=>e()),rq({logLevel:e,message:"Player is exiting buffer state",mountTime:t,tag:"player"}))},[n]),(0,r.useMemo)(()=>({addBlock:f,listenForBuffering:c,listenForResume:m,buffering:d}),[f,d,c,m])})(t??"info",n);return(0,o.jsx)(nm.Provider,{value:a,children:e})},nh=e=>{let[t,n]=(0,r.useState)(e.buffering.current);return(0,r.useEffect)(()=>(e.listenForBuffering(()=>{n(!0)}),e.listenForResume(()=>{n(!1)}),()=>{e.listenForBuffering(()=>{}),e.listenForResume(()=>{})}),[e]),t},ng=()=>{let e=(0,r.useContext)(nm),t=es(),n=e?e.addBlock:null;return(0,r.useMemo)(()=>({delayPlayback:()=>{if(!n)throw Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");er.trace({logLevel:t,tag:"[buffer-state]"},"Adding buffer handle",Error().stack);let{unblock:e}=n({id:String(Math.random())}),r=!1;return{unblock:()=>{r||(r=!0,er.trace({logLevel:t,tag:"[buffer-state]"},"Removing buffer handle"),e())}}}}),[n,t])},ny=({mediaRef:e,time:t,logLevel:r,why:n,mountTime:o})=>{let a=nr()?Number(t.toFixed(1)):t;return rq({logLevel:r,tag:"seek",message:`Seeking from ${e.currentTime} to ${a}. src= ${e.src} Reason: ${n}`,mountTime:o}),e.currentTime=a,a},nv=({frame:e,playbackRate:t,startFrom:r})=>tR(e,[-1,r,r+1],[-1,r,r+t]),nw=({fps:e,frame:t,playbackRate:r,startFrom:n})=>1e3/e*nv({frame:t,playbackRate:r,startFrom:n})/1e3,nb={},nx=({mediaRef:e,src:t,mediaType:n,playbackRate:o,preservePitch:a=!0,onlyWarnForMediaSeekingError:i,acceptableTimeshift:s,pauseWhenBuffering:l,isPremounting:u,isPostmounting:d,onAutoPlayError:f})=>{let c,m,{playbackRate:p}=ej(),h=eq(),g=e_(),[y]=eD(),v=(0,r.useContext)(nm),{fps:w}=eW(),b=ni(),x=(0,r.useRef)(null),E=(0,r.useRef)(null),C=es(),R=el();if(!v)throw Error("useMediaPlayback must be used inside a <BufferingContext>");let k=(0,r.useRef)({}),I=(0,r.useCallback)(()=>{!t||k.current[t]||(er.verbose({logLevel:C,tag:null},`Detected ${t} as a variable FPS video. Disabling buffering while seeking.`),k.current[t]=!0)},[C,t]),F=(({mediaRef:e,mediaType:t,lastSeek:n,onVariableFpsVideoDetected:o})=>{let a=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let{current:r}=e;if(r)a.current={time:r.currentTime,lastUpdate:performance.now()};else{a.current=null;return}if("video"!==t){a.current=null;return}if(!r.requestVideoFrameCallback)return;let i=()=>{},s=()=>{if(!r)return;let e=r.requestVideoFrameCallback((e,t)=>{if(null!==a.current){let e=Math.abs(a.current.time-t.mediaTime),r=Math.abs(null===n.current?1/0:t.mediaTime-n.current);e>.5&&r>.5&&t.mediaTime>a.current.time&&o()}a.current={time:t.mediaTime,lastUpdate:performance.now()},s()});i=()=>{r.cancelVideoFrameCallback(e),i=()=>{}}};return s(),()=>{i()}},[n,e,t,o]),a})({mediaRef:e,mediaType:n,lastSeek:E,onVariableFpsVideoDetected:I}),T=(c=r.default.useRef({time:e.current?.currentTime??0,lastUpdate:performance.now()}),null!==(m=e.current?.currentTime??null)&&c.current.time!==m&&(c.current.time=m,c.current.lastUpdate=performance.now()),c),$=nw({frame:h,playbackRate:o,startFrom:-b,fps:w}),S=(({element:e,shouldBuffer:t,isPremounting:n,isPostmounting:o,logLevel:a,mountTime:i,src:s})=>{let l=ng(),[u,d]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let r=[],{current:u}=e;if(!u||!t)return;if(n||o){if((n||o)&&u.readyState<u.HAVE_FUTURE_DATA&&!navigator.userAgent.includes("Firefox/")){rq({logLevel:a,message:`Calling .load() on ${u.src} because readyState is ${u.readyState} and it is not Firefox. Element is premounted ${u.playbackRate}`,tag:"load",mountTime:i});let e=u.playbackRate;u.load(),u.playbackRate=e}return}let f=e=>{let t=!1;r.forEach(r=>{r(e),t=!0}),r=[],d(e=>(e&&(t=!0),!1)),t&&rq({logLevel:a,message:`Unmarking as buffering: ${u.src}. Reason: ${e}`,tag:"buffer",mountTime:i})},c=e=>{d(!0),rq({logLevel:a,message:`Marking as buffering: ${u.src}. Reason: ${e}`,tag:"buffer",mountTime:i});let{unblock:t}=l.delayPlayback(),n=()=>{f('"canplay" was fired'),m()},o=()=>{f('"error" event was occurred'),m()};u.addEventListener("canplay",n,{once:!0}),r.push(()=>{u.removeEventListener("canplay",n)}),u.addEventListener("error",o,{once:!0}),r.push(()=>{u.removeEventListener("error",o)}),r.push(e=>{rq({logLevel:a,message:`Unblocking ${u.src} from buffer. Reason: ${e}`,tag:"buffer",mountTime:i}),t()})},m=()=>{if(u.readyState<u.HAVE_FUTURE_DATA){if(c(`readyState is ${u.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){rq({logLevel:a,message:`Calling .load() on ${s} because readyState is ${u.readyState} and it is not Firefox. ${u.playbackRate}`,tag:"load",mountTime:i});let e=u.playbackRate;u.load(),u.playbackRate=e}}else{let e=()=>{c('"waiting" event was fired')};u.addEventListener("waiting",e),r.push(()=>{u.removeEventListener("waiting",e)})}};return m(),()=>{f("element was unmounted or prop changed")}},[l,s,e,n,o,a,t,i]),u})({element:e,shouldBuffer:l,isPremounting:u,isPostmounting:d,logLevel:C,mountTime:R,src:t??null}
16),{bufferUntilFirstFrame:P,isBuffering:N}=(({mediaRef:e,mediaType:t,onVariableFpsVideoDetected:n,pauseWhenBuffering:o,logLevel:a,mountTime:i})=>{let s=(0,r.useRef)(!1),{delayPlayback:l}=ng(),u=(0,r.useCallback)(r=>{if("video"!==t||!o)return;let u=e.current;if(!u)return;if(u.readyState>=u.HAVE_FUTURE_DATA&&!/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent))return void rq({logLevel:a,message:`Not using buffer until first frame, because readyState is ${u.readyState} and is not Safari or Desktop Chrome`,mountTime:i,tag:"buffer"});if(!u.requestVideoFrameCallback)return void rq({logLevel:a,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:i,tag:"buffer"});s.current=!0,rq({logLevel:a,message:`Buffering ${e.current?.src} until the first frame is received`,mountTime:i,tag:"buffer"});let d=l(),f=()=>{d.unblock(),u.removeEventListener("ended",f,{once:!0}),u.removeEventListener("pause",f,{once:!0}),s.current=!1},c=()=>{f()};u.requestVideoFrameCallback((e,t)=>{Math.abs(t.mediaTime-r)>.5&&n(),f()}),u.addEventListener("ended",c,{once:!0}),u.addEventListener("pause",c,{once:!0}),u.addEventListener("canplay",c,{once:!0})}
16,[l,a,e,t,i,n,o]);return(0,r.useMemo)(()=>({isBuffering:()=>s.current,bufferUntilFirstFrame:u}),[u])})({mediaRef:e,mediaType:n,onVariableFpsVideoDetected:I,pauseWhenBuffering:l,logLevel:C,mountTime:R}),M=o*p,V=e.current?.duration?Math.min(e.current.duration,s??.65):s??.65,A=nh(v);(0,r.useEffect)(()=>{if(e.current?.paused)return;if(!y){rq({logLevel:C,tag:"pause",message:`Pausing ${e.current?.src} because ${u?"media is premounting":d?"media is postmounting":"Player is not playing"}`,mountTime:R}),e.current?.pause();return}let t=S||N();v.buffering.current&&!t&&(rq({logLevel:C,tag:"pause",message:`Pausing ${e.current?.src} because player is buffering but media tag is not`,mountTime:R}),e.current?.pause())},[N,S,v,A,u,C,e,n,R,y,d]);let j=W();(0,r.useLayoutEffect)(()=>{let t=Math.max(0,M);e.current&&e.current.playbackRate!==t&&(e.current.playbackRate=t),e.current&&e.current.preservesPitch!==a&&(e.current.preservesPitch=a)},[e,M,a]),(0,r.useEffect)(()=>{let r="audio"===n?"<Html5Audio>":"<Html5Video>";if(!e.current)throw Error(`No ${n} ref found`);if(!t)throw Error(`No 'src' attribute was passed to the ${r} element.`);let{duration:o}=e.current,a=!Number.isNaN(o)&&Number.isFinite(o)?Math.min(o,$):$,s=T.current.time,c=F.current?.time??null,m=k.current[t],p=Math.abs(a-s),h=c?Math.abs(a-c):null,w=F.current?.lastUpdate&&F.current.time>T.current.lastUpdate?h:p,b=h&&!m?w:p;if(b>V&&x.current!==a){E.current=ny({mediaRef:e.current,time:a,logLevel:C,why:`because time shift is too big. shouldBeTime = ${a}, isTime = ${s}, requestVideoCallbackTime = ${c}, timeShift = ${b}${m?", isVariableFpsVideo = true":""}, isPremounting = ${u}, isPostmounting = ${d}, pauseWhenBuffering = ${l}`,mountTime:R}),x.current=E.current,y&&(M>0&&P(a),e.current.paused&&r1({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:C,mountTime:R,reason:"player is playing but media tag is paused, and just seeked",isPlayer:j.isPlayer})),i||((e,t)=>{if(null===e||0===e.seekable.length||e.seekable.length>1||nb[e.src])return;let r={start:e.seekable.start(0),end:e.seekable.end(0)};if(0===r.start&&0===r.end){let r=[`The media ${e.src} cannot be seeked. This could be one of few reasons:`,"1) The media resource was replaced while the video is playing but it was not loaded yet.","2) The media does not support seeking.","3) The media was loaded with security headers prventing it from being included.","Please see https://remotion.dev/docs/non-seekable-media for assistance."].join(`
17`);if("console-error"===t)console.error(r);else if("console-warning"===t)console.warn(`The media ${e.src} does not support seeking. The video will render fine, but may not play correctly in the Remotion Studio and in the <Player>. See https://remotion.dev/docs/non-seekable-media for an explanation.`);else throw Error(r);nb[e.src]=!0}})(e.current,i?"console-warning":"console-error");return}let I=y?.15:.01,A=Math.abs(e.current.currentTime-a)>I,_=S||N(),L=v.buffering.current&&!_;if(!y||L){A&&(E.current=ny({mediaRef:e.current,time:a,logLevel:C,why:`not playing or something else is buffering. time offset is over seek threshold (${I})`,mountTime:R}));return}if(!y||v.buffering.current)return;let O=e.current.paused&&!e.current.ended,D=0===g;if(O||D){let t=O?"media tag is paused":"absolute frame is 0";A&&(E.current=ny({mediaRef:e.current,time:a,logLevel:C,why:`is over timeshift threshold (threshold = ${I}) and ${t}`,mountTime:R})),r1({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:C,mountTime:R,reason:`player is playing and ${t}`,isPlayer:j.isPlayer}),!m&&M>0&&P(a)}},[g,V,P,v.buffering,F,C,$,N,S,e,n,i,M,y,t,f,u,d,l,R,T,j.isPlayer])},nE=({mediaRef:e,id:t,mediaType:n,onAutoPlayError:o,isPremounting:a,isPostmounting:i})=>{let{audioAndVideoTags:s,imperativePlaying:l}=eA(),u=es(),d=el(),f=W();(0,r.useEffect)(()=>(s.current.push({id:t,play:t=>{if(l.current&&!a&&!i)return r1({mediaRef:e,mediaType:n,onAutoPlayError:o,logLevel:u,mountTime:d,reason:t,isPlayer:f.isPlayer})}}),()=>{s.current=s.current.filter(e=>e.id!==t)}),[s,t,e,n,o,l,a,i,u,d,f.isPlayer])},nC=(0,r.createContext)({mediaMuted:!1,mediaVolume:1}),nR=(0,r.createContext)({setMediaMuted:()=>{throw Error("default")},setMediaVolume:()=>{throw Error("default")}}),nk=()=>{let{mediaVolume:e}=(0,r.useContext)(nC),{setMediaVolume:t}=(0,r.useContext)(nR);return(0,r.useMemo)(()=>[e,t],[e,t])},nI=()=>{let{mediaMuted:e}=(0,r.useContext)(nC),{setMediaMuted:t}=(0,r.useContext)(nR);return(0,r.useMemo)(()=>[e,t],[e,t])},nF=e=>{if(e>=100)throw Error(`Volume was set to ${e}, but regular volume is 1, not 100. Did you forget to divide by 100? Set a volume of less than 100 to dismiss this error.`)},nT=(0,r.forwardRef)((e,t)=>
17{let[n]=(0,r.useState)(e.shouldPreMountAudioTags);if(e.shouldPreMountAudioTags!==n)throw Error("Cannot change the behavior for pre-mounting audio tags dynamically.");let a=es(),{volume:i,muted:s,playbackRate:l,preservePitch:u,shouldPreMountAudioTags:d,src:f,onDuration:c,acceptableTimeShiftInSeconds:m,_remotionInternalNeedsDurationCalculation:p,_remotionInternalNativeLoopPassed:h,_remotionInternalStack:g,allowAmplificationDuringRender:y,name:v,pauseWhenBuffering:w,showInTimeline:b,loopVolumeCurveBehavior:x,stack:E,crossOrigin:C,delayRenderRetries:R,delayRenderTimeoutInMilliseconds:k,toneFrequency:I,useWebAudioApi:F,onError:T,onNativeError:$,audioStreamIndex:S,...P}=e,[N]=nk(),[M]=nI(),V=ns(x??"repeat");if(!f)throw TypeError("No 'src' was passed to <Html5Audio>.");let A=rY(f),j=(0,r.useContext)(ex),[_]=(0,r.useState)(()=>String(Math.random())),L=nu({frame:V,volume:i,mediaVolume:N});nF(L);let O=r0({crossOrigin:C,requestsVideoFrame:!1,isClientSideRendering:!1}),D=(0,r.useMemo)(()=>({muted:s||M||L<=0,src:A,loop:h,crossOrigin:O,...P}),[h,M,s,P,A,L,O]),{el:q,mediaElementSourceNode:H,cleanupOnMediaTagUnmount:W}=(({aud:e,audioId:t,premounting:n,postmounting:o})=>{let a=(0,r.useContext)(r4),i=(0,r.useContext)(r6),[s]=(0,r.useState)(()=>{if(i&&i.numberOfAudioTags>0)return i.registerAudio({aud:e,audioId:t,premounting:n,postmounting:o});let s=r.default.createRef(),l=a?.audioContext?r2({audioContext:a.audioContext,ref:s}):null;return{el:s,id:Math.random(),props:e,audioId:t,mediaElementSourceNode:l,premounting:n,audioMounted:!!s.current,postmounting:o,cleanupOnMediaTagUnmount:()=>{l?.cleanup()}}}),l=r.default.useInsertionEffect??r.default.useLayoutEffect;return"u">typeof document&&(l(()=>{i&&i.numberOfAudioTags>0&&i.updateAudio({id:s.id,aud:e,audioId:t,premounting:n,postmounting:o})},[e,i,s.id,t,n,o]),l(()=>()=>{i&&i.numberOfAudioTags>0&&i.unregisterAudio(s.id)},[i,s.id])),s})({aud:D,audioId:(0,r.useMemo)(()=>`audio-${eR(f??"")}-${j?.relativeFrom}-${j?.cumulatedFrom}-${j?.durationInFrames}-muted:${e.muted}-loop:${e.loop}`,[f,j?.relativeFrom,j?.cumulatedFrom,j?.durationInFrames,e.muted,e.loop]),premounting:!!j?.premounting,postmounting:!!j?.postmounting});nc({volume:i,mediaVolume:N,src:f,mediaType:"audio",playbackRate:l??1,displayName:v??null,id:_,getStack:(0,r.useCallback)(()=>g??null,[g]),showInTimeline:b,premountDisplay:j?.premountDisplay??null,postmountDisplay:j?.postmountDisplay??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),nx({mediaRef:q,src:f,mediaType:"audio",playbackRate:l??1,preservePitch:u,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:m??null,isPremounting:!!j?.premounting,isPostmounting:!!j?.postmounting,pauseWhenBuffering:w,onAutoPlayError:null}),nE({id:_,isPostmounting:!!j?.postmounting,isPremounting:!!j?.premounting,mediaRef:q,mediaType:"audio",onAutoPlayError:null}),na({logLevel:a,mediaRef:q,source:H,volume:L,shouldUseWebAudioApi:F??!1}),(r.default.useInsertionEffect??r.default.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{W()})},[W]),(0,r.useImperativeHandle)(t,()=>q.current,[q]);let z=(0,r.useRef)(c);return(z.current=c,(0,r.useEffect)(()=>{let{current:e}=q;if(!e)return;if(e.duration)return void z.current?.(e.src,e.duration);let t=()=>{z.current?.(e.src,e.duration)};return e.addEventListener("loadedmetadata",t),()=>{e.removeEventListener("loadedmetadata",t)}},[q,f]),n)?null:(0,o.jsx)("audio",{ref:q,preload:"metadata",crossOrigin:O,...D})}),n$=(0,r.forwardRef)((e,t)=>{let n=(0,r.useRef)(null),{volume:a,playbackRate:i,allowAmplificationDuringRender:s,onDuration:l,toneFrequency:u,_remotionInternalNeedsDurationCalculation:d,_remotionInternalNativeLoopPassed:f,acceptableTimeShiftInSeconds:c,name:m,onNativeError:p,delayRenderRetries:h,delayRenderTimeoutInMilliseconds:g,loopVolumeCurveBehavior:y,pauseWhenBuffering:v,audioStreamIndex:w,preservePitch:b,...x}=e,E=e_(),C=ns(y??"repeat"),R=eq(),k=(0,r.useContext)(ex),{registerRenderAsset:I,unregisterRenderAsset:F}=(0,r.useContext)(rj),{delayRender:T,continueRender:$}=ed(),S=(0,r.useMemo)(()=>`audio-${eR(e.src??"")}-${k?.relativeFrom}-${k?.cumulatedFrom}-${k?.durationInFrames}`,[e.src,k?.relativeFrom,k?.cumulatedFrom,k?.durationInFrames]),P=nu({volume:a,frame:C,mediaVolume:1});nF(P),(0,r.useImperativeHandle)(t,()=>n.current,[]),(0,r.useEffect)(()=>
17{if(!e.src)throw Error("No src passed");if(window.remotion_audioEnabled&&!e.muted&&!(P<=0))return I({type:"audio",src:r_(e.src),id:S,frame:E,volume:P,mediaFrame:R,playbackRate:e.playbackRate??1,toneFrequency:u??1,audioStartFrame:Math.max(0,-(k?.cumulatedNegativeFrom??0)),audioStreamIndex:w??0}),()=>F(S)},[e.muted,e.src,I,E,S,F,P,C,R,i,e.playbackRate,u,k?.cumulatedNegativeFrom,w]);let{src:N}=e,M=t||d;return((0,r.useLayoutEffect)(()=>{if(window.process?.env?.NODE_ENV==="test"||!M)return;let e=T("Loading <Html5Audio> duration with src="+N,{retries:h??void 0,timeoutInMilliseconds:g??void 0}),{current:t}=n,r=()=>{t?.duration&&l(t.src,t.duration),$(e)};return t?.duration?(l(t.src,t.duration),$(e)):t?.addEventListener("loadedmetadata",r,{once:!0}),()=>{t?.removeEventListener("loadedmetadata",r),$(e)}},[N,l,M,h,g,$,T]),M)?(0,o.jsx)("audio",{ref:n,...x,onError:p}):null}),nS=(0,r.forwardRef)((e,t)=>{let n=(0,r.useContext)(r6),{startFrom:a,endAt:i,trimBefore:s,trimAfter:l,name:u,stack:d,pauseWhenBuffering:f,showInTimeline:c,onError:m,...p}=e,{loop:h,...g}=e,{fps:y}=eW(),v=W();if(v.isClientSideRendering)throw Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");let{durations:w,setDurations:b}=(0,r.useContext)(rQ);if("string"!=typeof e.src)throw TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);let x=rY(e.src),E=(0,r.useCallback)(e=>{console.log(e.currentTarget.error);let t=`Could not play audio with src ${x}: ${e.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(h){if(m)return void m(Error(t));Q(Error(t))}else m?.(Error(t)),console.warn(t)},[h,m,x]),C=(0,r.useCallback)((e,t)=>{b({type:"got-duration",durationInSeconds:t,src:e})},[b]),R=w[r_(x)]??w[r_(e.src)];rK({startFrom:a,endAt:i,trimBefore:s,trimAfter:l});let{trimBeforeValue:k,trimAfterValue:I}=rG({startFrom:a,endAt:i,trimBefore:s,trimAfter:l});return h&&void 0!==R?Number.isFinite(R)?(0,o.jsx)(rD,{layout:"none",durationInFrames:rL({trimAfter:I,mediaDurationInFrames:R*y,playbackRate:e.playbackRate??1,trimBefore:k}),children:(0,o.jsx)(nS,{...g,ref:t,_remotionInternalNativeLoopPassed:!0})}):(0,o.jsx)(nS,{...g,ref:t,_remotionInternalNativeLoopPassed:!0}):void 0!==k||void 0!==I?(0,o.jsx)(ry,{layout:"none",from:0-(k??0),showInTimeline:!1,durationInFrames:I,name:u,children:(0,o.jsx)(nS,{_remotionInternalNeedsDurationCalculation:!!h,pauseWhenBuffering:f??!1,...p,ref:t})}):(rJ({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Audio"),v.isRendering)?(0,o.jsx)(n$,{onDuration:C,...e,ref:t,onNativeError:E,_remotionInternalNeedsDurationCalculation:!!h}):(0,o.jsx)(nT,{_remotionInternalNativeLoopPassed:e._remotionInternalNativeLoopPassed??!1,_remotionInternalStack:d??null,shouldPreMountAudioTags:null!==n&&n.numberOfAudioTags>0,...e,ref:t,onNativeError:E,onDuration:C,pauseWhenBuffering:f??!1,_remotionInternalNeedsDurationCalculation:!!h,showInTimeline:c??!0})});ew(nS);var nP={...e0,color:{type:"color",default:"transparent",description:"Color"},width:{type:"number",min:1,step:1,default:1920,description:"Width",hiddenFromList:!1},height:{type:"number",min:1,step:1,default:1080,description:"Height",hiddenFromList:!1},...eU},nN=({color:e,width:t,height:n,effects:a=[],className:i,style:s,pixelDensity:l,overrideId:u,reference:d})=>{let{delayRender:f,continueRender:c,cancelRender:m}=ed(),p=(e=>{if(void 0===e)return 1;if("number"!=typeof e||!Number.isFinite(e)||e<=0)throw Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e})(l),h=Math.ceil(t*p),g=Math.ceil(n*p),[y,v]=(0,r.useState)(null),w=rr({effects:a,overrideId:u??null}),b=(0,r.useMemo)(()=>{if("u"<typeof document)return null;let e=document.createElement("canvas");return e.width=1,e.height=1,e},[]),x=rF(),E=(0,r.useCallback)(e=>{v(e),"function"==typeof d?d(e):d&&(d.current=e)},[d]);(0,r.useEffect)(()=>{if(!y||!b)return;let t=f("Solid effect chain");if(!x)return c(t),()=>{c(t)};let r=b.getContext("2d",{colorSpace:"srgb"});return r?(r.clearRect(0,0,1,1),void 0!==e&&(r.fillStyle=e,r.fillRect(0,0,1,1)),rI({state:x.get(h,g),source:b,effects:w,output:y,width:h,height:g}).then(e=>{e&&c(t)}
17).catch(e=>{m(e)}),()=>{c(t)}):void m(Error("Failed to acquire 2D context for <Solid> source"))},[e,y,b,x,h,g,f,c,m,w]);let C=(0,r.useMemo)(()=>({width:t,height:n,...s??{}}),[n,s,t]);return(0,o.jsx)("canvas",{ref:E,width:h,height:g,className:i,style:C})},nM=rc({Component:(0,r.forwardRef)(({effects:e=[],controls:t,color:n,height:a,width:i,className:s,durationInFrames:l,style:u,name:d,from:f,freeze:c,hidden:m,showInTimeline:p,pixelDensity:h,...g},y)=>{let v=t7(e),w=(0,r.useRef)(null);return(0,r.useImperativeHandle)(y,()=>w.current,[]),(0,o.jsx)(ry,{layout:"none",from:f,freeze:c,hidden:m,showInTimeline:p,controls:t,_remotionInternalEffects:v,durationInFrames:l,name:d??"<Solid>",outlineRef:w,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...g,children:(0,o.jsx)(nN,{reference:w,overrideId:t?.overrideId??null,color:n,height:a,width:i,className:s,style:u,effects:e,pixelDensity:h})})}),componentIdentity:"dev.remotion.remotion.Solid",schema:nP,supportsEffects:!0});nM.displayName="Solid",ew(nM);var nV=null,nA=()=>{if(null!==nV)return nV;if("u"<typeof document)return!1;let e=document.createElement("canvas"),t=e.getContext("2d");return nV="function"==typeof t?.drawElementImage&&"function"==typeof e.requestPaint&&"function"==typeof e.captureElementImage&&"transferControlToOffscreen"in HTMLCanvasElement.prototype},nj=({offscreen:e,width:t,height:r})=>{e.width!==t&&(e.width=t),e.height!==r&&(e.height=r)},n_=({canvas:e,element:t,elementImage:r})=>{let n=e.getContext("2d");if(!n)throw Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");n.reset();let o=n.drawElementImage(r,0,0);t.style.transform=o.toString()},nL=(0,r.createContext)(!1),nO=(0,r.forwardRef)(({width:e,height:t,effects:n,children:a,onPaint:i,onInit:s,pixelDensity:l,controls:u,style:d},f)=>{let c=(0,r.useContext)(nL);if("number"!=typeof e||"number"!=typeof t)throw Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(e)}, height=${String(t)}.`);if(!Number.isInteger(e)||e<=0)throw Error(`HtmlInCanvas: \`width\` must be a positive integer. Received: ${String(e)}.`);if(!Number.isInteger(t)||t<=0)throw Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(t)}.`);let m=function(e){if(void 0===e)return 1;if("number"!=typeof e||!Number.isFinite(e)||e<=0)throw Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e}(l),p=Math.ceil(e*m),h=Math.ceil(t*m),{continueRender:g,cancelRender:y}=ed();nA()||y(Error("HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome)."));let v=(0,r.useRef)(null),w=(0,r.useRef)(null),b=(0,r.useRef)(null),x=`${e}x${t}@${m}`,E=(0,r.useCallback)(e=>{v.current=e,"function"==typeof f?f(e):f&&(f.current=e)},[f]),C=rF(),R=rr({effects:n,overrideId:u?.overrideId??null}),k=(0,r.useRef)(R);k.current=R;let I=(0,r.useRef)(i);I.current=i;let F=(0,r.useRef)(s);F.current=s;let T=(0,r.useRef)(!1),$=(0,r.useRef)(null),S=(0,r.useRef)(!1),P=(0,r.useCallback)(async()=>{let e=b.current;if(!e)throw Error("Canvas or scene element not found");let t=w.current;if(!t)throw Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");nj({offscreen:t,width:p,height:h});try{let r=v.current;if(!r)throw Error("Canvas not found");if(!t.getContext("2d"))throw Error("Failed to acquire 2D context for <HtmlInCanvas> offscreen canvas");let n=eo("onPaint");if(!T.current){T.current=!0;let n=r.captureElementImage(e),o=F.current;if(o){let r=await o({canvas:t,element:e,elementImage:n,pixelDensity:m});if("function"!=typeof r)throw Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");S.current?r():$.current=r}}let o=I.current??n_,a=r.captureElementImage(e);await o({canvas:t,element:e,elementImage:a,pixelDensity:m}),await rI({state:C.get(p,h),source:t,effects:k.current,output:t,width:p,height:h}),g(n)}catch(e){y(e)}},[h,p,C,g,y,m]);(0,r.useLayoutEffect)(()=>{let e=v.current;if(!e)throw Error("Canvas not found");e.layoutSubtree=!0;let t=e.transferControlToOffscreen();return w.current=t,nj({offscreen:t,width:p,height:h}),T.current=!1,S.current=!1,e.addEventListener("paint",P),()=>{e.removeEventListener("paint",P),w.current=null,T.current=!1,S.current=!0,$.current?.(),$.current=null}},[P,y,p,h]);let N=(0,r.useRef)(!1);(0,r.useLayoutEffect)(()=>
17{if(!N.current){N.current=!0;return}let e=v.current;e&&e.requestPaint?.()},[i,R]),(0,r.useLayoutEffect)(()=>{let e=v.current;if(!e)return;let t=eo("waiting for first paint after canvas resize");return e.addEventListener("paint",()=>{g(t)},{once:!0}),()=>{g(t)}},[e,t,g,x]);let M=(0,r.useMemo)(()=>({width:e,height:t}),[e,t]),V=(0,r.useMemo)(()=>({width:e,height:t,...d??{}}),[t,d,e]);if(c)throw Error("<HtmlInCanvas> effects cannot be nested together. Chrome will only display the outer effect. Consider merging the effects into one if you can.");return(0,o.jsx)(nL.Provider,{value:!0,children:(0,o.jsx)("canvas",{ref:E,width:p,height:h,style:V,children:(0,o.jsx)("div",{ref:b,style:M,children:a})},x)})});nO.displayName="HtmlInCanvasContent";var nD=(0,r.forwardRef)(({width:e,height:t,effects:n=[],children:a,onPaint:i,onInit:s,pixelDensity:l,controls:u,style:d,durationInFrames:f,name:c,...m},p)=>{let{durationInFrames:h}=eW(),g=t7(n),y=(0,r.useRef)(null),v=(0,r.useCallback)(e=>{y.current=e,"function"==typeof p?p(e):p&&(p.current=e)},[p]);return(0,o.jsx)(ry,{durationInFrames:f??h,name:c??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:u,_remotionInternalEffects:g,outlineRef:y,layout:"none",...m,children:(0,o.jsx)(nO,{ref:v,width:e,height:t,effects:n,onPaint:i,onInit:s,pixelDensity:l,controls:u,style:d,children:a})})});nD.displayName="HtmlInCanvas";var nq=Object.assign(rc({Component:nD,componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:{...e0,...eU},supportsEffects:!0}),{isSupported:nA});function nH(e){return e.startsWith("data:")&&e.length>100?e.slice(0,60)+"...["+e.length+" chars total]":e}nq.displayName="HtmlInCanvas",ew(nq);var nW={...e0,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},...eU},nz=(0,r.forwardRef)(({src:e,width:t,height:n,fit:a="fill",effects:i,controls:s,onError:l,className:u,style:d,id:f,pauseWhenLoading:c,maxRetries:m=2,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:h,refForOutline:g,...y},v)=>{let{delayRender:w,continueRender:b,cancelRender:x}=ed(),{delayPlayback:E}=ng(),[C,R]=(0,r.useState)(null),[k,I]=(0,r.useState)(null),F=rY(e),T=rF(),$=rr({effects:i,overrideId:s?.overrideId??null}),S=(0,r.useContext)(ex),P=(0,r.useMemo)(()=>"u"<typeof document?null:document.createElement("canvas"),[]),N=(0,r.useCallback)(e=>{R(e),g&&(g.current=e),"function"==typeof v?v(e):v&&(v.current=e)},[v,g]);return(0,r.useEffect)(()=>{let e=!!S?.premounting,t=!!S?.postmounting,r=w(`Rendering <CanvasImage> with src="${nH(F)}"`,{retries:p??void 0,timeoutInMilliseconds:h??void 0}),n=!c||e||t?()=>{}:E().unblock,o=new AbortController,a=!1,i=!1,s=0,u=null;I(null);let d=()=>{i||(i=!0,n(),b(r))},f=()=>{(({src:e,signal:t})=>new Promise((r,n)=>{let o=new Image,a=!1;function i(e){a||(a=!0,o.onload=null,o.onerror=null,e())}function s(){i(()=>n((()=>{if("u">typeof DOMException)return new DOMException("Image loading was aborted","AbortError");let e=Error("Image loading was aborted");return e.name="AbortError",e})()))}(o.onload=()=>{Promise.resolve(o.decode?.()).catch(()=>{}).then(()=>
17{let t=o.naturalWidth||o.width,a=o.naturalHeight||o.height;t<=0||a<=0?i(()=>n(Error(`Could not determine dimensions for <CanvasImage> with src="${nH(e)}"`))):i(()=>r({element:o,width:t,height:a}))})},o.onerror=()=>{i(()=>n(Error(`Could not load <CanvasImage> with src="${nH(e)}"`)))},t.addEventListener("abort",s,{once:!0}),t.aborted)?s():(o.crossOrigin="anonymous",o.src=e)}))({src:F,signal:o.signal}).then(e=>{a||I(e)}).then(()=>{a||d()}).catch(e=>{if("AbortError"===e.name)return void d();if(++s<=m){var t;let e=(t=s,1e3*2**(t-1));console.warn(`Could not load <CanvasImage> with src="${nH(F)}", retrying in ${e}ms`),u=setTimeout(()=>{a||f()},e)}else l?(l(e),d()):x(e)})};return f(),()=>{a=!0,null!==u&&clearTimeout(u),o.abort(),d()}},[F,x,b,E,w,p,h,m,l,c,S?.postmounting,S?.premounting]),(0,r.useEffect)(()=>{if(!k||!C||!P)return;let e=w(`Applying effects to <CanvasImage> with src="${nH(F)}"`),r=!1,o=!1,i=()=>{o||(o=!0,b(e))},s=t??k.width,u=n??k.height,d=P.getContext("2d",{colorSpace:"srgb"});return d?(P.width=s,P.height=u,C.width=s,C.height=u,d.clearRect(0,0,s,u),d.drawImage(k.element,...rv(a,{width:k.width,height:k.height},{width:s,height:u})),rI({state:T.get(s,u),source:P,effects:$,output:C,width:s,height:u}).then(e=>{e&&!r&&i()}).catch(e=>{r||(l?(l(e),i()):x(e))}),()=>{r=!0,i()}):(x(Error("Could not get 2D context for <CanvasImage> source canvas")),i(),()=>{i()})},[F,x,T,b,w,a,n,k,$,l,C,P,t]),(0,o.jsx)("canvas",{...y,ref:N,width:t,height:n,className:u,style:d,id:f})});nz.displayName="CanvasImageContent";var nU=rc({Component:(0,r.forwardRef)(({src:e,width:t,height:n,fit:a,effects:i=[],className:s,style:l,id:u,onError:d,pauseWhenLoading:f,maxRetries:c,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:p,durationInFrames:h,from:g,freeze:y,hidden:v,name:w,showInTimeline:b,stack:x,controls:E,_remotionInternalDocumentationLink:C,outlineRef:R,...k},I)=>{if(!e)throw Error('No "src" prop was passed to <CanvasImage>.');let F=t7(i),T=(0,r.useRef)(null);return(0,r.useImperativeHandle)(I,()=>T.current,[]),(0,o.jsx)(ry,{layout:"none",from:g??0,durationInFrames:h??1/0,freeze:y,hidden:v,showInTimeline:b??!0,name:w??"<CanvasImage>",_remotionInternalDocumentationLink:C??"https://www.remotion.dev/docs/canvasimage",controls:E,_remotionInternalEffects:F,_remotionInternalIsMedia:{type:"image",src:e},_remotionInternalStack:x,outlineRef:R??T,children:(0,o.jsx)(nz,{ref:T,src:e,width:t,height:n,fit:a,effects:i,controls:E,className:s,style:l,id:u,onError:d,pauseWhenLoading:f,maxRetries:c,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:p,refForOutline:R??null,...k})})}),componentIdentity:"dev.remotion.remotion.CanvasImage",schema:nW,supportsEffects:!0});nU.displayName="CanvasImage",ew(nU),(0,r.forwardRef)(({onLoad:e,onError:t,delayRenderRetries:n,delayRenderTimeoutInMilliseconds:a,...i},s)=>{let{delayRender:l,continueRender:u}=ed(),[d]=(0,r.useState)(()=>l(`Loading <IFrame> with source ${i.src}`,{retries:n??void 0,timeoutInMilliseconds:a??void 0})),f=(0,r.useCallback)(t=>{u(d),e?.(t)},[d,e,u]),c=(0,r.useCallback)(e=>{u(d),t?t(e):console.error("Error loading iframe:",e,"Handle the event using the onError() prop to make this message disappear.")},[d,t,u]);return(0,o.jsx)("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...i,ref:s,onError:c,onLoad:f})});var nB=({onError:e,maxRetries:t=2,src:n,pauseWhenLoading:a,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,onImageFrame:l,crossOrigin:u,decoding:d,ref:f,refForOutline:c,...m})=>{let p=(0,r.useRef)(null),h=(0,r.useRef)({}),{delayPlayback:g}=ng(),y=(0,r.useContext)(ex),v=(0,r.useCallback)(e=>{p.current=e,c.current=e,"function"==typeof f?f(e):f&&(f.current=e)},[f,c]),w=rY(n),b=(0,r.useCallback)(e=>{if(!p.current)return;let t=p.current.src;setTimeout(()=>{if(!p.current)return;let e=p.current?.src;e===t&&(p.current.removeAttribute("src"),p.current.setAttribute("src",e))},e)},[]),{delayRender:x,continueRender:E,cancelRender:C}=ed(),R=(0,r.useCallback)(r=>{if(h.current){if(h.current[p.current?.src]=(h.current[p.current?.src]??0)+1,e&&(h.current[p.current?.src]??0)>t)return void e(r);if((h.current[p.current?.src]??0)<=t){var n;
17let e=(n=h.current[p.current?.src]??0,1e3*2**(n-1));console.warn(`Could not load image with source ${nH(p.current?.src)}, retrying again in ${e}ms`),b(e);return}try{C("Error loading image with src: "+nH(p.current?.src))}catch{}}},[C,t,e,b]);if("u">typeof window){let e=!!y?.premounting,t=!!y?.postmounting;(0,r.useLayoutEffect)(()=>{if(window.process?.env?.NODE_ENV==="test"){p.current&&(p.current.src=w);return}let{current:r}=p;if(!r)return;let n=x("Loading <Img> with src="+nH(w),{retries:i??void 0,timeoutInMilliseconds:s??void 0}),o=!a||e||t?()=>{}:g().unblock,u=!1,d=()=>{u||((h.current[p.current?.src]??0)>0&&(delete h.current[p.current?.src],console.info(`Retry successful - ${nH(p.current?.src)} is now loaded`)),r&&l?.(r),o()),E(n)};return p.current?(r.src=w,r.decode().then(d).catch(e=>{console.warn(e),r.complete&&r.naturalWidth>0&&r.naturalHeight>0?d():r.addEventListener("load",d)}),()=>{u=!0,r.removeEventListener("load",d),o(),E(n)}):void d()},[w,g,i,s,a,e,t,l,E,x])}let{isClientSideRendering:k,isRendering:I}=W(),F=r0({crossOrigin:u,requestsVideoFrame:!1,isClientSideRendering:k});return(0,o.jsx)("img",{...m,ref:v,crossOrigin:F,onError:R,decoding:I?"sync":d})},nY=({hidden:e,name:t,stack:r,showInTimeline:n,src:a,from:i,durationInFrames:s,freeze:l,controls:u,outlineRef:d,...f})=>{if(!a)throw Error('No "src" prop was passed to <Img>.');return(0,o.jsx)(ry,{layout:"none",from:i??0,durationInFrames:s??1/0,freeze:l,_remotionInternalStack:r,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",_remotionInternalIsMedia:{type:"image",src:a},name:t??"<Img>",controls:u,showInTimeline:n??!0,hidden:e,outlineRef:d,children:(0,o.jsx)(nB,{src:a,refForOutline:d,...f})})},nJ={...e0,...eU},nK=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),nG=rc({Component:({effects:e=[],ref:t,hidden:n,name:a,stack:i,showInTimeline:s,src:l,from:u,durationInFrames:d,freeze:f,controls:c,width:m,height:p,className:h,style:g,id:y,pauseWhenLoading:v,maxRetries:w,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:x,...E})=>{let C=(0,r.useRef)(null);if(0===e.length)return(0,o.jsx)(nY,{...E,ref:t,hidden:n,name:a,stack:i,showInTimeline:s,src:l,from:u,durationInFrames:d,freeze:f,controls:c,width:m,height:p,className:h,style:g,id:y,pauseWhenLoading:v,maxRetries:w,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:x,outlineRef:C});if(!l)throw Error('No "src" prop was passed to <Img>.');(({props:e,ref:t,width:r,height:n})=>{if("string"==typeof r||"string"==typeof n)throw Error('The "width" and "height" props must be numbers on <Img> when effects are passed, because <Img> renders a <CanvasImage>. Use numeric props or CSS dimensions in "style".');let o=Object.keys(e).filter(t=>void 0!==e[t]&&nK.has(t));if(null!=t&&o.unshift("ref"),0!==o.length)throw Error(`The ${o.map(e=>`"${e}"`).join(", ")} prop${1===o.length?"":"s"} cannot be used on <Img> when effects are passed, because <Img> renders a <canvas> instead of a native <img>. Remove ${1===o.length?"this prop":"these props"}.`)})({props:E,ref:t,width:m,height:p});let R="number"==typeof m?m:void 0,k="number"==typeof p?p:void 0,I=(e=>{let t=e?.objectFit;if("fill"===t||"contain"===t||"cover"===t)return t})(g)??"fill";return(0,o.jsx)(nU,{src:l,width:R,height:k,fit:I,effects:e,className:h,style:g,id:y,pauseWhenLoading:v,maxRetries:w,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:x,from:u,durationInFrames:d,freeze:f,hidden:n,name:a??"<Img>",showInTimeline:s,stack:i,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:c,outlineRef:C,...E})},componentIdentity:"dev.remotion.remotion.Img",schema:nJ,supportsEffects:!0});ew(nG);var nZ={...e0,...eU},nQ=(e,t)=>{let n=(0,r.forwardRef)((n,a)=>{let{durationInFrames:i,from:s,freeze:l,hidden:u,name:d,showInTimeline:f,stack:c,controls:m,...p}=n,h=(0,r.useRef)(null),g=(0,r.useCallback)(e=>{h.current=e,"function"==typeof a?a(e):a&&(a.current=e)},[a]);return(0,o.jsx)(ry,{layout:"none",from:s??0,durationInFrames:i??1/0,freeze:l,hidden:u,name:d??t,showInTimeline:f??!0,controls:m,_remotionInternalStack:c,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:h,children:r.default.createElement(e,{...p,ref:g})})});n.displayName=t;let a=rc({Component:n,componentIdentity:`dev.remotion.remotion.${t.slice(1,-1)}`,schema:nZ,supportsEffects:!1});return a.displayName=t,ew(a),a};nQ("a","<Interactive.A>"),nQ("article","<Interactive.Article>"),nQ("aside","<Interactive.Aside>
17"),nQ("button","<Interactive.Button>"),nQ("circle","<Interactive.Circle>"),nQ("code","<Interactive.Code>"),nQ("div","<Interactive.Div>"),nQ("ellipse","<Interactive.Ellipse>"),nQ("em","<Interactive.Em>"),nQ("footer","<Interactive.Footer>"),nQ("g","<Interactive.G>"),nQ("h1","<Interactive.H1>"),nQ("h2","<Interactive.H2>"),nQ("h3","<Interactive.H3>"),nQ("h4","<Interactive.H4>"),nQ("h5","<Interactive.H5>"),nQ("h6","<Interactive.H6>"),nQ("header","<Interactive.Header>"),nQ("label","<Interactive.Label>"),nQ("li","<Interactive.Li>"),nQ("line","<Interactive.Line>"),nQ("main","<Interactive.Main>"),nQ("nav","<Interactive.Nav>"),nQ("ol","<Interactive.Ol>"),nQ("p","<Interactive.P>"),nQ("path","<Interactive.Path>"),nQ("pre","<Interactive.Pre>"),nQ("rect","<Interactive.Rect>"),nQ("section","<Interactive.Section>"),nQ("small","<Interactive.Small>"),nQ("span","<Interactive.Span>"),nQ("strong","<Interactive.Strong>"),nQ("svg","<Interactive.Svg>"),nQ("text","<Interactive.Text>"),nQ("ul","<Interactive.Ul>");var nX=r.default.createRef(),n0={};i(n0,{makeDefaultPreviewCSS:()=>n3,injectCSS:()=>n2,OBJECTFIT_CONTAIN_CLASS_NAME:()=>n5});var n1={},n2=e=>{if("u"<typeof document||n1[e])return()=>{};let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");return r.appendChild(document.createTextNode(e)),t.prepend(r),n1[e]=r,()=>{let t=n1[e];t&&(t.parentNode&&t.parentNode.removeChild(t),delete n1[e])}},n5="__remotion_objectfitcontain",n3=(e,t)=>e?`
18    ${e} * {
19      box-sizing: border-box;
20    }
21    ${e} *:-webkit-full-screen {
22      width: 100%;
23      height: 100%;
24    }
25    ${e} .${n5} {
26      object-fit: contain;
27    }
28  `:`
29    * {
30      box-sizing: border-box;
31    }
32    body {
33      margin: 0;
34	    background-color: ${t};
35    }
36    .${n5} {
37      object-fit: contain;
38    }
39    `,n4="__remotion-studio-container",n6=r.default.createContext(null),n8=[],n9=(0,r.createContext)(null),n7=({children:e,videoEnabled:t,audioEnabled:n})=>{let a=(0,r.useMemo)(()=>({videoEnabled:t,audioEnabled:n}),[t,n]);return(0,o.jsx)(n9.Provider,{value:a,children:e})},oe=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"],ot=({calculated:e,compositionId:t,compositionFps:r,compositionHeight:n,compositionWidth:o,compositionDurationInFrames:a})=>{let i=`calculated by calculateMetadata() for the composition "${t}"`,s=`of the "<Composition />" component with the id "${t}"`,l=e?.width??o??void 0;z(l,"width",e?.width?i:s);let u=e?.height??n??void 0;z(u,"height",e?.height?i:s);let d=e?.fps??r??null;B(d,e?.fps?i:s,!1);let f=e?.durationInFrames??a??null;U(f,{allowFloats:!1,component:`of the "<Composition />" component with the id "${t}"`});let c=e?.defaultCodec;var m="defaultCodec";if(void 0!==c){if("string"!=typeof c)throw TypeError(`The "${m}" prop ${i} must be a string, but you passed a value of type ${typeof c}.`);if(!oe.includes(c))throw Error(`The "${m}" prop ${i} must be one of ${oe.join(", ")}, but you passed ${c}.`)}let p=e?.defaultOutName,h=e?.defaultVideoImageFormat,g=e?.defaultPixelFormat;return{width:l,height:u,fps:d,durationInFrames:f,defaultCodec:c,defaultOutName:p,defaultVideoImageFormat:h,defaultPixelFormat:g,defaultProResProfile:e?.defaultProResProfile,defaultSampleRate:e?.defaultSampleRate}},or=({calculateMetadata:e,signal:t,defaultProps:r,inputProps:n,compositionId:o,compositionDurationInFrames:a,compositionFps:i,compositionHeight:s,compositionWidth:l})=>{let u=e?e({defaultProps:r,props:n,abortSignal:t,compositionId:o,isRendering:E().isRendering}):null;if(null!==u&&"object"==typeof u&&"then"in u)return u.then(e=>{let{height:t,width:u,durationInFrames:d,fps:f,defaultCodec:c,defaultOutName:m,defaultVideoImageFormat:p,defaultPixelFormat:h,defaultProResProfile:g,defaultSampleRate:y}=ot({calculated:e,compositionDurationInFrames:a,compositionFps:i,compositionHeight:s,compositionWidth:l,compositionId:o});return{width:u,height:t,fps:f,durationInFrames:d,id:o,defaultProps:I(r),props:I(e.props??n),defaultCodec:c??null,defaultOutName:m??null,defaultVideoImageFormat:p??null,defaultPixelFormat:h??null,defaultProResProfile:g??null,defaultSampleRate:y??null}});let d=ot({calculated:u,compositionDurationInFrames:a,compositionFps:i,compositionHeight:s,compositionWidth:l,compositionId:o});return null===u?{...d,id:o,defaultProps:I(r??{}),props:I(n),defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}:{...d,id:o,defaultProps:I(r??{}),props:I(u.props??n),defaultCodec:u.defaultCodec??null,defaultOutName:u.defaultOutName??null,defaultVideoImageFormat:u.defaultVideoImageFormat??null,defaultPixelFormat:u.defaultPixelFormat??null,defaultProResProfile:u.defaultProResProfile??null,defaultSampleRate:u.defaultSampleRate??null}},on=r.default.createContext(()=>{}),oo=r.default.createContext(null),oa=(0,r.createContext)({setSize:()=>{},size:{size:"auto",translation:{x:0,y:0}}}),oi=r.default.createContext(null),os=({onError:e,volume:t,playbackRate:n,src:a,muted:i,allowAmplificationDuringRender:s,transparent:l,toneMapped:u,toneFrequency:d,name:f,loopVolumeCurveBehavior:c,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:p,onVideoFrame:h,crossOrigin:g,audioStreamIndex:v,preservePitch:w,...b})=>{let x=e_(),E=eq(),C=ns(c),R=eH(),k=(0,r.useContext)(ex),I=ni(),{registerRenderAsset:F,unregisterRenderAsset:T}=(0,r.useContext)(rj);if(!a)throw TypeError("No `src` was passed to <OffthreadVideo>.");let $=(0,r.useMemo)(()=>`offthreadvideo-${eR(a)}-${k?.cumulatedFrom}-${k?.relativeFrom}-${k?.durationInFrames}`,[a,k?.cumulatedFrom,k?.relativeFrom,k?.durationInFrames]);if(!R)throw Error("No video config found");let S=nu({volume:t,frame:C,mediaVolume:1});nF(S),(0,r.useEffect)(()=>
39{if(!a)throw Error("No src passed");if(window.remotion_audioEnabled&&!i&&!(S<=0))return F({type:"video",src:r_(a),id:$,frame:x,volume:S,mediaFrame:E,playbackRate:n,toneFrequency:d,audioStartFrame:Math.max(0,-(k?.cumulatedNegativeFrom??0)),audioStreamIndex:v}),()=>T($)},[i,a,F,$,T,S,E,x,n,d,k?.cumulatedNegativeFrom,v]);let P=(0,r.useMemo)(()=>nv({frame:E,playbackRate:n||1,startFrom:-I})/R.fps,[E,I,n,R.fps]),N=(0,r.useMemo)(()=>(({src:e,transparent:t,currentTime:r,toneMapped:n})=>`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(r_(e))}&time=${encodeURIComponent(Math.max(0,r))}&transparent=${String(t)}&toneMapped=${String(n)}`)({src:a,currentTime:P,transparent:l,toneMapped:u}),[u,P,a,l]),[M,V]=(0,r.useState)(null),{delayRender:A,continueRender:j}=ed();(0,r.useLayoutEffect)(()=>{if(!window.remotion_videoEnabled)return;let t=[];V(null);let r=new AbortController,n=A(`Fetching ${N} from server`,{retries:m??void 0,timeoutInMilliseconds:p??void 0});return(async()=>{try{let e=await fetch(N,{signal:r.signal,cache:"no-store"});if(200!==e.status){if(500===e.status){let t=await e.json();if(t.error){let e=t.error.replace(/^Error: /,"");throw Error(e)}}throw Error(`Server returned status ${e.status} while fetching ${N}`)}let o=await e.blob(),a=URL.createObjectURL(o);t.push(()=>URL.revokeObjectURL(a)),V({src:a,handle:n})}catch(t){if(t.message.includes("aborted")||r.signal.aborted)return void j(n);t.message.includes("Failed to fetch")&&(t=Error(`Failed to fetch ${N}. This could be caused by Chrome rejecting the request because the disk space is low. Consider increasing the disk size of your environment.`,{cause:t})),e?e(t):Q(t)}})(),t.push(()=>{r.signal.aborted||r.abort()}),()=>{t.forEach(e=>e())}},[N,m,p,e,j,A]);let _=(0,r.useCallback)(()=>{e?e?.(Error("Failed to load image with src "+M)):Q("Failed to load image with src "+M)},[M,e]),L=(0,r.useMemo)(()=>[n5,b.className].filter(y).join(" "),[b.className]),O=(0,r.useCallback)(e=>{h&&h(e)},[h]);return M&&window.remotion_videoEnabled?(j(M.handle),(0,o.jsx)(nG,{src:M.src,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:p,onImageFrame:O,...b,onError:_,className:L})):null},ol=({ref:e,onVideoFrame:t})=>{(0,r.useEffect)(()=>{let{current:r}=e;if(!r||!t)return;let n=0,o=(r,a)=>{e.current&&(t(e.current,r,a),n=e.current.requestVideoFrameCallback(o))};if(t(r),r.requestVideoFrameCallback)return n=r.requestVideoFrameCallback(o),()=>{n&&r.cancelVideoFrameCallback(n)}},[t,e])};class ou extends Error{src;constructor({message:e,src:t}){super(e),this.name="MediaPlaybackError",this.src=t}}var od=(0,r.forwardRef)((e,t)=>{let n=(0,r.useContext)(r4);if(!n)throw Error("SharedAudioContext not found");let a=(0,r.useRef)(null),i=(0,r.useMemo)(()=>n.audioContext?r2({audioContext:n.audioContext,ref:a}):null,[n.audioContext]);(r.default.useInsertionEffect??r.default.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{i?.cleanup()})},[i]);let{volume:s,muted:l,playbackRate:u,preservePitch:d,onlyWarnForMediaSeekingError:f,src:c,onDuration:m,acceptableTimeShift:p,acceptableTimeShiftInSeconds:h,toneFrequency:g,name:y,_remotionInternalNativeLoopPassed:v,_remotionInternalStack:w,style:b,pauseWhenBuffering:x,showInTimeline:E,loopVolumeCurveBehavior:C,onError:R,onAutoPlayError:k,onVideoFrame:I,crossOrigin:F,delayRenderRetries:T,delayRenderTimeoutInMilliseconds:$,allowAmplificationDuringRender:S,useWebAudioApi:P,audioStreamIndex:N,...M}=e,V=ns(C??"repeat"),{fps:A,durationInFrames:j}=eW(),_=(0,r.useContext)(ex),L=es(),O=el(),[D]=(0,r.useState)(()=>String(Math.random()));if(void 0!==p)throw Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");let[q]=nk(),[H]=nI(),W=nu({frame:V,volume:s,mediaVolume:q});nF(W);let z=(0,r.useCallback)(()=>w??null,[w]);nc({volume:s,mediaVolume:q,mediaType:"video",src:c,playbackRate:e.playbackRate??1,displayName:y??null,id:D,getStack:z,showInTimeline:E,premountDisplay:_?.premountDisplay??null,postmountDisplay:_?.postmountDisplay??null,loopDisplay:void 0,documentationLink:f?"https://www.remotion.dev/docs/offthreadvideo":"https://www.remotion.dev/docs/html5-video",refForOutline:a}),nx({mediaRef:a,src:c,mediaType:"video",playbackRate:e.playbackRate??1,preservePitch:d,onlyWarnForMediaSeekingError:f,acceptableTimeshift:h??null,isPremounting:!!_?.premounting,isPostmounting:!!_?.postmounting,pauseWhenBuffering:x,onAutoPlayError:k??null}),nE({id:D,isPostmounting:!!_?.postmounting,isPremounting:!!_?.premounting,mediaRef:a,mediaType:"video",onAutoPlayError:k??null}),na({logLevel:L,mediaRef:a,volume:W,source:i,shouldUseWebAudioApi:P??!1});let U=_?_.relativeFrom:0,B=_?Math.min(_.durationInFrames,j):j,Y=(({actualSrc:e,actualFrom:t,duration:n,fps:o})=>{let a=(0,r.useRef)(t),i=(0,r.useRef)(n),s=(0,r.useRef)(e);return(({prevStartFrom:e,newStartFrom:t,prevDuration:r,newDuration:n,fps:o})=>{let a=nn({actualFrom:e,fps:o}),i=nn({actualFrom:t,fps:o}),s=(({duration:e,fps:t})=>ne(e,t))({duration:r,fps:o}),l=(({duration:e,fps:t})=>ne(e,t))({duration:n,fps:o});return!(i<a)&&!(l>s)})({prevStartFrom:a.current,newStartFrom:t,prevDuration:i.current,newDuration:n,fps:o})&&e===s.current||(a.current=t,i.current=n,s.current=e),(({actualSrc:e,actualFrom:t,duration:r,fps:n})=>{if(nr()&&e.startsWith("blob:")||e.startsWith("data:")||new URL(e,("u"<typeof window?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(t))return e;let o=`${e}#t=${nn({actualFrom:t,fps:n})}`;return Number.isFinite(r)?`${o},${(({duration:e,fps:t})=>ne(e,t))({duration:r,fps:n})}`:o})({actualSrc:s.current,actualFrom:a.current,duration:i.current,fps:o})})({actualSrc:rY(c),actualFrom:U,duration:B,fps:A});(0,r.useImperativeHandle)(t,()=>a.current,[]),(0,r.useState)(()=>rq({logLevel:L,message:`Mounting video with source = ${Y}, v=${eb}
39, user agent=${"u"<typeof navigator?"server":navigator.userAgent}`,tag:"video",mountTime:O})),(0,r.useEffect)(()=>{let{current:e}=a;if(!e)return;let t=()=>{if(e.error){if(console.error("Error occurred in video",e?.error),R)return void R(new ou({message:`Code ${e.error.code}: ${e.error.message}`,src:c}));throw new ou({message:`The browser threw an error while playing the video ${c}: Code ${e.error.code} - ${e?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:c})}if(R)return void R(new ou({message:`The browser threw an error while playing the video ${c}`,src:c}));throw new ou({message:"The browser threw an error while playing the video",src:c})};return e.addEventListener("error",t,{once:!0}),()=>{e.removeEventListener("error",t)}},[R,c]);let J=(0,r.useRef)(m);J.current=m,ol({ref:a,onVideoFrame:I}),(0,r.useEffect)(()=>{let{current:e}=a;if(!e)return;if(e.duration)return void J.current?.(c,e.duration);let t=()=>{J.current?.(c,e.duration)};return e.addEventListener("loadedmetadata",t),()=>{e.removeEventListener("loadedmetadata",t)}},[c]),(0,r.useEffect)(()=>{let{current:e}=a;e&&(nr()?e.preload="metadata":e.preload="auto")},[]);let K=(0,r.useMemo)(()=>({...b}),[b]),G=r0({crossOrigin:F,requestsVideoFrame:!!I,isClientSideRendering:!1});return(0,o.jsx)("video",{...M,ref:a,muted:l||H||W<=0,playsInline:!0,src:Y,loop:v,style:K,disableRemotePlayback:!0,crossOrigin:G,controls:!1})}),of=e=>{let{startFrom:t,endAt:n,trimBefore:a,trimAfter:i,name:s,pauseWhenBuffering:l,stack:u,showInTimeline:d,...f}=e,c=W();if(c.isClientSideRendering)throw Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");let m=(0,r.useCallback)(()=>{},[]);if("string"!=typeof e.src)throw TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);rK({startFrom:t,endAt:n,trimBefore:a,trimAfter:i});let{trimBeforeValue:p,trimAfterValue:h}=rG({startFrom:t,endAt:n,trimBefore:a,trimAfter:i});if(void 0!==p||void 0!==h)return(0,o.jsx)(ry,{layout:"none",from:0-(p??0),showInTimeline:!1,durationInFrames:h,name:s,children:(0,o.jsx)(of,{pauseWhenBuffering:l??!1,...f,trimAfter:void 0,name:void 0,showInTimeline:d,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(rJ(e,"Video"),c.isRendering)return(0,o.jsx)(os,{pauseWhenBuffering:l??!1,...f,trimAfter:void 0,name:void 0,showInTimeline:d,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0});let{transparent:g,toneMapped:y,onAutoPlayError:v,onVideoFrame:w,crossOrigin:b,delayRenderRetries:x,delayRenderTimeoutInMilliseconds:E,...C}=f;return(0,o.jsx)(od,{_remotionInternalStack:u??null,onDuration:m,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:l??!1,showInTimeline:d??!0,onAutoPlayError:v??void 0,onVideoFrame:w??null,crossOrigin:b,...C,_remotionInternalNativeLoopPassed:!1}
39)};ew(({src:e,acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:r,audioStreamIndex:n,crossOrigin:a,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:l,muted:u,name:d,onAutoPlayError:f,onError:c,onVideoFrame:m,pauseWhenBuffering:p,playbackRate:h,preservePitch:g,showInTimeline:y,style:v,toneFrequency:w,toneMapped:b,transparent:x,trimAfter:E,trimBefore:C,useWebAudioApi:R,volume:k,_remotionInternalNativeLoopPassed:I,endAt:F,stack:T,startFrom:$,imageFormat:S,...P})=>{if(S)throw TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return(0,o.jsx)(of,{acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:r??!0,audioStreamIndex:n??0,crossOrigin:a,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:l??"repeat",muted:u??!1,name:d,onAutoPlayError:f??null,onError:c,onVideoFrame:m,pauseWhenBuffering:p??!0,playbackRate:h??1,preservePitch:g,toneFrequency:w??1,showInTimeline:y??!0,src:e,stack:T,startFrom:$,_remotionInternalNativeLoopPassed:I??!1,endAt:F,style:v,toneMapped:b??!0,transparent:x??!1,trimAfter:E,trimBefore:C,useWebAudioApi:R??!1,volume:k,...P})});var oc=(0,r.createRef)(),om=e=>r.default.Children.toArray(e).reduce((e,t)=>t.type===r.default.Fragment?e.concat(om(t.props.children)):(e.push(t),e),[]),op=(0,r.forwardRef)(({children:e},t)=>{if(!r.default.useContext(to))throw Error("This component must be inside a <Series /> component.");return(0,o.jsx)(ti,{children:e})});ew(Object.assign(rc({Component:e=>{let t=(0,r.useMemo)(()=>{let t=0,n=om(e.children);return r.Children.map(n,(e,r)=>{if("string"==typeof e){if(""===e.trim())return null;throw TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${e}"`)}if(e.type!==op)throw TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${e} instead`);let a=`index = ${r}, duration = ${e.props.durationInFrames}`,i=e.props.durationInFrames,{durationInFrames:s,children:l,from:u,name:d,...f}=e.props;(r!==n.length-1||i!==1/0)&&U(i,{component:"of a <Series.Sequence /> component",allowFloats:!0});let c=e.props.offset??0;if(Number.isNaN(c))throw TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${a}).`);if(!Number.isFinite(c)||c%1!=0)throw TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${c} (${a}).`);let m=t+c;return t+=i+c,(0,o.jsx)(rg,{ref:e.ref,name:d||"<Series.Sequence>",_remotionInternalDocumentationLink:d?void 0:"https://www.remotion.dev/docs/series",from:m,durationInFrames:i,...f,children:e})})},[e.children]);return(0,o.jsx)(ta,{children:(0,o.jsx)(ry,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...e,children:t})})},componentIdentity:"dev.remotion.remotion.Series",schema:e5,supportsEffects:!1}),{Sequence:op}));var oh={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},og={},oy=e=>e.startsWith("/")?oy(e.substring(1)):e,ov=e=>Math.round(1e5*e)/1e5,ow=({element:e,desiredTime:t,logLevel:r,mountTime:n})=>{let o;if(r7(e.currentTime,t))return{wait:Promise.resolve(t),cancel:()=>{}};ny({logLevel:r,mediaRef:e,time:t,why:"Seeking during rendering",mountTime:n});let a=null;return{wait:Promise.all([new Promise(t=>{o=e.requestVideoFrameCallback((e,r)=>{let n=r.expectedDisplayTime-e;n<=0?t(r.mediaTime):setTimeout(()=>{t(r.mediaTime)},n+150)})}),new Promise(t=>{let r=()=>{t()};e.addEventListener("seeked",r,{once:!0}),a=()=>{e.removeEventListener("seeked",r)}})]).then(([e])=>e),cancel:()=>{a?.(),e.cancelVideoFrameCallback(o)}}},ob=(0,r.forwardRef)(({onError:e,volume:t,allowAmplificationDuringRender:n,playbackRate:a,onDuration:i,toneFrequency:s,name:l,acceptableTimeShiftInSeconds:u,delayRenderRetries:d,delayRenderTimeoutInMilliseconds:f,loopVolumeCurveBehavior:c,audioStreamIndex:m,onVideoFrame:p,preservePitch:h,...g},y)=>{let v=e_(),w=eq(),b=ns(c??"repeat"),x=eH(),E=(0,r.useRef)(null),C=(0,r.useContext)(ex),R=ni(),k=W(),I=es(),F=el(),{delayRender:T,continueRender:$}=ed(),{registerRenderAsset:S,unregisterRenderAsset:P}=(0,r.useContext)(rj),N=(0,r.useMemo)(()=>`video-${eR(g.src??"")}-${C?.cumulatedFrom}-${C?.relativeFrom}-${C?.durationInFrames}`,[g.src,C?.cumulatedFrom,C?.relativeFrom,C?.durationInFrames]);if(!x)throw Error("No video config found");let M=nu({volume:t,frame:b,mediaVolume:1});nF(M),(0,r.useEffect)(()=>
39{if(!g.src)throw Error("No src passed");if(!g.muted&&!(M<=0)&&window.remotion_audioEnabled)return S({type:"video",src:r_(g.src),id:N,frame:v,volume:M,mediaFrame:w,playbackRate:a??1,toneFrequency:s??1,audioStartFrame:Math.max(0,-(C?.cumulatedNegativeFrom??0)),audioStreamIndex:m??0}),()=>P(N)},[g.muted,g.src,S,N,P,M,w,v,a,s,C?.cumulatedNegativeFrom,m]),(0,r.useImperativeHandle)(y,()=>E.current,[]),ol({ref:E,onVideoFrame:p}),(0,r.useEffect)(()=>{if(!window.remotion_videoEnabled)return;let{current:t}=E;if(!t)return;let r=nw({frame:w,playbackRate:a||1,startFrom:-R,fps:x.fps}),n=T(`Rendering <Html5Video /> with src="${g.src}" at time ${r}`,{retries:d??void 0,timeoutInMilliseconds:f??void 0});if(window.process?.env?.NODE_ENV==="test")return void $(n);if(r7(t.currentTime,r)){if(t.readyState>=2)return void $(n);let e=()=>{$(n)};return t.addEventListener("loadeddata",e,{once:!0}),()=>{t.removeEventListener("loadeddata",e)}}let o=()=>{$(n)},i=(({element:e,desiredTime:t,fps:r,logLevel:n,mountTime:o})=>{let a=1/r/2,i=()=>{};return Number.isFinite(e.duration)&&e.currentTime>=e.duration&&t>=e.duration?{prom:Promise.resolve(),cancel:()=>{}}:{prom:new Promise((r,s)=>{let l=ow({element:e,desiredTime:t+a,logLevel:n,mountTime:o});l.wait.then(l=>{if(Math.abs(t-l)<=a)return r();let u=ow({element:e,desiredTime:l+a*(t>l?1:-1),logLevel:n,mountTime:o});i=u.cancel,u.wait.then(l=>{if(ov(Math.abs(t-l))<=ov(a))return r();let u=ow({element:e,desiredTime:t+a,logLevel:n,mountTime:o});return i=u.cancel,u.wait.then(()=>{r()}).catch(e=>{s(e)})}).catch(e=>{s(e)})}),i=l.cancel}),cancel:()=>{i()}}})({element:t,desiredTime:r,fps:x.fps,logLevel:I,mountTime:F});i.prom.then(()=>{$(n)}),t.addEventListener("ended",o,{once:!0});let s=()=>{if(t?.error){if(console.error("Error occurred in video",t?.error),!e)throw new ou({message:`The browser threw an error while playing the video ${g.src}: Code ${t.error.code} - ${t?.error?.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:g.src})}else throw new ou({message:"The browser threw an error",src:g.src})};return t.addEventListener("error",s,{once:!0}),()=>{i.cancel(),t.removeEventListener("ended",o),t.removeEventListener("error",s),$(n)}},[b,g.src,a,x.fps,w,R,e,d,f,I,F,$,T]);let{src:V}=g;return k.isRendering&&(0,r.useLayoutEffect)(()=>{if(window.process?.env?.NODE_ENV==="test")return;let e=T("Loading <Html5Video> duration with src="+V,{retries:d??void 0,timeoutInMilliseconds:f??void 0}),{current:t}=E,r=()=>{t?.duration&&i(V,t.duration),$(e)};return t?.duration?(i(V,t.duration),$(e)):t?.addEventListener("loadedmetadata",r,{once:!0}),()=>{t?.removeEventListener("loadedmetadata",r),$(e)}},[V,i,d,f,$,T]),(0,o.jsx)("video",{ref:E,disableRemotePlayback:!0,...g})}),ox=(0,r.forwardRef)((e,t)=>{let{startFrom:n,endAt:a,trimBefore:i,trimAfter:s,name:l,pauseWhenBuffering:u,stack:d,_remotionInternalNativeLoopPassed:f,showInTimeline:c,onAutoPlayError:m,onVideoFrame:p,...h}=e,{loop:g,...y}=e,{fps:v}=eW(),w=W();if(w.isClientSideRendering)throw Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");let{durations:b,setDurations:x}=(0,r.useContext)(rQ);if("string"==typeof t)throw Error("string refs are not supported");if("string"!=typeof e.src)throw TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);let E=rY(e.src),C=(0,r.useCallback)((e,t)=>{x({type:"got-duration",durationInSeconds:t,src:e})},[x]),R=b[r_(E)]??b[r_(e.src)];rK({startFrom:n,endAt:a,trimBefore:i,trimAfter:s});let{trimBeforeValue:k,trimAfterValue:I}=rG({startFrom:n,endAt:a,trimBefore:i,trimAfter:s});return g&&void 0!==R?Number.isFinite(R)?(0,o.jsx)(rD,{durationInFrames:rL({trimAfter:I,mediaDurationInFrames:R*v,playbackRate:e.playbackRate??1,trimBefore:k}),layout:"none",name:l,showInTimeline:!1,children:(0,o.jsx)(ox,{...y,ref:t,stack:d,_remotionInternalNativeLoopPassed:!0})}):(0,o.jsx)(ox,{...y,ref:t,stack:d,_remotionInternalNativeLoopPassed:!0}):void 0!==k||void 0!==I?(0,o.jsx)(ry,{layout:"none",from:0-(k??0),showInTimeline:!1,durationInFrames:void 0===I?void 0:I/(e.playbackRate??1),name:l,children:(0,o.jsx)(ox,{pauseWhenBuffering:u??!1,onVideoFrame:p,...h,ref:t,stack:d})}):(rJ({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Video"),w.isRendering)?(0,o.jsx)(ob,{onDuration:C,onVideoFrame:p??null,...h,ref:t}):(0,o.jsx)(od,{onlyWarnForMediaSeekingError:!1,...h,ref:t,onVideoFrame:p??null,pauseWhenBuffering:u??!1,onDuration:C,_remotionInternalStack:d??null,_remotionInternalNativeLoopPassed:f??!1,showInTimeline:c??!0,onAutoPlayError:m??void 0})});ew(ox),(()=>{if("u"<typeof globalThis)return;let e=()=>{globalThis.remotion_imported=eb,"u">typeof window&&(window.remotion_imported=eb)},t=globalThis.remotion_imported||"u">typeof window&&window.remotion_imported;if(t){if(t===eb)return;if("string"==typeof t&&t.includes("webcodecs"))return e();throw TypeError(`\uD83D\uDEA8 Multiple versions of Remotion detected: ${[eb,"string"==typeof t?t:"an older version"].filter(y).join(" and ")}. This will cause things to break in an unexpected way.
40Check that all your Remotion packages are on the same version. If your dependencies depen
40d on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`)}e()})();var oE=new Proxy({},{get:(e,r)=>"Bundling"===r||"Rendering"===r||"Log"===r||"Puppeteer"===r||"Output"===r?oE:()=>{console.warn("⚠️  The CLI configuration has been extracted from Remotion Core."),console.warn("Update the import from the config file:"),console.warn(),console.warn("- Delete:"),console.warn('import {Config} from "remotion";'),console.warn("+ Replace:"),console.warn('import {Config} from "@remotion/cli/config";'),console.warn(),console.warn("For more information, see https://www.remotion.dev/docs/4-0-migration."),t.default.exit(1)}});ry.displayName="Sequence",ew(ry),ew(ey),ew(e=>{let{name:t,children:n}=e,a=(0,r.useContext)(b),{registerFolder:i,unregisterFolder:s}=(0,r.useContext)(m),l=g(),u=e.stack??null;if(null==t)throw TypeError("You must pass a name to a <Folder />.");if("string"!=typeof t)throw TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof t}`);if(!v(t))throw Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${t}`);let d=[a.parentName,a.folderName].filter(y),f=0===d.length?null:d.join("/"),c=(0,r.useMemo)(()=>({folderName:t,parentName:f}),[t,f]);return(0,r.useEffect)(()=>(i(t,f,l.get(),u),()=>{s(t,f)}),[t,a.folderName,f,i,s,l,u]),(0,o.jsx)(b.Provider,{value:c,children:n})}),e.s(["AbsoluteFill",0,S,"Composition",0,ey,"Easing",0,tN,"Img",0,nG,"Internals",0,{MaxMediaCacheSizeContext:n6,useUnsafeVideoConfig:eH,useFrameForVolumeProp:ns,useTimelinePosition:e_,useAbsoluteTimelinePosition:eL,evaluateVolume:nu,getAbsoluteSrc:r_,getAssetDisplayName:nl,Timeline:eE,validateMediaTrimProps:rK,validateMediaProps:rJ,resolveTrimProps:rG,VideoForPreview:od,CompositionManager:c,CompositionSetters:m,VisualModePropStatusesContext:e9,VisualModePropStatusesRefContext:e7,VisualModeDragOverridesContext:te,VisualModeSettersContext:tt,SequenceManager:e4,SequenceManagerRefContext:e6,SequenceStackTracesUpdateContext:on,baseSchema:e0,sequenceSchema:e1,SequenceWithoutSchema:rg,sequenceStyleSchema:eY,sequenceVisualStyleSchema:eU,sequencePremountSchema:eB,transformSchema:eU,premountSchema:eB,flattenActiveSchema:rn,getFlatSchemaWithAllKeys:ro,RemotionRootContexts:({children:e,numberOfAudioTags:t,logLevel:n,audioLatencyHint:a,previewSampleRate:i,videoEnabled:s,audioEnabled:l,frameState:u})=>{let d=(0,r.useMemo)(()=>{let e=0;return{getNonce:()=>e++}},[]),f=(0,r.useMemo)(()=>({logLevel:n,mountTime:Date.now()}),[n]);return(0,o.jsx)(ei.Provider,{value:f,children:(0,o.jsx)(p.Provider,{value:d,children:(0,o.jsx)(e$,{frameState:u,children:(0,o.jsx)(n7,{videoEnabled:s,audioEnabled:l,children:(0,o.jsx)(q,{children:(0,o.jsx)(rU,{children:(0,o.jsx)(tn,{children:(0,o.jsx)(rX,{children:(0,o.jsx)(np,{children:(0,o.jsx)(r8,{audioLatencyHint:a,audioEnabled:l,previewSampleRate:i,children:(0,o.jsx)(r9,{numberOfAudioTags:t,children:e})})})})})})})})})})})},CompositionManagerProvider:({children:e,onlyRenderComposition:t,currentCompositionMetadata:n,initialCompositions:a,initialCanvasContent:i})=>{let[s,l]=(0,r.useState)([]),[u,d]=(0,r.useState)(i),[f,p]=(0,r.useState)(a),h=(0,r.useRef)(f),g=(0,r.useCallback)(e=>{p(t=>{let r=e(t);return h.current=r,r})},[]),y=(0,r.useCallback)(e=>{g(t=>{if(t.find(t=>t.id===e.id))throw Error(`Multiple composition with id ${e.id} are registered.`);return[...t,e]})},[g]),v=(0,r.useCallback)(e=>{p(t=>t.filter(t=>t.id!==e))},[]),w=(0,r.useCallback)((e,t,r,n)=>{l(o=>[...o,{name:e,parent:t,nonce:r,stack:n}])},[]),b=(0,r.useCallback)((e,t)=>{l(r=>r.filter(r=>r.name!==e||r.parent!==t))},[]);(0,r.useImperativeHandle)(nX,()=>({getCompositions:()=>h.current}),[]);let x=(0,r.useMemo)(()=>({registerComposition:y,unregisterComposition:v,registerFolder:w,unregisterFolder:b,setCanvasContent:d,onlyRenderComposition:t}),[y,w,v,b,t]),E=(0,r.useMemo)(()=>({compositions:f,folders:s,currentCompositionMetadata:n,canvasContent:u}),[f,s,n,u]);return(0,o.jsx)(c.Provider,{value:E,children:(0,o.jsx)(m.Provider,{value:x,children:e})})},useVideo:ec,getRoot:()=>null,useMediaVolumeState:nk,useMediaMutedState:nI,useMediaInTimeline:nc,useLazyComponent:ef,truthy:y,SequenceContext:ex,PremountContext:e3,useRemotionContexts:function(){let e=r.default.useContext(c),t=r.default.useContext(eI),n=r.default.useContext(ek),o=r.default.useContext(ex),a=r.default.useContext(p),i=r.default.useContext(s),l=r.default.useContext(rH),u=r.default.useContext(Y),d=r.default.useContext(rj),f=r.default.useContext(e4),m=r.default.useContext(e6),h=r.default.useContext(e7),g=r.default.useContext(nm),y=r.default.useContext(ei);return(0,r.useMemo)(()=>({compositionManagerCtx:e,timelineContext:t,setTimelineContext:n,sequenceContext:o,nonceContext:a,canUseRemotionHooksContext:i,preloadContext:l,resolve
40CompositionContext:u,renderAssetManagerContext:d,sequenceManagerContext:f,sequenceManagerRefContext:m,visualModePropStatusesRefContext:h,bufferManagerContext:g,logLevelContext:y}),[e,a,o,n,t,i,l,u,d,f,m,h,g,y])},RemotionContextProvider:e=>{let{children:t,contexts:r}=e;return(0,o.jsx)(ei.Provider,{value:r.logLevelContext,children:(0,o.jsx)(s.Provider,{value:r.canUseRemotionHooksContext,children:(0,o.jsx)(p.Provider,{value:r.nonceContext,children:(0,o.jsx)(rH.Provider,{value:r.preloadContext,children:(0,o.jsx)(c.Provider,{value:r.compositionManagerCtx,children:(0,o.jsx)(e6.Provider,{value:r.sequenceManagerRefContext,children:(0,o.jsx)(e4.Provider,{value:r.sequenceManagerContext,children:(0,o.jsx)(e7.Provider,{value:r.visualModePropStatusesRefContext,children:(0,o.jsx)(rj.Provider,{value:r.renderAssetManagerContext,children:(0,o.jsx)(Y.Provider,{value:r.resolveCompositionContext,children:(0,o.jsx)(eI.Provider,{value:r.timelineContext,children:(0,o.jsx)(ek.Provider,{value:r.setTimelineContext,children:(0,o.jsx)(ex.Provider,{value:r.sequenceContext,children:(0,o.jsx)(nm.Provider,{value:r.bufferManagerContext,children:t})})})})})})})})})})})})})})},CSSUtils:n0,setupEnvVariables:()=>{let e=(()=>{if(E().isRendering){let e=window.remotion_envVariables;return e?{...JSON.parse(e),NODE_ENV:"production"}:{}}return{NODE_ENV:"production"}})();window.process||(window.process={}),window.process.env||(window.process.env={}),Object.keys(e).forEach(t=>{window.process.env[t]=e[t]})},MediaVolumeContext:nC,SetMediaVolumeContext:nR,getRemotionEnvironment:E,SharedAudioContext:r4,SharedAudioContextProvider:r8,SharedAudioTagsContext:r6,SharedAudioTagsContextProvider:r9,invalidCompositionErrorMessage:ep,invalidFolderNameErrorMessage:w,calculateMediaDuration:rL,isCompositionIdValid:em,isFolderNameValid:v,getPreviewDomElement:()=>document.getElementById(n4),compositionsRef:nX,portalNode:j,waitForRoot:e=>(n8.push(e),()=>{n8=n8.filter(t=>t!==e)}),SetTimelineContext:ek,CanUseRemotionHooksProvider:l,CanUseRemotionHooks:s,PrefetchProvider:rU,DurationsContextProvider:rX,IsPlayerContextProvider:({children:e})=>(0,o.jsx)(F.Provider,{value:!0,children:e}),useIsPlayer:T,EditorPropsProvider:q,EditorPropsContext:O,usePreload:rY,NonceContext:p,resolveVideoConfig:or,resolveVideoConfigOrCatch:e=>{try{let t=or(e);return{type:"success",result:t}}catch(e){return{type:"error",error:e}}},ResolveCompositionContext:Y,useResolvedVideoConfig:K,resolveCompositionsRef:J,REMOTION_STUDIO_CONTAINER_ELEMENT:n4,RenderAssetManager:rj,persistCurrentFrame:eS,usePlaybackRate:ej,useTimelineContext:eA,useTimelineSetFrame:eO,isIosSafari:nr,WATCH_REMOTION_STATIC_FILES:"remotion_staticFilesChanged",addSequenceStackTraces:ew,useMediaStartsAt:ni,BufferingProvider:np,BufferingContextReact:nm,getComponentsToAddStacksTo:()=>ev,CurrentScaleContext:oo,PixelDensityContext:oi,PreviewSizeContext:oa,calculateScale:({canvasSize:e,compositionHeight:t,compositionWidth:r,previewSize:n})=>{let o=Math.min(e.height/t,e.width/r);return"auto"===n?0===o?1:o:Number(n)},validateRenderAsset:rA,Log:er,LogLevelContext:ei,useLogLevel:es,playbackLogging:rq,timeValueRef:D,compositionSelectorRef:oc,RemotionEnvironmentContext:H,warnAboutTooHighVolume:nF,AudioForPreview:nT,OBJECTFIT_CONTAIN_CLASS_NAME:n5,InnerOffthreadVideo:of,useBasicMediaInTimeline:nf,getInputPropsOverride:_,setInputPropsOverride:e=>{if("u">typeof localStorage){if(null===e)return void localStorage.removeItem("remotion_inputPropsOverride"+window.location.origin);localStorage.setItem("remotion_inputPropsOverride"+window.location.origin,JSON.stringify(e))}},useVideoEnabled:()=>{let e=(0,r.useContext)(n9);return e&&null!==e.videoEnabled?e.videoEnabled:window.remotion_videoEnabled},useAudioEnabled:()=>{let e=(0,r.useContext)(n9);return e&&null!==e.audioEnabled?e.audioEnabled:window.remotion_audioEnabled},useIsPlayerBuffering:nh,TimelinePosition:eE,DelayRenderContextType:eu,TimelineContext:eI,PlaybackRateContext:eF,AbsoluteTimeContext:eT,RenderAssetManagerProvider:({children:e,collectAssets:t})=>{let[n,a]=(0,r.useState)([]),i=(0,r.useRef)([]),s=(0,r.useCallback)(e=>{rA(e),i.current=[...i.current,e],a(i.current)},[]);t&&(0,r.useImperativeHandle)(t,()=>({collectAssets:()=>{let e=i.current;return i.current=[],a([]),e}}),[]);let l=(0,r.useCallback)(e=>{i.current=i.current.filter(t=>t.id!==e),a(i.current)},[]);(0,r.useLayoutEffect)(()=>{"u">typeof window&&(window.remotion_collectAssets=()=>{let e=i.current;return i.current=[],a([]),e})},[]);let u=(0,r.useMemo)(()=>({registerRenderAsset:s,unregisterRenderAsset:l,renderAssets:n}),[n,s,l]);return(0,o.jsx)(rj.Provider,{value:u,children:e})},getEffectiveVisualModeValue:t6,CompositionRenderErrorContext:u,useEffectChainState:rF,createEffe
40ctChainState:rC,cleanupEffectChainState:rR,runEffectChain:rI,useMemoizedEffects:rr,useMemoizedEffectDefinitions:t7,createEffect:e=>{let{calculateKey:t,validateParams:r}=e,n={...e,documentationLink:e.documentationLink??null,calculateKey:e=>{let r=e.disabled??!1;return`${t(e)}-disabled-${r}`},schema:{disabled:rV,...e.schema}};return (e={})=>(r(e),{definition:n,params:e,effectKey:n.calculateKey(e),memoized:!1})},createWebGLContextError:e=>Error(rw("WebGL",e)),createWebGL2ContextError:rb,computeEffectiveSchemaValuesDotNotation:ru,interpolateKeyframedStatus:t3,makeStaticDragOverride:e=>({type:"static",value:e}),makeKeyframedDragOverride:({status:e,frame:t,value:r})=>{let n=e.keyframes.findIndex(e=>e.frame===t),o=-1===n?[...e.keyframes,{frame:t,value:r}].sort((e,t)=>e.frame-t.frame):e.keyframes.map((e,o)=>o===n?{frame:t,value:r}:e),a=[...e.easing];for(;a.length<o.length-1;)a.push(ri);return a.length>o.length-1&&(a.length=o.length-1),{type:"keyframed",status:{...e,keyframes:o,easing:a}}},resolveDragOverrideValue:t4,getStaticDragOverrideValue:e=>{if(e?.type==="static")return e.value},OverrideIdsToNodePathsGettersContext:t8,OverrideIdsToNodePathsSettersContext:t9,findPropsToDelete:ra,makeSequencePropsSubscriptionKey:e8,getPropStatusesCtx:rt,getEffectPropStatusesCtx:re,hiddenField:eJ,durationInFramesField:eZ,freezeField:eX,fromField:eQ},"Sequence",0,ry,"continueRender",0,e=>{"u">typeof window&&ea({scope:window,handle:e,environment:E(),logLevel:window.remotion_logLevel??"info"})},"delayRender",0,eo,"interpolate",0,tR,"random",0,eR,"spring",0,tS,"staticFile",0,e=>{var t;if(null===e)throw TypeError("null was passed to staticFile()");if(void 0===e)throw TypeError("undefined was passed to staticFile()");if(e.startsWith("http://")||e.startsWith("https://"))throw TypeError(`staticFile() does not support remote URLs - got "${e}". Instead, pass the URL without wrapping it in staticFile(). See: https://remotion.dev/docs/staticfile-remote-urls`);if(e.startsWith("..")||e.startsWith("./"))throw TypeError(`staticFile() does not support relative paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("/Users")||e.startsWith("/home")||e.startsWith("/tmp")||e.startsWith("/etc")||e.startsWith("/opt")||e.startsWith("/var")||e.startsWith("C:")||e.startsWith("D:")||e.startsWith("E:"))throw TypeError(`staticFile() does not support absolute paths - got "${e}". Instead, pass the name of a file that is inside the public/ folder. See: https://remotion.dev/docs/staticfile-relative-paths`);if(e.startsWith("public/"))throw TypeError(`Do not include the public/ prefix when using staticFile() - got "${e}". See: https://remotion.dev/docs/staticfile-relative-paths`);let r=(e=>{for(let t of Object.keys(oh))if(e.includes(t))return{containsHex:!0,hexCode:t};return{containsHex:!1}})(e);r.containsHex&&(og[t=`WARNING: You seem to pass an already encoded path (path contains ${r.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`]||(console.warn(t),og[t]=!0));let n=(e=>{if("u">typeof window&&window.remotion_staticBase){if(e.startsWith(window.remotion_staticBase))throw Error(`The value "${e}" is already prefixed with the static base ${window.remotion_staticBase}. You don't need to call staticFile() on it.`);return`${window.remotion_staticBase}/${oy(e)}`}return`/${oy(e)}`})(e.split("/").map(e=>encodeURIComponent(e)).join("/"));return n.startsWith("/")?n:`/${n}`},"useCurrentFrame",0,eq,"useVideoConfig",0,eW])}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.