ossclip 0.1.18 → 0.1.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/editor-dist/assets/index-B44I-xE4.js +163 -0
- package/editor-dist/assets/index-ChRVBVLj.css +1 -0
- package/editor-dist/index.html +2 -2
- package/package.json +4 -4
- package/src/analyse.ts +101 -0
- package/src/caption-report.ts +217 -0
- package/src/edit.ts +38 -0
- package/src/overrides-write.ts +77 -0
- package/src/phase-timing.ts +140 -0
- package/src/produce.ts +145 -88
- package/src/program.ts +79 -0
- package/editor-dist/assets/index-C8IPo60X.css +0 -1
- package/editor-dist/assets/index-CdwzWN3j.js +0 -162
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
var Ux=Object.defineProperty;var Zx=(e,t,n)=>t in e?Ux(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>Zx(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Yx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Mg={exports:{}},wl={},$g={exports:{}},me={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ps=Symbol.for("react.element"),Kx=Symbol.for("react.portal"),Xx=Symbol.for("react.fragment"),Gx=Symbol.for("react.strict_mode"),qx=Symbol.for("react.profiler"),Qx=Symbol.for("react.provider"),Jx=Symbol.for("react.context"),e1=Symbol.for("react.forward_ref"),t1=Symbol.for("react.suspense"),n1=Symbol.for("react.memo"),r1=Symbol.for("react.lazy"),bp=Symbol.iterator;function o1(e){return e===null||typeof e!="object"?null:(e=bp&&e[bp]||e["@@iterator"],typeof e=="function"?e:null)}var Ag={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Ng=Object.assign,Lg={};function Ko(e,t,n){this.props=e,this.context=t,this.refs=Lg,this.updater=n||Ag}Ko.prototype.isReactComponent={};Ko.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ko.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zg(){}zg.prototype=Ko.prototype;function $d(e,t,n){this.props=e,this.context=t,this.refs=Lg,this.updater=n||Ag}var Ad=$d.prototype=new zg;Ad.constructor=$d;Ng(Ad,Ko.prototype);Ad.isPureReactComponent=!0;var Sp=Array.isArray,Dg=Object.prototype.hasOwnProperty,Nd={current:null},Og={key:!0,ref:!0,__self:!0,__source:!0};function Vg(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)Dg.call(t,r)&&!Og.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];o.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:ps,type:e,key:i,ref:s,props:o,_owner:Nd.current}}function i1(e,t){return{$$typeof:ps,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ld(e){return typeof e=="object"&&e!==null&&e.$$typeof===ps}function s1(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Ep=/\/+/g;function vu(e,t){return typeof e=="object"&&e!==null&&e.key!=null?s1(""+e.key):t.toString(36)}function xa(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ps:case Kx:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+vu(s,0):r,Sp(o)?(n="",e!=null&&(n=e.replace(Ep,"$&/")+"/"),xa(o,t,n,"",function(u){return u})):o!=null&&(Ld(o)&&(o=i1(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(Ep,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Sp(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+vu(i,a);s+=xa(i,t,n,l,o)}else if(l=o1(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+vu(i,a++),s+=xa(i,t,n,l,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function As(e,t,n){if(e==null)return e;var r=[],o=0;return xa(e,r,"","",function(i){return t.call(n,i,o++)}),r}function a1(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var St={current:null},ba={transition:null},l1={ReactCurrentDispatcher:St,ReactCurrentBatchConfig:ba,ReactCurrentOwner:Nd};function Bg(){throw Error("act(...) is not supported in production builds of React.")}me.Children={map:As,forEach:function(e,t,n){As(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return As(e,function(){t++}),t},toArray:function(e){return As(e,function(t){return t})||[]},only:function(e){if(!Ld(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};me.Component=Ko;me.Fragment=Xx;me.Profiler=qx;me.PureComponent=$d;me.StrictMode=Gx;me.Suspense=t1;me.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=l1;me.act=Bg;me.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Ng({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=Nd.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Dg.call(t,l)&&!Og.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:ps,type:e.type,key:o,ref:i,props:r,_owner:s}};me.createContext=function(e){return e={$$typeof:Jx,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Qx,_context:e},e.Consumer=e};me.createElement=Vg;me.createFactory=function(e){var t=Vg.bind(null,e);return t.type=e,t};me.createRef=function(){return{current:null}};me.forwardRef=function(e){return{$$typeof:e1,render:e}};me.isValidElement=Ld;me.lazy=function(e){return{$$typeof:r1,_payload:{_status:-1,_result:e},_init:a1}};me.memo=function(e,t){return{$$typeof:n1,type:e,compare:t===void 0?null:t}};me.startTransition=function(e){var t=ba.transition;ba.transition={};try{e()}finally{ba.transition=t}};me.unstable_act=Bg;me.useCallback=function(e,t){return St.current.useCallback(e,t)};me.useContext=function(e){return St.current.useContext(e)};me.useDebugValue=function(){};me.useDeferredValue=function(e){return St.current.useDeferredValue(e)};me.useEffect=function(e,t){return St.current.useEffect(e,t)};me.useId=function(){return St.current.useId()};me.useImperativeHandle=function(e,t,n){return St.current.useImperativeHandle(e,t,n)};me.useInsertionEffect=function(e,t){return St.current.useInsertionEffect(e,t)};me.useLayoutEffect=function(e,t){return St.current.useLayoutEffect(e,t)};me.useMemo=function(e,t){return St.current.useMemo(e,t)};me.useReducer=function(e,t,n){return St.current.useReducer(e,t,n)};me.useRef=function(e){return St.current.useRef(e)};me.useState=function(e){return St.current.useState(e)};me.useSyncExternalStore=function(e,t,n){return St.current.useSyncExternalStore(e,t,n)};me.useTransition=function(){return St.current.useTransition()};me.version="18.3.1";$g.exports=me;var c=$g.exports;const ne=Yx(c);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var u1=c,c1=Symbol.for("react.element"),d1=Symbol.for("react.fragment"),f1=Object.prototype.hasOwnProperty,p1=u1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m1={key:!0,ref:!0,__self:!0,__source:!0};function Wg(e,t,n){var r,o={},i=null,s=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(s=t.ref);for(r in t)f1.call(t,r)&&!m1.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:c1,type:e,key:i,ref:s,props:o,_owner:p1.current}}wl.Fragment=d1;wl.jsx=Wg;wl.jsxs=Wg;Mg.exports=wl;var d=Mg.exports,gc={},Hg={exports:{}},Ht={},Ug={exports:{}},Zg={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(I,_){var F=I.length;I.push(_);e:for(;0<F;){var z=F-1>>>1,B=I[z];if(0<o(B,_))I[z]=_,I[F]=B,F=z;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var _=I[0],F=I.pop();if(F!==_){I[0]=F;e:for(var z=0,B=I.length,Y=B>>>1;z<Y;){var $=2*(z+1)-1,A=I[$],X=$+1,Z=I[X];if(0>o(A,F))X<B&&0>o(Z,A)?(I[z]=Z,I[X]=F,z=X):(I[z]=A,I[$]=F,z=$);else if(X<B&&0>o(Z,F))I[z]=Z,I[X]=F,z=X;else break e}}return _}function o(I,_){var F=I.sortIndex-_.sortIndex;return F!==0?F:I.id-_.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],f=1,p=null,m=3,h=!1,y=!1,g=!1,E=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(I){for(var _=n(u);_!==null;){if(_.callback===null)r(u);else if(_.startTime<=I)r(u),_.sortIndex=_.expirationTime,t(l,_);else break;_=n(u)}}function b(I){if(g=!1,x(I),!y)if(n(l)!==null)y=!0,O(S);else{var _=n(u);_!==null&&R(b,_.startTime-I)}}function S(I,_){y=!1,g&&(g=!1,v(T),T=-1),h=!0;var F=m;try{for(x(_),p=n(l);p!==null&&(!(p.expirationTime>_)||I&&!M());){var z=p.callback;if(typeof z=="function"){p.callback=null,m=p.priorityLevel;var B=z(p.expirationTime<=_);_=e.unstable_now(),typeof B=="function"?p.callback=B:p===n(l)&&r(l),x(_)}else r(l);p=n(l)}if(p!==null)var Y=!0;else{var $=n(u);$!==null&&R(b,$.startTime-_),Y=!1}return Y}finally{p=null,m=F,h=!1}}var C=!1,k=null,T=-1,P=5,j=-1;function M(){return!(e.unstable_now()-j<P)}function D(){if(k!==null){var I=e.unstable_now();j=I;var _=!0;try{_=k(!0,I)}finally{_?N():(C=!1,k=null)}}else C=!1}var N;if(typeof w=="function")N=function(){w(D)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,H=L.port2;L.port1.onmessage=D,N=function(){H.postMessage(null)}}else N=function(){E(D,0)};function O(I){k=I,C||(C=!0,N())}function R(I,_){T=E(function(){I(e.unstable_now())},_)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){y||h||(y=!0,O(S))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(I){switch(m){case 1:case 2:case 3:var _=3;break;default:_=m}var F=m;m=_;try{return I()}finally{m=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,_){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var F=m;m=I;try{return _()}finally{m=F}},e.unstable_scheduleCallback=function(I,_,F){var z=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?z+F:z):F=z,I){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=F+B,I={id:f++,callback:_,priorityLevel:I,startTime:F,expirationTime:B,sortIndex:-1},F>z?(I.sortIndex=F,t(u,I),n(l)===null&&I===n(u)&&(g?(v(T),T=-1):g=!0,R(b,F-z))):(I.sortIndex=B,t(l,I),y||h||(y=!0,O(S))),I},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(I){var _=m;return function(){var F=m;m=_;try{return I.apply(this,arguments)}finally{m=F}}}})(Zg);Ug.exports=Zg;var h1=Ug.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var g1=c,Wt=h1;function q(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Yg=new Set,Ui={};function Zr(e,t){Do(e,t),Do(e+"Capture",t)}function Do(e,t){for(Ui[e]=t,e=0;e<t.length;e++)Yg.add(t[e])}var On=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vc=Object.prototype.hasOwnProperty,v1=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,kp={},Cp={};function y1(e){return vc.call(Cp,e)?!0:vc.call(kp,e)?!1:v1.test(e)?Cp[e]=!0:(kp[e]=!0,!1)}function w1(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function x1(e,t,n,r){if(t===null||typeof t>"u"||w1(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Et(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Et(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Et(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Et(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Et(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new Et(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Et(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Et(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Et(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Et(e,5,!1,e.toLowerCase(),null,!1,!1)});var zd=/[\-:]([a-z])/g;function Dd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(zd,Dd);ut[t]=new Et(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(zd,Dd);ut[t]=new Et(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(zd,Dd);ut[t]=new Et(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Et(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Et("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Et(e,1,!1,e.toLowerCase(),null,!0,!0)});function Od(e,t,n,r){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(x1(t,n,o,r)&&(n=null),r||o===null?y1(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Un=g1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ns=Symbol.for("react.element"),ho=Symbol.for("react.portal"),go=Symbol.for("react.fragment"),Vd=Symbol.for("react.strict_mode"),yc=Symbol.for("react.profiler"),Kg=Symbol.for("react.provider"),Xg=Symbol.for("react.context"),Bd=Symbol.for("react.forward_ref"),wc=Symbol.for("react.suspense"),xc=Symbol.for("react.suspense_list"),Wd=Symbol.for("react.memo"),er=Symbol.for("react.lazy"),Gg=Symbol.for("react.offscreen"),Ip=Symbol.iterator;function ci(e){return e===null||typeof e!="object"?null:(e=Ip&&e[Ip]||e["@@iterator"],typeof e=="function"?e:null)}var Be=Object.assign,yu;function Ti(e){if(yu===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);yu=t&&t[1]||""}return`
|
|
34
|
+
`+yu+e}var wu=!1;function xu(e,t){if(!e||wu)return"";wu=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
35
|
+
`),i=r.stack.split(`
|
|
36
|
+
`),s=o.length-1,a=i.length-1;1<=s&&0<=a&&o[s]!==i[a];)a--;for(;1<=s&&0<=a;s--,a--)if(o[s]!==i[a]){if(s!==1||a!==1)do if(s--,a--,0>a||o[s]!==i[a]){var l=`
|
|
37
|
+
`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{wu=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ti(e):""}function b1(e){switch(e.tag){case 5:return Ti(e.type);case 16:return Ti("Lazy");case 13:return Ti("Suspense");case 19:return Ti("SuspenseList");case 0:case 2:case 15:return e=xu(e.type,!1),e;case 11:return e=xu(e.type.render,!1),e;case 1:return e=xu(e.type,!0),e;default:return""}}function bc(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case go:return"Fragment";case ho:return"Portal";case yc:return"Profiler";case Vd:return"StrictMode";case wc:return"Suspense";case xc:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xg:return(e.displayName||"Context")+".Consumer";case Kg:return(e._context.displayName||"Context")+".Provider";case Bd:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Wd:return t=e.displayName||null,t!==null?t:bc(e.type)||"Memo";case er:t=e._payload,e=e._init;try{return bc(e(t))}catch{}}return null}function S1(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return bc(t);case 8:return t===Vd?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function gr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function E1(e){var t=qg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ls(e){e._valueTracker||(e._valueTracker=E1(e))}function Qg(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=qg(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Na(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Sc(e,t){var n=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Tp(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=gr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Jg(e,t){t=t.checked,t!=null&&Od(e,"checked",t,!1)}function Ec(e,t){Jg(e,t);var n=gr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?kc(e,t.type,n):t.hasOwnProperty("defaultValue")&&kc(e,t.type,gr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Rp(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function kc(e,t,n){(t!=="number"||Na(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ri=Array.isArray;function Po(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+gr(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Cc(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(q(91));return Be({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function _p(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(q(92));if(Ri(n)){if(1<n.length)throw Error(q(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:gr(n)}}function ev(e,t){var n=gr(t.value),r=gr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Pp(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tv(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ic(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tv(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var zs,nv=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(zs=zs||document.createElement("div"),zs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=zs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Zi(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Mi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},k1=["Webkit","ms","Moz","O"];Object.keys(Mi).forEach(function(e){k1.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Mi[t]=Mi[e]})});function rv(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Mi.hasOwnProperty(e)&&Mi[e]?(""+t).trim():t+"px"}function ov(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=rv(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var C1=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Tc(e,t){if(t){if(C1[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(q(62))}}function Rc(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var _c=null;function Hd(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Pc=null,Fo=null,jo=null;function Fp(e){if(e=gs(e)){if(typeof Pc!="function")throw Error(q(280));var t=e.stateNode;t&&(t=kl(t),Pc(e.stateNode,e.type,t))}}function iv(e){Fo?jo?jo.push(e):jo=[e]:Fo=e}function sv(){if(Fo){var e=Fo,t=jo;if(jo=Fo=null,Fp(e),t)for(e=0;e<t.length;e++)Fp(t[e])}}function av(e,t){return e(t)}function lv(){}var bu=!1;function uv(e,t,n){if(bu)return e(t,n);bu=!0;try{return av(e,t,n)}finally{bu=!1,(Fo!==null||jo!==null)&&(lv(),sv())}}function Yi(e,t){var n=e.stateNode;if(n===null)return null;var r=kl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(q(231,t,typeof n));return n}var Fc=!1;if(On)try{var di={};Object.defineProperty(di,"passive",{get:function(){Fc=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{Fc=!1}function I1(e,t,n,r,o,i,s,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(f){this.onError(f)}}var $i=!1,La=null,za=!1,jc=null,T1={onError:function(e){$i=!0,La=e}};function R1(e,t,n,r,o,i,s,a,l){$i=!1,La=null,I1.apply(T1,arguments)}function _1(e,t,n,r,o,i,s,a,l){if(R1.apply(this,arguments),$i){if($i){var u=La;$i=!1,La=null}else throw Error(q(198));za||(za=!0,jc=u)}}function Yr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function cv(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function jp(e){if(Yr(e)!==e)throw Error(q(188))}function P1(e){var t=e.alternate;if(!t){if(t=Yr(e),t===null)throw Error(q(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return jp(o),e;if(i===r)return jp(o),t;i=i.sibling}throw Error(q(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,a=o.child;a;){if(a===n){s=!0,n=o,r=i;break}if(a===r){s=!0,r=o,n=i;break}a=a.sibling}if(!s){for(a=i.child;a;){if(a===n){s=!0,n=i,r=o;break}if(a===r){s=!0,r=i,n=o;break}a=a.sibling}if(!s)throw Error(q(189))}}if(n.alternate!==r)throw Error(q(190))}if(n.tag!==3)throw Error(q(188));return n.stateNode.current===n?e:t}function dv(e){return e=P1(e),e!==null?fv(e):null}function fv(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=fv(e);if(t!==null)return t;e=e.sibling}return null}var pv=Wt.unstable_scheduleCallback,Mp=Wt.unstable_cancelCallback,F1=Wt.unstable_shouldYield,j1=Wt.unstable_requestPaint,Ye=Wt.unstable_now,M1=Wt.unstable_getCurrentPriorityLevel,Ud=Wt.unstable_ImmediatePriority,mv=Wt.unstable_UserBlockingPriority,Da=Wt.unstable_NormalPriority,$1=Wt.unstable_LowPriority,hv=Wt.unstable_IdlePriority,xl=null,Cn=null;function A1(e){if(Cn&&typeof Cn.onCommitFiberRoot=="function")try{Cn.onCommitFiberRoot(xl,e,void 0,(e.current.flags&128)===128)}catch{}}var dn=Math.clz32?Math.clz32:z1,N1=Math.log,L1=Math.LN2;function z1(e){return e>>>=0,e===0?32:31-(N1(e)/L1|0)|0}var Ds=64,Os=4194304;function _i(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Oa(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=_i(a):(i&=s,i!==0&&(r=_i(i)))}else s=n&~o,s!==0?r=_i(s):i!==0&&(r=_i(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-dn(t),o=1<<n,r|=e[n],t&=~o;return r}function D1(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function O1(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-dn(i),a=1<<s,l=o[s];l===-1?(!(a&n)||a&r)&&(o[s]=D1(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Mc(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function gv(){var e=Ds;return Ds<<=1,!(Ds&4194240)&&(Ds=64),e}function Su(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ms(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dn(t),e[t]=n}function V1(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-dn(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Zd(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-dn(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var Ce=0;function vv(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var yv,Yd,wv,xv,bv,$c=!1,Vs=[],ar=null,lr=null,ur=null,Ki=new Map,Xi=new Map,nr=[],B1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function $p(e,t){switch(e){case"focusin":case"focusout":ar=null;break;case"dragenter":case"dragleave":lr=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":Ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xi.delete(t.pointerId)}}function fi(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=gs(t),t!==null&&Yd(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function W1(e,t,n,r,o){switch(t){case"focusin":return ar=fi(ar,e,t,n,r,o),!0;case"dragenter":return lr=fi(lr,e,t,n,r,o),!0;case"mouseover":return ur=fi(ur,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Ki.set(i,fi(Ki.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Xi.set(i,fi(Xi.get(i)||null,e,t,n,r,o)),!0}return!1}function Sv(e){var t=Fr(e.target);if(t!==null){var n=Yr(t);if(n!==null){if(t=n.tag,t===13){if(t=cv(n),t!==null){e.blockedOn=t,bv(e.priority,function(){wv(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sa(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ac(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);_c=r,n.target.dispatchEvent(r),_c=null}else return t=gs(n),t!==null&&Yd(t),e.blockedOn=n,!1;t.shift()}return!0}function Ap(e,t,n){Sa(e)&&n.delete(t)}function H1(){$c=!1,ar!==null&&Sa(ar)&&(ar=null),lr!==null&&Sa(lr)&&(lr=null),ur!==null&&Sa(ur)&&(ur=null),Ki.forEach(Ap),Xi.forEach(Ap)}function pi(e,t){e.blockedOn===t&&(e.blockedOn=null,$c||($c=!0,Wt.unstable_scheduleCallback(Wt.unstable_NormalPriority,H1)))}function Gi(e){function t(o){return pi(o,e)}if(0<Vs.length){pi(Vs[0],e);for(var n=1;n<Vs.length;n++){var r=Vs[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ar!==null&&pi(ar,e),lr!==null&&pi(lr,e),ur!==null&&pi(ur,e),Ki.forEach(t),Xi.forEach(t),n=0;n<nr.length;n++)r=nr[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<nr.length&&(n=nr[0],n.blockedOn===null);)Sv(n),n.blockedOn===null&&nr.shift()}var Mo=Un.ReactCurrentBatchConfig,Va=!0;function U1(e,t,n,r){var o=Ce,i=Mo.transition;Mo.transition=null;try{Ce=1,Kd(e,t,n,r)}finally{Ce=o,Mo.transition=i}}function Z1(e,t,n,r){var o=Ce,i=Mo.transition;Mo.transition=null;try{Ce=4,Kd(e,t,n,r)}finally{Ce=o,Mo.transition=i}}function Kd(e,t,n,r){if(Va){var o=Ac(e,t,n,r);if(o===null)ju(e,t,r,Ba,n),$p(e,r);else if(W1(o,e,t,n,r))r.stopPropagation();else if($p(e,r),t&4&&-1<B1.indexOf(e)){for(;o!==null;){var i=gs(o);if(i!==null&&yv(i),i=Ac(e,t,n,r),i===null&&ju(e,t,r,Ba,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else ju(e,t,r,null,n)}}var Ba=null;function Ac(e,t,n,r){if(Ba=null,e=Hd(r),e=Fr(e),e!==null)if(t=Yr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=cv(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ba=e,null}function Ev(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(M1()){case Ud:return 1;case mv:return 4;case Da:case $1:return 16;case hv:return 536870912;default:return 16}default:return 16}}var ir=null,Xd=null,Ea=null;function kv(){if(Ea)return Ea;var e,t=Xd,n=t.length,r,o="value"in ir?ir.value:ir.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return Ea=o.slice(e,1<r?1-r:void 0)}function ka(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Bs(){return!0}function Np(){return!1}function Ut(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Bs:Np,this.isPropagationStopped=Np,this}return Be(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Bs)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Bs)},persist:function(){},isPersistent:Bs}),t}var Xo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gd=Ut(Xo),hs=Be({},Xo,{view:0,detail:0}),Y1=Ut(hs),Eu,ku,mi,bl=Be({},hs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qd,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==mi&&(mi&&e.type==="mousemove"?(Eu=e.screenX-mi.screenX,ku=e.screenY-mi.screenY):ku=Eu=0,mi=e),Eu)},movementY:function(e){return"movementY"in e?e.movementY:ku}}),Lp=Ut(bl),K1=Be({},bl,{dataTransfer:0}),X1=Ut(K1),G1=Be({},hs,{relatedTarget:0}),Cu=Ut(G1),q1=Be({},Xo,{animationName:0,elapsedTime:0,pseudoElement:0}),Q1=Ut(q1),J1=Be({},Xo,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),eb=Ut(J1),tb=Be({},Xo,{data:0}),zp=Ut(tb),nb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rb={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},ob={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ib(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ob[e])?!!t[e]:!1}function qd(){return ib}var sb=Be({},hs,{key:function(e){if(e.key){var t=nb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ka(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?rb[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qd,charCode:function(e){return e.type==="keypress"?ka(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ka(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ab=Ut(sb),lb=Be({},bl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Dp=Ut(lb),ub=Be({},hs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qd}),cb=Ut(ub),db=Be({},Xo,{propertyName:0,elapsedTime:0,pseudoElement:0}),fb=Ut(db),pb=Be({},bl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),mb=Ut(pb),hb=[9,13,27,32],Qd=On&&"CompositionEvent"in window,Ai=null;On&&"documentMode"in document&&(Ai=document.documentMode);var gb=On&&"TextEvent"in window&&!Ai,Cv=On&&(!Qd||Ai&&8<Ai&&11>=Ai),Op=" ",Vp=!1;function Iv(e,t){switch(e){case"keyup":return hb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vo=!1;function vb(e,t){switch(e){case"compositionend":return Tv(t);case"keypress":return t.which!==32?null:(Vp=!0,Op);case"textInput":return e=t.data,e===Op&&Vp?null:e;default:return null}}function yb(e,t){if(vo)return e==="compositionend"||!Qd&&Iv(e,t)?(e=kv(),Ea=Xd=ir=null,vo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Cv&&t.locale!=="ko"?null:t.data;default:return null}}var wb={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!wb[e.type]:t==="textarea"}function Rv(e,t,n,r){iv(r),t=Wa(t,"onChange"),0<t.length&&(n=new Gd("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ni=null,qi=null;function xb(e){Dv(e,0)}function Sl(e){var t=xo(e);if(Qg(t))return e}function bb(e,t){if(e==="change")return t}var _v=!1;if(On){var Iu;if(On){var Tu="oninput"in document;if(!Tu){var Wp=document.createElement("div");Wp.setAttribute("oninput","return;"),Tu=typeof Wp.oninput=="function"}Iu=Tu}else Iu=!1;_v=Iu&&(!document.documentMode||9<document.documentMode)}function Hp(){Ni&&(Ni.detachEvent("onpropertychange",Pv),qi=Ni=null)}function Pv(e){if(e.propertyName==="value"&&Sl(qi)){var t=[];Rv(t,qi,e,Hd(e)),uv(xb,t)}}function Sb(e,t,n){e==="focusin"?(Hp(),Ni=t,qi=n,Ni.attachEvent("onpropertychange",Pv)):e==="focusout"&&Hp()}function Eb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sl(qi)}function kb(e,t){if(e==="click")return Sl(t)}function Cb(e,t){if(e==="input"||e==="change")return Sl(t)}function Ib(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var mn=typeof Object.is=="function"?Object.is:Ib;function Qi(e,t){if(mn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!vc.call(t,o)||!mn(e[o],t[o]))return!1}return!0}function Up(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Zp(e,t){var n=Up(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Up(n)}}function Fv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Fv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jv(){for(var e=window,t=Na();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Na(e.document)}return t}function Jd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Tb(e){var t=jv(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Fv(n.ownerDocument.documentElement,n)){if(r!==null&&Jd(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Zp(n,i);var s=Zp(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var Rb=On&&"documentMode"in document&&11>=document.documentMode,yo=null,Nc=null,Li=null,Lc=!1;function Yp(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lc||yo==null||yo!==Na(r)||(r=yo,"selectionStart"in r&&Jd(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Li&&Qi(Li,r)||(Li=r,r=Wa(Nc,"onSelect"),0<r.length&&(t=new Gd("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yo)))}function Ws(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var wo={animationend:Ws("Animation","AnimationEnd"),animationiteration:Ws("Animation","AnimationIteration"),animationstart:Ws("Animation","AnimationStart"),transitionend:Ws("Transition","TransitionEnd")},Ru={},Mv={};On&&(Mv=document.createElement("div").style,"AnimationEvent"in window||(delete wo.animationend.animation,delete wo.animationiteration.animation,delete wo.animationstart.animation),"TransitionEvent"in window||delete wo.transitionend.transition);function El(e){if(Ru[e])return Ru[e];if(!wo[e])return e;var t=wo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Mv)return Ru[e]=t[n];return e}var $v=El("animationend"),Av=El("animationiteration"),Nv=El("animationstart"),Lv=El("transitionend"),zv=new Map,Kp="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function br(e,t){zv.set(e,t),Zr(t,[e])}for(var _u=0;_u<Kp.length;_u++){var Pu=Kp[_u],_b=Pu.toLowerCase(),Pb=Pu[0].toUpperCase()+Pu.slice(1);br(_b,"on"+Pb)}br($v,"onAnimationEnd");br(Av,"onAnimationIteration");br(Nv,"onAnimationStart");br("dblclick","onDoubleClick");br("focusin","onFocus");br("focusout","onBlur");br(Lv,"onTransitionEnd");Do("onMouseEnter",["mouseout","mouseover"]);Do("onMouseLeave",["mouseout","mouseover"]);Do("onPointerEnter",["pointerout","pointerover"]);Do("onPointerLeave",["pointerout","pointerover"]);Zr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Zr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Zr("onBeforeInput",["compositionend","keypress","textInput","paste"]);Zr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Zr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Zr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Pi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Fb=new Set("cancel close invalid load scroll toggle".split(" ").concat(Pi));function Xp(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,_1(r,t,void 0,e),e.currentTarget=null}function Dv(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var a=r[s],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&o.isPropagationStopped())break e;Xp(o,a,u),i=l}else for(s=0;s<r.length;s++){if(a=r[s],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&o.isPropagationStopped())break e;Xp(o,a,u),i=l}}}if(za)throw e=jc,za=!1,jc=null,e}function je(e,t){var n=t[Bc];n===void 0&&(n=t[Bc]=new Set);var r=e+"__bubble";n.has(r)||(Ov(t,e,2,!1),n.add(r))}function Fu(e,t,n){var r=0;t&&(r|=4),Ov(n,e,r,t)}var Hs="_reactListening"+Math.random().toString(36).slice(2);function Ji(e){if(!e[Hs]){e[Hs]=!0,Yg.forEach(function(n){n!=="selectionchange"&&(Fb.has(n)||Fu(n,!1,e),Fu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hs]||(t[Hs]=!0,Fu("selectionchange",!1,t))}}function Ov(e,t,n,r){switch(Ev(t)){case 1:var o=U1;break;case 4:o=Z1;break;default:o=Kd}n=o.bind(null,t,n,e),o=void 0,!Fc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function ju(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var a=r.stateNode.containerInfo;if(a===o||a.nodeType===8&&a.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&(l=s.stateNode.containerInfo,l===o||l.nodeType===8&&l.parentNode===o))return;s=s.return}for(;a!==null;){if(s=Fr(a),s===null)return;if(l=s.tag,l===5||l===6){r=i=s;continue e}a=a.parentNode}}r=r.return}uv(function(){var u=i,f=Hd(n),p=[];e:{var m=zv.get(e);if(m!==void 0){var h=Gd,y=e;switch(e){case"keypress":if(ka(n)===0)break e;case"keydown":case"keyup":h=ab;break;case"focusin":y="focus",h=Cu;break;case"focusout":y="blur",h=Cu;break;case"beforeblur":case"afterblur":h=Cu;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":h=Lp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":h=X1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":h=cb;break;case $v:case Av:case Nv:h=Q1;break;case Lv:h=fb;break;case"scroll":h=Y1;break;case"wheel":h=mb;break;case"copy":case"cut":case"paste":h=eb;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":h=Dp}var g=(t&4)!==0,E=!g&&e==="scroll",v=g?m!==null?m+"Capture":null:m;g=[];for(var w=u,x;w!==null;){x=w;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,v!==null&&(b=Yi(w,v),b!=null&&g.push(es(w,b,x)))),E)break;w=w.return}0<g.length&&(m=new h(m,y,null,n,f),p.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",h=e==="mouseout"||e==="pointerout",m&&n!==_c&&(y=n.relatedTarget||n.fromElement)&&(Fr(y)||y[Vn]))break e;if((h||m)&&(m=f.window===f?f:(m=f.ownerDocument)?m.defaultView||m.parentWindow:window,h?(y=n.relatedTarget||n.toElement,h=u,y=y?Fr(y):null,y!==null&&(E=Yr(y),y!==E||y.tag!==5&&y.tag!==6)&&(y=null)):(h=null,y=u),h!==y)){if(g=Lp,b="onMouseLeave",v="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(g=Dp,b="onPointerLeave",v="onPointerEnter",w="pointer"),E=h==null?m:xo(h),x=y==null?m:xo(y),m=new g(b,w+"leave",h,n,f),m.target=E,m.relatedTarget=x,b=null,Fr(f)===u&&(g=new g(v,w+"enter",y,n,f),g.target=x,g.relatedTarget=E,b=g),E=b,h&&y)t:{for(g=h,v=y,w=0,x=g;x;x=so(x))w++;for(x=0,b=v;b;b=so(b))x++;for(;0<w-x;)g=so(g),w--;for(;0<x-w;)v=so(v),x--;for(;w--;){if(g===v||v!==null&&g===v.alternate)break t;g=so(g),v=so(v)}g=null}else g=null;h!==null&&Gp(p,m,h,g,!1),y!==null&&E!==null&&Gp(p,E,y,g,!0)}}e:{if(m=u?xo(u):window,h=m.nodeName&&m.nodeName.toLowerCase(),h==="select"||h==="input"&&m.type==="file")var S=bb;else if(Bp(m))if(_v)S=Cb;else{S=Eb;var C=Sb}else(h=m.nodeName)&&h.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(S=kb);if(S&&(S=S(e,u))){Rv(p,S,n,f);break e}C&&C(e,m,u),e==="focusout"&&(C=m._wrapperState)&&C.controlled&&m.type==="number"&&kc(m,"number",m.value)}switch(C=u?xo(u):window,e){case"focusin":(Bp(C)||C.contentEditable==="true")&&(yo=C,Nc=u,Li=null);break;case"focusout":Li=Nc=yo=null;break;case"mousedown":Lc=!0;break;case"contextmenu":case"mouseup":case"dragend":Lc=!1,Yp(p,n,f);break;case"selectionchange":if(Rb)break;case"keydown":case"keyup":Yp(p,n,f)}var k;if(Qd)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else vo?Iv(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Cv&&n.locale!=="ko"&&(vo||T!=="onCompositionStart"?T==="onCompositionEnd"&&vo&&(k=kv()):(ir=f,Xd="value"in ir?ir.value:ir.textContent,vo=!0)),C=Wa(u,T),0<C.length&&(T=new zp(T,e,null,n,f),p.push({event:T,listeners:C}),k?T.data=k:(k=Tv(n),k!==null&&(T.data=k)))),(k=gb?vb(e,n):yb(e,n))&&(u=Wa(u,"onBeforeInput"),0<u.length&&(f=new zp("onBeforeInput","beforeinput",null,n,f),p.push({event:f,listeners:u}),f.data=k))}Dv(p,t)})}function es(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Wa(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Yi(e,n),i!=null&&r.unshift(es(e,i,o)),i=Yi(e,t),i!=null&&r.push(es(e,i,o))),e=e.return}return r}function so(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Gp(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,o?(l=Yi(n,i),l!=null&&s.unshift(es(n,l,a))):o||(l=Yi(n,i),l!=null&&s.push(es(n,l,a)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var jb=/\r\n?/g,Mb=/\u0000|\uFFFD/g;function qp(e){return(typeof e=="string"?e:""+e).replace(jb,`
|
|
38
|
+
`).replace(Mb,"")}function Us(e,t,n){if(t=qp(t),qp(e)!==t&&n)throw Error(q(425))}function Ha(){}var zc=null,Dc=null;function Oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vc=typeof setTimeout=="function"?setTimeout:void 0,$b=typeof clearTimeout=="function"?clearTimeout:void 0,Qp=typeof Promise=="function"?Promise:void 0,Ab=typeof queueMicrotask=="function"?queueMicrotask:typeof Qp<"u"?function(e){return Qp.resolve(null).then(e).catch(Nb)}:Vc;function Nb(e){setTimeout(function(){throw e})}function Mu(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Gi(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Gi(t)}function cr(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Jp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Go=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Go,ts="__reactProps$"+Go,Vn="__reactContainer$"+Go,Bc="__reactEvents$"+Go,Lb="__reactListeners$"+Go,zb="__reactHandles$"+Go;function Fr(e){var t=e[Sn];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vn]||n[Sn]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Jp(e);e!==null;){if(n=e[Sn])return n;e=Jp(e)}return t}e=n,n=e.parentNode}return null}function gs(e){return e=e[Sn]||e[Vn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xo(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(q(33))}function kl(e){return e[ts]||null}var Wc=[],bo=-1;function Sr(e){return{current:e}}function Me(e){0>bo||(e.current=Wc[bo],Wc[bo]=null,bo--)}function Pe(e,t){bo++,Wc[bo]=e.current,e.current=t}var vr={},wt=Sr(vr),Pt=Sr(!1),zr=vr;function Oo(e,t){var n=e.type.contextTypes;if(!n)return vr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ft(e){return e=e.childContextTypes,e!=null}function Ua(){Me(Pt),Me(wt)}function em(e,t,n){if(wt.current!==vr)throw Error(q(168));Pe(wt,t),Pe(Pt,n)}function Vv(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(q(108,S1(e)||"Unknown",o));return Be({},n,r)}function Za(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vr,zr=wt.current,Pe(wt,e),Pe(Pt,Pt.current),!0}function tm(e,t,n){var r=e.stateNode;if(!r)throw Error(q(169));n?(e=Vv(e,t,zr),r.__reactInternalMemoizedMergedChildContext=e,Me(Pt),Me(wt),Pe(wt,e)):Me(Pt),Pe(Pt,n)}var $n=null,Cl=!1,$u=!1;function Bv(e){$n===null?$n=[e]:$n.push(e)}function Db(e){Cl=!0,Bv(e)}function Er(){if(!$u&&$n!==null){$u=!0;var e=0,t=Ce;try{var n=$n;for(Ce=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}$n=null,Cl=!1}catch(o){throw $n!==null&&($n=$n.slice(e+1)),pv(Ud,Er),o}finally{Ce=t,$u=!1}}return null}var So=[],Eo=0,Ya=null,Ka=0,Kt=[],Xt=0,Dr=null,Nn=1,Ln="";function _r(e,t){So[Eo++]=Ka,So[Eo++]=Ya,Ya=e,Ka=t}function Wv(e,t,n){Kt[Xt++]=Nn,Kt[Xt++]=Ln,Kt[Xt++]=Dr,Dr=e;var r=Nn;e=Ln;var o=32-dn(r)-1;r&=~(1<<o),n+=1;var i=32-dn(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,Nn=1<<32-dn(t)+o|n<<o|r,Ln=i+e}else Nn=1<<i|n<<o|r,Ln=e}function ef(e){e.return!==null&&(_r(e,1),Wv(e,1,0))}function tf(e){for(;e===Ya;)Ya=So[--Eo],So[Eo]=null,Ka=So[--Eo],So[Eo]=null;for(;e===Dr;)Dr=Kt[--Xt],Kt[Xt]=null,Ln=Kt[--Xt],Kt[Xt]=null,Nn=Kt[--Xt],Kt[Xt]=null}var Bt=null,Vt=null,Le=!1,cn=null;function Hv(e,t){var n=qt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function nm(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Bt=e,Vt=cr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Bt=e,Vt=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Dr!==null?{id:Nn,overflow:Ln}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=qt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Bt=e,Vt=null,!0):!1;default:return!1}}function Hc(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Uc(e){if(Le){var t=Vt;if(t){var n=t;if(!nm(e,t)){if(Hc(e))throw Error(q(418));t=cr(n.nextSibling);var r=Bt;t&&nm(e,t)?Hv(r,n):(e.flags=e.flags&-4097|2,Le=!1,Bt=e)}}else{if(Hc(e))throw Error(q(418));e.flags=e.flags&-4097|2,Le=!1,Bt=e}}}function rm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Bt=e}function Zs(e){if(e!==Bt)return!1;if(!Le)return rm(e),Le=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Oc(e.type,e.memoizedProps)),t&&(t=Vt)){if(Hc(e))throw Uv(),Error(q(418));for(;t;)Hv(e,t),t=cr(t.nextSibling)}if(rm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(q(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Vt=cr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Vt=null}}else Vt=Bt?cr(e.stateNode.nextSibling):null;return!0}function Uv(){for(var e=Vt;e;)e=cr(e.nextSibling)}function Vo(){Vt=Bt=null,Le=!1}function nf(e){cn===null?cn=[e]:cn.push(e)}var Ob=Un.ReactCurrentBatchConfig;function hi(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(q(309));var r=n.stateNode}if(!r)throw Error(q(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var a=o.refs;s===null?delete a[i]:a[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(q(284));if(!n._owner)throw Error(q(290,e))}return e}function Ys(e,t){throw e=Object.prototype.toString.call(t),Error(q(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function om(e){var t=e._init;return t(e._payload)}function Zv(e){function t(v,w){if(e){var x=v.deletions;x===null?(v.deletions=[w],v.flags|=16):x.push(w)}}function n(v,w){if(!e)return null;for(;w!==null;)t(v,w),w=w.sibling;return null}function r(v,w){for(v=new Map;w!==null;)w.key!==null?v.set(w.key,w):v.set(w.index,w),w=w.sibling;return v}function o(v,w){return v=mr(v,w),v.index=0,v.sibling=null,v}function i(v,w,x){return v.index=x,e?(x=v.alternate,x!==null?(x=x.index,x<w?(v.flags|=2,w):x):(v.flags|=2,w)):(v.flags|=1048576,w)}function s(v){return e&&v.alternate===null&&(v.flags|=2),v}function a(v,w,x,b){return w===null||w.tag!==6?(w=Vu(x,v.mode,b),w.return=v,w):(w=o(w,x),w.return=v,w)}function l(v,w,x,b){var S=x.type;return S===go?f(v,w,x.props.children,b,x.key):w!==null&&(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===er&&om(S)===w.type)?(b=o(w,x.props),b.ref=hi(v,w,x),b.return=v,b):(b=Fa(x.type,x.key,x.props,null,v.mode,b),b.ref=hi(v,w,x),b.return=v,b)}function u(v,w,x,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==x.containerInfo||w.stateNode.implementation!==x.implementation?(w=Bu(x,v.mode,b),w.return=v,w):(w=o(w,x.children||[]),w.return=v,w)}function f(v,w,x,b,S){return w===null||w.tag!==7?(w=Lr(x,v.mode,b,S),w.return=v,w):(w=o(w,x),w.return=v,w)}function p(v,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Vu(""+w,v.mode,x),w.return=v,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Ns:return x=Fa(w.type,w.key,w.props,null,v.mode,x),x.ref=hi(v,null,w),x.return=v,x;case ho:return w=Bu(w,v.mode,x),w.return=v,w;case er:var b=w._init;return p(v,b(w._payload),x)}if(Ri(w)||ci(w))return w=Lr(w,v.mode,x,null),w.return=v,w;Ys(v,w)}return null}function m(v,w,x,b){var S=w!==null?w.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:a(v,w,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ns:return x.key===S?l(v,w,x,b):null;case ho:return x.key===S?u(v,w,x,b):null;case er:return S=x._init,m(v,w,S(x._payload),b)}if(Ri(x)||ci(x))return S!==null?null:f(v,w,x,b,null);Ys(v,x)}return null}function h(v,w,x,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return v=v.get(x)||null,a(w,v,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ns:return v=v.get(b.key===null?x:b.key)||null,l(w,v,b,S);case ho:return v=v.get(b.key===null?x:b.key)||null,u(w,v,b,S);case er:var C=b._init;return h(v,w,x,C(b._payload),S)}if(Ri(b)||ci(b))return v=v.get(x)||null,f(w,v,b,S,null);Ys(w,b)}return null}function y(v,w,x,b){for(var S=null,C=null,k=w,T=w=0,P=null;k!==null&&T<x.length;T++){k.index>T?(P=k,k=null):P=k.sibling;var j=m(v,k,x[T],b);if(j===null){k===null&&(k=P);break}e&&k&&j.alternate===null&&t(v,k),w=i(j,w,T),C===null?S=j:C.sibling=j,C=j,k=P}if(T===x.length)return n(v,k),Le&&_r(v,T),S;if(k===null){for(;T<x.length;T++)k=p(v,x[T],b),k!==null&&(w=i(k,w,T),C===null?S=k:C.sibling=k,C=k);return Le&&_r(v,T),S}for(k=r(v,k);T<x.length;T++)P=h(k,v,T,x[T],b),P!==null&&(e&&P.alternate!==null&&k.delete(P.key===null?T:P.key),w=i(P,w,T),C===null?S=P:C.sibling=P,C=P);return e&&k.forEach(function(M){return t(v,M)}),Le&&_r(v,T),S}function g(v,w,x,b){var S=ci(x);if(typeof S!="function")throw Error(q(150));if(x=S.call(x),x==null)throw Error(q(151));for(var C=S=null,k=w,T=w=0,P=null,j=x.next();k!==null&&!j.done;T++,j=x.next()){k.index>T?(P=k,k=null):P=k.sibling;var M=m(v,k,j.value,b);if(M===null){k===null&&(k=P);break}e&&k&&M.alternate===null&&t(v,k),w=i(M,w,T),C===null?S=M:C.sibling=M,C=M,k=P}if(j.done)return n(v,k),Le&&_r(v,T),S;if(k===null){for(;!j.done;T++,j=x.next())j=p(v,j.value,b),j!==null&&(w=i(j,w,T),C===null?S=j:C.sibling=j,C=j);return Le&&_r(v,T),S}for(k=r(v,k);!j.done;T++,j=x.next())j=h(k,v,T,j.value,b),j!==null&&(e&&j.alternate!==null&&k.delete(j.key===null?T:j.key),w=i(j,w,T),C===null?S=j:C.sibling=j,C=j);return e&&k.forEach(function(D){return t(v,D)}),Le&&_r(v,T),S}function E(v,w,x,b){if(typeof x=="object"&&x!==null&&x.type===go&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Ns:e:{for(var S=x.key,C=w;C!==null;){if(C.key===S){if(S=x.type,S===go){if(C.tag===7){n(v,C.sibling),w=o(C,x.props.children),w.return=v,v=w;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===er&&om(S)===C.type){n(v,C.sibling),w=o(C,x.props),w.ref=hi(v,C,x),w.return=v,v=w;break e}n(v,C);break}else t(v,C);C=C.sibling}x.type===go?(w=Lr(x.props.children,v.mode,b,x.key),w.return=v,v=w):(b=Fa(x.type,x.key,x.props,null,v.mode,b),b.ref=hi(v,w,x),b.return=v,v=b)}return s(v);case ho:e:{for(C=x.key;w!==null;){if(w.key===C)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(v,w.sibling),w=o(w,x.children||[]),w.return=v,v=w;break e}else{n(v,w);break}else t(v,w);w=w.sibling}w=Bu(x,v.mode,b),w.return=v,v=w}return s(v);case er:return C=x._init,E(v,w,C(x._payload),b)}if(Ri(x))return y(v,w,x,b);if(ci(x))return g(v,w,x,b);Ys(v,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(v,w.sibling),w=o(w,x),w.return=v,v=w):(n(v,w),w=Vu(x,v.mode,b),w.return=v,v=w),s(v)):n(v,w)}return E}var Bo=Zv(!0),Yv=Zv(!1),Xa=Sr(null),Ga=null,ko=null,rf=null;function of(){rf=ko=Ga=null}function sf(e){var t=Xa.current;Me(Xa),e._currentValue=t}function Zc(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function $o(e,t){Ga=e,rf=ko=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_t=!0),e.firstContext=null)}function Jt(e){var t=e._currentValue;if(rf!==e)if(e={context:e,memoizedValue:t,next:null},ko===null){if(Ga===null)throw Error(q(308));ko=e,Ga.dependencies={lanes:0,firstContext:e}}else ko=ko.next=e;return t}var jr=null;function af(e){jr===null?jr=[e]:jr.push(e)}function Kv(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,af(t)):(n.next=o.next,o.next=n),t.interleaved=n,Bn(e,r)}function Bn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var tr=!1;function lf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Dn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ye&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Bn(e,n)}return o=r.interleaved,o===null?(t.next=t,af(r)):(t.next=o.next,o.next=t),r.interleaved=t,Bn(e,n)}function Ca(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zd(e,n)}}function im(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qa(e,t,n,r){var o=e.updateQueue;tr=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var f=e.alternate;f!==null&&(f=f.updateQueue,a=f.lastBaseUpdate,a!==s&&(a===null?f.firstBaseUpdate=u:a.next=u,f.lastBaseUpdate=l))}if(i!==null){var p=o.baseState;s=0,f=u=l=null,a=i;do{var m=a.lane,h=a.eventTime;if((r&m)===m){f!==null&&(f=f.next={eventTime:h,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,g=a;switch(m=t,h=n,g.tag){case 1:if(y=g.payload,typeof y=="function"){p=y.call(h,p,m);break e}p=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,m=typeof y=="function"?y.call(h,p,m):y,m==null)break e;p=Be({},p,m);break e;case 2:tr=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,m=o.effects,m===null?o.effects=[a]:m.push(a))}else h={eventTime:h,lane:m,tag:a.tag,payload:a.payload,callback:a.callback,next:null},f===null?(u=f=h,l=p):f=f.next=h,s|=m;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;m=a,a=m.next,m.next=null,o.lastBaseUpdate=m,o.shared.pending=null}}while(!0);if(f===null&&(l=p),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=f,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Vr|=s,e.lanes=s,e.memoizedState=p}}function sm(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(q(191,o));o.call(r)}}}var vs={},In=Sr(vs),ns=Sr(vs),rs=Sr(vs);function Mr(e){if(e===vs)throw Error(q(174));return e}function uf(e,t){switch(Pe(rs,t),Pe(ns,e),Pe(In,vs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ic(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ic(t,e)}Me(In),Pe(In,t)}function Wo(){Me(In),Me(ns),Me(rs)}function Gv(e){Mr(rs.current);var t=Mr(In.current),n=Ic(t,e.type);t!==n&&(Pe(ns,e),Pe(In,n))}function cf(e){ns.current===e&&(Me(In),Me(ns))}var Oe=Sr(0);function Qa(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Au=[];function df(){for(var e=0;e<Au.length;e++)Au[e]._workInProgressVersionPrimary=null;Au.length=0}var Ia=Un.ReactCurrentDispatcher,Nu=Un.ReactCurrentBatchConfig,Or=0,Ve=null,Qe=null,nt=null,Ja=!1,zi=!1,os=0,Vb=0;function mt(){throw Error(q(321))}function ff(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!mn(e[n],t[n]))return!1;return!0}function pf(e,t,n,r,o,i){if(Or=i,Ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ia.current=e===null||e.memoizedState===null?Ub:Zb,e=n(r,o),zi){i=0;do{if(zi=!1,os=0,25<=i)throw Error(q(301));i+=1,nt=Qe=null,t.updateQueue=null,Ia.current=Yb,e=n(r,o)}while(zi)}if(Ia.current=el,t=Qe!==null&&Qe.next!==null,Or=0,nt=Qe=Ve=null,Ja=!1,t)throw Error(q(300));return e}function mf(){var e=os!==0;return os=0,e}function xn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Ve.memoizedState=nt=e:nt=nt.next=e,nt}function en(){if(Qe===null){var e=Ve.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=nt===null?Ve.memoizedState:nt.next;if(t!==null)nt=t,Qe=e;else{if(e===null)throw Error(q(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},nt===null?Ve.memoizedState=nt=e:nt=nt.next=e}return nt}function is(e,t){return typeof t=="function"?t(e):t}function Lu(e){var t=en(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var r=Qe,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var a=s=null,l=null,u=i;do{var f=u.lane;if((Or&f)===f)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var p={lane:f,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=p,s=r):l=l.next=p,Ve.lanes|=f,Vr|=f}u=u.next}while(u!==null&&u!==i);l===null?s=r:l.next=a,mn(r,t.memoizedState)||(_t=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ve.lanes|=i,Vr|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function zu(e){var t=en(),n=t.queue;if(n===null)throw Error(q(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);mn(i,t.memoizedState)||(_t=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function qv(){}function Qv(e,t){var n=Ve,r=en(),o=t(),i=!mn(r.memoizedState,o);if(i&&(r.memoizedState=o,_t=!0),r=r.queue,hf(ty.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||nt!==null&&nt.memoizedState.tag&1){if(n.flags|=2048,ss(9,ey.bind(null,n,r,o,t),void 0,null),rt===null)throw Error(q(349));Or&30||Jv(n,t,o)}return o}function Jv(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ey(e,t,n,r){t.value=n,t.getSnapshot=r,ny(t)&&ry(e)}function ty(e,t,n){return n(function(){ny(t)&&ry(e)})}function ny(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!mn(e,n)}catch{return!0}}function ry(e){var t=Bn(e,1);t!==null&&fn(t,e,1,-1)}function am(e){var t=xn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:is,lastRenderedState:e},t.queue=e,e=e.dispatch=Hb.bind(null,Ve,e),[t.memoizedState,e]}function ss(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ve.updateQueue,t===null?(t={lastEffect:null,stores:null},Ve.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function oy(){return en().memoizedState}function Ta(e,t,n,r){var o=xn();Ve.flags|=e,o.memoizedState=ss(1|t,n,void 0,r===void 0?null:r)}function Il(e,t,n,r){var o=en();r=r===void 0?null:r;var i=void 0;if(Qe!==null){var s=Qe.memoizedState;if(i=s.destroy,r!==null&&ff(r,s.deps)){o.memoizedState=ss(t,n,i,r);return}}Ve.flags|=e,o.memoizedState=ss(1|t,n,i,r)}function lm(e,t){return Ta(8390656,8,e,t)}function hf(e,t){return Il(2048,8,e,t)}function iy(e,t){return Il(4,2,e,t)}function sy(e,t){return Il(4,4,e,t)}function ay(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ly(e,t,n){return n=n!=null?n.concat([e]):null,Il(4,4,ay.bind(null,t,e),n)}function gf(){}function uy(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ff(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cy(e,t){var n=en();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ff(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function dy(e,t,n){return Or&21?(mn(n,t)||(n=gv(),Ve.lanes|=n,Vr|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_t=!0),e.memoizedState=n)}function Bb(e,t){var n=Ce;Ce=n!==0&&4>n?n:4,e(!0);var r=Nu.transition;Nu.transition={};try{e(!1),t()}finally{Ce=n,Nu.transition=r}}function fy(){return en().memoizedState}function Wb(e,t,n){var r=pr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},py(e))my(t,n);else if(n=Kv(e,t,n,r),n!==null){var o=bt();fn(n,e,r,o),hy(n,t,r)}}function Hb(e,t,n){var r=pr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(py(e))my(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,mn(a,s)){var l=t.interleaved;l===null?(o.next=o,af(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Kv(e,t,o,r),n!==null&&(o=bt(),fn(n,e,r,o),hy(n,t,r))}}function py(e){var t=e.alternate;return e===Ve||t!==null&&t===Ve}function my(e,t){zi=Ja=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hy(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Zd(e,n)}}var el={readContext:Jt,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useInsertionEffect:mt,useLayoutEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useMutableSource:mt,useSyncExternalStore:mt,useId:mt,unstable_isNewReconciler:!1},Ub={readContext:Jt,useCallback:function(e,t){return xn().memoizedState=[e,t===void 0?null:t],e},useContext:Jt,useEffect:lm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ta(4194308,4,ay.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ta(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ta(4,2,e,t)},useMemo:function(e,t){var n=xn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=xn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Wb.bind(null,Ve,e),[r.memoizedState,e]},useRef:function(e){var t=xn();return e={current:e},t.memoizedState=e},useState:am,useDebugValue:gf,useDeferredValue:function(e){return xn().memoizedState=e},useTransition:function(){var e=am(!1),t=e[0];return e=Bb.bind(null,e[1]),xn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ve,o=xn();if(Le){if(n===void 0)throw Error(q(407));n=n()}else{if(n=t(),rt===null)throw Error(q(349));Or&30||Jv(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,lm(ty.bind(null,r,i,e),[e]),r.flags|=2048,ss(9,ey.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=xn(),t=rt.identifierPrefix;if(Le){var n=Ln,r=Nn;n=(r&~(1<<32-dn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=os++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Vb++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Zb={readContext:Jt,useCallback:uy,useContext:Jt,useEffect:hf,useImperativeHandle:ly,useInsertionEffect:iy,useLayoutEffect:sy,useMemo:cy,useReducer:Lu,useRef:oy,useState:function(){return Lu(is)},useDebugValue:gf,useDeferredValue:function(e){var t=en();return dy(t,Qe.memoizedState,e)},useTransition:function(){var e=Lu(is)[0],t=en().memoizedState;return[e,t]},useMutableSource:qv,useSyncExternalStore:Qv,useId:fy,unstable_isNewReconciler:!1},Yb={readContext:Jt,useCallback:uy,useContext:Jt,useEffect:hf,useImperativeHandle:ly,useInsertionEffect:iy,useLayoutEffect:sy,useMemo:cy,useReducer:zu,useRef:oy,useState:function(){return zu(is)},useDebugValue:gf,useDeferredValue:function(e){var t=en();return Qe===null?t.memoizedState=e:dy(t,Qe.memoizedState,e)},useTransition:function(){var e=zu(is)[0],t=en().memoizedState;return[e,t]},useMutableSource:qv,useSyncExternalStore:Qv,useId:fy,unstable_isNewReconciler:!1};function ln(e,t){if(e&&e.defaultProps){t=Be({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Yc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Be({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Tl={isMounted:function(e){return(e=e._reactInternals)?Yr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=bt(),o=pr(e),i=Dn(r,o);i.payload=t,n!=null&&(i.callback=n),t=dr(e,i,o),t!==null&&(fn(t,e,o,r),Ca(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=bt(),o=pr(e),i=Dn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=dr(e,i,o),t!==null&&(fn(t,e,o,r),Ca(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=bt(),r=pr(e),o=Dn(n,r);o.tag=2,t!=null&&(o.callback=t),t=dr(e,o,r),t!==null&&(fn(t,e,r,n),Ca(t,e,r))}};function um(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Qi(n,r)||!Qi(o,i):!0}function gy(e,t,n){var r=!1,o=vr,i=t.contextType;return typeof i=="object"&&i!==null?i=Jt(i):(o=Ft(t)?zr:wt.current,r=t.contextTypes,i=(r=r!=null)?Oo(e,o):vr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Tl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function cm(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Tl.enqueueReplaceState(t,t.state,null)}function Kc(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},lf(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Jt(i):(i=Ft(t)?zr:wt.current,o.context=Oo(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Yc(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Tl.enqueueReplaceState(o,o.state,null),qa(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ho(e,t){try{var n="",r=t;do n+=b1(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
39
|
+
Error generating stack: `+i.message+`
|
|
40
|
+
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Du(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xc(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Kb=typeof WeakMap=="function"?WeakMap:Map;function vy(e,t,n){n=Dn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){nl||(nl=!0,id=r),Xc(e,t)},n}function yy(e,t,n){n=Dn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Xc(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Xc(e,t),typeof r!="function"&&(fr===null?fr=new Set([this]):fr.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function dm(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Kb;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=lS.bind(null,e,t,n),t.then(e,e))}function fm(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function pm(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Dn(-1,1),t.tag=2,dr(n,t,1))),n.lanes|=1),e)}var Xb=Un.ReactCurrentOwner,_t=!1;function xt(e,t,n,r){t.child=e===null?Yv(t,null,n,r):Bo(t,e.child,n,r)}function mm(e,t,n,r,o){n=n.render;var i=t.ref;return $o(t,o),r=pf(e,t,n,r,i,o),n=mf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wn(e,t,o)):(Le&&n&&ef(t),t.flags|=1,xt(e,t,r,o),t.child)}function hm(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!kf(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,wy(e,t,i,r,o)):(e=Fa(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Qi,n(s,r)&&e.ref===t.ref)return Wn(e,t,o)}return t.flags|=1,e=mr(i,r),e.ref=t.ref,e.return=t,t.child=e}function wy(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Qi(i,r)&&e.ref===t.ref)if(_t=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(_t=!0);else return t.lanes=e.lanes,Wn(e,t,o)}return Gc(e,t,n,r,o)}function xy(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Pe(Io,Ot),Ot|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Pe(Io,Ot),Ot|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Pe(Io,Ot),Ot|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Pe(Io,Ot),Ot|=r;return xt(e,t,o,n),t.child}function by(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Gc(e,t,n,r,o){var i=Ft(n)?zr:wt.current;return i=Oo(t,i),$o(t,o),n=pf(e,t,n,r,i,o),r=mf(),e!==null&&!_t?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Wn(e,t,o)):(Le&&r&&ef(t),t.flags|=1,xt(e,t,n,o),t.child)}function gm(e,t,n,r,o){if(Ft(n)){var i=!0;Za(t)}else i=!1;if($o(t,o),t.stateNode===null)Ra(e,t),gy(t,n,r),Kc(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,a=t.memoizedProps;s.props=a;var l=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Jt(u):(u=Ft(n)?zr:wt.current,u=Oo(t,u));var f=n.getDerivedStateFromProps,p=typeof f=="function"||typeof s.getSnapshotBeforeUpdate=="function";p||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==r||l!==u)&&cm(t,s,r,u),tr=!1;var m=t.memoizedState;s.state=m,qa(t,r,s,o),l=t.memoizedState,a!==r||m!==l||Pt.current||tr?(typeof f=="function"&&(Yc(t,n,f,r),l=t.memoizedState),(a=tr||um(t,n,a,r,m,l,u))?(p||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),s.props=r,s.state=l,s.context=u,r=a):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Xv(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ln(t.type,a),s.props=u,p=t.pendingProps,m=s.context,l=n.contextType,typeof l=="object"&&l!==null?l=Jt(l):(l=Ft(n)?zr:wt.current,l=Oo(t,l));var h=n.getDerivedStateFromProps;(f=typeof h=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(a!==p||m!==l)&&cm(t,s,r,l),tr=!1,m=t.memoizedState,s.state=m,qa(t,r,s,o);var y=t.memoizedState;a!==p||m!==y||Pt.current||tr?(typeof h=="function"&&(Yc(t,n,h,r),y=t.memoizedState),(u=tr||um(t,n,u,r,m,y,l)||!1)?(f||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,l)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=l,r=u):(typeof s.componentDidUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return qc(e,t,n,r,i,o)}function qc(e,t,n,r,o,i){by(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&tm(t,n,!1),Wn(e,t,i);r=t.stateNode,Xb.current=t;var a=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Bo(t,e.child,null,i),t.child=Bo(t,null,a,i)):xt(e,t,a,i),t.memoizedState=r.state,o&&tm(t,n,!0),t.child}function Sy(e){var t=e.stateNode;t.pendingContext?em(e,t.pendingContext,t.pendingContext!==t.context):t.context&&em(e,t.context,!1),uf(e,t.containerInfo)}function vm(e,t,n,r,o){return Vo(),nf(o),t.flags|=256,xt(e,t,n,r),t.child}var Qc={dehydrated:null,treeContext:null,retryLane:0};function Jc(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ey(e,t,n){var r=t.pendingProps,o=Oe.current,i=!1,s=(t.flags&128)!==0,a;if((a=s)||(a=e!==null&&e.memoizedState===null?!1:(o&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Pe(Oe,o&1),e===null)return Uc(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Pl(s,r,0,null),e=Lr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Jc(n),t.memoizedState=Qc,e):vf(t,s));if(o=e.memoizedState,o!==null&&(a=o.dehydrated,a!==null))return Gb(e,t,s,r,a,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,a=o.sibling;var l={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=mr(o,l),r.subtreeFlags=o.subtreeFlags&14680064),a!==null?i=mr(a,i):(i=Lr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Jc(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Qc,r}return i=e.child,e=i.sibling,r=mr(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function vf(e,t){return t=Pl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Ks(e,t,n,r){return r!==null&&nf(r),Bo(t,e.child,null,n),e=vf(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Gb(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=Du(Error(q(422))),Ks(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Pl({mode:"visible",children:r.children},o,0,null),i=Lr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Bo(t,e.child,null,s),t.child.memoizedState=Jc(s),t.memoizedState=Qc,i);if(!(t.mode&1))return Ks(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(q(419)),r=Du(i,r,void 0),Ks(e,t,s,r)}if(a=(s&e.childLanes)!==0,_t||a){if(r=rt,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Bn(e,o),fn(r,e,o,-1))}return Ef(),r=Du(Error(q(421))),Ks(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=uS.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Vt=cr(o.nextSibling),Bt=t,Le=!0,cn=null,e!==null&&(Kt[Xt++]=Nn,Kt[Xt++]=Ln,Kt[Xt++]=Dr,Nn=e.id,Ln=e.overflow,Dr=t),t=vf(t,r.children),t.flags|=4096,t)}function ym(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Zc(e.return,t,n)}function Ou(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function ky(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(xt(e,t,r.children,n),r=Oe.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ym(e,n,t);else if(e.tag===19)ym(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Pe(Oe,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Qa(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ou(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Qa(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ou(t,!0,n,null,i);break;case"together":Ou(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ra(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Wn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Vr|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(q(153));if(t.child!==null){for(e=t.child,n=mr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=mr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function qb(e,t,n){switch(t.tag){case 3:Sy(t),Vo();break;case 5:Gv(t);break;case 1:Ft(t.type)&&Za(t);break;case 4:uf(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Pe(Xa,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Pe(Oe,Oe.current&1),t.flags|=128,null):n&t.child.childLanes?Ey(e,t,n):(Pe(Oe,Oe.current&1),e=Wn(e,t,n),e!==null?e.sibling:null);Pe(Oe,Oe.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return ky(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Pe(Oe,Oe.current),r)break;return null;case 22:case 23:return t.lanes=0,xy(e,t,n)}return Wn(e,t,n)}var Cy,ed,Iy,Ty;Cy=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ed=function(){};Iy=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Mr(In.current);var i=null;switch(n){case"input":o=Sc(e,o),r=Sc(e,r),i=[];break;case"select":o=Be({},o,{value:void 0}),r=Be({},r,{value:void 0}),i=[];break;case"textarea":o=Cc(e,o),r=Cc(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ha)}Tc(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var a=o[u];for(s in a)a.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ui.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(s in a)!a.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in l)l.hasOwnProperty(s)&&a[s]!==l[s]&&(n||(n={}),n[s]=l[s])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ui.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&je("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Ty=function(e,t,n,r){n!==r&&(t.flags|=4)};function gi(e,t){if(!Le)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Qb(e,t,n){var r=t.pendingProps;switch(tf(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return Ft(t.type)&&Ua(),ht(t),null;case 3:return r=t.stateNode,Wo(),Me(Pt),Me(wt),df(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Zs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,cn!==null&&(ld(cn),cn=null))),ed(e,t),ht(t),null;case 5:cf(t);var o=Mr(rs.current);if(n=t.type,e!==null&&t.stateNode!=null)Iy(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(q(166));return ht(t),null}if(e=Mr(In.current),Zs(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Sn]=t,r[ts]=i,e=(t.mode&1)!==0,n){case"dialog":je("cancel",r),je("close",r);break;case"iframe":case"object":case"embed":je("load",r);break;case"video":case"audio":for(o=0;o<Pi.length;o++)je(Pi[o],r);break;case"source":je("error",r);break;case"img":case"image":case"link":je("error",r),je("load",r);break;case"details":je("toggle",r);break;case"input":Tp(r,i),je("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},je("invalid",r);break;case"textarea":_p(r,i),je("invalid",r)}Tc(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var a=i[s];s==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&Us(r.textContent,a,e),o=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&Us(r.textContent,a,e),o=["children",""+a]):Ui.hasOwnProperty(s)&&a!=null&&s==="onScroll"&&je("scroll",r)}switch(n){case"input":Ls(r),Rp(r,i,!0);break;case"textarea":Ls(r),Pp(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ha)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tv(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Sn]=t,e[ts]=r,Cy(e,t,!1,!1),t.stateNode=e;e:{switch(s=Rc(n,r),n){case"dialog":je("cancel",e),je("close",e),o=r;break;case"iframe":case"object":case"embed":je("load",e),o=r;break;case"video":case"audio":for(o=0;o<Pi.length;o++)je(Pi[o],e);o=r;break;case"source":je("error",e),o=r;break;case"img":case"image":case"link":je("error",e),je("load",e),o=r;break;case"details":je("toggle",e),o=r;break;case"input":Tp(e,r),o=Sc(e,r),je("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Be({},r,{value:void 0}),je("invalid",e);break;case"textarea":_p(e,r),o=Cc(e,r),je("invalid",e);break;default:o=r}Tc(n,o),a=o;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?ov(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&nv(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&Zi(e,l):typeof l=="number"&&Zi(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ui.hasOwnProperty(i)?l!=null&&i==="onScroll"&&je("scroll",e):l!=null&&Od(e,i,l,s))}switch(n){case"input":Ls(e),Rp(e,r,!1);break;case"textarea":Ls(e),Pp(e);break;case"option":r.value!=null&&e.setAttribute("value",""+gr(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Po(e,!!r.multiple,i,!1):r.defaultValue!=null&&Po(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ha)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ht(t),null;case 6:if(e&&t.stateNode!=null)Ty(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(q(166));if(n=Mr(rs.current),Mr(In.current),Zs(t)){if(r=t.stateNode,n=t.memoizedProps,r[Sn]=t,(i=r.nodeValue!==n)&&(e=Bt,e!==null))switch(e.tag){case 3:Us(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Us(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Sn]=t,t.stateNode=r}return ht(t),null;case 13:if(Me(Oe),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Le&&Vt!==null&&t.mode&1&&!(t.flags&128))Uv(),Vo(),t.flags|=98560,i=!1;else if(i=Zs(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(q(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(q(317));i[Sn]=t}else Vo(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ht(t),i=!1}else cn!==null&&(ld(cn),cn=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Oe.current&1?Je===0&&(Je=3):Ef())),t.updateQueue!==null&&(t.flags|=4),ht(t),null);case 4:return Wo(),ed(e,t),e===null&&Ji(t.stateNode.containerInfo),ht(t),null;case 10:return sf(t.type._context),ht(t),null;case 17:return Ft(t.type)&&Ua(),ht(t),null;case 19:if(Me(Oe),i=t.memoizedState,i===null)return ht(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)gi(i,!1);else{if(Je!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Qa(e),s!==null){for(t.flags|=128,gi(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Pe(Oe,Oe.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ye()>Uo&&(t.flags|=128,r=!0,gi(i,!1),t.lanes=4194304)}else{if(!r)if(e=Qa(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),gi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Le)return ht(t),null}else 2*Ye()-i.renderingStartTime>Uo&&n!==1073741824&&(t.flags|=128,r=!0,gi(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ye(),t.sibling=null,n=Oe.current,Pe(Oe,r?n&1|2:n&1),t):(ht(t),null);case 22:case 23:return Sf(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ot&1073741824&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),null;case 24:return null;case 25:return null}throw Error(q(156,t.tag))}function Jb(e,t){switch(tf(t),t.tag){case 1:return Ft(t.type)&&Ua(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wo(),Me(Pt),Me(wt),df(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return cf(t),null;case 13:if(Me(Oe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(q(340));Vo()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(Oe),null;case 4:return Wo(),null;case 10:return sf(t.type._context),null;case 22:case 23:return Sf(),null;case 24:return null;default:return null}}var Xs=!1,vt=!1,eS=typeof WeakSet=="function"?WeakSet:Set,oe=null;function Co(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ze(e,t,r)}else n.current=null}function td(e,t,n){try{n()}catch(r){Ze(e,t,r)}}var wm=!1;function tS(e,t){if(zc=Va,e=jv(),Jd(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,f=0,p=e,m=null;t:for(;;){for(var h;p!==n||o!==0&&p.nodeType!==3||(a=s+o),p!==i||r!==0&&p.nodeType!==3||(l=s+r),p.nodeType===3&&(s+=p.nodeValue.length),(h=p.firstChild)!==null;)m=p,p=h;for(;;){if(p===e)break t;if(m===n&&++u===o&&(a=s),m===i&&++f===r&&(l=s),(h=p.nextSibling)!==null)break;p=m,m=p.parentNode}p=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Dc={focusedElem:e,selectionRange:n},Va=!1,oe=t;oe!==null;)if(t=oe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,oe=e;else for(;oe!==null;){t=oe;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,E=y.memoizedState,v=t.stateNode,w=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:ln(t.type,g),E);v.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(q(163))}}catch(b){Ze(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,oe=e;break}oe=t.return}return y=wm,wm=!1,y}function Di(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&td(t,n,i)}o=o.next}while(o!==r)}}function Rl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function nd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ry(e){var t=e.alternate;t!==null&&(e.alternate=null,Ry(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Sn],delete t[ts],delete t[Bc],delete t[Lb],delete t[zb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function _y(e){return e.tag===5||e.tag===3||e.tag===4}function xm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||_y(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function rd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Ha));else if(r!==4&&(e=e.child,e!==null))for(rd(e,t,n),e=e.sibling;e!==null;)rd(e,t,n),e=e.sibling}function od(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(od(e,t,n),e=e.sibling;e!==null;)od(e,t,n),e=e.sibling}var st=null,un=!1;function Gn(e,t,n){for(n=n.child;n!==null;)Py(e,t,n),n=n.sibling}function Py(e,t,n){if(Cn&&typeof Cn.onCommitFiberUnmount=="function")try{Cn.onCommitFiberUnmount(xl,n)}catch{}switch(n.tag){case 5:vt||Co(n,t);case 6:var r=st,o=un;st=null,Gn(e,t,n),st=r,un=o,st!==null&&(un?(e=st,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):st.removeChild(n.stateNode));break;case 18:st!==null&&(un?(e=st,n=n.stateNode,e.nodeType===8?Mu(e.parentNode,n):e.nodeType===1&&Mu(e,n),Gi(e)):Mu(st,n.stateNode));break;case 4:r=st,o=un,st=n.stateNode.containerInfo,un=!0,Gn(e,t,n),st=r,un=o;break;case 0:case 11:case 14:case 15:if(!vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&td(n,t,s),o=o.next}while(o!==r)}Gn(e,t,n);break;case 1:if(!vt&&(Co(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Ze(n,t,a)}Gn(e,t,n);break;case 21:Gn(e,t,n);break;case 22:n.mode&1?(vt=(r=vt)||n.memoizedState!==null,Gn(e,t,n),vt=r):Gn(e,t,n);break;default:Gn(e,t,n)}}function bm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new eS),t.forEach(function(r){var o=cS.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function on(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,a=s;e:for(;a!==null;){switch(a.tag){case 5:st=a.stateNode,un=!1;break e;case 3:st=a.stateNode.containerInfo,un=!0;break e;case 4:st=a.stateNode.containerInfo,un=!0;break e}a=a.return}if(st===null)throw Error(q(160));Py(i,s,o),st=null,un=!1;var l=o.alternate;l!==null&&(l.return=null),o.return=null}catch(u){Ze(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Fy(t,e),t=t.sibling}function Fy(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(on(t,e),yn(e),r&4){try{Di(3,e,e.return),Rl(3,e)}catch(g){Ze(e,e.return,g)}try{Di(5,e,e.return)}catch(g){Ze(e,e.return,g)}}break;case 1:on(t,e),yn(e),r&512&&n!==null&&Co(n,n.return);break;case 5:if(on(t,e),yn(e),r&512&&n!==null&&Co(n,n.return),e.flags&32){var o=e.stateNode;try{Zi(o,"")}catch(g){Ze(e,e.return,g)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&Jg(o,i),Rc(a,s);var u=Rc(a,i);for(s=0;s<l.length;s+=2){var f=l[s],p=l[s+1];f==="style"?ov(o,p):f==="dangerouslySetInnerHTML"?nv(o,p):f==="children"?Zi(o,p):Od(o,f,p,u)}switch(a){case"input":Ec(o,i);break;case"textarea":ev(o,i);break;case"select":var m=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var h=i.value;h!=null?Po(o,!!i.multiple,h,!1):m!==!!i.multiple&&(i.defaultValue!=null?Po(o,!!i.multiple,i.defaultValue,!0):Po(o,!!i.multiple,i.multiple?[]:"",!1))}o[ts]=i}catch(g){Ze(e,e.return,g)}}break;case 6:if(on(t,e),yn(e),r&4){if(e.stateNode===null)throw Error(q(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(g){Ze(e,e.return,g)}}break;case 3:if(on(t,e),yn(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Gi(t.containerInfo)}catch(g){Ze(e,e.return,g)}break;case 4:on(t,e),yn(e);break;case 13:on(t,e),yn(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(xf=Ye())),r&4&&bm(e);break;case 22:if(f=n!==null&&n.memoizedState!==null,e.mode&1?(vt=(u=vt)||f,on(t,e),vt=u):on(t,e),yn(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!f&&e.mode&1)for(oe=e,f=e.child;f!==null;){for(p=oe=f;oe!==null;){switch(m=oe,h=m.child,m.tag){case 0:case 11:case 14:case 15:Di(4,m,m.return);break;case 1:Co(m,m.return);var y=m.stateNode;if(typeof y.componentWillUnmount=="function"){r=m,n=m.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(g){Ze(r,n,g)}}break;case 5:Co(m,m.return);break;case 22:if(m.memoizedState!==null){Em(p);continue}}h!==null?(h.return=m,oe=h):Em(p)}f=f.sibling}e:for(f=null,p=e;;){if(p.tag===5){if(f===null){f=p;try{o=p.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=p.stateNode,l=p.memoizedProps.style,s=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=rv("display",s))}catch(g){Ze(e,e.return,g)}}}else if(p.tag===6){if(f===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){Ze(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;f===p&&(f=null),p=p.return}f===p&&(f=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:on(t,e),yn(e),r&4&&bm(e);break;case 21:break;default:on(t,e),yn(e)}}function yn(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(_y(n)){var r=n;break e}n=n.return}throw Error(q(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Zi(o,""),r.flags&=-33);var i=xm(e);od(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,a=xm(e);rd(e,a,s);break;default:throw Error(q(161))}}catch(l){Ze(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function nS(e,t,n){oe=e,jy(e)}function jy(e,t,n){for(var r=(e.mode&1)!==0;oe!==null;){var o=oe,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Xs;if(!s){var a=o.alternate,l=a!==null&&a.memoizedState!==null||vt;a=Xs;var u=vt;if(Xs=s,(vt=l)&&!u)for(oe=o;oe!==null;)s=oe,l=s.child,s.tag===22&&s.memoizedState!==null?km(o):l!==null?(l.return=s,oe=l):km(o);for(;i!==null;)oe=i,jy(i),i=i.sibling;oe=o,Xs=a,vt=u}Sm(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,oe=i):Sm(e)}}function Sm(e){for(;oe!==null;){var t=oe;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vt||Rl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vt)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:ln(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&sm(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}sm(t,s,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var f=u.memoizedState;if(f!==null){var p=f.dehydrated;p!==null&&Gi(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(q(163))}vt||t.flags&512&&nd(t)}catch(m){Ze(t,t.return,m)}}if(t===e){oe=null;break}if(n=t.sibling,n!==null){n.return=t.return,oe=n;break}oe=t.return}}function Em(e){for(;oe!==null;){var t=oe;if(t===e){oe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,oe=n;break}oe=t.return}}function km(e){for(;oe!==null;){var t=oe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Rl(4,t)}catch(l){Ze(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(l){Ze(t,o,l)}}var i=t.return;try{nd(t)}catch(l){Ze(t,i,l)}break;case 5:var s=t.return;try{nd(t)}catch(l){Ze(t,s,l)}}}catch(l){Ze(t,t.return,l)}if(t===e){oe=null;break}var a=t.sibling;if(a!==null){a.return=t.return,oe=a;break}oe=t.return}}var rS=Math.ceil,tl=Un.ReactCurrentDispatcher,yf=Un.ReactCurrentOwner,Qt=Un.ReactCurrentBatchConfig,ye=0,rt=null,Ge=null,at=0,Ot=0,Io=Sr(0),Je=0,as=null,Vr=0,_l=0,wf=0,Oi=null,Rt=null,xf=0,Uo=1/0,Mn=null,nl=!1,id=null,fr=null,Gs=!1,sr=null,rl=0,Vi=0,sd=null,_a=-1,Pa=0;function bt(){return ye&6?Ye():_a!==-1?_a:_a=Ye()}function pr(e){return e.mode&1?ye&2&&at!==0?at&-at:Ob.transition!==null?(Pa===0&&(Pa=gv()),Pa):(e=Ce,e!==0||(e=window.event,e=e===void 0?16:Ev(e.type)),e):1}function fn(e,t,n,r){if(50<Vi)throw Vi=0,sd=null,Error(q(185));ms(e,n,r),(!(ye&2)||e!==rt)&&(e===rt&&(!(ye&2)&&(_l|=n),Je===4&&rr(e,at)),jt(e,r),n===1&&ye===0&&!(t.mode&1)&&(Uo=Ye()+500,Cl&&Er()))}function jt(e,t){var n=e.callbackNode;O1(e,t);var r=Oa(e,e===rt?at:0);if(r===0)n!==null&&Mp(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Mp(n),t===1)e.tag===0?Db(Cm.bind(null,e)):Bv(Cm.bind(null,e)),Ab(function(){!(ye&6)&&Er()}),n=null;else{switch(vv(r)){case 1:n=Ud;break;case 4:n=mv;break;case 16:n=Da;break;case 536870912:n=hv;break;default:n=Da}n=Oy(n,My.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function My(e,t){if(_a=-1,Pa=0,ye&6)throw Error(q(327));var n=e.callbackNode;if(Ao()&&e.callbackNode!==n)return null;var r=Oa(e,e===rt?at:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=ol(e,r);else{t=r;var o=ye;ye|=2;var i=Ay();(rt!==e||at!==t)&&(Mn=null,Uo=Ye()+500,Nr(e,t));do try{sS();break}catch(a){$y(e,a)}while(!0);of(),tl.current=i,ye=o,Ge!==null?t=0:(rt=null,at=0,t=Je)}if(t!==0){if(t===2&&(o=Mc(e),o!==0&&(r=o,t=ad(e,o))),t===1)throw n=as,Nr(e,0),rr(e,r),jt(e,Ye()),n;if(t===6)rr(e,r);else{if(o=e.current.alternate,!(r&30)&&!oS(o)&&(t=ol(e,r),t===2&&(i=Mc(e),i!==0&&(r=i,t=ad(e,i))),t===1))throw n=as,Nr(e,0),rr(e,r),jt(e,Ye()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(q(345));case 2:Pr(e,Rt,Mn);break;case 3:if(rr(e,r),(r&130023424)===r&&(t=xf+500-Ye(),10<t)){if(Oa(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){bt(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Vc(Pr.bind(null,e,Rt,Mn),t);break}Pr(e,Rt,Mn);break;case 4:if(rr(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-dn(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=Ye()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*rS(r/1960))-r,10<r){e.timeoutHandle=Vc(Pr.bind(null,e,Rt,Mn),r);break}Pr(e,Rt,Mn);break;case 5:Pr(e,Rt,Mn);break;default:throw Error(q(329))}}}return jt(e,Ye()),e.callbackNode===n?My.bind(null,e):null}function ad(e,t){var n=Oi;return e.current.memoizedState.isDehydrated&&(Nr(e,t).flags|=256),e=ol(e,t),e!==2&&(t=Rt,Rt=n,t!==null&&ld(t)),e}function ld(e){Rt===null?Rt=e:Rt.push.apply(Rt,e)}function oS(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!mn(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function rr(e,t){for(t&=~wf,t&=~_l,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-dn(t),r=1<<n;e[n]=-1,t&=~r}}function Cm(e){if(ye&6)throw Error(q(327));Ao();var t=Oa(e,0);if(!(t&1))return jt(e,Ye()),null;var n=ol(e,t);if(e.tag!==0&&n===2){var r=Mc(e);r!==0&&(t=r,n=ad(e,r))}if(n===1)throw n=as,Nr(e,0),rr(e,t),jt(e,Ye()),n;if(n===6)throw Error(q(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Pr(e,Rt,Mn),jt(e,Ye()),null}function bf(e,t){var n=ye;ye|=1;try{return e(t)}finally{ye=n,ye===0&&(Uo=Ye()+500,Cl&&Er())}}function Br(e){sr!==null&&sr.tag===0&&!(ye&6)&&Ao();var t=ye;ye|=1;var n=Qt.transition,r=Ce;try{if(Qt.transition=null,Ce=1,e)return e()}finally{Ce=r,Qt.transition=n,ye=t,!(ye&6)&&Er()}}function Sf(){Ot=Io.current,Me(Io)}function Nr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$b(n)),Ge!==null)for(n=Ge.return;n!==null;){var r=n;switch(tf(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Ua();break;case 3:Wo(),Me(Pt),Me(wt),df();break;case 5:cf(r);break;case 4:Wo();break;case 13:Me(Oe);break;case 19:Me(Oe);break;case 10:sf(r.type._context);break;case 22:case 23:Sf()}n=n.return}if(rt=e,Ge=e=mr(e.current,null),at=Ot=t,Je=0,as=null,wf=_l=Vr=0,Rt=Oi=null,jr!==null){for(t=0;t<jr.length;t++)if(n=jr[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}jr=null}return e}function $y(e,t){do{var n=Ge;try{if(of(),Ia.current=el,Ja){for(var r=Ve.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ja=!1}if(Or=0,nt=Qe=Ve=null,zi=!1,os=0,yf.current=null,n===null||n.return===null){Je=1,as=t,Ge=null;break}e:{var i=e,s=n.return,a=n,l=t;if(t=at,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,f=a,p=f.tag;if(!(f.mode&1)&&(p===0||p===11||p===15)){var m=f.alternate;m?(f.updateQueue=m.updateQueue,f.memoizedState=m.memoizedState,f.lanes=m.lanes):(f.updateQueue=null,f.memoizedState=null)}var h=fm(s);if(h!==null){h.flags&=-257,pm(h,s,a,i,t),h.mode&1&&dm(i,u,t),t=h,l=u;var y=t.updateQueue;if(y===null){var g=new Set;g.add(l),t.updateQueue=g}else y.add(l);break e}else{if(!(t&1)){dm(i,u,t),Ef();break e}l=Error(q(426))}}else if(Le&&a.mode&1){var E=fm(s);if(E!==null){!(E.flags&65536)&&(E.flags|=256),pm(E,s,a,i,t),nf(Ho(l,a));break e}}i=l=Ho(l,a),Je!==4&&(Je=2),Oi===null?Oi=[i]:Oi.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var v=vy(i,l,t);im(i,v);break e;case 1:a=l;var w=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(fr===null||!fr.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=yy(i,a,t);im(i,b);break e}}i=i.return}while(i!==null)}Ly(n)}catch(S){t=S,Ge===n&&n!==null&&(Ge=n=n.return);continue}break}while(!0)}function Ay(){var e=tl.current;return tl.current=el,e===null?el:e}function Ef(){(Je===0||Je===3||Je===2)&&(Je=4),rt===null||!(Vr&268435455)&&!(_l&268435455)||rr(rt,at)}function ol(e,t){var n=ye;ye|=2;var r=Ay();(rt!==e||at!==t)&&(Mn=null,Nr(e,t));do try{iS();break}catch(o){$y(e,o)}while(!0);if(of(),ye=n,tl.current=r,Ge!==null)throw Error(q(261));return rt=null,at=0,Je}function iS(){for(;Ge!==null;)Ny(Ge)}function sS(){for(;Ge!==null&&!F1();)Ny(Ge)}function Ny(e){var t=Dy(e.alternate,e,Ot);e.memoizedProps=e.pendingProps,t===null?Ly(e):Ge=t,yf.current=null}function Ly(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Jb(n,t),n!==null){n.flags&=32767,Ge=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Je=6,Ge=null;return}}else if(n=Qb(n,t,Ot),n!==null){Ge=n;return}if(t=t.sibling,t!==null){Ge=t;return}Ge=t=e}while(t!==null);Je===0&&(Je=5)}function Pr(e,t,n){var r=Ce,o=Qt.transition;try{Qt.transition=null,Ce=1,aS(e,t,n,r)}finally{Qt.transition=o,Ce=r}return null}function aS(e,t,n,r){do Ao();while(sr!==null);if(ye&6)throw Error(q(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(q(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(V1(e,i),e===rt&&(Ge=rt=null,at=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Gs||(Gs=!0,Oy(Da,function(){return Ao(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Qt.transition,Qt.transition=null;var s=Ce;Ce=1;var a=ye;ye|=4,yf.current=null,tS(e,n),Fy(n,e),Tb(Dc),Va=!!zc,Dc=zc=null,e.current=n,nS(n),j1(),ye=a,Ce=s,Qt.transition=i}else e.current=n;if(Gs&&(Gs=!1,sr=e,rl=o),i=e.pendingLanes,i===0&&(fr=null),A1(n.stateNode),jt(e,Ye()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(nl)throw nl=!1,e=id,id=null,e;return rl&1&&e.tag!==0&&Ao(),i=e.pendingLanes,i&1?e===sd?Vi++:(Vi=0,sd=e):Vi=0,Er(),null}function Ao(){if(sr!==null){var e=vv(rl),t=Qt.transition,n=Ce;try{if(Qt.transition=null,Ce=16>e?16:e,sr===null)var r=!1;else{if(e=sr,sr=null,rl=0,ye&6)throw Error(q(331));var o=ye;for(ye|=4,oe=e.current;oe!==null;){var i=oe,s=i.child;if(oe.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(oe=u;oe!==null;){var f=oe;switch(f.tag){case 0:case 11:case 15:Di(8,f,i)}var p=f.child;if(p!==null)p.return=f,oe=p;else for(;oe!==null;){f=oe;var m=f.sibling,h=f.return;if(Ry(f),f===u){oe=null;break}if(m!==null){m.return=h,oe=m;break}oe=h}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var E=g.sibling;g.sibling=null,g=E}while(g!==null)}}oe=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,oe=s;else e:for(;oe!==null;){if(i=oe,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Di(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,oe=v;break e}oe=i.return}}var w=e.current;for(oe=w;oe!==null;){s=oe;var x=s.child;if(s.subtreeFlags&2064&&x!==null)x.return=s,oe=x;else e:for(s=w;oe!==null;){if(a=oe,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Rl(9,a)}}catch(S){Ze(a,a.return,S)}if(a===s){oe=null;break e}var b=a.sibling;if(b!==null){b.return=a.return,oe=b;break e}oe=a.return}}if(ye=o,Er(),Cn&&typeof Cn.onPostCommitFiberRoot=="function")try{Cn.onPostCommitFiberRoot(xl,e)}catch{}r=!0}return r}finally{Ce=n,Qt.transition=t}}return!1}function Im(e,t,n){t=Ho(n,t),t=vy(e,t,1),e=dr(e,t,1),t=bt(),e!==null&&(ms(e,1,t),jt(e,t))}function Ze(e,t,n){if(e.tag===3)Im(e,e,n);else for(;t!==null;){if(t.tag===3){Im(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(fr===null||!fr.has(r))){e=Ho(n,e),e=yy(t,e,1),t=dr(t,e,1),e=bt(),t!==null&&(ms(t,1,e),jt(t,e));break}}t=t.return}}function lS(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=bt(),e.pingedLanes|=e.suspendedLanes&n,rt===e&&(at&n)===n&&(Je===4||Je===3&&(at&130023424)===at&&500>Ye()-xf?Nr(e,0):wf|=n),jt(e,t)}function zy(e,t){t===0&&(e.mode&1?(t=Os,Os<<=1,!(Os&130023424)&&(Os=4194304)):t=1);var n=bt();e=Bn(e,t),e!==null&&(ms(e,t,n),jt(e,n))}function uS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zy(e,n)}function cS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(q(314))}r!==null&&r.delete(t),zy(e,n)}var Dy;Dy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pt.current)_t=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return _t=!1,qb(e,t,n);_t=!!(e.flags&131072)}else _t=!1,Le&&t.flags&1048576&&Wv(t,Ka,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ra(e,t),e=t.pendingProps;var o=Oo(t,wt.current);$o(t,n),o=pf(null,t,r,e,o,n);var i=mf();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ft(r)?(i=!0,Za(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,lf(t),o.updater=Tl,t.stateNode=o,o._reactInternals=t,Kc(t,r,e,n),t=qc(null,t,r,!0,i,n)):(t.tag=0,Le&&i&&ef(t),xt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ra(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=fS(r),e=ln(r,e),o){case 0:t=Gc(null,t,r,e,n);break e;case 1:t=gm(null,t,r,e,n);break e;case 11:t=mm(null,t,r,e,n);break e;case 14:t=hm(null,t,r,ln(r.type,e),n);break e}throw Error(q(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),Gc(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),gm(e,t,r,o,n);case 3:e:{if(Sy(t),e===null)throw Error(q(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Xv(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ho(Error(q(423)),t),t=vm(e,t,r,n,o);break e}else if(r!==o){o=Ho(Error(q(424)),t),t=vm(e,t,r,n,o);break e}else for(Vt=cr(t.stateNode.containerInfo.firstChild),Bt=t,Le=!0,cn=null,n=Yv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Vo(),r===o){t=Wn(e,t,n);break e}xt(e,t,r,n)}t=t.child}return t;case 5:return Gv(t),e===null&&Uc(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Oc(r,o)?s=null:i!==null&&Oc(r,i)&&(t.flags|=32),by(e,t),xt(e,t,s,n),t.child;case 6:return e===null&&Uc(t),null;case 13:return Ey(e,t,n);case 4:return uf(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Bo(t,null,r,n):xt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),mm(e,t,r,o,n);case 7:return xt(e,t,t.pendingProps,n),t.child;case 8:return xt(e,t,t.pendingProps.children,n),t.child;case 12:return xt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Pe(Xa,r._currentValue),r._currentValue=s,i!==null)if(mn(i.value,s)){if(i.children===o.children&&!Pt.current){t=Wn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Dn(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var f=u.pending;f===null?l.next=l:(l.next=f.next,f.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Zc(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(q(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Zc(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}xt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,$o(t,n),o=Jt(o),r=r(o),t.flags|=1,xt(e,t,r,n),t.child;case 14:return r=t.type,o=ln(r,t.pendingProps),o=ln(r.type,o),hm(e,t,r,o,n);case 15:return wy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:ln(r,o),Ra(e,t),t.tag=1,Ft(r)?(e=!0,Za(t)):e=!1,$o(t,n),gy(t,r,o),Kc(t,r,o,n),qc(null,t,r,!0,e,n);case 19:return ky(e,t,n);case 22:return xy(e,t,n)}throw Error(q(156,t.tag))};function Oy(e,t){return pv(e,t)}function dS(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qt(e,t,n,r){return new dS(e,t,n,r)}function kf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fS(e){if(typeof e=="function")return kf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Bd)return 11;if(e===Wd)return 14}return 2}function mr(e,t){var n=e.alternate;return n===null?(n=qt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Fa(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")kf(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case go:return Lr(n.children,o,i,t);case Vd:s=8,o|=8;break;case yc:return e=qt(12,n,t,o|2),e.elementType=yc,e.lanes=i,e;case wc:return e=qt(13,n,t,o),e.elementType=wc,e.lanes=i,e;case xc:return e=qt(19,n,t,o),e.elementType=xc,e.lanes=i,e;case Gg:return Pl(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kg:s=10;break e;case Xg:s=9;break e;case Bd:s=11;break e;case Wd:s=14;break e;case er:s=16,r=null;break e}throw Error(q(130,e==null?e:typeof e,""))}return t=qt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Lr(e,t,n,r){return e=qt(7,e,r,t),e.lanes=n,e}function Pl(e,t,n,r){return e=qt(22,e,r,t),e.elementType=Gg,e.lanes=n,e.stateNode={isHidden:!1},e}function Vu(e,t,n){return e=qt(6,e,null,t),e.lanes=n,e}function Bu(e,t,n){return t=qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function pS(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Su(0),this.expirationTimes=Su(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Su(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Cf(e,t,n,r,o,i,s,a,l){return e=new pS(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},lf(i),e}function mS(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ho,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Vy(e){if(!e)return vr;e=e._reactInternals;e:{if(Yr(e)!==e||e.tag!==1)throw Error(q(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ft(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(q(171))}if(e.tag===1){var n=e.type;if(Ft(n))return Vv(e,n,t)}return t}function By(e,t,n,r,o,i,s,a,l){return e=Cf(n,r,!0,e,o,i,s,a,l),e.context=Vy(null),n=e.current,r=bt(),o=pr(n),i=Dn(r,o),i.callback=t??null,dr(n,i,o),e.current.lanes=o,ms(e,o,r),jt(e,r),e}function Fl(e,t,n,r){var o=t.current,i=bt(),s=pr(o);return n=Vy(n),t.context===null?t.context=n:t.pendingContext=n,t=Dn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=dr(o,t,s),e!==null&&(fn(e,o,s,i),Ca(e,o,s)),s}function il(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Tm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function If(e,t){Tm(e,t),(e=e.alternate)&&Tm(e,t)}function hS(){return null}var Wy=typeof reportError=="function"?reportError:function(e){console.error(e)};function Tf(e){this._internalRoot=e}jl.prototype.render=Tf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(q(409));Fl(e,t,null,null)};jl.prototype.unmount=Tf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Br(function(){Fl(null,e,null,null)}),t[Vn]=null}};function jl(e){this._internalRoot=e}jl.prototype.unstable_scheduleHydration=function(e){if(e){var t=xv();e={blockedOn:null,target:e,priority:t};for(var n=0;n<nr.length&&t!==0&&t<nr[n].priority;n++);nr.splice(n,0,e),n===0&&Sv(e)}};function Rf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Ml(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Rm(){}function gS(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=il(s);i.call(u)}}var s=By(t,r,e,0,null,!1,!1,"",Rm);return e._reactRootContainer=s,e[Vn]=s.current,Ji(e.nodeType===8?e.parentNode:e),Br(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var a=r;r=function(){var u=il(l);a.call(u)}}var l=Cf(e,0,!1,null,null,!1,!1,"",Rm);return e._reactRootContainer=l,e[Vn]=l.current,Ji(e.nodeType===8?e.parentNode:e),Br(function(){Fl(t,l,n,r)}),l}function $l(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var a=o;o=function(){var l=il(s);a.call(l)}}Fl(t,s,e,o)}else s=gS(n,t,e,o,r);return il(s)}yv=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=_i(t.pendingLanes);n!==0&&(Zd(t,n|1),jt(t,Ye()),!(ye&6)&&(Uo=Ye()+500,Er()))}break;case 13:Br(function(){var r=Bn(e,1);if(r!==null){var o=bt();fn(r,e,1,o)}}),If(e,1)}};Yd=function(e){if(e.tag===13){var t=Bn(e,134217728);if(t!==null){var n=bt();fn(t,e,134217728,n)}If(e,134217728)}};wv=function(e){if(e.tag===13){var t=pr(e),n=Bn(e,t);if(n!==null){var r=bt();fn(n,e,t,r)}If(e,t)}};xv=function(){return Ce};bv=function(e,t){var n=Ce;try{return Ce=e,t()}finally{Ce=n}};Pc=function(e,t,n){switch(t){case"input":if(Ec(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=kl(r);if(!o)throw Error(q(90));Qg(r),Ec(r,o)}}}break;case"textarea":ev(e,n);break;case"select":t=n.value,t!=null&&Po(e,!!n.multiple,t,!1)}};av=bf;lv=Br;var vS={usingClientEntryPoint:!1,Events:[gs,xo,kl,iv,sv,bf]},vi={findFiberByHostInstance:Fr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yS={bundleType:vi.bundleType,version:vi.version,rendererPackageName:vi.rendererPackageName,rendererConfig:vi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Un.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=dv(e),e===null?null:e.stateNode},findFiberByHostInstance:vi.findFiberByHostInstance||hS,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qs.isDisabled&&qs.supportsFiber)try{xl=qs.inject(yS),Cn=qs}catch{}}Ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vS;Ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Rf(t))throw Error(q(200));return mS(e,t,null,n)};Ht.createRoot=function(e,t){if(!Rf(e))throw Error(q(299));var n=!1,r="",o=Wy;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Cf(e,1,!1,null,null,n,!1,r,o),e[Vn]=t.current,Ji(e.nodeType===8?e.parentNode:e),new Tf(t)};Ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(q(188)):(e=Object.keys(e).join(","),Error(q(268,e)));return e=dv(t),e=e===null?null:e.stateNode,e};Ht.flushSync=function(e){return Br(e)};Ht.hydrate=function(e,t,n){if(!Ml(t))throw Error(q(200));return $l(null,e,t,!0,n)};Ht.hydrateRoot=function(e,t,n){if(!Rf(e))throw Error(q(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Wy;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=By(t,null,e,1,n??null,o,!1,i,s),e[Vn]=t.current,Ji(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new jl(t)};Ht.render=function(e,t,n){if(!Ml(t))throw Error(q(200));return $l(null,e,t,!1,n)};Ht.unmountComponentAtNode=function(e){if(!Ml(e))throw Error(q(40));return e._reactRootContainer?(Br(function(){$l(null,null,e,!1,function(){e._reactRootContainer=null,e[Vn]=null})}),!0):!1};Ht.unstable_batchedUpdates=bf;Ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Ml(n))throw Error(q(200));if(e==null||e._reactInternals===void 0)throw Error(q(38));return $l(e,t,n,!1,r)};Ht.version="18.3.1-next-f1338f8080-20240426";function Hy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Hy)}catch(e){console.error(e)}}Hy(),Hg.exports=Ht;var ud=Hg.exports,_m=ud;gc.createRoot=_m.createRoot,gc.hydrateRoot=_m.hydrateRoot;var wS=Object.defineProperty,Uy=(e,t)=>{for(var n in t)wS(e,n,{get:t[n],enumerable:!0,configurable:!0,set:r=>t[n]=()=>r})};if(typeof c.createContext!="function"){const e=['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";'];throw new Error(e.join(`
|
|
41
|
+
`))}var Kr=c.createContext(!1),cd=({children:e})=>d.jsx(Kr.Provider,{value:!0,children:e}),Zy=c.createContext({setError:()=>{},clearError:()=>{}}),Pm=()=>{try{return typeof __webpack_module__>"u"?null:__webpack_module__.hot??null}catch{return null}};class xS extends ne.Component{constructor(){super(...arguments);Se(this,"state",{hasError:!1});Se(this,"hmrStatusHandler",null)}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){this.props.onError(n),this.subscribeToHmrReset()}componentDidMount(){this.state.hasError||this.props.onClear()}componentDidUpdate(n,r){r.hasError&&!this.state.hasError&&this.props.onClear()}componentWillUnmount(){this.unsubscribeFromHmrReset()}subscribeToHmrReset(){if(this.hmrStatusHandler)return;const n=Pm();if(!n)return;const r=o=>{o==="idle"&&(this.unsubscribeFromHmrReset(),this.setState({hasError:!1}))};this.hmrStatusHandler=r,n.addStatusHandler(r)}unsubscribeFromHmrReset(){const n=this.hmrStatusHandler;if(!n)return;this.hmrStatusHandler=null;const r=Pm();r&&r.removeStatusHandler(n)}render(){return this.state.hasError?null:this.props.children}}var qo=c.createContext({compositions:[],folders:[],currentCompositionMetadata:null,canvasContent:null}),ys=c.createContext({registerComposition:()=>{},unregisterComposition:()=>{},registerFolder:()=>{},unregisterFolder:()=>{},setCanvasContent:()=>{},onlyRenderComposition:null}),ws=c.createContext({getNonce:()=>0}),ja=0;try{typeof __webpack_module__<"u"&&__webpack_module__.hot&&__webpack_module__.hot.addStatusHandler(e=>{e==="idle"&&ja++})}catch{}var Al=()=>{const t=c.useContext(ws).getNonce(),n=c.useRef(t);n.current=t;const r=c.useRef([[ja,t]]),o=c.useCallback(()=>(ja!==r.current[r.current.length-1][0]&&(r.current=[...r.current,[ja,n.current]]),r.current),[r]);return c.useMemo(()=>({get:o}),[o])};function Qo(e){return!!e}var Yy=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,Ky=e=>e.match(Yy()),bS=e=>{if(e==null)throw new TypeError("You must pass a name to a <Folder />.");if(typeof e!="string")throw new TypeError(`The "name" you pass into <Folder /> must be a string. Got: ${typeof e}`);if(!Ky(e))throw new Error(`Folder name can only contain a-z, A-Z, 0-9 and -. You passed ${e}`)},SS=`Folder name must match ${String(Yy())}`,dd=c.createContext({folderName:null,parentName:null}),ES=e=>{const{name:t,children:n}=e,r=c.useContext(dd),{registerFolder:o,unregisterFolder:i}=c.useContext(ys),s=Al(),a=e.stack??null;bS(t);const l=[r.parentName,r.folderName].filter(Qo),u=l.length===0?null:l.join("/"),f=c.useMemo(()=>({folderName:t,parentName:u}),[t,u]);return c.useEffect(()=>(o(t,u,s.get(),a),()=>{i(t,u)}),[t,r.folderName,u,o,i,s,a]),d.jsx(dd.Provider,{value:f,children:n})};function Fm(){return["NOD","E_EN","V"].join("")}var jm=()=>["e","nv"].join(""),En=()=>{const e=typeof window<"u"&&window.remotion_isPlayer,t=typeof window<"u"&&typeof window.process<"u"&&typeof window.process.env<"u"&&(window.process[jm()][Fm()]==="test"||window.process[jm()][Fm()]==="production"&&typeof window<"u"&&typeof window.remotion_puppeteerTimeout<"u"),n=typeof window<"u"&&window.remotion_isStudio,r=typeof window<"u"&&window.remotion_isReadOnlyStudio;return{isStudio:n,isRendering:t,isPlayer:e,isReadOnlyStudio:r,isClientSideRendering:!1}},fd="remotion-date:",ls="remotion-file:",kS=({data:e,indent:t,staticBase:n})=>{let r=!1,o=!1,i=!1,s=!1;try{return{serializedString:JSON.stringify(e,function(l,u){const f=this[l];return f instanceof Date?(r=!0,`${fd}${f.toISOString()}`):f instanceof Map?(i=!0,u):f instanceof Set?(s=!0,u):typeof f=="string"&&n!==null&&f.startsWith(n)?(o=!0,`${ls}${f.replace(n+"/","")}`):u},t),customDateUsed:r,customFileUsed:o,mapUsed:i,setUsed:s}}catch(a){throw new Error("Could not serialize the passed input props to JSON: "+a.message)}},Xy=e=>JSON.parse(e,(t,n)=>typeof n=="string"&&n.startsWith(fd)?new Date(n.replace(fd,"")):typeof n=="string"&&n.startsWith(ls)?`${window.remotion_staticBase}/${n.replace(ls,"")}`:n),CS=e=>Xy(kS({data:e,indent:2,staticBase:window.remotion_staticBase}).serializedString),pd=e=>En().isStudio?CS(e):e,Gy=c.createContext(!1),IS=({children:e})=>d.jsx(Gy.Provider,{value:!0,children:e}),_f=()=>c.useContext(Gy),qn=({className:e,classPrefix:t,type:n})=>{if(!e)return!1;if(n==="exact"){const r=e.split(" ");return t.some(o=>r.some(i=>i.trim()===o||i.trim().endsWith(`:${o}`)||i.trim().endsWith(`!${o}`)))}return t.some(r=>e.startsWith(r)||e.includes(` ${r}`)||e.includes(`!${r}`)||e.includes(`:${r}`))},TS=(e,t)=>{const{style:n,...r}=e,o=c.useMemo(()=>({position:"absolute",top:qn({className:r.className,classPrefix:["top-","inset-"],type:"prefix"})?void 0:0,left:qn({className:r.className,classPrefix:["left-","inset-"],type:"prefix"})?void 0:0,right:qn({className:r.className,classPrefix:["right-","inset-"],type:"prefix"})?void 0:0,bottom:qn({className:r.className,classPrefix:["bottom-","inset-"],type:"prefix"})?void 0:0,width:qn({className:r.className,classPrefix:["w-"],type:"prefix"})?void 0:"100%",height:qn({className:r.className,classPrefix:["h-"],type:"prefix"})?void 0:"100%",display:qn({className:r.className,classPrefix:["block","inline-block","inline","flex","inline-flex","flow-root","grid","inline-grid","contents","list-item","hidden"],type:"exact"})?void 0:"flex",flexDirection:qn({className:r.className,classPrefix:["flex-row","flex-col","flex-row-reverse","flex-col-reverse"],type:"exact"})?void 0:"column",...n}),[r.className,n]);return d.jsx("div",{ref:t,style:o,...r})},hn=c.forwardRef(TS),RS={transform:"rotate(90deg)"},Mm=40,_S={color:"white",fontSize:14,fontFamily:"sans-serif"},PS={justifyContent:"center",alignItems:"center"},FS=()=>d.jsxs(hn,{style:PS,id:"remotion-comp-loading",children:[d.jsx("style",{type:"text/css",children:`
|
|
42
|
+
@keyframes anim {
|
|
43
|
+
from {
|
|
44
|
+
opacity: 0
|
|
45
|
+
}
|
|
46
|
+
to {
|
|
47
|
+
opacity: 1
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
#remotion-comp-loading {
|
|
51
|
+
animation: anim 2s;
|
|
52
|
+
animation-fill-mode: forwards;
|
|
53
|
+
}
|
|
54
|
+
`}),d.jsx("svg",{width:Mm,height:Mm,viewBox:"-100 -100 400 400",style:RS,children:d.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"})}),d.jsxs("p",{style:_S,children:["Resolving ","<Suspense>","..."]})]}),Lt=null,md=()=>{if(!Lt){if(typeof document>"u")throw new Error("Tried to call an API that only works in the browser from outside the browser");Lt=document.createElement("div"),Lt.style.position="absolute",Lt.style.top="0px",Lt.style.left="0px",Lt.style.right="0px",Lt.style.bottom="0px",Lt.style.width="100%",Lt.style.height="100%",Lt.style.display="flex",Lt.style.flexDirection="column";const e=document.createElement("div");e.style.position="fixed",e.style.top="-999999px",e.appendChild(Lt),document.body.appendChild(e)}return Lt},hd=()=>"remotion_inputPropsOverride"+window.location.origin,qy=()=>{if(typeof localStorage>"u")return null;const e=localStorage.getItem(hd());return e?JSON.parse(e):null},jS=e=>{if(!(typeof localStorage>"u")){if(e===null){localStorage.removeItem(hd());return}localStorage.setItem(hd(),JSON.stringify(e))}},$m=!1,MS=()=>{$m||($m=!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()"))},$S=()=>{if(typeof window>"u")return MS(),{};if(En().isPlayer)throw new Error("You cannot call `getInputProps()` from a <Player>. Instead, the props are available as React props from component that you passed as `component` prop.");const e=qy();if(e)return e;if(typeof window>"u"||typeof window.remotion_inputProps>"u")throw new 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.");const t=window.remotion_inputProps;return t?Xy(t):{}},Pf=c.createContext({props:{},updateProps:()=>{throw new Error("Not implemented")}}),AS=ne.createRef(),Qy=({children:e})=>{const[t,n]=ne.useState({}),r=c.useCallback(({defaultProps:i,id:s,newProps:a})=>{n(l=>({...l,[s]:typeof a=="function"?a(l[s]??i):a}))},[]),o=c.useMemo(()=>({props:t,updateProps:r}),[t,r]);return d.jsx(Pf.Provider,{value:o,children:e})},Jy=ne.createContext(null),Ke=()=>{const e=c.useContext(Jy),[t]=c.useState(()=>En());return e??t};function sl(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function Nl(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function Ll(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`)}var zl=c.createContext(null),NS=c.createRef(),LS=e=>!!e.calculateMetadata,Ff=e=>{const t=c.useContext(zl),{props:n}=c.useContext(Pf),{compositions:r,canvasContent:o,currentCompositionMetadata:i}=c.useContext(qo),s=(o==null?void 0:o.type)==="composition"?o.compositionId:null,a=e??s,l=r.find(p=>p.id===a),u=c.useMemo(()=>l?n[l.id]??{}:{},[n,l]),f=Ke();return c.useMemo(()=>l?i?{type:"success",metadataSource:null,result:{...i,id:l.id,defaultProps:l.defaultProps??{}}}:LS(l)?!t||!t[l.id]?null:t[l.id]:(Nl(l.durationInFrames,{allowFloats:!1,component:`in <Composition id="${l.id}">`}),Ll(l.fps,`in <Composition id="${l.id}">`),sl(l.width,"width",`in <Composition id="${l.id}">`),sl(l.height,"height",`in <Composition id="${l.id}">`),{type:"success",metadataSource:null,result:{width:l.width,height:l.height,fps:l.fps,id:l.id,durationInFrames:l.durationInFrames,defaultProps:l.defaultProps??{},props:{...l.defaultProps??{},...u??{},...typeof window>"u"||f.isPlayer||!window.remotion_inputProps?{}:$S()??{}},defaultCodec:null,defaultOutName:null,defaultVideoImageFormat:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null}}):null,[l,t,i,u,f.isPlayer])},e0=e=>{const t=e.stack??"";return t.startsWith("Error:")?t:`${e.message}
|
|
55
|
+
${t}`},zS=e=>e instanceof Error?!0:!(e===null||typeof e!="object"||!("stack"in e)||typeof e.stack!="string"||!("message"in e)||typeof e.message!="string");function jf(e,t){let n;throw zS(t)?(n=t,n.stack||(n.stack=new Error(n.message).stack)):typeof t=="string"?n=Error(t):n=Error("Rendering was cancelled"),e&&(e.remotion_cancelledError=e0(n)),n}function us(e){return jf(typeof window<"u"?window:void 0,e)}var DS=["trace","verbose","info","warn","error"],Am=e=>DS.indexOf(e),Dl=(e,t)=>Am(e)<=Am(t),xs=({args:e,logLevel:t,tag:n})=>{const r=[...e];return En().isRendering&&!En().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_level_${t}`)),n&&En().isRendering&&!En().isClientSideRendering&&r.unshift(Symbol.for(`__remotion_tag_${n}`)),r},OS=(e,...t)=>{if(Dl(e.logLevel,"verbose"))return console.debug(...xs({args:t,logLevel:"verbose",tag:e.tag}))},VS=(e,...t)=>{if(Dl(e.logLevel,"trace"))return console.debug(...xs({args:t,logLevel:"trace",tag:e.tag}))},BS=(e,...t)=>{if(Dl(e.logLevel,"info"))return console.log(...xs({args:t,logLevel:"info",tag:e.tag}))},WS=(e,...t)=>{if(Dl(e.logLevel,"warn"))return console.warn(...xs({args:t,logLevel:"warn",tag:e.tag}))},HS=(e,...t)=>console.error(...xs({args:t,logLevel:"error",tag:e.tag})),ot={trace:VS,verbose:OS,info:BS,warn:WS,error:HS};typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var US="The delayRender was called:",ZS="Retries left: ",YS="- Rendering the frame will be retried.",KS="handle was cleared after",XS=3e4,GS=({scope:e,environment:t,label:n,options:r})=>{var s;if(typeof n!="string"&&n!==null)throw new Error("The label parameter of delayRender() must be a string or undefined, got: "+JSON.stringify(n));const o=Math.random();e.remotion_delayRenderHandles.push(o);const i=((s=Error().stack)==null?void 0:s.replace(/^Error/g,""))??"";if(t.isRendering){const a=((r==null?void 0:r.timeoutInMilliseconds)??e.remotion_puppeteerTimeout??XS)-2e3,l=((r==null?void 0:r.retries)??0)-(e.remotion_attempt-1);e.remotion_delayRenderTimeouts[o]={label:n??null,startTime:Date.now(),timeout:setTimeout(()=>{const u=["A delayRender()",n?`"${n}"`:null,`was called but not cleared after ${a}ms. See https://remotion.dev/docs/timeout for help.`,l>0?ZS+l:null,l>0?YS:null,US,i].filter(Qo).join(" ");t.isClientSideRendering?e.remotion_cancelledError=e0(Error(u)):jf(e,Error(u))},a)}}return e.remotion_renderReady=!1,o},qS=({scope:e,handle:t,environment:n,logLevel:r})=>{if(typeof t>"u")throw new TypeError("The continueRender() method must be called with a parameter that is the return value of delayRender(). No value was passed.");if(typeof t!="number")throw new TypeError("The parameter passed into continueRender() must be the return value of delayRender() which is a number. Got: "+JSON.stringify(t));const o=e.remotion_delayRenderHandles.includes(t),i=e.remotion_delayRenderTimeouts[t];if(o&&n.isRendering&&i){const{label:s,startTime:a,timeout:l}=i;clearTimeout(l);const u=[s?`"${s}"`:"A handle",KS,`${Date.now()-a}ms`].filter(Qo).join(" ");ot.verbose({logLevel:r,tag:"delayRender()"},u),delete e.remotion_delayRenderTimeouts[t]}e.remotion_delayRenderHandles=e.remotion_delayRenderHandles.filter(s=>s!==t),e.remotion_delayRenderHandles.length===0&&(e.remotion_renderReady=!0)},Xr=c.createContext({logLevel:"info",mountTime:0}),Rn=()=>{const{logLevel:e}=c.useContext(Xr);if(e===null)throw new Error("useLogLevel must be used within a LogLevelProvider");return e},bs=()=>{const{mountTime:e}=c.useContext(Xr);if(e===null)throw new Error("useMountTime must be used within a LogLevelProvider");return e},t0=c.createContext(null),gn=()=>{const e=Ke(),t=c.useContext(t0)??(typeof window<"u"?window:void 0),n=Rn(),r=c.useCallback((s,a)=>t?GS({scope:t,environment:e,label:s??null,options:a??{}}):Math.random(),[e,t]),o=c.useCallback(s=>{t&&qS({scope:t,handle:s,environment:e,logLevel:n})},[e,n,t]),i=c.useCallback(s=>jf(t??(typeof window<"u"?window:void 0),s),[t]);return{delayRender:r,continueRender:o,cancelRender:i}},n0=({compProps:e,componentName:t,noSuspense:n})=>{const r=c.useRef(null);return"component"in e&&(r.current=e.component),c.useMemo(()=>{if("component"in e){if(typeof document>"u"||n)return e.component;if(typeof e.component>"u")throw new Error(`A value of \`undefined\` was passed to the \`component\` prop. Check the value you are passing to the <${t}/> component.`);return s=>{const a=r.current;return ne.createElement(a,s)}}if("lazyComponent"in e&&typeof e.lazyComponent<"u"){if(typeof e.lazyComponent>"u")throw new Error(`A value of \`undefined\` was passed to the \`lazyComponent\` prop. Check the value you are passing to the <${t}/> component.`);return ne.lazy(e.lazyComponent)}throw new Error("You must pass either 'component' or 'lazyComponent'")},[e.lazyComponent])},Ol=()=>{const{canvasContent:e,compositions:t,currentCompositionMetadata:n}=c.useContext(qo),r=t.find(i=>(e==null?void 0:e.type)==="composition"&&i.id===e.compositionId),o=Ff((r==null?void 0:r.id)??null);return c.useMemo(()=>!o||o.type==="error"||o.type==="loading"||!r?null:{...o.result,defaultProps:r.defaultProps??{},id:r.id,...n??{},component:r.component},[n,o,r])},r0=()=>/^([a-zA-Z0-9-\u4E00-\u9FFF])+$/g,o0=e=>e.match(r0()),QS=e=>{if(!o0(e))throw new Error(`Composition id can only contain a-z, A-Z, 0-9, CJK characters and -. You passed ${e}`)},JS=`Composition ID must match ${String(r0())}`,eE=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}},tE=()=>{const{continueRender:e,delayRender:t}=gn();return c.useEffect(()=>{const n=t("Waiting for Root component to unsuspend");return()=>e(n)},[e,t]),null},nE=({width:e,height:t,fps:n,durationInFrames:r,id:o,defaultProps:i,schema:s,...a})=>{const l=c.useContext(ys),{registerComposition:u,unregisterComposition:f}=l,p=Ol(),m=n0({compProps:a,componentName:"Composition",noSuspense:!1}),h=Al(),y=_f(),g=Ke(),E=c.useContext(Kr);if(typeof window<"u"&&(window.remotion_seenCompositionIds=Array.from(new Set([...window.remotion_seenCompositionIds??[],o]))),E)throw y?new Error("<Composition> was mounted inside the `component` that was passed to the <Player>. See https://remotion.dev/docs/wrong-composition-mount for help."):new Error("<Composition> mounted inside another composition. See https://remotion.dev/docs/wrong-composition-mount for help.");const{folderName:v,parentName:w}=c.useContext(dd),x=a.stack??null,b="component"in a?a.component:null;c.useEffect(()=>{if(!o)throw new Error("No id for composition passed.");return QS(o),eE(i,"defaultProps",o),u({durationInFrames:r??void 0,fps:n??void 0,height:t??void 0,width:e??void 0,id:o,folderName:v,component:m,defaultProps:pd(i??{}),nonce:h.get(),parentFolderName:w,componentFromProps:b,schema:s??null,calculateMetadata:a.calculateMetadata??null,stack:x}),()=>{f(o)}},[r,n,t,m,o,v,i,e,h,w,b,s,a.calculateMetadata,x,u,f]);const S=Ff(o),{setError:C,clearError:k}=c.useContext(Zy),T=c.useCallback(j=>{C(j)},[C]),P=c.useCallback(()=>{k()},[k]);if(g.isStudio&&p&&p.component===m&&p.id===o){const j=m;return S===null||S.type!=="success"&&S.type!=="success-and-refreshing"?null:ud.createPortal(d.jsx(cd,{children:d.jsx(xS,{onError:T,onClear:P,children:d.jsx(c.Suspense,{fallback:d.jsx(FS,{}),children:d.jsx(j,{...S.result.props??{}})})})}),md())}if(g.isRendering&&p&&p.component===m&&p.id===o){const j=m;return S===null||S.type!=="success"&&S.type!=="success-and-refreshing"?null:ud.createPortal(d.jsx(cd,{children:d.jsx(c.Suspense,{fallback:d.jsx(tE,{}),children:d.jsx(j,{...S.result.props??{}})})}),md())}return null},al=e=>{const{onlyRenderComposition:t}=c.useContext(ys);return t&&t!==e.id?null:d.jsx(nE,{...e})},i0=[],s0=null,rE=()=>i0,kt=e=>{i0.push(e)},oE=e=>{s0=e},iE=()=>s0,sE=e=>{const t=ne.Children.toArray(e);if(t.length!==1)return null;const n=t[0];return!ne.isValidElement(n)||typeof n.type!="function"&&typeof n.type!="object"?null:n.type},Fi="4.0.499",aE=()=>{if(typeof globalThis>"u")return;const e=()=>{globalThis.remotion_imported=Fi,typeof window<"u"&&(window.remotion_imported=Fi)},t=globalThis.remotion_imported||typeof window<"u"&&window.remotion_imported;if(t){if(t===Fi)return;if(typeof t=="string"&&t.includes("webcodecs")){e();return}throw new TypeError(`🚨 Multiple versions of Remotion detected: ${[Fi,typeof t=="string"?t:"an older version"].filter(Qo).join(" and ")}. This will cause things to break in an unexpected way.
|
|
56
|
+
Check that all your Remotion packages are on the same version. If your dependencies depend on Remotion, make them peer dependencies. You can also run \`npx remotion versions\` from your terminal to see which versions are mismatching.`)}e()},tt=c.createContext(null),gd={};Uy(gd,{useTimelineSetFrame:()=>p0,useTimelinePosition:()=>Cr,useTimelineContext:()=>kr,usePlayingState:()=>m0,usePlaybackRate:()=>Nf,useAbsoluteTimelinePosition:()=>f0,persistCurrentFrame:()=>a0,getInitialFrameState:()=>l0,getFrameForComposition:()=>u0,clampFrameToCompositionRange:()=>c0});function Nm(e){let t=e+1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}function lE(e){let t=0,n=0,r=0;for(t=0;t<e.length;t++)n=e.charCodeAt(t),r=(r<<5)-r+n,r|=0;return r}var Gr=(e,t)=>{if(e===null)return Math.random();if(typeof e=="string")return Nm(lE(e));if(typeof e=="number")return Nm(e*1e10);throw new Error("random() argument must be a number or a string")},Jo=c.createContext({setFrame:()=>{throw new Error("default")},setPlaying:()=>{throw new Error("default")}}),ei=c.createContext(null),Mf=c.createContext(null),$f=c.createContext(null),uE=({children:e,frameState:t})=>{const[n,r]=c.useState(!1),o=c.useRef(!1),[i,s]=c.useState(1),a=c.useRef([]),[l]=c.useState(()=>String(Gr(null))),[u,f]=c.useState(()=>l0()),p=t??u,{delayRender:m,continueRender:h}=gn();typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_setFrame=(v,w,x)=>{window.remotion_attempt=x;const b=m(`Setting the current frame to ${v}`);let S=!0;f(C=>(C[w]??window.remotion_initialFrame)===v?(S=!1,C):{...C,[w]:v}),S?requestAnimationFrame(()=>h(b)):h(b)},window.remotion_isPlayer=!1},[h,m]);const y=c.useMemo(()=>({frame:p,playing:n,imperativePlaying:o,rootId:l,audioAndVideoTags:a}),[p,n,l]),g=c.useMemo(()=>({playbackRate:i,setPlaybackRate:s}),[i]),E=c.useMemo(()=>({setFrame:f,setPlaying:r}),[]);return d.jsx($f.Provider,{value:y,children:d.jsx(Mf.Provider,{value:g,children:d.jsx(ei.Provider,{value:y,children:d.jsx(Jo.Provider,{value:E,children:e})})})})},Af=()=>"remotion.time-all",a0=e=>{localStorage.setItem(Af(),JSON.stringify(e))},l0=()=>{const e=localStorage.getItem(Af())??"{}";return JSON.parse(e)},u0=e=>{const t=localStorage.getItem(Af())??"{}",n=JSON.parse(t);return n[e]!==void 0?Number(n[e]):typeof window>"u"?0:window.remotion_initialFrame??0},c0=(e,t)=>Math.max(0,Math.min(Math.max(0,t-1),e)),d0=e=>{const t=Ol(),n=Ke();if(!t)return typeof window>"u"?0:window.remotion_initialFrame??0;const r=e.frame[t.id]??(n.isPlayer?0:u0(t.id));return c0(r,t.durationInFrames)},kr=()=>{const e=c.useContext(ei);if(e===null)throw new Error("TimelineContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},Nf=()=>{const e=c.useContext(Mf);if(e===null)throw new Error("PlaybackRateContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return e},Cr=()=>{const e=kr();return d0(e)},f0=()=>{const e=c.useContext($f);if(e===null)throw new Error("AbsoluteTimeContext is not available. This hook must be used inside a <Player> or the Remotion Studio.");return d0(e)},p0=()=>{const{setFrame:e}=c.useContext(Jo);return e},m0=()=>{const{playing:e,imperativePlaying:t}=kr(),{setPlaying:n}=c.useContext(Jo);return c.useMemo(()=>[e,n,t],[t,e,n])},ct=()=>{const e=c.useContext(Kr),t=Ke();if(!e)throw t.isPlayer?new Error("useCurrentFrame can only be called inside a component that was passed to <Player>. See: https://www.remotion.dev/docs/player/examples"):new 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");const n=Cr(),r=c.useContext(tt),o=r?r.cumulatedFrom+r.relativeFrom:0;return n-o},Vl=()=>{const e=c.useContext(tt),t=(e==null?void 0:e.width)??null,n=(e==null?void 0:e.height)??null,r=(e==null?void 0:e.durationInFrames)??null,o=Ol();return c.useMemo(()=>{if(!o)return null;const{id:i,durationInFrames:s,fps:a,height:l,width:u,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:y,defaultPixelFormat:g,defaultProResProfile:E,defaultSampleRate:v}=o;return{id:i,width:t??u,height:n??l,fps:a,durationInFrames:r??s,defaultProps:f,props:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:y,defaultPixelFormat:g,defaultProResProfile:E,defaultSampleRate:v}},[r,n,t,o])},qe=()=>{const e=Vl(),t=c.useContext(Kr),n=_f();if(!e)throw typeof window<"u"&&window.remotion_isPlayer||n?new 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."].join("-")):new 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 new Error("Called useVideoConfig() outside a Remotion composition.");return e},Ss=({frame:e,children:t,active:n=!0})=>{const r=ct(),o=qe();if(typeof e>"u")throw new Error("The <Freeze /> component requires a 'frame' prop, but none was passed.");if(typeof e!="number")throw new Error(`The 'frame' prop of <Freeze /> must be a number, but is of type ${typeof e}`);if(Number.isNaN(e))throw new Error("The 'frame' prop of <Freeze /> must be a real number, but it is NaN.");if(!Number.isFinite(e))throw new Error(`The 'frame' prop of <Freeze /> must be a finite number, but it is ${e}.`);const i=c.useMemo(()=>{if(typeof n=="boolean")return n;if(typeof n=="function")return n(r)},[n,r]),s=kr(),a=c.useContext(tt),l=(a==null?void 0:a.relativeFrom)??0,u=c.useMemo(()=>i?{...s,playing:!1,imperativePlaying:{current:!1},frame:{[o.id]:e+l}}:s,[i,s,o.id,e,l]),f=c.useMemo(()=>a?i?{...a,cumulatedFrom:0}:a:null,[a,i]);return d.jsx(ei.Provider,{value:u,children:d.jsx(tt.Provider,{value:f,children:t})})},_n={"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",defaultKeyframeOutput:"perceptual-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}},cE=_n,Bl={"style.color":{type:"color",default:void 0,description:"Color"},"style.fontFamily":{type:"font-family",default:void 0,description:"Font family",keyframable:!1},"style.fontSize":{type:"number",default:void 0,min:0,step:1,description:"Font size",hiddenFromList:!1},"style.lineHeight":{type:"number",default:void 0,min:0,step:.05,description:"Line height",hiddenFromList:!1},"style.fontWeight":{type:"enum",default:"400",description:"Font weight",variants:{100:{},200:{},300:{},400:{},500:{},600:{},700:{},800:{},900:{},normal:{},bold:{}}},"style.fontStyle":{type:"enum",default:"normal",description:"Font style",variants:{normal:{},italic:{},oblique:{}}},"style.textAlign":{type:"enum",default:"left",description:"Text align",variants:{left:{},center:{},right:{},justify:{},start:{},end:{}}},"style.letterSpacing":{type:"number",default:void 0,step:.1,description:"Letter spacing",hiddenFromList:!1}},Ir={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},Tr={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},h0={children:{type:"text-content",default:"",description:"Text",keyframable:!1}},ti={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},g0={...ti},v0={..._n,...Tr,...Ir,...g0},Lf={type:"boolean",default:!1,description:"Hidden"},y0={type:"hidden"},zf={type:"hidden"},dE=e=>({name:zf,...e}),Df={type:"number",default:void 0,min:1,step:1,hiddenFromList:!0},w0={type:"number",default:0,step:1,hiddenFromList:!0},x0={type:"number",default:0,min:0,step:1,hiddenFromList:!0},Of={type:"number",default:null,step:1,hiddenFromList:!0},Zn={durationInFrames:Df,from:w0,trimBefore:x0,freeze:Of,hidden:Lf,name:zf,showInTimeline:y0},Zo={...Zn,layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":v0,none:{}}}},fE={durationInFrames:Df,trimBefore:x0,freeze:Of,hidden:Lf,name:zf,showInTimeline:y0},pE={...fE,layout:Zo.layout},mE={...Zo,layout:{...Zo.layout,default:"none"}},ni=ne.createContext({registerSequence:()=>{throw new Error("SequenceManagerContext not initialized")},unregisterSequence:()=>{throw new Error("SequenceManagerContext not initialized")},sequences:[]}),Wl=ne.createContext({current:[]}),An=e=>`${e.absolutePath}\0${e.nodePath.join(".")}\0${e.sequenceKeys.join(".")}\0${e.effectKeys.map(t=>t.join(".")).join(".")}`,Hl=ne.createContext({propStatuses:{}}),Ul=ne.createContext({current:{}}),Zl=ne.createContext({getDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")},getEffectDragOverrides:()=>{throw new Error("VisualModeDragOverridesContext not initialized")}}),b0=ne.createContext({setDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},clearEffectDragOverrides:()=>{throw new Error("VisualModeSettersContext not initialized")},setPropStatuses:()=>{throw new Error("VisualModeSettersContext not initialized")}}),Wu=(e,t)=>`${An(e)}.effects.${t}`,hE=({children:e})=>{const[t,n]=c.useState([]),r=c.useRef(t);r.current=t;const[o,i]=c.useState({}),s=c.useRef(o);s.current=o;const[a,l]=c.useState({}),[u,f]=c.useState({}),p=c.useRef(u);p.current=u;const m=c.useCallback((P,j,M)=>{i(D=>({...D,[An(P)]:{...D[An(P)],[j]:M}}))},[]),h=c.useCallback(P=>{i(j=>{const M=An(P);if(!j[M])return j;const D={...j};return delete D[M],D})},[]),y=c.useCallback((P,j,M,D)=>{l(N=>{const L=Wu(P,j);return{...N,[L]:{...N[L],[M]:D}}})},[]),g=c.useCallback((P,j)=>{l(M=>{const D=Wu(P,j);if(!M[D])return M;const N={...M};return delete N[D],N})},[]),E=c.useCallback((P,j)=>{f(M=>{const D=An(P),N=M[D],L=j(N);return N===L?M:{...M,[D]:L}})},[]),v=c.useCallback(P=>{n(j=>[...j,P])},[]),w=c.useCallback(P=>{n(j=>j.filter(M=>M.id!==P))},[]),x=c.useMemo(()=>({registerSequence:v,sequences:t,unregisterSequence:w}),[v,t,w]),b=c.useCallback(P=>o[An(P)]??{},[o]),S=c.useCallback((P,j)=>a[Wu(P,j)]??{},[a]),C=c.useMemo(()=>({propStatuses:u}),[u]),k=c.useMemo(()=>({getDragOverrides:b,getEffectDragOverrides:S}),[b,S]),T=c.useMemo(()=>({setDragOverrides:m,clearDragOverrides:h,setEffectDragOverrides:y,clearEffectDragOverrides:g,setPropStatuses:E}),[m,h,y,g,E]);return d.jsx(Wl.Provider,{value:r,children:d.jsx(ni.Provider,{value:x,children:d.jsx(Ul.Provider,{value:p,children:d.jsx(Hl.Provider,{value:C,children:d.jsx(Zl.Provider,{value:k,children:d.jsx(b0.Provider,{value:T,children:e})})})})})})},Yl=c.createContext(!1),gE=({children:e})=>d.jsx(Yl.Provider,{value:!0,children:e}),S0=({children:e})=>d.jsx(Yl.Provider,{value:!1,children:e}),vE=()=>{if(!ne.useContext(Yl))throw new Error("This component must be inside a <Series /> component.")},E0=c.createContext({premountFramesRemaining:0}),yE=!1,Es=e=>e??yE,ks=({from:e,durationInFrames:t,premountFor:n,postmountFor:r,style:o,styleWhilePremounted:i,styleWhilePostmounted:s,hideWhilePremounted:a})=>{const l=c.useContext(E0),u=ct()-l.premountFramesRemaining,f=Ke(),{fps:p}=qe(),m=n??0,h=r??0,y=Math.ceil(e+t-1),g=!f.isRendering&&u<e&&u>=e-m,E=!f.isRendering&&u>y&&u<=y+h,v=g||E,w=g?e:E?e+t-1:0,x=c.useMemo(()=>v?{...o,...a==="opacity"?{opacity:0}:{display:"none"},pointerEvents:"none",...g?i:{},...E?s:{}}:o,[v,a,E,g,o,s,i]);return{effectivePremountFor:m,effectivePostmountFor:h,premountingActive:g,postmountingActive:E,isPremountingOrPostmounting:v,freezeFrame:w,premountingStyle:x}},wE=(e,t)=>{for(const n of t){const r=n.split("."),o=[e];let i=e;for(let s=0;s<r.length-1;s++){const a=r[s],l=i[a];if(l==null){i=null;break}i=l,o.push(i)}if(i!==null){delete i[r[r.length-1]];for(let s=o.length-1;s>0;s--){const a=o[s];if(Object.keys(a).length===0){const l=r[s-1];delete o[s-1][l]}else break}}}return e},xE=4,bE=.001,SE=1e-7,EE=10,ji=11,Qs=1/(ji-1),kE=typeof Float32Array=="function";function k0(e,t){return 1-3*t+3*e}function C0(e,t){return 3*t-6*e}function I0(e){return 3*e}function ll(e,t,n){return((k0(t,n)*e+C0(t,n))*e+I0(t))*e}function T0(e,t,n){return 3*k0(t,n)*e*e+2*C0(t,n)*e+I0(t)}function CE({aX:e,_aA:t,_aB:n,mX1:r,mX2:o}){let i,s,a=0,l=t,u=n;do s=l+(u-l)/2,i=ll(s,r,o)-e,i>0?u=s:l=s;while(Math.abs(i)>SE&&++a<EE);return s}function IE(e,t,n,r){let o=t;for(let i=0;i<xE;++i){const s=T0(o,n,r);if(s===0)return o;const a=ll(o,n,r)-e;o-=a/s}return o}function R0(e,t,n,r){if(!(e>=0&&e<=1&&n>=0&&n<=1))throw new Error("bezier x values must be in [0, 1] range");const o=kE?new Float32Array(ji):new Array(ji);if(e!==t||n!==r)for(let s=0;s<ji;++s)o[s]=ll(s*Qs,e,n);function i(s){let a=0,l=1;const u=ji-1;for(;l!==u&&o[l]<=s;++l)a+=Qs;--l;const f=(s-o[l])/(o[l+1]-o[l]),p=a+f*Qs,m=T0(p,e,n);return m>=bE?IE(s,p,e,n):m===0?p:CE({aX:s,_aA:a,_aB:a+Qs,mX1:e,mX2:n})}return function(s){const a=Math.min(1,Math.max(0,s));return e===t&&n===r?a:a===0?0:a===1?1:ll(i(a),t,r)}}var TE=e=>Math.round(e*1e6)/1e6,RE=new Set(["deg","rad","grad","turn"]),_0=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"]),P0=/^([+-]?(?:\d+\.?\d*|\.\d+))([a-zA-Z%]+)?$/,F0=new Set(["left","center","right","top","bottom"]),To=e=>e==="left"?[{axis:"x",value:{value:0,unit:"%"}}]:e==="right"?[{axis:"x",value:{value:100,unit:"%"}}]:e==="top"?[{axis:"y",value:{value:0,unit:"%"}}]:e==="bottom"?[{axis:"y",value:{value:100,unit:"%"}}]:[{axis:"x",value:{value:50,unit:"%"}},{axis:"y",value:{value:50,unit:"%"}}],yi={value:50,unit:"%"},Lm=e=>String(TE(e)),_E=(e,t)=>{const n=P0.exec(e);if(n===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported scale, translate, or rotate value`);const r=n[2]??null,o=Number(n[1]);if(!Number.isFinite(o))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(r===null)return{kind:"scale",value:o,unit:null};if(RE.has(r))return{kind:"rotate",value:o,unit:r};if(_0.has(r))return{kind:"translate",value:o,unit:r};throw new TypeError(`Cannot interpolate "${t}" because "${r}" is not a supported translate or rotate unit`)},j0=({component:e,value:t,allowPercentage:n})=>{const r=P0.exec(e);if(r===null)throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);const o=r[2]??null,i=Number(r[1]);if(!Number.isFinite(i))throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not finite`);if(o===null||!_0.has(o)||!n&&o==="%")throw new TypeError(`Cannot interpolate "${t}" because "${e}" is not a supported transform-origin ${n?"length-percentage":"z length"}`);return{value:i,unit:o}},Hu=(e,t)=>{const n=e.toLowerCase();return F0.has(n)?{type:"keyword",keyword:n}:{type:"length-percentage",parsed:j0({component:e,value:t,allowPercentage:!0})}},PE=(e,t,n)=>{const r=[];for(const o of To(e))for(const i of To(t))o.axis!==i.axis&&r.push(o.axis==="x"?[o.value,i.value]:[i.value,o.value]);if(r.length===0)throw new TypeError(`Cannot interpolate "${n}" because "${e} ${t}" is not a valid transform-origin keyword pair`);return r[0]},FE=(e,t)=>{if(e.length===1){const a=Hu(e[0],t);return a.type==="length-percentage"?[a.parsed,yi]:a.keyword==="top"||a.keyword==="bottom"?[yi,To(a.keyword)[0].value]:[To(a.keyword)[0].value,yi]}const n=Hu(e[0],t),r=Hu(e[1],t);if(n.type==="length-percentage"&&r.type==="length-percentage")return[n.parsed,r.parsed];if(n.type==="keyword"&&r.type==="keyword")return PE(n.keyword,r.keyword,t);const o=n.type==="keyword"?n:r.type==="keyword"?r:null,i=n.type==="length-percentage"?n.parsed:r.type==="length-percentage"?r.parsed:null;if(o===null||i===null)throw new Error("Expected a keyword and a length-percentage value");const s=n.type==="keyword";if(o.keyword==="left"||o.keyword==="right"){if(!s)throw new TypeError(`Cannot interpolate "${t}" because horizontal transform-origin keywords must come before a length-percentage value`);return[To(o.keyword)[0].value,i]}return o.keyword==="top"||o.keyword==="bottom"?[i,To(o.keyword)[0].value]:s?[yi,i]:[i,yi]},jE=(e,t)=>{const[n,r]=FE(t.slice(0,2),e),o=t[2]===void 0?{value:0,unit:null}:j0({component:t[2],value:e,allowPercentage:!1});return{kind:"translate",values:[n.value,r.value,o.value],units:[n.unit,r.unit,o.unit],dimensions:t[2]===void 0?2:3}},ME=e=>{var o,i,s,a,l,u;if(typeof e=="number"){if(!Number.isFinite(e))throw new Error(`outputRange must contain only finite numbers, but got [${e}]`);return{kind:"scale",values:[e,e,1],units:[null,null,null],dimensions:1}}const t=e.trim().split(/\s+/);if(t.length<1||t.length>3||t[0]==="")throw new TypeError(`String outputRange values must contain 1 to 3 components, but got "${e}"`);if(t.some(f=>F0.has(f.toLowerCase())))return jE(e,t);const n=t.map(f=>_E(f,e)),[{kind:r}]=n;for(const f of n)if(f.kind!==r)throw new TypeError(`Cannot interpolate "${e}" because it mixes ${r} and ${f.kind} values`);if(r==="scale"){const f=n[0].value,p=((o=n[1])==null?void 0:o.value)??f,m=((i=n[2])==null?void 0:i.value)??1;return{kind:r,values:[f,p,m],units:[null,null,null],dimensions:n.length}}return{kind:r,values:[n[0].value,((s=n[1])==null?void 0:s.value)??0,((a=n[2])==null?void 0:a.value)??0],units:[n[0].unit,((l=n[1])==null?void 0:l.unit)??null,((u=n[2])==null?void 0:u.unit)??null],dimensions:n.length}},$E=({kind:e,values:t,units:n,dimensions:r})=>e==="scale"?t.slice(0,r).map(o=>Lm(o)).join(" "):t.slice(0,r).map((o,i)=>`${Lm(o)}${n[i]}`).join(" "),zm=e=>e===0?0:Math.sign(e)*e*e,AE=e=>e===0?0:Math.sign(e)*Math.sqrt(Math.abs(e));function NE(e,t,n,r){const{extrapolateLeft:o,extrapolateRight:i,easing:s,output:a}=r;let l=e;const[u,f]=t,[p,m]=n;if(l<u){if(o==="identity")return l;if(o==="clamp")l=u;else if(o==="wrap"){const h=f-u;l=((l-u)%h+h)%h+u}}if(l>f){if(i==="identity")return l;if(i==="clamp")l=f;else if(i==="wrap"){const h=f-u;l=((l-u)%h+h)%h+u}}if(p===m)return p;if(l=(l-u)/(f-u),l=s(l),a==="perceptual-scale"){const h=zm(p),y=zm(m);l=AE(l*(y-h)+h)}else l=l*(m-p)+p;return l}function LE(e,t){let n;for(n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}var zE=e=>e,DE=e=>e??"linear",M0=e=>e.remotionShouldExtendRight===!0,Dm=({easing:e,segmentIndex:t})=>e===void 0?zE:typeof e=="function"?e:e[t],Om=({input:e,inputRange:t,outputRange:n,easing:r,extrapolateLeft:o,extrapolateRight:i,output:s})=>NE(e,t,n,{easing:r,extrapolateLeft:o,extrapolateRight:e>t[1]&&i==="clamp"&&M0(r)?"extend":i,output:s}),Vf=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=DE(r==null?void 0:r.output);if(t.length===1)return n[0];const i=r==null?void 0:r.easing;let s="extend";(r==null?void 0:r.extrapolateLeft)!==void 0&&(s=r.extrapolateLeft);let a="extend";(r==null?void 0:r.extrapolateRight)!==void 0&&(a=r.extrapolateRight);const l=(r==null?void 0:r.posterize)===void 0?e:Math.floor(e/r.posterize)*r.posterize,u=LE(l,t),f=Dm({easing:i,segmentIndex:u});let p=Om({input:l,inputRange:[t[u],t[u+1]],outputRange:[n[u],n[u+1]],easing:f,extrapolateLeft:s,extrapolateRight:a,output:o});for(let m=0;m<u;m++){const h=Dm({easing:i,segmentIndex:m});if(!M0(h))continue;const y=t[m+1];if(l<=y)continue;const g=Om({input:l,inputRange:[t[m],y],outputRange:[n[m],n[m+1]],easing:h,extrapolateLeft:s,extrapolateRight:"extend",output:o});p+=g-n[m+1]}return p},OE=({input:e,inputRange:t,outputRange:n,options:r})=>{var u;const o=n.map(ME),i=(u=o[0])==null?void 0:u.kind;if(i===void 0)throw new Error("outputRange must have at least 1 element");for(const f of o)if(f.kind!==i)throw new TypeError(`Cannot interpolate ${i} values with ${f.kind} values`);const s=Math.max(...o.map(f=>f.dimensions)),a=[null,null,null];if(i!=="scale")for(let f=0;f<s;f++){for(const p of o){const m=p.units[f];if(m!==null){if(a[f]===null){a[f]=m;continue}if(a[f]!==m)throw new TypeError(`Cannot interpolate ${i} values with different units on axis ${f+1}: ${a[f]} and ${m}`)}}if(a[f]===null)throw new TypeError(`Cannot interpolate ${i} values because axis ${f+1} has no unit`)}const l=[0,0,0];for(let f=0;f<s;f++)l[f]=Vf({input:e,inputRange:t,outputRange:o.map(p=>p.values[f]),options:r});return $E({kind:i,values:l,units:a,dimensions:s})},VE=e=>{var n;const t=(n=e[0])==null?void 0:n.length;if(t===void 0)throw new Error("outputRange must have at least 1 element");if(t===0)throw new TypeError("outputRange tuples must contain at least 1 number");for(const r of e){if(r.length!==t)throw new TypeError(`outputRange tuples must all have the same length, but got ${t} and ${r.length}`);for(const o of r)if(typeof o!="number"||!Number.isFinite(o))throw new TypeError(`outputRange tuples must contain only finite numbers, but got [${r.join(",")}]`)}return t},BE=({input:e,inputRange:t,outputRange:n,options:r})=>{const o=VE(n);return new Array(o).fill(!0).map((i,s)=>Vf({input:e,inputRange:t,outputRange:n.map(a=>a[s]),options:r}))};function WE(e){for(let t=1;t<e.length;++t)if(!(e[t]>e[t-1]))throw new Error(`inputRange must be strictly monotonically increasing but got [${e.join(",")}]`)}function Vm(e,t){if(t.length<1)throw new Error(e+" must have at least 1 element");for(const n of t){if(typeof n!="number")throw new Error(`${e} must contain only numbers`);if(!Number.isFinite(n))throw new Error(`${e} must contain only finite numbers, but got [${t.join(",")}]`)}}function HE(e,t){if(e===void 0||typeof e=="function")return;const n=t-1;if(e.length!==n)throw new Error(`When easing is an array, it must have one entry per segment between keyframes (length inputRange.length - 1 = ${n}), but got length ${e.length}`);for(let r=0;r<e.length;r++)if(typeof e[r]!="function")throw new Error(`easing[${r}] must be a function`)}function UE(e){if(e!==void 0&&(typeof e!="number"||!Number.isFinite(e)||e<=0))throw new Error(`posterize must be a positive finite number, but got ${e}`)}function ZE(e){if(!(e===void 0||e==="linear"||e==="perceptual-scale"))throw new Error(`output must be "linear" or "perceptual-scale", but got ${String(e)}`)}function ri(e,t,n,r){if(typeof e>"u")throw new Error("input can not be undefined");if(typeof t>"u")throw new Error("inputRange can not be undefined");if(typeof n>"u")throw new Error("outputRange can not be undefined");if(t.length!==n.length)throw new Error("inputRange ("+t.length+") and outputRange ("+n.length+") must have the same length");if(Vm("inputRange",t),WE(t),HE(r==null?void 0:r.easing,t.length),UE(r==null?void 0:r.posterize),ZE(r==null?void 0:r.output),typeof e!="number")throw new TypeError("Cannot interpolate an input which is not a number");if(!Array.isArray(n))throw new Error("outputRange must contain only numbers");if(n.some(i=>typeof i=="string")){if(!n.every(i=>typeof i=="string"||typeof i=="number"))throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");return OE({input:e,inputRange:t,outputRange:n,options:r})}if(n.every(i=>Array.isArray(i)))return BE({input:e,inputRange:t,outputRange:n,options:r});if(!n.every(i=>typeof i=="number"))throw new TypeError("outputRange must contain only numbers, numeric tuples, or supported scale, translate, and rotate strings");return Vm("outputRange",n),Vf({input:e,inputRange:t,outputRange:n,options:r})}var YE=({allowFloats:e,durationInFrames:t,frame:n})=>{if(typeof n>"u")throw new TypeError('Argument missing for parameter "frame"');if(typeof n!="number")throw new TypeError(`Argument passed for "frame" is not a number: ${n}`);if(!Number.isFinite(n))throw new RangeError(`Frame ${n} is not finite`);if(n<0&&n<-t)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the lowest frame that can be rendered is ${-t}`);if(n>t-1)throw new RangeError(`Cannot use frame ${n}: Duration of composition is ${t}, therefore the highest frame that can be rendered is ${t-1}`)},KE=e=>{if(!(typeof e>"u")){if(typeof e!="number")throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof e}"`);if(Number.isNaN(e))throw new TypeError('A "duration" of a spring is NaN, which it must not be');if(!Number.isFinite(e))throw new TypeError('A "duration" of a spring must be finite, but is '+e);if(e<=0)throw new TypeError('A "duration" of a spring must be positive, but is '+e)}},XE={damping:10,mass:1,stiffness:100,overshootClamping:!1},Uu={};function GE({animation:e,now:t,config:n}){const{toValue:r,lastTimestamp:o,current:i,velocity:s}=e,a=Math.min(t-o,64);if(n.damping<=0)throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");const l=n.damping,u=n.mass,f=n.stiffness,p=[r,o,i,s,l,u,f,t].join("-");if(Uu[p])return Uu[p];const m=-s,h=r-i,y=l/(2*Math.sqrt(f*u)),g=Math.sqrt(f/u),E=g*Math.sqrt(1-y**2),v=a/1e3,w=Math.sin(E*v),x=Math.cos(E*v),b=Math.exp(-y*g*v),S=b*(w*((m+y*g*h)/E)+h*x),C=r-S,k=y*g*S-b*(x*(m+y*g*h)-E*h*w),T=Math.exp(-g*v),P=r-T*(h+(m+g*h)*v),j=T*(m*(v*g-1)+v*h*g*g),M={toValue:r,prevPosition:i,lastTimestamp:t,current:y<1?C:P,velocity:y<1?k:j};return Uu[p]=M,M}var Zu={};function $0({frame:e,fps:t,config:n={}}){const i=[e,t,n.damping,n.mass,n.overshootClamping,n.stiffness].join("-");if(Zu[i])return Zu[i];let s={lastTimestamp:0,current:0,toValue:1,velocity:0,prevPosition:0};const a=Math.max(0,e),l=a%1;for(let u=0;u<=Math.floor(a);u++){u===Math.floor(a)&&(u+=l);const f=u/t*1e3;s=GE({animation:s,now:f,config:{...XE,...n}})}return Zu[i]=s,s}var Yu=new Map;function A0({fps:e,config:t={},threshold:n=.005}){if(typeof n!="number")throw new TypeError(`threshold must be a number, got ${n} of type ${typeof n}`);if(n===0)return 1/0;if(n===1)return 0;if(isNaN(n))throw new TypeError("Threshold is NaN");if(!Number.isFinite(n))throw new TypeError("Threshold is not finite");if(n<0)throw new TypeError("Threshold is below 0");const r=[e,t.damping,t.mass,t.overshootClamping,t.stiffness,n].join("-");if(Yu.has(r))return Yu.get(r);Ll(e,"to the measureSpring() function");let o=0,i=0;const s=()=>$0({fps:e,frame:o,config:t});let a=s();const l=()=>Math.abs(a.current-a.toValue);let u=l();for(;u>=n;)o++,a=s(),u=l();i=o;for(let f=0;f<20;f++)o++,a=s(),u=l(),u>=n&&(f=0,i=o+1);return Yu.set(r,i),i}function vd({frame:e,fps:t,config:n={},from:r=0,to:o=1,durationInFrames:i,durationRestThreshold:s,delay:a=0,reverse:l=!1}){KE(i),YE({frame:e,durationInFrames:1/0,allowFloats:!0}),Ll(t,"to spring()");const u=l||typeof i<"u",f=u?A0({fps:t,config:n,threshold:s}):void 0,p=u?{get:()=>f}:{get:()=>{throw new Error("did not calculate natural duration, this is an error with Remotion. Please report")}},h=(l?(i??p.get())-e:e)+(l?a:-a),y=i===void 0?h:h/(i/p.get());if(i&&h>i)return o;const g=$0({fps:t,frame:y,config:n}),E=n.overshootClamping?o>=r?Math.min(g.current,o):Math.max(g.current,o):g.current;return r===0&&o===1?E:ri(E,[0,1],[r,o])}var Bm=e=>Math.min(1,Math.max(0,e)),wi=30;class ul{static step0(t){return t>0?1:0}static step1(t){return t>=1?1:0}static linear(t){return t}static ease(t){return ul.bezier(.42,0,1,1)(t)}static quad(t){return t*t}static cubic(t){return t*t*t}static poly(t){return n=>n**t}static sin(t){return 1-Math.cos(t*Math.PI/2)}static circle(t){const n=Bm(t);return 1-Math.sqrt(1-n*n)}static exp(t){return 2**(10*(t-1))}static elastic(t=1){const n=t*Math.PI;return r=>1-Math.cos(r*Math.PI/2)**3*Math.cos(r*n)}static back(t=1.70158){return n=>n*n*((t+1)*n-t)}static spring({allowTail:t=!1,durationRestThreshold:n,...r}={}){return Object.assign(i=>i<=0?0:!t&&i>=1?1:vd(t?{fps:wi,frame:i*A0({fps:wi,config:r,threshold:n}),config:r}:{fps:wi,frame:i*wi,config:r,durationInFrames:wi,durationRestThreshold:n}),{remotionShouldExtendRight:t})}static bounce(t){const n=Bm(t);if(n<1/2.75)return 7.5625*n*n;if(n<2/2.75){const o=n-.5454545454545454;return 7.5625*o*o+.75}if(n<2.5/2.75){const o=n-.8181818181818182;return 7.5625*o*o+.9375}const r=n-2.625/2.75;return 7.5625*r*r+.984375}static bezier(t,n,r,o){return R0(t,n,r,o)}static in(t){return t}static out(t){return n=>1-t(1-n)}static inOut(t){return n=>n<.5?t(n*2)/2:1-t((1-n)*2)/2}}var sn="[-+]?\\d*\\.?\\d+",Js=sn+"%";function ea(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var ta="(?:none|[-+]?\\d*\\.?\\d+(?:%|deg|rad|grad|turn)?)";function xi(e){return new RegExp(e+"\\(\\s*("+ta+")\\s+("+ta+")\\s+("+ta+")(?:\\s*\\/\\s*("+ta+"))?\\s*\\)")}function qE(){const e={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};return e.rgb===void 0&&(e.rgb=new RegExp("rgb"+ea(sn,sn,sn)),e.rgba=new RegExp("rgba"+ea(sn,sn,sn,sn)),e.hsl=new RegExp("hsl"+ea(sn,Js,Js)),e.hsla=new RegExp("hsla"+ea(sn,Js,Js,sn)),e.hex3=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,e.hex6=/^#([0-9a-fA-F]{6})$/,e.hex8=/^#([0-9a-fA-F]{8})$/,e.oklch=xi("oklch"),e.oklab=xi("oklab"),e.lab=xi("lab"),e.lch=xi("lch"),e.hwb=xi("hwb")),e}function No(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Wm(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,o=2*n-r,i=No(o,r,e+1/3),s=No(o,r,e),a=No(o,r,e-1/3);return Math.round(i*255)<<24|Math.round(s*255)<<16|Math.round(a*255)<<8}function ao(e){const t=Number.parseInt(e,10);return t<0?0:t>255?255:t}function Hm(e){return(Number.parseFloat(e)%360+360)%360/360}function Um(e){const t=Number.parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function na(e){const t=Number.parseFloat(e);return t<0?0:t>100?1:t/100}function Yt(e,t){return e==="none"?0:e.endsWith("%")?Number.parseFloat(e)/100*t:Number.parseFloat(e)}function Ku(e){return e==="none"?0:e.endsWith("rad")?Number.parseFloat(e)*180/Math.PI:e.endsWith("grad")?Number.parseFloat(e)*.9:e.endsWith("turn")?Number.parseFloat(e)*360:Number.parseFloat(e)}function bi(e){return e===void 0||e==="none"?1:e.endsWith("%")?Math.max(0,Math.min(1,Number.parseFloat(e)/100)):Math.max(0,Math.min(1,Number.parseFloat(e)))}function Lo(e){return e<=.0031308?12.92*e:1.055*e**(1/2.4)-.055}function ra(e){return Math.max(0,Math.min(1,e))}function Si(e,t,n,r){const o=Math.round(ra(e)*255),i=Math.round(ra(t)*255),s=Math.round(ra(n)*255),a=Math.round(ra(r)*255);return(o<<24|i<<16|s<<8|a)>>>0}function Zm(e,t,n){const r=e+.3963377774*t+.2158037573*n,o=e-.1055613458*t-.0638541728*n,i=e-.0894841775*t-1.291485548*n,s=r*r*r,a=o*o*o,l=i*i*i,u=4.0767416621*s-3.3077115913*a+.2309699292*l,f=-1.2684380046*s+2.6097574011*a-.3413193965*l,p=-.0041960863*s-.7034186147*a+1.707614701*l;return[Lo(u),Lo(f),Lo(p)]}function Ym(e,t,n){const r=.008856451679035631,o=24389/27,i=.95047,s=1,a=1.08883,l=(e+16)/116,u=t/500+l,f=l-n/200,p=u*u*u,m=f*f*f,h=p>r?p:(116*u-16)/o,y=e>o*r?((e+16)/116)**3:e/o,g=m>r?m:(116*f-16)/o,E=h*i,v=y*s,w=g*a,x=3.2404542*E-1.5371385*v-.4985314*w,b=-.969266*E+1.8760108*v+.041556*w,S=.0556434*E-.2040259*v+1.0572252*w;return[Lo(x),Lo(b),Lo(S)]}function QE(e,t,n){if(t+n>=1){const u=t/(t+n);return[u,u,u]}const r=1,o=0,i=No(o,r,e+1/3),s=No(o,r,e),a=No(o,r,e-1/3),l=1-t-n;return[i*l+t,s*l+t,a*l+t]}var Km={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199};function JE(e){const t=qE();let n;if(t.hex6&&(n=t.hex6.exec(e)))return Number.parseInt(n[1]+"ff",16)>>>0;if(Km[e]!==void 0)return Km[e];if(t.rgb&&(n=t.rgb.exec(e)))return(ao(n[1])<<24|ao(n[2])<<16|ao(n[3])<<8|255)>>>0;if(t.rgba&&(n=t.rgba.exec(e)))return(ao(n[1])<<24|ao(n[2])<<16|ao(n[3])<<8|Um(n[4]))>>>0;if(t.hex3&&(n=t.hex3.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+"ff",16)>>>0;if(t.hex8&&(n=t.hex8.exec(e)))return Number.parseInt(n[1],16)>>>0;if(t.hex4&&(n=t.hex4.exec(e)))return Number.parseInt(n[1]+n[1]+n[2]+n[2]+n[3]+n[3]+n[4]+n[4],16)>>>0;if(t.hsl&&(n=t.hsl.exec(e)))return(Wm(Hm(n[1]),na(n[2]),na(n[3]))|255)>>>0;if(t.hsla&&(n=t.hsla.exec(e)))return(Wm(Hm(n[1]),na(n[2]),na(n[3]))|Um(n[4]))>>>0;if(t.oklch&&(n=t.oklch.exec(e))){const r=Yt(n[1],1),o=Yt(n[2],.4),i=Ku(n[3]),s=bi(n[4]),a=i*Math.PI/180,[l,u,f]=Zm(r,o*Math.cos(a),o*Math.sin(a));return Si(l,u,f,s)}if(t.oklab&&(n=t.oklab.exec(e))){const r=Yt(n[1],1),o=Yt(n[2],.4),i=Yt(n[3],.4),s=bi(n[4]),[a,l,u]=Zm(r,o,i);return Si(a,l,u,s)}if(t.lab&&(n=t.lab.exec(e))){const r=Yt(n[1],100),o=Yt(n[2],125),i=Yt(n[3],125),s=bi(n[4]),[a,l,u]=Ym(r,o,i);return Si(a,l,u,s)}if(t.lch&&(n=t.lch.exec(e))){const r=Yt(n[1],100),o=Yt(n[2],150),i=Ku(n[3]),s=bi(n[4]),a=i*Math.PI/180,[l,u,f]=Ym(r,o*Math.cos(a),o*Math.sin(a));return Si(l,u,f,s)}if(t.hwb&&(n=t.hwb.exec(e))){const r=Ku(n[1]),o=Yt(n[2],1),i=Yt(n[3],1),s=bi(n[4]),[a,l,u]=QE(r/360,o,i);return Si(a,l,u,s)}throw new Error(`invalid color string ${e} provided`)}var Xm=e=>(e>>24&255)/255,ek=e=>e>>16&255,tk=e=>e>>8&255,nk=e=>e&255,rk=(e,t,n,r)=>`rgba(${e}, ${t}, ${n}, ${r})`;function ok(e){const t=JE(e);return(t<<24|t>>>8)>>>0}var ik=(e,t,n,r)=>{const[o,i,s,a]=[ek,tk,nk,Xm].map(l=>{const u=ri(e,t,n.map(f=>l(f)),{easing:r==null?void 0:r.easing,extrapolateLeft:"clamp",extrapolateRight:"clamp",posterize:r==null?void 0:r.posterize});return l===Xm?Number(u.toFixed(3)):Math.round(u)});return rk(o,i,s,a)},sk=(e,t,n,r)=>{if(typeof e>"u")throw new TypeError("input can not be undefined");if(typeof t>"u")throw new TypeError("inputRange can not be undefined");if(typeof n>"u")throw new TypeError("outputRange can not be undefined");if(t.length!==n.length)throw new TypeError("inputRange ("+t.length+" values provided) and outputRange ("+n.length+" values provided) must have the same length");const o=n.map(i=>ok(i));return ik(e,t,o,r)},Gm=({easing:e,forceSpringAllowTail:t})=>{switch(e.type){case"linear":return ul.linear;case"spring":return ul.spring({allowTail:t??e.allowTail??void 0,damping:e.damping,durationRestThreshold:e.durationRestThreshold??void 0,mass:e.mass,overshootClamping:e.overshootClamping,stiffness:e.stiffness});case"bezier":return R0(e.x1,e.y1,e.x2,e.y2);default:throw new TypeError(`Unsupported easing: ${JSON.stringify(e)}`)}},Cs=({frame:e,forceSpringAllowTail:t,status:n})=>{const{keyframes:r,easing:o,clamping:i,interpolationFunction:s}=n;if(r.length===0)return null;const a=[...r].sort((f,p)=>f.frame-p.frame),l=a.map(f=>f.frame),u=a.map(f=>f.value);if(s==="interpolateColors"){if(!u.every(f=>typeof f=="string"))return null;if(r.length===1)return u[0];try{return sk(e,l,u,{easing:o.map(f=>Gm({easing:f,forceSpringAllowTail:t})),posterize:n.posterize})}catch{return null}}if(s!=="interpolate")return null;try{return ri(e,l,u,{easing:o.map(f=>Gm({easing:f,forceSpringAllowTail:t})),extrapolateLeft:i.left,extrapolateRight:i.right,output:n.output,posterize:n.posterize})}catch{return null}},Kl=({dragOverrideValue:e,frame:t})=>{if(e===void 0)return{type:"none"};if(e.type==="static")return{type:"resolved",value:e.value};if(t===null)return{type:"none"};const n=Cs({forceSpringAllowTail:null,frame:t,status:e.status});return n===null?{type:"none"}:{type:"resolved",value:n}},N0=({propStatus:e,dragOverrideValue:t,defaultValue:n,frame:r=null,shouldResortToDefaultValueIfUndefined:o=!1})=>{const i=Kl({dragOverrideValue:t,frame:r});return i.type==="resolved"&&i.value!==void 0?i.value:e.status==="keyframed"?r!==null?Cs({forceSpringAllowTail:null,frame:r,status:e}):o?n:void 0:e.codeValue===void 0&&o?n:e.codeValue},Bf=c.createContext({overrideIdToNodePathMappings:{}}),ak=c.createContext({setOverrideIdToNodePath:()=>{throw new Error("OverrideIdsToNodePathsSettersContext not initialized")}}),lk=({descriptor:e,propStatusOverrides:t,dragOverrides:n,frame:r})=>{if(!t&&!n)return{params:e.params,effectKey:e.effectKey};const o={...e.params};if(t)for(const[i,s]of Object.entries(t))s!==void 0&&(o[i]=s);if(n)for(const[i,s]of Object.entries(n)){const a=Kl({dragOverrideValue:s,frame:r});a.type==="resolved"&&(o[i]=a.value)}return{params:o,effectKey:e.definition.calculateKey(o)}},uk=(e,t)=>{if(!e)return null;const n={};let r=!1;for(const[o,i]of Object.entries(e)){if(i.status==="static"){n[o]=i.codeValue,r=!0;continue}if(i.status==="keyframed"){const s=Cs({forceSpringAllowTail:null,frame:t,status:i});s!==null&&(n[o]=s,r=!0)}}return r?n:null},Is=e=>{const t=c.useRef(null),n=e.map(i=>i.definition),r=t.current;return r!==null&&r.length===n.length&&r.every((i,s)=>i===n[s])?r:(t.current=n,n)},L0=({propStatuses:e,nodePath:t,effectIndex:n})=>{const r=e[An(t)];if(!r)return{type:"cannot-update-sequence",reason:"not-found"};if(!r.canUpdate)return{type:"cannot-update-sequence",reason:r.reason};const o=r.effects.find(i=>i.effectIndex===n);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"}},z0=(e,t)=>{const n=e[An(t)];if(n&&n.canUpdate)return n.props},Ts=({effects:e,overrideId:t})=>{const n=c.useRef(null),{propStatuses:r}=c.useContext(Hl),{getEffectDragOverrides:o}=c.useContext(Zl),i=ct(),{overrideIdToNodePathMappings:s}=c.useContext(Bf),a=n.current,l=t?s[t]??null:null,u=e.map((m,h)=>{if(l===null)return{descriptor:m,params:m.params,effectKey:m.effectKey};const y=L0({propStatuses:r,nodePath:l,effectIndex:h}),g=y.type==="can-update-effect"?uk(y.props,i):null,E=o(l,h),v=Object.keys(E).length===0?null:E,{params:w,effectKey:x}=lk({descriptor:m,propStatusOverrides:g,dragOverrides:v,frame:i});return{descriptor:m,params:w,effectKey:x}});if(a!==null&&a.length===u.length&&a.every((m,h)=>m.definition===u[h].descriptor.definition&&m.effectKey===u[h].effectKey))return a;const p=u.map(({descriptor:m,params:h,effectKey:y})=>({definition:m.definition,effectKey:y,params:h,memoized:!0}));return n.current=p,p},Wf=(e,t)=>{const n={};for(const r of Object.keys(e)){const o=e[r];if(o.type!=="hidden")if(o.type==="enum"){n[r]=o;const i=t(r)??o.default,s=o.variants[i];s&&Object.assign(n,Wf(s,t))}else n[r]=o}return n},Hf=e=>{const t={},n=(r,o)=>{r in t||(t[r]=o)};for(const r of Object.keys(e)){const o=e[r];if(n(r,o),o.type==="enum")for(const i of Object.values(o.variants)){const s=Hf(i);for(const a of Object.keys(s))n(a,s[a])}}return t},D0=({schema:e,key:t,value:n})=>{const r=e[t];if(!r)throw new Error("Key "+JSON.stringify(t)+" not found in schema");if(typeof n!="string")throw new Error("Value must be a string, but is "+JSON.stringify(n));if(r.type!=="enum")throw new Error("Key "+JSON.stringify(t)+" is not an enum");if(!r.variants[n])throw new Error("Value for "+JSON.stringify(t)+" must be one of "+Object.keys(r.variants).map(a=>JSON.stringify(a)).join(", ")+", got "+JSON.stringify(n));const i=Object.keys(r.variants).filter(a=>a!==n),s=new Set;for(const a of i){const l=r.variants[a],u=Object.keys(l);for(const f of u)s.add(f)}return[...s]},qm={type:"linear"},ck=({insertedKeyframeIndex:e,easingLength:t,keyframeCount:n})=>!(e>0&&e<n-1)||t===0?null:Math.min(e-1,t-1),dk=e=>({type:"static",value:e}),fk=({status:e,frame:t,value:n})=>{const r=e.keyframes.findIndex(s=>s.frame===t),o=r===-1?[...e.keyframes,{frame:t,value:n}].sort((s,a)=>s.frame-a.frame):e.keyframes.map((s,a)=>a===r?{frame:t,value:n}:s),i=[...e.easing];if(r===-1){const s=o.findIndex(u=>u.frame===t),a=ck({insertedKeyframeIndex:s,easingLength:i.length,keyframeCount:o.length}),l=a===null?qm:i[a];i.splice(s,0,l)}for(;i.length<o.length-1;)i.push(qm);return i.length>o.length-1&&(i.length=o.length-1),{type:"keyframed",status:{...e,keyframes:o,easing:i}}},pk=e=>{if((e==null?void 0:e.type)==="static")return e.value},mk=e=>e!==null&&e.status==="keyframed",O0=(e,t)=>{if(t in e)return e[t];for(const n of Object.values(e))if(n.type==="enum")for(const r of Object.values(n.variants)){const o=O0(r,t);if(o)return o}},V0=({schema:e,currentValue:t,overrideValues:n,propStatus:r,frame:o})=>{var a;const i={},s=new Set;for(const l of Object.keys(t)){const u=(r==null?void 0:r[l])??null,f=O0(e,l);if((f==null?void 0:f.type)==="hidden")continue;let p;if(u===null)p=t[l];else if(mk(u))if((f==null?void 0:f.type)==="array"||(f==null?void 0:f.keyframable)===!1)p=t[l];else{const m=Kl({dragOverrideValue:n[l],frame:o});m.type==="resolved"?p=m.value:o!==null?p=Cs({forceSpringAllowTail:null,frame:o,status:u})??t[l]:p=t[l]}else u.status==="computed"?p=t[l]:p=N0({propStatus:u,dragOverrideValue:n[l],defaultValue:f==null?void 0:f.default,frame:o,shouldResortToDefaultValueIfUndefined:!1});(f==null?void 0:f.type)==="asset"&&typeof p=="string"&&p.startsWith(ls)&&(p=`${window.remotion_staticBase}/${p.slice(ls.length)}`),p===void 0&&s.add(l),i[l]=p}for(const l of Object.keys(n))if(((a=e[l])==null?void 0:a.type)==="enum"){const u=D0({schema:e,key:l,value:i[l]});for(const f of u)s.add(f)}return{merged:i,propsToDelete:s}},B0=(e,t)=>{const n=t.split(".");let r=e;for(const o of n){if(r==null||typeof r!="object")return;r=r[o]}return r},W0=({flatSchema:e,key:t,props:n})=>{var o;const r=B0(n,t);if(!(((o=e[t])==null?void 0:o.type)==="text-content"&&typeof r!="string"))return r},hk=(e,t,n)=>{const r={};for(const o of t)r[o]=n?W0({flatSchema:n,key:o,props:e}):B0(e,o);return r},gk=(e,t)=>Object.keys(Wf(e,n=>t[n])),vk=({flatSchema:e,props:t,valuesDotNotation:n,schemaKeys:r,propsToDelete:o})=>{var a;const i={...t};for(const l of r){const u=n[l];if(((a=e[l])==null?void 0:a.type)==="text-content"&&u===void 0)continue;const f=l.split(".");if(f.length===1){i[l]=u;continue}let p=i;for(let m=0;m<f.length-1;m++){const h=f[m];typeof p[h]=="object"&&p[h]!==null?p[h]={...p[h]}:p[h]={},p=p[h]}p[f[f.length-1]]=u}const s=new Set([...o].filter(l=>{var u;return!(((u=e[l])==null?void 0:u.type)==="text-content"&&n[l]===void 0)}));return wE(i,s),i},Qm={},Yn=({Component:e,componentName:t,componentIdentity:n,schema:r,supportsEffects:o})=>{const i=dE(r),s=Hf(i),a=Object.keys(s),l=c.forwardRef((u,f)=>{const p=Ke();if(!p.isStudio||p.isReadOnlyStudio||p.isRendering)return ne.createElement(e,{...u,controls:null,ref:f});const{propStatuses:m}=c.useContext(Hl),{getDragOverrides:h}=c.useContext(Zl),y=c.useContext(Bf),g=ct();if(u.controls)return ne.createElement(e,{...u,ref:f});const[E]=c.useState(()=>{const{stack:P}=u;if(!P)return String(Math.random());const j=Qm[P];if(j)return j;const M=String(Math.random());return Qm[P]=M,M}),v=y.overrideIdToNodePathMappings[E]??null,w=a.map(P=>W0({flatSchema:s,key:P,props:u})),x=c.useMemo(()=>hk(u,a,s),w),b=c.useMemo(()=>({schema:i,currentRuntimeValueDotNotation:x,overrideId:E,supportsEffects:o,componentIdentity:n,componentName:t}),[x,E]),{merged:S,propsToDelete:C}=c.useMemo(()=>V0({schema:i,currentValue:x,overrideValues:v===null?{}:h(v),propStatus:v===null?void 0:z0(m,v),frame:g}),[x,h,v,m,g]),k=gk(i,S),T=vk({flatSchema:s,props:u,valuesDotNotation:S,schemaKeys:k,propsToDelete:C});return ne.createElement(e,{...T,controls:b,ref:f})});return l.displayName=`withInteractivitySchema(${e.displayName||e.name||"Component"})`,l},Xu=[],yk=({from:e=0,trimBefore:t=0,freeze:n,durationInFrames:r=1/0,children:o,name:i,height:s,width:a,showInTimeline:l=!0,hidden:u=!1,controls:f,_remotionInternalEffects:p,_remotionInternalLoopDisplay:m,_remotionInternalStack:h,_remotionInternalDocumentationLink:y,_remotionInternalSingleChildComponent:g,_remotionInternalPremountDisplay:E,_remotionInternalPostmountDisplay:v,_remotionInternalIsMedia:w,outlineRef:x,...b},S)=>{const{layout:C="absolute-fill"}=b,[k]=c.useState(()=>String(Math.random())),T=c.useContext(tt),{rootId:P}=kr(),j=T?T.cumulatedFrom+T.relativeFrom:0,M=Al();if(C!=="absolute-fill"&&C!=="none")throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${C}`);if(C==="none"&&typeof b.style<"u")throw new TypeError('If layout="none", you may not pass a style. Passed: '+JSON.stringify(b.style));if(typeof r!="number")throw new TypeError(`You passed to durationInFrames an argument of type ${typeof r}, but it must be a number.`);if(r<=0)throw new TypeError(`durationInFrames must be positive, but got ${r}`);if(typeof e!="number")throw new 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 new TypeError(`The "from" prop of a sequence must be finite, but got ${e}.`);if(typeof t!="number")throw new TypeError(`You passed to the "trimBefore" prop of your <Sequence> an argument of type ${typeof t}, but it must be a number.`);if(t<0)throw new TypeError(`The "trimBefore" prop of <Sequence /> must be greater than or equal to 0, but got ${t}.`);if(Number.isNaN(t))throw new TypeError('The "trimBefore" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(t))throw new TypeError(`The "trimBefore" prop of <Sequence /> must be finite, but it is ${t}.`);if(typeof n<"u"&&n!==null){if(typeof n!="number")throw new TypeError(`The "freeze" prop of <Sequence /> must be a number, but is of type ${typeof n}.`);if(Number.isNaN(n))throw new TypeError('The "freeze" prop of <Sequence /> must be a real number, but it is NaN.');if(!Number.isFinite(n))throw new TypeError(`The "freeze" prop of <Sequence /> must be finite, but it is ${n}.`)}const D=Cr(),N=qe(),L=e-t,H=((T==null?void 0:T.absoluteFrom)??0)+L,O=T?Math.min(T.durationInFrames-L,r):r,R=Math.max(0,Math.min(N.durationInFrames-e,O)),{registerSequence:I,unregisterSequence:_}=c.useContext(ni),F=c.useRef(null),z=b.layout==="none"?x??null:x??F,B=c.useMemo(()=>(T==null?void 0:T.premounting)||!!b._remotionInternalIsPremounting,[b._remotionInternalIsPremounting,T==null?void 0:T.premounting]),Y=c.useMemo(()=>(T==null?void 0:T.postmounting)||!!b._remotionInternalIsPostmounting,[b._remotionInternalIsPostmounting,T==null?void 0:T.postmounting]),$=j+L,A=T?T.cumulatedFrom+T.relativeFrom:0,X=T?A-T.cumulatedNegativeFrom:0,Z=Math.max(0,X,$),V=$-Z,U=c.useMemo(()=>({absoluteFrom:H,cumulatedFrom:j,relativeFrom:L,cumulatedNegativeFrom:V,durationInFrames:R,parentFrom:(T==null?void 0:T.relativeFrom)??0,id:k,height:s??(T==null?void 0:T.height)??null,width:a??(T==null?void 0:T.width)??null,premounting:B,postmounting:Y,premountDisplay:E??null,postmountDisplay:v??null}),[j,H,L,R,T,k,s,a,B,Y,E,v,V]),se=c.useMemo(()=>i??"",[i]),de=y??"https://www.remotion.dev/docs/sequence",ae=Ke(),te=c.useContext(Yl),J=(b==null?void 0:b.stack)??null,Q=c.useRef(null);Q.current=h??J;const G=typeof n=="number"?n:null,fe=t===0?null:t,Ee=(T==null?void 0:T.cumulatedNegativeFrom)??0,$e=w&&w.type!=="image"?w.data.startMediaFrom+Ee-V:null,Fe=w&&w.type!=="image"?w.data.startMediaFrom+Ee:null,Ie=w&&w.type!=="image"&&Fe!==null?G===null?null:Fe+(m?G%m.durationInFrames:G)*w.data.playbackRate:null;c.useEffect(()=>{if(ae.isStudio)return w?(w.type==="image"?I({type:"image",controls:f??null,effects:p??Xu,displayName:se,documentationLink:de,duration:R,from:e,trimBefore:fe,id:k,loopDisplay:m,nonce:M.get(),parent:(T==null?void 0:T.id)??null,postmountDisplay:v??null,premountDisplay:E??null,rootId:P,showInTimeline:l,src:w.src,getStack:()=>Q.current,refForOutline:z??null,isInsideSeries:te,frozenFrame:G,singleChildComponent:g??null}):I({type:w.type,controls:f??null,effects:p??Xu,displayName:se,documentationLink:de,doesVolumeChange:w.data.doesVolumeChange,duration:R,from:e,trimBefore:fe,id:k,loopDisplay:m,nonce:M.get(),parent:(T==null?void 0:T.id)??null,playbackRate:w.data.playbackRate,postmountDisplay:v??null,premountDisplay:E??null,rootId:P,showInTimeline:l,src:w.data.src,getStack:()=>Q.current,startMediaFrom:$e??w.data.startMediaFrom,mediaFrameAtSequenceZero:Fe,volume:w.data.volumes,refForOutline:z??null,isInsideSeries:te,frozenFrame:G,frozenMediaFrame:Ie,singleChildComponent:g??null}),()=>{_(k)}):(I({from:e,trimBefore:fe,duration:R,id:k,displayName:se,documentationLink:de,parent:(T==null?void 0:T.id)??null,type:"sequence",rootId:P,showInTimeline:l,nonce:M.get(),loopDisplay:m,getStack:()=>Q.current,premountDisplay:E??null,postmountDisplay:v??null,controls:f??null,effects:p??Xu,refForOutline:z??null,isInsideSeries:te,frozenFrame:G,singleChildComponent:g??null}),()=>{_(k)})},[r,k,i,I,se,_,T==null?void 0:T.id,R,P,e,t,fe,l,M,m,E,v,ae.isStudio,f,p,w,de,z,te,G,$e,Fe,Ie,g]);const he=Math.ceil(j+e+r-1),we=D<j+e||D>he?null:o,_e=we===null||typeof n>"u"||n===null?we:d.jsx(Ss,{frame:n,children:we}),ge=b.layout==="none"?void 0:b.style,ke=c.useCallback(At=>{F.current=At,typeof S=="function"?S(At):S&&(S.current=At)},[S]),ft=c.useMemo(()=>({flexDirection:void 0,...a?{width:a}:{},...s?{height:s}:{},...ge??{}}),[s,ge,a]);if(S!==null&&C==="none")throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');return u?null:d.jsx(tt.Provider,{value:U,children:_e===null?null:b.layout==="none"?_e:d.jsx(hn,{ref:ke,style:ft,className:b.className,children:_e})})},wk=c.forwardRef(yk),xk=(e,t)=>{if(e.layout==="none")throw new Error('`<Sequence>` with `premountFor` and `postmountFor` props does not support layout="none"');const{style:n,from:r=0,durationInFrames:o=1/0,premountFor:i=0,postmountFor:s=0,styleWhilePremounted:a,styleWhilePostmounted:l,...u}=e,{freezeFrame:f,isPremountingOrPostmounting:p,postmountingActive:m,premountingActive:h,premountingStyle:y}=ks({from:r,durationInFrames:o,premountFor:i,postmountFor:s,style:n??null,styleWhilePremounted:a??null,styleWhilePostmounted:l??null,hideWhilePremounted:"opacity"});return d.jsx(Ss,{frame:f,active:p,children:d.jsx(Xl,{ref:t,from:r,durationInFrames:o,style:y??void 0,_remotionInternalPremountDisplay:i,_remotionInternalPostmountDisplay:s,_remotionInternalIsPremounting:h,_remotionInternalIsPostmounting:m,...u})})},bk=c.forwardRef(xk),Sk=(e,t)=>{const n=Ke(),{fps:r}=qe();if(e.layout!=="none"&&!n.isRendering){const o=e.premountFor;if(o||e.postmountFor)return d.jsx(bk,{ref:t,...e,premountFor:o})}return d.jsx(wk,{...e,ref:t})},Xl=c.forwardRef(Sk),H0=Xl,dt=Yn({Component:Xl,componentName:"<Sequence>",componentIdentity:"dev.remotion.remotion.Sequence",schema:Zo,supportsEffects:!1});Yn({Component:Xl,componentName:"<Sequence>",componentIdentity:null,schema:pE,supportsEffects:!1});var U0=(e,t,n)=>{switch(e){case"fill":return[0,0,t.width,t.height,0,0,n.width,n.height];case"contain":{const r=Math.min(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}case"cover":{const r=Math.max(n.width/t.width,n.height/t.height),o=(n.width-t.width*r)/2,i=(n.height-t.height*r)/2;return[0,0,t.width,t.height,o,i,t.width*r,t.height*r]}default:throw new Error("Unknown fit: "+e)}},Ek="https://remotion.dev/docs/troubleshooting/webgl2-context",Z0=(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 ${Ek}`,kk=e=>new Error(Z0("WebGL",e)),Y0=e=>new Error(Z0("WebGL2",e));class Ck{constructor(t,n){Se(this,"width");Se(this,"height");Se(this,"pairs",new Map);Se(this,"lostContexts",new Set);this.width=t,this.height=n}getPair(t){const n=this.pairs.get(t);if(n)return n;const r=[this.allocateCanvas(t),this.allocateCanvas(t)];return this.pairs.set(t,r),r}assertContextNotLost(t){if(this.lostContexts.has(t))throw new 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(t){const n=document.createElement("canvas");switch(n.width=this.width,n.height=this.height,t){case"2d":{if(!n.getContext("2d",{colorSpace:"srgb"}))throw new Error("Failed to acquire 2D context for canvas effect");return n}case"webgl2":{const r=n.getContext("webgl2",{premultipliedAlpha:!0,alpha:!0,preserveDrawingBuffer:!0});if(!r)throw Y0("canvas effect");return n.addEventListener("webglcontextlost",o=>{o.preventDefault(),this.lostContexts.add(n)}),n.addEventListener("webglcontextrestored",()=>{this.lostContexts.delete(n)}),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n}case"webgpu":{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment for canvas effect");return n}default:{const r=t;throw new Error(`Unknown effect backend: ${r}`)}}}}var Ik=e=>{const t=[];let n=[],r=null;for(const o of e){const{backend:i}=o.definition;r===null||i===r?(n.push(o),r=i):(t.push({backend:r,effects:n}),n=[o],r=i)}return r!==null&&n.length>0&&t.push({backend:r,effects:n}),t},oa=null,Tk=()=>oa||(oa=(async()=>{if(typeof navigator>"u"||!("gpu"in navigator))throw new Error("WebGPU is not available in this environment");const{gpu:e}=navigator,t=await e.requestAdapter();if(!t)throw new Error("No WebGPU adapter available");return t.requestDevice()})(),oa),K0=(e,t)=>({pool:new Ck(e,t),setupCache:new WeakMap,cleanupRegistry:[],currentRunId:0}),yd=e=>{e.currentRunId++;for(const t of e.cleanupRegistry)t.definition.cleanup(t.state)},Rk=(e,t,n)=>{const r=t;let o=e.setupCache.get(r);if(o||(o=new WeakMap,e.setupCache.set(r,o)),o.has(n))return o.get(n);const i=t.setup(n);return o.set(n,i),e.cleanupRegistry.push({definition:r,state:i}),i},Rs=async({state:e,source:t,effects:n,output:r,width:o,height:i})=>{const s=++e.currentRunId,a=()=>e.currentRunId!==s,l=n.filter(E=>!E.params.disabled),u=Ik(l);let f=t,p=null;if(u.length===0){if(t===r)return!0;const E=r.getContext("2d");if(!E)throw new Error("Failed to acquire 2D context for output canvas");return E.clearRect(0,0,o,i),E.drawImage(f,0,0,o,i),!0}let m=!1;for(const E of u)if(E.backend==="webgpu"){m=!0;break}const h=m?await Tk():null;if(a())return!1;let y=!0;for(let E=0;E<u.length;E++){const v=u[E],[w,x]=e.pool.getPair(v.backend);let b=w;for(const C of v.effects){const k=C.definition,T=Rk(e,k,b);k.apply({source:f,target:b,state:T,params:C.params,width:o,height:i,gpuDevice:h,flipSourceY:v.backend==="webgl2"?y:!1}),v.backend==="webgl2"&&(y=!0,e.pool.assertContextNotLost(b)),f=b,b=b===w?x:w}p=f??p;const S=u[E+1];if(S&&S.backend!==v.backend&&p)if(v.backend==="2d"&&S.backend==="webgl2")f=p,y=!0;else{const C=await createImageBitmap(p);if(a())return C.close(),!1;f=C,S.backend==="webgl2"&&(y=!1)}}if(!p)return!0;const g=r.getContext("2d");if(!g)throw new Error("Failed to acquire 2D context for output canvas");return g.clearRect(0,0,o,i),g.drawImage(p,0,0,o,i),!0},_s=()=>{const e=c.useRef(null),t=c.useRef(null);return c.useEffect(()=>()=>{e.current&&yd(e.current)},[]),c.useMemo(()=>({get:(n,r)=>((!t.current||t.current.width!==n||t.current.height!==r)&&(e.current&&yd(e.current),e.current=K0(n,r),t.current={width:n,height:r}),e.current)}),[])},_k=({width:e,height:t,fit:n,className:r,style:o,effects:i,...s},a)=>{const l=c.useRef(null),u=_s(),f=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),p=c.useCallback(m=>{const h=l.current,y=e??m.displayWidth,g=t??m.displayHeight;if(!h)throw new Error("Canvas ref is not set");if(!f)throw new Error("Source canvas is not available");f.width=y,f.height=g;const E=f.getContext("2d");if(!E)throw new Error("Could not get 2d context for source canvas");return E.drawImage(m,...U0(n,{height:m.displayHeight,width:m.displayWidth},{width:y,height:g})),h.width=y,h.height=g,Rs({state:u.get(y,g),source:f,effects:i,output:h,width:y,height:g})},[u,i,n,t,f,e]);return c.useImperativeHandle(a,()=>({draw:p,getCanvas:()=>{if(!l.current)throw new Error("Canvas ref is not set");return l.current},clear:()=>{var h;const m=(h=l.current)==null?void 0:h.getContext("2d");if(!m)throw new Error("Could not get 2d context");m.clearRect(0,0,l.current.width,l.current.height)}}),[p]),d.jsx("canvas",{ref:l,className:r,style:o,...s})},Pk=ne.forwardRef(_k),X0=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{if(typeof ImageDecoder>"u")throw new Error("Your browser does not support the WebCodecs ImageDecoder API.");const o=await fetch(e,{...n,signal:t}),{body:i}=o;if(!i)throw new Error("Got no body");const s=new ImageDecoder({data:i,type:r??o.headers.get("Content-Type")??"image/gif"});await Promise.all([s.completed,s.tracks.ready]);const{selectedTrack:a}=s.tracks;if(!a)throw s.close(),new Error("No selected track");return{decoder:s,selectedTrack:a}},Fk=5,Jm=({loopBehavior:e,durationFound:t,timeInSec:n})=>e==="loop"?t?n%t:n:Math.min(n,t||1/0),jk=async({resolvedSrc:e,signal:t,requestInit:n,currentTime:r,initialLoopBehavior:o})=>{const{decoder:i,selectedTrack:s}=await X0({resolvedSrc:e,signal:t,requestInit:n,contentType:null}),a=[];let l=null;const u=async h=>{const y=a.find(E=>E.frameIndex===h);if(y&&y.frame)return y;const g=await i.decode({frameIndex:h,completeFramesOnly:!0});return y?y.frame=g.image:a.push({frame:g.image,frameIndex:h,timeInSeconds:g.image.timestamp/1e6}),{frame:g.image,frameIndex:h,timeInSeconds:g.image.timestamp/1e6}},f=h=>{const g=a.filter(E=>E.frame).sort((E,v)=>{const w=Math.abs(E.timeInSeconds-h),x=Math.abs(v.timeInSeconds-h);return w-x});for(let E=0;E<g.length;E++){if(E<Fk)continue;const v=g[E];v.frame=null}},p=async({timeInSec:h,loopBehavior:y})=>{const g=Jm({durationFound:l,loopBehavior:y,timeInSec:h}),v=a.filter(x=>x.timeInSeconds<=g).map(x=>x.frameIndex).reduce((x,b)=>Math.max(x,b),0);let w=v;for(;;){const x=await u(w);if(w++,!x.frame)throw new Error("No frame found");if(!x.frame.duration||(w===s.frameCount&&l===null&&(l=(x.frame.timestamp+x.frame.duration)/1e6),x.timeInSeconds>g||w===s.frameCount))break}s.frameCount-v<3&&y==="loop"&&await u(0),f(g)};return await p({timeInSec:r,loopBehavior:o}),await p({timeInSec:r,loopBehavior:o}),{close:()=>{var h;for(const y of a)(h=y.frame)==null||h.close(),y.frame=null;i.close()},getFrame:async(h,y)=>{if(l!==null&&h>l&&y==="clear-after-finish")return null;const g=Jm({loopBehavior:y,durationFound:l,timeInSec:h});await p({timeInSec:g,loopBehavior:y});const v=a.filter(w=>w.frame).reduce((w,x)=>{const b=Math.abs(w.timeInSeconds-g),S=Math.abs(x.timeInSeconds-g);return b<S?w:x});if(!v.frame)throw new Error("No frame found");return v},frameCount:s.frameCount}},Mk=({frame:e,playbackRate:t,fps:n})=>e*t/n,$k=e=>{if(!e)return null;const t={...e};delete t.signal;const{headers:n,...r}=t;return JSON.stringify({...r,headers:n?Array.from(new Headers(n).entries()):null})},Ak=e=>typeof window>"u"?e:new URL(e,window.origin).href,Nk={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Zn,...ti,playbackRate:{type:"number",min:0,max:10,step:.1,default:1,description:"Playback rate",hiddenFromList:!1,keyframable:!1},..._n,...Tr,...Ir},Lk=e=>{const t={},n=t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(r.startsWith("data-")||r.startsWith("aria-"))&&(n[r]=e[r]);return t},G0=c.forwardRef(({src:e,width:t,height:n,onError:r,loopBehavior:o="loop",playbackRate:i=1,fit:s="fill",requestInit:a,effects:l,controls:u,...f},p)=>{const m=Ak(e),[h,y]=c.useState(null),{delayRender:g,continueRender:E}=gn(),[v]=c.useState(()=>g(`Rendering <AnimatedImage/> with src="${m}"`)),w=ct(),{fps:x}=qe(),b=Mk({frame:w,playbackRate:i,fps:x}),S=c.useRef(b);S.current=b;const C=$k(a),k=c.useRef(a);k.current=a;const T=c.useRef(null),P=Ts({effects:l,overrideId:(u==null?void 0:u.overrideId)??null});c.useImperativeHandle(p,()=>{var D;const M=(D=T.current)==null?void 0:D.getCanvas();if(!M)throw new Error("Canvas ref is not set");return M},[]);const[j]=c.useState(()=>o);return c.useEffect(()=>{const M=new AbortController;let D=!1,N=!1;const L=()=>{N||(N=!0,E(v))};return jk({resolvedSrc:m,signal:M.signal,requestInit:k.current,currentTime:S.current,initialLoopBehavior:j}).then(H=>{if(D){H.close();return}y(H),L()}).catch(H=>{if(!D){if(H.name==="AbortError"){L();return}r?(r==null||r(H),L()):us(H)}}),()=>{D=!0,M.abort(),L()}},[m,v,r,C,j,E]),c.useEffect(()=>()=>{h==null||h.close()},[h]),c.useLayoutEffect(()=>{if(!h)return;const M=g(`Rendering frame at ${b} of <AnimatedImage src="${e}"/>`);let D=!1;return h.getFrame(b,o).then(async N=>{var H,O;if(D)return;if(N===null){(H=T.current)==null||H.clear(),E(M);return}await((O=T.current)==null?void 0:O.draw(N.frame))&&!D&&E(M)}).catch(N=>{D||(r?(r(N),E(M)):us(N))}),()=>{D=!0,E(M)}},[b,h,o,r,e,E,g,P,s,t,n]),d.jsx(Pk,{ref:T,width:t,height:n,fit:s,effects:P,...f})});G0.displayName="AnimatedImageContent";var zk=({src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:u,durationInFrames:f,from:p,premountFor:m,postmountFor:h,styleWhilePremounted:y,styleWhilePostmounted:g,requestInit:E,effects:v=[],controls:w,ref:x,...b})=>{const S=c.useRef(null),C=Is(v);c.useImperativeHandle(x,()=>S.current,[]);const{effectivePostmountFor:k,effectivePremountFor:T,freezeFrame:P,isPremountingOrPostmounting:j,postmountingActive:M,premountingActive:D,premountingStyle:N}=ks({from:p??0,durationInFrames:f??1/0,premountFor:m??null,postmountFor:h??null,style:u??null,styleWhilePremounted:y??null,styleWhilePostmounted:g??null,hideWhilePremounted:"display-none"}),L=Lk(b),H={src:e,width:t,height:n,onError:r,fit:o,playbackRate:i,loopBehavior:s,id:a,className:l,style:N??void 0,requestInit:E,...L};return d.jsx(Ss,{frame:P,active:j,children:d.jsx(dt,{layout:"none",from:p??0,durationInFrames:f??1/0,name:"<AnimatedImage>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/animatedimage",controls:w,_remotionInternalEffects:C,_remotionInternalPremountDisplay:T||null,_remotionInternalPostmountDisplay:k||null,_remotionInternalIsPremounting:D,_remotionInternalIsPostmounting:M,...b,outlineRef:S,children:d.jsx(G0,{...H,ref:S,effects:v,controls:w})})})},q0=Yn({Component:zk,componentName:"<AnimatedImage>",componentIdentity:"dev.remotion.remotion.AnimatedImage",schema:Nk,supportsEffects:!0});q0.displayName="AnimatedImage";kt(q0);var Dk={type:"boolean",default:!1,description:"Disabled"},Ok=e=>{const{calculateKey:t,validateParams:n}=e,r={...e,documentationLink:e.documentationLink??null,calculateKey:i=>{const s=i.disabled??!1;return`${t(i)}-disabled-${s}`},schema:{disabled:Dk,...e.schema}};return(i={})=>(n(i),{definition:r,params:i,effectKey:r.calculateKey(i),memoized:!1})},Vk=e=>{if(typeof e!="string")throw new TypeError(`The "filename" must be a string, but you passed a value of type ${typeof e}`);if(e.trim()==="")throw new Error("The `filename` must not be empty");if(!e.match(/^([0-9a-zA-Z-!_.*'()/:&$@=;+,?]+)/g))throw new Error('The `filename` must match "/^([0-9a-zA-Z-!_.*\'()/:&$@=;+,?]+)/g". Use forward slashes only, even on Windows.')},Bk=e=>{if(typeof e!="string"&&!(e instanceof Uint8Array))throw new TypeError(`The "content" must be a string or Uint8Array, but you passed a value of type ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new Error("The `content` must not be empty")},Q0=e=>{e.type==="artifact"&&(Vk(e.filename),e.contentType!=="thumbnail"&&Bk(e.content))},qr=c.createContext({registerRenderAsset:()=>{},unregisterRenderAsset:()=>{},renderAssets:[]}),Wk=({children:e,collectAssets:t})=>{const[n,r]=c.useState([]),o=c.useRef([]),i=c.useCallback(l=>{Q0(l),o.current=[...o.current,l],r(o.current)},[]);t&&c.useImperativeHandle(t,()=>({collectAssets:()=>{const l=o.current;return o.current=[],r([]),l}}),[]);const s=c.useCallback(l=>{o.current=o.current.filter(u=>u.id!==l),r(o.current)},[]);c.useLayoutEffect(()=>{typeof window<"u"&&(window.remotion_collectAssets=()=>{const l=o.current;return o.current=[],r([]),l})},[]);const a=c.useMemo(()=>({registerRenderAsset:i,unregisterRenderAsset:s,renderAssets:n}),[n,i,s]);return d.jsx(qr.Provider,{value:a,children:e})},Tn=e=>typeof window>"u"||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("file://")||e.startsWith("blob:")||e.startsWith("data:")?e:new URL(e,window.origin).href,Gl=({trimAfter:e,mediaDurationInFrames:t,playbackRate:n,trimBefore:r})=>{let o=t;typeof e<"u"&&(o=e),typeof r<"u"&&(o-=r);const i=o/n;return Number(i.toFixed(10))},J0=c.createContext(null),Hk=()=>ne.useContext(J0),ql=({durationInFrames:e,times:t=1/0,children:n,name:r,showInTimeline:o,...i})=>{const s=ct(),{durationInFrames:a}=qe();if(Nl(e,{component:"of the <Loop /> component",allowFloats:!0}),typeof t!="number")throw new 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 new TypeError(`The "times" prop of a loop must be an integer, but got ${t}.`);if(t<0)throw new TypeError(`The "times" prop of a loop must be at least 0, but got ${t}`);const l=Math.ceil(a/e),u=Math.min(l,t),f=i.layout==="none"?void 0:i.style,p=e*(u-1),h=Math.floor(s/e)*e,y=Math.min(h,p),g=c.useMemo(()=>({numberOfTimes:Math.min(a/e,t),startOffset:-y,durationInFrames:e}),[a,e,y,t]),E=c.useMemo(()=>({iteration:Math.floor(s/e),durationInFrames:e}),[s,e]);return d.jsx(J0.Provider,{value:E,children:d.jsx(dt,{durationInFrames:e,from:y,name:r??"<Loop>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/loop",_remotionInternalLoopDisplay:g,layout:i.layout,style:f,showInTimeline:o,children:n})})};ql.useLoop=Hk;var yt=({logLevel:e,tag:t,message:n,mountTime:r})=>{const o=[r?Date.now()-r+"ms ":null,t].filter(Boolean).join(" ");ot.trace({logLevel:e,tag:null},`[${o}]`,n)},Ql=c.createContext({}),eh={},Gu=[],ew=({children:e})=>{const[t,n]=c.useState(()=>eh);return c.useEffect(()=>{const r=()=>{n(eh)};return Gu.push(r),()=>{Gu=Gu.filter(o=>o!==r)}},[]),d.jsx(Ql.Provider,{value:t,children:e})},tw=e=>{const t=e.indexOf("#");return t===-1?null:t},Uk=e=>{const t=tw(e);return t===null?e:e.slice(0,t)},Qr=e=>{const t=c.useContext(Ql),n=tw(e),r=Uk(e);return t[r]?n!==null?t[r]+e.slice(n):t[r]:e},Jl=(e,t)=>{if(typeof e.volume!="number"&&typeof e.volume!="function"&&typeof e.volume<"u")throw new 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(typeof e.volume=="number"&&e.volume<0)throw new TypeError(`You have passed a volume below 0 to your <${t} /> component. Volume must be between 0 and 1`);if(typeof e.playbackRate!="number"&&typeof e.playbackRate<"u")throw new TypeError(`You have passed a playbackRate of type ${typeof e.playbackRate} to your <${t} /> component. Playback rate must a real number or undefined.`);if(typeof e.playbackRate=="number"&&(isNaN(e.playbackRate)||!Number.isFinite(e.playbackRate)||e.playbackRate<=0))throw new TypeError(`You have passed a playbackRate of ${e.playbackRate} to your <${t} /> component. Playback rate must be a real number above 0.`);if(typeof e.preservePitch!="boolean"&&typeof e.preservePitch<"u")throw new TypeError(`'preservePitch' must be a boolean or undefined but got '${typeof e.preservePitch}' instead`)},Zk=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of startFrom prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("startFrom prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`startFrom must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of endAt prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("endAt prop can not be NaN.");if(t<=0)throw new TypeError(`endAt must be a positive number, instead got ${t}.`)}if(t<e)throw new TypeError("endAt prop must be greater than startFrom prop.")},Yk=(e,t)=>{if(typeof e<"u"){if(typeof e!="number")throw new TypeError(`type of trimBefore prop must be a number, instead got type ${typeof e}.`);if(isNaN(e)||e===1/0)throw new TypeError("trimBefore prop can not be NaN or Infinity.");if(e<0)throw new TypeError(`trimBefore must be greater than equal to 0 instead got ${e}.`)}if(typeof t<"u"){if(typeof t!="number")throw new TypeError(`type of trimAfter prop must be a number, instead got type ${typeof t}.`);if(isNaN(t))throw new TypeError("trimAfter prop can not be NaN.");if(t<=0)throw new TypeError(`trimAfter must be a positive number, instead got ${t}.`)}if(t<=e)throw new TypeError("trimAfter prop must be greater than trimBefore prop.")},eu=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>{if(typeof e<"u"&&typeof n<"u")throw new TypeError("Cannot use both startFrom and trimBefore props. Use trimBefore instead as startFrom is deprecated.");if(typeof t<"u"&&typeof r<"u")throw new TypeError("Cannot use both endAt and trimAfter props. Use trimAfter instead as endAt is deprecated.");typeof n<"u"||typeof r<"u"?Yk(n,r):(typeof e<"u"||typeof t<"u")&&Zk(e,t)},tu=({startFrom:e,endAt:t,trimBefore:n,trimAfter:r})=>({trimBeforeValue:n??e??void 0,trimAfterValue:r??t??void 0}),Kk=(e,t)=>{switch(t.type){case"got-duration":{const n=Tn(t.src);return e[n]===t.durationInSeconds?e:{...e,[n]:t.durationInSeconds}}default:return e}},Uf=c.createContext({durations:{},setDurations:()=>{throw new Error("context missing")}}),nw=({children:e})=>{const[t,n]=c.useReducer(Kk,{}),r=c.useMemo(()=>({durations:t,setDurations:n}),[t]);return d.jsx(Uf.Provider,{value:r,children:e})},Zf=({crossOrigin:e,requestsVideoFrame:t,isClientSideRendering:n})=>{if(e!=null)return e;if(n||t)return"anonymous"},cl=({mediaRef:e,mediaType:t,onAutoPlayError:n,logLevel:r,mountTime:o,reason:i,isPlayer:s})=>{const{current:a}=e;if(!a)return;yt({logLevel:r,tag:"play",message:`Attempting to play ${a.src}. Reason: ${i}`,mountTime:o});const l=a.play();l.catch&&l.catch(u=>{if(a&&!u.message.includes("request was interrupted by a call to pause")&&!u.message.includes("The operation was aborted.")&&!u.message.includes("The fetching process for the media resource was aborted by the user agent")&&!u.message.includes("request was interrupted by a new load request")&&!u.message.includes("because the media was removed from the document")&&!(u.message.includes("user didn't interact with the document")&&a.muted)&&(console.log(`Could not play ${t} due to following error: `,u),!a.muted)){if(n){n();return}t==="video"&&s&&(ot.info({logLevel:r,tag:"<"+t+">"},"The video will be muted and we'll retry playing it."),ot.info({logLevel:r,tag:"<"+t+">"},"Use onAutoPlayError() to handle this error yourself."),a.muted=!0,a.play())}})},Yf=({audioContext:e,ref:t})=>{let n=null,r=!1,o=e;return{setAudioContext:i=>{o=i},attemptToConnect:()=>{if(r)throw new Error("SharedElementSourceNode has been disposed");!n&&t.current&&o&&(n=o.createMediaElementSource(t.current))},get:()=>{if(!n)throw new Error("Audio element not connected");return n},cleanup:()=>{n&&(n.disconnect(),n=null),r=!0}}},th=!1,Xk=e=>{th||(th=!0,typeof window<"u"&&ot.warn({logLevel:e,tag:null},"AudioContext is not supported in this browser"))},Gk=({logLevel:e,latencyHint:t,audioEnabled:n,sampleRate:r})=>{const o=Ke(),i=c.useRef(r);if(r!==i.current)throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${i.current} Hz, but ${r} Hz was passed later.`);return c.useMemo(()=>{if(o.isRendering||!n)return null;if(typeof AudioContext>"u")return Xk(e),null;const a=new AudioContext({latencyHint:t,sampleRate:r}),l=a.createGain();l.connect(a.destination),ot.trace({logLevel:e,tag:"audio"},"Creating new audio context"),a.suspend();let u=null;return{audioContext:a,gainNode:l,getState:()=>{const h=a.state;return u==="running"&&h!=="running"?"suspended-to-running":u==="suspended"&&h!=="suspended"?"running-to-suspended":h},resume:()=>{u="running";const h=a.resume();return h.finally(()=>{u==="running"&&(u=null)}),h},suspend:()=>{u="suspended";const h=a.suspend();return h.finally(()=>{u==="suspended"&&(u=null)}),h}}},[e,t,o.isRendering,n,r])},qk=(e,t)=>new Promise(n=>{const r=e.currentTime,i=e.getOutputTimestamp().performanceTime,s=performance.now(),a=()=>{var p;const{currentTime:l}=e,u=e.getOutputTimestamp(),f=performance.now()-s;if(i!==void 0&&u.performanceTime!==void 0&&u.performanceTime>i&&u.contextTime!==void 0&&u.contextTime>r){ot.verbose({logLevel:t,tag:"audio"},`waitUntilActuallyResumed: getOutputTimestamp.performanceTime advanced from ${i.toFixed(6)} to ${u.performanceTime.toFixed(6)} after ${f.toFixed(1)}ms. currentTime=${l.toFixed(6)} (advanced by ${(l-r).toFixed(6)}), getOutputTimestamp.performanceTime=${((p=u.performanceTime)==null?void 0:p.toFixed(1))??"undefined"}`),n();return}requestAnimationFrame(a)};requestAnimationFrame(a)}),qu="data:audio/mp3;base64,/+MYxAAJcAV8AAgAABn//////+/gQ5BAMA+D4Pg+BAQBAEAwD4Pg+D4EBAEAQDAPg++hYBH///hUFQVBUFREDQNHmf///////+MYxBUGkAGIMAAAAP/29Xt6lUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV/+MYxDUAAANIAAAAAFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV",Qk=(e,t)=>{const n=Object.keys(e).sort(),r=Object.keys(t).sort();if(n.length!==r.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==r[o]||e[n[o]]!==t[r[o]])return!1;return!0},Jk=(e,t,n)=>e==="src"&&!n.startsWith("data:")&&!t.startsWith("data:")?new URL(n,window.origin).toString()!==new URL(t,window.origin).toString():n!==t,oi=c.createContext(null),nu=c.createContext(null),eC=e=>{if(e==="suspended"||e==="running-to-suspended"||e==="interrupted")return!0;if(e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},rw=({children:e,audioLatencyHint:t,audioEnabled:n,previewSampleRate:r})=>{const o=Rn(),i=r??48e3;c.useEffect(()=>{typeof window>"u"||(window.remotion_sampleRate=i)},[i]);const s=Gk({logLevel:o,latencyHint:t,audioEnabled:n,sampleRate:i}),a=c.useRef(!1),l=c.useRef(null),u=c.useMemo(()=>({value:0}),[]),f=c.useRef([]),p=c.useMemo(()=>({dispatch:b=>{f.current.forEach(S=>S(b))},subscribe:b=>(f.current.push(b),{remove:()=>{f.current=f.current.filter(S=>S!==b)}})}),[]),m=c.useRef({scheduledEndTime:null,mediaEndTime:null}),h=c.useRef(new Map),y=c.useCallback(b=>{h.current.delete(b)},[]),g=c.useMemo(()=>({node:b,mediaTimestamp:S,sourceOffset:C,scheduledTime:k,duration:T,offset:P,originalUnloopedMediaTimestamp:j})=>{if(!s)throw new Error("Audio context not found");const M=s.getState();if(M==="closed")return{type:"not-started",reason:"audio context is closed"};const D=eC(M);T>0&&(D?h.current.set(b,{scheduledTime:k,offset:P,duration:T}):b.start(k,P,T));const N=k+T/b.playbackRate.value,L=S+P-C,H=L+T,O=s.audioContext.baseLatency+s.audioContext.outputLatency,R=k-s.audioContext.currentTime,I=m.current,_=I.scheduledEndTime!==null&&Math.abs(k-I.scheduledEndTime)>.001,F=I.mediaEndTime!==null&&Math.abs(L-I.mediaEndTime)>.001;return ot.verbose({logLevel:o,tag:"audio-scheduling"},"scheduled %c%s%c %s %c%s%c %s %c%s%c %s %s %s %s %s",_?"color: red; font-weight: bold":"",k.toFixed(4),"",N.toFixed(4),F?"color: red; font-weight: bold":"",L.toFixed(4),"",H.toFixed(4),T<0||R<0?"color: red; font-weight: bold":"color: blue; font-weight: bold",T<0?"missed "+Math.abs(P).toFixed(2)+"s":Math.abs(R).toFixed(2)+(R<0?" delay":" ahead"),"","current="+s.audioContext.currentTime.toFixed(4),"offset="+P.toFixed(4),"latency="+O.toFixed(4),"state="+s.audioContext.state,j!==L?"original_ts="+j.toFixed(4):"","action="+(D?"schedule":"start"),""),I.scheduledEndTime=N,I.mediaEndTime=H,T>0?{type:"started",scheduledTime:k}:{type:"not-started",reason:"missed "+Math.abs(P).toFixed(2)+"s"}},[s,o]),E=c.useCallback(()=>{if(!s||a.current)return Promise.resolve();a.current=!0,s.gainNode.gain.cancelScheduledValues(s.audioContext.currentTime),s.gainNode.gain.setValueAtTime(0,s.audioContext.currentTime),s.gainNode.gain.linearRampToValueAtTime(1,s.audioContext.currentTime+.03),h.current.forEach((S,C)=>{C.start(S.scheduledTime,S.offset,S.duration)}),h.current.clear();const b=s.resume();return l.current=new Promise(S=>{qk(s.audioContext,o).then(S),b.catch(C=>{ot.warn({logLevel:o,tag:"audio"},"AudioContext resume rejected, continuing without audio sync",C),S()})}).finally(()=>{l.current=null}),b.catch(()=>{})},[s,o]),v=c.useCallback(()=>l.current,[]),w=c.useCallback(()=>!s||!a.current?Promise.resolve():(a.current=!1,s.suspend()),[s]),x=c.useMemo(()=>({audioContext:(s==null?void 0:s.audioContext)??null,getAudioContextState:()=>(s==null?void 0:s.getState())??null,gainNode:(s==null?void 0:s.gainNode)??null,audioSyncAnchor:u,audioSyncAnchorEmitter:p,scheduleAudioNode:g,resume:E,suspend:w,getIsResumingAudioContext:v,unscheduleAudioNode:y}),[s,u,p,g,E,w,v,y]);return d.jsx(oi.Provider,{value:x,children:e})},ow=({children:e,numberOfAudioTags:t})=>{const n=c.useRef([]),[r]=c.useState(t);if(t!==r)throw new Error("The number of shared audio tags has changed dynamically. Once you have set this property, you cannot change it afterwards.");const o=Rn(),i=bs(),s=Ke(),a=c.useContext(oi),l=(a==null?void 0:a.audioContext)??null,u=a==null?void 0:a.resume,[f]=c.useState(()=>new Array(t).fill(!0).map(()=>{const b=c.createRef();return{id:Math.random(),ref:b,mediaElementSourceNode:Yf({audioContext:l,ref:b})}}));for(const{mediaElementSourceNode:b}of f)b==null||b.setAudioContext(l);(ne.useInsertionEffect??ne.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{f.forEach(({mediaElementSourceNode:b})=>{b==null||b.cleanup()})})},[f]);const m=c.useRef(new Array(t).fill(!1)),h=c.useCallback(()=>{f.forEach(({ref:b,id:S})=>{var T;const C=(T=n.current)==null?void 0:T.find(P=>P.id===S),{current:k}=b;if(k){if(C===void 0){k.src!==qu&&(k.src=qu);return}if(!C)throw new TypeError("Expected audio data to be there");Object.keys(C.props).forEach(P=>{Jk(P,C.props[P],k[P])&&(k[P]=C.props[P])})}})},[f]),y=c.useCallback(b=>{var O,R;const{aud:S,audioId:C,premounting:k,postmounting:T}=b,P=(O=n.current)==null?void 0:O.find(I=>I.audioId===C);if(P)return P;const j=m.current.findIndex(I=>I===!1);if(j===-1)throw new 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.`);const{id:M,ref:D,mediaElementSourceNode:N}=f[j],L=[...m.current];L[j]=M,m.current=L;const H={props:S,id:M,el:D,audioId:C,mediaElementSourceNode:N,premounting:k,audioMounted:!!D.current,postmounting:T,cleanupOnMediaTagUnmount:()=>{}};return(R=n.current)==null||R.push(H),h(),H},[t,f,h]),g=c.useCallback(b=>{var k;const S=[...m.current],C=f.findIndex(T=>T.id===b);if(C===-1)throw new TypeError(`Unknown audio ref ${b}; refs: ${f.map(T=>T.id).join(", ")}`);S[C]=!1,m.current=S,n.current=(k=n.current)==null?void 0:k.filter(T=>T.id!==b),h()},[f,h]),E=c.useCallback(({aud:b,audioId:S,id:C,premounting:k,postmounting:T})=>{var j;let P=!1;n.current=(j=n.current)==null?void 0:j.map(M=>{const D=!!M.el.current;return M.audioMounted!==D&&(P=!0),M.id===C?Qk(b,M.props)&&M.premounting===k&&M.postmounting===T?M.audioMounted===D?M:{...M,audioMounted:D}:(P=!0,{...M,props:b,premounting:k,postmounting:T,audioId:S,audioMounted:D}):M.audioMounted===D?M:{...M,audioMounted:D}}),P&&h()},[h]),v=c.useCallback(()=>{f.forEach(b=>{const S=n.current.find(C=>C.el===b.ref);S!=null&&S.premounting||cl({mediaRef:b.ref,mediaType:"audio",onAutoPlayError:null,logLevel:o,mountTime:i,reason:"playing all audios",isPlayer:s.isPlayer})}),u==null||u()},[o,i,f,s.isPlayer,u]),w=c.useMemo(()=>({registerAudio:y,unregisterAudio:g,updateAudio:E,playAllAudios:v,numberOfAudioTags:t}),[t,v,y,g,E]),x=c.useMemo(()=>f.map(({id:b,ref:S})=>d.jsx("audio",{ref:S,preload:"metadata",src:qu},b)),[f]);return d.jsxs(nu.Provider,{value:w,children:[x,e]})},tC=({aud:e,audioId:t,premounting:n,postmounting:r})=>{var l;const o=c.useContext(oi),i=c.useContext(nu),[s]=c.useState(()=>{if(i&&i.numberOfAudioTags>0)return i.registerAudio({aud:e,audioId:t,premounting:n,postmounting:r});const u=ne.createRef(),f=Yf({audioContext:(o==null?void 0:o.audioContext)??null,ref:u});return{el:u,id:Math.random(),props:e,audioId:t,mediaElementSourceNode:f,premounting:n,audioMounted:!!u.current,postmounting:r,cleanupOnMediaTagUnmount:()=>{f==null||f.cleanup()}}});(l=s.mediaElementSourceNode)==null||l.setAudioContext((o==null?void 0:o.audioContext)??null);const a=ne.useInsertionEffect??ne.useLayoutEffect;return typeof document<"u"&&(a(()=>{i&&i.numberOfAudioTags>0&&i.updateAudio({id:s.id,aud:e,audioId:t,premounting:n,postmounting:r})},[e,i,s.id,t,n,r]),a(()=>()=>{i&&i.numberOfAudioTags>0&&i.unregisterAudio(s.id)},[i,s.id])),s},nC=1e-5,dl=(e,t)=>Math.abs(e-t)<nC,iw=(e,t)=>Math.round(e/t*100)/100,wd=()=>typeof window>"u"||!/AppleWebKit/.test(window.navigator.userAgent)?!1:!window.navigator.userAgent.includes("Chrome/"),ru=()=>typeof window>"u"?!1:/iP(ad|od|hone)/i.test(window.navigator.userAgent)&&wd(),rC=e=>ru()&&e.startsWith("blob:"),xd=({actualFrom:e,fps:t})=>iw(Math.max(0,-e),t),bd=({duration:e,fps:t})=>iw(e,t),oC=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{if(rC(e)||e.startsWith("data:")||!!new URL(e,(typeof window>"u"?null:window.location.href)??"http://localhost:3000").hash||!Number.isFinite(t))return e;const i=`${e}#t=${xd({actualFrom:t,fps:r})}`;return Number.isFinite(n)?`${i},${bd({duration:n,fps:r})}`:i},iC=({prevStartFrom:e,newStartFrom:t,prevDuration:n,newDuration:r,fps:o})=>{const i=xd({actualFrom:e,fps:o}),s=xd({actualFrom:t,fps:o}),a=bd({duration:n,fps:o}),l=bd({duration:r,fps:o});return!(s<i||l>a)},sC=({actualSrc:e,actualFrom:t,duration:n,fps:r})=>{const o=c.useRef(t),i=c.useRef(n),s=c.useRef(e);return(!iC({prevStartFrom:o.current,newStartFrom:t,prevDuration:i.current,newDuration:n,fps:r})||e!==s.current)&&(o.current=t,i.current=n,s.current=e),oC({actualSrc:s.current,actualFrom:o.current,duration:i.current,fps:r})},nh=!1,aC=e=>{nh||(nh=!0,ot.warn({logLevel:e,tag:null},"In Safari, setting a volume and a playback rate at the same time is buggy."),ot.warn({logLevel:e,tag:null},"In Desktop Safari, only volumes <= 1 will be applied."),ot.warn({logLevel:e,tag:null},e,"In Mobile Safari, the volume will be ignored and set to 1 if a playbackRate is set."))},sw=({mediaRef:e,volume:t,logLevel:n,source:r,shouldUseWebAudioApi:o})=>{var m,h,y;const i=c.useRef(null),s=c.useRef(t);s.current=t;const a=c.useContext(oi);if(!a)throw new Error("useAmplification must be used within a SharedAudioContext");const{audioContext:l,gainNode:u}=a;if(typeof window<"u"&&c.useLayoutEffect(()=>{var E,v;if(!l||!e.current||!o)return;if(e.current.playbackRate!==1&&wd()){aC(n);return}if(!r||!u)return;const g=new GainNode(l,{gain:s.current});return r.attemptToConnect(),r.get().connect(g),g.connect(u),i.current={gainNode:g},ot.trace({logLevel:n,tag:null},`Starting to amplify ${(E=e.current)==null?void 0:E.src}. Gain = ${s.current}, playbackRate = ${(v=e.current)==null?void 0:v.playbackRate}`),()=>{i.current=null,g.disconnect(),r.get().disconnect()}},[n,e,l,r,o,u]),i.current){const g=t;dl(i.current.gainNode.gain.value,g)||(i.current.gainNode.gain.value=g,ot.trace({logLevel:n,tag:null},`Setting gain to ${g} for ${(m=e.current)==null?void 0:m.src}`))}return(wd()&&e.current&&((h=e.current)==null?void 0:h.playbackRate)!==1||!o)&&e.current&&!dl(t,(y=e.current)==null?void 0:y.volume)&&(e.current.volume=Math.min(t,1)),i},Wr=()=>{const e=c.useContext(tt);return(e==null?void 0:e.cumulatedNegativeFrom)??0},ii=e=>{const t=ql.useLoop(),n=ct(),r=Wr();return e==="repeat"||t===null?n+r:n+r+t.durationInFrames*t.iteration},aw=e=>{if(/data:|blob:/.test(e.substring(0,5)))return"Data URL";const t=e.split("/").map(n=>n.split("\\")).flat(1);return t[t.length-1]},lC=({compositionDurationInFrames:e,playbackRate:t,trimBefore:n,trimAfter:r,parentSequenceDurationInFrames:o,loop:i})=>{if(i)return e;const s=Gl({mediaDurationInFrames:e*t+(n??0),playbackRate:t,trimBefore:n,trimAfter:r});if(o!==null){const a=Math.min(o,s);return Number(a.toFixed(10))}return s},Jr=({frame:e,volume:t,mediaVolume:n=1})=>{if(typeof t=="number")return t*n;if(typeof t>"u")return Number(n);const r=t(e)*n;if(typeof r!="number")throw new TypeError(`You passed in a a function to the volume prop but it did not return a number but a value of type ${typeof r} for frame ${e}`);if(Number.isNaN(r))throw new TypeError(`You passed in a function to the volume prop but it returned NaN for frame ${e}.`);if(!Number.isFinite(r))throw new TypeError(`You passed in a function to the volume prop but it returned a non-finite number for frame ${e}.`);return Math.max(0,r)},rh={},uC=e=>{rh[e]||(console.warn(e),rh[e]=!0)},lw=({volume:e,mediaVolume:t,mediaType:n,src:r,displayName:o,trimBefore:i,trimAfter:s,playbackRate:a,sequenceDurationInFrames:l,mediaStartsAt:u,loop:f})=>{if(!r)throw new Error("No src passed");const p=c.useContext(tt),[m]=c.useState(()=>e),h=lC({compositionDurationInFrames:l,playbackRate:a,trimBefore:i,trimAfter:s,parentSequenceDurationInFrames:(p==null?void 0:p.durationInFrames)??null,loop:f}),y=c.useMemo(()=>typeof e=="number"?e:new Array(Math.floor(Math.max(0,h+u))).fill(!0).map((b,S)=>Jr({frame:S+u,volume:e,mediaVolume:t})).join(","),[h,u,e,t]);c.useEffect(()=>{typeof e=="number"&&e!==m&&uC(`Remotion: The ${n} with src ${r} has changed it's volume. Prefer the callback syntax for setting volume to get better timeline display: https://www.remotion.dev/docs/audio/volume`)},[m,n,r,e]);const g=typeof e=="function",E=Al(),{rootId:v}=kr(),w=0-u+(i??0);return c.useMemo(()=>({volumes:y,duration:h,doesVolumeChange:g,nonce:E,rootId:v,finalDisplayName:o??aw(r),startMediaFrom:w,src:r,playbackRate:a}),[y,h,g,E,v,o,r,w,a])},Kf=({volume:e,mediaVolume:t,src:n,mediaType:r,playbackRate:o,displayName:i,id:s,getStack:a,showInTimeline:l,premountDisplay:u,postmountDisplay:f,loopDisplay:p,documentationLink:m,refForOutline:h})=>{const y=c.useContext(tt),g=Wr(),{registerSequence:E,unregisterSequence:v}=c.useContext(ni),{durationInFrames:w}=qe(),x=Wr(),{volumes:b,duration:S,doesVolumeChange:C,nonce:k,rootId:T,finalDisplayName:P}=lw({volume:e,mediaVolume:t,mediaType:r,src:n,displayName:i,trimAfter:void 0,trimBefore:void 0,playbackRate:o,sequenceDurationInFrames:w,mediaStartsAt:x,loop:!1}),{isStudio:j}=Ke();c.useEffect(()=>{var M,D;if(!n)throw new Error("No src passed");if(!(!j&&((D=(M=window.process)==null?void 0:M.env)==null?void 0:D.NODE_ENV)!=="test")&&l)return E({type:r,src:n,id:s,duration:S,from:0,trimBefore:null,parent:(y==null?void 0:y.id)??null,displayName:P,documentationLink:m,rootId:T,volume:b,showInTimeline:!0,nonce:k.get(),startMediaFrom:0-g,mediaFrameAtSequenceZero:null,doesVolumeChange:C,loopDisplay:p,playbackRate:o,getStack:a,premountDisplay:u,postmountDisplay:f,controls:null,effects:[],refForOutline:h,isInsideSeries:!1,frozenFrame:null,frozenMediaFrame:null}),()=>{v(s)}},[S,s,y,n,E,v,b,C,k,r,g,o,a,l,u,f,p,m,T,P,j,h])},cC=(e,t)=>{const[n,r]=c.useState([]),[o,i]=c.useState([]),[s,a]=c.useState([]),u=Ke().isRendering,f=c.useRef(!1),p=c.useCallback(y=>{if(u)return{unblock:()=>{}};let g=!1;return r(E=>[...E,y]),{unblock:()=>{g||(g=!0,r(E=>{const v=E.filter(w=>w!==y);return v.length===E.length?E:v}))}}},[u]),m=c.useCallback(y=>(i(g=>[...g,y]),{remove:()=>{i(g=>g.filter(E=>E!==y))}}),[]),h=c.useCallback(y=>(a(g=>[...g,y]),{remove:()=>{a(g=>g.filter(E=>E!==y))}}),[]);return c.useEffect(()=>{u||n.length>0&&!f.current&&(f.current=!0,o.forEach(y=>y()),yt({logLevel:e,message:"Player is entering buffer state",mountTime:t,tag:"player"}))},[n]),typeof window<"u"&&c.useLayoutEffect(()=>{u||n.length===0&&f.current&&(f.current=!1,s.forEach(y=>y()),yt({logLevel:e,message:"Player is exiting buffer state",mountTime:t,tag:"player"}))},[n]),c.useMemo(()=>({addBlock:p,listenForBuffering:m,listenForResume:h,buffering:f}),[p,f,m,h])},si=ne.createContext(null),uw=({children:e})=>{const{logLevel:t,mountTime:n}=c.useContext(Xr),r=cC(t??"info",n);return d.jsx(si.Provider,{value:r,children:e})},cw=e=>{const[t,n]=c.useState(e.buffering.current);return c.useEffect(()=>{const r=()=>{n(!0)},o=()=>{n(!1)},i=e.listenForBuffering(r),s=e.listenForResume(o);return()=>{i.remove(),s.remove()}},[e]),t},ou=()=>{const e=c.useContext(si),t=Rn(),n=e?e.addBlock:null;return c.useMemo(()=>({delayPlayback:()=>{if(!n)throw new 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");ot.trace({logLevel:t,tag:"[buffer-state]"},"Adding buffer handle",new Error().stack);const{unblock:r}=n({id:String(Math.random())});let o=!1;return{unblock:()=>{o||(o=!0,ot.trace({logLevel:t,tag:"[buffer-state]"},"Removing buffer handle"),r())}}}}),[n,t])},dC=()=>/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),fC=({mediaRef:e,mediaType:t,onVariableFpsVideoDetected:n,pauseWhenBuffering:r,logLevel:o,mountTime:i})=>{const s=c.useRef(!1),{delayPlayback:a}=ou(),l=c.useCallback(u=>{var y;if(t!=="video"||!r)return;const f=e.current;if(!f)return;if(f.readyState>=f.HAVE_FUTURE_DATA&&!dC()){yt({logLevel:o,message:`Not using buffer until first frame, because readyState is ${f.readyState} and is not Safari or Desktop Chrome`,mountTime:i,tag:"buffer"});return}if(!f.requestVideoFrameCallback){yt({logLevel:o,message:"Not using buffer until first frame, because requestVideoFrameCallback is not supported",mountTime:i,tag:"buffer"});return}s.current=!0,yt({logLevel:o,message:`Buffering ${(y=e.current)==null?void 0:y.src} until the first frame is received`,mountTime:i,tag:"buffer"});const p=a(),m=()=>{p.unblock(),f.removeEventListener("ended",m,{once:!0}),f.removeEventListener("pause",m,{once:!0}),s.current=!1},h=()=>{m()};f.requestVideoFrameCallback((g,E)=>{Math.abs(E.mediaTime-u)>.5&&n(),m()}),f.addEventListener("ended",h,{once:!0}),f.addEventListener("pause",h,{once:!0}),f.addEventListener("canplay",h,{once:!0})},[a,o,e,t,i,n,r]);return c.useMemo(()=>({isBuffering:()=>s.current,bufferUntilFirstFrame:l}),[l])},pC=e=>{const{duration:t,currentTime:n,paused:r,ended:o,desiredUnclampedTime:i,mediaTagTime:s,mediaTagLastUpdate:a,rvcTime:l,rvcLastUpdate:u,isVariableFpsVideo:f,acceptableTimeShift:p,lastSeekDueToShift:m,playing:h,playbackRate:y,mediaTagBufferingOrStalled:g,playerBuffering:E,absoluteFrame:v,onlyWarnForMediaSeekingError:w,isPremounting:x,isPostmounting:b,pauseWhenBuffering:S}=e,C=!Number.isNaN(t)&&Number.isFinite(t)?Math.min(t,i):i,k=Math.abs(C-s),T=l?Math.abs(C-l):null,P=u&&l>a?T:k,j=T&&!f?P:k;if(j>p&&m!==C)return{type:"seek-due-to-shift",shouldBeTime:C,why:`because time shift is too big. shouldBeTime = ${C}, isTime = ${s}, requestVideoCallbackTime = ${l}, timeShift = ${j}${f?", isVariableFpsVideo = true":""}, isPremounting = ${x}, isPostmounting = ${b}, pauseWhenBuffering = ${S}`,bufferUntilFirstFrame:h&&y>0,playReason:h&&r?"player is playing but media tag is paused, and just seeked":null,warnAboutNonSeekable:!w};const M=h?.15:.01,D=Math.abs(n-C)>M;if(!h||E&&!g)return{type:"seek-if-not-playing",shouldBeTime:C,why:D?`not playing or something else is buffering. time offset is over seek threshold (${M})`:null};if(!h||E)return{type:"none"};const L=r&&!o;if(L||v===0){const O=L?"media tag is paused":"absolute frame is 0";return{type:"play-and-seek",shouldBeTime:C,why:D?`is over timeshift threshold (threshold = ${M}) and ${O}`:null,playReason:`player is playing and ${O}`,bufferUntilFirstFrame:!f&&y>0}}return{type:"none"}},mC=e=>{var r,o;const t=ne.useRef({time:((r=e.current)==null?void 0:r.currentTime)??0,lastUpdate:performance.now()}),n=((o=e.current)==null?void 0:o.currentTime)??null;return n!==null&&t.current.time!==n&&(t.current.time=n,t.current.lastUpdate=performance.now()),t},Ma=({mediaRef:e,time:t,logLevel:n,why:r,mountTime:o})=>{const i=ru()?Number(t.toFixed(1)):t;return yt({logLevel:n,tag:"seek",message:`Seeking from ${e.currentTime} to ${i}. src= ${e.src} Reason: ${r}`,mountTime:o}),e.currentTime=i,i},hC=({element:e,shouldBuffer:t,isPremounting:n,isPostmounting:r,logLevel:o,mountTime:i,src:s})=>{const a=ou(),[l,u]=c.useState(!1);return c.useEffect(()=>{let f=[];const{current:p}=e;if(!p||!t)return;if(n||r){if((n||r)&&p.readyState<p.HAVE_FUTURE_DATA&&!navigator.userAgent.includes("Firefox/")){yt({logLevel:o,message:`Calling .load() on ${p.src} because readyState is ${p.readyState} and it is not Firefox. Element is premounted ${p.playbackRate}`,tag:"load",mountTime:i});const g=p.playbackRate;p.load(),p.playbackRate=g}return}const m=g=>{let E=!1;f.forEach(v=>{v(g),E=!0}),f=[],u(v=>(v&&(E=!0),!1)),E&&yt({logLevel:o,message:`Unmarking as buffering: ${p.src}. Reason: ${g}`,tag:"buffer",mountTime:i})},h=g=>{u(!0),yt({logLevel:o,message:`Marking as buffering: ${p.src}. Reason: ${g}`,tag:"buffer",mountTime:i});const{unblock:E}=a.delayPlayback(),v=()=>{m('"canplay" was fired'),y()},w=()=>{m('"error" event was occurred'),y()};p.addEventListener("canplay",v,{once:!0}),f.push(()=>{p.removeEventListener("canplay",v)}),p.addEventListener("error",w,{once:!0}),f.push(()=>{p.removeEventListener("error",w)}),f.push(x=>{yt({logLevel:o,message:`Unblocking ${p.src} from buffer. Reason: ${x}`,tag:"buffer",mountTime:i}),E()})},y=()=>{if(p.readyState<p.HAVE_FUTURE_DATA){if(h(`readyState is ${p.readyState}, which is less than HAVE_FUTURE_DATA`),!navigator.userAgent.includes("Firefox/")){yt({logLevel:o,message:`Calling .load() on ${s} because readyState is ${p.readyState} and it is not Firefox. ${p.playbackRate}`,tag:"load",mountTime:i});const g=p.playbackRate;p.load(),p.playbackRate=g}}else{const g=()=>{h('"waiting" event was fired')};p.addEventListener("waiting",g),f.push(()=>{p.removeEventListener("waiting",g)})}};return y(),()=>{m("element was unmounted or prop changed")}},[a,s,e,n,r,o,t,i]),l},gC=({mediaRef:e,mediaType:t,lastSeek:n,onVariableFpsVideoDetected:r})=>{const o=c.useRef(null);return c.useEffect(()=>{const{current:i}=e;if(i)o.current={time:i.currentTime,lastUpdate:performance.now()};else{o.current=null;return}if(t!=="video"){o.current=null;return}const s=i;if(!s.requestVideoFrameCallback)return;let a=()=>{};const l=()=>{if(!s)return;const u=s.requestVideoFrameCallback((f,p)=>{if(o.current!==null){const m=Math.abs(o.current.time-p.mediaTime),h=Math.abs(n.current===null?1/0:p.mediaTime-n.current);m>.5&&h>.5&&p.mediaTime>o.current.time&&r()}o.current={time:p.mediaTime,lastUpdate:performance.now()},l()});a=()=>{s.cancelVideoFrameCallback(u),a=()=>{}}};return l(),()=>{a()}},[n,e,t,r]),o},dw=({frame:e,playbackRate:t,startFrom:n})=>ri(e,[-1,n,n+1],[-1,n,n+t]),fw=({fps:e,frame:t,playbackRate:n,startFrom:r})=>{const o=dw({frame:t,playbackRate:n,startFrom:r}),i=1e3/e;return o*i/1e3},oh={},vC=(e,t)=>{if(e===null||e.seekable.length===0||e.seekable.length>1||oh[e.src])return;const n={start:e.seekable.start(0),end:e.seekable.end(0)};if(n.start===0&&n.end===0){const 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(`
|
|
57
|
+
`);console.error(r),oh[e.src]=!0}},pw=({mediaRef:e,src:t,mediaType:n,playbackRate:r,preservePitch:o=!0,onlyWarnForMediaSeekingError:i,acceptableTimeshift:s,pauseWhenBuffering:a,isPremounting:l,isPostmounting:u,onAutoPlayError:f})=>{const{playbackRate:p}=Nf(),m=ct(),h=Cr(),[y]=m0(),g=c.useContext(si),{fps:E}=qe(),v=Wr(),w=c.useRef(null),x=c.useRef(null),b=Rn(),S=bs();if(!g)throw new Error("useMediaPlayback must be used inside a <BufferingContext>");const C=c.useRef({}),k=c.useCallback(()=>{t&&(C.current[t]||(ot.verbose({logLevel:b,tag:null},`Detected ${t} as a variable FPS video. Disabling buffering while seeking.`),C.current[t]=!0))},[b,t]),T=gC({mediaRef:e,mediaType:n,lastSeek:x,onVariableFpsVideoDetected:k}),P=mC(e),j=fw({frame:m,playbackRate:r,startFrom:-v,fps:E}),M=hC({element:e,shouldBuffer:a,isPremounting:l,isPostmounting:u,logLevel:b,mountTime:S,src:t??null}),{bufferUntilFirstFrame:D,isBuffering:N}=fC({mediaRef:e,mediaType:n,onVariableFpsVideoDetected:k,pauseWhenBuffering:a,logLevel:b,mountTime:S}),L=r*p,H=(()=>{var z;return(z=e.current)!=null&&z.duration?Math.min(e.current.duration,s??.65):s??.65})(),O=cw(g);c.useEffect(()=>{var F,z,B,Y,$;if((F=e.current)!=null&&F.paused)return;if(!y){yt({logLevel:b,tag:"pause",message:`Pausing ${(z=e.current)==null?void 0:z.src} because ${l?"media is premounting":u?"media is postmounting":"Player is not playing"}`,mountTime:S}),(B=e.current)==null||B.pause();return}const I=M||N();g.buffering.current&&!I&&(yt({logLevel:b,tag:"pause",message:`Pausing ${(Y=e.current)==null?void 0:Y.src} because player is buffering but media tag is not`,mountTime:S}),($=e.current)==null||$.pause())},[N,M,g,O,l,b,e,n,S,y,u]);const R=Ke();c.useLayoutEffect(()=>{const I=Math.max(0,L);e.current&&e.current.playbackRate!==I&&(e.current.playbackRate=I),e.current&&e.current.preservesPitch!==o&&(e.current.preservesPitch=o)},[e,L,o]),c.useEffect(()=>{var z,B;const I=n==="audio"?"<Html5Audio>":"<Html5Video>";if(!e.current)throw new Error(`No ${n} ref found`);if(!t)throw new Error(`No 'src' attribute was passed to the ${I} element.`);const{current:_}=e,F=pC({duration:_.duration,currentTime:_.currentTime,paused:_.paused,ended:_.ended,desiredUnclampedTime:j,mediaTagTime:P.current.time,mediaTagLastUpdate:P.current.lastUpdate,rvcTime:((z=T.current)==null?void 0:z.time)??null,rvcLastUpdate:((B=T.current)==null?void 0:B.lastUpdate)??null,isVariableFpsVideo:!!C.current[t],acceptableTimeShift:H,lastSeekDueToShift:w.current,playing:y,playbackRate:L,mediaTagBufferingOrStalled:M||N(),playerBuffering:g.buffering.current,absoluteFrame:h,onlyWarnForMediaSeekingError:i,isPremounting:l,isPostmounting:u,pauseWhenBuffering:a});if(F.type!=="none"){if(F.type==="seek-due-to-shift"){x.current=Ma({mediaRef:_,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:S}),w.current=x.current,F.bufferUntilFirstFrame&&D(F.shouldBeTime),F.playReason!==null&&cl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:S,reason:F.playReason,isPlayer:R.isPlayer}),F.warnAboutNonSeekable&&vC(_);return}if(F.type==="seek-if-not-playing"){F.why!==null&&(x.current=Ma({mediaRef:_,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:S}));return}F.why!==null&&(x.current=Ma({mediaRef:_,time:F.shouldBeTime,logLevel:b,why:F.why,mountTime:S})),cl({mediaRef:e,mediaType:n,onAutoPlayError:f,logLevel:b,mountTime:S,reason:F.playReason,isPlayer:R.isPlayer}),F.bufferUntilFirstFrame&&D(F.shouldBeTime)}},[h,H,D,g.buffering,T,b,j,N,M,e,n,i,L,y,t,f,l,u,a,S,P,R.isPlayer])},mw=({mediaRef:e,id:t,mediaType:n,onAutoPlayError:r,isPremounting:o,isPostmounting:i})=>{const{audioAndVideoTags:s,imperativePlaying:a}=kr(),l=Rn(),u=bs(),f=Ke();c.useEffect(()=>{const p={id:t,play:m=>{if(a.current&&!(o||i))return cl({mediaRef:e,mediaType:n,onAutoPlayError:r,logLevel:l,mountTime:u,reason:m,isPlayer:f.isPlayer})}};return s.current.push(p),()=>{s.current=s.current.filter(m=>m.id!==t)}},[s,t,e,n,r,a,o,i,l,u,f.isPlayer])},Xf=c.createContext({playerMuted:!1,mediaVolume:1}),Gf=c.createContext({setPlayerMuted:()=>{throw new Error("default")},setMediaVolume:()=>{throw new Error("default")}}),qf=()=>{const{mediaVolume:e}=c.useContext(Xf),{setMediaVolume:t}=c.useContext(Gf);return c.useMemo(()=>[e,t],[e,t])},Qf=()=>{const{playerMuted:e}=c.useContext(Xf),{setPlayerMuted:t}=c.useContext(Gf);return c.useMemo(()=>[e,t],[e,t])},ai=e=>{if(e>=100)throw new 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.`)},yC=(e,t)=>{const[n]=c.useState(e.shouldPreMountAudioTags);if(e.shouldPreMountAudioTags!==n)throw new Error("Cannot change the behavior for pre-mounting audio tags dynamically.");const r=Rn(),{volume:o,muted:i,playbackRate:s,preservePitch:a,shouldPreMountAudioTags:l,src:u,onDuration:f,acceptableTimeShiftInSeconds:p,_remotionInternalNeedsDurationCalculation:m,_remotionInternalNativeLoopPassed:h,_remotionInternalStack:y,allowAmplificationDuringRender:g,name:E,pauseWhenBuffering:v,showInTimeline:w,loopVolumeCurveBehavior:x,stack:b,crossOrigin:S,delayRenderRetries:C,delayRenderTimeoutInMilliseconds:k,toneFrequency:T,useWebAudioApi:P,onError:j,onNativeError:M,audioStreamIndex:D,...N}=e,[L]=qf(),[H]=Qf(),O=ii(x??"repeat");if(!u)throw new TypeError("No 'src' was passed to <Html5Audio>.");const R=Qr(u),I=c.useContext(tt),[_]=c.useState(()=>String(Math.random())),F=Jr({frame:O,volume:o,mediaVolume:L});ai(F);const z=Zf({crossOrigin:S,requestsVideoFrame:!1,isClientSideRendering:!1}),B=c.useMemo(()=>({muted:i||H||F<=0,src:R,loop:h,crossOrigin:z,...N}),[h,H,i,N,R,F,z]),Y=c.useMemo(()=>`audio-${Gr(u??"")}-${I==null?void 0:I.relativeFrom}-${I==null?void 0:I.cumulatedFrom}-${I==null?void 0:I.durationInFrames}-muted:${e.muted}-loop:${e.loop}`,[u,I==null?void 0:I.relativeFrom,I==null?void 0:I.cumulatedFrom,I==null?void 0:I.durationInFrames,e.muted,e.loop]),{el:$,mediaElementSourceNode:A,cleanupOnMediaTagUnmount:X}=tC({aud:B,audioId:Y,premounting:!!(I!=null&&I.premounting),postmounting:!!(I!=null&&I.postmounting)}),Z=c.useCallback(()=>y??null,[y]);Kf({volume:o,mediaVolume:L,src:u,mediaType:"audio",playbackRate:s??1,displayName:E??null,id:_,getStack:Z,showInTimeline:w,premountDisplay:(I==null?void 0:I.premountDisplay)??null,postmountDisplay:(I==null?void 0:I.postmountDisplay)??null,loopDisplay:void 0,documentationLink:"https://www.remotion.dev/docs/html5-audio",refForOutline:null}),pw({mediaRef:$,src:u,mediaType:"audio",playbackRate:s??1,preservePitch:a,onlyWarnForMediaSeekingError:!1,acceptableTimeshift:p??null,isPremounting:!!(I!=null&&I.premounting),isPostmounting:!!(I!=null&&I.postmounting),pauseWhenBuffering:v,onAutoPlayError:null}),mw({id:_,isPostmounting:!!(I!=null&&I.postmounting),isPremounting:!!(I!=null&&I.premounting),mediaRef:$,mediaType:"audio",onAutoPlayError:null}),sw({logLevel:r,mediaRef:$,source:A,volume:F,shouldUseWebAudioApi:P??!1}),(ne.useInsertionEffect??ne.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{X()})},[X]),c.useImperativeHandle(t,()=>$.current,[$]);const U=c.useRef(f);return U.current=f,c.useEffect(()=>{var ae;const{current:se}=$;if(!se)return;if(se.duration){(ae=U.current)==null||ae.call(U,se.src,se.duration);return}const de=()=>{var te;(te=U.current)==null||te.call(U,se.src,se.duration)};return se.addEventListener("loadedmetadata",de),()=>{se.removeEventListener("loadedmetadata",de)}},[$,u]),n?null:d.jsx("audio",{ref:$,preload:"metadata",crossOrigin:z,...B})},hw=c.forwardRef(yC),wC=(e,t)=>{const n=c.useRef(null),{volume:r,playbackRate:o,allowAmplificationDuringRender:i,onDuration:s,toneFrequency:a,_remotionInternalNeedsDurationCalculation:l,_remotionInternalNativeLoopPassed:u,acceptableTimeShiftInSeconds:f,name:p,onNativeError:m,delayRenderRetries:h,delayRenderTimeoutInMilliseconds:y,loopVolumeCurveBehavior:g,pauseWhenBuffering:E,audioStreamIndex:v,preservePitch:w,...x}=e,b=Cr(),S=ii(g??"repeat"),C=ct(),k=c.useContext(tt),{registerRenderAsset:T,unregisterRenderAsset:P}=c.useContext(qr),{delayRender:j,continueRender:M}=gn(),D=c.useMemo(()=>`audio-${Gr(e.src??"")}-${k==null?void 0:k.relativeFrom}-${k==null?void 0:k.cumulatedFrom}-${k==null?void 0:k.durationInFrames}`,[e.src,k==null?void 0:k.relativeFrom,k==null?void 0:k.cumulatedFrom,k==null?void 0:k.durationInFrames]),N=Jr({volume:r,frame:S,mediaVolume:1});ai(N),c.useImperativeHandle(t,()=>n.current,[]),c.useEffect(()=>{if(!e.src)throw new Error("No src passed");if(window.remotion_audioEnabled&&!e.muted&&!(N<=0))return T({type:"audio",src:Tn(e.src),id:D,frame:b,volume:N,mediaFrame:C,playbackRate:e.playbackRate??1,toneFrequency:a??1,audioStartFrame:Math.max(0,-((k==null?void 0:k.cumulatedNegativeFrom)??0)),audioStreamIndex:v??0}),()=>P(D)},[e.muted,e.src,T,b,D,P,N,S,C,o,e.playbackRate,a,k==null?void 0:k.cumulatedNegativeFrom,v]);const{src:L}=e,H=t||l;return c.useLayoutEffect(()=>{var _,F;if(((F=(_=window.process)==null?void 0:_.env)==null?void 0:F.NODE_ENV)==="test"||!H)return;const O=j("Loading <Html5Audio> duration with src="+L,{retries:h??void 0,timeoutInMilliseconds:y??void 0}),{current:R}=n,I=()=>{R!=null&&R.duration&&s(R.src,R.duration),M(O)};return R!=null&&R.duration?(s(R.src,R.duration),M(O)):R==null||R.addEventListener("loadedmetadata",I,{once:!0}),()=>{R==null||R.removeEventListener("loadedmetadata",I),M(O)}},[L,s,H,h,y,M,j]),H?d.jsx("audio",{ref:n,...x,onError:m}):null},xC=c.forwardRef(wC),bC=(e,t)=>{const n=c.useContext(nu),r=e,{startFrom:o,endAt:i,trimBefore:s,trimAfter:a,name:l,stack:u,pauseWhenBuffering:f,showInTimeline:p,onError:m,freeze:h,...y}=r,{loop:g,freeze:E,...v}=r,{fps:w}=qe(),x=Ke(),b=Es(f);if(x.isClientSideRendering)throw new Error("<Html5Audio> is not supported in @remotion/web-renderer. Use <Audio> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");if(typeof h<"u")throw new TypeError('The "freeze" prop is not supported on <Html5Audio />. Use <Sequence freeze={...}> to freeze media playback.');const{durations:S,setDurations:C}=c.useContext(Uf);if(typeof e.src!="string")throw new TypeError(`The \`<Html5Audio>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const k=Qr(e.src),T=c.useCallback(N=>{console.log(N.currentTarget.error);const L=`Could not play audio with src ${k}: ${N.currentTarget.error}. See https://remotion.dev/docs/media-playback-error for help.`;if(g){if(m){m(new Error(L));return}us(new Error(L))}else m==null||m(new Error(L)),console.warn(L)},[g,m,k]),P=c.useCallback((N,L)=>{C({type:"got-duration",durationInSeconds:L,src:N})},[C]),j=S[Tn(k)]??S[Tn(e.src)];eu({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});const{trimBeforeValue:M,trimAfterValue:D}=tu({startFrom:o,endAt:i,trimBefore:s,trimAfter:a});if(g&&j!==void 0){if(!Number.isFinite(j))return d.jsx($a,{...v,ref:t,_remotionInternalNativeLoopPassed:!0});const N=j*w;return d.jsx(ql,{layout:"none",durationInFrames:Gl({trimAfter:D,mediaDurationInFrames:N,playbackRate:e.playbackRate??1,trimBefore:M}),children:d.jsx($a,{...v,ref:t,_remotionInternalNativeLoopPassed:!0})})}return typeof M<"u"||typeof D<"u"?d.jsx(dt,{layout:"none",from:0-(M??0),showInTimeline:!1,durationInFrames:D,name:l,children:d.jsx($a,{_remotionInternalNeedsDurationCalculation:!!g,pauseWhenBuffering:b,...y,ref:t})}):(Jl({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Audio"),x.isRendering?d.jsx(xC,{onDuration:P,...e,ref:t,onNativeError:T,_remotionInternalNeedsDurationCalculation:!!g}):d.jsx(hw,{_remotionInternalNativeLoopPassed:e._remotionInternalNativeLoopPassed??!1,_remotionInternalStack:u??null,shouldPreMountAudioTags:n!==null&&n.numberOfAudioTags>0,...e,ref:t,onNativeError:T,onDuration:P,pauseWhenBuffering:b,_remotionInternalNeedsDurationCalculation:!!g,showInTimeline:p??!0}))},$a=c.forwardRef(bC);kt($a);var SC=e=>{if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`<Solid>: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e},EC={...Zn,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},pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},..._n,...Tr,...Ir},kC=({color:e,width:t,height:n,effects:r=[],className:o,style:i,pixelDensity:s,overrideId:a,reference:l})=>{const{delayRender:u,continueRender:f,cancelRender:p}=gn(),m=SC(s),h=Math.ceil(t*m),y=Math.ceil(n*m),[g,E]=c.useState(null),v=Ts({effects:r,overrideId:a??null}),w=c.useMemo(()=>{if(typeof document>"u")return null;const C=document.createElement("canvas");return C.width=1,C.height=1,C},[]),x=_s(),b=c.useCallback(C=>{E(C),typeof l=="function"?l(C):l&&(l.current=C)},[l]);c.useEffect(()=>{if(!g||!w)return;const C=u("Solid effect chain");if(!x)return f(C),()=>{f(C)};const k=w.getContext("2d",{colorSpace:"srgb"});if(!k){p(new Error("Failed to acquire 2D context for <Solid> source"));return}return k.clearRect(0,0,1,1),e!==void 0&&(k.fillStyle=e,k.fillRect(0,0,1,1)),Rs({state:x.get(h,y),source:w,effects:v,output:g,width:h,height:y}).then(T=>{T&&f(C)}).catch(T=>{p(T)}),()=>{f(C)}},[e,g,w,x,h,y,u,f,p,v]);const S=c.useMemo(()=>({width:t,height:n,...i??{}}),[n,i,t]);return d.jsx("canvas",{ref:b,width:h,height:y,className:o,style:S})},CC=c.forwardRef(({effects:e=[],controls:t,color:n,height:r,width:o,className:i,durationInFrames:s,style:a,name:l,from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,pixelDensity:y,...g},E)=>{const v=Is(e),w=c.useRef(null);return c.useImperativeHandle(E,()=>w.current,[]),d.jsx(dt,{layout:"none",from:u,trimBefore:f,freeze:p,hidden:m,showInTimeline:h,controls:t,_remotionInternalEffects:v,durationInFrames:s,name:l??"<Solid>",outlineRef:w,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/solid",...g,children:d.jsx(kC,{reference:w,overrideId:(t==null?void 0:t.overrideId)??null,color:n,height:r,width:o,className:i,style:a,effects:e,pixelDensity:y})})}),gw=Yn({Component:CC,componentName:"<Solid>",componentIdentity:"dev.remotion.remotion.Solid",schema:EC,supportsEffects:!0});gw.displayName="Solid";kt(gw);var ia=null,vw=()=>{if(ia!==null)return ia;if(typeof document>"u")return!1;const e=document.createElement("canvas"),t=e.getContext("2d");return ia=typeof(t==null?void 0:t.drawElementImage)=="function"&&typeof e.requestPaint=="function"&&typeof e.captureElementImage=="function"&&"transferControlToOffscreen"in HTMLCanvasElement.prototype,ia},IC="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).";function TC(e,t){if(typeof e!="number"||typeof t!="number")throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(e)}, height=${String(t)}.`);if(!Number.isInteger(e)||e<=0)throw new Error(`HtmlInCanvas: \`width\` must be a positive integer. Received: ${String(e)}.`);if(!Number.isInteger(t)||t<=0)throw new Error(`HtmlInCanvas: \`height\` must be a positive integer. Received: ${String(t)}.`)}function RC(e){if(e===void 0)return 1;if(typeof e!="number"||!Number.isFinite(e)||e<=0)throw new Error(`HtmlInCanvas: \`pixelDensity\` must be a positive finite number. Received: ${String(e)}.`);return e}var sa=e=>e instanceof DOMException&&e.name==="InvalidStateError",ih="HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.",sh=({target:e,width:t,height:n})=>{e.width!==t&&(e.width=t),e.height!==n&&(e.height=n)},_C=({canvas:e,element:t,elementImage:n})=>{const r=e.getContext("2d");if(!r)throw new Error("Failed to acquire 2D context for <HtmlInCanvas> canvas");r.reset();const o=r.drawElementImage(n,0,0);t.style.transform=o.toString()},ah=c.createContext(null),yw=c.forwardRef(({width:e,height:t,effects:n,children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l},u)=>{const f=c.useContext(ah);TC(e,t);const p=RC(s),m=Math.ceil(e*p),h=Math.ceil(t*p),{delayRender:y,continueRender:g,cancelRender:E}=gn(),{isClientSideRendering:v,isRendering:w}=Ke(),x=!w||v,b=o===void 0&&i===void 0;vw()||E(new Error(IC));const S=c.useRef(null),C=c.useRef(null),k=c.useRef(null),T=`${e}x${t}@${p}-${b?"direct":"offscreen"}`,P=c.useCallback($=>{S.current=$,typeof u=="function"?u($):u&&(u.current=$)},[u]),j=_s(),M=Ts({effects:n,overrideId:(a==null?void 0:a.overrideId)??null}),D=c.useRef(M);D.current=M;const N=c.useRef(o);N.current=o;const L=c.useRef(i);L.current=i;const H=c.useRef(!1),O=c.useRef(null),R=c.useRef(!1),I=c.useRef(f);I.current=f;const _=c.useCallback(async()=>{var X;const $=k.current;if(!$)throw new Error("Canvas or scene element not found");const A=C.current;if(!A)throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");sh({target:A,width:m,height:h});try{const Z=S.current;if(!Z)throw new Error("Canvas not found");const V=y("onPaint");if(!H.current){const se=L.current;if(!se)H.current=!0;else{let de;try{de=Z.captureElementImage($)}catch(ae){if(sa(ae)&&x){g(V);return}throw sa(ae)?new Error(ih):ae}H.current=!0;try{if(A instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");const ae=await se({canvas:A,element:$,elementImage:de,pixelDensity:p});if(typeof ae!="function")throw new Error("HtmlInCanvas: when `onInit` is provided, it must return a cleanup function, or a Promise that resolves to one.");R.current?ae():O.current=ae}finally{de.close()}}}let U;try{U=Z.captureElementImage($)}catch(se){if(sa(se)&&x){g(V);return}throw sa(se)?new Error(ih):se}try{const se=N.current;if(se){if(A instanceof HTMLCanvasElement)throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");const de=se({canvas:A,element:$,elementImage:U,pixelDensity:p});de&&await de}else _C({canvas:A,element:$,elementImage:U,pixelDensity:p});await Rs({state:j.get(m,h),source:A,effects:D.current,output:A,width:m,height:h})}finally{U.close()}(X=I.current)==null||X.requestParentPaint(),g(V)}catch(Z){E(Z)}},[h,m,j,g,E,y,p,x]);c.useLayoutEffect(()=>{const $=S.current;if(!$)throw new Error("Canvas not found");$.layoutSubtree=!0;const A=b?$:$.transferControlToOffscreen();return C.current=A,sh({target:A,width:m,height:h}),H.current=!1,R.current=!1,$.addEventListener("paint",_),()=>{var X;$.removeEventListener("paint",_),C.current=null,H.current=!1,R.current=!0,(X=O.current)==null||X.call(O),O.current=null}},[_,E,m,h,b]);const F=c.useRef(!1);c.useLayoutEffect(()=>{var A;if(!F.current){F.current=!0;return}const $=S.current;$&&((A=$.requestPaint)==null||A.call($))},[o,M]),c.useLayoutEffect(()=>{const $=S.current;if(!$)return;const A=y("waiting for first paint after canvas resize");return $.addEventListener("paint",()=>{g(A)},{once:!0}),()=>{g(A)}},[e,t,g,y,T]);const z=c.useMemo(()=>({width:e,height:t}),[e,t]),B=c.useMemo(()=>({width:e,height:t,...l??{}}),[t,l,e]),Y=c.useMemo(()=>({requestParentPaint:()=>{var $,A;(A=($=S.current)==null?void 0:$.requestPaint)==null||A.call($)}}),[]);return d.jsx(ah.Provider,{value:Y,children:d.jsx("canvas",{ref:P,width:m,height:h,style:B,children:d.jsx("div",{ref:k,style:z,children:r})},T)})});yw.displayName="HtmlInCanvasContent";var ww=c.forwardRef(({width:e,height:t,effects:n=[],children:r,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,durationInFrames:u,name:f,...p},m)=>{const h=Is(n),y=c.useRef(null),g=c.useCallback(E=>{y.current=E,typeof m=="function"?m(E):m&&(m.current=E)},[m]);return d.jsx(dt,{durationInFrames:u,name:f??"<HtmlInCanvas>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/remotion/html-in-canvas",controls:a,_remotionInternalEffects:h,outlineRef:y,layout:"none",...p,children:d.jsx(yw,{ref:g,width:e,height:t,effects:n,onPaint:o,onInit:i,pixelDensity:s,controls:a,style:l,children:r})})});ww.displayName="HtmlInCanvas";var PC={...Zn,pixelDensity:{type:"number",min:1,max:3,step:.1,default:1,description:"Pixel density",hiddenFromList:!1},..._n,...Tr,...Ir},FC=Yn({Component:ww,componentName:"<HtmlInCanvas>",componentIdentity:"dev.remotion.remotion.HtmlInCanvas",schema:PC,supportsEffects:!0}),xw=Object.assign(FC,{isSupported:vw});xw.displayName="HtmlInCanvas";kt(xw);function zn(e){return e.startsWith("data:")&&e.length>100?e.slice(0,60)+"...["+e.length+" chars total]":e}var jC={...Zn,...ti,fit:{type:"enum",default:"fill",description:"Fit",variants:{fill:{},contain:{},cover:{}}},..._n,...Tr,...Ir},MC=()=>{if(typeof DOMException<"u")return new DOMException("Image loading was aborted","AbortError");const e=new Error("Image loading was aborted");return e.name="AbortError",e},$C=({src:e,signal:t})=>new Promise((n,r)=>{const o=new Image;let i=!1;function s(){o.onload=null,o.onerror=null}function a(u){i||(i=!0,s(),u())}function l(){a(()=>r(MC()))}if(o.onload=()=>{var u;Promise.resolve((u=o.decode)==null?void 0:u.call(o)).catch(()=>{}).then(()=>{const f=o.naturalWidth||o.width,p=o.naturalHeight||o.height;if(f<=0||p<=0){a(()=>r(new Error(`Could not determine dimensions for <CanvasImage> with src="${zn(e)}"`)));return}a(()=>n({element:o,width:f,height:p}))})},o.onerror=()=>{a(()=>r(new Error(`Could not load <CanvasImage> with src="${zn(e)}"`)))},t.addEventListener("abort",l,{once:!0}),t.aborted){l();return}o.crossOrigin="anonymous",o.src=e});function AC(e){return 1e3*2**(e-1)}var NC=({onFrame:e})=>{if(typeof requestAnimationFrame>"u")return e(),()=>{};const t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)},bw=c.forwardRef(({src:e,width:t,height:n,fit:r="fill",effects:o,controls:i,onError:s,className:a,style:l,id:u,pauseWhenLoading:f,maxRetries:p=2,delayRenderRetries:m,delayRenderTimeoutInMilliseconds:h,refForOutline:y,...g},E)=>{const{delayRender:v,continueRender:w,cancelRender:x}=gn(),{delayPlayback:b}=ou(),[S,C]=c.useState(null),[k,T]=c.useState(null),P=Qr(e),j=_s(),M=Ts({effects:o,overrideId:(i==null?void 0:i.overrideId)??null}),D=c.useContext(tt),N=c.useRef(null),[L,H]=c.useState(!1),O=!!(D!=null&&D.premounting),R=!!(D!=null&&D.postmounting),I=c.useCallback(({markAsReady:z})=>{const B=N.current;!B||B.continued||(B.continued=!0,z&&H(!1),w(B.handle),N.current=null)},[w]),_=c.useMemo(()=>typeof document>"u"?null:document.createElement("canvas"),[]),F=c.useCallback(z=>{C(z),y&&(y.current=z),typeof E=="function"?E(z):E&&(E.current=z)},[E,y]);return c.useLayoutEffect(()=>{if(!(!f||!L||O||R))return b().unblock},[b,L,R,O,f]),c.useLayoutEffect(()=>{const z=v(`Rendering <CanvasImage> with src="${zn(P)}"`,{retries:m??void 0,timeoutInMilliseconds:h??void 0}),B=new AbortController;let Y=!1,$=0,A=null;T(null),H(!0),N.current={handle:z,continued:!1};const X=()=>{$C({src:P,signal:B.signal}).then(Z=>{Y||T(Z)}).catch(Z=>{if(Z.name==="AbortError"){I({markAsReady:!1});return}if($++,$<=p){const V=AC($);console.warn(`Could not load <CanvasImage> with src="${zn(P)}", retrying in ${V}ms`),A=setTimeout(()=>{Y||X()},V)}else s?(s(Z),I({markAsReady:!0})):x(Z)})};return X(),()=>{Y=!0,A!==null&&clearTimeout(A),B.abort(),I({markAsReady:!1})}},[P,x,I,v,m,h,p,s]),c.useLayoutEffect(()=>{if(!k||!S||!_)return;const z=v(`Applying effects to <CanvasImage> with src="${zn(P)}"`);let B=!1,Y=!1,$=()=>{};const A=()=>{Y||(Y=!0,w(z))},X=t??k.width,Z=n??k.height,V=_.getContext("2d",{colorSpace:"srgb"});return V?(_.width=X,_.height=Z,S.width=X,S.height=Z,V.clearRect(0,0,X,Z),V.drawImage(k.element,...U0(r,{width:k.width,height:k.height},{width:X,height:Z})),Rs({state:j.get(X,Z),source:_,effects:M,output:S,width:X,height:Z}).then(U=>{U&&!B&&($=NC({onFrame:()=>{B||(A(),I({markAsReady:!0}))}}))}).catch(U=>{B||(s?(s(U),A(),I({markAsReady:!0})):x(U))}),()=>{B=!0,$(),A()}):(x(new Error("Could not get 2D context for <CanvasImage> source canvas")),A(),()=>{A()})},[P,x,j,w,I,v,r,n,k,M,s,S,_,t]),d.jsx("canvas",{...g,ref:F,width:t,height:n,className:a,style:l,id:u})});bw.displayName="CanvasImageContent";var LC=c.forwardRef(({src:e,width:t,height:n,fit:r,effects:o=[],className:i,style:s,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,durationInFrames:h,from:y,trimBefore:g,freeze:E,premountFor:v,postmountFor:w,styleWhilePremounted:x,styleWhilePostmounted:b,hidden:S,name:C,showInTimeline:k,stack:T,controls:P,_remotionInternalDocumentationLink:j,outlineRef:M,...D},N)=>{if(!e)throw new Error('No "src" prop was passed to <CanvasImage>.');const L=Is(o),H=c.useRef(null);c.useImperativeHandle(N,()=>H.current,[]);const{effectivePostmountFor:O,effectivePremountFor:R,freezeFrame:I,isPremountingOrPostmounting:_,postmountingActive:F,premountingActive:z,premountingStyle:B}=ks({from:y??0,durationInFrames:h??1/0,premountFor:v??null,postmountFor:w??null,style:s??null,styleWhilePremounted:x??null,styleWhilePostmounted:b??null,hideWhilePremounted:"display-none"});return d.jsx(Ss,{frame:I,active:_,children:d.jsx(dt,{layout:"none",from:y??0,trimBefore:g,durationInFrames:h??1/0,freeze:E,hidden:S,showInTimeline:k??!0,name:C??"<CanvasImage>",_remotionInternalDocumentationLink:j??"https://www.remotion.dev/docs/canvasimage",controls:P,_remotionInternalEffects:L,_remotionInternalIsMedia:{type:"image",src:e},_remotionInternalStack:T,_remotionInternalPremountDisplay:R||null,_remotionInternalPostmountDisplay:O||null,_remotionInternalIsPremounting:z,_remotionInternalIsPostmounting:F,outlineRef:M??H,children:d.jsx(bw,{ref:H,src:e,width:t,height:n,fit:r,effects:o,controls:P,className:i,style:B??void 0,id:a,onError:l,pauseWhenLoading:u,maxRetries:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,refForOutline:M??null,...D})})})}),Jf=Yn({Component:LC,componentName:"<CanvasImage>",componentIdentity:"dev.remotion.remotion.CanvasImage",schema:jC,supportsEffects:!0});Jf.displayName="CanvasImage";kt(Jf);var zC=({onLoad:e,onError:t,delayRenderRetries:n,delayRenderTimeoutInMilliseconds:r,...o},i)=>{const{delayRender:s,continueRender:a}=gn(),[l]=c.useState(()=>s(`Loading <IFrame> with source ${o.src}`,{retries:n??void 0,timeoutInMilliseconds:r??void 0})),u=c.useCallback(p=>{a(l),e==null||e(p)},[l,e,a]),f=c.useCallback(p=>{a(l),t?t(p):console.error("Error loading iframe:",p,"Handle the event using the onError() prop to make this message disappear.")},[l,t,a]);return d.jsx("iframe",{referrerPolicy:"strict-origin-when-cross-origin",...o,ref:i,onError:f,onLoad:u})};c.forwardRef(zC);function DC(e){return 1e3*2**(e-1)}var OC=({onError:e,maxRetries:t=2,src:n,pauseWhenLoading:r,delayRenderRetries:o,delayRenderTimeoutInMilliseconds:i,onImageFrame:s,crossOrigin:a,decoding:l,ref:u,refForOutline:f,...p})=>{const m=c.useRef(null),h=c.useRef({}),{delayPlayback:y}=ou(),g=c.useContext(tt),[E,v]=c.useState(!1),w=c.useCallback(L=>{m.current=L,f.current=L,typeof u=="function"?u(L):u&&(u.current=L)},[u,f]),x=Qr(n),b=c.useCallback(L=>{if(!m.current)return;const H=m.current.src;setTimeout(()=>{var R;if(!m.current)return;const O=(R=m.current)==null?void 0:R.src;O===H&&(m.current.removeAttribute("src"),m.current.setAttribute("src",O))},L)},[]),{delayRender:S,continueRender:C,cancelRender:k}=gn(),T=!!(g!=null&&g.premounting),P=!!(g!=null&&g.postmounting),j=c.useCallback(L=>{var H,O,R,I,_,F,z;if(h.current){if(h.current[(H=m.current)==null?void 0:H.src]=(h.current[(O=m.current)==null?void 0:O.src]??0)+1,e&&(h.current[(R=m.current)==null?void 0:R.src]??0)>t){e(L);return}if((h.current[(I=m.current)==null?void 0:I.src]??0)<=t){const B=DC(h.current[(_=m.current)==null?void 0:_.src]??0);console.warn(`Could not load image with source ${zn((F=m.current)==null?void 0:F.src)}, retrying again in ${B}ms`),b(B);return}try{k("Error loading image with src: "+zn((z=m.current)==null?void 0:z.src))}catch{}}},[k,t,e,b]);typeof window<"u"&&(c.useLayoutEffect(()=>{if(!(!r||!E||T||P))return y().unblock},[y,E,P,T,r]),c.useLayoutEffect(()=>{var I,_;if(((_=(I=window.process)==null?void 0:I.env)==null?void 0:_.NODE_ENV)==="test"){m.current&&(m.current.src=x);return}const{current:L}=m;if(!L)return;v(!0);const H=S("Loading <Img> with src="+zn(x),{retries:o??void 0,timeoutInMilliseconds:i??void 0});let O=!1;const R=()=>{var F,z,B;if(O){C(H);return}(h.current[(F=m.current)==null?void 0:F.src]??0)>0&&(delete h.current[(z=m.current)==null?void 0:z.src],console.info(`Retry successful - ${zn((B=m.current)==null?void 0:B.src)} is now loaded`)),L&&(s==null||s(L)),v(!1),C(H)};if(!m.current){R();return}return L.src=x,L.decode().then(R).catch(F=>{console.warn(F),L.complete&&L.naturalWidth>0&&L.naturalHeight>0?R():L.addEventListener("load",R)}),()=>{O=!0,L.removeEventListener("load",R),C(H)}},[x,o,i,s,C,S]));const{isClientSideRendering:M,isRendering:D}=Ke(),N=Zf({crossOrigin:a,requestsVideoFrame:!1,isClientSideRendering:M});return d.jsx("img",{...p,ref:w,crossOrigin:N,onError:j,decoding:D?"sync":l})},VC=({hidden:e,name:t,stack:n,showInTimeline:r,src:o,from:i,trimBefore:s,durationInFrames:a,freeze:l,premountFor:u,postmountFor:f,style:p,styleWhilePremounted:m,styleWhilePostmounted:h,controls:y,outlineRef:g,...E})=>{if(!o)throw new Error('No "src" prop was passed to <Img>.');const{effectivePostmountFor:v,effectivePremountFor:w,freezeFrame:x,isPremountingOrPostmounting:b,postmountingActive:S,premountingActive:C,premountingStyle:k}=ks({from:i??0,durationInFrames:a??1/0,premountFor:u??null,postmountFor:f??null,style:p??null,styleWhilePremounted:m??null,styleWhilePostmounted:h??null,hideWhilePremounted:"display-none"});return d.jsx(Ss,{frame:x,active:b,children:d.jsx(dt,{layout:"none",from:i??0,trimBefore:s,durationInFrames:a??1/0,freeze:l,_remotionInternalStack:n,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",_remotionInternalIsMedia:{type:"image",src:o},_remotionInternalPremountDisplay:w||null,_remotionInternalPostmountDisplay:v||null,_remotionInternalIsPremounting:C,_remotionInternalIsPostmounting:S,name:t??"<Img>",controls:y,showInTimeline:r??!0,hidden:e,outlineRef:g,children:d.jsx(OC,{src:o,refForOutline:g,style:k??void 0,...E})})})},BC=Jf,WC={src:{type:"asset",default:void 0,description:"Source",keyframable:!1},...Zn,...ti,..._n,...Tr,...Ir},HC=new Set(["alt","crossOrigin","decoding","fetchPriority","loading","onError","onImageFrame","onLoad","sizes","srcSet","useMap"]),UC=e=>Object.keys(e).filter(t=>e[t]!==void 0&&HC.has(t)),ZC=e=>e.map(t=>`"${t}"`).join(", "),YC=({props:e,ref:t,width:n,height:r})=>{if(typeof n=="string"||typeof r=="string")throw new 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".');const o=UC(e);if(t!=null&&o.unshift("ref"),o.length!==0)throw new Error(`The ${ZC(o)} prop${o.length===1?"":"s"} cannot be used on <Img> when effects are passed, because <Img> renders a <canvas> instead of a native <img>. Remove ${o.length===1?"this prop":"these props"}.`)},KC=e=>{const t=e==null?void 0:e.objectFit;if(t==="fill"||t==="contain"||t==="cover")return t},XC=({effects:e=[],ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:y,controls:g,width:E,height:v,className:w,style:x,id:b,pauseWhenLoading:S,maxRetries:C,delayRenderRetries:k,delayRenderTimeoutInMilliseconds:T,...P})=>{const j=c.useRef(null),M=Es(S);if(e.length===0)return d.jsx(VC,{...P,ref:t,hidden:n,name:r,stack:o,showInTimeline:i,src:s,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:y,controls:g,width:E,height:v,className:w,style:x,id:b,pauseWhenLoading:M,maxRetries:C,delayRenderRetries:k,delayRenderTimeoutInMilliseconds:T,outlineRef:j});if(!s)throw new Error('No "src" prop was passed to <Img>.');YC({props:P,ref:t,width:E,height:v});const D=typeof E=="number"?E:void 0,N=typeof v=="number"?v:void 0,L=P,H=KC(x)??"fill";return d.jsx(BC,{src:s,width:D,height:N,fit:H,effects:e,className:w,style:x,id:b,pauseWhenLoading:M,maxRetries:C,delayRenderRetries:k,delayRenderTimeoutInMilliseconds:T,from:a,trimBefore:l,durationInFrames:u,freeze:f,premountFor:p,postmountFor:m,styleWhilePremounted:h,styleWhilePostmounted:y,hidden:n,name:r??"<Img>",showInTimeline:i,stack:o,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/img",controls:g,outlineRef:j,...L})},ep=Yn({Component:XC,componentName:"<Img>",componentIdentity:"dev.remotion.remotion.Img",schema:WC,supportsEffects:!0});kt(ep);var GC=e=>{if(e==="remotion")return"dev.remotion.remotion";if(e.startsWith("@remotion/"))return`dev.remotion.${e.slice(10).replace(/-([a-z])/g,(n,r)=>r.toUpperCase())}`;throw new Error(`Unsupported Remotion package name: ${e}`)},Sw=({packageName:e,componentName:t})=>`${GC(e)}.${t}`,tp={...Zn,..._n},qC={...tp,...Tr},Ew={...qC,...Ir},QC={...Ew,...Bl,...h0},JC={...tp,...Bl,...h0},e2=(e,t)=>{typeof e=="function"?e(t):e&&(e.current=t)},kw=e=>{const t=Yn(e);return kt(t),t},fl=(e,t,n)=>{const r=c.forwardRef((i,s)=>{const{durationInFrames:a,from:l,trimBefore:u,freeze:f,hidden:p,name:m,showInTimeline:h,stack:y,controls:g,...E}=i,v=c.useRef(null),w=c.useCallback(x=>{v.current=x,e2(s,x)},[s]);return d.jsx(dt,{layout:"none",from:l??0,trimBefore:u,durationInFrames:a??1/0,freeze:f,hidden:p,name:m??t,showInTimeline:h??!0,controls:g,_remotionInternalStack:y,_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/interactive",outlineRef:v,children:ne.createElement(e,{...E,ref:w})})});r.displayName=t;const o=kw({Component:r,componentName:t,componentIdentity:Sw({packageName:"remotion",componentName:t.slice(1,-1)}),schema:n,supportsEffects:!1});return o.displayName=t,o},Re=(e,t)=>fl(e,t,QC),lo=(e,t)=>fl(e,t,tp),Jn={baseSchema:Zn,transformSchema:_n,textSchema:Bl,backgroundSchema:Tr,borderSchema:Ir,premountSchema:ti,sequenceSchema:Zo,withSchema:kw,_internalMakeRemotionComponentIdentity:Sw,A:Re("a","<Interactive.A>"),Article:Re("article","<Interactive.Article>"),Aside:Re("aside","<Interactive.Aside>"),Button:Re("button","<Interactive.Button>"),Circle:lo("circle","<Interactive.Circle>"),Code:Re("code","<Interactive.Code>"),Div:Re("div","<Interactive.Div>"),Ellipse:lo("ellipse","<Interactive.Ellipse>"),Em:Re("em","<Interactive.Em>"),Footer:Re("footer","<Interactive.Footer>"),G:lo("g","<Interactive.G>"),H1:Re("h1","<Interactive.H1>"),H2:Re("h2","<Interactive.H2>"),H3:Re("h3","<Interactive.H3>"),H4:Re("h4","<Interactive.H4>"),H5:Re("h5","<Interactive.H5>"),H6:Re("h6","<Interactive.H6>"),Header:Re("header","<Interactive.Header>"),Label:Re("label","<Interactive.Label>"),Li:Re("li","<Interactive.Li>"),Line:lo("line","<Interactive.Line>"),Main:Re("main","<Interactive.Main>"),Nav:Re("nav","<Interactive.Nav>"),Ol:Re("ol","<Interactive.Ol>"),P:Re("p","<Interactive.P>"),Path:lo("path","<Interactive.Path>"),Pre:Re("pre","<Interactive.Pre>"),Rect:lo("rect","<Interactive.Rect>"),Section:Re("section","<Interactive.Section>"),Small:Re("small","<Interactive.Small>"),Span:Re("span","<Interactive.Span>"),Strong:Re("strong","<Interactive.Strong>"),Svg:fl("svg","<Interactive.Svg>",Ew),Text:fl("text","<Interactive.Text>",JC),Ul:Re("ul","<Interactive.Ul>")},t2=async({resolvedSrc:e,signal:t,requestInit:n,contentType:r})=>{const{decoder:o,selectedTrack:i}=await X0({resolvedSrc:e,signal:t,requestInit:n,contentType:r});try{const{image:s}=await o.decode({frameIndex:i.frameCount-1,completeFramesOnly:!0});try{if(s.duration===null)throw new Error("Could not determine animated image duration");return(s.timestamp+s.duration)/1e6}finally{s.close()}}finally{o.close()}},Cw=ne.createRef(),n2=({children:e,onlyRenderComposition:t,currentCompositionMetadata:n,initialCompositions:r,initialCanvasContent:o})=>{const[i,s]=c.useState([]),[a,l]=c.useState(o),[u,f]=c.useState(r),p=c.useRef(u),m=c.useCallback(x=>{f(b=>{const S=x(b);return p.current=S,S})},[]),h=c.useCallback(x=>{m(b=>{if(b.find(S=>S.id===x.id))throw new Error(`Multiple composition with id ${x.id} are registered.`);return[...b,x]})},[m]),y=c.useCallback(x=>{f(b=>b.filter(S=>S.id!==x))},[]),g=c.useCallback((x,b,S,C)=>{s(k=>[...k,{name:x,parent:b,nonce:S,stack:C}])},[]),E=c.useCallback((x,b)=>{s(S=>S.filter(C=>!(C.name===x&&C.parent===b)))},[]);c.useImperativeHandle(Cw,()=>({getCompositions:()=>p.current}),[]);const v=c.useMemo(()=>({registerComposition:h,unregisterComposition:y,registerFolder:g,unregisterFolder:E,setCanvasContent:l,onlyRenderComposition:t}),[h,g,y,E,t]),w=c.useMemo(()=>({compositions:u,folders:i,currentCompositionMetadata:n,canvasContent:a}),[u,i,n,a]);return d.jsx(qo.Provider,{value:w,children:d.jsx(ys.Provider,{value:v,children:e})})},Iw={};Uy(Iw,{makeDefaultPreviewCSS:()=>o2,injectCSS:()=>r2,OBJECTFIT_CONTAIN_CLASS_NAME:()=>cs});var aa={},r2=e=>{if(typeof document>"u")return()=>{};if(aa[e])return()=>{};const t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");return n.appendChild(document.createTextNode(e)),t.prepend(n),aa[e]=n,()=>{const r=aa[e];r&&(r.parentNode&&r.parentNode.removeChild(r),delete aa[e])}},cs="__remotion_objectfitcontain",o2=(e,t)=>e?`
|
|
58
|
+
${e} * {
|
|
59
|
+
box-sizing: border-box;
|
|
60
|
+
}
|
|
61
|
+
${e} *:-webkit-full-screen {
|
|
62
|
+
width: 100%;
|
|
63
|
+
height: 100%;
|
|
64
|
+
}
|
|
65
|
+
${e} .${cs} {
|
|
66
|
+
object-fit: contain;
|
|
67
|
+
}
|
|
68
|
+
`:`
|
|
69
|
+
* {
|
|
70
|
+
box-sizing: border-box;
|
|
71
|
+
}
|
|
72
|
+
body {
|
|
73
|
+
margin: 0;
|
|
74
|
+
background-color: ${t};
|
|
75
|
+
}
|
|
76
|
+
.${cs} {
|
|
77
|
+
object-fit: contain;
|
|
78
|
+
}
|
|
79
|
+
`,Tw="__remotion-studio-container",i2=()=>document.getElementById(Tw),s2=ne.createContext(null),a2=null,Qu=[],l2=()=>a2,u2=e=>(Qu.push(e),()=>{Qu=Qu.filter(t=>t!==e)}),np=c.createContext(null),c2=()=>{const e=c.useContext(np);return!e||e.videoEnabled===null?window.remotion_videoEnabled:e.videoEnabled},d2=()=>{const e=c.useContext(np);return!e||e.audioEnabled===null?window.remotion_audioEnabled:e.audioEnabled},f2=({children:e,videoEnabled:t,audioEnabled:n})=>{const r=c.useMemo(()=>({videoEnabled:t,audioEnabled:n}),[t,n]);return d.jsx(np.Provider,{value:r,children:e})},p2=({children:e,numberOfAudioTags:t,logLevel:n,audioLatencyHint:r,previewSampleRate:o,videoEnabled:i,audioEnabled:s,frameState:a})=>{const l=c.useMemo(()=>{let f=0;return{getNonce:()=>f++}},[]),u=c.useMemo(()=>({logLevel:n,mountTime:Date.now()}),[n]);return d.jsx(Xr.Provider,{value:u,children:d.jsx(ws.Provider,{value:l,children:d.jsx(uE,{frameState:a,children:d.jsx(f2,{videoEnabled:i,audioEnabled:s,children:d.jsx(Qy,{children:d.jsx(ew,{children:d.jsx(hE,{children:d.jsx(nw,{children:d.jsx(uw,{children:d.jsx(rw,{audioLatencyHint:r,audioEnabled:s,previewSampleRate:o,children:d.jsx(ow,{numberOfAudioTags:t,children:e})})})})})})})})})})})},lh=["h264","h265","vp8","vp9","av1","mp3","aac","wav","prores","h264-mkv","h264-ts","gif"];function m2(e,t,n){if(!(typeof e>"u")){if(typeof e!="string")throw new TypeError(`The "${n}" prop ${t} must be a string, but you passed a value of type ${typeof e}.`);if(!lh.includes(e))throw new Error(`The "${n}" prop ${t} must be one of ${lh.join(", ")}, but you passed ${e}.`)}}var h2=({calculated:e,compositionId:t,compositionFps:n,compositionHeight:r,compositionWidth:o,compositionDurationInFrames:i})=>{const s=`calculated by calculateMetadata() for the composition "${t}"`,a=`of the "<Composition />" component with the id "${t}"`,l=(e==null?void 0:e.width)??o??void 0;sl(l,"width",e!=null&&e.width?s:a);const u=(e==null?void 0:e.height)??r??void 0;sl(u,"height",e!=null&&e.height?s:a);const f=(e==null?void 0:e.fps)??n??null;Ll(f,e!=null&&e.fps?s:a);const p=(e==null?void 0:e.durationInFrames)??i??null;Nl(p,{allowFloats:!1,component:`of the "<Composition />" component with the id "${t}"`});const m=e==null?void 0:e.defaultCodec;m2(m,s,"defaultCodec");const h=e==null?void 0:e.defaultOutName,y=e==null?void 0:e.defaultVideoImageFormat,g=e==null?void 0:e.defaultPixelFormat,E=e==null?void 0:e.defaultProResProfile,v=e==null?void 0:e.defaultSampleRate;return{width:l,height:u,fps:f,durationInFrames:p,defaultCodec:m,defaultOutName:h,defaultVideoImageFormat:y,defaultPixelFormat:g,defaultProResProfile:E,defaultSampleRate:v}},uh=({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionId:o,compositionWidth:i,defaultProps:s,originalProps:a})=>{const l=h2({calculated:e,compositionDurationInFrames:t,compositionFps:n,compositionHeight:r,compositionWidth:i,compositionId:o});return{metadataSource:{durationInFrames:(e==null?void 0:e.durationInFrames)===void 0?"composition":"calculate-metadata",fps:(e==null?void 0:e.fps)===void 0?"composition":"calculate-metadata",height:(e==null?void 0:e.height)===void 0?"composition":"calculate-metadata",width:(e==null?void 0:e.width)===void 0?"composition":"calculate-metadata"},videoConfig:{...l,id:o,defaultProps:pd(s??{}),props:pd((e==null?void 0:e.props)??a),defaultCodec:l.defaultCodec??null,defaultOutName:l.defaultOutName??null,defaultVideoImageFormat:l.defaultVideoImageFormat??null,defaultPixelFormat:l.defaultPixelFormat??null,defaultProResProfile:l.defaultProResProfile??null,defaultSampleRate:l.defaultSampleRate??null}}},Rw=({calculateMetadata:e,signal:t,defaultProps:n,inputProps:r,compositionId:o,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l})=>{const u=e?e({defaultProps:n,props:r,abortSignal:t,compositionId:o,isRendering:En().isRendering}):null;return u!==null&&typeof u=="object"&&"then"in u?u.then(f=>uh({calculated:f,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})):uh({calculated:u,compositionDurationInFrames:i,compositionFps:s,compositionHeight:a,compositionWidth:l,compositionId:o,defaultProps:n,originalProps:r})},_w=e=>{const t=Rw(e);return typeof t=="object"&&"then"in t?t.then(({videoConfig:n})=>n):t.videoConfig},g2=e=>{try{return{type:"success",result:Rw(e)}}catch(t){return{type:"error",error:t}}},v2=e=>{try{return{type:"success",result:_w(e)}}catch(t){return{type:"error",error:t}}},y2=ne.createContext(()=>{}),w2=()=>{if(En().isRendering){const e=window.remotion_envVariables;return e?{...JSON.parse(e),NODE_ENV:"production"}:{}}return{NODE_ENV:"production"}},x2=()=>{const e=w2();window.process||(window.process={}),window.process.env||(window.process.env={}),Object.keys(e).forEach(t=>{window.process.env[t]=e[t]})},b2=ne.createContext(null),S2=c.createContext({setSize:()=>{},size:{size:"auto",translation:{x:0,y:0}}}),E2=({canvasSize:e,compositionHeight:t,compositionWidth:n,previewSize:r})=>{const o=e.height/t,i=e.width/n,s=Math.min(o,i);return r==="auto"?s===0?1:s:Number(r)},k2=ne.createContext(null),C2=({src:e,transparent:t,currentTime:n,toneMapped:r})=>`http://localhost:${window.remotion_proxyPort}/proxy?src=${encodeURIComponent(Tn(e))}&time=${encodeURIComponent(Math.max(0,n))}&transparent=${String(t)}&toneMapped=${String(r)}`,I2=({onError:e,volume:t,playbackRate:n,src:r,muted:o,allowAmplificationDuringRender:i,transparent:s,toneMapped:a,toneFrequency:l,name:u,loopVolumeCurveBehavior:f,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onVideoFrame:h,crossOrigin:y,audioStreamIndex:g,preservePitch:E,...v})=>{const w=Cr(),x=ct(),b=ii(f),S=Vl(),C=c.useContext(tt),k=Wr(),{registerRenderAsset:T,unregisterRenderAsset:P}=c.useContext(qr);if(!r)throw new TypeError("No `src` was passed to <OffthreadVideo>.");const j=c.useMemo(()=>`offthreadvideo-${Gr(r)}-${C==null?void 0:C.cumulatedFrom}-${C==null?void 0:C.relativeFrom}-${C==null?void 0:C.durationInFrames}`,[r,C==null?void 0:C.cumulatedFrom,C==null?void 0:C.relativeFrom,C==null?void 0:C.durationInFrames]);if(!S)throw new Error("No video config found");const M=Jr({volume:t,frame:b,mediaVolume:1});ai(M),c.useEffect(()=>{if(!r)throw new Error("No src passed");if(window.remotion_audioEnabled&&!o&&!(M<=0))return T({type:"video",src:Tn(r),id:j,frame:w,volume:M,mediaFrame:x,playbackRate:n,toneFrequency:l,audioStartFrame:Math.max(0,-((C==null?void 0:C.cumulatedNegativeFrom)??0)),audioStreamIndex:g}),()=>P(j)},[o,r,T,j,P,M,x,w,n,l,C==null?void 0:C.cumulatedNegativeFrom,g]);const D=c.useMemo(()=>dw({frame:x,playbackRate:n||1,startFrom:-k})/S.fps,[x,k,n,S.fps]),N=c.useMemo(()=>C2({src:r,currentTime:D,transparent:s,toneMapped:a}),[a,D,r,s]),[L,H]=c.useState(null),{delayRender:O,continueRender:R}=gn();c.useLayoutEffect(()=>{if(!window.remotion_videoEnabled)return;const z=[];H(null);const B=new AbortController,Y=O(`Fetching ${N} from server`,{retries:p??void 0,timeoutInMilliseconds:m??void 0});return(async()=>{try{const A=await fetch(N,{signal:B.signal,cache:"no-store"});if(A.status!==200){if(A.status===500){const V=await A.json();if(V.error){const U=V.error.replace(/^Error: /,"");throw new Error(U)}}throw new Error(`Server returned status ${A.status} while fetching ${N}`)}const X=await A.blob(),Z=URL.createObjectURL(X);z.push(()=>URL.revokeObjectURL(Z)),H({src:Z,handle:Y})}catch(A){if(A.message.includes("aborted")){R(Y);return}if(B.signal.aborted){R(Y);return}A.message.includes("Failed to fetch")&&(A=new 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:A})),e?e(A):us(A)}})(),z.push(()=>{B.signal.aborted||B.abort()}),()=>{z.forEach(A=>A())}},[N,p,m,e,R,O]);const I=c.useCallback(()=>{e?e==null||e(new Error("Failed to load image with src "+L)):us("Failed to load image with src "+L)},[L,e]),_=c.useMemo(()=>[cs,v.className].filter(Qo).join(" "),[v.className]),F=c.useCallback(z=>{h&&h(z)},[h]);return!L||!window.remotion_videoEnabled?null:(R(L.handle),d.jsx(ep,{src:L.src,delayRenderRetries:p,delayRenderTimeoutInMilliseconds:m,onImageFrame:F,...v,onError:I,className:_}))},Pw=({ref:e,onVideoFrame:t})=>{c.useEffect(()=>{const{current:n}=e;if(!n||!t)return;let r=0;const o=(i,s)=>{e.current&&(t(e.current,i,s),r=e.current.requestVideoFrameCallback(o))};if(t(n),!!n.requestVideoFrameCallback)return r=n.requestVideoFrameCallback(o),()=>{r&&n.cancelVideoFrameCallback(r)}},[t,e])};class Ro extends Error{constructor({message:n,src:r}){super(n);Se(this,"src");this.name="MediaPlaybackError",this.src=r}}var T2=(e,t)=>{const n=c.useContext(oi);if(!n)throw new Error("SharedAudioContext not found");const r=c.useRef(null),o=c.useMemo(()=>n.audioContext?Yf({audioContext:n.audioContext,ref:r}):null,[n.audioContext]);(ne.useInsertionEffect??ne.useLayoutEffect)(()=>()=>{requestAnimationFrame(()=>{o==null||o.cleanup()})},[o]);const{volume:s,muted:a,playbackRate:l,preservePitch:u,onlyWarnForMediaSeekingError:f,src:p,onDuration:m,acceptableTimeShift:h,acceptableTimeShiftInSeconds:y,toneFrequency:g,name:E,_remotionInternalNativeLoopPassed:v,_remotionInternalStack:w,style:x,pauseWhenBuffering:b,showInTimeline:S,loopVolumeCurveBehavior:C,onError:k,onAutoPlayError:T,onVideoFrame:P,crossOrigin:j,delayRenderRetries:M,delayRenderTimeoutInMilliseconds:D,allowAmplificationDuringRender:N,useWebAudioApi:L,audioStreamIndex:H,...O}=e,R=ii(C??"repeat"),{fps:I,durationInFrames:_}=qe(),F=c.useContext(tt),z=Rn(),B=bs(),[Y]=c.useState(()=>String(Math.random()));if(typeof h<"u")throw new Error("acceptableTimeShift has been removed. Use acceptableTimeShiftInSeconds instead.");const[$]=qf(),[A]=Qf(),X=Jr({frame:R,volume:s,mediaVolume:$});ai(X);const Z=c.useCallback(()=>w??null,[w]);Kf({volume:s,mediaVolume:$,mediaType:"video",src:p,playbackRate:e.playbackRate??1,displayName:E??null,id:Y,getStack:Z,showInTimeline:S,premountDisplay:(F==null?void 0:F.premountDisplay)??null,postmountDisplay:(F==null?void 0:F.postmountDisplay)??null,loopDisplay:void 0,documentationLink:f?"https://www.remotion.dev/docs/offthreadvideo":"https://www.remotion.dev/docs/html5-video",refForOutline:r}),pw({mediaRef:r,src:p,mediaType:"video",playbackRate:e.playbackRate??1,preservePitch:u,onlyWarnForMediaSeekingError:f,acceptableTimeshift:y??null,isPremounting:!!(F!=null&&F.premounting),isPostmounting:!!(F!=null&&F.postmounting),pauseWhenBuffering:b,onAutoPlayError:T??null}),mw({id:Y,isPostmounting:!!(F!=null&&F.postmounting),isPremounting:!!(F!=null&&F.premounting),mediaRef:r,mediaType:"video",onAutoPlayError:T??null}),sw({logLevel:z,mediaRef:r,volume:X,source:o,shouldUseWebAudioApi:L??!1});const V=F?F.relativeFrom:0,U=F?Math.min(F.durationInFrames,_):_,se=Qr(p),de=sC({actualSrc:se,actualFrom:V,duration:U,fps:I});c.useImperativeHandle(t,()=>r.current,[]),c.useState(()=>yt({logLevel:z,message:`Mounting video with source = ${de}, v=${Fi}, user agent=${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"video",mountTime:B})),c.useEffect(()=>{const{current:Q}=r;if(!Q)return;const G=()=>{var fe;if(Q.error){if(console.error("Error occurred in video",Q==null?void 0:Q.error),k){const Ee=new Ro({message:`Code ${Q.error.code}: ${Q.error.message}`,src:p});k(Ee);return}throw new Ro({message:`The browser threw an error while playing the video ${p}: Code ${Q.error.code} - ${(fe=Q==null?void 0:Q.error)==null?void 0:fe.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:p})}else{if(k){const Ee=new Ro({message:`The browser threw an error while playing the video ${p}`,src:p});k(Ee);return}throw new Ro({message:"The browser threw an error while playing the video",src:p})}};return Q.addEventListener("error",G,{once:!0}),()=>{Q.removeEventListener("error",G)}},[k,p]);const ae=c.useRef(m);ae.current=m,Pw({ref:r,onVideoFrame:P}),c.useEffect(()=>{var fe;const{current:Q}=r;if(!Q)return;if(Q.duration){(fe=ae.current)==null||fe.call(ae,p,Q.duration);return}const G=()=>{var Ee;(Ee=ae.current)==null||Ee.call(ae,p,Q.duration)};return Q.addEventListener("loadedmetadata",G),()=>{Q.removeEventListener("loadedmetadata",G)}},[p]),c.useEffect(()=>{const{current:Q}=r;Q&&(ru()?Q.preload="metadata":Q.preload="auto")},[]);const te=c.useMemo(()=>({...x}),[x]),J=Zf({crossOrigin:j,requestsVideoFrame:!!P,isClientSideRendering:!1});return d.jsx("video",{...O,ref:r,muted:a||A||X<=0,playsInline:!0,src:de,loop:v,style:te,disableRemotePlayback:!0,crossOrigin:J,controls:!1})},rp=c.forwardRef(T2),op=e=>{const{startFrom:t,endAt:n,trimBefore:r,trimAfter:o,name:i,pauseWhenBuffering:s,stack:a,showInTimeline:l,...u}=e,f=Ke(),p=Es(s);if(f.isClientSideRendering)throw new Error("<OffthreadVideo> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const m=c.useCallback(()=>{},[]);if(typeof e.src!="string")throw new TypeError(`The \`<OffthreadVideo>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);eu({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});const{trimBeforeValue:h,trimAfterValue:y}=tu({startFrom:t,endAt:n,trimBefore:r,trimAfter:o});if(typeof h<"u"||typeof y<"u")return d.jsx(dt,{layout:"none",from:0-(h??0),showInTimeline:!1,durationInFrames:y,name:i,children:d.jsx(op,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0})});if(Jl(e,"Video"),f.isRendering)return d.jsx(I2,{pauseWhenBuffering:p,...u,trimAfter:void 0,name:void 0,showInTimeline:l,trimBefore:void 0,stack:void 0,startFrom:void 0,endAt:void 0});const{transparent:g,toneMapped:E,onAutoPlayError:v,onVideoFrame:w,crossOrigin:x,delayRenderRetries:b,delayRenderTimeoutInMilliseconds:S,...C}=u;return d.jsx(rp,{_remotionInternalStack:a??null,onDuration:m,onlyWarnForMediaSeekingError:!0,pauseWhenBuffering:p,showInTimeline:l??!0,onAutoPlayError:v??void 0,onVideoFrame:w??null,crossOrigin:x,...C,_remotionInternalNativeLoopPassed:!1})},Fw=({src:e,acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n,audioStreamIndex:r,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a,muted:l,name:u,onAutoPlayError:f,onError:p,onVideoFrame:m,pauseWhenBuffering:h,playbackRate:y,preservePitch:g,showInTimeline:E,style:v,toneFrequency:w,toneMapped:x,transparent:b,trimAfter:S,trimBefore:C,useWebAudioApi:k,volume:T,_remotionInternalNativeLoopPassed:P,endAt:j,stack:M,startFrom:D,imageFormat:N,...L})=>{if(N)throw new TypeError("The `<OffthreadVideo>` tag does no longer accept `imageFormat`. Use the `transparent` prop if you want to render a transparent video.");return d.jsx(op,{acceptableTimeShiftInSeconds:t,allowAmplificationDuringRender:n??!0,audioStreamIndex:r??0,crossOrigin:o,delayRenderRetries:i,delayRenderTimeoutInMilliseconds:s,loopVolumeCurveBehavior:a??"repeat",muted:l??!1,name:u,onAutoPlayError:f??null,onError:p,onVideoFrame:m,pauseWhenBuffering:Es(h),playbackRate:y??1,preservePitch:g,toneFrequency:w??1,showInTimeline:E??!0,src:e,stack:M,startFrom:D,_remotionInternalNativeLoopPassed:P??!1,endAt:j,style:v,toneMapped:x??!0,transparent:b??!1,trimAfter:S,trimBefore:C,useWebAudioApi:k??!1,volume:T,...L})};kt(Fw);var R2="remotion_staticFilesChanged";function _2(){const e=ne.useContext(qo),t=ne.useContext(ei),n=ne.useContext(Jo),r=ne.useContext(tt),o=ne.useContext(ws),i=ne.useContext(Kr),s=ne.useContext(Ql),a=ne.useContext(zl),l=ne.useContext(qr),u=ne.useContext(ni),f=ne.useContext(Wl),p=ne.useContext(Ul),m=ne.useContext(si),h=ne.useContext(Xr);return c.useMemo(()=>({compositionManagerCtx:e,timelineContext:t,setTimelineContext:n,sequenceContext:r,nonceContext:o,canUseRemotionHooksContext:i,preloadContext:s,resolveCompositionContext:a,renderAssetManagerContext:l,sequenceManagerContext:u,sequenceManagerRefContext:f,visualModePropStatusesRefContext:p,bufferManagerContext:m,logLevelContext:h}),[e,o,r,n,t,i,s,a,l,u,f,p,m,h])}var P2=e=>{const{children:t,contexts:n}=e;return d.jsx(Xr.Provider,{value:n.logLevelContext,children:d.jsx(Kr.Provider,{value:n.canUseRemotionHooksContext,children:d.jsx(ws.Provider,{value:n.nonceContext,children:d.jsx(Ql.Provider,{value:n.preloadContext,children:d.jsx(qo.Provider,{value:n.compositionManagerCtx,children:d.jsx(Wl.Provider,{value:n.sequenceManagerRefContext,children:d.jsx(ni.Provider,{value:n.sequenceManagerContext,children:d.jsx(Ul.Provider,{value:n.visualModePropStatusesRefContext,children:d.jsx(qr.Provider,{value:n.renderAssetManagerContext,children:d.jsx(zl.Provider,{value:n.resolveCompositionContext,children:d.jsx(ei.Provider,{value:n.timelineContext,children:d.jsx(Jo.Provider,{value:n.setTimelineContext,children:d.jsx(tt.Provider,{value:n.sequenceContext,children:d.jsx(si.Provider,{value:n.bufferManagerContext,children:t})})})})})})})})})})})})})})},F2=c.createRef(),ie={MaxMediaCacheSizeContext:s2,useUnsafeVideoConfig:Vl,useFrameForVolumeProp:ii,useTimelinePosition:Cr,useAbsoluteTimelinePosition:f0,evaluateVolume:Jr,getAbsoluteSrc:Tn,getAnimatedImageDurationInSeconds:t2,getAssetDisplayName:aw,Timeline:gd,validateMediaTrimProps:eu,validateMediaProps:Jl,resolveTrimProps:tu,VideoForPreview:rp,CompositionManager:qo,CompositionSetters:ys,VisualModePropStatusesContext:Hl,VisualModePropStatusesRefContext:Ul,VisualModeDragOverridesContext:Zl,VisualModeSettersContext:b0,SequenceManager:ni,SequenceManagerRefContext:Wl,SequenceStackTracesUpdateContext:y2,baseSchema:Zn,sequenceSchema:Zo,SequenceWithoutSchema:H0,sequenceStyleSchema:v0,sequenceVisualStyleSchema:cE,sequencePremountSchema:g0,textSchema:Bl,transformSchema:_n,premountSchema:ti,flattenActiveSchema:Wf,getFlatSchemaWithAllKeys:Hf,RemotionRootContexts:p2,CompositionManagerProvider:n2,useVideo:Ol,getRoot:l2,useMediaVolumeState:qf,usePlayerMutedState:Qf,useMediaInTimeline:Kf,useLazyComponent:n0,truthy:Qo,SequenceContext:tt,PremountContext:E0,usePremounting:ks,useRemotionContexts:_2,RemotionContextProvider:P2,CSSUtils:Iw,setupEnvVariables:x2,MediaVolumeContext:Xf,SetMediaVolumeContext:Gf,getRemotionEnvironment:En,SharedAudioContext:oi,SharedAudioContextProvider:rw,SharedAudioTagsContext:nu,SharedAudioTagsContextProvider:ow,invalidCompositionErrorMessage:JS,invalidFolderNameErrorMessage:SS,calculateMediaDuration:Gl,isCompositionIdValid:o0,isFolderNameValid:Ky,getPreviewDomElement:i2,compositionsRef:Cw,portalNode:md,waitForRoot:u2,SetTimelineContext:Jo,CanUseRemotionHooksProvider:cd,CanUseRemotionHooks:Kr,PrefetchProvider:ew,DurationsContextProvider:nw,IsPlayerContextProvider:IS,useIsPlayer:_f,EditorPropsProvider:Qy,EditorPropsContext:Pf,usePreload:Qr,NonceContext:ws,resolveVideoConfig:_w,resolveVideoConfigOrCatch:v2,resolveVideoConfigWithMetadataOrCatch:g2,ResolveCompositionContext:zl,useResolvedVideoConfig:Ff,resolveCompositionsRef:NS,REMOTION_STUDIO_CONTAINER_ELEMENT:Tw,RenderAssetManager:qr,persistCurrentFrame:a0,usePlaybackRate:Nf,useTimelineContext:kr,useTimelineSetFrame:p0,isIosSafari:ru,WATCH_REMOTION_STATIC_FILES:R2,addSequenceStackTraces:kt,useMediaStartsAt:Wr,BufferingProvider:uw,BufferingContextReact:si,getComponentsToAddStacksTo:rE,getSequenceComponent:iE,getSingleChildComponent:sE,CurrentScaleContext:b2,PixelDensityContext:k2,PreviewSizeContext:S2,calculateScale:E2,validateRenderAsset:Q0,Log:ot,LogLevelContext:Xr,useLogLevel:Rn,playbackLogging:yt,timeValueRef:AS,compositionSelectorRef:F2,RemotionEnvironmentContext:Jy,warnAboutTooHighVolume:ai,AudioForPreview:hw,OBJECTFIT_CONTAIN_CLASS_NAME:cs,InnerOffthreadVideo:op,useBasicMediaInTimeline:lw,getInputPropsOverride:qy,setInputPropsOverride:jS,useVideoEnabled:c2,useAudioEnabled:d2,useIsPlayerBuffering:cw,TimelinePosition:gd,DelayRenderContextType:t0,TimelineContext:ei,PlaybackRateContext:Mf,AbsoluteTimeContext:$f,RenderAssetManagerProvider:Wk,getEffectiveVisualModeValue:N0,CompositionRenderErrorContext:Zy,useEffectChainState:_s,createEffectChainState:K0,cleanupEffectChainState:yd,runEffectChain:Rs,useMemoizedEffects:Ts,useMemoizedEffectDefinitions:Is,createEffect:Ok,createWebGLContextError:kk,createWebGL2ContextError:Y0,computeEffectiveSchemaValuesDotNotation:V0,interpolateKeyframedStatus:Cs,makeStaticDragOverride:dk,makeKeyframedDragOverride:fk,resolveDragOverrideValue:Kl,getStaticDragOverrideValue:pk,OverrideIdsToNodePathsGettersContext:Bf,OverrideIdsToNodePathsSettersContext:ak,findPropsToDelete:D0,makeSequencePropsSubscriptionKey:An,getPropStatusesCtx:z0,getEffectPropStatusesCtx:L0,hiddenField:Lf,durationInFramesField:Df,freezeField:Of,fromField:w0},jw=e=>ne.Children.toArray(e).reduce((n,r)=>r.type===ne.Fragment?n.concat(jw(r.props.children)):(n.push(r),n),[]),j2={durationInFrames:Jn.baseSchema.durationInFrames,name:Jn.sequenceSchema.name,hidden:Jn.sequenceSchema.hidden,showInTimeline:Jn.sequenceSchema.showInTimeline,freeze:Jn.baseSchema.freeze,trimBefore:Jn.sequenceSchema.trimBefore,layout:Jn.sequenceSchema.layout},M2=c.forwardRef(({offset:e=0,className:t="",stack:n=null,_remotionInternalRender:r=null,...o},i)=>(vE(),r?r({...o,offset:e,className:t||void 0,stack:n},i):d.jsx(S0,{children:o.children}))),Mw=Jn.withSchema({Component:M2,componentName:"<Series.Sequence>",componentIdentity:"dev.remotion.remotion.Series.Sequence",schema:j2,supportsEffects:!1}),$2=H0,ch=({durationInFrames:e,offset:t,index:n,childrenLength:r})=>{const o=`index = ${n}, duration = ${e}`;(n!==r-1||e!==1/0)&&Nl(e,{component:"of a <Series.Sequence /> component",allowFloats:!0});const i=t??0;if(Number.isNaN(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${o}).`);if(!Number.isFinite(i))throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);if(i%1!==0)throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${i} (${o}).`);return i},A2=e=>{const t=c.useMemo(()=>{const n=jw(e.children),r=(o,i)=>{if(o===n.length)return null;const a=n[o];if(typeof a=="string"){if(a.trim()==="")return r(o+1,i);throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${a}"`)}if(a.type!==Mw)throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${a} instead`);const l=a;return ch({durationInFrames:l.props.durationInFrames,offset:l.props.offset,index:o,childrenLength:n.length}),ne.cloneElement(l,{_remotionInternalRender:(u,f)=>{const p=u.durationInFrames,{durationInFrames:m,children:h,offset:y,controls:g,stack:E,from:v,name:w,...x}=u,b=ch({durationInFrames:p,offset:y,index:o,childrenLength:n.length}),S=i+b,C=i+p+b;return d.jsxs(d.Fragment,{children:[d.jsx($2,{ref:f,name:w||"<Series.Sequence>",_remotionInternalDocumentationLink:w?void 0:"https://www.remotion.dev/docs/series",_remotionInternalStack:E??void 0,controls:g??void 0,from:S,durationInFrames:p,...x,children:d.jsx(S0,{children:h})}),r(o+1,C)]})}})};return r(0,0)},[e.children]);return d.jsx(gE,{children:d.jsx(dt,{layout:"none",name:"<Series>",_remotionInternalDocumentationLink:"https://www.remotion.dev/docs/series",...e,children:t})})},N2=Object.assign(Yn({Component:A2,componentName:"<Series>",componentIdentity:"dev.remotion.remotion.Series",schema:mE,supportsEffects:!1}),{Sequence:Mw});kt(N2);var L2={"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";"},dh={},z2=e=>{dh[e]||(console.warn(e),dh[e]=!0)},D2=e=>{for(const t of Object.keys(L2))if(e.includes(t))return{containsHex:!0,hexCode:t};return{containsHex:!1}},Sd=e=>e.startsWith("/")?Sd(e.substring(1)):e,O2=e=>{if(typeof window<"u"&&window.remotion_staticBase){if(e.startsWith(window.remotion_staticBase))throw new 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}/${Sd(e)}`}return`/${Sd(e)}`},V2=e=>e.split("/").map(o=>encodeURIComponent(o)).join("/"),$w=e=>{if(e===null)throw new TypeError("null was passed to staticFile()");if(typeof e>"u")throw new TypeError("undefined was passed to staticFile()");if(e.startsWith("http://")||e.startsWith("https://"))throw new 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 new 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 new 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 new TypeError(`Do not include the public/ prefix when using staticFile() - got "${e}". See: https://remotion.dev/docs/staticfile-relative-paths`);const t=D2(e);t.containsHex&&z2(`WARNING: You seem to pass an already encoded path (path contains ${t.hexCode}). Since Remotion 4.0, the encoding is done by staticFile() itself. You may want to remove a encodeURIComponent() wrapping.`);const n=V2(e),r=O2(n);return r.startsWith("/")?r:`/${r}`},B2=e=>{const t={...e,durationInFrames:1,fps:1};return ne.createElement(al,t)};kt(B2);var fh=e=>Math.round(e*1e5)/1e5,Ju=({element:e,desiredTime:t,logLevel:n,mountTime:r})=>{if(dl(e.currentTime,t))return{wait:Promise.resolve(t),cancel:()=>{}};Ma({logLevel:n,mediaRef:e,time:t,why:"Seeking during rendering",mountTime:r});let o,i=null;const s=new Promise(l=>{o=e.requestVideoFrameCallback((u,f)=>{const p=f.expectedDisplayTime-u;if(p<=0){l(f.mediaTime);return}setTimeout(()=>{l(f.mediaTime)},p+150)})}),a=new Promise(l=>{const u=()=>{l()};e.addEventListener("seeked",u,{once:!0}),i=()=>{e.removeEventListener("seeked",u)}});return{wait:Promise.all([s,a]).then(([l])=>l),cancel:()=>{i==null||i(),e.cancelVideoFrameCallback(o)}}},W2=({element:e,desiredTime:t,fps:n,logLevel:r,mountTime:o})=>{const i=1/n/2;let s=()=>{};return Number.isFinite(e.duration)&&e.currentTime>=e.duration&&t>=e.duration?{prom:Promise.resolve(),cancel:()=>{}}:{prom:new Promise((l,u)=>{const f=Ju({element:e,desiredTime:t+i,logLevel:r,mountTime:o});f.wait.then(p=>{if(Math.abs(t-p)<=i)return l();const h=t>p?1:-1,y=Ju({element:e,desiredTime:p+i*h,logLevel:r,mountTime:o});s=y.cancel,y.wait.then(g=>{const E=Math.abs(t-g);if(fh(E)<=fh(i))return l();const v=Ju({element:e,desiredTime:t+i,logLevel:r,mountTime:o});return s=v.cancel,v.wait.then(()=>{l()}).catch(w=>{u(w)})}).catch(g=>{u(g)})}),s=f.cancel}),cancel:()=>{s()}}},H2=({onError:e,volume:t,allowAmplificationDuringRender:n,playbackRate:r,onDuration:o,toneFrequency:i,name:s,acceptableTimeShiftInSeconds:a,delayRenderRetries:l,delayRenderTimeoutInMilliseconds:u,loopVolumeCurveBehavior:f,audioStreamIndex:p,onVideoFrame:m,preservePitch:h,...y},g)=>{const E=Cr(),v=ct(),w=ii(f??"repeat"),x=Vl(),b=c.useRef(null),S=c.useContext(tt),C=Wr(),k=Ke(),T=Rn(),P=bs(),{delayRender:j,continueRender:M}=gn(),{registerRenderAsset:D,unregisterRenderAsset:N}=c.useContext(qr),L=c.useMemo(()=>`video-${Gr(y.src??"")}-${S==null?void 0:S.cumulatedFrom}-${S==null?void 0:S.relativeFrom}-${S==null?void 0:S.durationInFrames}`,[y.src,S==null?void 0:S.cumulatedFrom,S==null?void 0:S.relativeFrom,S==null?void 0:S.durationInFrames]);if(!x)throw new Error("No video config found");const H=Jr({volume:t,frame:w,mediaVolume:1});ai(H),c.useEffect(()=>{if(!y.src)throw new Error("No src passed");if(!y.muted&&!(H<=0)&&window.remotion_audioEnabled)return D({type:"video",src:Tn(y.src),id:L,frame:E,volume:H,mediaFrame:v,playbackRate:r??1,toneFrequency:i??1,audioStartFrame:Math.max(0,-((S==null?void 0:S.cumulatedNegativeFrom)??0)),audioStreamIndex:p??0}),()=>N(L)},[y.muted,y.src,D,L,N,H,v,E,r,i,S==null?void 0:S.cumulatedNegativeFrom,p]),c.useImperativeHandle(g,()=>b.current,[]),Pw({ref:b,onVideoFrame:m}),c.useEffect(()=>{var Y,$;if(!window.remotion_videoEnabled)return;const{current:R}=b;if(!R)return;const I=fw({frame:v,playbackRate:r||1,startFrom:-C,fps:x.fps}),_=j(`Rendering <Html5Video /> with src="${y.src}" at time ${I}`,{retries:l??void 0,timeoutInMilliseconds:u??void 0});if((($=(Y=window.process)==null?void 0:Y.env)==null?void 0:$.NODE_ENV)==="test"){M(_);return}if(dl(R.currentTime,I)){if(R.readyState>=2){M(_);return}const A=()=>{M(_)};return R.addEventListener("loadeddata",A,{once:!0}),()=>{R.removeEventListener("loadeddata",A)}}const F=()=>{M(_)},z=W2({element:R,desiredTime:I,fps:x.fps,logLevel:T,mountTime:P});z.prom.then(()=>{M(_)}),R.addEventListener("ended",F,{once:!0});const B=()=>{var A;if(R!=null&&R.error){if(console.error("Error occurred in video",R==null?void 0:R.error),e)return;throw new Ro({message:`The browser threw an error while playing the video ${y.src}: Code ${R.error.code} - ${(A=R==null?void 0:R.error)==null?void 0:A.message}. See https://remotion.dev/docs/media-playback-error for help. Pass an onError() prop to handle the error.`,src:y.src})}else throw new Ro({message:"The browser threw an error",src:y.src})};return R.addEventListener("error",B,{once:!0}),()=>{z.cancel(),R.removeEventListener("ended",F),R.removeEventListener("error",B),M(_)}},[w,y.src,r,x.fps,v,C,e,l,u,T,P,M,j]);const{src:O}=y;return k.isRendering&&c.useLayoutEffect(()=>{var F,z;if(((z=(F=window.process)==null?void 0:F.env)==null?void 0:z.NODE_ENV)==="test")return;const R=j("Loading <Html5Video> duration with src="+O,{retries:l??void 0,timeoutInMilliseconds:u??void 0}),{current:I}=b,_=()=>{I!=null&&I.duration&&o(O,I.duration),M(R)};return I!=null&&I.duration?(o(O,I.duration),M(R)):I==null||I.addEventListener("loadedmetadata",_,{once:!0}),()=>{I==null||I.removeEventListener("loadedmetadata",_),M(R)}},[O,o,l,u,M,j]),d.jsx("video",{ref:b,disableRemotePlayback:!0,...y})},U2=c.forwardRef(H2),Z2=(e,t)=>{const{startFrom:n,endAt:r,trimBefore:o,trimAfter:i,name:s,pauseWhenBuffering:a,stack:l,_remotionInternalNativeLoopPassed:u,showInTimeline:f,onAutoPlayError:p,onVideoFrame:m,...h}=e,{loop:y,...g}=e,{fps:E}=qe(),v=Ke(),w=Es(a);if(v.isClientSideRendering)throw new Error("<Html5Video> is not supported in @remotion/web-renderer. Use <Video> from @remotion/media instead. See https://remotion.dev/docs/client-side-rendering/limitations");const{durations:x,setDurations:b}=c.useContext(Uf);if(typeof t=="string")throw new Error("string refs are not supported");if(typeof e.src!="string")throw new TypeError(`The \`<Html5Video>\` tag requires a string for \`src\`, but got ${JSON.stringify(e.src)} instead.`);const S=Qr(e.src),C=c.useCallback((j,M)=>{b({type:"got-duration",durationInSeconds:M,src:j})},[b]),k=x[Tn(S)]??x[Tn(e.src)];eu({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});const{trimBeforeValue:T,trimAfterValue:P}=tu({startFrom:n,endAt:r,trimBefore:o,trimAfter:i});if(y&&k!==void 0){if(!Number.isFinite(k))return d.jsx(Aa,{...g,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0});const j=k*E;return d.jsx(ql,{durationInFrames:Gl({trimAfter:P,mediaDurationInFrames:j,playbackRate:e.playbackRate??1,trimBefore:T}),layout:"none",name:s,showInTimeline:!1,children:d.jsx(Aa,{...g,ref:t,stack:l,_remotionInternalNativeLoopPassed:!0})})}return typeof T<"u"||typeof P<"u"?d.jsx(dt,{layout:"none",from:0-(T??0),showInTimeline:!1,durationInFrames:P===void 0?void 0:P/(e.playbackRate??1),name:s,children:d.jsx(Aa,{pauseWhenBuffering:w,onVideoFrame:m,...h,ref:t,stack:l})}):(Jl({playbackRate:e.playbackRate,preservePitch:e.preservePitch,volume:e.volume},"Html5Video"),v.isRendering?d.jsx(U2,{onDuration:C,onVideoFrame:m??null,...h,ref:t}):d.jsx(rp,{onlyWarnForMediaSeekingError:!1,...h,ref:t,onVideoFrame:m??null,pauseWhenBuffering:w,onDuration:C,_remotionInternalStack:l??null,_remotionInternalNativeLoopPassed:u??!1,showInTimeline:f??!0,onAutoPlayError:p??void 0}))},Aa=c.forwardRef(Z2);kt(Aa);aE();var Y2={},K2=new Proxy(Y2,{get(e,t){return t==="Bundling"||t==="Rendering"||t==="Log"||t==="Puppeteer"||t==="Output"?K2:()=>{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."),process.exit(1)}}});dt.displayName="Sequence";kt(dt);oE(dt);kt(al);kt(ES);typeof window<"u"&&(window.remotion_renderReady=!1,window.remotion_delayRenderTimeouts||(window.remotion_delayRenderTimeouts={}),window.remotion_delayRenderHandles=[]);var X2={"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",defaultKeyframeOutput:"perceptual-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}},G2={"style.borderWidth":{type:"number",default:void 0,min:0,step:1,description:"Border width",hiddenFromList:!1},"style.borderStyle":{type:"enum",default:"none",description:"Border style",variants:{none:{},hidden:{},solid:{},dashed:{},dotted:{},double:{},groove:{},ridge:{},inset:{},outset:{}}},"style.borderColor":{type:"color",default:void 0,description:"Border color"}},q2={"style.backgroundColor":{type:"color",default:"transparent",description:"Color"}},Q2={premountFor:{type:"number",default:0,description:"Premount For",min:0,step:1,hiddenFromList:!1,keyframable:!1},postmountFor:{type:"number",default:0,min:0,step:1,hiddenFromList:!0,keyframable:!1}},J2={...Q2},eI={...X2,...q2,...G2,...J2},tI={layout:{type:"enum",default:"absolute-fill",description:"Layout",variants:{"absolute-fill":eI,none:{}}}};({...tI.layout});var nI=(e,t,n)=>{if(e){if(typeof e!="object")throw new Error(`"${t}" must be an object, but you passed a value of type ${typeof e}`);if(Array.isArray(e))throw new Error(`"${t}" must be an object, an array was passed ${n?`for composition "${n}"`:""}`)}};function rI(e,t,n){if(typeof e!="number")throw new Error(`The "${t}" prop ${n} must be a number, but you passed a value of type ${typeof e}`);if(isNaN(e))throw new TypeError(`The "${t}" prop ${n} must not be NaN, but is NaN.`);if(!Number.isFinite(e))throw new TypeError(`The "${t}" prop ${n} must be finite, but is ${e}.`);if(e%1!==0)throw new TypeError(`The "${t}" prop ${n} must be an integer, but is ${e}.`);if(e<=0)throw new TypeError(`The "${t}" prop ${n} must be positive, but got ${e}.`)}function oI(e,t){const{allowFloats:n,component:r}=t;if(typeof e>"u")throw new Error(`The "durationInFrames" prop ${r} is missing.`);if(typeof e!="number")throw new Error(`The "durationInFrames" prop ${r} must be a number, but you passed a value of type ${typeof e}`);if(e<=0)throw new TypeError(`The "durationInFrames" prop ${r} must be positive, but got ${e}.`);if(!n&&e%1!==0)throw new TypeError(`The "durationInFrames" prop ${r} must be an integer, but got ${e}.`);if(!Number.isFinite(e))throw new TypeError(`The "durationInFrames" prop ${r} must be finite, but got ${e}.`)}function iI(e,t,n){if(typeof e!="number")throw new Error(`"fps" must be a number, but you passed a value of type ${typeof e} ${t}`);if(!Number.isFinite(e))throw new Error(`"fps" must be a finite, but you passed ${e} ${t}`);if(isNaN(e))throw new Error(`"fps" must not be NaN, but got ${e} ${t}`);if(e<=0)throw new TypeError(`"fps" must be positive, but got ${e} ${t}`);if(n&&e>50)throw new 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 iu={validateFps:iI,validateDimension:rI,validateDurationInFrames:oI,validateDefaultAndInputProps:nI};if(typeof c.createContext!="function"){const e=['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 {Player} from "@remotion/player";',"","After:",' "use client";',' import {Player} from "@remotion/player";'];throw new Error(e.join(`
|
|
80
|
+
`))}var lt=25,Ed=16,sI=()=>d.jsx("svg",{width:lt,height:lt,viewBox:"0 0 25 25",fill:"none",children:d.jsx("path",{d:"M8 6.375C7.40904 8.17576 7.06921 10.2486 7.01438 12.3871C6.95955 14.5255 7.19163 16.6547 7.6875 18.5625C9.95364 18.2995 12.116 17.6164 14.009 16.5655C15.902 15.5147 17.4755 14.124 18.6088 12.5C17.5158 10.8949 15.9949 9.51103 14.1585 8.45082C12.3222 7.3906 10.2174 6.68116 8 6.375Z",fill:"white",stroke:"white",strokeWidth:"6.25",strokeLinejoin:"round"})}),aI=()=>d.jsxs("svg",{viewBox:"0 0 100 100",width:lt,height:lt,children:[d.jsx("rect",{x:"25",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"}),d.jsx("rect",{x:"55",y:"20",width:"20",height:"60",fill:"#fff",ry:"5",rx:"5"})]}),lI=({isFullscreen:e})=>{const r=e?0:3,o=e?6*1.6:6/2,i=e?6*1.6:6*2;return d.jsxs("svg",{viewBox:"0 0 32 32",height:Ed,width:Ed,children:[d.jsx("path",{d:`
|
|
81
|
+
M ${r} ${i}
|
|
82
|
+
L ${o} ${o}
|
|
83
|
+
L ${i} ${r}
|
|
84
|
+
`,stroke:"#fff",strokeWidth:6,fill:"none"}),d.jsx("path",{d:`
|
|
85
|
+
M ${32-r} ${i}
|
|
86
|
+
L ${32-o} ${o}
|
|
87
|
+
L ${32-i} ${r}
|
|
88
|
+
`,stroke:"#fff",strokeWidth:6,fill:"none"}),d.jsx("path",{d:`
|
|
89
|
+
M ${r} ${32-i}
|
|
90
|
+
L ${o} ${32-o}
|
|
91
|
+
L ${i} ${32-r}
|
|
92
|
+
`,stroke:"#fff",strokeWidth:6,fill:"none"}),d.jsx("path",{d:`
|
|
93
|
+
M ${32-r} ${32-i}
|
|
94
|
+
L ${32-o} ${32-o}
|
|
95
|
+
L ${32-i} ${32-r}
|
|
96
|
+
`,stroke:"#fff",strokeWidth:6,fill:"none"})]})},uI=()=>d.jsx("svg",{width:lt,height:lt,viewBox:"0 0 24 24",children:d.jsx("path",{d:"M3.63 3.63a.996.996 0 000 1.41L7.29 8.7 7 9H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71v-4.17l4.18 4.18c-.49.37-1.02.68-1.6.91-.36.15-.58.53-.58.92 0 .72.73 1.18 1.39.91.8-.33 1.55-.77 2.22-1.31l1.34 1.34a.996.996 0 101.41-1.41L5.05 3.63c-.39-.39-1.02-.39-1.42 0zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-3.83-2.4-7.11-5.78-8.4-.59-.23-1.22.23-1.22.86v.19c0 .38.25.71.61.85C17.18 6.54 19 9.06 19 12zm-8.71-6.29l-.17.17L12 7.76V6.41c0-.89-1.08-1.33-1.71-.7zM16.5 12A4.5 4.5 0 0014 7.97v1.79l2.48 2.48c.01-.08.02-.16.02-.24z",fill:"#fff"})}),cI=()=>d.jsx("svg",{width:lt,height:lt,viewBox:"0 0 24 24",children:d.jsx("path",{d:"M3 10v4c0 .55.45 1 1 1h3l3.29 3.29c.63.63 1.71.18 1.71-.71V6.41c0-.89-1.08-1.34-1.71-.71L7 9H4c-.55 0-1 .45-1 1zm13.5 2A4.5 4.5 0 0014 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 4.45v.2c0 .38.25.71.6.85C17.18 6.53 19 9.06 19 12s-1.82 5.47-4.4 6.5c-.36.14-.6.47-.6.85v.2c0 .63.63 1.07 1.21.85C18.6 19.11 21 15.84 21 12s-2.4-7.11-5.79-8.4c-.58-.23-1.21.22-1.21.85z",fill:"#fff"})}),ph="__remotion_buffering_indicator",mh="__remotion_buffering_animation",dI={width:lt,height:lt,overflow:"hidden",lineHeight:"normal",fontSize:"inherit"},fI={width:14,height:14,overflow:"hidden",lineHeight:"normal",fontSize:"inherit"},pI=({type:e})=>{const t=e==="player"?dI:fI;return d.jsxs(d.Fragment,{children:[d.jsx("style",{type:"text/css",children:`
|
|
97
|
+
@keyframes ${mh} {
|
|
98
|
+
0% {
|
|
99
|
+
rotate: 0deg;
|
|
100
|
+
}
|
|
101
|
+
100% {
|
|
102
|
+
rotate: 360deg;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.${ph} {
|
|
107
|
+
animation: ${mh} 1s linear infinite;
|
|
108
|
+
}
|
|
109
|
+
`}),d.jsx("div",{style:t,children:d.jsx("svg",{viewBox:e==="player"?"0 0 22 22":"0 0 18 18",style:t,className:ph,children:d.jsx("path",{d:e==="player"?"M 11 4 A 7 7 0 0 1 15.1145 16.66312":"M 9 2 A 7 7 0 0 1 13.1145 14.66312",stroke:"white",strokeLinecap:"round",fill:"none",strokeWidth:3})})})]})},mI=({currentSize:e,width:t,height:n,compositionWidth:r,compositionHeight:o})=>t!==void 0&&n===void 0?{aspectRatio:[r,o].join("/")}:n!==void 0&&t===void 0?{aspectRatio:[r,o].join("/")}:e?{width:r,height:o}:{width:r,height:o},Aw=({previewSize:e,compositionWidth:t,compositionHeight:n,canvasSize:r})=>{const o=ie.calculateScale({canvasSize:r,compositionHeight:n,compositionWidth:t,previewSize:e}),i=0-(1-o)/2,s=i*t,a=i*n,l=t*o,u=n*o,f=r.width/2-l/2,p=r.height/2-u/2;return{centerX:f,centerY:p,xCorrection:s,yCorrection:a,scale:o}},Nw=({config:e,style:t,canvasSize:n,overflowVisible:r,layout:o})=>e?{position:"relative",overflow:r?"visible":"hidden",...mI({compositionHeight:e.height,compositionWidth:e.width,currentSize:n,height:t==null?void 0:t.height,width:t==null?void 0:t.width}),opacity:o?1:0,...t}:{},Lw=({config:e,layout:t,scale:n,overflowVisible:r})=>e?t?{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,marginLeft:t.xCorrection,marginTop:t.yCorrection,overflow:r?"visible":"hidden"}:{position:"absolute",width:e.width,height:e.height,display:"flex",transform:`scale(${n})`,overflow:r?"visible":"hidden"}:{},zw=({layout:e,scale:t,config:n,overflowVisible:r})=>{if(!n)return{};if(!e)return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",overflow:r?"visible":"hidden"};const{centerX:o,centerY:i}=e;return{width:n.width*t,height:n.height*t,display:"flex",flexDirection:"column",position:"absolute",left:o,top:i,overflow:r?"visible":"hidden"}},Dw=ne.createContext(void 0),Ow=ne.createContext(void 0);class hI{constructor(){Se(this,"listeners",{ended:[],error:[],pause:[],play:[],ratechange:[],scalechange:[],seeked:[],timeupdate:[],frameupdate:[],fullscreenchange:[],volumechange:[],mutechange:[],waiting:[],resume:[]});Se(this,"dispatchSeek",t=>{this.dispatchEvent("seeked",{frame:t})});Se(this,"dispatchVolumeChange",t=>{this.dispatchEvent("volumechange",{volume:t})});Se(this,"dispatchPause",()=>{this.dispatchEvent("pause",void 0)});Se(this,"dispatchPlay",()=>{this.dispatchEvent("play",void 0)});Se(this,"dispatchEnded",()=>{this.dispatchEvent("ended",void 0)});Se(this,"dispatchRateChange",t=>{this.dispatchEvent("ratechange",{playbackRate:t})});Se(this,"dispatchScaleChange",t=>{this.dispatchEvent("scalechange",{scale:t})});Se(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Se(this,"dispatchTimeUpdate",t=>{this.dispatchEvent("timeupdate",t)});Se(this,"dispatchFrameUpdate",t=>{this.dispatchEvent("frameupdate",t)});Se(this,"dispatchFullscreenChange",t=>{this.dispatchEvent("fullscreenchange",t)});Se(this,"dispatchMuteChange",t=>{this.dispatchEvent("mutechange",t)});Se(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Se(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}class gI{constructor(){Se(this,"listeners",{error:[],waiting:[],resume:[]});Se(this,"dispatchError",t=>{this.dispatchEvent("error",{error:t})});Se(this,"dispatchWaiting",t=>{this.dispatchEvent("waiting",t)});Se(this,"dispatchResume",t=>{this.dispatchEvent("resume",t)})}addEventListener(t,n){this.listeners[t].push(n)}removeEventListener(t,n){this.listeners[t]=this.listeners[t].filter(r=>r!==n)}dispatchEvent(t,n){this.listeners[t].forEach(r=>{r({detail:n})})}}var Vw=e=>{const t=c.useContext(ie.BufferingContextReact);if(!t)throw new Error("BufferingContextReact not found");c.useLayoutEffect(()=>{const n=t.listenForBuffering(()=>{t.buffering.current=!0,e.dispatchWaiting({})}),r=t.listenForResume(()=>{t.buffering.current=!1,e.dispatchResume({})});return()=>{n.remove(),r.remove()}},[t,e])},vI=({children:e,currentPlaybackRate:t})=>{const[n]=c.useState(()=>new hI);if(!c.useContext(ie.BufferingContextReact))throw new Error("BufferingContextReact not found");return c.useEffect(()=>{t&&n.dispatchRateChange(t)},[n,t]),Vw(n),d.jsx(Dw.Provider,{value:n,children:e})},ip=(e,t)=>{const[n,r]=c.useState(!1);return c.useEffect(()=>{const{current:o}=e;if(!o)return;let i;const s=()=>{t&&(clearTimeout(i),i=setTimeout(()=>{r(!1)},t===!0?3e3:t))},a=()=>{r(!0),s()},l=()=>{r(!1),clearTimeout(i)},u=()=>{r(!0),s()};return o.addEventListener("mouseenter",a),o.addEventListener("mouseleave",l),o.addEventListener("mousemove",u),()=>{o.removeEventListener("mouseenter",a),o.removeEventListener("mouseleave",l),o.removeEventListener("mousemove",u),clearTimeout(i)}},[t,e]),n},su=()=>{const[e,t,n]=ie.Timeline.usePlayingState(),[r,o]=c.useState(!1),i=ie.Timeline.useTimelinePosition(),s=c.useRef(i),a=ie.Timeline.useTimelineSetFrame(),l=ie.Timeline.useTimelineSetFrame(),u=c.useContext(ie.SharedAudioContext),f=c.useContext(ie.SharedAudioTagsContext),{audioAndVideoTags:p}=ie.useTimelineContext(),m=c.useRef(i);m.current=i;const h=ie.useVideo(),y=ie.useUnsafeVideoConfig(),g=c.useContext(Dw),E=((y==null?void 0:y.durationInFrames)??1)-1,v=i===E,w=i===0;if(!g)throw new TypeError("Expected Player event emitter context");const x=c.useContext(ie.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");const{buffering:b}=x,S=c.useCallback(R=>{const I=y?ie.TimelinePosition.clampFrameToCompositionRange(R,y.durationInFrames):Math.max(0,R);h!=null&&h.id&&l(_=>({..._,[h.id]:I})),m.current=I,g.dispatchSeek(I)},[y,g,l,h==null?void 0:h.id]),C=c.useCallback(R=>{n.current||(o(!0),v&&S(0),u==null||u.resume(),f&&f.numberOfAudioTags>0&&R&&f.playAllAudios(),p.current.forEach(I=>I.play("player play() was called and playing audio from a click")),n.current=!0,t(!0),s.current=m.current,g.dispatchPlay())},[n,v,u,f,t,g,S,p]),k=c.useCallback(()=>{n.current&&(n.current=!1,t(!1),g.dispatchPause(),u==null||u.suspend())},[g,n,t,u]),T=c.useCallback(()=>{n.current&&(n.current=!1,m.current=s.current,y&&(l(R=>({...R,[y.id]:s.current})),t(!1),g.dispatchPause()))},[y,g,n,t,l]),P=h==null?void 0:h.id,j=c.useCallback(R=>{if(!P)return null;n.current||a(I=>{const _=I[P]??window.remotion_initialFrame??0,F=Math.max(0,_-R);return _===F?I:{...I,[P]:F}})},[n,a,P]),M=c.useCallback(R=>{if(!P)return null;n.current||a(I=>{const _=I[P]??window.remotion_initialFrame??0,F=Math.min(E,_+R);return _===F?I:{...I,[P]:F}})},[P,n,E,a]),D=c.useCallback(R=>{n.current?k():C(R)},[n,k,C]),N=c.useCallback(()=>n.current,[n]),L=c.useCallback(()=>m.current,[m]),H=c.useCallback(()=>b.current,[b]);return c.useMemo(()=>({frameBack:j,frameForward:M,isLastFrame:v,emitter:g,playing:e,play:C,pause:k,seek:S,isFirstFrame:w,getCurrentFrame:L,isPlaying:N,isBuffering:H,pauseAndReturnToPlayStart:T,hasPlayed:r,toggle:D}),[g,j,M,r,w,v,L,k,T,C,e,S,D,N,H])},yI=({browserMediaControlsBehavior:e,videoConfig:t,playbackRate:n})=>{const{playing:r,pause:o,play:i,emitter:s,getCurrentFrame:a,seek:l}=su(),u=c.useRef(!1);c.useEffect(()=>{r&&(u.current=!0)},[r]),c.useEffect(()=>{navigator.mediaSession&&e.mode!=="do-nothing"&&(r?navigator.mediaSession.playbackState="playing":u.current&&(navigator.mediaSession.playbackState="paused"))},[e.mode,r]),c.useEffect(()=>{if(!navigator.mediaSession||e.mode==="do-nothing")return;const f=()=>{t&&navigator.mediaSession&&navigator.mediaSession.setPositionState({duration:t.durationInFrames/t.fps,playbackRate:n,position:a()/t.fps})};return s.addEventListener("timeupdate",f),()=>{s.removeEventListener("timeupdate",f)}},[e.mode,s,a,n,t]),c.useEffect(()=>{if(navigator.mediaSession&&e.mode!=="do-nothing")return navigator.mediaSession.setActionHandler("play",()=>{e.mode==="register-media-session"&&i()}),navigator.mediaSession.setActionHandler("pause",()=>{e.mode==="register-media-session"&&o()}),navigator.mediaSession.setActionHandler("seekto",f=>{e.mode==="register-media-session"&&f.seekTime!==void 0&&t&&l(Math.round(f.seekTime*t.fps))}),navigator.mediaSession.setActionHandler("seekbackward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(0,Math.round((a()-10)*t.fps)))}),navigator.mediaSession.setActionHandler("seekforward",()=>{e.mode==="register-media-session"&&t&&l(Math.max(t.durationInFrames-1,Math.round((a()+10)*t.fps)))}),navigator.mediaSession.setActionHandler("previoustrack",()=>{e.mode==="register-media-session"&&l(0)}),()=>{navigator.mediaSession.metadata=null,navigator.mediaSession.setActionHandler("play",null),navigator.mediaSession.setActionHandler("pause",null),navigator.mediaSession.setActionHandler("seekto",null),navigator.mediaSession.setActionHandler("seekbackward",null),navigator.mediaSession.setActionHandler("seekforward",null),navigator.mediaSession.setActionHandler("previoustrack",null)}},[e.mode,a,o,i,l,t])},wI=({time:e,currentFrame:t,playbackSpeed:n,fps:r,actualLastFrame:o,actualFirstFrame:i,framesAdvanced:s,shouldLoop:a})=>{const u=(n<0?Math.ceil:Math.floor)(e*n/(1e3/r))-s,f=u+t,p=t>o||t<i,m=f>o||f<i,h=!a&&m&&!p;return n>0?m?{nextFrame:i,framesToAdvance:u,hasEnded:h}:{nextFrame:f,framesToAdvance:u,hasEnded:h}:m?{nextFrame:o,framesToAdvance:u,hasEnded:h}:{nextFrame:f,framesToAdvance:u,hasEnded:h}},hh=()=>typeof document>"u"?!1:document.visibilityState==="hidden",xI=()=>{const e=c.useRef(hh());return c.useEffect(()=>{const t=()=>{e.current=hh()};return document.addEventListener("visibilitychange",t),()=>{document.removeEventListener("visibilitychange",t)}},[]),e},bI=.1,gh=({audioContext:e,audioSyncAnchor:t,absoluteTimeInSeconds:n,globalPlaybackRate:r,logLevel:o,force:i})=>{const s=e.currentTime-n/r,a=s-t.value,{outputLatency:l}=e,u=l===0?.3:l,f=e.baseLatency+u;return Math.abs(a)<bI+f&&!i||Math.abs(a)<Number.EPSILON?!1:(ie.Log.verbose({logLevel:o,tag:"audio-scheduling"},"Anchor "+(i?"forcibly ":"")+"changed from %s to %s with shift %s",t.value,s,a),t.value=s,!0)},SI=e=>{if(e==="suspended"||e==="running-to-suspended")return!0;if(e==="closed"||e==="interrupted"||e==="running"||e==="suspended-to-running")return!1;throw new Error(`Unexpected audio context state: ${e}`)},EI=({loop:e,playbackRate:t,moveToBeginningWhenEnded:n,inFrame:r,outFrame:o,browserMediaControlsBehavior:i,getCurrentFrame:s,muted:a})=>{const l=ie.useUnsafeVideoConfig(),u=ie.Timeline.useTimelinePosition(),{playing:f,pause:p,emitter:m,isPlaying:h}=su(),y=ie.Timeline.useTimelineSetFrame(),g=c.useContext(ie.SharedAudioContext),E=ie.useLogLevel(),v=xI(),w=c.useRef(0),x=c.useContext(ie.BufferingContextReact);if(!x)throw new Error("Missing the buffering context. Most likely you have a Remotion version mismatch.");yI({browserMediaControlsBehavior:i,playbackRate:t,videoConfig:l}),c.useLayoutEffect(()=>{if(!g||!g.audioContext||!l||a)return;gh({audioContext:g.audioContext,audioSyncAnchor:g.audioSyncAnchor,absoluteTimeInSeconds:u/l.fps,globalPlaybackRate:t,logLevel:E,force:!1})&&g.audioSyncAnchorEmitter.dispatch("changed")},[l,u,E,t,g,a]),c.useLayoutEffect(()=>{const b=g==null?void 0:g.audioContext;if(!b||!l||a)return;const S=()=>{const C=g==null?void 0:g.getAudioContextState();C&&SI(C)&&gh({audioContext:b,audioSyncAnchor:g.audioSyncAnchor,absoluteTimeInSeconds:s()/l.fps,globalPlaybackRate:t,logLevel:E,force:!0})};return b==null||b.addEventListener("statechange",S),()=>{b==null||b.removeEventListener("statechange",S)}},[l,s,E,a,t,g]),c.useEffect(()=>{var N;if(!l)return;if(!f){(N=g==null?void 0:g.suspend)==null||N.call(g);return}let b=!1,S=null,C=performance.now(),k=0;const T=()=>{S!==null&&(S.type==="raf"?cancelAnimationFrame(S.id):clearTimeout(S.id))},P=()=>{b=!0,T()},j=()=>{var z,B;if(b)return;if(!h()){(z=g==null?void 0:g.suspend)==null||z.call(g);return}!a&&!x.buffering.current&&((B=g==null?void 0:g.resume)==null||B.call(g));const L=performance.now()-C,H=o??l.durationInFrames-1,O=r??0,R=s(),{nextFrame:I,framesToAdvance:_,hasEnded:F}=wI({time:L,currentFrame:R,playbackSpeed:t,fps:l.fps,actualFirstFrame:O,actualLastFrame:H,framesAdvanced:k,shouldLoop:e});if(k+=_,I!==s()&&(!F||n)&&!x.buffering.current&&y(Y=>({...Y,[l.id]:I})),F){P(),p(),m.dispatchEnded();return}M()},M=()=>{var H,O;const L=((H=g==null?void 0:g.getIsResumingAudioContext)==null?void 0:H.call(g))??null;if(L!==null&&!a){L.then(()=>{C=performance.now(),k=0,M()});return}if(x.buffering.current){a||(O=g==null?void 0:g.suspend)==null||O.call(g);const R=x.listenForResume(()=>{R.remove(),C=performance.now(),k=0,M()});return}if(v.current){S={type:"timeout",id:setTimeout(j,1e3/l.fps)};return}S={type:"raf",id:requestAnimationFrame(j)}};M();const D=()=>{document.visibilityState!=="visible"&&(T(),j())};return window.addEventListener("visibilitychange",D),()=>{window.removeEventListener("visibilitychange",D),P()}},[l,e,p,f,y,m,t,r,o,n,v,s,x,h,g,E,a]),c.useEffect(()=>{const b=performance.now(),S=b-w.current;if(S>=250){m.dispatchTimeUpdate({frame:u}),w.current=b;return}const C=setTimeout(()=>{m.dispatchTimeUpdate({frame:u}),w.current=performance.now()},250-S);return()=>clearTimeout(C)},[m,u]),c.useEffect(()=>{m.dispatchFrameUpdate({frame:u})},[m,u])},ec=[],tc=e=>e?"current"in e?e.current:e:null,sp=(e,t)=>{const[n,r]=c.useState(()=>{const s=tc(e);if(!s)return null;const a=s.getClientRects();return a[0]?{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}}:null}),o=c.useMemo(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const{contentRect:a,target:l}=s[0],u=l.getClientRects();if(!(u!=null&&u[0])){r(null);return}const f=a.width===0?1:u[0].width/a.width,p=a.height===0?1:u[0].height/a.height,m=t.shouldApplyCssTransforms||f===0?u[0].width:u[0].width*(1/f),h=t.shouldApplyCssTransforms||p===0?u[0].height:u[0].height*(1/p);r(y=>y&&y.width===m&&y.height===h&&y.left===u[0].x&&y.top===u[0].y&&y.windowSize.height===window.innerHeight&&y.windowSize.width===window.innerWidth?y:{width:m,height:h,left:u[0].x,top:u[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})}),[t.shouldApplyCssTransforms]),i=c.useCallback(()=>{const s=tc(e);if(!s)return;const a=s.getClientRects();if(!a[0]){r(null);return}r(l=>l&&l.width===a[0].width&&l.height===a[0].height&&l.left===a[0].x&&l.top===a[0].y&&l.windowSize.height===window.innerHeight&&l.windowSize.width===window.innerWidth?l:{width:a[0].width,height:a[0].height,left:a[0].x,top:a[0].y,windowSize:{height:window.innerHeight,width:window.innerWidth}})},[e]);return c.useEffect(()=>{i()},[i]),c.useEffect(()=>{if(!o)return;const s=tc(e);return s&&o.observe(s),()=>{s&&o.unobserve(s)}},[o,e]),c.useEffect(()=>{if(t.triggerOnWindowResize)return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}},[t.triggerOnWindowResize,i]),c.useEffect(()=>(ec.push(i),()=>{ec=ec.filter(s=>s!==i)}),[i]),c.useMemo(()=>n?{...n,refresh:i}:null,[n,i])},ap=e=>e??"__remotion-player",kI={display:"flex",justifyContent:"center",alignItems:"center",flex:1,height:"100%",width:"100%"};class Bw extends ne.Component{constructor(){super(...arguments);Se(this,"state",{hasError:null})}static getDerivedStateFromError(n){return{hasError:n}}componentDidCatch(n){this.props.onError(n)}render(){return this.state.hasError?d.jsx("div",{style:kI,children:this.props.errorFallback({error:this.state.hasError})}):this.props.children}}var CI=async()=>{if(typeof window>"u"||typeof window.crypto>"u"||typeof window.crypto.subtle>"u")return null;try{const e=await crypto.subtle.digest("SHA-256",new TextEncoder().encode(window.location.hostname));return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{return null}},nc={backgroundColor:"red",position:"absolute",padding:12,fontFamily:"Arial"},II=["28d262b44cc61fa750f1686b16ad0604dabfe193fbc263eec05c89b7ad4c2cd6","4db1b0a94be33165dfefcb3ba03d04c7a2666dd27c496d3dc9fa41858e94925e","fbc48530bbf245da790f63675e84e06bab38c3b114fab07eb350025119922bdc","7baf10a8932757b1b3a22b3fce10a048747ac2f8eaf638603487e3705b07eb83","8a6c21a598d8c667272b5207c051b85997bf5b45d5fb712378be3f27cd72c6a6","a2f7aaac9c50a9255e7fc376110c4e0bfe153722dc66ed3c5d3bf2a135f65518"],vh=!1,TI=()=>{const[e,t]=ne.useState(!1);return c.useEffect(()=>{vh||(vh=!0,CI().then(n=>{n&&II.includes(n)&&t(!0)}).catch(()=>{}))},[]),c.useEffect(()=>{if(!e)return;const n=()=>{if(!document.querySelector(".warning-banner")){const i=document.createElement("div");i.className="warning-banner",Object.assign(i.style,nc,{zIndex:"9999",cssText:`${nc.cssText} !important;`}),i.innerHTML=`
|
|
110
|
+
<a href="https://github.com/remotion-dev/remotion/pull/4589" style="color: white;">
|
|
111
|
+
Remotion Unlicensed – Contact hi@remotion.dev
|
|
112
|
+
</a>
|
|
113
|
+
`,document.body.appendChild(i)}},r=new MutationObserver(()=>n());return r.observe(document.body,{childList:!0,subtree:!0}),()=>{r.disconnect()}},[e]),e?d.jsx("div",{style:nc,className:"warning-banner",children:d.jsx("a",{style:{color:"white"},href:"https://github.com/remotion-dev/remotion/pull/4589",children:"Remotion Unlicensed – Contact hi@remotion.dev"})}):null},yh=({playing:e,buffering:t})=>e&&t?d.jsx(pI,{type:"player"}):e?d.jsx(aI,{}):d.jsx(sI,{}),uo=12,wh=5,RI=({volume:e,isVertical:t,onBlur:n,inputRef:r,setVolume:o})=>{const i=c.useMemo(()=>{const m={paddingLeft:5,height:lt,width:$r,display:"inline-flex",alignItems:"center"};return t?{...m,position:"absolute",transform:`rotate(-90deg) translateX(${$r/2+lt/2}px)`}:{...m}},[t]),s=typeof ne.useId>"u"?"volume-slider":ne.useId(),[a]=c.useState(()=>`__remotion-volume-slider-${Gr(s)}`.replace(".","")),l=c.useCallback(p=>{o(parseFloat(p.target.value))},[o]),u=c.useMemo(()=>{const p={WebkitAppearance:"none",backgroundColor:"rgba(255, 255, 255, 0.5)",borderRadius:wh/2,cursor:"pointer",height:wh,width:$r,backgroundImage:`linear-gradient(
|
|
114
|
+
to right,
|
|
115
|
+
white ${e*100}%, rgba(255, 255, 255, 0) ${e*100}%
|
|
116
|
+
)`};return t?{...p,bottom:lt+$r/2}:p},[t,e]),f=`
|
|
117
|
+
.${a}::-webkit-slider-thumb {
|
|
118
|
+
-webkit-appearance: none;
|
|
119
|
+
background-color: white;
|
|
120
|
+
border-radius: ${uo/2}px;
|
|
121
|
+
box-shadow: 0 0 2px black;
|
|
122
|
+
height: ${uo}px;
|
|
123
|
+
width: ${uo}px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.${a}::-moz-range-thumb {
|
|
127
|
+
-webkit-appearance: none;
|
|
128
|
+
background-color: white;
|
|
129
|
+
border-radius: ${uo/2}px;
|
|
130
|
+
box-shadow: 0 0 2px black;
|
|
131
|
+
height: ${uo}px;
|
|
132
|
+
width: ${uo}px;
|
|
133
|
+
}
|
|
134
|
+
`;return d.jsxs("div",{style:i,children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:f}}),d.jsx("input",{ref:r,"aria-label":"Change volume",className:a,max:1,min:0,onBlur:n,onChange:l,step:.01,type:"range",value:e,style:u})]})},_I=e=>d.jsx(RI,{...e}),$r=100,PI=({displayVerticalVolumeSlider:e,renderMuteButton:t,renderVolumeSlider:n})=>{const[r,o]=ie.usePlayerMutedState(),[i,s]=ie.useMediaVolumeState(),[a,l]=c.useState(!1),u=c.useRef(null),f=c.useRef(null),p=ip(u,!1),m=c.useCallback(()=>{setTimeout(()=>{f.current&&document.activeElement!==f.current&&l(!1)},10)},[]),h=i===0,y=c.useCallback(()=>{if(h){s(1),o(!1);return}o(b=>!b)},[h,o,s]),g=c.useMemo(()=>({display:"inline-flex",background:"none",border:"none",justifyContent:"center",alignItems:"center",touchAction:"none",...e&&{position:"relative"}}),[e]),E=c.useMemo(()=>({display:"inline",width:lt,height:lt,cursor:"pointer",appearance:"none",background:"none",border:"none",padding:0}),[]),v=c.useCallback(({muted:b,volume:S})=>{const C=b||S===0;return d.jsx("button",{"aria-label":C?"Unmute sound":"Mute sound",title:C?"Unmute sound":"Mute sound",onClick:y,onBlur:m,onFocus:()=>l(!0),style:E,type:"button",children:C?d.jsx(uI,{}):d.jsx(cI,{})})},[m,y,E]),w=c.useMemo(()=>t?t({muted:r,volume:i}):v({muted:r,volume:i}),[r,i,v,t]),x=c.useMemo(()=>(a||p)&&!r&&!ie.isIosSafari()?(n??_I)({isVertical:e,volume:i,onBlur:()=>l(!1),inputRef:f,setVolume:s}):null,[e,a,p,r,i,n,s]);return d.jsxs("div",{ref:u,style:g,children:[w,x]})};function FI(e){const[t,n]=c.useState(e),r=c.useRef(null);return c.useEffect(()=>{const o=i=>{r.current&&!r.current.contains(i.target)&&n(!1)};return document.addEventListener("pointerup",o,!0),()=>{document.removeEventListener("pointerup",o,!0)}},[]),{ref:r,isComponentVisible:t,setIsComponentVisible:n}}var jI=35,MI=70,$I={height:30,paddingRight:15,paddingLeft:12,display:"flex",flexDirection:"row",alignItems:"center"},AI={width:22,display:"flex",alignItems:"center"},NI={width:14,height:14,color:"black"},LI=()=>d.jsx("svg",{viewBox:"0 0 512 512",style:NI,children:d.jsx("path",{fill:"currentColor",d:"M435.848 83.466L172.804 346.51l-96.652-96.652c-4.686-4.686-12.284-4.686-16.971 0l-28.284 28.284c-4.686 4.686-4.686 12.284 0 16.971l133.421 133.421c4.686 4.686 12.284 4.686 16.971 0l299.813-299.813c4.686-4.686 4.686-12.284 0-16.971l-28.284-28.284c-4.686-4.686-12.284-4.686-16.97 0z"})}),zI=e=>{const t=e.toString();return t.includes(".")?t:t+".0"},DI=({rate:e,onSelect:t,selectedRate:n,keyboardSelectedRate:r})=>{const o=c.useCallback(p=>{p.stopPropagation(),p.preventDefault(),t(e)},[t,e]),[i,s]=c.useState(!1),a=c.useCallback(()=>{s(!0)},[]),l=c.useCallback(()=>{s(!1)},[]),u=r===e,f=c.useMemo(()=>({...$I,backgroundColor:i||u?"#eee":"transparent"}),[i,u]);return d.jsxs("div",{onPointerEnter:a,onPointerLeave:l,tabIndex:0,style:f,onClick:o,children:[d.jsx("div",{style:AI,children:e===n?d.jsx(LI,{}):null}),zI(e),"x"]},e)},OI=({setIsComponentVisible:e,playbackRates:t,canvasSize:n})=>{const{setPlaybackRate:r,playbackRate:o}=ie.usePlaybackRate(),[i,s]=c.useState(o);c.useEffect(()=>{const u=f=>{if(f.preventDefault(),f.key==="ArrowUp"){const p=t.findIndex(m=>m===i);if(p===0)return;s(p===-1?t[0]:t[p-1])}else if(f.key==="ArrowDown"){const p=t.findIndex(m=>m===i);if(p===t.length-1)return;s(p===-1?t[t.length-1]:t[p+1])}else f.key==="Enter"&&(r(i),e(!1))};return window.addEventListener("keydown",u),()=>{window.removeEventListener("keydown",u)}},[t,i,r,e]);const a=c.useCallback(u=>{r(u),e(!1)},[e,r]),l=c.useMemo(()=>({position:"absolute",right:0,width:125,maxHeight:n.height-MI-jI,bottom:35,background:"#fff",borderRadius:4,overflow:"auto",color:"black",textAlign:"left"}),[n.height]);return d.jsx("div",{style:l,children:t.map(u=>d.jsx(DI,{selectedRate:o,onSelect:a,rate:u,keyboardSelectedRate:i},u))})},VI={fontSize:13,fontWeight:"bold",color:"white",border:"2px solid white",borderRadius:20,paddingLeft:8,paddingRight:8,paddingTop:2,paddingBottom:2},kd={appearance:"none",backgroundColor:"transparent",border:"none",cursor:"pointer",paddingLeft:0,paddingRight:0,paddingTop:6,paddingBottom:6,height:37,display:"inline-flex",marginBottom:0,marginTop:0,alignItems:"center"},BI={...kd,position:"relative"},WI=({playbackRates:e,canvasSize:t})=>{const{ref:n,isComponentVisible:r,setIsComponentVisible:o}=FI(!1),{playbackRate:i}=ie.usePlaybackRate(),s=c.useCallback(a=>{a.stopPropagation(),a.preventDefault(),o(l=>!l)},[o]);return d.jsx("div",{ref:n,children:d.jsxs("button",{type:"button","aria-label":"Change playback rate",style:BI,onClick:s,children:[d.jsxs("div",{style:VI,children:[i,"x"]}),r&&d.jsx(OI,{canvasSize:t,playbackRates:e,setIsComponentVisible:o})]})})},xh=(e,t,n)=>Math.round(ri(e,[0,n],[0,t-1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"})),_o=5,Ei=12,Cd=4,HI={userSelect:"none",WebkitUserSelect:"none",paddingTop:Cd,paddingBottom:Cd,boxSizing:"border-box",cursor:"pointer",position:"relative",touchAction:"none"},UI={height:_o,backgroundColor:"rgba(255, 255, 255, 0.25)",width:"100%",borderRadius:_o/2},ZI=e=>{let t=e;for(;t.parentElement;)t=t.parentElement;return t},YI=({durationInFrames:e,onSeekEnd:t,onSeekStart:n,inFrame:r,outFrame:o})=>{const i=c.useRef(null),s=ip(i,!1),a=sp(i,{triggerOnWindowResize:!0,shouldApplyCssTransforms:!0}),{seek:l,play:u,pause:f,playing:p}=su(),m=ie.Timeline.useTimelinePosition(),[h,y]=c.useState({dragging:!1}),g=(a==null?void 0:a.width)??0,E=c.useCallback(C=>{var P;if(C.button!==0)return;const k=(P=i.current)==null?void 0:P.getBoundingClientRect().left,T=xh(C.clientX-k,e,g);f(),l(T),y({dragging:!0,wasPlaying:p}),n()},[e,g,f,l,p,n]),v=c.useCallback(C=>{var P;if(!a)throw new Error("Player has no size");if(!h.dragging)return;const k=(P=i.current)==null?void 0:P.getBoundingClientRect().left,T=xh(C.clientX-k,e,a.width);l(T)},[h.dragging,e,l,a]),w=c.useCallback(()=>{y({dragging:!1}),h.dragging&&(h.wasPlaying?u():f(),t())},[h,t,f,u]);c.useEffect(()=>{if(!h.dragging)return;const C=ZI(i.current);return C.addEventListener("pointermove",v),C.addEventListener("pointerup",w),()=>{C.removeEventListener("pointermove",v),C.removeEventListener("pointerup",w)}},[h.dragging,v,w]);const x=c.useMemo(()=>({height:Ei,width:Ei,borderRadius:Ei/2,position:"absolute",top:Cd-Ei/2+5/2,backgroundColor:"white",left:Math.max(0,m/Math.max(1,e-1)*g-Ei/2),boxShadow:"0 0 2px black",opacity:Number(s||h.dragging)}),[s,h.dragging,e,m,g]),b=c.useMemo(()=>({height:_o,backgroundColor:"rgba(255, 255, 255, 1)",width:(m-(r??0))/(e-1)*g,marginLeft:(r??0)/(e-1)*g,borderRadius:_o/2}),[e,m,r,g]),S=c.useMemo(()=>({height:_o,backgroundColor:"rgba(255, 255, 255, 0.25)",width:((o??e-1)-(r??0))/(e-1)*100+"%",marginLeft:(r??0)/(e-1)*100+"%",borderRadius:_o/2,position:"absolute"}),[e,r,o]);return d.jsxs("div",{ref:i,onPointerDown:E,style:HI,children:[d.jsxs("div",{style:UI,children:[d.jsx("div",{style:S}),d.jsx("div",{style:b})]}),d.jsx("div",{style:x})]})},bh=e=>{const t=Math.floor(e/60),n=Math.floor(e-t*60);return`${String(t)}:${String(n).padStart(2,"0")}`},KI=({durationInFrames:e,maxTimeLabelWidth:t,fps:n})=>{const r=ie.Timeline.useTimelinePosition(),o=c.useMemo(()=>({color:"white",fontFamily:"sans-serif",fontSize:14,maxWidth:t===null?void 0:t,overflow:"hidden",textOverflow:"ellipsis"}),[t]),s=r===e-1?r+1:r;return d.jsxs("div",{style:o,children:[bh(s/n)," / ",bh(e/n)]})},XI=10,Id=12,GI=({allowFullscreen:e,playerWidth:t})=>c.useMemo(()=>{const r=lt,o=lt,i=e?Ed:0,s=o+r+i+Id*2+XI*2,a=t-s,l=Math.max(a,0),u=l-$r,p=(u<$r?l:u)+s+$r,m=t<p;return{maxTimeLabelWidth:l===0?null:l,displayVerticalVolumeSlider:m}},[e,t]),qI=[0,.013,.049,.104,.175,.259,.352,.45,.55,.648,.741,.825,.896,.951,.987],QI=[0,8.1,15.5,22.5,29,35.3,41.2,47.1,52.9,58.8,64.7,71,77.5,84.5,91.9],JI=1/.7,eT={boxSizing:"border-box",position:"absolute",bottom:0,width:"100%",paddingTop:40,paddingBottom:10,backgroundImage:`linear-gradient(to bottom,${qI.map((e,t)=>`hsla(0, 0%, 0%, ${e}) ${QI[t]*JI}%`).join(", ")}, hsl(0, 0%, 0%) 100%)`,backgroundSize:"auto 145px",display:"flex",paddingRight:Id,paddingLeft:Id,flexDirection:"column",transition:"opacity 0.3s"},tT={display:"flex",flexDirection:"row",width:"100%",alignItems:"center",justifyContent:"center",userSelect:"none",WebkitUserSelect:"none"},nT={display:"flex",flexDirection:"row",userSelect:"none",WebkitUserSelect:"none",alignItems:"center"},ki={width:12},rT={height:8},oT={flex:1},iT={},sT=({durationInFrames:e,isFullscreen:t,fps:n,showVolumeControls:r,onFullscreenButtonClick:o,allowFullscreen:i,onExitFullscreenButtonClick:s,spaceKeyToPlayOrPause:a,onSeekEnd:l,onSeekStart:u,inFrame:f,outFrame:p,initiallyShowControls:m,canvasSize:h,renderPlayPauseButton:y,renderFullscreenButton:g,alwaysShowControls:E,showPlaybackRateControl:v,containerRef:w,buffering:x,hideControlsWhenPointerDoesntMove:b,onPointerDown:S,onDoubleClick:C,renderMuteButton:k,renderVolumeSlider:T,playing:P,toggle:j,renderCustomControls:M})=>{const D=c.useRef(null),[N,L]=c.useState(!1),H=ip(w,b),{maxTimeLabelWidth:O,displayVerticalVolumeSlider:R}=GI({allowFullscreen:i,playerWidth:(h==null?void 0:h.width)??0}),[I,_]=c.useState(()=>{if(typeof m=="boolean")return m;if(typeof m=="number"){if(m%1!==0)throw new Error("initiallyShowControls must be an integer or a boolean");if(Number.isNaN(m))throw new Error("initiallyShowControls must not be NaN");if(!Number.isFinite(m))throw new Error("initiallyShowControls must be finite");if(m<=0)throw new Error("initiallyShowControls must be a positive integer");return m}throw new TypeError("initiallyShowControls must be a number or a boolean")}),F=c.useMemo(()=>({...eT,opacity:Number(H||!P||I||E)}),[H,I,P,E]);c.useEffect(()=>{D.current&&a&&D.current.focus({preventScroll:!0})},[P,a]),c.useEffect(()=>{L((typeof document<"u"&&(document.fullscreenEnabled||document.webkitFullscreenEnabled))??!1)},[]),c.useEffect(()=>{if(I===!1)return;const V=setTimeout(()=>{_(!1)},I===!0?2e3:I);return()=>{clearInterval(V)}},[I]);const z=c.useMemo(()=>{if(v===!0)return[.5,.8,1,1.2,1.5,1.8,2,2.5,3];if(Array.isArray(v)){for(const Z of v){if(typeof Z!="number")throw new Error("Every item in showPlaybackRateControl must be a number");if(Z<=0)throw new Error("Every item in showPlaybackRateControl must be positive")}return v}return null},[v]),B=M?M():null,Y=c.useRef(null),$=c.useRef(null),A=c.useCallback(Z=>{(Z.target===Y.current||Z.target===$.current)&&(S==null||S(Z))},[S]),X=c.useCallback(Z=>{(Z.target===Y.current||Z.target===$.current)&&(C==null||C(Z))},[C]);return d.jsxs("div",{ref:Y,style:F,onPointerDown:A,onDoubleClick:X,children:[d.jsxs("div",{ref:$,style:tT,children:[d.jsxs("div",{style:nT,children:[d.jsx("button",{ref:D,type:"button",style:kd,onClick:j,"aria-label":P?"Pause video":"Play video",title:P?"Pause video":"Play video",children:y===null?d.jsx(yh,{buffering:x,playing:P}):y({playing:P,isBuffering:x})??d.jsx(yh,{buffering:x,playing:P})}),r?d.jsxs(d.Fragment,{children:[d.jsx("div",{style:ki}),d.jsx(PI,{renderMuteButton:k,renderVolumeSlider:T,displayVerticalVolumeSlider:R})]}):null,d.jsx("div",{style:ki}),d.jsx(KI,{durationInFrames:e,fps:n,maxTimeLabelWidth:O}),d.jsx("div",{style:ki})]}),d.jsx("div",{style:oT}),B,B&&z&&h?d.jsx("div",{style:ki}):null,z&&h&&d.jsx(WI,{canvasSize:h,playbackRates:z}),z&&N&&i?d.jsx("div",{style:ki}):null,d.jsx("div",{style:iT,children:N&&i?d.jsx("button",{type:"button","aria-label":t?"Exit fullscreen":"Enter Fullscreen",title:t?"Exit fullscreen":"Enter Fullscreen",style:kd,onClick:t?s:o,children:g===null?d.jsx(lI,{isFullscreen:t}):g({isFullscreen:t})}):null})]}),d.jsx("div",{style:rT}),d.jsx(YI,{onSeekEnd:l,onSeekStart:u,durationInFrames:e,inFrame:f,outFrame:p})]})},Ww=typeof document>"u",aT=e=>{let t=!1;return{promise:new Promise((r,o)=>{e.then(i=>{if(t){o({isCanceled:t,value:i});return}r(i)}).catch(i=>{o({isCanceled:t,error:i})})}),cancel:()=>{t=!0}}},lT=e=>new Promise(t=>setTimeout(t,e)),uT=()=>{const e=c.useRef([]),t=c.useCallback(i=>{e.current=[...e.current,i]},[]),n=c.useCallback(i=>{e.current=e.current.filter(s=>s!==i)},[]),r=c.useCallback(()=>e.current.map(i=>i.cancel()),[]);return c.useMemo(()=>({appendPendingPromise:t,removePendingPromise:n,clearPendingPromises:r}),[t,r,n])},cT=(e,t,n)=>{const r=uT(),o=c.useCallback(async l=>{if(l instanceof PointerEvent?l.pointerType==="touch":l.nativeEvent.pointerType==="touch"){e(l);return}r.clearPendingPromises();const u=aT(lT(200));r.appendPendingPromise(u);try{await u.promise,r.removePendingPromise(u),e(l)}catch(f){const p=f;if(r.removePendingPromise(u),!p.isCanceled)throw p.error}},[r,e]),i=c.useCallback(()=>{document.addEventListener("pointerup",l=>{o(l)},{once:!0})},[o]),s=c.useCallback(()=>{r.clearPendingPromises(),t()},[r,t]);return c.useMemo(()=>n?{handlePointerDown:i,handleDoubleClick:s}:{handlePointerDown:e,handleDoubleClick:()=>{}},[n,s,i,e])},Td=ne.version.split(".")[0];if(Td==="0")throw new Error(`Version ${Td} of "react" is not supported by Remotion`);var dT=parseInt(Td,10)>=18,fT=({controls:e,style:t,loop:n,autoPlay:r,allowFullscreen:o,inputProps:i,clickToPlay:s,showVolumeControls:a,doubleClickToFullscreen:l,spaceKeyToPlayOrPause:u,errorFallback:f,playbackRate:p,renderLoading:m,renderPoster:h,className:y,moveToBeginningWhenEnded:g,showPosterWhenUnplayed:E,showPosterWhenEnded:v,showPosterWhenPaused:w,showPosterWhenBuffering:x,showPosterWhenBufferingAndPaused:b,inFrame:S,outFrame:C,initiallyShowControls:k,renderFullscreen:T,renderPlayPauseButton:P,renderMuteButton:j,renderVolumeSlider:M,renderCustomControls:D,alwaysShowControls:N,showPlaybackRateControl:L,posterFillMode:H,bufferStateDelayInMilliseconds:O,hideControlsWhenPointerDoesntMove:R,overflowVisible:I,browserMediaControlsBehavior:_,overrideInternalClassName:F,noSuspense:z},B)=>{const Y=ie.useUnsafeVideoConfig(),$=ie.useVideo(),A=c.useRef(null),X=sp(A,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),[Z,V]=c.useState(!1),[U,se]=c.useState(r),[de,ae]=c.useState(()=>!1),[te,J]=c.useState(!1),Q=c.useMemo(()=>typeof document>"u"?!1:!!(document.fullscreenEnabled||document.webkitFullscreenEnabled),[]),G=su(),fe=G.toggle,{playerMuted:Ee,mediaVolume:$e}=c.useContext(ie.MediaVolumeContext);c.useEffect(()=>{G.emitter.dispatchVolumeChange($e)},[G.emitter,$e]);const Fe=Ee||$e===0;c.useEffect(()=>{G.emitter.dispatchMuteChange({isMuted:Fe})},[G.emitter,Fe]),EI({loop:n,playbackRate:p,moveToBeginningWhenEnded:g,inFrame:S,outFrame:C,getCurrentFrame:G.getCurrentFrame,browserMediaControlsBehavior:_,muted:Fe}),c.useEffect(()=>{Z&&!G.playing&&(V(!1),G.play())},[Z,G]),c.useEffect(()=>{const{current:ce}=A;if(!ce)return;const be=()=>{const rn=document.fullscreenElement===ce||document.webkitFullscreenElement===ce;ae(rn)};return document.addEventListener("fullscreenchange",be),document.addEventListener("webkitfullscreenchange",be),()=>{document.removeEventListener("fullscreenchange",be),document.removeEventListener("webkitfullscreenchange",be)}},[]);const Ie=c.useCallback(ce=>{fe(ce)},[fe]),he=c.useCallback(()=>{if(!o)throw new Error("allowFullscreen is false");if(!Q)throw new Error("Browser doesnt support fullscreen");if(!A.current)throw new Error("No player ref found");A.current.webkitRequestFullScreen?A.current.webkitRequestFullScreen():A.current.requestFullscreen()},[o,Q]),we=c.useCallback(()=>{document.webkitExitFullscreen?document.webkitExitFullscreen():document.exitFullscreen()},[]);c.useEffect(()=>{const{current:ce}=A;if(!ce)return;const be=()=>{const rn=document.webkitFullscreenElement??document.fullscreenElement;rn&&rn===A.current?G.emitter.dispatchFullscreenChange({isFullscreen:!0}):G.emitter.dispatchFullscreenChange({isFullscreen:!1})};return ce.addEventListener("webkitfullscreenchange",be),ce.addEventListener("fullscreenchange",be),()=>{ce.removeEventListener("webkitfullscreenchange",be),ce.removeEventListener("fullscreenchange",be)}},[G.emitter]);const _e=(Y==null?void 0:Y.durationInFrames)??1,ge=c.useMemo(()=>!Y||!X?null:Aw({canvasSize:X,compositionHeight:Y.height,compositionWidth:Y.width,previewSize:"auto"}),[X,Y]),ke=(ge==null?void 0:ge.scale)??1,ft=c.useRef(!1);c.useEffect(()=>{if(!ft.current){ft.current=!0;return}G.emitter.dispatchScaleChange(ke)},[G.emitter,ke]);const{setMediaVolume:At,setPlayerMuted:Rr}=c.useContext(ie.SetMediaVolumeContext),[tn,Zt]=c.useState(!1);c.useEffect(()=>{let ce=null,be=!1;const rn=()=>{be=!1,requestAnimationFrame(()=>{O===0?Zt(!0):ce=setTimeout(()=>{be||Zt(!0)},O)})},io=()=>{requestAnimationFrame(()=>{be=!0,Zt(!1),ce&&clearTimeout(ce)})};return G.emitter.addEventListener("waiting",rn),G.emitter.addEventListener("resume",io),()=>{G.emitter.removeEventListener("waiting",rn),G.emitter.removeEventListener("resume",io),Zt(!1),ce&&clearTimeout(ce),be=!0}},[O,G.emitter]),c.useImperativeHandle(B,()=>{const ce={play:G.play,pause:()=>{V(!1),G.pause()},toggle:Ie,getContainerNode:()=>A.current,getCurrentFrame:G.getCurrentFrame,isPlaying:G.isPlaying,seekTo:be=>{const rn=_e-1,io=Math.max(0,Math.min(rn,be));G.isPlaying()&&(V(io!==rn||n),G.pause()),io===rn&&!n&&G.emitter.dispatchEnded(),G.seek(io)},isFullscreen:()=>{const{current:be}=A;return be?document.fullscreenElement===be||document.webkitFullscreenElement===be:!1},requestFullscreen:he,exitFullscreen:we,getVolume:()=>Ee?0:$e,setVolume:be=>{if(typeof be!="number")throw new TypeError(`setVolume() takes a number, got value of type ${typeof be}`);if(isNaN(be))throw new TypeError("setVolume() got a number that is NaN. Volume must be between 0 and 1.");if(be<0||be>1)throw new TypeError(`setVolume() got a number that is out of range. Must be between 0 and 1, got ${be}`);At(be)},isMuted:()=>Fe,mute:()=>{Rr(!0)},unmute:()=>{Rr(!1)},getScale:()=>ke,pauseAndReturnToPlayStart:()=>{G.pauseAndReturnToPlayStart()}};return Object.assign(G.emitter,ce)},[_e,we,n,Ee,Fe,$e,G,he,Rr,At,Ie,ke]);const Pn=$?$.component:null,Nt=c.useMemo(()=>Nw({canvasSize:X,config:Y,style:t,overflowVisible:I,layout:ge}),[X,Y,ge,I,t]),Kn=c.useMemo(()=>zw({config:Y,layout:ge,scale:ke,overflowVisible:I}),[Y,ge,I,ke]),Ms=c.useMemo(()=>Lw({config:Y,layout:ge,scale:ke,overflowVisible:I}),[Y,ge,I,ke]),Xn=G.pause,to=G.emitter.dispatchError,pu=c.useCallback(ce=>{Xn(),to(ce)},[to,Xn]),ve=c.useCallback(ce=>{ce.stopPropagation(),he()},[he]),$s=c.useCallback(ce=>{ce.stopPropagation(),we()},[we]),mu=c.useCallback(ce=>{(ce instanceof MouseEvent?ce.button===2:ce.nativeEvent.button)||Ie(ce)},[Ie]),ui=c.useCallback(()=>{J(!0)},[]),vn=c.useCallback(()=>{J(!1)},[]),hu=c.useCallback(()=>{de?we():he()},[we,de,he]),{handlePointerDown:no,handleDoubleClick:ro}=cT(mu,hu,l&&o&&Q);c.useEffect(()=>{U&&(G.play(),se(!1))},[U,G]);const gu=c.useMemo(()=>m?m({height:Nt.height,width:Nt.width,isBuffering:tn}):null,[Nt.height,Nt.width,m,tn]),K=c.useMemo(()=>({type:"scale",scale:ke}),[ke]);if(!Y)return null;const ee=h?h({height:H==="player-size"?Nt.height:Y.height,width:H==="player-size"?Nt.width:Y.width,isBuffering:tn}):null;if(ee===void 0)throw new TypeError("renderPoster() must return a React element, but undefined was returned");const re=ee&&[w&&!G.isPlaying()&&!te,v&&G.isLastFrame&&!G.isPlaying(),E&&!G.hasPlayed&&!G.isPlaying(),x&&tn&&G.isPlaying(),b&&tn&&!G.isPlaying()].some(Boolean),{left:Te,top:Ct,width:pt,height:Fn,...oo}=Kn,nn=d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:Kn,onPointerDown:s?no:void 0,onDoubleClick:l?ro:void 0,children:[d.jsxs("div",{style:Ms,className:ap(F),children:[Pn?d.jsx(Bw,{onError:pu,errorFallback:f,children:d.jsx(ie.CurrentScaleContext.Provider,{value:K,children:d.jsx(Pn,{...($==null?void 0:$.props)??{},...i??{}})})}):null,re&&H==="composition-size"?d.jsx("div",{style:{...oo,width:Y.width,height:Y.height},onPointerDown:s?no:void 0,onDoubleClick:l?ro:void 0,children:ee}):null]}),d.jsx(TI,{})]}),re&&H==="player-size"?d.jsx("div",{style:Kn,onPointerDown:s?no:void 0,onDoubleClick:l?ro:void 0,children:ee}):null,e?d.jsx(sT,{fps:Y.fps,playing:G.playing,toggle:G.toggle,durationInFrames:Y.durationInFrames,containerRef:A,onFullscreenButtonClick:ve,isFullscreen:de,allowFullscreen:o,showVolumeControls:a,onExitFullscreenButtonClick:$s,spaceKeyToPlayOrPause:u,onSeekEnd:vn,onSeekStart:ui,inFrame:S,outFrame:C,initiallyShowControls:k,canvasSize:X,renderFullscreenButton:T,renderPlayPauseButton:P,alwaysShowControls:N,showPlaybackRateControl:L,buffering:tn,hideControlsWhenPointerDoesntMove:R,onDoubleClick:l?ro:void 0,onPointerDown:s?no:void 0,renderMuteButton:j,renderVolumeSlider:M,renderCustomControls:D}):null]});return z||Ww&&!dT?d.jsx("div",{ref:A,style:Nt,className:y,children:nn}):d.jsx("div",{ref:A,style:Nt,className:y,children:d.jsx(c.Suspense,{fallback:gu,children:nn})})},pT=c.forwardRef(fT),Hw="remotion.volumePreference",mT=(e,t,n)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(n??Hw,String(e))}catch(r){ie.Log.error({logLevel:t,tag:null},"Could not persist volume",r)}},hT=e=>{if(typeof window>"u")return 1;try{const t=window.localStorage.getItem(e??Hw);return t?Number(t):1}catch{return 1}},lp="player-comp",Uw=({children:e,timelineContext:t,playbackRateContext:n,fps:r,compositionHeight:o,compositionWidth:i,durationInFrames:s,component:a,numberOfSharedAudioTags:l,initiallyMuted:u,logLevel:f,audioLatencyHint:p,sampleRate:m,volumePersistenceKey:h,initialVolume:y,inputProps:g,audioEnabled:E})=>{const v=y===void 0,w=c.useMemo(()=>({compositions:[{component:a,durationInFrames:s,height:o,width:i,fps:r,id:lp,nonce:[[0,777]],folderName:null,parentFolderName:null,schema:null,calculateMetadata:null,stack:null}],folders:[],currentCompositionMetadata:{defaultCodec:null,defaultOutName:null,defaultPixelFormat:null,defaultProResProfile:null,defaultSampleRate:null,defaultVideoImageFormat:null,durationInFrames:s,fps:r,height:o,width:i,props:g},canvasContent:{type:"composition",compositionId:"player-comp"}}),[a,s,o,i,r,g]),[x,b]=c.useState(()=>u),[S,C]=c.useState(()=>v?hT(h??null):y),k=c.useMemo(()=>({playerMuted:x,mediaVolume:S}),[x,S]),T=c.useRef(!1),P=T.current||E&&!x&&S>0;T.current=P;const j=c.useCallback(L=>{C(L),v&&mT(L,f,h??null)},[v,f,h]),M=c.useMemo(()=>({setPlayerMuted:b,setMediaVolume:j}),[j]),D=c.useMemo(()=>({logLevel:f,mountTime:Date.now()}),[f]),N=c.useMemo(()=>({isPlayer:!0,isRendering:!1,isStudio:!1,isClientSideRendering:!1,isReadOnlyStudio:!1}),[]);return d.jsx(ie.RemotionEnvironmentContext.Provider,{value:N,children:d.jsx(ie.LogLevelContext.Provider,{value:D,children:d.jsx(ie.CanUseRemotionHooksProvider,{children:d.jsx(ie.AbsoluteTimeContext.Provider,{value:t,children:d.jsx(ie.PlaybackRateContext.Provider,{value:n,children:d.jsx(ie.TimelineContext.Provider,{value:t,children:d.jsx(ie.CompositionManager.Provider,{value:w,children:d.jsx(ie.PrefetchProvider,{children:d.jsx(ie.DurationsContextProvider,{children:d.jsx(ie.MediaVolumeContext.Provider,{value:k,children:d.jsx(ie.SetMediaVolumeContext.Provider,{value:M,children:d.jsx(ie.BufferingProvider,{children:d.jsx(ie.SharedAudioContextProvider,{audioLatencyHint:p,audioEnabled:P,previewSampleRate:m,children:d.jsx(ie.SharedAudioTagsContextProvider,{numberOfAudioTags:l,children:e})})})})})})})})})})})})})})},Sh=!1,gT=(e,t)=>{e||Sh||(Sh=!0,ie.Log.warn({logLevel:t,tag:null},"Note: Some companies are required to obtain a license to use Remotion. See: https://remotion.dev/license\nPass the `acknowledgeRemotionLicense` prop to `<Player />` function to make this message disappear."))},Eh=(e,t)=>{if(typeof e>"u"||e===null)return e??null;if(typeof e!="number")throw new TypeError(`"${t}" must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new TypeError(`"${t}" must not be NaN, but is ${JSON.stringify(e)}`);if(!Number.isFinite(e))throw new TypeError(`"${t}" must be finite, but is ${JSON.stringify(e)}`);if(e%1!==0)throw new TypeError(`"${t}" must be an integer, but is ${JSON.stringify(e)}`);return e},vT=({inFrame:e,durationInFrames:t,outFrame:n})=>{const r=Eh(e,"inFrame"),o=Eh(n,"outFrame");if(!(r===null&&o===null)){if(r!==null&&r>t-1)throw new Error("inFrame must be less than (durationInFrames - 1), but is "+r);if(o!==null&&o>t-1)throw new Error("outFrame must be less than (durationInFrames - 1), but is "+o);if(r!==null&&r<0)throw new Error("inFrame must be greater than 0, but is "+r);if(o!==null&&o<=0)throw new Error(`outFrame must be greater than 0, but is ${o}. If you want to render a single frame, use <Thumbnail /> instead.`);if(o!==null&&r!==null&&o<=r)throw new Error("outFrame must be greater than inFrame, but is "+o+" <= "+r)}},yT=({initialFrame:e,durationInFrames:t})=>{if(typeof t!="number")throw new Error(`\`durationInFrames\` must be a number, but is ${JSON.stringify(t)}`);if(!(typeof e>"u")){if(typeof e!="number")throw new Error(`\`initialFrame\` must be a number, but is ${JSON.stringify(e)}`);if(Number.isNaN(e))throw new Error("`initialFrame` must be a number, but is NaN");if(!Number.isFinite(e))throw new Error("`initialFrame` must be a number, but is Infinity");if(e%1!==0)throw new Error(`\`initialFrame\` must be an integer, but is ${JSON.stringify(e)}`);if(e>t-1)throw new Error(`\`initialFrame\` must be less or equal than \`durationInFrames - 1\`, but is ${JSON.stringify(e)}`)}},wT=e=>{if(e!==void 0){if(e>10)throw new Error(`The highest possible playback rate is 10. You passed: ${e}`);if(e<-10)throw new Error(`The lowest possible playback rate is -10. You passed: ${e}`);if(e===0)throw new Error("A playback rate of 0 is not supported.")}},xT=iu.validateFps,kh=iu.validateDimension,bT=iu.validateDurationInFrames,ST=iu.validateDefaultAndInputProps,ET=e=>"component"in e?e.component:null,kT=({durationInFrames:e,compositionHeight:t,compositionWidth:n,fps:r,inputProps:o,style:i,controls:s=!1,loop:a=!1,autoPlay:l=!1,showVolumeControls:u=!0,allowFullscreen:f=!0,clickToPlay:p,doubleClickToFullscreen:m=!1,spaceKeyToPlayOrPause:h=!0,moveToBeginningWhenEnded:y=!0,numberOfSharedAudioTags:g=5,errorFallback:E=()=>"⚠️",playbackRate:v=1,renderLoading:w,className:x,showPosterWhenUnplayed:b,showPosterWhenEnded:S,showPosterWhenPaused:C,showPosterWhenBuffering:k,showPosterWhenBufferingAndPaused:T,initialFrame:P,renderPoster:j,inFrame:M,outFrame:D,initiallyShowControls:N,renderFullscreenButton:L,renderPlayPauseButton:H,renderVolumeSlider:O,renderCustomControls:R,alwaysShowControls:I=!1,initiallyMuted:_=!1,showPlaybackRateControl:F=!1,posterFillMode:z="player-size",bufferStateDelayInMilliseconds:B,hideControlsWhenPointerDoesntMove:Y=!0,overflowVisible:$=!1,renderMuteButton:A,browserMediaControlsBehavior:X,overrideInternalClassName:Z,logLevel:V="info",noSuspense:U,acknowledgeRemotionLicense:se,audioLatencyHint:de="playback",sampleRate:ae=48e3,volumePersistenceKey:te,initialVolume:J,...Q},G)=>{if(typeof window<"u"&&(window.remotion_isPlayer=!0),Q.defaultProps!==void 0)throw new Error("The <Player /> component does not accept `defaultProps`, but some were passed. Use `inputProps` instead.");const fe=ET(Q);if((fe==null?void 0:fe.type)===al)throw new TypeError("'component' should not be an instance of <Composition/>. Pass the React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");if(fe===al)throw new TypeError("'component' must not be the 'Composition' component. Pass your own React component directly, and set the duration, fps and dimensions as separate props. See https://www.remotion.dev/docs/player/examples for an example.");c.useState(()=>gT(!!se,V));const Ee=ie.useLazyComponent({compProps:Q,componentName:"Player",noSuspense:!!U});yT({initialFrame:P,durationInFrames:e});const[$e,Fe]=c.useState(()=>({[lp]:P??0})),[Ie,he]=c.useState(!1),[we]=c.useState("player-comp"),_e=c.useRef(null),ge=c.useRef([]),ke=c.useRef(!1),[ft,At]=c.useState(v);if(typeof t!="number")throw new TypeError(`'compositionHeight' must be a number but got '${typeof t}' instead`);if(typeof n!="number")throw new TypeError(`'compositionWidth' must be a number but got '${typeof n}' instead`);if(kh(t,"compositionHeight","of the <Player /> component"),kh(n,"compositionWidth","of the <Player /> component"),bT(e,{component:"of the <Player/> component",allowFloats:!1}),xT(r,"as a prop of the <Player/> component",!1),ST(o,"inputProps",null),vT({durationInFrames:e,inFrame:M,outFrame:D}),typeof s!="boolean"&&typeof s<"u")throw new TypeError(`'controls' must be a boolean or undefined but got '${typeof s}' instead`);if(typeof l!="boolean"&&typeof l<"u")throw new TypeError(`'autoPlay' must be a boolean or undefined but got '${typeof l}' instead`);if(typeof a!="boolean"&&typeof a<"u")throw new TypeError(`'loop' must be a boolean or undefined but got '${typeof a}' instead`);if(typeof m!="boolean"&&typeof m<"u")throw new TypeError(`'doubleClickToFullscreen' must be a boolean or undefined but got '${typeof m}' instead`);if(typeof u!="boolean"&&typeof u<"u")throw new TypeError(`'showVolumeControls' must be a boolean or undefined but got '${typeof u}' instead`);if(typeof f!="boolean"&&typeof f<"u")throw new TypeError(`'allowFullscreen' must be a boolean or undefined but got '${typeof f}' instead`);if(typeof p!="boolean"&&typeof p<"u")throw new TypeError(`'clickToPlay' must be a boolean or undefined but got '${typeof p}' instead`);if(typeof h!="boolean"&&typeof h<"u")throw new TypeError(`'spaceKeyToPlayOrPause' must be a boolean or undefined but got '${typeof h}' instead`);if(typeof ae!="number"||!Number.isFinite(ae)||Number.isNaN(ae)||ae<=0||ae%1!==0)throw new TypeError(`'sampleRate' must be a positive integer but got '${ae}' instead`);if(typeof J<"u"&&typeof J!="number")throw new TypeError(`'initialVolume' must be a number or undefined but got '${typeof J}' instead`);if(typeof J=="number"&&(!Number.isFinite(J)||Number.isNaN(J)||J<0||J>1))throw new TypeError(`'initialVolume' must be between 0 and 1 but got '${J}' instead`);if(typeof g!="number"||g%1!==0||!Number.isFinite(g)||Number.isNaN(g)||g<0)throw new TypeError(`'numberOfSharedAudioTags' must be an integer but got '${g}' instead`);wT(ft),c.useEffect(()=>{At(v)},[v]),c.useImperativeHandle(G,()=>_e.current,[]),c.useState(()=>{ie.playbackLogging({logLevel:V,message:`[player] Mounting <Player>. User agent = ${typeof navigator>"u"?"server":navigator.userAgent}`,tag:"player",mountTime:Date.now()})});const Rr=c.useMemo(()=>({frame:$e,playing:Ie,rootId:we,imperativePlaying:ke,audioAndVideoTags:ge}),[$e,Ie,we]),tn=c.useMemo(()=>({playbackRate:ft,setPlaybackRate:At}),[ft]),Zt=c.useMemo(()=>({setFrame:Fe,setPlaying:he}),[Fe]);typeof window<"u"&&c.useLayoutEffect(()=>{ie.CSSUtils.injectCSS(ie.CSSUtils.makeDefaultPreviewCSS(`.${ap(Z)}`,"#fff"))},[Z]);const Pn=c.useMemo(()=>o??{},[o]),Nt=c.useMemo(()=>X??{mode:"prevent-media-session"},[X]);return d.jsx(ie.IsPlayerContextProvider,{children:d.jsx(Uw,{timelineContext:Rr,playbackRateContext:tn,component:Ee,compositionHeight:t,compositionWidth:n,durationInFrames:e,fps:r,numberOfSharedAudioTags:g,initiallyMuted:_,logLevel:V,audioLatencyHint:de,sampleRate:ae,volumePersistenceKey:te,initialVolume:J,inputProps:Pn,audioEnabled:!0,children:d.jsx(ie.SetTimelineContext.Provider,{value:Zt,children:d.jsx(vI,{currentPlaybackRate:ft,children:d.jsx(pT,{ref:_e,posterFillMode:z,renderLoading:w,autoPlay:!!l,loop:!!a,controls:!!s,errorFallback:E,style:i,inputProps:Pn,allowFullscreen:!!f,moveToBeginningWhenEnded:!!y,clickToPlay:typeof p=="boolean"?p:!!s,showVolumeControls:!!u,doubleClickToFullscreen:!!m,spaceKeyToPlayOrPause:!!h,playbackRate:ft,className:x??void 0,showPosterWhenUnplayed:!!b,showPosterWhenEnded:!!S,showPosterWhenPaused:!!C,showPosterWhenBuffering:!!k,showPosterWhenBufferingAndPaused:!!T,renderPoster:j,inFrame:M??null,outFrame:D??null,initiallyShowControls:N??!0,renderFullscreen:L??null,renderPlayPauseButton:H??null,renderMuteButton:A??null,renderVolumeSlider:O??null,renderCustomControls:R??null,alwaysShowControls:I,showPlaybackRateControl:F,bufferStateDelayInMilliseconds:B??300,hideControlsWhenPointerDoesntMove:Y,overflowVisible:$,browserMediaControlsBehavior:Nt,overrideInternalClassName:Z??void 0,noSuspense:!!U})})})})})},CT=c.forwardRef,IT=CT(kT),TT=()=>{const e=c.useContext(Ow);if(!e)throw new TypeError("Expected Player event emitter context");return c.useMemo(()=>({emitter:e}),[e])},Rd=ne.version.split(".")[0];if(Rd==="0")throw new Error(`Version ${Rd} of "react" is not supported by Remotion`);var RT=parseInt(Rd,10)>=18,_T=({style:e,inputProps:t,errorFallback:n,renderLoading:r,className:o,overflowVisible:i,noSuspense:s,overrideInternalClassName:a},l)=>{const u=ie.useUnsafeVideoConfig(),f=ie.useVideo(),p=c.useRef(null),m=sp(p,{triggerOnWindowResize:!1,shouldApplyCssTransforms:!1}),h=c.useMemo(()=>!u||!m?null:Aw({canvasSize:m,compositionHeight:u.height,compositionWidth:u.width,previewSize:"auto"}),[m,u]),y=(h==null?void 0:h.scale)??1,g=TT();Vw(g.emitter),c.useImperativeHandle(l,()=>{const T={getContainerNode:()=>p.current,getScale:()=>y};return Object.assign(g.emitter,T)},[y,g.emitter]);const E=f?f.component:null,v=c.useMemo(()=>Nw({config:u,style:e,canvasSize:m,overflowVisible:i,layout:h}),[m,u,h,i,e]),w=c.useMemo(()=>zw({config:u,layout:h,scale:y,overflowVisible:i}),[u,h,i,y]),x=c.useMemo(()=>Lw({config:u,layout:h,scale:y,overflowVisible:i}),[u,h,i,y]),b=c.useCallback(T=>{g.emitter.dispatchError(T)},[g.emitter]),S=c.useMemo(()=>r?r({height:v.height,width:v.width,isBuffering:!1}):null,[v.height,v.width,r]),C=c.useMemo(()=>({type:"scale",scale:y}),[y]);if(!u)return null;const k=d.jsx("div",{style:w,children:d.jsx("div",{style:x,className:ap(a),children:E?d.jsx(Bw,{onError:b,errorFallback:n,children:d.jsx(ie.CurrentScaleContext.Provider,{value:C,children:d.jsx(E,{...(f==null?void 0:f.props)??{},...t??{}})})}):null})});return s||Ww&&!RT?d.jsx("div",{ref:p,style:v,className:o,children:k}):d.jsx("div",{ref:p,style:v,className:o,children:d.jsx(c.Suspense,{fallback:S,children:k})})},PT=c.forwardRef(_T),FT=({frameToDisplay:e,style:t,inputProps:n,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,className:a,errorFallback:l=()=>"⚠️",renderLoading:u,overflowVisible:f=!1,overrideInternalClassName:p,logLevel:m="info",noSuspense:h,...y},g)=>{typeof window<"u"&&c.useLayoutEffect(()=>{window.remotion_isPlayer=!0},[]);const[E]=c.useState(()=>String(Gr(null))),v=c.useRef(null),w=c.useMemo(()=>({playing:!1,frame:{[lp]:e},rootId:E,imperativePlaying:{current:!1},audioAndVideoTags:{current:[]}}),[e,E]),x=c.useMemo(()=>({playbackRate:1,setPlaybackRate:()=>{throw new Error("thumbnail")}}),[]);c.useImperativeHandle(g,()=>v.current,[]);const b=ie.useLazyComponent({compProps:y,componentName:"Thumbnail",noSuspense:!!h}),[S]=c.useState(()=>new gI),C=c.useMemo(()=>n??{},[n]);return d.jsx(ie.IsPlayerContextProvider,{children:d.jsx(Uw,{timelineContext:w,playbackRateContext:x,component:b,compositionHeight:r,compositionWidth:o,durationInFrames:i,fps:s,numberOfSharedAudioTags:0,initiallyMuted:!0,logLevel:m,audioLatencyHint:"playback",sampleRate:48e3,inputProps:C,audioEnabled:!1,children:d.jsx(Ow.Provider,{value:S,children:d.jsx(PT,{ref:v,className:a,errorFallback:l,inputProps:C,renderLoading:u,style:t,overflowVisible:f,overrideInternalClassName:p,noSuspense:!!h})})})})},jT=c.forwardRef;jT(FT);const zo=[1,1.5,2,4];function Ch(e){return zo.find(t=>t>e+1e-9)??zo[zo.length-1]}function MT(e,t){switch(t){case"L":return e.playing&&e.rate>0?{rate:Ch(e.rate),playing:!0}:{rate:zo[0],playing:!0};case"J":return e.playing&&e.rate<0?{rate:-Ch(-e.rate),playing:!0}:{rate:-zo[0],playing:!0};case"K":return{rate:zo[0],playing:!e.playing}}}function up(e,t,n){const r=Math.round(e*n),o=Math.round(t*n);return{from:r,durationInFrames:Math.max(1,o-r)}}const $T=({src:e,spans:t,punchInScale:n=1.07,punchThresholdSec:r=.15,audioFadeSec:o=.01,background:i="black"})=>{const{fps:s}=qe(),a=c.useMemo(()=>{const u=[];let f=!1;for(let p=0;p<t.length;p++){const m=t[p-1],h=m?t[p].srcIn-m.srcOut:0;p>0&&h>=r&&(f=!f),u.push(f?n:1)}return u},[t,n,r]),l=Math.max(1,Math.round(o*s));return d.jsx(hn,{style:{backgroundColor:i},children:t.map((u,f)=>{const{from:p,durationInFrames:m}=up(u.outIn,u.outOut,s);return d.jsx(dt,{from:p,durationInFrames:m,premountFor:s,children:d.jsx(hn,{style:{transform:`scale(${a[f]})`},children:d.jsx(Fw,{src:e,trimBefore:Math.round(u.srcIn*s),trimAfter:Math.round(u.srcOut*s),style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"var(--ossclip-obj-x, 50%) var(--ossclip-obj-y, 50%)"},volume:h=>Math.max(0,Math.min(1,(h+1)/l,(m-h)/l))})})},f)})})};function W(e,t,n){function r(a,l){var u;Object.defineProperty(a,"_zod",{value:a._zod??{},enumerable:!1}),(u=a._zod).traits??(u.traits=new Set),a._zod.traits.add(e),t(a,l);for(const f in s.prototype)f in a||Object.defineProperty(a,f,{value:s.prototype[f].bind(a)});a._zod.constr=s,a._zod.def=l}const o=(n==null?void 0:n.Parent)??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function s(a){var l;const u=n!=null&&n.Parent?new i:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return n!=null&&n.Parent&&a instanceof n.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class ds extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const Zw={};function yr(e){return Zw}function AT(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function NT(e,t){return typeof t=="bigint"?t.toString():t}function Yw(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cp(e){return e==null}function dp(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function LT(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}function ze(e,t,n){Object.defineProperty(e,t,{get(){{const r=n();return e[t]=r,r}},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function fp(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ci(e){return JSON.stringify(e)}const Kw=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function _d(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const zT=Yw(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function pl(e){if(_d(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(_d(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}const DT=new Set(["string","number","symbol"]);function au(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function eo(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n!=null&&n.parent)&&(r._zod.parent=e),r}function le(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function OT(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const VT={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function BT(e,t){const n={},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(n[o]=r.shape[o])}return eo(e,{...e._zod.def,shape:n,checks:[]})}function WT(e,t){const n={...e._zod.def.shape},r=e._zod.def;for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete n[o]}return eo(e,{...e._zod.def,shape:n,checks:[]})}function HT(e,t){if(!pl(t))throw new Error("Invalid input to extend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return fp(this,"shape",r),r},checks:[]};return eo(e,n)}function UT(e,t){return eo(e,{...e._zod.def,get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return fp(this,"shape",n),n},catchall:t._zod.def.catchall,checks:[]})}function ZT(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in r))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=e?new e({type:"optional",innerType:r[i]}):r[i])}else for(const i in r)o[i]=e?new e({type:"optional",innerType:r[i]}):r[i];return eo(t,{...t._zod.def,shape:o,checks:[]})}function YT(e,t,n){const r=t._zod.def.shape,o={...r};if(n)for(const i in n){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(o[i]=new e({type:"nonoptional",innerType:r[i]}))}else for(const i in r)o[i]=new e({type:"nonoptional",innerType:r[i]});return eo(t,{...t._zod.def,shape:o,checks:[]})}function Bi(e,t=0){var n;for(let r=t;r<e.issues.length;r++)if(((n=e.issues[r])==null?void 0:n.continue)!==!0)return!0;return!1}function Ar(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function la(e){return typeof e=="string"?e:e==null?void 0:e.message}function wr(e,t,n){var o,i,s,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const f=la((s=(i=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:i.error)==null?void 0:s.call(i,e))??la((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??la((l=n.customError)==null?void 0:l.call(n,e))??la((u=n.localeError)==null?void 0:u.call(n,e))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function pp(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function fs(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const Xw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,NT,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Gw=W("$ZodError",Xw),qw=W("$ZodError",Xw,{Parent:Error});function KT(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function XT(e,t){const n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>o({issues:a}));else if(s.code==="invalid_key")o({issues:s.issues});else if(s.code==="invalid_element")o({issues:s.issues});else if(s.path.length===0)r._errors.push(n(s));else{let a=r,l=0;for(;l<s.path.length;){const u=s.path[l];l===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(s))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return o(e),r}const GT=e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new ds;if(s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>wr(l,i,yr())));throw Kw(a,o==null?void 0:o.callee),a}return s.value},qT=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((o==null?void 0:o.Err)??e)(s.issues.map(l=>wr(l,i,yr())));throw Kw(a,o==null?void 0:o.callee),a}return s.value},Qw=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new ds;return i.issues.length?{success:!1,error:new(e??Gw)(i.issues.map(s=>wr(s,o,yr())))}:{success:!0,data:i.value}},QT=Qw(qw),Jw=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(s=>wr(s,o,yr())))}:{success:!0,data:i.value}},JT=Jw(qw),eR=/^[cC][^\s-]{8,}$/,tR=/^[0-9a-z]+$/,nR=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,rR=/^[0-9a-vA-V]{20}$/,oR=/^[A-Za-z0-9]{27}$/,iR=/^[a-zA-Z0-9_-]{21}$/,sR=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,aR=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ih=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,lR=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uR="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cR(){return new RegExp(uR,"u")}const dR=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,fR=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,pR=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,mR=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,hR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ex=/^[A-Za-z0-9_-]*$/,gR=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,vR=/^\+(?:[0-9]){6,14}[0-9]$/,tx="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",yR=new RegExp(`^${tx}$`);function nx(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function wR(e){return new RegExp(`^${nx(e)}$`)}function xR(e){const t=nx({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-]\\d{2}:\\d{2})");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${tx}T(?:${r})$`)}const bR=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},SR=/^\d+$/,ER=/^-?\d+(?:\.\d+)?/i,kR=/true|false/i,CR=/^[^A-Z]*$/,IR=/^[^a-z]*$/,Mt=W("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rx={number:"number",bigint:"bigint",object:"date"},ox=W("$ZodCheckLessThan",(e,t)=>{Mt.init(e,t);const n=rx[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ix=W("$ZodCheckGreaterThan",(e,t)=>{Mt.init(e,t);const n=rx[typeof t.value];e._zod.onattach.push(r=>{const o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),TR=W("$ZodCheckMultipleOf",(e,t)=>{Mt.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):LT(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),RR=W("$ZodCheckNumberFormat",(e,t)=>{var s;Mt.init(e,t),t.format=t.format||"float64";const n=(s=t.format)==null?void 0:s.includes("int"),r=n?"int":"number",[o,i]=VT[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=o,l.maximum=i,n&&(l.pattern=SR)}),e._zod.check=a=>{const l=a.value;if(n){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}l<o&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),l>i&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:i,inst:e})}}),_R=W("$ZodCheckMaxLength",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!cp(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const s=pp(o);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),PR=W("$ZodCheckMinLength",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!cp(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const s=pp(o);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),FR=W("$ZodCheckLengthEquals",(e,t)=>{var n;Mt.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!cp(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,i=o.length;if(i===t.length)return;const s=pp(o),a=i>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),lu=W("$ZodCheckStringFormat",(e,t)=>{var n,r;Mt.init(e,t),e._zod.onattach.push(o=>{const i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),jR=W("$ZodCheckRegex",(e,t)=>{lu.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),MR=W("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=CR),lu.init(e,t)}),$R=W("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=IR),lu.init(e,t)}),AR=W("$ZodCheckIncludes",(e,t)=>{Mt.init(e,t);const n=au(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),NR=W("$ZodCheckStartsWith",(e,t)=>{Mt.init(e,t);const n=new RegExp(`^${au(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),LR=W("$ZodCheckEndsWith",(e,t)=>{Mt.init(e,t);const n=new RegExp(`.*${au(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),zR=W("$ZodCheckOverwrite",(e,t)=>{Mt.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class DR{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
135
|
+
`).filter(s=>s),o=Math.min(...r.map(s=>s.length-s.trimStart().length)),i=r.map(s=>s.slice(o)).map(s=>" ".repeat(this.indent*2)+s);for(const s of i)this.content.push(s)}compile(){const t=Function,n=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(i=>` ${i}`)];return new t(...n,o.join(`
|
|
136
|
+
`))}}const OR={major:4,minor:0,patch:0},We=W("$ZodType",(e,t)=>{var o;var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=OR;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const i=(s,a,l)=>{let u=Bi(s),f;for(const p of a){if(p._zod.def.when){if(!p._zod.def.when(s))continue}else if(u)continue;const m=s.issues.length,h=p._zod.check(s);if(h instanceof Promise&&(l==null?void 0:l.async)===!1)throw new ds;if(f||h instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await h,s.issues.length!==m&&(u||(u=Bi(s,m)))});else{if(s.issues.length===m)continue;u||(u=Bi(s,m))}}return f?f.then(()=>s):s};e._zod.run=(s,a)=>{const l=e._zod.parse(s,a);if(l instanceof Promise){if(a.async===!1)throw new ds;return l.then(u=>i(u,r,a))}return i(l,r,a)}}e["~standard"]={validate:i=>{var s;try{const a=QT(e,i);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return JT(e,i).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}}),mp=W("$ZodString",(e,t)=>{var n;We.init(e,t),e._zod.pattern=[...((n=e==null?void 0:e._zod.bag)==null?void 0:n.patterns)??[]].pop()??bR(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),De=W("$ZodStringFormat",(e,t)=>{lu.init(e,t),mp.init(e,t)}),VR=W("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=aR),De.init(e,t)}),BR=W("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ih(r))}else t.pattern??(t.pattern=Ih());De.init(e,t)}),WR=W("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=lR),De.init(e,t)}),HR=W("$ZodURL",(e,t)=>{De.init(e,t),e._zod.check=n=>{try{const r=n.value,o=new URL(r),i=o.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:gR.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),!r.endsWith("/")&&i.endsWith("/")?n.value=i.slice(0,-1):n.value=i;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),UR=W("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=cR()),De.init(e,t)}),ZR=W("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=iR),De.init(e,t)}),YR=W("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=eR),De.init(e,t)}),KR=W("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=tR),De.init(e,t)}),XR=W("$ZodULID",(e,t)=>{t.pattern??(t.pattern=nR),De.init(e,t)}),GR=W("$ZodXID",(e,t)=>{t.pattern??(t.pattern=rR),De.init(e,t)}),qR=W("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=oR),De.init(e,t)}),QR=W("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=xR(t)),De.init(e,t)}),JR=W("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=yR),De.init(e,t)}),e_=W("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=wR(t)),De.init(e,t)}),t_=W("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=sR),De.init(e,t)}),n_=W("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=dR),De.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),r_=W("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=fR),De.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),o_=W("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=pR),De.init(e,t)}),i_=W("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=mR),De.init(e,t),e._zod.check=n=>{const[r,o]=n.value.split("/");try{if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${r}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function sx(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const s_=W("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=hR),De.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{sx(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function a_(e){if(!ex.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return sx(n)}const l_=W("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ex),De.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{a_(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),u_=W("$ZodE164",(e,t)=>{t.pattern??(t.pattern=vR),De.init(e,t)});function c_(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const d_=W("$ZodJWT",(e,t)=>{De.init(e,t),e._zod.check=n=>{c_(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),ax=W("$ZodNumber",(e,t)=>{We.init(e,t),e._zod.pattern=e._zod.bag.pattern??ER,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),f_=W("$ZodNumber",(e,t)=>{RR.init(e,t),ax.init(e,t)}),p_=W("$ZodBoolean",(e,t)=>{We.init(e,t),e._zod.pattern=kR,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),m_=W("$ZodUnknown",(e,t)=>{We.init(e,t),e._zod.parse=n=>n}),h_=W("$ZodNever",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Th(e,t,n){e.issues.length&&t.issues.push(...Ar(n,e.issues)),t.value[n]=e.value}const g_=W("$ZodArray",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let s=0;s<o.length;s++){const a=o[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?i.push(l.then(u=>Th(u,n,s))):Th(l,n,s)}return i.length?Promise.all(i).then(()=>n):n}});function ua(e,t,n){e.issues.length&&t.issues.push(...Ar(n,e.issues)),t.value[n]=e.value}function Rh(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Ar(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const v_=W("$ZodObject",(e,t)=>{We.init(e,t);const n=Yw(()=>{const p=Object.keys(t.shape);for(const h of p)if(!(t.shape[h]instanceof We))throw new Error(`Invalid element at key "${h}": expected a Zod schema`);const m=OT(t.shape);return{shape:t.shape,keys:p,keySet:new Set(p),numKeys:p.length,optionalKeys:new Set(m)}});ze(e._zod,"propValues",()=>{const p=t.shape,m={};for(const h in p){const y=p[h]._zod;if(y.values){m[h]??(m[h]=new Set);for(const g of y.values)m[h].add(g)}}return m});const r=p=>{const m=new DR(["shape","payload","ctx"]),h=n.value,y=w=>{const x=Ci(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};m.write("const input = payload.value;");const g=Object.create(null);let E=0;for(const w of h.keys)g[w]=`key_${E++}`;m.write("const newResult = {}");for(const w of h.keys)if(h.optionalKeys.has(w)){const x=g[w];m.write(`const ${x} = ${y(w)};`);const b=Ci(w);m.write(`
|
|
137
|
+
if (${x}.issues.length) {
|
|
138
|
+
if (input[${b}] === undefined) {
|
|
139
|
+
if (${b} in input) {
|
|
140
|
+
newResult[${b}] = undefined;
|
|
141
|
+
}
|
|
142
|
+
} else {
|
|
143
|
+
payload.issues = payload.issues.concat(
|
|
144
|
+
${x}.issues.map((iss) => ({
|
|
145
|
+
...iss,
|
|
146
|
+
path: iss.path ? [${b}, ...iss.path] : [${b}],
|
|
147
|
+
}))
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
} else if (${x}.value === undefined) {
|
|
151
|
+
if (${b} in input) newResult[${b}] = undefined;
|
|
152
|
+
} else {
|
|
153
|
+
newResult[${b}] = ${x}.value;
|
|
154
|
+
}
|
|
155
|
+
`)}else{const x=g[w];m.write(`const ${x} = ${y(w)};`),m.write(`
|
|
156
|
+
if (${x}.issues.length) payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
|
|
157
|
+
...iss,
|
|
158
|
+
path: iss.path ? [${Ci(w)}, ...iss.path] : [${Ci(w)}]
|
|
159
|
+
})));`),m.write(`newResult[${Ci(w)}] = ${x}.value`)}m.write("payload.value = newResult;"),m.write("return payload;");const v=m.compile();return(w,x)=>v(p,w,x)};let o;const i=_d,s=!Zw.jitless,l=s&&zT.value,u=t.catchall;let f;e._zod.parse=(p,m)=>{f??(f=n.value);const h=p.value;if(!i(h))return p.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),p;const y=[];if(s&&l&&(m==null?void 0:m.async)===!1&&m.jitless!==!0)o||(o=r(t.shape)),p=o(p,m);else{p.value={};const x=f.shape;for(const b of f.keys){const S=x[b],C=S._zod.run({value:h[b],issues:[]},m),k=S._zod.optin==="optional"&&S._zod.optout==="optional";C instanceof Promise?y.push(C.then(T=>k?Rh(T,p,b,h):ua(T,p,b))):k?Rh(C,p,b,h):ua(C,p,b)}}if(!u)return y.length?Promise.all(y).then(()=>p):p;const g=[],E=f.keySet,v=u._zod,w=v.def.type;for(const x of Object.keys(h)){if(E.has(x))continue;if(w==="never"){g.push(x);continue}const b=v.run({value:h[x],issues:[]},m);b instanceof Promise?y.push(b.then(S=>ua(S,p,x))):ua(b,p,x)}return g.length&&p.issues.push({code:"unrecognized_keys",keys:g,input:h,inst:e}),y.length?Promise.all(y).then(()=>p):p}});function _h(e,t,n,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(o=>o.issues.map(i=>wr(i,r,yr())))}),t}const y_=W("$ZodUnion",(e,t)=>{We.init(e,t),ze(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),ze(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),ze(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),ze(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(r=>r._zod.pattern);return new RegExp(`^(${n.map(r=>dp(r.source)).join("|")})$`)}}),e._zod.parse=(n,r)=>{let o=!1;const i=[];for(const s of t.options){const a=s._zod.run({value:n.value,issues:[]},r);if(a instanceof Promise)i.push(a),o=!0;else{if(a.issues.length===0)return a;i.push(a)}}return o?Promise.all(i).then(s=>_h(s,n,e,r)):_h(i,n,e,r)}}),w_=W("$ZodIntersection",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,i=t.left._zod.run({value:o,issues:[]},r),s=t.right._zod.run({value:o,issues:[]},r);return i instanceof Promise||s instanceof Promise?Promise.all([i,s]).then(([l,u])=>Ph(n,l,u)):Ph(n,i,s)}});function Pd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(pl(e)&&pl(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),o={...e,...t};for(const i of r){const s=Pd(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};o[i]=s.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],i=t[r],s=Pd(o,i);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ph(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),Bi(e))return e;const r=Pd(t.value,n.value);if(!r.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}const x_=W("$ZodRecord",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!pl(o))return n.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),n;const i=[];if(t.keyType._zod.values){const s=t.keyType._zod.values;n.value={};for(const l of s)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){const u=t.valueType._zod.run({value:o[l],issues:[]},r);u instanceof Promise?i.push(u.then(f=>{f.issues.length&&n.issues.push(...Ar(l,f.issues)),n.value[l]=f.value})):(u.issues.length&&n.issues.push(...Ar(l,u.issues)),n.value[l]=u.value)}let a;for(const l in o)s.has(l)||(a=a??[],a.push(l));a&&a.length>0&&n.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{n.value={};for(const s of Reflect.ownKeys(o)){if(s==="__proto__")continue;const a=t.keyType._zod.run({value:s,issues:[]},r);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){n.issues.push({origin:"record",code:"invalid_key",issues:a.issues.map(u=>wr(u,r,yr())),input:s,path:[s],inst:e}),n.value[a.value]=a.value;continue}const l=t.valueType._zod.run({value:o[s],issues:[]},r);l instanceof Promise?i.push(l.then(u=>{u.issues.length&&n.issues.push(...Ar(s,u.issues)),n.value[a.value]=u.value})):(l.issues.length&&n.issues.push(...Ar(s,l.issues)),n.value[a.value]=l.value)}}return i.length?Promise.all(i).then(()=>n):n}}),b_=W("$ZodEnum",(e,t)=>{We.init(e,t);const n=AT(t.entries);e._zod.values=new Set(n),e._zod.pattern=new RegExp(`^(${n.filter(r=>DT.has(typeof r)).map(r=>typeof r=="string"?au(r):r.toString()).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return e._zod.values.has(i)||r.issues.push({code:"invalid_value",values:n,input:i,inst:e}),r}}),S_=W("$ZodTransform",(e,t)=>{We.init(e,t),e._zod.parse=(n,r)=>{const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(s=>(n.value=s,n));if(o instanceof Promise)throw new ds;return n.value=o,n}}),E_=W("$ZodOptional",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.optout="optional",ze(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ze(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${dp(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>t.innerType._zod.optin==="optional"?t.innerType._zod.run(n,r):n.value===void 0?n:t.innerType._zod.run(n,r)}),k_=W("$ZodNullable",(e,t)=>{We.init(e,t),ze(e._zod,"optin",()=>t.innerType._zod.optin),ze(e._zod,"optout",()=>t.innerType._zod.optout),ze(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${dp(n.source)}|null)$`):void 0}),ze(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),C_=W("$ZodDefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>Fh(i,t)):Fh(o,t)}});function Fh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const I_=W("$ZodPrefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),T_=W("$ZodNonOptional",(e,t)=>{We.init(e,t),ze(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>jh(i,e)):jh(o,e)}});function jh(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const R_=W("$ZodCatch",(e,t)=>{We.init(e,t),e._zod.optin="optional",ze(e._zod,"optout",()=>t.innerType._zod.optout),ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>wr(s,r,yr()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(i=>wr(i,r,yr()))},input:n.value}),n.issues=[]),n)}}),__=W("$ZodPipe",(e,t)=>{We.init(e,t),ze(e._zod,"values",()=>t.in._zod.values),ze(e._zod,"optin",()=>t.in._zod.optin),ze(e._zod,"optout",()=>t.out._zod.optout),e._zod.parse=(n,r)=>{const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(i=>Mh(i,t,r)):Mh(o,t,r)}});function Mh(e,t,n){return Bi(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}const P_=W("$ZodReadonly",(e,t)=>{We.init(e,t),ze(e._zod,"propValues",()=>t.innerType._zod.propValues),ze(e._zod,"values",()=>t.innerType._zod.values),ze(e._zod,"optin",()=>t.innerType._zod.optin),ze(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then($h):$h(o)}});function $h(e){return e.value=Object.freeze(e.value),e}const F_=W("$ZodCustom",(e,t)=>{Mt.init(e,t),We.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(i=>Ah(i,n,r,e));Ah(o,n,r,e)}});function Ah(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(fs(o))}}class j_{constructor(){this._map=new Map,this._idmap=new Map}add(t,...n){const r=n[0];if(this._map.set(t,r),r&&typeof r=="object"&&"id"in r){if(this._idmap.has(r.id))throw new Error(`ID ${r.id} already exists in the registry`);this._idmap.set(r.id,t)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};return delete r.id,{...r,...this._map.get(t)}}return this._map.get(t)}has(t){return this._map.has(t)}}function M_(){return new j_}const ca=M_();function $_(e,t){return new e({type:"string",...le(t)})}function A_(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...le(t)})}function Nh(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...le(t)})}function N_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...le(t)})}function L_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...le(t)})}function z_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...le(t)})}function D_(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...le(t)})}function O_(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...le(t)})}function V_(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...le(t)})}function B_(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...le(t)})}function W_(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...le(t)})}function H_(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...le(t)})}function U_(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...le(t)})}function Z_(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...le(t)})}function Y_(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...le(t)})}function K_(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...le(t)})}function X_(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...le(t)})}function G_(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...le(t)})}function q_(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...le(t)})}function Q_(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...le(t)})}function J_(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...le(t)})}function eP(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...le(t)})}function tP(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...le(t)})}function nP(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...le(t)})}function rP(e,t){return new e({type:"string",format:"date",check:"string_format",...le(t)})}function oP(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...le(t)})}function iP(e,t){return new e({type:"string",format:"duration",check:"string_format",...le(t)})}function sP(e,t){return new e({type:"number",checks:[],...le(t)})}function aP(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...le(t)})}function lP(e,t){return new e({type:"boolean",...le(t)})}function uP(e){return new e({type:"unknown"})}function cP(e,t){return new e({type:"never",...le(t)})}function Lh(e,t){return new ox({check:"less_than",...le(t),value:e,inclusive:!1})}function rc(e,t){return new ox({check:"less_than",...le(t),value:e,inclusive:!0})}function zh(e,t){return new ix({check:"greater_than",...le(t),value:e,inclusive:!1})}function oc(e,t){return new ix({check:"greater_than",...le(t),value:e,inclusive:!0})}function Dh(e,t){return new TR({check:"multiple_of",...le(t),value:e})}function lx(e,t){return new _R({check:"max_length",...le(t),maximum:e})}function ml(e,t){return new PR({check:"min_length",...le(t),minimum:e})}function ux(e,t){return new FR({check:"length_equals",...le(t),length:e})}function dP(e,t){return new jR({check:"string_format",format:"regex",...le(t),pattern:e})}function fP(e){return new MR({check:"string_format",format:"lowercase",...le(e)})}function pP(e){return new $R({check:"string_format",format:"uppercase",...le(e)})}function mP(e,t){return new AR({check:"string_format",format:"includes",...le(t),includes:e})}function hP(e,t){return new NR({check:"string_format",format:"starts_with",...le(t),prefix:e})}function gP(e,t){return new LR({check:"string_format",format:"ends_with",...le(t),suffix:e})}function Ps(e){return new zR({check:"overwrite",tx:e})}function vP(e){return Ps(t=>t.normalize(e))}function yP(){return Ps(e=>e.trim())}function wP(){return Ps(e=>e.toLowerCase())}function xP(){return Ps(e=>e.toUpperCase())}function bP(e,t,n){return new e({type:"array",element:t,...le(n)})}function SP(e,t,n){return new e({type:"custom",check:"custom",fn:t,...le(n)})}const EP=W("ZodISODateTime",(e,t)=>{QR.init(e,t),He.init(e,t)});function kP(e){return nP(EP,e)}const CP=W("ZodISODate",(e,t)=>{JR.init(e,t),He.init(e,t)});function IP(e){return rP(CP,e)}const TP=W("ZodISOTime",(e,t)=>{e_.init(e,t),He.init(e,t)});function RP(e){return oP(TP,e)}const _P=W("ZodISODuration",(e,t)=>{t_.init(e,t),He.init(e,t)});function PP(e){return iP(_P,e)}const FP=(e,t)=>{Gw.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>XT(e,n)},flatten:{value:n=>KT(e,n)},addIssue:{value:n=>e.issues.push(n)},addIssues:{value:n=>e.issues.push(...n)},isEmpty:{get(){return e.issues.length===0}}})},uu=W("ZodError",FP,{Parent:Error}),jP=GT(uu),MP=qT(uu),$P=Qw(uu),AP=Jw(uu),Xe=W("ZodType",(e,t)=>(We.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),e.clone=(n,r)=>eo(e,n,r),e.brand=()=>e,e.register=(n,r)=>(n.add(e,r),e),e.parse=(n,r)=>jP(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>$P(e,n,r),e.parseAsync=async(n,r)=>MP(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>AP(e,n,r),e.spa=e.safeParseAsync,e.refine=(n,r)=>e.check(IF(n,r)),e.superRefine=n=>e.check(TF(n)),e.overwrite=n=>e.check(Ps(n)),e.optional=()=>Bh(e),e.nullable=()=>Wh(e),e.nullish=()=>Bh(Wh(e)),e.nonoptional=n=>yF(e,n),e.array=()=>Hn(e),e.or=n=>fx([e,n]),e.and=n=>uF(e,n),e.transform=n=>Hh(e,fF(n)),e.default=n=>hF(e,n),e.prefault=n=>vF(e,n),e.catch=n=>xF(e,n),e.pipe=n=>Hh(e,n),e.readonly=()=>EF(e),e.describe=n=>{const r=e.clone();return ca.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){var n;return(n=ca.get(e))==null?void 0:n.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ca.get(e);const r=e.clone();return ca.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),cx=W("_ZodString",(e,t)=>{mp.init(e,t),Xe.init(e,t);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(dP(...r)),e.includes=(...r)=>e.check(mP(...r)),e.startsWith=(...r)=>e.check(hP(...r)),e.endsWith=(...r)=>e.check(gP(...r)),e.min=(...r)=>e.check(ml(...r)),e.max=(...r)=>e.check(lx(...r)),e.length=(...r)=>e.check(ux(...r)),e.nonempty=(...r)=>e.check(ml(1,...r)),e.lowercase=r=>e.check(fP(r)),e.uppercase=r=>e.check(pP(r)),e.trim=()=>e.check(yP()),e.normalize=(...r)=>e.check(vP(...r)),e.toLowerCase=()=>e.check(wP()),e.toUpperCase=()=>e.check(xP())}),NP=W("ZodString",(e,t)=>{mp.init(e,t),cx.init(e,t),e.email=n=>e.check(A_(LP,n)),e.url=n=>e.check(O_(zP,n)),e.jwt=n=>e.check(tP(JP,n)),e.emoji=n=>e.check(V_(DP,n)),e.guid=n=>e.check(Nh(Oh,n)),e.uuid=n=>e.check(N_(da,n)),e.uuidv4=n=>e.check(L_(da,n)),e.uuidv6=n=>e.check(z_(da,n)),e.uuidv7=n=>e.check(D_(da,n)),e.nanoid=n=>e.check(B_(OP,n)),e.guid=n=>e.check(Nh(Oh,n)),e.cuid=n=>e.check(W_(VP,n)),e.cuid2=n=>e.check(H_(BP,n)),e.ulid=n=>e.check(U_(WP,n)),e.base64=n=>e.check(Q_(GP,n)),e.base64url=n=>e.check(J_(qP,n)),e.xid=n=>e.check(Z_(HP,n)),e.ksuid=n=>e.check(Y_(UP,n)),e.ipv4=n=>e.check(K_(ZP,n)),e.ipv6=n=>e.check(X_(YP,n)),e.cidrv4=n=>e.check(G_(KP,n)),e.cidrv6=n=>e.check(q_(XP,n)),e.e164=n=>e.check(eP(QP,n)),e.datetime=n=>e.check(kP(n)),e.date=n=>e.check(IP(n)),e.time=n=>e.check(RP(n)),e.duration=n=>e.check(PP(n))});function pe(e){return $_(NP,e)}const He=W("ZodStringFormat",(e,t)=>{De.init(e,t),cx.init(e,t)}),LP=W("ZodEmail",(e,t)=>{WR.init(e,t),He.init(e,t)}),Oh=W("ZodGUID",(e,t)=>{VR.init(e,t),He.init(e,t)}),da=W("ZodUUID",(e,t)=>{BR.init(e,t),He.init(e,t)}),zP=W("ZodURL",(e,t)=>{HR.init(e,t),He.init(e,t)}),DP=W("ZodEmoji",(e,t)=>{UR.init(e,t),He.init(e,t)}),OP=W("ZodNanoID",(e,t)=>{ZR.init(e,t),He.init(e,t)}),VP=W("ZodCUID",(e,t)=>{YR.init(e,t),He.init(e,t)}),BP=W("ZodCUID2",(e,t)=>{KR.init(e,t),He.init(e,t)}),WP=W("ZodULID",(e,t)=>{XR.init(e,t),He.init(e,t)}),HP=W("ZodXID",(e,t)=>{GR.init(e,t),He.init(e,t)}),UP=W("ZodKSUID",(e,t)=>{qR.init(e,t),He.init(e,t)}),ZP=W("ZodIPv4",(e,t)=>{n_.init(e,t),He.init(e,t)}),YP=W("ZodIPv6",(e,t)=>{r_.init(e,t),He.init(e,t)}),KP=W("ZodCIDRv4",(e,t)=>{o_.init(e,t),He.init(e,t)}),XP=W("ZodCIDRv6",(e,t)=>{i_.init(e,t),He.init(e,t)}),GP=W("ZodBase64",(e,t)=>{s_.init(e,t),He.init(e,t)}),qP=W("ZodBase64URL",(e,t)=>{l_.init(e,t),He.init(e,t)}),QP=W("ZodE164",(e,t)=>{u_.init(e,t),He.init(e,t)}),JP=W("ZodJWT",(e,t)=>{d_.init(e,t),He.init(e,t)}),dx=W("ZodNumber",(e,t)=>{ax.init(e,t),Xe.init(e,t),e.gt=(r,o)=>e.check(zh(r,o)),e.gte=(r,o)=>e.check(oc(r,o)),e.min=(r,o)=>e.check(oc(r,o)),e.lt=(r,o)=>e.check(Lh(r,o)),e.lte=(r,o)=>e.check(rc(r,o)),e.max=(r,o)=>e.check(rc(r,o)),e.int=r=>e.check(Vh(r)),e.safe=r=>e.check(Vh(r)),e.positive=r=>e.check(zh(0,r)),e.nonnegative=r=>e.check(oc(0,r)),e.negative=r=>e.check(Lh(0,r)),e.nonpositive=r=>e.check(rc(0,r)),e.multipleOf=(r,o)=>e.check(Dh(r,o)),e.step=(r,o)=>e.check(Dh(r,o)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function ue(e){return sP(dx,e)}const eF=W("ZodNumberFormat",(e,t)=>{f_.init(e,t),dx.init(e,t)});function Vh(e){return aP(eF,e)}const tF=W("ZodBoolean",(e,t)=>{p_.init(e,t),Xe.init(e,t)});function pn(e){return lP(tF,e)}const nF=W("ZodUnknown",(e,t)=>{m_.init(e,t),Xe.init(e,t)});function Yo(){return uP(nF)}const rF=W("ZodNever",(e,t)=>{h_.init(e,t),Xe.init(e,t)});function oF(e){return cP(rF,e)}const iF=W("ZodArray",(e,t)=>{g_.init(e,t),Xe.init(e,t),e.element=t.element,e.min=(n,r)=>e.check(ml(n,r)),e.nonempty=n=>e.check(ml(1,n)),e.max=(n,r)=>e.check(lx(n,r)),e.length=(n,r)=>e.check(ux(n,r)),e.unwrap=()=>e.element});function Hn(e,t){return bP(iF,e,t)}const sF=W("ZodObject",(e,t)=>{v_.init(e,t),Xe.init(e,t),ze(e,"shape",()=>t.shape),e.keyof=()=>li(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Yo()}),e.loose=()=>e.clone({...e._zod.def,catchall:Yo()}),e.strict=()=>e.clone({...e._zod.def,catchall:oF()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>HT(e,n),e.merge=n=>UT(e,n),e.pick=n=>BT(e,n),e.omit=n=>WT(e,n),e.partial=(...n)=>ZT(px,e,n[0]),e.required=(...n)=>YT(mx,e,n[0])});function xe(e,t){const n={type:"object",get shape(){return fp(this,"shape",{...e}),this.shape},...le(t)};return new sF(n)}const aF=W("ZodUnion",(e,t)=>{y_.init(e,t),Xe.init(e,t),e.options=t.options});function fx(e,t){return new aF({type:"union",options:e,...le(t)})}const lF=W("ZodIntersection",(e,t)=>{w_.init(e,t),Xe.init(e,t)});function uF(e,t){return new lF({type:"intersection",left:e,right:t})}const cF=W("ZodRecord",(e,t)=>{x_.init(e,t),Xe.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function xr(e,t,n){return new cF({type:"record",keyType:e,valueType:t,...le(n)})}const Fd=W("ZodEnum",(e,t)=>{b_.init(e,t),Xe.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const i={};for(const s of r)if(n.has(s))i[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Fd({...t,checks:[],...le(o),entries:i})},e.exclude=(r,o)=>{const i={...t.entries};for(const s of r)if(n.has(s))delete i[s];else throw new Error(`Key ${s} not found in enum`);return new Fd({...t,checks:[],...le(o),entries:i})}});function li(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Fd({type:"enum",entries:n,...le(t)})}const dF=W("ZodTransform",(e,t)=>{S_.init(e,t),Xe.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=i=>{if(typeof i=="string")n.issues.push(fs(i,n.value,t));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=n.value),s.inst??(s.inst=e),s.continue??(s.continue=!0),n.issues.push(fs(s))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(i=>(n.value=i,n)):(n.value=o,n)}});function fF(e){return new dF({type:"transform",transform:e})}const px=W("ZodOptional",(e,t)=>{E_.init(e,t),Xe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Bh(e){return new px({type:"optional",innerType:e})}const pF=W("ZodNullable",(e,t)=>{k_.init(e,t),Xe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Wh(e){return new pF({type:"nullable",innerType:e})}const mF=W("ZodDefault",(e,t)=>{C_.init(e,t),Xe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hF(e,t){return new mF({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const gF=W("ZodPrefault",(e,t)=>{I_.init(e,t),Xe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function vF(e,t){return new gF({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():t}})}const mx=W("ZodNonOptional",(e,t)=>{T_.init(e,t),Xe.init(e,t),e.unwrap=()=>e._zod.def.innerType});function yF(e,t){return new mx({type:"nonoptional",innerType:e,...le(t)})}const wF=W("ZodCatch",(e,t)=>{R_.init(e,t),Xe.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xF(e,t){return new wF({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const bF=W("ZodPipe",(e,t)=>{__.init(e,t),Xe.init(e,t),e.in=t.in,e.out=t.out});function Hh(e,t){return new bF({type:"pipe",in:e,out:t})}const SF=W("ZodReadonly",(e,t)=>{P_.init(e,t),Xe.init(e,t)});function EF(e){return new SF({type:"readonly",innerType:e})}const kF=W("ZodCustom",(e,t)=>{F_.init(e,t),Xe.init(e,t)});function CF(e){const t=new Mt({check:"custom"});return t._zod.check=e,t}function IF(e,t={}){return SP(kF,e,t)}function TF(e){const t=CF(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(fs(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(fs(o))}},e(n.value,n)));return t}const cu=li(["full-bleed","video-top","pip-bubble","graphic-only","blurred-behind","lower-third","split-left","split-right"]),du=li(["TitleCard","StatCard","RuleCard","StrikethroughReveal","FlowDiagram","TerminalMock","ChatMock","ScreenshotFrame","BulletList"]),RF=xe({startWord:ue().int().nonnegative(),endWord:ue().int().nonnegative()});xe({id:pe(),anchor:RF,layout:cu,component:du,props:xr(pe(),Yo()),overrides:xr(pe(),Yo()).default({}),rationale:pe().optional()});xe({id:pe(),kind:li(["graphic","plain"]).optional(),layout:cu,component:du.optional(),props:xr(pe(),Yo()).optional(),startSec:ue().nonnegative(),endSec:ue().nonnegative(),graphicRect:xe({x:ue(),y:ue(),w:ue(),h:ue()}).optional(),elements:xr(pe(),xe({dx:ue().optional(),dy:ue().optional(),scale:ue().positive().optional(),hidden:pn().optional()})).optional(),video:xe({scale:ue().positive().max(4).optional(),dy:ue().optional(),dx:ue().optional(),autoZoom:pn().optional()}).optional(),pip:xe({cornerRadius:ue().min(0).max(1).optional(),x:ue().min(0).max(1).optional(),y:ue().min(0).max(1).optional()}).optional(),captionY:ue().min(0).max(1).optional(),captionScale:ue().min(.2).max(3).optional(),pinned:pn().optional()}).superRefine((e,t)=>{e.kind!=="plain"&&(e.component===void 0||e.props===void 0)&&t.addIssue({code:"custom",message:'a graphic cue requires component and props; only kind: "plain" may omit them'})});xe({centerYFrac:ue().min(0).max(1),sizeFrac:ue().min(0).max(1).optional(),centerXFrac:ue().min(0).max(1).optional(),sourceAspect:ue().positive().optional()});const hp=xe({bg:pe().default("#0B0B0E"),fg:pe().default("#FFFFFF"),accent:pe().default("#FFE14D"),muted:pe().default("#9A9AA3"),success:pe().default("#5FBF77"),cardBg:pe().default("#15151B"),cardBorder:pe().default("#2A2A33"),danger:pe().default("#FF5C5C"),radiusPx:ue().default(24),fontDisplay:pe().default("'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif"),fontMono:pe().default("'SF Mono', 'Cascadia Code', Consolas, monospace")}),_F=hp.parse({}),PF=xe({eyebrow:pe().max(28).optional(),title:pe().min(1).max(48).describe("the claim WITHOUT the emphasis token — never repeat the emphasis here"),emphasis:pe().max(16).optional().describe("the number/punch token pulled OUT of the title (e.g. '861%') — not a duplicate of it"),sub:pe().max(64).optional()}),FF=xe({label:pe().min(1).max(28),value:pe().min(1).max(12),caption:pe().max(40).optional(),inverted:pn().default(!1)}),jF=xe({kicker:pe().min(1).max(24),text:pe().min(1).max(40),struck:pe().max(40).optional()}),MF=xe({lines:Hn(xe({text:pe().min(1).max(32),struck:pn().default(!1),mark:li(["none","cross","check"]).default("none")})).min(1).max(4)}),$F=xe({title:pe().max(28).optional(),items:Hn(pe().min(1).max(36)).min(2).max(5)}),AF=xe({nodes:Hn(pe().min(1).max(16)).min(2).max(5),emphasizeLast:pn().default(!0)}),NF=xe({windows:Hn(xe({title:pe().max(24),lines:Hn(pe().max(40)).min(1).max(6)})).min(1).max(5),fanOut:pe().max(20).optional()}),LF=xe({messages:Hn(xe({from:li(["user","agent"]),text:pe().min(1).max(60)})).min(1).max(4),keyword:pe().max(16).optional().describe("ONLY for a 'comment <word>' ask: the single distinctive word the viewer types, plain and unformatted. Leave unset for any other CTA — especially 'reply with a number/which one', where there is no word to type. Never a referential filler like 'number', 'answer', 'comment' or 'below'.")}),zF=xe({src:pe().optional().describe("OMIT THIS unless the user supplied an actual image file beside the video — never invent a filename from the transcript; without it the frame renders as a styled placeholder, which is the intended look"),label:pe().max(32).optional(),kenBurns:pn().default(!0)}),DF={TitleCard:{propsSchema:PF,defaultProps:{title:"TITLE"},defaultLayout:"pip-bubble",altLayouts:[],whenToUse:"The core claim or hook as big typography; use `emphasis` for a huge number or punch word."},StatCard:{propsSchema:FF,defaultProps:{label:"METRIC",value:"+0%"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"One striking metric (value like '+242%', '×3', '5s'); punchline in `caption`."},RuleCard:{propsSchema:jF,defaultProps:{kicker:"RULE",text:"DO THE THING"},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"A prescriptive takeaway ('CAPACITY RULE / CAP ACTIVE AGENTS'); `struck` shows the rejected alternative."},StrikethroughReveal:{propsSchema:MF,defaultProps:{lines:[{text:"NOT THIS",struck:!0}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:'Negation/contrast beat — big words over the blurred speaker. Strike EVERY line of the phrase the speaker negates, not just its tail — a half-struck claim reads as a typo. For wrong-vs-right lists, set mark: "cross"/"check" (✗/✓) per line instead.'},FlowDiagram:{propsSchema:AF,defaultProps:{nodes:["A","B"]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"A causal chain or pipeline as chips with arrows (TEAM → AI AGENTS → CHURN)."},TerminalMock:{propsSchema:NF,defaultProps:{windows:[{title:"terminal-01",lines:["$ run"]}]},defaultLayout:"graphic-only",altLayouts:[],whenToUse:"Anything about running code/processes/agents — stylized terminal windows."},ChatMock:{propsSchema:LF,defaultProps:{messages:[{from:"user",text:"hello"}]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"A quoted phrase or exchange as chat bubbles over the blurred speaker; for a comment-CTA beat, set `keyword` to the word viewers should type."},ScreenshotFrame:{propsSchema:zF,defaultProps:{},defaultLayout:"video-top",altLayouts:["blurred-behind"],whenToUse:"Reference to a document/PR/review — a framed screenshot look with a label chip."},BulletList:{propsSchema:$F,defaultProps:{items:["FIRST","SECOND"]},defaultLayout:"blurred-behind",altLayouts:["graphic-only"],whenToUse:"An ENUMERATION — the speaker lists two or more parallel things ('what you need is X, Y, Z'). One bullet per item, optional kicker title. Use this for lists instead of bending TitleCard or StrikethroughReveal around them."}};function Uh(e,t,n={}){const r=DF[e],o={...r.defaultProps,...t,...n},i=r.propsSchema.safeParse(o);return i.success?i.data:null}const OF=xe({dx:ue().optional(),dy:ue().optional(),scale:ue().positive().optional(),hidden:pn().optional()}),hx=xe({props:xr(pe(),Yo()).default({}),elements:xr(pe(),OF).default({}),timing:xe({startSec:ue().nonnegative(),endSec:ue().nonnegative()}).optional(),component:du.optional(),layout:cu.optional(),video:xe({scale:ue().positive().max(4).optional(),dy:ue().optional(),dx:ue().optional(),autoZoom:pn().optional()}).optional(),pip:xe({cornerRadius:ue().min(0).max(1).optional(),x:ue().min(0).max(1).optional(),y:ue().min(0).max(1).optional()}).optional(),captionY:ue().min(0).max(1).optional(),captionScale:ue().min(.2).max(3).optional(),graphicRect:xe({x:ue().min(0).max(1),y:ue().min(0).max(1),w:ue().min(.08).max(1),h:ue().min(.05).max(1)}).optional(),hidden:pn().optional()}),VF=xe({text:pe().min(1).max(80),was:pe()});function BF(e,t,n){var r;return((r=e[t])==null?void 0:r.was)??n}function gx(e){return String(Math.round(e*1e3))}const WF=fx([xe({at:ue().finite().nonnegative(),id:pe().min(1)}),ue().finite().nonnegative().transform(e=>({at:e,id:gx(e)}))]);function HF(e,t){const n=gx(e),r=new Set(t.map(o=>o.id));if(!r.has(n))return n;for(let o=2;;o++){const i=`${n}-${o}`;if(!r.has(i))return i}}const UF=xe({theme:hp.partial().default({}),captionsHidden:pn().optional(),scenes:xr(pe(),hx).default({}),captions:xr(pe(),VF).default({}),splits:Hn(WF).default([]),cuts:Hn(xe({startSec:ue().nonnegative(),endSec:ue().nonnegative(),src:xe({startSec:ue().nonnegative(),endSec:ue().nonnegative()}).optional()})).default([])}),ZF=()=>UF.parse({});function YF(e,t){return Uh(e,{},t)??Uh(e,{},{})}function KF(e,t){const n=e[t],r=t.indexOf("@");if(r===-1)return n;const o=e[t.slice(0,r)];if(!o)return n;const{timing:i,hidden:s,...a}=o;return n?{...a,...n,props:{...a.props,...n.props},elements:{...a.elements,...n.elements},...a.video||n.video?{video:{...a.video,...n.video}}:{},...a.pip||n.pip?{pip:{...a.pip,...n.pip}}:{}}:{...a,props:{...a.props},elements:{...a.elements}}}function jd(e,t){const n=new Set(e.map(i=>i.id)),r=Object.keys(t.scenes).filter(i=>!n.has(i));return{cues:e.map(i=>{const s=KF(t.scenes,i.id);if(!s)return i;const a=s.component!==void 0&&s.component!==i.component,l=s.component??i.component,u=s.component!==void 0&&a?YF(s.component,s.props):{...i.props,...s.props},f=s.layout!==void 0&&s.layout!==i.layout,{graphicRect:p,...m}=i;return{...f?m:i,component:l,layout:s.layout??i.layout,props:u,...Object.keys(s.elements).length>0?{elements:s.elements}:{},...s.video?{video:s.video}:{},...s.pip?{pip:s.pip}:{},...s.captionY!==void 0?{captionY:s.captionY}:{},...s.captionScale!==void 0?{captionScale:s.captionScale}:{},...s.graphicRect?{graphicRect:s.graphicRect}:{},...s.timing&&!i.pinned?{startSec:s.timing.startSec,endSec:s.timing.endSec,pinned:!0}:{}}}),orphans:r}}const hl=.3;function gp(e,t){const n=[...e];for(const r of[...t].sort((o,i)=>o.at-i.at)){const o=n.findIndex(s=>r.at>=s.startSec+hl&&r.at<=s.endSec-hl);if(o===-1)continue;const i=n[o];n.splice(o,1,{...i,endSec:r.at},{...i,id:`${i.id.split("@")[0]}@${r.id}`,startSec:r.at})}return n}function vx(e,t){const n=[];return{cues:e.filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)!==!0?!0:(n.push(o.id),!1)}),hidden:n}}function XF(e,t){return vx(gp(e,t.splits),t)}function yx(e){if(!Number.isFinite(e))throw new Error(`captionKeyFor: caption words need a finite srcStart (§137), got ${String(e)} — run backfillSrcStart on lines read from a pre-§137 render-props.json`);return`w${Math.round(e*1e3)}`}function vp(e){return/^\d+$/.test(e)}function Fs(e){return!e||!Number.isFinite(e.srcStart)?null:yx(e.srcStart)}const GF=8;function qF(e,t,n){var i,s;if(!vp(e))return{to:e};const r=Number(e);if(((i=n[r])==null?void 0:i.text)===t.was)return Zh(n[r]);const o=[];for(let a=1;a<=GF;a++)for(const l of[r-a,r+a])((s=n[l])==null?void 0:s.text)===t.was&&o.push(l);return o.length===0?{to:null,reason:n.some(l=>l.text===t.was)?"out-of-range":"not-found"}:o.length>1?{to:null,reason:"ambiguous"}:Zh(n[o[0]])}function Zh(e){const t=Fs(e);return t===null?{to:null,reason:"unanchorable"}:{to:t}}function QF(e,t){const n=t.flatMap(a=>a.words),r={},o=[],i=Object.entries(e).map(([a,l])=>({key:a,edit:l,legacy:vp(a),claim:qF(a,l,n)})),s=new Map;for(const a of i){if(a.claim.to===null)continue;const l=s.get(a.claim.to);l?l.push(a):s.set(a.claim.to,[a])}for(const a of i){if(a.claim.to===null){o.push({key:a.key,was:a.edit.was,reason:a.claim.reason});continue}const l=s.get(a.claim.to),u=l.length===1?l[0]:l.find(f=>!f.legacy);if(u===a){r[a.claim.to]=a.edit;continue}o.push({key:a.key,was:a.edit.was,reason:u===void 0?"collision":"superseded"})}return{edits:r,unresolved:o}}function JF(e,t){const n={...t.edits};for(const r of t.unresolved){if(r.reason==="superseded")continue;const o=e[r.key];o!==void 0&&(n[r.key]=o)}return n}function ej(e,t){const n=[];if(Object.keys(t).length===0)return{lines:[...e],dropped:n};const r=new Set,o=e.map(i=>({...i,words:i.words.map(s=>{const a=Fs(s);if(a===null)return s;const l=t[a];return l?r.has(a)?(n.push({key:a,expected:l.was,found:s.text,reason:"duplicate-anchor"}),s):(r.add(a),s.text!==l.was?(n.push({key:a,expected:l.was,found:s.text}),s):{...s,text:l.text}):s})}));for(const[i,s]of Object.entries(t))r.has(i)||n.push({key:i,expected:s.was,found:null});return{lines:o,dropped:n}}function tj(e,t){return hp.parse({...e,...t.theme})}function Yh(e,t,n,r){const o=e.scenes[t]??hx.parse({});return{...e,scenes:{...e.scenes,[t]:{...o,elements:{...o.elements,[n]:{...o.elements[n],...r}}}}}}function nj(e,t,n){const r=e.scenes[t];if(!r)return e;const{[n]:o,...i}=r.elements;return{...e,scenes:{...e.scenes,[t]:{...r,elements:i}}}}function rj(e,t,n){const r=e.scenes[t],o=r==null?void 0:r.elements[n];if(!r||!(o!=null&&o.hidden))return e;const{hidden:i,...s}=o,{[n]:a,...l}=r.elements,u=Object.keys(s).length>0?{...r.elements,[n]:s}:l;return{...e,scenes:{...e.scenes,[t]:{...r,elements:u}}}}function oj(e,t){const n=e.scenes[t];if(!n||!n.timing)return e;const{timing:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function ij(e,t){const n=e.scenes[t];if(!n||!n.graphicRect)return e;const{graphicRect:r,...o}=n;return{...e,scenes:{...e.scenes,[t]:o}}}function wx(e){const t=e.indexOf("@");return t===-1?e:e.slice(0,t)}const sj=.6;function aj(e,t){const n=new Set([0]);for(const r of e??[])Number.isFinite(r)&&r>0&&r<t&&n.add(r);return[...n].sort((r,o)=>r-o)}function lj(e,t){const n=t.outputDurationSec,r=[...e].sort((f,p)=>f.startSec-p.startSec);if(n<=0)return r;const o=aj(t.clipStarts,n),i=[];let s=0;for(const f of r)f.startSec-s>1e-9&&i.push({start:s,end:f.startSec}),s=Math.max(s,f.endSec);n-s>1e-9&&i.push({start:s,end:n});const a=[];for(const f of i){const p=o.filter(h=>h>f.start+1e-9&&h<f.end-1e-9),m=[f.start,...p,f.end];for(let h=0;h<m.length-1;h++){const y=m[h],g=m[h+1];if(g-y<sj)continue;let E=0;for(let v=0;v<o.length;v++)o[v]<=y+1e-9&&(E=v);a.push({start:y,end:g,clip:E})}}const l=new Map,u=a.map(f=>{const p=l.get(f.clip)??0;return l.set(f.clip,p+1),{id:p===0?`take-${f.clip}`:`take-${f.clip}-${p}`,kind:"plain",layout:"full-bleed",startSec:f.start,endSec:f.end}});return[...r,...u].sort((f,p)=>f.startSec-p.startSec)}const uj=1.05;function cj(e,t){for(const r of e)if(t>=r.startSec&&t<r.endSec){const o=r.endSec-r.startSec,i=o>0?(t-r.startSec)/o:1,s=.5-.5*Math.cos(Math.PI*i);return r.from+(r.to-r.from)*s}const n=e[e.length-1];return n&&t===n.endSec?n.to:1}function dj(e,t,n){if(e.length===0)return{x:0,y:0,w:(n==null?void 0:n.width)??0,h:(n==null?void 0:n.height)??0,full:!0};if(t<e[0].startSec)return e[0].rect;for(const r of e)if(t>=r.startSec&&t<r.endSec)return r.rect;return e[e.length-1].rect}class fj{constructor(t){Se(this,"spans");Se(this,"outputDuration");let n=-1/0;for(const i of t){if(i.srcOut<i.srcIn)throw new Error(`segment ends before it starts: ${i.srcIn}..${i.srcOut}`);if(i.srcIn<n)throw new Error(`cutlist segments overlap at ${i.srcIn}`);n=i.srcOut}const r=[];let o=0;for(const i of t){if(i.kind!=="keep"||i.srcOut<=i.srcIn)continue;const s=i.srcOut-i.srcIn;r.push({srcIn:i.srcIn,srcOut:i.srcOut,outIn:o,outOut:o+s}),o+=s}this.spans=r,this.outputDuration=o}toOutput(t){for(const i of this.spans)if(t>=i.srcIn&&t<=i.srcOut)return i.outIn+(t-i.srcIn);const n=1e-9;let r=null,o=1/0;for(const i of this.spans){const s=t<i.srcIn?i.srcIn-t:t-i.srcOut;s<o&&(o=s,r=i)}if(r&&o<=n){const i=Math.min(Math.max(t,r.srcIn),r.srcOut);return r.outIn+(i-r.srcIn)}return null}toOutputClamped(t){const n=this.toOutput(t);if(n!==null)return n;let r=0;for(const o of this.spans)if(o.srcOut<=t)r=o.outOut;else if(o.srcIn>=t)return o.outIn;return r}toSource(t){const n=this.spans;if(n.length===0)return 0;const r=n[0];if(t<=r.outIn)return r.srcIn;for(const o of n)if(t>=o.outIn&&t<=o.outOut)return o.srcIn+(t-o.outIn);return n[n.length-1].srcOut}mapWord(t){const n=(t.start+t.end)/2;if(this.toOutput(n)===null&&this.toOutput(t.start)===null&&this.toOutput(t.end)===null)return null;const r=this.toOutputClamped(t.start),o=this.toOutputClamped(t.end);return o<=r?null:{start:r,end:o}}}function xx(e){return new fj(e.map(t=>({srcIn:t.srcIn,srcOut:t.srcOut,kind:"keep"})))}function Kh(e,t){const n=o=>o.words;if(e.every(o=>n(o).every(i=>i.srcStart!==void 0)))return[...e];const r=xx(t);return e.map(o=>({...o,words:n(o).map(i=>i.srcStart===void 0?{...i,srcStart:r.toSource(i.start)}:i)}))}const pj=/[\p{Script=Arabic}\p{Script=Hebrew}\p{Script=Syriac}\p{Script=Thaana}\p{Script=Nko}]/u,mj=new RegExp("\\p{L}","u");function hj(e){for(const t of e){if(pj.test(t))return"rtl";if(mj.test(t))return"ltr"}return"ltr"}const $t={width:1080,height:1920};$t.width;$t.height;const js={centerYFrac:.38,sizeFrac:.22},gj=.35,vj=.45,bx=1-1/uj,yj=.4*bx,wj=.6*bx;function Sx(e,t,n=$t){const r=e.w*n.width,o=e.h*n.height;return Math.max(o,r/(t.sourceAspect??n.width/n.height))}function xj(e,t,n=$t){const r=e.h*n.height,o=Sx(e,t,n),i=o-r;if(i<=1)return .5;const s=t.sizeFrac??js.sizeFrac,a=(t.centerYFrac-s/2-gj*s)*o,l=(t.centerYFrac+s/2)*o,u=(a+l)/2-vj*r,f=a-yj*r,p=l+wj*r-r,m=p<=f?Math.min(Math.max(u,p),f):p;return Math.min(1,Math.max(0,m/i))}function bj(e,t,n,r,o=$t){if(r.length===0)return e;const i=t.h*o.height,s=Sx(t,n,o);if(s-i<=1)return e;const l=i/s,u=1-l;if(u<=0)return e;let f=e*u;for(let p=0;p<r.length+1;p++){const m=r.find(x=>{const b=x.y,S=x.y+x.h,C=f+l,k=b<f&&f<S,T=b<C&&C<S;return k||T});if(!m)break;const h=[],y=m.y+m.h;y<=u&&h.push(y);const g=m.y-l;if(g>=0&&h.push(g),m.h<=l){const x=Math.max(0,m.y+m.h-l),b=Math.min(u,m.y);x<=b&&h.push(Math.min(Math.max(f,x),b))}const E=n.sizeFrac??js.sizeFrac,v=n.centerYFrac+E/2,w=h.filter(x=>x+l>=v);if(w.length===0)return e;f=w.reduce((x,b)=>Math.abs(b-f)<Math.abs(x-f)?b:x)}return Math.min(1,Math.max(0,f/u))}function Sj(e,t,n=$t){const r=e.w*n.width,o=e.h*n.height,i=Math.max(r,o*(t.sourceAspect??n.width/n.height)),s=i-r;if(s<=1||t.centerXFrac===void 0)return .5;const a=t.centerXFrac*i-r/2;return Math.min(1,Math.max(0,a/s))}const Ej={top:.12,bottom:.22,right:.16,left:.04},kj={top:.06,bottom:.12,right:.05,left:.05};function bn(e=$t){return e.width>e.height?kj:Ej}function Cj(e=$t){const t=bn(e);return{x:t.left,y:t.top,w:1-t.left-t.right,h:1-t.top-t.bottom}}const Ij=.08,Tj=.05;function gl(e,t=$t){const n=Cj(t),r=1e-9,o=(u,f,p)=>u<f-r?f:u>p+r?p:u,i=o(e.w,Ij,n.w),s=o(e.h,Tj,n.h),a=o(e.x,n.x,n.x+n.w-i),l=o(e.y,n.y,n.y+n.h-s);return{x:a,y:l,w:i,h:s}}const Xh=.045,jn={x:0,y:0,w:1,h:1},ic=.3,co={x:.5-ic/2,y:.66,w:ic,h:ic*1080/1920};function Hr(e,t=js,n=[],r=$t){const o=a=>bj(xj(a,t,r),a,t,n,r),i=a=>Sj(a,t,r),s=r.width>r.height;switch(e){case"full-bleed":return{video:{rect:jn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(jn),objectPosX:i(jn)},graphic:null,captionAnchor:.7};case"lower-third":{const a=s?{x:.05,y:.7,w:.62,h:.18}:{x:.04,y:.56,w:.8,h:.22};return{video:{rect:jn,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(jn),objectPosX:i(jn)},graphic:a,captionAnchor:s?.62:.49}}case"split-left":case"split-right":{if(s){const l=e==="split-left",u={x:l?0:.5,y:0,w:.5,h:1};return{video:{rect:u,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(u),objectPosX:i(u)},graphic:l?{x:.55,y:.2,w:.4,h:.56}:{x:.05,y:.2,w:.4,h:.56},captionAnchor:.82}}const a={x:0,y:0,w:1,h:.5};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.58,w:.8,h:.2},captionAnchor:.53}}case"video-top":{const a={x:0,y:0,w:1,h:.42};return{video:{rect:a,cornerRadius:0,blurPx:0,dim:0,opacity:1,objectPosY:o(a),objectPosX:i(a)},graphic:{x:.04,y:.54,w:.8,h:.24},captionAnchor:.48}}case"pip-bubble":return{video:{rect:co,cornerRadius:1,blurPx:0,dim:0,opacity:1,objectPosY:o(co),objectPosX:i(co)},graphic:{x:.06,y:.14,w:.78,h:.42},captionAnchor:.61};case"graphic-only":return{video:{rect:co,cornerRadius:1,blurPx:0,dim:0,opacity:0,objectPosY:o(co),objectPosX:i(co)},graphic:{x:.04,y:.14,w:.8,h:.54},captionAnchor:.73};case"blurred-behind":return{video:{rect:jn,cornerRadius:0,blurPx:22,dim:.55,opacity:1,objectPosY:o(jn),objectPosX:i(jn)},graphic:{x:.07,y:.24,w:.77,h:.36},captionAnchor:.69}}}const Rj={x:.07,y:.24,w:.77,h:.36};function Ex(e,t=$t){return e.graphicRect?gl(e.graphicRect,t):Hr(e.layout,js,[],t).graphic??Rj}const kx=.35;function hr(e,t){for(const n of e)if(t>=n.startSec&&t<n.endSec)return n;return null}function Gt(e,t,n){return e+(t-e)*n}function _j(e,t,n){return{x:Gt(e.x,t.x,n),y:Gt(e.y,t.y,n),w:Gt(e.w,t.w,n),h:Gt(e.h,t.h,n)}}function Gh(e,t,n){return{rect:_j(e.rect,t.rect,n),cornerRadius:Gt(e.cornerRadius,t.cornerRadius,n),blurPx:Gt(e.blurPx,t.blurPx,n),dim:Gt(e.dim,t.dim,n),opacity:Gt(e.opacity,t.opacity,n),objectPosY:Gt(e.objectPosY,t.objectPosY,n),objectPosX:Gt(e.objectPosX,t.objectPosX,n)}}function vl(e){return e*e*(3-2*e)}function Cx(e){return e.filter(t=>!(t.kind==="plain"&&t.layout==="full-bleed"))}function sc(e,t,n,r){const o=Hr(e.layout,t,n,r).video,i=e.layout==="pip-bubble"?e.pip:void 0;if(!i)return o;const s={...o.rect,x:Math.min(Math.max(i.x??o.rect.x,0),1-o.rect.w),y:Math.min(Math.max(i.y??o.rect.y,0),1-o.rect.h)};return{...o,rect:s,cornerRadius:i.cornerRadius??o.cornerRadius}}function Pj(e,t,n=js,r=[],o=$t){const i=Cx(e),s=r.filter(v=>t>=v.startSec&&t<v.endSec),a=Hr("full-bleed",n,s,o).video,l=hr(i,t);if(!l)return a;const u=sc(l,n,s,o),f=Math.min(kx,(l.endSec-l.startSec)/2),p=t-l.startSec,m=l.endSec-t,h=hr(i,l.startSec-.001),y=hr(i,l.endSec+.001),g=h?sc(h,n,s,o):a,E=y?sc(y,n,s,o):a;return p<f?Gh(g,u,vl(p/f)):m<f?Gh(u,E,vl(1-m/f)):u}function ac(e){return e==="pip-bubble"||e==="graphic-only"?1:0}function Fj(e,t){const n=Cx(e),r=hr(n,t);if(!r)return 0;const o=ac(r.layout),i=Math.min(kx,(r.endSec-r.startSec)/2),s=hr(n,r.startSec-.001),a=hr(n,r.endSec+.001),l=s?ac(s.layout):0,u=a?ac(a.layout):0,f=t-r.startSec,p=r.endSec-t;return f<i?Gt(l,o,vl(f/i)):p<i?Gt(o,u,vl(1-p/i)):o}function jj(e,t,n){return e.filter(r=>(r.startSec??Number.NEGATIVE_INFINITY)<n&&(r.endSec??Number.POSITIVE_INFINITY)>t)}function Mj(e,t){let n=0;for(const r of t){const o=Math.max(e.y,r.y),i=Math.min(e.y+e.h,r.y+r.h);i>o&&(n+=i-o)}return Math.min(1,n/e.h)}function $j(e,t,n,r=$t){const o=Hr(e,void 0,[],r),i=bn(r),s=o.captionAnchor,a=l=>{const u={y:l-Xh,h:Xh*2};if(u.y<i.top||u.y+u.h>1-i.bottom||Mj(u,t)>0)return!1;const f=n??o.graphic;return!(f&&Math.min(u.y+u.h,f.y+f.h)-Math.max(u.y,f.y)>0)};if(a(s))return s;for(let l=.02;l<=.6;l+=.02)for(const u of[s-l,s+l])if(a(u))return u;return s}const Aj=.3,Nj=.3,Lj=.133,yp=e=>e*(2-e);function Ix(e,t=Aj,n=Nj){if(e<=0)return{enterSec:0,exitSec:0};const r=t+n;if(r<=e)return{enterSec:t,exitSec:n};const o=e/r;return{enterSec:t*o,exitSec:n*o}}const qh=.4;function zj(e,t){if(!t)return e;const n=e.replace(/^[^A-Za-z0-9]+|[^A-Za-z0-9]+$/g,"");return n.toLowerCase()!==t.toLowerCase()?e:e.replace(n,`"${n.toUpperCase()}"`)}function Dj(e,t){return t?e>=t.startSec-qh&&e<=t.endSec+qh:!1}const Oj=({line:e,wordOffset:t,verticalAnchor:n,fontSizePx:r,activeColor:o,ctaKeyword:i,ctaWindow:s})=>{const a=ct(),{fps:l,width:u,height:f}=qe(),p=bn({width:u,height:f}),m=e.start+a/l,h=hj(e.words.map(y=>y.text).join(" "));return d.jsx(hn,{style:{pointerEvents:"none"},children:d.jsx("div",{style:{position:"absolute",top:`${n*100}%`,left:0,right:0,transform:"translateY(-50%)",direction:h,display:"flex",justifyContent:"center",gap:"0.28em",flexWrap:"wrap",paddingLeft:`${p.left*100}%`,paddingRight:`${p.right*100}%`,fontFamily:"'Inter', 'Helvetica Neue', 'Arial Black', Arial, sans-serif",fontWeight:900,fontSize:r,lineHeight:1.15,textAlign:"center",color:"white",WebkitTextStroke:"10px rgba(0,0,0,0.85)",paintOrder:"stroke fill",textShadow:"0 4px 24px rgba(0,0,0,0.55)"},children:e.words.map((y,g)=>{const E=Math.max(y.end,y.start+.12),v=m>=y.start&&m<=E,w=v?Math.min(1,(m-y.start)/Lj):0,x=yp(w);return d.jsx("span",{"data-caption-word":t+g,"data-caption-text":y.text,"data-caption-src":Fs(y)===null?void 0:y.srcStart,style:{display:"inline-block",pointerEvents:"auto",transform:x>0?`scale(${1+.08*x})`:"scale(1)",color:v?o:"white"},children:zj(y.text,Dj(y.start,s)?i:void 0)},g)})})})},Vj=({lines:e,cues:t=[],verticalAnchor:n=.76,fontSizePx:r=64,activeColor:o="#FFE14D",ctaKeyword:i,ctaWindow:s,sourceTextRegions:a=[]})=>{const{fps:l,width:u,height:f}=qe(),p={width:u,height:f},m=[];let h=0;for(const y of e)m.push(h),h+=y.words.length;return d.jsx(hn,{children:e.map((y,g)=>{const E=t.length>0?hr(t,y.start):null,v=(E==null?void 0:E.captionY)!==void 0?E.captionY:t.length>0||a.length>0?$j((E==null?void 0:E.layout)??"full-bleed",jj(a,y.start,y.end),E==null?void 0:E.graphicRect,p):n,{from:w,durationInFrames:x}=up(y.start,y.end,l);return d.jsx(dt,{from:w,durationInFrames:x,children:d.jsx(Oj,{line:y,wordOffset:m[g],verticalAnchor:v,fontSizePx:r*((E==null?void 0:E.captionScale)??1),activeColor:o,ctaKeyword:i,ctaWindow:s})},g)})})};function Bj(e,t,n,r=.5,o=.5){const i=Math.max(1,e.width),s=Math.max(1,e.height),a=Math.max(1,t.w),l=Math.max(1,t.h),u=Math.max(n.width/a,n.height/l),f=-t.x*u+(n.width-a*u)*Qh(r),p=-t.y*u+(n.height-l*u)*Qh(o);return{width:i*u,height:s*u,left:f,top:p}}function Qh(e){return Number.isFinite(e)?Math.min(1,Math.max(0,e)):.5}function Tx(e,t,n){const r=Math.max(1,e.width),o=Math.max(1,e.height),i=Math.max(1,t.w),s=Math.max(1,t.h),a=Math.min(n.width/i,n.height/s),l=-t.x*a+(n.width-i*a)/2,u=-t.y*a+(n.height-s*a)/2;return{width:r*a,height:o*a,left:l,top:u}}function Wj(e,t){return Tx(e,{x:0,y:0,w:e.width,h:e.height},t)}function Hj(e,t){if(e.length===0)return t;for(const o of e)if(t>=o.outIn&&t<o.outOut)return o.srcIn+(t-o.outIn);const n=e[0];return t<n.outIn?n.srcIn:e[e.length-1].srcOut}function Uj(e,t,n,r,o,i){return e==="fit"?Tx(t,n,r):Bj(t,n,r,o,i)}function Zj(e,t,n,r){return e.length===0?{x:0,y:0,w:r.width,h:r.height,full:!0}:dj(e,Hj(t,n),r)}const Yj=({cues:e,theme:t,face:n,zoomPlan:r,sourceTextRegions:o,contentTimeline:i,spans:s,sourceSize:a,contentCropMode:l="cover",sourceFit:u="cover",children:f})=>{const p=ct(),{fps:m,width:h,height:y}=qe(),g=p/m,v=Pj(e,g,n??void 0,o??[],{width:h,height:y}),w=Fj(e,g),x=v.rect.w*h,b=v.rect.h*y,S=v.cornerRadius*Math.min(x,b)/2,C=hr(e,g),k=C==null?void 0:C.video,T=r&&r.length>0?cj(r,g):1,P=Math.max(0,v.opacity*(1-.6*v.cornerRadius)),j=(k==null?void 0:k.autoZoom)!==!1,M=u==="contain"&&a!==void 0,D=j&&!M?1+(T-1)*P:1,N=(k==null?void 0:k.scale)??1,L=(k==null?void 0:k.dx)??0,H=(k==null?void 0:k.dy)??0,O=[L!==0||H!==0?`translate(${L}px, ${H}px)`:"",D*N!==1?`scale(${D*N})`:""].filter(Boolean).join(" ")||void 0;return d.jsxs(hn,{children:[d.jsx(hn,{style:{background:t.bg,opacity:w}}),d.jsxs("div",{"data-edit-video":C==null?void 0:C.id,style:{position:"absolute",left:`${v.rect.x*100}%`,top:`${v.rect.y*100}%`,width:x,height:b,borderRadius:S,overflow:"hidden",opacity:v.opacity,backgroundColor:M?t.bg:void 0,boxShadow:v.cornerRadius>.5?"0 18px 60px rgba(0,0,0,0.55)":void 0},children:[d.jsx("div",{style:{position:"absolute",inset:0,filter:v.blurPx>.5?`blur(${v.blurPx}px)`:void 0,transform:O,transformOrigin:"50% 40%","--ossclip-obj-y":`${v.objectPosY*100}%`,"--ossclip-obj-x":`${v.objectPosX*100}%`},children:M?d.jsx(Kj,{source:a,slot:{width:x,height:b},children:f}):d.jsx(Xj,{timeline:i,spans:s,sourceSize:a,mode:l,tSec:g,slot:{width:x,height:b},posX:v.objectPosX,posY:v.objectPosY,children:f})}),d.jsx("div",{style:{position:"absolute",inset:0,background:"black",opacity:v.dim}})]})]})},Kj=({source:e,slot:t,children:n})=>{const r=Wj(e,t);return d.jsx("div",{style:{position:"absolute",width:r.width,height:r.height,left:r.left,top:r.top},children:n})},Xj=({timeline:e,spans:t,sourceSize:n,mode:r,tSec:o,slot:i,posX:s,posY:a,children:l})=>{const u=d.jsx("div",{style:{position:"absolute",inset:0},children:l});if(!e||e.length<2||!n)return u;const f=Zj(e,t??[],o,n);if(f.full)return u;const p=Uj(r,n,f,i,s,a);return d.jsx("div",{style:{position:"absolute",width:p.width,height:p.height,left:p.left,top:p.top},children:l})},wp=.94,Gj=new Set(["FlowDiagram","StrikethroughReveal","ChatMock","BulletList"]),Jh=2.4,fa=.45,fu=.58,gt=.72,qj=.62;function mo(e,t,n,r,o){const i=Math.max(1,Math.floor(n/Math.max(1,o*t)));return Math.max(1,Math.ceil(e/i))*t*r}const Ne=e=>typeof e=="string"?e:"",or=e=>Array.isArray(e)?e:[];function Qj(e,t,n,r=1/0){switch(e){case"TitleCard":{const o=n-80,i=Ne(t.emphasis),s=28;let a=0,l=0;Ne(t.eyebrow)&&(a+=34*1.2,l++),i&&(a+=210*.95,l++);const u=i?64:96;return a+=mo(Ne(t.title).length,u,o,1.05,gt),l++,Ne(t.sub)&&(a+=mo(Ne(t.sub).length,40,o,1.2,fu),l++),a+s*Math.max(0,l-1)}case"StatCard":{const o=mo(Ne(t.label).length,42,n*.55,1.15,gt);let i=88+Math.max(o,110*1.15)+4;return Ne(t.caption)&&(i+=30+(38*1.2+32+4)),i}case"RuleCard":{const o=n-60-96;let i=80;return i+=30*1.2+14,i+=mo(Ne(t.text).length,72,o,1.02,gt),Ne(t.struck)&&(i+=26+mo(Ne(t.struck).length,44,o,1.2,gt)),i}case"StrikethroughReveal":{const o=or(t.lines).map(a=>Ne(a==null?void 0:a.text)),i=jx(o,n,r),s=o.reduce((a,l)=>a+Fx(l,i,n).length,0);return s*i*1.08+i*.2*Math.max(0,s-1)}case"FlowDiagram":{const o=or(t.nodes).map(l=>Ne(l)),i=Math.max(1,o.length),{mode:s,fontSize:a}=Dx(o,n,r);return s==="row"?a*Wi+4:a*(Wi*i+zx*(i-1))}case"TerminalMock":{const o=or(t.windows);let i=0;for(const s of o){const a=or(s==null?void 0:s.lines);i+=56.8+2,i+=Math.max(1,a.length)*27*1.2+8*Math.max(0,a.length-1)+36,i+=4}return i+=22*Math.max(0,o.length-1),Ne(t.fanOut)&&(i+=22+40*1.2),i}case"ChatMock":{const o=Nx(t).map(s=>s.text),i=Lx(o,{widthPx:n,heightPx:r});return Ax(o,i,n)}case"ScreenshotFrame":{const o=n*.94;return(Ne(t.src)?o*9/16:480)+4}case"BulletList":{const o=or(t.items).map(s=>Ne(s)),i=Px(o,n,r,!!Ne(t.title),Ne(t.title));return r4(o.length,i,!!Ne(t.title))}}}const Qn=e=>Ne(e).split(/\s+/).reduce((t,n)=>Math.max(t,n.length),0);function Jj(e,t){switch(e){case"RuleCard":{const n=Qn(t.kicker)*30*(gt+.28),r=Qn(t.text)*72*gt,o=Qn(t.struck)*44*(gt+.04),i=Math.max(n,r,o);return i>0?156+i:0}case"TitleCard":{const n=Ne(t.emphasis)?64:96,r=Qn(t.eyebrow)*34*(gt+.35),o=Qn(t.emphasis)*210*gt,i=Qn(t.title)*n*(gt+.02),s=Qn(t.sub)*40*fu,a=Math.max(r,o,i,s);return a>0?80+a:0}case"TerminalMock":{let n=0;for(const r of or(t.windows))for(const o of or(r==null?void 0:r.lines))n=Math.max(n,Ne(o).length);return n>0?108+n*27*qj:0}case"StatCard":{const n=Ne(t.value).length*110*gt;return n===0?0:164+Qn(t.label)*42*gt+40+n}default:return 0}}const eg=36,e4=120,Rx=1.6,_x=.88,t4=(gt+.28)*.36,n4=1.1;function r4(e,t,n){return(Math.max(1,e)*Rx+(n?_x:0))*t}function Px(e,t=831,n=1/0,r=!1,o=""){const i=e.reduce((l,u)=>Math.max(l,u.length),0);if(i===0)return eg;const s=Math.min(t/(i*gt+n4),o?t/(o.length*t4):1/0),a=n*wp/(Math.max(1,e.length)*Rx+(r?_x:0));return Math.max(eg,Math.min(e4,Math.floor(Math.min(s,a))))}const o4=92,i4=44,s4=150,a4=[" → "," -> "," → "," > "];function Fx(e,t,n){const r=o=>o.length*t*gt<=n;if(r(e))return[e];for(const o of a4){if(!e.includes(o))continue;const s=e.split(o).map((a,l)=>l===0?a:`${o.trim()} ${a}`.trim());if(s.every(r))return s}return[e]}function jx(e,t=831,n=1/0){const r=e.reduce((s,a)=>Math.max(s,a.length),0);if(r===0)return o4;const o=t/(r*gt),i=n/(Math.max(1,e.length)*1.28);return Math.max(i4,Math.min(s4,Math.floor(Math.min(o,i))))}const tg=22,ng=44,l4=96,rg=22,Mx=.85,$x=.82;function Ax(e,t,n){const o=(n-80)*$x-2*t*Mx;let i=0;for(const s of e)i+=mo(s.length,t,o,1.2,fu)+t*1.2+4;return i+t*.5*Math.max(0,e.length-1)}function Nx(e){const t=Ne(e.keyword);return t?[{from:"user",text:`"${t.toUpperCase()}"`}]:or(e.messages).map(n=>{const r=n??{};return{from:r.from==="agent"?"agent":"user",text:Ne(r.text)}})}function Lx(e,t={}){const n=t.widthPx??831,r=t.heightPx??1/0,o=n-80,i=e.reduce((p,m)=>Math.max(p,m.length),0);if(i===0)return ng;const s=e.flatMap(p=>p.split(/\s+/)).reduce((p,m)=>Math.max(p,m.length),0),a=p=>o*$x/(p*fu+2*Mx),l=Math.min(i,rg),u=i>rg?ng:l4;let f=Math.floor(Math.min(a(l),a(s),u));for(;f>tg&&Ax(e,f,n)>r*wp;)f-=1;return Math.max(tg,f)}const og=26,u4=22,c4=76,Wi=2.1,zx=2.05;function Dx(e,t,n=1/0){const r=e.reduce((g,E)=>g+E.length,0),o=Math.max(1,e.length),i=.78,s=1.6,a=1.8,l=t-20,u=Math.floor(Math.min(l/(i*r+s*o+a*(o-1)),n/Wi)),f=Math.max(...e.map(g=>g.length),1),p=Wi*o+zx*(o-1),m=Math.floor(Math.min(l/(i*f+s),n/p,c4)),h=u>=og;return m>=u4?h?u*Wi>=m*p?{mode:"row",fontSize:u}:{mode:"stack",fontSize:m}:{mode:"stack",fontSize:m}:{mode:"row",fontSize:Math.max(og,u)}}function d4(e,t,n){if(Gj.has(e))return 1;const r=n.heightPx*wp,o=u=>Qj(e,t,n.widthPx/u)*u<=r;if(!o(fa))return fa;const i=Jj(e,t),s=i>0?n.widthPx/i:Jh;let a=fa,l=Math.max(fa,Math.min(Jh,s));if(l<=a)return a;for(let u=0;u<24;u++){const f=(a+l)/2;o(f)?a=f:l=f}return a}function it(e=0){const t=ct(),{fps:n}=qe();return vd({frame:t-e,fps:n,config:{damping:200,stiffness:130},durationInFrames:Math.round(n*.5)})}function kn(e,t=26){return{opacity:e,transform:`translateY(${(1-e)*t}px)`}}function Ur(e){return{opacity:e,transform:`scale(${.9+.1*e})`}}function f4(e,t){return!e||t===1?e:Object.fromEntries(Object.entries(e).map(([n,r])=>[n,{...r,...r.dx!==void 0?{dx:r.dx/t}:{},...r.dy!==void 0?{dy:r.dy/t}:{}}]))}function et(e,t){const n=e==null?void 0:e[t];if(!n)return{};if(n.hidden)return{display:"none"};const r=[`translate(${n.dx??0}px, ${n.dy??0}px)`];return n.scale!==void 0&&n.scale!==1&&r.push(`scale(${n.scale})`),{transform:r.join(" ")}}const p4=({props:e,theme:t,edits:n})=>{var l;const r=it(0),o=it(5),i=it(10),s=(l=e.emphasis)==null?void 0:l.trim(),a=!!s&&s.toLowerCase().includes(e.title.trim().toLowerCase());return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:28,textAlign:"center",fontFamily:t.fontDisplay,color:t.fg,padding:"0 40px"},children:[e.eyebrow?d.jsx("div",{"data-edit-id":"eyebrow",style:{...kn(r),fontSize:34,fontWeight:700,letterSpacing:"0.35em",color:t.muted,textTransform:"uppercase",...et(n,"eyebrow")},children:e.eyebrow}):null,s?d.jsx("div",{"data-edit-id":"emphasis",style:{...kn(o,40),fontSize:210,fontWeight:900,lineHeight:.95,...et(n,"emphasis")},children:s}):null,a?null:d.jsx("div",{"data-edit-id":"title",style:{...kn(s?i:o,34),fontSize:s?64:96,fontWeight:900,lineHeight:1.05,textTransform:"uppercase",letterSpacing:"0.02em",...et(n,"title")},children:e.title}),e.sub?d.jsx("div",{"data-edit-id":"sub",style:{...kn(i),fontSize:40,fontWeight:600,color:t.muted,...et(n,"sub")},children:e.sub}):null]})},m4=({props:e,theme:t,edits:n})=>{const r=it(0),o=it(6),i=e.inverted;return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:30,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[d.jsxs("div",{style:{...Ur(r),display:"flex",alignItems:"center",justifyContent:"space-between",gap:40,width:"100%",background:i?t.fg:t.cardBg,color:i?t.bg:t.fg,border:`2px solid ${i?t.fg:t.cardBorder}`,borderRadius:t.radiusPx,padding:"44px 52px"},children:[d.jsx("div",{"data-edit-id":"label",style:{fontSize:42,fontWeight:800,textTransform:"uppercase",letterSpacing:"0.06em",lineHeight:1.15,maxWidth:"55%",...et(n,"label")},children:e.label}),d.jsx("div",{"data-edit-id":"value",style:{fontSize:110,fontWeight:900,whiteSpace:"nowrap",...et(n,"value")},children:e.value})]}),e.caption?d.jsx("div",{"data-edit-id":"caption",style:{...kn(o),fontSize:38,fontWeight:800,color:t.fg,background:t.cardBg,border:`2px solid ${t.cardBorder}`,borderRadius:t.radiusPx/2,padding:"16px 30px",textTransform:"uppercase",letterSpacing:"0.08em",...et(n,"caption")},children:e.caption}):null]})},h4=({props:e,theme:t,edits:n})=>{const r=it(0),o=it(8);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:26,fontFamily:t.fontDisplay,width:"100%",padding:"0 30px"},children:[d.jsxs("div",{style:{...Ur(r),width:"100%",background:t.fg,color:t.bg,borderRadius:t.radiusPx,padding:"40px 48px",textAlign:"left"},children:[d.jsx("div",{"data-edit-id":"kicker",style:{fontSize:30,fontWeight:800,letterSpacing:"0.28em",textTransform:"uppercase",color:"#55555E",marginBottom:14,fontFamily:t.fontMono,...et(n,"kicker")},children:e.kicker}),d.jsx("div",{"data-edit-id":"text",style:{fontSize:72,fontWeight:900,lineHeight:1.02,textTransform:"uppercase",...et(n,"text")},children:e.text})]}),e.struck?d.jsx("div",{"data-edit-id":"struck",style:{...kn(o),fontSize:44,fontWeight:800,color:t.muted,textDecoration:"line-through",textDecorationThickness:6,textDecorationColor:t.danger,textTransform:"uppercase",letterSpacing:"0.04em",...et(n,"struck")},children:e.struck}):null]})},g4=({text:e,struck:t,mark:n,delay:r,fontSize:o,theme:i,editId:s,edits:a})=>{const l=it(r),u=it(r+8);return d.jsxs("div",{"data-edit-id":s,style:{...kn(l,30),position:"relative",display:"inline-block",...et(a,s)},children:[d.jsxs("span",{style:{fontSize:o,fontWeight:900,textTransform:"uppercase",lineHeight:1.08,whiteSpace:"nowrap",color:t?i.muted:i.fg},children:[n!=="none"?d.jsx("span",{style:{color:n==="cross"?i.danger:i.success,marginRight:"0.3em"},children:n==="cross"?"✗":"✓"}):null,e]}),t?d.jsx("div",{style:{position:"absolute",left:"-2%",top:"50%",height:o*.11,width:`${u*104}%`,background:i.danger,borderRadius:o*.055,transform:"translateY(-50%) rotate(-2deg)"}}):null]})},v4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=e.lines.map(l=>(l.mark??"none")!=="none"?`✗ ${l.text}`:l.text),s=jx(i,n,r),a=e.lines.flatMap((l,u)=>Fx(l.text,s,n??831).map((f,p)=>({text:f,struck:l.struck,mark:p===0?l.mark??"none":"none",lineIndex:u})));return d.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:s*.2,textAlign:"center",fontFamily:t.fontDisplay},children:a.map((l,u)=>d.jsx(g4,{text:l.text,struck:l.struck,mark:l.mark,delay:u*6,fontSize:s,theme:t,editId:`line-${l.lineIndex}`,edits:o},u))})},y4=({text:e,emphasized:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=it(n);return d.jsx("div",{"data-edit-id":i,style:{...Ur(a),background:t?o.fg:o.cardBg,color:t?o.bg:o.fg,border:`2px solid ${t?o.fg:o.cardBorder}`,borderRadius:o.radiusPx/2,padding:`${r*.55}px ${r*.8}px`,fontSize:r,fontWeight:900,textTransform:"uppercase",letterSpacing:"0.04em",whiteSpace:"nowrap",fontFamily:o.fontDisplay,...et(s,i)},children:e})},w4=({delay:e,fontSize:t,theme:n,down:r=!1})=>{const o=it(e);return d.jsx("div",{style:{opacity:o,color:n.muted,fontSize:t*1.15,fontWeight:700,lineHeight:1,paddingLeft:r?0:t*.55},children:r?"↓":"→"})};function x4(e,t=b4,n){return Dx(e,t,n)}const b4=864,S4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const{mode:i,fontSize:s}=x4(e.nodes,n,r),a=i==="row";return d.jsx("div",{style:{display:"flex",flexDirection:a?"row":"column",flexWrap:"nowrap",alignItems:"center",justifyContent:"center",gap:a?0:s*.45,padding:"0 10px"},children:e.nodes.map((l,u)=>d.jsxs("div",{style:{display:"flex",flexDirection:a?"row":"column",alignItems:"center",gap:a?s*.55:s*.45},children:[u>0?d.jsx(w4,{delay:u*6+3,fontSize:s,theme:t,down:!a}):null,d.jsx(y4,{text:l,emphasized:e.emphasizeLast&&u===e.nodes.length-1,delay:u*6,fontSize:s,theme:t,editId:`node-${u}`,edits:o})]},u))})},E4=({title:e,lines:t,delay:n,theme:r,editId:o,edits:i})=>{const s=it(n);return d.jsxs("div",{"data-edit-id":o,style:{...Ur(s),background:r.cardBg,border:`2px solid ${r.cardBorder}`,borderRadius:r.radiusPx/2,overflow:"hidden",width:"100%",fontFamily:r.fontMono,...et(i,o)},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"14px 20px",borderBottom:`2px solid ${r.cardBorder}`},children:[["#FF5F57","#FEBC2E","#28C840"].map(a=>d.jsx("div",{style:{width:16,height:16,borderRadius:8,background:a}},a)),d.jsx("div",{style:{marginLeft:10,fontSize:24,color:r.muted},children:e})]}),d.jsx("div",{style:{padding:"18px 22px",display:"flex",flexDirection:"column",gap:8},children:t.map((a,l)=>d.jsx("div",{style:{fontSize:27,color:r.fg,whiteSpace:"pre"},children:a},l))})]})},k4=({props:e,theme:t,edits:n})=>{const r=it(e.windows.length*6+4);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:22,width:"100%",padding:"0 30px"},children:[e.windows.map((o,i)=>d.jsx(E4,{title:o.title,lines:o.lines,delay:i*6,theme:t,editId:`window-${i}`,edits:n},i)),e.fanOut?d.jsxs("div",{"data-edit-id":"fanOut",style:{...kn(r),fontFamily:t.fontDisplay,fontSize:40,fontWeight:900,letterSpacing:"0.2em",color:t.fg,textTransform:"uppercase",...et(n,"fanOut")},children:["⌄ ",e.fanOut]}):null]})},C4=({from:e,text:t,delay:n,fontSize:r,theme:o,editId:i,edits:s})=>{const a=it(n),l=e==="user";return d.jsx("div",{"data-edit-id":i,style:{...Ur(a),alignSelf:l?"flex-end":"flex-start",background:l?o.fg:o.cardBg,color:l?o.bg:o.fg,border:`2px solid ${l?o.fg:o.cardBorder}`,borderRadius:28,[l?"borderBottomRightRadius":"borderBottomLeftRadius"]:8,padding:`${r*.6}px ${r*.85}px`,fontSize:r,fontWeight:700,maxWidth:"82%",fontFamily:o.fontDisplay,...et(s,i)},children:t})},I4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=Nx(e),s=Lx(i.map(a=>a.text),{widthPx:n,heightPx:r});return d.jsx("div",{style:{display:"flex",flexDirection:"column",gap:s*.5,width:"100%",padding:"0 40px"},children:i.map((a,l)=>d.jsx(C4,{from:a.from,text:a.text,delay:l*8,fontSize:s,theme:t,editId:`message-${l}`,edits:o},l))})},T4=({props:e,theme:t,edits:n})=>{const r=it(0),o=it(8),i=ct(),{fps:s}=qe(),a=e.kenBurns?ri(i,[0,s*8],[1,1.08],{extrapolateRight:"clamp"}):1,l=e.src?/^https?:\/\//.test(e.src)?e.src:$w(e.src):null;return d.jsxs("div",{"data-edit-id":"image",style:{...Ur(r),position:"relative",width:"94%",...et(n,"image")},children:[d.jsx("div",{style:{overflow:"hidden",borderRadius:t.radiusPx/2,border:`2px solid ${t.cardBorder}`,background:t.cardBg,boxShadow:"0 24px 80px rgba(0,0,0,0.5)"},children:l?d.jsx(ep,{src:l,style:{width:"100%",display:"block",transform:`scale(${a})`}}):d.jsx("div",{style:{height:420,display:"flex",flexDirection:"column",gap:14,padding:30,transform:`scale(${a})`},children:[.9,.75,.85,.6,.8,.5].map((u,f)=>d.jsx("div",{style:{height:22,width:`${u*100}%`,borderRadius:6,background:f%3===0?t.cardBorder:"#22222B"}},f))})}),e.label?d.jsx("div",{"data-edit-id":"label",style:{...Ur(o),position:"absolute",right:-8,bottom:-20,background:t.fg,color:t.bg,fontFamily:t.fontMono,fontSize:28,fontWeight:800,letterSpacing:"0.08em",padding:"12px 22px",borderRadius:10,textTransform:"uppercase",...et(n,"label")},children:e.label}):null]})},R4=({text:e,index:t,fontSize:n,theme:r,edits:o})=>{const i=`item-${t}`,s=it(t*7);return d.jsxs("div",{"data-edit-id":i,style:{...kn(s,26),display:"flex",alignItems:"baseline",gap:n*.35,...et(o,i)},children:[d.jsx("span",{style:{fontSize:n*.75,color:r.accent,fontWeight:900},children:"▸"}),d.jsx("span",{style:{fontSize:n,fontWeight:900,textTransform:"uppercase",lineHeight:1.15,whiteSpace:"nowrap",color:r.fg},children:e})]})},_4=({props:e,theme:t,widthPx:n,heightPx:r,edits:o})=>{const i=Px(e.items,n,r,!!e.title,e.title),s=it(0);return d.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:i*.45,fontFamily:t.fontDisplay},children:[e.title?d.jsx("div",{"data-edit-id":"title",style:{...kn(s,20),fontSize:i*.36,fontWeight:700,letterSpacing:"0.28em",textTransform:"uppercase",color:t.muted,...et(o,"title")},children:e.title}):null,e.items.map((a,l)=>d.jsx(R4,{text:a,index:l,fontSize:i,theme:t,edits:o},l))]})},P4={TitleCard:p4,StatCard:m4,RuleCard:h4,StrikethroughReveal:v4,FlowDiagram:S4,TerminalMock:k4,ChatMock:I4,ScreenshotFrame:T4,BulletList:_4},F4=new Set(["lower-third","full-bleed"]),j4=.55,M4=e=>{const t=/^#([0-9a-fA-F]{6})$/.exec(e.trim()),[n,r,o]=t?[0,2,4].map(i=>Number.parseInt(t[1].slice(i,i+2),16)):[0,0,0];return`rgba(${n}, ${r}, ${o}, ${j4})`},$4=e=>({width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",opacity:e,transform:e<1?`translateY(${(1-e)*18}px)`:void 0}),A4=({durationInFrames:e,children:t})=>{const n=ct(),{fps:r}=qe(),{exitSec:o}=Ix(e/r),i=(e-n)/r,s=o<=0?1:Math.min(1,Math.max(0,i/o));return d.jsx("div",{style:$4(yp(s)),children:t})},N4=({durationInFrames:e,themeBg:t,radiusPx:n})=>{const r=ct(),{fps:o}=qe(),{enterSec:i}=Ix(e/o),s=i<=0?1:Math.min(1,Math.max(0,r/o/i)),a=yp(s);return d.jsx("div",{style:{position:"absolute",inset:0,background:M4(t),backdropFilter:"blur(14px)",WebkitBackdropFilter:"blur(14px)",borderRadius:n,opacity:a,transform:a<1?`translateY(${(1-a)*18}px)`:void 0}})},L4=({cues:e,theme:t})=>{const{fps:n,width:r,height:o}=qe();return d.jsx(hn,{style:{pointerEvents:"none"},children:e.map(i=>{if(i.kind==="plain"||!i.component||!i.props)return null;const s=Ex(i,{width:r,height:o}),a=P4[i.component],{from:l,durationInFrames:u}=up(i.startSec,i.endSec,n),f=s.w*r,p=s.h*o,m=F4.has(i.layout),h=m?Math.min(24,Math.round(p*.12)):0,y=f-h*2,g=p-h*2,E=d4(i.component,i.props,{widthPx:y,heightPx:g});return d.jsx(dt,{from:l,durationInFrames:u,children:d.jsx("div",{"data-edit-scene":i.id,style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"auto",overflow:"hidden"},children:d.jsxs(A4,{durationInFrames:u,children:[m?d.jsx(N4,{durationInFrames:u,themeBg:t.bg,radiusPx:t.radiusPx}):null,d.jsx("div",{style:{width:y/E,transform:`scale(${E})`,position:"relative"},children:d.jsx(a,{props:i.props,theme:t,widthPx:y/E,heightPx:g/E,edits:f4(i.elements,E)})})]})})},i.id)})})},z4="made with ossclip",D4=.45,O4=.024;function V4(e=$t){const t=bn(e);return{xPx:Math.round(t.left*e.width),yPx:Math.round(t.top*e.height),fontPx:Math.round(Math.min(e.width,e.height)*O4),opacity:D4,text:z4}}function B4(e){return e===!0}const W4=({theme:e,frame:t})=>{const n=V4(t);return d.jsx("div",{style:{position:"absolute",left:n.xPx,top:n.yPx,fontFamily:e.fontDisplay,fontSize:n.fontPx,fontWeight:600,letterSpacing:"0.02em",color:e.fg,opacity:n.opacity,pointerEvents:"none",whiteSpace:"nowrap"},children:n.text})};function H4(e){return e!==!0}const U4=({videoFileName:e,spans:t,captionLines:n,sceneCues:r,theme:o,settings:i,face:s,zoomPlan:a,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f,contentTimeline:p,sourceSize:m,contentCropMode:h,sourceFit:y,watermark:g,captionsHidden:E})=>{if(!e)return d.jsx(hn,{style:{backgroundColor:"#111",color:"#888",alignItems:"center",justifyContent:"center",fontFamily:"monospace",fontSize:40},children:"no production loaded"});const v=/^https?:\/\//.test(e)?e:$w(e);return d.jsxs(hn,{style:{backgroundColor:"black"},children:[d.jsx(Yj,{cues:r,theme:o,face:s,zoomPlan:a,sourceTextRegions:f,contentTimeline:p,spans:t,sourceSize:m,contentCropMode:h,sourceFit:y,children:d.jsx($T,{src:v,spans:t,...y==="contain"?{punchInScale:1,background:"transparent"}:{}})}),d.jsx(L4,{cues:r,theme:o}),H4(E)?d.jsx(Vj,{lines:n,cues:r,activeColor:o.accent,ctaKeyword:l,ctaWindow:u,sourceTextRegions:f}):null,B4(g)?d.jsx(W4,{theme:o,frame:{width:i.width,height:i.height}}):null]})},Z4=600,Y4=()=>({doc:ZF(),past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null}),wn=(e,t)=>e.scenes[t]??{props:{},elements:{}};function K4(e,t){var r;const n=(o,i)=>{const s=Date.now(),a=i!==void 0&&e.lastCoalesce!==null&&e.lastCoalesce.key===i&&s-e.lastCoalesce.at<Z4;return{doc:o,past:a?e.past:[...e.past,e.doc],future:[],dirty:!0,savedAt:e.savedAt,lastCoalesce:i!==void 0?{key:i,at:s}:null}};switch(t.type){case"load":return{doc:t.doc,past:[],future:[],dirty:!1,savedAt:0,lastCoalesce:null};case"patchProps":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,props:{...o.props,...t.patch}}}},t.coalesce)}case"patchElement":return n(Yh(e.doc,t.sceneId,t.elementId,t.patch),t.coalesce);case"clearElement":return n(nj(e.doc,t.sceneId,t.elementId));case"hideElement":return n(Yh(e.doc,t.sceneId,t.elementId,{hidden:!0}));case"restoreElement":{const o=(r=e.doc.scenes[t.sceneId])==null?void 0:r.elements[t.elementId];return o!=null&&o.hidden?n(rj(e.doc,t.sceneId,t.elementId)):e}case"patchTiming":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,timing:{startSec:t.startSec,endSec:t.endSec}}}})}case"clearTiming":return n(oj(e.doc,t.sceneId));case"patchVideo":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,video:{...o.video,...t.patch}}}},t.coalesce)}case"clearVideo":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.video))return e;const{video:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchPip":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,pip:{...o.pip,...t.patch}}}},t.coalesce)}case"clearPip":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.pip))return e;const{pip:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"patchCaptionY":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,captionY:t.y}}},t.coalesce)}case"patchCaptionScale":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,captionScale:t.scale}}},t.coalesce)}case"clearCaptionStyle":{const o=e.doc.scenes[t.sceneId];if((o==null?void 0:o.captionY)===void 0&&(o==null?void 0:o.captionScale)===void 0)return e;const{captionY:i,captionScale:s,...a}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:a}})}case"patchCaptionStyleAll":{const o={...e.doc.scenes};for(const i of t.sceneIds){const s=o[i]??{props:{},elements:{}};o[i]={...s,...t.y!==void 0?{captionY:t.y}:{},...t.scale!==void 0?{captionScale:t.scale}:{}}}return n({...e.doc,scenes:o})}case"addSplit":return e.doc.splits.some(o=>Math.abs(o.at-t.t)<.001)?e:n({...e.doc,splits:[...e.doc.splits,{at:t.t,id:HF(t.t,e.doc.splits)}].sort((o,i)=>o.at-i.at)});case"setCaptionsHidden":{if(t.hidden===(e.doc.captionsHidden===!0))return e;if(t.hidden)return n({...e.doc,captionsHidden:!0});const{captionsHidden:o,...i}=e.doc;return n(i)}case"hideScene":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,hidden:!0}}})}case"restoreScene":{const o=e.doc.scenes[t.sceneId];if(!(o!=null&&o.hidden))return e;const{hidden:i,...s}=o;return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:s}})}case"cutChunk":{const o=e.doc.cuts.filter(i=>i.src!==void 0||i.startSec!==t.startSec||i.endSec!==t.endSec);return n({...e.doc,cuts:[...o,{startSec:t.startSec,endSec:t.endSec}]})}case"restoreChunk":{if(t.index<0||t.index>=e.doc.cuts.length)return e;const o=e.doc.cuts.filter((i,s)=>s!==t.index);return n({...e.doc,cuts:o})}case"patchComponent":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,component:t.component}}})}case"patchLayout":{const{graphicRect:o,...i}=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...i,layout:t.layout}}})}case"patchGraphicRect":{const o=wn(e.doc,t.sceneId);return n({...e.doc,scenes:{...e.doc.scenes,[t.sceneId]:{...o,graphicRect:t.rect}}},t.coalesce)}case"clearGraphicRect":return n(ij(e.doc,t.sceneId));case"patchCaption":{const o=yx(t.srcStart),i=BF(e.doc.captions,o,t.was);if(t.text===i){const{[o]:s,...a}=e.doc.captions;return n({...e.doc,captions:a})}return n({...e.doc,captions:{...e.doc.captions,[o]:{text:t.text,was:i}}})}case"patchTheme":return n({...e.doc,theme:{...e.doc.theme,...t.patch}});case"undo":{if(e.past.length===0)return e;const o=e.past[e.past.length-1],i=e.past.slice(0,-1);return{doc:o,past:i,future:[...e.future,e.doc],savedAt:e.savedAt,dirty:i.length!==e.savedAt,lastCoalesce:null}}case"redo":{if(e.future.length===0)return e;const o=e.future[e.future.length-1],i=[...e.past,e.doc];return{doc:o,past:i,future:e.future.slice(0,-1),savedAt:e.savedAt,dirty:i.length!==e.savedAt,lastCoalesce:null}}case"saved":return{...e,dirty:!1,savedAt:e.past.length}}}function X4(){const[e,t]=c.useReducer(K4,void 0,Y4),n=async()=>{const r=await fetch("/api/overrides",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify(e.doc)});if(!r.ok){const o=await r.json().catch(()=>({}));throw new Error(o.error??"save failed")}t({type:"saved"})};return{doc:e.doc,dirty:e.dirty,canUndo:e.past.length>0,canRedo:e.future.length>0,load:r=>t({type:"load",doc:r}),undo:()=>t({type:"undo"}),redo:()=>t({type:"redo"}),save:n,patchProps:(r,o,i)=>t({type:"patchProps",sceneId:r,patch:o,coalesce:i}),patchElement:(r,o,i,s)=>t({type:"patchElement",sceneId:r,elementId:o,patch:i,coalesce:s}),clearElement:(r,o)=>t({type:"clearElement",sceneId:r,elementId:o}),hideElement:(r,o)=>t({type:"hideElement",sceneId:r,elementId:o}),restoreElement:(r,o)=>t({type:"restoreElement",sceneId:r,elementId:o}),patchTiming:(r,o,i)=>t({type:"patchTiming",sceneId:r,startSec:o,endSec:i}),clearTiming:r=>t({type:"clearTiming",sceneId:r}),patchVideo:(r,o,i)=>t({type:"patchVideo",sceneId:r,patch:o,coalesce:i}),clearVideo:r=>t({type:"clearVideo",sceneId:r}),patchPip:(r,o,i)=>t({type:"patchPip",sceneId:r,patch:o,coalesce:i}),clearPip:r=>t({type:"clearPip",sceneId:r}),patchCaptionY:(r,o,i)=>t({type:"patchCaptionY",sceneId:r,y:o,coalesce:i}),patchCaptionScale:(r,o,i)=>t({type:"patchCaptionScale",sceneId:r,scale:o,coalesce:i}),clearCaptionStyle:r=>t({type:"clearCaptionStyle",sceneId:r}),patchCaptionStyleAll:(r,o)=>t({type:"patchCaptionStyleAll",sceneIds:r,...o}),addSplit:r=>t({type:"addSplit",t:r}),setCaptionsHidden:r=>t({type:"setCaptionsHidden",hidden:r}),hideScene:r=>t({type:"hideScene",sceneId:r}),restoreScene:r=>t({type:"restoreScene",sceneId:r}),cutChunk:(r,o)=>t({type:"cutChunk",startSec:r,endSec:o}),restoreChunk:r=>t({type:"restoreChunk",index:r}),patchGraphicRect:(r,o,i)=>t({type:"patchGraphicRect",sceneId:r,rect:o,coalesce:i}),clearGraphicRect:r=>t({type:"clearGraphicRect",sceneId:r}),patchComponent:(r,o)=>t({type:"patchComponent",sceneId:r,component:o}),patchLayout:(r,o)=>t({type:"patchLayout",sceneId:r,layout:o}),patchCaption:(r,o,i)=>t({type:"patchCaption",srcStart:r,text:o,was:i}),patchTheme:r=>t({type:"patchTheme",patch:r})}}function ig(e){const t=e==null?void 0:e.closest("[data-edit-id]");if(!t)return null;const n=t.closest("[data-edit-scene]");return n?{sceneId:n.dataset.editScene,elementId:t.dataset.editId}:null}function sg(e){const t=e==null?void 0:e.closest("[data-edit-video]");return(t==null?void 0:t.dataset.editVideo)||null}function ag(e,t,n){const r=e.querySelectorAll(`[data-edit-scene="${t}"] [data-edit-id="${n}"]`);if(r.length===0)return null;let o=1/0,i=1/0,s=-1/0,a=-1/0;return r.forEach(l=>{const u=l.getBoundingClientRect();o=Math.min(o,u.left),i=Math.min(i,u.top),s=Math.max(s,u.right),a=Math.max(a,u.bottom)}),new DOMRect(o,i,s-o,a-i)}const lg=.015,G4=1e-9;function fo(e,t){let n=null,r=1/0;for(const o of e){const i=Math.abs(o.feature-o.target);i<=t+G4&&i<r&&(n=o,r=i)}return n}function ug(e,t,n,r){const o={...e},i=[];if(t==="move"){const s=e.x+e.w/2,a=e.x+e.w,l=.5-e.w/2,u=l>=n.left&&l+e.w<=1-n.right,f=fo([...u?[{target:.5,feature:s}]:[],{target:n.left,feature:e.x},{target:1-n.right,feature:a}],r);f&&(o.x=e.x+(f.target-f.feature),i.push({axis:"x",at:f.target}));const p=e.y+e.h/2,m=e.y+e.h,h=.5-e.h/2,y=h>=n.top&&h+e.h<=1-n.bottom,g=fo([...y?[{target:.5,feature:p}]:[],{target:n.top,feature:e.y},{target:1-n.bottom,feature:m}],r);return g&&(o.y=e.y+(g.target-g.feature),i.push({axis:"y",at:g.target})),{rect:o,guides:i}}if(t.includes("w")){const s=fo([{target:n.left,feature:e.x}],r);if(s){const a=e.x+e.w;o.x=s.target,o.w=a-s.target,i.push({axis:"x",at:s.target})}}else if(t.includes("e")){const s=1-n.right,a=fo([{target:s,feature:e.x+e.w}],r);a&&(o.w=a.target-e.x,i.push({axis:"x",at:a.target}))}if(t.includes("n")){const s=fo([{target:n.top,feature:e.y}],r);if(s){const a=e.y+e.h;o.y=s.target,o.h=a-s.target,i.push({axis:"y",at:s.target})}}else if(t.includes("s")){const s=1-n.bottom,a=fo([{target:s,feature:e.y+e.h}],r);a&&(o.h=a.target-e.y,i.push({axis:"y",at:a.target}))}return{rect:o,guides:i}}function q4(e){const t=e.spans;if(t===void 0)return{};let n;try{n=xx(t).spans.length}catch{return{}}if(n===0)return{};const r={};return e.captionLines&&(r.captionLines=Kh(e.captionLines,t)),e.baseCaptionLines&&(r.baseCaptionLines=Kh(e.baseCaptionLines,t)),r}function cg(e,t){const n=t.baseCaptionLines??t.captionLines??[],r=QF(e.captions,n);return{doc:{...e,captions:JF(e.captions,r)},unresolved:r.unresolved}}function Q4(e){const t={};for(const[n,r]of Object.entries(e))vp(n)||(t[n]=r);return t}function J4(e,t){const n=i=>JSON.stringify([i.text,i.was]),r=new Map;for(const i of Object.values(t))r.set(n(i),(r.get(n(i))??0)+1);const o=[];for(const i of Object.values(e)){const s=r.get(n(i))??0;s>0?r.set(n(i),s-1):o.push(i)}return o}function eM(e){return e.map(t=>`“${t.was}” was retyped as “${t.text}”, and the overrides this render wrote back no longer have it. Retype it if you still want it.`)}function Ox(e){return e.map(t=>{const n=`“${t.was}” was retyped in an older version of this project`;switch(t.reason){case"out-of-range":return`${n}, and the word is still here but too far from where the edit was stored to be sure it is the same one — it was left alone. It is still saved. Retype it here if that is the word you meant.`;case"ambiguous":return`${n}, and more than one word here says it — it was left alone rather than applied to the wrong one. Retype the one you meant.`;case"unanchorable":return`${n}, but this project's files carry no source timing for that word, so nothing can be anchored to it. Re-run produce, then retype it.`;case"collision":return`${n} twice, and both point at the same word — neither was applied. Retype the one you meant.`;case"superseded":return`${n} and again since; the newer edit was kept and the older one dropped.`;default:return`${n}, and no word here says it any more — the cut probably removed it. Retype it if you still want it.`}})}function tM(e){return e.map(t=>t.reason==="duplicate-anchor"?`“${t.expected}” shares its moment with another word — only the first was retyped.`:t.found===null?`“${t.expected}” was retyped, but no word in this cut sits at that moment any more.`:`“${t.expected}” was retyped, but the transcript says “${t.found}” there now.`)}function nM(e){if(e===void 0||e.trim()==="")return null;const t=Number(e);return Fs({srcStart:t})===null?null:t}function rM(e,t){var i;if(!e)return null;const n=[];if(e.kind!=="plain"&&((i=t.scenes[e.id])==null?void 0:i.hidden)!==!0&&n.push("graphic"),t.cuts.some(s=>s.src===void 0&&s.startSec===e.startSec&&s.endSec===e.endSec)||n.push("take"),n.length===0)return null;const o=wx(e.id);return{sceneId:e.id,rootId:o,isSplitHalf:o!==e.id,startSec:e.startSec,endSec:e.endSec,targets:n}}function dg(e,t,n,r){const o={...e};return t==="move"?(o.x+=n,o.y+=r,o):(t.includes("w")&&(o.x+=n,o.w-=n),t.includes("e")&&(o.w+=n),t.includes("n")&&(o.y+=r,o.h-=r),t.includes("s")&&(o.h+=r),o)}const fg=64,pa=9,ma=e=>Math.round(e*10)/10,po=e=>Math.round(e*1e4)/1e4,Vx={position:"absolute",width:10,height:10,background:"#5b8cff",border:"1px solid #0B0B0E",borderRadius:2,pointerEvents:"auto",zIndex:6},pg={nw:{left:0,top:0,transform:"translate(-50%,-50%)",cursor:"nwse-resize"},n:{left:"50%",top:0,transform:"translate(-50%,-50%)",cursor:"ns-resize"},ne:{right:0,top:0,transform:"translate(50%,-50%)",cursor:"nesw-resize"},e:{right:0,top:"50%",transform:"translate(50%,-50%)",cursor:"ew-resize"},se:{right:0,bottom:0,transform:"translate(50%,50%)",cursor:"nwse-resize"},s:{left:"50%",bottom:0,transform:"translate(-50%,50%)",cursor:"ns-resize"},sw:{left:0,bottom:0,transform:"translate(-50%,50%)",cursor:"nesw-resize"},w:{left:0,top:"50%",transform:"translate(-50%,-50%)",cursor:"ew-resize"}},oM={...Vx,background:"#ffe14d"},iM={top:{top:0,left:14,right:14,height:10},bottom:{bottom:0,left:14,right:14,height:10},left:{left:0,top:14,bottom:14,width:10},right:{right:0,top:14,bottom:14,width:10}},sM={position:"absolute",cursor:"move",pointerEvents:"auto",zIndex:5},Bx=/^(line|node|message|window|item)-(\d+)$/;function aM(e,t,n){const r=Bx.exec(e);if(!r)return null;const o=r[1],i=Number(r[2]);if(o==="message"&&i===0&&typeof t.keyword=="string"&&t.keyword){const f=n.trim().replace(/^"(.*)"$/,"$1").toLowerCase();return f?{keyword:f}:null}const s=o==="line"?"lines":o==="node"?"nodes":o==="item"?"items":o==="window"?"windows":"messages",a=t[s];if(!Array.isArray(a)||i<0||i>=a.length)return null;const l=a.slice(),u=l[i];if(o==="node"||o==="item")l[i]=n;else if(o==="window"){if(typeof u!="object"||u===null)return null;const f=n.split(`
|
|
160
|
+
`).slice(0,6).map(p=>p.slice(0,40));l[i]={...u,lines:f}}else{if(typeof u!="object"||u===null)return null;l[i]={...u,text:n}}return{[s]:l}}function lM(e,t){const n=Bx.exec(e);if(!n){const u=t[e];return typeof u=="string"?u:null}const r=n[1],o=Number(n[2]);if(r==="message"&&o===0&&typeof t.keyword=="string"&&t.keyword)return t.keyword;const s=t[r==="line"?"lines":r==="node"?"nodes":r==="item"?"items":r==="window"?"windows":"messages"];if(!Array.isArray(s)||o<0||o>=s.length)return null;const a=s[o];if(r==="node"||r==="item")return typeof a=="string"?a:null;if(r==="window"){const u=a==null?void 0:a.lines;return Array.isArray(u)&&u.every(f=>typeof f=="string")?u.join(`
|
|
161
|
+
`):null}const l=a==null?void 0:a.text;return typeof l=="string"?l:null}function Wx(){const e=document.activeElement;(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)&&e.blur()}const uM=({stageRef:e,selection:t,onSelect:n,edits:r,onSave:o,settings:i,playerRef:s,onTransport:a,onVideoPreview:l,onGraphicPreview:u,cue:f,cues:p,onToggleHelp:m,onRequestDelete:h})=>{const[y,g]=c.useState(null),E=c.useRef(null),v=c.useRef(0),w=c.useRef(null),x=c.useRef(0),b=c.useRef(null),S=c.useRef(0),C=c.useRef(null),[k,T]=c.useState(!1),[P,j]=c.useState([]),M=c.useRef(null),[D,N]=c.useState(null),[L,H]=c.useState(null),O=c.useRef(null),[R,I]=c.useState({dx:0,dy:0}),_=c.useRef(null),F=c.useRef(t),z=c.useCallback($=>{F.current=$,n($)},[n]);c.useEffect(()=>{F.current=t},[t]);const B=($,A)=>{const X=[];let Z=null;for(let V=0;V<25;V++){const U=document.elementFromPoint($,A);if(!U||U===document.documentElement||U===document.body){Z=U;break}if(Z=U,U.hasAttribute("data-edit-id")||U.hasAttribute("data-edit-scene")||U.hasAttribute("data-caption-word")||U.closest("[data-edit-video]")!==null||["BUTTON","INPUT","SELECT","TEXTAREA"].includes(U.tagName)||!(U instanceof HTMLElement))break;X.push({el:U,prev:U.style.pointerEvents}),U.style.pointerEvents="none"}return X.forEach(({el:V,prev:U})=>{V.style.pointerEvents=U}),Z},Y=c.useCallback(()=>{var U,se;const $=e.current,A=(U=s.current)==null?void 0:U.getScale(),X=((se=$==null?void 0:$.querySelector(".__remotion-player"))==null?void 0:se.getBoundingClientRect())??($==null?void 0:$.getBoundingClientRect());if(!X||!A||A<=0)return null;const Z=i.width*A,V=i.height*A;return{left:X.left+(X.width-Z)/2,top:X.top+(X.height-V)/2,w:Z,h:V}},[e,s,i]);return c.useEffect(()=>{if(!t){g(null);return}let $;const A=()=>{var Z;const X=e.current;if(X){const V=t.elementId?ag(X,t.sceneId,t.elementId):((Z=X.querySelector(`[data-edit-scene="${t.sceneId}"]`))==null?void 0:Z.getBoundingClientRect())??null;g(V)}$=requestAnimationFrame(A)};return $=requestAnimationFrame(A),()=>cancelAnimationFrame($)},[e,t]),c.useEffect(()=>{const $=A=>{var V,U;const X=e.current;if(!X||!X.contains(A.target)||A.altKey||A.button!==0)return;(((V=F.current)==null?void 0:V.elementId)&&((U=_.current)==null?void 0:U.contains(A.target))||ig(B(A.clientX,A.clientY))!==null)&&A.stopPropagation()};return window.addEventListener("pointerdown",$,!0),()=>window.removeEventListener("pointerdown",$,!0)},[e]),c.useEffect(()=>{const $=A=>{var J,Q,G,fe,Ee,$e,Fe;const X=e.current;if(!X||!X.contains(A.target))return;const Z=document.activeElement;if((Z instanceof HTMLInputElement||Z instanceof HTMLTextAreaElement)&&Z.contains(A.target)||(Wx(),A.altKey||A.button!==0))return;const V=A.target instanceof Element?A.target.closest("[data-el-handle]"):null,U=F.current;if(V&&(U!=null&&U.elementId)){const Ie=ag(X,U.sceneId,U.elementId);if(Ie){const he=Ie.left+Ie.width/2,we=Ie.top+Ie.height/2,_e=Math.hypot(A.clientX-he,A.clientY-we);if(_e>2){const ge=((Q=(J=r.doc.scenes[U.sceneId])==null?void 0:J.elements[U.elementId])==null?void 0:Q.scale)??1;M.current={sceneId:U.sceneId,elementId:U.elementId,cx:he,cy:we,startDist:_e,prior:ge,factor:1},N(1)}}return}if((G=F.current)!=null&&G.elementId&&((fe=_.current)!=null&&fe.contains(A.target))){O.current={x:A.clientX,y:A.clientY,dx:0,dy:0},I({dx:0,dy:0});return}const se=A.target instanceof Element?A.target.closest("[data-box-handle]"):null,de=F.current;if(se&&de&&!de.elementId){const Ie=X.querySelector(`[data-edit-scene="${de.sceneId}"]`),he=Y();if(Ie&&he){const we=Ie.getBoundingClientRect();C.current=null,b.current={sceneId:de.sceneId,handle:se.dataset.boxHandle,x:A.clientX,y:A.clientY,dx:0,dy:0,start:{x:(we.left-he.left)/he.w,y:(we.top-he.top)/he.h,w:we.width/he.w,h:we.height/he.h}},T(!0)}return}const ae=B(A.clientX,A.clientY),te=ig(ae);if(!te){const Ie=ae==null?void 0:ae.closest("[data-edit-scene]");if(Ie){z({sceneId:Ie.dataset.editScene,elementId:null});return}const he=sg(ae),we=X.getBoundingClientRect().bottom;if(he&&A.clientY<we-fg){z({sceneId:he,elementId:null});const _e=p.find(ke=>ke.id===he);if((_e==null?void 0:_e.layout)==="pip-bubble"&&!A.altKey){const ke=Hr("pip-bubble",void 0,[],i).video.rect;w.current={sceneId:he,x:A.clientX,y:A.clientY,base:{x:((Ee=_e.pip)==null?void 0:Ee.x)??ke.x,y:(($e=_e.pip)==null?void 0:$e.y)??ke.y},slot:{w:ke.w,h:ke.h}};return}const ge=(Fe=r.doc.scenes[he])==null?void 0:Fe.video;E.current={sceneId:he,x:A.clientX,y:A.clientY,dx:0,dy:0,baseDx:(ge==null?void 0:ge.dx)??0,baseDy:(ge==null?void 0:ge.dy)??0};return}z(null);return}z({sceneId:te.sceneId,elementId:te.elementId}),O.current={x:A.clientX,y:A.clientY,dx:0,dy:0},I({dx:0,dy:0})};return window.addEventListener("mousedown",$),()=>window.removeEventListener("mousedown",$)},[e,z,r,Y,p,i]),c.useEffect(()=>{const $=()=>{var U,se;const Z=(U=s.current)==null?void 0:U.getScale(),V=(se=e.current)==null?void 0:se.getBoundingClientRect();return Z&&Z>0?1/Z:V&&V.width>0?i.width/V.width:1},A=Z=>{const V=e.current;if(V&&!(b.current||M.current))if(w.current)V.style.cursor="move";else if(E.current)V.style.cursor="grabbing";else{const J=Z.target instanceof Element?Z.target:null,Q=J!==null&&V.contains(J)&&!J.closest("button, input, select, textarea, [data-edit-id], [data-edit-scene], [data-caption-word]")&&Z.clientY<V.getBoundingClientRect().bottom-fg,G=Q&&(()=>{var Ee;const fe=sg(J);return fe!==null&&((Ee=p.find($e=>$e.id===fe))==null?void 0:Ee.layout)==="pip-bubble"})();V.style.cursor=Q?G?"move":"grab":""}const U=M.current;if(U){const Q=Math.hypot(Z.clientX-U.cx,Z.clientY-U.cy)/U.startDist;U.factor=Math.min(4/U.prior,Math.max(.05/U.prior,Q)),N(U.factor);return}const se=b.current;if(se){se.dx=Z.clientX-se.x,se.dy=Z.clientY-se.y,C.current=Z.altKey,S.current||(S.current=requestAnimationFrame(()=>{S.current=0;const J=b.current,Q=Y();if(!J||!Q)return;const G=gl(dg(J.start,J.handle,J.dx/Q.w,J.dy/Q.h),i);if(Z.altKey)j([]),u({sceneId:J.sceneId,rect:G});else{const fe=ug(G,J.handle,bn(i),lg);j(fe.guides),u({sceneId:J.sceneId,rect:fe.rect})}}));return}if(w.current){x.current||(x.current=requestAnimationFrame(()=>{x.current=0;const J=w.current,Q=Y();if(!J||!Q)return;const G=(Z.clientX-J.x)/Q.w,fe=(Z.clientY-J.y)/Q.h;r.patchPip(J.sceneId,{x:po(Math.min(Math.max(J.base.x+G,0),1-J.slot.w)),y:po(Math.min(Math.max(J.base.y+fe,0),1-J.slot.h))},`pip:${J.sceneId}:drag`)}));return}const ae=E.current;if(ae){ae.dx=Z.clientX-ae.x,ae.dy=Z.clientY-ae.y,v.current||(v.current=requestAnimationFrame(()=>{v.current=0;const J=E.current;if(!J)return;const Q=$();l({sceneId:J.sceneId,patch:{dx:J.baseDx+J.dx*Q,dy:J.baseDy+J.dy*Q}})}));return}const te=O.current;te&&(te.dx=Z.clientX-te.x,te.dy=Z.clientY-te.y,I({dx:te.dx,dy:te.dy}))},X=Z=>{const V=M.current;if(V){M.current=null,N(null),Math.abs(V.factor-1)>.001&&r.patchElement(V.sceneId,V.elementId,{scale:Math.round(V.prior*V.factor*1e3)/1e3});return}const U=b.current;if(U){if(b.current=null,T(!1),j([]),S.current&&(cancelAnimationFrame(S.current),S.current=0),U.dx!==0||U.dy!==0){const J=Y();if(J){let Q=gl(dg(U.start,U.handle,U.dx/J.w,U.dy/J.h),i);(C.current??Z.altKey)||(Q=ug(Q,U.handle,bn(i),lg).rect),r.patchGraphicRect(U.sceneId,{x:po(Q.x),y:po(Q.y),w:po(Q.w),h:po(Q.h)})}}C.current=null,u(null);return}if(w.current){w.current=null,x.current&&(cancelAnimationFrame(x.current),x.current=0);return}const de=E.current;if(de){if(E.current=null,v.current&&(cancelAnimationFrame(v.current),v.current=0),de.dx!==0||de.dy!==0){const J=$();r.patchVideo(de.sceneId,{dx:ma(de.baseDx+de.dx*J),dy:ma(de.baseDy+de.dy*J)})}l(null);return}const ae=O.current,te=F.current;if(!ae||!(te!=null&&te.elementId)){O.current=null;return}if(ae.dx!==0||ae.dy!==0){const J=$(),Q=r.doc.scenes[te.sceneId],G=Q==null?void 0:Q.elements[te.elementId];r.patchElement(te.sceneId,te.elementId,{dx:ma(((G==null?void 0:G.dx)??0)+ae.dx*J),dy:ma(((G==null?void 0:G.dy)??0)+ae.dy*J)})}O.current=null,I({dx:0,dy:0})};return window.addEventListener("mousemove",A),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",A),window.removeEventListener("mouseup",X)}},[r,e,i,s,l,u,Y,p]),c.useEffect(()=>{const $=A=>{var se;const X=e.current;if(!X||!X.contains(A.target))return;const Z=(se=B(A.clientX,A.clientY))==null?void 0:se.closest("[data-caption-word]");if(!Z)return;A.preventDefault();const V=nM(Z.dataset.captionSrc),U=Z.dataset.captionText??"";V===null||!U||H({srcStart:V,was:U,draft:U,rect:Z.getBoundingClientRect()})};return window.addEventListener("dblclick",$),()=>window.removeEventListener("dblclick",$)},[e]),c.useEffect(()=>{const $=()=>{const V=document.activeElement;return V instanceof HTMLInputElement||V instanceof HTMLTextAreaElement||V instanceof HTMLSelectElement||V instanceof HTMLElement&&V.isContentEditable},A=()=>{const V=document.activeElement;return V instanceof HTMLTextAreaElement||V instanceof HTMLElement&&V.isContentEditable?!0:V instanceof HTMLInputElement&&!["range","checkbox","radio","button"].includes(V.type)},X=()=>{const V=document.activeElement;V instanceof HTMLElement&&!A()&&V.blur()},Z=V=>{var se,de,ae;if(L!==null)return;const U=V.metaKey||V.ctrlKey;if(V.key==="Escape"){if($()){(se=document.activeElement)==null||se.blur();return}z(null)}else if(U&&V.key.toLowerCase()==="z")V.preventDefault(),V.shiftKey?r.redo():r.undo();else if(U&&V.key.toLowerCase()==="y")V.preventDefault(),r.redo();else if(U&&V.key.toLowerCase()==="s")V.preventDefault(),o();else if(V.key===" "&&!U){if(A())return;const te=document.activeElement;if(te instanceof HTMLElement&&te.tagName==="BUTTON"&&((de=e.current)!=null&&de.contains(te)))return;X(),V.preventDefault(),(ae=s.current)==null||ae.toggle()}else if(!U&&["j","k","l"].includes(V.key.toLowerCase())){if(A())return;X(),V.preventDefault(),a(V.key.toUpperCase())}else if(!U&&!V.altKey&&(V.key==="ArrowLeft"||V.key==="ArrowRight")){if($())return;V.preventDefault();const te=s.current;if(!te)return;te.seekTo(Math.max(0,te.getCurrentFrame()+(V.key==="ArrowRight"?1:-1)))}else if(U&&V.key.toLowerCase()==="b"){if(A())return;V.preventDefault();const te=s.current;if(!te)return;const J=te.getCurrentFrame()/i.fps;if(!p.find(G=>J>=G.startSec+hl&&J<=G.endSec-hl))return;r.addSplit(Math.round(J*1e3)/1e3)}else if(!U&&V.altKey&&(V.key==="ArrowLeft"||V.key==="ArrowRight")){if(A())return;const te=F.current,J=te?(()=>{const Q=p.findIndex(G=>G.id===te.sceneId);return Q===-1?void 0:p[Q+(V.key==="ArrowRight"?1:-1)]})():p[V.key==="ArrowRight"?0:p.length-1];if(!J)return;V.preventDefault(),z({sceneId:J.id,elementId:null})}else if(U&&(V.key==="ArrowLeft"||V.key==="ArrowRight")){if(A())return;V.preventDefault();const te=s.current;if(!te)return;const J=te.getCurrentFrame()/i.fps,Q=p.findIndex(fe=>J>=fe.startSec&&J<fe.endSec),G=p[(Q===-1?0:Q)+(V.key==="ArrowRight"?1:-1)];if(!G)return;te.seekTo(Math.round(G.startSec*i.fps)),z({sceneId:G.id,elementId:null})}else if(!U&&!V.altKey&&V.key==="?"){if($())return;V.preventDefault(),m()}else if(!U&&(V.key==="Delete"||V.key==="Backspace")){if($())return;const te=F.current;if(!te||te.elementId!==null||!f||f.id!==te.sceneId)return;const J=rM(f,r.doc);if(!J)return;V.preventDefault(),h(J)}};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[z,r,L,o,s,e,a,f,p,i,m,h]),d.jsxs("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:[R.dx!==0||R.dy!==0||k?d.jsx("div",{"data-testid":"safe-area-guide",style:{position:"absolute",left:`${bn(i).left*100}%`,top:`${bn(i).top*100}%`,right:`${bn(i).right*100}%`,bottom:`${bn(i).bottom*100}%`,border:"1px dashed rgba(255, 225, 77, 0.45)",boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.18)",pointerEvents:"none"}}):null,P.map($=>d.jsx("div",{"data-testid":`guide-${$.axis}`,style:{position:"absolute",pointerEvents:"none",background:"#FFE14D",...$.axis==="x"?{left:`${$.at*100}%`,top:0,bottom:0,width:1}:{top:`${$.at*100}%`,left:0,right:0,height:1}}},$.axis)),y&&t?d.jsxs("div",{ref:_,"data-testid":"overlay-box",style:{position:"fixed",pointerEvents:"auto",left:y.left+R.dx-pa/2+y.width*(1-(D??1))/2,top:y.top+R.dy-pa/2+y.height*(1-(D??1))/2,width:y.width*(D??1)+pa,height:y.height*(D??1)+pa,border:t.elementId?"2px dashed #ffe14d":"2px dashed #5b8cff",borderRadius:4,boxShadow:"0 0 0 1px rgba(0,0,0,0.35)",cursor:t.elementId?"grab":"default"},children:[t.elementId?d.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,marginBottom:4,fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap"},children:t.elementId}):null,t.elementId?["nw","ne","se","sw"].map($=>d.jsx("div",{"data-el-handle":$,"data-testid":`el-handle-${$}`,style:{...oM,...pg[$]}},$)):null,!t.elementId&&f&&f.kind!=="plain"?d.jsxs(d.Fragment,{children:[["top","bottom","left","right"].map($=>d.jsx("div",{"data-box-handle":"move","data-testid":$==="top"?"box-handle-move":`box-handle-move-${$}`,style:{...sM,...iM[$]}},$)),["nw","n","ne","e","se","s","sw","w"].map($=>d.jsx("div",{"data-box-handle":$,"data-testid":`box-handle-${$}`,style:{...Vx,...pg[$]}},$))]}):null]}):null,L?d.jsx("input",{autoFocus:!0,"data-testid":"caption-edit",value:L.draft,onChange:$=>H({...L,draft:$.target.value}),onBlur:()=>{const $=L.draft.trim();$&&r.patchCaption(L.srcStart,$,L.was),H(null)},onKeyDown:$=>{$.key==="Enter"&&$.target.blur(),$.key==="Escape"&&H(null)},style:{position:"fixed",pointerEvents:"auto",left:L.rect.left-4,top:L.rect.top-4,width:Math.max(L.rect.width+40,90),height:L.rect.height+8,fontSize:Math.max(13,Math.min(L.rect.height*.7,28)),fontFamily:"'Inter', system-ui, sans-serif",fontWeight:800,border:"2px solid #FFE14D",borderRadius:4,padding:"0 4px",background:"#0B0B0E",color:"#fff",outline:"none",zIndex:11}}):null]})},an={display:"flex",flexDirection:"column",gap:6},Ii={display:"grid",gridTemplateColumns:"1fr 1fr",gap:8},Ae={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},Hi={fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px",width:"100%"},Md={...Hi,fontFamily:"'Inter', system-ui, sans-serif"},Ue={display:"flex",flexDirection:"column",gap:14,padding:"16px 18px",borderBottom:"1px solid #22222a"},zt={fontSize:12,fontWeight:600,color:"#FF5C5C",background:"transparent",border:"1px solid #452626",borderRadius:6,padding:"7px 10px",cursor:"pointer"},Dt=()=>{var e,t;(t=(e=document.activeElement)==null?void 0:e.blur)==null||t.call(e)},cM=e=>String(Math.round(e*1e3)/1e3),It=({id:e,value:t,onCommit:n,min:r,max:o,dragStep:i})=>{const[s,a]=ne.useState(null),[l,u]=ne.useState(!1),f=ne.useRef(null),p=ne.useRef(null),m=r??-1/0,h=o??1/0,y=i??(r!==void 0&&o!==void 0?(o-r)/240:.5),g=s!==null;return d.jsxs("div",{style:an,children:[d.jsx("span",{style:Ae,children:e}),d.jsx("input",{type:"text",inputMode:"decimal",ref:f,"data-testid":`field-${e}`,style:{...Hi,...g?{}:{cursor:"ew-resize",touchAction:"none"},...l?{borderColor:"#FFE14D",color:"#FFE14D"}:{}},value:s??(Number.isFinite(t)?cM(t):"0"),onFocus:E=>a(E.target.value),onBlur:()=>a(null),onPointerDown:E=>{g||(E.preventDefault(),p.current={x:E.clientX,v:Number.isFinite(t)?t:0,moved:!1},E.currentTarget.setPointerCapture(E.pointerId),u(!0))},onPointerMove:E=>{const v=p.current;if(!v)return;const w=E.clientX-v.x;if(!v.moved&&Math.abs(w)<=2)return;v.moved=!0;const x=Math.round(Math.min(h,Math.max(m,v.v+w*y))*1e3)/1e3;n(x)},onPointerUp:()=>{var v,w,x;const E=((v=p.current)==null?void 0:v.moved)===!0;p.current=null,u(!1),E||((w=f.current)==null||w.focus(),(x=f.current)==null||x.select())},onPointerCancel:()=>{p.current=null,u(!1)},onChange:E=>{a(E.target.value);const v=E.target.value.trim();if(v==="")return;const w=Number(v.replace(",","."));Number.isFinite(w)&&n(Math.min(h,Math.max(m,w)))}})]})},ha=({id:e,value:t,isColor:n,onCommit:r})=>d.jsxs("div",{style:an,children:[d.jsx("span",{style:Ae,children:e}),d.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[n?d.jsx("input",{type:"color",value:t,onChange:o=>r(o.target.value),style:{width:28,height:28,border:"1px solid #2A2A33",borderRadius:6,padding:0,background:"none"}}):null,d.jsx("input",{"data-testid":`theme-${e}`,style:{...Md,flex:1},value:t,onChange:o=>r(o.target.value)})]})]}),dM=({selection:e,cue:t,frame:n,allSceneIds:r,edits:o,onSelect:i,resolvedTheme:s,anchorText:a,onVideoPreview:l,runInfo:u,captionsHiddenByFlag:f})=>{var v,w,x,b,S,C,k,T,P,j,M,D;if(e!=null&&e.elementId&&t){const N=e.elementId,L=((v=t.elements)==null?void 0:v[N])??{},H=t.props?lM(N,t.props):null,O=/^window-\d+$/.test(N);return d.jsxs("div",{children:[d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Selected"}),d.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:N})]}),(()=>{var B;const R=/^line-(\d+)$/.exec(N),I=(B=t.props)==null?void 0:B.lines;if(t.component!=="StrikethroughReveal"||!R||!Array.isArray(I))return null;const _=Number(R[1]),F=I[_];if(!F)return null;const z=F.struck?"struck":(F.mark??"none")!=="none"?F.mark:"plain";return d.jsx("div",{style:Ue,children:d.jsxs("div",{style:an,children:[d.jsx("span",{style:Ae,children:"Line style"}),d.jsxs("select",{"data-testid":"line-style",style:Hi,value:z,onChange:Y=>{const $=Y.target.value,A=I.slice();A[_]={...A[_],struck:$==="struck",mark:$==="cross"||$==="check"?$:"none"},o.patchProps(e.sceneId,{lines:A})},children:[d.jsx("option",{value:"plain",children:"plain"}),d.jsx("option",{value:"struck",children:"struck through"}),d.jsx("option",{value:"cross",children:"✗ wrong"}),d.jsx("option",{value:"check",children:"✓ right"})]})]})})})(),H!==null?d.jsx("div",{style:Ue,children:d.jsxs("div",{style:an,children:[d.jsx("span",{style:Ae,children:"Text"}),(()=>{const R=I=>{const _=t.props??{},F=/^(line|node|message|window|item)-\d+$/.test(N)?aM(N,_,I):{[N]:I};F&&o.patchProps(e.sceneId,F,`text:${e.sceneId}:${N}`)};return O?d.jsx("textarea",{style:{...Md,resize:"vertical",fontFamily:"inherit"},"data-testid":"element-text",rows:Math.min(6,Math.max(2,H.split(`
|
|
162
|
+
`).length)),value:H,onChange:I=>R(I.target.value)}):d.jsx("input",{style:Md,"data-testid":"element-text",value:H,onChange:I=>R(I.target.value)})})()]})}):null,d.jsxs("div",{style:Ue,children:[d.jsxs("div",{style:an,children:[d.jsxs("span",{style:Ae,children:["scale"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[(L.scale??1).toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"el-scale-slider",min:.1,max:3,step:.01,value:L.scale??1,onChange:R=>o.patchElement(e.sceneId,N,{scale:Number(R.target.value)},`element:${e.sceneId}:${N}:scale`)})]}),d.jsxs("div",{style:Ii,children:[d.jsx(It,{id:"x",value:L.dx??0,dragStep:1,onCommit:R=>o.patchElement(e.sceneId,N,{dx:R},`element:${e.sceneId}:${N}:dx`)}),d.jsx(It,{id:"y",value:L.dy??0,dragStep:1,onCommit:R=>o.patchElement(e.sceneId,N,{dy:R},`element:${e.sceneId}:${N}:dy`)})]}),d.jsx(It,{id:"scale",value:L.scale??1,min:.05,max:4,dragStep:.01,onCommit:R=>o.patchElement(e.sceneId,N,{scale:R},`element:${e.sceneId}:${N}:scale`)})]}),d.jsxs("div",{style:Ue,children:[d.jsx("button",{style:zt,onClick:()=>{Dt(),o.clearElement(e.sceneId,N)},children:"Reset element"}),d.jsx("button",{"data-testid":"delete-element",style:{...zt,marginTop:8},onClick:()=>{Dt(),o.hideElement(e.sceneId,N),i({sceneId:e.sceneId,elementId:null})},children:"Delete element"})]})]})}if(e&&t){const N=t.kind==="plain";if(((w=o.doc.scenes[e.sceneId])==null?void 0:w.hidden)===!0)return d.jsx("div",{children:d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Scene"}),d.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",d.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(deleted)"})]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Its window plays as a plain take. Restore brings the graphic back."}),d.jsx("button",{"data-testid":"restore-scene",style:{...zt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{Dt(),o.restoreScene(e.sceneId)},children:"Restore scene"})]})});const L=o.doc.cuts.findIndex(O=>O.src===void 0&&O.startSec===t.startSec&&O.endSec===t.endSec);if(L!==-1)return d.jsx("div",{children:d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:N?"Take":"Scene"}),d.jsxs("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:[e.sceneId," ",d.jsx("span",{style:{color:"#9A9AA3",fontWeight:400},children:"(marked for removal)"})]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Struck through on the timeline. It disappears from the output on the next produce/Render — this preview still plays it (the editor doesn't re-derive a second cut timeline just to show one early)."}),d.jsx("button",{"data-testid":"restore-chunk",style:{...zt,color:"#5FBF77",border:"1px solid #24402c"},onClick:()=>{Dt(),o.restoreChunk(L)},children:"Restore"})]})});const H=Object.entries(t.elements??{}).filter(([,O])=>O.hidden===!0).map(([O])=>{var _,F;const I=((F=(_=o.doc.scenes[e.sceneId])==null?void 0:_.elements[O])==null?void 0:F.hidden)===!0?e.sceneId:wx(e.sceneId);return{id:O,owningSceneId:I}});return d.jsxs("div",{children:[d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:N?"Take":"Scene"}),d.jsx("div",{style:{fontSize:15,fontWeight:700,fontFamily:"ui-monospace, monospace"},children:e.sceneId}),N?d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"A continuous stretch of the talking head — no graphic. Frame it below; its window follows the cut."}):null]}),d.jsxs("div",{style:Ue,children:[!N&&t.component?d.jsxs("div",{style:an,children:[d.jsx("span",{style:Ae,children:"Component"}),d.jsx("select",{style:Hi,value:t.component,onChange:O=>o.patchComponent(e.sceneId,O.target.value),children:du.options.map(O=>d.jsx("option",{value:O,children:O},O))})]}):null,d.jsxs("div",{style:an,children:[d.jsx("span",{style:Ae,children:"Layout"}),d.jsx("select",{style:Hi,"data-testid":"layout-select",value:t.layout,onChange:O=>o.patchLayout(e.sceneId,O.target.value),children:cu.options.map(O=>d.jsx("option",{value:O,children:O},O))})]})]}),d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Video framing"}),d.jsxs("div",{style:an,children:[d.jsxs("span",{style:Ae,children:["zoom"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[(((x=t.video)==null?void 0:x.scale)??1).toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"zoom-slider",min:.5,max:3,step:.01,value:((b=t.video)==null?void 0:b.scale)??1,onChange:O=>l({sceneId:e.sceneId,patch:{scale:Number(O.target.value)}}),onPointerUp:O=>{const R=Number(O.target.value);o.patchVideo(e.sceneId,{scale:R},`video:${e.sceneId}:scale`),l(null)},onKeyUp:O=>{if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"].includes(O.key))return;const I=Number(O.target.value);o.patchVideo(e.sceneId,{scale:I},`video:${e.sceneId}:scale`),l(null)}})]}),d.jsxs("label",{style:{display:"flex",gap:8,alignItems:"center",fontSize:12,color:"#9A9AA3",cursor:"pointer"},children:[d.jsx("input",{type:"checkbox","data-testid":"auto-zoom",checked:((S=t.video)==null?void 0:S.autoZoom)!==!1,onChange:O=>o.patchVideo(e.sceneId,{autoZoom:O.target.checked})}),"auto zoom (the slow push composes on top of your zoom)"]}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Pan: drag the picture on the stage."}),d.jsx(It,{id:"scale",value:((C=t.video)==null?void 0:C.scale)??1,min:.05,max:4,dragStep:.01,onCommit:O=>o.patchVideo(e.sceneId,{scale:O},`video:${e.sceneId}:scale`)}),d.jsxs("div",{style:Ii,children:[d.jsx(It,{id:"dx",value:((k=t.video)==null?void 0:k.dx)??0,dragStep:1,onCommit:O=>o.patchVideo(e.sceneId,{dx:O},`video:${e.sceneId}:dx`)}),d.jsx(It,{id:"dy",value:((T=t.video)==null?void 0:T.dy)??0,dragStep:1,onCommit:O=>o.patchVideo(e.sceneId,{dy:O},`video:${e.sceneId}:dy`)})]}),t.video?d.jsx("button",{style:zt,onClick:()=>{Dt(),o.clearVideo(e.sceneId)},children:"Reset framing"}):null]}),t.layout==="pip-bubble"?(()=>{const O=Hr("pip-bubble",void 0,[],n).video,R=t.pip??{},I=R.cornerRadius??O.cornerRadius;return d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"PiP bubble"}),d.jsxs("div",{style:an,children:[d.jsxs("span",{style:Ae,children:["roundness"," ",d.jsx("span",{style:{color:"#EDEDF2"},children:I.toFixed(2)})]}),d.jsx("input",{type:"range","data-testid":"pip-roundness",min:0,max:1,step:.01,value:I,onChange:_=>o.patchPip(e.sceneId,{cornerRadius:Number(_.target.value)},`pip:${e.sceneId}:cornerRadius`)})]}),d.jsxs("div",{style:Ii,children:[d.jsx(It,{id:"pip-x",value:R.x??O.rect.x,min:0,max:1-O.rect.w,dragStep:.002,onCommit:_=>o.patchPip(e.sceneId,{x:_},`pip:${e.sceneId}:x`)}),d.jsx(It,{id:"pip-y",value:R.y??O.rect.y,min:0,max:1-O.rect.h,dragStep:.002,onCommit:_=>o.patchPip(e.sceneId,{y:_},`pip:${e.sceneId}:y`)})]}),t.pip?d.jsx("button",{"data-testid":"reset-pip",style:zt,onClick:()=>{Dt(),o.clearPip(e.sceneId)},children:"Reset bubble"}):null]})})():null,(()=>{var I;if(N)return null;const O=Ex(t,n),R=_=>F=>o.patchGraphicRect(e.sceneId,gl({...O,[_]:F},n),`box:${e.sceneId}:${_}`);return d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Graphic box"}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Frame fractions — or drag the handles on the stage."}),d.jsxs("div",{style:Ii,children:[d.jsx(It,{id:"box-x",value:O.x,min:0,max:1,dragStep:.002,onCommit:R("x")}),d.jsx(It,{id:"box-y",value:O.y,min:0,max:1,dragStep:.002,onCommit:R("y")})]}),d.jsxs("div",{style:Ii,children:[d.jsx(It,{id:"box-w",value:O.w,min:.08,max:1,dragStep:.002,onCommit:R("w")}),d.jsx(It,{id:"box-h",value:O.h,min:.05,max:1,dragStep:.002,onCommit:R("h")})]}),(I=o.doc.scenes[e.sceneId])!=null&&I.graphicRect?d.jsx("button",{"data-testid":"reset-box",style:zt,onClick:()=>{Dt(),o.clearGraphicRect(e.sceneId)},children:"Reset box"}):null]})})(),(()=>{const O=Hr(t.layout,void 0,[],n).captionAnchor,R=t.captionY??O,I=t.captionScale??1,_=o.doc.scenes[e.sceneId];return d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Captions"}),o.doc.captionsHidden===!0||f===!0?d.jsxs("div",{"data-testid":"captions-hidden-hint",style:{fontSize:12,color:"#FFE14D"},children:["Captions are hidden globally",f===!0?" (--no-captions)":" (Theme panel)"," — these settings are kept and apply when captions are shown again."]}):null,d.jsxs("div",{style:an,children:[d.jsxs("span",{style:Ae,children:["position"," ",d.jsx("span",{style:{color:"#EDEDF2"},children:R.toFixed(2)})]}),d.jsx("input",{type:"range","data-testid":"caption-y-slider",min:.05,max:.95,step:.01,value:R,onChange:F=>o.patchCaptionY(e.sceneId,Number(F.target.value),`captionY:${e.sceneId}`)})]}),d.jsxs("div",{style:an,children:[d.jsxs("span",{style:Ae,children:["scale"," ",d.jsxs("span",{style:{color:"#EDEDF2"},children:[I.toFixed(2),"×"]})]}),d.jsx("input",{type:"range","data-testid":"caption-scale-slider",min:.2,max:3,step:.01,value:I,onChange:F=>o.patchCaptionScale(e.sceneId,Number(F.target.value),`captionScale:${e.sceneId}`)})]}),d.jsx(It,{id:"caption-scale",value:I,min:.2,max:3,dragStep:.01,onCommit:F=>o.patchCaptionScale(e.sceneId,F,`captionScale:${e.sceneId}`)}),d.jsx("button",{"data-testid":"caption-y-all",style:{...zt,color:"#EDEDF2",border:"1px solid #2A2A33"},title:"Write this scene's caption position and scale to every scene — one undo step",onClick:()=>{Dt(),o.patchCaptionStyleAll(r,{y:R,scale:I})},children:"Apply to all scenes"}),(_==null?void 0:_.captionY)!==void 0||(_==null?void 0:_.captionScale)!==void 0?d.jsx("button",{"data-testid":"reset-caption-y",style:zt,onClick:()=>{Dt(),o.clearCaptionStyle(e.sceneId)},children:"Reset captions"}):null]})})(),d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Timing"}),d.jsxs("div",{"data-testid":"timing-range",style:{fontSize:13,fontFamily:"ui-monospace, 'SF Mono', monospace"},children:[t.startSec.toFixed(2),"s – ",t.endSec.toFixed(2),"s",d.jsxs("span",{style:{color:"#9A9AA3"},children:[" ","(",(t.endSec-t.startSec).toFixed(2),"s)"]})]}),d.jsx("div",{style:{fontSize:12,color:t.pinned?"#FFE14D":"#9A9AA3"},children:N?"Derived from the cut — not movable":t.pinned?"Pinned to these times":"Tracking transcript"}),!t.pinned&&a?d.jsxs("div",{style:{fontSize:12,color:"#9A9AA3",fontStyle:"italic"},children:["“",a,"”"]}):null,t.pinned?d.jsx("button",{style:zt,onClick:()=>{Dt(),o.clearTiming(e.sceneId)},children:"Un-pin (re-anchor to words)"}):null]}),N?null:d.jsx("div",{style:Ue,children:d.jsx("button",{"data-testid":"delete-scene",style:zt,onClick:()=>{Dt(),o.hideScene(e.sceneId)},children:"Delete scene"})}),H.length>0?d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Hidden elements"}),H.map(({id:O,owningSceneId:R})=>d.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[d.jsx("span",{style:{fontSize:13,fontFamily:"ui-monospace, monospace",color:"#C9C9D4"},children:O}),d.jsx("button",{"data-testid":`restore-element-${O}`,style:{...zt,color:"#5FBF77",border:"1px solid #24402c",padding:"4px 8px"},onClick:()=>{Dt(),o.restoreElement(R,O)},children:"Restore"})]},O))]}):null,d.jsxs("div",{style:Ue,children:[d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Removes this window from the output on the next produce/Render. Struck through here until then — the preview keeps playing it."}),d.jsx("button",{"data-testid":"cut-chunk",style:zt,onClick:()=>{Dt(),o.cutChunk(t.startSec,t.endSec)},children:"Delete this chunk"})]})]})}const p=o.doc.theme,m=(N,L)=>o.patchTheme({[N]:L}),h=N=>`${Math.floor(N/60)}:${String(Math.floor(N%60)).padStart(2,"0")}`,y=((P=u==null?void 0:u.usage)==null?void 0:P.totals)??null,g=((j=u==null?void 0:u.production)==null?void 0:j.producer)??null,E=((M=u==null?void 0:u.production)==null?void 0:M.clip)??null;return d.jsxs("div",{children:[d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Theme"}),d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Nothing selected — global tokens."})]}),d.jsxs("div",{style:Ue,children:[d.jsx(ha,{id:"accent",value:p.accent??s.accent,isColor:!0,onCommit:N=>m("accent",N)}),d.jsx(ha,{id:"bg",value:p.bg??s.bg,isColor:!0,onCommit:N=>m("bg",N)}),d.jsx(ha,{id:"fg",value:p.fg??s.fg,isColor:!0,onCommit:N=>m("fg",N)}),d.jsx(It,{id:"radiusPx",value:p.radiusPx??s.radiusPx,min:0,dragStep:.5,onCommit:N=>m("radiusPx",N)}),d.jsx(ha,{id:"fontDisplay",value:p.fontDisplay??s.fontDisplay,isColor:!1,onCommit:N=>m("fontDisplay",N)})]}),d.jsxs("div",{style:Ue,children:[d.jsx("span",{style:Ae,children:"Captions"}),d.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:"#EDEDF2",cursor:"pointer"},children:[d.jsx("input",{type:"checkbox","data-testid":"captions-visible-toggle",checked:o.doc.captionsHidden!==!0&&f!==!0,disabled:f===!0&&o.doc.captionsHidden!==!0,onChange:N=>o.setCaptionsHidden(!N.target.checked)}),"Show captions"]}),o.doc.captionsHidden===!0?d.jsx("div",{style:{fontSize:12,color:"#9A9AA3"},children:"Hidden everywhere — the CTA keyword styling rides the caption track, so it is hidden too. Per-scene caption position/scale edits are kept."}):null,f===!0?d.jsx("div",{"data-testid":"captions-flag-note",style:{fontSize:12,color:"#FFE14D"},children:"This project was produced with --no-captions, which Render replays — the toggle can't bring captions back here; re-run produce without the flag."}):null]}),g||y?d.jsxs("div",{style:Ue,"data-testid":"run-info",children:[d.jsx("span",{style:Ae,children:"This video"}),g?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["planned by ",d.jsx("span",{style:{color:"#EDEDF2"},children:g.provider}),g.models.length>0?` (${g.models.join(", ")})`:"",g.cached?" · reused from cache":"",g.at?` · ${new Date(g.at).toLocaleString()}`:""]}):null,y?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:[y.calls," LLM call",y.calls===1?"":"s"," ·"," ",y.inputTokens.toLocaleString()," in / ",y.outputTokens.toLocaleString()," out tokens",y.anyEstimated?" (partly estimated)":""]}):null,y&&y.equivalentUsd!==null?d.jsx("div",{style:{fontSize:12,color:"#C9C9D4"},children:y.allUnbilled?`~$${y.equivalentUsd.toFixed(2)} of API-rate work, covered by the subscription`:y.billedUsd!==null?`~$${y.billedUsd.toFixed(2)} charged at API rates`:`~$${y.equivalentUsd.toFixed(2)} at API rates`}):null,E?d.jsxs("div",{style:{fontSize:12,color:"#C9C9D4"},children:["clip: ",h(E.startSec),"–",h(E.endSec),(D=u==null?void 0:u.production)!=null&&D.sourceDuration?` of ${h(u.production.sourceDuration)}`:""," ","(--clip ",E.targetSec,")"]}):null]}):null,d.jsx("div",{style:Ue,children:d.jsx("div",{"data-testid":"ai-disclaimer",style:{fontSize:12,color:"#9A9AA3"},children:"AI can make mistakes. The cut, captions and graphics are generated — review them before publishing."})})]})},lc=1.2,yl=.05;function fM(e,t,n,r){return n<=0||r<=0?0:Math.min(1,Math.max(0,(e-t)/n))*r}const pM=16,mM=e=>Math.min(pM,Math.max(1,e));function hM(e,t,n,r,o){if(e<=0||n<=0)return 0;const s=(r+o)*(t/e),a=Math.max(0,t*n-n);return Math.min(a,Math.max(0,s-o))}const xp=e=>e.filter(t=>t.kind!=="plain");function gM(e,t,n,r){const o=xp(e),i=o.findIndex(h=>h.id===t),s=o[i];if(!s)return null;const a=s.endSec-s.startSec,l=i>0?o[i-1]:void 0,u=i<o.length-1?o[i+1]:void 0,f=l?l.endSec+yl:0,p=u?u.startSec-yl:r,m=Math.min(Math.max(s.startSec+n,f),Math.max(f,p-a));return{startSec:m,endSec:m+a}}function vM(e,t,n,r,o){const i=xp(e),s=i.findIndex(h=>h.id===t),a=s>0?i[s-1]:void 0,l=s>=0&&s<i.length-1?i[s+1]:void 0,u=a?a.endSec+yl:0,f=l?l.startSec-yl:o;let p=Math.min(Math.max(n,u),Math.max(u,f-lc)),m=Math.max(Math.min(r,f),p+lc);return m>f&&(m=f,p=Math.max(u,m-lc)),{startSec:p,endSec:m}}function mg(e,t,n,r){const o=[0,r,n];for(const a of xp(e))a.id!==t&&o.push(a.startSec,a.endSec);o.sort((a,l)=>a-l);const i=[];let s;for(const a of o)(s===void 0||a-s>1e-6)&&(i.push(a),s=a);return i}function ga(e,t,n){if(n<=0||t.length===0)return{sec:e,snapped:null};let r=null,o=1/0;for(const i of t){const s=Math.abs(e-i);(s<o||s===o&&r!==null&&i<r)&&(r=i,o=s)}return r===null||o>n?{sec:e,snapped:null}:{sec:r,snapped:r}}function yM(e,t){if(e.length===0)return 0;for(const r of e)if(t>=r.srcIn&&t<=r.srcOut)return r.outIn+(t-r.srcIn);let n=0;for(const r of e)if(r.srcOut<=t)n=r.outOut;else if(r.srcIn>=t)return r.outIn;return n}function uc(e,t){const n=Math.max(0,e);if(t<=0)return`${n.toFixed(1)}s`;const r=Math.floor(n),o=Math.floor(r/60),i=r%60,s=Math.floor((n-r)*t),a=String(Math.max(1,Math.ceil(t)-1)).length;return`${o}:${String(i).padStart(2,"0")}:${String(s).padStart(a,"0")}`}const wM=10,xM=4,hg=8,gg=8,bM=300,SM=e=>{const t=Math.max(0,Math.round(e));return`${Math.floor(t/60)}:${String(t%60).padStart(2,"0")}`},EM=(e,t)=>{const[n,r]=ne.useState({}),o=ne.useRef({}),i=t.map(s=>s.toFixed(1)).join(",");return ne.useEffect(()=>{if(!e||t.length===0)return;const s=[...new Set(t.map(p=>p.toFixed(1)))].filter(p=>o.current[p]===void 0);if(s.length===0)return;let a=!1;const l=document.createElement("video");l.src=e,l.muted=!0,l.preload="auto";const u=document.createElement("canvas");return(async()=>{await new Promise((m,h)=>{l.onloadedmetadata=()=>m(),l.onerror=()=>h(new Error("no video for thumbnails"))}),u.width=168,u.height=Math.max(1,Math.round(168*l.videoHeight/Math.max(1,l.videoWidth)));const p=u.getContext("2d");if(p){for(const m of s){if(a)return;await new Promise(h=>{l.onseeked=()=>h(),l.currentTime=Math.max(0,Number(m))}),p.drawImage(l,0,0,u.width,u.height),o.current[m]=u.toDataURL("image/jpeg",.6)}a||r({...o.current})}})().catch(()=>{}),()=>{a=!0,l.removeAttribute("src"),l.load()}},[e,i]),n},kM=({cues:e,ghosts:t,cuts:n=[],spans:r=[],durationSec:o,fps:i,playerRef:s,selection:a,onSelect:l,edits:u,videoSrc:f,toSourceSec:p})=>{const m=c.useRef(null),h=c.useRef(null),y=c.useRef(!1),g=c.useRef(null),[E,v]=c.useState(0),w=c.useRef(E);w.current=E;const[x,b]=c.useState(null),[S,C]=c.useState(1),k=ne.useMemo(()=>p?e.filter(R=>R.kind==="plain").map(R=>p((R.startSec+R.endSec)/2)):[],[e,p]),T=EM(f,k),P=c.useRef(null),j=c.useRef(null),M=c.useCallback((R,I)=>{const _=P.current;C(F=>{const z=mM(R);if(z===F||!_)return z;const B=_.getBoundingClientRect();return j.current={prevZoom:F,anchorX:I!==void 0?I-B.left:B.width/2},z})},[]);c.useLayoutEffect(()=>{const R=P.current,I=j.current;!R||!I||(j.current=null,R.scrollLeft=hM(I.prevZoom,S,R.clientWidth,R.scrollLeft,I.anchorX))},[S]);const D=c.useRef(S);D.current=S,c.useEffect(()=>{const R=P.current;if(!R)return;const I=_=>{_.ctrlKey||_.metaKey?(_.preventDefault(),M(D.current*Math.exp(-_.deltaY*.01),_.clientX)):R.scrollWidth>R.clientWidth&&(_.preventDefault(),R.scrollLeft+=_.deltaY+_.deltaX)};return R.addEventListener("wheel",I,{passive:!1}),()=>R.removeEventListener("wheel",I)},[M]),c.useEffect(()=>{const R=s.current;if(!R)return;v(R.getCurrentFrame());const I=_=>v(_.detail.frame);return R.addEventListener("frameupdate",I),()=>R.removeEventListener("frameupdate",I)},[s]),c.useEffect(()=>{const R=P.current;if(!R||o<=0||R.scrollWidth<=R.clientWidth)return;const I=E/i/o*R.scrollWidth,{scrollLeft:_,clientWidth:F}=R;(I<_||I>_+F)&&(R.scrollLeft=Math.max(0,Math.min(R.scrollWidth-F,I-F*.1)))},[E,i,o]),c.useEffect(()=>{var I,_;if(!a)return;const R=(I=P.current)==null?void 0:I.querySelector(`[data-testid="timeline-block-${a.sceneId}"]`);(_=R==null?void 0:R.scrollIntoView)==null||_.call(R,{inline:"nearest",block:"nearest"})},[a]);const N=c.useCallback(R=>{var F;const I=m.current;if(!I||o<=0)return;const _=I.getBoundingClientRect();(F=s.current)==null||F.seekTo(Math.round(fM(R,_.left,_.width,o)*i))},[s,o,i]),L=c.useCallback((R,I)=>_=>{_.stopPropagation(),_.preventDefault();const F=m.current;F&&(h.current={sceneId:R.id,edge:I,startContentX:_.clientX-F.getBoundingClientRect().left,origStart:R.startSec,origEnd:R.endSec},b({sceneId:R.id,startSec:R.startSec,endSec:R.endSec,snapped:null}))},[]),H=c.useRef(0);c.useEffect(()=>{const R=F=>{const z=P.current;if(!z||z.scrollWidth<=z.clientWidth)return;const B=Date.now();if(B-H.current<bM)return;const Y=z.getBoundingClientRect(),$=z.scrollWidth-z.clientWidth;F>=Y.right-gg&&z.scrollLeft<$?(z.scrollLeft=Math.min($,z.scrollLeft+z.clientWidth),H.current=B):F<=Y.left+gg&&z.scrollLeft>0&&(z.scrollLeft=Math.max(0,z.scrollLeft-z.clientWidth),H.current=B)},I=F=>{var ae;if((y.current||((ae=g.current)==null?void 0:ae.moved)===!0||h.current!==null)&&R(F.clientX),y.current){N(F.clientX);return}const B=g.current;if(B&&o>0){if(!B.moved&&Math.abs(F.clientX-B.startX)<xM)return;if(B.moved=!0,B.scrub){N(F.clientX);return}const te=m.current,J=te==null?void 0:te.getBoundingClientRect(),Q=J?(F.clientX-J.left-B.startContentX)/J.width*o:0;let G=Q,fe=null;const Ee=J&&J.width>0&&!F.altKey?e.find(Fe=>Fe.id===B.sceneId):void 0;if(Ee&&J){const Fe=hg/(J.width/o),Ie=mg(e,B.sceneId,w.current/i,o),he=Ee.startSec+Q,we=Ee.endSec+Q,_e=ga(he,Ie,Fe),ge=ga(we,Ie,Fe),ke=_e.snapped===null?1/0:Math.abs(_e.sec-he),ft=ge.snapped===null?1/0:Math.abs(ge.sec-we);ke<=ft&&_e.snapped!==null?(G=Q+(_e.sec-he),fe=_e.snapped):ge.snapped!==null&&(G=Q+(ge.sec-we),fe=ge.snapped)}const $e=gM(e,B.sceneId,G,o);if($e){const Fe=fe!==null&&(Math.abs($e.startSec-fe)<1e-6||Math.abs($e.endSec-fe)<1e-6)?fe:null;b({sceneId:B.sceneId,...$e,snapped:Fe})}return}const Y=h.current;if(!Y||o<=0)return;const $=m.current;if(!$)return;const A=$.getBoundingClientRect(),X=(F.clientX-A.left-Y.startContentX)/A.width*o;let Z=Y.edge==="start"?Y.origStart+X:Y.origStart,V=Y.edge==="end"?Y.origEnd+X:Y.origEnd,U=null;if(!F.altKey&&A.width>0){const te=hg/(A.width/o),J=mg(e,Y.sceneId,w.current/i,o);if(Y.edge==="start"){const Q=ga(Z,J,te);Z=Q.sec,U=Q.snapped}else{const Q=ga(V,J,te);V=Q.sec,U=Q.snapped}}const se=vM(e,Y.sceneId,Z,V,o),de=U!==null&&(Math.abs(se.startSec-U)<1e-6||Math.abs(se.endSec-U)<1e-6)?U:null;b({sceneId:Y.sceneId,...se,snapped:de})},_=F=>{y.current=!1;const z=g.current;if(z){g.current=null,z.moved&&!z.scrub&&b(Y=>(Y&&Y.sceneId===z.sceneId&&u.patchTiming(z.sceneId,Y.startSec,Y.endSec),null));return}const B=h.current;B&&(b(Y=>(Y&&Y.sceneId===B.sceneId&&(Y.startSec!==B.origStart||Y.endSec!==B.origEnd)&&u.patchTiming(B.sceneId,Y.startSec,Y.endSec),null)),h.current=null)};return window.addEventListener("mousemove",I),window.addEventListener("mouseup",_),()=>{window.removeEventListener("mousemove",I),window.removeEventListener("mouseup",_)}},[e,o,u,N,i]);const O=o>0?Math.min(1,E/i/o)*100:0;return d.jsxs("div",{style:CM,onMouseDownCapture:Wx,children:[d.jsxs("div",{style:IM,children:[d.jsx("span",{style:RM,children:"ctrl+scroll to zoom"}),d.jsx("button",{"data-testid":"zoom-out",style:cc,onClick:()=>M(S/2),disabled:S<=1,title:"Zoom out (ctrl/cmd + scroll on the timeline)",children:"−"}),d.jsxs("span",{"data-testid":"zoom-level",style:TM,children:[Math.round(S*10)/10,"×"]}),d.jsx("button",{"data-testid":"zoom-in",style:cc,onClick:()=>M(S*2),disabled:S>=16,title:"Zoom in (ctrl/cmd + scroll on the timeline)",children:"+"}),d.jsx("button",{"data-testid":"zoom-fit",style:{...cc,width:"auto",padding:"0 8px"},onClick:()=>M(1),disabled:S<=1,title:"Fit the whole clip in view",children:"fit"})]}),d.jsx("div",{ref:P,"data-testid":"timeline-scroller",style:_M,children:d.jsxs("div",{style:{width:`${S*100}%`,minWidth:"100%",paddingBottom:6},children:[d.jsx("div",{"data-testid":"ruler",style:PM,onMouseDown:R=>{R.preventDefault(),N(R.clientX),y.current=!0},children:(()=>{var Y;if(o<=0)return d.jsx("span",{style:dc,children:"0:00"});const I=(((Y=P.current)==null?void 0:Y.clientWidth)??1200)*S/o;let F=[.5,1,2,5,10,15,30,60,120,300,600].find($=>$*I>=70)??600;for(;o/(F/5)>600;)F*=2;const z=F/5,B=[];for(let $=0;$<=o+1e-6;$+=z){const A=Math.round($/z)%5===0,X=`${$/o*100}%`;B.push(d.jsx("div",{style:{position:"absolute",left:X,bottom:0,width:1,height:A?8:4,background:A?"#3A3A44":"#26262e",pointerEvents:"none"}},$.toFixed(3))),A&&$+z<=o&&B.push(d.jsx("span",{style:{...dc,position:"absolute",left:X,top:0,transform:$===0?void 0:"translateX(-50%)",pointerEvents:"none"},children:SM($)},`l${$.toFixed(3)}`))}return d.jsxs(d.Fragment,{children:[B,d.jsx("span",{style:{...dc,position:"absolute",right:2,top:0,pointerEvents:"none"},children:uc(o,i)})]})})()}),d.jsxs("div",{ref:m,style:FM,onMouseDown:R=>{R.preventDefault(),N(R.clientX),y.current=!0},children:[e.map(R=>{const I=R.kind==="plain",_=(x==null?void 0:x.sceneId)===R.id,F=_?x.startSec:R.startSec,z=_?x.endSec:R.endSec,B=o>0?F/o*100:0,Y=o>0?Math.max(0,(z-F)/o*100):0,$=(a==null?void 0:a.sceneId)===R.id,A=I&&p?T[p((R.startSec+R.endSec)/2).toFixed(1)]:void 0;return d.jsxs("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:X=>{var Z;X.stopPropagation(),X.preventDefault(),l({sceneId:R.id,elementId:null}),g.current={sceneId:R.id,startX:X.clientX,startContentX:X.clientX-(((Z=m.current)==null?void 0:Z.getBoundingClientRect().left)??0),moved:!1,scrub:I}},style:{...vg,left:`${B}%`,width:`${Y}%`,zIndex:_?4:$?3:1,border:$?"2px solid #5b8cff":I?"1px solid #22222a":"1px solid #2A2A33",backgroundColor:$?"#1c2333":I?"#131318":"#1A1A21",...A?{backgroundImage:`linear-gradient(rgba(10,10,14,0.35), rgba(10,10,14,0.6)), url(${A})`,backgroundSize:"auto 100%, auto 100%",backgroundRepeat:"repeat-x"}:{}},children:[d.jsx("span",{style:I?A?{...va,color:"#D8D8DE",textShadow:"0 1px 2px rgba(0,0,0,0.9)"}:{...va,color:"#55555f"}:va,children:R.id}),!I&&R.pinned?d.jsx("span",{style:jM,children:"PIN"}):null,I?null:d.jsxs(d.Fragment,{children:[d.jsx("div",{onMouseDown:L(R,"start"),style:{...yg,left:0,cursor:"ew-resize"}}),d.jsx("div",{onMouseDown:L(R,"end"),style:{...yg,right:0,cursor:"ew-resize"}})]})]},R.id)}),t.map(R=>{const I=o>0?R.startSec/o*100:0,_=o>0?Math.max(0,(R.endSec-R.startSec)/o*100):0,F=(a==null?void 0:a.sceneId)===R.id;return d.jsx("div",{"data-testid":`timeline-block-${R.id}`,onMouseDown:z=>{z.stopPropagation(),z.preventDefault(),l({sceneId:R.id,elementId:null})},style:{...vg,left:`${I}%`,width:`${_}%`,zIndex:F?3:2,border:F?"2px dashed #5b8cff":"1px dashed #6a6a75",background:"transparent"},children:d.jsx("span",{style:{...va,color:"#6a6a75",textDecoration:"line-through"},children:R.id})},`ghost-${R.id}`)}),n.map((R,I)=>{const _=z=>o>0?Math.min(100,Math.max(0,z/o*100)):0;if(!R.src){const z=Math.min(Math.max(R.startSec,0),o),B=Math.min(Math.max(R.endSec,0),o),Y=_(z),$=o>0?Math.max(0,(B-z)/o*100):0;return d.jsx("div",{"data-testid":`timeline-cut-${R.startSec}-${R.endSec}`,style:{...MM,left:`${Y}%`,width:`${$}%`},children:d.jsx("div",{style:$M})},`cut-${I}-${R.startSec}-${R.endSec}`)}if(r.length===0)return null;const F=_(yM(r,R.src.startSec));return d.jsx("div",{"data-testid":`timeline-cut-seam-${R.startSec}-${R.endSec}`,title:"Restore cut — the material returns on the next produce/Render",onMouseDown:z=>{z.stopPropagation(),z.preventDefault(),u.restoreChunk(I)},style:{...AM,left:`${F}%`},children:d.jsx("div",{style:NM})},`cut-${I}-${R.startSec}-${R.endSec}`)}),x?d.jsxs("div",{"data-testid":"drag-readout",style:{...wg,left:`${o>0?x.startSec/o*100:0}%`,transform:o>0&&x.startSec/o>.85?"translateX(-100%)":wg.transform},children:[uc(x.startSec,i)," – ",uc(x.endSec,i)]}):null,(x==null?void 0:x.snapped)!==null&&(x==null?void 0:x.snapped)!==void 0?d.jsx("div",{"data-testid":"snap-tick",style:{...LM,left:`${o>0?x.snapped/o*100:0}%`}}):null,d.jsx("div",{"data-testid":"playhead",style:{...zM,left:`${O}%`},children:d.jsx("div",{"data-testid":"playhead-grab",onMouseDown:R=>{R.stopPropagation(),R.preventDefault(),y.current=!0},style:DM})})]})]})})]})},CM={flexShrink:0,borderTop:"1px solid #1E1E24",background:"#111116",padding:"6px 20px 8px"},IM={display:"flex",justifyContent:"flex-end",alignItems:"center",gap:6,marginBottom:4},cc={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},TM={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:26,textAlign:"center"},RM={fontSize:10,color:"#55555f",marginRight:4,userSelect:"none"},_M={overflowX:"auto",overflowY:"hidden"},PM={position:"relative",height:18,padding:"0 2px",marginBottom:4,borderBottom:"1px solid #1E1E24",cursor:"ew-resize",userSelect:"none"},dc={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3"},FM={position:"relative",height:44,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,overflow:"visible",userSelect:"none"},vg={position:"absolute",top:3,bottom:3,borderRadius:4,boxSizing:"border-box",cursor:"pointer",display:"flex",alignItems:"center",overflow:"hidden"},va={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",textTransform:"uppercase",letterSpacing:"0.04em",color:"#9A9AA3",padding:"0 8px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},jM={position:"absolute",top:3,right:3,fontSize:9,fontFamily:"ui-monospace, 'SF Mono', monospace",letterSpacing:"0.04em",textTransform:"uppercase",color:"#0B0B0E",background:"#ffe14d",padding:"1px 5px",borderRadius:3,pointerEvents:"none"},MM={position:"absolute",top:3,bottom:3,zIndex:3,pointerEvents:"none",borderRadius:4,border:"1px solid rgba(255,92,92,0.6)",background:"repeating-linear-gradient(135deg, rgba(255,92,92,0.22), rgba(255,92,92,0.22) 6px, transparent 6px, transparent 12px)"},$M={position:"absolute",left:0,right:0,top:"50%",height:2,background:"rgba(255,92,92,0.8)"},AM={position:"absolute",top:-4,bottom:-4,width:12,marginLeft:-6,zIndex:4,cursor:"pointer",pointerEvents:"auto"},NM={position:"absolute",left:"50%",top:0,bottom:0,width:2,background:"#FF5C5C",pointerEvents:"none"},yg={position:"absolute",top:0,bottom:0,width:wM},LM={position:"absolute",top:-4,bottom:-4,width:1,zIndex:6,background:"#FFE14D",pointerEvents:"none"},wg={position:"absolute",bottom:"100%",marginBottom:3,transform:"translateX(-4px)",whiteSpace:"nowrap",fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#0B0B0E",background:"#FFE14D",padding:"1px 5px",borderRadius:3,zIndex:6,pointerEvents:"none"},zM={position:"absolute",top:-26,bottom:-4,width:2,zIndex:5,background:"#FFE14D",pointerEvents:"none"},DM={position:"absolute",top:0,bottom:0,left:-4,width:10,pointerEvents:"auto",cursor:"ew-resize"},OM=({baseLines:e,liveLines:t,fps:n,playerRef:r,edits:o,width:i})=>{const[s,a]=c.useState(""),[l,u]=c.useState(null),[f,p]=c.useState(null),m=c.useRef(null),h=c.useMemo(()=>{var P;const k=[];let T=0;for(let j=0;j<t.length;j++){const M=t[j],D=e[j];for(let N=0;N<M.words.length;N++){const L=M.words[N];k.push({index:T,base:((P=D==null?void 0:D.words[N])==null?void 0:P.text)??L.text,live:L.text,start:L.start,end:L.end,lineStart:M.start,word:L}),T++}}return k},[e,t]);c.useEffect(()=>{const k=r.current;if(!k)return;const T=P=>{const j=P.detail.frame/n,M=h.find(D=>j>=D.start&&j<D.end);p(D=>M?M.index===D?D:M.index:D)};return k.addEventListener("frameupdate",T),()=>k.removeEventListener("frameupdate",T)},[r,n,h]),c.useEffect(()=>{var k,T,P;f!==null&&((P=(T=(k=m.current)==null?void 0:k.querySelector(`[data-testid="transcript-word-${f}"]`))==null?void 0:T.scrollIntoView)==null||P.call(T,{block:"nearest"}))},[f]);const y=s.trim().toLowerCase(),g=c.useMemo(()=>y?h.filter(k=>k.live.toLowerCase().includes(y)).map(k=>k.index):[],[y,h]),E=c.useMemo(()=>y?new Set(g):null,[y,g]),[v,w]=c.useState(0),x=k=>{var T,P,j;(j=(P=(T=m.current)==null?void 0:T.querySelector(`[data-testid="transcript-word-${k}"]`))==null?void 0:P.scrollIntoView)==null||j.call(P,{block:"center"})};c.useEffect(()=>{w(0),g.length>0&&x(g[0])},[g]);const b=k=>{if(g.length===0)return;const T=(v+k+g.length)%g.length;w(T),x(g[T])},S=k=>{const T=k.draft.trim();T&&o.patchCaption(k.srcStart,T,k.base),u(null)},C=k=>{Fs(k.word)!==null&&u({index:k.index,draft:k.live,srcStart:k.word.srcStart,base:k.base})};return d.jsxs("div",{"data-testid":"transcript-panel",style:{...VM,width:i},children:[d.jsxs("div",{style:BM,children:[d.jsx("span",{style:WM,children:"Transcript"}),d.jsx("div",{style:HM,children:"Click a word to jump the preview there; double-click to retype it. 1:1 retype only — word count and timing stay fixed, so scene anchors and the caption highlight keep working."}),d.jsxs("div",{style:{display:"flex",gap:6,alignItems:"center"},children:[d.jsx("input",{"data-testid":"transcript-search",style:{...UM,flex:1},placeholder:"Find a word…",value:s,onChange:k=>a(k.target.value),onKeyDown:k=>{k.key==="Enter"&&(k.preventDefault(),b(k.shiftKey?-1:1))}}),d.jsx("button",{"data-testid":"transcript-prev",style:xg,onClick:()=>b(-1),disabled:g.length===0,title:"Previous match (⇧Enter)","aria-label":"Previous match",children:"‹"}),d.jsx("button",{"data-testid":"transcript-next",style:xg,onClick:()=>b(1),disabled:g.length===0,title:"Next match (Enter)","aria-label":"Next match",children:"›"})]}),E?d.jsx("div",{"data-testid":"transcript-match-count",style:{fontSize:11,color:"#9A9AA3"},children:g.length===0?"0 matches":`${v+1}/${g.length} match${g.length===1?"":"es"}`}):null]}),d.jsx("div",{style:ZM,"data-testid":"transcript-body",ref:m,children:h.map((k,T)=>d.jsxs(ne.Fragment,{children:[T>0?" ":null,(l==null?void 0:l.index)===k.index?d.jsx("input",{autoFocus:!0,"data-testid":"transcript-edit",style:QM,value:l.draft,onChange:P=>u({...l,draft:P.target.value}),onBlur:()=>S(l),onKeyDown:P=>{P.key==="Enter"&&P.target.blur(),P.key==="Escape"&&u(null)}}):d.jsx("span",{"data-testid":`transcript-word-${k.index}`,onClick:()=>{var P;return(P=r.current)==null?void 0:P.seekTo(Math.round(k.start*n))},onDoubleClick:()=>C(k),title:k.live!==k.base?`edited (was “${k.base}”) — double-click to retype`:"click to jump · double-click to retype",style:{...YM,...E!=null&&E.has(k.index)?KM:{},...g[v]===k.index?XM:{},...k.live!==k.base?GM:{},...f===k.index?qM:{}},children:k.live})]},k.index))})]})},VM={flexShrink:0,display:"flex",flexDirection:"column",background:"#111116",minHeight:0},BM={display:"flex",flexDirection:"column",gap:8,padding:"14px 14px 10px",borderBottom:"1px solid #1E1E24"},WM={fontSize:11,fontWeight:600,letterSpacing:"0.06em",textTransform:"uppercase",color:"#9A9AA3"},HM={fontSize:11,lineHeight:1.45,color:"#6a6a75"},UM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,background:"#0F0F14",border:"1px solid #2A2A33",borderRadius:6,color:"#fff",padding:"6px 8px"},ZM={flex:1,overflowY:"auto",overflowX:"hidden",overflowWrap:"break-word",padding:"10px 14px 16px",fontSize:13,lineHeight:2,color:"#C9C9D4"},YM={cursor:"pointer",borderRadius:3,padding:"1px 2px"},KM={background:"#2b2b1a",outline:"1px solid #6b6432"},XM={background:"#3d3a17",outline:"2px solid #FFE14D",color:"#fff"},xg={width:26,height:30,fontSize:16,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,cursor:"pointer",padding:0},GM={color:"#FFE14D"},qM={background:"#1c2333",outline:"1px solid #5b8cff"},QM={fontFamily:"'Inter', system-ui, sans-serif",fontSize:13,width:110,background:"#0F0F14",border:"1px solid #FFE14D",borderRadius:4,color:"#fff",padding:"1px 4px"},JM=[{title:"transport",rows:[["space","play / pause"],["J / K / L","reverse · pause · forward (tap again to speed up)"],["← / →","step one frame back / forward"],["⌘/ctrl + ← / →","jump to and select the previous / next scene"]]},{title:"selection",rows:[["click","select scene or element"],["⌥ + ← / →","select previous / next scene"],["esc","clear selection · close dialogs"]]},{title:"editing",rows:[["⌘/ctrl + B","split the scene at the playhead"],["delete / backspace","delete the selected scene — asks graphic or whole take (§139)"],["enter (in that dialog)","confirm the highlighted option"],["⌘/ctrl + Z","undo"],["⌘/ctrl + ⇧ + Z","redo (⌘Y works too)"],["⌘/ctrl + S","save"],["double-click caption word","retype it in place"],["drag element / corner handles","move · resize"],["drag picture","pan the video framing"],["drag a scene block / edge on the timeline","snaps to scene edges + the playhead (hold ⌥ while dragging to disable)"],["drag a box on the stage","snaps to centre / safe-area guides (hold ⌥ mid-drag to disable)"]]},{title:"view",rows:[["⌘/ctrl + scroll on preview","zoom the view (never edits)"],["⌥-drag / middle-drag","pan the zoomed view"],["⌘/ctrl + scroll on timeline","zoom the timeline"],["?","this reference"]]}],e$=({onClose:e})=>(c.useEffect(()=>{const t=n=>{n.key==="Escape"&&(n.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),d.jsx("div",{style:t$,onMouseDown:e,children:d.jsxs("div",{"data-testid":"shortcuts-modal",style:n$,onMouseDown:t=>t.stopPropagation(),children:[d.jsxs("div",{style:r$,children:[d.jsx("span",{style:o$,children:"keybinds"}),d.jsx("span",{style:i$,children:"esc close"})]}),d.jsx("div",{style:s$,children:"available commands and configured shortcuts"}),JM.map(t=>d.jsxs("div",{style:{marginTop:18},children:[d.jsx("div",{style:a$,children:t.title}),t.rows.map(([n,r])=>d.jsxs("div",{style:l$,children:[d.jsx("span",{style:u$,children:n}),d.jsx("span",{style:c$,children:r})]},n))]},t.title))]})})),t$={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},n$={width:620,maxWidth:"90vw",maxHeight:"82vh",overflowY:"auto",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},r$={display:"flex",justifyContent:"space-between",alignItems:"center"},o$={fontSize:18,fontWeight:700,color:"#EDEDF2"},i$={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px"},s$={fontSize:13,color:"#6a6a75",marginTop:4},a$={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},l$={display:"flex",gap:16,padding:"3px 0"},u$={width:290,flexShrink:0,color:"#c5a3ff",fontWeight:600,fontSize:13},c$={color:"#C9C9D4",fontSize:13},bg={graphic:{label:"just the graphic",detail:e=>e.isSplitHalf?"this half only — the take underneath keeps playing":"the take underneath keeps playing"},take:{label:"the whole take",detail:e=>`cuts ${(e.endSec-e.startSec).toFixed(1)}s out of the video`}},d$=({plan:e,onConfirm:t,onCancel:n})=>{const[r,o]=c.useState(e.targets[0]),i=c.useRef(null),s=c.useRef(null);return c.useEffect(()=>{const a=l=>{if(l.key==="Escape"){l.stopPropagation(),n();return}if(l.key!=="Tab")return;const u=i.current;if(!u)return;const f=u.querySelectorAll("input, button"),p=f[0],m=f[f.length-1];!p||!m||(l.shiftKey&&document.activeElement===p?(l.preventDefault(),m.focus()):!l.shiftKey&&document.activeElement===m&&(l.preventDefault(),p.focus()))};return window.addEventListener("keydown",a,!0),()=>window.removeEventListener("keydown",a,!0)},[n]),c.useEffect(()=>{var l;const a=document.activeElement;return(l=s.current)==null||l.focus(),()=>{var u;return(u=a==null?void 0:a.focus)==null?void 0:u.call(a)}},[]),d.jsx("div",{style:f$,onMouseDown:n,children:d.jsxs("form",{ref:i,"data-testid":"delete-scene-modal",role:"dialog","aria-modal":"true","aria-label":`Delete ${e.rootId}`,style:p$,onMouseDown:a=>a.stopPropagation(),onSubmit:a=>{a.preventDefault(),t(r)},children:[d.jsxs("div",{style:m$,children:[d.jsxs("span",{style:h$,children:["delete ",e.rootId,e.isSplitHalf?d.jsx("span",{style:g$,children:"half"}):null,"?"]}),d.jsx("span",{style:v$,children:"esc cancel"})]}),d.jsx("div",{style:y$,children:"undoable with ⌘Z, like every other edit"}),d.jsx("div",{style:{marginTop:16},children:e.targets.map(a=>d.jsxs("label",{style:w$,"data-testid":`delete-option-${a}`,children:[d.jsx("input",{type:"radio",name:"delete-target",value:a,checked:r===a,onChange:()=>o(a),style:x$}),d.jsxs("span",{children:[d.jsx("span",{style:b$,children:bg[a].label}),d.jsx("span",{style:S$,children:bg[a].detail(e)})]})]},a))}),d.jsxs("div",{style:E$,children:[d.jsx("button",{type:"button","data-testid":"delete-cancel",style:Hx,onClick:n,children:"Cancel"}),d.jsx("button",{ref:s,type:"submit","data-testid":"delete-confirm",style:k$,children:"Delete"})]})]})})},f$={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},p$={width:420,maxWidth:"90vw",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"18px 22px 20px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},m$={display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},h$={fontSize:16,fontWeight:700,color:"#EDEDF2"},g$={fontSize:11,fontWeight:700,color:"#0B0B0E",background:"#c5a3ff",borderRadius:4,padding:"2px 6px",marginLeft:6},v$={fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",borderRadius:4,padding:"3px 10px",whiteSpace:"nowrap"},y$={fontSize:12,color:"#6a6a75",marginTop:4},w$={display:"flex",alignItems:"flex-start",gap:10,padding:"8px 0",cursor:"pointer"},x$={accentColor:"#8ab4f8",marginTop:2,cursor:"pointer"},b$={display:"block",fontSize:13,fontWeight:600,color:"#EDEDF2"},S$={display:"block",fontSize:12,color:"#9A9AA3",marginTop:2},E$={display:"flex",justifyContent:"flex-end",gap:8,marginTop:14},Hx={fontSize:12,fontWeight:600,color:"#C9C9D4",background:"transparent",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer",fontFamily:"inherit"},k$={...Hx,color:"#FF5C5C",border:"1px solid #452626"},C$=(e,t=3)=>{const n=e.split("/");if(n.length<=t)return{head:"",tail:e};const r=n.length-t;return{head:n.slice(0,r).join("/")||"/",tail:n.slice(r).join("/")}},Sg=e=>e.scrollTop+e.clientHeight<e.scrollHeight-1,I$=(e,t,n)=>n<=0?-1:Math.max(0,Math.min(n-1,e+t)),Eg=({recent:e,required:t,onOpen:n,onClose:r})=>{const[o,i]=c.useState(null),[s,a]=c.useState(null),[l,u]=c.useState(!1),f=c.useRef(null),p=c.useRef(null),[m,h]=c.useState(!1),[y,g]=c.useState(!1),E=()=>{h(f.current?Sg(f.current):!1)},v=()=>{g(p.current?Sg(p.current):!1)},w=async S=>{try{const C=await fetch(`/api/fs${S?`?dir=${encodeURIComponent(S)}`:""}`),k=await C.json();if(!C.ok)throw new Error(k.error??`listing failed: ${C.status}`);i(k)}catch(C){a(C instanceof Error?C.message:String(C))}};c.useEffect(()=>{w()},[]),c.useEffect(()=>{const S=()=>{E(),v()};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[o,e]),c.useEffect(()=>{if(t)return;const S=C=>{C.key==="Escape"&&(C.stopPropagation(),r())};return window.addEventListener("keydown",S,!0),()=>window.removeEventListener("keydown",S,!0)},[t,r]);const x=S=>{var j;const C=S.key==="ArrowDown"?1:S.key==="ArrowUp"?-1:0;if(C===0&&S.key!=="Home"&&S.key!=="End")return;const k=Array.from(S.currentTarget.querySelectorAll("button"));if(k.length===0)return;const T=k.indexOf(document.activeElement),P=S.key==="Home"?0:S.key==="End"?k.length-1:I$(T,C,k.length);S.preventDefault(),(j=k[P])==null||j.focus()},b=S=>{u(!0),a(null),n(S).then(C=>{u(!1),C&&a(C)})};return d.jsx("div",{style:T$,onMouseDown:t?void 0:r,children:d.jsxs("div",{"data-testid":"project-picker",style:R$,onMouseDown:S=>S.stopPropagation(),children:[d.jsxs("div",{style:_$,children:[d.jsx("span",{style:P$,children:t?"open a project":"switch project"}),t?null:d.jsx("button",{"data-testid":"project-picker-close",style:F$,onClick:r,children:"esc close"})]}),d.jsx("div",{style:j$,children:"A project is a work directory a `ossclip produce` run wrote — the folder holding render-props.json."}),s?d.jsx("div",{"data-testid":"project-picker-error",style:M$,children:s}):null,e.length>0?d.jsxs("div",{style:{marginTop:16,flexShrink:0},children:[d.jsx("div",{style:kg,children:"recent"}),d.jsx("div",{ref:p,className:"ossclip-scroll-list",style:y?{...Cg,...Tg}:Cg,onScroll:v,onKeyDown:x,"data-testid":"project-recent-list",children:e.map(S=>{const{head:C,tail:k}=C$(S);return d.jsxs("button",{"data-testid":"project-recent",className:"ossclip-picker-row",style:{...fc,...z$},disabled:l,onClick:()=>b(S),title:S,children:[d.jsx("span",{style:{color:"#FFE14D",flexShrink:0},children:"▸"}),d.jsxs("span",{style:D$,children:[d.jsx("span",{style:O$,children:k}),C?d.jsx("span",{style:V$,children:C}):null]})]},S)})})]}):null,d.jsxs("div",{style:L$,children:[d.jsx("div",{style:kg,children:"browse"}),d.jsxs("div",{style:{color:"#6a6a75",fontSize:12,marginBottom:6},children:["Folders only — hidden ones are omitted, and any projects produced inside a folder show up directly as ",d.jsx("span",{style:{color:"#FFE14D"},children:"▸ .ossclip/…"})," entries."]}),o?d.jsxs(d.Fragment,{children:[d.jsxs("div",{style:$$,children:[d.jsx("span",{style:A$,title:o.dir,children:o.dir}),o.isWorkdir?d.jsx("button",{"data-testid":"project-open-current",style:N$,disabled:l,onClick:()=>b(o.dir),children:"open this project"}):null]}),d.jsxs("div",{ref:f,className:"ossclip-scroll-list",style:m?{...Ig,...Tg}:Ig,onScroll:E,onKeyDown:x,"data-testid":"project-fs-list",children:[o.parent?d.jsxs("button",{"data-testid":"project-fs-up",className:"ossclip-picker-row",style:fc,disabled:l,onClick:()=>void w(o.parent),children:[d.jsx("span",{style:{color:"#6a6a75",flexShrink:0},children:"↑"}),d.jsx("span",{style:Rg,children:".."})]}):null,o.entries.map(S=>d.jsxs("button",{"data-testid":S.isWorkdir?"project-fs-workdir":"project-fs-dir",className:`ossclip-picker-row${S.isWorkdir?" is-workdir":""}`,style:fc,disabled:l,onClick:()=>S.isWorkdir?b(S.path):void w(S.path),title:S.path,children:[d.jsx("span",{style:{flexShrink:0,color:S.isWorkdir?"#FFE14D":"#6a6a75"},children:S.isWorkdir?"▸":"▪"}),d.jsxs("span",{style:Rg,children:[S.name,S.isWorkdir?null:d.jsx("span",{style:{color:"#55555f"},children:"/"})]}),S.isWorkdir?d.jsx("span",{style:B$,children:"project"}):null]},S.path)),o.entries.length===0?d.jsx("div",{style:{color:"#6a6a75",fontSize:12,padding:"6px 8px"},children:"no folders here"}):null]})]}):d.jsx("div",{style:{color:"#6a6a75",fontSize:13},children:"loading…"})]})]})})},T$={position:"fixed",inset:0,zIndex:30,background:"rgba(5,5,8,0.6)",display:"flex",alignItems:"center",justifyContent:"center"},R$={width:620,maxWidth:"90vw",maxHeight:"82vh",boxSizing:"border-box",display:"flex",flexDirection:"column",background:"#12121A",border:"1px solid #3A3A48",borderRadius:8,padding:"20px 26px 26px",fontFamily:"ui-monospace, 'SF Mono', Consolas, monospace"},_$={display:"flex",justifyContent:"space-between",alignItems:"center"},P$={fontSize:18,fontWeight:700,color:"#EDEDF2"},F$={fontSize:13,fontWeight:700,color:"#0B0B0E",background:"#a8c7fa",border:"none",borderRadius:4,padding:"3px 10px",cursor:"pointer"},j$={fontSize:13,color:"#6a6a75",marginTop:4},M$={marginTop:12,fontSize:13,color:"#FF5C5C"},kg={fontSize:14,fontWeight:700,color:"#8ab4f8",marginBottom:6},$$={display:"flex",alignItems:"center",gap:10,marginBottom:6},A$={fontSize:12,color:"#9A9AA3",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},N$={flexShrink:0,fontSize:12,fontWeight:700,color:"#0B0B0E",background:"#FFE14D",border:"1px solid #FFE14D",borderRadius:6,padding:"4px 10px",cursor:"pointer"},L$={marginTop:16,display:"flex",flexDirection:"column",flex:1,minHeight:0},Cg={maxHeight:218,overflowY:"auto",overscrollBehavior:"contain",flexShrink:0,display:"flex",flexDirection:"column",gap:2},Ig={flex:1,minHeight:0,overflowY:"auto",overscrollBehavior:"contain",display:"flex",flexDirection:"column",gap:2},Tg={maskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black calc(100% - 24px), transparent 100%)"},fc={flexShrink:0,minHeight:34,display:"flex",alignItems:"center",gap:8,width:"100%",boxSizing:"border-box",textAlign:"left",fontFamily:"inherit",fontSize:13,lineHeight:1.4,borderRadius:6,padding:"6px 10px",cursor:"pointer",overflow:"hidden"},Rg={overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},z$={minHeight:46,alignItems:"center"},D$={display:"flex",flexDirection:"column",minWidth:0},O$={color:"#EDEDF2",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},V$={fontSize:11,color:"#6a6a75",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},B$={marginLeft:10,fontSize:11,fontWeight:700,color:"#FFE14D"};function ya(e){for(let t=e.length-1;t>=0;t--){const n=/^\s*(\d{1,3})%\s*$/.exec(e[t]);if(n)return Math.min(100,Number(n[1]))}return null}function W$(e){const t=n=>{for(let r=e.length-1;r>=0;r--)if(n.test(e[r]))return e[r]};return[t(/^▸ producing scenes/),t(/^▸ llm:/)].filter(n=>n!==void 0)}function H$(e,t){const n=Math.max(0,Math.floor((t-e)/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function U$(e,t){return e?{load:e,notifyDiscard:t}:{load:null,notifyDiscard:!1}}function Z$(e){if(e.dirty){if(e.renderRunning){e.onBlocked();return}e.save().catch(t=>e.onSaveError(t instanceof Error?t.message:String(t)))}}function Y$(e,t){const{cues:n}=jd(e,t);return gp(n,t.splits).filter(o=>{var i;return((i=t.scenes[o.id])==null?void 0:i.hidden)===!0})}const _g=e=>({...e,...q4(e)}),Pg=e=>{const t=Ox(e);e.forEach((n,r)=>{console.warn(`ossclip §137: dropped caption edit ${JSON.stringify(n)} — ${t[r]}`)})},K$=()=>{const e=X4(),t=c.useRef(e.dirty);t.current=e.dirty;const[n,r]=c.useState(!1),[o,i]=c.useState(!1),[s,a]=c.useState([]),[l,u]=c.useState([]),f=c.useRef(e.doc.captions);f.current=e.doc.captions;const[p,m]=c.useState(null),[h,y]=c.useState(null),[g,E]=c.useState(null),[v,w]=c.useState(null),[x,b]=c.useState(null),[S,C]=c.useState(!1),[k,T]=c.useState(1),[P,j]=c.useState(null),[M,D]=c.useState(!1),[N,L]=c.useState([]),[H,O]=c.useState(null),[R,I]=c.useState(!1),[_,F]=c.useState(null),z=c.useRef(null);c.useEffect(()=>()=>{z.current!==null&&window.clearInterval(z.current)},[]);const[B,Y]=c.useState(null),$=c.useRef(null),A=c.useRef(null),X=c.useRef(null),Z=c.useRef(null),[V,U]=c.useState(null),[se,de]=c.useState(null),ae=c.useCallback(K=>{var Te;if(X.current=K,de(K),(Te=Z.current)==null||Te.disconnect(),Z.current=null,!K)return;const ee=()=>U({w:Math.max(0,K.clientWidth-mc*2),h:Math.max(0,K.clientHeight-mc*2)});ee();const re=new ResizeObserver(ee);re.observe(K),Z.current=re},[]),[te,J]=c.useState(1),Q=c.useRef(te);Q.current=te;const G=c.useRef(null),fe=c.useCallback((K,ee)=>{const re=X.current,Te=Math.min(8,Math.max(.25,K)),Ct=Q.current;if(re&&Te!==Ct){const pt=re.getBoundingClientRect();G.current={prev:Ct,ax:((ee==null?void 0:ee.x)??pt.left+pt.width/2)-pt.left,ay:((ee==null?void 0:ee.y)??pt.top+pt.height/2)-pt.top,sl:re.scrollLeft,st:re.scrollTop}}J(Te)},[]);c.useLayoutEffect(()=>{const K=X.current,ee=G.current;if(!K||!ee)return;G.current=null;const re=te/ee.prev;K.scrollLeft=(ee.sl+ee.ax)*re-ee.ax,K.scrollTop=(ee.st+ee.ay)*re-ee.ay},[te]),c.useEffect(()=>{const K=se;if(!K)return;const ee=re=>{(re.ctrlKey||re.metaKey)&&(re.preventDefault(),fe(Q.current*Math.exp(-re.deltaY*.01),{x:re.clientX,y:re.clientY}))};return K.addEventListener("wheel",ee,{passive:!1}),()=>K.removeEventListener("wheel",ee)},[se,fe]);const Ee=c.useRef(null);c.useEffect(()=>{const K=re=>{const Te=Ee.current,Ct=X.current;!Te||!Ct||(Ct.scrollLeft=Te.sl-(re.clientX-Te.x),Ct.scrollTop=Te.st-(re.clientY-Te.y))},ee=()=>{Ee.current=null};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",ee),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",ee)}},[]);const[$e,Fe]=c.useState(!1),[Ie,he]=c.useState(()=>{const K=Number(window.localStorage.getItem(Fg));return Number.isFinite(K)&&K>0?jg(K):300}),we=c.useRef(null);c.useEffect(()=>{const K=re=>{const Te=we.current;Te&&he(jg(Te.startW+(re.clientX-Te.startX)))},ee=()=>{we.current&&(we.current=null,he(re=>(window.localStorage.setItem(Fg,String(re)),re)))};return window.addEventListener("mousemove",K),window.addEventListener("mouseup",ee),()=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",ee)}},[]);const[_e,ge]=c.useState(!1),[ke,ft]=c.useState(null),[At,Rr]=c.useState(!0),tn=c.useCallback(K=>{const ee=MT({rate:k,playing:S},K);T(ee.rate);const re=A.current;re&&(ee.playing&&!S&&re.play(),!ee.playing&&S&&re.pause())},[k,S]);c.useEffect(()=>{const K=A.current;if(!K)return;const ee=()=>C(!0),re=()=>C(!1);return K.addEventListener("play",ee),K.addEventListener("pause",re),()=>{K.removeEventListener("play",ee),K.removeEventListener("pause",re)}});const Zt=c.useCallback(()=>{if(z.current!==null)return;const K=window.setInterval(()=>{(async()=>{try{const re=await(await fetch("/api/render/status")).json();if(re.running||re.exitCode===null){F(Te=>({running:re.running,lines:re.lines??[],startedAt:re.startedAt??(Te==null?void 0:Te.startedAt)}));return}if(z.current!==null&&(window.clearInterval(z.current),z.current=null),re.exitCode===0){const Ct=await(await fetch("/api/production")).json(),pt=_g(Ct.renderProps);y(pt),I(!!Ct.canRender);const Fn=U$(Ct.overrides,t.current);if(Fn.load){const oo=f.current,nn=cg(Fn.load,pt);e.load(nn.doc),Pg(nn.unresolved),a(nn.unresolved);const ce=eM(J4(oo,nn.doc.captions));for(const be of ce)console.warn(`ossclip §137: ${be}`);u(ce)}else a([]),u([]);Fn.notifyDiscard&&r(!0),F(null)}else F({running:!1,lines:re.lines??[],failed:re.exitCode,cancelled:re.cancelled})}catch{z.current===null&&Zt()}})()},1e3);z.current=K},[]),Pn=c.useCallback(async()=>{const K=await fetch("/api/production");if(!K.ok)throw new Error(`GET /api/production failed: ${K.status}`);const ee=await K.json();if(L(ee.recent??[]),ee.noWorkdir){a([]),u([]),D(!0);return}const re=_g(ee.renderProps);y(re),O(ee.workdir??null),I(!!ee.canRender);const Te=cg(ee.overrides,re);e.load(Te.doc),Pg(Te.unresolved),a(Te.unresolved),u([]),fetch("/api/usage").then(async Fn=>E(Fn.ok?await Fn.json():null)).catch(()=>E(null));const pt=await(await fetch("/api/render/status")).json();pt.running&&(F({running:!0,lines:pt.lines??[],startedAt:pt.startedAt}),Zt())},[Zt]);c.useEffect(()=>{Pn().catch(K=>w(K instanceof Error?K.message:String(K)))},[]);const Nt=c.useCallback(async K=>{if(e.dirty&&!window.confirm("Unsaved edits will be lost — switch projects anyway?"))return null;try{const ee=await fetch("/api/workdir",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:K})}),re=await ee.json().catch(()=>({}));return ee.ok?(b(null),j(null),Y(null),F(null),J(1),y(null),D(!1),await Pn(),null):re.error??`open failed: ${ee.status}`}catch(ee){return ee instanceof Error?ee.message:String(ee)}},[e.dirty,Pn]),Kn=c.useMemo(()=>{if(!h)return{lines:[],dropped:[]};const K=h.baseCaptionLines??h.captionLines??[];return ej(K,Q4(e.doc.captions))},[h,e.doc.captions]),Ms=c.useMemo(()=>Ox(s),[s]),Xn=c.useMemo(()=>tM(Kn.dropped),[Kn]),to=Xn.join(`
|
|
163
|
+
`),pu=Xn.length>0&&to!==p;c.useEffect(()=>{if(Xn.length!==0)for(const K of Xn)console.warn(`ossclip §137: ${K}`)},[to]);const ve=c.useMemo(()=>{if(!h)return null;const K=(h.baseSceneCues??h.sceneCues??[]).filter(ce=>ce.kind!=="plain"),ee=h.baseTheme??h.theme??_F,{cues:re}=jd(K,e.doc),{cues:Te}=XF(re,e.doc),Ct=lj(Te,{outputDurationSec:h.outputDurationSec,clipStarts:(h.spans??[]).map(ce=>ce.outIn)}),pt=gp(Ct,e.doc.splits),{cues:Fn}=jd(pt,e.doc),{cues:oo}=vx(Fn,e.doc);let nn=P?oo.map(ce=>ce.id===P.sceneId?{...ce,video:{...ce.video,...P.patch}}:ce):oo;return B&&(nn=nn.map(ce=>ce.id===B.sceneId?{...ce,graphicRect:B.rect}:ce)),{...h,sceneCues:nn,captionLines:Kn.lines,theme:tj(ee,e.doc),captionsHidden:h.captionsHiddenByFlag===!0||e.doc.captionsHidden===!0,videoFileName:`/media/${h.videoFileName}`}},[h,e.doc,P,B,Kn]),$s=()=>{Z$({dirty:e.dirty,renderRunning:(_==null?void 0:_.running)===!0,save:e.save,onBlocked:()=>i(!0),onSaveError:K=>w(K)})},mu=c.useCallback(async()=>{try{e.dirty&&await e.save();const K=await fetch("/api/render",{method:"POST"});if(!K.ok){const ee=await K.json().catch(()=>({}));throw new Error(ee.error??`render failed to start: ${K.status}`)}F({running:!0,lines:[],startedAt:Date.now()}),Zt()}catch(K){w(K instanceof Error?K.message:String(K))}},[e,Zt]),ui=c.useMemo(()=>{if(!h)return[];const K=(h.baseSceneCues??h.sceneCues??[]).filter(ee=>ee.kind!=="plain");return Y$(K,e.doc)},[h,e.doc]),vn=c.useMemo(()=>x?(ve==null?void 0:ve.sceneCues.find(K=>K.id===x.sceneId))??ui.find(K=>K.id===x.sceneId)??null:null,[ve,x,ui]),hu=c.useMemo(()=>{if(!vn||!ve)return;const K=ve.captionLines.filter(re=>re.start<vn.endSec&&re.end>vn.startSec).flatMap(re=>re.words).filter(re=>re.start<vn.endSec&&re.end>vn.startSec).map(re=>re.text);if(K.length===0)return;const ee=K.join(" ");return ee.length>90?`${ee.slice(0,90)}…`:ee},[vn,ve]);if(v)return d.jsx("div",{style:pc,children:d.jsxs("div",{style:{padding:24,color:"#FF5C5C",fontFamily:"ui-monospace, monospace"},children:["Couldn't load the production: ",v]})});if(!ve)return d.jsx("div",{style:pc,children:M?d.jsx(Eg,{recent:N,required:!0,onOpen:Nt,onClose:()=>{}}):d.jsx("div",{style:{padding:24,color:"#9A9AA3"},children:"Loading production…"})});const no=ve.settings.width/ve.settings.height,ro=V?Math.max(220,Math.min(V.w,V.h*no)):380,gu=Math.round(ro*te);return d.jsxs("div",{style:pc,children:[d.jsxs("div",{style:Q$,children:[d.jsx("span",{style:J$,children:"ossclip"}),H?d.jsx("span",{"data-testid":"workdir-label",style:e5,title:H,children:H.split("/").filter(Boolean).slice(-2).join("/")}):null,d.jsxs("div",{style:{display:"flex",gap:8},children:[d.jsx("button",{"data-testid":"open-button",style:Tt,onClick:()=>D(!0),title:H?`Open another project — currently ${H}`:"Open another project",children:"Open"}),d.jsx("button",{"data-testid":"undo-button",style:Tt,onClick:()=>e.undo(),disabled:!e.canUndo,title:"Undo (⌘Z)","aria-label":"Undo",children:d.jsx(G$,{})}),d.jsx("button",{"data-testid":"redo-button",style:Tt,onClick:()=>e.redo(),disabled:!e.canRedo,title:"Redo (⌘⇧Z)","aria-label":"Redo",children:d.jsx(q$,{})}),d.jsx("button",{"data-testid":"transcript-toggle",style:{...Tt,...$e?{borderColor:"#5b8cff"}:{}},onClick:()=>Fe(K=>!K),title:"Find and retype caption words across the whole transcript",children:"Transcript"}),d.jsx("button",{style:{...Tt,...e.dirty?n5:{}},onClick:$s,disabled:!e.dirty||(_==null?void 0:_.running)===!0,title:(_==null?void 0:_.running)===!0?"Can't save while a render is running":void 0,children:"Save"}),d.jsx("button",{"data-testid":"render-button",style:Tt,onClick:()=>void mu(),disabled:!R||(_==null?void 0:_.running)===!0,title:R?"Saves if needed, then replays the last completed produce command — pipeline flags come from that run; your saved edits apply on top":"No command.json in this workdir — run `ossclip produce` once in a terminal; it records the invocation and Render replays it",children:_!=null&&_.running?"Rendering…":"Render"})]}),d.jsx("span",{style:{...t5,color:e.dirty?"#FFE14D":"#5FBF77"},...e.dirty?{"data-testid":"dirty"}:{},children:e.dirty?"● Unsaved changes":"✓ Saved"}),d.jsx("button",{"data-testid":"shortcuts-button",style:{...Tt,padding:"7px 10px"},onClick:()=>ge(K=>!K),title:"Keyboard shortcuts (?)",children:"?"})]}),_e?d.jsx(e$,{onClose:()=>ge(!1)}):null,ke?d.jsx(d$,{plan:ke,onCancel:()=>ft(null),onConfirm:K=>{K==="graphic"?e.hideScene(ke.sceneId):e.cutChunk(ke.startSec,ke.endSec),ft(null)}}):null,M?d.jsx(Eg,{recent:N,required:!1,onOpen:Nt,onClose:()=>D(!1)}):null,_?d.jsxs("div",{"data-testid":"render-log",style:{...d5,borderColor:_.failed!==void 0?"#FF5C5C":"#2A2A33"},children:[_.failed!==void 0?d.jsxs("div",{style:{color:_.cancelled?"#9A9AA3":"#FF5C5C",marginBottom:4},"data-testid":_.cancelled?"render-cancelled":"render-failed",children:[_.cancelled?"render cancelled":`render failed (exit ${_.failed})`,d.jsx("button",{style:{...Tt,marginLeft:10,padding:"2px 8px"},onClick:()=>F(null),children:"Dismiss"})]}):null,_.running?d.jsxs("div",{"data-testid":"render-status",style:f5,children:[d.jsx("style",{children:"@keyframes ossclip-spin { to { transform: rotate(360deg) } }"}),d.jsx("span",{style:p5,"aria-hidden":!0}),d.jsxs("span",{style:{color:"#EDEDF2"},children:["rendering",_.startedAt!=null?` · ${H$(_.startedAt,Date.now())}`:"",ya(_.lines)!==null?` · ${ya(_.lines)}%`:""]}),ya(_.lines)!==null?d.jsx("div",{style:m5,children:d.jsx("div",{"data-testid":"render-progress-bar",style:{...h5,width:`${ya(_.lines)}%`}})}):null,d.jsx("button",{"data-testid":"render-cancel",style:{...Tt,padding:"2px 8px"},onClick:()=>void fetch("/api/render/cancel",{method:"POST"}),children:"Cancel"}),d.jsx("button",{"data-testid":"render-logs-toggle",style:{...Tt,padding:"2px 8px"},onClick:()=>Rr(K=>!K),title:At?"Collapse the log":"Expand the log",children:At?"▾ logs":"▸ logs"})]}):null,At?d.jsxs(d.Fragment,{children:[W$(_.lines).map(K=>d.jsx("div",{"data-testid":"render-pinned",style:{color:"#C9C9D4"},children:K},K)),d.jsx(X$,{lines:_.lines})]}):null]}):null,n?d.jsxs("div",{"data-testid":"reanchor-notice",style:wa,children:["Render re-anchored your saved cuts and splits — edits made while it ran were dropped, not merged, to avoid overwriting that anchor.",d.jsx("button",{style:{...Tt,marginLeft:10,padding:"2px 8px"},onClick:()=>r(!1),children:"Dismiss"})]}):null,Ms.length>0||l.length>0?d.jsxs("div",{"data-testid":"caption-migration-notice",style:wa,children:[[...Ms,...l].map((K,ee)=>d.jsx("div",{children:K},ee)),d.jsx("button",{style:{...Tt,marginLeft:10,padding:"2px 8px"},onClick:()=>{a([]),u([])},children:"Dismiss"})]}):null,pu?d.jsxs("div",{"data-testid":"caption-dropped-notice",style:wa,children:[Xn.map((K,ee)=>d.jsx("div",{children:K},ee)),d.jsx("button",{style:{...Tt,marginLeft:10,padding:"2px 8px"},onClick:()=>m(to),children:"Dismiss"})]}):null,o?d.jsxs("div",{"data-testid":"save-blocked-notice",style:wa,children:["Can't save while a render is running — it's writing its own overrides.json right now. Wait for it to finish (or cancel it) before saving.",d.jsx("button",{style:{...Tt,marginLeft:10,padding:"2px 8px"},onClick:()=>i(!1),children:"Dismiss"})]}):null,d.jsxs("div",{style:r5,children:[$e?d.jsxs(d.Fragment,{children:[d.jsx(OM,{baseLines:(h==null?void 0:h.baseCaptionLines)??(h==null?void 0:h.captionLines)??[],liveLines:ve.captionLines,fps:ve.settings.fps,playerRef:A,edits:e,width:Ie}),d.jsx("div",{"data-testid":"transcript-divider",style:o5,title:"Drag to resize the transcript pane",onMouseDown:K=>{K.preventDefault(),we.current={startX:K.clientX,startW:Ie}}})]}):null,d.jsxs("div",{style:i5,children:[d.jsx("div",{ref:ae,style:s5,onMouseDown:K=>{if(K.altKey||K.button===1){K.preventDefault();const ee=X.current;ee&&(Ee.current={x:K.clientX,y:K.clientY,sl:ee.scrollLeft,st:ee.scrollTop})}},children:d.jsx("div",{style:{margin:"auto",padding:mc},children:d.jsxs("div",{ref:$,"data-testid":"stage","data-playing":S?"true":"false","data-rate":k,style:{position:"relative",display:"inline-block"},children:[d.jsx(IT,{ref:A,component:U4,inputProps:ve,durationInFrames:Math.max(1,Math.round(ve.outputDurationSec*ve.settings.fps)),fps:ve.settings.fps,compositionWidth:ve.settings.width,compositionHeight:ve.settings.height,style:{width:gu},controls:!0,clickToPlay:!1,playbackRate:k}),d.jsx(uM,{stageRef:$,selection:x,onSelect:b,edits:e,onSave:$s,settings:ve.settings,cues:ve.sceneCues,playerRef:A,cue:vn,onTransport:tn,onVideoPreview:j,onGraphicPreview:Y,onToggleHelp:()=>ge(K=>!K),onRequestDelete:ft}),d.jsx("button",{"data-testid":"rate-chip",onClick:()=>tn("L"),title:"Playback rate — click to speed up (J/K/L on the keyboard)",style:g5,children:k<0?`◂◂ ${Math.abs(k)}×`:`${k}×`})]})})}),d.jsxs("div",{style:a5,children:[d.jsx("button",{"data-testid":"view-zoom-out",style:hc,onClick:()=>fe(te/2),disabled:te<=.25,title:"Zoom the preview out — below 100% shrinks under the fitted size",children:"−"}),d.jsxs("span",{"data-testid":"view-zoom-level",style:l5,children:[Math.round(te*100),"%"]}),d.jsx("button",{"data-testid":"view-zoom-in",style:hc,onClick:()=>fe(te*2),disabled:te>=8,title:"Zoom the preview in — a viewing magnifier, it never edits the video",children:"+"}),d.jsx("button",{"data-testid":"view-zoom-fit",style:{...hc,width:"auto",padding:"0 8px"},onClick:()=>fe(1),disabled:Math.abs(te-1)<.001,title:"Fit the preview to the window",children:"fit"}),d.jsx("span",{style:u5,children:"⌥-drag pans"})]})]}),d.jsx("div",{style:c5,children:d.jsx(dM,{selection:x,cue:vn,frame:{width:ve.settings.width,height:ve.settings.height},allSceneIds:ve.sceneCues.map(K=>K.id),edits:e,onSelect:b,resolvedTheme:ve.theme,anchorText:hu,onVideoPreview:j,runInfo:g,captionsHiddenByFlag:(h==null?void 0:h.captionsHiddenByFlag)===!0})})]}),d.jsx(kM,{cues:ve.sceneCues,ghosts:ui,cuts:e.doc.cuts,spans:ve.spans??[],durationSec:ve.outputDurationSec,fps:ve.settings.fps,playerRef:A,selection:x,onSelect:b,edits:e,videoSrc:ve.videoFileName,toSourceSec:K=>{var ee;for(const re of ve.spans??[])if(K>=re.outIn&&K<re.outOut)return re.srcIn+(K-re.outIn);return((ee=(ve.spans??[])[0])==null?void 0:ee.srcIn)??K}})]})},X$=({lines:e})=>{const t=c.useRef(null),n=c.useRef(!0);return c.useEffect(()=>{const r=t.current;r&&n.current&&(r.scrollTop=r.scrollHeight)},[e]),d.jsx("div",{ref:t,"data-testid":"render-tail",onScroll:r=>{const o=r.currentTarget;n.current=o.scrollTop+o.clientHeight>=o.scrollHeight-8},style:{maxHeight:220,overflowY:"auto"},children:e.map((r,o)=>d.jsx("div",{children:r},o))})},G$=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[d.jsx("path",{d:"M9 14 4 9l5-5"}),d.jsx("path",{d:"M4 9h10.5a5.5 5.5 0 0 1 0 11H11"})]}),q$=()=>d.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.4",strokeLinecap:"round",strokeLinejoin:"round",style:{display:"block"},children:[d.jsx("path",{d:"m15 14 5-5-5-5"}),d.jsx("path",{d:"M20 9H9.5a5.5 5.5 0 0 0 0 11H13"})]}),pc={fontFamily:"'Inter', system-ui, sans-serif",background:"#0B0B0E",color:"#EDEDF2",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column"},Q$={display:"flex",alignItems:"center",gap:14,padding:"10px 20px",borderBottom:"1px solid #1E1E24",background:"#111116"},J$={fontWeight:800,fontSize:14,letterSpacing:"0.02em",color:"#FFE14D",marginRight:8},e5={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#6a6a75",maxWidth:260,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t5={fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",marginLeft:"auto"},Tt={fontSize:12,fontWeight:600,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:6,padding:"7px 12px",cursor:"pointer"},n5={background:"#FFE14D",color:"#0B0B0E",border:"1px solid #FFE14D"},r5={display:"flex",flex:1,minHeight:0},mc=32,Fg="ossclip.transcriptWidth",jg=e=>Math.min(640,Math.max(220,e)),o5={width:5,flexShrink:0,cursor:"col-resize",background:"#1E1E24",borderLeft:"1px solid #2A2A33"},i5={position:"relative",flex:1,minWidth:0},s5={position:"absolute",inset:0,display:"flex",overflow:"auto"},a5={position:"absolute",top:10,left:10,zIndex:6,display:"flex",alignItems:"center",gap:6,padding:"4px 6px",background:"rgba(17,17,22,0.85)",border:"1px solid #2A2A33",borderRadius:6},hc={width:22,height:18,fontSize:12,lineHeight:1,color:"#EDEDF2",background:"#1A1A21",border:"1px solid #2A2A33",borderRadius:4,cursor:"pointer",padding:0},l5={fontSize:10,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",minWidth:34,textAlign:"center"},u5={fontSize:10,color:"#55555f",userSelect:"none"},c5={width:260,flexShrink:0,borderLeft:"1px solid #1E1E24",background:"#111116",overflowY:"auto"},d5={fontSize:11,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#9A9AA3",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",whiteSpace:"pre-wrap",flexShrink:0},wa={display:"flex",alignItems:"center",fontSize:12,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"#0F0F14",borderBottom:"1px solid #2A2A33",padding:"6px 20px",flexShrink:0},f5={display:"flex",alignItems:"center",gap:10,marginBottom:4},p5={width:12,height:12,flexShrink:0,border:"2px solid #2A2A33",borderTopColor:"#FFE14D",borderRadius:"50%",animation:"ossclip-spin 0.8s linear infinite"},m5={flex:1,maxWidth:260,height:4,background:"#1E1E24",borderRadius:2,overflow:"hidden"},h5={height:"100%",background:"#FFE14D",borderRadius:2,transition:"width 0.6s ease"},g5={position:"absolute",top:8,right:8,zIndex:5,fontSize:11,fontWeight:700,fontFamily:"ui-monospace, 'SF Mono', monospace",color:"#FFE14D",background:"rgba(11,11,14,0.75)",border:"1px solid #2A2A33",borderRadius:6,padding:"3px 8px",cursor:"pointer"};gc.createRoot(document.getElementById("root")).render(d.jsx(ne.StrictMode,{children:d.jsx(K$,{})}));
|